Defect detection method, device, equipment, medium and product

By generating clear C-scan images using multi-channel ultrasonic information and pre-fitted DAC surfaces, the problems of aperture limitation and noise interference in existing technologies are solved, enabling high-precision defect detection of workpieces with different apertures.

CN120847251APending Publication Date: 2025-10-28PIPECHINA SOUTH CHINA CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511136095.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-14
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing ultrasonic defect detection technology can only be used on workpieces with the same aperture. It is susceptible to noise interference, which leads to detection errors, rough image generation, and affects the accuracy of defect judgment.

Method used

By acquiring multi-channel ultrasonic information and prefitting DAC surfaces, multiple C-scan images at different sound path positions are determined, and clear images are generated using image reconstruction models to determine the defect detection results of the workpiece.

Benefits of technology

It enables precise inspection of workpieces with different apertures, improves image quality and the accuracy of defect detection, reduces noise interference, and enhances the clarity of inspection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120847251A_ABST
    Figure CN120847251A_ABST
Patent Text Reader

Abstract

The invention discloses a defect detection method, device and equipment, a medium and a product, and relates to the technical field of ultrasonic detection. The method comprises the following steps: acquiring multi-channel ultrasonic information and a pre-fitting DAC curved surface of a to-be-detected workpiece; according to the multi-channel ultrasonic information and the pre-fitting DAC curved surface, determining a plurality of C scanning images under different sound path distance positions; and determining a defect detection result of the to-be-detected workpiece according to all the C scanning images and the image reconstruction model. The method comprises the following steps: determining a DAC curve corresponding to a to-be-detected workpiece in a pre-fitting DAC curved surface formed by DAC curves corresponding to different apertures, generating a plurality of C scanning images to reconstruct a clear image, and determining a score of the to-be-detected workpiece as a defect detection result. The fitting requirements of the workpieces to be detected with different apertures are met, the fitting precision is improved, the quality of a C scanning image is improved, the quality of a final detection image is further improved, and the accuracy of workpiece defect detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ultrasonic testing technology, and in particular to a defect detection method, apparatus, equipment, medium, and product. Background Art

[0002] Ultrasonic defect detection is a technology based on modern industry that uses ultrasonic C-mode scanning to detect and analyze defects in workpieces. Ultrasonic C-mode scanning is a method of modulating and imaging based on cross-sectional echo information within the ultrasonic scanning range during workpiece inspection.

[0003] Existing technology uses Hermit interpolation to fit information obtained from ultrasonic C-scans to generate a distance-amplitude (DAC) curve. This DAC curve is then combined with three-color imaging to generate a workpiece image. This method allows for the intuitive display of defect location and size, enabling qualitative and quantitative analysis of the defects.

[0004] However, this method can only be applied to defects in workpieces with the same aperture, and the fitting process is susceptible to noise interference, leading to unknown detection errors. Furthermore, the images generated using three-color imaging are relatively coarse, containing abnormal black and white pixels, which interfere with manual determination of the number, location, size, and depth of defects. Summary of the Invention

[0005] This invention provides a defect detection method, apparatus, equipment, medium, and product to meet the detection needs of workpieces with different aperture sizes, improve the accuracy of image generation, and thus enhance the accuracy of the final defect detection results.

[0006] According to one aspect of the present invention, a defect detection method is provided, comprising:

[0007] Acquire multi-channel ultrasonic information and prefitted DAC surface of the workpiece to be inspected;

[0008] Based on the multi-channel ultrasound information and the prefitted DAC surface, multiple C-scan images at different sound path positions are determined;

[0009] Based on all the C-scan images and the image reconstruction model, the defect detection results of the workpiece to be inspected are determined.

[0010] According to a second aspect of the present invention, a defect detection apparatus is provided, comprising:

[0011] The information acquisition module is used to acquire multi-channel ultrasonic information and pre-fitted DAC surface of the workpiece to be inspected;

[0012] The image generation module is used to determine multiple C-scan images at different sound path positions based on the multi-channel ultrasound information and the prefitted DAC surface.

[0013] The result determination module is used to determine the defect detection result of the workpiece under inspection based on all the C-scan images and the image reconstruction model.

[0014] According to a third aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the defect detection method according to any embodiment of the present invention.

[0018] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the defect detection method according to any embodiment of the present invention.

[0019] According to a fifth aspect of the present invention, embodiments of the present invention also provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the defect detection method of any embodiment of the present invention.

