Pipeline butt weld phased array atlas automatic evaluation method and system
By combining hyperbolic wavefront reconstruction algorithm and multi-scale edge detection technology, the problems of noise suppression and defect identification accuracy in phased array ultrasonic testing have been solved. This has addressed existing technical issues, achieved technical breakthroughs in phased array imaging, and improved the accuracy and efficiency of pipeline butt weld inspection.
Patent Information
- Application Number
- CN202511275870.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2026-01-06
AI Technical Summary
Existing phased array ultrasonic testing technology suffers from severe noise interference, low accuracy in defect identification, and limited precision in positioning and dimensional measurement in pipe butt welds. In particular, it is difficult to effectively distinguish defect echo signals from background noise in complex weld backgrounds, leading to inaccurate evaluation results.
The hyperbolic wavefront reconstruction algorithm is used for spatial focusing correction and gradient feature partitioning. Combined with multi-scale edge detection, adaptive filtering and wavelet packet decomposition, the feature combination is optimized by genetic algorithm, and the spectral clustering method is used for defect classification and three-dimensional localization to generate clear defect feature parameters.
It enables precise correction and partitioning of phased array spectra, improving the accuracy and reliability of defect detection, reducing reliance on the professional skills of inspection personnel, and enhancing the consistency and efficiency of weld quality assessment.
Smart Images

