Method and device for detecting precursor of surface damage of additive manufacturing device

By combining the YOLOv11-LSF model and optical system device on the surface of metal additive manufacturing devices, the problem of difficult to take into account both detection accuracy and speed and high cost in the prior art is solved, and efficient and low-cost detection of damage precursors is achieved.

CN119851100BActive Publication Date: 2025-06-17NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510341308.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-06-17
Estimated Expiration
2045-03-21

AI Technical Summary

Technical Problem

The prior art has problems in the detection of surface damage precursors of metal additive manufacturing devices, which are difficult to take into account both detection accuracy and speed, high cost and complex operation, and cannot meet the needs of industrial-grade precision manufacturing.

Method used

Using the YOLOv11-LSF model, by introducing the LSKA attention mechanism and Slim-neck concept, a backbone network and neck network are built, and combined with optical system devices, efficient detection of surface damage precursors of additive manufacturing devices is achieved.

Benefits of technology

It significantly improves the detection ability of multi-scale targets, enhances attention to key areas, suppresses interference from complex background information, improves detection and classification capabilities, and achieves efficient and low-cost detection of damage precursors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851100B_ABST
    Figure CN119851100B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for detecting precursors of surface damage of an additive manufacturing device. The method includes: collecting a target precursor image of the surface of the additive manufacturing device; inputting the target precursor image into a pre-trained damage recognition model, and determining whether there is damage in the target precursor image based on the damage recognition model; the damage recognition model includes: a backbone network, a neck network, and a head network; the backbone network is constructed by replacing the C2PSA module of the YOLOv11 model with a C2PSA_LKSA module; the C2PSA_LKSA module is obtained by a C2PSA module introducing an LSKA attention mechanism; the neck network is constructed by replacing the C3K2 module in the neck network of the YOLOv11 model with a VoV-GSCSP module; the VoV-GSCSP module is constructed based on the Slim-neck concept. The detection accuracy and detection efficiency of the present invention are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technology for measuring damage precursors, and particularly to a method and device for detecting surface damage precursors of additive manufacturing devices. Background Art

[0002] As a breakthrough in advanced manufacturing paradigms, additive manufacturing (AM) exhibits significant technical advantages in the preparation of complex structural components in fields such as aerospace and biomedicine due to its unique layer-by-layer manufacturing advantage. Compared with traditional "subtractive" and "equivalent material" processing methods, it can perform complex geometries and customizations with minimal waste, and its processing method is more flexible, capable of producing parts by layer-by-layer stacking according to a designed part model. However, when facing the requirements of industrial-grade precision manufacturing, key issues such as the multi-scale characteristics of surface damage precursors, background noise interference, and the lack of high-quality training samples severely restrict the intelligent transformation of the AM quality monitoring system.

[0003] Metal additive manufacturing technology, as the most cutting-edge and challenging technology in the additive manufacturing system, is an important development direction of advanced manufacturing and is expected to become a key technical approach to achieve cross-generation improvement of the structure of high-end industrial equipment. Currently, the research on metal additive manufacturing mainly focuses on four preparation methods: selective laser melting (SLM), laser metal deposition (LMD), electron beam melting (EBM), and wire arc additive manufacturing (WAAM). However, due to the unique manufacturing method of metal additive manufacturing components, damage precursors such as low-density regions, stress, and cracks that can induce a decline in device performance will be caused. The size range of pore-type damage precursors is about 5 - 20 μm, the size of extended-type damage precursors is about 50 - 500 µm, and the length and opening degree of crack-type damage precursors are generally less than 100 μm. The existence of these damage precursors threatens the safety of high-precision industries. Therefore, the detection and identification of various types of damage precursors in metal additive manufacturing components are of great significance, which can not only improve the material utilization rate but also ensure the safety of industrial applications. Traditional non-destructive damage precursor detection methods include radiographic inspection, ultrasonic testing, liquid penetration testing, magnetic particle testing, and eddy current testing, etc. Although traditional methods have high detection accuracy, they are costly and complex to operate, unable to balance detection accuracy and speed, and may not fully meet the actual production requirements in some cases. Therefore, it is very necessary to propose a more efficient and low-cost damage precursor detection method. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for detecting surface damage precursors of additive manufacturing devices.

[0005] To achieve the above-mentioned invention objective, the present invention provides a method for detecting precursors of surface damage of an additive manufacturing device, including the following steps:

[0006] S1. Collect a target precursor image of the surface of the additive manufacturing device;

[0007] S2. Input the target precursor image into a pre-trained damage recognition model, and based on the damage recognition model, determine whether there is damage in the target precursor image;

[0008] The damage recognition model is the YOLOv11-LSF model, which includes: a backbone network, a neck network connected to the backbone network, and a head network connected to the neck network;

[0009] The backbone network is constructed by replacing the C2PSA module in the backbone network of the YOLOv11 model with a C2PSA_LKSA module; wherein, the C2PSA_LKSA module is obtained by introducing an LSKA attention mechanism into the C2PSA module;

[0010] The neck network is constructed by replacing the C3K2 module in the neck network of the YOLOv11 model with a VoV-GSCSP module; wherein, the VoV-GSCSP module is constructed based on the Slim-neck concept.

[0011] According to one aspect of the present invention, the C2PSA_LKSA module includes: a first Conv layer, a plurality of PSABlock layers, a first Concat layer, and a second Conv layer connected in sequence;

[0012] The first Conv layer is connected to the first Concat layer;

[0013] The PSABlock layer includes: an LSKA attention mechanism layer, a third Conv layer, and a fourth Conv layer connected in sequence.

[0014] According to one aspect of the present invention, the backbone network includes: a first main network Conv layer, a second main network Conv layer, a first main network C3k2 layer, a third main network Conv layer, a second main network C3k2 layer, a fourth main network Conv layer, a third main network C3k2 layer, a fifth main network Conv layer, a fourth main network C3k2 layer, an SPPF layer, and a C2PSA_LKSA module connected in sequence;

[0015] The first main network C3k2 layer and the second main network C3k2 layer are respectively configured as: C3K2 c3k=False;

[0016] The third main network C3k2 layer and the fourth main network C3k2 layer are respectively configured as: C3K2 c3k = True.

[0017] According to one aspect of the present invention, if the main network C3k2 layer is configured as C3K2 c3k = False, then the main network C3k2 layer includes: a fifth Conv layer, a first Split layer, N Bottleneck layers, a second Concat layer, and a sixth Conv layer connected in sequence;

[0018] If the main network C3k2 layer is configured as C3K2 c3k = True, then the main network C3k2 layer includes: a seventh Conv layer, a second Split layer, N C3k layers, a third Concat layer, and an eighth Conv layer connected in sequence;

[0019] The C3k layer is configured with Bottleneck layers stacked N times.

[0020] According to one aspect of the present invention, the damage recognition model is obtained by training based on the following steps, which include:

[0021] S201. Dataset acquisition

[0022] Collect damage precursor images on the surface of the additive manufacturing device, and based on the characteristics of the collected damage precursor images, simulate them to obtain a preset number of simulation images. Label the collected damage precursor images and simulation images respectively, and save them as txt files to obtain a mixed dataset required for model training;

[0023] Divide the mixed dataset into a training set and a validation set at a preset ratio;

[0024] S202. Model training

[0025] Deploy the training environment of the damage recognition model, and input the training set into the damage recognition model for training;

[0026] S203. Model evaluation

