## 5 Conclusions  
According to the measurements and results shown in this paper, we have shown that it is possible to create an energy-efficient battery-operated system capable of executing complex computer vision tasks in a reasonable time with a low amount of available resources by using carefully selected methods and algorithms. This approach can help to reduce the energy usage of the intelligent sensor grids, as well as to decrease the network traffic by replacing cloud computing where it is worthwhile. It should be underlined that taking the existing ML and TinyML studies and devices into account, to the best of our knowledge, there are no TinyML research papers nor devices with the resources comparable to the STM32F411 microcontroller that was used to implement complex computer vision tasks. Meanwhile, there exist research papers handling the topic of such tasks, yet with the use of overly powerful processors with more than enough resource memory and computational capabilities, resulting in higher cost and excessive power consumption of such devices in comparison to the proposed solution. The main conclusion of this paper is that it is possible to create a cost-effective and battery-operated TinyML system with a long uptime and that provides satisfactory results of masked face classification. In more detail, we created the TinyML system consisting of K-means supported by a sliding window face detection module, a carefully designated preprocessing filter that is responsible for feature extraction, and a K-means masked face classifier. The preprocessing filter transforms the detected face into a downscaled 32 \(\times\) 32 px image that is converted to intermediate values and passed to the thresholding stage. After unfolding, this results in a feature vector with 1024 dimensions. Our proposed \begin{table}
\begin{tabular}{c c} \hline
**Window Size** & **System Uptime** \\ \hline
320 \(\times\) 320 & 44.47 days \\
352 \(\times\) 352 & 49.83 days \\
384 \(\times\) 384 & 49.48 days \\
416 \(\times\) 416 & 76.59 days \\
448 \(\times\) 448 & 132.73 days \\
480 \(\times\) 480 & 145.48 days \\ \hline \end{tabular}
\end{table} 
Table 13: System uptime results. \begin{table}
\begin{tabular}{c c c} \hline
**Window Size** & \
\begin{tabular}{c} **Energy Consumption** \\ **(90\% Efficiency)** \\ \end{tabular} &
\begin{tabular}{c} **Possible Operations** \\ **on One Battery Charge** \\ \end{tabular} \\ \hline
320 \(\times\) 320 & 0.011 mAh & 222,359 \\
352 \(\times\) 352 & 0.010 mAh & 249,146 \\
384 \(\times\) 384 & 0.010 mAh & 247,400 \\
416 \(\times\) 416 & 0.007 mAh & 382,933 \\
448 \(\times\) 448 & 0.004 mAh & 663,662 \\
480 \(\times\) 480 & 0.003 mAh & 727,403 \\ \hline \end{tabular}
\end{table} 
Table 12: System time and energy consumption results. TinyML system solution managed to deliver very high-quality metric values, with accuracy, TPR, TNR, precision and recall being over 96% for masked face classification, while being able to reach up to 145 days of uptime using a typical 18650 battery with a capacity of 2500 mAh and nominal voltage of 3.7 V. The results were achieved using a STM32F411 microcontroller with 100 MHz ARM Cortex M4, which proves that execution of complex computer vision tasks is possible on such low-power devices. It should be noted that the STM32F411 microcontroller draws only 33 mW during the operation. The accuracy of the whole system is over 79%. There is still room for improvement--future work may include face detection accuracy enhancement and face detection speedup. Further work can also cover other classification algorithms and methods in combination with different preprocessing methods, as well as the research of other hardware platforms that are capable of fulfilling the strict limitations of TinyML. Conceptualization, D.P. and K.W. ; methodology, D.P. ; software, D.P. ; validation, D.P. and K.W. ; formal analysis, D.P. and K.W. ; resources, D.P. ; data curation, D.P. ; writing--original draft preparation, D.P. ; writing--review and editing, D.P. and K.W. ; visualization, D.P.