MvtecAD unsupervised Anomaly Detection

Overview

MvtecAD unsupervised Anomaly Detection

This respository is the unofficial implementations of DFR: Deep Feature Reconstruction for Unsupervised Anomaly Segmentation

Result of 500 epochs trained model

Selects latent sizes of Autoencoder by PCA

Classes latent size Segmentation AUC Detection AUC
bottle 116 97.2771% 99.8413%
cable 557 95.5101% 84.8951%
capsule 162 98.8928% 97.3275%
carpet 245 97.9116% 90.5297%
grid 145 97.2484 79.5322%
hazelnut 459 98.5848% 100%
leather 325 98.8649% 95.4484%
metal_nut 380 96.127% 97.263%
pill 292 98.0543% 94.108%
screw 283 99.3001% 92.0066%
tile 557 89.4887% 91.7388%
toothbrush 243 98.6729% 91.3889%
transistor 333 83.9157% 89.0833%
wood 364 91.7027% 98.9474%
zipper 115 95.6663% 83.2983%
mean 95.8141% 92.3606

How to run

requirements

pytorch scikit-learn matplotlib numpy pandas PIL wget

Train

python main.py --mode          train      
               --data_dir_head [Datapath] 
               --BATCH_SIZE    [BATCH_SIZE] 
               --LR            [Learning Rate] 
               --EPOCH         [Epochs] 
               --backbone      [Feature map of Conv in VGG19]
               --latent_dim    [Latent size of CAE] 
               --classes       [Default is all] 

Download 500 Epochs Finetuned Models

Here provide the model of each classes in Drophox

python main.py --mode download                   

Evaluate the ROC-AUC of Test Set

python main.py --mode        evaluation    
               --classes     [Default is all] 

Inference the model

python main.py --mode           inference    
               --heatmap_path   [Input path] 
               --heatmap_item   [Class of input] 
               --heatmap_gt     [GT path Default is None]
               --device         [cpu or cuda]
               --device         [Output path ]         

Example run in main.py

if __name__ == "__main__":  
    cfg = config()
    cfg.mode = "inference"
    cfg.heatmap_path = 'mvtecad_unsupervise/bottle/test/broken_small/001.png'
    cfg.heatmap_item = 'bottle'
    cfg.heatmap_gt = 'mvtecad_unsupervise/bottle/ground_truth/broken_small/001_mask.png'
    cfg.device = 'cpu'
    cfg.heatmap_export = 'validate/Inferece.png'

validate/Inferece.png is

Code Reference

https://github.com/YoungGod/DFR

https://www.kaggle.com/danieldelro/unsupervised-anomaly-segmentation-of-screw-images

Character-Input - Create a program that asks the user to enter their name and their age

Character-Input Create a program that asks the user to enter their name and thei

PyLaboratory 0 Feb 06, 2022
Specificity-preserving RGB-D Saliency Detection

Specificity-preserving RGB-D Saliency Detection Authors: Tao Zhou, Huazhu Fu, Geng Chen, Yi Zhou, Deng-Ping Fan, and Ling Shao. 1. Preface This reposi

Tao Zhou 35 Jan 08, 2023
Pytorch implementation of "ARM: Any-Time Super-Resolution Method"

ARM-Net Dependencies Python 3.6 Pytorch 1.7 Results Train Data preprocessing cd data_scripts python extract_subimages_test.py python data_augmentation

Bohong Chen 55 Nov 24, 2022
Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders

Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders

1 Oct 11, 2021
《Dual-Resolution Correspondence Network》(NeurIPS 2020)

Dual-Resolution Correspondence Network Dual-Resolution Correspondence Network, NeurIPS 2020 Dependency All dependencies are included in asset/dualrcne

Active Vision Laboratory 45 Nov 21, 2022
✂️ EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video.

EyeLipCropper EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video. The whole process consists of three parts: frame extracti

