An open API service indexing awesome lists of open source software.

https://github.com/adityaghatkar1707-ui/anomaly_detectionupdatedcvpr2025

Updated Deep Learning-based Anomaly Detection (CVPR 2025 version) โ€” implemented using Python 3.13 and TensorFlow 2.20. Features CPU-only compatibility, improved data loading, and end-to-end training + testing via CMD interface.
https://github.com/adityaghatkar1707-ui/anomaly_detectionupdatedcvpr2025

ai anomaly-detection c3d deep-learning keras python python3 pythonprojects research surveillance tenserflow

Last synced: about 1 month ago
JSON representation

Updated Deep Learning-based Anomaly Detection (CVPR 2025 version) โ€” implemented using Python 3.13 and TensorFlow 2.20. Features CPU-only compatibility, improved data loading, and end-to-end training + testing via CMD interface.

Awesome Lists containing this project

README

          

๐Ÿš€ Anomaly Detection in Surveillance Videos (Updated CVPR 2025)

This is an updated and working version of the CVPR 2018 Anomaly Detection project by Waqas Sultani et al., rewritten for modern Python 3.13, TensorFlow 2.20.0, and Keras.
The original code used Theano and outdated Keras 1.x; this version runs successfully on Windows using CPU.

๐Ÿง  About the Project

The system detects abnormal activities in surveillance videos (e.g., accidents, explosions, thefts) using C3D feature representations.
Our implementation performs both training and testing from pre-computed feature text files and achieves accurate anomaly prediction via CMD interface.

๐Ÿ“‚ Folder Structure
AnomalyDetectionUpdatedCVPR2025/
โ”‚
โ”œโ”€โ”€ C3D_Features_Txt/
โ”‚ โ”œโ”€โ”€ Train/
โ”‚ โ”‚ โ”œโ”€โ”€ Abnormal/
โ”‚ โ”‚ โ””โ”€โ”€ Normal/
โ”‚ โ””โ”€โ”€ Test/
โ”‚
โ”œโ”€โ”€ TrainingAnomalyDetector_public.py
โ”œโ”€โ”€ Test_Anomaly_Detector_public.py
โ”œโ”€โ”€ trained_anomaly_model.h5
โ””โ”€โ”€ README.md

๐Ÿงฉ Dataset (Existing Pre-computed)

This implementation uses C3D pre-computed feature datasets from the original CVPR 2018 work:
๐Ÿ”— UCF Anomaly Detection Dataset (Official Link)
Each video is divided into 32 segments, and each segment contains a 4096-dimensional feature vector extracted from a C3D model.

โš™๏ธ Setup & Run

1๏ธโƒฃ Install dependencies
pip install tensorflow numpy scipy

2๏ธโƒฃ Train model
python TrainingAnomalyDetector_public.py

3๏ธโƒฃ Test model
python Test_Anomaly_Detector_public.py

๐Ÿงพ Example Output (CMD)
๐Ÿงพ Found 9 test feature files.
[1/9] Explosion008_C: mean_score=0.5379 โ†’ ABNORMAL
[9/9] Shoplifting028_C: mean_score=0.4916 โ†’ NORMAL
โœ… All test videos processed.

๐Ÿ“ˆ Improvements (Over Original 2018 Version)
Feature Original (2018) Updated (2025)
Backend Theano TensorFlow 2.20
Keras Version 1.1.0 Modern Keras API
Compatibility Linux only Windows + CPU compatible
Code Quality Legacy Clean, modular, and debugged
GPU Dependency Required Optional (CPU-only mode added)

๐Ÿงฉ Future Scope

Real-time visualization and alert system
Integration with LPR (License Plate Recognition)
Object and behavior detection
Dashboard for anomaly analytics
Migration from C3D โ†’ I3D / Transformer-based models

๐Ÿง‘โ€๐Ÿ’ป Author
Aditya Ghatkar
Third-Year Engineering Student | Research Enthusiast (AI & Deep Learning)

๐Ÿงพ Reference
Sultani, W., Chen, C., & Shah, M. (2018). Real-World Anomaly Detection in Surveillance Videos.
Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

๐Ÿงฉ Results (Proof of Concept โ€” Level 1)

This level demonstrates the working prototype of the Anomaly Detection System on CMD interface.
Training Output Example:
----------------------------------------------------------------------
โœ… Step 7: Starting training on CPU...
Epoch 1/5
8/8 โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 1s 14ms/step - loss: 1.6568
Epoch 2/5
8/8 โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 0s 14ms/step - loss: 1.4782
๐ŸŽ‰ Training completed successfully!
๐Ÿ’พ Model saved as trained_anomaly_model.h5
-----------------------------------------------------------------------

Testing Output Example:
-----------------------------------------------------------------------
๐Ÿงพ Found 9 test feature files.

[1/9] Explosion008_C: mean_score=0.5379 โ†’ ABNORMAL

[2/9] Explosion025_C: mean_score=0.3916 โ†’ NORMAL

[9/9] Shoplifting028_C: mean_score=0.4916 โ†’ NORMAL
โœ… All test videos processed.
โฑ๏ธ Total time: 0:00:01.669070
-----------------------------------------------------------------------

โœ… These results confirm that:
The model can train successfully using C3D features.
The system correctly classifies normal vs. abnormal events.
Proof of concept (POC) is complete and ready for visualization (Level 2).

๐Ÿ“Œ Summary Note
In Level 1 (POC) โ†’ you show:
It works (CMD results)
Accuracy or classification works
Training + Testing are functional