Skip to content

rajatrayaraddi/multiple-instance-learning

Repository files navigation

Multiple Instance Learning for Detecting Crowd Behavior Anomalies in Surveillance Videos

This repository contains code and experiments for a novel Multiple Instance Learning (MIL)-based model for anomaly detection in surveillance videos. The model classifies video segments as anomalous or normal, leveraging spatio-temporal features extracted from video clips.

Overview

  • Designed a MIL-based architecture to capture temporal context and weakly-labeled training data.
  • Utilized I3D feature extraction for both RGB and optical flow representations of video segments.
  • Evaluated on a subset of the UCF-Crime dataset, achieving:
    • AUC = 0.9022, with high recall and precision, demonstrating strong performance in detecting rare anomalous events.

File Descriptions

  • main.py – Entry point for training and evaluation. Supports selection of learners, optimizers (e.g., Adam, AdamW), and training parameters such as number of epochs.
  • loss.py – Defines the custom loss function with adjustable sparsity and smoothness for anomaly detection tasks.
  • learner{2–9}.py – Contains different learner/classifier architectures, each varying in activation functions, depth, kernel size, and attention mechanisms.
  • dataset.py – Dataset loader that prepares input sequences.
  • fetch.py – Retrieves and displays metrics of the best-performing model after training.
  • visualization/vis.py – Provides visualization tools for predictions on video inputs. Paths can be modified to test the model on different videos.

Additional Artifacts

Model checkpoints, extracted I3D features, and detection visualizations can be found at Google Drive.

Draft Paper

A detailed write-up of this work is available on Zenodo.

License

This project is released under the MIT License.

About

Multiple Instance Learning based model to Detect Crowd Behavior Anomalies in Surveillance Videos

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages