# MemSeg: A semi-supervised method for image surface defect detection using differences and commonalities

**Authors:** Minghui Yang, Peng Wu, Jing Liu, Hui Feng  
**arXiv:** [2205.00908](https://arxiv.org/abs/2205.00908)  
**Date:** 2022-05-02  
**Summary page:** https://www.summarizepaper.com/en/paper/2205.00908v1/

## Key points

- MemSeg is a semi-supervised method for detecting surface defects on industrial products
- It is an end-to-end memory-based segmentation network
- MemSeg introduces artificially simulated abnormal samples and memory samples to assist the learning process
- It explicitly learns the differences between normal and simulated abnormal images during training
- MemSeg uses a memory pool to store general patterns of normal samples, comparing similarities and differences with input samples for effective guesses about abnormal regions
- In the inference phase, MemSeg directly determines abnormal regions in an end-to-end manner
- Experimental validation shows state-of-the-art performance on MVTec AD datasets with high AUC scores at both image-level and pixel-level
- MemSeg has a significant advantage in inference speed, making it suitable for real-time applications in industrial scenarios

## Summary

The authors propose a semi-supervised method called MemSeg for detecting surface defects on industrial products. MemSeg is an end-to-end memory-based segmentation network that takes into account the small intra-class variance of products in the same production line. To assist the learning process, MemSeg introduces artificially simulated abnormal samples and memory samples. During the training phase, MemSeg explicitly learns the potential differences between normal and simulated abnormal images to obtain a robust classification hyperplane. Additionally, inspired by the mechanism of human memory, MemSeg uses a memory pool to store the general patterns of normal samples. By comparing the similarities and differences between input samples and memory samples in the memory pool, effective guesses about abnormal regions can be made. In the inference phase, MemSeg directly determines the abnormal regions of an input image in an end-to-end manner. Experimental validation shows that MemSeg achieves state-of-the-art performance on MVTec AD datasets with AUC scores of 99.56% and 98.84% at the image-level and pixel-level respectively. Furthermore, due to its end-to-end and straightforward network structure, MemSeg has a significant advantage in inference speed which makes it suitable for real time applications in industrial scenarios. Overall, MemSeg is a promising semi supervised method that effectively detects surface defects on industrial products by leveraging differences and commonalities between normal and abnormal samples.
