The objective of this project is to carry out supervised image classification on a collection of colored images. It employs a convolutional neural network design and applies data augmentation and transformations to recognize the category of images from a predefined set of 10 classes.
Data Set (CIFAR-10)
The dataset used is CIFAR-10, which is a widely used benchmark dataset in the field of computer vision and machine learning. It serves as a standard dataset for training and evaluating machine learning algorithms, particularly for image classification tasks.
The dataset has the following features:
- Consists of 60,000 32x32 color images in 10 classes, with 6,000 images per class.
- Comprises 50,000 training images and 10,000 test images.
- Classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck.
The project is implemented in several steps simulating the essential data processing and analysis phases.
- Each step is represented in a corresponding section inside image-classification-tensorflow.ipynb.
Includes importing necessary libraries and modules.
Includes loading the dataset from keras library and checking its details.
Includes data transformation and augmentation using ImageDataGenerator, as follows:
- Scaling the pixel values of the images to be in the range [0, 1].
- Randomly applying shear transformations to the images.
- Randomly applying zoom transformations to the images.
- Randomly flipping images horizontally.
The CNN model consists of the following Sequential layers:
- Input layer.
- Two convolutional layers with ReLU activation function and an increasing number of filters.
- Two max pooling layers following the convolutional layers.
- Flattening layer.
- Two dense/fully connected layers with ReLU activation function.
- Output layer with Softmax activation function.
Model is compiled and trained using the following configurations:
- Optimizer: Adam.
- Loss function: Categorical Crossentropy.
- Batch size: 32
- Epochs: 25
Model accuracy is plotted and analyzed along the epochs. The final results are as follows:
Metric | Training | Validation |
---|---|---|
Accuracy | 0.8070 | 0.7398 |
F1 Score | 0.8059 | 0.7391 |
Loss | 0.5518 | 0.7972 |
Precision | 0.8623 | 0.7926 |
Recall | 0.7569 | 0.6997 |