A method and system for automatically identifying defects in non-destructive testing images of special equipment

By combining anisotropic diffusion filtering and multi-scale image pyramid with SVM classification based on fuzzy morphological contour constraints, the problem of defect identification in complex scenarios in special equipment was solved, and the accurate identification of irregular, multi-scale, and weak-contrast defects was achieved.

CN121033513BActive Publication Date: 2026-07-21INNER MONGOLIA ZHONGAN SPECIAL INSPECTION & TESTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INNER MONGOLIA ZHONGAN SPECIAL INSPECTION & TESTING CO LTD
Filing Date
2025-08-13
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies cannot accurately identify irregular, multi-scale, and weak-contrast defects in complex special equipment inspection scenarios, especially under conditions of V-groove, multi-layer weld structures, and corrosion-perforation defects.

Method used

An anisotropic diffusion filtering mechanism combined with grayscale gradient control and edge protection is used for image enhancement and background suppression. A multi-scale image pyramid is constructed by local threshold adaptive target region localization. SVM classification combined with scale consistency constraints and fuzzy morphological contour constraints is used to achieve defect response extraction and type recognition.

Benefits of technology

It improves the accuracy and robustness of defect identification under complex working conditions, reduces false detections and missed detections, and enhances the identification accuracy of multi-scale, low-contrast defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033513B_ABST
    Figure CN121033513B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of special equipment nondestructive testing image intelligent recognition, and discloses a kind of special equipment nondestructive testing image defect automatic identification method and system, wherein, method includes: based on anisotropic diffusion mechanism is preprocessed;Adopt local self-adaptive threshold method to complete preliminary defect region positioning;Constitute scale consistency constraint multi-scale image pyramid;Defect morphology parameter is constructed;Fusion fuzzy shape constraint and SVM classification mechanism are carried out to defect type identification.Compared with the prior art in which global filtering or fixed threshold segmentation method is mainly relied on, especially under the conditions of V-type groove, multi-layer weld structure and corrosion perforation type defects, the technical problem that accurate identification of irregular, multi-scale and weak contrast defects cannot be realized is solved, since the anisotropic diffusion mechanism is introduced, combined with scale consistency constraint multi-scale response extraction and fusion fuzzy shape modeling classification strategy, the accuracy of special equipment image defect recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent image recognition technology for nondestructive testing of special equipment, and in particular to an automatic defect recognition method and system for nondestructive testing images of special equipment. Background Technology

[0002] Currently, safety assessments of special equipment widely rely on non-destructive testing (NDT) technology, especially imaging inspection methods such as industrial digital radiography, which have become important tools for assessing the weld and structural integrity of critical equipment such as pressure vessels, heat exchangers, and storage tanks. However, traditional image recognition methods typically rely on low-order visual features such as grayscale thresholds, edge detection, or morphological filtering for defect extraction and identification. While these methods are practical for standardized weld structures or high-contrast image scenarios, their adaptability is clearly insufficient when facing complex inspection scenarios in special equipment, such as "V-groove + multi-layer weld structures" or corrosion perforation defects at the bottom of storage tanks. Specifically, images in such complex structural regions have the following significant challenging features: (1) The defect contour structure is highly irregular, with blurred edges and varied shapes; (2) The target scale varies greatly, ranging from micro-perforations to slag inclusions or unwelded defects in multi-layer welds, with a significant span; (3) The image background noise is strong, such as weld texture reflection, welding spatter artifacts, magnetic powder deposition spots, etc., which can cause serious interference and easily lead to false detection or missed detection by traditional filters; (4) Some defects, such as corrosion points, present low gray-scale gradients and have no obvious contours, making it difficult to accurately extract them through classical gradient detection or edge operators.

[0003] Furthermore, existing methods often employ fixed parameters or static structural models, lacking adaptive mechanisms to suit different weld types and equipment structures. This makes it difficult to handle defect scenarios with uncertain structural heights, multiple scales, and multiple types of defects. While deep learning methods have made progress in some areas, the large number of training samples required, especially in the field of high-safety-level special equipment, makes it difficult to obtain real-world defect samples, thus limiting their general applicability.

[0004] Therefore, existing technologies cannot fully meet the needs of accurate automatic defect region extraction, boundary optimization, and type identification under actual industrial inspection conditions characterized by complex structural forms, diverse defect scales, and significant texture interference. There is an urgent need to propose an image recognition method that combines multi-scale visual modeling, structure-guided region of interest localization, and morphological constraint discrimination mechanisms to improve adaptability and robustness to complex working conditions while ensuring recognition accuracy. Summary of the Invention

[0005] To address the aforementioned technical shortcomings, the purpose of this invention is to propose an automatic defect identification method for non-destructive testing images of special equipment. This method aims to solve the technical problem that existing technologies often rely on global filtering or fixed threshold segmentation methods, which are particularly inadequate for accurately identifying irregular, multi-scale, and weak-contrast defects, especially under conditions such as V-groove, multi-layer weld structures, and corrosion-perforated defects.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides an automatic identification method for defects in non-destructive testing images of special equipment.

[0007] The automatic defect identification method for non-destructive testing images of special equipment includes:

[0008] Step S10: Obtain the original inspection image I of the special equipment using industrial digital X-ray imaging. Perform anisotropic diffusion filtering on the original inspection image I based on an anisotropic diffusion filtering mechanism combining a grayscale gradient amplitude control function and an edge protection factor to obtain an enhanced edge-preserving image I′. Perform morphological top-hat operation on the enhanced edge-preserving image I′ to obtain a background-suppressed image I. top ;

