A contrast enhancement method for improving x-ray imaging quality of thick-walled GIS components

By employing techniques such as RTK localization, Monte Carlo scattering estimation, scattering deconvolution network, and pyramid attention fusion network, the problem of low contrast in X-ray imaging of thick-walled GIS components was solved, achieving adaptive enhancement of contrast in different regions and improving imaging quality and defect detection capabilities.

CN122175838APending Publication Date: 2026-06-09ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID NINGXIA ELECTRIC POWER COMPANY +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID NINGXIA ELECTRIC POWER COMPANY
Filing Date
2026-03-11
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Thick-walled GIS components have low X-ray imaging contrast and cannot adaptively enhance different areas. Existing anti-scattering grids lose a large amount of original X-ray signal while removing scattering, resulting in a decrease in signal-to-noise ratio. Histogram equalization methods cannot adapt to the uneven gray-scale distribution of multi-material composite structures.

Method used

A three-dimensional imaging coordinate system is established using an RTK positioning system. Scattering correction is performed using a Monte Carlo scattering estimator and a scattering deconvolution network. Multi-scale feature extraction and defect saliency enhancement are performed using a pyramid attention fusion network. Regional adaptive enhancement is achieved by combining a thermal diffusion contrast adjustment algorithm and a graph cut multi-region segmentation algorithm.

Benefits of technology

Without losing the original X-ray signal, it significantly improves the contrast and signal-to-noise ratio of X-ray imaging of thick-walled GIS components. It can adaptively enhance different regions, improve the detection sensitivity of small defects and the detail recognition of multi-material interfaces, and avoid the problems of local over-enhancement or under-enhancement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175838A_ABST
    Figure CN122175838A_ABST
Patent Text Reader

Abstract

The application provides a contrast enhancement method for improving X-ray imaging quality of thick-wall GIS components, and belongs to the technical field of X-ray inspection of GIS components. After a unified three-dimensional imaging coordinate system is established, a Compton scattering point spread function is calculated by using a Monte Carlo scattering estimator, and a scattering correction image is obtained by frequency domain separation through a scattering deconvolution network. The scattering correction image is input into a pyramid attention fusion network to perform multi-scale feature extraction and defect saliency enhancement. A thermal diffusion contrast adjustment algorithm based on a local gradient structure tensor is performed on a preliminary enhanced image. A graph cut multi-region segmentation algorithm is used to independently optimize the contrast parameters for homogeneous regions. A closed-loop optimization is formed by adjusting the pyramid feature fusion weight coefficient according to the global contrast evaluation value feedback, thereby solving the technical problems of low X-ray imaging contrast of thick-wall GIS components and the inability to adaptively enhance different regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of X-ray inspection technology for GIS components, and more specifically, relates to a contrast enhancement method for improving the X-ray imaging quality of thick-walled GIS components. Background Technology

[0002] Non-destructive testing (NDT) of gas-insulated switchgear relies on X-ray imaging to identify internal defects. Traditional methods employ anti-scattering grids to suppress Compton scattering and histogram equalization to enhance contrast. However, in thick-walled metal casings, scattered photons account for 60% to 80% of the detected signal. While the anti-scattering grid removes scattering, it also loses a significant amount of the original X-ray signal, leading to a decrease in the signal-to-noise ratio. Global enhancement methods such as histogram equalization apply uniform contrast transformation parameters to the entire image, which cannot adapt to the highly uneven grayscale distribution caused by composite structures of multiple materials such as aluminum alloy casings and copper conductors. This results in over-enhancing or under-enhancing other areas while enhancing contrast in some regions. In other words, existing technologies suffer from low contrast in X-ray imaging of thick-walled GIS components and an inability to adaptively enhance different areas. Summary of the Invention

[0003] In view of this, the present invention provides a contrast enhancement method for improving the X-ray imaging quality of thick-walled GIS components, which can solve the technical problems of low contrast in X-ray imaging of thick-walled GIS components and the inability to adaptively enhance different regions in the prior art.

[0004] This invention is implemented as follows: This invention provides a contrast enhancement method to improve the X-ray imaging quality of thick-walled GIS components, comprising the following steps: acquiring an initial X-ray projection image of the thick-walled GIS component; obtaining the spatial coordinates of the X-ray source focus and detector center using an RTK positioning system to establish a unified three-dimensional imaging coordinate system; performing scattering correction processing on the initial X-ray projection image; calculating the Compton scattering point spread function using a Monte Carlo scattering estimator; performing spatial-frequency domain separation of the scattering distribution using a scattering deconvolution network to obtain a scattering-corrected image; inputting the scattering-corrected image into a contrast enhancement model for multi-scale feature extraction and defect saliency enhancement to obtain a preliminary enhanced image; and further enhancing the preliminary image. The enhanced image is obtained by performing a thermal diffusion contrast adjustment algorithm. The diffusion coefficient tensor is calculated based on the local gradient structure tensor. The grayscale stretching is enhanced in uniform regions while the diffusion is suppressed in edge regions. The thermal diffusion enhanced image is then processed by a graph cut multi-region segmentation algorithm to construct a pixel similarity weighted map. The map is then segmented into multiple homogeneous regions by a minimum cut algorithm. The contrast parameters are independently optimized for each homogeneous region to obtain a region-adaptive enhanced image. The global contrast evaluation value of the region-adaptive enhanced image is calculated. When the global contrast evaluation value falls into different ranges, the pyramid feature fusion weight coefficient of the contrast enhancement model is adjusted and the process is repeated until the global contrast evaluation value meets the preset threshold, at which point the final enhanced image is output.

[0005] The RTK positioning system provides the rover station with centimeter-level precision three-dimensional geodetic coordinates by receiving differential signals from the base station and satellites. The rover station is installed on GIS equipment and an X-ray machine.

[0006] Among them, the Monte Carlo scattering estimator simulates the propagation path of X-rays in thick-walled metallic materials based on a photon transport physics model by randomly sampling the scattering angle and energy loss of photons interacting with matter.

[0007] The Compton scattering point spread function is a spatial distribution function that describes the photon energy reduction and directional deflection that occur on the detector plane after an inelastic collision between an X-ray photon and an outer electron.

[0008] Among them, the scattering deconvolution network adopts a deep convolutional neural network architecture to extract the feature representation of the scattering image under different frequency components through multiple convolutional kernels, and uses deconvolution layers to perform inverse operations to separate the Compton scattering point spread function from the initial X-ray projection image.

[0009] The contrast enhancement model is structured as a pyramid attention fusion network, which includes a feature pyramid extraction module, a channel attention module, a spatial attention module, and a multi-scale fusion module.

[0010] Among them, the feature pyramid extraction module extracts multi-scale feature representations of scattering-corrected images in parallel through convolutional layers with different dilation rates, capturing defect information at different scales, from micro-cracks to large-scale conductors.

[0011] The channel attention module automatically suppresses background noise channels and enhances the response of defect-related channels by calculating the importance weights of each feature channel through global average pooling and fully connected layers.

[0012] The spatial attention module uses convolution to calculate the saliency score of each spatial location on the feature map, highlighting defective regions and suppressing interference from normal regions.

[0013] The multi-scale fusion module adaptively fuses attention-weighted features from different pyramid levels, balancing the contributions of global structure and local details through learnable pyramid feature fusion weight coefficients.

[0014] The contrast enhancement model training uses a weighted combination of Focal Loss and Dice Loss as the loss function to alleviate the class imbalance problem between normal and defective regions.

[0015] Among them, the thermal diffusion contrast adjustment algorithm compares the gray-level distribution of the initially enhanced image to a two-dimensional temperature field distribution and uses anisotropic thermal diffusion partial differential equations to describe the transmission process of gray-level values ​​in the space of the initially enhanced image.

[0016] The local gradient structure tensor is obtained by integrating the outer product of the gradient vector of the initial enhanced image within a local window. The eigenvectors of the local gradient structure tensor indicate the tangent and normal of the local edges.

