An algorithm for detection of tuberculosis bacilli in Ziehl-Neelsen sputum smear images

Christian del Carpio, Erwin Dianderas, Mirko Zimic, Patricia Sheen, Jorge Coronel, Roberto Lavarello, Guillermo Kemper


This work proposes an algorithm oriented to the detection of tuberculosis bacilli in digital images of sputum samples, inked with the Ziehl Neelsen method and prepared with the direct, pellet and diluted pellet methods. The algorithm aims at automating the optical analysis of bacilli count and the calculation of the concentration level. Several algorithms have been proposed in the literature with the same objective, however, in no case is the performance in sensitivity and specificity evaluated for the 3 preparation methods. The proposed algorithm improves the contrast of the colors of interest, then thresholds the image and segments by labeling the objects of interest (bacilli). Each object then has its geometrical descriptors and photometric descriptors. With all this, a characteristic vector is formed, which are used in the training and classification process of an SVM. For the training 225 images obtained by the 3 preparation methods were used. The proposed algorithm reached, for the direct method, a sensitivity level of 93.67% and a specificity level of 89.23%. In the case of the Pellet method, a sensitivity of 92.13% and a specificity of 82.58% was obtained, while for diluted Pellet the sensitivity was 92.81% and the specificity 83.61%.


baciloscopy; image processing; sputum smear; tuberculosis; Ziehl-Neelsen;

Full Text:



Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

International Journal of Electrical and Computer Engineering (IJECE)
p-ISSN 2088-8708, e-ISSN 2722-2578

This journal is published by the Institute of Advanced Engineering and Science (IAES) in collaboration with Intelektual Pustaka Media Utama (IPMU).