Automated tuberculosis screening

A method, system, and computer-readable medium for determining a number of mycobacteria in source image data of a sputum-smear sample are provided. First image data is extracted from the source image data of the sputum-smear sample. Binary image data is created from the extracted first image data. A plurality of groups of blobs is identified in the created binary image data. A distance between a pair of the identified plurality of groups of blobs is determined. If the distance is below a threshold value, the pair is combined as a single group of blobs. The determining is repeated for pairs of the identified plurality of groups of blobs, and the remaining groups of blobs are then classified.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application is a U.S. national stage application under 35 U.S.C. 371 of International Application No. PCT/IB2010/056049, filed on Dec. 23, 2010, the entire contents of which are incorporated herein by reference in its entirety. International Application No. PCT/IB2010/056049 claims the benefit of Indian Application No. 3324/CHE/2010 filed on Nov. 8, 2010 under 35 U.S.C. 119(a).

BACKGROUND

Tuberculosis (TB) is a serious illness that results in morbidity and mortality, if neglected. In fact, the World Health Organization has declared TB a global health emergency. TB often afflicts the poorer and malnourished segments of society. Due to the infectious nature of TB, early diagnosis is critical in controlling the disease and in reducing the trauma and cost to the patient. In the most common form of TB, pulmonary TB, active infection is diagnosed by examining the stained sputum smears of subjects by well-trained technicians. The technician looks for the presence of mycobacteria in the sputum smear; the bacilli-count is an indicator of the degree of infection.

In practice, there are two methods of staining/microscopy. The faster and more sensitive approach involves screening the sputum samples stained with auramine or rhodamine using a fluorescence microscope. However, this method is very expensive. A much cheaper method involves visually examining highly-magnified microscopic fields of Ziehl-Neelsen (ZN) stained sputum smears. Although this method is commonly practiced, it may not provide accurate results because only a few sub-regions may be examined (leading to possible omission of diagnostically important sub-regions) because it is tedious to check a large number of images. As a result, the average count of the bacilli is approximate possibly causing disease to go undiagnosed or require subsequent visits/tests. Further, the severity of the disease and its prognosis may be misestimated based on the grading of sputum smears.

SUMMARY

In an aspect, a method of determining a number of mycobacteria in source image data of a sputum-smear sample is provided. First image data is extracted from the source image data. Binary image data is created from the extracted image data. A plurality of groups of blobs is identified in the created binary image data. A distance between a pair of the identified plurality of groups of blobs is determined. If the distance is below a threshold value, the pair is combined into a single group of blobs. The determining is repeated for pairs of the identified plurality of groups of blobs. A classification of the plurality of groups of blobs is determined. In one illustrative embodiment groups of blobs are classified as a single bacillus, a beaded bacillus, or a clump of bacilli.

In another aspect, a computer-readable medium is provided having stored thereon computer-readable instructions that when executed by a computing device cause the computing device to perform the method of determining a number of mycobacteria in image data of a sputum-smear sample.

In yet another aspect, a device is provided. The device includes, but is not limited to, a processor and the computer-readable medium operably coupled to the processor. The computer-readable medium has instructions stored thereon that when executed by the processor cause the system to perform the method of classifying blobs in image data of a sputum-smear sample.

DETAILED DESCRIPTION

A method of determining a number of mycobacteria in image data of a sputum-smear sample is provided. In an illustrative embodiment, image data is extracted from image data of the sputum-smear sample. Binary image data is created from the extracted image data. A plurality of groups of blobs is identified in the created binary image data. Groups of blobs whose size are less than a predetermined amount constitute noise and are removed the plurality of blobs. A representative example of the predetermined size is 30 pixels. Other sizes, however, can be used such as 15 or 45 pixels. A distance between a pair of the identified plurality of groups of blobs is determined. If the distance is below a threshold value, the pair is combined as a single group of blobs replaces the pair of groups of blobs in the plurality of blobs. The determining is repeated for pairs of the identified plurality of groups of blobs. The plurality of groups of blobs remaining may be classified as individual bacillus, beaded bacillus, or a clump of bacilli.

