Optimized exposer region-based modified adaptive histogram equalization method for contrast enhancement in CXR imaging

This section presents the comparative results and analysis of the proposed ERBMAHE technique and its optimized variant using PSO, known as PSO-ERBMAHE. The study evaluates both techniques on COVID-19, viral pneumonia, and normal CXR images to highlight their effectiveness in enhancing critical visual features. This section is divided into two parts, as outlined below:

  1. a.

    Proposed ERBMAHE.

  2. b.

    Proposed PSO-ERBMAHE.

a. Proposed ERBMAHE

This section analyzes the contrast-enhanced chest X-ray (CXR) images generated using the proposed ‘ERBMAHE’ technique. The CXRs utilized in this study were sourced from the COVID-19 radiography database9 on Kaggle, which has been developed collaboratively by researchers from Qatar University, the University of Dhaka, and their international partners. This dataset includes a comprehensive collection of CXR images categorized into three groups: COVID-19, viral pneumonia, and normal. The dataset has undergone multiple updates to enhance its size and diversity. Initially released with 219 COVID-19 images, it has expanded to include 3,616 COVID-19 images, along with 10,192 normal images and 1345 viral pneumonia images. This continuous improvement ensures that our research is supported by a robust and representative set of data. For our analysis, we selected a total of 200 CXRs from each category to evaluate the algorithm’s performance. Simulations were conducted using MATLAB-2022 on an Intel® Core™ i3-4005U CPU at 1.70 GHz, with 4.00 GB of RAM and a 64-bit Windows 10 Pro operating system. To achieve this goal, eight other methods were compared, namely, “Histogram Equalization (HE)”39, “Nonlinear Exposure Intensity-Based Modification Histogram Equalization (NEIMHE)”33, “Brightness Preserving Bi-Histogram Equalization (BBHE)”30, “Dual Sub-Image HE (DSIHE)”31, “Exposure-Based Sub-Imaging HE (ESIHE)”32 and “Balance Contrast Enhancement Technique (BCET)”40.

In this section, three sample images each from the COVID-19, viral pneumonia and normal categories were evaluated by using a two-stage approach. First, the images are assessed through human visual inspection and then evaluated by using quantitative measures. The resulting images produced by the proposed technique and other state-of-the-art techniques for all three categories are shown in Figs. 4 and 5, and 6. The results of the quantitative analyses of these images are tabulated in Tables 4 and 5, and 6. Additionally, Table 7 display the average results of quantitative analysis of the proposed technique for 600 CXR images. Moreover, enhanced CXR images were evaluated with the help of expert doctors. Each expert doctor rated the resulting images based on the quality scale shown in Table 8. The quantitative parameters for each image are shown in Table 9, and the details of the expert doctors are shown in Table 10.

Table 4 Quantitative analysis results for Fig. 4.
Fig. 4

Outcomes of enhancement for COVID-19 CXR images produced by (a) Input image (b) Proposed ERBMAHE (c) DSIHE (d) BBHE (e) ESIHE (f) BCERT (g) NEIMHE (h) HE.

