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

Predicting a person's gender based on their weight and height

Logistic Regression Advanced Case Study Gender Classification: Predicting a person's gender based on their weight and height 1. Introduction We turn o

1 Feb 01, 2022
PyTorch Implementations for DeeplabV3 and PSPNet

Pytorch-segmentation-toolbox DOC Pytorch code for semantic segmentation. This is a minimal code to run PSPnet and Deeplabv3 on Cityscape dataset. Shor

Zilong Huang 746 Dec 15, 2022
Implementation of the 😇 Attention layer from the paper, Scaling Local Self-Attention For Parameter Efficient Visual Backbones

HaloNet - Pytorch Implementation of the Attention layer from the paper, Scaling Local Self-Attention For Parameter Efficient Visual Backbones. This re

Phil Wang 189 Nov 22, 2022
Pytorch implementation of Distributed Proximal Policy Optimization: https://arxiv.org/abs/1707.02286

Pytorch-DPPO Pytorch implementation of Distributed Proximal Policy Optimization: https://arxiv.org/abs/1707.02286 Using PPO with clip loss (from https

Alexis David Jacq 163 Dec 26, 2022
Dilated RNNs in pytorch

PyTorch Dilated Recurrent Neural Networks PyTorch implementation of Dilated Recurrent Neural Networks (DilatedRNN). Getting Started Installation: $ pi

Zalando Research 200 Nov 17, 2022
Continual Learning of Long Topic Sequences in Neural Information Retrieval

ContinualPassageRanking Repository for the paper "Continual Learning of Long Topic Sequences in Neural Information Retrieval". In this repository you

0 Apr 12, 2022
HairCLIP: Design Your Hair by Text and Reference Image

Overview This repository hosts the official PyTorch implementation of the paper: "HairCLIP: Design Your Hair by Text and Reference Image". Our single

322 Jan 06, 2023
Cycle Consistent Adversarial Domain Adaptation (CyCADA)

Cycle Consistent Adversarial Domain Adaptation (CyCADA) A pytorch implementation of CyCADA. If you use this code in your research please consider citi

Hyunwoo Ko 2 Jan 10, 2022
Continuous Conditional Random Field Convolution for Point Cloud Segmentation

CRFConv This repository is the implementation of "Continuous Conditional Random Field Convolution for Point Cloud Segmentation" 1. Setup 1) Building c

Fei Yang 8 Dec 08, 2022
Poplar implementation of "Bundle Adjustment on a Graph Processor" (CVPR 2020)

Poplar Implementation of Bundle Adjustment using Gaussian Belief Propagation on Graphcore's IPU Implementation of CVPR 2020 paper: Bundle Adjustment o

Joe Ortiz 34 Dec 05, 2022
A Re-implementation of the paper "A Deep Learning Framework for Character Motion Synthesis and Editing"

What is This This is a simple re-implementation of the paper "A Deep Learning Framework for Character Motion Synthesis and Editing"(1). Only Sections

102 Dec 14, 2022
Machine learning framework for both deep learning and traditional algorithms

NeoML is an end-to-end machine learning framework that allows you to build, train, and deploy ML models. This framework is used by ABBYY engineers for

NeoML 704 Dec 27, 2022
Accelerated SMPL operation, commonly used in generate 3D human mesh, STAR included.

SMPL2 An enchanced and accelerated SMPL operation which commonly used in 3D human mesh generation. It takes a poses, shapes, cam_trans as inputs, outp

JinTian 20 Oct 17, 2022
Official Implementation of "Designing an Encoder for StyleGAN Image Manipulation"

Designing an Encoder for StyleGAN Image Manipulation (SIGGRAPH 2021) Recently, there has been a surge of diverse methods for performing image editing

749 Jan 09, 2023
Training data extraction on GPT-2

Training data extraction from GPT-2 This repository contains code for extracting training data from GPT-2, following the approach outlined in the foll

Florian Tramer 62 Dec 07, 2022
LSTMs (Long Short Term Memory) RNN for prediction of price trends

Price Prediction with Recurrent Neural Networks LSTMs BTC-USD price prediction with deep learning algorithm. Artificial Neural Networks specifically L

5 Nov 12, 2021
load .txt to train YOLOX, same as Yolo others

YOLOX train your data you need generate data.txt like follow format (per line- one image). prepare one data.txt like this: img_path1 x1,y1,x2,y2,clas

LiMingf 18 Aug 18, 2022
Pytorch Code for "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation"

Medical-Transformer Pytorch Code for the paper "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation" About this repo: This repo

Jeya Maria Jose 615 Dec 25, 2022
Self-Supervised Pillar Motion Learning for Autonomous Driving (CVPR 2021)

Self-Supervised Pillar Motion Learning for Autonomous Driving Chenxu Luo, Xiaodong Yang, Alan Yuille Self-Supervised Pillar Motion Learning for Autono

QCraft 101 Dec 05, 2022
Unofficial implementation of Pix2SEQ

Unofficial-Pix2seq: A Language Modeling Framework for Object Detection Unofficial implementation of Pix2SEQ. Please use this code with causion. Many i

159 Dec 12, 2022