# A Computer Vision Model to Identify the Incorrect Use of Face Masks for COVID-19 Awareness
## 3 Methodology
### Detection and Classification Models
#### 3.2.2 Face Classification: ResNet  
Since the revolution of CNNs with the successful introduction of AlexNet [41], researchers have tried to obtain more accurate models to work with CV image tasks. Nevertheless, making deeper CNNs does not only involve adding more layers, since problems such as the vanishing gradient might appear (when the gradient is backpropagated to previous layers, it can converge to an infinitely small number, causing low performance in the CNN). However, vanishing problems were solved in some studies using normalized initialization and intermediate normalization layers, allowing the models to converge for stochastic gradient descent (SGD) and backpropagation. Although they resolved the vanishing problem, [PERSON] et al. [42] observed that the accuracy in the training dataset dropped in models with more layers. Therefore, a degradation problem had appeared. This problem leads to the saturation of the accuracy in the training dataset, but it is not caused by overfitting. [PERSON] et al. presented ResNets as a solution to the degradation problem. They realized that the deeper layers were not identity mapping. This \"identity mapping\" was regarded as the ability to maintain at least the same error across the deeper layers, like an identity function avoiding degraded performance. Therefore, this is the desired underlying mapping. Instead of waiting for the layers to fit the desired underlying mapping, the authors explicitly allowed the layers to fit a residual mapping. These residual mappings are also known as residual blocks (identity blocks). Residual blocks skip one or more connection layers to enable a fine-grained level of detail at the inference. ResNet-18 is a variant of ResNet, and its architecture is presented in Figure 3. Here, we can see the shortcuts that contribute to identity mapping. Depending on whether or not there is a necessity to match dimensions through each residual block, two types of identities can be found: the identity shortcuts (solid lines) and the projection shortcuts to create a match between the input and output dimensions (dotted lines). The matching of dimensions can be performed using linear projections.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Donor Dataset**} & \multirow{2}{*}{**Purpose**} & \multirow{2}{*}{**Images**} & \multirow{2}{*}{**Faces**} & \multicolumn{3}{c}{**Labels**} \\ \cline{4-7}  & & & & \multicolumn{2}{c}{**With Mask**} & \multicolumn{1}{c}{**Without**} \\ \cline{4-7}  & & & & **Correct** & **Incorrect** & **Mask** \\ \hline \multirow{3}{*}{MAFA} & Training & 25,876 & 29,452 & 24,603 & 1204 & 3645 \\  & Testing & 4935 & 7342 & 4929 & 324 & 2089 \\ \hline \multirow{3}{*}{WIDER FACE} & Training & 8906 & 20,932 & 0 & 0 & 20,932 \\  & Testing & 2217 & 5346 & 0 & 0 & 5346 \\ \hline \multirow{3}{*}{**FMLD**} & Training & 34,782 & 50,384 & 24,603 & 1204 & 24,577 \\  & Testing & 7152 & 12,688 & 4929 & 324 & 7435 \\ \cline{1-1}  & Totals & 41,934 & 63,072 & 29,532 & 1528 & 32,012 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Summary of the construction of the FMLD dataset. FMLD uses the donor datasets MAFA and WIDER FACE to construct the “Compliant” and “Non-Compliant” classes.