A metal 3D printed body defect detection method, device and electronic equipment

Through the combination of resistive timing signals and image data, the defect detection of metal 3D printed bodies is performed using the logic linear regression model and the improved YOLOv8 model, which solves the problem of high computing resources and improves detection efficiency and accuracy.

CN118864463BActive Publication Date: 2025-01-07XIAN JIAOTONG UNIV CITY COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411339438.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-07
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

In the metal additive manufacturing process, defect detection of metal 3D printed bodies consumes a lot of computing resources, resulting in inefficiency.

Method used

First-order differential processing is performed by acquiring the resistor timing signal, and the print state is predicted using a pre-trained logic linear regression model. If it is an abnormal state, image data is obtained for defect detection, and defect type recognition is performed in combination with the improved YOLOv8 model.

Benefits of technology

It reduces the consumption of computing resources, improves detection efficiency, and improves the accuracy and efficiency of defect detection through feature fusion and attention mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864463B_ABST
    Figure CN118864463B_ABST
Patent Text Reader

Abstract

The present invention provides a defect detection method, device and electronic device for a metal 3D printed body, which belongs to the field of additive manufacturing technology. The method comprises: obtaining a resistance time series signal of a metal 3D printed body to be detected at the current moment and within a preset time length before the current moment; performing first-order difference processing on the resistance time series signal to obtain a differential data set; inputting the differential data set into a pre-trained first-order difference logistic linear regression model to predict the printing state of the metal 3D printed body to be detected at the current moment; if the printing state is an abnormal printing state, obtaining image data of the metal 3D printed body to be detected; and performing defect detection on the metal 3D printed body to be detected according to the image data. The method can reduce the consumption of computing resources for defect detection of metal 3D printed bodies during additive manufacturing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of additive manufacturing, and specifically relates to a defect detection method, device and electronic equipment for a metal 3D printed body. Background Art

[0002] Additive Manufacturing (AM) is a technology that manufactures parts by stacking materials layer by layer based on a three-dimensional model. Metal additive manufacturing has important applications in aerospace, national defense, nuclear energy engineering, transportation, biomedicine and other fields. However, in the metal additive manufacturing process, the metal raw material needs to complete the solid-liquid-solid state change in a very short time. This process will produce a huge temperature gradient, which can easily cause various defects in the metal 3D printed body, seriously affecting the quality and performance of the parts. Therefore, it is particularly important to detect defects in the metal 3D printed body and correct them in time.

[0003] At present, defect detection is mainly carried out by collecting image data of 3D printed bodies in real time and identifying the real-time collected image data; thus, in the additive manufacturing process, a large amount of image data needs to be processed and identified, resulting in a large consumption of computing resources. Summary of the invention

[0004] In order to solve the problem of large consumption of computing resources in metal 3D printed body defect detection during additive manufacturing, the present invention provides a metal 3D printed body defect detection method, device and electronic equipment.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A defect detection method for a metal 3D printed body, comprising:

[0007] Obtain the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment;

[0008] The resistance time series signal is subjected to first-order difference processing to obtain a difference data set; the difference data set is input into a pre-trained first-order difference logistic linear regression model to predict the printing state of the metal 3D printed body to be detected at the current moment; the first-order difference logistic linear regression model is pre-trained based on the first-order difference data set of the historical resistance time series signal; the printing state includes a normal printing state and an abnormal printing state;

[0009] If the printing state is an abnormal printing state, acquiring image data of the metal 3D printed body to be inspected;

[0010] Defect detection is performed on the metal 3D printed body to be detected according to the image data.

[0011] Alternatively, the expression of the first-order difference logistic linear regression model is:

[0012] ;

[0013] in, Indicates the probability value of abnormal printing status, represents the base of natural logarithms, y is the weighted sum of each differential data, , Indicates weights, ω represents The weight vector is composed of weights, represents the transpose operation, Indicates Differential data, for A differential data set composed of differential data;

[0014] Predict the printing status of the metal 3D printed body to be tested at the current moment, including:

[0015] If the probability value at the current moment output by the first-order difference logistic linear regression model is greater than a preset threshold, it is determined that the printing state at the current moment is an abnormal printing state.

[0016] Optionally, performing defect detection on the metal 3D printed body to be detected according to the image data includes:

[0017] Constructing an improved YOLOv8 model including a backbone network, a neck network and a head network, wherein the improved YOLOv8 model replaces the C2F modules in the backbone network and the neck network in the original YOLOv8 model with Star Blocks modules adding a CAA attention mechanism;

[0018] The improved YOLOv8 model is trained to obtain a detection model for detecting defect types of metal 3D printed bodies;

[0019] The image data is input into the detection model, and the extracted image features are fused by adding the Star Blocks module with CAA attention mechanism. The fused features are predicted by the head network, and the defect type of the metal 3D printed body to be detected is output.

[0020] Optionally, the improved YOLOv8 model is trained to obtain a detection model for detecting defect types of metal 3D printed bodies, including:

[0021] Obtain historical image data of metal 3D printed bodies;

[0022] Performing positive processing and negative processing on the historical image data; wherein the positive processing includes adaptive histogram equalization, USM sharpening and color inversion processing, and the negative processing includes adding noise to the image data;

[0023] Annotate the processed image data for defects to obtain a training data set;

[0024] The improved YOLOv8 model is trained using the training data set to obtain a detection model for detecting defect types of metal 3D printed bodies.

