Abstract
Interactive colorization relies on user-provided hints to guide the transformation of grayscale images into color. Traditional convolutional neural network (CNN) approaches often struggle with long-range propagation due to their limited receptive fields, leading to inconsistent colorization in distant regions. We present iColoriT, a novel framework that leverages the global receptive field of Vision Transformers (ViT) to propagate local hints effectively. By combining a ViT encoder with an efficient pixel-shuffling upsampling technique and a local stabilizing layer, iColoriT achieves state-of-the-art accuracy and real-time performance on both GPU and CPU hardware.
Introduction
Interactive colorization is a task where a user provides sparse color hints—such as points or scribbles—to guide the colorization of a grayscale image. The primary challenge in this domain is the "propagation" of these hints: ensuring that a color assigned to one pixel correctly spreads to all semantically related regions (e.g., an entire lake) without leaking into unrelated areas (e.g., the grassy shore).
Existing methods typically rely on Convolutional Neural Networks (CNNs). Because a single convolutional layer only processes a small neighborhood of pixels, these models must stack many layers to spread color information across an image. This often leads to incomplete colorization or "faded" results in distant regions because the hint's influence weakens as it travels through the network. Furthermore, heavy CNN decoders make real-time interaction laggy, especially on hardware without high-end GPUs.
The iColoriT Architecture
iColoriT reimagines the colorization pipeline by replacing traditional local convolutions with a global attention mechanism. The architecture consists of three key components:
1. Vision Transformer (ViT) Encoder
Instead of local convolutions, iColoriT uses a Transformer encoder. Because Transformers utilize self-attention, every pixel (or "patch") can communicate with every other pixel in a single layer. This provides a global receptive field, allowing a color hint to propagate to relevant distant regions instantly. The self-attention matrix essentially acts as a propagation map; if the model identifies a pixel as part of a "sky" patch, the attention mechanism naturally routes the "blue" hint to all other "sky" patches, regardless of their spatial distance.
2. Pixel Shuffling
To maintain high inference speeds, the authors bypass computationally expensive decoders. Instead, they utilize "pixel shuffling," a technique that reshapes high-dimensional features from the Transformer directly into the spatial color channels (the a and b channels of the Lab color space). This makes the architecture asymmetric and highly efficient for inference.
3. Local Stabilizing Layer
A known issue with pixel shuffling at high upsampling ratios is the appearance of "checkerboard" or "patchy" artifacts. iColoriT addresses this by adding a simple convolutional layer just before the shuffling step. This layer smooths the features by looking at immediate neighbors, ensuring that adjacent patches have coherent colors and capturing low-level textures that the global Transformer might overlook.
Experimental Results
The model was trained on the ImageNet (2012) dataset and evaluated on several benchmarks, including ImageNet ctest10k, Oxford 102flowers, and CUB-200 (Birds).
Quantitative Performance
iColoriT demonstrates significant improvements over previous state-of-the-art models like those by Zhang et al. and Su et al. On the ImageNet ctest10k benchmark, iColoriT achieved a Peak Signal-to-Noise Ratio (PSNR) of 30.63 with just 10 hints, significantly outperforming baselines that struggled to reach 29.
Real-time Efficiency
The model is optimized for real-time performance across various hardware configurations:
- GPU: 14ms per image.
- CPU: 540ms per image.
- iColoriT-Tiny (CPU): 177ms per image.
This efficiency makes the model viable for mobile or web-based applications where high-end GPUs are not available.
Discussion and Limitations
Visual results confirm that iColoriT is superior at coloring large, persistent regions with a single click. However, some limitations remain. The model occasionally struggles with very small, intricate objects or distinguishing between objects with nearly identical grayscale intensities (e.g., a dark cat on a dark sofa). Additionally, because the model is trained in a self-supervised manner without explicit category labels, it lacks high-level semantic knowledge of specific objects. Future work may involve incorporating semantic segmentation labels or active learning to suggest optimal hint placements to the user.
Conclusion
iColoriT represents a shift in interactive colorization by prioritizing global context over local convolutions. By leveraging the Vision Transformer's ability to map relationships across the entire image, the framework achieves more accurate color propagation with fewer user inputs while maintaining the speed required for truly interactive applications.
Summary updated