# Improved U2 Net-Based Surface Defect Detection Method for Blister Tablets
## 2 Related Works  
The traditional methods are mainly used to detect defects by feature extraction and classification. [PERSON] [9] used fast robust features to extract defective features of effervescent tablets and performed svm classification for detection. [PERSON] al. [10] used the OTSU method, that is, the global threshold image segmentation method, to process the image of the blister tablets and obtain the image of the defect. [PERSON] al. [11] used a Canny algorithm based on edge detection technology to detect the edge of blister tablets. [PERSON] al. [12] converted the image into hsv color space, divided the bubble-cap region and tablet region, extracted the corresponding feature parameters, and then used a BP neural network classification algorithm to identify the corresponding defects. Although this type of detection method can also better detect surface defects in blister sheets, it often relies on the use of traditional image processing methods or specific algorithms of this type. The detection results of this type of method are easily affected by noise and environment and are not robust and are easily disturbed. Due to the rapid development of deep learning for blister tablet defect detection, many methods have emerged. For example, [PERSON] et al. [13] used a Mask R-CNN model to detect hollow capsules. However, Mask R-CNN, in the face of a complex boundary may show misjudment or miscalculation. The complex inference time of the model is slow, and it is difficult to meet the needs of detection. [PERSON] [14] proposed a YOLOv5-DEI network model combining deformation convolution and void convolution to detect surface defects of tablets. In this kind of model, only the position of the defect can be obtained, but the shape and size of the defect cannot be obtained, and the calculation complexity is high.  
In order to accurately detect blister tablets, a semantic segmentation model was adopted in this paper [15; 16; 17; 18]. Semantic segmentation localizes defects at the pixel level, providing finer information about defect boundaries and shapes. This helps to accurately recognize and evaluate defects and can handle irregular and multi-scale defects. For example, [PERSON] et al. [19] developed an improved defect segmentation method for U2 Net, adjusted the expansion factor of the mixed expansion convolution of the residual module, and added the coordinate attention mechanism in the last layer of all Rsu, which reduced the influence of the residual blocks in the coding and decoding process of the original network and improved the model's detection effect on scratches. [PERSON] et al. [20] proposed a U2 Net-based defect detection algorithm for metal surfaces and designed a U-shaped attention coding module which can increase the weight of defect area during coding, suppress background noise, and enhance the detection effect. [PERSON] et al. [21] improved the original residual module by using depth-separable convolution and proposed a new residual module to enhance crack detection on the surface of concrete structures.  
Inspired by the above, this paper uses the large kernel attention mechanism combined with the RSU module of U2 Net to improve the detection capability of the U2 Net model and proposes a loss function composed of Gaussian Laplace and cross entropy to enhance the edge detection capability. Finally, the local mean method and OTSU method are used to improve the accuracy.