[0009] Step S20: Based on the background suppression image I top Perform initial localization processing of the target region ROI with local threshold adaptation, and output a preliminary set of candidate target regions R;

[0010] Step S30: Based on the preliminary candidate target region set R, construct a multi-scale image pyramid using a defect response extraction mechanism with scale consistency constraints, perform defect response extraction processing based on the multi-scale image pyramid, and output the effective defect response region;

[0011] Step S40: Perform defect boundary extraction, boundary optimization, and morphological parameter construction on the effective defect response region to obtain defect morphological parameters; wherein, the defect boundary extraction process specifically includes: constructing an energy function for the effective defect response region that includes boundary smoothness, contour rigidity, and image gradient attraction, performing an edge fitting operation based on an active contour model, and gradually making the contour fit the defect edge during the iterative optimization process;

[0012] Step S50: Based on the effective defect response region and defect morphology parameters, the SVM classification mechanism with fuzzy morphological contour constraints is used to perform defect type identification processing, and the defect identification image result set labeled with defect type is output.

[0013] Preferably, in step S10, the original inspection image I of the special equipment is acquired using industrial digital X-ray imaging. Anisotropic diffusion filtering is then applied to the original inspection image I based on an anisotropic diffusion filtering mechanism combining a grayscale gradient amplitude control function and an edge protection factor to obtain an enhanced edge-preserving image I′. A morphological top-hat operation is then performed on the enhanced edge-preserving image I′ to obtain a background-suppressed image I. top The steps specifically include:

[0014] Step S101: The special equipment's inspection area is imaged using industrial digital X-ray imaging. An exposure parameter set ε = {A, V, θ} is dynamically set based on the structural characteristics of the inspection area, where A represents the X-ray source's exposure current; V represents the exposure voltage; and θ represents the angle between the incident X-ray angle and the normal to the equipment surface. Based on the set exposure parameter set ε, the grayscale contrast and structural edge response of asymmetric regions, including V-groove structures and cross-weld structures, are optimized to obtain the original inspection image I.

[0015] Step S102: Introduce the gray-level gradient amplitude control function and the edge protection factor, construct a diffusion model based on the gray-level gradient amplitude control function and the edge protection factor, perform anisotropic diffusion filtering on the original detection image I based on the diffusion model, and output the enhanced edge-preserving image I′;

[0016] Step S103: Perform structural feature contrast enhancement processing on the enhanced edge-preserving image I′ output in step S102, using a top-hat transform mechanism based on morphological principles to obtain the background-suppressed image I. top The top-hat transformation mechanism is implemented by reconstructing the background by subtracting an opening operation from the original image.

[0017] Preferably, in step S10, the diffusion model constructed uses the following formula: Where t represents the diffusion time step; This represents the local gradient vector of the original detected image I; This represents the gradient magnitude corresponding to the local gradient vector, used to describe the intensity of image edges. Maintain diffusion control factor at the edge; exp(·) is an exponential function, and K is the edge response threshold, which is set to the quantile of the 95% gray-level gradient distribution in the image to prevent weak defect edges from being mistaken for noise and over-smoothed.

[0018] Preferably, in step S20, based on the background suppression image I top The steps for performing initial local threshold adaptive target region (ROI) localization processing and outputting a preliminary candidate target region set R include:

[0019] Background suppression based image Itop For each pixel (x, y), calculate the local average gray value μ(x, y) and local gray standard deviation σ(x, y) within the preset sliding window w, where x is the horizontal coordinate of the pixel and y is the vertical coordinate of the pixel.

[0020] A decision function T(x,y) is constructed based on the local average gray value μ(x,y) and the local gray standard deviation σ(x,y), T(x,y)=μ(x,y)-α·σ(x,y), where α is a scaling factor with a value range of [0.5, 1.2], which is dynamically set according to the gray distribution characteristics of the image background or the signal-to-noise ratio to enhance the response sensitivity of low-contrast defect areas in the image;

[0021] When a pixel in the image has a gray value lower than a certain threshold, it is identified as a candidate defect pixel. The candidate region is extracted using an eight-neighborhood connection region growth method, and area filtering and morphological merging operations are performed on each candidate region to output a preliminary set of candidate target regions R.

[0022] Preferably, step S30, which involves constructing a multi-scale image pyramid based on the preliminary candidate target region set R using a scale consistency constraint-based defect response extraction mechanism, performing defect response extraction processing based on the multi-scale image pyramid, and outputting the effective defect response region, specifically includes:

[0023] Step S301: Based on the preliminary candidate target region set R, crop region sub-images from the original image and construct a multi-scale image pyramid sequence corresponding to the region sub-images; wherein, each layer of the multi-scale image pyramid sequence represents a Gaussian blur map with scale parameters, including standard deviations of 1, 2, 4, and 8, used to simulate the spatial distribution response characteristics of defects of different sizes in the image.

[0024] Step S302: Apply the Laplacian Gaussian edge enhancement operator to each layer of the multi-scale image pyramid sequence to obtain the potential defect contour response at different scales;

[0025] Step S303: For the potential defect contour response at all scales, calculate the maximum response amplitude of each image pixel at all scales and construct the maximum response map;

[0026] Step S304: Apply the connected component analysis method to the maximum response map to extract strong response regions that satisfy the condition that the number of consecutive pixels is greater than the set connectivity threshold η, so as to eliminate isolated false defect response points.

