# 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
Memory usage for a given model configuration and hyperparameters on average did not exceed the 3% level. Figure 4: Comparison of the results of the LeNet-5 model training process at different batch sizes. (**a**) Results for batch size = 8. (**b**) Results for batch size = 16. (**c**) Results for batch size = 32. **AlexNet**  
Figure 6 shows how the AlexNet model's performance changes depending on the batch size: 8, 16, and 32. With a batch size of 8, the model achieved an accuracy of 63.39% with a loss of 2.43. Training took the longest time, 1114 s. The results indicate a stable learning process, as can be seen by the gradual increase in accuracy and relatively small fluctuations in loss. However, the time-consuming nature of this approach can be a significant problem when training time is limited. Increasing the size of the batch to 16 brought some benefits in the form of reducing the training time to 928 s, and the loss of the model decreased to 1.55. Nevertheless, the accuracy remained almost the same (63.30%). However, the graph shows greater fluctuations in both accuracy and loss, which may suggest the model's difficulty in maintaining stability with faster data processing. At the highest batch of 32, the training time was reduced to 831 s, and the model's loss decreased to 1.71. However, the accuracy dropped to 60.54%, and the results were less stable, as can be seen from the larger fluctuations in the graphs. This indicates that although the model processed the data faster, this affected the stability and predictability of the results. Figure 5: Comparison of the results of the LeNet-5 model training process at different batch sizes, including GPU and memory consumption. (**a**) Results for batch size = 8. (**b**) Results for batch size = 16. (**c**) Results for batch size = 32. From Figure 7, it can be seen that at a batch size of 8, GPU and GPU memory consumption was higher compared to larger batchs, suggesting a more intensive use of computing resources. As the batch size increases to 16 and 32, GPU and memory consumption becomes lower. In the graphs for batch sizes of 16 and 32, it can be observed that GPU consumption shows a dependence on the validation loss value. When validation loss increases, GPU utilization also increases, and with decreases in validation loss, a decrease in GPU utilization is noticeable. **GoogLeNet**  
Figures 8 and 9 show the results of the GoogLeNet model's training process at different batch sizes: 8, 16, and 32. It can be observed from them that changing the size of the batch affects the training time, accuracy and loss stability, and the consumption of computing resources much more than is the case with the other architectures. This is due to the fact that the GoogLeNet architecture is a much more complex architecture with many more parameters. The use of a batch size of 8 brought the GoogLeNet model the highest stability of metrics, with an accuracy of 65.71% and a loss of 1.35. Despite the longer training time of 5257 s, GPU (56.72%) and memory (25.16%) usage was relatively optimal. This size of the batch allowed for consistent results, indicating an appropriate balance between accuracy and computational resources. With a batch size of 16, training time was reduced to 4742 s. Although training was faster, the results suggest that the stability of the model decreased, which may be related to the higher computational requirements. Increasing the batch size to 32 brought an improvement in model accuracy to 68.66% and a reduction in loss to 1.53. Figure 6: Comparison of the results of the AlexNet model training process at different batch sizes. (**a**) Results for batch size = 8. (**b**) Results for batch size = 16. (**c**) Results for batch size = 32. Training time was the shortest among the configurations tested, at 4516 s. GPU usage dropped to 57.2% and memory usage to 28.24%. Figure 8: \(Cont\). Figure 7: Comparison of the results of the AlexNet model training process at different batch sizes, including GPU and memory consumption. (**a**) Results for batch size = 8.