Figure CN121275908A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nondestructive testing technology, and in particular to an automatic evaluation method and system for phase array spectra of pipe butt welds. Background Technology
[0002] Pipeline butt welds are critical connection points in industrial pipeline systems, and their quality directly affects the safe operation of the pipeline system. Phased array ultrasonic testing technology, as an advanced non-destructive testing method, is widely used in pipeline weld inspection. This technology utilizes an array of multiple ultrasonic transducers, and through electronic control of the transmission and reception timing of each transducer, it achieves omnidirectional scanning of the inspection area, enabling the acquisition of rich defect information.
[0003] Traditional phased array ultrasonic testing of pipe butt welds relies heavily on manual experience for image interpretation and defect assessment. Inspectors observe echo characteristics in the phased array ultrasonic images and, based on experience, determine the type, location, and size of defects. However, due to the complex weld structure, multiple reflections and scattering of ultrasonic waves during propagation, and interference from various noise sources, accurate interpretation of the information in the phased array images is difficult. Furthermore, the raw data output by phased array ultrasonic testing equipment is enormous, containing a large amount of A-mode waveform data, which requires processing to generate visualized inspection images.
[0004] Existing phased array imagery assessment techniques suffer from the following shortcomings: The lack of effective image enhancement methods leads to severe noise interference against complex weld backgrounds, making it difficult to effectively distinguish defect echo signals from background noise, particularly resulting in low detection rates for small-sized and weak-echo defects. Existing defect feature extraction methods are relatively simple, relying mainly on fixed feature parameters and failing to fully utilize the signal's characteristic information across different frequency bands, leading to low accuracy in defect type identification, especially prone to misjudgment when multiple defect types coexist. Furthermore, existing technologies have limited accuracy in defect location and size measurement. The failure to effectively correct for variations in the propagation path and velocity of ultrasonic waves within the material results in significant measurement errors between the three-dimensional position coordinates and actual dimensions of the defects, affecting the reliability of the assessment results. Summary of the Invention
[0005] This invention provides an automatic evaluation method and system for phased array patterns of pipe butt welds, which can solve the problems in the prior art.
[0006] A first aspect of the present invention provides a method for automatic evaluation of phase array spectra of pipe butt welds, comprising: A-type waveform data is extracted from the raw phased array ultrasonic testing data of the butt weld of the pipeline to be evaluated and the data is recombined to generate a three-dimensional data matrix. The three-dimensional data matrix is then sliced along the beam angle and weld depth to generate a phased array spectrum. The phased array spectrum is spatially focused and corrected using a hyperbolic wavefront reconstruction algorithm. The spatial gradient features of the corrected spectrum are calculated, and the phased array spectrum is divided into a first gradient region and a second gradient region based on the spatial gradient features. Noise suppression is performed in the first gradient region using morphological reconstruction filtering, and enhancement is performed in the second gradient region using adaptive median filtering. The defect boundaries are extracted from the processed phased array spectrum using a multi-scale edge detection algorithm to generate a binary contour image. Defect feature parameters are calculated based on the binary contour image. Wavelet packet decomposition is performed on the defect feature parameters to obtain subspaces of multiple frequency bands. The information entropy value and energy density ratio are calculated in each subspace. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. These feature subspaces are then input into a genetic algorithm to iteratively optimize feature combinations. Based on the optimized feature combinations, a defect feature vector is constructed. The defect feature vector is then clustered using a spectral clustering method to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the acoustic beam pattern.
[0007] The phased array spectrum is spatially focused and corrected using a hyperbolic wavefront reconstruction algorithm. The spatial gradient characteristics of the corrected spectrum are calculated, and based on these characteristics, the phased array spectrum is divided into a first gradient region and a second gradient region. Noise suppression is performed in the first gradient region using morphological reconstruction filtering, and enhancement processing is applied in the second gradient region using adaptive median filtering. Calculate the time delay of each array element in the phased array probe emitting sound waves to any point in the weld and then returning to the receiving array element. Weight the original signals received by each array element to obtain a weighted signal. Based on the time delay, transfer and superimpose the weighted signal in the time domain to obtain the corrected phased array spectrum. The first-order difference values in the horizontal and vertical directions of the corrected phased array spectrum are calculated and the sum of squares and square roots are performed to obtain the spatial gradient features. Based on the gray-level histogram distribution of the spatial gradient features, the optimal segmentation threshold is determined. Regions in the corrected phased array spectrum with spatial gradient features greater than the optimal segmentation threshold are divided into the first gradient region, and regions in the corrected phased array spectrum with spatial gradient features less than or equal to the optimal segmentation threshold are divided into the second gradient region. The labeled image is obtained by subtracting a preset brightness adjustment value from the image gray value in the first gradient region. The original image in the first gradient region is used as a mask image. The labeled image is iteratively dilated and the gray value is limited by the mask image until the difference between the gray values of the corresponding pixels in the current iteration image and the previous iteration image is less than a preset reconstruction threshold. The local gray variance of the preset sliding window in the second gradient region is calculated. The gain adjustment coefficient is determined according to the ratio of the local gray variance to the reference variance. The gain adjustment coefficient is multiplied by the residual of the median filtering result and then superimposed on the original image.
[0008] The processed phased array image is used to extract defect boundaries using a multi-scale edge detection algorithm to generate a binarized contour image. Defect feature parameters are then calculated based on the binarized contour image, including: The processed phased array spectrum is convolved with Gaussian-Laplacian operators with different scale parameters to obtain edge response image sequences. Non-maximum suppression is performed on the edge response image sequences and adaptive weighted fusion is based on local gray-level variance to obtain fused edge images. Boundary tracking is performed on the fused edge image to extract a continuous sequence of defect boundary coordinates. Disconnected boundary coordinate points are connected using a distance constraint criterion to obtain the defect boundary. The defect boundary is binarized, with boundary pixels set as foreground and the remaining pixels set as background, to obtain a binarized contour image. The binarized contour image is mapped to the phased array spectrum in feature space. A gray-shape joint feature matrix of the defect region is constructed in the mapped space, and polar coordinate transformation is performed along the defect boundary to obtain the defect boundary feature curve. The morphological parameters and Fourier harmonic coefficients of the defect boundary feature curve are calculated. The radial gray-level distribution features and angular gray-level distribution features of the defect region are calculated based on the polar coordinate transformation. The morphological parameters, Fourier harmonic coefficients, radial gray-level distribution features, and angular gray-level distribution features are fused through adaptive weights to generate defect feature parameters.
[0009] The binarized contour image is mapped to the phased array spectrum in a feature space. A gray-shape joint feature matrix of the defect region is constructed in the mapped space, and a polar coordinate transformation is performed along the defect boundary to obtain the defect boundary feature curve. The morphological parameters and Fourier harmonic coefficients of the defect boundary feature curve are calculated. The radial and angular gray-level distribution features of the defect region are calculated based on the polar coordinate transformation, including: The feature map image is obtained by overlaying the binarized contour image with the phased array map; Calculate the gray-level gradient and edge curvature of the defect region in the feature mapping image, and then perform weighted fusion of the gray-level gradient and edge curvature in the local neighborhood to generate a gray-level-shape joint feature matrix. Determine the centroid position of the defect region, establish a polar coordinate system with the centroid position as the pole, and convert the coordinates of the defect boundary points in the gray-scale-shape joint feature matrix into radial distance and polar angle in polar coordinates to generate a defect boundary feature curve. The smoothness of the curve is obtained by calculating the rate of change of distance between adjacent points of the defect boundary feature curve, the continuity is obtained by calculating the change of tangent direction of the curve at each boundary point, and the closure is obtained by calculating the Euclidean distance between the first and last points. The Fourier transform of the defect boundary feature curve is performed to extract the amplitude spectrum and phase spectrum of different frequency components as Fourier harmonic coefficients. The gray-shape joint feature matrix is integrated and normalized along the angular direction in polar coordinates to obtain the radial gray-level distribution features of the defect area; the center pixel value in the defect area is compared with the other pixel values to obtain a binary encoding sequence; the binary encoding sequence is converted into a decimal number as the local binary pattern value of the point; and the distribution histogram of the local binary pattern value in the angular direction is statistically analyzed to obtain the angular gray-level distribution features.
[0010] Wavelet packet decomposition is performed on the defect feature parameters to obtain subspaces of multiple frequency bands. Information entropy and energy density ratio are calculated in each subspace. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. These feature subspaces are then input into a genetic algorithm to iteratively optimize feature combinations, including: The defect feature parameter sequence is input into a wavelet packet decomposer for multi-level decomposition. The signal is recursively decomposed by a high-pass filter and a low-pass filter to obtain subspace sequences of different frequency ranges. The subspace sequences are then reconstructed to reassemble the signals of different frequency bands into multiple frequency band subspaces. Wavelet packet coefficients are extracted within the frequency band subspace, and the square of the wavelet packet coefficients is calculated to obtain the energy value. The energy value is then divided by the sum of the energy values of all frequency band subspaces to obtain the normalized energy distribution value. The initial value of information entropy is calculated by multiplying the normalized energy distribution value with its natural logarithm. The sign of the initial value of information entropy is inverted and the inversion results in all frequency bands are summed to obtain the information entropy value of each frequency band subspace. The information entropy value of each frequency band subspace is divided by the sum of the information entropy values of all frequency band subspaces to obtain the energy density ratio of that frequency band subspace. From the frequency band subspace, select subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold as feature subspaces. Encode the feature parameters in the feature subspaces into binary sequences. Randomly select two binary sequences as parent sequences and swap gene fragments at the intersection of the parent sequences to obtain offspring sequences. Randomly select mutation positions in the offspring sequences and flip the gene values at those positions to generate new feature combination sequences.
[0011] Based on the optimized feature combination, a defect feature vector is constructed. Spectral clustering is then used to perform cluster analysis on the defect feature vector to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the acoustic beam pattern. The optimized feature combination is used to extract the root mean square value and peak frequency of the defect signal in the time domain and frequency domain respectively, and the root mean square value and peak frequency are concatenated to construct the defect feature vector. The defect feature vector is normalized using the maximum and minimum values of each feature component to obtain a standardized feature vector. The Euclidean distance between the standardized feature vectors is calculated, and samples whose Euclidean distance is less than a preset distance threshold are classified into the same class to obtain the initial clustering result. Based on the initial clustering results, the feature mean of samples within each category is calculated as the class center. The distance from the sample to be classified to each class center is calculated, and the sample to be classified is assigned to the class with the smallest distance. The class centers are iteratively updated until the change in the position of the class centers in two consecutive iterations is less than the preset convergence threshold, and the defect category is obtained. Based on the time difference between ultrasonic wave transmission and reception and the sound wave propagation distance, the spatial position information of each probe is obtained. Based on the spatial position information, the straight-line distance from each probe to the defect is calculated. According to the relative position relationship and straight-line distance of multiple probes, the three-dimensional spatial position coordinates of the defect are determined by the triangle positioning principle. The actual size of the defect is calculated based on the amplitude attenuation of the defect echo and the wavelength of the sound wave.
[0012] A second aspect of the present invention provides an automatic evaluation system for phased array images of pipe butt welds, comprising: The first unit is used to extract A-type waveform data from the phased array ultrasonic testing raw data of the butt weld of the pipeline to be evaluated and to reconstruct the data to generate a three-dimensional data matrix. The three-dimensional data matrix is then sliced sequentially along the beam angle and weld depth to generate a phased array map. The second unit is used to perform spatial focusing correction on the phased array spectrum using a hyperbolic wavefront reconstruction algorithm, calculate the spatial gradient features of the corrected spectrum, divide the phased array spectrum into a first gradient region and a second gradient region based on the spatial gradient features, perform noise suppression processing using morphological reconstruction filtering in the first gradient region, and perform enhancement processing using adaptive median filtering in the second gradient region; extract the defect boundary of the processed phased array spectrum using a multi-scale edge detection algorithm to generate a binarized contour image, and calculate the defect feature parameters based on the binarized contour image. The third unit is used to perform wavelet packet decomposition on the defect feature parameters to obtain subspaces of multiple frequency bands. In each subspace, the information entropy value and energy density ratio are calculated. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. The feature subspaces are input into a genetic algorithm to iteratively optimize feature combinations. Based on the optimized feature combinations, a defect feature vector is constructed. The defect feature vector is clustered using a spectral clustering method to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the sound beam pattern.
[0013] A third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0014] Fourth aspect of the present invention, A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0015] The beneficial effects of this application are as follows: This invention combines hyperbolic wavefront reconstruction algorithm with spatial gradient feature region division to achieve accurate correction and partitioning of phased array spectra. It solves the technical problem that traditional image processing methods cannot simultaneously achieve noise suppression and defect detail preservation, thus improving the accuracy and reliability of defect detection.
[0016] This invention employs a multi-scale edge detection algorithm to extract defect boundaries, combines wavelet packet decomposition and information entropy analysis to select the most discriminative feature subspace, and optimizes feature combination through a genetic algorithm. This overcomes the subjectivity and uncertainty of traditional manual feature extraction methods, making the expression of defect features more objective and comprehensive.
[0017] This invention, based on a defect classification method using spectral clustering and a three-dimensional localization technology using acoustic beam patterns, enables automatic identification, classification, and quantitative assessment of weld defects. This makes the inspection process more efficient and standardized, significantly reducing the workload of manual assessment and the reliance on the professional skills of inspection personnel, and improving the consistency and efficiency of weld quality assessment. Attached Figure Description
[0018] Figure 1 This is a schematic flowchart of the automatic evaluation method for phased array spectra of pipe butt welds according to an embodiment of the present invention; Figure 2 This is a schematic diagram comparing the effects of hyperbolic wavefront reconstruction algorithms; Figure 3 This is a flowchart of wavelet packet-genetic algorithm feature optimization. Detailed Implementation
[0019] 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, 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.
[0020] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0021] Figure 1 This is a flowchart illustrating the automatic evaluation method for phased array spectra of pipe butt welds according to an embodiment of the present invention. Figure 1 As shown, the method includes: A-type waveform data is extracted from the raw phased array ultrasonic testing data of the butt weld of the pipeline to be evaluated and the data is recombined to generate a three-dimensional data matrix. The three-dimensional data matrix is then sliced along the beam angle and weld depth to generate a phased array spectrum. The phased array spectrum is spatially focused and corrected using a hyperbolic wavefront reconstruction algorithm. The spatial gradient features of the corrected spectrum are calculated, and the phased array spectrum is divided into a first gradient region and a second gradient region based on the spatial gradient features. Noise suppression is performed in the first gradient region using morphological reconstruction filtering, and enhancement is performed in the second gradient region using adaptive median filtering. The defect boundaries are extracted from the processed phased array spectrum using a multi-scale edge detection algorithm to generate a binary contour image. Defect feature parameters are calculated based on the binary contour image. Wavelet packet decomposition is performed on the defect feature parameters to obtain subspaces of multiple frequency bands. The information entropy value and energy density ratio are calculated in each subspace. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. These feature subspaces are then input into a genetic algorithm to iteratively optimize feature combinations. Based on the optimized feature combinations, a defect feature vector is constructed. The defect feature vector is then clustered using a spectral clustering method to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the acoustic beam pattern.
[0022] In one optional implementation, the phased array spectrum is spatially focused and corrected using a hyperbolic wavefront reconstruction algorithm. The spatial gradient characteristics of the corrected spectrum are calculated, and the phased array spectrum is divided into a first gradient region and a second gradient region based on these characteristics. Noise suppression is performed in the first gradient region using morphological reconstruction filtering, and enhancement processing is performed in the second gradient region using adaptive median filtering. Calculate the time delay of each array element in the phased array probe emitting sound waves to any point in the weld and then returning to the receiving array element. Weight the original signals received by each array element to obtain a weighted signal. Based on the time delay, transfer and superimpose the weighted signal in the time domain to obtain the corrected phased array spectrum. The first-order difference values in the horizontal and vertical directions of the corrected phased array spectrum are calculated and the sum of squares and square roots are performed to obtain the spatial gradient features. Based on the gray-level histogram distribution of the spatial gradient features, the optimal segmentation threshold is determined. Regions in the corrected phased array spectrum with spatial gradient features greater than the optimal segmentation threshold are divided into the first gradient region, and regions in the corrected phased array spectrum with spatial gradient features less than or equal to the optimal segmentation threshold are divided into the second gradient region. The labeled image is obtained by subtracting a preset brightness adjustment value from the image gray value in the first gradient region. The original image in the first gradient region is used as a mask image. The labeled image is iteratively dilated and the gray value is limited by the mask image until the difference between the gray values of the corresponding pixels in the current iteration image and the previous iteration image is less than a preset reconstruction threshold. The local gray variance of the preset sliding window in the second gradient region is calculated. The gain adjustment coefficient is determined according to the ratio of the local gray variance to the reference variance. The gain adjustment coefficient is multiplied by the residual of the median filtering result and then superimposed on the original image.
[0023] The acoustic path distance from each element of the phased array probe to any point P(x,y) in the weld is calculated. Based on the sound wave propagation speed in the material, the time delay from the transmitting element to point P and then to the receiving element is determined. In practical applications, the sound wave propagation speed for steel welds is approximately 5900 m / s. Taking a 32-element linear phased array probe as an example, with an element spacing of 0.5 mm and a detection depth of 30 mm, the calculated time delay matrix is used for subsequent signal processing. The original signal is weighted using a Hanning window function to improve the signal-to-noise ratio. The weighted signal amplitude is multiplied by a weighting coefficient between 0.5 and 1. Based on the calculated time delay, the weighted signal is shifted and superimposed in the time domain to achieve spatial focusing correction, resulting in the corrected phased array spectrum.
[0024] Based on the corrected image, the first-order differences in the horizontal and vertical directions are calculated using the Sobel operator. For any pixel (i,j) in the image, the horizontal difference is calculated by weighted differences of pixels within a 3×3 region surrounding that pixel, and the vertical difference is calculated similarly. The horizontal and vertical differences are squared, summed, and then the square root is taken to obtain the spatial gradient feature value of that point. For a 512×512 resolution image, the gradient value typically ranges from 0 to 255.
[0025] The image is divided into different gradient regions based on spatial gradient features. The gray-level histogram distribution of spatial gradient feature values is statistically analyzed, and the OTSU algorithm is used to determine the optimal segmentation threshold. In practical applications, this threshold is typically between 35 and 65. Regions in the corrected phased array image with spatial gradient features greater than the threshold are designated as the first gradient region, and regions with spatial gradient features less than or equal to the threshold are designated as the second gradient region. The first gradient region typically corresponds to defect edges and areas with prominent contours, while the second gradient region mainly consists of background areas and areas inside defects.
[0026] The labeled image is obtained by subtracting a preset brightness adjustment value of 15 from the grayscale value of the first gradient region image, and the original image of the first gradient region is used as the mask image. A dilation operation is performed on the labeled image using a 3×3 structuring element, and a grayscale value constraint is applied between the labeled image and the mask image; that is, the grayscale value after dilation must not exceed the grayscale value of the corresponding position in the mask image. This process is iteratively executed until the difference in grayscale value of the corresponding pixel in the current iteration image and the previous iteration image is less than a preset reconstruction threshold of 2, at which point the iteration stops. Typically, this process requires 8 to 15 iterations to reach convergence.
[0027] For the second gradient region, a 5×5 sliding window is used to calculate the local gray-level variance. The reference variance is set to 1.5 times the background region variance, approximately 8. The gain adjustment coefficient k is determined based on the ratio of the local gray-level variance to the reference variance. When the ratio is greater than 1, k is the square root of the ratio multiplied by 0.8; when the ratio is less than or equal to 1, k is the 0.5 power of the ratio multiplied by 1.2. A 5×5 median filter is applied to the second gradient region, and the difference between the median filter result and the original image is calculated to obtain the residual. The gain adjustment coefficient is multiplied by the residual and then superimposed onto the original image to achieve adaptive enhancement.
[0028] Experimental results show that the signal-to-noise ratio in the defect region of the phased array image processed by this method is improved from 4.2 to 7.8, and the average gradient intensity at the defect edge is increased by 68%, thus more accurately displaying the location, shape, and size of defects in the weld. In actual industrial inspection, this method can effectively suppress background noise, enhance defect features, improve defect detection rate and positioning accuracy, and provide reliable image data support for weld quality assessment.
[0029] Through the above processing flow, spatial focusing correction and regional adaptive enhancement of phased array images are achieved, overcoming the problem that traditional methods cannot simultaneously suppress noise and preserve edges when processing images of complex weld seams, and providing a clearer image basis for weld defect detection.
[0030] Figure 2 This diagram illustrates the performance comparison of the hyperbolic wavefront reconstruction algorithm in phased array ultrasonic testing. The bar chart compares the performance of the traditional time-delay stacking algorithm, the full-focus imaging algorithm, and the proposed method across six key performance indicators. In terms of signal-to-noise ratio (SNR), the proposed method achieves 7.8 dB, an 85.7% improvement compared to the traditional time-delay stacking algorithm's 4.2 dB, and a 27.9% improvement compared to the full-focus imaging algorithm's 6.1 dB, demonstrating its significant advantage in noise suppression. Regarding spatial resolution, the proposed method achieves an accuracy of 0.3 mm, significantly better than the traditional method's 0.8 mm and full-focus imaging's 0.5 mm, indicating that the hyperbolic wavefront reconstruction algorithm can more accurately locate defects. In terms of defect detection rate, the proposed method achieves 94%, an 18 percentage point improvement compared to the traditional method and an 11 percentage point improvement compared to full-focus imaging, demonstrating stronger defect recognition capabilities. In edge sharpness scoring, the proposed method received the highest rating of 5.2 points, and its background noise suppression rate reached 78%, both leading the compared methods. Although the computational efficiency of this invention is 72%, which is between the traditional method's 85% and full-focus imaging's 45%, its overall performance is the best, verifying the technical innovation and practical value of the hyperbolic wavefront reconstruction algorithm in phased array spectral spatial focusing correction.
[0031] In one optional implementation, the processed phased array image is processed using a multi-scale edge detection algorithm to extract the defect boundary, generating a binarized contour image. The defect feature parameters are then calculated based on the binarized contour image, including: The processed phased array spectrum is convolved with Gaussian-Laplacian operators with different scale parameters to obtain edge response image sequences. Non-maximum suppression is performed on the edge response image sequences and adaptive weighted fusion is based on local gray-level variance to obtain fused edge images. Boundary tracking is performed on the fused edge image to extract a continuous sequence of defect boundary coordinates. Disconnected boundary coordinate points are connected using a distance constraint criterion to obtain the defect boundary. The defect boundary is binarized, with boundary pixels set as foreground and the remaining pixels set as background, to obtain a binarized contour image. The binarized contour image is mapped to the phased array spectrum in feature space. A gray-shape joint feature matrix of the defect region is constructed in the mapped space, and polar coordinate transformation is performed along the defect boundary to obtain the defect boundary feature curve. The morphological parameters and Fourier harmonic coefficients of the defect boundary feature curve are calculated. The radial gray-level distribution features and angular gray-level distribution features of the defect region are calculated based on the polar coordinate transformation. The morphological parameters, Fourier harmonic coefficients, radial gray-level distribution features, and angular gray-level distribution features are fused through adaptive weights to generate defect feature parameters.
[0032] Edge detection is performed on the phased array image using Gaussian-Laplacian operators with different scale parameters. The Gaussian-Laplacian operator, composed of a Gaussian smoothing kernel and a second-order Laplacian differential operator, can be represented as the second derivative of a Gaussian function. In practice, five different scale parameters are selected for edge response calculation, with scale parameter σ set to 1.0, 1.5, 2.0, 2.5, and 3.0 pixels, respectively. For each scale parameter σ, a corresponding Gaussian-Laplacian operator is constructed and convolved with the phased array image to obtain five edge response images, forming an edge response image sequence.
[0033] Non-maximum suppression (NMS) is performed on each edge response image, preserving local maxima and suppressing non-maximums. NMS is achieved by comparing the response values of each pixel with its two neighboring pixels along its gradient direction. If the response value of the current pixel is greater than that of its two neighboring pixels, the pixel is retained as a candidate edge point; otherwise, it is suppressed as background. Adaptive weighted fusion is then performed on the edge response image sequence after NMS. During fusion, the gray-level variance of each scale image within a local 3×3 window is calculated. A larger variance indicates richer edge information in the region, and the corresponding weight should be larger. The weighting coefficient is set to the ratio of this local variance to the sum of the local variances of all scales. The edge images at each scale are then summed according to their weights to obtain the fused edge image.
[0034] A continuous defect boundary coordinate sequence is extracted using an eight-connected region growing method. Boundary tracking begins with a seed point whose edge intensity exceeds a threshold, which is set to 1.5 times the average gray value of the image. Starting from the seed point, its eight neighboring pixels are checked sequentially. If the edge intensity of a neighboring pixel exceeds the threshold, it is added to the boundary coordinate sequence and used as the new current point to continue the search until no new neighboring point that meets the condition can be found, thus completing the extraction of a continuous boundary segment. For broken boundary segments, connection processing is performed according to a distance constraint criterion. If the Euclidean distance between the endpoints of two boundary segments is less than a preset threshold (set to 5 pixels in this example), the two boundary segments are considered to belong to different parts of the same defect and should be connected. The connection uses linear interpolation to generate connecting pixels between two broken points, maintaining the continuity of the boundary.
[0035] The extracted defect boundaries are binarized, with boundary pixels set as foreground (grayscale value 255) and the remaining pixels set as background (grayscale value 0), resulting in a binarized contour image. The binarized contour image is then mapped to the original phased array image in its feature space to construct a joint feature representation. This mapping is achieved by establishing a spatial correspondence between the binarized contour and the original image. Within the mapped space, a grayscale-shape joint feature matrix for the defect region is constructed, containing both the shape and grayscale distribution information of the defect region.
[0036] The binarized contour image and the phased array map are weighted and superimposed with weights of 0.7 and 0.3 respectively to generate a feature map image. The binarized contour image is obtained by performing Canny edge detection on the original defect image, and the phased array map is a grayscale image of the defect area obtained by a phased array ultrasonic testing device. The Sobel operator is used to calculate the gradient values of the feature map image in the x and y directions respectively, and the gradient magnitude is calculated to obtain the gray-level gradient; the second derivative at the boundary point of the feature map image is calculated to obtain the edge curvature; in a 5×5 local neighborhood, the gray-level gradient and the edge curvature are weighted and fused with weights of 0.6 and 0.4 respectively to generate a gray-level-shape joint feature matrix. The centroid position is obtained by calculating the average value of the coordinates of all pixels in the defect region. A polar coordinate system is established with the centroid position as the pole. The rectangular coordinates of the defect boundary points in the gray-shape joint feature matrix are converted into radial distance and polar angle in polar coordinates to generate the defect boundary feature curve. The smoothness is obtained by calculating the rate of change of distance between adjacent points of the defect boundary feature curve, the continuity is obtained by calculating the change of tangent direction of the defect boundary feature curve at each boundary point, and the closure is obtained by calculating the Euclidean distance between the first and last points of the defect boundary feature curve. The defect boundary feature curve is subjected to Fourier transform, and the low-frequency components of 180 frequency components are extracted as basic shape features, and the high-frequency components are extracted as boundary detail features. The 360-degree angle is divided into 36 angular intervals. The sum of gray values in each interval is calculated and normalized by dividing by the number of pixels in the interval to obtain the radial gray-scale distribution characteristics. Each pixel in the defect area and its 8 neighbors are selected. The value of the center pixel is compared with the value of the neighboring pixels to generate an 8-bit binary encoding sequence. The binary encoding sequence is converted into a decimal number as a local binary pattern value. The distribution histogram of the local binary pattern value in the angular direction is calculated to obtain the angular gray-scale distribution characteristics.
[0037] Morphological parameters, Fourier harmonic coefficients, radial grayscale distribution features, and angular grayscale distribution features are weighted according to their discriminative power in defect identification: morphological parameters have a weight of 0.3, Fourier harmonic coefficients have a weight of 0.3, radial grayscale distribution features have a weight of 0.2, and angular grayscale distribution features have a weight of 0.2. A final defect feature parameter vector is generated through weighted fusion. This vector comprehensively represents the geometric shape and grayscale distribution characteristics of the defect and can be used for subsequent defect classification and evaluation.
[0038] In one optional implementation, the binarized contour image is mapped to a phased array spectrum in a feature space. A gray-shape joint feature matrix of the defect region is constructed in the mapped space, and a polar coordinate transformation is performed along the defect boundary to obtain a defect boundary feature curve. The morphological parameters and Fourier harmonic coefficients of the defect boundary feature curve are calculated. The radial and angular gray-level distribution characteristics of the defect region are calculated based on the polar coordinate transformation, including: The feature map image is obtained by overlaying the binarized contour image with the phased array map; Calculate the gray-level gradient and edge curvature of the defect region in the feature mapping image, and then perform weighted fusion of the gray-level gradient and edge curvature in the local neighborhood to generate a gray-level-shape joint feature matrix. Determine the centroid position of the defect region, establish a polar coordinate system with the centroid position as the pole, and convert the coordinates of the defect boundary points in the gray-scale-shape joint feature matrix into radial distance and polar angle in polar coordinates to generate a defect boundary feature curve. The smoothness of the curve is obtained by calculating the rate of change of distance between adjacent points of the defect boundary feature curve, the continuity is obtained by calculating the change of tangent direction of the curve at each boundary point, and the closure is obtained by calculating the Euclidean distance between the first and last points. The Fourier transform of the defect boundary feature curve is performed to extract the amplitude spectrum and phase spectrum of different frequency components as Fourier harmonic coefficients. The gray-shape joint feature matrix is integrated and normalized along the angular direction in polar coordinates to obtain the radial gray-level distribution features of the defect area; the center pixel value in the defect area is compared with the other pixel values to obtain a binary encoding sequence; the binary encoding sequence is converted into a decimal number as the local binary pattern value of the point; and the distribution histogram of the local binary pattern value in the angular direction is statistically analyzed to obtain the angular gray-level distribution features.
[0039] The binarized contour image is obtained by binarizing the original defect image and then extracting the defect contour using edge detection operators such as Canny or Sobel. The defect boundary pixel value is 1, and the background pixel value is 0. The phased array image is a grayscale image of the defect region acquired using a phased array ultrasonic testing device. The defect region exhibits high acoustic reflection intensity, manifested as a high grayscale value. After pixel-level alignment of these two images, a feature map image is generated through image overlay. Specifically, the overlay operation can use image multiplication, i.e., multiplying corresponding pixel values; or a weighted average, such as assigning a weight of 0.7 to the binarized contour image and a weight of 0.3 to the phased array image, and then weighting and overlaying the two. For a 100×100 pixel image, at position (50,50), if the pixel value of the binarized contour image is 1 and the pixel value of the phased array image is 200, then the pixel value of the superimposed feature map image at that position is 200×1=200 (multiplication method) or 1×0.7+200×0.3=60.7 (weighted average method).
[0040] The grayscale gradient is calculated using the Sobel operator, performing convolution operations in the x and y directions respectively, and then calculating the gradient magnitude. For example, at the defect boundary point (60, 65), the gradient value in the x direction is 15, and the gradient value in the y direction is 20, so the gradient magnitude at this point is 25 (i.e., sqrt(15)). 2 +20 2 The edge curvature is obtained by calculating the second derivative at the boundary point. For the boundary point (60, 65), if its second derivative value is 0.05, it indicates that the curvature is small and the boundary is relatively smooth. Within a 5×5 local neighborhood, the gray-level gradient and edge curvature are weighted and fused, with weights set to 0.6 and 0.4, respectively, to generate a gray-level-shape joint feature matrix. Each element in this matrix contains positional information and the fused feature value. For the boundary point (60, 65) mentioned above, its fused feature value is 25×0.6 + 0.05×0.4 = 15.02.
[0041] The centroid of the defect region is determined by calculating the average coordinates of all pixels within the defect region. Assuming the defect region contains 300 pixels with a sum of coordinates (18000, 15000), the centroid is located at (60, 50). A polar coordinate system is established with this centroid as the pole, converting the defect boundary point coordinates in the gray-shape joint feature matrix into polar coordinates. For example, the boundary point (80, 50) is 20 pixels from the centroid and has a 0-degree angle with the positive x-axis, so its polar coordinates are (20, 0); the boundary point (60, 70) is 20 pixels from the centroid and has a 90-degree angle with the positive x-axis, so its polar coordinates are (20, 90). A defect boundary feature curve is generated by connecting the polar coordinates of all boundary points.
[0042] The morphological parameters of the defect boundary feature curve include curve smoothness, continuity, and closure. Curve smoothness is obtained by calculating the rate of change of distance between adjacent points. For example, if the distance between point 10 and point 11 in the boundary point set is 2.2 pixels, and the distance between point 11 and point 12 is 2.5 pixels, then the rate of change of distance at point 11 is (2.5-2.2) / 2.2 = 0.136. The smaller the rate of change, the smoother the curve. Continuity is obtained by calculating the change of tangent direction at each boundary point. For example, if the tangent direction at point 20 is 30 degrees and at point 21 is 32 degrees, then the change of direction is 2 degrees. The smaller the change value, the better the continuity. Closure is obtained by calculating the Euclidean distance between the first and last points. For example, if the coordinates of the first point are (20,0) and the coordinates of the last point are (19.8,2), then the Euclidean distance is 2.01 pixels. The smaller this value, the higher the curve closure.
[0043] Performing a Fourier transform on the defect boundary characteristic curve, assuming 360 sampling points represent a complete defect boundary, yields 180 frequency components. Low-frequency components (such as 1st-10th harmonics) typically describe the overall shape of the defect, while high-frequency components (such as 11th-180th harmonics) typically describe the details and noise of the defect boundary. For an approximately circular defect, the amplitude of its 1st harmonic is 18.5, and the amplitude of its 2nd harmonic is 0.8, indicating that the defect shape is mainly determined by the fundamental frequency. However, for an irregularly shaped defect, the amplitudes of its higher-order harmonics are relatively large, such as the amplitude of its 5th harmonic being 6.2, indicating that the defect has a more complex boundary shape.
[0044] The 360-degree angle is divided into 36 angular intervals, each interval being 10 degrees. The sum of the grayscale values within each interval is calculated and then normalized by dividing by the number of pixels in that interval. For example, if there are 25 pixels in the 0-10 degree interval, the sum of the grayscale values is 4500, then the average grayscale value for that interval is 180. By comparing the grayscale distribution across different angular intervals, the radial grayscale variation characteristics of defects in different directions can be identified.
[0045] When calculating the angular grayscale distribution feature, each pixel within the defect area and its 8 neighbors are selected. The value of the center pixel is compared with the values of its 8 surrounding pixels to generate an 8-bit binary code sequence. If the neighboring pixel value is greater than or equal to the center pixel value, the corresponding bit is 1; otherwise, it is 0. For example, if the grayscale value of a pixel is 150, and the grayscale values of its 8 neighbors are 145, 155, 160, 148, 150, 142, 138, and 152, the generated binary code sequence is 01100010. This binary code sequence is converted to a decimal number, resulting in 98, which is taken as the local binary pattern value of that point. The distribution histogram of the local binary pattern values of all pixels within the defect area in the angular direction is statistically analyzed. For example, within the 0-30 degree angle range, the local binary pattern value 98 appears 12 times, and the local binary pattern value 24 appears 8 times, thus obtaining the angular grayscale distribution feature. This feature can be used to distinguish different types of defects.
[0046] In one optional implementation, wavelet packet decomposition is performed on the defect feature parameters to obtain subspaces of multiple frequency bands. Within each subspace, the information entropy value and energy density ratio are calculated. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are designated as feature subspaces. The feature subspaces are then input into a genetic algorithm to iteratively optimize feature combinations, including: The defect feature parameter sequence is input into a wavelet packet decomposer for multi-level decomposition. The signal is recursively decomposed by a high-pass filter and a low-pass filter to obtain subspace sequences of different frequency ranges. The subspace sequences are then reconstructed to reassemble the signals of different frequency bands into multiple frequency band subspaces. Wavelet packet coefficients are extracted within the frequency band subspace, and the square of the wavelet packet coefficients is calculated to obtain the energy value. The energy value is then divided by the sum of the energy values of all frequency band subspaces to obtain the normalized energy distribution value. The initial value of information entropy is calculated by multiplying the normalized energy distribution value with its natural logarithm. The sign of the initial value of information entropy is inverted and the inversion results in all frequency bands are summed to obtain the information entropy value of each frequency band subspace. The information entropy value of each frequency band subspace is divided by the sum of the information entropy values of all frequency band subspaces to obtain the energy density ratio of that frequency band subspace. From the frequency band subspace, select subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold as feature subspaces. Encode the feature parameters in the feature subspaces into binary sequences. Randomly select two binary sequences as parent sequences and swap gene fragments at the intersection of the parent sequences to obtain offspring sequences. Randomly select mutation positions in the offspring sequences and flip the gene values at those positions to generate new feature combination sequences.
[0047] like Figure 3 As shown, the method includes: The wavelet packet decomposer uses the db4 wavelet basis function to perform a three-level decomposition of the input feature parameters. For example, for a defect vibration signal with a sampling frequency of 1000Hz and a length of 2048 points, recursive decomposition is performed using a high-pass filter g[n] and a low-pass filter h[n]. In the first level of decomposition, the low-frequency part has a frequency range of 0-250Hz, and the high-frequency part has a frequency range of 250-500Hz. After the second level of decomposition, four frequency bands are obtained, namely 0-125Hz, 125-250Hz, 250-375Hz, and 375-500Hz. After the third level of decomposition, eight frequency band subspaces are obtained, with frequency ranges of 0-62.5Hz, 62.5-125Hz, 125-187.5Hz, 187.5-250Hz, 250-312.5Hz, 312.5-375Hz, 375-437.5Hz, and 437.5-500Hz. To improve the accuracy of subsequent processing, these subspace sequences are reconstructed by using wavelet packet coefficients of each frequency band node to recombine the signals and generate a complete multi-frequency band subspace.
[0048] For the i-th frequency band subspace, assume its wavelet packet coefficients are wi,j, where j is the index of the sampling point within that subspace. The energy value Ei is obtained by squareding these coefficients, specifically the sum of the squares of all wavelet packet coefficients within that subspace. For example, for the subspace with a frequency band of 0-62.5Hz, if the sum of the squares of its wavelet packet coefficients is 256, and the total energy of all eight frequency band subspaces is 1024, then the normalized energy distribution value of that subspace is 0.25. The normalized energy distribution values for all eight frequency band subspaces are calculated using this method.
[0049] Taking the i-th frequency band subspace as an example, its normalized energy distribution value is pi. The initial value of information entropy is obtained by multiplying pi by its natural logarithm ln(pi). For example, if the normalized energy distribution value of a certain frequency band is 0.25, then its initial value of information entropy is 0.25×ln(0.25)≈-0.3466. Inverting this initial value of information entropy gives 0.3466, and summing the inverted results for all frequency bands yields the information entropy value of that frequency band subspace. If the sum of the information entropy values of the eight frequency band subspaces is 2.0, then the energy density ratio of that frequency band subspace is 0.3466÷2.0≈0.1733. The information entropy value and energy density ratio of each frequency band subspace are calculated using this method.
[0050] A preset entropy threshold of 0.15 and a preset energy threshold of 0.1 are set. Subspaces with an information entropy value greater than 0.15 and an energy density ratio greater than 0.1 are selected from the eight frequency band subspaces mentioned above as feature subspaces. Assuming that after screening, the subspaces of frequency bands 62.5-125Hz, 187.5-250Hz, and 312.5-375Hz are selected as feature subspaces, the wavelet packet coefficients contained within them are the effective feature parameters.
[0051] The selected feature parameters are encoded as binary sequences for genetic algorithm optimization. Each feature parameter corresponds to a binary bit; if selected, it is marked as 1, otherwise as 0. For example, if there are 20 feature parameters and 3 are selected, the binary encoding is "00100001000000010000". A crossover rate of 0.8 and a mutation rate of 0.1 are used as control parameters for the genetic algorithm, with a population size of 50 and a maximum number of iterations of 100.
[0052] At the start of the genetic algorithm optimization process, an initial population is randomly generated, with each individual representing a feature combination. The performance of each feature combination is evaluated using a fitness function that combines classification accuracy and the number of features, aiming for both high accuracy and a more concise feature set. For example, if one combination has a classification accuracy of 95% and contains 5 features, while another combination has an accuracy of 94% but only contains 3 features, the latter receives a higher fitness score.
[0053] In the selection operation, a roulette wheel method is used to select two parent sequences. For example, two binary sequences, "001010" and "110100", are randomly selected from the feature subspace as parents. In the crossover operation, the crossover position is set to the 3rd position, and the gene fragments after this position are swapped to obtain the offspring sequences "001100" and "110010". Subsequently, a mutation operation is performed. Suppose the mutation is performed at the 5th position of the first offspring sequence, flipping the gene value at that position from 0 to 1, generating a new feature combination sequence "001110".
[0054] Through iterative evolution, individuals in the population continuously optimize, eventually converging to the optimal or near-optimal feature combination. In a practical case, after filtering from an initial 54 feature parameters using this method, the eight most representative feature parameters were ultimately selected to form a feature subset, achieving an accuracy of 97.5% for defect identification. This is 3.8 percentage points higher than the identification rate using all feature parameters, while simultaneously reducing computational complexity by 84%.
[0055] In one optional implementation, a defect feature vector is constructed based on the optimized feature combination. A spectral clustering method is then used to perform cluster analysis on the defect feature vector to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the acoustic beam pattern, including: The optimized feature combination is used to extract the root mean square value and peak frequency of the defect signal in the time domain and frequency domain respectively, and the root mean square value and peak frequency are concatenated to construct the defect feature vector. The defect feature vector is normalized using the maximum and minimum values of each feature component to obtain a standardized feature vector. The Euclidean distance between the standardized feature vectors is calculated, and samples whose Euclidean distance is less than a preset distance threshold are classified into the same class to obtain the initial clustering result. Based on the initial clustering results, the feature mean of samples within each category is calculated as the class center. The distance from the sample to be classified to each class center is calculated, and the sample to be classified is assigned to the class with the smallest distance. The class centers are iteratively updated until the change in the position of the class centers in two consecutive iterations is less than the preset convergence threshold, and the defect category is obtained. Based on the time difference between ultrasonic wave transmission and reception and the sound wave propagation distance, the spatial position information of each probe is obtained. Based on the spatial position information, the straight-line distance from each probe to the defect is calculated. According to the relative position relationship and straight-line distance of multiple probes, the three-dimensional spatial position coordinates of the defect are determined by the triangle positioning principle. The actual size of the defect is calculated based on the amplitude attenuation of the defect echo and the wavelength of the sound wave.
[0056] In the time domain, the root mean square (RMS) value of the defect signal is calculated, reflecting the signal's energy level. In the frequency domain, a Fourier transform is performed on the defect signal, and the frequency corresponding to the maximum amplitude in the signal spectrum, i.e., the peak frequency, is found. For example, for a defect signal with a sampling rate of 50MHz, its RMS value is 0.45mV, and its peak frequency is 5.2MHz. These two characteristic values are concatenated into a two-dimensional vector [0.45, 5.2], which serves as the feature vector describing the defect.
[0057] For each feature component, find its maximum and minimum values across all samples. For example, for the root mean square value feature, assume the maximum value is 0.85mV and the minimum is 0.12mV across all samples; for the peak frequency feature, the maximum value is 7.8MHz and the minimum is 2.1MHz. Map the value of each feature component to the interval [0,1] according to a linear mapping relationship. For the feature vector [0.45, 5.2] in the example above, after normalization, it becomes [(0.45-0.12) / (0.85-0.12), (5.2-2.1) / (7.8-2.1)], i.e., [0.452, 0.544]. This normalized feature vector ensures that different features have equal importance in cluster analysis.
[0058] For two standardized feature vectors a and b, their Euclidean distance is calculated as the square root of the sum of the squares of the differences between the two vectors' components. For example, the Euclidean distance between vectors [0.452, 0.544] and [0.513, 0.628] is 0.114. Samples whose distance is less than a preset distance threshold are grouped into the same class, forming the initial clustering result. In practical applications, this distance threshold can be set to 0.15.
[0059] Calculate the mean of the features of all samples within each category, and use this mean as the class center. For example, for a category containing 10 samples, if the mean of the root mean square feature is 0.47 and the mean of the peak frequency feature is 5.3, then the class center is [0.47, 5.3]. For each sample to be classified, calculate its distance to each class center and assign it to the category with the smallest distance. After completing one round of classification, recalculate the class centers for each category and proceed to the next iteration. The iteration stops when the change in the class center position between two consecutive iterations is less than a preset convergence threshold. In practical applications, this convergence threshold can be set to 0.01. In this way, the final classification results for each defect are obtained.
[0060] When determining the three-dimensional spatial location of the defect, the propagation distance of the ultrasonic wave is calculated based on the time difference between the ultrasonic wave's emission and reception and the speed of sound propagation in the material. For steel with a propagation speed of 5900 m / s, if the time difference is 10 microseconds, the propagation distance is 59 mm. Data is collected by multiple probes (at least three) installed at different locations to obtain the spatial position information of each probe. For example, the spatial positions of the three probes are (0,0,0) mm, (100,0,0) mm, and (0,100,0) mm, respectively.
[0061] Calculate the straight-line distance from each probe to the defect. If the distances from the three probes to the defect are 82 mm, 96 mm, and 94 mm respectively, a system of equations can be established based on the principle of triangulation to solve for the three-dimensional coordinates of the defect. The spatial position of the defect is obtained as (35, 45, 65) mm.
[0062] For an ultrasonic wave with a frequency of 5 MHz, its wavelength in steel is 1.18 mm. When the defect size is larger than the wavelength, the echo amplitude is proportional to the defect size. The actual size of the defect can be estimated by comparing the echo amplitude of the defect with that of a standard reflector (such as a flat-bottomed hole). If the echo amplitude of the defect is 80% of that of a standard 3 mm flat-bottomed hole, the estimated size of the defect is approximately 2.4 mm.
[0063] This method, by comprehensively utilizing time-domain and frequency-domain features and combining spectral clustering techniques with the principle of triangulation, achieves accurate classification and precise location of defects, providing an effective technical means for industrial non-destructive testing.
[0064] This invention provides an automatic evaluation system for phased array images of pipe butt welds, comprising: The first unit is used to extract A-type waveform data from the phased array ultrasonic testing raw data of the butt weld of the pipeline to be evaluated and to reconstruct the data to generate a three-dimensional data matrix. The three-dimensional data matrix is then sliced sequentially along the beam angle and weld depth to generate a phased array map. The second unit is used to perform spatial focusing correction on the phased array spectrum using a hyperbolic wavefront reconstruction algorithm, calculate the spatial gradient features of the corrected spectrum, divide the phased array spectrum into a first gradient region and a second gradient region based on the spatial gradient features, perform noise suppression processing using morphological reconstruction filtering in the first gradient region, and perform enhancement processing using adaptive median filtering in the second gradient region; extract the defect boundary of the processed phased array spectrum using a multi-scale edge detection algorithm to generate a binarized contour image, and calculate the defect feature parameters based on the binarized contour image. The third unit is used to perform wavelet packet decomposition on the defect feature parameters to obtain subspaces of multiple frequency bands. In each subspace, the information entropy value and energy density ratio are calculated. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. The feature subspaces are input into a genetic algorithm to iteratively optimize feature combinations. Based on the optimized feature combinations, a defect feature vector is constructed. The defect feature vector is clustered using a spectral clustering method to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the sound beam pattern.
[0065] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0066] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0067] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automatic evaluation method for phased array images of pipe butt welds, characterized in that, include: A-type waveform data is extracted from the raw phased array ultrasonic testing data of the butt weld of the pipeline to be evaluated and the data is recombined to generate a three-dimensional data matrix. The three-dimensional data matrix is then sliced along the beam angle and weld depth to generate a phased array spectrum. The phased array spectrum is spatially focused and corrected by hyperbolic wavefront reconstruction algorithm. The spatial gradient characteristics of the corrected spectrum are calculated. Based on the spatial gradient characteristics, the phased array spectrum is divided into a first gradient region and a second gradient region. In the first gradient region, morphological reconstruction filtering is used for noise suppression. In the second gradient region, adaptive median filtering is used for enhancement. The processed phased array image is used to extract the defect boundary through a multi-scale edge detection algorithm to generate a binarized contour image, and the defect feature parameters are calculated based on the binarized contour image. Wavelet packet decomposition is performed on the defect feature parameters to obtain subspaces of multiple frequency bands. The information entropy value and energy density ratio are calculated in each subspace. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. These feature subspaces are then input into a genetic algorithm to iteratively optimize feature combinations. Based on the optimized feature combinations, a defect feature vector is constructed. The defect feature vector is then clustered using a spectral clustering method to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the acoustic beam pattern.
2. The method according to claim 1, characterized in that, The phased array spectrum is spatially focused and corrected using a hyperbolic wavefront reconstruction algorithm. The spatial gradient characteristics of the corrected spectrum are calculated, and based on these characteristics, the phased array spectrum is divided into a first gradient region and a second gradient region. Noise suppression is performed in the first gradient region using morphological reconstruction filtering, and enhancement processing is applied in the second gradient region using adaptive median filtering. Calculate the time delay of each array element in the phased array probe emitting sound waves to any point in the weld and then returning to the receiving array element. Weight the original signals received by each array element to obtain a weighted signal. Based on the time delay, transfer and superimpose the weighted signal in the time domain to obtain the corrected phased array spectrum. The first-order difference values in the horizontal and vertical directions of the corrected phased array spectrum are calculated and the sum of squares and square roots are performed to obtain the spatial gradient features. Based on the gray-level histogram distribution of the spatial gradient features, the optimal segmentation threshold is determined. Regions in the corrected phased array spectrum with spatial gradient features greater than the optimal segmentation threshold are divided into the first gradient region, and regions in the corrected phased array spectrum with spatial gradient features less than or equal to the optimal segmentation threshold are divided into the second gradient region. The labeled image is obtained by subtracting a preset brightness adjustment value from the image gray value in the first gradient region. The original image in the first gradient region is used as a mask image. The labeled image is iteratively dilated and the gray value is limited by the mask image until the difference between the gray values of the corresponding pixels in the current iteration image and the previous iteration image is less than a preset reconstruction threshold. The local gray variance of the preset sliding window in the second gradient region is calculated. The gain adjustment coefficient is determined according to the ratio of the local gray variance to the reference variance. The gain adjustment coefficient is multiplied by the residual of the median filtering result and then superimposed on the original image.
3. The method according to claim 1, characterized in that, The processed phased array image is used to extract defect boundaries using a multi-scale edge detection algorithm to generate a binarized contour image. Defect feature parameters are then calculated based on the binarized contour image, including: The processed phased array spectrum is convolved with Gaussian-Laplacian operators with different scale parameters to obtain edge response image sequences. Non-maximum suppression is performed on the edge response image sequences and adaptive weighted fusion is based on local gray-level variance to obtain fused edge images. Boundary tracking is performed on the fused edge image to extract a continuous sequence of defect boundary coordinates. Disconnected boundary coordinate points are connected using a distance constraint criterion to obtain the defect boundary. The defect boundary is binarized, with boundary pixels set as foreground and the remaining pixels set as background, to obtain a binarized contour image. The binarized contour image is mapped to the phased array spectrum in feature space. A gray-shape joint feature matrix of the defect region is constructed in the mapped space, and polar coordinate transformation is performed along the defect boundary to obtain the defect boundary feature curve. The morphological parameters and Fourier harmonic coefficients of the defect boundary feature curve are calculated. The radial gray-level distribution features and angular gray-level distribution features of the defect region are calculated based on the polar coordinate transformation. The morphological parameters, Fourier harmonic coefficients, radial gray-level distribution features, and angular gray-level distribution features are fused through adaptive weights to generate defect feature parameters.
4. The method according to claim 3, characterized in that, The binarized contour image is mapped to the phased array spectrum in a feature space. A gray-shape joint feature matrix of the defect region is constructed in the mapped space, and a polar coordinate transformation is performed along the defect boundary to obtain the defect boundary feature curve. The morphological parameters and Fourier harmonic coefficients of the defect boundary feature curve are calculated. The radial and angular gray-level distribution features of the defect region are calculated based on the polar coordinate transformation, including: The feature map image is obtained by overlaying the binarized contour image with the phased array map; Calculate the gray-level gradient and edge curvature of the defect region in the feature mapping image, and then perform weighted fusion of the gray-level gradient and edge curvature in the local neighborhood to generate a gray-level-shape joint feature matrix. Determine the centroid position of the defect region, establish a polar coordinate system with the centroid position as the pole, and convert the coordinates of the defect boundary points in the gray-scale-shape joint feature matrix into radial distance and polar angle in polar coordinates to generate a defect boundary feature curve. The smoothness of the curve is obtained by calculating the rate of change of distance between adjacent points of the defect boundary feature curve, the continuity is obtained by calculating the change of tangent direction of the curve at each boundary point, and the closure is obtained by calculating the Euclidean distance between the first and last points. The Fourier transform of the defect boundary feature curve is performed to extract the amplitude spectrum and phase spectrum of different frequency components as Fourier harmonic coefficients. The gray-shape joint feature matrix is integrated and normalized along the angular direction in polar coordinates to obtain the radial gray-level distribution features of the defect area; the center pixel value in the defect area is compared with the other pixel values to obtain a binary encoding sequence; the binary encoding sequence is converted into a decimal number as the local binary pattern value of the point; and the distribution histogram of the local binary pattern value in the angular direction is statistically analyzed to obtain the angular gray-level distribution features.
5. The method according to claim 1, characterized in that, Wavelet packet decomposition is performed on the defect feature parameters to obtain subspaces of multiple frequency bands. Information entropy and energy density ratio are calculated in each subspace. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. These feature subspaces are then input into a genetic algorithm to iteratively optimize feature combinations, including: The defect feature parameter sequence is input into a wavelet packet decomposer for multi-level decomposition. The signal is recursively decomposed by a high-pass filter and a low-pass filter to obtain subspace sequences of different frequency ranges. The subspace sequences are then reconstructed to reassemble the signals of different frequency bands into multiple frequency band subspaces. Wavelet packet coefficients are extracted within the frequency band subspace, and the square of the wavelet packet coefficients is calculated to obtain the energy value. The energy value is then divided by the sum of the energy values of all frequency band subspaces to obtain the normalized energy distribution value. The initial value of information entropy is calculated by multiplying the normalized energy distribution value with its natural logarithm. The sign of the initial value of information entropy is inverted and the inversion results in all frequency bands are summed to obtain the information entropy value of each frequency band subspace. The information entropy value of each frequency band subspace is divided by the sum of the information entropy values of all frequency band subspaces to obtain the energy density ratio of that frequency band subspace. From the frequency band subspace, select subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold as feature subspaces. Encode the feature parameters in the feature subspaces into binary sequences. Randomly select two binary sequences as parent sequences and swap gene fragments at the intersection of the parent sequences to obtain offspring sequences. Randomly select mutation positions in the offspring sequences and flip the gene values at those positions to generate new feature combination sequences.
6. The method according to claim 1, characterized in that, Based on the optimized feature combination, a defect feature vector is constructed. Spectral clustering is then used to perform cluster analysis on the defect feature vector to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the acoustic beam pattern. The optimized feature combination is used to extract the root mean square value and peak frequency of the defect signal in the time domain and frequency domain respectively, and the root mean square value and peak frequency are concatenated to construct the defect feature vector. The defect feature vector is normalized using the maximum and minimum values of each feature component to obtain a standardized feature vector. The Euclidean distance between the standardized feature vectors is calculated, and samples whose Euclidean distance is less than a preset distance threshold are classified into the same class to obtain the initial clustering result. Based on the initial clustering results, the feature mean of samples within each category is calculated as the class center. The distance from the sample to be classified to each class center is calculated, and the sample to be classified is assigned to the class with the smallest distance. The class centers are iteratively updated until the change in the position of the class centers in two consecutive iterations is less than the preset convergence threshold, and the defect category is obtained. Based on the time difference between ultrasonic wave transmission and reception and the sound wave propagation distance, the spatial position information of each probe is obtained. Based on the spatial position information, the straight-line distance from each probe to the defect is calculated. According to the relative position relationship and straight-line distance of multiple probes, the three-dimensional spatial position coordinates of the defect are determined by the triangle positioning principle. The actual size of the defect is calculated based on the amplitude attenuation of the defect echo and the wavelength of the sound wave.
7. An automatic evaluation system for phased array diagrams of pipe butt welds, used to implement the method as described in any one of claims 1-6, characterized in that, include: The first unit is used to extract A-type waveform data from the phased array ultrasonic testing raw data of the butt weld of the pipeline to be evaluated and to reconstruct the data to generate a three-dimensional data matrix. The three-dimensional data matrix is then sliced sequentially along the beam angle and weld depth to generate a phased array map. The second unit is used to perform spatial focusing correction on the phased array spectrum using the hyperbolic wavefront reconstruction algorithm, calculate the spatial gradient characteristics of the corrected spectrum, divide the phased array spectrum into a first gradient region and a second gradient region based on the spatial gradient characteristics, perform noise suppression processing using morphological reconstruction filtering in the first gradient region, and perform enhancement processing using adaptive median filtering in the second gradient region. The processed phased array image is used to extract the defect boundary through a multi-scale edge detection algorithm to generate a binarized contour image, and the defect feature parameters are calculated based on the binarized contour image. The third unit is used to perform wavelet packet decomposition on the defect feature parameters to obtain subspaces of multiple frequency bands. In each subspace, the information entropy value and energy density ratio are calculated. Subspaces with information entropy values greater than a preset entropy threshold and energy density ratios greater than a preset energy threshold are selected as feature subspaces. The feature subspaces are input into a genetic algorithm to iteratively optimize feature combinations. Based on the optimized feature combinations, a defect feature vector is constructed. The defect feature vector is clustered using a spectral clustering method to obtain the defect category. The three-dimensional spatial coordinates and actual size of the defect are calculated based on the time delay characteristics of the defect echo and the sound beam pattern.
8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.