[0025] Optionally, obtaining a resistance timing signal of the metal 3D printed body to be detected at a current moment and within a preset time period before the current moment includes:

[0026] An AC sine wave signal is generated by a signal generator, and the AC sine wave signal is adjusted to obtain a constant current source signal;

[0027] Inputting a constant current source signal to the metal 3D printed body to be detected, and obtaining a voltage across both ends of the metal 3D printed body to be detected;

[0028] The resistance value of the metal 3D printed body to be detected at each moment is calculated according to the voltage across the two ends of the metal 3D printed body to be detected and the current passing through the metal 3D printed body to be detected, and a resistance timing signal within the current moment and a preset time length before the current moment is obtained.

[0029] Optionally, after obtaining the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment, the method further includes:

[0030] Discretize the resistance timing signal, perform low-pass convolution and high-pass convolution on the discretized resistance timing signal, and decompose the high-frequency component and low-frequency component of the resistance timing signal;

[0031] Determine a target threshold based on a soft threshold function, and perform a wavelet transform on the high-frequency component based on the target threshold to obtain a processed resistance time series signal;

[0032] The processed resistance timing signal is reconstructed by wavelet to obtain the target resistance timing signal.

[0033] The present invention also provides a defect detection device for a metal 3D printed body, comprising:

[0034] The first acquisition module is used to acquire the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment;

[0035] A prediction module is used to perform first-order differential processing on the resistance timing signal to obtain a differential data set; the differential data set is input into a pre-trained first-order differential logistic linear regression model to predict the printing state of the metal 3D printed body to be detected at the current moment; the first-order differential logistic linear regression model is pre-trained based on the first-order differential data set of the historical resistance timing signal; the printing state includes a normal printing state and an abnormal printing state;

[0036] A second acquisition module is used to acquire image data of the metal 3D printed body to be inspected if the printing state is an abnormal printing state;

[0037] A detection module is used to perform defect detection on the metal 3D printed body to be detected according to the image data.

[0038] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned metal 3D printed body defect detection method when executing the program.

[0039] The present invention also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned defect detection method for a metal 3D printed body is implemented.

[0040] The defect detection method of the metal 3D printed body provided by the present invention has the following beneficial effects:

[0041] The present invention obtains a resistance timing signal within a preset time period before and at a current moment, and judges the printing state of a metal 3D printed body according to the resistance timing signal through a first-order difference logistic linear regression model. When the printing state is an abnormal printing state, image data is obtained for defect detection. Since the resistance of a metal 3D printed body in a normal printing state changes regularly with time (for example, changes linearly), it is possible to determine whether the resistance change is abnormal through the resistance timing signal, thereby determining whether the printing state of the metal 3D printed body is abnormal. Since image data processing is performed in real time for defect detection, the consumption of computing resources is relatively large. Therefore, when it is determined that the metal 3D printed body is in an abnormal printing state, it indicates that a defect has occurred. At this time, acquiring image data for defect detection can reduce the consumption of computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiment of the present invention and its design scheme, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 A schematic flow chart of a defect detection method for a metal 3D printed body provided in an embodiment of the present invention;

[0044] Figure 2 A structural schematic diagram of a dynamic resistance measurement system provided by an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of a discrimination result provided by an embodiment of the present invention; wherein, Figure 3 Figure (a) is the discrimination result diagram of the first group of resistance timing signals. Figure 3 Figure (b) is the discrimination result diagram of the second group of resistance timing signals. Figure 3 Figure (c) is the discrimination result diagram of the third group of resistance timing signals. Figure 3 Figure (d) is the discrimination result diagram of the fourth group of resistor timing signals;

[0046] Figure 4 A schematic diagram of a clustering result provided by an embodiment of the present invention, Figure 4 Figure (a) is the clustering result diagram of the first group of resistor timing signals. Figure 4 Figure (b) is the clustering result diagram of the second group of resistor timing signals. Figure 4 Figure (c) is the clustering result diagram of the third group of resistor timing signals. Figure 4 Figure (d) is the clustering result diagram of the fourth group of resistor timing signals;

[0047] Figure 5 A schematic diagram of a defect detection system provided by an embodiment of the present invention;

[0048] Figure 6 A schematic diagram of a normalized confusion matrix of a model provided in an embodiment of the present invention; wherein, Figure 6 Figure (a) is the normalized confusion matrix of the original YOLOv8 model. Figure 6 Figure (b) shows the normalized confusion matrix of the improved YOLOv8 model;

[0049] Figure 7 A schematic diagram of a visualized receptive field of a model provided in an embodiment of the present invention; wherein, Figure 7 Figure (a) shows the visual receptive field of the original YOLOv8 model. Figure 7 Figure (b) shows the visual receptive field of the improved YOLOv8 model;

[0050] Figure 8 A schematic structural diagram of a defect detection device for a metal 3D printed body provided in an embodiment of the present invention.

[0051] Description of reference numerals:

[0052] 1-PC terminal, 2-AC constant current source, 3-industrial camera, 4-laser, 5-fill light, 6-wire feeder, 7-wire reel, 8-print head, 9-substrate, 10-mobile platform. DETAILED DESCRIPTION

[0053] In order to enable those skilled in the art to better understand the technical solution of the present invention and implement it, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention.

[0054] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the technical solutions of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0055] In addition, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. In the description of the present invention, it should be noted that, unless otherwise clearly specified or limited, the terms "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. In the description of the present invention, unless otherwise specified, "plurality" means two or more, which will not be described in detail here.

