Surface defect inspection is a very challenging task in which surface defects usually show weak appearances or exist under complex backgrounds. Most high-accuracy defect detection methods require expensive computation and storage overhead, making them less practical in some resource-constrained defect detection applications. Although some lightweight methods have achieved real-time inference speed with fewer parameters, they show poor detection accuracy in complex defect scenarios. To this end, we develop a Global Context Aggregation Network (GCANet) for lightweight saliency detection of surface defects on the encoder-decoder structure. First, we introduce a novel transformer encoder on the top layer of the lightweight backbone, which captures global context information through a novel Depth-wise Self-Attention (DSA) module. The proposed DSA performs element-wise similarity in channel dimension while maintaining linear complexity. In addition, we introduce a novel Channel Reference Attention (CRA) module before each decoder block to strengthen the representation of multi-level features in the bottom-up path. The proposed CRA exploits the channel correlation between features at different layers to adaptively enhance feature representation. The experimental results on three public defect datasets demonstrate that the proposed network achieves a better trade-off between accuracy and running efficiency compared with other 17 state-of-the-art methods. Specifically, GCANet achieves competitive accuracy (91.79% $F_{\beta}^{w}$, 93.55% $S_\alpha$, and 97.35% $E_\phi$) on SD-saliency-900 while running 272fps on a single gpu.
翻译:表面缺陷检测是一项极具挑战性的任务,其中表面缺陷通常呈现弱外观或在复杂背景下存在。大多数高精度缺陷检测方法需要昂贵的计算和存储开销,在部分资源受限的缺陷检测应用中实用性较低。尽管一些轻量级方法以更少的参数实现了实时推理速度,但它们在复杂缺陷场景中检测精度较差。为此,我们提出一种基于编码器-解码器结构的全局上下文聚合网络(GCANet),用于轻量级表面缺陷显著性检测。首先,在轻量级骨干网络的顶层引入一种新型Transformer编码器,通过新型深度自注意力(DSA)模块捕获全局上下文信息。所提出的DSA在通道维度上进行逐元素相似度计算,同时保持线性复杂度。此外,在每个解码器模块前引入一种新型通道参考注意力(CRA)模块,以增强自底向上路径中多级特征的表示能力。所提出的CRA利用不同层级特征间的通道相关性,自适应地增强特征表示。在三个公共缺陷数据集上的实验结果表明,与其他17种现有最优方法相比,所提网络在精度与运行效率之间实现了更优的权衡。具体而言,GCANet在SD-saliency-900数据集上取得了具有竞争力的精度($F_{\beta}^{w}$为91.79%,$S_\alpha$为93.55%,$E_\phi$为97.35%),同时在单GPU上达到272fps的运行速度。