Workpiece defect recognition method based on digital radiographic image structural features and CT images
By combining the structural features of digital X-ray images with CT images, and using an improved semantic segmentation model Unet and loss function, the problem of distinguishing between structural artifacts and defects in industrial CT images is solved, achieving higher defect detection accuracy and lower false negative rate.
Patent Information
- Application Number
- CN202411836035.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Existing technologies struggle to effectively distinguish between structural artifacts and defects in industrial CT images, resulting in low defect identification accuracy.
By combining the structural features of digital radiographic images and CT images, defect identification is performed using the improved semantic segmentation model Unet. The model's recognition accuracy is improved by utilizing the cumulative distribution curve of structural features and an improved loss function.
It effectively improves the accuracy of defect detection, reduces the false negative and false positive rates, and can better distinguish between defects and structural artifacts.
Smart Images

Figure CN120031785B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of nondestructive testing, and particularly relates to a workpiece defect recognition method based on digital radiographic image structural features and CT images. BACKGROUND
[0002] An industrial computer tomography (CT) image is formed by accumulating the structure of a workpiece within a certain slice thickness range on a target plane. Due to the influence of the workpiece structure, structural artifacts similar to low-density inclusions, loose structures, and holes may be generated on the tomographic image. Since the structural artifacts and the defects have basically the same representation form, it is difficult to obtain ideal results by directly using the CT image to train a deep neural network.
[0003] In actual detection, a detection personnel generally performs digital radiographic (DR) scanning on a workpiece first to determine the specific height of the region to be detected in the detection system, and then performs CT scanning on the corresponding position. When training a CT image defect recognition model, the structural information contained in the DR image is often ignored. Therefore, the prior art lacks an industrial CT detection image defect intelligent recognition method based on the cumulative distribution of digital radiographic image structural features. SUMMARY
[0004] In order to solve the problems in the background art, the purpose of the present application is to provide a workpiece defect recognition method based on digital radiographic image structural features and CT images.
[0005] The technical scheme adopted by the present application comprises the following steps:
[0006] Step S1, first, place a workpiece with defects to be detected on an industrial CT device, and perform DR scanning on the workpiece by using the industrial CT device to obtain a digital radiographic image I of the workpiece; the digital radiographic image I has a width W and a height H in step S1;
[0007] Step S2, based on a first semantic segmentation model, obtain a hole type region L of the digital radiographic image I;
[0008] The step S2 specifically comprises: inputting the digital radiographic image I with the width W and the height H into a trained first semantic segmentation model Unet, and outputting a hole type region of the digital radiographic image I;
[0009] The training method of the first semantic segmentation model Unet is as follows: first, a hole type region data set is constructed, including a plurality of digital radiographic images I and corresponding real hole type regions, and the real hole type region is the label of the hole type region data set; then, the first semantic segmentation model Unet is constructed, the hole type region data set is input into the constructed first semantic segmentation model Unet for training, and a trained first semantic segmentation model Unet is obtained, which can be used to output the hole type region of the digital radiographic image I.
[0010] Step S3, then, the CT scan image of the workpiece to be detected at the target detection region position is obtained by scanning using the industrial CT device.
[0011] The target detection region position is a common defect position of the workpiece, such as a weld position, and the target detection region position of the workpiece can be obtained by directly observing the digital radiographic image I of the workpiece.
[0012] Step S4, according to the digital radiographic image I, the structure feature cumulative distribution curve corresponding to each CT scan image is obtained.
[0013] Step S5, an improved semantic segmentation model Unet is constructed, and the improved semantic segmentation model is trained using the CT scan image and the structure feature cumulative distribution curve to obtain a trained improved semantic segmentation model.
[0014] Step S6, finally, the CT scan image of the workpiece to be detected is input into the trained improved semantic segmentation model Unet, and the defect detection result of the workpiece is output.
[0015] The step S3 is specifically:
[0016] First, the target detection region of the workpiece is determined according to the digital radiographic image I of the workpiece, then the scanning height hc and the tomographic slice thickness d of the industrial CT device are set according to the position of the target detection region, and then the industrial CT device is used to perform a CT scan at the target detection region position of the workpiece, that is, the CT scan image of the workpiece at the target detection region position is obtained, and subsequently the scanning height hc and the tomographic slice thickness d of the industrial CT device can be adjusted to scan a plurality of CT scan images.
[0017] The step S4 is specifically:
[0018] Step S4.1, the coordinates of each CT scan image are converted according to the following formula to obtain the position of the target detection region in the digital radiographic image I:
[0019]
[0020] wherein h' represents the height corresponding to the scanning height hc of the CT scan image in the digital radiographic image I; d' represents the slice thickness corresponding to the slice thickness d of the CT scan image in the digital radiographic image I; P start represents the starting scanning height of the industrial CT device coordinate system during DR scanning; P end represents the ending scanning height of the industrial CT device coordinate system during DR scanning; H is the height of the digital radiographic image I; S represents the pixel size of the radiographic image I, i.e., the pixel size of the digital radiographic image I is SxS;
[0021] Step S4.2, based on the position of the target detection area in the digital radiographic image I, obtaining the structure feature cumulative distribution curve G(x, fx) corresponding to each CT scan image.
[0022] In the step S4.2, the structure feature cumulative distribution curve G(x, fx) is obtained in the following manner:
[0023] Step S4.2.1, first obtaining a plurality of structure feature data points (x, fx) according to the radiographic image I, wherein fx represents the number of pixel points of the pass region L identified by the first semantic segmentation model at the position of the horizontal coordinate x of the target pass region R in the target pass region R of the digital radiographic image I;
[0024] wherein the expression of the target pass region R in the digital radiographic image I is as follows:
[0025]
[0026] wherein x and y represent the horizontal coordinate and the vertical coordinate of the target pass region R, respectively, and W represents the width of the digital radiographic image I;
[0027] Step S4.2.2, then taking the horizontal coordinate x of the target pass region R as the horizontal coordinate axis and the number of pixel points fx as the vertical coordinate axis to draw the structure feature cumulative distribution curve G(x, fx).
[0028] The step S5 is specifically:
[0029] Step S5.1, establishing a workpiece defect image data set including CT scan images and their corresponding class labels, wherein the class labels of the workpiece defect image data set include the structure feature cumulative distribution curve G(x, fx) and the real defects of the workpiece;
[0030] Step S5.2, constructing an improved semantic segmentation model Unet;
[0031] Step S5.3, inputting the workpiece defect image data set into the constructed improved semantic segmentation model Unet for training to obtain the trained improved semantic segmentation model Unet.
[0032] In the step S5.2, the improved semantic segmentation model Unet is obtained by adding a convolution layer, a feature extractor Transformer, a feature fusion layer and a full connection layer in the conventional semantic segmentation model Unet, and the adding manner is as follows:
[0033] The convolution layer, the feature extractor Transformer and the feature fusion layer are sequentially connected between the last encoder and the first decoder of the conventional semantic segmentation model Unet, and the full connection layer is connected with the feature fusion layer, the full connection layer is used for processing the input structural feature cumulative distribution curve G(x, fx), and the output of the feature extractor Transformer and the structural feature cumulative distribution curve processed by the full connection layer are spliced and then input into the feature fusion layer.
[0034] In the step S5.3, when the improved semantic segmentation model Unet is trained, a loss function is used to calculate the loss of segmentation, the loss function adopts an improved binary cross entropy function, and the loss calculation is processed according to the following formula:
[0035] Loss=αL1+β(L2+L3)
[0036]
[0037] L2=ω1·y″(1-y′)
[0038] L3=ω2·y′(1-y″)
[0039] Wherein, Loss represents the improved binary cross entropy function; alpha and beta respectively represent the weights of local loss and global loss; L1 represents the binary cross entropy function before improvement; L2 represents the missed detection rate; L3 represents the false detection rate; N represents the total number of pixel points in the image; y i represents the true probability that the pixel point i belongs to the defect; represents the predicted probability that the pixel point i belongs to the defect; omega1 represents the weight of the missed detection rate; omega2 represents the weight of the false detection rate; y" represents the global actual value, when y" = 1, it represents that the image exists defects, and when y" = 0, it represents that the image does not exist defects; y' represents the global predicted value, when y' = 1, it represents that the predicted image exists defects, and when y' = 0, it represents that the predicted image does not exist defects.
[0040] The whole DR image of the workpiece can reflect the distribution of the feature structure in the workpiece in the axial direction (vertical direction), and by extracting the information existing in the DR image, the training of the CT image defect recognition model can be constrained as prior knowledge, and the recognition accuracy of the CT image defect recognition model can be improved.
[0041] The beneficial effects of the present application are:
[0042] 1、The application realizes effective discrimination of defects and structural artifacts by extracting structural features in the DR image and inputting the CT image into a deep learning model, which can effectively improve the accuracy of workpiece defect detection.
[0043] 2、The application is based on the improved defect recognition model loss function, and increases the global loss term on the basis of the binary cross entropy loss, thereby reducing the missed detection rate and false detection rate of the model.
[0044] 3、The defect recognition of conventional industrial CT images is only limited to the information inside the CT image, and it is difficult to distinguish the structural artifacts which are basically consistent with the defect representation form, the application realizes effective discrimination of defects and structural artifacts by extracting structural features in the DR image and inputting the CT image into a deep learning model. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 is the overall flowchart of the application;
[0046] Figure 2 is the piston DR image;
[0047] Figure 3 is the predicted hole type area in the DR image;
[0048] Figure 4 is the structural feature cumulative distribution curve calculation schematic diagram;
[0049] Figure 5 is the structural feature cumulative distribution curve diagram;
[0050] Figure 6 is the improved semantic segmentation model overall structure diagram;
[0051] Figure 7 is the typical CT image recognition result comparison diagram. DETAILED DESCRIPTION
[0052] The application will be described in detail below in combination with specific implementation cases, and the following implementation cases will help those skilled in the art to further understand the application, but do not limit the application in any form.
[0053] The steps of the embodiment of the application are as follows, as shown in Figure 1 .
[0054] Step S1, first, place the piston to be detected defects on the industrial CT device, use the industrial CT device to perform a DR scan to obtain the digital radiograph I of the piston, then rotate the piston by 90°, and then perform a digital radiograph projection, as shown in Figure 2 , the width W of the digital radiograph I is 1500, and the height H is 1600;
[0055] Step S2, based on the first semantic segmentation model Unet, the hole type region L of the digital radiograph image I is obtained, and the predicted result is as shown in Figure 3 ;
[0056] Step S3, then, the CT scan image of the workpiece at the target detection region position is obtained by scanning with the industrial CT device, and the target detection region is specifically the bottom of the inner cooling oil channel of the piston.
[0057] Step S3 is specifically:
[0058] First, the target detection region position of the workpiece is determined according to the digital radiograph image I of the piston, then the scanning height hc of the industrial CT device is set to 521.0 mm and the tomographic slice thickness d is set to 1 mm according to the position of the target detection region, and then a CT scan is performed on the workpiece at the target detection region position by using the industrial CT device, i.e. the CT scan image of the workpiece at the target detection region position is obtained, and the scanning height hc and the tomographic slice thickness d of the industrial CT device can be adjusted to scan multiple CT scan images.
[0059] Step S4, the starting height P start of 400 mm and the ending height P end of 560 mm are obtained according to the mechanical information of the industrial CT device.
[0060] Step S5, according to the scanning starting height and the scanning ending height in step 4, the pixel size SxS of the digital radiograph image I is calculated to be 0.1x0.1. The coordinate conversion of the CT scan image is performed, and the corresponding height of the target detection region position in the digital radiograph image I is h' = 1210 and the slice thickness is d' = 10.
[0061] Step S6, the structure feature cumulative distribution curve is calculated according to the digital radiograph image, and the calculation principle is as shown in Figure 4 : for each column in the target hole type region R = {(x, y) | 0≤x≤1500, 1205≤y≤1215} in the digital radiograph image I, the first semantic segmentation model Unet identifies the number of pixel points of the hole type region as fx, and the obtained structure feature cumulative distribution curve is as shown in Figure 5 .
[0062] Step S7, first, a workpiece defect image dataset is established, including the CT scan image and its corresponding class label, and the class label of the workpiece defect image dataset includes the structure feature cumulative distribution curve G(x, fx) and the real defect of the workpiece; then an improved semantic segmentation model Unet is constructed; finally, the workpiece defect image dataset is input into the constructed improved semantic segmentation model Unet for training, and the trained improved semantic segmentation model Unet is obtained.
[0063] The improved semantic segmentation model Unet is constructed as follows: a convolution layer, a Transformer layer and a feature fusion layer are added in a new semantic segmentation model Unet, and a full connection layer is added to process the structural feature cumulative distribution curve. The specific position of the Transformer layer is after the encoding layer of the semantic segmentation model Unet. The output of the Transformer layer and the processed structural feature cumulative distribution curve are spliced and input into the feature fusion layer. The overall structure of the improved semantic segmentation model Unet is as shown in Figure 6 Figure 6 The numbers in the figure represent the shape of the input and output data.
[0064] For a single-class semantic segmentation task, a binary cross-entropy loss can be used to calculate the difference between the predicted value of each pixel and the true label, and the binary cross-entropy loss is improved to obtain the loss function of the improved semantic segmentation model:
[0065] Loss=αL1+β(L2+L3)
[0066]
[0067] L2=ω1·y″(1-y′)
[0068] L3=ω2·y′(1-y″)
[0069] Wherein, Loss represents the improved binary cross-entropy function; α and β represent the weights of local loss and global loss respectively; L1 represents the binary cross-entropy function before improvement; L2 represents the missed detection rate; L3 represents the false detection rate; N represents the total number of pixel points in the image; y i represents the true probability that pixel point i belongs to a defect; represents the predicted probability that pixel point i belongs to a defect; ω1 represents the weight of the missed detection rate; ω2 represents the weight of the false detection rate; y″ represents the global actual value, y″=1 represents that the image has a defect, and y″=0 represents that the image has no defect; y' represents the global predicted value, y'=1 represents that the predicted image has a defect, and y'=0 represents that the predicted image has no defect.
[0070] Step S8, using the trained improved semantic segmentation model Unet to predict the workpiece CT image, sample 1 is 205 pieces of non-defective pistons, sample 2 is 330 pieces of defective pistons. And compared with the conventional unimproved semantic segmentation model Unet, as shown in Table 1. Among them, Unet represents the conventional unimproved semantic segmentation model Unet, Unet+Transformer layer represents adding convolution layer and Transformer layer in the conventional semantic segmentation model Unet, Unet+Transformer layer+feature fusion layer represents the improved semantic segmentation model Unet provided by the application, and the comparison results of typical CT images are as shown in Figure 7
[0071] Table 1 Comparison of prediction results
[0072]
[0073] As shown by the results in Table 1, the improved semantic segmentation model Unet used in the application has good discrimination effect on structural artifacts and defects.
[0074] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the application, and not to limit them; although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the application.
Claims
1. A workpiece defect recognition method based on digital radiographic image structural features and CT images, characterized by, The method comprises the following steps: Step S1, first, place the workpiece to be detected on the industrial CT device, and use the industrial CT device to perform DR scanning to obtain a digital radiographic image I of the workpiece; Step S2, based on the first semantic segmentation model, obtain a pass line area L of the digital radiographic image I; Step S3, then, use the industrial CT device to scan to obtain a CT scan image of the workpiece to be detected at a target detection area position; Step S4, based on the position of the target detection area in the digital radiographic image I, obtain a structure feature cumulative distribution curve G(x, fx) corresponding to each CT scan image; Step S5, construct an improved semantic segmentation model Unet, train the improved semantic segmentation model using the CT scan image and the structure feature cumulative distribution curve, and obtain the trained improved semantic segmentation model Unet; Step S6, finally, input the CT scan image of the workpiece to be detected into the trained improved semantic segmentation model Unet, and output a defect detection result of the workpiece; In the step S4, the structure feature cumulative distribution curve G(x, fx) is obtained in the following manner: Step S4.1, first, obtain a plurality of structure feature data points (x, fx) according to the radiographic image I, wherein fx represents the number of pass line area L pixel points recognized at the position of the horizontal coordinate x of the target pass line area R in the digital radiographic image I; Wherein, the expression of the target pass line area R in the digital radiographic image I is as follows: Wherein, x and y represent the horizontal coordinate and the vertical coordinate of the target pass line area R respectively, W represents the width of the digital radiographic image I; h' represents the height corresponding to the scanning height hc of the CT scan image in the digital radiographic image I; d' represents the slice thickness corresponding to the tomographic slice thickness d of the CT scan image in the digital radiographic image I; Step S4.2, then, take the horizontal coordinate x of the target pass line area R as the horizontal coordinate axis and the pixel point number fx as the vertical coordinate axis to draw the structure feature cumulative distribution curve G(x, fx).
2. The method according to claim 1, characterized in that: The step S3 is specifically: First, determine the target detection area of the workpiece according to the digital radiographic image I of the workpiece, then set the scanning height hc and the tomographic slice thickness d of the industrial CT device according to the position of the target detection area, and then perform a CT scan on the workpiece at the target detection area position using the industrial CT device, thereby obtaining the CT scan image of the workpiece at the target detection area position.
3. The method according to claim 1, characterized in that: In the step S4, the specific method based on the position of the target detection area in the digital radiographic image I is as follows: According to the following formula, the coordinates of each CT scan image are converted to obtain the position of the target detection area in the digital radiographic image I: wherein h' represents the height corresponding to the scanning height hc of the CT scan image in the digital radiographic image I; d' represents the slice thickness corresponding to the slice thickness d of the CT scan image in the digital radiographic image I; P start represents the starting scanning height of the industrial CT device coordinate system during DR scanning; P end represents the ending scanning height of the industrial CT device coordinate system during DR scanning; H is the height of the digital radiographic image I; S represents the pixel size of the radiographic image I.
4. The method according to claim 1, characterized in that: The step S5 is specifically: Step S5.1, establish a workpiece defect image data set, including CT scan images and corresponding class labels, wherein the class labels of the workpiece defect image data set include a structure feature cumulative distribution curve G(x, fx) and a real defect of the workpiece; Step S5.2, construct an improved semantic segmentation model Unet; Step S5.3, input the workpiece defect image data set into the improved semantic segmentation model Unet for training to obtain the trained improved semantic segmentation model Unet.
5. The method according to claim 4, characterized in that: In the step S5.2, the improved semantic segmentation model Unet is obtained by adding a convolution layer, a feature extractor Transformer, a feature fusion layer and a full connection layer in the conventional semantic segmentation model Unet, and the adding method is as follows: The convolution layer, the feature extractor Transformer and the feature fusion layer are sequentially connected between the last encoder and the first decoder of the conventional semantic segmentation model Unet, the full connection layer is used to process the input structural feature cumulative distribution curve G(x, fx), the output of the feature extractor Transformer and the structural feature cumulative distribution curve processed by the full connection layer are spliced and then input into the feature fusion layer.
6. The method according to claim 4, characterized in that: In the step S5.3, when the improved semantic segmentation model Unet is trained, a loss function is used to calculate the loss of segmentation, the loss function adopts an improved binary cross entropy function, and the loss calculation is processed according to the following formula: Loss=αL1+β(L2+L3) L2=ω1·y″(1-y′) L3=ω2·y′(1-y″) wherein Loss represents the improved binary cross-entropy function; a and β represent the weights of the local loss and the global loss, respectively; L1 represents the binary cross-entropy function before improvement; L2 represents the missed detection rate; L3 represents the false detection rate; N represents the total number of pixel points in the image; y i represents the true probability that the pixel point i belongs to the defect; represents the predicted probability that the pixel point i belongs to the defect; ω1 represents the weight of the missed detection rate; ω2 represents the weight of the false detection rate; y" represents the global actual value; y' represents the global predicted value.
Citation Information
Patent Citations
Ceramic matrix composite real-time damage degree prediction method based on deep learning
CN119005024A
System And Methods For Restorative Dentistry Treatment Planning Using Adversarial Learning
US20200405242A1