Skip to content

This project aims to colorize grayscale images with autoencoders.

Notifications You must be signed in to change notification settings

Akankshaaaa/Image-colorization-autoencoders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Image-colorization-autoencoders

This project aims to colorize grayscale images with autoencoders. Given a grayscale image, the model should be able to colorize it and we are going to do so with the help of autoencoders.

An autoencoder is a neural networks that are designed to reconstruct the original image. During this process, there might be some reconstruction errors since we take an image and scale it down and then upscale it back to it's original size.

Here's the basic idea of the project :

  1. Choose an appropriate dataset
  2. Resize the Images to 256*256
  3. Convert from RGB --> Lab colorspace
  • Lab colorspace comprises of 3 channels

    • L : Lightness. values range from 1 - 100
    • A : represents colors from green to red. values range from -128 to +128
    • B : represents colors from blue to yellow. values range from -128 to +128

    We're using the lab colorspace because we get to isolate the black and white part from the colored part.

  1. Normalize the images.
  2. Create the model
  3. Provide the L channel i.e the monochrome image as the input to the model.
  4. Get ab channels i.e the colored part of the image as the output.
  5. Combine the L, a and b channels and convert from Lab to RGB colorspace.
  6. Evaluate the results.

The model that worked the best for me was trained on the landscape images dataset for 200 epochs on google colab GPU with adam optimiser and 0.1 validation split.

Here are some results :

Grayscale Image Predicted Image Ground Truth
image image image
image image image
image image image
image image image
image image image
image image image

There are a few blindspots in the predicted images but overall the model did a pretty good job of coloring the images. The dataset that I used comprised of 7K landscape images. The results highly depend on the nature and size of the dataset so make sure you choose an appropriate one.

References

Colorful Image Colorization

Auto Colorization of Black and White Images using Machine Learning “Auto-encoders” technique

About

This project aims to colorize grayscale images with autoencoders.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages