All Projects → gudovskiy → cflow-ad

gudovskiy / cflow-ad

Licence: BSD-3-Clause license
Official PyTorch code for WACV 2022 paper "CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to cflow-ad

MVTec-Anomaly-Detection
This project proposes an end-to-end framework for semi-supervised Anomaly Detection and Segmentation in images based on Deep Learning.
Stars: ✭ 161 (+16.67%)
Mutual labels:  unsupervised, mvtec
ifl-tpp
Implementation of "Intensity-Free Learning of Temporal Point Processes" (Spotlight @ ICLR 2020)
Stars: ✭ 58 (-57.97%)
Mutual labels:  normalizing-flows
UDLF
An Unsupervised Distance Learning Framework for Multimedia Retrieval
Stars: ✭ 40 (-71.01%)
Mutual labels:  unsupervised
constant-memory-waveglow
PyTorch implementation of NVIDIA WaveGlow with constant memory cost.
Stars: ✭ 36 (-73.91%)
Mutual labels:  normalizing-flows
rgbd person tracking
R-GBD Person Tracking is a ROS framework for detecting and tracking people from a mobile robot.
Stars: ✭ 46 (-66.67%)
Mutual labels:  detection
CarND-VehicleDetection
vehicle detection with deep learning
Stars: ✭ 34 (-75.36%)
Mutual labels:  detection
opencv TLD
TLD:tracking-learning-detection 跟踪算法
Stars: ✭ 41 (-70.29%)
Mutual labels:  detection
AXI PCB defect detection
This repo contains data pre-processing, classification and defect detection methodologies for images from Advance XRay Inspection from multi-layer PCB boards. Proprietary AXI image dataset is not included in this repo. Users can use their own datasets on top of the OOP data extraction layer and neural network models implemented here.
Stars: ✭ 31 (-77.54%)
Mutual labels:  detection
detect-gpu
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
Stars: ✭ 749 (+442.75%)
Mutual labels:  detection
ARFaceFilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 72 (-47.83%)
Mutual labels:  detection
InvertibleNetworks.jl
A Julia framework for invertible neural networks
Stars: ✭ 86 (-37.68%)
Mutual labels:  normalizing-flows
detect-features
Detect and report browser and hardware features.
Stars: ✭ 63 (-54.35%)
Mutual labels:  detection
jeelizGlanceTracker
JavaScript/WebGL lib: detect if the user is looking at the screen or not from the webcam video feed. Lightweight and robust to all lighting conditions. Great for play/pause videos if the user is looking or not, or for person detection. Link to live demo.
Stars: ✭ 68 (-50.72%)
Mutual labels:  detection
face-mask-detection-tf2
A face mask detection using ssd with simplified Mobilenet and RFB or Pelee in Tensorflow 2.1. Training on your own dataset. Can be converted to kmodel and run on the edge device of k210
Stars: ✭ 72 (-47.83%)
Mutual labels:  detection
Normalizing Flows
Implementation of Normalizing flows on MNIST https://arxiv.org/abs/1505.05770
Stars: ✭ 14 (-89.86%)
Mutual labels:  normalizing-flows
RaspberryPi-4WD-Car
Yahboom 4WD smart robot with AI vision features for Raspberry Pi 4B
Stars: ✭ 31 (-77.54%)
Mutual labels:  detection
Awesome-Vision-Transformer-Collection
Variants of Vision Transformer and its downstream tasks
Stars: ✭ 124 (-10.14%)
Mutual labels:  detection
Log4j-CVE-Detect
Detections for CVE-2021-44228 inside of nested binaries
Stars: ✭ 33 (-76.09%)
Mutual labels:  detection
Scanr
Detect x86 shellcode in files and traffic.
Stars: ✭ 16 (-88.41%)
Mutual labels:  detection
DecisionAmbiguityRecognition
Deep learning AI, that recognizes when are people uncertain
Stars: ✭ 16 (-88.41%)
Mutual labels:  detection

PWC

CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows

WACV 2022 preprint:https://arxiv.org/abs/2107.12571

Abstract

Unsupervised anomaly detection with localization has many practical applications when labeling is infeasible and, moreover, when anomaly examples are completely missing in the train data. While recently proposed models for such data setup achieve high accuracy metrics, their complexity is a limiting factor for real-time processing. In this paper, we propose a real-time model and analytically derive its relationship to prior methods. Our CFLOW-AD model is based on a conditional normalizing flow framework adopted for anomaly detection with localization. In particular, CFLOW-AD consists of a discriminatively pretrained encoder followed by a multi-scale generative decoders where the latter explicitly estimate likelihood of the encoded features. Our approach results in a computationally and memory-efficient model: CFLOW-AD is faster and smaller by a factor of 10x than prior state-of-the-art with the same input setting. Our experiments on the MVTec dataset show that CFLOW-AD outperforms previous methods by 0.36% AUROC in detection task, by 1.12% AUROC and 2.5% AUPRO in localization task, respectively. We open-source our code with fully reproducible experiments.

BibTex Citation

If you like our paper or code, please cite its WACV 2022 preprint using the following BibTex:

@inproceedings{Gudovskiy_2022_WACV,
    author    = {Gudovskiy, Denis and Ishizaka, Shun and Kozuka, Kazuki},
    title     = {{CFLOW-AD}: Real-Time Unsupervised Anomaly Detection With Localization via Conditional Normalizing Flows},
    booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
    month     = {January},
    year      = {2022},
    pages     = {98-107}
}

Installation

Install all packages with this command:

$ python3 -m pip install -U -r requirements.txt

Datasets

We support MVTec AD dataset for anomaly localization in factory setting and Shanghai Tech Campus (STC) dataset with surveillance camera videos. Please, download dataset from URLs and extract to data folder or make symlink to that folder or change default data path in main.py).

Code Organization

  • ./custom_datasets - contains dataloaders for MVTec and STC
  • ./custom_models - contains pretrained feature extractors

Training Models

  • Run code by selecting class name, feature extractor, input size, flow model etc.
  • The commands below should reproduce our reference MVTec results using WideResnet-50 extractor:
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name bottle
python3 main.py --gpu 0 --pro -inp 256 --dataset mvtec --class-name cable
python3 main.py --gpu 0 --pro -inp 256 --dataset mvtec --class-name capsule
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name carpet
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name grid
python3 main.py --gpu 0 --pro -inp 256 --dataset mvtec --class-name hazelnut
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name leather
python3 main.py --gpu 0 --pro -inp 256 --dataset mvtec --class-name metal_nut
python3 main.py --gpu 0 --pro -inp 256 --dataset mvtec --class-name pill
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name screw
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name tile
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name toothbrush
python3 main.py --gpu 0 --pro -inp 128 --dataset mvtec --class-name transistor
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name wood
python3 main.py --gpu 0 --pro -inp 512 --dataset mvtec --class-name zipper

Testing Pretrained Models

  • Download pretrained weights from Google Drive
  • The command below should reproduce MVTec results using light-weight MobileNetV3L extractor (AUROC, AUPRO) = (98.38%, 94.72%):
python3 main.py --gpu 0 --pro -enc mobilenet_v3_large --dataset mvtec --action-type norm-test -inp INPUT --class-name CLASS --checkpoint PATH/FILE.PT

CFLOW-AD Architecture

CFLOW-AD

Reference CFLOW-AD Results for MVTec

CFLOW-AD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].