Sputum Smear Microscopy for Tuberculosis: Evaluation of Autofocus Functions and Automatic Identification of Tuberculosis Mycobacterium

Since 1997 the World Health Organization has published an annual report on global control of tuberculosis (TB) with the purpose of providing a comprehensive and up-to-date assessment of the TB epidemic. According to the Global TB control report of 2010 (World Health Organization [WHO], 2010), the global burden of disease caused by TB in 2009 is as follows: 9.4 million incident cases, 14 million prevalent cases, 1.3 million deaths among non HIV-positive people and 0.38 million deaths among HIV positive people.


Introduction
Since 1997 the World Health Organization has published an annual report on global control of tuberculosis (TB) with the purpose of providing a comprehensive and up-to-date assessment of the TB epidemic. According to the Global TB control report of 2010 (World Health Organization [WHO], 2010), the global burden of disease caused by TB in 2009 is as follows: 9.4 million incident cases, 14 million prevalent cases, 1.3 million deaths among non HIV-positive people and 0.38 million deaths among HIV positive people.
The absolute number of cases continues to increase from year to year. The slow reduction in incident rates per capita is outweighed by increases in population. The greatest number of cases are in Asia (55%) and Africa (30%). Other regions have lower numbers of cases: Eastern Mediterranean Region (7%), European Region (4%) and American Region (3%). The main effort of WHO today concerning TB is to attain the targets included in the Millennium Development Goals (MDGs).
Adopted by world leaders in 2000, the MDGs are a blueprint that guides the efforts of the United Nations Development Program and various and various aid agencies, providing concrete, numerical benchmarks for tackling extreme poverty in its many dimensions to be achieved by 2015. The MDGs define 8 goals (United Nations [UN], 2010) with 21 targets that are measured by 60 indicators. TB falls under the 6th goal related to fighting disease epidemics, aiming to: "Combat HIV/AIDS, Malaria and other diseases". Within this goal the following target refers to TB: "Halt and begin to reverse the incidence of malaria and other major diseases". Related to this target, the following indicator refers to TB: Halt and begin to reverse TB incidence by 2015; Reduce prevalence and deaths due to TB by 50% compared with a baseline of 1990.
To achieve these indicators the WHO adopted a Partnership Global Plan to Stop TB (WHO, 2011). Launched in January 2006, it includes sputum smear microscopy as the main diagnostic tool. Indeed, one of the targets of this plan is stated as follows: "A treatment success rate among sputum smear positive case of 90%". The main reason for sputum smear www.intechopen.com Understanding Tuberculosis -Global Experiences and Innovative Approaches to the Diagnosis 278 microscopy to be included is that it is the main non-invasive technique employed for TB diagnosis. Other non-invasive techniques include culture and chest radiography.
Sputum smear microscopy has several operational advantages over culture as a diagnostic tool (Luelmo, 2004): "The results are available soon, correlate with infectiousness, and identify both patients at high risk of death from tuberculosis if untreated and patients who require more drugs in the initial treatment regimen because of greater bacterial load". In addition sputum smear microscopy has an important role in follow up of TB treatment. Only when the smears are negative can the intensive phase of the treatment be suspended.
Despite the historical importance of chest radiography in TB diagnosis, it is not used today as a diagnostic tool alone. The following reasons justify this practice: 1) Some other diseases of the lung show a similar appearance in radiographic picture. Consequently radiographic exam is not specific to TB; 2) Lesions of pulmonary tuberculosis can take almost any form in a radiographic image (American Thoracic Society [ATS], 2000) .
Two main facts enable the use of sputum smear microscopy for TB diagnosis. The first one is that special dyes allow to differentiating the bacillus from the background. The second one is that there is a positive correlation between the number of bacillus in the smear and the probability of their being identified by microscopy.
To support the last statement, Table 1 (David, 1976, as cited in Toman, 2004a shows the positive correlation that exists between the number of bacillus present in a sputum specimen, the number of bacillus in a smear and the probability of finding theses bacillus by microscopy. For this study 0.01 ml of sputum was placed on a slide and spread over an area of 200mm 2 . The magnification of the microscope used allowed for observing 10.000 fields on this slide. 1. Fluorescence microscopy has the following main advantages over conventional microscopy: 1) Fluorescence microscopy uses a lower power objective lens (typically 25x), while conventional microscopy uses a higher power objective lens (typically 100x). As a consequence fluorescence microscopy allows the same area of a smear to be scanned in a much shorter time than with conventional microscopy (Bennedesen & Larsen, 1966); 2. Fluorescence microscopy is on average 10% more sensitive than conventional microscopy (Steingart et. al., 2006).
The main shortcomings of fluorescence microscopy are: 1) The relatively high costs of the microscopy unit and its maintenance when compared with the conventional microscopy unit; 2) The handling and maintenance of the optical equipment require advanced technical skill (Toman, 2004b).
The sensitivity of tuberculosis diagnostic through sputum smear analysis reported in the literature varies greatly. While reported sensitivities of conventional microscopy range from 0.32 to 0.94, reported sensitivities of fluorescence microscopy range from 0.52 to 0.97. On average the specificity of fluorescence microscopy is similar to conventional microscopy and range from 0.94 to 1 (Steingart et. al., 2006).
In addition to the huge variability in sensitivity, the manual screening for bacillus identification is a labor-intensive task that consumes between 40 minutes and 3 hours, depending on patient's level of infection and it is needed to analyse 40-100 images (Sotaquirá, 2009).
Some authors (Forero et. al., 2006;Sotaquira, 2009;Khutlang, 2010) claimed that the main advantages of an automatic bacilli screening over a manual one are better reproducible values for sensitivity and specificity and a faster screening process. Table 2 shows reported values for sensitivity, specificity and time waste for one image analysis using automatic methods.
The sensitivity and specificity values previously cited for manual screening methods refer to tuberculosis diagnosis. The sensitivity and specificity values for automatic methods shown in Table 2 refer to object classification as bacillus or not bacillus. Therefore, a rigorous comparison of sensitivities and specificities between manual and automatic screening methods could not be done.
Only one paper of Table 2 cited time wasted for one image analysis, 1.87s. To compute the time consumed with a TB automatic diagnosis it is necessary to take into account the number of images needed to achieve a correct diagnosis. As previously cited, in order to achieve a correct diagnosis, it is necessary to analyze between 20 and 100 fields of one slide.
With an automatic procedure, it is also necessary to take into account the time spent with focusing computations, image acquisition and microscopy displacement. According to Santos (Santos et. al., 1997) focusing computations takes 1.8s per field, while acquisition takes 0.7s, including 0.5s for slide movement. Assuming that no parallel process occurs and considering the worst case scenario of 100 images we have the time spent with an automatic diagnosis (T ad ) given by: This value is a few times smaller than the value of 40 minutes previously cited for a TB manual diagnostic with sputum smear microscopy.  Steps involved in automated microscopy include those shown if Figure 2. In the following sections, we analyze some of these steps. In section 2 we address the problem of auto focusing, discussing the main functions used in auto focusing methods. In the third section we discuss the main differences between the methods used for bacilli segmentation and classification in fluorescence microscopy and conventional microscopy.

