A method for detecting defects in a digital radiographic image of a steel pipe weld

By constructing a deep convolutional network model based on image reconstruction, the problems of low efficiency of manual inspection and insufficient performance of automatic methods in steel pipe welding defect detection are solved, and efficient and robust detection of steel pipe weld defects is achieved.

CN115690001BActive Publication Date: 2026-07-21SINOPEC OILFIELD EQUIP CORP
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SINOPEC OILFIELD EQUIP CORP
Filing Date
2022-10-09
Publication Date
2026-07-21

Smart Images

  • Figure CN115690001B_ABST
    Figure CN115690001B_ABST
Patent Text Reader

Abstract

The application provides a method for detecting defects in a steel pipe welding digital radiograph image, comprising the following steps: S1, collecting a plurality of DR images, expanding a sample data set, preprocessing the plurality of DR images, and constructing a training data set; S2, constructing a deep convolution network model based on image reconstruction, wherein the network model comprises at least one convolution network-based encoder and a corresponding decoder; S3, performing model parameter optimization training, using the training data set to optimize network parameters, and obtaining an optimized network model; S4, inputting the collected DR image into the optimized network model for inference to obtain a reconstructed image; performing difference operation on the reconstructed image and the input image, and binarizing the difference result to obtain a final defect position; and through the above scheme, the final defect position is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of steel pipe welding defect detection, and in particular to a method for detecting defects in digital radiographic images of steel pipe welds. Background Technology

[0002] During the welding process of steel pipes, various welding defects, such as porosity, cracks, lack of fusion, and spatter, are inevitably generated due to the influence of the production environment and manufacturing process. These defects significantly affect the performance of the product. Detecting welding defects and repairing them in a timely manner is crucial. Currently, commonly used welding inspection methods in the industry include manual inspection and non-destructive testing, including radiographic testing, eddy current testing, penetrant testing, ultrasonic testing, and magnetic particle testing. While non-destructive testing can resolve most important surface defects, it requires specialized technicians for on-site inspection. For enterprises, this is difficult to achieve in terms of inspection efficiency and economic cost. In actual welding, the generation of leftover material should be avoided as much as possible. Inspection of the weld area and reprocessing of defect locations are beneficial to improving the quality and utilization rate of the steel pipe. Therefore, improving the quality and efficiency of welding defect detection is particularly important.

[0003] Currently, non-destructive testing (NDT) methods are commonly used for steel pipe welds, with X-ray inspection being the most prevalent. X-ray weld inspection is categorized into film inspection and digital inspection based on the image type. The former is highly subjective and prone to misjudgment, while the latter utilizes computer algorithms for image recognition and detection. To alleviate the difficulties of manual analysis, some automated or semi-automated technologies have been developed. In particular, automated analysis relying on traditional computer vision or shallow machine learning has seen some applications in this field. Unfortunately, due to various challenges, such as weld geometry, low contrast and inconsistent brightness, and defects with significant appearance variations, these methods have not been widely adopted in practical welding applications. Recently, interest in machine learning and deep learning has surged, especially in image analysis. Deep learning models are developed by learning from massive datasets containing thousands or millions of examples. For many NDT applications, annotated training data resources are limited; therefore, the potential of deep learning may not be fully utilized. Currently, object detection or semantic segmentation models are commonly used in this field to discover and locate defects. However, these methods are all supervised learning methods, and the lack of natural training instances makes it impossible for the model to be effectively optimized, resulting in poor performance in practice.

[0004] In summary, most relevant enterprises still rely on traditional manual observation methods, which are prone to subjective factors, low detection efficiency, and easily lead to welding quality problems. Automated methods, due to various reasons such as insufficient feature table capabilities or an insufficient number of manually labeled samples, struggle to achieve satisfactory performance. Therefore, it is necessary to provide a method for detecting defects in digital radiographic images of steel pipe welds to address the aforementioned issues.

