Two-stage classification of tuberculosis culture diagnosis using convolutional neural network with transfer learning


Tuberculosis (TB) has been one of top 10 leading causes of death. A computer-aided diagnosis system to accelerate TB diagnosis is crucial. In this paper, we apply convolutional neural network and deep learning to classify the images of TB culture test—the gold standard of TB diagnostic test. Since the dataset is small and imbalanced, a transfer learning approach is applied. Moreover, as the recall of non-negative class is an important metric for this application, we propose a two-stage classification method to boost the results. The experiment results on a real dataset of TB culture test (1727 samples with 16,503 images from Tao-Yuan General Hospital, Taiwan) show that the proposed method can achieve 99% precision and 98% recall on the non-negative class.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11


  1. 1.

    Daniel TM (2006) The history of tuberculosis. Respir Med 100(11):1862–1870

    Article  Google Scholar 

  2. 2.

    World Health Organization (2018) Global tuberculosis report 2018. World Health Organization, Geneva

    Google Scholar 

  3. 3.

    Miller LG, Asch SM, Yu EI, Knowles L, Gelberg L, Davidson P (2000) A population-based survey of tuberculosis symptoms: how atypical are atypical presentations? Clin Infect Dis 30(2):293–299

    Article  Google Scholar 

  4. 4.

    World Health Organization (2015) The end TB strategy. World Health Organization, Geneva

    Google Scholar 

  5. 5.

    Centers for Disease Control and Prevention (2014) Core curriculum on tuberculosis: what the clinician should know. Accessed 25 July 2019

  6. 6.

    Rahman F, Munshi SK, Kamal SM, Rahman AM, Rahman MM, Noor R (2011) Comparison of different microscopic methods with conventional TB culture. Stamford J Microbiol 1(1):46–50

    Article  Google Scholar 

  7. 7.

    Liu TT (2007) Design and investigation on identification of tubercle bacilli image system. Master thesis, National Chiao Tung University

  8. 8.

    Sadaphal P, Rao J, Comstock G, Beg M (2008) Image processing techniques for identifying Mycobacterium tuberculosis in Ziehl-Neelsen stains. Int J Tuberc Lung Dis 12(5):579–582

    Google Scholar 

  9. 9.

    Chen ZH (2013) Automatic mycobacterium tuberculosis identification system. Master thesis, National Cheng Kung University

  10. 10.

    Costa Filho CFF, Levy PC, Xavier CDM, Fujimoto LBM, Costa MGF (2015) Automatic identification of tuberculosis mycobacterium. Res Biomed Eng 31(1):33–43

    Article  Google Scholar 

  11. 11.

    Lakhani P, Sundaram B (2017) Deep learning at chest radiography: automated classification of pulmonary tuberculosis by using convolutional neural networks. Radiology 284(2):574–582

    Article  Google Scholar 

  12. 12.

    Hwang S, Kim HE, Jeong J, Kim HJ (2016) A novel approach for tuberculosis screening based on deep convolutional neural networks. Paper Presented at the Medical Imaging 2016: Computer-Aided Diagnosis

  13. 13.

    Rajpurkar P, Irvin J, Zhu K, Yang B, Mehta H, Duan T, Shpanskaya K (2017) Chexnet: radiologist-level pneumonia detection on chest x-rays with deep learning. arXiv preprint arXiv:1711.05225

  14. 14.

    Kant S, Srivastava MM (2018) Towards automated tuberculosis detection using deep learning. IEEE Symp Ser Comput Intell (SSCI) 2018:1250–1253

    Google Scholar 

  15. 15.

    Panicker RO, Kalmady KS, Rajan J, Sabu MK (2018) Automatic detection of tuberculosis bacilli from microscopic sputum smear images using deep learning methods. Biocybern Biomed Eng 38(3):691–699.

    Article  Google Scholar 

  16. 16.

    Xiong Y, Ba X, Hou A, Zhang K, Chen L, Li T (2018) Automatic detection of mycobacterium tuberculosis using artificial intelligence. J Thorac Dis 10(3):1936–1940.

    Article  Google Scholar 

  17. 17.

    Simonyan K, Zisserman A (2014) Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556

  18. 18.

    LeCun Y (2015) LeNet-5, convolutional neural networks. 20. Accessed 7 July 2019

  19. 19.

    Chollet F (2017) Xception: deep learning with depthwise separable convolutions. Paper Presented at the Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition

  20. 20.

    Litjens G, Kooi T, Bejnordi BE, Setio AAA, Ciompi F, Ghafoorian M, Sánchez CI (2017) A survey on deep learning in medical image analysis. Med Image Anal 42:60–88

    Article  Google Scholar 

  21. 21.

    Ronneberger O, Fischer P, Brox T (2015) U-net: convolutional networks for biomedical image segmentation. Springer, Cham

    Google Scholar 

  22. 22.

    Milletari F, Navab N, Ahmadi S-A (2016) V-net: fully convolutional neural networks for volumetric medical image segmentation. Paper Presented at the 2016 Fourth International Conference on 3D Vision (3DV)

  23. 23.

    Li Q, Cai W, Wang X, Zhou Y, Feng DD, Chen M (2014) Medical image classification with convolutional neural network. Paper Presented at the 2014 13th International Conference on Control Automation Robotics and Vision (ICARCV)

  24. 24.

    Jifara W, Jiang F, Rho S, Cheng M, Liu S (2019) Medical image denoising using convolutional neural network: a residual learning approach. J Supercomput 75(2):704–718

    Article  Google Scholar 

  25. 25.

    Van Opbroek A, Ikram MA, Vernooij MW, De Bruijne M (2014) Transfer learning improves supervised image segmentation across imaging protocols. IEEE Trans Med Imaging 34(5):1018–1030

    Article  Google Scholar 

  26. 26.

    Shin H-C, Roth HR, Gao M, Lu L, Xu Z, Nogues I, Summers RM (2016) Deep convolutional neural networks for computer-aided detection: cNN architectures, dataset characteristics and transfer learning. IEEE Trans Med Imaging 35(5):1285–1298

    Article  Google Scholar 

  27. 27.

    Bar Y, Diamant I, Wolf L, Lieberman S, Konen E, Greenspan H (2015) Chest pathology detection using deep learning with non-medical training. Paper Presented at the 2015 IEEE 12th International Symposium on Biomedical Imaging (ISBI)

  28. 28.

    Huynh BQ, Li H, Giger ML (2016) Digital mammographic tumor classification using transfer learning from deep convolutional neural networks. J Med Imaging 3(3):034501

    Article  Google Scholar 

  29. 29.

    Chawla NV, Bowyer KW, Hall LO, Kegelmeyer WP (2002) SMOTE: synthetic minority over-sampling technique. J Artif Intell Res 16:321–357

    Article  Google Scholar 

  30. 30.

    Wang Z et al (2004) Image quality assessment: from error visibility to structural similarity. IEEE Trans Image Process 13(4):600–612

    Article  Google Scholar 

  31. 31.

    Redmon J, Farhadi A (2017) YOLO9000: better, faster, stronger. Paper presented at the Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition

Download references


This paper is partially supported by MOST Taiwan under grants 108-2410-H-002-230-MY2 and 108-3116-F-002-003-CC1. We thank Dr. H.C. Chen in Tao-Yuan General Hospital, Ministry of Health and Welfare, Taiwan, for providing the data.

Author information



Corresponding author

Correspondence to Jeng-Wei Lin.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Chang, RI., Chiu, YH. & Lin, JW. Two-stage classification of tuberculosis culture diagnosis using convolutional neural network with transfer learning. J Supercomput 76, 8641–8656 (2020).

Download citation


  • Automatic tuberculosis diagnosis
  • Tuberculosis culture test
  • Deep learning
  • Transfer learning
  • Multi-stage classification