[0027] Evaluate the recognition performance of the trained damage recognition model based on the validation set. If the evaluation result meets the preset conditions, output the damage recognition model, where the recognition performance of the damage recognition model is evaluated based on at least one of the accuracy, recall rate, average precision value, mean average precision, and GFLOPs index of the model recognition.

[0028] According to one aspect of the present invention, in the step of simulating the collected damage precursor images based on their characteristics to obtain a preset number of simulation images, the following steps are included:

[0029] a1. Obtain a non-damaged precursor image and construct a simulated image background. Among them, at least one of the processing methods of random scaling, random rotation, and random splicing is used to transform the non-damaged precursor image, and the obtained image is scaled and cropped to obtain the simulated image background of a preset size;

[0030] a2. Select the size of the area for simulating damage. Among them, the side length of the selected area is M×M;

[0031] a3. Randomly generate M Gaussian functions, where the variance and mean of each Gaussian function are different;

[0032] a4. Superimpose a matrix for simulating damage based on the M Gaussian functions. Among them, the matrix is randomly superimposed based on the type of damage in the damage precursor image features to simulate the same type of damage;

[0033] a5. Scale and map the matrix to (0, 255) according to the image gray value range, and randomly scale the matrix to simulate damages of different sizes;

[0034] a6. Select a number of random positions within a preset range in the simulated image background to arrange a number of simulated damages to generate the simulated image. Among them, during the process of arranging a number of simulated damages in the simulated image background, the brightness and / or contrast of the simulated damages are randomly changed.

[0035] According to one aspect of the present invention, in step a4, in the step of randomly superimposing the matrix based on the type of damage in the damage precursor image features to simulate the same type of damage, the types of damage include: pores and cracks;

[0036] If the type of damage is pores, it includes:

[0037] Randomly superimpose the M Gaussian functions according to the cluster characteristics of the damage, so as to generate an M×M-dimensional matrix corresponding to the cluster characteristics of the damage and randomly fluctuating to simulate the same type of damage;

[0038] If the type of damage is cracks, it includes:

[0039] Randomly generate a vertical line, and uniformly obtain M point coordinates based on the extension direction of the line;

[0040] Randomly fine-tune the coordinate values in each point coordinate to make the line have at least one change among thickness increase and decrease, distortion, and bending to simulate the random extension state of the crack;

[0041] Adjust the extension direction and / or position of the simulated crack by at least one of random rotation and random translation;

[0042] Correspondingly superimpose the M Gaussian functions based on the point coordinates in the simulated crack to generate a matrix for simulating damage, so as to simulate the same type of damage.

[0043] To achieve the above invention purpose, the present invention provides a device for detecting the precursor of surface damage of an additive manufacturing device described above, including: a light emitting optical path, a collection optical path, a beam splitter, an objective lens group and a host computer;

[0044] The collection optical path and the objective lens group are coaxially arranged;

[0045] The beam splitter is arranged between the collection optical path and the objective lens group;

[0046] The light emitting optical path is oppositely arranged with one side of the beam splitter;

[0047] The beam splitter receives the light emitted by the light emitting optical path and transmits it to the objective lens group, and the beam splitter receives the image returned by the objective lens group and transmits it to the collection optical path;

[0048] The host computer is connected to the collection optical path.

[0049] According to one aspect of the present invention, the light emitting optical path includes: a light source, a first condenser lens, a first aperture, a beam expander, a second aperture, a polarizer and a second condenser lens arranged coaxially in sequence, and a light source driver;

[0050] The second condenser lens is oppositely arranged with the beam splitter;

[0051] The collection optical path includes: a CMOS sensor, a tube lens, a Bertrand lens and an analyzer arranged coaxially in sequence;

[0052] The analyzer is oppositely arranged with the beam splitter;

[0053] The CMOS sensor is connected to the host computer.

[0054] According to one aspect of the present invention, the polarizer can rotate freely along the axis;

[0055] The analyzer can rotate freely along the axis;

[0056] The objective lens group is a double telecentric achromatic objective lens, and its working distance is 20 ± 2 mm, the numerical aperture is 0.25, and the magnification is 10 times;

[0057] The light source is a halogen lamp;

[0058] The size of the CMOS sensor is 1 inch, and its pixel size is 2.4 micrometers.

[0059] The beneficial effects of the present invention are as follows:

[0060] According to one aspect of the present invention, a YOLOv11-LSF model is creatively proposed, which effectively improves the detection ability for multi-scale targets, enhances the attention to key regions, fully suppresses the interference of complex background information, and greatly improves the overall detection and classification ability of the model.

[0061] According to one aspect of the present invention, by introducing VoV-GSCSP, the complexity of convolution operations is sufficiently reduced, and at the same time, the feature map information of different stages is more effectively fused. Without sacrificing accuracy, the model complexity is reduced, the detection speed of the model is accelerated, and the network is more adaptable to the requirements of actual detection tasks for detection speed.

[0062] According to one aspect of the present invention, in terms of model training, based on the damage precursor features on the surface of the additive manufacturing component collected by the hardware system, a simulated damage precursor image is constructed, and it is mixed with the collected damage precursor image as the training sample of the damage precursor detection network, solving the problem of difficult acquisition of model training samples.

[0063] According to one aspect of the present invention, a microscopic polarization YOLOv11-LSF intelligent detection framework is creatively proposed. An automatic non-destructive detection method for damage precursors of additive manufacturing devices is established through triple technological innovations, effectively breaking through the bottleneck of existing technologies. First, a multi-scale perception module is constructed based on the large separable kernel attention mechanism, significantly improving the feature detection ability of the network in complex industrial scenarios; second, a cross-level local network VoV-GSCSP module is designed using GSConv and a one-time aggregation method, constructing a Slim-neck architecture, and significantly reducing the model complexity without sacrificing accuracy; third, an innovative damage precursor simulation strategy integrating physical features is proposed to construct a virtual-real fusion training sample library, breaking through the dependence of traditional deep learning on large-scale labeled data. Experimental results show that compared with the baseline model, the accuracy of the YOLOv11-LSF model of the present invention has increased by 1.6%, the recall rate has increased by 1.6%, mAP50 has increased by 1.5%, and mAP50-95 has increased by 2.8%. Its unique small-sample adaptability and robustness in complex working conditions provide a reliable technical solution for industrial-level AM quality monitoring.

[0064] According to one solution of the present invention, this solution not only promotes the technological innovation of the intelligent manufacturing quality assurance system, but also opens up a new path for the application of the cross-scale damage precursor detection theory in the field of advanced manufacturing.

[0065] According to one solution of the present invention, this solution fully takes into account the complex changes in defect scale. Through the introduced C2PSA_LKSA module, the adaptability of the model to targets of different scales can be fully enhanced, the attention ability of the model to the key regions of the targets can be enhanced, and the detection accuracy of defect targets can be improved.

[0066] According to one solution of the present invention, this solution inputs an image into the damage recognition model, extracts features through a series of convolution operations. At the end of the backbone network, it is necessary to integrate semantic information of different levels, and then dynamically adjust the coverage range of the large receptive field based on the LKSA attention mechanism, which can more effectively capture the cross-level global dependencies.

[0067] According to one solution of the present invention, this solution realizes multi-dimensional collaborative innovation with the detection algorithm through the constructed optical system device, achieving a breakthrough improvement in the detection of defects on the surface of highly reflective metals. At the hardware level, by designing and adopting a double-rotating polarizer group (i.e., polarizer and analyzer), continuous adjustment of the incident light path from 0 to 180° and / or dynamic compensation of the analyzer from 90 to 270° can be realized, resulting in an increase in the signal-to-noise ratio of >15 dB; at the algorithm level, the YOLOv11-LSF model is innovatively constructed, effectively improving the detection ability for multi-scale targets, enhancing the attention to key regions, fully suppressing the interference of complex background information, and greatly improving the overall detection and classification ability of the model. Through the optical-algorithm joint calibration system, a closed-loop feedback system from feature acquisition, processing optimization to result output is formed, showing significant advantages especially in the detection of micropore cracks, multi-material adaptation (aluminum alloy / stainless steel / titanium alloy) and the robustness in industrial complex environments, systematically solving industry pain points such as high-reflection interference, missed detection of tiny defects, and environmental sensitivity. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 It is a step block diagram of the method for detecting the surface damage precursor of an additive manufacturing device according to an embodiment of the present invention;

[0069] Figure 2 It is an application flow chart of the YOLOv11-LSF model according to an embodiment of the present invention;

[0070] Figure 3 It is a structural diagram of the YOLOv11-LSF model according to an embodiment of the present invention;

[0071] Figure 4 It is a structural diagram of the C2PSA_LKSA module according to an embodiment of the present invention;

[0072] Figure 5 Flow chart for constructing the simulation image of an embodiment of the present invention;

[0073] Figure 6 Flow chart for constructing the pore simulation image of an embodiment of the present invention;

[0074] Figure 7 Flow chart for constructing the crack simulation image of an embodiment of the present invention;

[0075] Figure 8 Simulation image of the damage simulated in an embodiment of the present invention, where, Figure 8 (a) represents the simulation image of the pores simulated, Figure 8 (b) represents the simulation image of the cracks simulated;

[0076] Figure 9 Device for the method for detecting the precursor of surface damage of an additive manufacturing device in an embodiment of the present invention;

[0077] Figure 10 Comparison result diagram of the YOLO series network and the YOLOv11-LSF model in an embodiment of the present invention;

[0078] Figure 11 Heatmaps corresponding to the selected respective attention mechanisms, where, Figure 11 (a) represents the Heatmap corresponding to the YOLOv11s attention mechanism, Figure 11 (b) represents the Heatmap corresponding to the CA attention mechanism, Figure 11 (c) represents the Heatmap corresponding to the CBAM attention mechanism, Figure 11 (d) represents the Heatmap corresponding to the ECA attention mechanism, Figure 11 (e) represents the Heatmap corresponding to the GAM attention mechanism, Figure 11 (f) represents the Heatmap corresponding to the LSKA attention mechanism;

[0079] Figure 12 Comparison diagram of the ablation experiment results of the YOLO series network and the YOLOv11-LSF model in an embodiment of the present invention, Figure 12 (a) represents the comparison diagram of the ablation experiment results of the accuracy of the YOLO series network and the YOLOv11-LSF model, Figure 12 (b) represents the comparison diagram of the ablation experiment results of the recall rate of the YOLO series network and the YOLOv11-LSF model, Figure 12(c) shows the comparison chart of ablation experiment results between the YOLO series networks and the YOLOv11-LSF model ; Figure 12 (d) shows the comparison chart of ablation experiment results between the YOLO series networks and the YOLOv11-LSF model ;

[0080] Figure 13 is the comparison chart of model losses between the YOLOv11 network and the YOLOv11-LSF model of an implementation manner of the present invention. Among them, Figure 13 (a) shows the comparison chart of training losses between the YOLOv11 network and the YOLOv11-LSF model, Figure 13 (b) shows the comparison chart of validation losses between the YOLOv11 network and the YOLOv11-LSF model;

[0081] Figure 14 is the comparison chart of model detection results of the YOLOv3 network for damage of an implementation manner of the present invention. Among them, Figure 14 (a) shows the original image of pores, Figure 14 (b) shows the original image of cracks, Figure 14 (c) shows the detection result image of pores by the YOLOv3 network, Figure 14 (d) shows the detection result image of cracks by the YOLOv3 network;

[0082] Figure 15 is the comparison chart of model detection results between the YOLOv5 network and the YOLOv10 network of an implementation manner of the present invention. Among them, Figure 15 (a) shows the detection result image of pores by the YOLOv5 network, Figure 15 (b) shows the detection result image of cracks by the YOLOv5 network, Figure 15 (c) shows the detection result image of pores by the YOLOv10 network, Figure 15 (d) shows the detection result image of cracks by the YOLOv10 network;

[0083] Figure 16 is the comparison chart of model detection results between the YOLOv11 network and the YOLOv11-LSF model of the present solution of an implementation manner of the present invention. Among them, Figure 16 (a) shows the detection result image of pores by the YOLOv11 network, Figure 16 (b) shows the detection result image of cracks by the YOLOv11 network, Figure 16 (c) shows the detection result image of pores by the YOLOv11-LSF model, Figure 16 (d) shows the detection result image of cracks by the YOLOv11-LSF model. Detailed implementation manner

[0084] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0085] When describing the embodiments of the present invention, the orientation or positional relationships expressed by the terms "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" are based on the orientation or positional relationships shown in the relevant drawings. This is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the above terms should not be construed as limiting the present invention.

[0086] The present invention will be described in detail below in conjunction with the drawings and specific embodiments. The embodiments cannot be elaborated one by one here, but the embodiments of the present invention are not limited to the following embodiments.

[0087] Combined with Figure 1 and Figure 2 As shown, according to an embodiment of the present invention, a method for detecting precursors of surface damage of an additive manufacturing device includes the following steps:

[0088] S1. Collect the target precursor image on the surface of the additive manufacturing device;

[0089] S2. Input the target precursor image into a pre-trained damage recognition model, and based on the damage recognition model, determine whether there is damage in the target precursor image; As Figure 3 shown, in this embodiment, the damage recognition model is the YOLOv11-LSF model. Among them, the YOLOv11-LSF model in this solution is obtained by introducing the LSKA attention mechanism and the Slim-neck concept based on the structure of YOLOv11; it specifically includes: a backbone network, a neck network connected to the backbone network, and a head network connected to the neck network; in this embodiment, the backbone network is constructed by replacing the C2PSA module in the backbone network of the YOLOv11 model with the C2PSA_LKSA module; among them, the C2PSA_LKSA module is obtained by introducing the LSKA attention mechanism into the C2PSA module; the neck network is constructed by replacing the C3K2 module in the neck network of the YOLOv11 model with the VoV-GSCSP module; among them, the VoV-GSCSP module is constructed based on the Slim-neck concept.

[0090] As shown Figure 4 in FIG. 1, according to an embodiment of the present invention, the C2PSA_LKSA module includes: a first Conv layer, a plurality of PSABlock layers, a first Concat layer, and a second Conv layer connected in sequence; wherein, the plurality of PSABlock layers are connected in sequence. Further, the first Conv layer is connected to the first Concat layer. In this embodiment, the PSABlock layer includes: an LSKA attention mechanism layer, a third Conv layer, and a fourth Conv layer connected in sequence.

[0091] In this embodiment, the LSKA attention mechanism layer maintains efficient image processing capabilities while reducing computational and memory costs through innovative kernel decomposition and concatenated convolution strategies; wherein, the core formula for the operation of the LSKA attention mechanism layer is as follows:

