Skip to content

Classifying Images with Pre-trained Classifier Models

The project’s objective is to examine the relationship between image modifications and classification accuracy. The chosen classifier for this investigation is MobileNetV2, a lightweight and efficient convolutional neural network (CNN) architecture specifically crafted for mobile and edge devices. The MobileNetV2 model employed is pre-trained on ImageNet-1k at a resolution of 224×224 pixels.

The chosen image corruption method is compression, as it plays a crucial role in managing big data and proves beneficial in storage. To execute image compression, a JPEG compression function is implemented using the Python Imaging Library (PIL). The code snippet below illustrates the compression process.

,

The following images were examples of few stages of compression.

0% compression

,

50% compression

,

100% compression

,

,

The image above illustrates the reduction in image sizes at each compression level. Observing the images, it is noted that even at 100% compression, the classifier successfully classified the image accurately.

To evaluate the classifier’s performance under compression, two additional image corruption factors, namely image resizing and noise addition, were experimented with. A table has been generated based on the observations for each corruption level, where correctly classified instances are denoted as 1, and incorrectly classified instances are denoted as 0.

,

The table is visually plotted using line chart below,

,

From the graph, it is evident that the MobileNetV2 model performs well in classifying images, even under 100% image compression. However, it struggles to accurately classify images corrupted by resizing and the addition of noise. This experiment leads to the conclusion that MobileNetV2 excels as an image classifier, even in scenarios involving highly compressed images.

A detailed implementation of the project is available in the provided GitHub repository. https://github.com/Kishan1082/Image-Classification-using-Image-classifier.git