[0017] Among them, the graph cut multi-region segmentation algorithm models the heat diffusion enhancement image as an undirected weighted graph. Each pixel is a node. The weight of the edge connecting adjacent pixels is calculated by combining the gray-level similarity spatial distance and gradient difference between the two pixels.

[0018] The global contrast evaluation value is obtained by weighting the global grayscale dynamic range of the region adaptively enhanced image, the mean local contrast of the region adaptively enhanced image, and the edge preservation index of the region adaptively enhanced image.

[0019] Specifically, when the global contrast evaluation value is less than the preset lower limit threshold, the pyramid feature fusion weight coefficient of the high-level features in the contrast enhancement model is increased to strengthen the global contrast enhancement.

[0020] This invention separates the Compton scattering point spread function from the initial projected image through an inverse operation using a scattering deconvolution network, suppressing scattering artifacts without losing the original X-ray signal, thus providing a high-quality foundation for subsequent enhancement. A pyramid attention fusion network captures multi-scale defect features and focuses on abnormal regions through an attention mechanism. Combined with the anisotropic diffusion strategy of the thermal diffusion contrast adjustment algorithm, it stretches grayscale in uniform regions while suppressing diffusion in edge regions, solving the local imbalance problem caused by global methods. A graph-cut multi-region segmentation algorithm segments the image into homogeneous regions and independently optimizes the contrast parameters of each region, achieving fine-grained local adaptive enhancement. The global contrast evaluation value is used to adjust the pyramid feature fusion weight coefficients, forming a closed-loop optimization. In summary, this invention solves the technical problems mentioned in the background art, such as low contrast in X-ray imaging of thick-walled GIS components and the inability to adaptively enhance different regions. Attached Figure Description

[0021] Figure 1 This is a flowchart of the method of the present invention.

[0022] Figure 2 This is a comparison chart of the scattering deconvolution network architecture and the scattering correction effect.

[0023] Figure 3 This is a tensor space distribution diagram of the diffusion coefficient for the thermal diffusion contrast adjustment algorithm.

[0024] Figure 4 The graph shows the optimized contrast parameter curves between the multi-region segmentation results and the homogeneous regions.

[0025] Figure 5 This is a comparison of the grayscale distribution of the defective areas in the final enhanced image and the initial image. Detailed Implementation

[0026] 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.

[0027] like Figure 1 The diagram shows a flowchart of a contrast enhancement method for improving the X-ray imaging quality of thick-walled GIS components provided by this invention. The method includes the following steps: S01. Acquire initial X-ray projection images of thick-walled GIS components, and obtain the spatial coordinates of the X-ray source focus and the detector center through the RTK positioning system to establish a unified three-dimensional imaging coordinate system. S02. The initial X-ray projection image is subjected to scattering correction processing. The Compton scattering point spread function is calculated using a Monte Carlo scattering estimator. The scattering distribution is spatially and frequency-domain separated by a scattering deconvolution network to obtain the scattering correction image. S03. Input the scattering correction image into the contrast enhancement model for multi-scale feature extraction and defect saliency enhancement to obtain a preliminary enhanced image; S04. Perform a thermal diffusion contrast adjustment algorithm on the preliminary enhanced image. Calculate the diffusion coefficient tensor based on the local gradient structure tensor. Enhance grayscale stretching in uniform regions while suppressing diffusion in edge regions to obtain a thermal diffusion enhanced image. S05. Perform graph cut multi-region segmentation algorithm on the thermal diffusion enhancement image, construct a pixel similarity weighted map and segment it into multiple homogeneous regions through the minimum cut algorithm, optimize the contrast parameter independently for each homogeneous region, and obtain a region adaptive enhancement image. S06. Calculate the global contrast evaluation value of the region adaptive enhancement image. When the global contrast evaluation value falls within different ranges, adjust the pyramid feature fusion weight coefficient of the contrast enhancement model and return to step S03 to re-execute until the global contrast evaluation value meets the preset threshold, and output the final enhanced image.

[0028] The RTK positioning system provides the rover station with centimeter-level precision three-dimensional geodetic coordinates by receiving differential signals from the base station and satellites. The rover station is installed on the GIS equipment and X-ray machine. Through calibration, the relative positional relationship between the phase center of the RTK antenna, the focal point of the X-ray source, and the center of the detector is established. The coordinates of all imaging elements are transformed and unified into the same coordinate system, thereby achieving high-precision spatial alignment between key components inside the GIS and the imaging equipment.

[0029] Among them, the Monte Carlo scattering estimator simulates the propagation path of X-rays in thick-walled metal materials based on a photon transport physics model. By randomly sampling the scattering angle and energy loss of photons interacting with matter, and statistically analyzing a large number of historical photon events, it calculates the ratio distribution of scattered photons to original X-ray photons received at each detector pixel position, forming the Compton scattering point spread function that describes the spatial distribution law of scattering.

[0030] Among them, the Compton scattering point spread function is a spatial distribution function that describes the photon energy reduction and direction deflection caused by the inelastic collision between X-ray photons and outer electrons, forming on the detector plane. In thick-walled GIS shells, scattered photons account for 60% to 80% of the total detection signal, which seriously reduces the imaging contrast.

[0031] Among them, the scattering deconvolution network adopts a deep convolutional neural network architecture. It extracts the feature representation of the scattering image at different frequency components through multiple convolutional kernels, uses deconvolution layers to separate the Compton scattering point spread function from the initial X-ray projection image through inverse operation, and establishes a loss function by combining the scattering consistency constraint of multi-angle projection. By iteratively optimizing the network parameters, the scattering correction image is made close to the real scatter-free projection. Compared with the traditional anti-scattering grid method, it can suppress scattering artifacts by more than 85% without losing the original X-ray signal.

[0032] Spatial frequency domain separation refers to decomposing the initial X-ray projection image into a low-frequency, slowly varying scattering background and a high-frequency detailed structure, and then reconstructing them through frequency domain filters to remove scattering.

[0033] The contrast enhancement model is structured as a pyramid attention fusion network, comprising a feature pyramid extraction module, a channel attention module, a spatial attention module, and a multi-scale fusion module. The feature pyramid extraction module extracts multi-scale feature representations of the scattering correction image in parallel using convolutional layers with different dilation rates, capturing defect information at different scales, from micro-cracks to large-scale conductors. The channel attention module calculates the importance weights of each feature channel using global average pooling and fully connected layers, automatically suppressing background noise channels and enhancing the response of defect-related channels. The spatial attention module calculates the saliency score of each spatial location on the feature map through convolution, highlighting defect areas and suppressing interference from normal areas. The multi-scale fusion module adaptively fuses attention-weighted features from different pyramid levels, balancing the contribution of global structure and local details through learnable pyramid feature fusion weight coefficients, outputting an enhanced feature map which is then mapped to a preliminary enhanced image via convolutional layers.

[0034] The steps for establishing the training dataset for the contrast enhancement model specifically include collecting X-ray projection images of GIS shells of different thicknesses as input samples, generating corresponding high-contrast ideal images through manual annotation or simulation as supervision labels, performing data augmentation operations such as random cropping, rotation, and brightness adjustment on the X-ray projection images to expand sample diversity, and dividing the training dataset into training set, validation set, and test set in a ratio of 8:1:1.

[0035] The specific training steps of the contrast enhancement model include initializing the network parameters as pre-trained weights or random values, using a weighted combination of Focal Loss and Dice Loss as the loss function to alleviate the class imbalance problem between normal and defective regions, using the Adam optimizer to update the parameters with gradient descent at an initial learning rate of 0.001, evaluating the performance on the validation set and saving the optimal model every 10 training epochs, reducing the learning rate by 0.1 times when the validation set loss no longer decreases for 5 consecutive epochs, and stopping training when the total number of training epochs reaches 100 or the validation set performance converges.

[0036] The Pyramid Attention Fusion Network captures multi-scale defect features within GIS, ranging from 0.2mm contact gaps to conductors tens of millimeters in size, through its feature pyramid extraction module. This overcomes the limitation of traditional convolutional networks, whose fixed receptive field cannot accommodate both large and small targets. The channel attention and spatial attention modules enable the Pyramid Attention Fusion Network to automatically focus on salient defect regions with abnormal contrast in scattering-corrected images, suppressing interference from over 95% of the normal background area and significantly improving the detection sensitivity for small target defects. Focal Loss, by reducing the weight of easily classified samples and increasing the loss contribution of difficult-to-classify samples, allows the contrast enhancement model to pay more attention to easily overlooked minute defects during training. Loss further improves segmentation accuracy by directly optimizing the overlap between the predicted and real regions. The combination of the two effectively alleviates the class imbalance problem caused by the defect area accounting for less than 0.1%. The hard sample mining strategy automatically selects the samples with the highest loss values ​​in each training batch for focused learning, which strengthens the contrast enhancement model's ability to identify difficult defects such as blurred edges and extremely low contrast, thereby improving the overall detection performance. The pyramid attention fusion network provides the contrast enhancement model with powerful feature representation and defect localization capabilities, enabling the contrast enhancement model to accurately identify and enhance tiny defects with signal differences of only 1 to 2 gray levels against thick-walled and strongly attenuated backgrounds, while maintaining edge sharpness. This provides a high-quality input foundation for subsequent thermal diffusion contrast adjustment algorithms and graph cut multi-region segmentation algorithms.

[0037] The contrast adjustment coefficient function is used to dynamically adjust the pyramid feature fusion weight coefficient of the contrast enhancement model according to the local gradient characteristics of the preliminary enhanced image. The contrast adjustment coefficient function calculates the adjustment coefficient value based on the global gradient mean, local gradient standard deviation and edge sharpness index of the preliminary enhanced image. When the adjustment coefficient value is in the interval [0, 0.3), a low-weight fusion mode is used to suppress noise amplification. When the adjustment coefficient value is in the interval [0.3, 0.7), a balanced weight fusion mode is used to balance details and smoothness. When the adjustment coefficient value is in the interval [0.7, 1.0], a high-weight fusion mode is used to enhance the contrast of defects. Adaptive processing of images with different contrast distributions is achieved by adjusting the fusion ratio of different pyramid feature levels.

[0038] The thermal diffusion contrast adjustment algorithm analogizes the grayscale distribution of the initially enhanced image to a two-dimensional temperature field distribution. It uses anisotropic thermal diffusion partial differential equations to describe the transmission process of grayscale values ​​in the space of the initially enhanced image. The diffusion term of these equations is controlled by a diffusion coefficient tensor. The principal direction and eigenvalues ​​of the diffusion coefficient tensor are adaptively determined by calculating the local gradient structure tensor of the local gradient of the initially enhanced image. The local gradient structure tensor is obtained by integrating the outer product of the gradient vectors of the initially enhanced image within a local window. The eigenvectors of the local gradient structure tensor indicate the tangent and normal directions of local edges, and the eigenvalues ​​reflect edge strength. In uniform grayscale regions with low gradients, the local gradient structure tensor... With small and isotropic eigenvalues, the thermal diffusion contrast adjustment algorithm sets a large diffusion coefficient tensor to fully diffuse and transmit gray values, thereby stretching the dynamic range of gray values ​​and enhancing local contrast. In high-gradient edge regions, the local gradient structure tensor exhibits significant anisotropy. The thermal diffusion contrast adjustment algorithm maintains a large diffusion coefficient tensor in the tangential direction of the edge to smooth noise, and suppresses the diffusion coefficient tensor in the normal direction of the edge to prevent edge blurring, thus enhancing contrast while maintaining edge sharpness. The anisotropic thermal diffusion partial differential equation is solved iteratively using numerical methods, updating the gray values ​​of the initially enhanced image in each iteration until the overall contrast evaluation index of the initially enhanced image reaches a preset threshold or the number of iterations reaches the upper limit, thus obtaining the thermal diffusion enhanced image.

[0039] The thermal diffusion contrast adjustment algorithm achieves naturalness and adaptability in contrast enhancement by simulating the physical diffusion process, avoiding the problems of local over-enhancement or under-enhancement caused by traditional global methods such as histogram equalization. The anisotropic diffusion strategy based on the local gradient structure tensor can accurately identify the edge direction and intensity in the initially enhanced image. In uniform regions, grayscale stretching is achieved by increasing the diffusion coefficient tensor to improve the visibility of low-contrast regions, while in edge regions, the sharpness of the boundary is maintained by suppressing the normal diffusion coefficient tensor. This solves the contradiction between traditional spatial filtering amplifying noise and frequency filtering blurring edges. The thermal diffusion contrast adjustment algorithm has a significant effect on improving the common problems of low global contrast and uneven local contrast in X-ray images of thick-walled GIS components. It can improve overall readability while accurately preserving the detailed features of key defects such as micro-cracks and contact gaps, laying the foundation for subsequent graph-cut multi-region segmentation algorithms.

[0040] The graph cut multi-region segmentation algorithm models the heat diffusion enhancement image as an undirected weighted graph, where each pixel is a node, and adjacent pixels are connected by edges. The weight of each edge is calculated by combining the gray-level similarity, spatial distance, and gradient difference between the two pixels; edges between pixels with high gray-level similarity have higher weights. The algorithm introduces source and sink nodes to represent the foreground and background, respectively. It uses the minimum cut maximum flow theory to find a set of edges in the undirected weighted graph. After removing this set of edges, the undirected weighted graph is segmented into multiple connected subgraphs, each corresponding to a homogeneous region in the heat diffusion enhancement image. The segmentation objective is to minimize the sum of the weights of the cut edges. Push-Relabel is employed. The algorithm efficiently solves the minimum cut problem. The Push-Relabel algorithm maintains the height label and pre-flow of each node, iteratively performing push and relabel operations until the maximum flow state is reached. The cut set corresponding to this state is the minimum cut. After segmentation, multiple homogeneous regions with relatively uniform gray-level distribution and texture characteristics are obtained. For each homogeneous region, the gray-level histogram of the homogeneous region is calculated independently, and contrast parameters are designed. The smoothness inside the homogeneous region and the sharpness of the boundary between homogeneous regions are balanced by the energy minimization framework. Histogram equalization or gamma correction are used to improve the contrast inside the homogeneous region. Gradient preservation constraints are introduced at the boundary of the homogeneous region to prevent artifacts caused by over-enhancement, thus obtaining a region-adaptive enhanced image.

[0041] The graph-cut multi-region segmentation algorithm achieves fine-grained local adaptive enhancement by segmenting the thermal diffusion enhanced image into multiple homogeneous regions and independently optimizing the contrast parameters of each region. This overcomes the limitation of global enhancement methods, which cannot accommodate regions with different material thicknesses. The minimum cut maximum flow theory ensures the optimality of the segmentation result in an energy sense, making the boundaries of homogeneous regions accurately fit the real material interfaces and structural edges in the thermal diffusion enhanced image, avoiding the sensitivity of traditional threshold segmentation or region growing methods to initial parameters. For composite structures of multiple materials such as aluminum alloy shells, copper conductors, and epoxy insulation components in thick-walled GIS components, the difference in the attenuation coefficients of each material to X-rays leads to highly uneven gray-scale distribution in the imaging. The graph-cut multi-region segmentation algorithm can automatically identify homogeneous regions corresponding to different materials and adjust the enhancement strategy accordingly, significantly improving the detail discernibility at the boundaries of multiple materials. The energy minimization framework optimizes the contrast of each homogeneous region while constraining the boundary gradient to remain sharp, preventing visual discontinuity artifacts caused by differences in enhancement parameters between homogeneous regions. This allows the region-adaptive enhanced image to maintain high contrast while having good overall consistency.

