CNSNet: A Cleanness-Navigated-Shadow Network for Shadow Removal

Qianhao Yu, Naishan Zheng, Jie Huang, Feng Zhao

Abstract

Shadow removal is a fundamental task in computer vision that requires restoring the color and texture of shadowed regions to match their non-shadowed surroundings. Traditional methods often struggle with long-range dependencies or statistical mismatches between regions. We present CNSNet, a hybrid CNN-Transformer architecture that utilizes a "cleanness-navigated" approach. By leveraging two novel modules—Shadow-Oriented Adaptive Normalization (SOAN) and Shadow-Aware Aggregation with Transformer (SAAT)—CNSNet effectively borrows information from clean regions to restore shadowed areas. Experimental results on benchmark datasets (ISTD, ISTD+, and SRD) demonstrate that CNSNet achieves state-of-the-art performance with significantly fewer parameters than existing models.

Introduction

Shadow removal involves more than just brightening dark pixels; it requires a sophisticated understanding of the underlying texture and global illumination to ensure the restored area is indistinguishable from the rest of the image. This task presents two primary challenges for modern deep learning architectures. First, standard Convolutional Neural Networks (CNNs) possess a limited receptive field, making it difficult to reference distant, non-shadowed pixels that may contain the necessary texture information. Second, shadowed and non-shadowed regions exhibit vastly different statistical profiles. Standard normalization techniques often ignore these regional differences, leading to suboptimal restoration.

While Transformers offer a solution to the long-range modeling problem, "blind" self-attention can introduce noise if the model attempts to restore a shadowed region using irrelevant non-shadowed pixels (e.g., using a clean car pixel to restore a shadowed grass patch). CNSNet addresses these issues by using the non-shadow regions of an image to actively guide the restoration process.

Methodology

Soft-Region Mask Predictor

Unlike traditional methods that rely on binary masks, CNSNet utilizes a Soft-Region Mask Predictor. This module generates a "fuzzy" mask that measures the correlation between different image regions. This soft approach facilitates smoother transitions between shadow and non-shadow areas, preventing the harsh boundary artifacts often seen in mask-based restoration.

Shadow-Oriented Adaptive Normalization (SOAN)

To address the statistical mismatch between regions, the Shadow-Oriented Adaptive Normalization (SOAN) module treats the image as a collection of distinct zones. Instead of applying a global normalization, SOAN calculates the mean and variance specifically from the non-shadow (clean) regions. These statistics are then adaptively applied to the shadow regions. This process effectively "transfers" the lighting and color profile of the sunny areas to the dark areas, ensuring global consistency in the final output.

Shadow-Aware Aggregation with Transformer (SAAT)

For fine-grained pixel restoration, the Shadow-Aware Aggregation with Transformer (SAAT) module refines the attention mechanism. By using the predicted soft mask to weight the "Key" vectors within the Transformer, the model is forced to prioritize highly relevant, shadow-free pixels. This guided attention ensures that the information used to fill in a shadowed pixel is contextually and texturally appropriate.

Experimental Evaluation

Datasets and Metrics

CNSNet was evaluated on three major benchmarks:

  • ISTD: A standard dataset of 1,870 image triplets.
  • ISTD+: A refined version of ISTD that addresses color inconsistency issues.
  • SRD: A large-scale dataset featuring diverse and complex shadow scenarios.

Performance was measured using Root Mean Square Error (RMSE), Peak Signal-to-Noise Ratio (PSNR), and Structural Similarity Index (SSIM).

Results and Efficiency

CNSNet achieved top-tier results across all metrics. On the ISTD dataset, it reached an RMSE of 4.61, a significant improvement over previous state-of-the-art models like BMNet (5.73). On the ISTD+ dataset, it achieved an RMSE of 2.98, outperforming all competitors.

Beyond accuracy, CNSNet is remarkably efficient. The model contains only 1.17 million parameters. In comparison, the DSC model—a high-performing predecessor—utilizes 22.3 million parameters. This makes CNSNet nearly 20 times smaller while delivering superior restoration quality. Qualitative analysis confirms that CNSNet produces fewer "boundary traces" and superior texture recovery compared to previous methods.

Conclusion

CNSNet introduces a robust framework for shadow removal by treating non-shadowed regions as a navigational guide for restoration. Through the combination of SOAN and SAAT, the network achieves a balance between statistical consistency and local detail. Future work may focus on optimizing the model for real-time video applications and improving performance in scenarios where a clean reference texture is not readily available within the same frame.

Summary updated

BibTeX
@inproceedings{yu2022cnsnet,
  author = {Qianhao Yu and Naishan Zheng and Jie Huang and Feng Zhao},
  title = {{CNSNet: A Cleanness-Navigated-Shadow Network for Shadow Removal}},
  booktitle = {Workshops @ ECCV},
  year = {2022},
  doi = {10.1007/978-3-031-25063-7\_14},
}
Figure