[0092] Input feature map After decomposed convolution processing:

[0093] (1)

[0094] wherein, represents the input image, respectively represent the number of channels, image height, and image width, represents depthwise separable convolution, ∘ represents operation concatenation, represents depthwise separable convolution with a dilation rate of d

[0095] Through convolution to compress the channel dimension and generate attention weights:

[0096] (2)

[0097] In the formula, is a learnable convolution kernel, * represents the convolution operation, and the output is the spatial attention map.

[0098] Finally, feature enhancement is achieved through the Hadamard product:

[0099] (3)

[0100] where represents element-wise multiplication, retaining the original feature resolution.

[0101] ​Through the set C2PSA_LKSA module, the YOLOv11-LSF model of this solution further effectively improves the detection ability of the model for multi-scale targets, and fully improves the overall detection and classification ability of the YOLOv11-LSF model. In addition, through the set C2PSA_LKSA module, without introducing too many parameters, the present invention can further enhance the detection ability of the entire model for multi-scale targets and the attention to key regions, which is more beneficial to further promoting the detection and classification ability of the present invention.

[0102] Through the above settings, the YOLOv11-LSF model of the present invention can fully adapt to damage precursors of different scales, and can simultaneously identify damage types (such as pores and scratches) of different scales with a large difference, fully expanding the receptive field and enhancing the global modeling ability, providing a stronger context understanding ability for target detection.

[0103] As Figure 3 shown, according to an embodiment of the present invention, the backbone network includes: a first main network Conv layer, a second main network Conv layer, a first main network C3k2 layer, a third main network Conv layer, a second main network C3k2 layer, a fourth main network Conv layer, a third main network C3k2 layer, a fifth main network Conv layer, a fourth main network C3k2 layer, an SPPF layer, and a C2PSA_LKSA module connected in sequence; wherein, the first main network C3k2 layer and the second main network C3k2 layer are respectively configured as: C3K2 c3k = False; the third main network C3k2 layer and the fourth main network C3k2 layer are respectively configured as: C3K2 c3k = True.

[0104] In this embodiment, if the main network C3k2 layer is configured as C3K2 c3k = False, the main network C3k2 layer includes: a fifth Conv layer, a first Split layer, N Bottleneck layers, a second Concat layer, and a sixth Conv layer connected in sequence; if the main network C3k2 layer is configured as C3K2 c3k = True, the main network C3k2 layer includes: a seventh Conv layer, a second Split layer, N C3k layers, a third Concat layer, and an eighth Conv layer connected in sequence; wherein, the C3k layer is configured with Bottleneck layers stacked N times. In this embodiment, the Bottleneck layer has multiple Conv layers connected in sequence. For example, the Conv layer can be set to two layers.

[0105] According to an embodiment of the present invention, the VoV-GSCSP module introduced in the neck network constructs a path aggregation feature pyramid network, which can fully integrate the path aggregation feature pyramid network with multi-scale information, and realizes the ability to improve the feature utilization efficiency and network performance by using different structural design schemes.

[0106] In this embodiment, the calculation process of the VoV-GSCSP module is as follows:

[0107] (4)

[0108] (5)

[0109] (6)

[0110] Among them, The operation divides the input channels into two parts, and only performs n GS bottleneck processing on the main branch, and finally completes feature fusion through 1×1 convolution. represents the input feature map. represents the first part of the feature after the input feature map is split by channels. represents the sequential processing module composed of two layers. represents concatenating the processed feature and the original reserved feature along the channel dimension. represents the second part of the feature after the input feature map is split by channels. represents weighted fusion of the concatenated features.

[0111] According to an embodiment of the present invention, the damage identification model is obtained by training based on the following steps, which include:

[0112] S201. Dataset acquisition

[0113] Collect the images of damage precursors on the surface of the additive manufacturing device, and based on the characteristics of the collected damage precursor images, simulate them to obtain a preset number of simulation images. Label the collected damage precursor images and simulation images respectively, and save them as txt files to obtain the mixed dataset required for model training. In this embodiment, 64 images containing pores (round or oval white spots, white in the center, regular in shape) and scratches (light gray, with clearly defined wavy, linear, and branched thin lines) can be collected and mixed with 2000 images simulated from the collected images as the mixed image set for training. Further, use the LabelImg annotation tool to annotate the images in the obtained mixed image set and save them as txt files to obtain the mixed dataset required for model training. Among them, each damage precursor instance on the image is annotated with an accurate bounding box, and these bounding boxes provide detailed information about the target location, size, and category.

[0114] Further, divide the mixed dataset into a training set and a validation set at a preset ratio. In this embodiment, randomly divide the mixed dataset into a training set and a validation set at a ratio of 8:2.

[0115] S202. Model Training

[0116] Deploy the training environment of the damage recognition model, and input the training set into the damage recognition model for training. In this embodiment, build the training of the damage recognition model on the Pytorch deep learning framework and run it in the Anaconda virtual environment. Table 1 shows the configuration of the training environment. Table 2 shows the corresponding hyperparameter settings.

[0117] Table 1 Configuration of the Training Environment

[0118]

[0119] Table 2 Hyperparameter Settings

[0120]

[0121] S203. Model Evaluation

[0122] Evaluate the recognition performance of the trained damage recognition model based on the validation set. If the evaluation result meets the preset conditions, output the damage recognition model. Among them, evaluate the recognition performance of the damage recognition model based on at least one of the accuracy, recall rate, average precision value, mean average precision, and GFLOPs metrics of the model recognition.

[0123] Accuracy ( )

[0124] Accuracy refers to the probability that all detected targets are correctly detected, which is expressed as:

[0125] ;

[0126] wherein, is the number of positive examples correctly predicted; is the number of negative examples predicted as positive examples.

[0127] Recall rate ( )

[0128] Recall rate refers to the probability of correct identification among all positive samples, which is expressed as:

[0129] .

[0130] Average Precision ( )

[0131] Taking into account the changes in accuracy and recall rate, it characterizes the area under the Precision-Recall ( Precision-Recall ) curve and is an important indicator to measure the quality of an object detection model, which is expressed as:

[0132] ;

[0133] wherein, is the value corresponding to the point on the PR curve, and .

[0134] Mean Average Precision ( )

[0135] Mean Average Precision is a comprehensive indicator that can comprehensively reflect precision, recall rate, and average precision value. represents the value at a 50% IoU threshold. A higher value indicates that the model is more accurate, which is expressed as:

[0136] ;

[0137] wherein, ranges from [0, 1], and the closer it is to 1, the better. This indicator is the most important object detection indicator in the algorithm; represents the total number of detected target categories.

[0138] GFLOPs indicator ( )

[0139] The GFLOPs metric is an important metric for measuring the computational complexity of a neural network model. It represents the number of billions of floating-point operations performed per second. The higher the GFLOPs, the more calculations the model needs to perform during execution, resulting in higher requirements for hardware resources and potentially affecting the training speed and inference efficiency.

[0140] As Figure 5 shown, according to an embodiment of the present invention, in the step of simulating the collected damage precursor image features and obtaining a preset number of simulation images, the following steps are included:

