Additive manufacturing powder laying defect recognition method and system based on channel gating and cross attention

CN122989596APending Publication Date: 2026-10-27XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611128511.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]本发明的目的在于克服现有技术中面临的单模态识别抗干扰能力弱、多模态特征融合不充分导致的微弱缺陷识别精度低、样本不均衡适配性差的挑战,提供一种基于通道门控与交叉注意力的增材制造铺粉缺陷识别方法及系统,实现SLM工艺中铺粉划痕、凸起缺陷的高精度分割识别与物理尺寸量化评估

Benefits of technology

本发明提供了一种基于通道门控与交叉注意力的增材制造铺粉缺陷识别方法及系统,包括如下步骤:获取SLM设备铺粉过程多模态数据并进行增强预处理操作;完成数据集标签标定并数据划分;构建多模态双流特征提取架构,融合铺粉图像与多通道传感时序信号的互补信息,摆脱传统单一视觉模态受成形仓光照不均、视觉畸变的局限,能够精准捕捉图像难以表征的早期铺粉工艺异常特征。其次,设计中层通道门控与瓶颈层交叉注意力多层级融合机制,针对划痕、凸起两类异质缺陷实现差异化特征增强,摒弃传统简单特征拼接模式,深度挖掘跨模态语义关联与空间对应关系,有效提升微弱缺陷特征表达能力,降低样本漏检水平。同时引入焦点损失与骰子损失复合优化策略,有效缓解铺粉图像背景占比大、缺陷像素稀疏带来的样本类别不均衡问题,强化模型对低对比度细微划痕等难样本的学习能力,避免分割断裂、边缘缺失等现象。在获取预测分割图后对其建立图像像素与SLM成形平台的几何映射模型,将像素级分割结果转化为缺陷实际面积、最大划痕长度、凸起等效直径等物理量化参数,能够为增材制造工艺调控和设备维护提供可靠依据。此发明方法及系统的整体模块化程度高、可拓展性强,可适应复杂工况下铺粉缺陷高精度、高可靠在位监测的实际工程需求,为在零件发生严重缺陷乃至最终报废前进行有效干预提供了关键决策支持,提升了SLM工艺的稳定性和成品的合格率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989596A_ABST
    Figure CN122989596A_ABST
Patent Text Reader

Abstract

The application provides an additive manufacturing powder laying defect identification method and system based on channel gating and cross attention, and belongs to the technical field of industrial quality monitoring and defect identification. By designing a multi-level fusion mechanism of middle-layer channel gating and bottleneck-layer cross attention, the method realizes differentiated feature enhancement for two types of heterogeneous defects, i.e. scratches and protrusions, deeply excavates cross-modal semantic correlation and spatial correspondence, effectively improves the weak defect feature expression capability, and reduces the sample missed detection level. After obtaining the predicted segmentation map, a geometric mapping model of the image pixel and the SLM forming platform is established, the pixel-level segmentation result is converted into physical quantitative parameters such as defect actual area, maximum scratch length, protrusion equivalent diameter and the like, which can provide reliable basis for additive manufacturing process regulation and equipment maintenance. The method provides key decision support for effective intervention before the part has serious defects or even is finally scrapped, and improves the stability of the SLM process and the qualified rate of the finished product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial quality monitoring and defect identification technology, specifically relating to a multimodal intelligent identification technology for powder spreading defects in laser selective melting process based on channel gating and cross-attention mechanisms. Background Technology

[0002] Selective Laser Melting (SLM), a core process in metal additive manufacturing, has been widely applied in high-end manufacturing fields such as aerospace, biomedicine, and new energy vehicles due to its unique advantages in manufacturing complex metal components. The powder spreading stage is a fundamental process in SLM forming. Affected by factors such as scraper wear, powder splashing, and thermal stress warping, it is highly susceptible to initial powder spreading defects such as scratches and localized protrusions. These defects exhibit a significant interlayer accumulation effect, easily inducing further porosity, cracks, part deformation, and even scraper collisions leading to machine shutdown, severely restricting the service performance and production stability of the formed parts.

[0003] Furthermore, existing SLM powder spreading defect identification technology still has many shortcomings: It relies heavily on single-vision modal monitoring, which is affected by the closed structure of the forming chamber and uneven lighting. The weak scratches and defects have low contrast and blurred edges, and are easily submerged by the powder texture background, resulting in a high defect detection rate. Existing multimodal recognition schemes mostly employ simple feature splicing and fusion, without designing differentiated feature enhancement mechanisms to address the heterogeneity in shape and scale of scratches and protrusions. This results in insufficient cross-modal fusion and correlation capabilities and limited recognition accuracy. The powder-laying defect samples have a serious class imbalance problem, with a very high proportion of normal background pixels and a very low proportion of effective defect pixels. Traditional single loss functions are easily dominated by a large number of simple background samples, making it difficult to learn the features of small defects and easily leading to problems such as segmentation breakage and holes.

[0004] Therefore, given the current situation where SLM powder spreading imaging suffers from weak defect features due to multiple interferences, uneven defect categories, and insufficient multimodal fusion effects and limited recognition accuracy, there is an urgent need to develop a high-precision intelligent recognition method that is adaptable to heterogeneous defects and has strong anti-interference and difficult sample learning capabilities, in order to solve the technical challenges currently faced in the field of in-situ monitoring of additive manufacturing. Summary of the Invention

