TMCNet: A few-shot defect segmentation method based on triplet-based feature enhancement and multi-scale cascaded decoding
摘要
Surface defect detection plays a crucial role in industrial manufacturing, as it directly impacts whether a product meets the required standards. However, due to the scarcity of certain defect samples, traditional defect detection models often struggle to maintain satisfactory performance under data-limited scenarios. Although recent few-shot segmentation methods have made progress, they still face challenges in terms of segmentation accuracy and robustness. To address these limitations, this paper proposes a novel few-shot segmentation framework named TMCNet, which integrates triplet-based feature enhancement and multi-scale cascaded decoding. First, to enhance the representational power of target defect features in the support set, we introduce a triplet-based feature enhancement module (TBFE) that captures defects from three complementary perspectives: salient characteristics, local fine-grained details, and global contextual dependencies. This enables the construction of more discriminative and comprehensive defect representations. Second, to address the limited receptive field commonly encountered in the few-shot pipeline, we propose a multi-receptive field enhancement module (MRFE) that incorporates multi-scale dilated convolutions and a channel-spatial hybrid attention mechanism, thereby enriching semantic feature expression. Third, to better handle large variations in defect scale, we design a multi-scale cascaded decoder (MSCD) that progressively refines the segmentation output by fusing multi-scale predictions, leading to more precise and reliable defect delineation. Extensive comparative experiments on two industrial few-shot defect segmentation datasets—FSSD-12 and Surface Defects-4i—demonstrate the superior performance of TMCNet. Under the 1-shot setting, our method achieves mIoU scores of 67.8% and 42.3%, respectively, significantly outperforming existing state-of-the-art approaches. Moreover, a series of ablation studies validate the effectiveness and individual contributions of each proposed module, further confirming the design rationale and technical soundness of the overall framework.