[0141] a1. Obtain a non-damaged precursor image and construct a simulation image background. Among them, the non-damaged precursor image can be collected based on the non-damaged position on the precursor surface, or obtained by cropping the non-damaged position in the collected damage precursor image. Since the collected non-damaged precursor images are limited by different cropping position sizes, it is difficult for their overall size to reach the preset size. Therefore, at least one of random scaling, random rotation, and random stitching is used to transform the cropped non-damaged precursor images, and then the non-damaged precursor images with different sizes can be changed into a large-area non-damaged precursor image. Furthermore, based on the obtained large-area image, scaling and cropping are performed to obtain a simulation image background with a preset size; where the preset size can be set to 3000×3000. In another embodiment of the present invention, during the random stitching of different non-damaged precursor images, the stitched images can be further superimposed by offset stacking and / or scaling stacking to effectively eliminate the possible holes at the stitching positions of the single-layer images and ensure the display quality of the stitched images.

[0142] a2. Select the size of the area for simulating damage. Among them, the side length of the selected area is M×M; for example, if M is 100, the side length of the selected area is 100×100.

[0143] a3. Randomly generate M Gaussian functions, where the variance and mean of each Gaussian function are different; where the number of Gaussian functions is determined by the side length of the area for simulating damage, and thus the entire damaged area can be simulated based on the constructed Gaussian functions;

[0144] a4. Superimpose an M Gaussian functions to form a matrix for simulating damage, where the matrix is randomly superimposed based on the damage type in the damage precursor image features to simulate the same type of damage; in this embodiment, the types of damage include: pores and cracks;

[0145] Combined Figure 5 and Figure 6 shown, if the type of damage is pores, it includes:

[0146] Randomly superimpose M Gaussian functions according to the clustered characteristics of the damage, so as to generate an M×M dimensional matrix corresponding to the clustered characteristics of the damage and with random fluctuations, to simulate the same type of damage;

[0147] Combined with Figure 5 and Figure 7 As shown, if the type of damage is a crack, it includes:

[0148] Randomly generate a vertical line, and uniformly obtain the coordinates of M points based on the extension direction of the line;

[0149] Randomly fine-tune the coordinate values in each point coordinate to make the line have at least one of the changes of thickness increase and decrease, distortion, and bending to simulate the random extension state of the crack; in this embodiment, by adjusting the abscissa and ordinate in each point coordinate, the relative positions between different points can be adjusted, so as to achieve the corresponding thickness increase and decrease and / or bending, and by adjusting the abscissa in each point coordinate, the relative positions between different points can be adjusted, so as to achieve the corresponding distortion effect.

[0150] Adjust the extension direction and / or position of the simulated crack by at least one of random rotation and random translation; in this embodiment, by adopting the method of overall rotation and / or overall translation of all the point coordinates of the simulated crack, the position can be further flexibly adjusted.

[0151] Based on the point coordinates in the simulated crack, superimpose the M Gaussian functions correspondingly to generate a matrix for simulating damage, to simulate the same type of damage.

[0152] Through the above settings, in this solution, by using Gaussian functions to randomly superimpose the corresponding matrix to simulate damage, the influence of background pixels on damage can be effectively eliminated, and the accurate damage morphology can be directly obtained. Furthermore, when it is superimposed on the background, the damage can be directly mapped to the pixels of the background image, effectively avoiding the influence of redundant pixels on the damage edge, so that the damage can be effectively ensured to be more easily and realistically added to the background image, greatly improving the authenticity of the simulation image.

[0153] a5. Scale and map the matrix to (0, 255) according to the image gray value range, and randomly scale the matrix to simulate damages of different sizes; in this embodiment, in the step of scaling and mapping the matrix to (0, 255) according to the image gray value range, take out the maximum value and the minimum value of the matrix, and scale each element (denoted as ) in the matrix through the conversion formula, which is expressed as: .

[0154] a6. Select several random positions within a preset range in the simulation image background to arrange a number of simulated damages to generate a simulation image. In this embodiment, the preset range selected in the simulation image background is . In this embodiment, the selection of several random positions is performed based on at least one of the ways of being spaced apart from each other, adjacent, and at least partially overlapping. In this embodiment, during the process of arranging a number of simulated damages in the simulation image background, the brightness and / or contrast of the simulated damages can be randomly changed. Thus, the damages in the simulation image background can present light and dark changes, so that the generated simulation image background is closer to the real image. See Figure 8 .

[0155] According to an embodiment of the present invention, in step S201, in the step of annotating the collected precursor image of the damage and the simulation image and saving them as a txt file, if the type of the damage is a pore, record the label in the txt file according to the size and position of the damage; if the type of the damage is a crack, construct an array according to the point coordinates of the crack, and find the coordinates of the smallest circumscribed rectangle covering all the point coordinates, then record the label in the txt file.

[0156] As Figure 9 shown, according to an embodiment of the present invention, the present invention provides a device applied to the foregoing method for detecting the precursor of the surface damage of the additive manufacturing device, including: a light-emitting optical path 1, a collection optical path 2, a beam splitter 3, an objective lens group 4, and a host computer 5; wherein, the collection optical path 2 and the objective lens group 4 are coaxially arranged; the beam splitter 3 is arranged between the collection optical path 2 and the objective lens group 4; the light-emitting optical path 1 is oppositely arranged on one side of the beam splitter 3. Thus, the beam splitter 3 receives the light emitted by the light-emitting optical path 1 and transmits it to the objective lens group 4, and the beam splitter 3 receives the image returned by the objective lens group 4 and transmits it to the collection optical path 2. In this embodiment, the host computer 5 is connected to the collection optical path 2. Thus, place the precursor to be detected at the intersection position of the objective lens group 4 to realize image acquisition of the surface of the precursor by the collection optical path 2, and then execute the foregoing method for detecting the precursor of the surface damage of the additive manufacturing device based on the connected host computer 5 to realize the detection of its surface quality.

[0157] As Figure 9As shown, according to an embodiment of the present invention, the light-emitting optical path 1 includes: a light source 11, a first condenser lens 12, a first aperture 13, a beam expander 14, a second aperture 15, a polarizer 16, and a second condenser lens 17, which are coaxially arranged in sequence, and a light source driver 18; in this embodiment, the second condenser lens 17 is arranged opposite to the beam splitter 3; in this embodiment, the acquisition optical path 2 includes: a CMOS sensor 21, a tube lens 22, a Bertrand lens 23, and an analyzer 24, which are coaxially arranged in sequence; wherein, the analyzer 24 is arranged opposite to the beam splitter 3; the CMOS sensor 21 is connected to the host computer 5.

[0158] Through the above settings, through the coordinated optimization of coaxial layout and component functions, the present invention has achieved multiple technological breakthroughs such as polarization control, beam quality improvement, and system stability enhancement, transforming the series functions of traditional optical elements into collaborative enhancement, which is especially suitable for scenarios with extremely high requirements for beam quality, polarization purity, and system stability, greatly improving the high-precision acquisition of images, and is more beneficial for further improving the detection accuracy of the present invention.

[0159] Through the above settings, the present invention can fully achieve precise regulation of the polarization state. Among them, the polarizer 16 is placed after the beam expander 14 and the second aperture 15, which can perform polarization filtering on the expanded and uniformly illuminated beam, eliminate non-polarized stray light, and significantly improve the polarization purity, especially suitable for scenarios requiring high polarization degrees (such as polarization-sensitive imaging or material detection). In addition, through the coaxial layout method, the offset between the polarizer and the optical axis can be effectively reduced, avoiding polarization state drift caused by mechanical vibration or temperature change. In addition, by setting the light-limiting functions of the first aperture 13 and the second aperture 15, the stray light at the edge of the expanded beam can be filtered, and the surface reflection light (such as high-reflection materials like metal and glass) can be further eliminated through the polarizer, thereby improving the imaging contrast and detection accuracy.

