**4. Conclusions**

We put forward an attention-based approach to improve textured surface anomaly detection. A number of experiments demonstrate that our approach is quite insensitive to the imbalance of positive and negative samples; meanwhile, 100% detection results can be achieved without false alarms and missing detections on the original as well as the augmented DAGM 2007 dataset. Consequently, it can be expected that the proposed model will be further applied in the practical industrial scenes where the quantity of anomaly samples is usually limited. Finally, how to implement the quantitative comparison for the segmentation result under weak supervised labels will be the focus of our next work.

**Author Contributions:** Conceptualization, G.L. and N.Y.; methodology, G.L.; software, G.L.; resources, L.G.; writing-original draft preparation, G.L.; project administration and writing–review & editing, N.Y. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Acknowledgments:** We sincerely appreciate the contribution of the DAGM and GNSS institutions for the open dataset to promote the development of textured surface anomaly detection.

**Conflicts of Interest:** The authors declare no conflict of interest.
