How krmantavya/anomaly-detection-in-videos works
This is a research pipeline for detecting anomalous frames in UCSD pedestrian videos: prepare frames, derive CNN features, fit or apply a one-class SVM, then assess predictions. The sampled scripts show feature extraction and SVM evaluation together in the hyperparameter tool, plus separate preprocessing and evaluation utilities. The README mentions temporal data, but the available excerpts do not show a distinct temporal-modeling stage; the initialization scripts also depend on extractor and classifier modules absent from the tree, so those links are not inferred.
Main entry points: hyperparameter.py One-class SVM · MeanImage.npy Mean image · evaluate.py Prediction evaluation · computeMeanImage.py Mean image generation
Components 12
Frame Preparation
- RGB conversion
Scripts/convertToRGB.py - Mean image generation
Scripts/computeMeanImage.py - Mean image
Scripts/MeanImage.npy
Feature Modeling
- CNN feature extraction
Scripts/hyperparameter.py - CaffeNet definition
Models/bvlc_reference_caffenet/deploy.prototxt - One-class SVM
Scripts/hyperparameter.py - Saved classifiers
Classifier
Evaluation
- UCSD frame labels
TargetLabels/UCSDped1.m - Prediction evaluation
Scripts/evaluate.py - Parameter tuning
Scripts/hyperparameter.py - Feature visualization
Scripts/drawFigure.py
Other components
- Video frames
Connections 10
- Video frames → RGB conversion: converts TIFFs
Scripts/convertToRGB.py - Mean image generation → Mean image: saves mean
Scripts/computeMeanImage.py - Mean image → CNN feature extraction: normalizes input
Scripts/hyperparameter.py - CNN feature extraction → One-class SVM: provides features
Scripts/hyperparameter.py - One-class SVM → Parameter tuning: tests predictions
Scripts/hyperparameter.py - UCSD frame labels → Prediction evaluation: labels frames
- One-class SVM → Prediction evaluation: produces predictions
- CNN feature extraction → CaffeNet definition: uses definition
- One-class SVM → Saved classifiers: saves or loads
- One-class SVM → Feature visualization: supplies predictions