Abstract
Industrial metal defect detection is difficult to run in real time on edge devices with limited computing power. To solve this problem, we propose a new lightweight detection network based on Mamba for industrial defect detection applications. Firstly, we designed a MobileMamba backbone network, which includes a Mamba network with temporal characteristics and a focus on global features. Moreover, we adopted a multi-scale approach to further stimulate the characteristics of Mamba and enhance the feature extraction ability of the model. We also add a contrastive auxiliary loss function on the basis of model training to compare the differences between foreground features and background features, as well as the differences between real labels and negative samples. We also defined the difficult negative samples and the easy negative samples, and used the negative samples with the top K% similarity as the difficult negative samples to make the model pay more attention to the difficult negative samples during training. Experiments on the NEU-DET, GC10-DET, and APDDD datasets show that the efficiency of our model is higher than that of the detection models at the same level, and our nano model can reason in real time on edge devices with an accuracy rate higher than that at the same level.