## 2 Materials and Methods  
### Data Preparation  
In order to extract the edges of fine structural parts such as the lattices, EP-M250 equipment (Beijing e-Plus 3D Tech. Co., Ltd., Beijing, China) was used to prepare the samples, and the forming layer images during the molding process were collected by an industrial camera. The forming material was TC4 (Ti-6 Al-4V) titanium alloy powder. For the lattice structure with an inclined member shape in this experiment, the scanning power and scanning rate of the upper surface were larger than those of the lower surface during forming. The layer thickness was set to 50 \(\upmu\)m. The solidified region images were acquired using a DMK 33 UX183 high-resolution camera (The Imaging Source Asia Co., Ltd., Taipei, Taiwan) with a resolution of 20 million pixels and a pixel size of 2.4 \(\upmu\)m; specific parameters are shown in Table 1. Since the scanning laser needed to be installed directly above the powder bed, the camera was set up on the right side of the chamber top to monitor the process. The camera was calibrated before data acquisition to eliminate the image distortion caused by the camera field shift during lateral installation so that the surface state of the actual forming layer could map to the solidified region image.  
In the process of data acquisition, due to the time interval error caused by laser starting and stopping, some invalid data shown as a scraper sweep would be collected, and these invalid data would be deleted. At the same time, in order to avoid the overfitting of the model caused by overly single datasets, a small number of pictures collected during the forming process of other samples were added to the dataset. The 495 pictures selected were labeled by labelme 5.1.1. Due to the large laser energy in the forming process and the different solidification speed of the melt channels, there were problems of uneven gray level and unclear edge in the collected solidified region images; however, some of them were not defects, such as edge loss or adhesion. Therefore, according to the observation of the forming process and the prior knowledge, the image was divided into two categories: entity and background. The generated annotation file was converted into a 0-1 mask image, the pixel value of the background was 0, and the pixel value of the entity was 1.  
Due to the small amount of data, the verification set was omitted, and the dataset was divided into training set and test set according to the ratio of 4:1. In order to prevent the overfitting of the model and ensure the generalization ability of the model, we performed data augmentation on the dataset by horizontally flipping the entire set of images, randomly cropping the images to a size of 512 \(\times\) 512, and applying Gaussian blur to the images. The resolution of the captured images was 1056 \(\times\) 936 and 1460 \(\times\) 1460. The larger size would increase the number of network parameters, which would lead to training difficulties, so the size was uniformly scaled to 512 \(\times\) 512. The data collection and processing flow is shown in Figure 1.  
\begin{table}
\begin{tabular}{c c} \hline
**Model** & DMK 33 UX1183 \\
**Sensor Type** & Sony IMX1183 CLK-J \\
**Sensor Format** & 1 inch \\
**Resolution** & 5472 \(\times\) 3648 \\
**Pixel Size** & 2.4 μm \\
**Dynamic Range** & 12 bit \\
**Shutter** & 50 μm \(\sim\) 30 s \\ \hline \end{tabular}
\end{table}
Table 1: Camera parameter.  
Figure 1: Data preparation flowchart. (**a**) Schematic diagram of the installation of monitoring equipment; (**b**) forming layer images; (**c**) data-enhanced images.