This project classifies images from the CIFAR-10 dataset using various models, including a CNN, ResNet50, and a fine-tuned ResNet152. The CIFAR-10 dataset consists of 60,000 32x32 color images across 10 different classes.
To install and run this project, follow these steps:
- Clone the repository:
git clone https://github.com/Amnaikram1/cifar10-image-classification.git cd cifar10-image-classification
To extract the training and test datasets, use the 7z archives:
extract_train.py
: Extracts the training dataset using thepy7zr
package.extract_test.py
: Extracts the test dataset using thepy7zr
package.
Data is loaded using the Data Loader script.
A data loader specifically refers to an object that encapsulates the training, validation, and optionally test datasets in a format suitable for training deep learning models. It provides a high-level interface to specify:
- Data Source
- Data Augmentation
- Batching
- Normalization
Train the model using Fastai by running the CNN learner script. This script defines the Image Data Loaders, creates a learner with a pre-trained ResNet152 model, and fine-tunes it.
To make predictions on the test set, use the get_preds()
method of CNN learner. This function will load the trained model and generate predictions for the test images.
The accuracy of different models used in this project:
Model | Accuracy (%) |
---|---|
CNN | 28% |
ResNet50 | 46% |
ResNet152 (Fine-tuned) | 97% |
- The Fastai library and its contributors
- Kaggle for providing the CIFAR-10 dataset
- The open-source community for their invaluable contributions
Feel free to adjust further as needed!