Distortion processing method and system for X-ray detection image of GIS equipment
By combining an improved convolutional neural network with a generative adversarial network, the problems of insufficient accuracy and strong dependence on labeled data in X-ray inspection images of GIS equipment were solved, achieving efficient distortion correction and improving image quality and detection accuracy.
Patent Information
- Application Number
- CN202511682330.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies for processing X-ray images from GIS equipment suffer from insufficient accuracy in handling complex distortions, strong dependence on labeled data, and low system integration. They are unable to effectively correct complex distortions caused by the coupling of multiple physical factors, especially when dealing with multi-scale distortion features, and cannot take into account both global distortion patterns and local distortion details.
By combining an improved convolutional neural network with a generative adversarial network, preprocessing is performed using adaptive median filtering and histogram equalization algorithms, multi-scale distortion features are extracted using an attention mechanism module, and a distortion model is constructed using a generative adversarial network, thus achieving hierarchical decomposition and precise restoration from image preprocessing to pixel-level correction.
It significantly improves the accuracy and effectiveness of complex distortion processing, reduces dependence on labeled data, enhances system integration and processing efficiency, and ensures high fidelity of geometric and grayscale information in the corrected image.
Smart Images

Figure CN121504778A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power equipment inspection, and in particular to a method and system for distortion processing of X-ray inspection images of GIS equipment. Background Technology
[0002] As a critical infrastructure of the power system, the internal structural integrity inspection of GIS equipment plays a decisive role in ensuring the safe operation of the power grid. X-ray non-destructive testing technology has become an important means of monitoring the condition of power equipment by enabling visual observation of the internal structure of the equipment through penetrating imaging. However, the X-ray imaging process involves a complex multi-physics coupling mechanism, including factors such as the characteristic parameters of the X-ray source, the mechanical assembly accuracy of the inspection system, the three-dimensional geometric features of the equipment under test, and the non-uniformity of the medium distribution in the X-ray penetration path. The interaction of these physical factors will form complex geometric distortion effects in the inspection image.
[0003] This distortion leads to a nonlinear mapping between the image coordinate system and the actual physical space, severely affecting the accuracy of the image in representing the geometric features of the internal structure of the equipment, and thus reducing the reliability of image analysis-based defect identification algorithms. Current mainstream image distortion correction techniques mainly employ two approaches: physical modeling and deep learning. Physical modeling methods require the precise construction of a complete physical model that includes elements such as the characteristics of the radiation source, mechanical assembly parameters, equipment structural features, and medium distribution. However, in practical engineering applications, it is difficult to accurately obtain all the necessary parameters, resulting in insufficient model accuracy and limited correction effectiveness.
[0004] While deep learning methods possess powerful feature learning capabilities, they require a large amount of professionally labeled training data. However, the annotation of X-ray images from GIS equipment demands both deep domain expertise and faces the practical challenge of high annotation costs. More significantly, existing correction methods typically optimize for single distortion types, failing to effectively handle complex distortion problems caused by the coupling of multiple physical factors in GIS equipment inspection. This technical bottleneck severely restricts the analytical accuracy and engineering application value of the inspected images. Particularly when processing multi-scale distortion features, traditional methods cannot simultaneously account for global distortion patterns and local distortion details, resulting in significant geometric distortion remaining in the corrected images.
[0005] Furthermore, existing methods lack targeted attention to key image regions during distortion feature extraction and model construction, further limiting the accuracy and reliability of distortion correction.
[0006] In summary, current power equipment testing methods generally suffer from problems such as insufficient accuracy in handling complex distortions, strong dependence on labeled data, and low system integration. Summary of the Invention
[0007] The purpose of this invention is to overcome the defects of the prior art and provide a method and system for distortion processing of X-ray inspection images of GIS equipment.
[0008] The objective of this invention can be achieved through the following technical solutions: According to one aspect of the present invention, a method for distortion processing of X-ray inspection images from GIS equipment is provided, characterized in that the method includes the following steps: S1. Obtain the original distorted image and preprocess it, then output the preprocessed image. S2. Use an improved convolutional neural network to extract distortion features from the preprocessed image and output a feature vector containing multi-scale distortion information of the image. S3. Based on feature vectors containing multi-scale image distortion information, a distortion model is constructed using a generative adversarial network (GAN). S4. Generate a simulated distorted image based on the constructed distortion model. Based on the simulated distorted image, find the ideal distortion-free image corresponding to its original distorted image, and use it as the predicted ideal distortion-free image. S5. Based on the predicted ideal distortion-free image, perform distortion correction on the original distorted image and output the corrected image.
[0009] As a preferred technical solution, the preprocessing of the original distorted image in S1 includes: noise reduction and grayscale adjustment of the original distorted image.
[0010] As a preferred technical solution, the noise reduction process specifically adopts an adaptive median filtering algorithm, and the adaptive median filtering algorithm dynamically adjusts the size of the filtering window according to the noise characteristics of different regions of the image; S11. Set the center pixel of the filter window, preset the size of the filter window, and create a set of pixels within the window centered on the center pixel; S12. Based on the pixel set, calculate the median, maximum, and minimum values of the pixels within the window, respectively; S13. If the difference between the median and the minimum value is greater than zero, and the difference between the median and the maximum value is less than zero, then it is determined that the current preset filtering window size is suitable for filtering, and step S14 is continued; otherwise, the window size is incremented by one, and it is determined whether the current window size is greater than the preset maximum window size. If it is greater, the pixel value at this time is directly output; otherwise, step S12 is executed. S14. Determine whether the current pixel is a noise point; if the difference between the current pixel value and the minimum value is greater than zero, and the difference between the current pixel value and the maximum value is less than zero, then the current pixel is determined to be a non-noise point, and the pixel value of the current pixel is output; otherwise, the median value of the pixel is output.
[0011] As a preferred technical solution, grayscale adjustment specifically employs a histogram equalization algorithm. The histogram equalization algorithm statistically analyzes the frequency of each grayscale value in the original distorted image and performs cumulative distribution to obtain a cumulative distribution function. After normalizing the cumulative distribution function, the grayscale values of the original distorted image are mapped to new grayscale values. The specific process of grayscale adjustment includes: first, calculating the grayscale frequency of the original distorted image after noise reduction based on the total number of pixels and total grayscale values of the original distorted image; then, accumulating the grayscale frequency to obtain the cumulative distribution function; and finally, mapping the original grayscale values to new grayscale values according to the cumulative distribution function.
[0012] As a preferred technical solution, the improved convolutional neural network in S2 includes convolutional layers, pooling layers, and activation functions; The preprocessed image is processed by this improved convolutional neural network to extract shallow and deep distortion features, and these features are then fused to output a feature vector containing multi-scale distortion information of the image. The specific process includes: After receiving the preprocessed image, the convolutional neural network slides each convolutional kernel across the input image to extract local features. That is, each convolutional kernel performs a convolution operation on the preprocessed image to extract a primary feature map. The primary feature map undergoes a non-linear transformation through an activation function. Then, it enters the pooling layer to perform max pooling, taking the maximum value of each element within the window and outputting the pooled feature map. This pooled feature map is then converted into a feature vector, which is used as a feature vector containing multi-scale distortion information of the image and output.
[0013] As a preferred technical solution, the improved convolutional neural network also includes one or more attention mechanism modules. The input of the attention mechanism module is a pooled feature map. Based on the pooled feature map, the attention mechanism module calculates weights in both spatial and channel dimensions to focus on the distorted region. By performing multi-scale feature fusion on the intermediate feature map, edge and texture details are extracted as shallow features, local structural information is extracted as mid-level features, and global semantic information is extracted as deep features. Finally, the shallow, mid-level, and deep features are integrated, and upsampling and downsampling are used to make the feature map sizes of different scales consistent. Then, they are concatenated in the channel dimension to obtain the final feature map. The final feature map is converted into a feature vector, which is then output as a feature vector containing multi-scale distortion information of the image. The specific process of weight calculation in both spatial and channel dimensions includes: The channel scalar of the feature map for each channel is calculated based on the pooled feature map. Then, the ReLU activation function and the Sigmoid function are applied. The channel scalars are mapped through a multilayer perceptron to obtain a weight matrix. This weight matrix is used to weight the channels to obtain the weight of each channel attention. Based on the weight of each channel attention, the global average pooling feature and the max pooling feature for each space are calculated. The global average pooling feature and the max pooling feature are concatenated, and the concatenation result is normalized using the Sigmoid function to obtain the weight of the spatial attention. The channel attention and the spatial attention are then weighted and fused to obtain the intermediate feature map.
[0014] As a preferred technical solution, the specific process of constructing the distortion model in S3 includes: The feature vector containing multi-scale distortion information of the image is input into the generator, which performs mapping to generate a simulated distorted image. The generator consists of transposed convolutional layers, which restore the feature vector to the image through upsampling, and a random noise vector is configured in the generation process. The discriminator is used to evaluate the difference between the generated simulated distorted image and the ideal undistorted image. The discriminator is used to train the generator so that the generator can produce simulated images that are closer to the ideal undistorted image. After the discriminator distinguishes between the ideal undistorted image and the generated simulated distorted image, it performs recurrent adversarial training on the generator based on the difference until the feature vector distribution of the simulated distorted image output by the generator is consistent with that of the ideal undistorted image, that is, the training is completed. The trained generator model is output as the distortion model.
[0015] As a preferred technical solution, the process of generating the predicted ideal distortion-free image in S4 includes: Establish a Mod distortion mapping function based on the mapping relationship between simulated distorted images and ideal distortion-free images; Using a distortion model based on the Mod distortion mapping function, the feature vector of the original distorted image is input to generate the corresponding predicted ideal distortion-free image.
[0016] As a preferred technical solution, when performing distortion correction in S5, the specific steps are as follows: calculate the bilinear interpolation relationship between the original distorted image and the predicted ideal distortion-free image; based on the bilinear interpolation relationship, map the pixels in the original distorted image to the corresponding positions in the predicted ideal distortion-free image to obtain the corrected image.
[0017] According to another aspect of the present invention, a distortion processing system for X-ray inspection images of GIS equipment is provided, comprising an image preprocessing module, a distortion feature extraction module, a distortion model construction module, and a distortion correction module connected in sequence.
[0018] The image preprocessing module is used to store ideal, distortion-free images of GIS equipment X-ray detection from the manufacturer's original library, acquire original distorted images of GIS equipment X-ray detection, perform noise reduction processing on the original images, and perform noise reduction and grayscale adjustment on the original images to obtain preprocessed images.
[0019] The distortion feature extraction module is used to extract distortion features from the preprocessed image and output a feature vector containing multi-scale distortion information of the image.
[0020] The distortion model construction module is used to construct distortion models using generative adversarial networks based on feature vectors.
[0021] The distortion correction module is used to generate a simulated distorted image based on the constructed distortion model, find the ideal distortion-free image corresponding to the original distorted image based on the simulated distorted image as the prediction result, use the corresponding ideal distortion-free image as the predicted ideal distortion-free image, perform distortion correction on the original distorted image based on the predicted ideal distortion-free image, and output the corrected image.
[0022] According to another aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described method for processing distortion of X-ray images detected by a GIS device.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the distortion processing steps of the above-described method for X-ray inspection images of a GIS device.
[0024] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the steps of the above-described method for distortion processing of X-ray inspection images of a GIS device.
[0025] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention combines an improved convolutional neural network (CNN) with a generative adversarial network (GAN). The improved CNN, by introducing an attention mechanism, can accurately extract multi-scale distortion features, while the GAN, through adversarial training, constructs a distortion model that can accurately simulate various complex distortion situations. Compared to traditional physical model methods and single deep learning schemes, this invention achieves layered decomposition and precise repair of complex distortions from image preprocessing to pixel-level correction, ensuring high fidelity of the geometric and grayscale information of the corrected image. This significantly improves the accuracy and effectiveness of complex distortion processing.
[0026] 2. In this invention, preprocessing operations such as denoising and grayscale adjustment on the original distorted image remove image noise interference and enhance image grayscale contrast, providing higher-quality input data for subsequent distortion feature extraction and model construction, thus improving the stability and accuracy of the entire distortion processing flow. Furthermore, the use of an adaptive median filtering algorithm with dynamic adjustment of the filtering window size enables precise noise reduction based on the noise characteristics of different regions of the image, effectively removing noise while preserving image details to the greatest extent possible, avoiding the detail blurring problem that easily occurs in traditional filtering algorithms, and improving the quality of image preprocessing. Histogram equalization is used for grayscale adjustment to optimize the grayscale distribution of the original distorted image, enhancing the image's grayscale levels and detail expression, making image features easier for subsequent networks to extract, laying the foundation for the accuracy of distortion feature extraction; thus achieving dynamic noise reduction.
[0027] 3. In this invention, the improved convolutional neural network integrates shallow and deep distortion features, which can fully extract multi-scale distortion information of images, realize the comprehensive capture of distortion features from local to global, provide rich and accurate feature support for distortion model construction, and improve the representation ability of distortion models.
[0028] Furthermore, an attention mechanism module is introduced into the improved convolutional neural network. By calculating the weights of spatial and channel dimensions, the distortion region is focused. At the same time, multi-scale features are integrated, which can enhance the extraction of key distortion features, suppress interference from irrelevant information, and further improve the representation accuracy and relevance of distortion feature vectors.
[0029] 4. In this invention, a generative adversarial network is used to construct a distortion model. The distortion rules are learned autonomously through adversarial training between the generator and the discriminator. This eliminates the need to rely on large-scale manually annotated distortion-free images, reducing dependence on annotation data and improving the versatility and scalability of the solution. The steps are closely connected and the technical modules are highly coordinated, realizing one-stop processing from the original distorted image to the corrected image, which greatly improves the system integration and processing efficiency.
[0030] Furthermore, it employs the adversarial training mechanism of generative adversarial networks to achieve unsupervised feature learning, breaking through the dependence on large-scale labeled data and effectively reducing data labeling costs and technical barriers. Through cyclic adversarial training between the generator and the discriminator, the precise mapping relationship between distorted images and ideal undistorted images can be learned. The feature distribution of the generated simulated distorted images is highly consistent with that of the ideal undistorted images, providing reliable model support for subsequent undistorted image prediction.
[0031] 5. In this invention, by generating a predicted ideal distortion-free image based on the Mod distortion mapping function and the distortion model, a precise mapping from the original distorted image to the ideal distortion-free image can be achieved, providing a clear reference standard for distortion correction and ensuring the accuracy of the distortion correction results.
[0032] 6. In this invention, the original distorted image pixels are mapped to the corresponding positions of the predicted ideal distortion-free image through bilinear interpolation, thereby achieving pixel-level accurate distortion correction. This makes the corrected image closer to the ideal distortion-free state in terms of geometric structure and grayscale information, significantly improving the accuracy of image distortion correction. Attached Figure Description
[0033] Figure 1 This is a step diagram of a distortion processing method for X-ray inspection images of GIS equipment according to the present invention; Figure 2 This is a schematic diagram illustrating the specific process of constructing the distortion model in this invention; Figure 3 This is a structural diagram of a distortion processing system for X-ray images detected by a GIS device, as described in this embodiment. Detailed Implementation
[0034] 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, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0035] To address the shortcomings of existing technologies, such as insufficient accuracy in handling complex distortions, strong dependence on labeled data, and low system integration, this solution combines an improved convolutional neural network (CNN) with a generative adversarial network (GAN). First, it preprocesses the original image using an adaptive median filtering algorithm and a histogram equalization algorithm. Second, it extracts multi-scale distortion features using an improved CNN with an attention mechanism module. Then, it constructs an accurate distortion model based on the GAN. Finally, it establishes a mapping relationship for distortion correction. This approach effectively handles distortion problems caused by the combined effects of multiple complex distortion factors in X-ray inspection images of GIS equipment, improving image quality and providing high-quality image data for the accurate identification and analysis of internal defects in GIS equipment, thereby enhancing the accuracy and reliability of GIS equipment inspection.
[0036] Example 1 In this embodiment, a distortion processing method for X-ray inspection images from a GIS device is used, and the method steps are as follows: Figure 1 As shown, it specifically includes: S1. Obtain the original distorted image and preprocess it, then output the preprocessed image. S2. Use an improved convolutional neural network to extract distortion features from the preprocessed image and output a feature vector containing multi-scale distortion information of the image. S3. Based on feature vectors containing multi-scale image distortion information, a generative adversarial network is used to construct a distortion model; S4. Generate a simulated distorted image based on the constructed distortion model. Based on the simulated distorted image, find the ideal distortion-free image corresponding to its original distorted image, and use it as the predicted ideal distortion-free image. S5. Based on the predicted ideal distortion-free image, perform distortion correction on the original distorted image and output the corrected image.
[0037] The preprocessing of the original distorted image in S1 includes: noise reduction and grayscale adjustment of the original distorted image.
[0038] The noise reduction process specifically employs an adaptive median filtering algorithm, which dynamically adjusts the filtering window size based on the noise characteristics of different regions of the image. S11. Set the center pixel of the filter window, preset the size of the filter window, and create a set of pixels within the window centered on the center pixel; S12. Based on the pixel set, calculate the median, maximum, and minimum values of the pixels within the window, respectively; S13. If the difference between the median and the minimum value is greater than zero, and the difference between the median and the maximum value is less than zero, then it is determined that the current preset filtering window size is suitable for filtering, and step S14 is continued; otherwise, the window size is incremented by one, and it is determined whether the current window size is greater than the preset maximum window size. If it is greater, the pixel value at this time is directly output; otherwise, step S12 is executed. S14. Determine whether the current pixel is a noise point; if the difference between the current pixel value and the minimum value is greater than zero, and the difference between the current pixel value and the maximum value is less than zero, then the current pixel is determined to be a non-noise point, and the pixel value of the current pixel is output; otherwise, the median value of the pixel is output.
[0039] The grayscale adjustment specifically employs a histogram equalization algorithm. This algorithm statistically analyzes the frequency of each grayscale value in the original distorted image and performs cumulative distribution to obtain a cumulative distribution function. After normalizing the cumulative distribution function, the grayscale values of the original distorted image are mapped to new grayscale values. The specific process of grayscale adjustment includes: first, calculating the grayscale frequency of the original distorted image after noise reduction based on the total number of pixels and total grayscale values of the original distorted image; then, accumulating the grayscale frequency to obtain the cumulative distribution function; and finally, mapping the original grayscale values to new grayscale values based on the cumulative distribution function.
[0040] The improved convolutional neural network in S2 includes convolutional layers, pooling layers, and activation functions; The preprocessed image is processed by this improved convolutional neural network to extract shallow and deep distortion features, and these features are then fused to output a feature vector containing multi-scale distortion information of the image. The specific process includes: After receiving the preprocessed image, the convolutional neural network slides each convolutional kernel across the input image to extract local features. That is, each convolutional kernel performs a convolution operation on the preprocessed image to extract a primary feature map. The primary feature map undergoes a non-linear transformation through an activation function. Then, it enters the pooling layer to perform max pooling, taking the maximum value of each element within the window and outputting the pooled feature map. This pooled feature map is then converted into a feature vector, which is used as a feature vector containing multi-scale distortion information of the image and output.
[0041] The improved convolutional neural network also includes one or more attention mechanism modules. The input of the attention mechanism module is a pooled feature map. Based on the pooled feature map, the attention mechanism module calculates weights in both spatial and channel dimensions to focus on distorted regions. By performing multi-scale feature fusion on the intermediate feature map, edge and texture details are extracted as shallow features, local structural information is extracted as mid-level features, and global semantic information is extracted as deep features. Finally, the shallow, mid-level, and deep features are integrated, and upsampling and downsampling are used to make the feature map sizes of different scales consistent. Then, they are concatenated in the channel dimension to obtain the final feature map. The final feature map is converted into a feature vector, which is used as a feature vector containing multi-scale distortion information of the image and output. The specific process of weight calculation in both spatial and channel dimensions includes: The channel scalar of the feature map for each channel is calculated based on the pooled feature map. Then, the ReLU activation function and the Sigmoid function are applied. The channel scalars are mapped through a multilayer perceptron to obtain a weight matrix. This weight matrix is used to weight the channels to obtain the weight of each channel attention. Based on the weight of each channel attention, the global average pooling feature and the max pooling feature for each space are calculated. The global average pooling feature and the max pooling feature are concatenated, and the concatenation result is normalized using the Sigmoid function to obtain the weight of the spatial attention. The channel attention and the spatial attention are then weighted and fused to obtain the intermediate feature map.
[0042] The specific process of constructing the distortion model in S3 is as follows: Figure 2 As shown, it includes: The feature vector containing multi-scale distortion information of the image is input into the generator, which performs mapping to generate a simulated distorted image. The generator consists of transposed convolutional layers, which restore the feature vector to the image through upsampling, and a random noise vector is configured in the generation process. The discriminator is used to evaluate the difference between the generated simulated distorted image and the ideal undistorted image. The discriminator is used to train the generator so that the generator can produce simulated images that are closer to the ideal undistorted image. After the discriminator distinguishes between the ideal undistorted image and the generated simulated distorted image, it performs recurrent adversarial training on the generator based on the difference until the feature vector distribution of the simulated distorted image output by the generator is consistent with that of the ideal undistorted image, that is, the training is completed. The trained generator model is output as the distortion model.
[0043] The process of generating the predicted ideal distortion-free image in S4 includes: Establish a Mod distortion mapping function based on the mapping relationship between simulated distorted images and ideal distortion-free images; Using a distortion model based on the Mod distortion mapping function, the feature vector of the original distorted image is input to generate the corresponding predicted ideal distortion-free image.
[0044] When performing distortion correction in S5, the specific steps are as follows: calculate the bilinear interpolation relationship between the original distorted image and the predicted ideal distortion-free image; based on the bilinear interpolation relationship, map the pixels in the original distorted image to the corresponding positions in the predicted ideal distortion-free image to obtain the corrected image.
[0045] In this embodiment, the specific application steps of the method are as follows: First, image preprocessing is performed; ideal distortion-free images of GIS equipment X-ray detection are stored in the manufacturer's original library, original distorted images of GIS equipment X-ray detection are acquired, noise reduction processing is performed on the original images, and grayscale adjustment is performed on the original images to obtain preprocessed images; An adaptive median filtering algorithm is used to dynamically adjust the size of the filtering window based on the noise distribution in the local area of the image, thereby removing noise interference from the original distorted image. The image is then adjusted to grayscale using a histogram equalization algorithm to make the grayscale histogram of the image uniformly distributed, thus enhancing the image contrast.
[0046] Secondly, distortion feature extraction is performed; an improved convolutional neural network is used to extract distortion features from the preprocessed image, and a feature vector containing multi-scale distortion information of the image is output. The convolutional neural network improved by generative adversarial network based on feature vectors includes multiple convolutional layers, pooling layers, activation functions, and one or more attention mechanism modules. Through the action of multiple convolutional layers, pooling layers, and activation functions, it extracts shallow and deep distortion features of the image, and fuses these features to output a feature vector containing multi-scale distortion information of the image; the network constructs a distortion model. Based on the extracted feature vectors, a distortion model is constructed using a generative adversarial network (GAN) model. The GAN model includes a generator and a discriminator. The generator generates a simulated distorted image based on the input feature vectors, and the discriminator is used to distinguish between the generated simulated distorted image and the actual original distorted image, enabling the generator to learn the distribution pattern of the original distorted image.
[0047] Then, based on the constructed distortion model, a simulated distorted image is generated. Based on the simulated distorted image, the ideal distortion-free image corresponding to the original distorted image is found as the prediction result. The corresponding ideal distortion-free image is used as the predicted ideal distortion-free image. The original distorted image is then distorted based on the predicted ideal distortion-free image, and the distorted image is output. Finally, based on the constructed distortion model, the inverse transform method is used to correct the distortion of the original distorted image. First, the distortion model is used to generate a simulated distorted image to find the ideal distortion-free image corresponding to the original distorted image as the prediction result. This prediction result is the predicted ideal distortion-free image. Then, by calculating the mapping relationship between the original distorted image and the predicted ideal distortion-free image, the pixel positions in the original distorted image are adjusted to correct the original distorted image and obtain the corrected image.
[0048] This method solves the problem of insufficient image correction accuracy caused by coordinate discretization during the inverse transformation process, improves the continuity of pixel mapping relationship in complex distortion scenarios, and enables the corrected image to more accurately restore the geometric features of the internal structure of GIS equipment.
[0049] Example 2 In this embodiment, a distortion processing system for X-ray inspection images of GIS equipment is used, and the system structure is as follows: Figure 3 As shown, it specifically includes an image preprocessing module, a distortion feature extraction module, a distortion model construction module, and a distortion correction module that are connected in sequence. The image preprocessing module is used to store ideal, distortion-free images of GIS equipment X-ray detection from the manufacturer's original library, acquire original distorted images of GIS equipment X-ray detection, perform noise reduction processing on the original images, and perform noise reduction processing and grayscale adjustment on the original images to obtain a preprocessed image. The distortion feature extraction module is used to extract distortion features from the preprocessed image and output a feature vector containing multi-scale distortion information of the image. The distortion model construction module is used to construct a distortion model based on the feature vector using a generative adversarial network. The distortion correction module is used to generate a simulated distorted image based on the constructed distortion model, find the ideal distortion-free image corresponding to the original distorted image based on the simulated distorted image as the prediction result, use the corresponding ideal distortion-free image as the predicted ideal distortion-free image, perform distortion correction on the original distorted image based on the predicted ideal distortion-free image, and output the corrected image.
[0050] like Figure 3 As shown, the working principle of this system is: Step S1: Perform image preprocessing; store ideal distortion-free images of GIS equipment X-ray detection from the manufacturer's original library, acquire original distorted images of GIS equipment X-ray detection, perform noise reduction processing on the original images, and perform noise reduction processing and grayscale adjustment on the original images to obtain preprocessed images. In this embodiment, the original distorted images acquired by X-ray inspection of GIS equipment are all radial images. The ideal, distortion-free images of X-ray inspection of GIS equipment stored in the manufacturer's original library are also radial images. An adaptive median filtering algorithm is used to dynamically adjust the size of the filtering window according to the noise distribution in the local area of the image to remove noise interference in the original distorted images. The image is then adjusted to grayscale using a histogram equalization algorithm to make the grayscale histogram of the image uniformly distributed, thereby enhancing the contrast of the image. Ideal, distortion-free images of GIS equipment X-ray inspection stored in the manufacturer's original database. Acquire raw distorted images from X-ray inspection using GIS equipment. The original image is subjected to noise reduction and grayscale adjustment to obtain a preprocessed image. .
[0051] Among them, the adaptive median filtering algorithm refers to a processing method that dynamically adjusts the size of the filtering window based on the noise characteristics of different regions of the image. Specifically, it can be implemented by combining local noise variance calculation with iterative adjustment of the window size. By analyzing the noise intensity in the neighborhood of pixels in real time, it automatically selects the optimal filtering window, effectively suppressing noise interference while preserving image details. The histogram equalization algorithm refers to a processing method that statistically analyzes and accumulates the distribution of the frequencies of each gray value in the image. Specifically, it can be implemented by combining the integral calculation of the gray value probability density function with nonlinear mapping. By establishing gray value redistribution rules, it optimizes the overall contrast of the image.
[0052] In the noise reduction stage, the image is first divided into blocks, and the noise variance index of each sub-region is calculated. The filter window size is dynamically selected based on a preset noise intensity threshold. Small window filtering is used for low-noise areas to preserve edge details, while a larger window is used for high-noise areas to enhance noise reduction. In the grayscale adjustment stage, the global grayscale histogram of the image is statistically analyzed, and the cumulative probability distribution of each grayscale value is calculated. A grayscale mapping table is generated through normalization, and the original pixel values are replaced with the mapped values to make the grayscale distribution more uniform. These two processing steps work collaboratively in stages to enhance the recognizability of useful information in the image while eliminating noise interference.
[0053] Step S11: Collect the original distorted image An adaptive median filtering algorithm is used for noise reduction. The adaptive median filtering algorithm dynamically adjusts the size of the filtering window according to the noise distribution in the local area of the image to remove noise interference in the original distorted image.
[0054] The adaptive median filtering algorithm dynamically adjusts the filter window size based on the noise characteristics of different regions of the image, where the range of the filter window size n×n is set to be... to ; Step S111: Set the center pixel of the filter window The value of this pixel is The set of pixels within the window is Where i represents any value, This represents the value of the i-th pixel within the window. Indicates the first in the window The value of each pixel; Step S112: Select the filter window size n. ; Step S113: Based on the pixel set Calculate the median of the pixels within the window Maximum value Minimum value ; Step S114: Determine whether the current filtering window size is suitable for filtering; like and Proceed to step S115; Otherwise, increase the window size. ,when Then return to step S113, when Output the pixel value at this time. ; Step S115: Determine whether the current pixel is a noise point; like and If the current pixel is not a noise point, then output the pixel value at this time. ; Otherwise, output the median value of the pixel at this point. ; Step S12: Adjust the grayscale of the image using a histogram equalization algorithm; Histogram equalization algorithm enhances image contrast by statistically analyzing the frequency of each gray value in the original distorted image, performing cumulative distribution, and normalizing the cumulative distribution function.
[0055] Step S121: Set the original distorted image Given M total pixels and K grayscale values (typically K=256), with grayscale values ranging from 0 to 255, calculate the original distorted image after noise reduction. The grayscale value frequencies, where the frequency of grayscale value k in the original distorted image is . ; Step S122: For digital images with discrete grayscale values, use frequency to replace probability and calculate the cumulative distribution function. The CDF (Cumulative Distribution Function) describes the proportion of pixels with gray values j and less than or equal to k in an image, reflecting the cumulative distribution characteristics of gray values.
[0056] Step S123: Map the original grayscale value k to the new grayscale value k'. ,in This is a mapping function that converts the original grayscale value into a new grayscale value. This method is used to normalize the cumulative probability to the grayscale range, ensuring that the new grayscale values cover the entire dynamic range, enhancing contrast, and obtaining a grayscale-adjusted image, which serves as the preprocessed image. Output.
[0057] Traditional methods using fixed-size filtering windows can lead to loss of detail in low-noise areas or residual noise in high-noise areas. This solution, however, achieves a balance between noise removal and detail preservation through a dynamic window adjustment mechanism. Existing histogram equalization techniques, which use global grayscale stretching, are prone to causing local over-enhancement. This solution, through statistically based cumulative distribution mapping, avoids local grayscale distortion while maintaining overall contrast improvement.
[0058] By employing an adaptive median filtering algorithm for noise reduction of the original image and a histogram equalization algorithm for grayscale adjustment, this approach addresses the issues of detail blurring and noise residue caused by fixed filtering windows in traditional preprocessing methods, as well as the local contrast imbalance caused by global grayscale adjustment. The noise reduction stage utilizes a dynamic window selection mechanism to achieve adaptive filtering in complex noise distribution scenarios; the grayscale adjustment stage employs statistically driven mapping relationships to enhance overall image contrast while maintaining local grayscale features. The synergistic effect of these two methods significantly improves the quality of the preprocessed image, providing high-fidelity input data for subsequent distortion feature extraction.
[0059] Step S2: Extract distortion features; use an improved convolutional neural network to extract distortion features from the preprocessed image and output a feature vector containing multi-scale distortion information of the image. The improved convolutional neural network includes multiple convolutional layers, pooling layers, activation functions, and one or more attention mechanism modules. Through the action of multiple convolutional layers, pooling layers, and activation functions, it extracts shallow and deep distortion features of the image, fuses these features, and outputs a feature vector containing multi-scale distortion information of the image; the network constructs a distortion model. Convolution operations are performed using convolutional layers, based on the preprocessed input image. Convolutional operations are performed, and then nonlinear characteristics are introduced through activation functions to solve the gradient vanishing problem, enhancing the network's ability to express nonlinear distortion patterns. This sparses the feature representation, highlighting effective information. Feature dimensionality reduction is achieved through pooling layers interspersed between convolutional layers, and an attention mechanism module enhances focus on distorted regions. Finally, a fusion layer integrating shallow and deep features outputs the final feature vector. .
[0060] Convolutional layers are network layers that extract local features by sliding convolutional kernels across the image spatial domain. They can be implemented using 3×3 or 5×5 kernels and are used to capture distortion patterns at different scales. Pooling layers are layers that downsample the feature map, typically using max pooling or average pooling methods to reduce the feature map dimensionality while preserving key distortion information. Activation functions are computational units that introduce non-linear transformations into the network, typically using ReLU or LeakyReLU functions to enhance the network's ability to express complex distortion patterns.
[0061] Receiving and preprocessing images using convolutional neural networks After that, the dimension is The height is H, the width is W, and the number of channels is C. Since grayscale images have C=1 and color images have C=3, in X-ray images from GIS equipment, C=1 is usually used, i.e., a single-channel grayscale image. Each convolutional kernel slides across the input image to extract local features; that is, each convolutional kernel modulates the preprocessed image. Convolutional operations are performed to extract primary feature maps. Let the size of each convolutional kernel be *d*, and the dimension of each kernel be *d*. For input preprocessed images The convolution operation generates a primary feature map. The English term for a feature map is FeatureMap, which is represented as: in, It is any value. It is a feature map The coordinates are , and b is the bias term; A convolutional layer typically consists of N convolutional kernels, each generating an independent primary feature map. These feature maps are stacked along the channel dimension to form a layer with dimension N. The output tensor, Let the padding value for the convolution operation be Pad, and the stride value be: The output of the convolutional layer undergoes a non-linear transformation through an activation function. This scheme uses the ReLU function to suppress negative responses and retain positive responses, which is computationally efficient. The derivative is 0 or 1, which enhances the sparsity of the feature map and highlights important features. Then, the pooling layer is entered to perform max pooling. Let the pooling window size be... The step size of the pooling operation is For each element within a window, the maximum value is taken to reduce the feature map size, and the pooled feature map is output. , represented as After pooling, the height and width of the pooled feature map become: Reduce computational complexity, preserve the strongest response in local regions, and enhance the robustness of features; Pooling layers compress features between adjacent convolutional layers, reducing computational complexity while preserving effective information. Activation functions are applied to the output of each convolutional layer, enhancing the network's ability to represent complex distortion features through nonlinear transformations.
[0062] The improved convolutional neural network also includes one or more attention mechanism modules to improve the network's attention to severely distorted regions in the image. The attention mechanism module calculates each attention in the feature map and uses weights in both spatial and channel dimensions to focus on distorted regions, paying more attention to local information of distortion in the image during feature extraction.
[0063] Calculate the weights of the attention for each channel: Based on the feature map of pooling Calculate the feature map for each channel channel scalar The scalar representation is: According to the channel scalar Mapping is performed through multiple layers of perception, specifically using the ReLU activation function and the Sigmoid function, expressed as follows: in, , It is a weight matrix; Perform channel weighting to obtain the attention weight for each channel. Calculate the weights for each spatial attention: Based on the feature map of pooling Calculate the feature map for each space Calculate the global average pooling feature for each space. and max pooling features , represented as Global average pooling features and max pooling features The data is concatenated and then normalized using the Sigmoid function to obtain the weights of the spatial attention, expressed as follows: By weighted and fused channel attention and spatial attention, a mid-level feature map is obtained. , represented as: By analyzing the intermediate feature maps Multi-scale feature fusion is performed to extract and preserve edge and texture details as shallow features. Extracting local structural information as mid-level features Extracting global semantic information as deep features The feature maps are integrated from shallow, mid, and deep layers. By upsampling U and downsampling D, the feature map sizes at different scales are made consistent. Then, they are concatenated along the channel dimension to obtain the final feature map. : Shallow convolutional layers extract local distortion features such as image edges and textures using small-sized convolutional kernels, while deep convolutional layers expand the receptive field through stacked convolutional operations to capture global distortion distribution patterns. Feature maps from different levels are fused through skip connections or feature concatenation to form a comprehensive feature vector that simultaneously contains local details and global information.
[0064] Based on the final feature map Converted to a feature vector FV, it is represented as: Traditional convolutional neural networks typically employ a single-scale feature extraction approach, which struggles to effectively handle complex distortions resulting from the coupling of multiple physical factors. Existing methods often neglect the correlation between features at different scales when dealing with complex distortions, leading to a failure to co-represent local distortion details and global distortion patterns.
[0065] This embodiment can effectively extract complex distortion features in images caused by the combined effects of various factors such as X-ray source characteristics, mechanical assembly errors, and uneven medium distribution. It solves the problem of insufficient feature representation ability of traditional deep learning methods in complex distortion scenarios, and provides high-precision multi-scale feature input for subsequent distortion modeling, thereby improving the distortion correction accuracy of X-ray images from GIS equipment.
[0066] Step S3: Based on the extracted feature vectors, a generative adversarial network (GAN) model is used to construct a distortion model. The GAN model includes a generator and a discriminator. The generator generates a simulated distorted image based on the input feature vectors, and the discriminator is used to distinguish between the generated simulated distorted image and the actual original distorted image, so that the generator can learn the distribution pattern of the original distorted image. Step S31: Input the feature vector into the generator, and the generator generates a simulated distorted image; Input the feature vector of multi-scale distortion extracted in step S2 where i is any value. Represents the i-th dimension feature; The mapping is implemented by generator G, and the output is a simulated distorted image, Simulate. , represented as: in, The random noise vector is used to enhance the diversity of the generated images; the generator consists of transposed convolutional layers, which upsample the feature vector to restore the image. Step S32: Evaluate the difference between the generated simulated distorted image and the ideal undistorted image using a discriminator. The discriminator is used to train the generator so that the generator can produce simulated images that are closer to the ideal undistorted image, thus completing the model construction.
[0067] Discriminator D is used to distinguish ideal, distortion-free images. and the generated simulated distorted image ; simulated distorted images output by generator G through adversarial training With ideal distortion-free image When the feature vectors are distributed in a consistent manner, training is complete.
[0068] Step S4: Generate a simulated distorted image based on the constructed distortion model. Find the ideal distortion-free image corresponding to the original distorted image based on the simulated distorted image as the prediction result. Use the corresponding ideal distortion-free image as the predicted ideal distortion-free image. Perform distortion correction on the original distorted image based on the predicted ideal distortion-free image and output the corrected image.
[0069] Based on the constructed distortion model, the inverse transform method is used to correct the distortion of the original distorted image. First, the distortion model is used to generate a simulated distorted image to find the ideal distortion-free image corresponding to the original distorted image as the prediction result. This prediction result is the predicted ideal distortion-free image. Then, by calculating the mapping relationship between the original distorted image and the predicted ideal distortion-free image, the pixel positions in the original distorted image are adjusted to correct the original distorted image and obtain the corrected image.
[0070] The inverse transformation method refers to establishing a coordinate mapping relationship from the original distorted image to an ideal, distortion-free image by inversely deriving the spatial transformation parameters of the distortion process. Specifically, it can be implemented using bilinear interpolation. By inversely solving for the ideal image coordinates corresponding to each pixel in the original distorted image, the precise relationship of pixel position migration is determined. The bilinear interpolation algorithm uses weighted calculations based on the gray values of four adjacent pixels, effectively handling pixel loss during image scaling or deformation and ensuring the continuity of the mapping relationship.
[0071] By constructing a distortion model trained using a generative adversarial network, a dataset of correspondences between simulated distorted images and ideal, distortion-free images is generated. In the mapping calculation phase, the pixel coordinates of the original distorted image are used as input to inversely solve for their corresponding positions in the ideal image coordinate system. During this process, for each distorted pixel, the weight coefficients of its four surrounding ideal image pixels are calculated using a bilinear interpolation algorithm, generating a continuous and smooth coordinate transformation matrix. This matrix can characterize the complex distortion patterns formed by the combined effects of ray source parameter errors, mechanical assembly deviations, and medium inhomogeneity, thus establishing a complete mapping relationship from the distortion domain to the ideal domain. The inverse solution strategy avoids the loss of image edge information caused by incomplete coordinate coverage during the forward transformation.
[0072] Step S41: Generate a simulated distorted image based on the distortion model, and calculate the mapping relationship between the original distorted image Simulate and the predicted ideal distortion-free image; Based on simulated distorted images With ideal distortion-free image The mapping relationship is used to establish a distortion model, and the Mod distortion mapping function is used. The Mod distortion mapping function can be learned through adversarial training.
[0073] Using the trained generator G, the original distorted image is input according to the distortion model. eigenvectors Generate the corresponding predicted ideal distortion-free image. , represented as ,in This is the inverse distortion mapping function, which can be obtained from the Mod distortion mapping function; Step S42: Based on the mapping relationship, the pixels in the original distorted image are mapped to the corresponding positions in the predicted ideal distortion-free image to achieve distortion correction of the original image. Establish a pixel coordinate mapping relationship from the original distorted image to the predicted ideal distortion-free image. For the original distorted image... any pixel Its ability to predict ideal distortion-free images Corresponding coordinates Satisfying the Mod distortion mapping function, expressed as: ; Since the mapping relationship may be non-linear, bilinear interpolation is used to calculate the pixel values of non-integer coordinates to avoid pixel loss or distortion. Assume the prediction is an ideal, distortion-free image. Corresponding coordinates The floating-point coordinates of the target are obtained by bilinear interpolation. Where i, j, v, and u are all arbitrary values, i and j are integers, and v and u are decimals in the range (-1, 1); Based on the mapping relationship, the pixel coordinates of the predicted ideal distortion-free image corresponding to the original distorted image are filled into the corresponding floating-point coordinates of the predicted ideal image using bilinear interpolation, resulting in the corrected image. .
[0074] Bilinear interpolation refers to an interpolation method based on a weighted average of the gray values of the four nearest neighbor pixels surrounding the target pixel. This can be implemented using a two-dimensional linear interpolation algorithm, which reduces discretization errors by establishing a continuous spatial mapping model. Pixel position migration refers to adjusting the spatial coordinates of pixels in the original distorted image according to the mapping relationship. Specifically, the corresponding position of the target pixel in the ideal, distortion-free image can be calculated using the inverse transformation matrix, and the interpolation algorithm is used to compensate for sub-pixel-level deviations during the coordinate transformation process.
[0075] After establishing the mapping relationship between the original distorted image and the predicted ideal distortion-free image, for cases where the coordinate transformation result of the target pixel may be located at a non-integer coordinate position in the ideal image, the gray values of four neighboring pixels around that position are selected, and linear interpolation is performed twice along the horizontal and vertical directions respectively to finally obtain the gray value of the target pixel. This method maintains the spatial continuity of gray values during the pixel migration process by using a weighted average of neighboring pixel information, avoiding jagged edges or loss of image details caused by coordinate discretization.
[0076] Traditional inverse transform methods typically use nearest-neighbor interpolation algorithms to directly extract the values of adjacent pixels at the target coordinates, resulting in step-like distortion at image edges. This proposed solution, however, constructs a continuous mapping relationship through bilinear interpolation, effectively suppressing the cumulative effect of discretization errors in the composite distortion correction process while maintaining computational efficiency.
[0077] This system integrates preprocessing algorithms such as adaptive median filtering and histogram equalization with an attention-based CNN-GAN architecture to form a complete automated processing flow. It achieves dynamic noise reduction and completes accurate distortion correction using mapping relationships, providing efficient and reliable technical support for GIS equipment inspection and significantly improving inspection efficiency and diagnostic accuracy.
[0078] This system, through the functional collaboration of its various modules, realizes the engineering application of image distortion processing methods for X-ray inspection of GIS equipment. It can efficiently and automatically complete the image distortion processing process, meeting the needs of industrial scenarios for rapid and accurate processing of X-ray images from GIS equipment, and has good practicality and promotional value.
[0079] In summary, this solution combines an improved convolutional neural network (CNN) with a generative adversarial network (GAN). First, it preprocesses the original image using an adaptive median filtering algorithm and a histogram equalization algorithm, with the adaptive median filtering window size dynamically adjusted. Second, it extracts multi-scale distortion features using an improved CNN incorporating an attention mechanism module. Then, it constructs an accurate distortion model based on the GAN and trains it adversarially using generator and discriminator loss functions. Finally, it performs distortion correction based on the mapping relationship. This approach achieves high-precision processing of complex distortions, reduces data annotation costs, and enhances system automation. It significantly improves the accuracy and effectiveness of distortion processing, overcomes the limitation of relying on large-scale labeled data, and forms a complete automated processing flow. This solves the problems of existing technologies struggling to effectively handle complex distortions caused by the coupling of multiple physical factors, over-reliance on professionally labeled data, and insufficient system integration.
[0080] 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 person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for distortion processing of X-ray inspection images from GIS equipment, characterized in that, The method steps include: S1, acquiring the original distorted image and preprocessing the original distorted image, and outputting the preprocessed image; S2. Use an improved convolutional neural network to extract distortion features from the preprocessed image and output a feature vector containing multi-scale distortion information of the image. S3. Based on feature vectors containing multi-scale image distortion information, a generative adversarial network is used to construct a distortion model; S4. Generate a simulated distorted image based on the constructed distortion model. Based on the simulated distorted image, find the ideal distortion-free image corresponding to its original distorted image, and use it as the predicted ideal distortion-free image. S5. Based on the predicted ideal distortion-free image, perform distortion correction on the original distorted image and output the corrected image.
2. The distortion processing method for X-ray inspection images of GIS equipment according to claim 1, characterized in that, The preprocessing of the original distorted image in S1 includes: noise reduction and grayscale adjustment of the original distorted image.
3. The distortion processing method for X-ray inspection images of GIS equipment according to claim 2, characterized in that, The noise reduction process specifically employs an adaptive median filtering algorithm, and the adaptive median filtering algorithm dynamically adjusts the filtering window size according to the noise characteristics of different regions of the image; S11. Set the center pixel of the filter window, preset the size of the filter window, and create a set of pixels within the window centered on the center pixel; S12. Based on the pixel set, calculate the median, maximum, and minimum values of the pixels within the window, respectively; S13. If the difference between the median and the minimum value is greater than zero, and the difference between the median and the maximum value is less than zero, then it is determined that the current preset filter window size is suitable for filtering, and step S14 is continued. Conversely, the window size is incremented by one, and it is determined whether the current window size is greater than the preset maximum window size. If it is greater, the pixel value at this time is directly output; otherwise, the process jumps to step S12. S14. Determine whether the current pixel is a noise point; if the difference between the current pixel value and the minimum value is greater than zero, and the difference between the current pixel value and the maximum value is less than zero, then determine that the current pixel is a non-noise point and output the current pixel value. Conversely, the median value of the pixel is output.
4. The distortion processing method for X-ray inspection images of GIS equipment according to claim 2, characterized in that, The grayscale adjustment specifically employs a histogram equalization algorithm. The histogram equalization algorithm statistically analyzes the frequency of each grayscale value in the original distorted image and performs cumulative distribution to obtain a cumulative distribution function. After normalizing the cumulative distribution function, the grayscale values of the original distorted image are mapped to new grayscale values. The specific process of grayscale adjustment includes: first, calculating the grayscale frequency of the original distorted image after noise reduction based on the total number of pixels and the total grayscale value of the original distorted image; Then, the grayscale frequencies are summed to obtain the cumulative distribution function; finally, the original grayscale values are mapped to new grayscale values based on the cumulative distribution function.
5. The distortion processing method for X-ray inspection images of GIS equipment according to claim 1, characterized in that, The improved convolutional neural network in S2 includes convolutional layers, pooling layers, and activation functions; The preprocessed image is processed by the improved convolutional neural network to extract shallow and deep distortion features, and these features are then fused to output a feature vector containing multi-scale distortion information of the image. The specific process includes: After receiving the preprocessed image, the convolutional neural network slides each convolutional kernel across the input image to extract local features. That is, each convolutional kernel performs a convolution operation on the preprocessed image to extract a primary feature map. The primary feature map undergoes a non-linear transformation through an activation function. Then, it enters the pooling layer to perform max pooling, taking the maximum value of each element within the window and outputting the pooled feature map. This pooled feature map is then converted into a feature vector, which is used as a feature vector containing multi-scale distortion information of the image and output.
6. The distortion processing method for X-ray inspection images of GIS equipment according to claim 5, characterized in that, The improved convolutional neural network also includes one or more attention mechanism modules; The attention mechanism module takes the pooled feature map as input and calculates weights in both spatial and channel dimensions based on the pooled feature map to focus on distorted regions. It then performs multi-scale feature fusion on the intermediate feature map, extracting edge and texture details as shallow features, local structural information as mid-level features, and global semantic information as deep features. Finally, it integrates the shallow, mid-level, and deep features, using upsampling and downsampling to ensure consistent feature map sizes across different scales, and then concatenates them along the channel dimension to obtain the final feature map. This final feature map is then converted into a feature vector, which is output as a feature vector containing multi-scale image distortion information. The specific process of weight calculation in both spatial and channel dimensions includes: The channel scalar of the feature map of each channel is calculated based on the pooled feature map. Then, the ReLU activation function and the Sigmoid function are used to map the channel scalar through multilayer perception to obtain the weight matrix. The channel weights are then used to obtain the attention weight of each channel. Based on the attention weight of each channel, the global average pooling feature and the max pooling feature of each space are calculated. The global average pooling features and the max pooling features are concatenated, and the concatenation result is normalized using the Sigmoid function to obtain the weights of the spatial attention. The channel attention and spatial attention are then weighted and fused to obtain the intermediate feature map.
7. The distortion processing method for X-ray inspection images of GIS equipment according to claim 1, characterized in that, The specific process of constructing the distortion model in S3 includes: The feature vector containing multi-scale distortion information of the image is input into the generator, which performs mapping to generate a simulated distorted image. The generator is composed of transposed convolutional layers, which restore the feature vector to the image through upsampling, and a random noise vector is configured in the generation process. A discriminator is used to evaluate the difference between the generated simulated distorted image and the ideal undistorted image. The discriminator is used to train the generator so that the generator can generate simulated images that are closer to the ideal undistorted image. After the discriminator distinguishes between the ideal undistorted image and the generated simulated distorted image, it performs cyclic adversarial training on the generator based on the difference until the feature vector distribution of the simulated distorted image output by the generator is consistent with that of the ideal undistorted image, that is, the training is completed. The trained generator model is output as the distortion model.
8. The distortion processing method for X-ray inspection images of GIS equipment according to claim 1, characterized in that, The process of generating the predicted ideal distortion-free image in S4 includes: Establish a Mod distortion mapping function based on the mapping relationship between simulated distorted images and ideal distortion-free images; Using a distortion model based on the Mod distortion mapping function, the feature vector of the original distorted image is input to generate the corresponding predicted ideal distortion-free image.
9. The distortion processing method for X-ray inspection images of GIS equipment according to claim 1, characterized in that, In step S5, distortion correction is performed by: calculating the bilinear interpolation relationship between the original distorted image and the predicted ideal distortion-free image; and based on the bilinear interpolation relationship, mapping the pixels in the original distorted image to the corresponding positions in the predicted ideal distortion-free image to obtain the corrected image.
10. A distortion processing system for X-ray inspection images of GIS equipment, characterized in that, The system includes an image preprocessing module, a distortion feature extraction module, a distortion model construction module, and a distortion correction module that are electrically connected in sequence. The system operates using a distortion processing method for X-ray inspection images of GIS equipment as described in any one of claims 1-9.