[0042] The global contrast evaluation value is obtained by weighting the global gray-level dynamic range, the mean local contrast value, and the edge preservation index of the region-adaptive enhanced image, and is used to quantitatively evaluate the overall contrast quality of the region-adaptive enhanced image. The global gray-level dynamic range is the ratio of the difference between the maximum and minimum gray-level values ​​of the region-adaptive enhanced image to the theoretical maximum dynamic range, reflecting the degree to which the region-adaptive enhanced image utilizes the gray-level space. The mean local contrast value is obtained by averaging the gray-level standard deviations within each sliding window on the region-adaptive enhanced image, reflecting the richness of local details. The edge preservation index is obtained by calculating the gradient magnitude correlation coefficient between the images before and after enhancement, reflecting the degree to which the enhancement process preserves edge structures. The global gray-level... The dynamic range, mean local contrast of the region-adaptive enhanced image, and edge preservation index of the region-adaptive enhanced image are normalized and then weighted and summed according to preset weight coefficients to obtain the global contrast evaluation value. When the global contrast evaluation value is less than the preset lower threshold, it indicates that the contrast of the region-adaptive enhanced image is insufficient, and the pyramid feature fusion weight coefficient of the high-level features in the contrast enhancement model needs to be increased to enhance the global contrast improvement. When the global contrast evaluation value is between the preset lower threshold and the preset upper threshold, it indicates that the contrast of the region-adaptive enhanced image is moderate, and the current pyramid feature fusion weight coefficient configuration is maintained. When the global contrast evaluation value exceeds the preset upper threshold, it indicates that the contrast of the region-adaptive enhanced image is too strong, which may introduce noise amplification. It is necessary to decrease the pyramid feature fusion weight coefficient of the high-level features and increase the pyramid feature fusion weight coefficient of the low-level features to balance detail preservation and noise suppression.

[0043] Among them, the hard sample mining strategy is a training strategy that automatically selects the sample with the highest loss value in each training batch of the contrast enhancement model for focused learning.

[0044] Optionally, the present invention also provides an application method implemented by a computer to form a contrast enhancement system for improving the X-ray imaging quality of thick-walled GIS components. The computer is provided with a readable storage medium, which stores program instructions. When the program instructions are run in the computer, they execute the above method.

[0045] The specific implementation methods of the above steps are described in detail below.

[0046] The specific implementation of step S01 is as follows: First, an X-ray beam is emitted into the thick-walled GIS component through an X-ray generator. After the X-ray penetrates the thick-walled GIS component, it is received by a flat panel detector to form projection image data. The flat panel detector converts the received X-ray photons into digital grayscale values ​​and stores them as the initial X-ray projection image. At the same time, the RTK positioning system receiver installed on the X-ray generator and the thick-walled GIS component is activated. The RTK positioning system receiver receives differential signals and satellite positioning signals sent by the ground reference station in real time. The three-dimensional coordinates of the X-ray source focus and the detector center in the world geodetic coordinate system are calculated using carrier phase differential positioning technology. The accuracy of the carrier phase differential positioning technology reaches the centimeter level. By using the pre-calibrated relative positional relationship between the X-ray source focus and the phase center of the RTK antenna, as well as the relative positional relationship between the detector center and the phase center of the RTK antenna, the spatial positions of all imaging elements are unified into a three-dimensional imaging coordinate system. The three-dimensional imaging coordinate system is established with the ground reference station as the origin, providing a reference for subsequent spatial positioning and image registration.

[0047] The specific implementation of step S02 involves inputting the initial X-ray projection image into a Monte Carlo scattering estimator to calculate the scattering distribution. The Monte Carlo scattering estimator establishes a three-dimensional model based on the material composition, thickness distribution, and geometry of the thick-walled GIS component. It uses a Monte Carlo random sampling method to simulate the propagation process of a large number of X-ray photons in the thick-walled metallic material. For each photon, the position, scattering angle, and energy loss during Compton scattering are randomly sampled within the material. The number and energy distribution of photons reaching each pixel position of the detector after multiple scattering events are statistically analyzed, and the Compton scattering point spread function, which describes the spatial distribution of the scattering, is calculated. This Compton scattering point spread function reflects... The diffusion range and intensity attenuation of scattered photons in the detector plane were determined. Then, the initial X-ray projection image and the Compton scattering point spread function were input into the scattering deconvolution network. The scattering deconvolution network adopts an encoder-decoder architecture. The encoder extracts multi-scale features of the initial X-ray projection image through multi-layer convolution, and the decoder separates the Compton scattering point spread function from the original signal through deconvolution. During network training, the mean square error of the images before and after scattering correction is used as the loss function. The network parameters are optimized through the backpropagation algorithm. During inference, the network outputs a scattering-corrected image with the scattering component removed. The scattering-corrected image retains the original X-ray signal while suppressing scattering artifacts.

[0048] The specific implementation of step S03 involves inputting the scattering correction image into the feature pyramid extraction module of the contrast enhancement model. This module contains four parallel convolutional branches, each employing dilated convolution kernels with dilation rates of 1, 2, 4, and 8 to extract feature maps at different scales. The dilated convolution expands the receptive field without increasing the number of parameters by inserting zeros between kernel elements, enabling simultaneous capture of 0.2mm-level microcrack features and tens of millimeter-level conductor structure features. The feature maps at the four scales are then input into the channel attention module. This module performs global average pooling on each feature map to obtain a statistical vector for each channel dimension, and calculates the channel's statistical vector using a two-layer fully connected network. The activation weights are multiplied by the original feature map to achieve channel weighting, highlighting defect-related channels and suppressing background noise channels. The weighted feature map is then input into a spatial attention module. This module calculates the saliency score of each spatial location in the feature map through convolution, multiplies the saliency score by the feature map to achieve spatial weighting, highlighting defect areas and suppressing normal areas. The attention-weighted multi-scale features are then input into a multi-scale fusion module. This module uses learnable pyramid feature fusion weight coefficients to weight and sum the features at each scale. The fused features are then mapped through a convolutional layer to form a preliminary enhanced image, in which the contrast of defect areas is initially improved.

[0049] The specific implementation of step S04 involves calculating the horizontal and vertical grayscale gradients of each pixel location in the initially enhanced image. A local gradient structure tensor is constructed using the outer product of the gradient vectors. This local gradient structure tensor is a 2×2 symmetric matrix, obtained by integrating the gradient outer product within a 3×3 neighborhood window. Eigenvalue decomposition is performed on the local gradient structure tensor to obtain two eigenvalues ​​and their corresponding eigenvectors. The eigenvector corresponding to the larger eigenvalue indicates the edge normal direction, and the eigenvector corresponding to the smaller eigenvalue indicates the edge tangential direction. The current pixel location is determined to be either a uniform region or an edge region based on the magnitude of the eigenvalues. A uniform region is defined as both eigenvalues ​​are less than a threshold of 0.05, while an edge region is defined as the larger eigenvalue is greater than a threshold of 0.2. The image is identified as an edge region. In uniform regions, the diffusion coefficient tensor is set to have a diffusion coefficient of 0.8 in both principal directions to promote grayscale diffusion. In edge regions, the tangential diffusion coefficient is set to 0.6 to smooth noise and the normal diffusion coefficient is set to 0.1 to preserve the edge. An anisotropic thermal diffusion partial differential equation is established based on the diffusion coefficient tensor to describe the evolution of grayscale values ​​over time. The anisotropic thermal diffusion partial differential equation is numerically solved using the finite difference method. The time step is set to 0.01 and the spatial step is set to 1 pixel. The grayscale values ​​of the initially enhanced image are iteratively updated. The overall contrast index of the image is calculated every 10 iterations. The iteration stops when the contrast index reaches a preset threshold of 1.5 or the number of iterations reaches 100, and the thermal diffusion enhanced image is output.

