Giter VIP home page Giter VIP logo

fastflow's Introduction

FastFlow

An unofficial pytorch implementation of FastFlow: Unsupervised Anomaly Detection and Localization via 2D Normalizing Flows (Jiawei Yu et al.).

As the paper doesn't give all implementation details, it's kinda difficult to reproduce its result. A very close AUROC is achieved in this repo. But there are still some confusions and a lot of guesses:

Really appreciate the inspiring discussion with the community. Feel free to comment, raise new issues or PRs.

Installation

pip install -r requirements.txt

Data

We use MVTec-AD to verify the performance.

The dataset is organized in the following structure:

mvtec-ad
|- bottle
|  |- train
|  |- test
|  |- ground_truth
|- cable
|  |- train
|  |- test
|  |- ground_truth
...

Train and eval

Take ResNet18 as example

# train
python main.py -cfg configs/resnet18.yaml --data path/to/mvtec-ad -cat [category]
# a folder named _fastflow_experiment_checkpoints will be created automatically to save checkpoints

# eval
python main.py -cfg configs/resnet18.yaml --data path/to/mvtec-ad -cat [category] --eval -ckpt _fastflow_experiment_checkpoints/exp[index]/[epoch#].pt

Performance

As the training process is not stable, I paste both the performance of the last (500th) epoch and the best epoch.

AUROC (last/best) wide-resnet-50 resnet18 DeiT CaiT
bottle 0.987/0.989 0.975/0.979 0.931/0.959 0.926/0.976
cable 0.950/0.978 0.942/0.962 0.976/0.979 0.975/0.981
capsule 0.987/0.989 0.979/0.985 0.982/0.988 0.987/0.990
carpet 0.988/0.989 0.986/0.986 0.991/0.994 0.981/0.993
grid 0.991/0.993 0.973/0.985 0.965/0.980 0.968/0.970
hazel nut 0.957/0.984 0.922/0.963 0.982/0.990 0.981/0.992
leather 0.995/0.996 0.991/0.996 0.991/0.994 0.994/0.996
metal nut 0.968/0.986 0.950/0.966 0.980/0.988 0.977/0.984
pill 0.968/0.977 0.955/0.968 0.977/0.989 0.984/0.990
screw 0.969/0.987 0.952/0.957 0.990/0.990 0.991/0.993
tile 0.955/0.971 0.916/0.951 0.966/0.966 0.946/0.972
toothbrush 0.985/0.986 0.967/0.978 0.983/0.988 0.989/0.992
transistor 0.956/0.975 0.970/0.975 0.959/0.970 0.967/0.969
wood 0.948/0.964 0.894/0.954 0.960/0.963 0.950/0.959
zipper 0.980/0.987 0.969/0.979 0.966/0.974 0.972/0.984
MEAN 0.972/0.983 0.956/0.972 0.973/0.981 0.973/0.983
Paper 0.981 0.972 0.981 0.985

fastflow's People

Contributors

gathierry avatar jhvics1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.