READ (Reconstruction or Embedding based Anomaly Detection)
This repo is the pytorch version of READ, plz jump to https://git.openi.org.cn/OpenI/READ_mindspore for the mindspore version.
READ is an open source toolbox focused on unsupervised anomaly detection/localization tasks. By only training on the defect-free samples, READ is able to recognize defect samples or even localize anomalies on defect samples.
The purpose of this repo is to promote the research and application of unsupervised anomaly detection and localization algorithms. READ is designed to provide:
- A unified interface for encapsulating diverse anomaly localization algorithms
- High quality implementations of novel anomaly localization algorithms
- Templates for using these algorithms in a detailed task
In addition, READ provides the benchmarks for validating novel unsupervised anomaly detection and localization algorithms for MVTec AD dataset.
Changelog
- [Jan 25 2021] READ_pytorch v0.1.2 is Released!
- [Nov 07 2021] READ_pytorch v0.1.1 is Released!
- [May 08 2021] READ_pytorch v0.1.0 is Released!
Please refer to ChangeLog for details and release history.
Installation
Install the latest version from the master branch on OpenI
pip install -U git+https://git.openi.org.cn/OpenI/READ_pytorch
Please follow the Installation document to get a detailed instruction.
Getting Started
Please follow the Getting Started document to run the provided demo tasks.
Localization examples (based on READ)
Supported Algorithms
Results
Implementation results on MVTec
- Image-level anomaly detection accuracy (ROCAUC)
MVTec |
RIAD |
FAVAE |
SPADE-WR50X2 |
PaDiM-WR50X2 |
USTAD |
STPM |
SemiOrth-WR50X2 |
InTra |
PatchCore-WR50X2 |
CFlow-Vit |
Carpet |
0.654 |
0.642 |
0.819 |
0.996 |
0.886 |
0.844 |
0.996 |
0.430 |
0.988 |
0.966 |
Grid |
0.980 |
1.000 |
0.42 |
0.966 |
0.919 |
0.982 |
0.836 |
0.600 |
0.909 |
0.959 |
Leather |
0.982 |
0.706 |
0.94 |
1.000 |
0.748 |
0.989 |
1.000 |
0.964 |
1.000 |
1.000 |
Tile |
0.838 |
0.842 |
0.980 |
0.973 |
0.998 |
0.981 |
0.963 |
0.894 |
0.984 |
1.000 |
Wood |
0.861 |
0.879 |
0.979 |
0.987 |
0.952 |
0.997 |
0.989 |
0.897 |
0.986 |
0.997 |
All texture classes |
0.863 |
0.814 |
0.828 |
0.984 |
0.901 |
0.959 |
0.957 |
0.757 |
0.973 |
0.984 |
Bottle |
0.984 |
0.999 |
0.972 |
0.999 |
0.940 |
1.000 |
0.995 |
0.947 |
1.000 |
0.998 |
Cable |
0.543 |
0.942 |
0.857 |
0.880 |
0.478 |
0.874 |
0.779 |
0.562 |
0.959 |
0.700 |
Capsule |
0.836 |
0.712 |
0.873 |
0.896 |
0.785 |
0.911 |
0.835 |
0.479 |
0.950 |
0.911 |
Hazelnut |
0.904 |
0.999 |
0.907 |
0.950 |
0.939 |
0.986 |
0.973 |
0.776 |
0.997 |
1.000 |
Metal nut |
0.820 |
0.911 |
0.734 |
0.987 |
0.509 |
0.988 |
0.917 |
0.466 |
0.996 |
0.984 |
Pill |
0.789 |
0.779 |
0.785 |
0.935 |
0.798 |
0.982 |
0.744 |
0.554 |
0.948 |
0.978 |
Screw |
0.746 |
0.595 |
0.658 |
0.846 |
0.706 |
0.871 |
0.470 |
0.665 |
0.953 |
0.709 |
Toothbrush |
0.956 |
0.925 |
0.878 |
0.981 |
0.825 |
0.769 |
0.978 |
0.533 |
0.981 |
1.000 |
Transistor |
0.890 |
0.885 |
0.900 |
0.983 |
0.563 |
0.810 |
0.927 |
0.520 |
0.939 |
0.831 |
Zipper |
0.978 |
0.647 |
0.952 |
0.920 |
0.761 |
0.967 |
0.872 |
0.461 |
0.968 |
0.917 |
All object classes |
0.845 |
0.839 |
0.852 |
0.9377 |
0.730 |
0.916 |
0.849 |
0.596 |
0.969 |
0.903 |
All classes |
0.851 |
0.831 |
0.844 |
0.953 |
0.787 |
0.930 |
0.885 |
0.650 |
0.970 |
0.930 |
- Pixel-level anomaly detection accuracy (ROCAUC)
MVTec |
RIAD |
FAVAE |
SPADE-WR50X2 |
PaDiM-WR50X2 |
USTAD |
STPM |
SemiOrth-WR50X2 |
InTra |
PatchCore-WR50X2 |
CFlow-Vit |
Carpet |
0.904 |
0.836 |
0.985 |
0.988 |
0.958 |
0.977 |
0.989 |
0.468 |
0.987 |
0.980 |
Grid |
0.984 |
0.994 |
0.978 |
0.969 |
0.850 |
0.983 |
0.860 |
0.631 |
0.978 |
0.963 |
Leather |
0.990 |
0.908 |
0.993 |
0.991 |
0.914 |
0.991 |
0.993 |
0.989 |
0.992 |
0.990 |
Tile |
0.761 |
0.626 |
0.942 |
0.940 |
0.948 |
0.969 |
0.935 |
0.873 |
0.945 |
0.950 |
Wood |
0.821 |
0.908 |
0.956 |
0.946 |
0.899 |
0.940 |
0.950 |
0.715 |
0.944 |
0.960 |
All texture classes |
0.892 |
0.854 |
0.971 |
0.967 |
0.914 |
0.972 |
0.945 |
0.735 |
0.969 |
0.969 |
Bottle |
0.945 |
0.962 |
0.968 |
0.982 |
0.902 |
0.983 |
0.977 |
0.806 |
0.978 |
0.979 |
Cable |
0.619 |
0.957 |
0.920 |
0.957 |
0.816 |
0.940 |
0.922 |
0.560 |
0.957 |
0.944 |
Capsule |
0.978 |
0.965 |
0.983 |
0.985 |
0.913 |
0.973 |
0.981 |
0.774 |
0.983 |
0.976 |
Hazelnut |
0.974 |
0.987 |
0.986 |
0.982 |
0.974 |
0.968 |
0.976 |
0.911 |
0.984 |
0.988 |
Metal nut |
0.828 |
0.953 |
0.969 |
0.972 |
0.891 |
0.954 |
0.949 |
0.753 |
0.963 |
0.984 |
Pill |
0.955 |
0.943 |
0.947 |
0.950 |
0.928 |
0.987 |
0.922 |
0.745 |
0.941 |
0.978 |
Screw |
0.984 |
0.960 |
0.992 |
0.984 |
0.967 |
0.983 |
0.949 |
0.785 |
0.981 |
0.973 |
Toothbrush |
0.966 |
0.984 |
0.989 |
0.988 |
0.947 |
0.982 |
0.989 |
0.692 |
0.986 |
0.986 |
Transistor |
0.813 |
0.907 |
0.861 |
0.973 |
0.687 |
0.806 |
0.958 |
0.657 |
0.885 |
0.895 |
Zipper |
0.981 |
0.817 |
0.982 |
0.983 |
0.825 |
0.987 |
0.975 |
0.497 |
0.986 |
0.962 |
All object classes |
0.904 |
0.944 |
0.960 |
0.976 |
0.885 |
0.956 |
0.960 |
0.718 |
0.964 |
0.967 |
All classes |
0.900 |
0.914 |
0.963 |
0.973 |
0.895 |
0.962 |
0.955 |
0.730 |
0.966 |
0.967 |
License
This project is released under the Open-Intelligence Open Source License V1.1.
Contact
Please contact me if there is any question (Chao Zhang chao.zhang46@tcl.com).
About
Machine Vision Group, TCL Corporate Research(HK) Co., Ltd is the main developer of READ.
Any contributions to READ is welcome!
Acknowledgement
A big thanks to Jinlai Ning (jinlai7@foxmail.com) for contributing codes about Semiorth and Intra.