# Improved U-Net++ with Patch Split for Micro-Defect Inspection in Silk Screen Printing
## 3 Improved U-Net++ with Patch-Split Method
### Micro Defect Inspection Architecture and Process  
In the case of silk screen prints, there are different types of products with different sizes. Therefore, a system for collecting product image data was utilized. The architecture of the system is illustrated in Figure 10. The components of the system include hardware for loading products, a 3-axis orthogonal robot that moves the vision camera to the shooting location, a vision camera that captures the product and creates an image that can be analyzed, a control for the vision camera, and PLC at the manufacturing site. The system consists of an AI edge PC capable of AI inference, a PLC that can control the 3-axis orthogonal robot and share the current situation with the AI Edge PC, and an AI server that can learn AI models by collecting and processing data from the cloud.  
A quality inspection process for microdefects is also proposed. The overall inspection process of the system is illustrated in Figure 11. The system can acquire images regardless of the product size. For this purpose, a 3-axis orthogonal robot that can move along the x- and y-axes was introduced. In addition, if the height of the product changes, it is possible to move the robot along the \(z\)-axis to correspond to the focus. The process starts when the field worker loads the product and presses the start button on the PLC panel. Through the PLC signal, the 3-axis orthogonal robot moves to the first imaging area. Upon arriving at the location, the PLC sends location information to the AI Edge PC that controls the lighting, thereby turning on the lighting at the desired temperature. Subsequently, it sends a shooting request signal to the camera connected to the AI Edge PC. The captured image is stored in the volatile memory of the camera. The data are sent to an AI Edge PC. The raw image created in this manner has 2448 \(\times\) 2048 pixels in the unprocessed state. Among the different types of defects in silk screen printing, we used blue light to detect defects that are not easily visible through the camera, such as scratches and dents. To maintain the external environment, a dark room in the form of a box was installed around the camera. Therefore, the raw image contained a shadow outside the product. To solve this problem, center crop was performed without loss of information. The cropped image had 1900 \(\times\) 1900 pixels. Then, to improve the defect detection performance, CLAHE preprocessing was performed and after patch split, resizing was applied to suit the AI analysis model to input size. The preprocessed image size was 1024 \(\times\) 1024 pixels. Subsequently, the proposed patch split described in Section 3.2 was performed. The patch image was composed of 256 \(\times\) 256 pixels, with a total of 16 sheets. Defects were detected using the improved U-Net++ model learned by applying the existing patch-split method to the image divided by patch level. A threshold value of 0.15 or more was indicative of  
Figure 10: Implemented systems for data acquisition, model training, and inference.  
defect. The results were generated from 16 patch images and the original image. In the case of the original image, because there was more than one product, a separate process was required to determine which product was defective. That is, a further division into product units was required. For this purpose, HoughLinesP was applied after applying Canny edge detection. The Canny edge detector is an edge detection operator that uses a multistage algorithm to detect a wide range of edges in images [32]. An example of Canny edge detection is shown in Figure 12. Thus, it was possible to determine which product was defective in the image. If a defect was detected for a product, the location information value was sent to the PLC so that the operator could easily check for the defect by stamping it. The same process was followed for all products.  
Figure 11: Proposed micro-defect detection process.  
Figure 12: Canny edge detection example.