[0027] Step S305: If a candidate region R i If a candidate region R simultaneously satisfies the following conditions: the maximum response amplitude is greater than a preset intensity threshold, and the number of pixels in the corresponding connected region is not less than a connectivity threshold η, then the candidate region R is selected.i If a region is identified as a valid defect response region, it is output to the set of valid defect regions D.

[0028] Preferably, in step S40, the energy function includes three parts: the first part is used to constrain the smoothness of the contour curve to ensure that the boundary lines do not undergo abrupt changes; the second part is used to suppress the sharp bending of the contour curve and maintain the structural rationality of the boundary; the third part is an attraction factor based on the image grayscale changes, used to guide the contour to approach the area with large grayscale changes in the image.

[0029] The boundary optimization process includes the following steps: after the edge fitting operation converges, the response region of each defect is closed based on the fitted boundary, and the final defect contour is output.

[0030] Preferably, in step S40, the defect morphology parameters include the pixel area of ​​the defect region, the perimeter of the defect region boundary, the length of the major and minor axes of the minimum circumscribed ellipse fitted to the defect region, and the average gray value within the defect region; the pixel area of ​​the defect region is used to measure the size of the defect; the perimeter of the defect region boundary is used to measure the edge complexity; the length of the major and minor axes of the minimum circumscribed ellipse fitted to the defect region is used to characterize the shape features of the defect; and the average gray value within the defect region is used to reflect the defect contrast or the depth of corrosion.

[0031] This invention also provides an automatic image defect identification system for non-destructive testing of special equipment, comprising:

[0032] The image acquisition and preprocessing module is used to acquire the original inspection image I of special equipment using industrial digital X-ray imaging. Based on an anisotropic diffusion filtering mechanism combining a gray-level gradient amplitude control function and an edge protection factor, the original inspection image I is anisotropically diffused to obtain an enhanced edge-preserving image I′. A morphological top-hat operation is then performed on the enhanced edge-preserving image I′ to obtain a background-suppressed image I. top ;

[0033] The target region initial localization module is used to determine the target region based on the background suppression image I. top Perform initial localization processing of the target region ROI with local threshold adaptation, and output a preliminary set of candidate target regions R;

[0034] The defect response extraction module is used to construct a multi-scale image pyramid based on the preliminary candidate target region set R using a scale consistency constraint defect response extraction mechanism, perform defect response extraction processing tasks based on the multi-scale image pyramid, and output the effective defect response region.

[0035] The boundary optimization and morphology modeling module is used to perform defect boundary extraction, boundary optimization, and morphology parameter construction on the effective defect response region to obtain defect morphology parameters. The defect boundary extraction process specifically includes: constructing an energy function for the effective defect response region that includes boundary smoothness, contour rigidity, and image gradient attraction; performing an edge fitting operation based on an active contour model; and gradually making the contour fit the defect edge during the iterative optimization process.

[0036] The defect type identification module is used to perform defect type identification processing based on the effective defect response area and defect morphology parameters, and adopts an SVM classification mechanism that integrates fuzzy morphological contour constraints. It outputs a set of defect identification image results labeled with defect type labels.

[0037] The present invention also provides an automatic identification device for defects in non-destructive testing images of special equipment, comprising: a memory, a processor, and an automatic identification program for defects in non-destructive testing images of special equipment stored in the memory and executable on the processor. When the automatic identification program for defects in non-destructive testing images of special equipment is executed by the processor, it implements an automatic identification method for defects in non-destructive testing images of special equipment.

[0038] The present invention also provides a computer program product, including an automatic identification program for defects in non-destructive testing images of special equipment, wherein the automatic identification program for defects in non-destructive testing images of special equipment is executed by a processor to implement the automatic identification method for defects in non-destructive testing images of special equipment.

[0039] The beneficial effects of this invention are as follows: Compared with the existing technology, which relies on global filtering or fixed threshold segmentation methods, especially under the conditions of V-groove, multi-layer weld structure and corrosion perforation defects, it is impossible to accurately identify irregular, multi-scale, and weak contrast defects. This application improves the accuracy of special equipment image defect identification by introducing anisotropic diffusion mechanism, multi-scale response extraction combined with scale consistency constraints, and classification strategy that integrates fuzzy morphology modeling. Attached Figure Description

[0040] 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. Obviously, 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.

[0041] Figure 1 This is a flowchart illustrating the first embodiment of a method for automatic identification of image defects in nondestructive testing of special equipment according to the present invention.

[0042] Figure 2 This is a schematic diagram of the equipment for an automatic image defect identification method for non-destructive testing of special equipment according to the present invention. Detailed Implementation

[0043] 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, and 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.

[0044] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of the method for automatic identification of defects in images of special equipment under nondestructive testing according to the present invention. The first embodiment of the method for automatic identification of defects in images of special equipment under nondestructive testing according to the present invention is presented.

[0045] In the first embodiment, the automatic defect identification method for non-destructive testing images of special equipment includes:

[0046] Step S10: Obtain the original inspection image I of the special equipment using industrial digital X-ray imaging. Perform anisotropic diffusion filtering on the original inspection image I based on an anisotropic diffusion filtering mechanism combining a grayscale gradient amplitude control function and an edge protection factor to obtain an enhanced edge-preserving image I′. Perform morphological top-hat operation on the enhanced edge-preserving image I′ to obtain a background-suppressed image I. top ;

