Skip to content

Anomaly detection autoencoder model with a focus on industrial images inspection.

License

Notifications You must be signed in to change notification settings

SulekBartek/Anomaly_detection_MVtec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anomaly Detection for Quality Control


python pytorch torchvision


Introduction

This notebook project aims to provide an easy-to-use implementation of a simple autoencoder model for detecting anomalies on defected parts or texture images, included in the MVTec industrial dataset. Presented method is unsupervised, the model is trained on defect-free images of one of the MVTec datasets and can detect various kinds of defects in the test images. As a loss function and also an evaluation metric, structural similarity index measure (SSIM) method have been used (SSIM Pytorch implementation).

Data

MVTec dataset consists of 17 subsets including jointly 5354 images of different objects and textures. Used datasets are available on the MVTec company website here.

Directory Structure

Downloaded datasets should be in directory data/
Required directory stucture:

├── metal_nut
│   ├── ground_truth
│   │   ├── bent
│   │   ├── color
│   │   ├── flip
│   │   └── scratch
│   ├── test
│   │   ├── bent
│   │   ├── color
│   │   ├── flip
│   │   ├── scratch
│   │   └── good
│   └── train
│       └── good
...

Dependencies

Main libraries used in this project:

  • torch >= 2.0.0
  • torchvision == 0.14.1
  • numpy == 1.22

For the rest of the dependencies take a look at requirements.txt.

Results

CAPSULE

GRID

BOTTLE

License

Project is licensed under the MIT License - see the LICENSE.md file for details

References

About

Anomaly detection autoencoder model with a focus on industrial images inspection.

Topics

Resources

License

Stars

Watchers

Forks