Introduction
Deep learning has revolutionized the field of image colorization, enabling the restoration of historical photographs and the enhancement of grayscale media with remarkable realism. However, a persistent challenge remains: the "shadow problem." Most state-of-the-art colorization models are trained on large-scale datasets like ImageNet, where shadows are frequently treated as background noise or insignificant artifacts. This neglect leads to two primary failure modes in real-world applications.
First, semantic confusion occurs when a model misinterprets a shadow as a physical object. For instance, a shadow cast on a green tennis court might be erroneously colorized as a blue or red patch because the model lacks the physical understanding of light projection. Second, a saturation drop often plagues shaded regions. Since shadows are inherently low-saturation areas, models tend to produce "safe," desaturated, or grayish results across the entire image to avoid chromatic errors in the shadows. This paper introduces the first shadow-aware image colorization framework designed to explicitly address these issues by decoupling shadow detection from the colorization process.
Methodology: The Dual-Branch Approach
The core innovation of this research is a dual-branch shadow-aware colorization network. Unlike traditional single-path architectures, this model bifurcates the task into two specialized streams that interact through a novel feature-sharing mechanism.
Shadow Detection and Colorization Branches
- Shadow Detection Branch: This branch utilizes a transformer-based encoder to analyze the grayscale input image $I$. It is specifically trained to predict a binary shadow mask $Y_s$. By supervising this branch with a dedicated shadow loss against ground-truth masks ($GT_s$), the network learns to identify the physical boundaries of shaded regions.
- Colorization Branch: Operating in parallel, this branch follows an encoder-decoder structure aimed at predicting the missing $a$ and $b$ chrominance channels in the CIELAB color space. It takes both the grayscale image and a set of "color tokens" $T$ as input.
The Shadow-Aware (SA) Block
The "secret sauce" of the architecture is the Shadow-Aware (SA) Block, which facilitates communication between the two branches. Within this block, features from the shadow detection branch ($F^s$) are used to guide the colorization process. The SA block applies different protocols based on the detected regions:
- Non-shadow areas are processed using cross-attention mechanisms with color tokens to ensure high vibrancy and diverse color palettes.
- Shadow areas are handled through specific convolutional layers that respect their naturally neutral tones without allowing this neutrality to "leak" into and desaturate the rest of the image.
Data: The First United Shadow Dataset
To effectively train a shadow-aware model, the researchers identified a lack of comprehensive datasets pairing color images with shadow masks. To fill this gap, they curated the first united shadow dataset for colorization. By aggregating several existing shadow detection benchmarks—including CUHK-Shadow, ISTD, SBU, UCF, ViSha, and STICT—they created a robust training set. The final dataset comprises 18,111 shadow images (13,628 for training and 4,483 for testing), providing the necessary ground truth for both color and shadow mask supervision.
Experimental Results
The proposed framework was evaluated against several leading models, including ColTran, ColorFormer, and DDColor.
Quantitative Performance
The shadow-aware model outperformed competitors across multiple metrics. It achieved a Peak Signal-to-Noise Ratio (PSNR) of 23.58 and a Fréchet Inception Distance (FID) of 4.18, indicating high fidelity and structural realism. Notably, it scored 33.75 in Colorfulness, significantly higher than models that tend to produce muted, grayish tones in an attempt to handle shadows.
Qualitative Comparison
Visual analysis confirms the model's ability to maintain natural shadow tones while preserving the vibrancy of the surrounding environment.
As seen in the comparison, while other models might colorize a sidewalk shadow with unnatural purple or blue hues, the shadow-aware model maintains a neutral gray for the shadow while keeping the grass and skin tones vivid. A user study involving 20 participants further validated these findings, with the proposed method consistently rated as the most visually appealing.
Conclusion and Future Directions
By treating shadows as a first-class citizen in the colorization pipeline, this research demonstrates that understanding the physics of light is just as important as semantic object recognition. While the model occasionally struggles with extremely complex shadow patterns or high-level semantic depth, it represents a significant step forward. Future work will likely focus on integrating more robust semantic supervision to further refine the relationship between objects and the shadows they cast.
Summary updated