## 3 TinyML Implemenatation
### Results Deploying the DNN in Embedded Systems  
Our example implementation is based on the work published in [88]. To carry out the implementation test on the theESP32, Pi Pico, and Arduino Nano 33 BLE systems, it is necessary to place within an Arduino IDE code snippet with the same data array content in the _exercice model.cc_ file shown in Figure 16.  
Figure 22 presents a portion of the _exercice model.cc_, particularly the first three lines, with the statements and syntax required by the Arduino IDE environment. The file is a more extensive data array, about 380 lines of hexadecimal data, and is copied directly from the _cc_ file obtained in Figure 16 using Colab and pasted into the _data.h_ instance. An important aspect of achieving the execution of the DNN within the ESP32, Pi Pico, and Nano 33 BLE is the size in bytes of the _exercise model.cc_ file, which is approximately 5.2 KB. The RAM sizes of our devices are 512 KB for the ESP32, 264 KB for Pi Pico, and 256 KB for Nano 33 BLE. Thus, the Iris-dataset-based DNN implementation using _cc_ file for flower classification on the three embedded systems is supported. Figure 19: TinyML implementation process. Figure 20: Code snippet with the headers and libraries required in Arduino IDE for programming the DNN on the ESP32, Pi Pico, and Arduino Nano 33 BLE. An example of the input dataset to the DNN executing within our embedded system (ESP32, Pi Pico, and Nano 33 BLE) is shown in Figure 23. Through the output terminal of the Arduino IDE, it is possible to interact and provide the three embedded systems with the input data for the DNN and verify the result when executing the flower classification task using the DNN algorithm, whose training model was obtained and compressed in the computer (see the following steps: training the selected model on a computer and programming, deploying, and testing the trained model in our methodology). Figure 24 shows the results using the ESP32, Pi Pico, and Nano 33 BLE to predict types of flowers using the Iris dataset. The visualization of the results was performed through the output terminal of the Arduino IDE. The information in Figure 24 is interpreted as follows: when the model is deployed on the embedded system, it obtains a set of three values that form an output vector, and each value of the output vector corresponds to a weight assigned to each type of flower; the output vectors are depicted in the \"Prediction-ESP32\" column in Figure 24. The first component of each vector corresponds to Setosa, the second one to Virginica, and the third to the Versicolor type of flower. The highest weight in  
Figure 23: Entry dataset for flower type prediction (**left**) and one-hot tags for the expected prediction (**right**), in the DNN algorithm deployed on ESP32, Pi Pico, and Nano 33 BLE. Figure 21: Code snippet with the main function programmed in Arduino IDE to deploy the DNN within the ESP32, Pi Pico, and Arduino Nano 33 BLE. Figure 22: The _exercise model.cc_ file formed by array of hexadecimal data and contained in _data.h_ instance in Arduino IDE. each output vector indicates the prediction of the flower type given by the DNN model. In addition, the \"Real Label\" column (see Figure 24) shows the correct classification. For example, the prediction vector in the \"Prediction-ESP32\" column in Figure 24 is \([-21.06,\ -5.13,\ -2.25]\). Focusing on the third weight (\(-2.25\)), it is the highest. This result indicates that the type of flower identified by the DNN based on the entry dataset is Versicolor. It should also be noted that in the \"Real Label\" column, a \"1\" is activated in the third column, which indicates that the actual type of flower is also Versicolor. Therefore, the prediction made by the DNN with the entry dataset in the first output vector provided a correct flower classification.