DegardinBruno / human-self-learning-anomaly

Code for the paper "Human Activity Analysis: Iterative Weak/Self-Supervised Learning Frameworks for Detecting Abnormal Events", IJCB 2020
Other
42 stars 13 forks source link

License: CC BY-NC-SA 4.0

Human Activity Analysis: Iterative Weak/Self-Supervised Learning Frameworks for Detecting Abnormal Events

PWC PWC

This repository contains the code for the IJCB'20 paper "Human Activity Analysis: Iterative Weak/Self-Supervised Learning Frameworks for Detecting Abnormal Events"

Installation

pip install -r requirements.txt  # use flag --user if permission needed
Libraries version:

Preprocessing Dataset << highly recommended

In order to employ the WS/SS framework and apply self-supervision to your dataset, normalization is required since we are working with coupled deep learning networks working at different levels. Follow the steps inside the utils folder to successfully normalize your dataset.

Dataset and Directories Structure

The UBI-Fights Dataset provides a wide diversity in fighting scenarios with 1000 videos, where 784 are normal daily life situations and 216 contain a fighting event. This dataset is fully-annotated at the frame-level.
To train your model and employ self-supervision for each network, the following directory structure is created:

|-- **annotation
|   |-- strong                  // Insert here your .csv files to be used by the SS Model
|   |   |-- train.csv           // empty, to be filled by the WS Model and Bayesian Classifier
|   |   |-- test.csv
|   |   |-- val.csv
|   |   |-- unlabeled_set.csv   // Same remaining videos unlabeled from the weak, but in C3D raw segment format
|   |   |-- test_notes.csv
|   |   `-- val_notes.csv
|   `-- weak                    // Insert here your .csv files to be used by the WS Model
|       |-- train.csv           // Small percentage (i.e., 30%) of the original training set
|       |-- test.csv
|       |-- val.csv
|       |-- unlabeled_set.csv   // Remaining videos are unlabeled for self-supervision purposes
|       |-- test_notes.csv
|       `-- val_notes.csv
|-- models
|   |-- pattern_model
|   |   |-- 0                   // WSS framework iterations
|   |   |-- 1
|   |   |-- ...
|   |-- strong_model
|   |   |-- 0                   // WSS framework iterations
|   |   |-- 1
|   |   |-- ...
|   `-- weak_model
|       |-- 0                   // WSS framework iterations
|       |-- 1
|       |-- ...
`-- results         
    |-- pattern
    |   `-- VAL                 // Directory for validation stats
    |-- strong
    |   |-- FINAL               // Directory for test stats
    |   `-- VAL
    `-- weak
        |-- FINAL
        `-- VAL

Quick Start

Citation

Please cite this paper in your publications if it helps your research:

@inproceedings{degardin2020human,
  title={Human Activity Analysis: Iterative Weak/Self-Supervised Learning Frameworks for Detecting Abnormal Events},
  author={Degardin, Bruno and Proen{\c{c}}a, Hugo},
  booktitle={2020 IEEE International Joint Conference on Biometrics (IJCB)},
  pages={1--7},
  organization={IEEE}
}