# Region-of-Interest Optimization for Deep-Learning-Based Breast Cancer Detection in Mammograms
## 2 Materials and Methods
### Metrics  
Various metrics were employed to evaluate the performance of the deep learning model for breast cancer detection using mammography, which captured different aspects of the classification task. The used metrics were the following:  
* Average precision (AP) is a performance metric that provides a summary of the precision-recall curve. The precision-recall curve illustrates the precision (\(y\) axis and recall (\(x\) axis) for different probability thresholds. Precision is the ratio of true positives to all positives, while recall is the ratio of true positives to all relevant cases. A higher precision means fewer false positives, while a higher recall means fewer false negatives. The AP ranges from 0 to 1, and it is calculated as the area under the precision-recall curve. A higher AP indicates better performance of the model. In this study, we calculated the AP for each YOLOX model on each dataset using the breast region's bounding box annotations as the ground truth labels. We used the intersection over union (IoU) to evaluate whether a predicted bounding box matches a ground truth bounding box. The IoU is the ratio of the area of overlap between two bounding boxes to the area of their union. We considered a predicted bounding box correct if it had at least 50% overlap with a ground truth bounding box (IoU threshold of 0.5). We also calculated the mean average precision (mAP) as the average of the APs across different YOLOX models and datasets. * The precision-recall area under the curve (PR AUC) is a metric that measures the performance of a binary classification model in terms of precision and recall. Precision is the ratio of true positives to the sum of true positives and false positives, while recall is the ratio of true positives to the sum of true positives and false negatives. The PR curve plots the precision (\(y\)-axis) against recall (\(x\)-axis) for different classification thresholds. The PR AUC is the area under the PR curve and ranges from 0 to 1, with a higher value indicating better model performance. This metric is particularly useful when dealing with imbalanced datasets, where positive cases are much fewer than negative cases, as it focuses on the ability of the model to identify true positives among all predicted positives. * ROC AUC is the area under the receiver operating characteristic curve. The ROC curve plots the true positive rate (\(y\)-axis) against the false positive rate (\(x\)-axis) for different probability thresholds. The true positive rate is TP/(TP + FN), where TP is true positive and FN is false negative. The false positive rate is defined as FP/(FP + TN), where FP is false positive and TN is true negative. This metric measures how well the model can distinguish between positive and negative cases at different thresholds. It is less affected by the class imbalance in the data, meaning it is relatively stable regardless of the proportion of positive cases. * Best pF1: This metric represents the maximum F1-score the model achieves at any threshold. The F1-score is the harmonic mean of precision and recall, defined as \(2*\) (precision \(*\) recall)/(precision + recall). The F1 score balances the two aspects of the classification task. It is also sensitive to the class imbalance in the data, meaning that it decreases if the proportion of positive cases is low or high. * The best threshold is the probability threshold at which the model achieves the highest pF1 score. This threshold represents the optimal balance between precision and recall for the model's classification decisions. Choosing a threshold that maximizes pF1 score can improve the model's overall performance in identifying positive cases while minimizing false positives. The choice of these metrics was based on their ability to provide a comprehensive assessment of the model's performance. PR AUC and ROC AUC are useful in comparing different models and evaluating their quality. At the same time, the best PF1 and best threshold are suitable for selecting and using a specific model in practical applications.