The original COVID-19 CXR image, as shown in Fig. 4(a), suffers from uneven or non-uniform illumination. The red rectangle in this figure highlights the left lung with insufficient light, making the details invisible. This area is referred to as the “UE” area. On the other hand, the yellow rectangle in the similar figure represents the area with excessive light, causing the texture of the trachea to be obscured. This area is labeled the “OE”. Figure 4(a) displays the input image, which was enhanced using seven different methods: the proposed method, DSIHE, BBHE, ERIHE, BCERT, NEIMHE, and HE. The results of these enhancements are illustrated in Fig. 4(b) through 4(h). After analyzing Fig. 4(b), the proposed ERBMAHE method effectively improved the visibility of the left lung and the trachea. This enhancement was achieved through a high contrast of the overall image, as indicated by the highest value of ICF. Although the value of local contrast is the second lowest, visually, the proposed technique yields more uniform illumination than do the DSIHE, BBHE, ERIHE, BCERT, NEIMHE, and HE methods. In Fig. 4(c), DSIHE enhanced the left lung, and the details of that part are not shown properly. On the other hand, the trachea is excessively enhanced, washing out the details of that region. The ICF is the fourth highest, and this method does not improve the uniform illumination as the proposed approach does. The local contrast value is obtained as the second highest. However, this method does not increase the contrast as much as the proposed technique, which can be observed visually in the image. In Fig. 4(d), the BBHE works similar to the DSIHE, but the value of the ICF is obtained as the third highest. This method slightly improves the contrast, while the local contrast is obtained as the third highest. However, despite having a higher value, it does not show gray-level variation compared to the proposed method, which is observed in the visual image. As shown in Fig. 4(e), the ESIHE enhances the left lung, similar to the other methods, namely, DSIHE, BBHE, ERIHE, BCERT, NEIMHE, and HE. On the other hand, this method over-enhances the trachea, which causes some of its details to be invisible due to excess light. This method obtains the second lowest value of ICF; however, it shows slight variation in contrast to the image. However, the local contrast value of this technique is minimal; hence, it does not improve the local contrast compared to other methods. Figure 4(f) shows that, like the DSIHE, BBHE, and ESIHE, the BCERT enhances the left lung. On the other hand, this method slightly enhances the trachea, providing slight detail to that region. The ICF value obtained via this method is low. However, despite its low value, the contrast of this technique is better than that of DSIHE, BBHE, or ESIHE. Moreover, the highest local contrast is obtained, but this method still fails to improve the contrast compared to the proposed method. In Fig. 4(g), NEIMHE enhances the left lung better than the original lung does but introduces some artifacts in this region. This technique enhances the trachea more, causing some of the present details to vanish. This method achieves the second-highest ICF. However, it fails to enhance the global contrast compared to other methods, such as BBHE, BCERT, DSIHE, and ESIHE. It achieves a higher value of local contrast than does the proposed technique. However, this method fails to improve the local contrast compared to the proposed technique. As shown in Fig. 4(h), HE enhanced both the left lung and trachea, similar to BBHE and DSIHE. The HE achieved the second-lowest ICF value. This shows a global contrast similar to that of BBHE and DSIHE, while HE achieves the highest local contrast value. It fails to boost local contrast compared to the suggested approach of ERBMAHE. Table 4 shows that the proposed ERBMAHE method significantly outperforms others, achieving the highest PSNR, lowest AMBE, highest SSIM, highest entropy, highest FSIM, highest TEN, and highest QRCM values, as visualized in Fig. 4. The method achieves a high PSNR of 27.38, indicating minimal mean intensity difference and effective noise preservation in the image. The low AMBE value of 3.44 suggests that the approach does not cause a significant shift in the mean brightness of the enhanced image. Additionally, the high SSIM score of 0.87 indicates that the method successfully maintains the original image structure during contrast enhancement. The high entropy value of 7.70 reflects a rich amount of information without introducing noise, which is especially beneficial for disease diagnosis in the medical field. Furthermore, a high FSIM score of 0.95 ensures that the low-level features of the input CXR image are preserved without noticeable degradation. A TEN score of 0.28 demonstrates improved sharpness, allowing fine details to be legibly visible. Finally, a high QRCM value of 0.16 achieves good contrast without any changes to the overall contrast.

Table 5 Quantitative analysis results for Fig. 5.
Fig. 5

Outcomes of enhancement for Viral Pneumonia CXR image (a) Input image (b) Proposed ERBMAHE (c) DSIHE (d) BBHE (e) ESIHE (f) BCERT (g) NEIMHE (h) HE.

