项目中文名
基于生成对抗网络的异常行为检测
作者
黄超
项目简介
1. 功能
实现复杂场景中异常行为的实时检测
2. 性能
数据集 |
AUC |
UCSD Ped2 |
95.4% |
平均检测速度为25fps. |
|
3. 评估指标
AUC
4. 使用数据集
UCSD Ped2
运行环境与依赖
代码运行的环境与依赖。如下所示:
类别 |
名称 |
版本 |
os |
ubuntu |
16.04 |
深度学习框架 |
pytorch |
>= 1.1 |
|
Python |
>= 3.6 |
|
tensorboardX |
|
|
cupy |
|
|
sklearn |
|
|
Other common packages. |
|
输入与输出
代码的输入与输出。如下所示:
名称 |
说明 |
输入 |
RGB图像。大小为256X256(宽x高) |
输出 |
异常分数。范围0到1,分数越大异常概率越大 |
运行方式
下载光流预训练模型链接:https://pan.baidu.com/s/1zP8jb3ew1iPSXsTczAdtIQ
提取码:25ro
将其放到/models/liteFlownet文件夹里
下载异常检测预训练模型链接:https://pan.baidu.com/s/19ClStpgDS26KcBccRDiKYg
提取码:5rud
将其放到/weights文件夹里
下载数据集链接:https://pan.baidu.com/s/1j0TEt-2Dw3kcfdX-LCF0YQ
提取码:i9b3
在terminal下运行以下命令。
Train
# Train by default with specified dataset.
python train.py --dataset=avenue
# Train with different batch_size, you might need to tune the learning rate by yourself.
python train.py --dataset=avenue --batch_size=16
# Set the max training iterations.
python train.py --dataset=avenue --iters=80000
# Set the save interval and the validation interval.
python train.py --dataset=avenue --save_interval=2000 --val_interval=2000
# Resume training with the latest trained model or a specified model.
python train.py --dataset=avenue --resume latest [or avenue_10000.pth]
# Train with Flownet2SD instead of lite-flownet.
python train.py --dataset=avenue --flownet=2sd
# Visualize the optic flow during training.
python train.py --dataset=avenue --show_flow
Use tensorboard
tensorboard --logdir=tensorboard_log/ped2_bs4
Evalution
# Validate with a trained model.
python evaluate.py --dataset=ped2 --trained_model=ped2_26000.pth
# Show and save the psnr curve and the difference heatmap between the gt frame and the
# generated frame during evaluating. This drops fps.
python evaluate.py --dataset=ped2 --trained_model=ped2_26000.pth --show_curve --show_heatmap