## 2 Materials and Methods
### Evaluation Procedure and Metrics  
In this research, the YOLO v4 deep learning system evaluated the model performance using the confusion matrix terminology [26] shown below:  
* True positive (\(TP\)): it occurs when an object category is detected, and the image contains this object class in the indicated position.
* False positive (\(FP\)): it means that an object category is detected, but this object class is not in the position indicated in the image.
* False negative (\(FN\)): it occurs when an object category is in a specific position, and the model cannot detect it.
* True negative (\(TN\)): no object category is in that specific position, and the model did not detect any object.  
The annotation and the bounding box's expected shape did not match perfectly during object detection, so an additional parameter was required to calculate the mentioned variables. This parameter was called intersection over union (IoU) and determined the required relative overlap \(\alpha\) of the shape of the bounding boxes \(B_{p}\) and the ground truth \(B_{g}t\) as defined by [27] in Equation (7):  
\[\alpha=\frac{area\left(B_{p}\cap B_{gt}\right)}{area\left(B_{p}\cup B_{gt} \right)} \tag{7}\]  
The default value of this parameter is 0.5 [28]. Using the terminology of the confusion matrix and IoU, the following metrics were calculated [26]:  
\[Recall=\frac{TP}{TP+FN} \tag{8}\]  
\[Precision=\frac{TP}{TP+FP} \tag{9}\]  
Average precision (\(AP\)) measures an object detector's performance related to a specific category in the object detection task. The procedure to calculate the \(AP\) was as follows:  
1. All the detections were sorted based on the confidence score.
2. The detections with the highest confidence score were matched to the ground truth until a recall \(r\) higher than the expected \(r\) level was reached.
3. Precision values based on each level of recall \(r\) were calculated.
4. The precision \(P_{interp}\) was interpolated by the maximum precision obtained for a recall level \(r\).  
The precision \(P_{interp}\) is defined by [28] in Equation (10):  
\[P_{interp}(r)=\underset{r:r\geq r}{max}p(r) \tag{10}\]  
where \(p(r)\) is the measured precision at recall \(r\).  
\begin{table}
\begin{tabular}{l l} \hline \hline  & **Parameters** & **Value** \\ \hline Input size & 416 \(\times\) 416 \\ Learning rate & \(1\times 10^{-3}\) \\ Batch size & 64 \\ Categories & 7 \\ Iterations & 5000 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Parameters of the YOLO v4 face masks leakage model.  
For this research, we used eleven levels of recall \(r\in\{0,0.1;...,1\}\) with the same distance among them. Finally, we used \(AP\), the arithmetic mean of the precision \(P_{interp}\) at different levels of _Recall_[28] as shown in Equation (11):  
\[AP=\frac{1}{11}\sum_{r\in\{0,0.1;...,1\}}P_{interp}(r). \tag{11}\]  
Furthermore, the mean average precision (mAP) (Equation (12)) is the mean of the AP values for each object category [29], and the higher the value, the better the result of detecting temperature distributions.  
\[mAP=\frac{\sum_{c=1}^{C}AP(c)}{C} \tag{12}\]  
where \(C\) is the number of detection categories. For the specific case of this study, \(C=7\).