A Pytorch Re-Implement Trial (Not Official) of paper: Video Anomaly Detection by Estimating Likelihood of Representations
Unfortunately, I haven't got the accuracy as good as the paper mentioned.(maybe I have missed some details, any help will be appreciated)
Here are something you may think it's valuable.
- a better object-detector result can get better AUROC, (for example, large image size, regard smaller object box, use different conf-thres(train > test))
- I get same result as the author in Ped2, yet big margin in Avenue and ShanghaiTech (nearly less ten point)
- Score Calculation and Score Smoothing can get a great improvement(you can find more details in this repo )
pytorch >=1.5.0 ( I use 1.5.0 )
scikit-learn
The framework include Three Parts:
- dataset prepare, contain object detect(which I use yolov5) and computer dynamic image;
- train denoised auto-encoder;
- get feature cluster center(train GMM);
- caculate anomaly score(evaluate);
You can get the download link from here
- prepare data
python prepare_dataset.py
- train DAE
python train_DAE.py
- train GMM
python train_GMM.py
details about parameters seen in scripts
-
python evaluate.py
more visualization tools can find in notebook: test.ipynb
- try knowledge distillation
- try cluster loss
If you find this useful, please cite works as follows:
{ GMM_DAE,
author = {Wu Fan},
title = { A Implementation of {GMM-DAE} Using {Pytorch}},
year = {2020},
howpublished = {\url{https://github.com/wufan-tb/gmm_dae}}
}