Scene-Independent Change Detection using Explicit Temporal Differencing and Deep Segmentation Models
This project explores the problem of change detection in video sequences, where the objective is to identify meaningful motion or foreground changes between consecutive frames.
The project was developed as an experimental computer vision research pipeline focused on:
- temporal motion modeling
- foreground segmentation
- scene-independent change detection
- architecture exploration for motion understanding
The implementation uses explicit temporal differencing along with a deep segmentation architecture to detect moving objects in dynamic scenes.
Traditional foreground detection methods often struggle in scenarios involving:
- illumination changes
- camera noise
- dynamic backgrounds
- scene-independent environments
- weak motion boundaries
Instead of relying purely on implicit feature learning, this project investigates whether:
explicit temporal motion representation can improve change detection performance more effectively than increasing architectural complexity.
Given a sequence of video frames:
Frame(t-2), Frame(t-1), Frame(t)
the task is to predict a binary segmentation mask identifying:
foreground motion meaningful scene changes moving objects while suppressing background noise.
The project uses video sequences inspired by the CDnet2014-style change detection benchmark.
Each scene contains:
input/
groundtruth/
The pipeline automatically:
- handles frame ordering
- aligns ground-truth masks
- filters missing annotations
- constructs temporal samples
The core contribution of this project is the use of explicit temporal differencing.
Instead of feeding raw stacked frames directly into the network, temporal motion is explicitly modeled using:
diff1 = abs(Frame(t) - Frame(t-1))
diff2 = abs(Frame(t) - Frame(t-2))
These difference maps are concatenated to form the final input tensor.
This significantly improved motion localization compared to implicit temporal learning.
The segmentation model consists of:
- Encoder
- ResNet18 backbone
- modified for 6-channel temporal input
- Decoder
- lightweight U-Net style decoder
- progressive upsampling using transposed convolutions
The architecture performs dense foreground prediction at pixel level.
Temporal Frames
│
▼
Explicit Frame Differencing
│
▼
6-Channel Motion Representation
│
▼
ResNet18 Encoder
│
▼
U-Net Style Decoder
│
▼
Foreground Change Mask
This project involved multiple experimental explorations.
Initial experiments used simple temporal frame stacking without explicit differencing.
- weak motion understanding
- blurry segmentation
- poor localization
A decoder with progressive upsampling was introduced.
- significantly better spatial reconstruction
- improved segmentation quality
Explicit motion representation using frame differences was introduced.
Explicit temporal differencing contributed more to performance improvement than increasing architectural complexity.
This became the most effective component in the pipeline.
Lightweight temporal attention mechanisms were explored.
- marginal improvements
- explicit motion representation already captured most temporal information
Temporal order prediction was explored as a self-supervised pretraining task.
- limited gains
- explicit motion cues already provided strong supervision
Boundary-aware and edge-guided supervision strategies were tested.
- unstable optimization
- aggressive boundary weighting sometimes degraded segmentation quality.
The final experiments revealed several important insights:
Insight 1:
Explicit temporal representation is more effective than relying solely on implicit temporal feature learning.
Insight 2:
Increasing architectural complexity does not necessarily improve segmentation quality.
Insight 3:
Stable training and clean temporal representation are often more valuable than adding multiple advanced modules.
The final pipeline achieved:
- stable foreground detection
- scene-independent motion understanding
- meaningful object localization
while maintaining a relatively lightweight architecture.
Input Frame
- video scene frame
Ground Truth
- binary foreground mask
Prediction
- predicted foreground motion mask
Example outputs are available in:
sample_results/
Temporal-Change-Detection/
│
├── models/
│ └── model.py
│
├── utils/
│ └── dataset.py
│
├── experiments/
│ └── pretrain.py
│ └── dataset_verify.py
│
├── sample_results/
│
├── train.py
├── evaluate.py
├── requirements.txt
└── README.md
git clone <your_repo_link>
cd Temporal-Change-Detection
pip install -r requirements.txt
Python train.py
Python evaluate.py
Possible future extensions include:
- transformer-based temporal modeling
- optical flow integration
- multi-scale feature fusion
- temporal consistency constraints
- lightweight real-time deployment
- unsupervised motion segmentation
Through this project, the following practical insights were gained:
- temporal representation design
- segmentation model behavior
- effects of supervision strategies
- instability caused by aggressive loss engineering
- importance of evaluation consistency
- iterative experimentation in computer vision research
This project demonstrates that:
carefully designed temporal motion representation can substantially improve scene-independent change detection performance, often more effectively than simply increasing model complexity.
The work emphasizes experimentation, reasoning, and architectural understanding rather than focusing purely on benchmark optimization.