[0047] It should be noted that the "anisotropic diffusion filtering mechanism combining grayscale gradient magnitude adjustment function and edge protection factor" mentioned in this step refers to: based on the traditional Perona-Malik diffusion model, introducing a gradient magnitude adjustment function for adaptively adjusting the diffusion rate (e.g., dynamically adjusting the diffusion intensity based on changes in local pixel gradients), and an adjustment factor for enhancing edge structure protection (e.g., constructing an edge attraction potential term based on the second-order gradient or Laplace response). This mechanism includes, but is not limited to: adaptive diffusion coefficient function, local gradient magnitude evaluation module, edge tendency modulation module, etc., to achieve the removal of background noise while retaining weak but crucial defect edge information. Furthermore, the "morphological top-hat operation" refers to a combined processing of structuring element erosion and dilation operations on the image to highlight bright and small-sized regional differences in the image, often used to extract local protrusions or point-like abnormal regions.

[0048] Understandably, by combining structure-selective diffusion with a local brightness enhancement mechanism, the visual salience of defect edges can be enhanced while significantly reducing background interference, thereby improving the accuracy of subsequent ROI localization and defect identification. This mechanism is particularly suitable for industrial X-ray image processing scenarios with blurred target boundaries and complex background textures, achieving effective enhancement of details in key areas without relying on global grayscale contrast.

[0049] It should be understood that, compared to commonly used uniform processing methods such as Gaussian smoothing, bilateral filtering, or median filtering in existing technologies, the anisotropic diffusion mechanism of this invention can adaptively adjust the diffusion direction and intensity according to local changes in image content, thereby avoiding the problems of edge information loss and excessive smoothing of defect signals common in traditional methods. Especially in the "V-groove + multi-layer weld" structural region, traditional methods cannot effectively distinguish between structural boundaries and defect boundaries, easily causing artifact interference; while this method, by constructing a direction-sensitive diffusion path and boundary approach mechanism, effectively enhances defect contrast and suppresses weld pseudo-textures, improving overall recognition accuracy.

[0050] For example, for a set of radiographic images of multi-layer weld seams of pressure vessels acquired through actual measurements, after processing with the traditional median filtering method, the average gradient amplitude of the defect edge region is about 12.4, and the variance of the background noise region is 28.6. However, after processing with the diffusion mechanism described in this invention, the average gradient of the defect edge is increased to 18.9 (an enhancement of about 52%), and the gray-level variance of the background region is reduced to 17.3 (a reduction of about 39%). The actual defect signal response in the image is clearer, the artifact region suppression is more obvious, and the robustness of defect extraction is effectively improved.

[0051] Step S20: Based on the background suppression image I top Perform initial localization processing of the target region ROI with local threshold adaptation, and output a preliminary set of candidate target regions R;

[0052] It should be noted that the "local threshold adaptive processing" refers to the approach of no longer using a uniform threshold to divide the entire image, but instead dividing the background suppression image into multiple local perceptual regions, and independently performing pixel-level threshold discrimination within each sub-region. The "local perceptual region" can be a sliding window centered on a pixel, or an image patch generated by region growth. Each region dynamically calculates its threshold based on its own grayscale distribution and determines whether there are potential abnormal grayscale spots within that region. This strategy fully considers grayscale shifts and contrast differences caused by variations in structural materials, X-ray energy attenuation, and non-uniform illumination in the image. In contrast, traditional global thresholding methods based on full-image statistics (such as histogram peak values) are difficult to adapt to the image inconsistencies caused by the complex structures of special equipment, often leading to over-binarization of certain regions and the omission of defects.

[0053] Understandably, through this local adaptive mechanism, the image is deconstructed into multiple small regions with local consistency. The threshold for each region is set based on its internal gray-level mean and local contrast. Even when weak contrast defects coexist with strong background interference, it can still adaptively highlight subtle anomalies, avoiding regional missed detections or excessive background interference. Simultaneously, because each local region can respond independently, defects appear as multiple bright spots or abrupt boundary changes with structural aggregation characteristics. This helps construct a stable initial set of Regions of Interest (ROIs), providing the geometric basis for a spatial candidate set for multi-scale defect discrimination.

[0054] It should be understood that this step overcomes two shortcomings of traditional image segmentation methods: first, when the gray-level changes of defects overlap with the background, traditional methods often fail due to insufficient contrast, leading to threshold failure; second, when the gray-level distribution of the image is spatially uneven, the global thresholding strategy can only adapt to some areas, and other areas are prone to misidentification or non-identification. This invention constructs a distribution adaptive mechanism oriented towards gray-level heterogeneity, enabling weak defects with gray levels lower than the background but continuous morphology, even in scenarios such as "V-shaped bevels" and "corrosion deposits," to be effectively perceived and included in the candidate region set R. Furthermore, this method has the advantage of stronger robustness to ambient light disturbances or imaging noise, and can adapt to the typical gray-level fluctuation characteristics of X-ray images in industrial settings.

[0055] For example, taking a magnetic particle inspection image of corrosion on the inner wall of a certain type of storage tank as an example, the image contains multiple perforations with a diameter of less than 3mm, accompanied by magnetic powder residue and surface rust spots. The overall grayscale mean is concentrated in the low value range and the contrast is not obvious. The target area extracted by the traditional global Otsu algorithm on this image is mainly concentrated in the bright edge area, while almost all actual corrosion points are erased as background noise. Through the local adaptive thresholding method of this invention, after dividing the image into 80×80 pixel sub-blocks, each block is modeled independently. The feature values ​​are activated at the weak edge spots and successfully output connected components. After connectivity analysis, a set of ROIs R is formed, which recalls 19 real defect areas, and the false detection rate is controlled within 12%. Compared with the traditional method, this method improves the false negative rate by more than 30% and reduces the false positive rate by about 18%, significantly enhancing its effectiveness and engineering applicability.

