# Accurate MRI-Based Brain Tumor Diagnosis: Integrating Segmentation and Deep Learning Approaches
## 2 Materials and Methods
This step aims to optimise the trade-off  
Figure 2: Proposed framework of tumour detection and segmentation. between computational speed and model accuracy. The integrated system outputs both the classification results--indicating the presence or absence of tumours--and the segmented images visually highlighting the tumour regions. Several key performance metrics are commonly used in the context of a binary classification problem, such as tumour detection. True Positive (TP) represents the number of correctly identified positive samples, meaning those with tumours. False Positive (FP) refers to the number of incorrectly identified positive samples or those without tumours. True Negative (TN) denotes the number of correctly identified negative samples or those without tumours. Conversely, False Negative (FN) indicates the number of incorrectly identified negative samples or those with tumours. Accuracy, as described in a relevant equation, represents the proportion of correctly identified samples in the data. These metrics provide a comprehensive assessment of the model's performance in distinguishing between the presence and absence of tumours in the given dataset [1]. Equations (5)-(9) describe the commonly used evaluation criteria for this study:  
\[Accuracy=\frac{(Tp-Tn)}{(Tp+Fp+Tn+Fn)} \tag{3}\]  
Precision is a performance metric representing the proportion of correctly identified positive samples among all those identified as positive by the model. Recall is the ratio of correctly identified positive samples to the total number of positive samples. The F1 score is a composite metric combining precision and recall into a single value. \[Precision=\frac{Tp}{(Tp+Fp)} \tag{4}\]  
\[Recall=\frac{Tp}{(Tp+Fn)} \tag{5}\]  
\[F1-score=\frac{2\left(Precision\times Recall\right)}{(Precision+Recall)} \tag{6}\]  
The Dice coefficient is like the Intersection over Union (IoU) and ranges from 0 to 1, with 1 indicating the highest similarity between the predicted segmentation and the ground truth. This coefficient evaluates the effectiveness of automated probabilistic fractional  
Figure 3: Fine-tuned MobileNetV2. segmentation of MR images and the accuracy of manual segmentations regarding spatial overlap. \[SC=\frac{Tp}{\Big{(}\frac{1}{2}\Big{)}(2 Tp+Fp+Fn)} \tag{7}\]  
Intersection over Union (IoU) is a performance metric used to evaluate the accuracy of object detection models. It compares the overlap between the predicted positive regions (including both true positives and false positives) and the actual positive regions (including both true positives and false negatives) in the dataset. The intersection of these sets represents the true positive (Tp) detections, while the union encompasses the true positives, false positives (Fp), and false negatives (Fn). \[SF(x)=\frac{1}{1+exp\ (-x)}\]0  
The Similarity Index (SI) is a performance metric used to assess the accuracy of tumour detection models. It measures the similarity between the ground truth annotations representing the actual tumour regions and the model's segmentation output, which identifies the predicted tumour regions. A higher SI value indicates a closer match between the predicted segmentation and the ground truth, signifying a more accurate detection of the tumour areas. \[SF(x)=\frac{1}{1+exp\ (-x)}\]1  
These evaluation metrics are essential for assessing the performance of brain tumour detection and classification models. They measure the models' ability to correctly identify positive (tumour-containing) and negative (tumour-free) samples and differentiate between different types of tumours. Metrics such as True Positive, False Positive, True Negative, False Negative, Accuracy, Precision, Recall, F1 score, Intersection over Union, and Similarity Index comprehensively evaluate the model's performance in various tumour detection and classification aspects.