As shown in Fig. 5(a), the original Viral Pneumonia CXR picture has uneven or non-uniform illumination. The yellow rectangle highlights the left lung with insufficient light, rendering the details invisible. This region is referred to as the “UE” area. The red rectangle in the same figure represents a region with a mixture of low and excessive light, obscuring the texture of the trachea. This area is labeled OE and WE. Figure 5(a) displays the input image, which was enhanced using seven different methods, as mentioned. The results of these enhancements are illustrated in Fig. 5(b) through 5(h). After analyzing Fig. 5(b), the proposed method, ERBMAHE, effectively improved the visibility of the left lung, known as the UE region, and the trachea, shown as the WE and OE regions. The ICF value of this approach is the lowest, but this approach does improve the overall contrast of the resultant images compared with DSIHE, BBHE, ESIHE, BCERT, NEIMHE, and HE. Although this method’s achieved local contrast value is the second lowest, the proposed technique visually demonstrates good local contrast. In Fig. 5(c), DSIHE enhanced fairly well in the left lung, and the details are also shown. On the other hand, the trachea is greatly enhanced, washing out the details of that part. The ICF value obtained via this method is the second highest, whereas the local contrast value is the highest. However, this technique does not increase uniform illumination as much as the proposed approach can, which can be observed visually in the image. In Fig. 5(d), the BBHE works similar to the DSIHE, but the left lung is enhanced more than in the original image. This approach obtained the fourth-highest ICF value. This approach improves the contrast slightly more than does DSIHE while obtaining the second-highest local contrast value. However, despite having a higher value, it does not have uniform illumination compared to the proposed method, as seen in the visual image. Figure 5(e) shows that the ESIHE enhances the left lung, similar to the other methods, DSIHE, BBHE, ESIHE, NEIMHE, and HE. On the other hand, this algorithm makes the trachea similar to that of the original image, so this region has no improvement. This method achieves the lowest ICF. However, it shows a slight variation in contrast in the image. However, the local contrast value of this method is the second lowest. Hence, when seen visually, it becomes apparent that the ESIHE method does not improve the local contrast compared to that of the proposed method. Figure 5(f) shows that BCERT does not improve contrast in the left lung or trachea. It produces a resultant image similar to that of the original image. The ICF obtained via this approach is the third highest. However, despite having the third highest value, this method’s contrast is similar to that of the original image. Moreover, the local contrast is greater than that of the proposed technique, but this method fails to improve the contrast. Figure 5(g) and Fig. 5(h) show that the NEIMHE and HE methods enhance the left lung more than the original image does, while the trachea is over-enhanced, causing the information about this region to disappear. NEIMHE and HE obtained higher local contrast values than did the proposed technique, but these methods did not improve the local contrast compared to that of the proposed method. Both methods also achieve higher ICF values than does the proposed technique; however, both of these methods are unable to improve uniform illumination, as is the case for the proposed approach. As shown in Table 5, the proposed ERBMAHE method achieves the highest PSNR, the lowest AMBE, the highest SSIM, the highest entropy, the highest FSIM, the highest TEN, and the highest QRCM values, as visualized in Fig. 5. A high PSNR indicates that the method results in minimal differences in mean intensity and effectively preserves the noise level of the image. A high SSIM value suggests that the proposed technique maintains the original image structure during contrast enhancement. Additionally, a low AMBE score indicates that the ERBMAHE approach does not cause a significant shift in the mean brightness of the enhanced image, effectively retaining the mean brightness of the input image. Furthermore, the technique preserves considerable detail, achieving a DE of 7.01 while maintaining the image’s contrast and noise levels. A high FSIM score of 0.96 ensures that the low-level features of the input CXR image are preserved without noticeable degradation. The TEN score of 0.37 demonstrates improved sharpness, allowing fine details to be clearly visible. Lastly, a high QRCM value of 0.27 indicates good contrast without altering the overall visual quality of the image.

Table 6 Quantitative analysis results for Fig. 6.
Fig. 6

Outcomes of enhancement for normal CXR images (a) Input image (b) Proposed ERBMAHE (c) DSIHE (d) BBHE (e) ESIHE (f) BCERT (g) NEIMHE (h) HE.

The original normal CXR image, as shown in Fig. 6(a), has uneven or non-uniform illumination. In this figure, the red rectangle highlights the right lung with insufficient light, rendering the details invisible. This area is referred to as the UE region. The blue rectangle in the same figure represents the area with low light and obscuring texture of the trachea. This area is referred to as the UE area. Figure 6(a) displays the input image, which was enhanced using seven different methods: the proposed method, DSIHE, BBHE, ESIHE, BCERT, NEIMHE, and HE. The results of these enhancements are illustrated in Fig. 6(b) through 6(h). After analyzing Fig. 6(b), the proposed technique effectively enhanced both the left lung and trachea, and the visibility of both areas was fairly enhanced. Therefore, the information in both regions is highlighted more than in the original image. The ICF of this method is the fourth highest, but this increases the overall contrast of the resultant image more than does DSIHE, BBHE, ESIHE, BCERT, NEIMHE, or HE. Although this algorithm achieved the third lowest local contrast, the proposed technique of ERBMAHE visually exhibited uniform illumination. In Fig. 6(c), DSIHE enhanced fairly well in the right lung, and the details are shown properly. On the other hand, the trachea is excessively enhanced due to washing out the details of this region. The ICF of this method is greater than that of the proposed method, but this does not improve the contrast compared to that of the proposed algorithm, whereas the local contrast value is obtained as the highest. However, this technique does not increase the local contrast as much as the proposed method, which we can see visually in the image. An examination of Fig. 6(d), (e), (g), and (h) reveals that BBHE, ESIHE, NEIMHE, and HE all effectively enhanced the right lung by clarifying and visualizing the relevant information. However, these methods fail to enhance the trachea region because they wash out the relevant information. Figure 6(f) shows that BCERT does not improve contrast in the right lung or trachea; it produces a resultant image similar to the original image. The BBHE, ESIHE, and HE algorithms achieved higher ICF values than did the proposed algorithm, except for the NEIMHE algorithm. However, these methods did not enhance the contrast compared to the proposed method. On the other hand, the local contrast value was found to be the highest except for BBHE and NEIMHE. Despite this, these methods did not improve the local contrast as effectively as the proposed technique, which is visible when looking at the image. As shown in Table 6, the proposed ERBMAHE method yields the highest PSNR, lowest AMBE, highest entropy values, highest TEN, and highest QRCM values and second highest SSIM and FSIM, which can be visualized in Fig. 6. The presented technique yields a maximum PSNR of 28.38 and a minimum AMBE of 1.63, indicating resilience to degradation and shifts in brightness. The proposed technique preserves a significant amount of information with a high DE of 7.47 without compromising the contrast or noise level in the image. The TEN score of 0.37 demonstrates improved sharpness, allowing fine details to be clearly visible. Lastly, a high QRCM value of 0.25 indicates good contrast without altering the overall visual quality of the image. However, it is essential to note that the proposed algorithm achieved lower SSIM and FSIM values than the ESIHE method. A visual comparison of images produced by both techniques reveals that the proposed method effectively preserves the original image’s structure.

Table 7 presents the average quantitative outcomes of 600 CXR images using the proposed ERBMAHE technique at the output stage. In this case, the proposed approach achieved the highest values of Entropy, PSNR, TEN and QRCM while the ICF, SSIM and FSIM values were the second highest. The proposed algorithm demonstrates enhanced detail visibility in the CXR images, achieving the highest Entropy value compared to six other state-of-the-art approaches.

Table 7 Average quantitative results obtained for 600 CXR images with the proposed algorithm at output stage.

Survey of Doctor experts

To evaluate the clinical effectiveness of the proposed ERBMAHE method, a survey was conducted with 12 expert doctors specializing in radiology, pulmonology, and internal medicine. The details of all experts are presented in Table 10. Each doctor was given 12 CXR images, including original images and images enhanced by the ERBMAHE method and six other techniques. The images were evaluated against four main criteria: contrast enhancement, clear visibility of anatomical structures, naturalness of the image and clinical applicability. The ratings were given on a scale from 1 to 5, as shown in Table 8, where 1 indicated bad performance and 5 indicated excellent performance. Images from the categories of COVID-19, normal, and viral pneumonia were selected to properly assess the technique. Results of the evaluation conducted by experts are presented in Table 9. Survey results proved that the suggested technique improves image quality with a clear visual representation, which is essential for clinical decision-making.

Table 8 Rating system for assessing subjective quality.
Table 9 Assessment of outcomes by expert Doctors for CXR images enhancement.
Table 10 Information about the specialists involved in the visual evaluation of the enhancement process.

b. Proposed PSO-ERBMAHE

The PSO-ERBMAHE technique was applied to CXR images to enhance image quality and optimize specific quantitative parameters. The testing process encompassed three categories of CXR images: COVID-19, Normal, and Viral Pneumonia.

Parameter settings

The parameters used in PSO-ERBMAHE technique implementation are summarized in Table 2.

Impact of parameter settings on image enhancement

The choice of parameters in PSO plays a crucial role in the optimization process and ultimately influences the quality of the enhanced images.

  • Swarm Size: A swarm size of 30 was selected to strike a balance between exploration of the solution space and convergence speed. This size allowed for sufficient diversity among particles while maintaining computational efficiency38.

  • Inertia Weight (\(\:w\)): The inertia weight was set to 0.8 to promote exploration within the search space. This value facilitated a balance between maintaining particle velocity and allowing for sufficient exploration of new areas. Adjustments to this parameter showed that higher inertia weights resulted in better exploration but required more iterations to converge41.

  • Acceleration Constants (c1, c2): Both acceleration constants were set to 2.5, which influenced how particles were attracted to their own best positions and the global best position found by the swarm. These settings enabled rapid convergence towards optimal solutions without causing overshooting or instability in the search process42.

  • Fitness Function Weights: The fitness functions—Entropy, Peak Signal-to-Noise Ratio (PSNR), Absolute Mean Brightness Error (AMBE), Image Contrast Function (ICF), Local Contrast (LC), Structural Similarity Index (SSIM), Feature Similarity Index (FSIM), Tenengrad function (TEN) and Quality-Aware Relative Contrast Measure (QRCM) —were each assigned equal weights of 0.25. This balanced approach ensured that no single metric dominated the optimization process, leading to well-rounded enhancements across various quality measures37.

In Fig. 7, we present both qualitative and quantitative results of the PSO-ERBMAHE and the proposed ERBMAHE techniques. The PSO-ERBMAHE method produced clear, sharp images that preserved essential anatomical details, which is crucial for accurate disease diagnosis. The quantitative results demonstrated improvements across several key metrics. Specifically, the proposed method yielded higher entropy values, reflecting the increased information richness of the enhanced images. Given the importance of information content in medical imaging, entropy served as a primary parameter for evaluation. Furthermore, the Particle Swarm Optimization (PSO) method significantly increased the Peak Signal-to-Noise Ratio (PSNR), reducing noise and improving image clarity. This enhancement was corroborated by the increase in the Structural Similarity Index (SSIM), suggesting better preservation of anatomical structures – a critical factor for medical image fidelity. Higher values of the Feature Similarity Index (FSIM) indicate that the proposed method effectively preserves the overall morphology of CXR images while enhancing contrast. Additionally, a higher Quality-Aware Relative Contrast Measure (QRCM) suggests that the technique maintains better quality without alterations to the contrast. Finally, an increased value from the Tenengrad function (TEN) demonstrates that the suggested method achieves enhanced sharpness, allowing fine details to be clearly visible. This technique also exhibited a lower AMBE, reflecting a more accurate brightness that matched the ideal standard. As shown in Fig. 7, the PSO-ERBMAHE achieved a DE of 7.63, a PSNR of 29.60, an AMBE of 0.51, an ICF of 46.98, an LC of 54.29, an SSIM of 0.89, FSIM of 0.97, TEN of 0.26, and QRCM of 0.17, demonstrating improved results compared to the ERBMAHE approach. For normal chest X-ray (CXR) images, PSO-ERBMAHE obtained a DE of 7.54, a PSNR of 31.15, an AMBE of 0.58, an ICF of 46.82, an LC of 55.11, an SSIM of 0.89, FSIM of 0.96, TEN of 0.34, and QRCM of 0.24, again highlighting enhancements over the ERBMAHE technique. In the case of viral pneumonia CXR images, the PSO-ERBMAHE achieved a DE of 6.97, a PSNR of 29.75, an AMBE of 1.79, an ICF of 38.96, an LC of 33.15, an SSIM of 0.85, FSIM of 0.98, TEN of 0.35, and QRCM of 0.24, consistently indicating improvements over the original ERBMAHE approach.

Thus, the PSO-ERBMAHE method effectively demonstrates that the selected parameters optimize both quantitative and qualitative outcomes. Moreover, the PSO-ERBMAHE approach demonstrated balanced enhancements compared to six other techniques, achieving a better balance of brightness, contrast, and structural similarity. These enhancements, both quantitative and qualitative, underscore the effectiveness of PSO-ERBMAHE for medical imaging tasks. The optimized images provide improved contrast and clarity, contributing to more reliable clinical analysis.

Fig. 7

Comparison of results between the original, proposed ERBMHE, and proposed PSO-ERBMAHE.