[0056] Step S30: Based on the preliminary candidate target region set R, construct a multi-scale image pyramid using a defect response extraction mechanism with scale consistency constraints, perform defect response extraction processing based on the multi-scale image pyramid, and output the effective defect response region;

[0057] It should be noted that the "defect response extraction mechanism with scale consistency constraints" in this step refers to: using the initial candidate target region set R as the seed region, constructing a multi-level image pyramid based on the image spatial resolution, with each layer corresponding to a spatial scaling scale (e.g., original scale, 0.75x, 0.5x, etc.). At each scale, using feature mappings based on texture gradient response, edge abrupt response, and local contrast anomaly, potential defect regions are extracted. After extraction, by performing regional spatial remapping (scale normalization) across different scales and constructing a scale response consistency scoring function, the stability and significance of the response across scales at the same location are analyzed. Finally, target regions with high response intensity and consistent cross-scale structure are selected as effective defect response regions, and the output is used as input for subsequent boundary fitting.

[0058] Understandably, by introducing scale consistency constraints, defects at different sizes in an image can be uniformly identified, which is particularly suitable for pitting defects with large size differences, defects with blurred structural boundaries, and overlapping images of multiple layers at weld seams. Because the response extraction mechanism possesses hierarchical and feature fusion capabilities, it not only improves the sensitivity of weak target recognition but also suppresses spurious response regions caused by texture repetition or illumination variations. The final output effective response region considers both local texture anomalies and scale structural continuity, thereby enhancing the reliability of subsequent defect contour analysis and classification.

[0059] It should be understood that, compared to traditional defect recognition methods that perform edge detection or feature segmentation only at a single resolution, this invention constructs a multi-scale image pyramid and combines local saliency enhancement and scale stability scoring strategies to achieve fusion decision-making for defect responses at different spatial scales. Especially in industrial images where "structures vary in size" and "the size of the same type of defect changes drastically," traditional solutions often only achieve good results at a single scale, with recognition breaks or missegmentation occurring at other scales. However, the feature discrimination method guided by scale consistency constraints in this invention can accurately track structural changes of the same target at different resolution layers, thereby improving the completeness and accuracy of the defect response.

[0060] For example, consider an image of multiple defects appearing in the weld area of ​​a special pressure vessel. The image includes large areas of layered incomplete fusion, pores approximately 4 mm in size, and multiple perforations less than 2 mm in size. If edge detection methods (such as Canny) are used for extraction at a single scale, only the layered incomplete fusion area can be detected; the responses to small pores and perforations are not significant, resulting in a false negative rate exceeding 38%. Using the method of this invention, response features are extracted at three scales, followed by normalization mapping and consistency scoring. Only areas with scores greater than a set threshold (e.g., 0.8) are retained as valid response areas. Ultimately, over 90% of the defect targets can be captured completely, with a false positive rate controlled below 12%. Comparative analysis shows that this method significantly outperforms traditional single-scale threshold discrimination methods in handling high-density, weakly defective areas.

[0061] Step S40: Perform defect boundary extraction, boundary optimization, and morphological parameter construction on the effective defect response region to obtain defect morphological parameters; wherein, the defect boundary extraction process specifically includes: constructing an energy function for the effective defect response region that includes boundary smoothness, contour rigidity, and image gradient attraction, performing an edge fitting operation based on an active contour model, and gradually making the contour fit the defect edge during the iterative optimization process;

[0062] It should be noted that the "energy function" described in this step is constructed based on the activity of the deformable contour line, and is used to find the target boundary in the image domain by minimizing the total energy. This energy function consists of three terms: the first term is the boundary smoothness term, used to suppress drastic contour deformation and ensure continuous smoothness; the second term is the contour rigidity term, representing the inherent structural tension of the contour to prevent distortion at non-real defect edges; the third term is the image gradient attraction term, whose value is set according to the image gradient magnitude at the current contour point position, used to attract the contour towards high gradient regions (i.e., image edges). In special equipment weld seam images, the image gradient attraction term is often designed as a local gray-level difference weighted function to enhance the attraction ability for blurred or partially occluded edges.

[0063] Understandably, through this energy function-driven active contour evolution process, the system can automatically iterate and generate a fitting curve that more closely resembles the actual defect boundary based on the coarse localization of the initial defect response region's contour. This method fully utilizes anisotropic gradient information and geometric continuity constraints in the image, enabling it to approximate the true defect shape contour even in scenes with blurred edges and weak contrast. This provides an accurate structural basis for subsequent extraction of defect morphological features (such as area, aspect ratio, curvature, concavity / convexity, etc.).

[0064] It should be understood that while traditional edge extraction methods such as Sobel and Canny perform reasonably well on high-contrast boundaries, they cannot construct complete, closed, and smooth boundary contours. This is especially true when the defect edge's grayscale value is close to the background grayscale value or when texture interference exists, easily leading to edge breaks, gaps, or contour jumps. In contrast, this invention introduces an active contour method based on a physically heuristic deformation model. This method not only guides the contour to fit the real boundary based on image grayscale, but also effectively suppresses overfitting and misfitting through built-in smoothing and rigidity terms, significantly improving the structural integrity and coherence of the boundary. It is particularly suitable for defect envelope extraction tasks in "V-shaped weld" regions with multiple structural interference backgrounds.

