# Brain Tumor Detection with Deep Learning Methods' Classifier Optimization Using Medical Images
## 3 Material and Method
### Evaluation Criteria  
Artificial intelligence applications work on the principle of trial, feedback, correction and result. Before the research, a model is created and feedback on the validity of the model is checked. Afterwards, necessary improvements are made and the model is expected to reach the expected accuracy. Test results are measured with different metric values. The performance of the model is determined according to the results obtained from here. Evaluation criteria play a very important role in comparing different models and distinguishing results.  
Various performance measures are used to estimate success rates as a result of classification processes. The most well-known criterion used in classification problems is the accuracy (ACC) metric. However, the accuracy criterion does not always provide certainty when used alone. Other measurement metrics need to be used to make a more precise and reliable analysis [42].  
When the studies in the literature are examined, besides the accuracy measurement metric, precision (Prec), sensitivity (Recall) and F1 score (F1) metrics were observed to be used. These values can be calculated in matrix form by using the confusion matrix. True Positive (TP), True Negative (TN), False Positive (FP) and False Negative (FN) values can be calculated in the classification results' confusion matrices [43]. Table 2 shows the components of the confusion matrix.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & & \multicolumn{2}{c}{**Predicted Value**} \\ \cline{3-4}  & & **Positive** & **Negative** \\ \hline \multirow{3}{*}{**Model**} & Positive & True Positive (TP) & False Negative (FN) \\  & Negative & False Positive (FP) & True Negative (TN) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Confusion matrix.  
\[\text{Recall}=\frac{TP}{TP+FN}\]  
\[\text{F1}-\text{Score}=\frac{2\times Precision\times Recall}{Precision+Recall}\]  
A confusion matrix is a table that is often used to numerically determine the performance of a classification method on a test dataset where the actual values are known. The results of the confusion matrix on the data sets we used in the study are as follows:  
TP (True Positive): It means sick to patient.  
FP (False Positive): It means sick to someone who is not sick.  
TN (True Negative): It means not sick to those who are not sick.  
FN (False Negative): Saying that the sick person is not sick.  
Here the sensitivity metric gives the percentage of correctly identifying those who are sick. The precision metric shows in percentage terms how many of those we call sick are actually sick. It can be seen that two important metrics, sensitivity and precision, are interdependent. The F1 score is used to eliminate the ambiguity that may arise here. In the F1 score calculation, the harmonic mean is used instead of the arithmetic mean. In some cases, it may be more advantageous to detect the sensitivity metric correctly than incorrectly. It is more acceptable to misjudge a patient with cancer and call someone who does not have cancer to the hospital, rather than failing to detect a patient with cancer and causing their death. However, we can call everyone to the hospital and find all the cancer cases, but this can lead to many false positives. There is a similar situation with the certainty metric. It recommends being absolutely sure before calling someone sick. If a person is diagnosed as sick and turns out to be really sick, the accuracy is 100%, but if the rest of the people are not identified, there is a big mistake.  
Applications made in the Python 3.12.1 language were developed in open source libraries and the Google Colab platform, which provides free GPU support, and this software language was used in classifying the created models and distinguishing the results. Our study was conducted on a laptop computer with Apple M1 pro processor, 8-core CPU, 14-core GPU, 16-core Neural Engine and 200 GBps memory bandwidth, 3024 \(\times\) 1964 resolution at 254 pixels per inch, 32 GB combined memory and 1 TB SSD.