Coder Social home page Coder Social logo

algirdaskartavicius / mahalanobisad-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from byungjae89/mahalanobisad-pytorch

0.0 1.0 0.0 273 KB

PyTorch implementation of "Modeling the Distribution of Normal Data in Pre-Trained Deep Features for Anomaly Detection"

License: Apache License 2.0

Python 100.00%

mahalanobisad-pytorch's Introduction

Modeling the Distribution of Normal Data in Pre-Trained Deep Features for Anomaly Detection in PyTorch

PyTorch implementation of Modeling the Distribution of Normal Data in Pre-Trained Deep Features for Anomaly Detection.

This paper presents an anomaly detection approach that consists of fitting a multivariate Gaussian to normal data in the pre-trained deep feature representations, using Mahalanobis distance as anomaly score.
It is a simple yet effective approach and achieves SOTA on MVTec AD dataset.

Prerequisites

  • python 3.6+
  • PyTorch 1.5+
  • efficientnet_pytorch, sklearn, matplotlib

Install prerequisites with:

pip install -r requirements.txt

If you already download MVTec AD dataset, move a file to data/mvtec_anomaly_detection.tar.xz.
If you don't have a dataset file, it will be automatically downloaded during the code running.

Usage

To test this implementation code on MVTec AD dataset:

cd src
python main.py

After running the code above, you can see the ROCAUC results in src/result/roc_curve_{model_name}.png

Results

Below is the implementation result of the test set ROCAUC on the MVTec AD dataset.

Paper Implementation
bottle - 100.0
cable - 94.2
capsule - 92.3
carpet - 98.1
grid - 94.6
hazelnut - 98.6
leather - 100.0
metal_nut - 94.3
pill - 83.4
screw - 78.1
tile - 98.6
toothbrush - 96.7
transistor - 96.1
wood - 98.5
zipper - 97.7
Average 94.8 94.7

ROC Curve

roc

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.