Lightweight PCB Defect Detection Method Based on Multi-scale Features and Attention Mechanism
To address the issues of surface background interference in PCB defect detection and resource consumption caused by large detection models,a lightweight network model called SL-Unet is proposed for effective extraction of multi-scale and edge information in PCB surface defect detection.SL-Unet utilizes the U-Net structure as the backbone network.Firstly,the U-shaped residual structure is used to capture multi-scale information in each dimension of the backbone network,strengthening the communication between shallow and deep information,and introducing the DropBlock module to improve the model's gener-alization ability.Secondly,the edge information of the decoder is used to complete deep supervision,and a lightweight channel attention module is incorporated to enhance the feature dependence of edge information,guiding the backbone network to per-ceive the edge information of defects when extracting features.Then,a multi-level joint loss is constructed through the edge-aware module for the optimization of the overall model.Finally,the Leaky ReLU function is used to replace the ReLU function in the network,improving the model's feature extraction ability in the negative interval.Experimental results show that the Dice co-efficient,intersection over union,image detection frame rate and model size indicators of SL-Unet reach 79.3%,67.4%,22 frames/s and 3.46MB,respectively,greatly ensuring the lightweight of the model and significantly improving the detection accu-racy of PCB surface defect images.
deep supervisiondefect detectionlightweight networkattention mechanismU-Net