Introduction
The Colorization Transformer (ColTran) is a novel generative model designed to produce diverse, high-fidelity colorizations of grayscale images. By leveraging axial self-attention, ColTran decomposes the complex, highly stochastic task of colorization into three manageable stages: coarse low-resolution coloring, color refinement, and spatial upsampling. This approach achieves a new state-of-the-art on ImageNet, with human evaluators frequently preferring its generated outputs over the original ground truth photographs.
The Challenge of Image Colorization
Image colorization is an inherently stochastic task. A single grayscale pixel does not map to one "correct" color; a car in a black-and-white photo could plausibly be red, blue, or silver. Because of this uncertainty, deterministic models often produce blurry, desaturated "average" colors when trying to minimize error.
While probabilistic models like GANs or VAEs handle this uncertainty better, scaling them to high-resolution images (e.g., $256 \times 256$) is computationally grueling. Transformers, which excel at modeling long-range dependencies, are a natural fit for capturing the semantic context needed for colorization (e.g., recognizing a sky to color it blue). However, standard self-attention scales quadratically with the number of pixels, making it prohibitively expensive for high-resolution image generation.
Methods: The ColTran Architecture
To overcome the quadratic scaling bottleneck, the authors introduce a modular pipeline built entirely on Axial Transformers. Instead of attending to every pixel simultaneously, axial attention operates sequentially along rows and then columns, reducing computational complexity from $O(N^2)$ to $O(N\sqrt{N})$.
The ColTran process is divided into three sequential steps:
- ColTran Core: A conditional autoregressive transformer generates a low-resolution ($64 \times 64$) coarse color map. It predicts a single "color" from a palette of 512 possibilities (3 bits per RGB channel).
- Color Upsampler: A parallel (non-autoregressive) model refines the 3-bit coarse colors into full 8-bit RGB (256 intensities per channel).
- Spatial Upsampler: A final parallel model super-resolves the $64 \times 64$ image to the target $256 \times 256$ resolution.
Key Innovation: Conditional Transformer Layers. Rather than simply concatenating grayscale information to the input, the authors modified the transformer blocks themselves. They introduced learnable scale and shift parameters into the self-attention, MLP, and LayerNorm components. This allows the grayscale context to directly and multiplicatively modulate the network's internal representations.
Key Insights
- Conditioning is King: The authors found that "biasing" the input with grayscale data—the standard approach in many models—is insufficient. Directly conditioning the internal layers of the transformer provides a much stronger signal, leading to significantly better log-likelihood and FID scores.
- Multiplicative over Additive: Ablation studies demonstrated that multiplicative interactions (scaling features based on the grayscale input) are far more effective than simple additive biases.
- The Hybrid Advantage: By using an autoregressive model for the "hard" part (deciding the base semantic colors) and parallel models for the "easy" parts (refining and upscaling), ColTran successfully balances high-quality generation with reasonable inference speeds.
Results and Evaluation
ColTran was primarily trained and evaluated on the ImageNet dataset at $256 \times 256$ resolution, with additional out-of-domain testing on LSUN and Celeb-A to verify generalization.
- FID Score: ColTran achieved a remarkable FID of 19.37 on ImageNet, representing a substantial improvement over the previous state-of-the-art, PixColor (24.32).
- Human Evaluation: In a "Mechanical Turk" test, ColTran's "Oracle" (the best of 3 generated samples) reached a 62% fooling rate. This means human evaluators chose the model's colorization over the actual ground truth photo more than half the time.
- Diversity: Because it is a probabilistic model, ColTran successfully generates many valid, distinct colorizations for a single grayscale input, accurately capturing the true uncertainty of the task.
Limitations and Future Work
Despite its strong performance, ColTran has limitations. While the upsamplers are fast, the "Core" model remains autoregressive and is therefore slow; sampling a batch of 20 images takes roughly 3.5 to 5 minutes on a P100 GPU. Furthermore, the system relies on three separate models trained independently, adding pipeline complexity.
Future work could explore more end-to-end approaches, further optimizations to the axial attention mechanism, and engineering improvements—such as caching unnecessarily recomputed activations—to significantly speed up the sampling process.
Summary updated