[0065] For example, taking a digital ray image containing a composite defect of "multi-layer weld seam + slag inclusion + porosity" as an example, the traditional Canny algorithm detects a large number of fracture edge points at the defect boundary, failing to form an effective closed region. Subsequent morphological parameter extraction suffers from serious underestimation of area and shape distortion. However, using the active contour energy function model of this invention, starting from the initially extracted defect response region, after constructing an initial contour, 20 rounds of energy minimization iterations are performed. The final output boundary closure is improved to over 97%, and the Dice coefficient between the contour and the manually labeled result reaches 0.88, far higher than the 0.62 of the traditional algorithm. Moreover, the morphological feature statistical error is within 5%, proving that this method has higher robustness and accuracy under multiple disturbances and highly complex structures.

[0066] Step S50: Based on the effective defect response region and defect morphology parameters, the SVM classification mechanism with fuzzy morphological contour constraints is used to perform defect type identification processing, and the defect identification image result set labeled with defect type is output.

[0067] It should be noted that the "SVM classification mechanism integrating fuzzy morphological contour constraints" refers to introducing morphological feature parameters derived from the defect boundary modeling results in step S40 into the traditional Support Vector Machine (SVM) classification framework. These parameters include contour compactness, edge curvature distribution, and irregularity. A fuzzy membership function is then constructed to hierarchically fuzzily classify these features, thus tolerating the influence of uncertainties such as boundary ambiguity and morphological transition zones on the recognition results. Furthermore, this mechanism constructs a multi-dimensional SVM classifier with a fuzzy kernel function, jointly considering multi-modal features such as grayscale texture, regional contrast, and boundary morphology to achieve multi-category discrimination of defect types (such as porosity, slag inclusions, incomplete penetration, and corrosion perforation).

[0068] Understandably, by introducing fuzzy morphological contour constraints, this step effectively improves the robustness and interpretability of defect type discrimination. Traditional SVM classification often suffers from decreased accuracy when faced with excessive fuzziness between categories, insufficient training samples, or drastic boundary changes. This method, by fuzzy modeling defect morphological information, not only compensates for inter-class differences that are difficult to distinguish between grayscale textures but also reduces the interference of boundary anomalies on the classification model. This allows the system to maintain high recognition accuracy and stability even in scenes with weak textures, complex backgrounds, or blurred target edges.

[0069] It should be understood that traditional classification methods based on grayscale texture or local statistics face two major problems in non-destructive testing images of special equipment: first, different defect types may have extremely similar local grayscale distributions (such as incomplete penetration and slag inclusion); second, blurring, noise, and artifacts often occur during image acquisition, leading to a non-ideal distribution of training samples. This invention solves these problems by integrating fuzzy contour representation based on morphological models with a classification constraint mechanism, enabling the model to flexibly adjust its boundary representation while retaining the superiority of SVM in small-sample classification. In contrast, conventional machine learning methods often cannot distinguish defect categories with highly irregular contours but similar grayscale features, resulting in significantly insufficient recognition accuracy in industrial applications.

[0070] For example, using a set of X-ray images from the weld area of ​​a high-pressure vessel as test samples, including typical defects such as porosity, slag inclusions, and incomplete penetration, the average recognition accuracy was 79.2% under the traditional grayscale and texture SVM classification framework, with a confusion rate of over 23% between porosity and slag inclusions. After adopting the SVM classification mechanism of this invention, which incorporates fuzzy morphological contour constraints, the accuracy improved to 91.8%, with a porosity recognition rate of 94.6% and a slag inclusion recognition rate of 89.2%, significantly outperforming traditional methods. In another set of magnetic particle image tests containing corrosion perforation defects, the model demonstrated good recognition ability for defects with highly irregular boundaries and weak contrast, indicating that the proposed fusion mechanism has strong versatility and adaptability in practical engineering scenarios.

[0071] Example 2: Furthermore, the present invention provides an automatic image defect identification system for non-destructive testing of special equipment, employing an automatic image defect identification method for non-destructive testing of special equipment as described in the above embodiments, which can solve the technical problem of automatic image defect identification for non-destructive testing of special equipment. Compared with the prior art, the beneficial effects of the automatic image defect identification system for non-destructive testing of special equipment provided by the present invention are the same as those of the automatic image defect identification method for non-destructive testing of special equipment provided in the above embodiments, and other technical features of the automatic image defect identification system for non-destructive testing of special equipment are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0072] Example 3: This invention provides an automatic image defect identification device for non-destructive testing of special equipment. Please refer to... Figure 2 An automatic image defect identification device for non-destructive testing of special equipment includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the automatic image defect identification method for non-destructive testing of special equipment as described in Embodiment 1 above. The automatic image defect identification device for non-destructive testing of special equipment in this embodiment of the invention may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), vehicle terminals (e.g., vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. This automatic image defect identification device for non-destructive testing of special equipment is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the invention. An automatic image defect identification device for non-destructive testing of special equipment may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the automatic image defect identification device for non-destructive testing of special equipment. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An I / O interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows a special equipment non-destructive testing image defect automatic identification device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows a special equipment non-destructive testing image defect automatic identification device with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0073] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method for automatic identification of defects in non-destructive testing images of special equipment. The computer program product provided by this invention can solve the technical problem of automatic identification of defects in non-destructive testing images of special equipment. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the method for automatic identification of defects in non-destructive testing images of special equipment provided in the above embodiments, and will not be repeated here.

