Automatic positioning method and device for nondestructive testing of digital image defects
By combining multi-scale convolutional branching and channel attention mechanisms, the problems of low efficiency and high misjudgment rate of manual identification in industrial non-destructive testing are solved, achieving high-precision automatic defect localization and multi-scenario adaptability, thus improving detection efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-31
AI Technical Summary
In current industrial nondestructive testing, digital radiographic images rely on manual recognition, which is inefficient and has a high misjudgment rate. Furthermore, existing deep learning methods have weak generalization ability in industrial DR images, resulting in blurred defect edges and significant background interference.
Image features are extracted using a multi-scale convolutional branch structure, weighted by a channel attention mechanism, and a defect probability map is generated through decoding and reconstruction. Threshold segmentation is then performed to achieve automatic defect localization, thus constructing a defect localization mechanism that combines multi-scale perception and attention collaboration.
It significantly improves the accuracy and robustness of defect identification, has high-precision automatic positioning capabilities, reduces artifact interference and the risk of missed detection, adapts to rapid integration in multiple scenarios, and supports a variety of industrial inspection objects.
Smart Images

Figure CN121767294A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial nondestructive testing and intelligent image analysis, specifically a method and device for automatic location of defects in digital images for nondestructive testing, applicable to digital radiographic image evaluation scenarios for key equipment such as castings, welds, and pressure vessels. Background Technology
[0002] In industrial manufacturing and safety assurance processes, digital radiography (DR) technology is widely used for identifying internal defects in high-risk structural components. However, current image assessment still relies heavily on manual identification, which suffers from low efficiency, high false positive rates, and inaccurate defect boundary judgment. With the development of deep learning technology, convolutional neural networks (CNNs) have performed well in image segmentation, but existing methods still suffer from weak generalization ability, blurred defect edges, and significant background interference in industrial DR images.
[0003] Therefore, developing a deep learning method suitable for complex inspection environments and capable of multi-scale feature extraction and precise defect localization has become an urgent need for the development of intelligent industrial inspection. Summary of the Invention
[0004] Purpose of the invention: This invention provides an automatic defect localization method and apparatus for digital images in nondestructive testing, which has high-precision defect localization capability and significantly improves the efficiency and accuracy of industrial nondestructive testing image evaluation.
[0005] Technical solution: An automatic defect localization method for non-destructive testing digital images includes the following steps: Step 1, Image Preprocessing: The original digital ray image is subjected to grayscale normalization, contrast enhancement, and noise suppression to obtain a standardized image; Step 2: Extract multi-scale feature maps from the standardized image to form a fused feature map. By constructing a multi-scale convolutional receptive field through a parallel convolutional branch structure, texture features of different sizes and scales in the image are extracted, enhancing the model's ability to perceive small-sized and complex-shaped defects. Step 3, fusion feature map Attention weighting: The feature maps of different channels are weighted using a channel attention mechanism to enhance the response of defect areas, suppress background noise, and improve localization accuracy; Step 4: Decode and reconstruct the attention-weighted fused feature map to obtain the defect probability map: Use a decoding structure of layer-by-layer upsampling and skip connections to restore the deep features to the original image space size, while fusing shallow detail information to output a continuous and clearly defined defect probability map. Step 5: Perform threshold segmentation on the defect probability map to obtain the bounding rectangle, area, and position coordinates of the defect. Specifically, perform threshold processing on the defect probability map to convert the continuous probability map into a binary mask image, thereby achieving accurate and automatic localization of the defect region.
[0006] Further, step 1 specifically includes: S1.1, grayscale normalization processing, maps the original image pixel values to the [0,1] interval: ,in, This represents the pixel value at the location in the original image. S1.2, Gamma correction enhances contrast, calculated as follows: , ,in, The enhancement coefficient is adjustable and dynamically adjusted based on image features. S1.3, median filtering for noise reduction, using... The filtering window replaces each pixel with the median of its neighborhood, effectively suppressing salt-and-pepper noise while preserving edge features.
[0007] Further, step 2 specifically includes: S2.1, design three parallel convolutional branches to extract local, coarse, and global feature maps, wherein the kernel sizes of the three parallel convolutional branches are respectively... , , ; S2.2, after each convolutional branch, a batch normalization layer is connected to a ReLU activation function to normalize the activation of local, coarse, and global features; S2.3, the standardized activation feature maps output from the three branches are concatenated along the channel dimension to form a fused feature map. : This structure is beneficial for fusing information from different receptive fields to enhance defect detection capabilities.
[0008] Furthermore, step 3 specifically includes the following processes: S3.1, Perform global average pooling on each channel of the fused feature to obtain the channel response vector: Where H is the height of the fused feature image, W is the width of the fused feature image, c is the channel, i corresponds to the pixel row coordinate, and j corresponds to the pixel column coordinate; S3.2, input the channel response vector into a two-layer fully connected network to obtain the channel weighting factor. : ,in, W1 represents the Sigmoid activation function, used to compress the output range to [0,1]. W2 represents the weights of the first fully connected layer. S3.3, multiply the weighting factor by the original channel feature map to achieve channel recalibration: .
[0009] Further, step 4 includes: S4.1, the weighted fused feature map is obtained by using bilinear interpolation. Perform double resampling layer by layer; S4.2, each upsampling stage makes skip connections with the shallow features of the corresponding layer in the encoding stage to improve the quality of spatial information recovery; S4.3, finally passed Convolutional layers map upsampled feature maps to single-channel defect probability maps. ,in .
[0010] Further, step 5 includes: S5.1, Set the defect probability map threshold The single-channel defect probability Figure 2 Value-based generation of mask image:
[0011] S5.2, in the mask image, pixels with a value of 1 represent areas that are judged as defects, and pixels with a value of 0 represent background areas; S5.3 obtains the bounding rectangle, area, and location coordinates of defects through connected component analysis and boundary extraction, which are used for visualization output or device linkage response.
[0012] An automatic defect localization device for non-destructive testing digital images, comprising: The image preprocessing module is used to perform grayscale normalization, contrast enhancement, and noise suppression on the original digital ray image to obtain a standardized image. The multi-scale feature extraction and fusion module is used to extract multi-scale feature maps from a standardized image to form a fused feature map. By constructing a multi-scale convolutional receptive field through a parallel convolutional branch structure, texture features of different sizes and scales in the image are extracted, enhancing the model's ability to perceive small-sized and complex-shaped defects. Attention weighting module is used to weight the fused feature maps. Attention weighting: The feature maps of different channels are weighted using a channel attention mechanism to enhance the response of defect areas, suppress background noise, and improve localization accuracy; The decoding and reconstruction module is used to decode and reconstruct the attention-weighted fused feature map to obtain the defect probability map: it adopts a decoding structure of layer-by-layer upsampling and skip connections to restore the deep features to the original image space size, while fusing shallow detail information to output a continuous and well-defined defect probability map. The threshold segmentation module is used to perform threshold segmentation on the defect probability map to obtain the bounding rectangle, area, and position coordinates of the defect. Specifically, it performs threshold processing on the defect probability map, converts the continuous probability map into a binary mask image, and realizes accurate automatic positioning of the defect region.
[0013] Furthermore, the image preprocessing module is specifically used for: S1.1, grayscale normalization processing, maps the original image pixel values to the [0,1] interval: ,in, This represents the pixel value at the location in the original image. S1.2, Gamma correction enhances contrast, calculated as follows: , ,in, The enhancement coefficient is adjustable and dynamically adjusted based on image features. S1.3, median filtering for noise reduction, using... The filtering window replaces each pixel with the median of its neighborhood, effectively suppressing salt-and-pepper noise while preserving edge features.
[0014] Furthermore, the multi-scale feature extraction and fusion module is specifically used for: S2.1, design three parallel convolutional branches to extract local, coarse, and global feature maps, wherein the kernel sizes of the three parallel convolutional branches are respectively... , , ; S2.2, after each convolutional branch, a batch normalization layer is connected to a ReLU activation function to normalize the activation of local, coarse, and global features; S2.3, the standardized activation feature maps output from the three branches are concatenated along the channel dimension to form a fused feature map. : This structure is beneficial for fusing information from different receptive fields to enhance defect detection capabilities.
[0015] Furthermore, the attention-weighted module is specifically used for: S3.1, Perform global average pooling on each channel of the fused feature to obtain the channel response vector: Where H is the height of the fused feature image, W is the width of the fused feature image, c is the channel, i corresponds to the pixel row coordinate, and j corresponds to the pixel column coordinate.
[0016] S3.2, input the channel response vector into a two-layer fully connected network to obtain the channel weighting factor. : ,in, W1 represents the Sigmoid activation function, used to compress the output range to [0,1]. W2 represents the weights of the first fully connected layer. S3.3, multiply the weighting factor by the original channel feature map to achieve channel recalibration: .
[0017] Beneficial effects: This invention provides an automatic defect localization method and apparatus for non-destructive testing digital images. Compared with existing defect identification methods that mainly rely on manual observation, fixed-window convolution, or traditional image processing algorithms, this invention has the following advantages: A multi-scale perception and attention-based defect localization mechanism is constructed to significantly improve the accuracy and robustness of defect recognition. This invention integrates a multi-scale convolutional structure and a channel attention mechanism. By extracting local texture and global structural information under different receptive fields and introducing a saliency enhancement mechanism, it effectively addresses common challenges in industrial X-ray images such as defect blurring, unclear boundaries, and inconsistent grayscale changes, thereby improving defect detectability in complex backgrounds.
[0018] This invention proposes an end-to-end pixel-level defect heatmap generation method, supporting high-precision automatic localization without manual intervention. Taking images as input, this invention directly generates a defect probability map (heatmap) through a deep network and employs an adaptive threshold strategy to generate a defect mask, achieving high-precision localization capabilities with an average IoU exceeding 0.91. Compared to traditional edge detection or region growing methods, it significantly reduces artifact interference and the risk of missed detections.
[0019] It possesses excellent engineering deployability and edge computing adaptability, supporting rapid integration across multiple scenarios. This invention employs a lightweight model structure design, allowing deployment on GPU servers or edge devices such as Jetson Xavier NX, adapting to the real-time inspection needs of industrial sites. Simultaneously, the system's modular structure is clear, with excellent interface openness, facilitating integration with existing non-destructive testing systems, quality management systems (QMS), or industrial data platforms.
[0020] This invention is widely adaptable to various industrial inspection objects, possessing versatility and scalability. Its effectiveness has been verified in radiographic images of various typical industrial components such as castings, welds, and pressure vessels, supporting the identification of different image resolutions, background noise levels, and various defect types. The method is not dependent on specific image acquisition equipment or target morphology, and can be extended to a wider range of industrial non-destructive testing fields, including composite materials, rail transit parts, and aerospace structural components.
[0021] In summary, this invention effectively improves the accuracy, efficiency, and intelligence of defect localization in nondestructive testing images by introducing a multi-scale attention mechanism, constructing a pixel-level heatmap localization network, optimizing the defect mask generation process, and combining lightweight deployment capabilities with multi-scenario adaptability. It has significant engineering application value and theoretical guiding significance. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating an automatic defect localization method for nondestructive testing of digital images based on a multi-scale attention network, provided as an example of this invention; Figure 2 This is a schematic diagram of the system architecture of an automatic defect localization method for nondestructive testing of digital images based on a multi-scale attention network, provided as an example of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] The features and illustrative embodiments of various aspects of the present invention will now be described in detail. Numerous specific details are set forth in the following detailed description to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention may be practiced without requiring some of these specific details. The following description of embodiments is merely intended to provide a better understanding of the invention by illustrating examples of the invention. The invention is by no means limited to any specific setups and methods set forth below, but covers any improvements, substitutions, and modifications to structures, methods, and devices without departing from the spirit of the invention. Well-known structures and techniques are not shown in the drawings and the following description to avoid unnecessarily obscuring the invention.
[0026] In the description of this invention, it should be noted that the directions or positional relationships indicated by terms such as "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer" are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing and simplifying the invention, and should not be construed as limiting the invention. Furthermore, the use of ordinal numbers (e.g., "first and second," etc.) is for distinguishing objects and is not limited to this order, and should not be construed as indicating or implying relative importance.
[0027] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly, encompassing both direct connection and indirect connection via an intermediate medium. Those skilled in the art can understand the specific meaning of these terms in this invention based on the specific circumstances.
[0028] It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other, and the various embodiments can be referenced and cited in each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0029] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0030] like Figure 1 As shown, this invention provides an automatic defect localization method for digital images in nondestructive testing based on multi-scale attention networks, which is used to locate hidden defects in digital negatives for nondestructive testing, thereby solving the problems of low efficiency and poor accuracy of manual identification of internal defects in products.
[0031] The present invention provides an automatic defect localization method for non-destructive testing digital images, comprising the following steps: Step 1, Image Preprocessing: The original digital ray image is subjected to grayscale normalization, contrast enhancement, and noise suppression to obtain a standardized image; Step 2: Extract multi-scale feature maps from the standardized image to form a fused feature map. By constructing a multi-scale convolutional receptive field through a parallel convolutional branch structure, texture features of different sizes and scales in the image are extracted, enhancing the model's ability to perceive small-sized and complex-shaped defects. Step 3, fusion feature map Attention weighting: The feature maps of different channels are weighted using a channel attention mechanism to enhance the response of defect areas, suppress background noise, and improve localization accuracy; Step 4: Decode and reconstruct the attention-weighted fused feature map to obtain the defect probability map: Use a decoding structure of layer-by-layer upsampling and skip connections to restore the deep features to the original image space size, while fusing shallow detail information to output a continuous and clearly defined defect probability map. Step 5: Perform threshold segmentation on the defect probability map to obtain the bounding rectangle, area, and position coordinates of the defect. Specifically, perform threshold processing on the defect probability map to convert the continuous probability map into a binary mask image, thereby achieving accurate and automatic localization of the defect region.
[0032] Further, step 1 specifically includes: S1.1, grayscale normalization processing, maps the original image pixel values to the [0,1] interval: ,in, This represents the pixel value at the location in the original image. S1.2, Gamma correction enhances contrast, calculated as follows: , ,in, The enhancement coefficient is adjustable and dynamically adjusted based on image features. S1.3, median filtering for noise reduction, using... The filtering window replaces each pixel with the median of its neighborhood, effectively suppressing salt-and-pepper noise while preserving edge features.
[0033] Further, step 2 specifically includes: S2.1, design three parallel convolutional branches to extract local, coarse, and global feature maps, wherein the kernel sizes of the three parallel convolutional branches are respectively... , , ; S2.2, after each convolutional branch, a batch normalization layer is connected to a ReLU activation function to normalize the activation of local, coarse, and global features; S2.3, the standardized activation feature maps output from the three branches are concatenated along the channel dimension to form a fused feature map. : This structure is beneficial for fusing information from different receptive fields to enhance defect detection capabilities.
[0034] Furthermore, step 3 specifically includes the following processes: S3.1, Perform global average pooling on each channel of the fused feature to obtain the channel response vector: Where H is the height of the fused feature image, W is the width of the fused feature image, c is the channel, i corresponds to the pixel row coordinate, and j corresponds to the pixel column coordinate.
[0035] S3.2, input the channel response vector into a two-layer fully connected network to obtain the channel weighting factor. : ,in, W1 represents the Sigmoid activation function, used to compress the output range to [0,1]. W2 represents the weights of the first fully connected layer.
[0036] S3.3, multiply the weighting factor by the original channel feature map to achieve channel recalibration:
[0037] Further, step 4 includes: S4.1, the weighted fused feature map is obtained by using bilinear interpolation. Perform double resampling layer by layer; S4.2, each upsampling stage makes skip connections with the shallow features of the corresponding layer in the encoding stage to improve the quality of spatial information recovery; S4.3, finally passed Convolutional layers map upsampled feature maps to single-channel defect probability maps. ,in .
[0038] Further, step 5 includes: S5.1, Set the defect probability map threshold The single-channel defect probability Figure 2 Value-based generation of mask image:
[0039] S5.2, in the mask image, pixels with a value of 1 represent areas that are judged as defects, and pixels with a value of 0 represent background areas; S5.3 obtains the bounding rectangle, area, and location coordinates of defects through connected component analysis and boundary extraction, which are used for visualization output or device linkage response.
[0040] An automatic defect localization device for non-destructive testing digital images, comprising: The image preprocessing module is used to perform grayscale normalization, contrast enhancement, and noise suppression on the original digital ray image to obtain a standardized image. The multi-scale feature extraction and fusion module is used to extract multi-scale feature maps from a standardized image to form a fused feature map. By constructing a multi-scale convolutional receptive field through a parallel convolutional branch structure, texture features of different sizes and scales in the image are extracted, enhancing the model's ability to perceive small-sized and complex-shaped defects. Attention weighting module is used to weight the fused feature maps. Attention weighting: The feature maps of different channels are weighted using a channel attention mechanism to enhance the response of defect areas, suppress background noise, and improve localization accuracy; The decoding and reconstruction module is used to decode and reconstruct the attention-weighted fused feature map to obtain the defect probability map: it adopts a decoding structure of layer-by-layer upsampling and skip connections to restore the deep features to the original image space size, while fusing shallow detail information to output a continuous and well-defined defect probability map. The threshold segmentation module is used to perform threshold segmentation on the defect probability map to obtain the bounding rectangle, area, and position coordinates of the defect. Specifically, it performs threshold processing on the defect probability map, converts the continuous probability map into a binary mask image, and realizes accurate automatic positioning of the defect region.
[0041] Furthermore, the image preprocessing module is specifically used for: S1.1, grayscale normalization processing, maps the original image pixel values to the [0,1] interval: ,in, This represents the pixel value at the location in the original image. S1.2, Gamma correction enhances contrast, calculated as follows: , ,in, The enhancement coefficient is adjustable and dynamically adjusted based on image features. S1.3, median filtering for noise reduction, using... The filtering window replaces each pixel with the median of its neighborhood, effectively suppressing salt-and-pepper noise while preserving edge features.
[0042] Furthermore, the multi-scale feature extraction and fusion module is specifically used for: S2.1, design three parallel convolutional branches to extract local, coarse, and global feature maps, wherein the kernel sizes of the three parallel convolutional branches are respectively... , , ; S2.2, after each convolutional branch, a batch normalization layer is connected to a ReLU activation function to normalize the activation of local, coarse, and global features; S2.3, the standardized activation feature maps output from the three branches are concatenated along the channel dimension to form a fused feature map. : This structure is beneficial for fusing information from different receptive fields to enhance defect detection capabilities.
[0043] Furthermore, the attention-weighted module is specifically used for: S3.1, Perform global average pooling on each channel of the fused feature to obtain the channel response vector: Where H is the height of the fused feature image, W is the width of the fused feature image, c is the channel, i corresponds to the pixel row coordinate, and j corresponds to the pixel column coordinate.
[0044] S3.2, input the channel response vector into a two-layer fully connected network to obtain the channel weighting factor. : Where S represents the Sigmoid activation function, used to compress the output range to [0,1], W1 is the weight of the first fully connected layer, and W2 is the weight of the first fully connected layer.
[0045] S3.3, multiply the weighting factor by the original channel feature map to achieve channel recalibration: .
[0046] Implementation Cases To further illustrate the technical solution of this invention, an implementation example of an automatic defect localization method for nondestructive testing digital images based on multi-scale attention networks is given below, combined with a practical application scenario. This embodiment is only used to illustrate the technical concept of this invention and does not constitute a limitation on the scope of protection.
[0047] 1. Application Scenarios This implementation plan was deployed in the digital non-destructive testing workshop of an automotive parts manufacturing company, primarily serving the task of identifying defects in key equipment such as aluminum alloy castings, steel welded parts, and titanium alloy structural components using digital radiography (DR) images. In this scenario, image sources encompass static X-ray imaging equipment, dynamic real-time acquisition devices, and industrial DR automatic image interpretation systems, with image resolutions ranging from 1024×1024 to 4096×4096 and grayscale levels of 8-bit or 16-bit.
[0048] In the aforementioned application scenarios, operators need to process hundreds or even thousands of DR images daily. Manual interpretation is not only inefficient and prone to fatigue, but also subject to significant subjective errors. The system described in this invention can be deployed on an image evaluation workstation, edge computing terminal, or quality inspection MES server, achieving data connectivity and automated integration with the enterprise's existing image acquisition, quality traceability, and inspection report systems. This enables an integrated intelligent upgrade of image evaluation, from image acquisition to defect location and classification, and structured output.
[0049] 2. System Composition This system consists of two parts: a hardware support platform and software functional modules.
[0050] Hardware support platform: including industrial image acquisition equipment (such as flat detectors FPD), industrial PCs or GPU servers, display terminals, storage devices and edge computing devices (such as NVIDIA Jetson NX, TX2, etc.), supporting stable operation 24 hours a day.
[0051] Software functional modules: including the following five core sub-modules: Image acquisition and standardization processing module: Implements image reception (supports DICOM, TIFF, PNG and other formats), grayscale normalization, histogram equalization, Gamma transformation enhancement, noise reduction filtering and other operations to improve image contrast and enhance the visibility of minor defects; Candidate defect region extraction module: Based on Sobel edge gradient, Otsu threshold, connected component analysis and morphological filtering, highly suspected defect regions are extracted to form a preliminary localization candidate set, providing target priors for accurate localization by subsequent deep models; Multi-scale defect localization module: adopts an improved UNet network structure. The encoder part introduces parallel 3×3, 5×5, and 7×7 convolutional kernels to achieve multi-scale feature extraction. At the same time, the SE attention mechanism is used to weight the channel dimension features and fuse multi-scale and key region responses. The decoder part improves the spatial detail restoration capability through skip connections and finally outputs a pixel-level defect heatmap. Defect type identification module: After cropping the high-response area of the heat map and performing geometric normalization on the defect sub-image, it is input into a lightweight classification network (such as MobileNetV2) and outputs the predicted category and probability score of 5 typical defects such as porosity, cracks, inclusions, lack of fusion, and thickness fluctuation. The auxiliary image evaluation output module overlays defect masks onto images to display defect locations, numbers, and categories, generating structured JSON / XML output. It supports integration with quality management systems (QMS) and automated inspection process systems, providing report generation interfaces and visualization interfaces.
[0052] 3. Implementation Process and Algorithm Step 1, Image Acquisition and Preprocessing. Acquire a 2048x2048 resolution DR image of the casting, and first perform grayscale normalization: Gamma enhancement was then performed ( To enhance shadow contrast, use Median filtering eliminates teaching and research noise, resulting in a preprocessed image. .
[0053] Step 2: Candidate region extraction. The image is processed using the Sobel operator to calculate the horizontal and vertical gradients. , Generate gradient magnitude map The Otsu adaptive thresholding algorithm is used to generate a binary mask image. Then, opening operations are used to eliminate isolated edges, and closing operations are used to connect fracture boundaries. Finally, a set of suspected defect regions is extracted. ; Step 3, defect localization network inference. Input to Xinlina's good multi-scale convolutional network: using a multi-scale receptive field structure to extract shallow and deep features in parallel; the SE module weights the feature response of each channel. Feature map Decoded into pixel-level defect heatmap .
[0054] Step 4, Defect Mask Generation. Set Threshold. , will heat Figure 2 Value-based The location of defects is visualized.
[0055] Step 5, Defect Classification and Structured Output. Extracting bounding boxes from connected regions and cropping the corresponding regions of the image. The data is fed into a classification network to obtain the predicted category probability. The output includes the defect location (x, y, w, h), category label, and confidence level.
[0056] 4. Result Validation and Performance Evaluation The system was deployed and tested in a real enterprise scenario. The verification data included 1000 DR images from three production workshops (500 castings, 300 welded parts, and 200 composite container images): Defect localization performance: average IoU = 0.911, Dice coefficient = 0.893, recall = 94.2%; Defect classification performance: overall accuracy = 92.7%, with pore recognition F1 = 0.95 and crack recognition F1 = .91; Processing efficiency: average processing latency = 0.84 seconds / image (NVIDIA RTX3060 platform), and latency was controlled within 1.5 seconds in the Jetson NX platform test. After the system was deployed, blind test comparison was conducted by the film evaluation engineers. The results showed that the missed detection rate decreased by 68%, the false detection rate decreased by 42%, the consistency between human and machine film evaluation improved by about 30%, the efficiency of assisted film evaluation increased by more than 70%, and it supports stable operation 24 / 7.
[0057] In summary, this system demonstrates excellent accuracy, robustness, and deployment adaptability in practical industrial applications, and has broad prospects for industrial promotion.
[0058] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for automatic defect positioning in non-destructive testing digital images, characterized in that, Comprising the following steps: Step 1, image preprocessing: the original digital radiographic image is subjected to gray scale normalization, contrast enhancement and noise suppression processing to obtain a standardized image; Step 2, forming a fusion feature map by extracting multi-scale feature maps from the normalized image : A multi-scale convolution receptive field is constructed through a parallel convolution branch structure to extract texture features of different sizes and scales in the image, thereby enhancing the model's perception ability for small size and complex shape defects. Step 3, attention weighting on the fused feature map Attention weighting: using channel attention mechanism to weight the feature maps of different channels, enhance the response of defect area, suppress background noise, and improve positioning accuracy. Step 4, the attention weighted fusion feature map is decoded and reconstructed to obtain a defect probability map: a decoding structure of layer-by-layer upsampling and jump connection is adopted to restore deep features to the original image space size, while fusing shallow detail information, and output a continuous and clear boundary defect probability map; Step 5, threshold segmentation is performed on the defect probability map to obtain the bounding rectangle, area and position coordinates of the defect, specifically: threshold processing is performed on the defect probability map to convert the continuous probability map into a binary mask image, realizing accurate and automatic positioning of the defect area.
2. The method of claim 1, wherein, Step 1, specifically comprising: S1.1, gray scale normalization processing, mapping the pixel value of the original image to the interval [0, 1]: wherein, is the pixel value of the original image at position S1.2, Gamma correction to enhance contrast, calculated as follows: , where, is an adjustable enhancement factor, dynamically adjusted according to image characteristics; S1.3, median filter denoising, using Filter window, replace each pixel with its neighborhood median, effectively suppresses salt and pepper noise and preserves edge features.
3. The method of claim 2, wherein, Step 2, specifically comprising: S2.1, three parallel convolution branches are designed to extract local, coarse and global feature maps, wherein the convolution kernel sizes of the three parallel convolution branches are , , ; S2.2, a batch normalization layer and a ReLU activation function are connected after each convolution branch to standardize and activate local, rough and global features; S2.3, the normalized activation feature maps of the three branch outputs are spliced according to the channel dimension to form a fused feature map : This structure is conducive to fusing information of different receptive fields to enhance the defect detection capability.
4. The method of claim 3, wherein, Step 3, specifically comprising the following processes: S3.
1. Perform global average pooling on each channel of the fusion feature to obtain a channel response vector: where H is the height of the fusion feature image, W is the width of the fusion feature image, c is the channel, i corresponds to the pixel row coordinate, and j corresponds to the pixel column coordinate. S3.2, input the channel response vector into a two-layer fully connected network to obtain the channel weighting factor : wherein, denotes a sigmoid activation function to compress the output range to [0, 1], W1 is the first fully connected layer weight, and W2 is the first fully connected layer weight. S3.3, multiplying the weighting factor with the original channel feature map to realize channel re-labeling: .
5. The method of claim 4, wherein, The step 4 comprises: S4.1, the weighted fusion feature map is obtained by using a bilinear interpolation method 2x upsampling is performed layer by layer; S4.2, each upsampling stage is connected with the shallow features of the corresponding layer in the encoding stage through jump connection to improve the spatial information recovery quality; S4.3, final pass The convolutional layer maps the upsampled feature map to a single-channel defect probability map wherein .
6. The method of claim 5, wherein, The step 5 comprises: S5.1, set defect probability map threshold binarizing the single-channel defect probability map to generate a mask image: S5.2, the pixel points with a value of 1 in the mask image represent the defect area, and the value of 0 represents the background area; S5.3, the bounding rectangle, area and position coordinates of the defect are obtained through connected region analysis and boundary extraction, which are used for visual output or device linkage response.
7. An apparatus for automatic defect location in non-destructive testing of digital images, characterized in that, Comprise: An image preprocessing module is configured to perform gray scale normalization, contrast enhancement and noise suppression processing on the original digital radiographic image to obtain a standardized image; The multi-scale feature extraction fusion module is used for extracting a multi-scale feature map from the standardized image to form a fusion feature map : a multi-scale convolution receptive field is constructed through a parallel convolution branch structure to extract texture features of different sizes and scales in the image, and the perception ability of the model to small sizes and complex shape defects is enhanced. An attention weighting module is configured to perform attention weighting on the fused feature map Attention weighting: using a channel attention mechanism to weight the feature maps of different channels, enhance the response of the defect area, suppress background noise, and improve positioning accuracy; A decoding reconstruction module is configured to decode and reconstruct the attention weighted fusion feature map to obtain a defect probability map: a decoding structure of layer-by-layer upsampling and jump connection is adopted to restore deep features to the original image space size, while fusing shallow detail information, and output a continuous and clear boundary defect probability map; A threshold segmentation module is configured to perform threshold segmentation on the defect probability map to obtain the bounding rectangle, area and position coordinates of the defect, specifically: threshold processing is performed on the defect probability map to convert the continuous probability map into a binary mask image, realizing accurate and automatic positioning of the defect area.
8. The apparatus for automatic positioning of defects in non-destructive testing digital images according to claim 7, characterized in that, The image preprocessing module is specifically configured to: S1.1, gray scale normalization processing, mapping the pixel value of the original image to the interval [0, 1]: wherein, is the pixel value of the original image at position; S1.2, Gamma correction to enhance contrast, calculated as follows: , , is an adjustable enhancement coefficient, dynamically adjusted according to image features; S1.3, median filter denoising, using Filter window, replace each pixel with its neighborhood median, effectively suppresses salt and pepper noise and preserves edge features.
9. The apparatus for automatic positioning of defects in non-destructive testing digital images according to claim 7, characterized in that, The multi-scale feature extraction and fusion module is specifically configured to: S2.1, three parallel convolution branches are designed to extract local, coarse and global feature maps, wherein the convolution kernel sizes of the three parallel convolution branches are , , ; S2.2, a batch normalization layer and a ReLU activation function are connected after each convolution branch to standardize and activate local, rough and global features; S2.3, the normalized activation feature maps of the three branch outputs are spliced according to the channel dimension to form a fused feature map : This structure is conducive to fusing information of different receptive fields to enhance the defect detection capability.
10. The apparatus for automatic positioning of defects in non-destructive testing digital images according to claim 9, characterized in that, The attention weighting module is specifically configured to: S3.
1. Perform global average pooling on each channel of the fusion feature to obtain a channel response vector: where H is the height of the fusion feature image, W is the width of the fusion feature image, c is the channel, i corresponds to the pixel row coordinate, and j corresponds to the pixel column coordinate. S3.2, input the channel response vector into a two-layer fully connected network to obtain the channel weighting factor : where, denotes a sigmoid activation function to compress the output range to [0, 1], W1 is the first fully connected layer weight, and W2 is the first fully connected layer weight. S3.3, multiplying the weighting factor with the original channel feature map to realize channel re-labeling: .
Citation Information
Cited By
X-ray detection method for internal structure defects of structural component
CN122023392A