With reference toFIG. 1, an illustrative embodiment of a block diagram of a TB screening system100is shown. TB screening system100may include one or more of an image data generation system116, a database118, a computing device102, a display120, a printer122, and a speaker124. Different and additional components may be incorporated into TB screening system100. Computing device102may include one or more of an output interface104, an input interface106, a computer-readable medium108, a communication interface110, a processor112, and a TB screening application114. Computing device102may be a computer of any form factor. Different and additional components may be incorporated into computing device102. Display120, printer122, and speaker124are illustrative output devices for use with computing device102.

Image data generation system116generates image data of sputum-smear samples. The source of and the dimensionality of the image data are not intended to be limiting. In an illustrative embodiment, the source of the image data is a highly magnified microscope and the sputum-smear samples are stained by a Ziehl-Neelsen (ZN) procedure. Image data generation system116may provide the image data to computing device102directly through communication interface110or may provide the image data to computing device102in the form of a memory media such as a compact disk (CD), digital versatile disk (DVD), etc.

As another option, image data generation system116may store the image data in database118in a cloud, on the web, etc. Database118may include any type of storage architecture. Storage architectures include files in a file system, native XML databases, relational databases, SQL databases, etc. Database118may comprise a file system including a plurality of data files. Database118may be accessed from computing device102using communication interface110.

Output interface104provides an interface for outputting information for review by a user of TB screening system100or for inputting information to another system for analysis of the output of TB screening system100, for example as a data stream. For illustration, output interface104may include an interface to display120, printer122, speaker124, etc. Display120may be one or more of a thin film transistor (TFT) display, a light emitting diode (LED) display, a liquid crystal display (LCD), or any of a variety of different displays known to those skilled in the art. Printer122may be any of a variety of printers as known to those skilled in the art. Speaker124may be any of a variety of speakers as known to those skilled in the art. Computing device102may have one or more output interfaces that use the same or a different interface technology. Display120and/or printer122further may be accessible to computing device102through communication interface110.

Input interface106provides an interface for receiving information for entry into computing device102as known to those skilled in the art. Input interface106may use various input technologies including, but not limited to, a keyboard, a pen and touch screen, a mouse, a track ball, a touch screen, a keypad, one or more buttons, etc. to allow the user to enter information into computing device102or to make selections presented in a user interface displayed on display120. Input interface106may provide both an input and an output interface. For illustration, a touch screen both allows user input and presents output to the user. Computing device102may have one or more input interfaces that use the same or a different input interface technology.

Computer-readable medium108is an electronic holding place or storage for information so that the information can be accessed by processor112as known to those skilled in the art. Computer-readable medium108can include, but is not limited to, any type of random access memory (RAM), any type of read only memory (ROM), any type of flash memory, etc. such as magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips, . . . ), optical disks (e.g., CD, DVD, . . . ), smart cards, flash memory devices, etc. Computing device102may have one or more computer-readable media that use the same or a different memory media technology. Computing device102also may have one or more drives that support the loading of a memory medium such as a CD or DVD. Computer-readable medium108may comprise a cache in which data can be stored temporarily for rapid access by processor112. Computer-readable medium108further may comprise database118.

Communication interface110provides an interface for receiving and transmitting data between devices using various protocols, transmission technologies, and media as known to those skilled in the art. The communication interface may support communication using various transmission media that may be wired or wireless. Computing device102may have one or more communication interfaces that use the same or a different communication interface technology. Data may be transferred between computing device102and image data generation system116using communication interface110. Additionally, communication interface110may provide connectivity to other systems. For illustration, communication interface110may provide connectivity to database118.

Processor112executes instructions as known to those skilled in the art. The instructions may be carried out by a special purpose computer, logic circuits, or hardware circuits. Thus, processor112may be implemented in hardware, firmware, or any combination of these methods. The term “execution” is the process of running an application or the carrying out of the operation called for by an instruction. The instructions may be written using one or more programming language, scripting language, assembly language, etc. Processor112executes an instruction, meaning that it performs the operations called for by that instruction. Processor112operably couples with one or more of output interface104, input interface106, computer-readable medium108, and communication interface110, among others, to receive, to send, and to process information. Processor112may retrieve a set of instructions from a permanent memory device and copy the instructions in an executable form to a temporary memory device that is generally some form of RAM. Computing device102may include a plurality of processors that use the same or a different processing technology.

