Abstract
Video Anomaly Detection (VAD) is a fundamental challenge in computer vision, traditionally approached through frame reconstruction or future frame prediction. However, these methods often suffer from over-generalization or a failure to capture deep temporal dependencies. This paper presents a novel paradigm: video event restoration. By utilizing a U-shaped Swin Transformer Network with Dual Skip Connections (USTN-DSC), the proposed method learns to restore missing frames between sparse keyframes. This approach forces the model to master complex spatio-temporal patterns, making it highly sensitive to anomalies that deviate from learned normal behaviors. Experimental results on standard benchmarks demonstrate state-of-the-art performance and real-time processing capabilities.
Introduction
Video Anomaly Detection (VAD) involves identifying rare and unpredictable events—such as a vehicle on a pedestrian path or sudden aggressive movements—within a continuous stream of normal data. Despite its importance in surveillance and public safety, VAD remains a "needle in a haystack" problem due to the lack of large-scale annotated abnormal data.
Existing deep learning methodologies typically fall into two categories: reconstruction and prediction. Reconstruction-based autoencoders learn to recreate input frames, but they often generalize too well, inadvertently reconstructing anomalous events with low error. Prediction-based models attempt to guess the next frame based on a historical sequence; however, because adjacent frames are often highly similar, these models can "cheat" by copying pixels rather than learning the underlying scene dynamics. To address these limitations, we propose a shift toward a restoration-based task that requires a higher-level understanding of visual features and temporal context.
Methodology
The Video Event Restoration Task
Inspired by video compression techniques (specifically I, P, and B frames), the proposed framework introduces a restoration task. Instead of predicting a single future frame, the model is provided with three sparse "keyframes"—the first, middle, and last frames of a sequence. The network must then restore the entire missing event between these anchors. This task is significantly more difficult than simple prediction, as it requires the model to mine the evolutionary relationships and spatio-temporal dependencies of the scene.
USTN-DSC Architecture
The core of the system is the U-shaped Swin Transformer Network with Dual Skip Connections (USTN-DSC). The Swin Transformer backbone allows the model to capture long-range dependencies more effectively than standard CNNs. To enhance the restoration of both static and dynamic elements, the architecture incorporates two specific skip connections:
- Cross-Attention Connections: These help the decoder focus on dynamic, fast-moving objects by querying relevant features from the encoder.
- Temporal Upsampling (TU) Residuals: These assist in restoring static backgrounds and slow-moving objects by transferring detail-rich features directly across the network.
Adjacent Frame Difference (AFD) Loss
To ensure motion consistency without the heavy computational cost of optical flow, we introduce the Adjacent Frame Difference (AFD) loss. This loss function constrains the pixel-wise difference between adjacent restored frames to match the ground truth, ensuring that the temporal flow of the restored event is physically plausible.
Experimental Results
Datasets
The model was evaluated on three standard VAD benchmarks:
- UCSD Ped2: A dataset of pedestrian walkways with 16 training and 12 testing videos.
- CUHK Avenue: Featuring 16 training and 21 testing videos with anomalies like "throwing a bag" or "running."
- ShanghaiTech: A complex dataset involving 13 different scenes and 130 abnormal events, including robberies and fights.
Performance and Efficiency
The USTN-DSC model achieved state-of-the-art (SOTA) results on the Ped2 and Avenue datasets, reaching 98.1% AUC and 89.9% AUC, respectively. On the more challenging ShanghaiTech dataset, the model achieved a competitive 73.8% AUC without the need for complex assistive features like adversarial training or foreground object extraction.
Beyond accuracy, the model is highly efficient. Running on an NVIDIA RTX 3090, it processes video at 188 FPS, making it suitable for real-time monitoring applications.
Discussion and Conclusion
The success of the restoration paradigm lies in the principle that "harder tasks build smarter models." By removing the ability to rely on adjacent frame pixel-copying, the USTN-DSC is forced to learn the inherent logic of normal motion. Consequently, when an anomaly occurs, the model's learned logic fails, resulting in a high restoration error that serves as a robust signal for detection.
While the model performs exceptionally well on standard benchmarks, the ShanghaiTech dataset highlights the ongoing challenge of multi-scene environments with complex motion patterns. Future research will focus on optimizing the architecture to handle even greater environmental variability and exploring deeper Transformer blocks to further improve spatio-temporal modeling.
Summary updated