[0050] The specific implementation of step S05 involves treating each pixel of the thermal diffusion enhancement image as a node in an undirected weighted graph. For each pixel, the grayscale difference, spatial distance, and gradient difference with its four adjacent pixels (up, down, left, and right) are calculated. A Gaussian function is used to map the grayscale difference to a similarity weight; the smaller the grayscale difference, the larger the similarity weight. The similarity weight, spatial distance weight, and gradient difference weight are multiplied to obtain the edge weight, which is then connected to adjacent pixel nodes. A source node representing the foreground and a sink node representing the background are added to the undirected weighted graph. Pixels with grayscale values ​​greater than a threshold of 150 are connected to the source node, and pixels with grayscale values ​​less than a threshold of 100 are connected to the sink node. The Push-Relabel algorithm is used to solve the maximum flow problem. The Push-Relabel algorithm first initializes the height labels and pre-flow of all nodes, setting a height label for the source node. The degree label represents the total number of nodes, and the preflow is infinite. An iterative push operation is performed to push the preflow from nodes with higher heights to adjacent nodes with lower heights. When a node can no longer be pushed, a remarking operation is performed to increase the node height. This push and remarking process is repeated until the preflow of all nodes reaches a balance. At this point, the maximum flow from the source node to the sink node corresponds to the minimum cut. The undirected weighted graph is divided into multiple connected homogeneous regions along the minimum cut boundary. For each homogeneous region, its gray-level histogram is calculated, and contrast parameters are designed based on the histogram shape. For homogeneous regions with concentrated gray-level distribution, a gamma correction parameter of 0.8 is used to enhance dark details; for homogeneous regions with dispersed gray-level distribution, a linear stretching parameter of 1.2 is used to expand the dynamic range. A total variational regularization constraint is introduced at the boundary of the homogeneous regions to maintain gradient sharpness. This total variational regularization minimizes the image gradient. The norm is used to preserve edges, and contrast parameters are applied to each homogeneous region to synthesize an adaptively enhanced image of the region.

[0051] The specific implementation of step S06 involves calculating the difference between the maximum and minimum grayscale values ​​of the region adaptive enhancement image, dividing the difference by the theoretical maximum dynamic range of 255 to obtain the global grayscale dynamic range, calculating the standard deviation of pixel grayscale values ​​within each window by sliding a 5×5 window on the region adaptive enhancement image, averaging the standard deviations of all windows to obtain the mean local contrast of the region adaptive enhancement image, calculating the gradient magnitude of the scattering correction image and the region adaptive enhancement image, calculating the Pearson correlation coefficient between the two gradient magnitudes to obtain the edge preservation index of the region adaptive enhancement image, normalizing the global grayscale dynamic range, the mean local contrast of the region adaptive enhancement image, and the edge preservation index of the region adaptive enhancement image by their maximum possible values, and then weighting and summing them according to preset weight coefficients of 0.3, 0.4, and 0.3 to obtain the global contrast evaluation value. When the global contrast evaluation value is less than a preset value, the region adaptive enhancement image is considered to have a lower grayscale dynamic range. When the lower threshold is set to 0.6, the contrast adjustment coefficient function is called to calculate the adjustment coefficient value. The contrast adjustment coefficient function takes the global gradient mean of the preliminary enhanced image, the local gradient standard deviation of the preliminary enhanced image, and the edge sharpness index of the preliminary enhanced image as inputs, and calculates the adjustment coefficient value through weighted combination. According to the interval to which the adjustment coefficient value belongs, the pyramid feature fusion weight coefficient of the high-level features in the contrast enhancement model is increased, and the process returns to step S03 to re-execute the contrast enhancement. When the global contrast evaluation value is between the preset lower threshold of 0.6 and the preset upper threshold of 0.85, the current pyramid feature fusion weight coefficient remains unchanged and the region adaptive enhancement image is output as the final enhanced image. When the global contrast evaluation value exceeds the preset upper threshold of 0.85, the pyramid feature fusion weight coefficient of the high-level features is decreased and the pyramid feature fusion weight coefficient of the low-level features is increased, and the process returns to step S03 to re-execute.

[0052] It should be noted that the key technical ideas of this invention include a scattering correction method based on Monte Carlo simulation and deep learning deconvolutional networks, a multi-scale defect enhancement method based on pyramidal attention fusion networks, and an adaptive contrast optimization method based on thermal diffusion equations and graph cut theory. The scattering correction method based on Monte Carlo simulation and deep learning deconvolutional networks accurately estimates the Compton scattering distribution through physical modeling, and combines the nonlinear fitting capability of deep learning networks to achieve effective separation of scattering and primary rays. Compared with traditional anti-scattering grid methods, it avoids a large amount of absorption loss of useful primary rays, maintains signal strength while suppressing scattering artifacts, and significantly improves the signal-to-noise ratio and contrast basis of thick-walled structure imaging. A multi-scale defect enhancement method based on a pyramid attention fusion network achieves adaptive detection and enhancement of defects at different scales by combining multi-scale feature extraction with an attention mechanism. The feature pyramid structure solves the problem that fixed receptive field networks cannot simultaneously handle micro-cracks and large-scale conductors. Channel and spatial attention mechanisms enable the network to focus on the significant defect region while suppressing background interference. The combined loss function of Focal Loss and Dice Loss effectively alleviates the class imbalance problem, significantly improving the detection sensitivity and localization accuracy of small target defects compared to traditional convolutional networks. An adaptive contrast optimization method based on the thermal diffusion equation and graph cut theory achieves a balance between denoising and edge preservation through anisotropic diffusion. The gradient structure tensor-guided diffusion strategy can adaptively adjust the enhancement intensity of different regions. The graph cut algorithm segments the image into multiple homogeneous regions and independently optimizes the enhancement parameters, overcoming the limitation of global methods in handling regions with different material thicknesses. Compared to traditional histogram equalization and other methods, it avoids local over-enhancement and under-enhancement problems, significantly improving the detail discernibility of multi-material composite structure interfaces. The synergistic effect of the three technical approaches forms a complete processing chain from scatter removal and defect detection to contrast optimization. Scatter correction provides a high-quality input foundation for subsequent enhancement, the pyramid attention fusion network accurately locates and highlights the defect area, and the thermal diffusion and graph cut algorithms achieve local adaptive enhancement while maintaining edge sharpness. Through the closed-loop feedback mechanism of the global contrast evaluation value, the parameters of each module are dynamically adjusted, realizing the full-process adaptive processing of X-ray images of thick-walled GIS components from signal recovery to feature enhancement and quality optimization. Compared with traditional methods, this significantly improves the detection rate of small defects and the overall imaging quality.

[0053] It should be noted that this invention also solves the following technical problem: the difficulty in simultaneously capturing multi-scale defect features in X-ray imaging of thick-walled GIS components. This invention utilizes a pyramid attention fusion network's feature pyramid extraction module, employing convolutional layers with different dilation rates to extract multi-scale feature representations in parallel. This captures defect information at different scales, from 0.2mm contact gaps to conductors tens of millimeters in diameter. The channel attention module and spatial attention module enable the network to automatically focus on salient defect areas with abnormal contrast, suppressing interference from normal background areas that account for over 95%. The multi-scale fusion module balances the contribution of global structure and local details through learnable pyramid feature fusion weight coefficients, overcoming the limitation of traditional convolutional networks with fixed receptive fields that cannot accommodate both large and small targets, and significantly improving the detection sensitivity of small target defects.

[0054] Furthermore, this invention also solves the technical problems of edge blurring and noise amplification during contrast enhancement. This invention uses a thermal diffusion contrast adjustment algorithm to calculate the diffusion coefficient tensor based on the local gradient structure tensor. A larger diffusion coefficient is set in the low-gradient uniform region to fully diffuse the grayscale values ​​and achieve dynamic range stretching. In the high-gradient edge region, a larger diffusion coefficient is maintained in the tangential direction to smooth noise, while the diffusion coefficient is suppressed in the normal direction to prevent edge blurring. An anisotropic diffusion strategy accurately identifies the edge direction and intensity, resolving the contradiction between traditional spatial domain filtering amplifying noise and frequency domain filtering blurring edges. This enhances contrast while maintaining edge sharpness and suppressing noise amplification.

