GithubHelp home page GithubHelp logo

lxmwust / mlf-sc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leapmind/mlf-sc

0.0 0.0 0.0 117 KB

Anomaly detection method that incorporates multi-scale features to sparse coding

Python 100.00%

mlf-sc's Introduction

MLF-SC: Incorporating Multi-Layer Features to Sparse Coding for Unsupervised Anomaly Detection

Actions Status Maintainability

MLF-SC (Multi-Layer Feature Sparse Coding) is an anomaly detection method that incorporates multi-scale features to sparse coding. This is a PyTorch implementation for MVTec datasets (Carpet, Grid, Leather, Tile, Wood, ...).

Output visualization of MVTec dataset (Grid, Hazelnut, and Bottle)

001-447078 010-390276 018-341679

Quick Start

git clone [email protected]:LeapMind/MLF-SC.git
pip3 install -r requirements.txt
python3 main.py train cfg/sample_config.yml
python3 main.py test cfg/sample_config.yml

Download Dataset

wget ftp://guest:[email protected]/mvtec_anomaly_detection/mvtec_anomaly_detection.tar.xz
tar -xvf mvtec_anomaly_detection.tar.xz 

Usage

You can train and test for each texture dataset.

Set dataset path to config.yml

Set root in config.yml to texture dataset path (like path/to/mvtec_anomaly_detection/carpet/).

Train

$ python3 main.py train cfg/config.yml

Test and Visualize Output

$ python3 main.py test cfg/config.yml

Contribution

Anomaly detection performance for the texture categories of the MVTec AD dataset. For each cell in the R1 / R2 columns, the ratio of correctly classified samples of normal R1 and that of anomalous images R2 are shown with R1 / R2 notation. The maximum averages (R1 + R2) / 2 are marked with boldface. The performance for the non-sparse-coding-based methods are cited from Table 2 of (Bergmann et al., 2019). The AUROC columns show only sparse coding and MLF-SC.

R1 / R2 AUROC
Category AE (SSIM) AE (L2) AnoGAN CNN
Feature Dictionary
Texture
Inspection
Sparse
Coding
MLF-SC
(Proposed)
Sparse
Coding
MLF-SC
(Proposed)
Carpet 0.43 / 0.90 0.57 / 0.42 0.82 / 0.16 0.89 / 0.36 0.57 / 0.61 0.43 / 0.79 1.00 / 0.98 0.58 0.99
Grid 0.38 / 1.00 0.57 / 0.98 0.90 / 0.12 0.57 / 0.33 1.00 / 0.05 0.76 / 0.72 1.00 / 0.88 0.89 0.97
Leather 0.00 / 0.92 0.06 / 0.82 0.91 / 0.12 0.63 / 0.71 0.00 / 0.99 0.84 / 0.96 0.97 / 0.97 0.95 0.99
Tile 1.00 / 0.04 1.00 / 0.54 0.97 / 0.05 0.97 / 0.44 1.00 / 0.43 0.94 / 0.60 0.94 / 0.76 0.86 0.92
Wood 0.84 / 0.82 1.00 / 0.47 0.89 / 0.47 0.79 / 0.88 0.42 / 1.00 0.84 / 0.60 0.95 / 0.98 0.97 0.99
Average 0.53 / 0.74 0.64 / 0.65 0.90 / 0.18 0.77 / 0.54 0.60 / 0.62 0.76 / 0.81 0.97 / 0.91 0.85 0.97

License

Non-commercial, research purposes only

License of dependent libraries

See LICENSE directory.

mlf-sc's People

Contributors

a-hanamoto avatar minux302 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.