[0020] The technical solution of this invention involves acquiring multi-channel ultrasonic information and a pre-fitted DAC surface of the workpiece to be inspected; determining multiple C-scan images at different sound path positions based on the multi-channel ultrasonic information and the pre-fitted DAC surface; and determining the defect detection result of the workpiece to be inspected based on all C-scan images and the image reconstruction model. By determining the DAC curve corresponding to the workpiece to be inspected within the pre-fitted DAC surface composed of DAC curves corresponding to different apertures, multiple C-scan images are generated for clear image reconstruction, and the score of the workpiece to be inspected is determined as the defect detection result. This satisfies the fitting requirements for workpieces with different apertures, improves the fitting accuracy, enhances the quality of the C-scan images, and thus improves the quality of the final detection image and the accuracy of workpiece defect detection.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a defect detection method provided in Embodiment 1 of the present invention;

[0024] Figure 2 This is an example diagram of a DAC surface in a defect detection method according to Embodiment 1 of the present invention;

[0025] Figure 3 This is a flowchart of a defect detection method provided according to Embodiment 2 of the present invention;

[0026] Figure 4 This is a structural diagram of an image reconstruction model in a defect detection method according to Embodiment 2 of the present invention;

[0027] Figure 5 This is an example flowchart of a defect detection method provided according to Embodiment 2 of the present invention;

[0028] Figure 6 This is a schematic diagram of the structure of a defect detection device according to Embodiment 3 of the present invention;

[0029] Figure 7 This is a schematic diagram of the structure of an electronic device that implements an embodiment of the present invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] Example 1

[0033] Figure 1 This is a flowchart of a defect detection method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where defects are detected and scored on workpieces to be inspected. This method can be executed by a defect detection device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0034] S110: Acquire multi-channel ultrasonic information and prefitted DAC surface of the workpiece to be inspected.

[0035] In this embodiment, the workpiece to be inspected can be understood as a workpiece that needs to be inspected for defects. Multi-channel ultrasonic information can be understood as ultrasonic information including multiple transmission channels, wherein the ultrasonic information may include the aperture, sound path and echo amplitude determined by different channels.

[0036] In this embodiment, the prefitted DAC surface can be understood as a DAC surface containing the fitted echo amplitude of the workpiece under test with respect to the workpiece aperture and sound path. A specific example is provided for illustration. Figure 2 An example diagram of the DAC surface in a defect detection method provided in Embodiment 1 of the present invention is shown below. Figure 2 As shown, the x-axis represents the aperture size, the y-axis represents the sound path, and the z-axis represents the echo amplitude. By combining the prefitted DAC surface, the corresponding DAC curve can be obtained as long as the value of x is given.

[0037] Specifically, an ultrasonic information collection module can be pre-set to perform ultrasonic scanning on the workpiece to be inspected, obtaining multi-channel ultrasonic information and transmitting it to the processor. The processor can receive the multi-channel ultrasonic information of the workpiece to be inspected. Pre-fitted DAC surfaces of the workpiece under different apertures can be pre-fitted and stored in a storage medium. The processor can retrieve the pre-fitted DAC surfaces from the storage medium.

[0038] For example, the ultrasound information collection module may include a multi-channel ultrasound transmitting unit, an ultrasound receiving unit, and a power management unit, wherein the specific functions of each unit are as follows: The ultrasound transmitting unit is used to transmit a negative square wave with a maximum voltage of 400V. The transmitting control switch needs to be a high-voltage, high-current, low-internal-resistance switch, such as an N-type silicon carbide switch. The rising edge of the transmitting pulse and the falling edge of the transmitting circuit can respectively use a P-type switch and an ultra-fast recovery diode. The transmitting circuit is also equipped with 50R and 200R dampers to support single-to-dual crystal switching for damping switching; The ultrasound receiving unit is used to receive and adjust the multi-channel ultrasound information, and the adjustment of the increase The gain range and bandwidth range are within 110dB and 0.3-24MHz, respectively. The ultrasonic receiving unit employs dual protection circuitry to prevent circuit damage. This dual protection circuitry includes a clamping protection circuit with resistors and back-to-back diodes in series, and a bridge diode clamping circuit. Furthermore, the ultrasonic receiving unit includes multi-level gain switching, an ultra-low noise amplifier, and a high-pass filter, used to adjust the gain range, increase bandwidth, and perform digital filtering in conjunction with the FPGA, respectively. The power management unit provides AC220V, 50-60Hz, 1A AC power and 12-15VDC, ≥4A DC power. Functionally, the power management unit can be divided into digital domain power and analog domain power. The digital domain power includes switching power supplies, and the analog domain power includes low-noise linear analog power supplies. The information transmission module primarily transmits and organizes ultrasonic information through the FPGA. This module also includes data synchronization, digital input, digital output, and upgrade functions. The information transmission module organizes multi-channel ultrasonic information from the ultrasonic information collection module into a fixed-format numerical matrix, and then transmits it to the PC host computer where the processor resides via the PHY port. The processor can then acquire the multi-channel ultrasonic information.

[0039] S120. Based on multi-channel ultrasound information and pre-fitted DAC surface, determine multiple C-scan images at different sound path positions.