[0055] Specifically, the principle of this invention is as follows: the low imaging contrast of thick-walled GIS components stems from two fundamental reasons: a high proportion of scattered photons and uneven grayscale distribution across multiple materials. This invention specifically employs a technical approach combining scattering deconvolution and region adaptive enhancement. The scattering deconvolution network performs frequency domain separation based on the Compton scattering point diffusion function estimated by Monte Carlo, eliminating scattering interference from a physical mechanism rather than simply suppressing it, thus preserving the original ray signal carrying true structural information. The multi-scale feature extraction of the pyramid attention fusion network overcomes the limitation of a fixed receptive field failing to accommodate targets of varying sizes; the attention mechanism allows the network to focus on defect regions with extremely small proportions. The thermal diffusion contrast adjustment algorithm adaptively determines the diffusion coefficient tensor through the local gradient structure tensor, employing differentiated diffusion strategies in uniform and edge regions to avoid the contradictions of global methods. The graph cut multi-region segmentation algorithm ensures optimal segmentation based on the minimum cut maximum flow theory, independently optimizing enhancement parameters for homogeneous regions corresponding to different materials, overcoming the limitation of global methods in accommodating multi-material structures. The global contrast evaluation value integrates grayscale dynamic range and edge preservation exponential quantization to enhance quality. Feedback adjustment of pyramid feature fusion weight coefficients forms an adaptive closed loop, enabling the enhancement process to be dynamically optimized according to image characteristics. Therefore, the technical solution of this invention conforms to the physical imaging mechanism and image processing logic, and can effectively solve the technical problems of low contrast in X-ray imaging of thick-walled GIS components and the inability to adaptively enhance different regions.

[0056] The following provides a specific embodiment 1 of the present invention. The specific implementation methods of steps S01, S02 and S03 in this embodiment 1 are the same as those described above, and will not be repeated in detail here. The specific implementation methods of the remaining steps are described in detail below.

[0057] The specific implementation of step S04 involves applying a thermal diffusion contrast adjustment algorithm to the preliminary enhanced image. Based on the local gradient structure tensor, the diffusion coefficient tensor is calculated. Gray-level stretching is enhanced in uniform regions while diffusion is suppressed in edge regions, resulting in a thermally diffused enhanced image. The thermal diffusion contrast adjustment algorithm analogizes the gray-level distribution of the preliminary enhanced image to a two-dimensional temperature field distribution. It uses anisotropic thermal diffusion partial differential equations to describe the transfer process of gray-level values ​​in the space of the preliminary enhanced image. The anisotropic thermal diffusion partial differential equations are expressed as follows: ; In the formula, To initially enhance the grayscale distribution function of the image, the unit is grayscale level; The diffusion time variable is expressed in seconds. This is used to initially enhance the grayscale gradient vector of the image, with units of grayscale levels per pixel; Here is the diffusion coefficient tensor, expressed in pixels squared per second. It is a divergence operator.

[0058] diffusion coefficient tensor The principal direction and eigenvalues ​​are adaptively determined by calculating the local gradient structure tensor of the preliminary enhanced image local gradient. The formula is expressed as follows: ; In the formula, and The initial enhanced image is in direction and The gradient component in the direction, in units of gray levels per pixel; This is a local integration window, and the window size is typically between 3×3 pixels and 7×7 pixels; This is a differential area element, with units of pixel squares.

[0059] Local gradient structure tensor eigenvectors and Indicates the tangent and normal directions of local edges; local gradient structure tensor. eigenvalues and Reflects edge strength. Eigenvalues and By solving the local gradient structure tensor The characteristic equation is obtained, satisfying... The unit is the square of gray levels per pixel, and the feature vector is... Corresponding to eigenvalues eigenvectors Corresponding to eigenvalues eigenvectors and All are two-dimensional unit vectors. Diffusion coefficient tensor. The formula is expressed as follows: ; In the formula, For feature vectors Transpose of; This is a diffusion adjustment function used to adjust the diffusion intensity based on the feature value, measured in pixels squared per second, grayscale level squared, and pixel squared. The formula is expressed as follows: ; In the formula, The baseline diffusion coefficient is expressed in pixels squared per second, with an empirical value of 1 to 5. The diffusion threshold parameter is expressed in units of gray level squared per pixel squared, with an empirical value ranging from 25 to 225. The anisotropic thermal diffusion partial differential equation is solved iteratively using numerical methods, updating the initial enhanced image gray values ​​in each iteration. The formula for iteratively updating gray values ​​is as follows: ; In the formula, For the first The grayscale value distribution of each iteration, in grayscale levels; For the first The grayscale value distribution of each iteration, in grayscale levels; This represents the number of iterations. The time step is measured in seconds, with an empirical value of 0.1 to 0.25. For the first The diffusion coefficient tensor is calculated in each iteration, with units of pixels squared per second. Iteration continues until the overall contrast evaluation index of the initially enhanced image reaches a preset threshold or the number of iterations reaches the upper limit, thus obtaining a thermally enhanced image. The upper limit of the number of iterations is typically set between 50 and 200.

[0060] The specific implementation of step S05 involves performing a graph-cut multi-region segmentation algorithm on the heat diffusion enhancement image. This constructs a pixel similarity-weighted graph and segments it into multiple homogeneous regions using a minimum cut algorithm. Contrast parameters are independently optimized for each homogeneous region to obtain a region-adaptive enhancement image. The graph-cut multi-region segmentation algorithm models the heat diffusion enhancement image as an undirected weighted graph. Each pixel in the undirected weighted graph is treated as a node, and adjacent pixels are connected by edges, with the weights of the edges... The edge weight is calculated by combining the grayscale similarity, spatial distance, and gradient difference between two pixels. The formula is expressed as follows: ; In the formula, and pixels and pixels The grayscale value, expressed in grayscale levels; and pixels and pixels Spatial location coordinates, in pixels; and pixels and pixels The gradient magnitude at the specified location, expressed in gray levels per pixel; The standard deviation of grayscale similarity is expressed in grayscale levels, with an empirical value of 10 to 30. The standard deviation of spatial distance is expressed in pixels, with an empirical value of 1 to 5. The standard deviation of gradient difference is expressed in gray levels per pixel, with an empirical value of 5 to 20. , and For normalized weight coefficients, satisfying The value is usually taken as , , ; The function is a natural exponential function. A push-relabeling algorithm is used to efficiently solve the minimum cut problem. After segmentation, multiple homogeneous regions with relatively uniform gray-level distribution and texture characteristics are obtained. For each homogeneous region, the gray-level histogram is calculated independently, and contrast parameters are designed. An energy minimization framework is used to balance the smoothness within homogeneous regions with the sharpness of boundaries between them. Histogram equalization or gamma correction are used to enhance contrast within homogeneous regions. Gradient preservation constraints are introduced at the boundaries of homogeneous regions to prevent artifacts caused by over-enhancement, resulting in a region-adaptive enhanced image.