[0005] The purpose of this invention is to overcome the challenges faced by existing technologies, such as weak anti-interference ability of single-modal recognition, low accuracy of weak defect recognition due to insufficient fusion of multimodal features, and poor adaptability of unbalanced samples. This invention provides a method and system for identifying powder layup defects in additive manufacturing based on channel gating and cross-attention, which enables high-precision segmentation and identification of powder layup scratches and protrusion defects in SLM process, as well as quantitative evaluation of their physical dimensions.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for identifying powder layup defects in additive manufacturing based on channel gating and cross-attention, comprising the following steps: A multimodal dataset of the laser selective melting powder spreading process is obtained, the multimodal dataset including powder spreading images, multi-channel sensor signals and corresponding defect labels; Adaptive correction and enhancement processing is performed on the acquired powder spreading images, and hybrid normalization enhancement is performed on the multi-channel sensor signals. The enhanced powder spreading images and the normalized multi-channel sensor signals are aligned, and a standardized multimodal sample set is constructed. A multimodal dual-stream feature extraction architecture is constructed, which independently encodes the powder-spreading image after the standardized multimodal sample set enhancement and the normalized multi-channel sensor signal, and extracts the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal in parallel. The extracted multi-scale spatial features and global physical features are input into a pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain the model segmentation map. The model segmentation map is mapped using a pixel-to-physical geometry mapping model to achieve quantitative evaluation of physical parameters; The defect segmentation model includes a mid-level channel gating module and a bottleneck layer spatial cross-attention module.

[0007] In the steps of performing adaptive correction and enhancement processing on the acquired powder-spreading image, performing hybrid normalization enhancement on the multi-channel sensor signal, aligning the enhanced powder-spreading image and the normalized multi-channel sensor signal, and constructing a standardized multimodal sample set, the method for performing adaptive correction and enhancement on the acquired powder-spreading image is as follows: eliminating perspective distortion of the powder-spreading image through homography matrix perspective transformation, and then after grayscale processing, fusing contrast-limited adaptive histogram equalization and adaptive gamma correction to complete image detail enhancement.

[0008] In the step of constructing a multimodal dual-stream feature extraction architecture, the powder-spreading image after centralized enhancement of standardized multimodal samples and the multi-channel sensor signal after normalization are independently encoded and the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal are extracted in parallel. The constructed dual-stream parallel feature extraction architecture includes an image branch and a sensor branch. The image branch uses ResNet-18 as the base encoder and outputs the multi-scale spatial features of the powder-spreading image after correction and enhancement through multi-layer downsampling, while retaining the mid-layer encoded features and the bottom-layer global features. The sensing branch employs a two-layer one-dimensional convolutional structure combined with a global average pooling structure to encode the hybrid normalized and enhanced multi-channel sensing signals into fixed-dimensional global physical features.

[0009] The method for inputting the extracted multi-scale spatial features and global physical features into a pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain the model segmentation map is as follows: A mid-level channel gating module is set up, and adaptive channel weights are generated based on global physical features to perform channel recalibration on the mid-level coding features of multi-scale spatial features, so as to obtain the mid-level coding feature map after channel recalibration. A bottleneck layer spatial cross-attention module is introduced, which uses the bottom-level global features as queries and the global physical features as keys. Spatial attention weights are generated through similarity calculation to obtain the fused bottom-level feature map, thereby achieving cross-modal semantic and spatial deep fusion. A multi-scale decoding structure combining encoder-decoder and skip connections is adopted to perform step-by-step upsampling decoding on the recalibrated middle-layer encoded feature map and the fused bottom-layer feature map to restore image resolution and output pixel-level defect segmentation masks for three categories: normal, scratch, and protrusion.

[0010] The method for setting up the intermediate channel gating module, generating adaptive channel weights based on global physical features, and recalibrating the intermediate-level encoded features of multi-scale spatial features to obtain the recalibrated intermediate-level encoded feature map is as follows: Let the mid-layer image coding feature map be... The global physical features of the input are processed through a multilayer perceptron. Generate channel enhancement weight coefficients :

[0011] In the formula: Use the Sigmoid activation function; ; The generated channel enhancement weight coefficients are applied to each channel of the intermediate image coding feature map to obtain the channel-recalibrated intermediate coding feature map, as expressed by the following formula:

[0012] In the formula: The symbol for element-wise multiplication; This is the adaptive enhancement coefficient.

[0013] The method of introducing a bottleneck layer spatial cross-attention module, using bottom-level global features as queries and global physical features as keys, generates spatial attention weights through similarity calculation, and obtains a fused bottom-level feature map, thus achieving cross-modal semantic and spatial deep fusion as follows: The underlying global feature map Linear mapping to query vector Global physical features are mapped to key vectors AND value vector The correlation between the two is calculated and an independent spatially gated weight map is generated using the Sigmoid activation function.

[0014] The generated gated weight map is used to perform multiplicative modulation on the underlying global feature map, and sensor semantic information is injected simultaneously to obtain the fused underlying feature map:

[0015] In the formula: Element-wise multiplication; multiplicative terms Residual enhancement for identity mappings; additive terms This enables precise injection of physical semantics into pixel coordinates.

[0016] The defect segmentation model is trained by constructing a composite loss function that combines focus loss and dice loss for model training and optimization.

[0017] In the step of mapping the model segmentation map through a pixel-to-physical geometry mapping model to achieve quantitative evaluation of physical parameters, the method for mapping the model segmentation map through a pixel-to-physical geometry mapping model is as follows: Define the effective forming area size of the laser selective melting printing platform as W×H, and the resolution of the input image captured by the vision sensor and preprocessed as w×h; define the spatial resolution coefficient δ and the unit pixel area coefficient. The pixel-physical geometry mapping model relationship is as follows:

[0018]

[0019] Physical area of ​​the segmentation diagram projected onto the surface of the forming layer The calculation formula is:

[0020] In the formula: Representing coordinates A pixel is considered defective if it is not defective, otherwise it is considered defective.

[0021] For scratch-like features, the maximum physical length is used for industrial evaluation; for raised defects, the equivalent physical diameter is used for quantification.