[0040] In this embodiment, the acoustic path position can be understood as the distance traveled by the ultrasonic signal in each transmission channel from transmission to reception. The C-scan image can be understood as two-dimensional imaging on different planes.

[0041] Specifically, the processor can determine the DAC curve corresponding to the aperture of the workpiece under test in the prefitted DAC surface, and then determine the echo amplitude at the corresponding sound path. Combined with the echo amplitude in the multi-channel ultrasonic information of the workpiece under test, the processor can determine the range in which the echo amplitude of the workpiece under test is located, calculate the difference between the two echo amplitudes, and generate a C-scan image at each sound path position based on the pixel value preset in the range and the difference in echo amplitude, thus obtaining multiple C-scan images.

[0042] S130. Based on all C-scan images and image reconstruction models, determine the defect detection results of the workpiece to be inspected.

[0043] In this embodiment, the image reconstruction model can be understood as a model used for image reconstruction and workpiece defect detection, such as a pre-trained neural network model. The defect detection result can be understood as a detection result reflecting the degree of workpiece defect, such as a workpiece score as the detection result, which can be used to finely classify the quality of the workpiece.

[0044] Specifically, the processor can aggregate all C-scan images through an image reconstruction model, reconstruct a clear workpiece image, automatically determine the workpiece score based on the clear workpiece image, calculate the workpiece score determination accuracy, and automatically improve the workpiece score based on the accuracy to achieve a better workpiece score result, which is then used as the defect detection result.

[0045] The technical solution of this invention involves acquiring multi-channel ultrasonic information and a pre-fitted DAC surface of the workpiece to be inspected; determining multiple C-scan images at different sound path positions based on the multi-channel ultrasonic information and the pre-fitted DAC surface; and determining the defect detection result of the workpiece to be inspected based on all C-scan images and the image reconstruction model. By determining the DAC curve corresponding to the workpiece to be inspected within the pre-fitted DAC surface composed of DAC curves corresponding to different apertures, multiple C-scan images are generated for clear image reconstruction, and the score of the workpiece to be inspected is determined as the defect detection result. This satisfies the fitting requirements for workpieces with different apertures, improves the fitting accuracy, enhances the quality of the C-scan images, and thus improves the quality of the final detection image and the accuracy of workpiece defect detection.

[0046] As a first optional embodiment of this embodiment, based on the above embodiment, the fitting step for prefitting the DAC surface may include:

[0047] Training data for multiple test workpieces are obtained. The test workpieces have the same workpiece parameters as the workpiece to be inspected and have multiple defects. The training data is input into the fitting model to obtain the prefitted DAC surface corresponding to the workpiece to be inspected.

[0048] In this embodiment, the test workpiece can be understood as the workpiece used for testing, whose parameters, such as material, shape, and aperture, are the same as those of the workpiece under test and have at least three defects of different depths. Training data can be understood as data used to train the fitting model. The fitting model can be understood as a DAC surface used to fit the echo amplitude with respect to the workpiece aperture and sound path.

[0049] Specifically, the processor can acquire training data from multiple test workpieces. These test workpieces have the same parameters as the workpiece under inspection and contain multiple defects. The training data is then input into the trained fitting model to obtain a pre-fitted DAC surface corresponding to the workpiece under inspection.

[0050] For example, the training data includes aperture, sound path, and echo amplitude. The fitting model can consist of three fully connected layers, with batch normalization layers and Leaky ReLU activation functions used between each pair of fully connected layers. Each fully connected layer contains K1 hidden neurons; for example, in this embodiment, the number of channels is 8, so K1 = 8. The fitting model uses dataset 1, which contains 20,000 samples. Training set 1 accounts for 80% of dataset 1, i.e., N = 16,000, while validation set 1 and test set 1 each contain 2,000 samples. Each sample contains an aperture x, sound path y, and echo amplitude z. The aperture and sound path in the training data form a 2×16,000 vector as the input to the fitting model, and the output of the fitting model is the echo amplitude vector z, with a dimension of 1×16,000.

[0051] For example, the loss function is:

[0052]

[0053] Where ||·||2 is the Euclidean norm, z n and These represent the echo amplitudes of the nth test piece. Gradient descent is used for training, and the weights assigned to the j-th neuron in the i-th layer of the network are... and bias It will be updated based on the learning rate (lr), and the specific formula is as follows:

[0054]

[0055] To avoid overfitting and slow training, the learning rate also needs to be updated in real time. The initial learning rate is set to 0.01, and its update formula is as follows:

[0056]

[0057] Where step represents the number of training epochs, and β is the decay factor, which is 0.7 in this embodiment. The fitting model is trained for a total of 100 epochs. After training, all weight coefficients in the fitting model are fixed, and the samples from validation set 1 and test set 1 are input into the fitting model for validation to obtain the final fitting model.

