## 3 TinyML Implemenatation
### Implementation Methodology
One of the most outstanding challenges in the field of TinyML is to achieve more accurate predictions with a certain embedded system using more optimized, compact files that allow each embedded system to execute a TinyML application in real time without having to meet high requirements and or expectations for the size of the SRAM. The analysis and discussion on file compression techniques for trained models used in TinyML applications is a great topic, which is addressed within the line of research for optimization of embedded systems in the field of artificial intelligence, with works such as [21; 32; 33; 48; 56; 57; 58; 63; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 91], addressing the topic and bridging the gap for other related research in this field. However, the main objective of the implementation in this work is not to show the results of the execution of the DNN with models optimized using different compression techniques for execution in hardware-constrained embedded systems. Likewise, when presenting Tables 14-16, emphasis will be placed on compliance with the SRAM size requirement in each system, to support models trained under a context that involves generating increasingly accurate models that do not compromise compliance, to not exceed sizes and to allow each system to operate in real time. It is a fact that training the DNN with a greater amount of data will generate a model with a larger file size; thus, performing a compression process on the model file without compromising the degree of accuracy in the prediction was a challenge achieved and presented in this implementation. Table 14 shows important hardware features that must be considered for implementing TinyML algorithms. However, other considerations taken into account to select the embedded systems shown in Table 14 are mentioned below. Although the Pi Pico and  
the ESP32 are dual-core systems, it is not necessary to carry out the implementation using the capabilities of both cores to distribute the processing; in this way, the comparison between the three embedded systems is fair when performing a deployment of TinyML in a single core. On the other hand, the operating frequencies of the CPU SoCs could generate differences between the execution times in each case. This aspect is explored in Table 15. As can be seen in Table 14, the RAM size of the Pi Pico and Arduino Nano 33 BLE does not exceed 260 KB and 520 KB for ESP32, which is a key aspect when considering that the implementation of TinyML requires that the embedded system has sufficient memory to allocate memory address and host a file with the trained model of the DNN that can have a size of up to 20 KB. Figures 17 and 18 describe important hardware details of the ESP32, Raspberry Pi Pico, and Arduino Nano 33 BLE Sense. Figure 19 summarizes the TinyML implementation process on the Arduino IDE platform, considering the Iris dataset and the compressed hexadecimal model content in the _data.h_ instance. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Characteristic** & **ESP23** & **Raspberry Pi Pico** & **Arduino Nano 33 BLE** \\ \hline Latency Time & 50–60 ms & 35–45 ms & 70–80 ms \\ \hline Power consumption (instantaneous value) & 825–990 mW & 660–825 mW & 500–600 mW \\ \hline Demand current in mA (instantaneous value) & 250–300 mA & 200–250 mA & 160–190 mA \\ \hline Allocated RAM Memory & 180 KB & 100 KB & 110 KB \\ \hline \hline \end{tabular}
\end{table} 
Table 16: Importance parameters for each embedded system when deploying model with _exerciectomized.cc_ file and realize one prediction per iteration in real time.