The Pneumonia is a serious respiratory infection that can lead to severe health complications and increased mortalityifnotdiagnosedandtreatedatanearlystage.ConventionaldiagnosisusingchestX-rayimaging istime-consumingandhighlydependentontheexpertiseofradiologists,whichmaynotalwaysbereadily available in healthcare facilities. To address this challenge, this project presents an Advanced Pneumonia Detection and Severity Analysis System from Chest X-Ray Images Using CLAHE-Enhanced Convolutional Neural Networks (CNN) with Grad-CAM Visualization and Clinical Recommendation Support. The proposed system utilizes Contrast Limited Adaptive Histogram Equalization (CLAHE) as a preprocessing technique to enhance the quality and contrast of chest X-ray images, thereby improving feature extraction and classification performance. A deep CNN model is trained on labeled chest radiographs to automatically classify images as Pneumonia or Normal while also assessing the severity level of infection. The model learns discriminative patterns from enhanced X-ray images and provides accurate predictions with improved robustness. To improve transparency and interpretability, Gradient- weighted Class Activation Mapping (Grad-CAM) is integrated into the framework to generate heatmap visualizations that highlight the infected lung regions responsible for the model’s predictions. The performanceoftheproposedmodelisevaluatedusingmetricssuchasaccuracy,precision,recall,F1-score, and confusion matrix analysis. Experimental results demonstrate that the integration of CLAHE enhancement and Grad-CAM interpretability significantly improves diagnostic reliability and model understanding.Thedevelopedsystemoffersanefficient,accurate,andexplainableAI-assistedsolutionfor early pneumonia diagnosis, severity assessment, timely treatment support, and improvement.
Introduction
Pneumonia is a serious respiratory disease that causes inflammation of the lungs and remains a leading cause of death worldwide, particularly among children, older adults, and immunocompromised patients. Chest X-ray imaging is the most widely used diagnostic tool for pneumonia detection, but manual interpretation is time-consuming, prone to errors, and limited by the shortage of experienced radiologists. Recent advances in Artificial Intelligence (AI), especially Convolutional Neural Networks (CNNs), have significantly improved automated pneumonia detection. However, most deep learning models lack transparency, making it difficult for clinicians to trust their predictions.
This study proposes an Explainable AI (XAI)-driven framework for pneumonia detection that integrates Contrast Limited Adaptive Histogram Equalization (CLAHE) for image enhancement, a CNN for classification, Grad-CAM for visual explanations, severity assessment, and a Clinical Decision Support System (CDSS). CLAHE improves chest X-ray contrast and highlights lung abnormalities, enabling better feature extraction by the CNN. Grad-CAM generates heatmaps that identify the regions influencing the model’s predictions, increasing interpretability and clinician confidence.
The methodology begins with collecting chest X-ray images from public datasets such as Kaggle, RSNA, and NIH. Images are preprocessed through resizing, noise reduction, CLAHE enhancement, normalization, and data augmentation before being input to the CNN. The network classifies images as Normal or Pneumonia. Positive cases are further categorized into Mild (less than 25% lung involvement), Moderate (25–50%), or Severe (more than 50%) based on the extent of infection. Grad-CAM produces visual heatmaps of infected regions, while the CDSS combines predictions, confidence scores, severity levels, and treatment recommendations, providing clinicians with an interpretable second-opinion tool.
The literature review highlights the success of transfer learning models such as VGG16, ResNet50, InceptionV3, and EfficientNetB3, as well as federated learning approaches that improve diagnostic accuracy while preserving patient privacy. Recent research also emphasizes the importance of explainability techniques and hyperparameter optimization in enhancing clinical trust and model performance.
Experimental results show that the proposed CLAHE-optimized CNN framework effectively improves image quality, accurately detects pneumonia, assesses disease severity, and generates meaningful Grad-CAM visualizations. The integrated Clinical Decision Support System provides comprehensive diagnostic reports, making the framework a reliable and transparent tool to assist radiologists in faster diagnosis, improved treatment planning, and reduced clinical workload.
Conclusion
This project proposed an Explainable AI-driven framework for pneumonia detection from chest X-ray images using a CLAHE-optimized CNN model. The system successfully enhanced image quality, detected pneumonia cases accurately, and classified disease severity into different levels. The integration of Grad-CAM visualization improved the interpretability of the model by highlighting the affected lung regions responsible for the predictions.
Furthermore, the Clinical Decision Support System provided meaningful diagnostic information to assist healthcare professionals in decision-making. Overall, the proposed framework demonstrated the potential of combining deep learning and explainable AI for accurate, reliable, and efficient pneumonia diagnosis, making it a useful tool for supporting radiologists and improving patient care.
References
[1] P. Rajpurkar, J. Irvin, K. Zhu, B. Yang, H. Mehta, T. Duan, D. Ding, A. Bagul, C. Langlotz, K. Shpanskaya, M. Lungren and A. Ng, “CheXNet: Radiologist-Level Pneumonia Detection on Chest X-Rays with Deep Learning,” Stanford University, 2017.
[2] X. Wang, Y. Peng, L. Lu, Z. Lu, M. Bagheri and R. Summers, “ChestX-ray8: Hospital-Scale Chest X-Ray Database and Benchmarks on Weakly Supervised
[3] Classification and Localization of Common Thorax Diseases,” IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3462–3471, 2017.
[4] D. Kermany, K. Zhang and M. Goldbaum, “Identifying Medical Diagnoses and Treatable Diseases by Image-Based Deep Learning,” Cell, vol. 172, no. 5, pp. 1122–1131, 2018.
[5] K. He, X. Zhang, S. Ren and J. Sun, “Deep Residual Learning for Image Recognition,” IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016.
[6] G. Huang, Z. Liu, L. van der Maaten and K. Weinberger, \"Densely Connected Convolutional Networks,\" IEEE Conference on Computer Vision and Pattern Recognition,
[7] R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh and D. Batra, “Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization,” International Journal of Computer Vision, vol. 128, no. 2, pp. 336–359, 2020.