In Table 11, we compared the average quantitative results obtained for 600 CXR images between the proposed ERBMAHE and the proposed PSO-ERBMAHE algorithms at the output stage. The results demonstrate that our ERBMAHE approach achieved the highest entropy, TEN, and QRCM values. The PSNR, AMBE, ICF, and SSIM values were also notably high, securing second place. On the other hand, the PSO-ERBMAHE technique attained the highest PSNR, AMBE, SSIM, and FSIM values while ranking second for entropy, TEN, and QRCM. Overall, PSO-ERBMAHE approach consistently generates optimal and superior results for an average of 600 CXR medical images. The quantitative assessment confirms that PSO-ERBMAHE method effectively preserves significant diagnostic features while processing the medical images.

Table 11 Presents a comparison of the average quantitative results obtained from the proposed ERBMAHE and proposed PSO-ERBMAHE techniques for 600 CXR images.

Practical applications and effects of contrast enhancement in CXR imaging

Contrast-enhanced CXR have numerous practical applications in medical diagnostics and clinical workflows. Enhanced X-rays significantly improve the visualization of fine details, facilitating the early detection of conditions such as pneumonia, tuberculosis, lung cancer, pulmonary edema, and interstitial lung diseases43. Subtle features, such as small nodules, fine blood vessel patterns, or early-stage fractures, become more discernible, enabling precise diagnosis44. Additionally, contrast-enhanced images make it easier to monitor disease progression in conditions like COVID-19, chronic obstructive pulmonary disease (COPD), or fibrosis by providing clear comparisons over time45. This technique also plays a critical role in AI and computer-aided diagnosis (CAD), where enhanced images serve as better inputs for machine learning models, improving the accuracy and reliability of automated detection algorithms46. These tools are particularly useful for training AI systems to distinguish between normal and pathological cases with greater precision47. Contrast enhancement is equally valuable in preoperative and postoperative evaluations, assisting surgeons and clinicians in planning thoracic surgeries and assessing their outcomes48. Moreover, enhanced CXR transmitted electronically in telemedicine and remote diagnosis enable radiologists to make accurate diagnoses in underserved or remote areas49. The technique also contributes to education and training, helping medical students and trainees to identify subtle pathologies with greater ease44.

The effects of contrast enhancement on CXR are equally impactful. It improves the visibility of critical structures, such as the lung parenchyma, ribs, diaphragm, and mediastinal regions, making hidden or low-contrast areas like small lesions or fluid accumulations more apparent45. This reduces diagnostic errors by decreasing the likelihood of false negatives (missed pathologies) and false positives (misinterpretations of normal features as abnormal)46. Enhanced contrast also aids in better interpretation of images in challenging cases, such as those involving over- or under-exposed X-rays, by restoring image quality and supporting accurate diagnoses47. This technique enhances workflow efficiency by allowing radiologists to interpret images more quickly and accurately, reducing delays and improving patient throughput49.

Computational performance and limitations

To evaluate the computational performance of the Proposed ERBMAHE, BBHE, ESIHE, BCERT, DSIHE, HE, and NEIMHE algorithms, Table 12 presents the average computational time, measured in seconds, for all 600 CXR images. The time is calculated from when the input image is provided until the resultant image is produced. From the result, BBHE, ESIHE, BCERT, DSIHE, HE, and NEIMHE are faster than the proposed ERBMAHE. This is because ERBMAHE involves multiple sub-images and consists of several processing stages, while the nature of HE computation is much simpler as well as BBHE, NEIMHE, ESIHE, and DSIHE computation only involve different histogram segmentation thresholds such as mean and median. Although the proposed technique requires more processing time in general, the proposed technique produces better contrast enhancement performance qualitatively and quantitatively compared to others. Additionally, in this approach, we utilized the PSO-ERBMAHE-based technique. While this method increases computational complexity, it delivers excellent contrast enhancement results, making it highly effective for disease detection. Moreover, the proposed ERBMAHE technique has been tested exclusively on CXR images. In the future, this approach could be extended to other medical imaging modalities, such as CT scans, MRI, PET, and ultrasound.

Table 12 Average computational time (seconds) of 600 CXR images for proposed ERBMAHE, BBHE, ESIHE, BCERT, DSIHE, HE, and NEIMHE methods.

Leave a Comment