Coder Social home page Coder Social logo

cfa_for_anomaly_localization's Introduction

CFA for Target-Oriented Anomaly Localization

PWC

PyTorch implementation of CFA: Coupled-hypersphere-based Feature Adaptation for Target-Oriented Anomaly Localization (CFA).

Getting Started

Install packages with:

$ pip install -r requirements.txt

Dataset

Prepare industrial image as:

train data:
    dataset_path/class_name/train/good/any_filename.png
    [...]

test data:
    dataset_path/class_name/test/good/any_filename.png
    [...]

    dataset_path/class_name/test/defect_type/any_filename.png
    [...]

How to train

Example

python trainer_cfa.py --class_name all --data_path [/path/to/dataset/] --cnn wrn50_2 --Rd False --size 224 --gamma_c 1 --gamma_d 1

Performance

WideResNet-50

R : resize. C : crop

R+C R CFA++
bottle 100 / 98.6 100 / 98.9 100 / 98.9
cable 99.8 / 98.7 99.8 / 99.0 99.8 / 99.0
capsule 97.3 / 98.9 99.2 / 99.1 99.2 / 99.1
carpet 99.5 / 98.7 99.4 / 99.0 99.5 / 99.0
grid 99.2 / 97.8 99.9 / 98.1 99.9 / 98.1
hazelnut 100 / 98.6 100 / 98.9 100 / 98.9
leather 100 / 99.1 100 / 99.3 100 / 99.3
metalnut 100 / 98.8 100 / 99.1 100 / 99.1
pill 97.9 / 98.6 97.9 / 98.8 97.9 / 98.8
screw 97.3 / 99.0 93.5 / 98.8 97.3 / 99.0
tile 99.4 / 95.8 100 / 96.3 100 / 96.3
toothbrush 100 / 98.8 97.2 / 99.1 100 / 99.1
transistor 100 / 98.3 100 / 98.4 100 / 98.4
wood 99.7 / 94.8 99.2 / 95.0 99.7 / 95.0
zipper 99.6 / 98.6 99.5 / 99.0 99.6 / 99.0
avg. 99.3 / 98.2 99.0 / 98.5 99.5 / 98.5

Reference

[1] https://github.com/byungjae89/SPADE-pytorch

[2] https://github.com/xiahaifeng1995/PaDiM-Anomaly-Detection-Localization-master

[3] https://github.com/pytorch/vision/tree/main/torchvision/models

[4] https://github.com/lukasruff/Deep-SVDD-PyTorch

cfa_for_anomaly_localization's People

Contributors

sungwool 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.