Two-Stage Video Shadow Detection via Temporal-Spatial Adaption

Xin Duan, Yu Cao, Lei Zhu, Gang Fu, Xin Wang, Renjie Zhang, Ping Li

Abstract

Video Shadow Detection (VSD) is a critical task for scene understanding, yet existing benchmarks often fail to capture the complexity of real-world environments. This paper introduces the Complex Video Shadow Dataset (CVSD), a large-scale benchmark featuring numerous, small, and disjointed shadows. To address these challenges, we propose a two-stage training paradigm that adapts image-level shadow knowledge to the video domain through novel Temporal-Adaption (TAB) and Spatial-Adaption (SAB) blocks. Our approach significantly outperforms state-of-the-art methods, particularly in intricate scenarios.

Introduction

Shadows provide essential cues for depth, shape, and lighting, but their presence often complicates computer vision tasks such as object tracking. While VSD has seen progress, current datasets like ViSha primarily feature dominant, isolated shadows in simple environments. In contrast, real-world shadows are often small, numerous, and highly deformable. This gap necessitates more robust benchmarks and models capable of maintaining temporal consistency and capturing fine-grained spatial details.

Methodology: Two-Stage Adaptation

We propose a framework based on conditioned feature adaptation, moving away from training video models from scratch.

Stage 1: Image-level Pre-training

A standard Segformer model is first trained on individual images to establish a baseline for shadow feature extraction.

Stage 2: Video-level Adaptation

The pre-trained model is adapted using two specialized modules:

  • Temporal-Adaption Block (TAB): This module fuses features from neighboring frames. By utilizing a transposed attention mechanism, it effectively handles deformable shadows while maintaining temporal consistency across the video sequence.
  • Spatial-Adaption Block (SAB): To preserve high-resolution details without excessive computational cost, we employ Mask-Guided Cropping. The model identifies regions likely to contain shadows, crops them into high-resolution patches, and integrates these local details back into the global context.
Architecture of the proposed two-stage video shadow detection framework featuring TAB and SAB modules.

The Complex Video Shadow Dataset (CVSD)

The CVSD dataset is designed to push the boundaries of VSD. It comprises 196 video clips and nearly 20,000 frames across 149 shadow categories. Unlike previous benchmarks that average approximately 5 shadows per frame, CVSD features an average of 13.6 to 16.5 disjointed shadow areas per frame, totaling over 309,000 instances. The dataset also features significantly higher resolution and more diverse lighting conditions than its predecessors.

Quantitative comparison of CVSD against existing benchmarks ViSha and VISAD.

Key Results and Insights

Our model establishes new state-of-the-art performance on the CVSD benchmark, achieving a Mean Absolute Error (MAE) of 0.046 and an Intersection over Union (IoU) of 0.515. These results represent a significant improvement over previous methods like SC-Cor (MAE 0.070, IoU 0.476).

A key insight is that transferring image-level knowledge via "adapter" copies—keeping the original weights frozen—is more effective than full video training. Furthermore, the Mask-Guided Cropping strategy acts as a "zoom lens," allowing the model to resolve intricate shadow boundaries that are typically lost during standard downsampling.

Conclusion and Future Work

While our framework excels at detecting complex cast shadows, it currently excludes self-shadows, which remain a challenge in dense scenes. Additionally, while the cropping strategy improves efficiency, the multi-frame fusion process still requires substantial GPU resources. Future research will focus on optimizing these adaptation blocks for real-time performance in mobile and robotic applications.

Summary updated

BibTeX
@inproceedings{duan2024two,
  author = {Xin Duan and Yu Cao and Lei Zhu and Gang Fu and Xin Wang and Renjie Zhang and Ping Li},
  title = {{Two-Stage Video Shadow Detection via Temporal-Spatial Adaption}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73195-2\_12},
}
Figure