[0160] As Figure 9 shown, according to an embodiment of the present invention, the polarizer 16 can rotate freely by 360° along the axis; the analyzer 24 can rotate freely by 360° along the axis. Through the above settings, by endowing the polarizer 16 and the analyzer 24 with the ability of free rotation, the limitations of traditional fixed polarization elements are broken through, realizing the dynamic regulation of the polarization state, multi-scene adaptability, and function expansion, enabling the polarization processing to be upgraded from static adaptation to dynamic collaboration, providing a new idea for high-precision imaging in optical systems.

[0161] In this embodiment, the objective lens group 4 is a double telecentric achromatic objective lens structure, and its working distance is about 20 millimeters (such as 20 ± 2 millimeters), the numerical aperture is 0.25, and the magnification is 10 times.

[0162] As Figure 9As shown, according to an embodiment of the present invention, the light source 11 is a halogen lamp. Among them, the light source 11 can be a 12-volt 30-watt halogen lamp. In this embodiment, the light source 11 has adjustable brightness to adapt to different materials of the precursors to be measured.

[0163] As Figure 9 shown, according to an embodiment of the present invention, the size of the CMOS sensor 21 is 1 inch, and its pixel size is 2.4 micrometers.

[0164] To further elaborate on the detection effect of this solution, it is further illustrated by way of example in combination with the accompanying drawings.

[0165] In this embodiment, based on the foregoing steps, a damage identification model of this solution is obtained. Furthermore, in this solution, the training results of the model on the mixed dataset are analyzed from four aspects: quantitative experiment, ablation experiment, model loss comparison, and detection performance for different damage precursors. First, in the quantitative experiment, the damage identification model of this solution is compared with the commonly used YOLO series models in recent years, and the reason for selecting YOLOv11 as the baseline in this study is analyzed. Second, in the ablation experiment, the effectiveness of the improved module of this study is verified by combining the data of experiments on different improvement points. Subsequently, the losses of the YOLOv11 model and the damage identification model of this solution during the training process are analyzed, demonstrating the improvement of the improved model in terms of stability and convergence. Finally, to highlight the actual performance of the improved model, different models are selected to test on the collected images of damage precursors.

[0166] Quantitative analysis

[0167] The YOLOv11-LSF model (i.e., the damage identification model) proposed in this solution is compared with other networks in the YOLO series. The selected YOLO series includes YOLOv3, YOLOv5, YOLOV9, YOLOv10, and YOLOv11. The experimental results of different models are shown in Table 3 and Figure 10 shown.

[0168] Table 3 Comparison results of the YOLOv11-LSF model (i.e., the damage identification model) of this solution and other networks in the YOLO series

[0169]

[0170] Table 3 compares the performance of different YOLO versions in terms of GFLOPs. The GFLOPs of YOLOv3 is as high as 282.2, indicating its high computational complexity. In contrast, the performance of YOLOv5, YOLOv9, YOLOv10, and YOLOv11 in terms of GFLOPs is significantly better than that of YOLOv3. Specifically, the GFLOPs of YOLOv5 is 23.8, the GFLOPs of YOLOv9 is 26.7, and the GFLOPs of YOLOv10 is 24.4. YOLOv11 has the lowest computational complexity, with a GFLOPs of only 21.3. It can be seen that developers have continuously optimized the network architecture during the evolution of the YOLO series of networks, reducing the computational complexity to better meet the requirements of real-time inference and low-power devices. At the same time, from Figure 10 it can be seen that the bar chart drawn with the training indicators of the scheme has relatively gentle fluctuations. The training results of the YOLO series of network models selected in this scheme on the mixed dataset in the experiment are relatively close in terms of model accuracy, recall rate, etc., and the average precision difference of the models is not very large. For example, the achieved by the YOLOv9 model training reached 0.963, which is the model with the highest accuracy except for the improved model of this scheme, while the lowest is YOLOv10, whose reached 0.944, a difference of 1.9% from YOLOv9. Finally, considering the lightweight nature of YOLOv11 and its latest version, it was selected as the baseline for the research. Among the indicators of the YOLOv11 training results, except for the model complexity, it can be seen from the figure that they are all inferior to the other selected network structures. The reason is that other networks may consume more computational resources to achieve a higher accuracy rate. However, after the improvement and optimization of this scheme for YOLOv11, on the basis of taking into account the lightweight model complexity, its various indicators exceed those of other network results and reach the optimal, achieving a good balance between accuracy and model complexity.

[0171] Ablation experiment

[0172] To intuitively feel the impact of different modules on the model accuracy, a series of ablation experiments were conducted based on YOLOv11 to prove the effectiveness of each module. First, experiments were carried out with YOLOv11s as the benchmark to obtain the detection results of the benchmark model, which served as the basis for the experiments. Then, the effectiveness of the benchmark model was verified by making different improvements to the benchmark model. First, the C2PSA module in the YOLOv11 backbone network was improved, with the rest remaining unchanged, and experiments were conducted with this modification to ensure that the results were not affected by other factors. And so on. After verifying all the improvement methods separately, all the methods were combined to obtain the final YOLOv11-LSF model, thus verifying the effectiveness of the YOLOv11-LSF model.

[0173] To improve the feature extraction of the network model for target objects and the suppression of background information, an attention mechanism was introduced in the C2PSA module of the backbone network in this scheme to improve the recognition ability of the network model. To verify the superiority of the LSKA attention module in the YOLOv11-LSF model proposed in this scheme, different attention modules were embedded at the same position in the network model, and comparative experiments were conducted.

[0174] Table 4 Comparison of results of different attention mechanisms

[0175]

[0176] It can be seen from the experimental results in Table 4 that the models with embedded attention modules did not significantly increase the number of parameters and the computational cost. In contrast, the C2PSA_LSKA module proposed in this paper is the most effective, which is 1.1% higher than the YOLOv11 model and 1%, 0.8%, 15.5% and 1.5% higher than the CBAM module, CA module, GAM module and ECA module respectively. At the same time, compared with LSKA, other attention mechanisms have insignificant improvement effects or varying degrees of decline in accuracy, recall and When the CBAM attention mechanism was introduced, the accuracy, and of YOLOv11 only increased by 0.6%, 0.1% and 1.2% respectively, but at the same time the recall rate of the model decreased by 0.07%. Therefore, the LSKA attention mechanism was selected in this scheme. At the same time, Figure 11 the Heatmap corresponding to each attention mechanism selected in this scheme shows that YOLOv11 cannot accurately detect all damage precursors in the image without introducing the attention mechanism, and there is a problem of missed detection. Figure 11 (b) to Figure 11(e) is the Heatmap obtained by other attention mechanisms selected in this scheme. It can be seen that the Heatmap of other attention mechanisms is relatively Figure 11 (f) is not accurate enough for the localization of damage precursors, which is most obvious in the GAM attention mechanism. Based on the above experimental results, by introducing the LSKA attention mechanism, this scheme can enhance the model's ability to focus on the damage precursor region and suppress the interference of background information. This can be confirmed by the diffusion of the network's interested regions in the Heatmap of the introduced LSKA attention mechanism.

[0177] Table 5 Results based on different feature fusion networks

[0178]

