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.
- Host: GitHub
- URL: https://github.com/adityaghatkar1707-ui/anomaly_detectionupdatedcvpr2025
- Owner: adityaghatkar1707-ui
- License: mit
- Created: 2025-11-29T15:38:24.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-11-30T04:32:17.000Z (6 months ago)
- Last Synced: 2025-12-01T19:42:47.410Z (6 months ago)
- Topics: ai, anomaly-detection, c3d, deep-learning, keras, python, python3, pythonprojects, research, surveillance, tenserflow
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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