This research proposed CoSegXAI, an experimental pipeline to investigate the impact of lung segmentation on the explainability and performance of deep neural networks applied to multiclass chest X-ray classification. We employed the COVID-19 Radiography Database and trained ResNet50, DenseNet201, and VGG19 models on both contextual (original) and ROI-based (segmented) images across four diagnostic classes: COVID-19, lung opacity, viral pneumonia, and normal cases. To evaluate model decisions, we generate the saliency maps using Grad-CAM and assess them through visual analysis and quantitative metrics, including Insertion Correlation (IC), Deletion Correlation (DC), and Sparsity. Our findings show that models trained on contextual images achieved superior classification performance. DenseNet201 achieves an accuracy of 92.80% and 88.08% trained on contextual and ROI-based images, respectively. However, explainability analysis reveals that models trained on ROI-based (segmented important regions) images produce more focused attention patterns with better calibration, achieving superior IC, DC, and Sparsity scores. These results suggest that models are more reliable and provide clinicians with greater explainability. The source code is available at https://github.com/graciellafavoreto/CoSegXAI.git.
Favoreto et al. (Tue,) studied this question.