A TOFD spectrum feature detection method
Through the TOFD map feature detection method, the YOLOv8 algorithm and feature fusion processing are used to solve the problem of low defect recognition efficiency in TOFD weld detection, and efficient and automated welding defect detection is achieved, which improves detection accuracy and efficiency.
Patent Information
- Application Number
- CN202311645222.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-12-04
Smart Images

Figure CN117740960B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of feature detection, and in particular relates to a TOFD spectrum feature detection method. Background Art
[0002] With the rapid development of society and technology, metal material welding technology has penetrated into all walks of life, especially in the field of special equipment, such as pressure vessels, pipelines, cranes and other equipment, which have strict requirements on welding quality. However, in the actual welding process, due to unreasonable processes, improper operations and other factors, welding cracks, pores and other defects will occur, affecting the quality, safety and service life of workpieces made of metal materials.
[0003] Welds are the weakest part of metal components. When defects occur in welds, they may cause serious safety problems. When defects occur, the appearance of welds is affected externally and the quality of products is affected internally. During the use of products, welds may break, corrode, and other safety problems that affect the use of products. The main reason for this problem is the non-standard and unreasonable welding operation. In the actual welding process, welding operators with poor experience and skills use unreasonable welding processes during welding, or the quality of metal materials is poor and the material joints are not cleaned during the welding process, which will lead to welding defects. Non-destructive testing of welds after welding is a means of evaluating welding quality and whether welding products are qualified or not, which is very important. Ultrasonic testing is a common means of on-site evaluation of welding quality, among which ultrasonic time-of-flight diffraction (TOFD) is the most common weld detection method. TOFD can detect the location and size of weld defects, but defect identification and defect type discrimination need to be judged by practitioners based on their own experience, the judgment efficiency is low, and the judgment results are greatly affected by human factors. Summary of the invention
[0004] The purpose of the present invention is to provide a feature detection method that can efficiently determine the type of defect in response to the above-mentioned technical problems.
[0005] The object of the present invention is achieved by: a TOFD spectrum feature detection method, comprising the following steps:
[0006] S1: Get TOFD spectrum;
[0007] S2: feature marking of TOFD images;
[0008] S3: The marked TOFD atlas is randomly divided into a training set and a validation set;
[0009] S4: Establish a target detection model and input the training set into the target detection model for training;
[0010] S5: Verify the trained object detection model through the validation set;
[0011] S6: Deploy a validated object detection model.
[0012] In the present invention, the specific steps of the training are as follows:
[0013] S4a: adjust the input image to three-channel 640×640 size;
[0014] S4b: Perform two-dimensional convolution module processing;
[0015] S4c: C2f treatment;
[0016] S4d: perform SPPF pooling layer;
[0017] S4e: Feature fusion processing.
[0018] Further in the present invention, the two-dimensional convolution module processing includes one two-dimensional convolution, one two-dimensional BatchNorm+ processing and one SiLU activation function processing, the convolution kernel in the two-dimensional convolution is 3×3, the image size after convolution is 160×160×128, and the calculation formula of the image size after convolution is: Where W is the size of the input matrix, F is the size of the convolution kernel, P is the padding size, S is the stride, and N is the size of the output matrix.
[0019] Further in the present invention, the C2f processing includes a CBS convolution layer, a split layer, two bottleneck layers, a Concat layer and a CBS convolution layer, the output of the latter CBS convolution layer is 160×160×128, and the convolution kernel is 1×1.
[0020] Further in the present invention, the SPPF pooling layer includes one CBS convolution module processing and three Maxpooling processing performed sequentially.
[0021] Further in the present invention, the feature fusion processing includes:
[0022] The features after the SPPF pooling layer are upsampled to an output size of 320×320, and are concat-ed with the data after the first Conv2 processing and then C2f-ed to obtain the first set of feature information, which is input into the detection head 1;
[0023] After the first set of features is processed by Conv2, they are concat and C2f processed with the result of the first Conv processing to obtain the second set of feature information with a size of 320×320, which is input into the second detection head.
[0024] In the present invention, the loss function in the feature fusion process adopts BCE Loss 、CIoU Loss The weighted average of the three loss functions of BCE and DFL is used as the loss value. Loss Used to calculate classification loss, CIoU Loss And DFL are used to calculate the prediction box loss, the calculation formula is:
[0025] DFL(S i ,S +1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 ))
[0026] in y is the true value, y i+1 With y i are the two nearest neighbors of y.
[0027]
[0028]
[0029]
[0030] IoU is the intersection over union (IoU) of the real box and the predicted box, w and h are the width and height of the predicted box respectively; α is the weight function, and v can measure the similarity of aspect ratios.
[0031]
[0032] Where y is the true value, is the predicted value.
[0033] Furthermore, in the present invention, the feature marking uses a LabelImage tool to select an accurate feature size and position, and mark the feature type.
[0034] The beneficial effects of the present invention are: only feature marking is required for the TOFD spectrum without preprocessing, thus reducing the workload. The target detection model has high detection efficiency, further reducing the workload of personnel. At the same time, the model also supports video input and can be deployed on an industrial computer to realize online detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flow chart of TOFD spectrum feature detection;
[0036] Figure 2It is a schematic diagram of the TOFD spectrum feature marking;
[0037] Figure 3 A schematic diagram of the structure of the model in the present invention;
[0038] Figure 4 It is a flow chart of CBS processing;
[0039] Figure 5 It is a flow chart of C2f processing;
[0040] Figure 6 It is a flow chart of SPPF pooling processing;
[0041] Figure 7 is a flow chart of the detection head data processing steps;
[0042] Figure 8 This is the verification result of the model in the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0044] See also Figures 1 to 8 , a TOFD spectrum feature detection method, comprising the following steps:
[0045] S1: Get TOFD spectrum;
[0046] S2: feature marking of TOFD images;
[0047] S3: The marked TOFD atlas is randomly divided into a training set and a validation set;
[0048] S4: Establish a target detection model and input the training set into the target detection model for training;
[0049] S5: Verify the trained object detection model through the validation set;
[0050] S6: Deploy a validated object detection model.
[0051] like Figure 2As shown in the figure, the feature marking of the TOFD map uses the LabelImage tool to select the accurate feature size and position, and mark the feature type. According to the harmfulness of the welding defect type, the feature types are divided into 6 categories: bubbles, dense bubbles, spot slag, strip slag, cracks, and unfused; considering the need for defect location, plus straight-through waves and bottom waves, a total of 8 features are used as identification targets. A total of 4,100 TOFD maps were collected for feature marking, and 95% were randomly assigned as model training sets and 5% as model verification sets.
[0052] The present invention establishes a target detection model based on the YOLOv8 algorithm. YOLOv8 adopts a three-layer structure of feature extraction layer Backbone, feature fusion layer Neck, and detection head Head. The feature extraction layer includes 5 layers of convolution processing, the purpose of which is to extract deep-level target features.
[0053] like Figure 3 As shown, due to the simple texture of TOFD atlas features, too many convolutions will lose the target features. Therefore, the Backbone layer in the model of the present invention only includes one convolution process to reduce the interference caused by feature redundancy. At the same time, the detection heads are optimized from three to two.
[0054] The specific steps of model training are:
[0055] S4a: adjust the input image to three-channel 640×640 size;
[0056] S4b: Perform two-dimensional convolution module processing;
[0057] S4c: C2f treatment;
[0058] S4d: perform SPPF pooling layer;
[0059] S4e: Feature fusion processing.
[0060] Perform two-dimensional convolution module processing (Conv2), that is, CBS processing. Figure 4 As shown in the figure, it includes a two-dimensional convolution, a two-dimensional BatchNorm+ process, and a SiLU activation function process. The convolution kernel in the two-dimensional convolution is 3×3, and the image size after convolution is 160×160×128. The calculation formula for the image size after convolution is: Where W is the size of the input matrix, F is the size of the convolution kernel, P is the padding size, S is the stride, and N is the size of the output matrix.
[0061] like Figure 5As shown in Figure 1, the C2f process sequentially includes a CBS convolution layer, a split layer, two bottleneck layers, a Concat layer, and a CBS convolution layer, where the output of the latter CBS convolution layer is 160×160×128 and the convolution kernel is 1×1.
[0062] like Figure 6 As shown in Figure 1, the SPPF pooling layer includes one CBS convolution module processing and three Maxpooling processing in sequence. The feature map without Maxpooling and the feature map obtained after each additional Maxpooling are concat spliced to achieve feature fusion.
[0063] The feature fusion process includes: upsampling the features after the SPPF pooling layer, outputting a size of 320×320, and performing a Concat with the data after the first Conv2 processing, and then performing a C2f process to obtain the first set of feature information, which is input into the detection head 1. The first set of features after Conv2 processing is concat and C2f processed with the result of the first Conv processing to obtain the second set of feature information, with a size of 320×320, which is input into the detection head 2. The data processing flow of the detection head is shown in Figure 7.
[0064] Considering the influence of image aspect ratio, BCE is used in the loss function Loss 、CIoU Loss The weighted average of the three loss functions of BCE and DFL is used as the loss value. Loss Used to calculate classification loss, CIoU Loss And DFL are used to calculate the prediction box loss, the calculation formula is:
[0065] DFL(S i ,S +1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 ))
[0066] in y is the true value, y i+1 With y i are the two nearest neighbors of y.
[0067]
[0068]
[0069]
[0070] IoU is the intersection over union (IoU) of the real box and the predicted box, w and h are the width and height of the predicted box respectively; α is the weight function, and v can measure the similarity of aspect ratios.
[0071]
[0072] Where y is the true value, is the predicted value.
[0073] The model verification results of the present invention are as follows Figure 8 As shown in the figure, the average detection accuracy of the features is not less than 88%, and the detection efficiency of the TOFD map with a size of 1440×550 is better than 300ms / sheet. The model supports video input and multiple picture input, which greatly reduces the workload of personnel.
[0074] The embodiments of the present application are described above in conjunction with the accompanying drawings. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A TOFD spectrum feature detection method, characterized in that: The following steps are involved: S1: Get TOFD spectrum; S2: feature marking of TOFD images; S3: The marked TOFD atlas is randomly divided into a training set and a validation set; S4: Establish a target detection model and input the training set into the target detection model for training; S5: Verify the trained object detection model through the validation set; S6: Deploy a validated object detection model; The specific steps of the training are: S4a: adjust the input image to three-channel 640×640 size; S4b: Perform two-dimensional convolution module processing twice; S4c: C2f treatment; S4d: perform SPPF pooling layer; S4e: feature fusion processing; The two-dimensional convolution module processing includes one two-dimensional convolution, one two-dimensional BatchNorm+ processing and one SiLU activation function processing. The convolution kernel in the two-dimensional convolution is 3×3, and the image size after convolution is 160×160×128. The calculation formula of the image size after convolution is: Where W is the size of the input matrix, F is the size of the convolution kernel, P is the padding size, S is the step size, and N is the size of the output matrix. The C2f process includes a CBS convolution layer, a split layer, two bottleneck layers, a Concat layer and a CBS convolution layer. The output of the latter CBS convolution layer is 160×160×128, and the convolution kernel is 1×1. The SPPF pooling layer includes one CBS convolution module processing and three Maxpooling processings performed in sequence. The feature fusion processing includes: The features after the SPPF pooling layer are upsampled to an output size of 320×320, and are concat-ed with the data after the first Conv2 processing and then C2f-ed to obtain the first set of feature information, which is input into the detection head 1; The first set of features after Conv2 processing are concat and C2f processed with the first Conv processing result to obtain the second set of feature information with a size of 320×320, which is input into the second detection head; The loss function in the feature fusion process adopts BCE Loss 、CIoU Loss The weighted average of the three loss functions of BCE and DFL is used as the loss value. Loss Used to calculate classification loss, CIoU Loss And DFL are used to calculate the prediction box loss, the calculation formula is: DFL(S i ,S +1 )=-((y i+1 -y)log(S i )+(y-y i )log(S i+1 )) in y is the true value, y i+1 With y i are the two nearest neighbors of y; IoU is the intersection over union of the real box and the predicted box, w and h are the width and height of the predicted box respectively; α is the weight function, and v can measure the similarity of aspect ratio; Where y is the true value, is the predicted value.
2. A TOFD spectrum feature detection method according to claim 1, characterized in that: The feature marking uses the Label Image tool to select the exact feature size and position, and mark the feature type.