[0074] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this invention.

[0075] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0076] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for automatic identification of defects in non-destructive testing images of special equipment, characterized in that, The methods include: Step S10: Obtain the original inspection image I of the special equipment using industrial digital ray imaging. Perform anisotropic diffusion filtering on the original inspection image I based on an anisotropic diffusion filtering mechanism combining a grayscale gradient amplitude control function and an edge protection factor to obtain an enhanced edge-preserving image I'. Perform morphological top-hat operation on the enhanced edge-preserving image I' to obtain a background-suppressed image. ; Step S20: Based on the background suppression image Perform initial localization processing of the target region ROI with local threshold adaptation, and output a preliminary set of candidate target regions R; Step S30: Construct a multi-scale image pyramid based on the preliminary candidate target region set R using a scale consistency constraint defect response extraction mechanism, perform defect response extraction processing based on the multi-scale image pyramid, and output the effective defect response region; wherein, the step of constructing a multi-scale image pyramid based on the preliminary candidate target region set R using a scale consistency constraint defect response extraction mechanism, performing defect response extraction processing based on the multi-scale image pyramid, and outputting the effective defect response region specifically includes: Based on the preliminary candidate target region set R, region sub-images are cropped from the original image, and a multi-scale image pyramid sequence corresponding to the region sub-images is constructed. Each layer of the multi-scale image pyramid sequence represents a Gaussian blur map with scale parameters, including standard deviations of 1, 2, 4, and 8, which is used to simulate the spatial distribution response characteristics of defects of different sizes in the image. The Laplacian Gaussian edge enhancement operator is applied to each layer of the multi-scale image pyramid sequence to obtain the contour response of potential defects at different scales. For the potential defect contour response at all scales, calculate the maximum response amplitude of each image pixel at all scales and construct the maximum response map; The connected component analysis method is applied to the maximum response map to extract strong response regions that satisfy the condition that the number of consecutive pixels is greater than the set connectivity threshold η, so as to eliminate isolated false defect response points. If a candidate region If a candidate region simultaneously satisfies the following conditions: the maximum response amplitude is greater than a preset intensity threshold, and the number of pixels in the corresponding connected region is not less than a connectivity threshold η, then the candidate region is selected. If a region is identified as a valid defect response region, it is output to the set of valid defect regions D. Step S40: Perform defect boundary extraction, boundary optimization, and morphological parameter construction on the effective defect response region to obtain defect morphological parameters; wherein, the defect boundary extraction process specifically includes: constructing an energy function for the effective defect response region that includes boundary smoothness, contour rigidity, and image gradient attraction, performing an edge fitting operation based on an active contour model, and gradually making the contour fit the defect edge during the iterative optimization process; Step S50: Based on the effective defect response region and defect morphology parameters, the defect type identification process is performed using the SVM classification mechanism that integrates fuzzy morphological contour constraints, and the defect identification image result set labeled with defect type is output; wherein, the SVM classification mechanism that integrates fuzzy morphological contour constraints refers to: introducing the defect morphology parameters from step S40 into the traditional support vector machine classification framework, and constructing fuzzy membership functions to perform hierarchical fuzzy classification of the defect morphology parameters.

2. The method for automatic identification of image defects in nondestructive testing of special equipment as described in claim 1, characterized in that, In step S10, the original inspection image I of the special equipment is acquired using industrial digital X-ray imaging. Anisotropic diffusion filtering is then applied to the original inspection image I based on an anisotropic diffusion filtering mechanism that combines a grayscale gradient amplitude control function with an edge protection factor, resulting in an enhanced edge-preserving image I'. A morphological top-hat operation is then performed on the enhanced edge-preserving image I' to obtain a background-suppressed image. The steps specifically include: Step S101: The area to be inspected of the special equipment is acquired using industrial digital X-ray imaging, and the exposure parameter set is dynamically set according to the structural characteristics of the area to be inspected. ,in, This represents the exposure current of the X-ray source; Indicates the exposure voltage; Indicates the angle between the incident angle of the ray and the normal to the surface of the equipment; based on the set exposure parameters. Optimize the grayscale contrast and structural edge response of asymmetric regions, including V-groove structures and cross weld structures, to obtain the original detection image I; Step S102: Introduce the gray-level gradient amplitude control function and the edge protection factor, construct a diffusion model based on the gray-level gradient amplitude control function and the edge protection factor, perform anisotropic diffusion filtering on the original detection image I based on the diffusion model, and output the enhanced edge-preserving image I'. Step S103: Perform structural feature contrast enhancement processing on the enhanced edge-preserving image I' output in step S102, using a top-hat transform mechanism based on morphological principles to obtain a background-suppressed image. The top-hat transformation mechanism is implemented by reconstructing the background by subtracting an opening operation from the original image.

3. The method for automatic identification of image defects in nondestructive testing of special equipment as described in claim 2, characterized in that, In step S10, the diffusion model constructed uses the following formula: ,in, Indicates the diffusion time step; This represents the local gradient vector of the original detected image I; This represents the gradient magnitude corresponding to the local gradient vector, used to describe the intensity of image edges. Maintain diffusion control factor at the edge; , It is an exponential function. The edge response threshold is set to the quantile of the 95% grayscale gradient distribution in the image, which is used to prevent weak defect edges from being mistaken for noise and thus over-smoothed.

