Abstract
Shadow detection remains a challenging task in computer vision due to the high variability of lighting conditions and scene contexts. Traditional deep learning models often struggle with distribution shifts when encountering "in-the-wild" images, frequently misidentifying dark-colored objects as shadows. This paper discusses Test-Time Intensity Consistency Adaptation (TICA), a novel framework designed to improve shadow detection by fine-tuning a pre-trained model on individual test images. By enforcing intensity consistency across augmented views of the same image, TICA allows models to adapt dynamically to specific scene characteristics, significantly reducing error rates compared to static state-of-the-art methods.
Introduction
Shadow detection is a foundational task for various applications, including object tracking, scene understanding, and image editing. Despite the success of deep convolutional neural networks, these models often fail to generalize to unseen environments. A primary reason for this failure is the distribution shift: the specific lighting, textures, and intensities present in a test image may differ significantly from those in the training dataset.
A common failure mode in shadow detection is the confusion between actual shadows and naturally dark objects, such as black vehicles or dark textiles. Most existing models are static, meaning their weights remain fixed after training. TICA addresses this limitation by introducing a dynamic adaptation phase, allowing the model to "learn" the specific lighting environment of a single image during the inference process.
The TICA Framework
The TICA framework is structured into two distinct phases: an initial supervised training stage and a subsequent unsupervised test-time adaptation (TTA) stage.
1. Initial Training Stage
In the first stage, a standard encoder-decoder network—utilizing backbones such as ResNet-50, Swin-Tiny, or HRNet-18—is trained on labeled shadow detection datasets. This stage employs a Balanced Binary Cross-Entropy (BBCE) loss to establish a baseline understanding of shadow features.
2. Test-Time Adaptation (TTA) Stage
The core innovation of TICA occurs when the model encounters a new, unlabeled test image. Instead of a single forward pass, the system performs the following steps:
- View Generation: The test image is transformed into two different "views" using random augmentations, including resizing, cropping, and flipping.
- Consistency Enforcement: The model predicts shadow masks for both views. A Consistency Loss is then calculated based on the intersection of these views.
- Dual Constraint: To ensure the model does not simply collapse into a trivial solution, TICA applies a dual constraint using Kullback-Leibler (KL) divergence. This enforces consistency for both the predicted shadow regions (foreground) and the non-shadow regions (background).
- Encoder-Only Updates: To maintain stability and computational efficiency, only the encoder weights are updated during this phase. This allows the model to refine its feature extraction for the specific scene while preserving the high-level shadow concepts learned by the decoder.
Experimental Evaluation
The authors evaluated TICA on two benchmark datasets: ISTD (1,330 training / 540 test images) and SBU (4,089 training / 638 test images). The primary metric for evaluation was the Balanced Error Rate (BER), where a lower score indicates higher accuracy.
Performance Against SOTA
TICA demonstrated significant improvements over existing test-time adaptation methods like TENT, ETA, and BN. On the ISTD dataset using a ResNet-50 backbone, TICA achieved a BER of 1.64, outperforming TENT’s 1.97.
When compared against specialized, state-of-the-art shadow detection models such as FDRNet and MTMT, TICA established new performance benchmarks. Using an HRNet-18 backbone, TICA reached a BER of 1.17 on the ISTD dataset, representing a 24.5% reduction in error compared to the previous best-performing method, FDRNet (1.55 BER).
Discussion of Key Findings
Several critical insights emerged from the development and testing of TICA:
- Intensity as an Unsupervised Signal: The researchers identified that light intensity inconsistencies are the primary source of error. By treating consistency as an objective, the model can self-correct without requiring ground-truth labels for every new image.
- The Importance of Background Consistency: Ablation studies revealed that enforcing consistency only on shadow regions was insufficient. Including the background in the dual constraint was vital for defining sharp shadow boundaries and preventing the model from over-predicting shadows in dark areas.
- Efficiency through Selective Updates: Updating only the encoder proved more effective than updating the entire network. This strategy prevents the model from overfitting to the noise of a single image while still allowing it to adapt its feature representations to the local context.
Limitations and Future Work
While TICA offers superior accuracy, it introduces a trade-off in terms of computational speed. Because the model must be fine-tuned for approximately five epochs for every test image, it is significantly slower than standard one-pass inference models. This overhead currently limits its applicability in real-time scenarios like autonomous driving.
Furthermore, there is a risk of overfitting if the adaptation phase lasts too long, which can eventually degrade performance. Future research may focus on incorporating additional cues for adaptation, such as texture and color consistency, and optimizing the adaptation process to reduce the required number of iterations.
Summary updated