Digital ray image defect intelligent identification method, computer equipment and medium
By constructing a standardized DR image database and combining adaptive noise reduction, enhancement processing, and an improved YOLOv8 model, the problems of high noise, poor image quality, and difficulty in identifying small defects in DR technology have been solved, achieving efficient and accurate defect identification.
Patent Information
- Application Number
- CN202511620070.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-17
AI Technical Summary
Existing digital ray inspection (DR) technology suffers from high noise, poor image quality, and difficulty in identifying small defects, resulting in low recognition rates. Furthermore, traditional methods have limited effectiveness in noise reduction and enhancement.
It adopts a three-level technical link of image preprocessing-feature enhancement-intelligent recognition. By constructing a standardized DR image database, grayscale processing, adaptive noise reduction and enhancement processing are performed, and recognition is carried out in combination with the YOLOv8 model based on DCN improvement.
It effectively handles various types of noise, significantly improves image quality, and enhances the accuracy and recall of defect recognition, especially the ability to identify small defects, thus achieving efficient and accurate defect detection.
Smart Images

Figure CN121544535A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of nondestructive testing and computer vision, in particular to a digital radiographic image defect intelligent recognition method, a computer device and a medium. BACKGROUND
[0002] With the development of economy, oil and gas pipelines have become the main mode of energy transportation, and welding is the core means of pipeline connection. However, defects are prone to occur in the girth weld during complex welding process, which may lead to pipeline failure, so nondestructive testing is crucial to ensure pipeline safety.
[0003] X-ray detection has become the mainstream method of girth weld nondestructive testing due to its economy and practicality, which is divided into radiographic testing (RT) and digital radiographic testing (DR). DR gradually replaces RT due to its high clarity, easy storage and other advantages, but the current DR defect recognition relies on manual work and is highly subjective, which is prone to missed or misjudgment, seriously restricting the development of DR technology.
[0004] The rise of deep learning technology provides an efficient and low-cost solution for defect recognition, but DR images have high noise and poor quality, which leads to low recognition rate. The existing technology has the following shortcomings: Noise reduction: Traditional methods have poor effect on multiple types of noise, and some methods cause image distortion, making it difficult to meet the automatic processing needs of a large number of samples.
[0005] Enhancement: The DR image has a large gray scale range, and traditional filtering methods have limited enhancement effect. Methods based on Fourier transform have exponential growth in time consumption as the sample size increases.
[0006] Recognition model: Target detection algorithms perform poorly in DR defect recognition due to small defect size and unclear features, and existing improved models have not fundamentally solved the problem of small feature extraction.
[0007] Therefore, there is an urgent need for a method that can efficiently process noise, enhance image quality, and accurately identify defects. SUMMARY
[0008] The present application aims to solve at least one of the above-mentioned deficiencies in the prior art. For example, one of the purposes of the present application is to systematically solve the problems of high noise, poor quality and small defect recognition of DR images through a three-level technical chain of "image preprocessing-feature enhancement-intelligent recognition".
[0009] To achieve the above-mentioned purpose, the present application provides a digital radiographic image defect intelligent recognition method.
[0010] The method includes: S1, constructing a database containing standardized DR images of various defect types; S2, performing grayscale processing on the DR images in the database to obtain single-channel grayscale images; S3, performing adaptive denoising processing on the single-channel grayscale images based on grayscale radius to obtain denoised images; S4, performing adaptive enhancement processing on the denoised images based on collaborative Fourier transform to improve image quality; S5, using a YOLOv8 model based on DCN improvement to identify the improved images.
[0011] Optionally, step S1 includes: acquiring images of circumferential welds in oil and gas pipelines using a DR digital system; classifying weld defects into six categories: cracks, porosity, lack of fusion, strip defects, depressions, and normal welds; and annotating the defect areas in the images of circumferential welds in oil and gas pipelines to form a standardized annotation file.
[0012] Alternatively, in step S2, the grayscale processing includes converting the color image into a single-channel grayscale image using a weighted average method.
[0013] Optionally, in step S3, the adaptive noise reduction processing based on grayscale radius includes: S31, obtaining the grayscale value of each pixel in the grayscale image and determining the noise type; S32, dynamically selecting the noise reduction radius and matching the filtering strategy according to the noise type of the pixel's grayscale value.
[0014] Further, optionally, step S31 includes: calculating the grayscale standard deviation of each pixel using a 3×3 sliding window, and then using the grayscale standard deviation... delta Determine the type of noise, if delta >50, is considered a salt-and-pepper noise zone. delta If the value is ≤10, it is considered a Gaussian noise region; otherwise, it is considered an edge defect region.
[0015] Further, alternatively, step S32 includes: for the salt-and-pepper noise region: selecting a small radius R =1, median filtering is the primary method; for edge defect areas: select a medium radius... R =2, use weighted average filtering; for Gaussian noise regions: select a large radius R =3, using multi-round iterative filtering.
[0016] Optionally, the step S4 comprises: S41, performing discrete Fourier transform on the gray image after noise reduction, and decomposing the image into low-frequency components and high-frequency components; S42, dividing the image into a plurality of modules by using a sliding window, screening structure similar modules through error distance, and enhancing defect features by weighted superposition after orthogonal transformation and aggregation of the matched modules; S43, performing collaborative filtering and aggregation on the high-frequency components and the low-frequency components decomposed by DFT; wherein the high-frequency components are subjected to collaborative threshold filtering, and the low-frequency components are subjected to collaborative Wiener filtering; S44, converting the processed frequency domain components back to the spatial domain image through inverse Fourier transform.
[0017] Further optionally, in the step S5, the YOLOv8 model improved based on the DCN comprises an input layer, a backbone network, a neck network and a head network, wherein the backbone network embeds a plurality of DCN modules.
[0018] Another aspect of the present application provides a computer device.
[0019] The computer device comprises at least one processor and a memory storing program instructions configured to be executed by the at least one processor, wherein the program instructions comprise instructions for executing the method as described above.
[0020] Still another aspect of the present application provides a computer readable storage medium.
[0021] The computer readable storage medium stores computer program instructions, wherein the computer program instructions are executed by a processor to implement the method as described above.
[0022] Compared with the prior art, the present application has the following beneficial effects at least one of which is included: (1) The present application effectively processes multiple types of noise by using an adaptive noise reduction method, and the PSNR and SSIM indicators are better than those of the traditional method, and image distortion is avoided.
[0023] (2) The present application significantly improves image quality by using an adaptive enhancement method combined with Fourier transform and filtering technology, and the average PSNR after enhancement is improved by more than 15, and the average SSIM is improved by more than 0.25.
[0024] (3) The improved YOLOv8 model of the present application solves the problem of small defect recognition by embedding a DCN module, and the precision, mAP@0.5 and recall rate are improved by 0.52, 0.57 and 0.51 respectively compared with the original model, and the stability of recognizing various defects is high. BRIEF DESCRIPTION OF DRAWINGS
[0025] The above and other objects and / or characteristics of the present application will become more apparent by describing in detail the present application with reference to the attached drawings, wherein: Figure 1 : DCN network structure schematic diagram.
[0026] Figure 2 : Improved YOLOv8 network structure schematic diagram.
[0027] Figure 3 : Gray scale images and gray scale histograms of different defects.
[0028] Figure 4 : Comparison chart of denoising effects of different denoising radii.
[0029] Figure 5 : PSNR and SSIM curve graphs under different denoising radii.
[0030] Figure 6 : Effect diagram after image automatic enhancement.
[0031] Figure 7 : Precision comparison chart of improved YOLOv8 model and other models.
[0032] Figure 8 : Confusion matrix of improved YOLOv8 model. DETAILED DESCRIPTION
[0033] In the following, the digital radiograph image defect intelligent recognition method, computer device and medium of the present application will be described in detail in conjunction with exemplary embodiments.
[0034] The present application specifically relates to a digital radiograph (DR) image defect intelligent recognition method. The method realizes defect recognition through image gray scale processing, adaptive denoising, adaptive enhancement and an improved YOLOv8 model, and solves the problem of low recognition rate caused by high DR image noise and poor quality. Compared with traditional methods, the present application defines the key parameters of each link in the defect recognition process, designs a denoising method based on gray scale radius, an enhancement algorithm cooperated with Fourier transform, and an improved YOLOv8 model embedded with three DCN (Deformable Convolution Network, DCN) modules, and finally the recognition accuracy reaches 0.87, mAP@0.5 reaches 0.86, and the recall rate reaches 0.81. Finally, the platform type accuracy reaches 90%, the size error is not more than 10%, and the position error is not more than 10%.
[0035] Exemplary Embodiment 1 The present exemplary embodiment provides a digital radiograph image defect intelligent recognition method. The method comprises the following steps: S1, Database establishment and standardization processing To ensure the robustness and generalization ability of model training, the present application constructs a standardized DR image database containing multiple types of defects, and the specific process is as follows: (1) Sample collection: Collect oil and gas pipeline girth weld images through a DR digital system, covering defect samples under different welding processes, pipeline materials (such as X70 and X80 pipeline steel), and working conditions.
[0036] (2) Defect classification: According to the SY 49013 industry standard, the defects are divided into 6 categories: cracks, pores, incomplete fusion, strip defects, depressions, and normal welds (non-defects). The number of each category is balanced to avoid class bias in model training.
[0037] (3) Data annotation: Use a professional annotation tool (such as LabelImg) to perform pixel-level annotation on the defect area, record the boundary box coordinates, class, and size information of the defect, and form a standardized annotation file (XML format) to provide supervision signals for model training.
[0038] S2, Image gray processing The DR original image is in RGB three-channel color format, with redundant pixel information and high computational complexity. To simplify the subsequent processing process, the present application converts the color image to a single-channel gray image using the weighted average method, and the specific formula is as follows: (1) wherein, , , represent the pixel values (value range 0-255) of the red, green, and blue channels, respectively, is the converted gray value. This method balances the red and blue channels by retaining the green channel weight sensitive to the human eye, while compressing the data dimension and maximizing the retention of defect feature information.
[0039] S3, Adaptive noise reduction processing based on gray radius DR images have problems such as mixed Gaussian noise and salt and pepper noise due to factors such as X-ray scattering and equipment noise. The effect of traditional single filtering method is limited. The present application proposes an adaptive noise reduction method based on gray radius, which realizes targeted noise reduction by dynamically adjusting the filtering range, and the steps are as follows: (1) Gray value query and noise type judgment Iterate through each pixel of the image to obtain its gray value and neighborhood (3x3 window) gray distribution, and judge the noise type by gray standard deviation delta If≤10, it is determined to be Gaussian noise; if there is a gray value jump ( ”), it is determined as salt and pepper noise; the rest is “edge defect area”, which provides the basis for subsequent radius selection.
[0040] (2) Adaptive selection of gray radius According to the noise type and pixel gray value, the noise reduction radius (R) and filtering strategy are dynamically selected: R For salt and pepper noise area: select small radius R = 1, mainly use median filtering; R For edge defect area: select medium radius R = 2, use weighted average filtering; R For Gaussian noise area: select large radius R = 3, use multi-round iterative filtering. R
[0041] (3) Calculation of gray weight parameter matrix For the selected radius R, a two-dimensional Gaussian weight matrix W is constructed as shown in formula 2: (2) Wherein, , , m is usually represented as a diffusion coefficient function or a weight function, r is the weight decay with the increase of the distance of the center pixel, h is the horizontal offset, w is the vertical offset. Realize weighted average filtering, reduce the damage to the defect characteristics.
[0042] (4) Single-channel gray recursive noise reductionRecursive calculation is performed within the radius range, and the gray value is optimized through multiple rounds of iteration, as shown in formula 3: (3) Wherein, is the input gray value, is the gray value after noise reduction.
[0043] Effect verification: Experiments show that when the radius R = 3, the noise reduction effect of various defects is optimal, and the specific indicators are shown in Table 1: Table 1 Peak signal-to-noise ratio and structural similarity index of different defect images after noise reduction processing
[0044] S4, adaptive enhancement processing based on cooperative Fourier transform The image after noise reduction still has problems such as low contrast and fuzzy defect features, and needs to be further enhanced. The application proposes a synergistic Fourier transform combined with multi-filter enhancement method, which improves image quality through joint optimization of frequency domain and spatial domain, and the steps are as follows: (1) Discrete Fourier transform (DFT) frequency division.
[0045] DFT is performed on the gray image after noise reduction, and the image is converted from spatial domain to frequency domain, as shown in formula 4.
[0046] (4) Wherein, is the spatial pixel value, is the frequency domain coefficient, omega is the transform space, e is the natural constant, i is the imaginary unit, x is the horizontal coordinate of the spatial pixel. Discrete Fourier transform (DFT) frequency division realizes separation of high and low frequency components, which provides a core basis for subsequent type enhancement. At the same time, the DFT enhancement module matches the effectiveness and the noise suppression and feature retention, which provides accurate feature support for similarity matching.
[0047] (2) Similarity matching and orthogonal transformation uses a sliding window to divide the image into multiple modules, and selects the structure similar module through error distance, as shown in formula 5.
[0048] (5) Wherein, is the error distance. The structure similar module is subjected to orthogonal transformation (such as wavelet transformation), the coefficients with amplitude less than the threshold value are zeroed, the key features are retained, and the matching accuracy is verified through mean square error (MSE), as shown in formula 6.
[0049] (6) Wherein, is the orthogonal transformation operator, which ensures the structural consistency of the similar module.
[0050] (3) Synergistic threshold filtering and aggregation.
[0051] The frequency domain high frequency component and the low frequency component decomposed by DFT are aggregated and synergistically filtered, which ensures that the high and low frequency components realize enhancement effect respectively. Firstly, the synergistic threshold filtering and aggregation are applied to the frequency domain high frequency component by synergistic threshold filtering, and the defect edge features are enhanced, as shown in formula 7: (7) Wherein, is the synergistic threshold, is the inverse Fourier transform coefficient.
[0052] The filtered modules are aggregated to generate pixel estimation values by weighted superposition, as shown in formula 8: wherein, is an estimated pixel value, is a weight.
[0053] The feature fusion is finally realized through the above calculation.
[0054] Subsequently, the filtering and collaborative optimization for the low-frequency components in the frequency domain are optimized through the collaborative Wiener filter. The collaborative Wiener filter is introduced to suppress residual noise and enhance the contrast between the background and defects, as shown in formula 9: wherein, is a Wiener filter coefficient, which is adaptively adjusted by the frequency energy spectrum.
[0055] (4) Finally, the image is converted back to the spatial domain image through inverse Fourier transform (IDFT).
[0056] Effect verification: This method can automatically optimize parameters, and the image quality indicators of various defects after enhancement are significantly improved, as shown in Table 2: Table 2 Peak signal-to-noise ratio and structural similarity index of different defect images after image enhancement processing
[0057] S5, YOLOv8 model identification based on DCN improvement In view of the problem that the defect size in the DR image is small and the feature is not obvious, the YOLOv8 model is improved by embedding a deformable convolutional network (DCN) module to improve the small target recognition capability, as follows: (1) DCN module design The basic structure of the DCN module is shown in Figure 1 . The DCN increases an offset prediction branch based on the traditional convolution to adaptively adjust the sampling position of the convolution kernel and adapt to the geometric deformation of the defect. The core formula is as follows: wherein, x is the center position of the convolution, p 0 is the target position on the output feature map of the convolution operation, y ( p 0) is the feature value at position p on the output feature map, is the relative coordinate in the convolution kernel, omega ( p n ) is the relative coordinate p corresponding weight parameter, R a receptive field range of the convolution kernel, a predicted offset, x p 0+ p n + is the pixel value corresponding to the sampling position (p + p n + Δp n ) on the input feature map after offset adjustment.
[0058] The actual sampling value is obtained by bilinear interpolation, as shown in equation 11: (11) wherein, is the interpolation reference point, x q is the actual pixel value of the interpolation reference point q on the input feature map, is the interpolation weight, x p is the pixel estimate value of the target sampling position p on the input feature map, G q , p is the bilinear interpolation kernel function between the target sampling position p and the interpolation reference point q, q x is the horizontal coordinate of the interpolation reference point q on the input feature map, p x is the horizontal coordinate of the target sampling position p on the input feature map, q y is the vertical coordinate of the interpolation reference point q on the input feature map, p y is the vertical coordinate of the target sampling position p on the input feature map, a is the offset coefficient of the target sampling position p and the interpolation reference point q in the horizontal coordinate direction, b is the offset coefficient of the target sampling position p and the interpolation reference point q in the vertical coordinate direction, g a , b is a weight calculation sub-function constructed based on the offset coefficients a and b.
[0059] (2) Improve the YOLOv8 model structure As Figure 2 is the overall model structure after embedding DCN into YOLOv8, the model is divided into four parts: Input layer: resize the enhanced image to 640×640, and use Mosaic data enhancement to improve the robustness of the model.
[0060] Backbone network: adopts C2f structure (contains 3 residual blocks) for feature extraction, and embeds DCN modules (a total of 3) at the 2nd, 4th and 6th layers to enhance the receptive field for small defects.
[0061] Neck network: adopts PANet bidirectional path structure, and integrates multi-scale features through bottom-up (down-sampling) and top-down (up-sampling) feature fusion.
[0062] Head network: adopts decoupled head structure, separates classification branch (outputs defect category probability) and regression branch, and uses 1x1 convolutional layer to complete the task respectively.
[0063] Loss function and training parameters: classification loss adopts variable focus loss (VFL) to dynamically adjust the weight of positive and negative samples to improve the classification accuracy of small targets.
[0064] Regression loss: combines complete intersection over union (CIoU) and distribution focus loss (DFL) to optimize the positioning accuracy of the bounding box.
[0065] Effect verification: when the backbone network embeds 3 DCN modules, the model performance is optimal, and the specific indicators are as follows: precision: 0.87, recall: 0.81, mAP@0.5: 0.86. Compared with the unimproved YOLOv8, the precision is improved by 0.52, the recall is improved by 0.51, and the mAP@0.5 is improved by 0.57, especially the recognition rate of small defects such as cracks and pores is significantly improved.
[0066] Through the above technical solutions, the present application realizes the whole process optimization from pre-processing to intelligent recognition of DR image defects, and provides an efficient and accurate solution for non-destructive testing of oil and gas pipeline girth welds.
[0067] Example embodiment 2 For steps S1 and S2 of example embodiment 1, this example embodiment describes the construction process of the DR defect image database and the specific implementation of gray scale processing, providing a standardized data basis for subsequent noise reduction, enhancement and intelligent recognition, and ensuring the reliability and generalization ability of model training.
[0068] (1) Sample collection and equipment parameter calibration As an option of the present application, the DR defect samples can be collected by a DL-2000 type digital ray detection system (DRAA Company, Jiangsu, China), which is equipped with a 16-bit high-sensitivity flat panel detector (pixel size 150 pm x 150 pm), covers a detection range of 200-1200 mm diameter pipe girth weld, and meets the industry standard (SY49013) for oil and gas pipeline detection. To ensure the diversity and representativeness of the samples, the following parameters are strictly controlled during the collection process: Ray source parameters: A directional X-ray machine is used, the tube voltage is set to 160-220 kV (adjusted according to the pipe wall thickness: 160 kV for wall thickness ≤15 mm, 190 kV for wall thickness 15-25 mm, and 220 kV for wall thickness >25 mm), the tube current is 5 mA, the exposure time is 3-5 s, and the focal length is 800 mm, to ensure that the X-ray energy uniformly penetrates the weld area and avoids image blurring due to insufficient exposure or feature loss due to overexposure.
[0069] Pipe sample preparation: X70 and X80 are selected as typical pipe steel materials, and the specifications cover 508 mm (wall thickness 12 mm), 813 mm (wall thickness 17.5 mm), and 1016 mm (wall thickness 21 mm) to simulate different pressure grades of pipe working conditions in actual engineering.
[0070] Environmental control: The collection environment temperature is maintained at 20±2°C, and the relative humidity is ≤60%, to avoid increased detector noise due to temperature and humidity fluctuations; the relative position of the X-ray machine and the pipe is fixed (using a special tool fixture), to ensure consistent imaging angles for different samples and reduce geometric deviations in subsequent processing.
[0071] (2) Defect classification and labeling specification As an option of the present application, the collected DR images can be classified into 6 categories according to the SY 49013 "Technical Specification for Welding of Oil and Gas Pipelines", and the specific definitions and sample quantities are as follows: Crack: a linearly distributed elongated defect in the weld with a length ≥2 mm and a width ≤0.5 mm, which is mainly caused by welding stress concentration in the heat-affected zone, and the samples cover longitudinal cracks (parallel to the weld direction) and transverse cracks (perpendicular to the weld direction).
[0072] Porosity: a circular or elliptical hole formed during the welding process due to the failure of the gas to escape in time, with a diameter of 0.5-3 mm, including single porosity (isolated distribution), dense porosity (multiple porosity groups with a spacing ≤5 mm), and chain porosity (linear arrangement along the weld direction).
[0073] Incomplete fusion: a defect that the weld and base material or interlayer are not completely fused, which appears as irregular strip-shaped shadow with a length ≥ 3 mm, including incomplete fusion of the groove (the interface between the weld and the pipe groove) and incomplete fusion of the interlayer (the interface between the layers of multi-pass welding).
[0074] Strip-shaped defect: a long strip-shaped inclusion or uncleaned slag distributed along the weld direction, with a width of 0.8-2 mm, a length ≥ 5 mm, and a gray value lower than that of the surrounding weld area.
[0075] Depression: a local depression formed by insufficient filling on the weld surface, which appears as an irregular area with low central gray value and high edge gray value in the DR image, with a depth ≥ 0.5 mm.
[0076] Normal weld (100): a qualified weld without visible defects, used as a negative sample to distinguish defect and non-defect areas.
[0077] (3) Specific implementation of gray processing The DR original image is in 24-bit RGB format (8 bits per channel), with a pixel value range of 0-255, containing redundant information of three channels of red (R), green (G), and blue (B). To simplify the data dimension, reduce the calculation amount, and retain the defect features, the invention converts the image to an 8-bit gray image using the weighted average method in step S2, with the specific steps as follows: Channel separation: use the split() function of the OpenCV library to separate the RGB image into R, G, and B single-channel matrices, each with a size of HxW (H is the image height and W is the image width, which is uniformly 2048x2048 pixels in this embodiment).
[0078] Gray conversion calculation: according to the visual characteristics that the human eye is most sensitive to green and least sensitive to blue, the gray value is calculated using formula 12: (12) Wherein, is the gray value.
[0079] Gray normalization: due to differences in exposure conditions of different samples, the gray value distribution range may be different (such as some images with gray values concentrated in 50-150 and some in 80-200). To unify the scale, the gray value is normalized to 0-255 using linear stretching.
[0080] Quality check: the converted gray image is checked for quality, and the following unqualified samples are removed: Abnormal gray mean value, which may be caused by exposure error; Gray standard deviation < 20, the image contrast is too low, and the defect features are blurred; There are obvious artifacts (such as straight line noise caused by detector scratches), which are screened by manual visual inspection combined with automatic detection (calculating the gray level jump of consecutive pixels).
[0081] As Figure 3 The gray values of different defects after gray processing are shown. After the above-mentioned process, the final database contains 600 valid samples, and the number of each type of defect is balanced (as shown in Table 3), the average gray value of the gray image is 128±15, and the standard deviation is 45±8, which meets the input requirements of subsequent noise reduction and enhancement processing. Through the standardized database and gray processing, a reliable data foundation is laid for the entire defect recognition process, ensuring that the subsequent algorithm can stably extract defect features.
[0082] Table 3 Sample type and number
[0083] Example 3 For step S3 of example 1, this example addresses the problem of mixed noise (Gaussian noise, salt and pepper noise, and ray scattering noise) in DR images, and elaborates on the specific operation process, parameter optimization and effect verification of the adaptive noise reduction method based on gray radius (i.e. step S3). By dynamically adjusting the filtering strategy, the balance between noise suppression and defect feature preservation is achieved.
[0084] (1) Noise type analysis and preprocessing The noise source of DR image is complex, which needs to be clarified through statistical analysis: Gaussian noise: mainly generated by the electronic thermal motion of the detector, showing random fluctuations around the true value of the gray value, and showing normal distribution on the gray histogram. The statistical analysis of 100 original images shows that the mean value of Gaussian noise is 0, and the standard deviation (σ) is between 8-10. Among them, the pore area has smaller σ due to uniform ray penetration, while the unfused area has larger σ due to complex structure.
[0085] Salt and pepper noise: caused by dead pixels of the detector or sudden change of ray energy, showing isolated bright spots or dark spots, accounting for about 0.5%-2% in the image. The crack edge area has a higher proportion of salt and pepper noise (1.5%-2%) due to obvious gray level jump.
[0086] Scattering noise: caused by non-directional scattering of ray interaction with pipe material, showing a large area of fuzzy background, which reduces the overall contrast of the image, especially in the center of the weld, with a gray value fluctuation range of 30-50.
[0087] The preprocessing stage needs to locate the noise-intensive area first: a 3x3 sliding window is used to calculate the standard deviation of the gray scale of each pixel. When the standard deviation is greater than 50, it is marked as "salt and pepper noise area" (about 15%-20% of the image area), and when it is less than or equal to 10, it is marked as "Gaussian noise area" (about 60%-70% of the image area), and the rest is "edge defect area", which provides the basis for subsequent radius selection.
[0088] (2) Adaptive radius selection and filtering strategy Based on the noise type and area characteristics, the noise reduction radius (R) is dynamically selected and the filtering strategy is matched: Salt and pepper noise area (such as normal weld area): select small radius (R=1), use median filter as main. The noise in this area is mainly salt and pepper noise, and small radius filtering can avoid the loss of details caused by excessive smoothing. Experiments show that when R=1, the salt and pepper noise removal rate reaches 90%, while retaining more than 95% of the original gray scale gradient.
[0089] Edge defect area (such as pore, strip defect area): select medium radius (R=2), use weighted average filtering. By constructing a gray weight matrix (center pixel weight 0.3, neighborhood pixel weight decreasing with distance), the defect edge is preserved while the noise is suppressed. Tests on 50 samples show that when R=2, the PSNR of the medium noise area is improved by 2.3-3.5dB compared with R=1, and the SSIM is improved by 0.05-0.08.
[0090] Gaussian noise area (such as crack, unfused area): select large radius (R=3), use multi-round iterative filtering. First round uses Gaussian filter to suppress Gaussian noise, second round uses mean filter to smooth scattered noise, and finally uses edge protection filter to repair crack edge. The test shows that when R=3, the noise variance of the Gaussian noise area is reduced from 18 to less than 5, while the gray scale gradient retention rate of the crack edge is still more than 85%.
[0091] Especially for cracks and other elongated defects, an "edge sensitive mechanism" is designed: when a pixel with a gray scale gradient greater than 40 is detected (judged as an edge), the radius is automatically reduced from 3 to 2, and the weight of the edge pixel is increased by 1.5 times compared with the ordinary pixel, avoiding the crack breakage caused by filtering. Processing of 43 crack samples shows that this mechanism can improve the continuity of the crack from 72% to 91%.
[0092] (3) Quantitative verification of noise reduction effect As Figure 4 The noise reduction effect of different defects under different noise reduction radii. Through multiple comparative experiments, the optimal parameters are verified, and when the radius R=3, the noise reduction effect of various defects is optimal, and the specific indicators are as follows: Peak Signal to Noise Ratio (PSNR): For pits, the PSNR is increased from 22.15 dB to 32.26 dB, an increase of 10.11 dB; for cracks, the PSNR is increased from 20.32 dB to 30.65 dB, an increase of 10.33 dB; for incomplete fusion, the PSNR is increased from 19.87 dB to 30.25 dB, an increase of 10.38 dB; for pores, the PSNR is increased from 21.05 dB to 31.27 dB, an increase of 10.22 dB; for strip defects, the PSNR is increased from 20.56 dB to 30.41 dB, an increase of 9.85 dB; and for normal welds, the PSNR is increased from 19.20 dB to 29.41 dB, an increase of 10.21 dB.
[0093] Structural Similarity Index (SSIM): For pits, the SSIM is increased from 0.51 to 0.72, an increase of 0.21; for cracks, the SSIM is increased from 0.40 to 0.61, an increase of 0.21; for incomplete fusion, the SSIM is increased from 0.42 to 0.63, an increase of 0.21; for pores, the SSIM is increased from 0.43 to 0.62, an increase of 0.19; for strip defects, the SSIM is increased from 0.45 to 0.65, an increase of 0.20; and for normal welds, the SSIM is increased from 0.38 to 0.56, an increase of 0.18.
[0094] Noise removal rate: The Gaussian noise removal rate is 92%-95%, the salt and pepper noise removal rate is more than 98%, and the background blur caused by scattering noise is reduced by 60%-70% (quantified by edge sharpness index: the proportion of edge pixels is increased from 8% before denoising to 15%).
[0095] Compared with traditional methods (such as wavelet filtering and median filtering), the adaptive method of the present application has the following advantages: for mixed scenes of multiple types of noise, the average PSNR is increased by 2.5-4 dB, and the average SSIM is increased by 0.1-0.15; especially for cracks, which are fragile features, traditional methods can easily cause 30%-40% of the features to be lost, while the feature retention rate of the present method is more than 85%.
[0096] (4) Abnormal sample processing and quality control To ensure the stability of batch processing, the following quality control mechanisms are set: Automatic review: samples with PSNR < 28 dB or SSIM < 0.6 after denoising are marked as "unqualified", and R=4 remedial filtering is automatically triggered, and about 80% of the samples can reach the standard after re-computation.
[0097] Through the above process, the adaptive denoising processing can control the noise level of the DR image within the ideal range, laying a high-quality data foundation for subsequent image enhancement and intelligent recognition, especially providing a key guarantee for feature extraction of small-size defects.
[0098] Example 4 For step S4 of the example embodiment 1, the present example embodiment is directed to the problems of low contrast, blurred defect edges, insufficient feature recognition, etc. that still exist in the DR image after noise reduction, and elaborates the operation process, parameter optimization and effect verification of the adaptive enhancement processing method based on collaborative Fourier transform, to improve the recognizability of defect features through joint processing of frequency domain and spatial domain.
[0099] (1) Image quality analysis before enhancement Although the DR image after noise reduction has removed most of the noise, the following problems still exist: Insufficient contrast: By analyzing the gray scale histogram of 586 images after noise reduction, it is found that 65% of the sample gray scale values are concentrated in 80-180 (accounting for 40% of the total dynamic range), and the gray scale difference between the non-fusion and strip defect regions and the background is only 5-15, which is difficult for the human eye to distinguish.
[0100] Edge blur: The edge gradient value (difference in gray scale between adjacent pixels) of defects such as cracks and depressions is 10-20 on average, which is lower than the threshold (30) that can be recognized by the human eye, resulting in that 70% of micro-cracks (length <3mm) are almost invisible.
[0101] Local brightness unevenness: Due to differences in radiation attenuation, there are 5-10mm diameter spots or dark spots in the center area of the weld, with a gray scale fluctuation of 30-50, which masks small defects (such as pores) in this area.
[0102] By quantifying the gray scale distribution entropy (an index that measures the uniformity of gray scale distribution), the average entropy value of the image after noise reduction is 5.2 (full score 8.0), indicating that the information richness still needs to be improved through enhancement processing.
[0103] (2) Step-by-step implementation of collaborative Fourier transform enhancement The enhancement process is divided into four stages: frequency domain frequency division, similarity matching, filter optimization, and spatial domain reconstruction, and the parameters and effects of each stage are as follows: Stage 1: Frequency domain frequency division processing Discrete Fourier transform is used to decompose the image into low-frequency components (accounting for 60%-70%, corresponding to the background and slowly changing areas) and high-frequency components (accounting for 30%-40%, corresponding to the defect edges and details). Analysis of 100 samples shows that: The low-frequency component energy is concentrated in the range of 0-0.2 times the cutoff frequency, and the low-frequency energy of the non-fusion area is 15%-20% higher than that of the normal weld.
[0104] The high-frequency component energy is concentrated in the range of 0.6-1.0 times the cutoff frequency, and the high-frequency energy of the crack area is 25%-35% higher than that of the background.
[0105] Separate the two types of components through frequency domain mask technology to provide a basis for targeted enhancement.
[0106] Stage 2: Similarity matching and feature aggregation Divide the image into 16384 modules (for a 2048x2048 image) using an 8x8 pixel sliding window, and filter similar structures by calculating the gray error distance between modules: For round defects such as pores, similar modules with a matching error distance ≤5 can match 15-20 similar modules per pore area on average; For linear defects such as cracks, similar modules with a matching error distance ≤8 are preferentially retained in the same direction (angle deviation <10°), and 8-12 similar modules per crack area can be matched on average.
[0107] After orthogonal transformation and aggregation of the matching modules, the defect features are enhanced by weighted superposition (weight positively correlated with module similarity), and the actual measurement shows that this step can increase the gray gradient of the defect area by 30%-40%.
[0108] Stage 3: Multi-filter collaborative optimization Different components are filtered using a combination filter strategy: Low-frequency component: Apply collaborative Wiener filtering, dynamically adjust the filtering strength according to the local variance (enhance filtering in areas with large variance, and weaken filtering in areas with small variance), reduce the background brightness standard deviation from 25 to 12, and improve uniformity by 52%; High-frequency component: Apply threshold filtering to retain edge features with a gray gradient >20 and filter weak noise (gradient <5), increasing the signal-to-noise ratio of the defect edge from 1.2 to 3.5.
[0109] Through 10 sets of parameter comparison experiments (sigma value 1-7, lambda value 0-30), the optimal combination is determined as sigma=5, lambda=20, at which the enhancement effect of each type of defect is most balanced.
[0110] Stage 4: Spatial reconstruction and detail repair Convert the processed frequency domain components back to spatial domain images through inverse Fourier transform, and perform detail repair for the following problems: For the "over-sharpening artifacts" (bright or dark rings around the edges) that appear after enhancement, use 5x5 mean filtering for local smoothing, with a pseudo-artifact removal rate of 90%; For pixels with gray value overflow (>255 or <0), use truncation processing (set pixels exceeding 255 to 255, and set pixels below 0 to 0) to ensure image compliance.
[0111] (3) Quantitative verification of enhancement effect As shown in Figure 5 the PSNR and SSIM of different defects after enhancement. The image quality indicators of each type of defect after enhancement are significantly improved, and the specific data is shown in Table 4 Table 4. Graphical quality enhancement effect
[0112] Other key indicators: Defect-to-background gray contrast: from an average of 12 to 45, an increase of 275%, with the contrast of pores increasing most significantly (from 8 to 52); Edge sharpness: the gray gradient of the crack edge is increased from 15 to 60, reaching the level that can be clearly recognized by the human eye; Processing efficiency: the enhancement of a single 2048x2048 image takes about 0.8 seconds, meeting the real-time requirements of industrial detection (<1 second).
[0113] As Figure 6 The defect enhancement effect after automatic enhancement of different defects is shown. Compared with traditional enhancement methods (such as histogram equalization, CLAHE), the synergistic method has obvious advantages: the average PSNR is 8-10 dB higher, the average SSIM is 0.15-0.2 higher, and the recognition rate of small pores (diameter <1 mm) is increased by more than 40%, solving the problem of noise amplification or detail loss caused by traditional methods.
[0114] Example Embodiment 5 For step S5 of example embodiment 1, this example embodiment details the training process, parameter optimization and performance evaluation of the improved YOLOv8 model based on DCN. By comparing the effects of different DCN module embedding schemes, the recognition ability of the improved model for DR image defects is verified, especially the recognition accuracy of small size and low contrast defects is improved.
[0115] (1) Model improvement and network structure design The core of improving the YOLOv8 model is to embed a deformable convolution (DCN) module in the original network, which is specifically designed as follows: DCN module embedding position: through 6 groups of comparative experiments (Group A-F), the influence of embedding position (backbone network / neck network) and number (1 / 2 / 3) is explored. Among them, Group A is “backbone network + 3 DCN”, Group B is “backbone network + 2 DCN”, Group C is “backbone network + 1 DCN”, Group D is “neck network + 3 DCN”, Group E is “neck network + 2 DCN”, Group F is “neck network + 1 DCN”, and a blank group (Group G, original YOLOv8) is set as a benchmark.
[0116] DCN module function: The DCN module adjusts the sampling position of the convolution kernel dynamically to adapt to the irregular shape of the defects (such as the bending of cracks and the elliptical shape of pores). Tests show that after embedding the DCN, the model's recognition ability for cracks with an inclination angle > 30° is improved by 40%, and the recognition ability for small pores with a diameter < 1 mm is improved by 55%.
[0117] The backbone network of the original YOLOv8 uses a C2f structure to extract features, the neck network fuses multi-scale features through PANet, and the head network uses a decoupled head to separate classification and regression tasks. After improvement, Group A embeds 1 DCN module at the 2nd, 4th, and 6th layers of the backbone network to enhance the feature capture ability for small defects. The network depth and parameter quantity increase by only 8% compared to the original model (parameter quantity increases from 63 million to 68 million), ensuring computational efficiency. Set the DCN model to embed YOLOv8 at different positions, as shown in Table 5.
[0118] Table 5 DCN embedding YOLOv8 at different positions
[0119] (2) Training environment and parameter settings The training process is carried out in the following environment: Hardware configuration: Intel Xeon Gold 6348 processor (28 cores), NVIDIA A100 graphics card (80GB video memory), 128GB memory, ensuring the training speed when processing batch 640×640 pixel images (each iteration takes about 45 seconds).
[0120] Dataset division: 586 samples are divided into training set (410), validation set (117), and test set (59) at a ratio of 7:2:1, and the proportion of each type of defect in the three groups is consistent (such as 30 cracks in the training set, 9 in the validation set, and 4 in the test set), avoiding data distribution bias.
[0121] Key training parameters: Image size is resized to 640×640 to meet the model input requirements; Batch size (Batch size) is set to 16 to balance memory usage and training stability; The number of iterations (Epochs) is 500, the learning rate is linearly decayed from 0.0 to 0.001 in the first 100 iterations, and the cosine annealing strategy is used for fine-tuning in the last 400 iterations; The optimizer is Adam, the weight decay coefficient is 0.0005, and the momentum parameter is 0.937; Enable early stopping mechanism (patience=50), if the mAP@0.5 of the validation set does not improve for 50 consecutive rounds, terminate training.
[0122] Data augmentation strategy: Mosaic augmentation (randomly paste 4 images), random horizontal flip (probability 0.5), random scaling (0.8-1.2 times), HSV color domain distortion (brightness ±10%, saturation ±15%) are used during training to improve the generalization ability of the model, and the actual measurement can improve the validation set accuracy by 5%-8%.
[0123] (3) Training process monitoring and key indicator changes During the training process, the precision, recall, mAP@0.5 and loss value are monitored in real time, and the key changes are as follows: As shown in (a) of Figure 7 , the recognition accuracy curves of different defect types are shown: Group A stabilizes at 0.87 after 150 rounds; Group B (0.82) and Group C (0.79) are next; the neck network embedding group (Group D-F) has the highest precision of 0.71 (Group D), which is significantly lower than the backbone network embedding group; the blank group (Group G) has a precision of only 0.35.
[0124] mAP@0.5 curve: Group A reaches 0.86 after 300 rounds, Group B is 0.81, and Group C is 0.78; the highest of the neck network group is 0.65 (Group D), and the blank group is only 0.29.
[0125] Loss value changes: Group A's classification loss decreases from 1.2 to 0.35, and the regression loss decreases from 2.5 to 0.6, both of which are lower than other groups, indicating that the model converges more optimally.
[0126] In the later training period (400-500 rounds), the fluctuation of each group's indicators is less than 2%, indicating that the model has stabilized and converged, and there is no need to increase the number of iterations.
[0127] (4) Model performance evaluation and comparative analysis As shown in Figure 8 , the accuracy of different defects under different models is shown.
[0128] Dishing: Group A accuracy 0.89, Group G 0.32, improvement 0.57; Cracking: Group A accuracy 0.81, Group G 0.28, improvement 0.53 (cracking is most sensitive to the number of DCNs, reducing 1 module decreases accuracy by 12%); Unfused: Group A accuracy 0.85, Group G 0.36, improvement 0.49; Stomata: Group A accuracy 0.95, Group G 0.41, improvement 0.54 (stomata features are relatively obvious, and the recognition effect is the best); Strip-shaped defects: Group A accuracy 0.83, Group G 0.33, improvement 0.50; Normal weld: Group A accuracy 0.78, Group G 0.30, lift 0.48.
[0129] Evaluation results on the test set show that Group A (backbone network + 3 DCNs) performs best, as detailed in Table 6: Table 6 Model Performance Evaluation
[0130] (5) Model real-time performance and engineering applicability The improved model achieves an inference speed of 28 frames per second (average time per image on the test set is 0.036 seconds), meeting the real-time requirements of industrial inspection (>20 frames per second). In actual pipeline inspection scenarios, the model achieves an 85% accuracy rate in recognizing 100 unknown DR images collected on-site. False positives are mainly concentrated on weld seams in old pipelines with extremely low signal-to-noise ratios (accounting for 15%), and can be further optimized by adding transfer learning to these types of samples.
[0131] In summary, the improved model, which embeds three DCN modules into the YOLOv8 backbone network, exhibits the best performance in terms of accuracy, recall, and generalization ability, providing an efficient and feasible solution for intelligent identification of defects in DR images.
[0132] To better understand the above exemplary embodiments of the present invention, the various steps of the method will be further explained below with reference to specific examples.
[0133] Example 1 This example uses a DR image of a pipe circumferential weld as an example to explain in detail the specific operation process of the intelligent identification method for defects in digital radiographic images of the present invention, and to verify the effectiveness of the method in conventional scenarios.
[0134] (1) Sample parameters and acquisition settings Samples of circumferential welds on X70 pipes were collected using a DL-2000 DR system. The pipes had a diameter of 813 mm and a wall thickness of 17.5 mm. The circumferential welds were produced using gas metal arc welding (GMAW). The samples included the following defect types and quantities: 43 cracks, 120 porosities, 170 lack of fusion, 155 stripes, 140 depressions, and 50 normal welds, for a total of 586 samples (410 for training, 117 for validation, and 59 for testing).
[0135] The original image is in RGB format with a resolution of 2048×2048 pixels, a grayscale value range of 45-205, a Gaussian noise standard deviation of 11.2, a salt-and-pepper noise ratio of 0.9%, and an average image contrast of 32 (difference between grayscale values of defects and background).
[0136] (2) Grayscale processing operation The image was converted to grayscale using a weighted average method with the following weight parameters: red channel 0.299, green channel 0.587, and blue channel 0.114. The processed grayscale image has an average grayscale value of 125 and a standard deviation of 40. The amount of data is reduced by 66% compared to the color image, and the processing time for a single image is 0.2 seconds.
[0137] (3) Adaptive noise reduction implementation Dynamically select the radius based on noise distribution: Salt and pepper region: radius R=1, median filtering is used, and the proportion of salt and pepper noise is reduced to 0.1% after processing, with a grayscale standard deviation of 7.8; Edge region: radius R=2, weighted average filtering (center pixel weight 0.3), PSNR improved to 31.5, SSIM reached 0.63; Gaussian region: half R=3, multi-round iterative filtering (first round Gaussian filtering, second round edge protection filtering), crack edge gray-scale gradient retention rate 86%, PSNR of non-fused region reaches 30.3, SSIM reaches 0.62.
[0138] (4) Adaptive enhancement parameters and effects Enhanced through collaborative Fourier transform, key parameters: Discrete Fourier transform frequency division: low-frequency components account for 60% (background), and high-frequency components account for 40% (defect edges); Similarity matching: 8×8 pixel window, 16-22 similar modules with an error distance ≤ 5 per defect; Filtering parameters: sigma=5, lambda=20, co-Wiener filter coefficient 0.85.
[0139] Enhanced defect indices: Porosity PSNR 46.8, SSIM 0.95; Cracks PSNR 45.6, SSIM 0.88; Lack of fusion PSNR 44.3, SSIM 0.84.
[0140] (5) Improve YOLOv8 model training and recognition Model configuration: The backbone network embeds 3 DCN modules, input size 640×640, batch size 6, number of iterations 500, learning rate 0.01, optimizer Adam; Data augmentation: Mosaic stitching (4 images), random horizontal flipping (probability 0.5), brightness adjustment (±10%). Recognition results: Test set precision 0.87, recall 0.81, mAP@0.5 0.86. Among them, the precision for pore recognition was 0.95, crack recognition was 0.81, and non-fusion recognition was 0.85, which is an improvement of 0.52 compared with the original YOLOv8.
[0141] (6) Verification results Using manual labeling and comparison, 55 out of 59 test samples were correctly identified, with an accuracy rate of 93%; 4 samples were misidentified (2 micro-cracks and 2 strip-shaped defects with blurred edges), with a misjudgment rate of 7%, which meets the requirements of industrial testing.
[0142] Example 2 This example uses DR images of another batch of pipe circumferential welds to verify the adaptability of the method under different welding processes. The sample has more complex defect features (such as dense porosity and thin cracks).
[0143] (1) Sample parameters and acquisition settings Samples of circumferential welds were collected from X80 material pipes with a diameter of 1016 mm and a wall thickness of 22.5 mm. The welding process was submerged arc welding. The defect types and quantities were as follows: 38 cracks, 105 porosities, 152 lack of fusion, 138 stripes, 125 depressions, and 42 normal welds, totaling 590 samples (413 in the training set, 118 in the validation set, and 59 in the test set).
[0144] The original image is 2048×2048 pixels, in RGB format, with a grayscale range of 50-210, a Gaussian noise standard deviation of 13.5, a salt-and-pepper noise ratio of 1.3%, and a grayscale standard deviation of 18.2 in densely poreed areas.
[0145] (2) Grayscale processing operation Using the same weighting formula as Example 1, the processed grayscale image has an average gray level of 128, a standard deviation of 43, and a processing time of 0.2 seconds per image.
[0146] (3) Adaptive noise reduction implementation Dynamic radius adjustment: Salt and pepper noise region: R=1, noise ratio after median filtering is 0.2%, grayscale standard deviation is 8.5; Edge region: R=2, PSNR after weighted filtering 31.2, SSIM 0.61; Gaussian acoustic region: R=3, PSNR of crack region after iterative filtering is 30.1, SSIM is 0.60, and edge gradient retention rate is 84%.
[0147] (4) Adaptive enhancement parameters and effects Parameters were adjusted to adapt to complex defects: sigma=6, lambda=25, and the Wiener filter coefficient was 0.82. Enhanced performance indicators: Porosity PSNR 46.5, SSIM 0.94; Crack PSNR 45.3, SSIM 0.87; Lack of fusion PSNR 44.1, SSIM 0.83.
[0148] (5) Improve YOLOv8 model training and recognition Model configuration: Same as Example 1, but the learning rate is adjusted to 0.009 (to adapt to defect complexity). Data augmentation: Add random scaling (0.7-1.3x) and contrast adjustment (±15%). Recognition results: Test set precision 0.85, recall 0.80, mAP@0.5 0.84. Among them, the precision for recognizing dense pores was 0.93, and for slender cracks it was 0.79, which is an improvement of 0.50 compared to the original YOLOv8.
[0149] (6) Verification results Of the 59 test samples, 53 were correctly identified, with an accuracy rate of 90%; 6 were misidentified (3 microcracks and 3 dense pore edges were missed), with a misjudgment rate of 10%, and the overall results meet the engineering application standards.
[0150] Exemplary Example 6 The digital X-ray image defect intelligent identification method according to the present invention can be programmed into a computer program and the corresponding program code or instructions can be stored in a computer-readable storage medium. When the program code or instructions are executed by a processor, the processor performs the above method. The processor and memory described below can be included in a computer device.
[0151] This exemplary embodiment provides a computer device, including: At least one processor; A memory storing program instructions configured to be executed by the at least one processor, the program instructions including instructions for performing the digital X-ray image defect intelligent recognition method according to any one of exemplary embodiments 1 to 5.
[0152] Exemplary Example 7 This exemplary embodiment provides a computer-readable storage medium.
[0153] The storage medium stores a computer program, and when the computer program instructions are executed by a processor, they implement the intelligent identification method for digital X-ray image defects as described in any one of exemplary embodiments 1 to 5.
[0154] The computer-readable storage medium can be any data storage device that stores data that can be read by a computer system. Examples of computer-readable storage media include: read-only memory, random access memory, read-only optical disc, magnetic tape, floppy disk, optical data storage device, and carrier waves (such as data transmission via the Internet through wired or wireless transmission paths).
[0155] Although the present invention has been described above in conjunction with exemplary embodiments and accompanying drawings, those skilled in the art should understand that various modifications can be made to the above embodiments without departing from the spirit and scope of the claims.
Claims
1. A method for intelligent identification of defects in digital X-ray images, characterized in that, The method includes: S1. Construct a database containing standardized DR images of various types of defects; S2. Perform grayscale processing on the DR images in the database to obtain single-channel grayscale images; S3. Perform adaptive noise reduction processing based on grayscale radius on the single-channel grayscale image to obtain the noise-reduced image; S4. Perform adaptive enhancement processing based on collaborative Fourier transform on the denoised image to improve image quality; S5. Use the improved YOLOv8 model based on DCN to identify the enhanced image.
2. The intelligent defect recognition method for digital X-ray images according to claim 1, characterized in that, Step S1 includes: Images of circumferential welds in oil and gas pipelines are acquired using a DR digital system. Weld defects are classified into 6 categories: cracks, porosity, lack of fusion, strip defects, depressions, and normal welds; Defect areas in images of circumferential welds in oil and gas pipelines are annotated to create standardized annotation files.
3. The intelligent defect recognition method for digital X-ray images according to claim 1, characterized in that, In step S2, the grayscale processing includes converting the color image into a single-channel grayscale image using a weighted average method.
4. The intelligent defect recognition method for digital X-ray images according to claim 1, characterized in that, In step S3, the adaptive noise reduction processing based on grayscale radius includes: S31. Obtain the grayscale value of each pixel in the grayscale image and determine the noise type; S32. Dynamically select the noise reduction radius and match the filtering strategy according to the grayscale noise type of the pixel.
5. The intelligent defect recognition method for digital X-ray images according to claim 4, characterized in that, Step S31 includes: calculating the grayscale standard deviation of each pixel using a 3×3 sliding window, and then using the grayscale standard deviation... δ Determine the type of noise, if δ >50, is considered a salt-and-pepper noise zone. δ If the value is ≤10, it is considered a Gaussian noise region; otherwise, it is considered an edge defect region.
6. The intelligent defect recognition method for digital X-ray images according to claim 5, characterized in that, Step S32 includes: For salt-and-pepper noise regions: Select a small radius. R =1, median filtering is the primary method; For edge defect areas: Select medium radius R =2, using weighted average filtering; For Gaussian noise regions: Choose a large radius. R =3, using multi-round iterative filtering.
7. The intelligent defect recognition method for digital X-ray images according to claim 1, characterized in that, Step S4 includes: S41. Perform a discrete Fourier transform on the denoised grayscale image to decompose the image into low-frequency components and high-frequency components. S42. The image is divided into multiple modules using a sliding window, and modules with similar structures are filtered by error distance; the matching modules are aggregated after orthogonal transformation, and the defect features are enhanced by weighted superposition. S43. Perform collaborative filtering and aggregation on the high-frequency and low-frequency components in the frequency domain decomposed by DFT; wherein, collaborative threshold filtering is applied to the high-frequency components and collaborative Wiener filtering is applied to the low-frequency components. S44. Convert the processed frequency domain components back to the spatial domain image using inverse Fourier transform.
8. The intelligent defect recognition method for digital X-ray images according to claim 1, characterized in that, In step S5, the DCN-based improved YOLOv8 model includes an input layer, a backbone network, a neck network, and a head network, wherein the backbone network embeds several DCN modules.
9. A computer device, characterized in that, include: At least one processor; A memory storing program instructions configured to be executed by the at least one processor, the program instructions including instructions for performing the method according to any one of claims 1-8.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method of any one of claims 1-8.