## 2 Method
### Image Processing
For the proposed application, we imposed a mean error that should not exceed zero and a standard deviation that should not exceed 0.5. In Table 4 it can be seen that the criteria set at the beginning were met, so we can consider that the images were processed correctly, and no important content was lost from the images. \[MAE=\frac{\sum_{i=1}^{n}\left|y_{i}-x_{i}\right|}{n} \tag{1}\]  
where \(MAE\) is the mean absolute error, \(y_{i}\) is the prediction, \(x_{i}\) is the true value, and \(n\) is the total number of data points. \[\sigma=\sqrt{\frac{\sum(x_{i}-\mu)^{2}}{N}} \tag{2}\]  
where \(\sigma\) is the population standard deviation, \(N\) is the size of the population, \(x_{i}\) is each value from the population, and \(\mu\) is the population mean. In the previous figure, it can also be seen that each category is followed by a \".pickle\", representing a file extension where we saved the values after the processing stage because they would be used later in a new training script. Pickle is a module offered by Python for data storage and it has the advantage of saving data in the file as a string; when reading, it provides a set of tools to interpret the content in the desired form. Considering that we \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **class.pickle** & **non\_uml.pickle** & **sequence.pickle** & **state.pickle** & **uml.pickle** \\ \hline
**Mean** & \(-0.0044898701\) & \(-0.082445047\) & \(-0.099869774\) & \(-0.042088231\) & \(-0.1001582262\) \\
**Std** & \(0.3404123\) & \(0.2871922\) & \(0.29997926\) & \(0.30228693\) & \(0.29298602\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Mean and standard errors for every processed class. are still dealing with images, we could make a final check by trying to interpret the pixel matrices obtained as images. We listed the image samples used before and after processing for the manual testing of any alteration. Given that the majority of the dataset is black and white, there was no significant loss that a human operator could capture. In comparison with the initial images, processing and re-displaying them led to a slight blur and color alteration that could be captured. However, no loss was expected to impact the training, since all important features were kept. At this point, we could say that the image processing stage was successfully completed, and we could move on to the next stage, which truly represents the artificial intelligence system, namely the preparation for training. Loading and processing training and test data for image-based machine learning tasks often requires the use of efficient libraries like os and cv2 in Python. The os module is indispensable for navigating the filesystem to gather image paths, while cv2 (OpenCV) is essential for reading and processing the images. To start, the os module can be used to traverse the directory structure, collecting the paths to all images within specified folders for training and testing datasets. This ensures that we have a comprehensive list of images to work with for further processing. Once the paths are collected, we use cv2 to read each image. A critical step in this process is ensuring that all images conform to a specified resolution. In real-world datasets, images often come in various sizes and resolutions. To standardize these images, we can use cv2.resize() to resize them to a required resolution, say 150 \(\times\) 150 pixels. This is particularly important because most neural networks require input images of a consistent size. The resizing process involves specifying the desired width and height, and choosing an interpolation method, such as cv2.INTER_LINEAR or cv2.INTER_AREA, to maintain image quality during resizing. In our case, we performed this step earlier in the process.