[0022] Secondly, the present invention provides an additive manufacturing powder layup defect identification system based on channel gating and cross-attention, comprising: Data acquisition module: used to acquire multimodal datasets of the laser selective melting powder spreading process, the multimodal datasets including powder spreading images, multi-channel sensor signals and corresponding defect labels; The data preprocessing module is used to perform adaptive correction and enhancement processing on the acquired powder spreading image, perform hybrid normalization enhancement on the multi-channel sensor signal, align the enhanced powder spreading image and the normalized multi-channel sensor signal, and construct a standardized multimodal sample set. Dual-stream feature extraction module: used to construct a multimodal dual-stream feature extraction architecture, independently encode the powder-spreading image after the standardized multimodal sample set enhancement and the normalized multi-channel sensor signal, and extract the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal in parallel. The defect segmentation module is used to input the extracted multi-scale spatial features and global physical features into the pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain the model segmentation map. Defect Quantification Assessment Module: Used to map the model segmentation map through a pixel-to-physical geometry mapping model to achieve quantitative assessment of physical parameters; The defect segmentation model includes a mid-level channel gating module and a bottleneck layer spatial cross-attention module.

[0023] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a method and system for identifying powder-laying defects in additive manufacturing based on channel gating and cross-attention, comprising the following steps: acquiring multimodal data of the powder-laying process in SLM equipment and performing enhanced preprocessing operations; completing dataset labeling and data partitioning; constructing a multimodal dual-stream feature extraction architecture, fusing complementary information from powder-laying images and multi-channel sensor time-series signals, overcoming the limitations of traditional single-vision modality due to uneven illumination and visual distortion in the forming chamber, and accurately capturing early powder-laying process anomalies that are difficult to characterize in images. Secondly, a multi-level fusion mechanism of mid-layer channel gating and bottleneck-layer cross-attention is designed to achieve differentiated feature enhancement for two types of heterogeneous defects: scratches and protrusions. This abandons the traditional simple feature splicing mode, deeply mining cross-modal semantic associations and spatial correspondences, effectively improving the ability to express weak defect features and reducing sample false negatives. Simultaneously, a composite optimization strategy of focus loss and dice loss is introduced to effectively alleviate the sample class imbalance problem caused by the large background proportion and sparse defect pixels in the powder-laying image, strengthening the model's learning ability for difficult samples such as low-contrast fine scratches, and avoiding phenomena such as segmentation breakage and edge loss. After obtaining the predicted segmentation image, a geometric mapping model between the image pixels and the SLM forming platform is established. The pixel-level segmentation results are converted into physical quantitative parameters such as the actual area of ​​defects, the maximum scratch length, and the equivalent diameter of protrusions, which can provide a reliable basis for additive manufacturing process control and equipment maintenance. This invention and its system have a high degree of modularity and strong scalability, and can adapt to the actual engineering needs of high-precision and high-reliability in-situ monitoring of powder-laying defects under complex working conditions. It provides key decision support for effective intervention before parts suffer serious defects or are ultimately scrapped, and improves the stability of the SLM process and the yield of finished products. Attached Figure Description

[0024] Figure 1 This is a flowchart of the additive manufacturing powder layup defect identification method based on channel gating and cross attention according to the present invention. Figure 2 This is a schematic diagram of the multimodal data augmentation preprocessing of the present invention; Figure 3 This is a schematic diagram illustrating the structural principle of the bottleneck layer spatial cross-attention module of the present invention. Figure 4 This is a schematic diagram of the SLM equipment and printing process used in this invention; Figure 5 This is a diagram illustrating the evolution of the powder-coated slice image with the number of printing layers in this invention. Figure 6 This is a typical sample image of multimodal enhancement after preprocessing enhancement operations in this invention; Figure 7 Comparison of original images, mask labels, and model segmentation and recognition results for some typical multimodal powder spreading samples of this invention; Figure 8This is a magnified comparison of different algorithms of the present invention in the task of identifying powder spreading defects in the case layer. Detailed Implementation

[0025] To further understand the content of this invention, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments are merely illustrative and not limiting of the invention.

[0026] Example 1 like Figure 1 As shown, an additive manufacturing powder layup defect identification method based on channel gating and cross-attention includes the following steps: S1: Obtain a multimodal dataset of the laser selective melting powder spreading process, wherein the multimodal dataset includes powder spreading images, multi-channel sensor signals and corresponding defect labels; S2: Perform adaptive correction and enhancement processing on the acquired powder spreading images respectively, perform hybrid normalization enhancement on the multi-channel sensor signals, align the enhanced powder spreading images and the normalized multi-channel sensor signals, and construct a standardized multimodal sample set. S3: Construct a multimodal dual-stream feature extraction architecture, independently encode the powder-spreading image after the standardized multimodal sample is enhanced, and the normalized multi-channel sensor signal is processed, and extract the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal in parallel. S4: Input the extracted multi-scale spatial features and global physical features into the pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain the model segmentation map; S5: Map the model segmentation map to a pixel-physical geometry mapping model to achieve quantitative evaluation of physical parameters; The defect segmentation model includes a mid-level channel gating module and a bottleneck layer spatial cross-attention module.

[0027] Specifically, in step S1, multimodal raw data of the powder spreading process of selective laser melting (SLM equipment) is acquired, including powder bed image data after powder spreading, as well as multi-channel signal data reflecting the powder spreading state process, such as scraper torque, processing platform torque, X / Y axis galvanometer drive power, and X / Y axis servo current, and corresponding defect labels.

[0028] Specifically, in step S2, adaptive correction and enhancement processing is performed on the acquired powder spreading image, and hybrid normalization enhancement is performed on the multi-channel sensor signal. The enhanced powder spreading image and the normalized multi-channel sensor signal are aligned, and a standardized multimodal sample set is constructed.

[0029] The image adaptive correction and enhancement strategy defined in this invention is applied to the powder-coated image data. The perspective distortion of the image is eliminated by homography matrix perspective transformation, and after grayscale processing, the image detail enhancement is completed by fusing contrast-limited adaptive histogram equalization and adaptive gamma correction.