[0058] The first optional embodiment of this embodiment solves the drawback of traditional solutions that can only fit test workpieces with the same aperture by designing a fitting model for fitting the DAC surface and using a neural network to fit ultrasonic information. This greatly reduces the interference of noise on the fitting process and improves the fitting accuracy.

[0059] Example 2

[0060] Figure 3This is a flowchart of a defect detection method provided in Embodiment 2 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 3 As shown, the method includes:

[0061] S301. Acquire multi-channel ultrasonic information and prefitted DAC surface of the workpiece to be inspected.

[0062] S302. Determine the DAC curve corresponding to the aperture value in the prefitted DAC surface.

[0063] Specifically, the processor can find the corresponding DAC curve by searching the prefitted DAC surface using the aperture value.

[0064] S303. Determine the C-scan pixel value based on the actual echo amplitude and DAC curve.

[0065] In this embodiment, the multi-channel ultrasonic information includes aperture value, sound path value, and actual echo amplitude. The aperture value refers to the number of array elements involved in sound wave transmission / reception. The actual echo amplitude can be understood as the echo amplitude of the workpiece under test obtained by scanning with a multi-channel ultrasonic device. The C-scan pixel value can be understood as the pixel value used for image generation, for example, a three-color system can be used.

[0066] Specifically, the processor can first determine the theoretical echo amplitude at the sound path value in the DAC curve, and then determine the C-scan pixel value based on the theoretical echo amplitude and the actual echo amplitude, and based on the preset pixel value.

[0067] Furthermore, based on the above embodiments, the step of determining the C-scan pixel value according to the actual echo amplitude and DAC curve can be refined as follows:

[0068] Determine the theoretical echo amplitude at the sound path value in the DAC curve; determine the echo interval and echo difference based on the theoretical echo amplitude and the actual echo amplitude; determine the C-scan pixel value based on the echo interval and echo difference.

[0069] In this embodiment, the theoretical echo amplitude can be understood as the echo amplitude calculated under ideal conditions. The echo range can be understood as a range set to reflect the degree of defect. The echo difference is used to reflect the gap between the theoretical and actual echo amplitudes.

[0070] Specifically, the processor can determine the theoretical echo amplitude at the sound path value in the DAC curve. The processor can determine the echo difference value based on the difference between the theoretical and actual echo amplitudes, and based on the echo difference value and a pre-set evaluation line, determine the echo range (i.e., the defect severity range) of the echo amplitude obtained from the workpiece under inspection within the DAC curve. The processor can then determine the C-scan pixel value based on the echo range and the echo difference value.

[0071] For example, the evaluation line dB value is selected as p1, the quantitative line dB value is p2, the rejection line dB value is p3, and the echo difference between the theoretical echo amplitude and the actual echo amplitude is p. Based on p, the interval of the echo amplitude obtained from the ultrasonic scanning of the inspected workpiece within the DAC curve is determined, and the pixel value is set to generate q C-scan images, where q is the number of channels. In this embodiment, p1 = -15, p2 = 0, p3 = 10, and q = 8. The C-scan pixel value setting adopts a three-color system. When p1 ≤ p < p2, it corresponds to the first echo interval, which is considered a non-hazardous defect, and the pixel value is set to α1 (which can be set according to experience). When p2 ≤ p < p3, it corresponds to the second echo interval, which is considered a potential defect that needs further judgment by subsequent methods, and the pixel value is set to α2. When p ≥ p3, it corresponds to the third echo interval, which is considered a non-negligible defect, and the pixel value is set to α3. In this embodiment, α1 = 240, α2 = 128, and α3 = 32.

[0072] S304. Based on the C-scan pixel values, generate multiple C-scan images corresponding to different sound path positions.

[0073] S305. Reconstruct all C-scan images and clear images of the workpiece under inspection using an image reconstruction model to obtain a reconstructed clear image of the workpiece under inspection.

[0074] In this embodiment, a clear image can be understood as an image of the workpiece to be inspected captured by an image acquisition device.

[0075] Specifically, the processor can input clear images captured by the image acquisition device and all C-scan images into the image reconstruction model. The image reconstruction model performs reconstruction processing to obtain a clear reconstructed image of the workpiece to be inspected. The clear reconstructed image has extremely high fidelity and can clearly observe the defect location, size, and depth of the workpiece, which helps the image reconstruction model to accurately score the workpiece.

