Weakly Supervised Realtime Dynamic Background Subtraction

Fateme Bahri, Nilanjan RayarXiv 2023 · DOI

Abstract

Background subtraction (BGS) is a fundamental task in computer vision, yet dynamic scenes—such as those featuring waving trees, flowing water, or flickering monitors—continue to pose significant challenges. This paper presents a weakly supervised framework that effectively handles dynamic backgrounds in real-time. By utilizing a dual-network system comprising an Autoencoder and a U-Net, the method learns scene-specific motion patterns from moving-object-free video segments. This approach eliminates the need for labor-intensive pixel-wise manual labeling while outperforming state-of-the-art unsupervised algorithms.

Introduction

The primary goal of background subtraction is to isolate foreground moving objects from the rest of a scene. While conceptually straightforward, "dynamic backgrounds" often lead to false positives in traditional algorithms, as background motion is incorrectly flagged as foreground.

Existing high-performance methods typically rely on supervised deep learning, which requires thousands of manually labeled pixel-level masks—a process that is both costly and time-consuming. Conversely, unsupervised methods lack the robustness needed for complex, shifting environments. This research bridges the gap with a weakly supervised approach: a system that learns the characteristics of a specific background using only a few seconds of "empty" video, requiring only frame-level tags rather than dense pixel-level annotations.

Methodology

The proposed framework employs two neural networks working in tandem to distinguish between static background, dynamic clutter, and actual foreground objects.

The Dual-Network Architecture

  1. Static Background Generator (Autoencoder): A fully connected autoencoder is trained on a sequence of images containing only the background. By compressing and reconstructing these images, it learns to generate a "static" version of the scene ($B_t$), effectively filtering out transient noise and motion.
  2. Dynamic Background Predictor (U-Net): To address the moving parts of the background (the "clutter"), the system subtracts the autoencoder’s static output from the original input and thresholds the result to create "pseudo-labels." A U-Net is then trained to predict this dynamic clutter ($D_t$).
Overview of the training and test phases, showing the interaction between the Autoencoder and U-Net.

Overfitting as a Strategy

A unique aspect of this method is the intentional overfitting of the U-Net to the specific training sequence. By becoming an "expert" on the specific motions of a single camera view (e.g., the exact sway of a particular tree), the model can reliably ignore those motions during the test phase.

Final Foreground Extraction

During testing, the foreground ($F_t$) is extracted using the following formula: $$F_t = (I_t - B_t) \times (1 - D_t)$$ This calculation subtracts the static background and uses the U-Net's output as a mask to cancel out any remaining dynamic artifacts.

Key Results

The framework was evaluated on major benchmarks including CDnet 2014 and the I2R dataset, focusing on categories like Dynamic Background and Bad Weather.

  • Efficiency: The system achieves a high throughput of 107 Frames Per Second (FPS) on a GeForce GTX 1080 Ti, making it suitable for edge-device deployment in surveillance and traffic monitoring.
  • Accuracy: On the CDnet 2014 Dynamic Background category, the method achieved an average F-Measure of 0.91, matching or exceeding other weakly supervised state-of-the-art models.
  • Visual Robustness: Qualitative results demonstrate the model's ability to handle challenging scenarios like fountains, waving foliage, and snowy conditions where traditional methods often fail.
Qualitative results across various datasets, demonstrating the progression from input image to final post-processed foreground mask.

Limitations and Future Work

While effective, the method has some limitations. The "absorption" problem occurs when the autoencoder incorporates constant noise (like falling snow) into the static background model, potentially leading to noise in the final mask. Additionally, the requirement for a "moving-object-free" training sequence may be difficult to meet in highly congested environments.

Future research will explore data augmentation to improve robustness against lighting changes and the use of sparse pixel-wise labels for "hard" frames to further refine accuracy without requiring a full manual labeling overhaul.

Summary updated

BibTeX
@misc{bahri2023weakly,
  author = {Fateme Bahri and Nilanjan Ray},
  title = {{Weakly Supervised Realtime Dynamic Background Subtraction}},
  year = {2023},
  eprint = {2303.02857},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.02857},
}
Figure