L-CoDe: Language-Based Colorization Using Color-Object Decoupled Conditions

Shuchen Weng, Hao Wu, Zheng Chang, Jiajun Tang, Si Li, Boxin ShiAAAI 2022 · DOI

TL;DR

This paper introduces L-CoDe, a novel language-based image colorization system that tackles the challenges of color-object coupling and mismatch. By decoupling color and object information and using a soft-gated mechanism, L-CoDe achieves state-of-the-art performance in generating realistic and caption-consistent colorized images.

What Problem Does This Paper Address?

Image colorization, the task of adding color to grayscale images, is inherently ambiguous. While automatic methods exist, they often struggle with the vast number of possible color assignments. Human interaction can help, but methods like scribble-based or example-based colorization can be time-consuming or require specific user input. Language-based colorization offers a more natural interaction by using text captions to guide the colorization process. However, existing language-based methods face two main challenges:

  1. Color-Object Coupling: The system might struggle to assign a specific color to its intended object, especially when the color is unusual or not commonly associated with that object (e.g., a "purple horse"). This happens because color and object information from the caption are often treated as a single unit.
  2. Color-Object Mismatch: Objects not explicitly mentioned in the caption might incorrectly inherit colors from other objects described in the text.

L-CoDe aims to solve these issues by explicitly decoupling color and object information from the caption.

Methods

L-CoDe employs an encoder-decoder architecture working in the CIE Lab color space. Its core innovations lie in three modules:

  • Object-Color Corresponding Matrix (OCCM) Predictor: This module predicts a matrix that explicitly captures the relationship between objects and their described colors within a caption. It uses separate MLPs to project word embeddings into "object space" and "color space," allowing for a more granular understanding of the caption's semantic components.
  • Attention Transfer Module (ATM): This novel module addresses the color-object coupling problem. It leverages the OCCM to transfer the correspondence between visual regions and nouns (objects) to the correspondence between regions and adjectives (colors). This allows the system to identify regions associated with objects and then apply the specified colors, even unusual ones.
  • Soft-Gated Injection Module (SIM): To combat color-object mismatch, SIM uses a soft-gated mask. This mask, derived from the ATM's output, ensures that colors are only injected into visual regions that are explicitly associated with a color description in the caption. This prevents unmentioned objects from being incorrectly colored.

The system also introduces a new dataset with annotated color-object pairs to help train the OCCM predictor.

Datasets

The paper uses the COCO-Stuff dataset for training and evaluation. Specifically, they filter images where captions contain adjectives and have annotated ground-truth correspondence matrices for training the OCCM.

Key Insights and Ideas

  • Decoupling is Key: The fundamental insight is that treating color and object information from captions as a single entity leads to poor performance. Explicitly decoupling them via the OCCM and ATM is crucial for accurate color assignment, especially for unusual color-object pairings.
  • Soft Gating for Precision: The SIM module's soft-gated approach is a clever way to prevent unwanted color bleeding and ensure that only relevant objects are colored according to the caption, thereby mitigating color-object mismatch.
  • Bridging the Gap for Legacy Photos: The model's ability to generalize to colorizing legacy black and white photos demonstrates the robustness of its learned colorization capabilities beyond synthetic datasets.

Key Results

  • Quantitative Performance: L-CoDe outperforms state-of-the-art language-based colorization methods (Manjunatha et al. 2018, Xie 2018) across PSNR, SSIM, and LPIPS metrics. For instance, L-CoDe achieves a PSNR of 24.965 and SSIM of 91.657%, significantly better than the competitors.
  • Qualitative Improvements: Visual comparisons show L-CoDe successfully handles challenging cases, such as changing the color of bananas to red or green, which other methods struggle with due to strong color-object coupling. It also avoids coloring objects not mentioned in the caption.
  • User Study: Human evaluations confirm L-CoDe's superiority, with participants favoring its colorization results in two separate experiments designed to assess caption adherence and visual appeal.

Limitations and Future Work

  • Resolution Limitations: The authors acknowledge that handling objects with fine structures and edges can still be challenging, potentially leading to artifacts like color bleeding. This is attributed to the limited resolution of image feature maps and attention maps.
  • Future Directions: The paper suggests that future work could focus on adopting higher-resolution features and attention representations to achieve colorization with finer details.

Summary updated

BibTeX
@inproceedings{weng2022l,
  author = {Shuchen Weng and Hao Wu and Zheng Chang and Jiajun Tang and Si Li and Boxin Shi},
  title = {{L-CoDe: Language-Based Colorization Using Color-Object Decoupled Conditions}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i3.20170},
}
Figure