[0076] For example, to facilitate understanding of this solution, a specific example of an image reconstruction model will be used to demonstrate it. Figure 4 This invention provides a structural diagram of an image reconstruction model in a defect detection method according to Embodiment 2 of the present invention, as shown below. Figure 4 As shown, the image reconstruction model includes an encoder, a decoder, and two fully connected layers. The encoder consists of two convolutional layers, an attention layer, a fully connected layer, and a batch normalization layer. The decoder consists of multiple fully connected layers. The processor can convert q scanned images (C-scan images) and the captured sharp image into a numerical matrix, defined as R1, ..., R... q The image shows eight images as an example. The numerical values ​​in the matrix range from 0 to 255, with 0 corresponding to black and 255 to white. The matrix dimension is related to the image resolution. Specifically, the pixel matrix dimension of the C-scan image is w.C ×w C The clear image is w V ×w V In this embodiment, w C =8, w V =64; To prevent the loss of edge information of the numerical matrix during subsequent convolution, R1, ..., R2 are expanded. q The dimension to (w C +2)×(w C +2), (w C +2)×(w C The augmented numerical matrix (+2) will pass through two identical convolutional layers consecutively. The kernel size of each convolutional layer is f×f, the stride is l, and the number of pixels is t. After two convolutions, q [(w] will be obtained. C -f+2t+l) / l]×[(w C The convolutional numerical matrix of -f+2t+l) / l] In this embodiment, f=3, l=1, t=1; q convolutional numerical matrices are input into the attention layer. The attention layer executes a self-attention mechanism, which re-represents each convolutional numerical matrix using a weighted sum of the remaining convolutional numerical matrices. The assigned weights are positively correlated with the similarity between the remaining convolutional numerical matrices and the convolutional numerical matrix to be represented; the higher the similarity, the larger the assigned weight. For example, calculate With The cosine similarity is defined as r²,...,r². q Then the re-represented matrix can be expressed as Similarly, we can obtain; The image is compressed through a fully connected linear layer, and then processed by a batch normalization layer and the Leaky ReLU activation function to obtain the final encoded numerical matrix H′, whose dimensions are consistent with the initial input q-frame C-scan images. Since H′ is an encoded numerical matrix that aggregates q-frame C-scan images, it is essentially the pixel numerical matrix corresponding to the compressed sharp image obtained after multiple noise reduction and optimization processes. Therefore, the decoder needs to expand the dimensions of H′ to the pixel numerical matrix corresponding to the reconstructed sharp image at a specified resolution. Because H′ and Due to the large dimensionality difference, if only a single linear fully connected layer is used, the image reconstruction model will struggle to effectively learn its underlying processes. Furthermore, to correspond with the number of layers in the encoder, four fully connected layers are used to expand the dimension of H′. Specifically, H′ is continuously multiplied by four weight matrices to progressively expand it to the specified dimension w. V ×w V .

[0077] S306. Defects in the reconstructed clear image are detected by using an image reconstruction model to obtain the inspection score of the workpiece to be inspected.

[0078] In this embodiment, the workpiece score can be understood as the workpiece score determined by the model.

[0079] Specifically, defects in a reconstructed clear image can be detected using an image reconstruction model to obtain a workpiece score for the workpiece under inspection.

[0080] For example, following the above Figure 4 The corresponding image reconstruction model structure, in obtaining Afterwards, the image reconstruction model can also be based on Determine the score for the workpiece; the process of determining the score is to establish a high-dimensional... The mapping relationship between the workpiece scores in the lowest dimension (1×1) is latently represented by an MLP consisting of two fully connected layers. This mapping relationship is learned through the weight adjustment of the MLP during the image reconstruction model training process. Once the image reconstruction model is trained, the mapping relationship is further refined based on the encoding results. Upon further processing in the MLP (Manufacturing Logic Provider) system, the system will autonomously determine the score of the inspected workpiece.

[0081] The image reconstruction model is trained using dataset 2, which contains 20,000 × q C-scan images, 20,000 reconstructed sharp images, and corresponding artifact scores. The training set 2, validation set 2, and test set 2 are allocated in an 8:1:1 ratio. The loss function is:

[0082]

[0083] Among them, H m and S represents the clear image and the reconstructed clear image of the m-th workpiece, respectively. m and The actual score of the m-th workpiece and the workpiece score given by the image reconstruction model are denoted by δ, which is the scaling factor. In this embodiment, δ = 0.04. The Adam optimization algorithm is used for training, with an initial learning rate of 0.001. The training is conducted for 2000 rounds, and the performance of the image reconstruction model is verified using validation set 2 and test set 2.

[0084] S307. Determine the final workpiece score based on the workpiece score and the preset workpiece score standard.

[0085] In this embodiment, the preset workpiece scoring standard can be understood as the pre-set scoring standard value corresponding to different defect levels.

[0086] Specifically, the processor can determine the difference between the detected workpiece score and the preset workpiece score standard, and judge the score accuracy based on the difference of all workpieces to be inspected. If the score accuracy is higher than or equal to the threshold, the detected workpiece score is directly used as the final workpiece score; otherwise, the detected workpiece score is corrected by the model to obtain the final workpiece score.

