GithubHelp home page GithubHelp logo

preslavrachev / nn-photo-colorization Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 2.0 41.34 MB

Can neural networks help bring a colourful life back to old black and white photos? Let's check it out!

License: MIT License

Python 0.82% Jupyter Notebook 99.18%
neural-network cnn-keras photography machine-learning

nn-photo-colorization's Introduction

nn-photo-colorization

Can neural networks help bring a colourful life back to old black and white photos? Let's check it out!

Note: This is a living document, summarising my research on the topic of photo colorization. It is far from its final version, but I would be more than happy, if it helps other people’s work. Feel free to send me comments, suggestions, or pull request changes

Inspired, by Emil Wallner's Medium post titled "How to colorize black & white photos with just 100 lines of neural network code", I decided to delve into the field myself, and see what I might end up with.

The Goal

Design and train a machine learning model, which by presenting it with a black-and-white photo, will result in a decently colorised version of the same. The goal here is not really to achieve a factual correctness (e.g the model decides that a red car should be blue), but a level of satisfactory fidelity. Moreover, from a purely artistic perspective, it might be interesting to see, even if wrongly coloured, if the end results add an unexpected aesthetic value.

Challenges

Choosing the right loss function

As it was reported by [1], when trained with a large set of images, the model becomes so generic that, in fact, colorised results come out mostly brownish, or very desaturated, as if a sepia filter has been applied on the photo. I have reported the same in my first versions of my experiment, while I still used a simple generic CNN model. As it would turn out, this might have been caused by the choice of a loss function. I used a mean squared error (mse) loss. This is a good default loss function, when solving regression problems, where the input space is continuous. As research points out, however, the ab space is discrete. It can be confined to a number of 313 classes, which changes the nature of the problem from regression to classification. This requires a choice of a more appropriate loss function.

Code Repositories

GitHub - richzhang/colorization: Automatic colorization using deep neural networks. “Colorful Image Colorization.” In ECCV, 2016.

GitHub - venkai/RBDN: Recursively Branched Deconvolutional Network: DCNN architecture for “Generalized Deep Image to Image Regression.” CVPR2017 (Spotlight).

GitHub - awesome-davian/Text2Colors: Implementation of our paper, Text2Colors: Guiding Image Colorization through Text-Driven Palette Generation

GitHub junyanz/interactive-deep-colorization: Deep learning software for colorizing black and white images with a few clicks.

References

[1] Wallner, E.: "How to colorize black & white photos with just 100 lines of neural network code" Medium.com, Oct 29, 2017 - https://medium.freecodecamp.org/colorize-b-w-photos-with-a-100-line-neural-network-53d9b4449f8d

[2] Dahl, R.: "Automatic Colorization" Tinyclouds.org, Jan, 2016 http://tinyclouds.org/colorize/

Cheng, Z., Yang, Q., Sheng, B.: "Deep colorization". In: Proceedings of the IEEE International Conference on Computer Vision. (2015) 415–423

Zhang, Richard, Phillip Isola, and Alexei A. Efros. "Colorful image colorization." European Conference on Computer Vision. Springer, Cham, 2016.

Zhang, Richard, et al. "Real-time user-guided image colorization with learned deep priors." arXiv preprint arXiv:1705.02999 (2017).

nn-photo-colorization's People

Contributors

preslavrachev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nn-photo-colorization's Issues

How to find the 313 color bins

First of all i'm new to machine learning, could someone explain to me how to quantize the ab color space and the one-hot encoding scheme.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.