X-ray Image Enhancement Based on Adaptive Gradient Domain Guided Image Filtering

: Due to the contrast of X-ray images being low, signiﬁcant elements including organs, bones, and nodules are very difﬁcult to identify, so contrast enhancement is necessary. In this paper, an X-ray image enhancement algorithm based on adaptive gradient domain guided image ﬁltering is proposed. The ampliﬁcation factor in the gradient domain guided image ﬁltering needs to be set manually; it needs to constantly adjust the parameters to achieve the best enhancement effect, and this also increases the computational complexity. In order to solve this problem, an adaptive ampliﬁcation factor is deﬁned in this paper, and the proposed algorithm is applied to the X-ray image enhancement. Experimental results demonstrate that the proposed method is superior to state-of-the art algorithms in terms of detail enhancement and edge-preserving.


Introduction
Inspecting X-ray images is an important element of medical diagnosis.Due to factors of the imaging equipment and illumination, the contrast and definition of X-ray images are low, and it is difficult for doctors to observe the tissues of patients, including organs, bones, and nodules.Therefore, it is necessary to process the X-ray image using effective image enhancement technology [1,2].
At present, image enhancement techniques can be roughly divided into the following categories: Spatial domain, transform domain and edge-preserving filtering [3,4].The traditional image enhancement methods based on spatial domain are histogram equalization (HE) [5], gamma correction [6], unsharp filter [7] and multi-scale retinex [8], etc.The histogram equalization (HE) can produce over-enhancement when enhancing images.In order to solve this problem, many improved algorithms based on histogram equalization are proposed, such as contrast-limited adaptive histogram equalization (CLAHE) [9], brightness preserving adaptive fuzzy histogram equalization (BPDFHE) [10], recursive exposurebased sub-image histogram equalization (RESIHE) [11], etc. HE-based approaches aim to automatically determine the global mapping function by maximizing the histogram entropy of the enhanced image.The methods based on HE are effective, but when the histogram distribution has a peak, they tend to over enhance the image and produce unnatural artifacts.Finally, these global tone mapping methods cannot adaptively enhance local image regions.In terms of the transform domain, there are many image enhancement algorithms, based on wavelet [12], dual-tree complex wavelet transform [13], contourlet [14], nonsubsampled contourlet transform (NSCT) [15], shearlet [16], nonsubsampled shearlet transform (NSST) [17], etc. Yang et al. [18] proposed an image enhancement method based on retinex and dual-tree complex wavelet transform, and this method has a good performance in terms of contrast enhancement.Feng et al. [19] proposed an image enhancement technique based on contourlet transform.This algorithm achieves enhancement by adjusting the decomposed contourlet coefficients, but as the contourlet transform does not have shiftinvariance, this method can lead to the appearance of the pseudo-Gibbs phenomenon.The NSCT is an improved version of contourlet transform, which has shift-invariance, and the pseudo-Gibbs phenomenon can be effectively avoided in the application of image processing.Li et al. [20] introduced an enhancement technique using NSCT; the gamma correction and adaptive threshold are used to process the low-frequency and high-frequency components, respectively.The unsharp filter is used to process the reconstructed image achieved by inverse NSCT.The result is a dramatic advance in image contrast.The enhancement methods based on NSCT show good performance, but NSCT has a high computational complexity.Compared with the NSCT, shearlet has lower computational complexity and better sparse representation characteristics.Li et al. [21] proposed a medical image enhancement algorithm using singular value decomposition in NSST domain, and a good image enhancement performance was achieved.Zhao et al. [22] introduced another enhancement method utilizing nonsubsampled shearlet transform for X-ray images.
In recent years, guided image filtering is very popular in image processing fields [23], such as image enhancement, image fusion, image classification, image restoration, image super-resolution, image dehazing, etc.Based on guided image filtering, some extended versions were proposed, such as weighted guided image filtering (WGIF) [24], gradient domain guided image filtering (GDGIF) [25], weighted guided image filtering with steering kernel (SKWGIF) [26], anisotropic guided filtering (AnisGF) [27], effective guided image filtering [28], side window guided filtering (SWGF) [29], weighted aggregation for guided image filtering (WAGIF) [30], and robust double-weighted guided image filtering [31].Among them, the effect of gradient domain guided image filtering in image enhancement has a good performance status.But the amplification factor in the GDGIF needs to be set manually; it needs to constantly adjust parameters to obtain a better enhanced image.This also increases the computational complexity.In order to deal with this weakness, an adaptive amplification factor is defined in this paper, and the proposed algorithm is applied to X-ray image enhancement.

Related Works Gradient Domain Guided Image Filtering
The gradient domain guided image filter is proposed by incorporating an explicit first-order edge-aware constraint, and it overcomes the disadvantage of halo artifacts in the guided image filter [25].This method is widely used in image enhancement, image fusion, and image defogging, etc.In the GDGIF method, we suppose the guidance image, input image and output image as G, X and Ẑ, respectively [25].The Ẑ is defined as follows: where a p 1 and b p 1 are constants in the window Ω ξ 1 (p 1 ), the corresponding values can be calculated by minimizing the cost function E a p 1 , b p 1 , and it is computed by: (2) where ΓG (p 1 ) depicts an edge-aware weighting, and it is computed by the following: where χ(p 1 ) is defined as σ G,1 (p 1 )σ G,ξ 1 (p 1 ).
The optimal values of a p 1 and b p 1 can be defined as follows: b The final value of the output image Ẑ(p) can be calculated by the following: where a p and b p represent the mean values of a p 1 and b p 1 in the window, respectively.The corresponding formulas can be defined as follows: where Ω ξ 1 (p 1 ) represents the cardinality of Ω ξ 1 (p 1 ).

The Proposed Method
In this section, an adaptive amplification factor is proposed.From Section 2, we can denote that the detail layer s is defined as the following [25,28]: where Ẑ presents the base layer.Multiplying the detail layer by an amplification factor β, the corresponding equation is defined as follows: where s 1 shows the enhanced detail layer, and β is an adjustable parameter, which can influence the enhanced result.In traditional gradient domain guided image filtering, the value of β is set to 5 [25].
The output image f can be computed by the following: Substituting Equation (8) into Equation ( 12): The gradient of the enhanced detail layer can be defined as follows: From Equation (1), we can define the gradient of base layer, and it is defined as follows: In general, the ∇s 1 is less than ∇ Ẑ.If not, the noise in the detail layer will be amplified.We have the following equation: Substituting Equations ( 15) and ( 16) into Equation ( 17): From Formula (18), we can have the following equation: When the value of β is large, the noise can be amplified; when the value of β is small, the details will be suppressed.From the above analysis, we can see that a proper value of β is very important to balance the noise suppression and detail enhancement.In this section, the value of β is defined as follows: where β is an adaptive parameter, and its value does not need to be set manually.

Experimental Results
In order to demonstrate the effectiveness of the proposed method, we experimented on a large number of X-ray images from the website http://acm.cs.nctu.edu.tw/(accessed on 20 September 2022) which was provided by Prof Ching-Chun Huang, and the following seven image enhancement approaches are compared: McCann [32], RLBHE [33], RESIHE [11], TBCSSR [34], gradient domain guided image filtering (GDGIF) [25], statistical methods with image processing concepts (SMIPC) [35], and improved type-II fuzzy set (FuzzyII) [36].Subjective and objective assessments are used to evaluate the performance of different image enhancement methods.In terms of the objective index, the average gradient (AG) [37], information entropy (H) [37], average local contrast (ALC) [38], spatial frequency (SF) [37] and mean gradient [38] are used in the comparison.The bigger these indexes are, the better the image enhancement effect is.
The average gradient (AG) is defined as follows [37]: where f (i, j) shows the pixel intensity at (i, j), and m × n shows the size of the image.Information entropy (H) estimates the amount of information in the image, and it is calculated by the following [37]: where p k shows the probability of intensity value k in the image.
Appl.Sci.2022, 12, 10453 5 of 12 The average local contrast (ALC) of the image is achieved by calculating the average value of the local contrast metric, and the local contrast is defined as follows [38]: where the local mean of intensity µ w is calculated for the pixels within the sliding 3 × 3 window centered on the pixel (i, j), and σ 2 w shows the local variance of intensity.Spatial frequency (SF) denotes the overall information level in the regions, and it is defined as follows [37]: where The mean gradient (MG) evaluates the edge information of image; it is defined as follows [38]: where G ij shows the magnitude of the gradient at the pixel location (i, j) in the image.
Figure 1 shows the enhancement images of eight methods experimented on X-ray image 1. Figure 1a shows the original X-ray image 1; Figure 1b shows the image obtained by McCann, and the image is too bright; Figure 1c shows the image achieved by RLBHE-the image is too dark and the performance of enhancement is poor, the details of the image are difficult to ascertain; Figure 1d is the result obtained by RESIHE-the definition of the image is low; Figure 1e shows the image enhanced by TBCSSR; Figure 1f represents the image obtained by GDGIF-the image has a lot of noise; Figures 1g and 1h show the result enhanced by SMIPC and FuzzyII, respectively, and the images have poor enhancement performance; Figure 1i is the image achieved by the proposed method-it has moderate brightness and better clarity.Table 1 is the evaluation index values of various algorithms in Figure 1.From this table, we can denote that the values of AG, ALC, SF and MG obtained by the proposed technique are the best; the value of H achieved by SMIPC is the best, and the corresponding value obtained by the proposed method is still ranked second.Figure 2 shows the enhancement images of eight approaches experimented on X-ray image 2. Figure 2a shows the original X-ray image 2; Figure 2b is the result obtained by McCann-the contrast is low; Figure 2c presents the image enhanced by RLBHE-it does not achieve the effect of image enhancement, the image is too dark, and we can hardly get effective information from it; Figure 2d shows the result achieved by RESIHE-the effect of enhancement is not obvious; the images obtained by TBCSSR and FuzzyII are shown in Figures 2e and 2h, respectively.The contrast and the definition are low; Figures 2f and 2g show the results enhanced by GDGIF and SMIPC, respectively.The two images appear to have noise amplification.The result enhanced by the proposed algorithm is shown in Figure 2i-it reveals more image details and suppresses the noise.Bone information can be clearly obtained, which is helpful for doctors to diagnose.Table 2 is the evaluation index values of various methods in Figure 2. Except for H, our method is the best for other indicators.
in Figure 2e and Figure 2h, respectively.The contrast and the definition are low; Figure 2f and Figure 2g show the results enhanced by GDGIF and SMIPC, respectively.The two images appear to have noise amplification.The result enhanced by the proposed algorithm is shown in Figure 2i-it reveals more image details and suppresses the noise.Bone information can be clearly obtained, which is helpful for doctors to diagnose.Table 2 is the evaluation index values of various methods in Figure 2. Except for H, our method is the best for other indicators.Figure 3 shows the enhancement images of eight approaches experimented on X-ray image 3. Figure 3a shows the original X-ray image 3; Figure 3b shows the enhancement result computed by McCann-the image is too bright, resulting in the loss of image details; Figure 3c shows the image achieved by RLBHE-the image is too dark, the useful information is lost; Figure 3d depicts the result achieved by RESIHE-the effect of enhancement is not obvious; Figure 3e shows the image obtained by TBCSSR-the image becomes gray and it is difficult to observe the details; the results enhanced by GDGIF, SMIPC, and FuzzyII are shown in Figure 3f-h, respectively.They are very similar and the enhancement effect is not prominent.Our method is depicted in Figure 3i-it performs well, and more details are retained.Table 3 shows the evaluation index values of the methods in Figure 3 Figure 3 shows the enhancement images of eight approaches experimented on X-ray image 3. Figure 3a shows the original X-ray image 3; Figure 3b shows the enhancement result computed by McCann-the image is too bright, resulting in the loss of image details; Figure 3c shows the image achieved by RLBHE-the image is too dark, the useful information is lost; Figure 3d depicts the result achieved by RESIHE-the effect of enhancement is not obvious; Figure 3e shows the image obtained by TBCSSR-the image becomes gray and it is difficult to observe the details; the results enhanced by GDGIF, SMIPC, and FuzzyII are shown in Figure 3f-h, respectively.They are very similar and the enhancement effect is not prominent.Our method is depicted in Figure 3i-it performs well, and more details are retained.Table 3 shows the evaluation index values of the methods in Figure 3.Our method obtains the best values for all the metrics.Figure 4 shows the enhancement images of eight approaches experimented on X-ray image 4. Figure 4a shows the original X-ray image 4; Figure 4b is the result computed by McCann-the image is too bright; Figure 4c depicts the image enhanced by RLBHE-the image is too dark; Figure 4d is the result achieved by RESIHE-the effect of enhancement is not obvious; the image obtained by TBCSSR is shown in Figure 4e-the image is dark; Figure 4f is the result enhanced by GDGIF-the details of the image are well preserved; Figures 4g and 4h are the results enhanced by SMIPC and FuzzyII, respectively; Figure 4i is the result calculated by our approach.Table 4 shows evaluation data in Figure 4, and we can notice that the values of AG, H, ALC, SF and MG are the best.We used eight image enhancement methods to experiment on 69 X-ray images, which we collected from the website http://acm.cs.nctu.edu.tw/(accessed on 20 September 2022), and the corresponding average data are shown in Table 5.From this table, we can notice that the values of AG, H, ALC SF and MG are the best.Through the above comprehensive analysis, the experiment results show that our method has obvious advantages in terms of both subjective and objective evaluations.Figure 4 shows the enhancement images of eight approaches experimented on X-ray image 4. Figure 4a shows the original X-ray image 4; Figure 4b is the result computed by McCann-the image is too bright; Figure 4c depicts the image enhanced by RLBHE-the image is too dark; Figure 4d is the result achieved by RESIHE-the effect of enhancement is not obvious; the image obtained by TBCSSR is shown in Figure 4e-the image is dark; Figure 4f is the result enhanced by GDGIF-the details of the image are well preserved; Figure 4g and Figure 4h are the results enhanced by SMIPC and FuzzyII, respectively; Figure 4i is the result calculated by our approach.Table 4 shows evaluation data in Figure 4, and we can notice that the values of AG, H, ALC, SF and MG are the best.We used eight image enhancement methods to experiment on 69 X-ray images, which

