# Models to Identify Small Brain White Matter Hyperintensity Lesions
## 4 Results
### Segmentation Results
#### 4.2.3 YOLO Model for Detecting WMH Lesions  
In this first experiment, we train the model for only lesion identification. The data used were composed of 2850 images. Two pre-trained models were used: \"yolov8n-seg.pt\" and \"yolov8x-seg.pt\". In this case, the best results were obtained with the \"yolov8n-seg.pt\" model.  
The confusion matrix in Figure 16 indicates that 24% of the backgrounds are detected as lesions, and 76% of the lesions are not detected. This suggests a tendency towards over-detection because the model has a good sensitivity for lesions when they are present in the image but does not have enough specificity. This suggests that while the model is highly accurate in confirming lesions, it needs significant improvement in reducing false positives and, more critically, in increasing its sensitivity to ensure fewer lesions are missed. Figure 17 presents graphs of the performance of the proposed model for the detection and localization of the lesions.  
Figure 16: Confusion matrix of the YOLO detection model using the pre-trained “yolov8n-seg.pt” model. On the right side, and below it, are some examples of the classification of the lesions.  
Figure 15: Some examples of segmentation lesion predictions using the SAM model with 25 epochs of training and different processors. (**a**) MR Image. (**b**) Ground truth mask. (**c**) Predicted mask. The orange areas correspond to the WMH lesions.  
Figure 17 illustrates the analysis of the training and validation function loss and metrics of precision and recall of the lesion identification. Here are more details about it:  
* The curves of \"train/box_loss\" and \"val/box_loss\" show the training and validation loss related to the bounding box predictions. As the loss function decreases, it signifies that the network is effectively learning and enhancing its capability to precisely predict well-fitted bounding boxes.
* The \"train/seg_loss\" and \"val/seg_loss\" represents the training and validation segmentation loss.
* The \"train/cls_loss\" and \"val/cls_loss\" refer to training classification loss, which evaluates the classification accuracy of each predicted bounding box.
* The \"train/dfl_loss\" and \"val/dfl_loss\" indicate the training distribution focal loss, indicating the model's confidence in predictions.
* The graph of \"metrics/precision(B)\" and \"metrics/precision(M)\" indicates the precision for bounding box predictions and precision for mask predictions, respectively.
* The \"metrics/recall(B)\" and \"metrics/recall(M)\" are the recall for bounding box predictions and recall for mask predictions, respectively. This indicates the ability to identify true positive masks.
* The \"metrics/mAP50(B)\" and \"metrics/mAP50(M)\" are the mean average precision at 50% IoU (Intersection over Union) for bounding boxes and for masks, respectively.
* The \"metrics/mAP50-95(B)\" and \"metrics/mAP50-95(M)\" are the mean average precision at IoU thresholds from 50% to 95% for bounding boxes and for masks, respectively.  
The analysis detailed in Figure 17 shows that the training and validation loss for bounding box predictions, segmentation, and classification all show a decrease, indicating effective learning and good generalization. In this scenario, the desirable trend of the function loss is to decrease toward zero as the numbers of epochs increase. However, loss fluctuations indicate that fine-tuning may need further refinement.  
Precision and recall metrics for masks and bounding boxes show steady upward trends, which reflect an increase in accuracy and true positive rates. The mean average precision metrics highlight enhanced detection and segmentation performance across various IoU thresholds.