[0179] In this scheme, the effects of four feature fusion networks, namely BiFPN, RepGFPN, ASF-YOLO, and Slim-neck, are analyzed. As shown in Table 5, compared with the original feature fusion network of YOLOv11, the Slim-neck selected in this scheme not only and are respectively improved by 1.3% and 2.9%, but it also successfully reduces the model complexity by 0.2. The reason is that this scheme adopts the GSConv and VoV-GSCSP structures in the Slim-neck neck part, which not only reduces the complexity of convolution operations, but also more effectively fuses the feature map information of different stages, so that both the computational amount and complexity of the model are reduced in the training results, while still maintaining satisfactory accuracy. And it can be clearly seen that the experimental results of selecting Slim-neck are better than those of selecting other feature fusion networks. The trained by selecting Slim-neck is respectively improved by 1%, 2.1%, and 1.6% compared with BiFPN, RepGFPN, and ASF-YOLO, and selecting Slim-neck has a more significant improvement in the model and is respectively improved by 1.6%, 5.4%, and 3.1% compared with BiFPN, RepGFPN, and ASF-YOLO. This also well proves that selecting Slim-neck helps to enhance the model's adaptability to targets of different scales and is beneficial to the application of the detection model in practical problems. Therefore, due to the excellent performance of Slim-neck, this scheme selects Slim-neck to optimize the neck network of the model in this scheme.

[0180] Based on the above experiments on different attention mechanisms and feature extraction networks, this scheme also conducts ablation experiments on the effectiveness of the combination of the LSKA attention mechanism and Slim-neck to test the effectiveness when the two act together. The experimental results are shown in Table 6 and Figure 12 .

[0181] Table 6 Results of ablation experiments

[0182]

[0183] From Figure 12 it can be easily seen that the convergence speed of the original YOLOv11 network model during training is not very ideal. For the four indicators selected in this scheme, the original YOLOv11 network basically needs to reach at least 40 rounds before it starts to converge during training. And based on the optimization and improvement of this scheme, the accuracy, recall rate, and the convergence speed of the training curve of the model has been significantly accelerated. This can be clearly seen from the training curves of Figure 12 (a) and Figure 12 (c). After 20 rounds of training, the training curve begins to stabilize. It can also be seen that the improvement scheme proposed in this study is in the best position in each training curve. As can be seen from Table 6, compared with YOLOv11, after introducing the LSKA attention mechanism into the backbone network, it has increased by 1.1%, significantly improving the accuracy of the model, but at the same time increasing the GFLOPs index by 0.7, resulting in a higher model complexity. And when Slim-neck is continued to be introduced, the GFLOPs index is reduced to 21.7, but it continues to increase and reaches 0.965, so that the model reduces computational resources without sacrificing accuracy. After all the improvements made by this scheme, compared with YOLOv11, the accuracy of the YOLOv11-LSF model has increased by 1.6%, the recall rate has increased by 1.6%, has increased by 1.5%, has increased by 2.8%. At the same time, it can be seen from Table 6 that the improvement idea proposed in this scheme has increased the detection accuracy of the model for the damage precursors of both categories. Among them, for cracks has increased by 2.8%, and the effect is more obvious. From the above experimental results, it can be seen that while significantly improving the detection performance, this scheme takes into account the model lightweight, making the YOLOv11 network more suitable for the object detection task of the surface damage precursor dataset of additive manufacturing devices.

[0184] Comparison of model loss diagrams

[0185] To further verify the effectiveness of this scheme for model convergence, Figure 13The loss curves of the YOLOv11 model and the YOLOv11-LSF model of this solution during the training process are shown respectively. By comparing the loss change graphs of the two models during the training process, it can be clearly seen that the loss of the YOLOv11 model is always greater than the loss of the YOLOv11-LSF model of this solution. This is most obvious on the test set. The loss value of the YOLOv11-LSF model of this solution has reached the loss value of the YOLOv11 model after the training is completed at about the 10th epoch. And it can be seen that the loss of the YOLOv11-LSF model of this solution on the test set begins to stabilize at about the 30th round, while the loss value of YOLOv11 begins to stabilize after about 45 rounds. Finally, the loss values ​​of the YOLOv11-LSF model of this solution on the training set and the test set reached 0.66538 and 0.73491 respectively, while the loss values ​​of the YOLOv11 model on the training set and the test set were 0.70689 and 0.87955 respectively. Therefore, it is fully proved that the YOLOv11-LSF model of the present invention has been significantly improved in stability and convergence.

[0186] Comparison of model detection results

[0187] In order to more intuitively prove that the YOLOv11-LSF model of this scheme is effective compared with other models, from the perspective of qualitative analysis, two specific representative images containing damage precursors were selected from the test set. Figure 14 , Figure 15 and Figure 16 The following are the actual detection results of several better models for the damage precursors on the workpiece surface. It should be noted that these six columns represent the original image, YOLOv3, YOLOv5, YOLOV10, YOLOV11 and the prediction results of our model.

[0188] from Figure 14 , Figure 15 and Figure 16From the comparison of the detection results of each model, YOLOv11 has false detection cases when detecting pores. It misdetects pores with a length similar to that of Li Wen as cracks. However, such cases do not occur in the YOLOv11-LSF model of this solution. Among the numerous models selected, the YOLOv11-LSF model of this solution has the highest confidence in pore detection and more accurate detection boxes. At the same time, it can be significantly seen from the figure that the model proposed in this study has superiority in crack detection. Other models in the selected area have the situation of detecting one crack as multiple cracks when detecting cracks, while the YOLOv11-LSF model of this solution can accurately identify each crack without multi-detection and false detection. Thus, it can be seen that the YOLOv11-LSF model of this solution can adapt to targets of different scales. The reason is that the YOLOv11-LSF model of this solution adopts the C2PSA_LKSA module, enabling it to adapt to multi-scale targets, thereby achieving the effect of accurately detecting both cracks and pores. This further proves that the YOLOv11-LSF model proposed in this study has strong multi-scale feature extraction and fusion capabilities.

[0189] In summary, this solution has the following advantages:

[0190] Through quantitative experimental analysis, this solution creatively proposed the YOLOv11-LSF model and conducted comparative experiments with YOLOv3, YOLOv5, YOLOv9, YOLOv10, and YOLOv11. The YOLOv11-LSF model proposed in this solution has the highest detection accuracy and the best comprehensive performance, and has a certain improvement in the accuracy of various damage precursors, further verifying the feasibility and practicality of the YOLOv11-LSF model of the present invention in the field of detecting damage precursors on the surface of additive manufacturing.

[0191] The effectiveness of each module in the YOLOv11-LSF model was verified through ablation experiments. That is, the C2PSA module was improved in the original network structure, and the cross-level local network VoV-GSCSP module was designed using GSConv and one-time aggregation method. After constructing the Slim-neck, the model performance reached the best. Finally, compared with YOLOv11, the recall rate of the YOLOv11-LSF model of this solution increased by 1.6%, the accuracy rate increased by 1.6%, increased by 1.5%, increased by 2.8%.

[0192] The above content is only an example of the specific solution of the present invention. For the equipment and structures not described in detail therein, it should be understood that the existing general equipment and general methods in the field are adopted for implementation.

[0193] The above is only one solution of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for detecting surface damage precursors of additive manufacturing devices, characterized in that: The following steps are involved: S1. Collect target precursor images on the surface of additive manufacturing devices; S2. Inputting the target precursor image into a pre-trained damage recognition model, and determining whether there is damage in the target precursor image based on the damage recognition model; The damage identification model is a YOLOv11-LSF model, which includes: a backbone network, a neck network connected to the backbone network, and a head network connected to the neck network; The backbone network is constructed by replacing the C2PSA module in the backbone network of the YOLOv11 model with the C2PSA_LKSA module; wherein the C2PSA_LKSA module is obtained by introducing the C2PSA module of the LSKA attention mechanism; The neck network is constructed by replacing the C3K2 module in the neck network of the YOLOv11 model with the VoV-GSCSP module; wherein the VoV-GSCSP module is constructed with the Slim-neck concept; The C2PSA_LKSA module includes: a first Conv layer, a plurality of PSABlock layers, a first Concat layer, and a second Conv layer connected in sequence; The first Conv layer is connected to the first Concat layer; The PSABlock layer includes: an LSKA attention mechanism layer, a third Conv layer and a fourth Conv layer connected in sequence.

2. The method for detecting surface damage precursors of additive manufacturing devices according to claim 1, characterized in that: The backbone network includes: a first main network Conv layer, a second main network Conv layer, a first main network C3k2 layer, a third main network Conv layer, a second main network C3k2 layer, a fourth main network Conv layer, a third main network C3k2 layer, a fifth main network Conv layer, a fourth main network C3k2 layer, an SPPF layer and a C2PSA_LKSA module connected in sequence; The first main network C3k2 layer and the second main network C3k2 layer are respectively configured as: C3K2 c3k=False; The third main network C3k2 layer and the fourth main network C3k2 layer are respectively configured as: C3K2 c3k=True.

3. The method for detecting surface damage precursors of additive manufacturing devices according to claim 2, characterized in that: If the main network C3k2 layer is configured as C3K2 c3k=False, the main network C3k2 layer includes: a fifth Conv layer, a first Split layer, N Bottleneck layers, a second Concat layer, and a sixth Conv layer connected in sequence; If the main network C3k2 layer is configured as C3K2 c3k=True, the main network C3k2 layer includes: the seventh Conv layer, the second Split layer, N C3k layers, the third Concat layer and the eighth Conv layer connected in sequence; The C3k layer is configured with Bottleneck layers stacked N times.

4. The method for detecting surface damage precursors of additive manufacturing devices according to claim 3, characterized in that: The damage identification model is trained based on the following steps, which include: S201. Dataset acquisition Collect the damage precursor image of the surface of the additive manufacturing device, and simulate it according to the characteristics of the collected damage precursor image to obtain a preset number of simulation images, annotate the collected damage precursor image and simulation image respectively, and save them as txt files to obtain the mixed data set required for model training; Dividing the mixed data set into a training set and a validation set in a preset ratio; S202. Model training Deploy a training environment for the damage identification model, and input the training set into the damage identification model for training; S203. Model Evaluation The recognition performance of the trained damage recognition model is evaluated based on the validation set. If the evaluation result meets the preset conditions, the damage recognition model is output. The recognition performance of the damage recognition model is evaluated based on at least one of the accuracy, recall, average precision value, average precision mean, and GFLOPs indicators of model recognition.

5. The method for detecting surface damage precursors of additive manufacturing devices according to claim 4, characterized in that: The step of simulating the damaged precursor image according to the collected features and obtaining a preset number of simulated images includes the following steps: a1. Obtaining a damage-free precursor image and constructing a simulated image background, wherein the damage-free precursor image is transformed by at least one of random scaling, random rotation, and random splicing, and the obtained image is scaled and cropped to obtain the simulated image background of a preset size; a2. Select the size of the region used to simulate damage, where the side length of the selected region is M×M; a3. Randomly generate M Gaussian functions, wherein the variance and mean of each Gaussian function are different; a4. Based on the M Gaussian functions, a matrix for simulating damage is superimposed, wherein the matrix is ​​randomly superimposed based on the type of damage in the damage precursor image feature to simulate the same type of damage; a5. Scaling and mapping the matrix to (0,255) according to the grayscale value range of the image, and randomly scaling the matrix to simulate damage of different sizes; a6. Selecting several random positions within a preset range in the background of the simulated image to arrange a number of simulated lesions to generate the simulated image, wherein in the process of arranging a number of simulated lesions in the background of the simulated image, the brightness and / or contrast of the simulated lesions are randomly changed.

6. The method for detecting surface damage precursors of additive manufacturing devices according to claim 5, characterized in that: In step a4, the matrix is ​​randomly superimposed based on the type of damage in the damage precursor image feature to simulate the same type of damage, and the types of damage include: pores and cracks; If the damage type is porosity, it includes: According to the cluster characteristics of the damage, the M Gaussian functions are randomly superimposed to generate a randomly fluctuating M×M dimensional matrix corresponding to the cluster characteristics of the damage, so as to simulate the same type of damage; If the damage type is crack, it includes: A vertical straight line is randomly generated, and M point coordinates are uniformly obtained based on the extension direction of the straight line; Randomly fine-tune the coordinate value of each point coordinate so that the straight line undergoes at least one of thickness increase or decrease, distortion, and bending to simulate a random extension state of a crack; At least one of random rotation and random translation is used to adjust the extension direction and / or position of the simulated crack; The M Gaussian functions are correspondingly superimposed based on the coordinates of the points in the simulated cracks to generate a matrix for simulating damage, so as to simulate the same type of damage.

7. A device applied to the method for detecting surface damage precursor of an additive manufacturing device according to any one of claims 1 to 6, characterized in that: include: Light emitting optical path (1), light collecting optical path (2), beam splitter (3), objective lens group (4) and host computer (5); The collection optical path (2) and the objective lens group (4) are coaxially arranged; The beam splitter (3) is arranged between the collection light path (2) and the objective lens group (4); The light emitting optical path (1) is arranged opposite to one side of the beam splitter (3); The beam splitter (3) receives the light emitted by the light emitting optical path (1) and transmits it to the objective lens group (4); and the beam splitter (3) receives the image returned by the objective lens group (4) and transmits it to the collection optical path (2); The host computer (5) is connected to the collection optical path (2) to execute the method for detecting surface damage precursors of additive manufacturing devices to detect the surface quality of additive manufacturing devices; The light emitting optical path (1) comprises: a light source (11), a first condenser (12), a first aperture (13), a beam expander (14), a second aperture (15), a polarizer (16) and a second condenser (17), which are coaxially arranged in sequence, and a light source driver (18); The second condenser (17) is arranged opposite to the beam splitter (3); The collection optical path (2) comprises: a CMOS sensor (21), a tube lens (22), a Bertrand lens (23) and an analyzer (24) which are coaxially arranged in sequence; The polarizer (24) is arranged opposite to the beam splitter (3); The CMOS sensor (21) is connected to the host computer (5).

8. The device according to claim 7, characterized in that The polarizer (16) can rotate freely along the axial direction; The polarizer (24) can rotate freely along the axial direction; The objective lens group (4) is a double telecentric achromatic structure objective lens, and its working distance is 20±2 mm, the numerical aperture is 0.25, and the magnification is 10 times; The light source (11) is a halogen lamp; The size of the CMOS sensor (21) is 1 inch, and its pixel size is 2.4 micrometers.

Citation Information

Patent Citations

  • Metasurface device preparation and test integrated system and metasurface device preparation method

    CN118937282A

  • Electric arc additive manufacturing macroscopic surface defect detection method based on YOLOv8 improvement

    CN119090802A