/Image-Colourization

Colouring Gray scale images using Convolutional Neural Network.

Primary LanguageJupyter Notebook

Image Colourization using CNN

Given a grayscale image, using convolutional neural network, it is possible to apply colour to the image. Given enough data, the CNN model can learn to predict the coloured version of the image bsaed on the content in the image.

In this project, the model is trained to colour grayscale images of the following category:

  1. People's faces
  2. Coast
  3. Buildings
  4. Mountains
  5. Forests
  6. Open country
  7. Street
  8. City Center

Dataset:

The processed data used for training and testing can be found here

Model Architecture:

The model follows an encoder-decoder architecture, with skip connections from encoder fed to the decoder (U-Net). The skip connection helps to preserve the local information of the input image which is used for reconstruction in the decoder. The model consists of 7 blocks of encoder followed by 7 blocks of decoder. Each encoder block has a Convolutional layer, LeakyReLU layer followed by a BatchNormalization layer and Dropout layer. Each decoder block has an Addition layer to add skip connections, ConvolutionalTranspose layer, LeakyReLU layer and BatchNormalization layer. The model takes input image of size 256X256X1 and outputs the coloured version of the image of size 256X256X3.

Architecture of the model:

flow

Trained model:

You can download the trained model from this link

Results:

         Ground Truth                  Model Input                    Model Output

1     1_gray      1_predicted

2     2_gray      2_predicted

3     3_gray      3_predicted

4     4_gray      4_predicted

5     5_gray      5_predicted

6     6_gray      6_predicted

7     7_gray      7_predicted

8     8_gray      8_predicted

9     9_gray      9_predicted

References: