X-ray image enhancement method based on unsupervised learning and related device
By using an unsupervised learning-based image enhancement network combined with a multi-module collaborative processing mechanism, the problems of blurred details and noise interference in X-ray electrode images under low-light conditions are solved, achieving improved contrast and sharpness, highlighting key defect features, and supporting high-precision defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-07
AI Technical Summary
Existing X-Ray electrode image enhancement methods tend to amplify noise and lose details when improving contrast and detail visibility, and deep learning models cannot effectively highlight subtle defects inside the electrode when transferred for use.
An image enhancement method based on unsupervised learning is adopted. By constructing an unsupervised image enhancement network, combining a first denoising sub-network, an illumination estimation network, and a second denoising sub-network, noise is suppressed by channel and spatial attention mechanisms, deep features are extracted and multi-scale processing is performed, and structured denoising is achieved by combining alternating operations of convolution and stationary wavelet transform.
It effectively suppresses noise interference, improves image contrast and clarity, highlights key defect features such as uneven coating and scratches, generates high-quality training datasets, and improves the accuracy and efficiency of defect detection.
Smart Images

Figure CN121258827B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to an X-Ray image enhancement method based on unsupervised learning and related equipment. BACKGROUND
[0002] With the rapid development of new energy vehicles and energy storage industries, the demand for lithium ion batteries has increased dramatically, and higher requirements have been placed on their manufacturing quality. As a core component of the battery, the surface defects (such as uneven coating, scratches, etc.) of the battery pole piece directly affect the electrochemical performance and safety performance of the battery. Currently, the industry generally uses X-Ray imaging technology to non-destructively test the pole piece to identify internal defects. Since the principle of X-Ray imaging is to form contrast through the difference in the absorption of rays by materials, the internal structure of the pole piece has subtle density changes, resulting in low-illumination characteristics of the imaging image, and it is difficult to directly observe the detailed information. Therefore, it is necessary to perform dark-light enhancement processing on the X-Ray image to improve the contrast and visibility of the details in order to detect defects.
[0003] However, the image enhancement methods in the related art rely on traditional pixel domain-based enhancement algorithms, such as histogram equalization and gamma correction, when processing X-Ray pole piece images. Although these methods can improve the image brightness to some extent, they can easily lead to noise amplification and loss of details, especially in areas where the gray value transitions smoothly, such as the edges of the pole piece coating, and the enhancement effect is often unsatisfactory, making it difficult to meet the needs of high-precision defect detection. In addition, although some deep learning enhancement models perform well on natural images, due to the unique gray distribution characteristics and defect morphology of X-Ray pole piece images, direct migration and use can cause over-enhancement or under-enhancement problems, and cannot effectively highlight the subtle defect features inside the pole piece. SUMMARY
[0004] Therefore, the purpose of the embodiments of the present application is to provide an X-Ray image enhancement method based on unsupervised learning and related equipment to solve one or more technical problems existing in the prior art and provide at least one beneficial option or create conditions.
[0005] In one aspect, the embodiments of the present application provide an X-Ray image enhancement method based on unsupervised learning, which includes the following steps:
[0006] An X-Ray image to be enhanced and a trained unsupervised image enhancement network are obtained; the unsupervised image enhancement network includes a first denoising sub-network, an illumination estimation network, and a second denoising sub-network;
[0007] The X-Ray image to be enhanced is input into the unsupervised image enhancement network. The first denoising sub-network performs noise suppression processing on the input X-Ray image to obtain a denoised feature map. After extracting deep features from the denoised feature map through the CBR and ResCBR modules in the illumination estimation network, non-uniform illumination is processed through a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map. The illumination feature map is processed through the second denoising sub-network, and structured denoising is performed through alternating operations of convolution and stationary wavelet transform to obtain the enhanced image.
[0008] Optionally, the step of performing noise suppression processing on the input X-Ray image through the first denoising sub-network to obtain a denoised feature map includes:
[0009] The X-Ray image is input into the CBL module of the first noise suppression module. After the initial features are extracted by Conv layer convolution, batch normalization by BN layer and LeakyReLU activation, the original feature map is obtained.
[0010] For the original feature map branch processing, the left branch generates a channel attention weight feature map through adaptive average pooling, 1D convolution and sigmoid, and the right branch captures spatial information through global averaging and max pooling and then concatenates it, and then generates a spatial attention weight feature map through 1×1 convolution and sigmoid.
[0011] The channel attention weight feature map and the spatial attention weight feature map are concatenated in the channel dimension to obtain the feature map output by the first noise suppression module. Then, the feature map is input into the next two concatenated noise suppression modules for repeated processing to obtain the denoised feature map output by the first denoising sub-network.
[0012] Optionally, after extracting deep features from the denoised feature map using the CBR and ResCBR modules in the illumination estimation network, the non-uniform illumination is processed through a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map, including:
[0013] The denoised feature map output by the first denoising sub-network is input into the CBR module. The basic features are extracted by convolution operation through the Conv layer, the feature data is standardized by the BN layer, and then a nonlinear transformation is introduced by the ReLU activation function to obtain the feature map output by the CBR module.
[0014] The feature map output by the CBR module is sequentially input into three cascaded ResCBR modules. Each ResCBR module first extracts features through its internal CBR module, and then performs residual connection between the extracted features and the input features of its internal CBR module to obtain the feature map processed by the ResCBR module.
[0015] The feature map processed by the ResCBR module is input into the multi-scale spatial pyramid structure to extract multi-scale feature maps.
[0016] Multi-scale feature maps are concatenated along the channel dimension, and the number of channels in the concatenated feature maps is adjusted to generate illumination feature maps.
[0017] Optionally, the step of inputting the feature map processed by the ResCBR module into the multi-scale spatial pyramid structure to extract multi-scale feature maps includes:
[0018] The feature maps processed by the ResCBR module are input into the four parallel branches of the multi-scale spatial pyramid structure.
[0019] Different convolution kernels are used to perform grouped convolution on the input feature map. The sigmoid function is used to generate pixel attention weight maps. These weight maps are then multiplied pixel by pixel with the grouped convolutional feature maps to obtain multi-scale feature maps output by each parallel branch.
[0020] Optionally, the step of processing the illumination feature map through a second denoising sub-network and performing structured denoising through alternating operations of convolution and stationary wavelet transform to obtain an enhanced image includes:
[0021] The X-Ray image is divided pixel by pixel by the illumination feature map to obtain the reflection image. The reflection image and the illumination feature map are then input into the first convolutional layer of the second denoising sub-network to obtain the first feature map.
[0022] The first feature map is decomposed into a low-frequency sub-band and multiple high-frequency sub-bands through a stationary wavelet transform layer. A gating mechanism is applied to the high-frequency sub-bands in the first feature map to suppress noise and preserve the structure and edge details of the low-frequency sub-bands, thus obtaining the second feature map.
[0023] The second feature map is then input into the second convolutional layer and decomposed and suppressed by a stationary wavelet transform layer to obtain the third feature map.
[0024] The third feature map is then input into the third convolutional layer to integrate multi-scale noise reduction features to output an enhanced image.
[0025] Optionally, the trained unsupervised image augmentation network is obtained in the following way:
[0026] Obtain an X-Ray image dataset containing different types of defects and divide it into a training set and a validation set;
[0027] The X-Ray images in the training set are input into an unsupervised image enhancement network, and the enhanced images are obtained through forward propagation.
[0028] By calculating the illumination consistency loss between the enhanced image and the X-Ray image, the smoothness loss of the reflection image, and the perceptual loss between the enhanced image and the X-Ray image, a multi-objective joint loss function is constructed, and the weight parameters of each layer of the unsupervised image enhancement network are updated using the backpropagation algorithm.
[0029] After each preset training round, the model is evaluated using a validation set. If the loss value is lower than the historical best, the weights are saved as a candidate optimal model. Training stops when the number of training iterations reaches a preset value or the validation set loss does not decrease for several consecutive rounds, and the candidate optimal model is selected as the trained unsupervised image augmentation network.
[0030] Optionally, after obtaining the enhanced image, the method further includes:
[0031] The enhanced image is labeled with defects using annotation software, generating a JSON file containing the vertex coordinates of the polygon segmentation for each defect region;
[0032] Based on the vertex coordinates of the segmented polygons in the JSON file, the minimum bounding rectangle coordinates of the corresponding defect area are generated, and each polygon outline in the JSON file is converted into a binary segmentation mask.
[0033] Create a dictionary data structure, using the unique identifier of the X-Ray image as the key and storing the corresponding binary segmentation mask and the coordinates of the minimum bounding rectangle as the value, to construct a training dataset containing X-Ray images, defect segmentation masks, and bounding box cue information.
[0034] On the other hand, embodiments of the present invention provide an X-Ray image enhancement device based on unsupervised learning, comprising:
[0035] The first module is used to acquire the X-Ray image to be enhanced and the trained unsupervised image enhancement network; the unsupervised image enhancement network includes a first denoising sub-network, an illumination estimation network, and a second denoising sub-network.
[0036] The second module is used to input the X-Ray image to be enhanced into the unsupervised image enhancement network. The input X-Ray image is subjected to noise suppression processing by the first denoising sub-network to obtain a denoised feature map. After extracting deep features from the denoised feature map by the CBR and ResCBR modules in the illumination estimation network, non-uniform illumination is processed by a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map. The illumination feature map is processed by the second denoising sub-network, and structured denoising is performed by alternating operations of convolution and stationary wavelet transform to obtain the enhanced image.
[0037] On the other hand, embodiments of the present invention provide an X-Ray image enhancement system based on unsupervised learning, comprising:
[0038] At least one processor;
[0039] At least one memory for storing at least one program;
[0040] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0041] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the above-described method.
[0042] The embodiments of the present invention have the following beneficial effects:
[0043] This invention utilizes a designed unsupervised image enhancement network, combined with the channel and spatial attention mechanisms of the first denoising sub-network, to effectively suppress noise interference in X-ray images, laying a clear feature foundation for subsequent illumination estimation. The illumination estimation network employs CBR and ResCBR modules to extract deep features and leverages a multi-scale spatial pyramid structure to handle non-uniform illumination. The generated illumination feature map ensures smoothness while enhancing boundary perception, avoiding the edge blurring problem that traditional methods often encounter during illumination correction. The second denoising sub-network achieves structured denoising through alternating operations of convolution and stationary wavelet transform, removing high-frequency noise while preserving the subtle structural information of electrode defects. This allows the enhanced image to improve overall contrast while highlighting key defect features such as coating inhomogeneity and scratches. Furthermore, training the network with a multi-objective joint loss function ensures the consistency of illumination between the enhanced and original images, the smoothness of the reflection image, and overall perceptual quality, improving the model's robustness and generalization ability. This invention can improve the clarity and contrast of defect areas in X-Ray images, effectively solving problems such as blurred details, noise interference, and poor enhancement effects caused by non-uniform illumination in low-light environments. In practical applications, the enhanced images generated by this method, after defect annotation and data structuring, can construct a high-quality training dataset, providing accurate segmentation masks and bounding box hints for the subsequent training of X-Ray image defect detection models, which helps to improve the accuracy and efficiency of defect detection. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic flowchart of the steps of an X-Ray image enhancement method based on unsupervised learning provided in an embodiment of the present invention;
[0046] Figure 2 This is a diagram of the noise suppression module of the first denoising sub-network provided in an embodiment of the present invention;
[0047] Figure 3 This is a diagram of the illumination estimation network structure provided in an embodiment of the present invention;
[0048] Figure 4 yes Figure 3 The structural diagram of the ResCBR module in the illumination estimation network;
[0049] Figure 5 yes Figure 3 A structural diagram of the pixel attention mechanism in an illumination estimation network;
[0050] Figure 6 This is a diagram of the second denoising sub-network structure provided in an embodiment of the present invention;
[0051] Figure 7 This is a structural block diagram of an X-Ray image enhancement device based on unsupervised learning provided in an embodiment of the present invention;
[0052] Figure 8 This is a structural block diagram of an X-Ray image enhancement system based on unsupervised learning provided in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0054] It should be noted that although the device diagram shows a modular division and the flowchart illustrates a logical order, in some cases, the steps shown or described may be performed in a different order than the modular division in the device or the order shown in the flowchart. The terms "first," "second," etc., used in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0056] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a full understanding of embodiments of the invention. However, those skilled in the art will recognize that the technical solutions of the invention can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of the invention.
[0057] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0058] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0059] To address the aforementioned technical issues, this invention proposes an X-Ray image enhancement method and related equipment based on unsupervised learning. By constructing an unsupervised image enhancement network and combining it with a multi-module collaborative processing mechanism, it achieves precise enhancement of X-Ray electrode images, effectively improving the detail visibility and contrast of defect areas, and providing high-quality image data support for subsequent high-precision defect detection.
[0060] like Figure 1 As shown, Figure 1 An X-ray image enhancement method based on unsupervised learning is provided for embodiments of the present invention. The method includes the following steps:
[0061] S100, acquire the X-Ray image to be enhanced and the trained unsupervised image enhancement network; the unsupervised image enhancement network includes a first denoising sub-network, an illumination estimation network and a second denoising sub-network;
[0062] S200, the X-Ray image to be enhanced is input into the unsupervised image enhancement network. The input X-Ray image is subjected to noise suppression processing through the first denoising sub-network to obtain a denoised feature map. After extracting deep features from the denoised feature map through the CBR and ResCBR modules in the illumination estimation network, non-uniform illumination is processed through a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map. The illumination feature map is processed through the second denoising sub-network, and structured denoising is performed through alternating operations of convolution and stationary wavelet transform to obtain the enhanced image.
[0063] This invention proposes an unsupervised learning-based X-Ray image enhancement method and related equipment. By constructing an unsupervised image enhancement network, it organically combines a first denoising sub-network, an illumination estimation network, and a second denoising sub-network to form a complete image enhancement chain. The first denoising sub-network, through multiple cascaded noise suppression modules, utilizes the synergistic effect of channel attention and spatial attention mechanisms to progressively filter noise components in the image, providing clean feature input for subsequent illumination estimation. The illumination estimation network, with the help of CBR and ResCBR modules, deeply mines information in the denoised feature map and accurately captures illumination changes at different scales through a multi-scale spatial pyramid structure. The generated illumination feature map not only smooths non-uniform illumination areas but also effectively preserves image boundary details, avoiding the loss of edge information during illumination correction. The second denoising sub-network innovatively employs an alternating processing method of convolution and stationary wavelet transform. During structured denoising, it removes high-frequency noise interference while preserving the subtle structural features of defects in the X-Ray image to the greatest extent possible. This significantly improves the contrast and clarity of the final enhanced image, making it more conducive to subsequent defect detection and analysis. This method does not rely on a large amount of labeled data and can achieve efficient enhancement of X-Ray images through unsupervised learning.
[0064] The following is a detailed description of the X-Ray image enhancement method based on unsupervised learning proposed in this invention, following the processing steps in engineering practice:
[0065] In this embodiment, an X-Ray image is first acquired, and an unsupervised image enhancement network (Uie-Net) based on deep learning is constructed according to the characteristics of the X-Ray image.
[0066] The unsupervised image enhancement network based on deep learning consists of a first denoising sub-network, an illumination estimation network, and a second denoising sub-network. The first denoising sub-network learns a noise suppression map without relying on a clean ground truth, reducing noise interference with subsequent illumination estimation. The illumination estimation network uses the Retinex principle (illumination maps contain mostly low-frequency information) to learn a smooth but boundary-aware illumination feature map from the denoised feature map output by the first denoising sub-network, then adaptively adjusts the gain per pixel, specifically giving high gain to dark areas and suppressing bright areas. The second denoising sub-network calculates the reflection image from the illumination feature map S output by the illumination estimation network using the formula R=I / S, where I represents the X-Ray image, S represents the illumination feature map output by the illumination estimation network, R represents the reflection image, and I / S represents a pixel-wise division operation. The reflection image contains more high-frequency information but still some noise. Therefore, structured denoising is performed on the reflection image using the illumination feature map S as a condition, cleaning up high-frequency noise after magnification, suppressing halos, and preserving realistic details and edge sharpness to obtain the enhanced image.
[0067] In some embodiments, the noise suppression processing of the input X-Ray image through the first denoising sub-network to obtain a denoised feature map includes:
[0068] S211, The X-Ray image is input into the CBL module of the first noise suppression module. Initial feature information is extracted by convolution operation through the Conv layer, batch normalization is performed through the BN layer to accelerate network convergence and suppress overfitting, and then nonlinear transformation is introduced through the LeakyRelu activation function to obtain the original feature map.
[0069] S212, the original feature map is processed by branching. The left branch first undergoes adaptive average pooling, then local smoothing is calculated by 1D convolution, and then channel attention weights are generated by the sigmoid activation function. The right branch captures spatial distribution information in the channel dimension through global average pooling and max pooling. The two pooling results are concatenated in the channel dimension, and then the dimensions are adjusted by 1×1 convolution. Finally, spatial attention weights are generated by the sigmoid activation function.
[0070] S213, the channel attention weight feature map output by the left branch and the spatial attention weight feature map output by the right branch are concatenated in the channel dimension to obtain the output feature map of the first noise suppression module;
[0071] S214, the output feature map of the first noise suppression module is sequentially input into the subsequent cascaded noise suppression modules, and the operations of S211 to S213 are repeated. After being processed by a total of three noise suppression modules, the denoised feature map output by the first denoising sub-network is obtained.
[0072] refer toFigure 2 The first denoising sub-network of the deep learning-based unsupervised image enhancement network includes three cascaded noise suppression modules. Each noise suppression module contains a CBL module for feature extraction. The CBL module consists of a convolutional layer (Conv), a batch normalization layer (BN), and a leaky rectified linear unit (LeakyReLU). The first CBL module of each noise suppression module has different numbers of input and output channels for the convolutional kernel, while the kernel size and stride remain consistent. The principle of the noise suppression module is as follows: Convolution operation is performed on the input feature map to extract feature information and obtain the original feature map. The left branch undergoes adaptive average pooling to make the structural response statistically larger and more stable while reducing the noise mean. Then, 1D convolution is performed to calculate local smoothing to enhance the collaborative performance of adjacent channels and suppress isolated noise spikes. Finally, the useful channels are assigned weights by the sigmoid activation function. The right branch performs global average pooling and max pooling along the channel dimension to capture spatial distribution information. Then, it is concatenated along the channel dimension and subjected to a 1×1 convolution to adjust the dimensions. A sigmoid activation function is then used to generate spatial attention weights, which suppress noise-dominated high-frequency information by assigning lower weights. This is then multiplied with the original feature map to enhance sensitivity to low-frequency information. Finally, the output feature maps of the left and right branches are concatenated to significantly suppress noise while enhancing feature representation. The mathematical formula for the noise suppression module is as follows:
[0073] ;
[0074] ;
[0075] ;
[0076] In the formula, is the output of the left branch, x is the original feature map after CBL output, Conv1d is 1D convolution, and AvgPooling is global average pooling. The output is the right branch, Conv2d is a 2D convolution, and MaxPooling is max pooling. The sigmoid activation function is used, and Concat is a cascade function. This is a denoised feature map.
[0077] In some embodiments, the illumination estimation network includes a CBR module, a ResCBR module, a multi-scale spatial pyramid structure, and convolutional layers; after extracting deep features from the denoised feature map through the CBR and ResCBR modules in the illumination estimation network, the non-uniform illumination is processed through the multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map, including:
[0078] S221, the denoised feature map output by the first denoising sub-network is input into the CBR module, and the basic features are extracted by convolution operation through the Conv layer. The feature data is standardized by the BN layer, and then a nonlinear transformation is introduced by the ReLU activation function to obtain the feature map output by the CBR module.
[0079] S222, the feature map output by the CBR module is sequentially input into three cascaded ResCBR modules. Each ResCBR module first extracts features through its internal CBR module, and then performs residual connection between the extracted features and the input features of its internal CBR module to obtain the feature map processed by the ResCBR module.
[0080] S223, the feature map processed by the ResCBR module is input into the multi-scale spatial pyramid structure to extract multi-scale feature maps; the multi-scale spatial pyramid structure contains 4 parallel branches, each branch uses convolution kernels of different sizes to perform group convolution on the input feature map and then connects to the pixel attention mechanism to obtain the feature map output by the 4 parallel branches.
[0081] S224 concatenates the multi-scale feature maps (feature maps output by 4 parallel branches) along the channel dimension, adjusts the number of channels in the concatenated feature maps, and generates an illumination feature map.
[0082] refer to Figure 3 and Figure 4 The illumination estimation network structure of the unsupervised image enhancement network based on deep learning is as follows: The denoised feature map output by the first denoising sub-network is processed by the CBR module to extract feature information and adjust the number of output channels. The CBR module includes Conv (Convolutional Layer), BN (Batch Normalization), and ReLU activation function layers. Then, it passes through three cascaded ResCBR modules. The ResCBR module is a feature extraction unit combining residual connections and the CBR module; essentially, it introduces skip connections on top of the CBR module to form a residual learning structure. Each ResCBR module is a residual structure. The residual structure can effectively solve the network degradation problem, alleviate gradient vanishing, and enrich the expressive power of features.
[0083] In some embodiments, the step of inputting the feature map processed by the ResCBR module into a multi-scale spatial pyramid structure to extract multi-scale feature maps includes:
[0084] S2231, the feature maps processed by the ResCBR module are input into the four parallel branches of the multi-scale spatial pyramid structure respectively;
[0085] S2232 uses different convolution kernels to perform group convolution on the input feature map, uses the sigmoid function to generate pixel attention weight maps, and multiplies the weight map with the group convolution feature map pixel by pixel to obtain the multi-scale feature map output by each parallel branch.
[0086] refer to Figure 5 The output of the ResCBR module is processed through a multi-scale spatial pyramid to obtain multi-scale receptive fields and handle non-uniform illumination. The multi-scale spatial pyramid contains four parallel branches, each consisting of a grouped convolution and a pixel attention mechanism. The kernel sizes of the four grouped convolutions are 3, 5, 7, and 9, respectively; the stride is 1, 1, 1, 1, and the pixel padding is 1, 2, 3, and 4, respectively. Grouped convolutions learn channels in groups, effectively reducing the number of network parameters and floating-point computations, making them suitable for deep feature maps. Furthermore, the design of different-scale grouped convolutions has the following advantages: 1) The four kernel sizes (3, 5, 7, 9) correspond to different spatial scales such as local shadows, blocky shadows, and global brightness. 2) Continuous receptive field gradients can be obtained without using dilated convolutions, avoiding the "checkerboard" artifacts caused by dilated convolutions. 3) The estimated illumination feature map can smooth out large-scale brightness non-uniformity and refine small-scale illumination changes, reducing halo phenomena. Each group convolution is followed by a pixel attention mechanism to selectively adjust the contribution of each scale branch at different locations, so that the final illumination feature map tends to be smaller in dark areas and smoother and less diffused in highlights. Furthermore, the pixel attention mechanism within each branch makes the scale features output by different branches more refined, reducing texture leakage. Finally, the outputs of the four branches are concatenated along the channel dimension, using 1×1 convolutions to adjust the number of channels. The illumination estimation network decouples and connects scale modeling and spatial selectivity, taking into account both the global and local aspects, making dark areas brighter and bright areas less overexposed, reducing edge halos, while keeping noise within acceptable limits through grouping and local control. The formulas for calculating the number of parameters and computational cost of ordinary convolution and group convolution are as follows:
[0087] ;
[0088] ;
[0089] ;
[0090] ;
[0091] in, The number of parameters for a regular convolution. The floating-point computation cost of ordinary convolution, The number of parameters for grouped convolution. The floating-point computation cost of grouped convolution. , , These represent the number of channels, width, and height of the output feature map, respectively. The number of channels in the input feature map. , , where represents the width and height of the convolution kernel, respectively. g is the number of groups. When g=4, the number of parameters and computational cost of grouped convolution is approximately 1 / 4 that of ordinary convolution.
[0092] In some embodiments, the second denoising subnetwork includes an alternating structure of three sequentially connected convolutional layers and stationary wavelet transform layers; the process of processing the illumination feature map through the second denoising subnetwork and performing structured denoising through alternating operations of convolution and stationary wavelet transform to obtain an enhanced image includes:
[0093] S231, divide the X-Ray image and the illumination feature map pixel by pixel to obtain the reflection image;
[0094] S232, the reflection image and the illumination feature map are input together into the first convolutional layer of the second denoising sub-network, and the first feature map is obtained through convolution operation;
[0095] S233, the first feature map is input into the stationary wavelet transform layer for multi-scale decomposition to obtain low-frequency sub-bands and multiple high-frequency sub-bands. A gating mechanism is used to suppress noise in the high-frequency sub-bands, while preserving the backbone structure information and edge details of the low-frequency sub-bands to obtain the second feature map.
[0096] S234, after inputting the second feature map into the second convolutional layer, it is decomposed and high-frequency noise suppressed again through the stationary wavelet transform layer to obtain the third feature map;
[0097] S235, the third feature map is input into the third convolutional layer, integrating multi-scale noise reduction features and outputting an enhanced image.
[0098] refer to Figure 6The second denoising sub-network structure of the deep learning-based unsupervised image enhancement network is as follows: The illumination feature map output by the illumination estimation network is sequentially processed through convolution, stationary wavelet transform (SWT), convolution, stationary wavelet transform, and convolution. The sizes of the three convolution kernels are 3, 3, and 1, respectively; the strides are 1, 1, and 1, respectively; and the padding is 1, 1, and 0, respectively. Unlike the first denoising sub-network, the input of the second denoising sub-network is the illumination image and the reflection image. The design principles are as follows: 1) The first denoising network and the illumination estimation network may have discrepancies. If the input of the second denoising sub-network is the reflection image, the network may not be able to determine whether some textures are real image details. 2) Jointly inputting the illumination image and the reflection image can enhance denoising and edge protection, and gently process areas with smooth illumination in the illumination image. 3) Consistency of the decomposition can be maintained through loss constraints. Adding a stationary wavelet transform after convolution can effectively suppress noise. On the one hand, the stationary wavelet transform does not downsample, so the resolution of the output feature map remains unchanged, which can avoid the upsampling error of the discrete wavelet transform (DWT). At the same time, the translation invariance will also prevent the edges from jittering due to the sampling phase. On the other hand, the stationary wavelet transform only performs gating on the high-frequency subband, which can effectively suppress noise, while the low-frequency information is preserved or slightly refined, making the edges and textures clearer.
[0099] In some embodiments, the trained unsupervised image augmentation network is obtained in the following manner:
[0100] S110, Obtain an X-Ray image dataset containing different types of defects and divide it into a training set and a validation set;
[0101] S120, input the X-Ray images in the training set into the unsupervised image enhancement network, and perform forward propagation calculations in the order of the first denoising sub-network, the illumination estimation network, and the second denoising sub-network to obtain the enhanced image;
[0102] S130: By calculating the illumination consistency loss between the enhanced image and the X-Ray image, the smoothness loss of the reflection image, and the perceptual loss between the enhanced image and the X-Ray image, a multi-objective joint loss function is constructed, and the weight parameters of each layer of the network are updated using the backpropagation algorithm.
[0103] S140. After each preset training round, the current network model is evaluated using the validation set. If the loss value on the validation set is lower than the historical best value, the weight parameters of the current network are saved as a candidate optimal model.
[0104] S150: When the number of training iterations reaches a preset value or the validation set loss no longer decreases after several consecutive rounds, training is stopped, and the saved candidate optimal model is selected as the trained unsupervised image augmentation network.
[0105] Specifically, the original X-ray image is input into an unsupervised image enhancement network for training, and the model weights during the training process are saved; the test image is reconstructed based on the model weights to generate a clear image with high contrast.
[0106] In some embodiments, after obtaining the enhanced image, the method further includes:
[0107] S410 uses annotation software to annotate defects in the enhanced image and generates a JSON file containing the vertex coordinates of the segmented polygons for each defect region;
[0108] S420: Based on the vertex coordinates of the segmented polygons in the JSON file, generate the minimum bounding rectangle coordinates of the corresponding defect area, and convert each polygon outline in the JSON file into a binary segmentation mask.
[0109] S430. Create a dictionary data structure, using the unique identifier of the X-Ray image as the key and storing the corresponding binary segmentation mask and the coordinates of the minimum bounding rectangle as the values, to construct a training dataset containing the X-Ray image, defect segmentation mask, and bounding box cue information.
[0110] Specifically, annotation software is used to manually annotate defects in the enhanced image, outlining the precise contours of various defects in the image and generating a JSON file containing the vertex coordinates of the segmented polygons for each defect region. The polygon coordinate data in the JSON file is read, and the x-coordinates (x and y) of all vertices of each polygon are extracted. The minimum and maximum x-coordinates (xmin and xmax) and the minimum and maximum y-coordinates (ymin and ymax) are determined by comparison. The minimum bounding rectangle coordinates of the defect region are formed by xmin, xmax, ymin, and ymax. The polygon contours in the JSON file are converted into binary segmentation masks, where the mask region corresponds to a defect location as 1 and the background region as 0. A dictionary data structure is created, using the unique identifier of the X-Ray image as the key, and storing the corresponding binary segmentation mask and the minimum bounding rectangle coordinates (xmin, ymin, xmax, ymax) as values, thus constructing a training dataset containing the original X-Ray image, defect segmentation mask, and bounding box cue information.
[0111] See Figure 7 This invention provides an X-Ray image enhancement device based on unsupervised learning, comprising:
[0112] The first module is used to acquire the X-Ray image to be enhanced and the trained unsupervised image enhancement network; the unsupervised image enhancement network includes a first denoising sub-network, an illumination estimation network, and a second denoising sub-network.
[0113] The second module is used to input the X-Ray image to be enhanced into the unsupervised image enhancement network. The input X-Ray image is subjected to noise suppression processing by the first denoising sub-network to obtain a denoised feature map. After extracting deep features from the denoised feature map by the CBR and ResCBR modules in the illumination estimation network, non-uniform illumination is processed by a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map. The illumination feature map is processed by the second denoising sub-network, and structured denoising is performed by alternating operations of convolution and stationary wavelet transform to obtain the enhanced image.
[0114] It is evident that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented in this device embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0115] See Figure 8 This invention provides an X-Ray image enhancement system based on unsupervised learning, comprising:
[0116] At least one processor;
[0117] At least one memory for storing at least one program;
[0118] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0119] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0120] Furthermore, embodiments of the present invention also disclose a computer program product or computer program stored in a computer-readable storage medium. A processor of a computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the described method. Similarly, the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0121] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0122] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0123] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0124] It should be understood that in this invention, "at least one (item)" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0125] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0126] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0127] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0128] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0129] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.
Claims
1. An X-ray image enhancement method based on unsupervised learning, characterized in that, The method includes the following steps: Obtain the X-Ray image to be enhanced and the trained unsupervised image enhancement network; the unsupervised image enhancement network includes a first denoising sub-network, an illumination estimation network, and a second denoising sub-network. The X-Ray image to be enhanced is input into the unsupervised image enhancement network. The first denoising sub-network performs noise suppression on the input X-Ray image to obtain a denoised feature map. Deep features are extracted from the denoised feature map using the CBR and ResCBR modules in the illumination estimation network. Non-uniform illumination is then processed using a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map. The illumination feature map is then processed by a second denoising sub-network, and structured denoising is performed through alternating operations of convolution and stationary wavelet transform to obtain the enhanced image. The noise suppression process performed on the input X-Ray image through the first denoising sub-network to obtain a denoised feature map includes: The X-Ray image to be enhanced is input into the CBL module of the first noise suppression module. After the initial features are extracted by Conv layer convolution, batch normalization by BN layer and LeakyReLU activation, the original feature map is obtained. For the original feature map branch processing, the left branch generates a channel attention weight feature map through adaptive average pooling, 1D convolution and sigmoid, and the right branch captures spatial information through global averaging and max pooling and then concatenates it, and then generates a spatial attention weight feature map through 1×1 convolution and sigmoid. The channel attention weight feature map and the spatial attention weight feature map are concatenated in the channel dimension to obtain the feature map output by the first noise suppression module. Then, the feature map is input into the next two concatenated noise suppression modules for repeated processing to obtain the denoised feature map output by the first denoising sub-network. The process of processing non-uniform illumination through a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map includes: The feature maps processed by the ResCBR module are input into the four parallel branches of the multi-scale spatial pyramid structure. Different convolution kernels are used to perform group convolution on the input feature map. The sigmoid function is used to generate pixel attention weight maps. The weight maps are then multiplied pixel by pixel with the group convolution feature maps to obtain the multi-scale feature maps output by each parallel branch. Multi-scale feature maps are concatenated along the channel dimension, and the number of channels in the concatenated feature maps is adjusted to generate illumination feature maps. The process of processing the illumination feature map through a second denoising sub-network and performing structured denoising through alternating operations of convolution and stationary wavelet transform to obtain an enhanced image includes: The X-Ray image to be enhanced is divided pixel by pixel by the illumination feature map to obtain the reflection image. The reflection image and the illumination feature map are then input into the first convolutional layer of the second denoising sub-network to obtain the first feature map. The first feature map is decomposed into a low-frequency sub-band and multiple high-frequency sub-bands through a stationary wavelet transform layer. A gating mechanism is applied to the high-frequency sub-bands in the first feature map to suppress noise and preserve the structure and edge details of the low-frequency sub-bands, thus obtaining the second feature map. The second feature map is then input into the second convolutional layer and decomposed and suppressed by a stationary wavelet transform layer to obtain the third feature map. The third feature map is then input into the third convolutional layer to integrate multi-scale noise reduction features to output an enhanced image.
2. The method according to claim 1, characterized in that, The extraction of deep features from the denoised feature map using the CBR and ResCBR modules in the illumination estimation network includes: The denoised feature map output by the first denoising sub-network is input into the CBR module. The basic features are extracted by convolution operation through the Conv layer, the feature data is standardized by the BN layer, and then a nonlinear transformation is introduced by the ReLU activation function to obtain the feature map output by the CBR module. The feature map output by the CBR module is sequentially input into three cascaded ResCBR modules. Each ResCBR module first extracts features through its internal CBR module, and then performs residual concatenation between the extracted features and the input features of its internal CBR module to obtain the feature map processed by the ResCBR module.
3. The method according to claim 1, characterized in that, The trained unsupervised image augmentation network is obtained through the following method: Obtain an X-Ray image dataset containing different types of defects and divide it into a training set and a validation set; The X-Ray images in the training set are input into an unsupervised image enhancement network, and the enhanced images are obtained through forward propagation. By calculating the illumination consistency loss between the enhanced image and the X-Ray image, the smoothness loss of the reflection image, and the perceptual loss between the enhanced image and the X-Ray image, a multi-objective joint loss function is constructed, and the weight parameters of each layer of the unsupervised image enhancement network are updated using the backpropagation algorithm. After each preset training round, the model is evaluated using a validation set. If the loss value is lower than the historical best, the weights are saved as a candidate optimal model. Training stops when the number of training iterations reaches a preset value or the validation set loss does not decrease for several consecutive rounds, and the candidate optimal model is selected as the trained unsupervised image augmentation network.
4. The method according to claim 1, characterized in that, After obtaining the enhanced image, the method further includes: The enhanced image is labeled with defects using annotation software, generating a JSON file containing the vertex coordinates of the polygon segmentation for each defect region; Based on the vertex coordinates of the segmented polygons in the JSON file, the minimum bounding rectangle coordinates of the corresponding defect area are generated, and each polygon outline in the JSON file is converted into a binary segmentation mask. Create a dictionary data structure, using the unique identifier of the X-Ray image as the key and storing the corresponding binary segmentation mask and the coordinates of the minimum bounding rectangle as the value, to construct a training dataset containing X-Ray images, defect segmentation masks, and bounding box cue information.
5. An X-ray image enhancement device based on unsupervised learning, characterized in that, include: The first module is used to acquire the X-Ray image to be enhanced and the trained unsupervised image enhancement network; The unsupervised image enhancement network includes a first denoising subnetwork, an illumination estimation network, and a second denoising subnetwork. The second module is used to input the X-Ray image to be enhanced into the unsupervised image enhancement network. The first denoising sub-network performs noise suppression processing on the input X-Ray image to obtain a denoised feature map. After extracting deep features from the denoised feature map using the CBR and ResCBR modules in the illumination estimation network, a multi-scale spatial pyramid structure is used to process non-uniform illumination, generating a smooth and boundary-aware illumination feature map. The second denoising sub-network processes the illumination feature map, and structured denoising is performed through alternating operations of convolution and stationary wavelet transform to obtain the enhanced image. The noise suppression process performed on the input X-Ray image through the first denoising sub-network to obtain a denoised feature map includes: The X-Ray image to be enhanced is input into the CBL module of the first noise suppression module. After the initial features are extracted by Conv layer convolution, batch normalization by BN layer and LeakyReLU activation, the original feature map is obtained. For the original feature map branch processing, the left branch generates a channel attention weight feature map through adaptive average pooling, 1D convolution and sigmoid, and the right branch captures spatial information through global averaging and max pooling and then concatenates it, and then generates a spatial attention weight feature map through 1×1 convolution and sigmoid. The channel attention weight feature map and the spatial attention weight feature map are concatenated in the channel dimension to obtain the feature map output by the first noise suppression module. Then, the feature map is input into the next two concatenated noise suppression modules for repeated processing to obtain the denoised feature map output by the first denoising sub-network. The process of processing non-uniform illumination through a multi-scale spatial pyramid structure to generate a smooth and boundary-aware illumination feature map includes: The feature maps processed by the ResCBR module are input into the four parallel branches of the multi-scale spatial pyramid structure. Different convolution kernels are used to perform group convolution on the input feature map. The sigmoid function is used to generate pixel attention weight maps. The weight maps are then multiplied pixel by pixel with the group convolution feature maps to obtain the multi-scale feature maps output by each parallel branch. Multi-scale feature maps are concatenated along the channel dimension, and the number of channels in the concatenated feature maps is adjusted to generate illumination feature maps. The process of processing the illumination feature map through a second denoising sub-network and performing structured denoising through alternating operations of convolution and stationary wavelet transform to obtain an enhanced image includes: The X-Ray image to be enhanced is divided pixel by pixel by the illumination feature map to obtain the reflection image. The reflection image and the illumination feature map are then input into the first convolutional layer of the second denoising sub-network to obtain the first feature map. The first feature map is decomposed into a low-frequency sub-band and multiple high-frequency sub-bands through a stationary wavelet transform layer. A gating mechanism is applied to the high-frequency sub-bands in the first feature map to suppress noise and preserve the structure and edge details of the low-frequency sub-bands, thus obtaining the second feature map. The second feature map is then input into the second convolutional layer and decomposed and suppressed by a stationary wavelet transform layer to obtain the third feature map. The third feature map is then input into the third convolutional layer to integrate multi-scale noise reduction features to output an enhanced image.
6. An X-Ray image enhancement system based on unsupervised learning, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Unsupervised low-light enhancement method based on histogram equalization prior
CN116309202A