Bring Back The Colours

- 10 mins

image

image source

Ever wondered how the life of old age people would be like? How they look and what colour clothes they wore? How the old films look if were coloured? Or how our Delhi look like in 1911?

Black and white photography bears its emotional impact. You get rid of populist distractions or kitschy stereotypes of colors. The skies are blue, and the roses are red. That’s for sure. Obvious thing. But what is within us? The lights, the shadows, the contrasts. Rich world. That’s what the black&white photography expresses directly. Under your skin, into your heart and soul.”

But What about the colours? Colours speak louder than words we all know. Colours creates, enhances changes, establishes,and reveals the mood of person, painting and nature. We can't imagine our life without colours.

UGHH!! Before my mood turns pensive and I completely deviate from the topic let's start deep diving into the theory.

We would be colouring the old Black and White images and videos for obvious reason- Adding life to it!!!

Let's start understanding how Deep Learning can help us do that. We would start with a very interestng and basic topic in Deep Learning THE AUTOENCODERS.

Autoencoders

Autoencoders are an unsupervised learning technique in which we leverage neural networks for the task of representation learning. Specifically, we'll design a neural network architecture such that we impose a bottleneck in the network which forces a compressed knowledge representation of the original input. If the input features were each independent of one another, this compression and subsequent reconstruction would be a very difficult task. However, if some sort of structure exists in the data (ie. correlations between input features), this structure can be learned and consequently leveraged when forcing the input through the network's bottleneck.

Markdowm Image

As visualized above, we can take an unlabeled dataset and frame it as a supervised learning problem tasked with outputting x^, a reconstruction of the original input x. This network can be trained by minimizing the reconstruction error, L(x,x^), which measures the differences between our original input and the consequent reconstruction. The bottleneck is a key attribute of our network design; without the presence of an information bottleneck, our network could easily learn to simply memorize the input values by passing these values along through the network

We will discuss more about Autoencoders and different types in upcoming posts. Here I just provided a jist about autoencoders and what they do. Detail discussion would follow up soon.

Let's discuss the part for which we all are interested in. COLOURIZATION.

We got an intuition about Autoencoders, What if in these autoencoders as an input I give a pool of coloured images? I try to get an encoding or black and white images as encoder output and reconstruct the original coloured images from these encodings by using a decoder.

In this way my model would learn to extract important features as encoding. This trained model can be further used to get the coloured images or video from black and white images. Which is pretty much our target.

Let's Code!!!

Since coding this would require high hardware requirements we will use GOOGLE COLAB for this and pretrained model by fast.ai for quick and precise results. Try to use shorter videos but with clear pixels and set the render factor to 21.

Original-Old Black and White Version

Colourized Version

Abhishek Parashar

Abhishek Parashar

I make sense with data while having Pizza, Coffee and Freaky shakes.

comments powered by Disqus
twitter facebook linkedin reddit rss