This project implements an image colorization model using a deep learning approach with an Autoencoder architecture. The model takes grayscale images as input and predicts the missing color channels.
- Project Overview
- Dataset
- Model Architecture
- Training Strategy
- Results
- Usage
- Requirements
- How to Run
- References
The goal of this project is to train a neural network that can take grayscale images (L channel from Lab color space) and predict the missing a and b color channels. The model is trained using Mean Squared Error (MSE) loss or Structural Similarity Index (SSIM) loss.
The dataset consists of images converted to the Lab color space, where:
- L channel represents lightness (input to the model)
- a, b channels represent color information (target output)
The dataset is split into:
- 70% Training set
- 15% Validation set
- 15% Test set
The model is based on an Autoencoder with a U-Net-like structure:
- Encoder: Extracts features from the grayscale input
- Decoder: Reconstructs the a and b channels
- Activation Function:
tanhfor output normalization
- Optimizer: Adam
- Loss Function: SSIM Loss
- Learning Rate: 0.001
- Epochs: 100
- Batch Size: Tuned using cross-validation
- Cross-validation is used to find the best hyperparameters
- Early stopping monitors SSIM loss to prevent overfitting
- Metrics:
- Peak Signal-to-Noise Ratio (PSNR)
- Structural Similarity Index (SSIM)
After training, the following plots are generated:
- Loss curves (Training & Validation)
- SSIM metric over epochs
- PSNR metric over epochs
The final model is evaluated by predicting color channels and reconstructing RGB images. The outputs include:
- Original image (ground truth)
- Grayscale input (L channel)
- Predicted a and b channels
- Reconstructed RGB image
pip install -r requirements.txt- Python 3.x
- TensorFlow / Keras
- OpenCV
- NumPy
- Matplotlib
- Clone this repository:
git clone https://github.com/yourusername/image-colorization.git cd image-colorization - Install dependencies:
pip install -r requirements.txt
- Kaggle: Image Colorization with CNN
- Research Papers on Autoencoders for Image Processing