Abstract:
In the X-ray digital images of soldering copper pipes with small diameter, the significant variations in size, shape, and contrast of soldering defect images make it difficult to achieve automatic defect recognition. To address this issue, we propose an improved defect segmentation model, AM-TransUNet, based on TransUNet, which combines multi-scale feature representation with the Biformer attention mechanism. The Res2Net module combined with the SimAM attention mechanism replaces the ResNet module in the encoder of the baseline TransUNet model, enhancing the model's multi-scale feature extraction capabilities and ability to capture local defect details in complex backgrounds. Additionally, the Biformer dynamic sparse attention mechanism is cascaded at the end of the encoder to improve detection speed and enhance the model's ability to capture global information. Experiments conducted on a constructed X-ray image dataset of small-diameter copper tubes demonstrate that the AM-TransUNet model achieves 2.8% and 3.2% higher precision and recall, respectively, compared to the baseline model. Moreover, the HD95 metric is reduced by 13.2, and the model shows superior sensitivity in detecting unfused defects with a radial dimension of 0.5 mm. The results indicate that the AM-TransUNet model has higher reliability in defect segmentation. Meanwhile, the detection speed of the AM-TransUNet model is improved by 9 frames per second over the baseline model, and the number of model parameters is reduced by 66 M.