4. The method for automatic identification of image defects in nondestructive testing of special equipment as described in claim 1, characterized in that, In step S40, the energy function includes three parts. The first part is used to constrain the smoothness of the contour curve to ensure that the boundary lines do not change abruptly. The second part is used to suppress the sharp bending of the contour curve and maintain the structural rationality of the boundary. The third part is an attraction factor based on the gray-level changes in the image, which is used to guide the contour to approach the area with large gray-level changes in the image. The boundary optimization process includes the following steps: after the edge fitting operation converges, the response region of each defect is closed based on the fitted boundary, and the final defect contour is output.

5. The method for automatic identification of image defects in nondestructive testing of special equipment as described in claim 1, characterized in that, In step S40, the defect morphology parameters include the pixel area of ​​the defect region, the perimeter of the defect region boundary, the length of the major and minor axes of the minimum circumscribed ellipse fitted to the defect region, and the average gray value within the defect region; the pixel area of ​​the defect region is used to measure the size of the defect; the perimeter of the defect region boundary is used to measure the edge complexity; and the length of the major and minor axes of the minimum circumscribed ellipse fitted to the defect region is used to characterize the shape features of the defect. The average gray value within the defect area is used to reflect the defect contrast or the depth of corrosion.

6. An automatic image defect identification system for non-destructive testing of special equipment, applied to the automatic image defect identification method for non-destructive testing of special equipment as described in any one of claims 1 to 5, characterized in that, The special equipment non-destructive testing image defect automatic identification system includes: The image acquisition and preprocessing module is used to acquire the original inspection image I of special equipment using industrial digital X-ray imaging. Based on an anisotropic diffusion filtering mechanism combining a gray-level gradient amplitude control function and an edge protection factor, the original inspection image I is anisotropically diffused to obtain an enhanced edge-preserving image I'. A morphological top-hat operation is then performed on the enhanced edge-preserving image I' to obtain a background-suppressed image. ; The target region initial localization module is used to determine the target region based on the background suppression image. Perform initial localization processing of the target region ROI with local threshold adaptation, and output a preliminary set of candidate target regions R; The defect response extraction module is used to construct a multi-scale image pyramid based on a scale-consistency constraint-based defect response extraction mechanism using a preliminary candidate target region set R, perform defect response extraction processing based on the multi-scale image pyramid, and output effective defect response regions. Specifically, the steps of constructing the multi-scale image pyramid based on the scale-consistency constraint-based defect response extraction mechanism using a preliminary candidate target region set R, and performing defect response extraction processing based on the multi-scale image pyramid to output effective defect response regions include: Based on the preliminary candidate target region set R, region sub-images are cropped from the original image, and a multi-scale image pyramid sequence corresponding to the region sub-images is constructed. Each layer of the multi-scale image pyramid sequence represents a Gaussian blur map with scale parameters, including standard deviations of 1, 2, 4, and 8, which is used to simulate the spatial distribution response characteristics of defects of different sizes in the image. The Laplacian Gaussian edge enhancement operator is applied to each layer of the multi-scale image pyramid sequence to obtain the contour response of potential defects at different scales. For the potential defect contour response at all scales, calculate the maximum response amplitude of each image pixel at all scales and construct the maximum response map; The connected component analysis method is applied to the maximum response map to extract strong response regions that satisfy the condition that the number of consecutive pixels is greater than the set connectivity threshold η, so as to eliminate isolated false defect response points. If a candidate region If a candidate region simultaneously satisfies the following conditions: the maximum response amplitude is greater than a preset intensity threshold, and the number of pixels in the corresponding connected region is not less than a connectivity threshold η, then the candidate region is selected. If a region is identified as a valid defect response region, it is output to the set of valid defect regions D. The boundary optimization and morphology modeling module is used to perform defect boundary extraction, boundary optimization, and morphology parameter construction on the effective defect response region to obtain defect morphology parameters. The defect boundary extraction process specifically includes: constructing an energy function for the effective defect response region that includes boundary smoothness, contour rigidity, and image gradient attraction; performing an edge fitting operation based on an active contour model; and gradually making the contour fit the defect edge during the iterative optimization process. The defect type identification module is used to perform defect type identification processing based on the effective defect response area and defect morphology parameters, and to output a set of defect identification image results labeled with defect type. The SVM classification mechanism that integrates fuzzy morphology parameters refers to introducing the defect morphology parameters from step S40 into the traditional support vector machine classification framework, and constructing fuzzy membership functions to perform hierarchical fuzzy classification of the defect morphology parameters.

7. An automatic image defect identification device for non-destructive testing of special equipment, characterized in that, The special equipment nondestructive testing image defect automatic identification device includes: a memory, a processor, and a special equipment nondestructive testing image defect automatic identification program stored in the memory and executable on the processor. When the special equipment nondestructive testing image defect automatic identification program is executed by the processor, it implements the special equipment nondestructive testing image defect automatic identification method according to any one of claims 1 to 5.

8. A computer program product, characterized in that, The computer program product includes an automatic identification program for defects in non-destructive testing images of special equipment. When the automatic identification program for defects in non-destructive testing images of special equipment is executed by a processor, it implements an automatic identification method for defects in non-destructive testing images of special equipment as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Aluminum magnesium alloy casting internal defect image recognition method based on machine vision

    CN109859160A

  • Building facade defect intelligent detection method

    CN119887763A