[0030] For multi-channel sensor time-series signal data, a differentiated hybrid normalization method is adopted according to the physical attributes of the signal; for position-type signals, Min is used. Max linear normalization is used; torque and current signals are represented by Z-mode. Score standardization is performed, and peak noise is truncated using the Sigma criterion. At the same time, the powder-spreading image and sensor signal are aligned using a timestamp-back sliding window, generating a standardized multimodal sample set with uniform dimensions and time sequence matching.

[0031] Specifically, in step S3, a multimodal dual-stream feature extraction architecture is constructed, and the powder-spreading image after the standardized multimodal sample is enhanced and the multi-channel sensor signal after normalization are independently encoded, and the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal are extracted in parallel.

[0032] A dual-stream parallel feature extraction architecture is constructed, including an image branch and a sensing branch. The image branch uses ResNet-18 as the base encoder and outputs multi-scale spatial features of the powder-spreading image after multi-layer downsampling correction and enhancement, while retaining the mid-layer encoded features and the bottleneck layer (bottom layer) global features. The sensing branch adopts a two-layer one-dimensional convolution combined with a global average pooling structure to encode the multi-channel sensing signal after hybrid normalization enhancement into fixed-dimensional global physical features of sensing, thereby realizing the independent extraction of image spatial features and process physical features.

[0033] Specifically, in step S4, the extracted multi-scale spatial features and global physical features are input into a pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain a model segmentation map. The defect segmentation model includes a mid-level channel gating module and a bottleneck layer spatial cross-attention module.

[0034] S41: Set up a mid-level channel gating module to generate adaptive channel weights based on global physical features and perform channel recalibration on the mid-level encoded features of multi-scale spatial features. The core calculation formula is as follows: Let the mid-layer image coding feature map be... First, the global physical features of the input are processed by a multilayer perceptron (MLP). Generate channel enhancement weight coefficients :

[0035] In the formula: Use the Sigmoid activation function; This represents the global physical feature vector of the sensor. .

[0036] The generated channel enhancement weights are then applied to each channel of the intermediate-level image coding feature map, resulting in a channel-recalibrated intermediate-level coding feature map, achieving adaptive weighted enhancement of image feature channels. This is expressed by the following formula:

[0037] In the formula: The symbol for element-wise multiplication; This is the adaptive enhancement coefficient.

[0038] S42: Introduces a bottleneck layer spatial cross-attention module, using bottom-level global features as queries and global physical features as keys. Spatial attention weights are generated through similarity calculation, achieving cross-modal semantic and spatial deep fusion. The calculation formula is as follows: First, the underlying global feature map Linear mapping to query vector Global physical features are mapped to key vectors AND value vector The correlation between the two is calculated, and an independent spatially gated weighted graph is generated using the Sigmoid activation function. The calculation formula is as follows:

[0039] This weighting assigns an independent state determination to each pixel location, enabling more flexible capture of spatially uneven defect features.

[0040] Subsequently, the gating graph is used to perform multiplicative modulation on the underlying global feature map, and sensor semantic information is injected simultaneously to finally fuse the features. The calculation formula is:

[0041] In the formula: Element-wise multiplication; multiplicative terms Residual enhancement for identity mapping ensures the transfer of original image features; additive terms This enables precise injection of physical semantics into pixel coordinates.

[0042] S43: In the decoding stage, a multi-scale decoding structure combining encoder-decoder and skip connections is adopted to perform step-by-step upsampling decoding on the recalibrated middle-layer encoded feature map and the fused bottom-layer feature map to restore the image resolution and output three types of pixel-level defect segmentation masks: normal, scratch, and protrusion.

[0043] Furthermore, the method for training the defect segmentation model is as follows: A composite loss function that combines focus loss and dice loss is constructed for model training and optimization. The training process is as follows: First, the focus loss adjusts the loss contribution of easy and difficult samples by introducing a dynamic weighting factor, the expression of which is:

[0044] In the formula: The probability predicted by the model; The focusing parameter is set to 2.0 in this invention. This loss function model can effectively reduce the weight of a large number of easily classifiable background samples, forcing the network to focus on difficult samples such as thin scratches that are difficult to identify due to low contrast.

[0045] To further ensure the geometric integrity of the defect region, a dice loss based on region similarity is introduced. Unlike pixel-level classification, this loss function directly measures the overlap between the segmentation and recognition mask and the true defect label, and its formula is defined as follows:

[0046] In the formula: and These represent the true label value and the predicted value. Through this objective function, the model can maintain its sensitivity to the morphology of the target region even when defect pixels are extremely sparse.

[0047] This invention employs an adaptive weighting strategy to combine the two. The resulting composite loss function is: Its expression is as follows:

[0048] In the formula: λ is a learnable weighting coefficient. It is used to balance the contribution of hard sample focusing and region similarity optimization, and its value ranges from [0-1]. In this invention, the weighting coefficient λ = 0.4.

[0049] Preferably, the present invention further includes evaluating the segmentation effect of powder spreading defect segmentation, specifically through the following indicators to evaluate the defect identification and segmentation effect: Segmentation accuracy (mean intersection-to-union ratio):

[0050] Average F1 score:

[0051] Sample-level defect detection rate:

[0052] Sample-level defect false negative rate:

[0053] In the formula: , representing the total number of categories; The pixel region that the model predicts to be a defect; These are pixel areas that are actually defective; The number of pixels at the intersection of the predicted region and the real region ( ); The number of pixels in the union of the predicted region and the ground truth region ( ), , and This represents the number of true positive, false positive, and false negative pixels in category i. This represents the total number of pixels in the predicted region. This represents the total number of pixels in the actual region. and Let's consider the precision and recall for category i. These are the defect samples that were correctly detected; This represents the total number of all real defects in the dataset. False negatives (the number of defective samples that were missed by the model). A true positive (a defective sample correctly identified by the model).