Conclusions
The low contrast of X-ray images makes it difficult to identify tiny and abnormal details.In order to solve this problem, a novel X-ray image enhancement method based on adaptive gradient domain guided image filtering is proposed, which solves the disadvantage that the amplification factor needs to be adjusted manually in traditional gradient domain guided image filtering.The proposed adaptive amplification factor is adopted to gradient domain guided image filtering and can effectively suppress the noise and boost the fine details in the detail layer.Compared to the state-of-the-art image enhancement methods, the proposed algorithm can produce a good enhanced performance in terms of the subjective and objective assessment.In follow-up work, we will apply this algorithm to the enhancement of other medical images to help doctors carry out auxiliary diagnosis and treatment for patients.

Table 1 .
The metric data of eight methods on X-ray image 1.
algorithms in Figure1.From this table, we can denote that the values of AG, ALC, SF and MG obtained by the proposed technique are the best; the value of H achieved by SMIPC is the best, and the corresponding value obtained by the proposed method is still ranked second.

Table 1 .
The metric data of eight methods on X-ray image 1.

Table 2 .
The metric data of eight methods on X-ray image 2.
. Our method obtains the best values for all the metrics.

Table 3 .
The metric data of eight methods on X-ray image 3.

Table 3 .
The metric data of eight methods on X-ray image 3.

Table 4 .
The metric data of eight methods on X-ray image 4.

Table 5 .
The average metric data of eight methods on 69 X-ray images.

Table 4 .
The metric data of eight methods on X-ray image 4.