TB screening application114performs operations associated with processing image data that potentially contains magnified bacteria. As an illustrative example, sputum-smear samples stained by a ZN procedure and obtained using a highly magnified microscope may comprise the image data. Alternatively, image data may be images taken from a fluorescent microscope of auramine-O stained sputum-smear samples. TB screening application114further may output a determination of a number of mycobacteria in the image data. The determination of a number of mycobacteria in the image data may comprise the number of individual bacilli, the number of clumps, or the number of beaded bacilli present in the image data. Some or all of the operations described may be embodied in TB screening application114. The operations may be implemented using hardware, firmware, software, or any combination of these methods. With reference to the illustrative embodiment ofFIG. 1, TB screening application114is implemented in software stored in computer-readable medium108and accessible by processor112for execution of the instructions that embody the operations of image TB screening application114. TB screening application114may be written using one or more programming languages, assembly languages, scripting languages, etc. TB screening application114may be implemented as a plug-in to a data processing and visualization application.

Components of TB screening system100may be housed in a single device, positioned in a single location, a single facility, and/or may be remote from one another. Thus, image data generation system116, database118, and/or computing device102may be integrated into a single system. Image data generation system116, database118, and/or computing device102may be connected directly through a wired or wireless technology. For illustration, image data generation system116may connect to computing device102using a cable for transmitting information between image data generation system116and computing device102. Image data generation system116may connect to computing device102using a network. Image data may be stored electronically and accessed using computing device102. Image data generation system116and computing device102do not need to be connected. Instead, the data acquired using image data generation system116may be manually provided to computing device102. For illustration, the data may be stored on electronic media such as a CD, a DVD, a flash drive, etc. After receiving the data, computing device102may initiate processing of the data automatically or under control of an operator of computing device102.

With reference toFIG. 2, an illustrative embodiment of operations associated with TB screening application114ofFIG. 1is described. Additional, fewer, or different operations may be performed, depending on the embodiment. In addition, although some of the operational flows are presented in sequence, the various operations may be performed in various repetitions, concurrently, and/or in other orders than those that are illustrated. The order of presentation of the operations ofFIG. 2is not intended to be limiting. In an operation200, image data is input or received by TB screening application114for processing by TB screening application114. For illustration, the image data may be stored at computing device102and selected for input to TB screening application114using an interactive dialog box that allows a user to select the data source as well as the loading mechanism associated with the data source. As alternatives, the image data may be streamed to computing device102from image data generation system116or the image data may be received by computing device102from database118. As another alternative, image data may be received by computer device102from an external source, such as the internet.

The pixels associated with the bacterial region and those associated with the rest of the background are fairly distinct in the hue, saturation and intensity (HSI) space. The HSI model also is close to the way humans (and hence the operators who work with images of the sputum smear) perceive color. As the HSI model is not a shape-based model, HSI is not restrictive to identifying only bacilli of a specific shape. Accordingly, the HSI model is able to identify “Y,” “T,” and “V” shaped bacilli. In addition, the HSI model is able to identify bacilli with beaded appearance, which are very common and very specific to TB. In the HSI model, hue and saturation carry color information, while intensity is independent of hue and saturation and does not carry color information. Hue describes pure color and saturation refers to the “degree of dilution from purity” by white light. Intensity is similar to that associated with gray-level pictures, and is decoupled from the color-information, which is embedded in hue and saturation. Since color-images from the microscope are available in the red, green, blue (RGB)-format, the HSI parameters may be extracted using the following transformations:

