# Application of Deep Neural Networks in Recognition of Selected Types of Objects in Digital Images
## 3 Discussion of Results
For example, a squirrel is often mistaken for a spider, which may suggest that the model is misinterpreting certain details, such as texture or shape. Similarly, a dog barely matches its class better than that of a spider, indicating serious difficulties in distinguishing between the classes. Good scores for the butterfly may be due to its more distinct and unique visual features, such as the shape of its wings or their pattern, which are easily distinguished from those of other animals. Poor results for other classes, on the other hand, may be due to overly general features that the model has learned to recognize, leading to frequent classification errors. In this case, the model may not have learned to differentiate between these classes well enough, resulting in poor performance. The LeNet-5 model, which accepts images with a resolution of 32 \(\times\) 32 pixels, may have encountered additional difficulties due to the pixelization of the original images, which likely had a higher resolution, such as around 200 \(\times\) 200 pixels. Reducing the resolution to 32 \(\times\) 32 leads to a loss of a lot of detail, which can significantly affect the model's ability to accurately distinguish between classes. For classes such as elephant, cat, sheep, and squirrel, which may have more subtle visual differences, this loss of detail could cause problems with accurate classification. In addition, LeNet-5 operates on grayscale images, meaning that any information contained in color was also lost. This could have made it particularly difficult to distinguish between classes that have similar shapes but differ in color. In such cases, the model did not have access to the full visual information, which could lead to more frequent errors. These limitations may be a key reason why the model does well with classes such as butterfly and spider, which have clear outlines and distinctive shapes, but has problems with more complex or visually similar classes. Figure 28 shows the normalized confusion matrix for the AlexNet model. The AlexNet model does very well in classifying such classes as dog, horse, elephant, butterfly, and chicken, as can be seen from the high values on the diagonal of the confusion matrix for these classes. In particular, the chicken (0.89) and the butterfly (0.84) stand out, which may suggest that these classes have features that are easily recognizable and clearly distinguishable from other classes. On the other hand, the most frequently confused classes are sheep, squirrel, and cow, which score the lowest. The sheep is often mistaken for a spider, which may indicate that the model has difficulty distinguishing texture or shape. AlexNet accepts images at a resolution of 227 \(\times\) 227 pixels, which is much more detailed than LeNet-5. This allows the model to better distinguish details that can be crucial in classifying more complex classes. In addition, the model operates on RGB color scale images, which allows it to detect distinctive features based on color information as well. AlexNet's results for classes such as butterfly and chicken are very good, which may be due to the unique visual features that these classes possess. However, the poorer results for other classes suggest that despite the higher resolution of the images, the model may still have trouble distinguishing between more similar classes. Figure 28: Normalized confusion matrix for the AlexNet model. Figure 27: Normalized confusion matrix for the LeNet-5 model. Figure 29 shows the normalized confusion matrix for the GoogLe-Net model. The GoogLeNet model effectively classifies classes such as elephant, butterfly, and chicken, as evident in the high values on the diagonal of the matrix for these classes. In particular, the chicken (0.94) and butterfly (0.94) classes are recognized with high accuracy, suggesting that these categories have clear and easily recognizable features for the optimized GoogLeNet architecture.