[0054] Specifically, in step S5, the model segmentation map is mapped through a pixel-physical geometry mapping model to achieve quantitative evaluation of physical parameters.

[0055] A geometric mapping model between the SLM forming platform and the pixels of the segmented image is established, and the defect process parameters are quantitatively calculated through pixel physical scale conversion. For the spatial geometric mapping model, the effective forming area size of the SLM printing platform is defined as W×H (mm), and the resolution of the input image captured by the vision sensor and preprocessed is w×h (unit). Therefore, the spatial resolution coefficient δ (unit: and unit pixel area factor (unit ):

[0056]

[0057] For calculating the physical area of ​​powder-laying defects, the set of pixels belonging to category c (c=1 for powder-laying scratches, c=2 for warping protrusions) in the defect mask generated by the model segmentation prediction is defined as follows: The projected physical area of ​​this type of defect on the surface of the forming layer. The calculation formula is:

[0058] In the formula: Representing coordinates A pixel is considered defective if it is not present, and zero otherwise. The size of the physical area directly reflects the degree of damage to the powder coating quality and the scale of potential internal defects in the part.

[0059] For scratch-like features, the physical maximum length is used for industrial evaluation. Given the linear extension characteristics of powder-spreading scratches, a single area index cannot fully characterize their sensitivity to the degree of blade damage; therefore, the physical maximum length is introduced. The core criterion for determining whether a scraper has chipped or is severely worn.

[0060] set up Consists of n independent connected regions Composition, for any connected component Its circumscribed rectangle width in the image coordinate system is and The maximum physical length of the scratch in this image layer is defined as:

[0061] For warped protrusion defects, since their morphology is usually clustered, the risk of impact to the scraper mainly depends on their local radial dimension. This is determined by the equivalent physical diameter. Quantify it.

[0062] For a specific defective connected region Its pixel area is Assuming the region is an equivalent circle, its equivalent physical diameter is calculated using the following formula:

[0063] Finally, the maximum equivalent diameter of all protruding regions in this layer is taken. This serves as a risk assessment indicator for this layer. When When the thickness of the forming layer approaches or exceeds the required thickness, the system will trigger an early alarm or force a shutdown.

[0064] The above mapping formula model can automatically output quantitative indicators such as the actual area of ​​defects, the maximum scratch length, and the equivalent diameter of protrusions, meeting the needs of industrial process evaluation and equipment operation and maintenance decision-making.

[0065] Example 2 An additive manufacturing powder layup defect recognition system based on channel gating and cross-attention is disclosed to implement the additive manufacturing powder layup defect recognition method based on channel gating and cross-attention described in the aforementioned embodiments, thereby realizing defect segmentation and quantification. Specifically, it includes: a data acquisition module, a data preprocessing module, a dual-stream feature extraction module, a defect segmentation module, and a defect quantification and evaluation module. The defect segmentation module includes a channel gating enhancement module, a cross-attention fusion module, a multi-scale decoding segmentation module, and a model training and optimization module. Related processes are referenced. Figure 1 As shown.

[0066] The data acquisition and preprocessing module, such as Figure 2 As shown, it is used to acquire the original image of SLM powder spreading and multi-channel sensor time-series signals. Perspective transformation correction, CLAHE equalization, and adaptive gamma image enhancement are sequentially performed on the powder spreading image. Min is applied to the multi-channel sensor time-series signals according to their physical properties. Max linear normalization, Z Score standardization was performed, and spike noise was truncated using the Sigma criterion. At the same time, spatiotemporal alignment of images and sensor signals was completed based on timestamp backtracking sliding windows, thus constructing a standardized multimodal dataset and corresponding defect labels.

[0067] The dual-stream feature extraction module is configured with an image coding branch and a sensing coding branch. The image branch uses a ResNet-18 network as the basic encoder to extract multi-scale spatial features of the powder spreading image. The sensing branch uses a one-dimensional convolution combined with a global average pooling structure to encode multi-channel sensing time-series signals and output fixed-dimensional global physical features of the sensing, thereby realizing the parallel and independent extraction of image spatial features and process physical features.

[0068] The channel gating enhancement module incorporates a multilayer perceptron and a sigmoid activation unit. It receives the global physical features of the sensor output from the dual-stream feature extraction module, generates adaptive channel weight coefficients, and performs channel-by-channel weighting and calibration of the mid-layer features of the image to suppress interference from powder background texture and enhance the expression of low-contrast scratch defect features.

[0069] The principle of the cross-attention fusion module is as follows: Figure 3 As shown, it is used to map image features to query vectors and sensor features to key vectors. It generates pixel-level spatial attention weight maps by calculating feature similarity, completes deep interaction between cross-modal global semantics and image spatial location information, adaptively focuses on blocky warped protrusion defect regions, and outputs fused and enhanced features.

[0070] The multi-scale decoding and segmentation module adopts an encoder-decoder architecture with a skip connection structure to perform multi-scale upsampling decoding on cross-modal fusion features, gradually restore the image feature resolution, and output pixel-level defect segmentation mask results for three types: normal, scratch, and protrusion.

[0071] The model training and optimization module has a built-in unit for calculating focus loss, dice loss, and a composite loss function composed of the two. It is configured with an adaptive optimizer, an initial learning rate, and an number of iteration training rounds. It completes model iteration convergence and performance verification based on the mean intersection over union (mIoU), mF1 score, sample detection rate, and false negative rate evaluation indicators under test data.

[0072] The defect quantification assessment module incorporates an SLM forming platform and an image pixel geometric mapping model. Through the physical scale of a unit pixel and the pixel area conversion formula, it automatically calculates the actual projected area of ​​the defect, the maximum physical length of the scratch, and the equivalent physical diameter of the protrusion. This enables the quantitative assessment of powder-spreading defects from pixel-level segmentation to process physical parameters, providing data support for the quantitative control of additive manufacturing processes and the monitoring of part quality.

[0073] Example 3 This embodiment takes actual industrial SLM printing conditions as the research object and uses the BLT-S310 laser selective melting equipment from Xi'an Bright Laser Technologies Co., Ltd. to conduct experimental verification of the powder spreading defect recognition algorithm. A schematic diagram of the specific SLM equipment and printing process is shown below. Figure 4 As shown. The experimental printing material used was AlSi10Mg aluminum alloy powder prepared by Xi'an Ouzhong Materials Technology Co., Ltd. This material has excellent specific strength and thermophysical properties, and is widely used in the manufacturing of aerospace and military structural components. For the specific experimental hardware configuration, a 5-megapixel industrial camera was used, with a maximum image resolution of 2592×1944. Intermittent triggering acquisition was employed after each powder layer was laid; multi-channel sensor signal data, including scraper torque, processing platform torque, X / Y axis drive power, and X / Y axis servo current, were simultaneously acquired. Core process parameters: laser power 500W, unidirectional powder laying method, layer thickness 30 mm. The effective printed size is 250mm × 250mm × 400mm. Experimental data comes from actual printing tasks of multiple S310 machines, constructing the AM_S310 multimodal dataset, totaling 1200 sets of multimodal aligned samples, including 600 sets of normal powder spreading, 200 sets of scraper scratches, and 400 sets of warped protrusions, as shown in Table 1 below. Pixel-level mask annotation was performed using Labelme software to obtain the corresponding original labels, and the dataset was divided into training, validation, and test sets in an 8:1:1 ratio. Figure 5 The image shows the evolution of powder-spreading defects as the number of printing layers increases, visually illustrating how defects in the powder-spreading process develop from nothing to something and gradually worsen.

[0074] Table 1. Statistical results of AM_S310 multimodal sample set under various defect states.

[0075] S1 Multimodal Data Preprocessing and Sample Construction First, the acquired raw powder-spreading images and sensor signals undergo standardized preprocessing: the images are corrected for perspective distortion by perspective transformation, grayscale conversion, and enhanced with CLAHE and adaptive gamma correction, then uniformly scaled to 512×512×1 pixels; position-independent channels are removed, and the six sensor signals are resampled and normalized to a fixed 6×224 feature matrix. A time-stamped backtracking sliding window is used to complete the spatiotemporal constraint alignment process, achieving accurate matching between discrete image frames and continuous sensor time-series signals, constructing standardized multimodal samples, among which... Figure 6 The data from the 1880 layers of normal, defect-free samples and the 2787 layers of abnormal, defective samples of the S310 equipment shown in (a)-(j) are used as examples to demonstrate the multimodal samples after data augmentation preprocessing.

[0076] S2 Multimodal Defect Recognition Model Construction and Training This embodiment employs the proposed Hierarchical Fusion U-Net (HFUNet) multi-level fusion defect recognition network with channel gating and cross-attention. The network uses a dual-stream feature extraction architecture, where the image branch uses a classic residual structure as the encoder to extract multi-scale spatial features through layer-by-layer downsampling; the sensing branch uses a two-layer one-dimensional convolutional and global average pooling structure to extract temporal global features. A channel gating module is set in the encoding layer to adaptively calibrate the image channel weights using sensing features, effectively suppressing interference from powder background textures and enhancing low-contrast, weak scratch features. A spatial cross-attention module is introduced in the network bottleneck layer to achieve deep interaction between global semantic features and image spatial location information, accurately focusing on blocky, warped, and protruding defect regions.

[0077] The model training uses ImageNet pre-trained weights, which are common in the fields of machine vision and image recognition, for initialization, and is combined with an adaptive optimization strategy. The loss function adopts a composite loss form that combines focus loss and dice loss, which effectively solves the problem of class imbalance of powder-spreading defect samples and improves the segmentation and recognition accuracy of small defects.

[0078] S3 Defect Segmentation In this embodiment, multiple typical powder-spreading samples were selected for testing. The model's defect segmentation and multimodal recognition performance are as follows: Figure 7As shown. Furthermore, this embodiment employs a three-pronged evaluation system encompassing pixel-level, sample-level, and process-level metrics, selecting average intersection-over-union ratio (mIoU), average F1 score, sample detection rate, and sample false negative rate as core evaluation indicators. To fully verify the superiority of the method and the contributions of each module, the following representative methods were selected as comparative benchmarks, aiming to verify the superiority of the method and system from the dimensions of modal contribution and architectural module advancement. The comparative methods include: traditional single-modal image segmentation method 1 (using only powder-spreading images as input to verify the necessity of introducing sensor signal modalities), mainstream advanced image segmentation benchmark method 2 (using the mainstream Transformer as the encoder, representing the optimal level of pure visual segmentation algorithms), multimodal stitching and fusion benchmark method 3, ablation method 1 (using a channel fusion mechanism to replace the cross-attention module in the bottleneck layer of the network framework), ablation method 2 (removing the mid-layer feature fusion branch and retaining only the cross-attention mechanism in the bottleneck layer), and ablation method 3 (replacing the composite loss function with a cross-entropy loss function to verify the gain effect of the proposed composite loss function when processing unbalanced sample sets). The defect identification and segmentation results of each method on the AM_S310 dataset are shown in Table 2. Here, mIoU is the average intersection-union ratio (IU / U), mF1 is the average F1 score, IoU (normal) and IoU (defect) are the IU / U ratios of the normal and defective regions, respectively; SDR is the sample detection rate, and SMR is the sample false negative rate.

[0079] Table 2 Comparison of defect identification and segmentation results of different methods on the AM_S310 dataset

[0080] As shown in Table 2, the proposed method exhibits significant advantages on the AM_S310 dataset: its average intersection-over-union (mIoU) reaches 0.8017, the IoU index for powder-laying defects is improved to 0.7052, the sample detection rate is as high as 97.73%, and the false negative rate is only 2.27%. All core indicators are superior to all comparison and ablation schemes, proving that this method can more accurately identify powder-laying defects. Furthermore, ablation experiments demonstrate that channel gating, cross-attention, and composite loss all play key roles in improving the ability to identify weak defects. Therefore, the proposed method can effectively reduce the risk of false positives and false negatives, possessing excellent defect identification capabilities and engineering practicality.

[0081] Meanwhile, to further verify the superiority of the method of the present invention in handling complex backgrounds and fine defects, a typical layer containing large-area warped protrusions and multiple thin, discontinuous powder-spreading scratches was selected as the test sample. The segmentation results of each comparative method were locally magnified for comparison. Figure 8 As shown, this layer of samples contains both large areas of warped protrusions (dark red) and multiple thin, discontinuous powder-spreading scratches (bright green), making it highly difficult to identify.

[0082] As can be seen from the magnified comparison, comparison method 1 has a weak ability to capture slender scratches, and is prone to pixel breakage and missed detection; comparison method 2 is easily affected by noise at the scratch edges and has false alarms for raised defects; comparison method 3 lacks effective feature screening and does not completely identify fine scratches with low signal-to-noise ratio. In contrast, the segmentation results generated by the method of this invention are closest to the actual defect distribution, with continuous scratch lines, clear boundaries, and no obvious breakage or missed detection problems.

[0083] The comparison results of ablation methods further validated the necessity of each module. Ablation method 1 showed decreased spatial localization accuracy for scratches, ablation method 2 still exhibited scratch omissions, and ablation method 3 lacked sensitivity to small target defects. This invention achieves feature selection through channel gating, cross-layer complementarity through cross-attention, and addresses class imbalance by combining a composite loss function. While accurately locating large-area warping defects, it also demonstrates significant advantages in the continuous recognition of subtle scratch features, fully proving the detection performance and robustness of this invention's architecture in real-world industrial scenarios.

[0084] S4 Defect Quantitative Assessment This embodiment establishes a pixel-physical geometry mapping model to quantitatively characterize the defects in the segmentation results output by the model. For the selected equipment model, the actual size of its forming platform is 250mm × 250mm, and the image resolution is 512 × 512 pixels. Therefore, W = H = 250mm, w = h = 512px, and the calculation yields: This allows for the determination of the actual physical size corresponding to a unit pixel. Based on this mapping relationship, quantitative calculation methods are established for the maximum physical length of scratches, the equivalent diameter of protrusions, and the area of ​​defects. This enables accurate characterization of powder-laying defects from pixel-level segmentation results to actual physical sizes, providing a quantitative basis for process evaluation and quality control.

[0085] Based on the above mapping relationship, this embodiment conducted quantitative characterization tests on typical defect layers of different devices, and the quantitative results of some samples are shown in Table 3. , These are the actual and predicted values ​​of the maximum physical length of the scratch, respectively. , These are the actual and predicted values ​​of the equivalent diameter of the warped protrusion, respectively, and the defect area error is the relative error between the predicted defect area and the actual defect area.

[0086] Table 3. Comparison of quantitative indicators using this method on a subset of strata samples.

[0087] As can be seen from the data in the table, the method of the present invention exhibits high quantification accuracy in key indicators such as the physical length L of the scratch, the equivalent diameter D of the warped protrusion, and the total area of ​​the defect. In multiple randomly selected typical samples, the relative error of the defect area is controlled within 5%, and the area error of the complex defect sample is only 0.65%. This indicates that the method of the present invention can accurately extract defect edge information, effectively avoid the size distortion problem caused by pixel loss or over-segmentation, and the quantification results can reliably reflect the actual physical morphology of the powder-laying defect, providing an objective quantitative basis for SLM process evaluation, defect classification, and quality control.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for identifying powder layup defects in additive manufacturing based on channel gating and cross-attention, characterized in that, Includes the following steps: A multimodal dataset of the laser selective melting powder spreading process is obtained, the multimodal dataset including powder spreading images, multi-channel sensor signals and corresponding defect labels; Adaptive correction and enhancement processing is performed on the acquired powder spreading images, and hybrid normalization enhancement is performed on the multi-channel sensor signals. The enhanced powder spreading images and the normalized multi-channel sensor signals are aligned, and a standardized multimodal sample set is constructed. A multimodal dual-stream feature extraction architecture is constructed, which independently encodes the powder-spreading image after the standardized multimodal sample is enhanced and the multi-channel sensor signal after normalization, and extracts the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal in parallel. The extracted multi-scale spatial features and global physical features are input into a pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain the model segmentation map. The model segmentation map is mapped using a pixel-to-physical geometry mapping model to achieve quantitative evaluation of physical parameters; The defect segmentation model includes a mid-level channel gating module and a bottleneck-level spatial cross-attention module.

2. The additive manufacturing powder layup defect identification method based on channel gating and cross-attention as described in claim 1, characterized in that, In the steps of performing adaptive correction and enhancement processing on the acquired powder-spreading image, performing hybrid normalization enhancement on the multi-channel sensor signal, aligning the enhanced powder-spreading image and the normalized multi-channel sensor signal, and constructing a standardized multimodal sample set, the method for performing adaptive correction and enhancement on the acquired powder-spreading image is as follows: eliminating perspective distortion of the powder-spreading image through homography matrix perspective transformation, and then after grayscale processing, fusing contrast-limited adaptive histogram equalization and adaptive gamma correction to complete image detail enhancement.

3. The additive manufacturing powder layup defect identification method based on channel gating and cross-attention according to claim 2, characterized in that, In the step of constructing a multimodal dual-stream feature extraction architecture, the powder-spreading image after centralized enhancement of standardized multimodal samples and the multi-channel sensor signal after normalization are independently encoded and the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal are extracted in parallel. The constructed dual-stream parallel feature extraction architecture includes an image branch and a sensor branch. The image branch uses ResNet-18 as the base encoder and outputs the multi-scale spatial features of the powder-spreading image after correction and enhancement through multi-layer downsampling, while retaining the mid-layer encoded features and the bottom-layer global features. The sensing branch employs a two-layer one-dimensional convolutional structure combined with global average pooling to encode the hybrid normalized and enhanced multi-channel sensing signals into fixed-dimensional global physical features.

4. The additive manufacturing powder layup defect identification method based on channel gating and cross-attention according to claim 3, characterized in that, The method for inputting the extracted multi-scale spatial features and global physical features into a pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain the model segmentation map is as follows: A mid-level channel gating module is set up, and adaptive channel weights are generated based on global physical features to perform channel recalibration on the mid-level coding features of multi-scale spatial features, so as to obtain the mid-level coding feature map after channel recalibration. A bottleneck layer spatial cross-attention module is introduced, which uses the bottom-level global features as queries and the global physical features as keys. Spatial attention weights are generated through similarity calculation to obtain the fused bottom-level feature map, thereby achieving cross-modal semantic and spatial deep fusion. A multi-scale decoding structure combining encoder-decoder and skip connections is adopted to perform step-by-step upsampling decoding on the recalibrated middle-layer encoded feature map and the fused bottom-layer feature map to restore image resolution and output pixel-level defect segmentation masks for three categories: normal, scratch, and protrusion.

5. The additive manufacturing powder layup defect identification method based on channel gating and cross-attention according to claim 4, characterized in that, The method for setting up the intermediate channel gating module, generating adaptive channel weights based on global physical features, and recalibrating the intermediate-level encoded features of multi-scale spatial features to obtain the recalibrated intermediate-level encoded feature map is as follows: Let the mid-layer image coding feature map be... The global physical features of the input are processed through a multilayer perceptron. Generate channel enhancement weight coefficients : In the formula: Use the Sigmoid activation function; ; The generated channel enhancement weight coefficients are applied to each channel of the intermediate image coding feature map to obtain the channel-recalibrated intermediate coding feature map, as expressed by the following formula: In the formula: The symbol for element-wise multiplication; This is the adaptive enhancement coefficient.

6. The additive manufacturing powder layup defect identification method based on channel gating and cross-attention according to claim 5, characterized in that, The method of introducing a bottleneck layer spatial cross-attention module, using bottom-level global features as queries and global physical features as keys, generates spatial attention weights through similarity calculation, and obtains the fused bottom-level feature map. This achieves cross-modal semantic and spatial deep fusion as follows: The underlying global feature map Linear mapping to query vector Global physical features are mapped to key vectors AND value vector The correlation between the two is calculated and an independent spatially gated weight map is generated using the Sigmoid activation function. The generated gated weight map is used to perform multiplicative modulation on the underlying global feature map, and sensor semantic information is injected simultaneously to obtain the fused underlying feature map: In the formula: Element-wise multiplication; multiplicative terms Residual enhancement for identity mappings; additive terms This enables precise injection of physical semantics into pixel coordinates.

7. The additive manufacturing powder layup defect identification method based on channel gating and cross-attention according to claim 1, characterized in that, The defect segmentation model is trained by constructing a composite loss function that combines focus loss and dice loss for model training and optimization.

8. The additive manufacturing powder layup defect identification method based on channel gating and cross-attention according to claim 1, characterized in that, In the step of mapping the model segmentation map through a pixel-to-physical geometry mapping model to achieve quantitative evaluation of physical parameters, the method for mapping the model segmentation map through a pixel-to-physical geometry mapping model is as follows: The effective forming area size of the laser selective melting printing platform is defined as W×H, and the resolution of the input image captured by the vision sensor and preprocessed is w×h. Define the spatial resolution factor δ and the area factor per unit pixel. The pixel-physical geometry mapping model relationship is as follows: Physical area of ​​the segmentation diagram projected onto the surface of the forming layer The calculation formula is: In the formula: Representing coordinates A pixel is considered defective if it is not defective, otherwise it is considered defective.

9. A method for identifying powder layup defects in additive manufacturing based on channel gating and cross-attention, as described in claim 4 or 8, characterized in that, For scratch-type feature spans, the maximum physical length is used for industrial evaluation; For protruding defects, they are quantified by equivalent physical diameter.

10. An additive manufacturing powder layup defect identification system based on channel gating and cross-attention, based on the additive manufacturing powder layup defect identification method based on channel gating and cross-attention as described in any one of claims 1 to 8, characterized in that, include: Data acquisition module: used to acquire multimodal datasets of the laser selective melting powder spreading process, the multimodal datasets including powder spreading images, multi-channel sensor signals and corresponding defect labels; The data preprocessing module is used to perform adaptive correction and enhancement processing on the acquired powder spreading image, perform hybrid normalization enhancement on the multi-channel sensor signal, align the enhanced powder spreading image and the normalized multi-channel sensor signal, and construct a standardized multimodal sample set. Dual-stream feature extraction module: used to construct a multimodal dual-stream feature extraction architecture, independently encode the powder-spreading image after the standardized multimodal sample set enhancement and the normalized multi-channel sensor signal, and extract the multi-scale spatial features of the powder-spreading image and the global physical features of the multi-channel sensor signal in parallel. The defect segmentation module is used to input the extracted multi-scale spatial features and global physical features into the pre-trained defect segmentation model to achieve powder spreading defect segmentation and obtain the model segmentation map. Defect Quantification Assessment Module: Used to map the model segmentation map through a pixel-to-physical geometry mapping model to achieve quantitative assessment of physical parameters; The defect segmentation model includes a mid-level channel gating module and a bottleneck-level spatial cross-attention module.