Arman
All work

04 / Flagship case study

Machine learning / computer vision

CCTV Violence Anomaly Detection

An offline research pipeline comparing classical and deep-learning models for binary violence classification.

Research pipeline from CCTV frame input through preprocessing, model comparison, anomaly detection, evaluation, and offline alert output.
Offline research and evaluation pipeline
Type
Machine learning / computer vision
Status
Offline research
Core stack
Python / Jupyter Notebook / TensorFlow / Keras / MobileNetV2
Repository
Public repository

Project overview

This offline research project compares classical machine-learning and deep-learning approaches for binary violence and non-violence image classification. Its repository retains the frozen data splits, result tables, figures, notebook, and saved model artifacts used in the documented experiment.

01

From balanced image subset to offline evaluation

The workflow prepares a fixed image dataset, trains several model families, and compares them on one documented test partition.

Dataset preparation

Balanced 5,000-image subset: 2,500 images per class

Image processing

160 × 160 pixel inputs and frozen train, validation, and test partitions

Classical features

MLP, KNN, Random Forest, Logistic Regression, Linear SVM, and Isolation Forest

Deep learning

Small custom CNN and MobileNetV2 transfer learning

Evaluation

Accuracy, precision, recall, F1, ROC-AUC, and average precision

Offline outputs

Comparison tables, curves, confusion matrices, and alert demonstrations

System relationships

  1. The balanced working subset is split into 3,500 training, 750 validation, and 750 test images.
  2. Classical and deep-learning model families are trained and compared using the same documented evaluation outputs.
  3. The result is an offline experiment record, not a deployed surveillance decision system.

02

Eight approaches compared

Feature-based supervised models
MLP, KNN, Random Forest, Logistic Regression, and Linear SVM establish classical comparison points.
Unsupervised baseline
Isolation Forest provides an anomaly-detection comparison within the same binary experiment.
Deep-learning baselines
A small custom CNN and a MobileNetV2 transfer-learning model provide two image-model comparisons.

03

Reported MLP evaluation

The repository reports the MLP as the strongest model by F1 score in this experiment. Each figure below belongs to the balanced working subset and frozen 750-image test split.

94.93%

Accuracy / Multilayer perceptron

Dataset
Balanced 5,000-image working subset with 2,500 violence and 2,500 non-violence samples
Evaluation
Documented 750-image frozen test split after 3,500/750/750 train/validation/test partitioning
Limit
Offline experiment result; it does not establish production CCTV performance or real-time deployment behavior.

99.1%

ROC-AUC / Multilayer perceptron

Dataset
Balanced 5,000-image working subset with 2,500 violence and 2,500 non-violence samples
Evaluation
Documented 750-image frozen test split after 3,500/750/750 train/validation/test partitioning
Limit
Offline experiment result; it does not establish production CCTV performance or real-time deployment behavior.

04

A second model’s error distribution

The MobileNetV2 confusion matrix provides class-level context for a separate transfer-learning result on the same frozen test split.

MobileNetV2 transfer-learning confusion matrix on the documented 750-image frozen test split: 342 normal and 363 anomaly samples classified correctly, with 45 errors.
MobileNetV2 evaluation on the frozen test split

05

Research limits remain part of the result

  • The repository defines this as academic and research work, not a real-world surveillance, policing, or security decision system.
  • The models were evaluated on a limited image dataset; real CCTV analysis would require video-level temporal modeling and evaluation across unseen cameras and scene variation.
  • Any real deployment would require additional testing, fairness evaluation, privacy review, and human oversight.
  • The reported metrics do not establish real-time behavior or production CCTV performance.

06

Technical stack in the repository

  • Python
  • Jupyter Notebook
  • TensorFlow
  • Keras
  • MobileNetV2
  • scikit-learn