###### Abstract
At present, X-ray computed tomography (industrial CT) is commonly utilized for detecting contour offset defects in sample parts [18]. However, CT scanning necessitates the scanning of solid parts. While this detection method boasts high accuracy, the process is intricate and time consuming, precluding real-time detection. Consequently, further research is imperative to achieve online detection of contour defects based on forming layer images. The contour of the solidified region image is obtained by segmenting the solid pattern in the forming layer image. In recent years, computer vision methods based on Convolutional Neural Networks (CNNs) [19] have shown significant applications in two-dimensional and three-dimensional data processing [20]. Researchers have used CNNs to form different network architectures and parameter configurations for different research objectives [21; 22]. These excellent performance results have made CNNs widely employed across diverse domains. In terms of image processing, semantic segmentation methods exhibit superior batch image processing capabilities and higher recognition accuracy compared to traditional image segmentation methods [23]. The UNet semantic segmentation network was introduced by [PERSON] et al. [24] with a focus on the distinctiveness of medical image processing. This network demonstrates exceptional segmentation efficacy across various datasets through a fully symmetric encoder-decoder structure and fusion of features by layer-skipping connection. The remarkable performance of Transformer models in natural language processing has garnered attention from the computer vision field [25]. Vision Transformer (ViT) was proposed as the first application of pure Transformer modules in image classification [26]. Although ViT excels at global feature extraction, it lacks proficiency in extracting local features. Conversely, CNNs prioritize local information while neglecting global information during feature extraction. As such, researchers have integrated Transformer with CNNs to address existing issues within these two models. In the TransUNet network [27], CNNs and Transformer are connected sequentially as hybrid encoders, and high-resolution feature information is fused during upsampling via skip-connections. This model amalgamates characteristics from both UNet and Transformer while delivering commendable segmentation results. In this paper, we propose an image segmentation model based on TransUNet for achieving high-precision edge segmentation of LPBF solidified region images. The encoder part of the model comprises four modules: CNN, SE, ASPP, and Transformer. The addition of the SE module [28] is aimed at channel attention allocation, while the ASPP module [29] conducts multi-scale feature extraction to further enhance model segmentation performance. The model recognition effect is verified by CT images. The contour of the solidified region image segmented by the model and the CT slice image of the corresponding layer are extracted, and then the geometric feature statistics of the contour are compared and analyzed. This was performed in order to explore the feasibility of using the solidified region image by the segmentation model as contour defect detection. The main contributions are as follows:  
1. A SA-TransUNet segmentation model of an LPBF solidified region image is constructed based on a TransUNet semantic segmentation network combined with an SE attention mechanism and an ASPP multi-scale feature extraction module according to characteristics specific to LPBF solidified region images of the forming layer. The excellent segmentation accuracy of this model provides an important foundation for the accuracy of LPBF defect detection and the reliability of quality assessment. 2. The contours of the solidified region image segmented by this model and the slice image obtained by CT scanning are extracted, then their geometric features are compared after statistical analysis.