Improved Segformer Fabric Defect Segmentation Algorithm Based on Gated Feature Fusion and Efficient Channel-Spatial Attention

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

Fabric defect segmentation is a critical task in industrial quality inspection, requiring high precision for small targets and blurred boundaries while meeting real-time detection demands. The Segformer model has gained attention for its balance between global context modeling and computational efficiency, but it still faces challenges in fabric defect segmentation: noise interference in multi-scale feature fusion, insufficient defect localization capability, and class imbalance between defect and background regions. To address these issues, this paper proposes an improved Segformer algorithm for fabric defect segmentation. First, a Gated Feature Fusion (GFF) module is designed to dynamically screen and fuse multi-scale features, reducing noise interference while compensating for missing detail and semantic information. Second, an Efficient Channel-Spatial Attention (ECSA) module is constructed to optimize feature weights in both channel and spatial dimensions, enhancing the model's focus on defect regions. Third, a hybrid loss function combining cross-entropy and Dice (DC Loss) is introduced to alleviate class imbalance, enabling the model to prioritize foreground defect regions during training. Experiments are conducted on a fabric defect dataset, and the results show that the proposed algorithm achieves a mean Intersection over Union (mIoU) of 78.67% and a mean Pixel Accuracy (mPA) of 86.02%, outperforming the original Segformer and other mainstream semantic segmentation models. It exhibits superior segmentation performance for small target defects.

Article activity feed