Fine-tuning Fully Connected Layer Architecture in Convolutional Neural Networks for Tuberculosis Classification of Chest Radiographs

Authors

Keywords:

Tuberculosis Classification, Convolutional Neural Networks, Chest X-ray

Abstract

Background and Objectives: Tuberculosis remains a leading cause of worldwide mortality, accounting for approximately 1.5 million deaths annually. Rapid diagnosis is essential for increasing accessibility to timely treatment. Although Convolutional Neural Network (CNN) technologies exhibit high performance, large-scale models often encounter over-parameterization, which may be unsuitable in resource-limited settings. The present research presents an experimental study to fine-tune 15 variations of Fully Connected (FC) layer architectures to identify a classification head that achieves an optimal balance between resource efficiency (lightweight) and maximum performance (effectiveness).

Methodology: The models were developed by pairing 15 popular feature extraction architectures (backbones) with 15 newly designed FC layer patterns, resulting in a total of 225 model combinations. A balanced dataset comprising 6,388 chest X-ray images (3,194 Tuberculosis and 3,194 Normal) was utilized to mitigate model bias. The data was partitioned into a training set (70%, 4,471 images), a validation set (20%, 1,278 images), and a test set (10%, 639 images). Performance was evaluated using 5-fold cross-validation to assess stability. Hyperparameters were set as follows: Adam optimizer (LR = 0.001), 15 epochs, and a batch size of 128.

Main Results: VGG16 architecture combined with "FC Pattern 11" achieved the highest performance, yielding an accuracy of 98.58%, a mean cross-validation accuracy of 97.52% (SD = 0.01), and a loss of 0.15. Clinical evaluation metrics demonstrated a sensitivity of 99.05% and a specificity of 98.11%. Pattern 11 employs a sequential node reduction strategy (384 -> 192 -> 96) integrated with Batch Normalization and L2 Regularization, which effectively improves internal stability and mitigates overfitting. Furthermore, this model maintains a lightweight structure with a depth of 16 layers, effectively reducing computational load and preventing over-parameterization more efficiently than deeper, more complex architectures.

Conclusions: Fine-tuning fully connected layers can significantly enhance standard architectures to a level suitable for Clinical Decision Support Systems (CDSS). The developed model is technically appropriate for preliminary screening, particularly due to its high sensitivity (99.05%), which minimizes the risk of missing pathological cases during initial triage.

Practical Application: The proposed model can be implemented as a preliminary screening tool to effectively reduce the workload of radiologists by filtering normal cases from suspected ones. The approach could help accelerate the diagnostic process, particularly in hospitals with limited resources and specialists, ensuring that patients receive timely and effective treatment.

References

World Health Organization (WHO). Tuberculosis [Online]. Available: https://www.who.int/health-topics/tuberculosis. [1 October 2025]

The Government Public Relations Department (PRD). Warning... Be Alert to the Danger of Tuberculosis (TB) [Online]. Available: https://www.prd.go.th/th/content/ category/detail/id/39/iid/376117. [1 October 2025] (In Thai)

Wajgi, R., Yenurkar, G., Nyangaresi, V., Wanjari, B., Verma, S., Deshmukh, A. and Mallewar, S. 2024. Optimized tuberculosis classification system for chest X‐ray images: Fusing hyperparameter tuning with transfer learning approaches. Engineering Reports, 6, e12906. https://doi.org/10.1002/eng2.12906

Rim, B., Jang, H., Lee, H. and Jeon, W. 2025. Active and Inactive Tuberculosis Classification Using Convolutional Neural Networks with MLP-Mixer. Bioengineering (Basel), 12, 630. https://doi.org/10.3390/bioengineering12060630

Mirugwe, A., Tamale, L. and Nyirenda, J. 2025. Improving Tuberculosis Detection in Chest X-Ray Images Through Transfer Learning and Deep Learning: Comparative Study of Convolutional Neural Network Architectures. JMIRx Med, 6, e66029. https://doi.org/10.2196/66029

Haque, B., Siddiqui, A. and Gupta, A. 2025. Optimized tuberculosis image classification in chest X-rays using transfer learning and hyper parameters. IEEE International Students' Conference on Electrical, Electronics and Computer Science (SCEECS), 18-19 January 2025, Bhopal, India, 1-6. https://doi.org/10.1109/SCEECS64059.2025.10940331

Fati, M., Senan, M. and ElHakim, N. 2022. Deep and hybrid learning technique for early detection of tuberculosis based on X-ray images using feature fusion. Applied Sciences, 12, 7092. https://doi.org/10.3390/app12147092

Genitha, C., Kalaivani, I., Ajibah, H., Jalagandeswaran, S. and Balamurugan, K. 2023. Automated Framework for the Tuberculosis Detection and Classification in X-Ray Images Using Deep Learning Algorithm. International Conference on Self Sustainable Artificial Intelligence Systems (ICSSAS), 18-20 October 2023, Erode, India, 215-220. https://doi.org/10.1109/ICSSAS57918.2023.10331715

Hossain, M., Mural, H., Monowar, and Hridoy, W. 2026. Automated Tuberculosis Detection in Chest Radiographs: A Hybrid Deep Learning Framework for Clinical Decision Support. Applied AI Letters, 7, e70022. https://doi.org/10.1002/ail2.70022

Kiran, S. and Jabeen, I. 2024. Dataset of Tuberculosis Chest X-rays Images [Online]. Available: https://data.mendeley.com/datasets/8j2g3csprk/2 [1 October 2025]

Rahman, T., Chowdhury, M. and Khandakar, A. 2021. Tuberculosis (TB) Chest X-ray Database [Online]. Available: https://www.kaggle.com/datasets/tawsifurrahman/tuberculosis-tb-chest-xray-dataset [1 October 2025]

Downloads

Published

2026-06-29

How to Cite

Chedsom, P. (2026). Fine-tuning Fully Connected Layer Architecture in Convolutional Neural Networks for Tuberculosis Classification of Chest Radiographs. Science and Engineering Connect, 49(2), 123–148. retrieved from https://ph04.tci-thaijo.org/index.php/SEC/article/view/12324

Issue

Section

Research Article