H={θ,B≤G360-θ,B>G⁢⁢where⁢⁢θ=cos-1⁢{12⁡[(R-G)+(R-B)](R-G)2+(R-B)⁢(G-B)},⁢S=1-3(R+G+B)⁢Min⁢{R,G,B},I=13⁢(R+G+B),
and where R, G, and B are red, green, and blue pixel values, respectively.

In an operation204, a binary image is created. For illustration, the binary image is created by segmenting the candidate bacterial regions based on color. Image creation may also include mapping the pixels from the RGB color space to the HSI space to generate information corresponding to the pixels, and using the generated information to classify the pixels into the class of bacteria or the background. Specifically, pixels belonging to bacteria and pixels from the background of multiple images of ZN-stained sputum smears are mapped into the HSI space. These pixels form clusters in the HSI space, representing the information regarding the color content associated with the bacteria and the background, respectively, in the color space.

Once the color information is obtained, segmentation between the background and the bacteria may be achieved using a minimum distance rule. Specifically, a pixel is considered to belong to the bacterial region if it is closer to the cluster associated with the bacterial region in the HSI space. The Mahalanobis distance, d2(x,μi)=(x−μi)Ci−1(x−μi), where Ciis the covariance matrix and μiis the mean, respectively, associated with the cluster indexed by i (i=1,2) may be used to make this determination, and x is the data vector consisting of the H,S, and I values of a pixel that is to be classified. In an illustrative embodiment, the covariance matrix can be used to represent the contours of constant density (3D histogram) as hyperellipsoids of constant Mahalanobis distance from μi.

Alternative distance and classification schemes may also be employed. For example, a rotated coordinate system method can be used to segment the pixels associated with the bacteria and the background in the color space. The distance between a vector x and the cluster i in the HSI space, according to the rotated coordinate method is given by

d⁡(x,q(i))=(λi,1⁢λi,2⁢λi,3)13⁢{∑k=13⁢[(x-μi)T⁢ci,k]2λi,k+3}.
In this expression, q(i)is the cluster, {ci,k, k=1,2,3} and {λi,k, k=1,2,3} are the eigenvectors and the eigenvalues associated with the covariance matrix associated with cluster “i,” μiis the mean, respectively, associated with the cluster indexed by i (i=1,2) may be used to make this determination, and x is the data vector consisting of the H, S, and I values of a pixel that is to be classified.

The clusters associated with the bacteria and the background, although fairly distinct, may exhibit a small overlap. In some cases, the overlap is due to the similarity in the colors associated with the bacteria and some regions of epithelial cells. Such an overlap can result in an incorrect classification, and consequently some errors in segmentation. Although such a similarity may not occur often, the effects can be reduced by an optional operation of dividing/splitting a large cluster associated with the background into several smaller sub-clusters so that segmentation of pixels associated with mycobacteria (i.e., of correct classification) becomes more robust based on the fact that the expression for Mahalanobis distance involves distance from the mean, apart from the inverse of the covariance. As an example, a set of points associated with bluish epithelial cells may be considered as a separate cluster with a spread that could potentially interfere with segmentation of the bacterial cluster. However, any point that is truly epithelial cell in an overlapping region will occur close to the mean associated with the epithelial cluster and far from the mean associated with the bacterial cluster (whose spread is relatively higher). Application of this method can improve the robustness of the segmentation. For example, dividing the large cluster associated with the background into several smaller sub-clusters significantly improves the accuracy of counting of beaded bacilli and clumps of bacilli. The preceding example is only illustrative and not meant to be limiting.

In an operation206, groups of blobs are identified in the binary image. Initially, each group of blobs contains a single blob. A blob can refer to a set of pixels connected according to a predetermined criterion. An illustrative criterion involves adjacency of pixels depending on whether a neighborhood used to define adjacency is the 4-points or the 8-points which surround each pixel. Thus, a set of pixels is 8-connected if there exists an 8-connected path between them such that the binary value is the same. A group of connected pixels identified using 4-point or 8-point adjacency thus defines a blob.

FIG. 7ais a graph illustrating a four pixel neighborhood of pixel p.FIG. 7bis a graph illustrating an eight pixel neighborhood of pixel p. The neighborhood of the pixel in bothFIG. 7aandFIG. 7bis represented by the darker regions. InFIG. 7a, there are four pixels in the neighborhood of p. InFIG. 7b, the neighborhood of pixel p is expanded to include eight pixels. A pixel is considered adjacent to a second pixel if it is located within the neighborhood of the second pixel. When two pixels are adjacent using the 8-point adjacency, the pixels may be referred to as 8-point adjacent. Further, a set of pixels are said to be an 8-connected path if pkis adjacent to pk+1, for kε[1,n). In a binary image, the set of all non-zero pixels (also called “foreground pixels”) that are 8-connected to a pixel p (i.e. such that an 8-connected path exists among all of them) is called a connected component containing pixel p. The connected component may also be called an object or blob.

In an illustrative embodiment, each identified blob is labeled.FIG. 8ais a graph illustrating three unlabeled blobs. Labeling is achieved by scanning a binary picture pixel-by-pixel, tracking neighbors and adjacency of each of the pixels, and labeling the set of all distinct connected components.FIG. 8billustrates a graph that has segmented the three blobs and labeling each blob.

Alternatively, mixed adjacency may also be used to identify blobs. Using mixed adjacency, a pixel p is adjacent to a pixel q if q is in either the four pixel neighborhood of p or in the diagonal neighborhood of p and N4(p)∩N4(q) is null.

In an operation210, a distance between pairs of groups of blobs is calculated and groups of blobs in close proximity are combined into a single group. In an illustrative embodiment, a pair of groups of blobs that are close in proximity are grouped as components of an indexed-array of blobs. Each element of the indexed-array contains a reference to each blob that comprises the group. For illustration, the distance can be calculated based on the extreme X- and Y-coordinates associated with each pair of groups of blobs. Thus, for each pair of groups of blobs in the binary image, the following operations may be performed. With reference toFIG. 5, the coordinates of the extreme-points associated with a first group of blobs are obtained as P11≡(xmin1,y11), P12≡(xmax1,y12), where y11and y12are the y-coordinates of P11and P12, respectively and where xmin1is the minimum x-coordinate of the first group of blobs and xmax1is the maximum x-coordinate of the first group of blobs. Similarly, P13≡(x13,ymin1), P14≡(x14,ymax1), where x13and y14are the y-coordinates of P13and P14, respectively and where ymin1is the minimum y-coordinate of the first group of blobs and ymax1is the maximum y-coordinate of the first group of blobs. Additionally, the coordinates of the extreme-points associated with a second group of blobs are obtained as P21≡(xmin2,y21), P22≡(xmax2,y22) and P23≡(x23, ymin2), P14≡(x24, ymax2), where xmin2, xmax2, ymin2, and ymax1are the extreme coordinates of the second group of blobs. The distance between each of the extreme points associated with the first group of blobs and those associated with the second group of blobs is calculated resulting in 16 distance values. In alternative embodiments, fewer or additional distance values may be calculated and used. The minimum distance of the 16 determined values is calculated. If the minimum distance is less than a pre-defined value, the two groups of blobs are combined or grouped together. In one embodiment, the pre-defined value can be a distance of 15 pixels. In alternative embodiments, a shorter or longer distance may be used.

In an operation212, the groups of blobs are categorized into individual/unbeaded bacillus, beaded bacillus, and clumps of bacilli. If a group of blobs has more than a predefined number of blobs, the group of blobs may be classified as a clump. In an illustrative embodiment, the predefined number is 5. Other values such as 3, 7, or 10 may also be used to classify a group of blobs as a clump. If the group of blobs contains a single blob, classification of the group of blobs as either an individual/unbeaded bacillus or a clump is based upon a size of the single blob. The size of a blob, for example, may be calculated by counting the number of pixels contained within the blob. If the size of the blob is within a first size range, the blob is classified as an individual/unbeaded bacillus. If the size of the blob is within a third size range, the blob is classified as a clump. If the size of the blob is not within the first or third size range, the blob is classified as noise. For groups of blobs that contain more than one blob, but less than the number of predefined blobs, the size of the group of blobs is used to classify the blobs. In an illustrative example, the size of a group of blobs is the sum of the size of each blob within the group. The size of a blob, for example, may be calculated by counting the number of pixels contained within the blob. If the size of the group of blobs is within a second size range, the group is classified as a beaded bacillus. If the size of the group of blobs is within a third size range, the group of blobs is classified as a clump. If the size of the group of blobs is not within the second or third size range, the group of blobs is classified as noise.

Various size ranges can be used to determine the category of each group of blobs. As an illustrative example, the first size range is used to classify a blob as a single bacillus. The second size range is used to classify each group of blobs as a beaded bacillus. A third size range is used to classify a group of blobs as a clump of bacilli. Blobs that are not within these size ranges may be classified as a noisy object. The values of the first, second, and third size ranges are predetermined and may be defined by a user of TB screening system100using an interactive dialog box that allows a user to enter the values or select from optional values. In another illustrative embodiment, the first, second, and third size threshold values are determined based on characteristics of the image data or based on historical data. For illustration, based upon empirical results, the first size range can be set to a range of between 150 and 900 pixels, inclusive. The second size range can be set to between 400 and 900 pixels, inclusive. The third range can be set to be between 901 and some large value, for detecting the presence of clumps.

The size ranges discussed above are for illustrative purposes. A larger number of size ranges may be used to further classification of bacilli. In addition, the ranges themselves may be changed to accommodate the classification of bacilli.

In an operation214, the identified number of bacillus, the number of beaded mycobacteria and the number of clumps of mycobacteria based upon the image data are output. For example, the number of various bacilli found in the image data can be printed to printer122, presented on display120, output via computerized voice via speaker124, or stored to computer-readable medium108and/or database118. Additionally, the binary image showing the remaining blobs may be output possibly in combination with the image data to show a comparison between the two images. The size of each group of blobs may also be output, as the size of each group of blobs may be useful in determining the severity of the disease.

With reference toFIG. 3, another illustrative embodiment of operations associated with TB screening application114ofFIG. 1is described. Additional, fewer, or different operations may be performed, depending on the embodiment. In addition, although some of the operational flows are presented in sequence, the various operations may be performed in various repetitions, concurrently, and/or in other orders than those that are illustrated. The order of presentation of the operations ofFIG. 3is not intended to be limiting. A number of operations inFIG. 3are similar to the operations illustrated inFIG. 2. For instance, image data is loaded in an operation300in the same way image data is loaded in operation200ofFIG. 2. A binary image is created in an operation304and groups of blobs are identified in an operation306. Both operations are similar to operations204and206ofFIG. 2, respectively. In an operation308, the size of each group of blobs is determined. Groups of blobs that are smaller than a predetermined size are discarded. In an illustrative embodiment, groups of blobs that are less than 30 pixels in size are discarded. Alternatively, a different threshold such as 10 pixels, 15 pixels, 25 pixels, 40 pixels, etc. may be used.

In an operation310, the distance between each pair of remaining groups of blobs is determined. The distance between groups of blobs is calculated in a similar manner as described in operation210ofFIG. 2. Each group of blobs in the array is categorized in an operation312in a similar manner as described in operation212ofFIG. 2. In an operation314, the number of individual/unbeaded bacillus, beaded bacillus, and clumps of bacilli are output in a similar manner as described in relation to operation214ofFIG. 2.

With reference toFIG. 6, a plot600showing an assessment of the degree of TB-infection, in terms of number of mycobacteria (AFB count) in each of 21 images is shown. The 21 images are the first 21 images from a set of 169 samples. The remaining 144 images showed similar results to those of the first 21. Results of a solid curve602corresponds to a manual visual count of the number of mycobacteria performed by a doctor and is assumed to represent the actual value. A second curve604represents a count of the number of mycobacteria provided using the HSI space method and includes the optional operation of segmenting the larger cluster into smaller sub-clusters to create the binary image.

Including the optional operation of segmenting the larger cluster into smaller sub-clusters to create the binary image improves the accuracy of the method compared to not splitting the background. For instance, empirical results show improvements in performance in classifying individual bacillus, beaded bacillus, and clumps. Table 1 below shows the improvement in the percent of successful detections based upon the 169 samples discussed above.

Individualbacillus(eitherBackgroundunbeaded or beadedbacillus)BeadedbacillusClumpsSplit93.49%83.60%82.44%Unsplit87.57%53.55%51.15%
The method based on using the classification in the HSI space method described above and splitting the large cluster into smaller sub-clusters to create the binary image is shown to work well. Even small numbers of bacteria have been counted fairly well. For example, this approach was accurate in counting the small number of bacteria as illustrated by the results corresponding to images4,5,8, and13ofFIG. 6. Additionally, this method is believed to work equally well in the RGB space.

In obtaining the results, 169 images of ZN-stained sputum smears, taken by a Leica DFC 320 at a magnification of 1000× (exposure time=1.62 milliseconds with no auto-exposure, gain=1.4×, color saturation=1.55×, γ=0.54; black=14, white=49, brightness=44%, automatic white balance=on, and auto shadow correction=40×) were considered for analysis based on the procedures discussed above. Using the classification in the HSI space method described above and splitting the large cluster into smaller sub-clusters, a background cluster was split into two sub-clusters. The sub-clusters were built from pixels taken from the following specific regions: (i) epithelial cells and (ii) the rest of the background. The sub-clusters were used to create binary images of each of the 169 images. As using the sub-clusters is optional, binary images were also created using the unsegmented background cluster.

The binary images were then subject to post-processing as described in operations206,210, and212. Groups of blobs having a size less than 150 pixels were discarded. Groups of blobs having a size between 150 and 900 pixels and containing a single blob were classified as a single bacillus. Each group of blobs having a size between 400 and 900 pixels and containing more than a single blob were classified as beaded bacillus. Groups of blobs having a size greater than 900 pixels were classified as clumps of bacilli. Connected component labeling, used to segment and label the blobs, was achieved through the program “bwlabel” in MATLAB. In alternative embodiments, any other program or method known to those of skill in the art may be used.

Another illustrative embodiment of operations associated with TB screening application114ofFIG. 1is disclosed with respect toFIG. 4. Image data is loaded in an operation400. In an operation402, a selected channel of information is extracted from the image data. The selection of the channel may be based on a detailed visual examination of image data that reveals a significant color-component in the background—including the pus and epithelial cells—while the bacteria has very little or no occurrence of that color-component, and thus appears dark in the image. For illustration, a green channel may be selected based on the ability of the green channel to distinguish the mycobacteria from the other material in the sample due to the non-occurrence of the color associated with the mycobacteria and the contrast provided using the color.

In an operation404, a binary image is created. For illustration, an optimum threshold can be determined based on certain criteria and using a maximum entropy principle based on a two-dimensional (2D) histogram derived from the extracted image data and a blurred version of the extracted image data. The 2D histogram can be determined using the gray values of the pixels of the image data and a respective local average. For illustration, if f(m,n) is the extracted image of size M×N, its averaged version can be defined as

g⁡(m,n)=19⁢∑i=-11⁢∑j=-11⁢f⁡(m+i,n+j),
and the 2D histogram can be defined as h(k,l)=P{f(m,n)=k,g(m,n)=l}. The probability density function i.e., the normalized 2D histogram, can be estimated as

A pair of thresholds t for f(m,n) and s for g(m,n) is determined. The thresholds are in form of coordinates of a point in the 2D histogram space. When these coordinates point to an optimal location, the sum of the entropies is maximized. The vector [t,s]Tdivides the 2D density into four quadrants. By construction, quadrant Q2, defined by [0,t] and [0,s], corresponds to the background, while quadrant Q4 defined by [t+1,M] [s+1,L], where L represents the number of gray levels in the image, corresponds to the object. Thus, the distributions over Q2 and Q4 are considered independent. The entropy associated with the background can be defined as

HBa=11-a⁢ln⁢∑i=0t⁢∑j=0s⁢p⁡(i,j)P2⁡(t,s)
where P2(t,s) is the cumulative probability. Where p(i,j) is the same as the previously discussed p(k,l). Similarly, the entropy associated with the object can be defined as

Hoa=11-a⁢ln⁢∑i=0t⁢∑j=0s⁢p⁡(i,j)P4⁡(t,s).
Because the other two quadrants, Q1 and Q3, correspond to object and noise, they are neglected. Therefore, P4(t,s)=1−P2(t,s).

The object and the background, corresponding to the two peaks in the normalized histogram, can be separated by selecting the vector [t*,s*]Tthat maximizes the sum of entropies

[t*,s*]T=Arg⁢max(t,s)[HBa⁡(t,s)+H0a⁡(t,s)]
where the value of the parameter a should be between 0 and 1. Values around 0.5 are known to work well, though alternate values are possible, and may be determined by testing using a family of images. For example, a value of 0.7 may be used. In an illustrative embodiment, a “0” value in the binary image represents mycobacterium and a “1” value represents everything else, including the pus and epithelial cells.

Once the binary image is created, operations406,410,412, and414, which correspond to operations206,210,212, and214ofFIG. 2, are executed. Similarly, the operation of extracting a selected channel from an image402can be to create the binary image as disclosed inFIG. 3. Accordingly, operations402and404can be utilized to determine the number of beaded bacilli in an image.

Using the green channel method described above to create the binary image yielded very good results on sample test sets of images. Because this method resulted in over-estimates in spite of a good visual contrast in the image, it is likely that the count may be sensitive to simple methods such as thresholding. Further, the microscope settings may have affected the performance of the green-channel approach.