[0087] Furthermore, based on the above embodiments, the step of determining the final workpiece score according to the workpiece inspection score and the preset workpiece score standard can be refined as follows:

[0088] A workpiece score set is constructed based on the workpiece scores of all workpieces to be inspected; the workpiece score evaluation accuracy rate is determined according to the workpiece score set and the preset workpiece score standard; if the workpiece score evaluation accuracy rate is greater than the preset threshold, the workpiece score is taken as the final workpiece score; otherwise, the workpiece score is corrected by the correction model to obtain the final workpiece score.

[0089] In this embodiment, the workpiece score set can be understood as the set of workpiece scores for all workpieces to be inspected. The workpiece score evaluation accuracy rate can be understood as the accuracy level used to characterize the current workpiece inspection. The preset threshold can be understood as a threshold set to determine whether score correction is needed. The correction model can be understood as a neural network model used for score correction.

[0090] Specifically, the processor can construct a set of inspection workpiece scores based on the inspection workpiece scores of all workpieces to be inspected. The processor can determine the difference between each inspection workpiece score in the set and a preset workpiece score standard. By comparing the difference with a set threshold, it can determine whether each inspection workpiece score belongs to a positive or negative sample, and then determine the proportion of positive samples to obtain the workpiece score evaluation accuracy. If the workpiece score evaluation accuracy is greater than the preset threshold, the inspection workpiece score is taken as the final workpiece score; otherwise, the inspection workpiece score is corrected through a correction model to obtain the final workpiece score.

[0091] For example, the accuracy of workpiece scoring can be calculated using the following formula: the difference between the score and the actual score for each workpiece is S. G If S G If the value is greater than or equal to g1, it is considered a negative sample; otherwise, it is considered a positive sample. g1 is a pre-set threshold, and in this embodiment, g1 = 1. After all the workpieces to be inspected have been inspected, the workpiece score discrimination accuracy φ is calculated, where φ is the proportion of the number of positive samples to the total number of workpiece scores. If φ < g2, where g2 is a preset threshold, the workpiece score is corrected using a correction model to obtain the final workpiece score; otherwise, the workpiece score is directly used as the final workpiece score. In this embodiment, g2 = 96%.

[0092] For example, the modified model can consist of a fully connected layer, a batch normalization layer, and a Leaky ReLU activation function. Each fully connected layer contains K3 hidden neurons; in this embodiment, K3 = 6. The neural network 3 uses a dataset 3 with a total of 20,000 samples. The training set 3, validation set 3, and test set 3 are allocated in an 8:1:1 ratio, and each sample contains one... and S m The loss function is then adopted as follows:

[0093]

[0094] Among them, S m and These represent the actual score and the improved score for the m-th workpiece, respectively. The corrected model can be trained using SGD with an initial learning rate of 0.01 for 100 training rounds. Performance is then assessed using validation set 3 and test set 3.

[0095] S308. The final workpiece score shall be used as the defect detection result of the workpiece to be inspected.

[0096] The technical solution of this invention determines the corresponding DAC curve in the pre-fitted DAC surface using the measured aperture value, satisfying the fitting requirements for workpieces with different apertures. The corresponding C-scan pixel value is determined by the actual echo amplitude and the theoretical echo amplitude of the DAC curve, providing support for the subsequent generation of C-scan images. The C-scan image is generated using the determined C-scan pixel values, improving the clarity of the C-scan image. Multiple C-scan images and a clear image are reconstructed using an image reconstruction model to obtain a reconstructed clear image, further improving the clarity of the image used for defect detection and providing an accurate basis for subsequent workpiece scoring. The automatic determination of workpiece scores using the reconstructed clear image via the image reconstruction model requires no manual intervention, and the quality of workpieces can be finely classified based on the workpiece score. The accuracy of the workpiece score determination for this batch is determined by detecting the workpiece score and a preset workpiece score standard. A correction model is used to correct scores with lower accuracy, obtaining a corrected final workpiece score, ensuring the accuracy of the workpiece score determination.

[0097] For example, to facilitate understanding of the overall defect detection process, a specific example can be provided. Figure 5 This is an example flowchart of a defect detection method provided in Embodiment 2 of the present invention, as follows: Figure 5As shown, the steps may include: First, scanning several test workpieces using a multi-channel ultrasonic device to obtain training data, which is then divided into training set 1, validation set 1, and test set 1 to test and train the fitted model, resulting in a trained fitted model. A pre-fitted DAC surface with the same workpiece parameters as the test workpiece is output. Next, scanning several workpieces to be tested using a multi-channel ultrasonic device to obtain multi-channel ultrasonic information, and combining this information with the pre-fitted DAC surface to generate multiple C-scan images. During training, multiple C-scan images, a preset workpiece scoring standard, and a clear image are used as training data, divided into training set 2, validation set 2, and test set 2 to test and train the reconstruction model, resulting in a trained image reconstruction model. Finally, a clear image of the workpiece to be tested is acquired using a clear image acquisition device. The clear image of the workpiece to be tested, the generated multiple C-scan images, and the preset workpiece scoring standard are input into the image reconstruction model to obtain a reconstructed clear image and a workpiece score. During training, both the preset workpiece scoring standard and the detected workpiece scores are used as training data, divided into training set 3, validation set 3, and test set 3 to test and train the modified model, resulting in the trained modified model. The accuracy of workpiece scoring is determined by the detected workpiece scores of all workpieces in this test. A preset threshold is used to judge whether the accuracy is qualified. If qualified, the detected workpiece score is directly output; if unqualified, the detected workpiece score is input into the modified model for correction, resulting in the corrected detected workpiece score.

[0098] Example 3

[0099] Figure 6 This is a schematic diagram of a defect detection device provided in Embodiment 3 of the present invention. Figure 6 As shown, the device includes:

[0100] Information acquisition module 61 is used to acquire multi-channel ultrasonic information and prefitted DAC surface of the workpiece to be inspected;

[0101] Image generation module 62 is used to determine multiple C-scan images at different sound path positions based on the multi-channel ultrasound information and the prefitted DAC surface;

[0102] The result determination module 63 is used to determine the defect detection result of the workpiece to be inspected based on all the C-scan images and the image reconstruction model.

[0103] The technical solution of this invention involves acquiring multi-channel ultrasonic information and a pre-fitted DAC surface of the workpiece to be inspected; determining multiple C-scan images at different sound path positions based on the multi-channel ultrasonic information and the pre-fitted DAC surface; and determining the defect detection result of the workpiece to be inspected based on all C-scan images and the image reconstruction model. By determining the DAC curve corresponding to the workpiece to be inspected within the pre-fitted DAC surface composed of DAC curves corresponding to different apertures, multiple C-scan images are generated for clear image reconstruction, and the score of the workpiece to be inspected is determined as the defect detection result. This satisfies the fitting requirements for workpieces with different apertures, improves the fitting accuracy, enhances the quality of the C-scan images, and thus improves the quality of the final detection image and the accuracy of workpiece defect detection.

[0104] Furthermore, the multi-channel ultrasound information includes aperture value, sound path value, and actual echo amplitude. Correspondingly, the image generation module 62 includes:

[0105] The first determining unit is used to determine the DAC curve corresponding to the aperture value in the prefitted DAC surface;

[0106] The second determining unit is used to determine the C-scan pixel value based on the actual echo amplitude and the DAC curve.

[0107] The third determining unit is used to generate multiple C-scan images corresponding to different sound path positions based on the C-scan pixel values.

[0108] Specifically, the second determining unit is used for:

[0109] Determine the theoretical echo amplitude at the specified sound path value in the DAC curve;

[0110] Based on the theoretical echo amplitude and the actual echo amplitude, determine the echo range and echo difference;

[0111] The C-scan pixel value is determined based on the echo interval and the echo difference.

[0112] Furthermore, the result determination module 63 includes:

[0113] The fourth determining unit is used to reconstruct all the C-scan images and the clear image of the workpiece to be inspected using an image reconstruction model to obtain a reconstructed clear image of the workpiece to be inspected.

[0114] The fifth determining unit is used to detect defects in the reconstructed clear image through the image reconstruction model to obtain the detection workpiece score of the workpiece to be inspected;

[0115] The sixth determining unit is used to determine the final workpiece score based on the detected workpiece score and the preset workpiece score standard;

[0116] The seventh determining unit is used to take the final workpiece score as the defect detection result of the workpiece to be inspected.

[0117] Specifically, the sixth determining unit is used for:

[0118] Construct a set of test workpiece scores based on the test workpiece scores of all test workpieces;

[0119] The accuracy rate of workpiece score evaluation is determined based on the workpiece score set and the preset workpiece score standard.

[0120] If the accuracy rate of the workpiece score evaluation is greater than the preset threshold, then the score of the detected workpiece will be taken as the final workpiece score.

[0121] Otherwise, the score of the detected workpiece is corrected by modifying the model to obtain the final workpiece score.

[0122] Optionally, the device further includes a surface fitting module.

[0123] The surface fitting module is specifically used for:

[0124] Acquire training data for multiple test workpieces, wherein the test workpieces have the same workpiece parameters as the workpiece to be inspected and have multiple defects;

[0125] The training data is input into the fitting model to obtain the prefitted DAC surface corresponding to the workpiece to be inspected.

[0126] The defect detection device provided in the embodiments of the present invention can execute the defect detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0127] Example 4

[0128] Figure 7 A schematic diagram of an electronic device 70 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0129] like Figure 7 As shown, the electronic device 70 includes at least one processor 71 and a memory, such as a read-only memory (ROM) 72 and a random access memory (RAM) 73, communicatively connected to the at least one processor 71. The memory stores computer programs executable by the at least one processor. The processor 71 can perform various appropriate actions and processes based on the computer program stored in the ROM 72 or loaded from storage unit 78 into the RAM 73. The RAM 73 can also store various programs and data required for the operation of the electronic device 70. The processor 71, ROM 72, and RAM 73 are interconnected via a bus 74. An input / output (I / O) interface 75 is also connected to the bus 74.

[0130] Multiple components in electronic device 70 are connected to I / O interface 75, including: input unit 76, such as keyboard, mouse, etc.; output unit 77, such as various types of monitors, speakers, etc.; storage unit 78, such as disk, optical disk, etc.; and communication unit 79, such as network card, modem, wireless transceiver, etc. Communication unit 79 allows electronic device 70 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0131] Processor 71 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 71 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 71 performs the various methods and processes described above, such as defect detection methods.

[0132] In some embodiments, the defect detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 78. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 70 via ROM 72 and / or communication unit 79. When the computer program is loaded into RAM 73 and executed by processor 71, one or more steps of the defect detection method described above may be performed. Alternatively, in other embodiments, processor 71 may be configured to perform the defect detection method by any other suitable means (e.g., by means of firmware).

[0133] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0134] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0135] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0137] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0138] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0139] In one embodiment, the present invention further includes a computer program product, which includes a computer program that, when executed by a processor, implements the defect detection method of any embodiment of the present invention.

[0140] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0141] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0142] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A defect detection method, characterized in that, include: Acquire multi-channel ultrasonic information and prefitted DAC surface of the workpiece to be inspected; Based on the multi-channel ultrasound information and the prefitted DAC surface, multiple C-scan images at different sound path positions are determined; Based on all the C-scan images and the image reconstruction model, the defect detection results of the workpiece to be inspected are determined.

2. The method according to claim 1, characterized in that, The multi-channel ultrasound information includes aperture value, sound path value, and actual echo amplitude. Correspondingly, determining multiple C-scan images at different sound path positions based on the multi-channel ultrasound information and the pre-fitted DAC surface includes: Determine the DAC curve corresponding to the aperture value in the prefitted DAC surface; The C-scan pixel value is determined based on the actual echo amplitude and the DAC curve. Based on the C-scan pixel values, multiple C-scan images corresponding to different sound path positions are generated.

3. The method according to claim 2, characterized in that, The step of determining the C-scan pixel value based on the actual echo amplitude and the DAC curve includes: Determine the theoretical echo amplitude at the specified sound path value in the DAC curve; Based on the theoretical echo amplitude and the actual echo amplitude, determine the echo range and echo difference; The C-scan pixel value is determined based on the echo interval and the echo difference.

4. The method according to claim 1, characterized in that, The step of determining the defect detection result of the workpiece under inspection based on all the C-scan images and image reconstruction models includes: The image reconstruction model is used to reconstruct all the C-scan images and the clear image of the workpiece to be inspected, so as to obtain the reconstructed clear image of the workpiece to be inspected. The defects in the reconstructed clear image are detected by the image reconstruction model to obtain the detection score of the workpiece to be inspected. The final workpiece score is determined based on the workpiece score and the preset workpiece score standard. The final workpiece score is used as the defect detection result of the workpiece to be inspected.

5. The method according to claim 4, characterized in that, The step of determining the final workpiece score based on the detected workpiece score and the preset workpiece score standard includes: Construct a set of test workpiece scores based on the test workpiece scores of all test workpieces; The accuracy rate of workpiece score evaluation is determined based on the workpiece score set and the preset workpiece score standard. If the accuracy rate of the workpiece score evaluation is greater than the preset threshold, then the score of the detected workpiece will be taken as the final workpiece score. Otherwise, the score of the detected workpiece is corrected by modifying the model to obtain the final workpiece score.

6. The method according to claim 1, characterized in that, The fitting steps for the prefitted DAC surface include: Acquire training data for multiple test workpieces, wherein the test workpieces have the same workpiece parameters as the workpiece to be inspected and have multiple defects; The training data is input into the fitting model to obtain the prefitted DAC surface corresponding to the workpiece to be inspected.

7. A defect detection device, characterized in that, include: The information acquisition module is used to acquire multi-channel ultrasonic information and pre-fitted DAC surface of the workpiece to be inspected; The image generation module is used to determine multiple C-scan images at different sound path positions based on the multi-channel ultrasound information and the prefitted DAC surface. The result determination module is used to determine the defect detection result of the workpiece under inspection based on all the C-scan images and the image reconstruction model.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the defect detection method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the defect detection method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the defect detection method according to any one of claims 1-6.