[0005] Chinese patent CN111738991A relates to a method for creating a digital radiographic inspection model for weld defects. Its working principle is as follows: The weld seam is extracted from the image using digital image processing technology; the sample size of the weld seam image is expanded using image enhancement technology; the model is trained using a constructed deep learning model and a designed loss function, enabling it to learn defect patterns from existing defect images. The use of deep neural networks allows for more flexible batch processing of all images to be tested, resulting in greater flexibility and more stable performance, ensuring a high recall rate and a certain accuracy. The model is encapsulated and stored for easy access and use, reducing manual workload and improving efficiency. However, in practice, this patent suffers from insufficient feature table capabilities or an insufficient number of manually labeled samples, making it difficult to achieve satisfactory performance. Therefore, its use has inherent limitations. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide a method for detecting defects in digital radiographic images of steel pipe welding, so as to solve the problems that manual observation methods are subject to many subjective factors, have low detection efficiency, and are prone to welding quality problems; while automatic methods have insufficient feature table capabilities or insufficient number of manually labeled samples, making it difficult to achieve satisfactory performance.

[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for detecting defects in digital radiographic images of welded steel pipes, comprising the following steps: S1. Acquire multiple DR images to expand the sample dataset, preprocess the multiple DR images, and construct a training dataset; S2. Construct a deep convolutional network model based on image reconstruction. This network model contains at least one encoder based on a convolutional network and a corresponding decoder. S3. Perform model parameter optimization training, use the training dataset to optimize network parameters, and obtain the optimized network model; S4. Input the acquired DR image into the optimized network model for inference to obtain the reconstructed image; perform a difference operation between the reconstructed image and the input image, and binarize the difference result to obtain the final defect location; The final defect location can be obtained using the above methods.

[0008] In a preferred embodiment, in step S1, the DR images used to construct the training dataset should not contain defects, and multiple DR images undergo image enhancement processing. The steps for preprocessing multiple DR images are as follows: A1: Convert a multi-channel image to a single-channel grayscale image using the following function:

[0009] in, The converted grayscale image. , and These are the red, green, and blue channels of the input image, respectively. r and c represent the r-th row and c-th column of the image; A2: Use histogram equalization to emphasize image contrast; A3: Median filtering is used to filter out impulse noise in the image; A4: Adjust the image contrast using other non-linear transformation functions, the functions are: in, For input single-channel images, For the output image, a and b are respectively The minimum and maximum gray values.

[0010] In the preferred embodiment, image enhancement processing includes directly and indirectly increasing the number of samples. Methods for directly increasing the number of samples include additional on-site image acquisition, generating adversarial models, variational autoencoder models, and depth models to generate additional images. Methods for indirectly increasing the number of samples include image translation, scaling, rotation, cropping, mirroring, grayscale jittering, and template removal.

[0011] In the preferred scheme, the convolutional network model is designed with the following network modules: "ReLU" block is the activation layer; "MaxPool" block is the max pooling layer; "Resize" block is the 2x resolution upsampling layer; "Concat" block is the feature concatenation layer; and "Cluster_N" and "Memory_N" are the feature clustering layer and feature storage layer, respectively. The encoder is used to encode the input image into multi-scale descriptive features, and the decoder is used to translate the descriptive features into a two-dimensional image; In the preferred embodiment, the step of the deep convolutional network model based on image reconstruction in step S2 is as follows: B1: The feature clustering layer only works during training, and the loss is designed to enhance the description of features about the main parts of the image; B2: It employs multiple feature storage modules to store representative features selected during training, and uses the stored features to reconstruct the input image during the testing phase.

[0012] In the preferred embodiment, the steps in B1 to enhance the description of the main parts of the image are: C1: Transform it into (H×W)×C through the deformation module, and then use the clustering algorithm to cluster the H×W one-dimensional vectors with dimension C into K classes, resulting in K class centers, each class center vector having dimension C. Where C, H, and W are the number of channels of the feature, respectively; C2: Transform it into (H×W)×C using the deformation module, and then calculate each position on the feature map according to the following formula. With cluster center vector similarity between :

[0013] Where i∈(1,2,…,W*H), j∈(1,2,…,K), ∈(1,2,…,K). α controls the shape of the similarity distribution; in the scheme of this application, α=1 is a conventional choice. C3: Similarity normalization: ; C4: Calculate the loss To enhance the ability of features to describe the main parts of an image: ; Where KL is the Kullback-Leibler divergence.

[0014] In the preferred embodiment, the step in B2 to reconstruct the input image using stored features is: D1: Calculate each position on the feature map With each storage unit Distance between:

[0015] Where i∈(1,2,…,W*H), j∈(1,2,…,N), ∈(1,2,…,N); D2: Find the input vector Reconstruction results :

[0016] D3: Constrain the loss function:

[0017] D4: Calculate the reconstruction loss from the initial input image: ; r and c represent the r-th row and c-th column of the image; D5: The loss function of the entire system is as follows: .

[0018] In the preferred scheme, the steps for optimizing model parameters during training in S3 are: E1: Calculate the difference image between the reconstructed image and the input image:

[0019] E2: Binarization process:

[0020] r and c represent the r-th row and c-th column of the image. β is a constant, with β=0.7 being a common choice. It is also a constant; Calculate the average gray value as :

[0021] S represents the number of images in the set, and H and W represent the height and width of the images, respectively. io (s,r,c) represents the gray value of the pixel located in the r-th row and c-th column in the s-th difference image.

[0022] In the preferred embodiment, the defect location is determined by identifying the non-zero pixel locations in the binarized image as the defect locations. If there are no non-zero pixels, then there are no defects in the image.

[0023] This invention provides a method for detecting defects in digital radiographic images (DR images) of steel pipe welds. By employing the above-mentioned scheme and a customized preprocessing algorithm, the clarity of the DR image is improved, and the distinction between defects and the background is increased. A novel image reconstruction deep convolutional network model is constructed to improve the network's feature extraction capability and the accuracy and stability of image reconstruction, making the difference results between the reconstructed image and the input image more robust, thus achieving a balance between stability and accuracy in defect detection. This invention can detect various defects in steel pipe welds in real time, such as cracks, incomplete penetration, lack of fusion, undercut, strip-shaped, circular, and spatter defects. In the preferred scheme, a high weld defect detection rate is achieved while ensuring a low false detection rate. While increasing the detection speed, the workload of manual defect detection is greatly reduced. Attached Figure Description

[0024] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 It is a DR image of a flawless steel pipe weld. Figure 2 This is an embodiment of a network model that conforms to the requirements of this application; Figure 3 This is a schematic diagram of how cluster centers are generated in the clustering module; Figure 4 This is a schematic diagram illustrating the calculation of clustering loss in the clustering module; Figure 5 This is a schematic diagram of a training process; Figure 6 yes Figure 5 The training process shown is illustrated by a schematic diagram of a verification sub-process. Figure 7 yes Figure 6 A schematic diagram illustrating the calculation of a binarization segmentation threshold; Figure 8 This is a flowchart illustrating a defect detection process in actual work after training is completed. Detailed Implementation

[0025] Example 1: A method for detecting defects in digital radiographic images of welded steel pipes includes the following steps: S1. Acquire multiple DR images to expand the sample dataset, preprocess the multiple DR images, and construct a training dataset; S2. Construct a deep convolutional network model based on image reconstruction. This network model contains at least one encoder based on a convolutional network and a corresponding decoder. S3. Perform model parameter optimization training, use the training dataset to optimize network parameters, and obtain the optimized network model; S4. Input the acquired DR image into the optimized network model for inference to obtain the reconstructed image; perform a difference operation between the reconstructed image and the input image, and binarize the difference result to obtain the final defect location; The final defect location can be obtained using the above methods.

[0026] In a preferred embodiment, in step S1, the DR images used to construct the training dataset should not contain defects, and multiple DR images undergo image enhancement processing. The steps for preprocessing multiple DR images are as follows: A1: Convert a multi-channel image to a single-channel grayscale image using the following function:

[0027] in, The converted grayscale image. , and These are the red, green, and blue channels of the input image, respectively. r and c represent the r-th row and c-th column of the image; A2: Use histogram equalization to emphasize image contrast; A3: Median filtering is used to filter out impulse noise in the image; A4: Adjust the image contrast using other non-linear transformation functions, the functions are: Where f0(x,y) is the input single-channel image, f(x,y) is the output image, and a and b are the minimum and maximum gray values ​​of f0(x,y), respectively.

[0028] In the preferred embodiment, image enhancement processing includes directly and indirectly increasing the number of samples. Methods for directly increasing the number of samples include additional on-site image acquisition, generating adversarial models, variational autoencoder models, and depth models to generate additional images. Methods for indirectly increasing the number of samples include image translation, scaling, rotation, cropping, mirroring, grayscale jittering, and template removal.

[0029] In the preferred scheme, the convolutional network model is designed with the following network modules: "ReLU" block is the activation layer; "MaxPool" block is the max pooling layer; "Resize" block is the 2x resolution upsampling layer; "Concat" block is the feature concatenation layer; and "Cluster_N" and "Memory_N" are the feature clustering layer and feature storage layer, respectively. The encoder is used to encode the input image into multi-scale descriptive features, and the decoder is used to translate the descriptive features into a two-dimensional image; In the preferred embodiment, the step of the deep convolutional network model based on image reconstruction in step S2 is as follows: B1: The feature clustering layer only works during training, and the loss is designed to enhance the description of features about the main parts of the image; B2: It employs multiple feature storage modules to store representative features selected during training, and uses the stored features to reconstruct the input image during the testing phase.

[0030] In the preferred embodiment, the steps in B1 to enhance the description of the main parts of the image are: C1: Transform it into (H×W)×C through the deformation module, and then use the clustering algorithm to cluster the H×W one-dimensional vectors with dimension C into K classes, resulting in K class centers, each class center vector having dimension C. Where C, H, and W are the number of channels of the feature, respectively; C2: Transform it into (H×W)×C using the deformation module, and then calculate each position on the feature map according to the following formula. With cluster center vector similarity between :

[0031] Where i∈(1,2,…,W*H), j∈(1,2,…,K), ∈(1,2,…,K). α controls the shape of the similarity distribution; in the scheme of this application, α=1 is a conventional choice. C3: Similarity normalization: ; C4: Calculate the loss To enhance the ability of features to describe the main parts of an image: ; Where KL is the Kullback-Leibler divergence.

[0032] In the preferred embodiment, the step in B2 to reconstruct the input image using stored features is: D1: Calculate each position on the feature map With each storage unit Distance between:

[0033] Where i∈(1,2,…,W*H), j∈(1,2,…,N), ∈(1,2,…,N); D2: Find the input vector Reconstruction results :

[0034] D3: Constrain the loss function:

[0035] D4: Calculate the reconstruction loss from the initial input image: ; r and c represent the r-th row and c-th column of the image; D5: The loss function of the entire system is as follows: .

[0036] In the preferred scheme, the steps for optimizing model parameters during training in S3 are: E1: Calculate the difference image between the reconstructed image and the input image:

[0037] E2: Binarization process:

[0038] r and c represent the r-th row and c-th column of the image. β is a constant, with β=0.7 being a common choice. It is also a constant; Calculate the average gray value as :

[0039] S represents the number of images in the set, and H and W represent the height and width of the images, respectively. io (s,r,c) represents the gray value of the pixel located in the r-th row and c-th column in the s-th difference image.

[0040] In the preferred embodiment, the defect location is determined by identifying the non-zero pixel locations in the binarized image as the defect locations. If there are no non-zero pixels, then there are no defects in the image.

[0041] Example 2: Combination Figures 1-8 Further explanation: Processing of DR images of steel pipe welding. Figure 8 A schematic flowchart of a steel pipe welding defect detection method provided in an embodiment of this application is given, which may include the following steps: Constructing a training dataset. The training dataset consists of DR images acquired on-site. A key feature of this application is that no defects are required in the images. In modern production processes, with current welding technology levels, collecting defect-free images is far less difficult than collecting images with defects. Therefore, in practical applications, a sufficient number of images for training can be easily collected. Note that "sufficient number" does not specify a fixed number of images. Considering that the model parameter training process can iterate continuously over a long period of debugging, multiple images can be used. Figure 1 An example training image is provided. Note that the direction, width, grayscale, and contrast of the weld seam in this image should not be used as the sole criterion. Preprocessing is required for the acquired images. One possible preprocessing steps are: If the image is multi-channel, convert it to a single-channel grayscale image. Taking the conversion of a common 3-channel RGB image to a single-channel grayscale image as an example, one conversion function is: (1) in, The converted grayscale image. , and These are the red, green, and blue channels of the input image, respectively. and The image represents the first row and number Note that this conversion function conforms to the ITU Recommendation BT.601-7, but should not be used as the sole conversion standard.

[0042] Histogram equalization is used to emphasize image contrast; Median filtering is used to filter impulse noise in the image. Note that the size and shape of the median filter template can be designed according to the images acquired by different devices and should not be the only limitation.

[0043] Other non-linear transformation functions can be used to adjust image contrast, such as the following functions: (2) in, For input single-channel images, To output the image, and They are respectively The minimum and maximum gray values.

[0044] Since a larger number of samples in the dataset results in higher parameter generalization ability during training, data augmentation of the images is also necessary. Data augmentation as described in this application refers to directly or indirectly increasing the number of samples in the dataset. Methods for directly increasing the number of samples include additional on-site image acquisition or generating additional images using deep models such as generative adversarial models or variational autoencoder models. Methods for indirectly increasing the number of samples include, but are not limited to, processing annotated images by translation, scaling, rotation, cropping, mirroring, grayscale jittering, and template removal.

[0045] Construct a deep convolutional network model based on image reconstruction. Figure 2 An optional implementation method is provided. Figure 2 middle, The block is a convolutional layer, in which , , , These represent the number of output channels (number of kernels), input channels, height, and width of the convolutional kernels, respectively; the "ReLU" block is the activation layer; the "MaxPool" block is the max pooling layer; the "Resize" block is the 2x resolution upsampling layer; and the "Concat" block is the feature concatenation layer. These layers are common network modules in convolutional network model design. "Cluster_N" and "Memory_N" are the feature clustering layer and feature storage layer, respectively, modules unique to the model illustrated in this application. The entire network consists of an encoder and a decoder. The encoder encodes the input image into multi-scale descriptive features, and the decoder translates these descriptive features into a two-dimensional image. Note that... Figure 2 The algorithm employs a three-scale encoder and decoder, but this number of layers should not be the only configuration.

[0046] Figure 2Three feature clustering modules are employed: "Cluster_1", "Cluster_2", and "Cluster_3". These clustering modules operate only during training, using loss mechanisms to enhance the description of features about the main parts of the image. Their operation involves two steps: In the first phase of training, its working mode is as follows: Figure 3 As shown. Let the feature dimension of the encoder side output be... ,in , and These represent the number of channels, height, and width of the feature, respectively. First, it is transformed using a deformation module. Then, a clustering algorithm is used to divide the clustered data into clusters. Each dimension is One-dimensional vector clustering Class, that is, get There are _ ... dimension.

[0047] In the second phase of training, its working mode is as follows: Figure 4 As shown. Let the feature dimension of the encoder side output be... ,in , and These represent the number of channels, height, and width of the feature, respectively. First, it is transformed using a deformation module. Then calculate each position on the feature map according to the following formula. With cluster center vector Similarity between : (3) in , , . In this application, the shape of the similarity distribution is controlled. It's a standard choice.

[0048] Then, the similarity distribution is normalized as follows: (4) Finally, the loss was calculated. This enhances the ability of features to describe the main parts of an image. It is defined as follows: (5) Where KL is the Kullback-Leibler divergence.

[0049] Figure 2Three feature storage modules are employed: "Memory_1", "Memory_2", and "Memory_3". These feature storage units store representative features selected during training. Then, during the testing phase, the stored features are used to reconstruct the input image. Considering that only defect-free samples are used during the training phase, if a defective image is input during the testing phase, it can be considered that defect-free samples are combined to reconstruct the defective image. In this case, defects in the image can be effectively removed. Specifically, let... It is a real-valued matrix, where Indicates the number of stored vectors. This represents the dimension of the stored vector. Similar to the clustering module, let the dimension of the input features of the storage module be... ,in , and These represent the number of channels, height, and width of the feature, respectively. First, it is transformed using a deformation module. Then calculate each position on the feature map according to the following formula. With each storage unit Distance between: (6) in , , Get all Then, the input vector Reconstruction results It can be determined by the following formula: (7) Considering that the storage unit should retain a representative portion of the input feature vector, its values ​​should be relatively sparse. Therefore, the following loss function is introduced for each storage unit as a constraint: (8) Finally, the reconstructed image Required and initial input image The reconstruction loss is calculated as follows: (9) in, and The image represents the first row and number In summary, the loss function of the entire system is as follows: (10) in, In the scheme of this application, It's a standard choice.

[0050] Perform model parameter optimization training. One model training process is as follows: Figure 5 As shown. This training process requires the construction of a validation sample set. The process of constructing the validation sample set in this application is consistent with that of constructing the training sample set. One validation process is as follows: Figure 6 As shown. Below, we will first discuss... Figure 5 The steps described in detail are as follows. The features obtained after the network's forward inference are used to calculate the aforementioned loss. The loss is used to calculate S02. In S02, one optimization strategy is to use stochastic gradient descent with a momentum value of 0.9 and a weight decay coefficient of 0.001. The criterion for determining whether to enter the verification phase in S03 can be set to proceed after a fixed number of forward and backward optimization iterations, such as 500 iterations. When the output of S04 meets certain conditions, S05 outputs a signal indicating the end of the training process. The following describes an embodiment corresponding to S04, namely… Figure 6 The steps in this section will be explained in detail. S06 Obtain the network forward inference results, that is, for the input image... A reconstructed image Then, the difference image between the reconstructed image and the input image is calculated first according to the following formula: (11) As you can see, and They have similar computational forms. Then, for Binarization yields a binary image. One binarization method is shown in the following equation: (12) in, and The image represents the first row and number List. It is a constant. It's a standard choice. It is also a constant, and the method for calculating this constant is as follows: Figure 7 As shown. First, all defective images in the verification sample are selected as an image set. Each image in the set is input into S10, and its reconstructed image is obtained. S11 calculates the difference image between two images and saves it in the computer. S12 counts the input images; if a fixed value is reached, the average gray value of all saved images can be calculated. Choosing the total number of images in the set as this fixed value is a common practice. S13 calculates the average gray value of all saved difference images according to the following formula and uses this value as... .

[0051] (13) in, The number of images in the set. and These represent the height and width of the image, respectively. Indicates the first The difference image located at the first line, number The pixel grayscale value of the column.

[0052] In practice, the acquired DR image is input into the optimized network model for inference to obtain the reconstructed image; the reconstructed image is then compared with the input image, and the difference result is binarized to obtain the final defect location. Figure 2 A schematic diagram of the process is given. In actual operation, the front-end device will acquire DR images of the weld in real time and input them into the processing system designed in this application. First, the trained network model is used to infer the single image and obtain the reconstructed image. The difference image between the reconstructed image and the input image is calculated, and the calculation method is shown in formula (11). The difference image is binarized, and the calculation method is shown in formula (12). Finally, since the binarized result image has been obtained at this time, the non-zero pixel positions in the image will be judged as the location of the defect. If there are no non-zero pixels, there is no defect in the image.

[0053] The above embodiments are merely preferred technical solutions of the present invention and should not be considered as limitations on the present invention. The embodiments and features described in these embodiments can be arbitrarily combined without conflict. The scope of protection of the present invention should be limited to the technical solutions described in the claims, including equivalent substitutions of the technical features described in the claims. That is, equivalent substitutions and improvements within this scope are also within the scope of protection of the present invention.

Claims

1. A method for detecting defects in digital radiographic images of welded steel pipes, characterized in that: Includes the following steps: S1. Acquire multiple DR images to expand the sample dataset, preprocess the multiple DR images, and construct a training dataset; S2. Construct a deep convolutional network model based on image reconstruction. This network model contains at least one encoder based on a convolutional network and a corresponding decoder. S3. Perform model parameter optimization training, use the training dataset to optimize network parameters, and obtain the optimized network model; S4. Input the acquired DR image into the optimized network model for inference to obtain the reconstructed image; The reconstructed image is compared with the input image, and the difference result is binarized to obtain the final defect location. The final defect location can be obtained using the methods described above. In step S1, the DR images used to construct the training dataset should not contain defects, and multiple DR images undergo image enhancement processing. The steps for preprocessing multiple DR images are as follows: A1: Convert a multi-channel image to a single-channel grayscale image using the following function: , in, Let R(r,c), G(r,c), and B(r,c) be the red, green, and blue channel images of the input image, respectively, and let r and c represent the r-th row and c-th column of the image. A2: Use histogram equalization to emphasize image contrast; A3: Median filtering is used to filter out impulse noise in the image; A4: Adjust the image contrast using other non-linear transformation functions, the functions are: ,in, For input single-channel images, For the output image, a and b are respectively The minimum and maximum gray values; The steps of the deep convolutional network model based on image reconstruction in step S2 are as follows: B1: The feature clustering layer only works during training, and the loss is designed to enhance the description of features about the main parts of the image; B2: It employs multiple feature storage modules to store representative features selected during training, and uses the stored features to reconstruct the input image during the testing phase. The steps in B2 to reconstruct the input image using stored features are: set up It is a real-valued matrix, where N represents the number of stored vectors and C represents the dimension of the stored vectors; D1. Calculate each position on the feature map. With each storage unit Distance between: , Where i∈(1,2,…,W×H), j∈(1,2,…,N), ∈(1,2,…,N), where W and H are the height and width of the feature; D2. Find the input vector. Reconstruction results : , D3. Constrain the loss function: , D4. Based on the initial input image and the reconstructed image Calculate the reconstruction loss: , r and c represent the r-th row and c-th column of the image; D5. The loss function of the entire system is as follows: , , and These represent the losses of three storage modules: Memory_1, Memory_2, and Memory_3. , and The losses for the three feature modules, Cluster_1, Cluster_2, and Cluster_3, are used to enhance the feature description about the main parts of the image. .

2. The method for detecting defects in digital radiographic images of welded steel pipes according to claim 1, characterized in that: Image enhancement processing includes directly and indirectly increasing the number of samples. Methods for directly increasing the number of samples include additional on-site image acquisition, generating additional images using deep models of generative adversarial models and variational autoencoder models. Methods for indirectly increasing the number of samples include image translation, scaling, rotation, cropping, mirroring, grayscale jittering, and template removal.

3. The method for detecting defects in digital radiographic images of welded steel pipes according to claim 1, characterized in that: The convolutional network model is designed with the following modules: "ReLU" block for activation; "MaxPool" block for max pooling; "Resize" block for upsampling at 2x resolution; "Concat" block for feature concatenation; and "Cluster" block for clustering. N "and Memory" N "These are the feature clustering layer and the feature storage layer, respectively." The encoder encodes the input image into multi-scale descriptive features, and the decoder translates the descriptive features into a two-dimensional image.

4. The method for detecting defects in digital radiographic images of welded steel pipes according to claim 1, characterized in that: The steps in B1 to enhance the description of the main parts of the image are: C1. Transform it into (H×W)×C using the deformation module. Then, use the clustering algorithm to cluster the H×W one-dimensional vectors with dimension C into K classes, resulting in K class centers. Each class center vector has dimension C. Where C, H, and W are the number of channels, height, and width of the feature, respectively; C2. Transform it into (H×W)×C using the deformation module, and then calculate each position on the feature map according to the following formula. With cluster center vector similarity between : , Where i∈(1,2,…,W×H), j∈(1,2,…,K), ∈(1,2,…,K), α controls the shape of the similarity distribution, α=1; C3. Similarity Normalization: , C4. Calculate the loss Enhance the ability of features to describe the main parts of an image: ; Where KL is the Kullback-Leibler divergence.

5. The method for detecting defects in digital radiographic images of welded steel pipes according to claim 1, characterized in that: The steps for optimizing model parameters in S3 are: E1. Calculate the difference image between the reconstructed image and the input image: ; E2, Binarization Processing: , r and c represent the r-th row and c-th column of the image, and β is a constant, β=0.7; Calculate the average gray value as : , S represents the number of images in the set, and H and W represent the height and width of the images, respectively. This represents the grayscale value of the pixel located in the r-th row and c-th column of the s-th difference image.

6. The method for detecting defects in digital radiographic images of welded steel pipes according to claim 1, characterized in that: The method for determining the location of defects is as follows: the non-zero pixel positions in the binarized image will be determined as the location of the defects. If there are no non-zero pixels, then there are no defects in the DR image.