[0056] Example 1

[0057] Figure 1 A schematic flow chart of a defect detection method for a metal 3D printed body provided in an embodiment of the present invention.

[0058] For example, Figure 1 As shown, the execution steps of this method are as follows:

[0059] S1, obtaining a resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment.

[0060] The metal 3D printed body to be detected is the metal currently being printed. Since metal is conductive, the metal 3D printed body to be detected can be powered on to obtain a resistance timing signal during its printing process. The preset time length can be set according to actual conditions, for example, 5 seconds, and the embodiment of the present invention does not specifically limit this. It should be understood that the resistance timing signal is a series of resistance signals that change over time.

[0061] The embodiment of the present invention provides a dynamic resistance measurement system based on a four-wire method, which is used to obtain a resistance timing signal of the internal resistance of a metal 3D printed body during metal additive manufacturing. The structure of the dynamic resistance measurement system is as follows: Figure 2 shown.

[0062] Exemplarily, the system mainly includes a linear voltage-regulated power supply module, a direct digital frequency synthesis (DDS) signal generator module, a sine wave pull-down circuit, a voltage-controlled constant current source module, an AD630 phase-locked amplifier module, a standard resistor, a fourth-order adjustable low-pass filter module, an analog-to-digital converter (ADC) acquisition module and an STM32 microcontroller.

[0063] Based on the above dynamic resistance measurement system, the process of obtaining the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment can be:

[0064] A1: Generate an AC sine wave signal through a signal generator, and adjust the AC sine wave signal to obtain a constant current source signal.

[0065] Specifically, a 1kHz AC sine wave signal is generated by the DDS signal generator module. Since the instantaneous value of the signal generated by DDS is greater than 0 during the entire cycle, a sine wave pull-down circuit needs to be designed to pull the negative half-cycle signal of the sine wave below the X-axis. After the AC sine wave signal is generated, a voltage-controlled constant current module is used to stabilize the output current.

[0066] A2: Input a constant current source signal to the metal 3D printed body to be detected, and obtain the voltage across the two ends of the metal 3D printed body to be detected.

[0067] Specifically, a constant current source signal is input into the metal 3D printed body (resistance to be measured), and a standard resistor is connected between the metal 3D printed body and the negative electrode of the constant current source signal as a load to prevent the resistance of the metal 3D printed body from being too small and the current of the entire loop from being zero. The AD630 phase-locked amplifier module requires two input signals, namely the signal to be measured and the reference signal. The constant current source signal is used as the reference signal of the AD630 phase-locked amplifier module, and the voltage signal across the resistor to be measured is input into the AD630 phase-locked amplifier module as the signal to be measured. The signal to be measured is phase-locked and amplified, and a half-wave rectified signal is output; this half-wave rectified signal is then input into the fourth-order adjustable low-pass filter module, and a DC signal is output after filtering out high-frequency noise. The DC signal is the voltage signal across the metal 3D printed body.

[0068] A3: Calculate the resistance value of the metal 3D printed body to be detected at each moment according to the voltage across the metal 3D printed body to be detected and the current passing through the metal 3D printed body to be detected, and obtain the resistance timing signal within the current moment and the preset time length before the current moment.

[0069] Specifically, the voltage signals at both ends are sampled by ADC, and then calculated by the STM32 microcontroller to obtain the resistance value of the metal 3D printed body to be tested. The calculation formula of the resistance value is as follows:

[0070] .

[0071] in, is the voltage across the metal 3D printed body, I is the constant current source current.

[0072] The above method is used to obtain the corresponding resistance value at each moment, and the resistance timing signal at the current moment and within a preset time period before the current moment can be obtained.

[0073] It should be understood that in laser wire feeding metal additive manufacturing, the resistance of the metal 3D printed body is very small, so the collected resistance timing signal is also very weak. Even if the signal is denoised by a filter, noise will inevitably be introduced.

[0074] Therefore, the embodiment of the present invention uses a wavelet denoising algorithm to perform noise filtering on the resistance time series signal collected by the dynamic resistance measurement system.

[0075] The wavelet denoising algorithm consists of three parts: 1. Wavelet decomposition; 2. Threshold function processing; 3. Wavelet reconstruction.

[0076] Next, the process of performing noise filtering processing using a wavelet denoising algorithm is described.

[0077] First, the noisy resistor timing signal is discretized, and the formula is as follows:

[0078] .

[0079] in, represents the noisy resistor timing signal, Represents the original resistance timing signal without noise, Indicates noise.

[0080] Then, low-pass convolution and high-pass convolution are performed on the discretized signal to obtain high-frequency components and low-frequency components. The formula is as follows:

[0081] .

[0082] .

[0083] in, represents the low-frequency component, represents the convolution kernel of low-pass convolution, represents the high frequency component, Represents the convolution kernel of the high-pass convolution.

[0084] Then, wavelet transform is performed on the high-frequency component, and the formula of wavelet coefficient is as follows:

[0085] .

[0086] in, For scale and location The wavelet coefficients on is the scale coefficient, is the translation index, Indicates the number of discrete resistance values, The image function in the wavelet domain representing the high-frequency component, represents the scaling function.

[0087] In wavelet decomposition, the correlation of data can be removed well. The useful signal sequence will be concentrated in a certain section of the wavelet domain, and the wavelet coefficients have large values; while the noise signal sequence is evenly distributed in the entire wavelet domain, and the wavelet coefficients have small values. Therefore, choosing a suitable threshold can effectively filter out the noise signal.

[0088] The embodiment of the present invention selects a soft threshold function to perform threshold function processing, removes the noise sequence, and retains the useful sequence. In the soft threshold function, the sequence whose wavelet coefficient is less than the threshold is directly set to zero, and the sequence whose wavelet coefficient is greater than the threshold is subjected to threshold shrinkage processing with amplitude reduction, as shown in the following formula:

[0089] .

[0090] in, represents the soft threshold function, represents the shrinkage function, Indicated in scale and location The wavelet decomposition coefficients on , and Indicates j A threshold value.

[0091] Finally, wavelet reconstruction is performed. Wavelet reconstruction is essentially an inverse wavelet transform of the signal, followed by filter reconstruction and signal reconstruction to achieve a denoised sequence. The signal is restored, and then processed continuously to output the useful signal.

[0092] In the above embodiment, a more accurate resistance timing signal can be obtained by performing noise filtering processing on the resistance timing signal collected by the dynamic resistance measurement system through the wavelet denoising algorithm.

[0093] S2, performing first-order difference processing on the resistance timing signal to obtain a differential data set; inputting the differential data set into a pre-trained first-order difference logistic linear regression model to predict the printing state of the metal 3D printed body to be detected at the current moment.

[0094] Among them, the first-order difference logistic linear regression model is a first-order difference improved logistic linear regression model, that is, the input of the model is not the original data set, but the data set after the first-order difference. The first-order difference logistic linear regression model is pre-trained based on the first-order difference data set of the historical resistance timing signal.

[0095] The printing status includes a normal printing status and an abnormal printing status.

[0096] Exemplarily, after the resistance timing signal is acquired, an absolute value operation is performed on the first-order difference of the resistance timing signal, and the formula is as follows:

[0097] .

[0098] in, Indicates i Differential data, Indicates the resistance timing signal A resistance signal, Indicates the resistance timing signal A plurality of resistance signals and a plurality of differential data form a differential data set.

[0099] Furthermore, the differential data set is normalized, and the formula is as follows:

[0100] .

[0101] in, Indicates the difference in the data set i The value after normalization of the data, It means to find the maximum value in the difference data set. It means to find the minimum value in the difference data set. d Represents a differenced dataset.

[0102] Then, the normalized difference data set is input into the trained first-order difference logistic linear regression model for prediction. The formula of the first-order difference logistic linear regression model is as follows:

[0103] .

[0104] in, Indicates the probability value of abnormal printing status, represents the base of natural logarithms, is the weighted sum of each differential data, , Indicates weights, Indicated by The weight vector composed of weights, that is Contains weights for multiple eigenvalues, represents transpose, Indicates Differential data, for The difference data set is composed of difference data.

[0105] Further, if the probability value output by the first-order difference logistic linear regression model is greater than a preset threshold (eg, 0.5), the printing state is an abnormal printing state.

[0106] It should be understood that in a binary classification problem, the probabilities of the two categories appearing are opposite to each other, and the logarithmic probability can be further obtained to represent the ratio between the probability of an abnormal printing state and the probability of a normal printing state, and the formula is as follows:

[0107] .

[0108] Optionally, in the training process of the first-order difference logistic linear regression model, firstly, multiple groups of resistance time series signals are subjected to first-order difference processing to obtain multiple differential data sets, and the multiple differential data sets are used as training sets, and a 0 label (0 label is defined as an abnormal printing state) and a 1 label (1 label is defined as a normal printing state) are added, and the maximum likelihood function is used to estimate the weight coefficient in the sample fitting process, which can be expressed by the following formula:

[0109] .

[0110] in, represents the maximum likelihood function, Indicates The probability that the differential data is label 0. Since the probabilities of the two labels are opposite to each other in the binary classification problem, The probability that the differential data is label 1 is , is the linear regression function data points.

[0111] Optionally, in order to speed up the training of the model, the maximum likelihood function can be converted to a log-likelihood function, with the following formula:

[0112] .

[0113] in, represents the log-likelihood function.

[0114] It should be understood that the weight coefficients of each eigenvalue can be obtained during the training process of the first-order differential logistic linear regression model. The acquired differential data set of the resistance timing signal is input into the trained first-order differential logistic linear regression model. A prediction can be made based on the differential data and the corresponding weight coefficients to output the probability that the printing state is an abnormal state.

[0115] Figure 3 A schematic diagram of a printing status determination result provided by an embodiment of the present invention.

[0116] For example, during the printing process of the 3D printed body to be tested, 4 groups of resistance timing signals are collected for status judgment, each group includes 157 resistance data, and the 4 groups of timing signals are respectively used for printing status judgment through the first-order difference linear regression model. The judgment results are as follows: Figure 3 As shown, Figure 3 Figure (a) is the discrimination result diagram of the first group of resistance timing signals. Figure 3 Figure (b) is the discrimination result diagram of the second group of resistance timing signals. Figure 3 Figure (c) is the discrimination result diagram of the third group of resistance timing signals. Figure 3 Figure (d) in FIG. 1 is the discrimination result diagram of the fourth group of resistance timing signals. It should be understood that Figure 3 It can be seen that when the resistance value suddenly changes significantly at a certain moment, fluctuations will appear in the corresponding discrimination effect diagram, indicating that the printing state at the current moment is abnormal.

[0117] It should be understood that since the first-order difference logistic linear regression requires the data to be separable, that is, the data set can be divided into two subsets so that the data points in each subset belong to different categories, the embodiment of the present invention clusters the resistance timing signal through the K-Means clustering algorithm to verify whether the printing status can be judged through the first-order difference logistic linear regression model.

[0118] The embodiment of the present invention selects 4 groups of resistance timing signals for clustering, and the clustering results are as follows: Figure 4 As shown, Figure 4 Figure (a) is the clustering result diagram of the first group of resistor timing signals. Figure 4 Figure (b) is the clustering result diagram of the second group of resistor timing signals. Figure 4 Figure (c) is the clustering result diagram of the third group of resistor timing signals. Figure 4 Figure (d) is the clustering result diagram of the fourth group of resistor timing signals.

[0119] It can be seen that the resistance timing signals can be clustered into two clusters, indicating that the resistance timing signals can be classified into two categories according to the printing status through the first-order difference logistic linear regression model.

[0120] S3, if the printing state is an abnormal printing state, obtaining image data of the metal 3D printed body to be inspected.

[0121] It should be understood that if the printing state is an abnormal printing state, it means that the metal 3D printed body has defects, and the specific defect type can be further determined through image data.

[0122] Specifically, the industrial camera is installed and fixed in a suitable position, and the focal length, exposure and other parameters of the camera are set to ensure that the captured image is not blocked by other objects; then, the image data is transmitted to the PC terminal through a data connection cable to realize the collection of image data of the metal 3D printing process.

[0123] Figure 5 A schematic diagram of a defect detection system provided by an embodiment of the present invention.

[0124] Exemplarily, the defect detection system includes: a PC terminal 1, an AC constant current source 2, an industrial camera 3, a laser 4, a fill light 5, a wire feeder 6, a wire reel 7, a print head 8, a substrate 9 and a mobile platform 10.

[0125] like Figure 5As shown, in the defect detection system, the positive and negative electrodes of the constant current source signal are respectively connected to the print head 8 and the substrate 9 to realize the input of the excitation signal of the metal 3D printed body to be detected, and the output signal is the voltage signal at both ends of the metal 3D printed body (resistance to be tested). The voltage signal is calculated by the microcontroller to obtain the resistance timing signal. If it is determined that the printing state of the metal 3D printed body to be detected is an abnormal state according to the resistance timing signal, the video image data taken by the industrial camera 3 is obtained.

[0126] S4, performing defect detection on the metal 3D printed body to be inspected according to the image data.

[0127] For example, some image recognition models (such as convolutional neural networks, YOLO (You Only Look Once) and Single Shot MultiBox Detector (SSD), etc.) can be trained using historical image data of metal 3D printed bodies, and the image data can be recognized by the trained models to determine the defect type.

[0128] The YOLOv8 model belongs to the YOLO series of models. As of now, it is the most advanced model in the field of computer vision for classification, detection, and segmentation tasks.

[0129] In an embodiment of the present invention, Context Anchor Attention (CAA) is introduced into the Star Blocks module, and then the YOLOv8 model is improved based on the Star Blocks module, and the image is recognized by the improved YOLOv8 model.

[0130] The CAA attention mechanism was originally used to obtain long-distance contextual information in remote sensing images. It can well grasp the interdependence between distant pixels, enhance central features, and improve the feature extraction ability of slender objects. Since the metal 3D printed body in laser wire deposition metal additive manufacturing is composed of a single accumulation of metal strips, it is essentially a slender object, so adding CAA can improve the model's recognition accuracy of metal 3D printed bodies.

[0131] The Star Blocks module is a technology used to improve the feature extraction capabilities of deep learning models. It is based on element-level multiplication operations and can map inputs to high-dimensional nonlinear feature spaces. Through this element-level multiplication operation, the performance and efficiency of the model can be improved.

[0132] It should be understood that the CAA mechanism is introduced into the Star Blocks module in order to enhance the model's ability to express the features of slender objects. Specifically, the CAA mechanism is added after the multiplication operation of the original Star Blocks module.

[0133] Furthermore, the Star blocks module with CAA added above replaces the C2F (Context to Feature) module in the original YOLOv8 model to obtain an improved YOLOv8 model.

[0134] It should be understood that in the YOLOv8 model, the role of the C2F module is to transfer the context information of the high-level feature map to the low-level feature map to enhance the expressiveness of the low-level feature map.

[0135] The improved YOLOv8 model architecture consists of three parts: backbone network, neck network and head network.

[0136] The backbone network has 10 layers, including Conv (convolutional layer), Star Blocks+CAA (Star Blocks module with CAA mechanism), and SPPF (Spatial Pyramid Pooling Fast) modules. The backbone network can be divided into four layers: the first layer is 0-2 layers, which is used for pre-extraction of features before the image enters the model. The remaining three layers are composed of 3-4 layers, 5-6 layers, and 7-9 layers, which are used to extract features of the image and serve as the third, fourth, and fifth layers in the feature pyramid (FPN) of the overall model, laying the foundation for target detection in the subsequent network.

[0137] The neck network has a total of 12 layers, consisting of Conv, Star Blocks+CAA, Concat (splicing layer) and Upsample (upsampling layer). The neck network is used to connect the backbone network and the head network, and plays a role in enhancing data features and data fusion.

[0138] The head network contains three decoupled detection heads, which are connected to the 15th, 18th and 21st layers of the neck network respectively, to decode the extracted image features for the final target detection. The internal part of the detection head separates the regression branch from the classification branch, so that the model can focus more on the detection of a certain target, and finally calculate the target's bounding box regression loss Bbox_Loss and label prediction loss Cls_Loss.

[0139] Furthermore, the improved YOLOv8 model is trained to obtain a detection model for detecting defect types of metal 3D printed bodies, and defect detection is performed according to the detection model.

[0140] Exemplarily, the process of training the above improved YOLOv8 model is as follows:

[0141] First of all, since the YOLOv8 model is a supervised machine learning model, the image data needs to be annotated with defects to form a usable training data set before model training begins. The defect types include spheroidization defects, fish scale defects, S-shaped defects, and undulating defects.

[0142] Optionally, Labelimg can be used to annotate images.

[0143] Since there are occlusions, overexposure, extreme blur and other phenomena in the image data, there is no useful information in these data and labels cannot be added to the images. Therefore, the image data is cleaned of abnormal data and only valid image data is retained.

[0144] In order to enrich the training data set and enhance the recognition accuracy and anti-interference ability of the model, the image can also be processed positively and negatively. In the positive processing, adaptive histogram equalization, unsharp mask (USM) sharpening and color inversion are used to highlight the characteristics of the image data; in the negative processing, two-dimensional Gaussian noise, salt and pepper noise and Poisson noise are added to the original image to adapt to the complex situations that may arise in actual situations.

[0145] Then, a software and hardware environment is built for the model. Table 1 is an example of software and hardware environment information provided by an embodiment of the present invention.

[0146] Table 1. Soft and hard information of the model training environment

[0147]

[0148] Furthermore, model parameters are set.

[0149] After importing the necessary libraries of the YOLOv8 model on the local Pycharm, the complete model code is deployed on the local machine. After the deployment is completed, the model training script is written, in which the model network architecture, training data set path and number of training rounds are specified. Table 2 is an example of model setting parameters provided in an embodiment of the present invention.

[0150] Table 2 Model parameters

[0151]

[0152] In summary, in the above-mentioned environment, the improved YOLOv8 model is trained based on the set parameters and training data sets. The trained model can output defect types (such as spheroidization defects, fish-scale defects, S-type defects, and undulating defects) according to the image data of the metal 3D printed body.

[0153] After the trained detection model is obtained through the above training process, defect detection is performed according to the detection model.

[0154] Specifically, the image data is input into the detection model, and feature extraction is performed to obtain a feature map. The extracted image features are fused by adding the Star Blocks module with the CAA attention mechanism. The fused features are predicted through the head network, and the defect type of the metal 3D printed body to be detected is output.

[0155] Among them, the process of feature fusion of the extracted image features by adding the Star Blocks module of the CAA attention mechanism is as follows: the extracted feature map is input into the Star Blocks module for the first linear transformation and the second linear transformation to obtain the transformed feature map, and then the linearly transformed feature map is subjected to element-wise multiplication to obtain a new feature map again. After the new feature map is input into the CAA attention mechanism, average pooling is performed first, and then a 1×1 convolution operation is performed to obtain the local area features of the image, which can be expressed by the formula:

[0156] .

[0157] in, Represents local area characteristics, is a 1×1 convolution operation, is the nth CAA module, For the l stage, is the input feature, is the average pooling operation, is the result of the multiplication operation of the Star Blocks module elements, and when hour, , is the total number of CAA modules.

[0158] Then, the local area features are sequentially subjected to depth peeling convolution in the horizontal and vertical directions. This operation can be regarded as an approximation of the standard large kernel convolution. The relationship between long-distance pixels is obtained with fewer parameters, which can be expressed by the following formula:

[0159] .

[0160] .

[0161] in, is the horizontal depth strip convolution, is the vertical depth strip convolution, For the depth peeling convolution operation, .

[0162] Finally, CAA generates an attention weight map, which is obtained by performing a 1×1 convolution and The function processing can be expressed by the following formula:

[0163] .

[0164] in, is the attention weight, is the output of the depth peeling convolution, since The effect of the function will make The output remains in the range (0, 1).

[0165] The features are fused according to the attention weights, and then the fused features are input to the next layer.

[0166] In the above embodiment, the Star Blocks module can build a compact and efficient network structure without significantly increasing the computational complexity, enhance the model's more powerful feature expression capabilities, and achieve more efficient image classification. Adding CAA after element-wise multiplication of the feature map can better obtain the features of the image and enhance the defect detection capability of the metal 3D printed body in the final generated feature map. Compared with the original YOLOv8 model, the improved YOLOv8 model can extract more effective spatial features, has better spatial perception capabilities, and can reduce the probability of missed detection and false detection in non-image center areas.

[0167] It should be understood that since the data transmitted back from the industrial camera to the PC terminal is video stream data, but the input layer in the YOLO series model uses image data, it is necessary to first decompose the video stream into frames, convert the video data into image data, and then input the image data into the improved YOLOv8 model.

[0168] It should be understood that in the process of machine learning, the model network obtains information about the input image through feature extraction, thereby fitting feature functions that conform to different categories, and then realizing the category judgment of the input image. However, in actual scenarios, the model often has false detections and missed detections in image detection. Therefore, the normalized confusion matrix can be used to measure the accuracy of model detection, such as Figure 6 As shown, Figure 6Figure (a) is the normalized confusion matrix of the original YOLOv8 model. Figure 6 Figure (b) is the normalized confusion matrix of the improved YOLOv8 model. It can be seen that the recognition accuracy of the two models for the morphological defect category can reach more than 94%, and the false positive rate between categories is at an extremely low level of only 0.01.

[0169] The receptive field describes the response area of ​​neurons in a neural network to input. The calculation process can be expressed by the formula:

[0170] .

[0171] in, Represents the model i The receptive field of the layer, Indicates i The convolution stride of the layer, Indicates i The convolution kernel size of the layer.

[0172] The receptive field of the last layer of feature extraction in the YOLOv8 model before and after the improvement is visualized. The results are as follows Figure 7 As shown, Figure 7 Figure (a) shows the visual receptive field of the original YOLOv8 model. Figure 7 Figure (b) shows the visual receptive field of the improved YOLOv8 model.

[0173] It can be seen that the improved YOLOv8 model can obtain more image feature information and has better global perception ability compared to the original YOLOv8 model. Therefore, the accuracy, robustness, generalization ability and potential efficiency are improved compared to the original YOLOv8 model.

[0174] In summary, the improved YOLOv8 model has a good accuracy in identifying the morphological defects of metal 3D printed bodies (reaching more than 94%), and has better global perception ability compared with the original model, which shows that the improved YOLOv8 model is more competent for the task of morphological defect detection in laser wire feeding metal additive manufacturing.

[0175] Based on the same inventive concept, the embodiment of the present invention also provides a defect detection device for a metal 3D printed body, such as Figure 8 As shown, illustratively, the device comprises:

[0176] The first acquisition module 8-1 is used to acquire the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment.

[0177] The prediction module 8-2 is used to perform first-order differential processing on the resistance timing signal to obtain a differential data set; the differential data set is input into a pre-trained first-order differential logistic linear regression model to predict the printing state of the metal 3D printed body to be detected at the current moment; the first-order differential logistic linear regression model is pre-trained based on the first-order differential data set of the historical resistance timing signal; the printing state includes a normal printing state and an abnormal printing state.

[0178] The second acquisition module 8 - 3 is used to acquire image data of the metal 3D printed body to be inspected if the printing state is an abnormal printing state.

[0179] The detection module 8-4 is used to perform defect detection on the metal 3D printed body to be inspected according to the image data.

[0180] Each module in the above-mentioned metal 3D printed body defect detection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0181] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in the metal 3D printed body defect detection method embodiment. The specific implementation method can be found in the method embodiment, which will not be repeated here.

[0182] Furthermore, the present invention also provides a non-temporary computer-readable storage medium containing instructions, and a computer program is stored on the storage medium. For example, a memory containing instructions, the above instructions can be executed by a processor of a computer device to complete the above method. For example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, and an optical data storage device. When the computer program is executed by the processor, the steps in the embodiment of the defect detection method for a metal 3D printed body can be implemented. The specific implementation method can be referred to the method embodiment, which will not be repeated here.

[0183] It should be understood by those skilled in the art that embodiments of the present invention may provide methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0184] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0185] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0187] It should be pointed out that the specific implementation methods described above can enable those skilled in the art to understand the invention more comprehensively, but do not limit the invention in any way. Therefore, although the invention has been described in detail in this specification and embodiments, those skilled in the art should understand that the invention can still be modified or replaced by equivalents; and all technical solutions and improvements that do not deviate from the spirit and scope of the invention are included in the protection scope of the patent for the invention. Any figure mark in the claims should not be regarded as limiting the claims involved. Any simple change or equivalent replacement of the technical solution that can be obviously obtained by any technician familiar with the field within the technical scope disclosed in the present invention belongs to the protection scope of the present invention.

Claims

1. A defect detection method for a metal 3D printed body, characterized in that: include: Obtain the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment; Perform first-order difference processing on the resistance time series signal to obtain a differential data set; The differential data set is input into a pre-trained first-order differential logistic linear regression model to predict the printing status of the metal 3D printed body to be inspected at the current moment; The first-order difference logistic linear regression model is pre-trained based on the first-order difference data set of the historical resistance time series signal; the printing state includes a normal printing state and an abnormal printing state; If the printing state is an abnormal printing state, obtaining image data of the metal 3D printed body to be inspected; Perform defect detection on the metal 3D printed body to be detected according to the image data; The resistance timing signal is subjected to first-order differential processing to obtain a differential data set, specifically: After obtaining the resistance timing signal, the first-order difference of the resistance timing signal is calculated by absolute value. The formula is as follows: d i =|x i -x i-1 |; Among them, d i represents the ith differential data, x i represents the i-th resistance signal in the resistance timing signal, x i-1 represents the i-1th resistance signal in the resistance timing signal, and a plurality of differential data form a differential data set; The expression of the first-order difference logistic linear regression model is: Among them, g(y) represents the probability value of abnormal printing status, e represents the base of natural logarithm, and y is the weighted sum of each differential data. ω i represents the i-th weight, ω represents the weight vector composed of n weights, T represents the transposition operation, δ i represents the i-th differential data, δ is the differential data set composed of n differential data; Predict the printing status of the metal 3D printed body to be tested at the current moment, including: If the probability value at the current moment output by the first-order difference logistic linear regression model is greater than a preset threshold, the printing state at the current moment is determined to be an abnormal printing state; Performing defect detection on the metal 3D printed body to be detected according to the image data includes: Constructing an improved YOLOv8 model including a backbone network, a neck network and a head network, wherein the improved YOLOv8 model replaces the C2F modules in the backbone network and the neck network in the original YOLOv8 model with StarBlocks modules that add a CAA attention mechanism; The improved YOLOv8 model is trained to obtain a detection model for detecting defect types of metal 3D printed bodies; The image data is input into the detection model, the extracted image features are fused by adding the Star Blocks module of the CAA attention mechanism, the fused features are predicted by the head network, and the defect type of the metal 3D printed body to be detected is output; The improved YOLOv8 model is trained to obtain a detection model for detecting metal 3D printed body defect types, including: Obtain historical image data of metal 3D printed bodies; Performing positive processing and negative processing on the historical image data; wherein the positive processing includes adaptive histogram equalization, USM sharpening and color inversion processing, and the negative processing includes adding noise to the image data; Annotate the processed image data for defects to obtain a training data set; The improved YOLOv8 model is trained using the training data set to obtain a detection model for detecting defect types of metal 3D printed bodies.

2. The defect detection method for a metal 3D printed body according to claim 1, characterized in that: Obtaining the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment, including: An AC sine wave signal is generated by a signal generator, and the AC sine wave signal is adjusted to obtain a constant current source signal; Inputting a constant current source signal to the metal 3D printed body to be detected, and obtaining a voltage across both ends of the metal 3D printed body to be detected; The resistance value of the metal 3D printed body to be detected at each moment is calculated according to the voltage across the two ends of the metal 3D printed body to be detected and the current passing through the metal 3D printed body to be detected, and a resistance timing signal within the current moment and a preset time length before the current moment is obtained.

3. The defect detection method for a metal 3D printed body according to claim 1, characterized in that: After obtaining the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment, it also includes: Discretize the resistance timing signal, perform low-pass convolution and high-pass convolution on the discretized resistance timing signal, and decompose the high-frequency component and low-frequency component of the resistance timing signal; Determine a target threshold based on a soft threshold function, and perform a wavelet transform on the high-frequency component based on the target threshold to obtain a processed resistance time series signal; The processed resistance timing signal is reconstructed by wavelet to obtain the target resistance timing signal.

4. A defect detection device for a metal 3D printed body, characterized in that: include: The first acquisition module is used to acquire the resistance timing signal of the metal 3D printed body to be detected at the current moment and within a preset time period before the current moment; A prediction module is used to perform first-order difference processing on the resistance time series signal to obtain a differential data set; The differential data set is input into a pre-trained first-order differential logistic linear regression model to predict the printing status of the metal 3D printed body to be inspected at the current moment; The first-order difference logistic linear regression model is pre-trained based on the first-order difference data set of the historical resistance time series signal; the printing state includes a normal printing state and an abnormal printing state; A second acquisition module is used to acquire image data of the metal 3D printed body to be inspected if the printing state is an abnormal printing state; A detection module, used for performing defect detection on the metal 3D printed body to be detected according to the image data; The resistance timing signal is subjected to first-order differential processing to obtain a differential data set, specifically: After obtaining the resistance timing signal, the first-order difference of the resistance timing signal is calculated by absolute value. The formula is as follows: d i =|x i -x i-1 |; Among them, d i represents the ith differential data, x i represents the i-th resistance signal in the resistance timing signal, x i-1 represents the i-1th resistance signal in the resistance timing signal, and a plurality of differential data form a differential data set; The expression of the first-order difference logistic linear regression model is: Among them, g(y) represents the probability value of abnormal printing status, e represents the base of natural logarithm, and y is the weighted sum of each differential data. ω i represents the i-th weight, ω represents the weight vector composed of n weights, T represents the transposition operation, δ i represents the i-th differential data, δ is the differential data set composed of m differential data; Predict the printing status of the metal 3D printed body to be tested at the current moment, including: If the probability value at the current moment output by the first-order difference logistic linear regression model is greater than a preset threshold, the printing state at the current moment is determined to be an abnormal printing state; Performing defect detection on the metal 3D printed body to be detected according to the image data includes: Constructing an improved YOLOv8 model including a backbone network, a neck network and a head network, wherein the improved YOLOv8 model replaces the C2F modules in the backbone network and the neck network in the original YOLOv8 model with StarBlocks modules that add a CAA attention mechanism; The improved YOLOv8 model is trained to obtain a detection model for detecting defect types of metal 3D printed bodies; The image data is input into the detection model, the extracted image features are fused by adding the Star Blocks module of the CAA attention mechanism, the fused features are predicted by the head network, and the defect type of the metal 3D printed body to be detected is output; The improved YOLOv8 model is trained to obtain a detection model for detecting metal 3D printed body defect types, including: Obtain historical image data of metal 3D printed bodies; Performing positive processing and negative processing on the historical image data; wherein the positive processing includes adaptive histogram equalization, USM sharpening and color inversion processing, and the negative processing includes adding noise to the image data; Annotate the processed image data for defects to obtain a training data set; The improved YOLOv8 model is trained using the training data set to obtain a detection model for detecting defect types of metal 3D printed bodies.

5. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for detecting defects in a metal 3D printed body according to any one of claims 1 to 3 is implemented.

6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the defect detection method for a metal 3D printed body according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Resistance spot welding quality online detection method fusing multi-sensing time sequence signal mechanism model

    CN114861498A

  • Deep learning 3D printing defect detection method based on improved YOLOX algorithm

    CN116704267A