This repository contains the implementation of two tasks using PyTorch: image classification and image colorization, both applied to the CIFAR-10 dataset. This is part of HW2 for the Deep Learning course instructed by Dr. Soleymani.
The goal of this project is to apply deep learning techniques to solve two key tasks using the CIFAR-10 dataset:
- Image Classification: Classifying images into one of the 10 classes in the CIFAR-10 dataset.
- Image Colorization: Colorizing grayscale images from the CIFAR-10 dataset using deep learning techniques.
The image classification task uses a Convolutional Neural Network (CNN) to classify images from the CIFAR-10 dataset into one of 10 categories (airplanes, cars, birds, cats, etc.). The project explores how CNNs can effectively learn image features and perform high-accuracy classification.
The colorization task focuses on taking grayscale images and converting them back into color using deep learning techniques. This task aims to predict the missing color channels of grayscale images by learning from the color patterns present in the CIFAR-10 dataset.
The dataset used is the CIFAR-10 dataset, which consists of 60,000 32x32 color images divided into 10 classes. The dataset is automatically downloaded via the torchvision library.
- CIFAR-10 Classes: Airplanes, Cars, Birds, Cats, Deer, Dogs, Frogs, Horses, Ships, Trucks.
- The dataset is split into training and validation sets for both tasks.
-
Clone the repository:
git clone https://github.com/AqaPayam/CIFAR10_Image_Classification_Colorization.git
-
Install the necessary dependencies:
pip install -r requirements.txt
-
Run the Jupyter notebook:
jupyter notebook CIFAR10_Image_Classification_And_Colorization.ipynb
- Python 3.x
- PyTorch
- Torchvision
- Numpy
- Pandas
- Matplotlib
- Seaborn
- tqdm
- scikit-learn
- torchsummary
- Classification Task: Execute the cells related to image classification in the Jupyter notebook to train the CNN on the CIFAR-10 dataset and evaluate its performance on the test set.
- Colorization Task: Execute the cells related to image colorization to train a model that converts grayscale images back to color. The notebook contains the necessary steps for data preprocessing, model training, and evaluation.
- Classification: The model aims to achieve high accuracy in identifying the correct class for each image.
- Colorization: The model attempts to restore the original colors of grayscale images as closely as possible by learning the distribution of colors in the CIFAR-10 dataset.
This project is part of the Deep Learning course by Dr. Soleymani.