Automatic Controllable Colorization via Imagination

Xiaoyan Cong, Yue Wu, Qifeng Chen, Chenyang Lei

Introduction

Automatic colorization—the process of adding color to grayscale images—has long been a challenging task in computer vision. Because a single grayscale value can correspond to many different colors, traditional models often produce "safe" but dull, desaturated results. This paper introduces a novel framework that leverages the "imagination" of pre-trained diffusion models to generate diverse, vivid colorization candidates, which are then intelligently composed into a final, high-quality result.

The Colorization Challenge

Colorization is an "ill-posed" problem. For instance, a dark gray pixel in a grayscale photo of a shirt could represent navy blue, dark green, or charcoal. Traditional deep learning methods tend to predict the statistical average of these possibilities, leading to grayish or "muddy" images.

Existing alternatives like exemplar-based methods require users to find a perfect reference image, while fully automatic generative models (like GANs) often suffer from spatial inconsistency or "color bleeding," where colors spill over the edges of objects. The researchers sought to combine the creative power of generative AI with the structural precision of exemplar-based systems.

The Imagination Framework

The proposed system moves away from direct colorization, instead using a three-stage "imagination-then-composition" workflow.

1. The Imagination Module

Rather than guessing colors pixel-by-pixel, the system uses ControlNet and BLIP-2. BLIP-2 generates a descriptive text caption of the grayscale input, while ControlNet uses the image's edges and boundaries to maintain structural integrity. Together, they "dream up" multiple diverse, fully-colored reference candidates that match the original scene's layout but vary in color schemes.

2. Reference Refinement and Composition

Since a single generated reference might contain local errors (like a purple tree), the system segments the input image using Semantic-SAM. For every segment (e.g., sky, building, person), it evaluates all imagined candidates using DINOv2 features to find the most semantically appropriate color match. These optimal segments are then stitched together into one refined, high-quality reference image.

The proposed framework pipeline: generating diverse reference candidates via ControlNet, segmenting the input, and composing a refined reference for final colorization.

3. Colorization Module

Finally, the system transfers the colors from this refined reference to the original grayscale image using a modified UniColor framework. This stage ensures that the final output respects the original luminance of the grayscale photo while adopting the vivid palette of the "imagined" reference.

Key Results and Evaluation

The framework was tested against major benchmarks including COCO-stuff and ImageNet, as well as uncurated "in-the-wild" photos.

  • Vibrancy: The model achieved a Colorfulness (CF) score of 47.2 on COCO-stuff, significantly higher than competitors like DDColor (44.7) and UniColor (36.4).
  • User Preference: In blind studies, users preferred the "Imagination" results 43.3% of the time, more than double the preference for the next-best model.
  • Controllability: Because the system relies on a reference image, it is inherently editable. Users can swap out specific segments of the reference if they prefer a different color for a particular object, and the system will update the final result accordingly.
Qualitative results of the 'Imagination' framework on diverse real-world images, showing vivid and structurally consistent colorization.

Limitations and Future Outlook

While the model excels at single-image colorization, it faces challenges with images containing many identical instances (like a large crowd), where it may struggle to maintain color identity across all individuals. Additionally, the use of diffusion models makes the process computationally intensive, taking roughly 8 seconds per image on high-end hardware. Future work will focus on accelerating this process using faster sampling techniques and extending the framework to maintain temporal consistency for video colorization.

Summary updated

BibTeX
@inproceedings{cong2024automatic,
  author = {Xiaoyan Cong and Yue Wu and Qifeng Chen and Chenyang Lei},
  title = {{Automatic Controllable Colorization via Imagination}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
}
Figure