[0061] The specific implementation of step S06 involves calculating the global contrast evaluation value of the region-adaptive enhanced image. When the global contrast evaluation value falls within different ranges, the pyramid feature fusion weight coefficients of the contrast enhancement model are adjusted, and step S03 is returned to be re-executed until the global contrast evaluation value meets the preset threshold, at which point the final enhanced image is output. Global contrast evaluation value The global grayscale dynamic range of the image is enhanced by calculating the region adaptively. Region adaptive enhancement of local image contrast mean Region-adaptive enhancement of image edge preservation index The weighted average is used to obtain the global grayscale dynamic range. The formula is expressed as follows: ; In the formula, The maximum grayscale value of the region adaptively enhanced image, expressed in gray levels; The minimum grayscale value of the region-adaptive enhanced image, expressed in gray levels. Mean local contrast of the region-adaptive enhanced image. The grayscale standard deviation within each window is calculated by sliding a window across the region-adaptive enhanced image, and then the average value is taken. The formula is expressed as follows: ; In the formula, This represents the total number of sliding windows; The number of pixels within each window; The window number; The pixel index within the window; For the first The first window The grayscale value of each pixel, in grayscale levels; For the first The average grayscale value of all pixels within a window, expressed in grayscale levels. Region-adaptive enhancement image edge preservation index. The gradient magnitude correlation coefficient is obtained by calculating the correlation coefficient between the images before and after enhancement, and the formula is expressed as follows: ; In the formula, This represents the total number of pixels in the image. Pixel number; To enhance the first Gradient magnitude of each pixel, in gray levels per pixel; To enhance the subsequent Gradient magnitude of each pixel, in gray levels per pixel; The average of the gradient magnitudes of all pixels before enhancement, expressed in gray levels per pixel; This is the average gradient magnitude of all pixels after enhancement, expressed in gray levels per pixel. Global contrast ratio evaluation value. The formula is expressed as follows: ; In the formula, This represents the theoretical maximum dynamic range, expressed in gray levels, with an empirical value of 255. The normalized baseline value is in gray levels, and the empirical value is 50. The normalized baseline value is 1 (empirical value). , and Let be the weighting coefficient, satisfying The value is usually taken as , , When the global contrast rating value Less than the preset lower threshold This indicates that the region-adaptive enhancement of image contrast is insufficient, and it is necessary to increase the pyramid feature fusion weight coefficient of the high-level features in the contrast enhancement model to strengthen the global contrast improvement. A preset lower threshold is required. The empirical value is 0.6; when the global contrast rating is... Located at the preset lower threshold With preset upper limit threshold The time interval indicates that the region adaptively enhances the image contrast to a moderate level, maintains the current pyramid feature fusion weight coefficient configuration, and presets an upper limit threshold. The empirical value is 0.85; when the global contrast rating is... Exceeding the preset upper limit threshold The results indicate that excessive contrast in region-adaptive enhancement of images may introduce noise amplification. It is necessary to reduce the pyramid feature fusion weight coefficient of high-level features and increase the pyramid feature fusion weight coefficient of low-level features to balance detail preservation and noise suppression.

[0062] The contrast adjustment coefficient function is used to dynamically adjust the pyramid feature fusion weight coefficients of the contrast enhancement model based on the local gradient characteristics of the initially enhanced image. The formula is expressed as follows: ; In the formula, To initially enhance the global gradient mean of the image, the unit is gray level per pixel; The normalized baseline value is in gray levels per pixel, and the empirical value is 20. To initially enhance the local gradient standard deviation of the image, the unit is gray level per pixel; This is a normalized baseline value, with units of gray levels per pixel, and an empirical value of 10. To initially enhance the image edge sharpness index; The normalized baseline value is 1 (empirical value). , and Let be the weighting coefficient, satisfying The value is usually taken as , , Preliminary enhancement of image edge sharpness index The formula is expressed as follows: ; In the formula, This represents the total number of edge pixels detected. The edge pixel number; For the first The Laplacian operator value at each edge pixel, in units of gray levels per pixel squared. When the contrast adjustment coefficient function value... When the value falls within the range of 0 to 0.3, a low-weighted fusion mode is used to suppress noise amplification. When the contrast adjustment coefficient function value... When the contrast ratio falls within the range of 0.3 to 0.7, a balanced weighted blending mode is used to balance detail and smoothness. When the contrast adjustment coefficient function value... When the image falls within the range of 0.7 to 1.0, a high-weight fusion mode is used to enhance the contrast of defects. Adaptive processing of images with different contrast distributions is achieved by adjusting the fusion ratio of features at different levels of the pyramid.

[0063] To better understand and implement this invention, the following is a specific application scenario of this invention, Example 2: To verify the effectiveness of this invention, technicians set up a test environment and selected a 220kV thick-walled GIS device for X-ray imaging testing. The device's outer shell is made of aluminum alloy with a wall thickness of 45mm, and its internal structure includes a composite of copper conductors, epoxy insulation, and other materials. A 450kV industrial X-ray machine was used as the X-ray source, with a digital flat panel detector pixel size of 0.2mm and an imaging resolution of 2048×2048 pixels. During imaging, the RTK positioning system's base station was set up in a fixed position, and the rover station was installed on both the X-ray machine and the GIS device. Centimeter-level positioning accuracy was achieved by receiving differential signals, establishing a unified three-dimensional imaging coordinate system. The X-ray source focal point coordinates were (1250.34, 2340.67, 1580.23)mm, the detector center coordinates were (1250.18, 4560.89, 1580.45)mm, and the source-image distance was 2220mm. The initial X-ray projection image acquired was 2048×2048 pixels in size, with a grayscale range of 0 to 4095. Due to the strong attenuation effect of the thick-walled metal shell, the overall grayscale of the initial image was low, concentrated in the range of 500 to 1200, with a global contrast of only 0.17 and a local average contrast of 23.5, making it difficult to identify minute internal defects.

[0064] Technicians first performed scattering correction on the initial X-ray projection image, and then used a Monte Carlo scattering estimator to simulate... The transport process of individual photons in thick-walled metallic materials was analyzed, and the Compton scattering point spread function was calculated, showing that scattered photons accounted for 72% of the total detected signal. For example... Figure 2As shown, the scattering deconvolutional network adopts a deep convolutional neural network architecture, containing 5 convolutional layers and 3 deconvolutional layers. A loss function is established through scattering consistency constraints based on multi-angle projection. After iterative optimization, scattering artifacts are suppressed by 87%, expanding the grayscale range of the scattering-corrected image to 200-2800 and improving the global contrast to 0.34. The scattering-corrected image is then input into a contrast enhancement model for multi-scale feature extraction. This model employs a pyramid attention fusion network structure. The feature pyramid extraction module contains four convolutional layers with different dilation rates of 1, 2, 4, and 8, capable of capturing multi-scale defect features ranging from 0.2mm contact gaps to 50mm conductors. The channel attention module calculates the importance weights of 128 feature channels through global average pooling, automatically suppressing background noise channels and enhancing the response of defect-related channels. The spatial attention module calculates the saliency score for each spatial location on the feature map, highlighting the response intensity of the defect region. The multi-scale fusion module adaptively fuses the attention-weighted features of four pyramid levels. The initial pyramid feature fusion weight coefficients are 0.1, 0.2, 0.3, and 0.4, respectively. The grayscale range of the output enhanced image is 150 to 3200, the global contrast is 0.52, and the local average contrast is increased to 45.8.

[0065] like Figure 3 As shown, technicians applied a thermal diffusion contrast adjustment algorithm to the initially enhanced image, analogizing the grayscale distribution to a two-dimensional temperature field distribution and using anisotropic thermal diffusion partial differential equations to describe the grayscale value transfer process. The local gradient structure tensor of the initially enhanced image was calculated, and the outer product of the gradient vectors was integrated within a 5×5 local window to obtain the eigenvalues ​​and eigenvectors of the structure tensor. The eigenvalues ​​reflect edge strength, and the eigenvectors indicate the tangential and normal directions of the edges. In low-gradient, uniform grayscale regions, the eigenvalues ​​of the structure tensor are less than 0.05 and are isotropic. The diffusion coefficient tensor is set to 0.8 to ensure sufficient grayscale diffusion and achieve a stretching of the grayscale dynamic range. In high-gradient edge regions, the structure tensor exhibits significant anisotropy, with eigenvalues ​​greater than 0.3. The diffusion coefficient tensor is maintained at 0.6 in the tangential direction to smooth noise, while in the normal direction, it is reduced to 0.1 to prevent edge blurring. As shown in Table 1, after 50 iterations, the grayscale range of the thermal diffusion enhanced image is 50 to 3800, the global contrast is improved to 0.68, the average local contrast reaches 62.3, and the edge preservation index is 0.91, which effectively improves the visibility of low contrast areas and maintains the sharpness of edges.

[0066] Table 1. Parameters of the iterative process of the thermal diffusion contrast adjustment algorithm

