Deep Exemplar-based Colorization

Mingming He, Dongdong Chen, Jing Liao, Pedro V. Sander, Lu Yuan · DOI

Image colorization is a classic "ill-posed" problem in computer vision. Because a single grayscale value can represent multiple colors in the real world—a gray petal could be red, yellow, or purple—automatic systems often struggle to produce vibrant, accurate results. This paper introduces the first deep learning framework for exemplar-based colorization, allowing users to guide the process by providing a reference color photo.

The Challenge of Control

Existing colorization methods typically fall into two categories. Fully automatic methods use deep learning to predict colors based on massive datasets, but they offer no user control and often produce desaturated, "conservative" results. Conversely, user-guided methods require manual "scribbles" or points of color, which are labor-intensive and require artistic skill.

Exemplar-based methods offer a middle ground by using a reference image to suggest colors. However, traditional versions are fragile, relying on low-level features like texture that fail when the reference image has different lighting or viewpoints. This research seeks to make exemplar-based colorization robust and controllable through a deep-learning-driven approach.

The system uses a reference image (left) to guide the colorization of a target grayscale image (right).

A Dual-Network Architecture

The proposed system consists of two primary sub-networks designed to handle semantic matching and color propagation:

1. Similarity Sub-net

To effectively "borrow" colors, the system must identify which parts of the reference image match the target. The authors utilize a "gray-VGG-19" network—a version of the VGG architecture fine-tuned to recognize objects specifically in grayscale. This allows the system to find semantic correspondences (e.g., identifying a "car wheel") regardless of color differences. A technique called Deep Image Analogy then creates a dense, pixel-to-pixel mapping between the two images.

2. Colorization Sub-net

This U-Net-style encoder-decoder takes the target image and the aligned reference colors as input. It employs a multi-task learning approach with two distinct branches:

  • Chrominance Branch: This branch selectively propagates colors from the reference image where the semantic match is deemed reliable.
  • Perceptual Branch: This acts as a safety net. If the reference is a poor match, this branch uses a perceptual loss to ensure the output remains a "natural" image based on priors learned from the ImageNet dataset.

Key Insights and Robustness

A critical innovation is the use of a luminance-only VGG. Standard pre-trained networks are often biased by color; by training specifically on the luminance (L) channel, the authors created a feature extractor that is truly color-blind, making it significantly better at matching grayscale targets to color references.

Furthermore, the network is designed to be "skeptical." It uses bidirectional similarity maps to decide which reference pixels to trust and which to ignore in favor of its own learned natural priors. This prevents the system from forcing a match when the reference image is semantically different from the target.

By changing the reference image, users can achieve different colorization results, such as this version with a blue shirt.

Results and Performance

Trained on approximately 700,000 image pairs from ImageNet, the model demonstrates impressive versatility. In a "real vs. fake" user study, the system achieved a 38.08% fooling rate, significantly outperforming previous state-of-the-art automatic methods.

Beyond accuracy, the system is highly efficient, processing a 256x256 image in roughly 0.166 seconds on a modern GPU. It also shows remarkable transferability; while trained on natural photos, the Chrominance branch allows it to successfully colorize paintings and cartoons by borrowing styles from a reference—a task where purely automatic models typically fail.

Limitations

Despite its success, the system has constraints. Because the Perceptual branch is trained on natural images, it may "correct" unusual artistic choices (like a green face) toward more natural-looking results. Additionally, semantic ambiguity can occur if the VGG features cannot distinguish between similar textures, such as sand versus grass. Future work may involve better balancing the two network branches to handle significant luminance gaps between the reference and target images.

Summary updated

BibTeX
@article{he2018deep,
  author = {Mingming He and Dongdong Chen and Jing Liao and Pedro V. Sander and Lu Yuan},
  title = {{Deep Exemplar-based Colorization}},
  journal = {ACM Trans. Graphics},
  year = {2018},
  doi = {10.1145/3197517.3201365},
}
Figure