Zi-Han Liu 9 Oct 25, 2022
Multi-Task Temporal Shift Attention Networks for On-Device Contactless Vitals Measurement (NeurIPS 2020)

MTTS-CAN: Multi-Task Temporal Shift Attention Networks for On-Device Contactless Vitals Measurement Paper Xin Liu, Josh Fromm, Shwetak Patel, Daniel M

Xin Liu 106 Dec 30, 2022
Event sourced bank - A wide-and-shallow example using the Python event sourcing library

Event Sourced Bank A "wide but shallow" example of using the Python event sourci

3 Mar 09, 2022
Image Completion with Deep Learning in TensorFlow

Image Completion with Deep Learning in TensorFlow See my blog post for more details and usage instructions. This repository implements Raymond Yeh and

Brandon Amos 1.3k Dec 23, 2022
Classification Modeling: Probability of Default

Credit Risk Modeling in Python Introduction: If you've ever applied for a credit card or loan, you know that financial firms process your information

Aktham Momani 2 Nov 07, 2022
Doing fast searching of nearest neighbors in high dimensional spaces is an increasingly important problem

Benchmarking nearest neighbors Doing fast searching of nearest neighbors in high dimensional spaces is an increasingly important problem, but so far t

Erik Bernhardsson 3.2k Jan 03, 2023
MMGeneration is a powerful toolkit for generative models, based on PyTorch and MMCV.

Documentation: https://mmgeneration.readthedocs.io/ Introduction English | 简体中文 MMGeneration is a powerful toolkit for generative models, especially f

OpenMMLab 1.3k Dec 29, 2022
YOLOv7 - Framework Beyond Detection

🔥🔥🔥🔥 YOLO with Transformers and Instance Segmentation, with TensorRT acceleration! 🔥🔥🔥

JinTian 3k Jan 01, 2023
A TensorFlow implementation of the Mnemonic Descent Method.

MDM A Tensorflow implementation of the Mnemonic Descent Method. Mnemonic Descent Method: A recurrent process applied for end-to-end face alignment G.

123 Oct 07, 2022
Code for the TIP 2021 Paper "Salient Object Detection with Purificatory Mechanism and Structural Similarity Loss"

PurNet Project for the TIP 2021 Paper "Salient Object Detection with Purificatory Mechanism and Structural Similarity Loss" Abstract Image-based salie

Jinming Su 4 Aug 25, 2022
BARF: Bundle-Adjusting Neural Radiance Fields 🤮 (ICCV 2021 oral)

BARF 🤮 : Bundle-Adjusting Neural Radiance Fields Chen-Hsuan Lin, Wei-Chiu Ma, Antonio Torralba, and Simon Lucey IEEE International Conference on Comp

Chen-Hsuan Lin 539 Dec 28, 2022
An Extendible (General) Continual Learning Framework based on Pytorch - official codebase of Dark Experience for General Continual Learning

Mammoth - An Extendible (General) Continual Learning Framework for Pytorch NEWS STAY TUNED: We are working on an update of this repository to include

AImageLab 277 Dec 28, 2022
An implementation of Geoffrey Hinton's paper "How to represent part-whole hierarchies in a neural network" in Pytorch.

GLOM An implementation of Geoffrey Hinton's paper "How to represent part-whole hierarchies in a neural network" for MNIST Dataset. To understand this

50 Oct 19, 2022
EPSANet:An Efficient Pyramid Split Attention Block on Convolutional Neural Network

EPSANet:An Efficient Pyramid Split Attention Block on Convolutional Neural Network This repo contains the official Pytorch implementaion code and conf

Hu Zhang 175 Jan 07, 2023
TensorFlow implementation of "Variational Inference with Normalizing Flows"

[TensorFlow 2] Variational Inference with Normalizing Flows TensorFlow implementation of "Variational Inference with Normalizing Flows" [1] Concept Co

YeongHyeon Park 7 Jun 08, 2022