Incorporating self-attention into DenseNet for multi-label chest X-ray image classification
Main Article Content
Abstract
This paper presents DNet-nSA, a novel deep learning architecture designed to enhance multi-label classification of chest X-ray (CXR) images by integrating n self-attention blocks into the DenseNet framework. While convolutional neural networks (CNNs) are effective at identifying local patterns, they frequently face challenges in capturing long-range dependencies and global context, which are essential for detecting spatially distributed abnormalities in CXR images. By embedding self-attention mechanisms, DNet-nSA allows the network to better capture non-local interactions and highlight diagnostically relevant regions. We propose and evaluate two variants: DNet-1SA and DNet-2SA, corresponding to the number of self-attention modules used. Experiments conducted on the ChestX-ray14 dataset demonstrate that the proposed models outperform the baseline DenseNet, the contrastive learning approach MoCoR101, and the self-supervised learning model MoBYSwinT, achieving a notable AUC of 0.822, confirming the effectiveness of self-attention in improving multi-label CXR image classification.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
References
Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M., Kudlur, M., Levenberg, J., Monga, R., Moore, S., Murray, D. G., Steiner, B., Tucker, P., Vasudevan, V., Warden, P., … Zheng, X. (2016). TensorFlow: A system for large-scale machine learning (No. arXiv:1605.08695). arXiv. https://doi.org/10.48550/arXiv.1605.08695
Adjei-Mensah, I., Zhang, X., Agyemang, I. O., Yussif, S. B., Baffour, A. A., Cobbinah, B. M., Sey, C., Fiasam, L. D., Chikwendu, I. A., & Arhin, J. R. (2024). Cov-Fed: Federated learning-based framework for COVID-19 diagnosis using chest X-ray scans. Engineering Applications of Artificial Intelligence, 128, 107448. https://doi.org/10.1016/j.engappai.2023.107448
Bustos, A., Pertusa, A., Salinas, J.-M., & de la Iglesia-Vayá, M. (2020). PadChest: A large chest X-ray image dataset with multi-label annotated reports. Medical Image Analysis, 66, 101797. https://doi.org/10.1016/j.media.2020.101797
Çallı, E., Sogancioglu, E., van Ginneken, B., van Leeuwen, K. G., & Murphy, K. (2021). Deep learning for chest X-ray analysis: A survey. Medical Image Analysis, 72, 102125. https://doi.org/10.1016/j.media.2021.102125
Chen, G.-Y., & Lin, C.-T. (2024). Multi-task supervised contrastive learning for chest X-ray diagnosis: A two-stage hierarchical classification framework for COVID-19 diagnosis. Applied Soft Computing, 155, 111478. https://doi.org/10.1016/j.asoc.2024.111478
Chicco, D. (2021). Siamese Neural Networks: An Overview. In H. Cartwright (Ed.), Artificial Neural Networks (pp. 73–94). Springer US. https://doi.org/10.1007/978-1-0716-0826-5_3
Chollet, F. (2015). Keras. Seattle, WA, USA.
Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., & Houlsby, N. (2020, October 22). An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv.Org. https://arxiv.org/abs/2010.11929v2
Galán-Cuenca, A., Gallego, A. J., Saval-Calvo, M., & Pertusa, A. (2024). Few-shot learning for COVID-19 chest X-ray classification with imbalanced data: An inter vs. intra domain study. Pattern Analysis and Applications, 27(3), 69. https://doi.org/10.1007/s10044-024-01285-w
Hage Chehade, A., Abdallah, N., Marion, J.-M., Hatt, M., Oueidat, M., & Chauvet, P. (2024). A systematic review: Classification of lung diseases from chest X-ray images using deep learning algorithms. SN Computer Science, 5(4), 405. https://doi.org/10.1007/s42979-024-02751-2
Hasanah, U., Avian, C., Darmawan, J. T., Bachroin, N., Faisal, M., Prakosa, S. W., Leu, J.-S., & Tsai, C.-T. (2024). CheXNet and feature pyramid network: A fusion deep learning architecture for multilabel chest X-Ray clinical diagnoses classification. The International Journal of Cardiovascular Imaging, 40(4), 709–722. https://doi.org/10.1007/s10554-023-03039-x
Hasanah, U., Leu, J.-S., Avian, C., Azmi, I., & Prakosa, S. W. (2025). A systematic review of multilabel chest X-ray classification using deep learning. Multimedia Tools and Applications, 84(23), 26719–26753. https://doi.org/10.1007/s11042-024-20172-4
Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning. Springer. https://doi.org/10.1007/978-0-387-84858-7
He, K., Zhang, X., Ren, S., & Sun, J. (2015). Deep Residual Learning for Image Recognition (No. arXiv:1512.03385). arXiv. https://doi.org/10.48550/arXiv.1512.03385
Huang, G., Liu, Z., van der Maaten, L., & Weinberger, K. Q. (2017). Densely connected convolutional networks. 4700–4708. https://openaccess.thecvf.com/content_cvpr_2017/html/Huang_Densely_Connected_Convolutional_CVPR_2017_paper.html
Irvin, J., Rajpurkar, P., Ko, M., Yu, Y., Ciurea-Ilcus, S., Chute, C., Marklund, H., Haghgoo, B., Ball, R., Shpanskaya, K., Seekins, J., Mong, D. A., Halabi, S. S., Sandberg, J. K., Jones, R., Larson, D. B., Langlotz, C. P., Patel, B. N., Lungren, M. P., & Ng, A. Y. (2019). CheXpert: A Large Chest Radiograph Dataset with Uncertainty Labels and Expert Comparison (No. arXiv:1901.07031). arXiv. https://doi.org/10.48550/arXiv.1901.07031
Koyyada, S. P., & Singh, T. P. (2024). A Systematic Survey of Automatic Detection of Lung Diseases from Chest X-Ray Images: COVID-19, Pneumonia, and Tuberculosis. SN Computer Science, 5(2), 229. https://doi.org/10.1007/s42979-023-02573-8
Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., & Guo, B. (2021). Swin Transformer: Hierarchical Vision Transformer using Shifted Windows (No. arXiv:2103.14030). arXiv. https://doi.org/10.48550/arXiv.2103.14030
Lu, Y., Hu, Y., Li, L., Xu, Z., Liu, H., Liang, H., & Fu, X. (2024). CvTGNet: A novel framework for chest X-ray multi-label classification. https://doi.org/10.1145/3649153.3649216
Nguyen, H. Q., Lam, K., Le, L. T., Pham, H. H., Tran, D. Q., Nguyen, D. B., Le, D. D., Pham, C. M., Tong, H. T. T., Dinh, D. H., Do, C. D., Doan, L. T., Nguyen, C. N., Nguyen, B. T., Nguyen, Q. V., Hoang, A. D., Phan, H. N., Nguyen, A. T., Ho, P. H., … Vu, V. (2022). VinDr-CXR: An open dataset of chest X-rays with radiologist’s annotations. Scientific Data, 9(1), 429. https://doi.org/10.1038/s41597-022-01498-w
Öztürk, Ş., Turalı, M. Y., & Çukur, T. (2025). HydraViT: Adaptive multi-branch transformer for multi-label disease classification from chest X-ray images. Biomedical Signal Processing and Control, 100, 106959. https://doi.org/10.1016/j.bspc.2024.106959
Poloju, N., & Rajaram, A. (2025). Hybrid technique for lung disease classification based on machine learning and optimization using X-ray images. Multimedia Tools and Applications, 84(21), 23531–23553. https://doi.org/10.1007/s11042-024-19959-2
Shelke, A., Inamdar, M., Shah, V., Tiwari, A., Hussain, A., Chafekar, T., & Mehendale, N. (2021). Chest X-ray classification using deep learning for automated COVID-19 screening. SN Computer Science, 2(4), 300. https://doi.org/10.1007/s42979-021-00695-5
Simonyan, K., & Zisserman, A. (2015). Very deep convolutional networks for large-scale image recognition (No. arXiv:1409.1556). arXiv. https://doi.org/10.48550/arXiv.1409.1556
Sowrirajan, H., Yang, J., Ng, A. Y., & Rajpurkar, P. (2021). MoCo Pretraining Improves Representation and transferability of chest X-ray models. Proceedings of the Fourth Conference on Medical Imaging with Deep Learning, 728–744.
Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., & Wojna, Z. (2016). Rethinking the inception architecture for computer vision. 2818–2826.
Tan, M., & Le, Q. (2021). EfficientNetV2: Smaller models and faster training. Proceedings of the 38th International Conference on Machine Learning, 10096–10106. https://proceedings.mlr.press/v139/tan21a.html
Vapnik, V. (2000). The nature of statistical learning theory (2nd ed.).
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł. ukasz, & Polosukhin, I. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30.
Verma, S., Devarajan, G. G., & Sharma, P. K. (2024). Comparative evaluation of feature extraction techniques in chest X ray image with different classification model. In D. Garg, J. J. P. C. Rodrigues, S. K. Gupta, X. Cheng, P. Sarao, & G. S. Patel (Eds.), Advanced Computing (pp. 197–209). Springer Nature Switzerland. https://doi.org/10.1007/978-3-031-56703-2_17
Vo, T.-T., & Do, T.-N. (2024a). Enhancing efficiency of multi-label X-ray image classification with self-supervised learning based on compact swin transformers. In T. K. Dang, J. Küng, & T. M. Chung (Eds.), Future Data and Security Engineering. Big Data, Security and Privacy, Smart City and Industry 4.0 Applications (pp. 153–167). Springer Nature. https://doi.org/10.1007/978-981-96-0434-0_11
Vo, T.-T., & Do, T.-N. (2024b). Improving chest X-ray image classification via integration of self-supervised learning and machine learning algorithms. Journal of Information and Communication Convergence Engineering, 22, 165–171. https://doi.org/10.56977/jicce.2024.22.2.165
Wang, G., Wang, P., & Wei, B. (2024). Multi-label local awareness and global co-occurrence priori learning improve chest X-ray classification. Multimedia Systems, 30(3), 132. https://doi.org/10.1007/s00530-024-01321-z
Wang, X., Peng, Y., Lu, L., Lu, Z., Bagheri, M., & Summers, R. M. (2017, May 5). ChestX-ray8: Hospital-scale chest X-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. arXiv.Org. https://doi.org/10.1109/CVPR.2017.369
Xie, Z., Lin, Y., Yao, Z., Zhang, Z., Dai, Q., Cao, Y., & Hu, H. (2021). Self-supervised learning with swin transformers (No. arXiv:2105.04553). arXiv. https://doi.org/10.48550/arXiv.2105.04553
Zhao, X., & Wang, X. (2025). Multi-label chest X-ray image classification based on long-range dependencies capture and label relationships learning. Biomedical Signal Processing and Control, 100, 107018. https://doi.org/10.1016/j.bspc.2024.107018