# Improved U2 Net-Based Surface Defect Detection Method for Blister Tablets
## 5 Experiments and Analysis of Results
### Blister Tablets Visual Inspection Results
The improved U2 Net completely detected the scratch area in d(2); the position of the red box was accurate; the segmentation edge of d(3) was smooth; and the shape was completely consistent with the actual scratch, without noise interference. The Gaussian Laplace operator shows its powerful edge detection capability in Figure 10, allowing the improved U2 Net to accurately capture scratched edges when  
Figure 10: Surface scratches defect detection effect. (**C**) Surface scratches images before detection; (**a(1)**) Pspnet detection results; (**a(2)**) Pspnet detection and cropping results; (**a(3)**) Pspnet defect segmentation binary graph results; (**b(1)**) Deeplabv3 detection result; (**b(2)**) results of Deeplabv3 detection and cropping; (**b(3)**) results of Deeplabv3 defect segmentation binary graph; (**c(1)**) U2 Net test results; (**c(2)**) detection and cropping results of U2 Net; (**c(3)**) U2 Net defect segmentation binary graph results; (**d(1)**) improved U2 Net detection results; (**d(2)**) improved U2 Net detection and cropping results; (**d(3)**) improved U2 Net defect segmentation binary graph results. dealing with complex backgrounds, while LKA helps the model obtain more context information to ensure that the scratched area is fully detected. Figure 11 shows the detection of minor surface defects. Figure 11D is the original image before detection. As Figure 11 shows, only the improved U2 Net model can detect such minor defects. Figure 11d(2) is the result of the model test, and the defect area can be fully detected. d(3) is the binary graph of the model inspection, and the results show smooth edges and no noise. The LKA can adaptively weight features while expanding the receptive field, which significantly improves the network's ability to perceive the global context and subtle features. According to the specific performance of Figures 8-11, the improved U2 Net expands the receptive field by introducing LKA and improves the global context awareness capability. The edge detection is enhanced by the Gaussian Laplacian operator to ensure the smoothness of the segmentation boundary. The cross-entropy loss function improves the segmentation accuracy and reduces the noise. The local mean and OTSU methods enhance the adaptive segmentation ability of the model, so that it can maintain high-precision detec  
Figure 11: Minor defects surface defect detection. (**D**) Minor defects images before detection; (**a(1)**) Pspnet detection results; (**a(2)**) Pspnet detection and cropping results; (**a(3)**) Pspnet defect segmentation binary graph results; (**b(1)**) Deeplabv3 detection result; (**b(2)**) results of Deeplabv3 detection and cropping; (**b(3)**) results of Deeplabv3 defect segmentation binary graph; (**c(1)**) U2 Net test results; (**c(2)**) detection and cropping results of U2 Net; (**c(3)**) U2 Net defect segmentation binary graph results; (**d(1)**) improved U2 Net detection results; (**d(2)**) improved U2 Net detection and cropping results; (**d(3)**) improved U2 Net defect segmentation binary graph results. tion and segmentation under complex lighting and background conditions. The integration of these technologies enables the improved U2 Net to significantly outperform Pspnet, Deeplabv3, and the original U2 Net in surface defect detection, demonstrating greater detection accuracy and segmentation quality in scratches, stains, and subtle defect detection.