Autofocus evaluation functions
Automatic microscopy is accomplished through coupling an electronic camera to a microscope. Auto focusing of electronic cameras is accomplished by searching for the lens position that gives the best focused image (Subbaro &. Tyan, 1995). A focused image can be thought of as one that, for a set of images captured with different microscope stages, presents the best average focus over an entire field of view. In a frequency viewpoint, a focused image can be thought of as one that has more high frequency components. It is important that samples be well prepared, resulting in thin structures, because thick samples present structures with different foci. An auto focusing process employs a focus measure and a procedure to determine the best focused image. A focus measure can be defined as follow: "First, the image for which the focus measure needs to be computed is normalized for brightness by dividing the image by its mean brightness. Then, it is convolved with a focus measure filter (FMF). Then, the energy (sum of squared values) of the filtered image is computed. This energy is the focus measure" (Subbaro &. Tyan, 1998 noise characteristic. In other words, there is no best focus measure that can be used for auto focusing of different image types. Because of this, it is important to find the best focus measure that can be used in TB auto focusing. In this section we will revise the main focus measure functions used in automatic microscopy.
The main focus measures functions used in auto focusing can be divided into four groups: Functions Based on Image Differentiation Different FMF have been used for image differentiation: Threshold Absolute Gradient: This function computes and accumulates the first difference between a pixel and its neighbor with a distance of one, when the difference is larger than a threshold.
ℎ | , + − , | ≥ Squared Gradient: Similar to the previous function but with squared difference. The larger differences influence the results more.
First order Gaussian Derivative (Geusebroeck et. al., 2000): This function involves image convolution with the derivative of a Gaussian smooth filter.

Functions Based on Correlation Measurement
These functions were proposed by Vollath (Vollath, 1998) and, according to the author, had good performance in noise presence.
Autocorrelation (Vollath's : Standard Deviation-Based Correlation (Vollath's : Some measures based on frequency content have been proposed, such as the wavelet transform (Kautsky et. al., 2002). Nevertheless it did not present good results in TB auto focusing.
It should be observed that some of these functions depend on threshold, while some others do not depend on any parameter. Some of these functions were used for TB auto focusing. Table 3 shows published papers involving TB auto focusing, detailing the focus measure employed in each one.
The papers of Russel (Russel & Douglas, 2007)  the TB conventional microscopy images into two groups: Images with high density background content and images with low density background content. Figure 3(a) shows an image with high density background content and Figure 3(b) an image with low density b a c k g r o u n d c o n t e n t . I n b o t h g r o u p s t h e v a r i a n c e a n d n o r m a l i z e d v a r i a n c e f u n c t i o n s showed the best performance. Osibote (Osibote et. al., 2010) also obtained a better performance with the normalized variance function.

Authors Microscopy Type Evaluation Functions Results
Forero et. al.   to gray scale. The performance of a focus measure is frequently evaluated using the focus curve and according to four features (Firestone at. al., 1991), defined as: 1. Accuracy: expressed here as the number of steps by which the maximum of a particular focus function departs from the correct focal position; Range: the number of steps between the two neighboring local minima around the global maximum; Number of false maxima: number of spurious focus function maxima; Width: computed at 50% of the height focus curve. This criterion describes the sharpness or narrowness of the peak. Santos et al. (1997) introduced a 5 th feature, Execution Time, as follows: Execution Time: the time taken for an algorithm to compute the focus plot and locate the position of maximum focus.
According to Santos (Santos et. al., 1997) a quantitative evaluation may compare a focus curve to an ideal function with respect to each of these features. The authors define an ideal focus function as having a value of 0 for execution time, accuracy, width and number of false maxima and a range determined by multiplying the number of images in the stack used to plot the focus function and the step size between each position in the stack (adjustment step of the microscopy). To obtain a measure of how a focus measure departs from an ideal behavior the following algorithm is used: 1. A series of focus measure curves is obtained (these series should contain images with different background content). The mean and the standard deviation of each feature in the series are obtained. 2. The five feature values of each image series are normalized by subtracting the corresponding mean and dividing by the standard deviation. This produces values for the different features that can be compared as they all now have mean zero and standard deviation equal to unity. 3. For each feature the distance from the ideal function is computed. First the differences between the feature value in the function and in the ideal function are obtained. Then the square root of the addition of the squares of these results is computed. 4. Finally, to produce a final figure of this function, the mean value of the five distances is obtained.
When doing a TB diagnosis with sputum smear microscopy, a bacilli count on a number of fields of one slide is necessary. A time-consuming autofocus procedure determines the optimal focus through the acquisition of the focus function for each field. To reduce lens motion and achieve faster autofocus times the following procedure proposed by Osibote (Osibote et. al., 2010) can be used: 1. Obtaining the focus position for the first field of the slide through the acquisition of a full image stack of the focus measure, ensuring a perfect evaluation of this field to avoid locating the optimal focus in a false minimum position; 2. Adopt a simplified procedure to determine the optimal focus position in subsequent fields, using the optimal focus position of the previous field as a reference. For this purpose the procedure proposed by Yanzdafar (Yanzdafar et. al., 2008) can be used.

Automated sputum smear microscopy
According to Forero (Forero et. al., 2006) bacilli are structures that have a length between 1 and 10μm and a width between 0.2 and 0.6μm presenting a straight, curve or bent shape, as shown if Figure 6.

Fig. 6. Different shapes of bacilli
Depending on the staining procedures used, the bacilli assume different appearances. When the sputum smear is stained with an acid-fast fluorochrome dye, as is the case when fluorescence microscopy is used, the bacilli fluoresce in the range between green and yellow up to white, while the background is dark. Otherwise, when the sputum smear is stained with carbolfuchsin Ziehl-Neelsen -ZN or Kinyoun acid-fast stains, as is the case when conventional microscopy is used, the bacilli may have different colours, varying from light fuchsia to dark purple. In Figure 7 we show images of both microscopy types. The block diagram of Figure 2 shows the main steps involved in automated bacilli recognition. Table 4 shows the main methods used in the literature for each step of this block diagram.
As shown in Figure 2, after image capture, bacilli segmentation is performed. The segmentation procedures adopted in both types of images shown in Figure 7 are completely different from each other.
In fluorescence microscopy images, the bacilli are easily separated from the background with a threshold operation. Afterwards, the segmentation is performed using edge detection operators, such as canny operators (Veropoulos et. al., 1998;Forero et. al., 2004). Intermediate steps for edge linking and boundary tracing are also employed. Figure 8 shows the results of the segmentation procedure used by Forero (Forero et. al., 2004) when applied to the image on the left side of Figure 7.
In conventional microscopy images, the bacilli are not easily separated from the background with a threshold operation. In this case, for bacilli segmentation, colour space techniques are used. As shown in  After the segmentation step is finished, not only bacilli are segmented. Some structures fluoresce the same way as bacilli in fluorescence microscopy images. Similarly some structures have the same colour properties as bacilli in conventional microscopy images. confused with bacilli. These structures, also called noise, could be debris or cells present in the background. To illustrate this point, near the lower left corner of Figure 7, a circular structure can be seen that fluoresces the same way as a bacillus, but because of its circular shape could not be classified as one. Nevertheless, this structure is segmented the same way as a bacillus, as shown in Figure 8. To separate noise from bacilli in the segmented images an additional step, called object classification in the block diagram of Figure 2 is normally employed. For this purpose classifiers using shape descriptors are used. As the bacilli may have different sizes, positions and orientations, the shape descriptors used must be rotation, translation and scale invariant. As shown in Table 4, the most used descriptors used are: compactness, eccentricity, Hu's moments and Fourier Descriptors. Varied classifiers such as classification trees, Support Vector Machines and Neural Networks were employed by some authors in order to recognize the bacilli.
The results presented in Table 4 show that, in bacilli detection, results for sensitivity and specificity as good as 97.77% and 99.13% are cited. It is noteworthy, however that the authors who cited these values, do not consider touching bacilli. In some cases, as the one shown in Figure 9, these bacilli are present in large quantities. Disregarding these bacilli implies a different count of what is done by manual means. Because of this, we believe that other ways of removing noise than those that use shape descriptors must be investigated. Mycobacterium tuberculosis is a disease that is transmitted through aerosol. This is the reason why it is estimated that a third of humankind is already infected by Mycobacterium tuberculosis. The vast majority of the infected do not know about their status. Mycobacterium tuberculosis is a silent pathogen, causing no symptomatology at all during the infection. In addition, infected people cannot cause further infections. Unfortunately, an estimated 10 per cent of the infected population has the probability to develop the disease, making it very difficult to eradicate. Once in this stage, the bacilli can be transmitted to other persons and the development of clinical symptoms is very progressive. Therefore the diagnosis, especially the discrimination between infection and disease, is a real challenge. In this book, we present the experience of worldwide specialists on the diagnosis, along with its lights and shadows.