## 3 Experiments and Results
### SOTA-Based Models  
State-of-the-art models present issues mainly linked with their structural complexity. In order to solve them and tackle the case study at hand, we propose a handful of NN architectures that rely on the simplification of state-of-the-art models. We call such NNs _SOTA-based models_--as they rely on the concept of state-of-the-art models, but simplify their structures. More in details, we tackle the structural complexity of SOTA models via truncation of their architectures. SOTA-based models are built stacking \(N\) modules of operations that characterise a state-of-the-art NN, and appending a simple classification layer at the end. \(N\) is an hyper-parameter of the SOTA-based model and should be ideally kept small to avoid building complex NNs. Throughout our experiments \(N\) was selected to match the memory requirements of the OpenMV microcontroller. As an example, consider the MobileNet-based model built from the MobileNet-V2 architecture. The building block of the MobileNet NN is the Inverted Mobile Bottleneck convolutional layer [14]. Therefore, the MobileNet-based model is obtained stacking together \(N=4\) Inverted Mobile Bottleneck convolutional layers, followed by a classification layer. This represents a trivial and well-known approach for the resolution of NNs complexity issue. However, given the simplicity of most real scenarios where AI is required, such an approach represents a good solution. We build one SOTA-based model for each SOTA model considered in Section 3.1. Similarly to what was done for SOTA models, SOTA-based NNs were trained outside the microcontroller, converted and then embedded in the OpenMV board for testing. As shown in Table 5 a small ablation study was completed considering image scales. For each SOTA-based model, a new version of the NN was trained considering either 1\(\times\) or 0.5\(\times\) scaled images. 1\(\times\) scaled images correspond to the 256 \(\times\) 256 pixels resolution, while the 0.5\(\times\) scaled images correspond to the 128 \(\times\) 128 pixels resolution. This ablation study was undertaken to establish if small loss in image quality could bring inference speed-up, and ease the deployment of AI on hyper-constrained devices. As Table 5 shows and similarly to what happened for SOTA models, the VGG-based NN applied to 256 \(\times\) 256 pixels images could not terminate its inference mechanism due to memory issues. Indeed, the truncation technique we used does not solve memory issues linked with local structures--i.e., layers--of NNs. However, all other SOTA-based NNs run successfully on the microcontroller board, showing improved performances over their Section 3.1 counterparts. The simplification technique applied to NNs successfully solved the overfitting issue. Indeed, classification performances on testing set of such models are now satisfactory. Concerning inference time, such truncation technique brought a relevant speed-up, as it was expected. However, such inference times may not be satisfactory for real-time applications, yet. Finally, the ablation study shows that small reduction in image quality can boosts greatly the speed performance of NNs. Results show the existence of a linear dependency between image resolution and inference time. A 0.5\(\times\) scaled input image bear a quarter of the pixels to analyse, therefore requiring a quarter of the time to obtain a prediction. \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Model** & **Memory Footprint** & **Accuracy** & **Inference Time** \\ \hline
1 \(\times\) MobileNet\({}_{\text{4}}\) & 0.73 MB & 98.72\% & 5.40 s \\
0.5 \(\times\) MobileNet\({}_{\text{4}}\) & 0.73 MB & 98.72\% & 1.37 s \\
1 \(\times\) ResNet\({}_{\text{3}}\) & 1.70 MB & 96.64\% & 41.30 s \\
0.5 \(\times\) ResNet\({}_{\text{3}}\) & 1.70 MB & 95.03\% & 10.35 s \\
1 \(\times\) VGG\({}_{\text{2}}\) & 1.70 MB & 98.15\% & ✗ \\
0.5 \(\times\) VGG\({}_{\text{2}}\) & 1.70 MB & 97.80\% & 47.11 s \\ \hline \hline \end{tabular}
\end{table}