[0067] Technicians applied a graph-cut multi-region segmentation algorithm to the thermal diffusion enhanced image, modeling the image as an undirected weighted graph where each pixel is a node, and adjacent pixels are connected by edges. The edge weights are calculated based on a combination of gray-level similarity, spatial distance, and gradient difference. Source and sink nodes are introduced to represent the foreground and background, respectively. A push-relabel algorithm is used to solve the minimum cut problem, iteratively performing push and relabel operations until the maximum flow state is reached. After segmentation, seven homogeneous regions are obtained, corresponding to the aluminum alloy shell region, copper conductor region, epoxy insulation region, air gap region, and three transition regions. Figure 4 As shown, grayscale histograms are calculated independently for each homogeneous region, and contrast parameters are designed. An enhancement strategy with a gamma correction coefficient of 1.2 is used for the aluminum alloy shell region, histogram equalization is used for the copper conductor region, adaptive contrast-limited histogram equalization is used for the epoxy insulation region, and linear stretching is used for the air gap region. By balancing the smoothness within homogeneous regions with the sharpness of boundaries between them through an energy minimization framework, a grayscale range of 0 to 4095 is obtained for the region-adaptive enhanced image, achieving a global contrast ratio of 0.85 and a local average contrast ratio of 78.6.

[0068] Technicians calculated the global contrast evaluation value of the region-adaptive enhanced image by weighting the global gray-level dynamic range, the local mean contrast value, and the edge preservation index. The global gray-level dynamic range is the ratio of the difference between 4095 and 0 to the theoretical maximum dynamic range of 4095, resulting in 1.00. The local mean contrast value is obtained by averaging the gray-level standard deviations within each window of the region-adaptive enhanced image (sliding a 7×7 window), resulting in 78.6. The edge preservation index is obtained by calculating the correlation coefficient of the gradient magnitudes of the images before and after enhancement, resulting in 0.88. After normalizing the three indicators, they are weighted and summed according to weight coefficients of 0.3, 0.5, and 0.2, yielding a global contrast evaluation value of 0.82. This value falls between the preset lower threshold of 0.6 and the preset upper threshold of 0.9, indicating that the contrast of the region-adaptive enhanced image is moderate and maintains the current pyramid feature fusion weight coefficient configuration. Figure 5 As shown, the final enhanced image can clearly display a 0.3mm contact gap defect, a 1.2mm conductor microcrack, and a 2.5mm insulation bubble defect inside the GIS. Compared with the initial image, the signal difference is increased from 1 to 2 gray levels to 50 to 80 gray levels, which significantly improves the identifiability of the defects.

[0069] This invention represents a significant advancement over traditional methods, primarily in the following aspects. Traditional X-ray imaging methods typically employ anti-scattering grids to physically remove scattered photons, but this simultaneously results in the loss of a large amount of original X-ray signal, leading to prolonged imaging time and increased dose. In contrast, this invention uses a scattering deconvolution network to separate the scattering distribution through numerical calculations, significantly suppressing scattering artifacts without losing the original X-ray signal, fundamentally solving the contrast reduction problem caused by the high scattering ratio of thick-walled metallic materials. Traditional contrast enhancement methods, such as histogram equalization and gamma correction, are global enhancement strategies that cannot account for the differences in material thickness across different regions in thick-walled GIS components, often resulting in over-enhancement of thin-walled areas and under-enhancement of thick-walled areas. This invention, however, extracts multi-scale features through a pyramid attention fusion network and automatically focuses on areas with significant defects by combining channel and spatial attention mechanisms, achieving adaptive enhancement of defects at different scales. Traditional spatial filtering methods amplify noise and blur edges while enhancing contrast, while frequency domain filtering methods suppress noise but lose high-frequency details. This invention, however, utilizes a thermal diffusion contrast adjustment algorithm based on local gradient structure tensors to achieve anisotropic diffusion. This algorithm enhances grayscale stretching in uniform regions while suppressing diffusion in edge regions, cleverly balancing the contradiction between contrast enhancement and edge preservation. Traditional segmentation methods such as thresholding and region growing are sensitive to initial parameters and struggle with multi-material composite structures. This invention, however, employs a graph-cut multi-region segmentation algorithm based on the minimum-cut maximum-flow theory to ensure optimal segmentation results in an energy sense. It accurately identifies homogeneous regions corresponding to different materials and adjusts enhancement strategies accordingly, significantly improving the discernibility of details at multi-material boundaries. Furthermore, this invention quantifies the enhancement effect using a global contrast evaluation value and dynamically adjusts the pyramid feature fusion weight coefficients, forming a closed-loop feedback optimization mechanism. This ensures optimal enhancement results across images with different contrast distributions, overcoming the limitations of traditional methods with fixed parameters that cannot be adaptively adjusted.

[0070] It should be noted that the variables involved in this invention are explained in detail in Tables 2 and 3.

[0071] Table 2. Variable Explanation Table (Part 1)

[0072] Table 3. Variable Explanation Table (Part Two)

[0073] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A contrast enhancement method for improving the X-ray imaging quality of thick-walled GIS components, characterized in that, Includes the following steps: Initial X-ray projection images of thick-walled GIS components are acquired, and the spatial coordinates of the X-ray source focus and detector center are obtained through an RTK positioning system to establish a unified three-dimensional imaging coordinate system. The initial X-ray projection images undergo scattering correction processing. The Compton scattering point spread function is calculated using a Monte Carlo scattering estimator, and the scattering distribution is spatially and frequency-domain separated using a scattering deconvolution network to obtain a scattering-corrected image. This scattering-corrected image is then input into a contrast enhancement model for multi-scale feature extraction and defect saliency enhancement to obtain a preliminary enhanced image. A thermal diffusion contrast adjustment algorithm is then applied to the preliminary enhanced image. Based on the local gradient structure tensor, the diffusion coefficient tensor is calculated to enhance grayscale stretching in uniform regions while suppressing diffusion in edge regions, resulting in a thermal diffusion enhanced image. A graph cut multi-region segmentation algorithm is then applied to the thermal diffusion enhanced image to construct a pixel similarity weighted map, which is then segmented into multiple homogeneous regions using a minimum cut algorithm. Contrast parameters are independently optimized for each homogeneous region to obtain a region-adaptive enhanced image. The global contrast evaluation value of the region-adaptive enhanced image is calculated. When the global contrast evaluation value falls within different ranges, the pyramid feature fusion weight coefficient of the contrast enhancement model is adjusted, and the process is repeated until the global contrast evaluation value meets a preset threshold, at which point the final enhanced image is output.

2. The method according to claim 1, characterized in that, The RTK positioning system provides the rover station with three-dimensional geodetic coordinates with centimeter-level accuracy by receiving differential signals from the base station and satellites. The rover station is installed on GIS equipment and X-ray machines.

3. The method according to claim 2, characterized in that, The Monte Carlo scattering estimator simulates the propagation path of X-rays in thick-walled metallic materials based on a photon transport physics model by randomly sampling the scattering angle and energy loss of photons interacting with matter.

4. The method according to claim 3, characterized in that, The Compton scattering point spread function is a spatial distribution function that describes the photon energy reduction and directional deflection that occur in the detector plane after an inelastic collision between an X-ray photon and an outer electron.

5. The method according to claim 4, characterized in that, The scattering deconvolution network employs a deep convolutional neural network architecture to extract feature representations of the scattering image at different frequency components through multiple convolutional kernels. It also uses deconvolutional layers to perform inverse operations to separate the Compton scattering point spread function from the initial X-ray projection image.

6. The method according to claim 5, characterized in that, The contrast enhancement model is structured as a pyramid attention fusion network. It includes a feature pyramid extraction module, a channel attention module, a spatial attention module, and a multi-scale fusion module.

7. The method according to claim 6, characterized in that, The feature pyramid extraction module extracts multi-scale feature representations of scatter-corrected images in parallel through convolutional layers with different dilation rates, capturing defect information at different scales, from micro-cracks to large-scale conductors.

8. The method according to claim 7, characterized in that, The channel attention module automatically suppresses background noise channels and enhances the response of defect-related channels by calculating the importance weights of each feature channel through global average pooling and fully connected layers.

9. The method according to claim 8, characterized in that, The spatial attention module uses convolution to calculate the saliency score of each spatial location on the feature map, highlighting defective regions and suppressing interference from normal regions.

10. The method according to claim 9, characterized in that, The multi-scale fusion module adaptively fuses attention-weighted features from different pyramid levels, balancing the contributions of global structure and local details through learnable pyramid feature fusion weight coefficients.