Siamese network with change awareness for surface defect segmentation in complex backgrounds

B Biyuan Liu (Key Laboratory of Environmental Pollution Control and Resource Reutilization in Xinjiang College of Ecology and Environment) S Sijie Luo H Huiyao Zhan Y Yicheng Zhou Z Zhou Huang H Huaixin Chen

Abstract

Abstract Despite the significant advancements made by deep visual networks in detecting surface defects at a regional level, the challenge of achieving high-quality pixel-wise defect detection persists due to the varied appearances of defects and the limited availability of data. To address the over-reliance on defect appearance and enhance the accuracy of defect segmentation, we proposed a Transformer-based Siamese network with change awareness, which formulates the defect segmentation under a complex background as change detection to mimic the human inspection process. Specifically, we introduced a novel multi-class balanced contrastive loss to guide the Transformer-based encoder, enabling it to encode diverse categories of defects as a unified, class-agnostic difference between defective and defect-free images. This difference is represented through a distance map, which is then skip-connected to the change-aware decoder, assisting in localizing pixel-wise defects. Additionally, we developed a synthetic dataset featuring multi-class liquid crystal display (LCD) defects set within a complex and disjointed background context. In evaluations using our proposed and two public datasets, our model outperforms leading semantic segmentation methods while maintaining a relatively compact model size. Furthermore, our model achieves a new state-of-the-art performance compared to semi-supervised approaches across various supervision settings. Our code and dataset are available at https://github.com/HATFormer/CADNet.

Article Details

Volume / Issue Vol. 15, Issue 1
Published April 07, 2025
ISSN 2045-2322
Publisher Nature Portfolio

Journal Info

Scientific Reports

Nature Portfolio

ISSN: 2045-2322 Open Access Life Sciences

Authors (6)

B

Biyuan Liu

Key Laboratory of Environmental Pollution Control and Resource Reutilization in Xinjiang College of Ecology and Environment

S

Sijie Luo

H

Huiyao Zhan

Y

Yicheng Zhou

Z

Zhou Huang

H

Huaixin Chen