## 4 Methodology
### Evaluation Metrics
#### 4.5.1 Object Detection  
To evaluate object detection models, the main ways of measuring performance are based on accuracy. The most commonly used metric for evaluating the accuracy of object detection models is mean Average Precision (mAP) [40; 41; 42].  
A True Positive (TP) is the correct detection of an annotated object (ground truth). A False Positive (FP) is the incorrect detection of a non-existent object or a wrong detection of an existing object. A False Negative (FN) is an undetected object. In addition, a True Negative (TN) is also used for machine learning models. For machine learning models, a TN occurs when the model correctly predicts that an instance does not belong to a certain class. In other words, the model correctly classified a negative sample; that is, a sample that does not belong to the class of interest. As there is an infinite number of bounding boxes that should not be detected within a given image in object detection, a TN is not employed [42].  
It is also important to define what is considered a \"correct detection\" and an \"incorrect detection\" along with the above concepts. For this, the Intersection over Union (IoU) is used. The IoU is a measure based on the Jaccard similarity, a similarity coefficient for two datasets [43]. For object detection, the IoU measures the overlapping area between the predicted bounding box and the real bounding box or ground truth, divided by the union area between them, given by Equation (1).  
\[IoU=\frac{area(B_{p}\cap B_{gt})}{area(B_{p}\cup B_{gt})} \tag{1}\]  
When comparing IoU for a certain threshold \(t\), it is possible to classify detection as correct or incorrect. If IoU \(>t\), the detection is considered correct, and for IoU \(<t\), it is incorrect. In the literature, the most used threshold values \(t\) are 0.5 and the mean of the range from 0.5 to 0.95, varying by 0.05.  
The evaluation methods used for object detection models are based on precision and recall. Precision measures the model's ability to identify only relevant objects. It is the percentage of correct predictions and is given by Equation (2) [42].  
\[P=\frac{TP}{TP+FP}=\frac{TP}{\text{All detections}} \tag{2}\]  
Recall measures the model's ability to find all relevant cases (all true bounding boxes). It is the percentage of correct predictions among all true objects and is given by Equation (3) [42].  
\[R=\frac{TP}{TP+FN}=\frac{TP}{\text{All ground truth}} \tag{3}\]  
An object detector is considered good when precision and recall values remain high even with an increase in the threshold \(t\), while precision remains high for different recall values. AP is the average precision for each recall level. For each class, precision is calculated at various threshold \(t\) levels. AP is calculated as the area under the P x R curve obtained by plotting precision against recall and can be obtained using Equation (4) [42].  
\[AP=\frac{1}{11}\sum_{r=i\in 0.01,...,0.9,1}\text{max}(P(R_{i})) \tag{4}\]  
Finally, mAP is the average of AP for all object detector classes, given by Equation (5) [42].  
\[mAP=\frac{1}{N}\sum_{i=1}^{N}AP_{i} \tag{5}\]  
where \(AP_{i}\) is the AP for the i-th class, and N is the total number of classes. This work uses [EMAIL_ADDRESS] as a metric, with mAP with a threshold equal to 0.5, and [EMAIL_ADDRESS]:0.95, which is the mean of mAP for the threshold range from 0.5 to 0.95, with a step of 0.05.