Colorization : A Machine Learning Model for Colorizing Black and White Images

David Cochard
axinc-ai
Published in
2 min readApr 26, 2021

This is an introduction to「Colorization」, a machine learning model that can be used with ailia SDK. You can easily use this model to create AI applications using ailia SDK as well as many other ready-to-use ailia MODELS.

Overview

Colorization is a machine learning model released in March of 2016 that takes a black and white image as input and outputs a colorized version of it. The machine learning model performs colorization based on these semantic meanings, such as grass is green, the sky is blue, and ladybugs are red.

Source: https://github.com/richzhang/colorization/tree/master/imgs
Source:https://arxiv.org/pdf/1603.08511.pdf

Architecture

Colorization works in the Lab color space. It takes the lightness L, and estimates colors a and b. It adds L to the computed ab and returns it to RGB space.

The model architecture is based on VGG.

Source:https://arxiv.org/pdf/1603.08511.pdf

The paper introduces an optimal error function for Colorization. The usual method of minimizing the L2 error of pixel values often converges to average values, resulting in an image with low saturation.

The proposed method solves this problem by using the distribution of ab values as the error function. The training quantizes the ab-values and learn to bring the distribution of ab-values closer together.

Source:https://arxiv.org/pdf/1603.08511.pdf

Usage

You can run the Colorization model in ailia SDK with the following command.

python3 colorization.py --input input.jpg --savepath output.jpg

ax Inc. has developed ailia SDK, which enables cross-platform, GPU-based rapid inference.

ax Inc. provides a wide range of services from consulting and model creation, to the development of AI-based applications and SDKs. Feel free to contact us for any inquiry.

--

--

David Cochard
axinc-ai

Engineer with 10+ years in game engines & multiplayer backend development. Now focused on machine learning, computer vision, graphics and AR