# Application of Deep Neural Networks in Recognition of Selected Types of Objects in Digital Images
## 2 Results of Research
### Test Results  
#### 2.5.1 Results of Hyperparameter Optimization Experiments for Supervised Learning Technique  
This section presents the results of experiments on the selection of optimal hyperparameters, such as batch size, activation functions, and optimizers with different learning rate settings. In the first stage of the study, for the supervised learning approach, preliminary experiments were conducted with a limited number of epochs (25) and a partial dataset, which allowed rapid selection of the best hyperparameter configurations. Once the optimal values were selected, full model training was conducted on the full dataset for 50 epochs, ensuring reliable and comparable results. Formula (1) is used to evaluate the quality of the models from the first approach, which was used to optimize the hyperparameters. This formula is also used to compare the results within each of the tested architectures during the final analysis, but the final selection of the best architecture is based solely on the accuracy (precision) index obtained. Lower values obtained using it indicated higher quality of the model, which made it possible to accurately compare and evaluate different configurations. \[M_{e}=\Bigg{|}-(3(1-A_{cc}))-(3L_{os})-\left(2\frac{T_{t}}{\max(T_{t})}\right)- \left(\frac{Ave_{GPU}}{100}\right)-\left(\frac{Ave_{mem}}{100}\right)-\left( \frac{Ave_{RAM}}{100}\right)-\left(\frac{Ave_{CPU}}{100}\right)\Bigg{|} \tag{1}\]  
The following is a description of the variables used in formula (1) to assess the quality of the models:  
* \(A_{cc}\) is accuracy--the accuracy of the model, measured as the proportion of correct predictions to the total number of predictions (a value between 0 and 1). It has been recognized as a key indicator of model quality, hence its importance in the evaluation. * \(L_{os}\) is loss--the loss of the model, a measure of the deviation of the prediction from the actual values. A low loss value indicates a better fit of the model to the training data. * \(T_{t}\) is training time--the time it takes to fully overtrain the model, expressed in seconds. The shorter the training time while maintaining high accuracy, the more effective the model. * \(Ave_{GPU}\) is average GPU usage--the average use of GPU resources during training, expressed as a percentage. It is included to evaluate the load on the computing hardware. * \(Ave_{me}\) is average memory consumption--the average memory consumption of the model during training, also expressed as a percentage. It is crucial for evaluating the model's effectiveness in terms of memory management. * \(Ave_{RAM}\) is average RAM consumption--the average RAM consumption of the system during training, in percent. This parameter affects the ability to process large datasets simultaneously. * \(Ave_{CPU}\) is average CPU consumption--the average use of CPU resources by the model during training, in percent. The weights assigned to each variable reflect their importance in the context of the study's objective, which is to find the optimal model configuration that not only achieves high accuracy, but also efficiently manages computational resources. _Batch size optimization_  
**LeNet-5**  
Figure 4 shows a comparison of the results of the training process of the LeNet-5 model at different batch sizes: 8, 16, and 32. The analysis of the charts shows that changing the size of the batch affects the stability of the learning process and the speed of convergence of the model. In the case of batch size 8, greater stability of accuracy and loss metrics is noticeable, but training time is increased compared to larger batchs. On the other hand, larger batch sizes (16 and 32) reduce training time, but may lead to greater variability in results, which may suggest less model stability. Figure 5 shows that GPU and memory usage was low during training using the LeNet-5 architecture. The average GPU load was around 15%, with a one-time temporary increase above 30% during training using a batch size of 8.