This is an unofficial implementation of the paper “Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection”.

Overview

STPM-Anomaly-Detection-Localization-master

This is an implementation of the paper Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection.

Datasets

MVTec AD datasets : Download from MVTec website

Environment

pip install -r requirements.txt

Usage

python main.py --phase 'train or test' --dataset_path 'D:/dataset/mvtec_anomaly_detection' --save_path 'path\to\save\results' --obj 'class name'

MVTecAD AUC-ROC score (mean of n trials)

Category Paper
(pixel-level)
This code
(pixel-level)
Paper
(image-level)
This code
(image-level)
carpet 0.988 0.988(1) - 0.999(1)
grid 0.990 0.980(1) - 0.925(1)
leather 0.993 0.989(1) - 1.0(1)
tile 0.974 0.919(1) - 0.979(1)
wood 0.972 0.926(1) - 0.988(1)
bottle 0.988 0.973(1) - 0.993(1)
cable 0.955 0.971(1) - 0.995(1)
capsule 0.983 0.963(1) - 0.818(1)
hazelnut 0.985 0.971(1) - 0.975(1)
metal nut 0.976 0.963(1) - 0.995(1)
pill 0.978 0.934(1) - 0.887(1)
screw 0.983 0.961(1) - 0.806(1)
toothbrush 0.989 0.978(1) - 0.989(1)
transistor 0.825 0.921(1) - 0.978(1)
zipper 0.985 0.969(1) - 0.899(1)
mean 0.970 0.960(1) 0.955 0.948(1)

Visualization examples

Acknowledgement

The code is partially adapted from STPM_anomaly_detection

You might also like...
MvtecAD unsupervised Anomaly Detection
MvtecAD unsupervised Anomaly Detection

MvtecAD unsupervised Anomaly Detection This respository is the unofficial implementations of DFR: Deep Feature Reconstruction for Unsupervised Anomaly

Pytorch reimplementation of PSM-Net:
Pytorch reimplementation of PSM-Net: "Pyramid Stereo Matching Network"

This is a Pytorch Lightning version PSMNet which is based on JiaRenChang/PSMNet. use python main.py to start training. PSM-Net Pytorch reimplementatio

An Implementation of SiameseRPN with Feature Pyramid Networks
An Implementation of SiameseRPN with Feature Pyramid Networks

SiameseRPN with FPN This project is mainly based on HelloRicky123/Siamese-RPN. What I've done is just add a Feature Pyramid Network method to the orig

Code for C2-Matching (CVPR2021). Paper: Robust Reference-based Super-Resolution via C2-Matching.
Code for C2-Matching (CVPR2021). Paper: Robust Reference-based Super-Resolution via C2-Matching.

C2-Matching (CVPR2021) This repository contains the implementation of the following paper: Robust Reference-based Super-Resolution via C2-Matching Yum

Implementation of momentum^2 teacher

Momentum^2 Teacher: Momentum Teacher with Momentum Statistics for Self-Supervised Learning Requirements All experiments are done with python3.6, torch

A Python implementation of the Locality Preserving Matching (LPM) method for pruning outliers in image matching.

LPM_Python A Python implementation of the Locality Preserving Matching (LPM) method for pruning outliers in image matching. The code is established ac

Official Implementation for the
Official Implementation for the "An Empirical Investigation of 3D Anomaly Detection and Segmentation" paper.

An Empirical Investigation of 3D Anomaly Detection and Segmentation Project | Paper Official PyTorch Implementation for the "An Empirical Investigatio

[ICCV 2021] FaPN: Feature-aligned Pyramid Network for Dense Image Prediction
[ICCV 2021] FaPN: Feature-aligned Pyramid Network for Dense Image Prediction

FaPN: Feature-aligned Pyramid Network for Dense Image Prediction [arXiv] [Project Page] @inproceedings{ huang2021fapn, title={{FaPN}: Feature-alig

(JMLR'19) A Python Toolbox for Scalable Outlier Detection (Anomaly Detection)
(JMLR'19) A Python Toolbox for Scalable Outlier Detection (Anomaly Detection)

Python Outlier Detection (PyOD) Deployment & Documentation & Stats Build Status & Coverage & Maintainability & License PyOD is a comprehensive and sca

Comments
  • 关于loss的问题

    关于loss的问题

    1. 目前的loss计算方法如下 f_loss = 0.5 * (ft_norm - fs_norm)**2 ave_loss = f_loss.sum() / (h*w) t_loss += ave_loss

    2. 我感觉这样做有些不合理,只是统计意义的最小,但是针对一些局部细节,并不一定能够做到很好。是否要考虑max value的限制呢

    opened by TimZhang001 0
  • Pretrained weights ?

    Pretrained weights ?

    Dear @xiahaifeng1995 , Thank you for such a nice implementation, your result is extremely great. I want to test it but I dont see where the pretrained weight is ?

    opened by trungpham2606 2
Owner
haifeng xia
haifeng xia
TF2 implementation of knowledge distillation using the "function matching" hypothesis from the paper Knowledge distillation: A good teacher is patient and consistent by Beyer et al.

FunMatch-Distillation TF2 implementation of knowledge distillation using the "function matching" hypothesis from the paper Knowledge distillation: A g

Sayak Paul 67 Dec 20, 2022
Real-Time-Student-Attendence-System - Real Time Student Attendence System

Real-Time-Student-Attendence-System The Student Attendance Management System Pro

Rounak Das 1 Feb 15, 2022
Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy" (ICLR 2022 Spotlight)

About Code release for Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy (ICLR 2022 Spotlight)

THUML @ Tsinghua University 221 Dec 31, 2022
Unofficial implementation of PatchCore anomaly detection

PatchCore anomaly detection Unofficial implementation of PatchCore(new SOTA) anomaly detection model Original Paper : Towards Total Recall in Industri

Changwoo Ha 268 Dec 22, 2022
Official PyTorch code for WACV 2022 paper "CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows"

CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows WACV 2022 preprint:https://arxiv.org/abs/2107.1

Denis 156 Dec 28, 2022
Pytorch implementation of Feature Pyramid Network (FPN) for Object Detection

fpn.pytorch Pytorch implementation of Feature Pyramid Network (FPN) for Object Detection Introduction This project inherits the property of our pytorc

Jianwei Yang 912 Dec 21, 2022
PyTorch code for ICLR 2021 paper Unbiased Teacher for Semi-Supervised Object Detection

Unbiased Teacher for Semi-Supervised Object Detection This is the PyTorch implementation of our paper: Unbiased Teacher for Semi-Supervised Object Detection

Facebook Research 366 Dec 28, 2022
pytorch implementation of "Contrastive Multiview Coding", "Momentum Contrast for Unsupervised Visual Representation Learning", and "Unsupervised Feature Learning via Non-Parametric Instance-level Discrimination"

Unofficial implementation: MoCo: Momentum Contrast for Unsupervised Visual Representation Learning (Paper) InsDis: Unsupervised Feature Learning via N

Zhiqiang Shen 16 Nov 4, 2020
The code repository for "RCNet: Reverse Feature Pyramid and Cross-scale Shift Network for Object Detection" (ACM MM'21)

RCNet: Reverse Feature Pyramid and Cross-scale Shift Network for Object Detection (ACM MM'21) By Zhuofan Zong, Qianggang Cao, Biao Leng Introduction F

TempleX 9 Jul 30, 2022
USAD - UnSupervised Anomaly Detection on multivariate time series

USAD - UnSupervised Anomaly Detection on multivariate time series Scripts and utility programs for implementing the USAD architecture. Implementation

null 116 Jan 4, 2023