## 2 Materials and Methods
### Data Set  
The thermal images used extracts from previously recorded videos. The whole of this study had a total of 172 images with 618 pixels (horizontal) \(\times\) 450 pixels (vertical) resolution, 138 of which (80%) were labeled as training images, and 34 (20%) remained as test data. We used _Labellng_ to manually label these 172 images, ensuring that each image's temperature focus was located in the labeling box's center. However, to improve detection, we opted for the generation of artificial information.  
The basic generation of artificial information was carried out as follows:  
\begin{table}
\begin{tabular}{l l l} \hline \hline
**Face Mask** & **Mean Pixels** & **Leakeage Percentage** \\ \hline Without a mask & 46.6 & 100\% \\
100\% cotton & 32.43 & 69\% \\
100\% polyester & 28.37 & 60\% \\
3-layer pleated & 18.28 & 39\% \\
98\% cotton & 12.49 & 26\% \\ KN95 & 11.99 & 25\% \\ Neoprene & 22.55 & 25\% \\ Mask without any leak & 0 & 0\% \\ \hline \hline \end{tabular}
\end{table}
Table 2: Summary of information for each face mask.  
Figure 3: Temperature’s temporal behavior by product.  
Reflection X: each image was flipped vertically (Equation (2)); reflection Y: each image was flipped horizontally (Equation (3)); reflection XY: each image was flipped vertically and horizontally (Equation (4)).  
\[\left[\begin{array}{c}x^{\prime}\\ y^{\prime}\end{array}\right]=\left[\begin{array}{cc}1&0\\ 0&-1\end{array}\right]\left[\begin{array}{c}x\\ y\end{array}\right] \tag{2}\]  
\[\left[\begin{array}{c}x^{\prime}\\ y^{\prime}\end{array}\right]=\left[\begin{array}{cc}-1&0\\ 0&1\end{array}\right]\left[\begin{array}{c}x\\ y\end{array}\right] \tag{3}\]  
\[\left[\begin{array}{c}x^{\prime}\\ y^{\prime}\end{array}\right]=\left[\begin{array}{cc}-1&0\\ 0&-1\end{array}\right]\left[\begin{array}{c}x\\ y\end{array}\right] \tag{4}\]  
where \(x\) and \(y\) represents the horizontal and vertical axis, respectively, on the image.  
Rotation: each image changed its axis. For this rotation, the rotation matrix given in Equation (5) was used, where \(\theta\) represents the rotation angle of the image and \(R(\theta)\) the new pixel position.  
\[R(\theta)=\begin{bmatrix}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{bmatrix} \tag{5}\]  
Median filter: each pixel in the image is replaced with the median value of its neighboring pixels (\(K\)) in the image. The operation is represented by Equation (6).  
\[K=\frac{1}{9}\left[\begin{array}{ccc}1&1&1\\ 1&1&1\\ 1&1&1\end{array}\right] \tag{6}\]  
Combining the fundamental data augmentation transformations (i.e., reflection x + median filter, rotation + median filter, among others) enlarged the data set, in our case, nine times larger than the original size. The additional training data helped the model avoid the overfitting that occurs when training with small amounts of data. Therefore, the data augmentation helped build a simple, robust, and generalizable model. Concerning the artificial data, 80.0% (1247 images) were used as training data for the object detection algorithm, and the remaining 20.0% (311 images) were used as test data to experiment and verify. Figure 4 shows the results of the labeling of two percentages of air filtration.