Open Access
13 July 2015 Automatic identification of fungi under complex microscopic fecal images
Lin Liu, Yang Yuan, Jing Zhang, Haoting Lei, Qiang Wang, Juanxiu Liu, Xiaohui Du, Guangming Ni, Yong Liu
Author Affiliations +
Abstract
Automatic identification of fungi in microscopic fecal images provides important information for evaluating digestive diseases. To date, disease diagnosis is primarily performed by manual techniques. However, the accuracy of this approach depends on the operator’s expertise and subjective factors. The proposed system automatically identifies fungi in microscopic fecal images that contain other cells and impurities under complex environments. We segment images twice to obtain the correct area of interest, and select ten features, including the circle number, concavity point, and other basic features, to filter fungi. An artificial neural network (ANN) system is used to identify the fungi. The first stage (ANN-1) processes features from five images in differing focal lengths; the second stage (ANN-2) identifies the fungi using the ANN-1 output values. Images in differing focal lengths can be used to improve the identification result. The system output accurately detects the image, whether or not it has fungi. If the image does have fungi, the system output counts the number of different fungi types.

1.

Introduction

The objective of this study is to detect fungi in microscopic fecal images to aid in the diagnosis of disease. Nowadays, disease diagnosis is primarily performed by manual techniques using a smear, which comprised a feces sample that is examined under a biological microscope. The number of different types of fungi in microscopic fecal images can help doctors perform a diagnosis. In manual techniques, however, operator expertise has a significant influence on the results; moreover, the process is tedious and time intensive. Thus, the need exists for an automated, cost-effective system for detecting fungi in microscopic fecal images.

Cell counting approaches based on a digital image process have recently attracted the attention of researchers. However, the main areas of such research include blood,1 not feces, because there are many contaminants in the microscopic fecal image.

Although segmentation and recognition in image processing techniques present many challenges, some reasonable attempts exist in the literature.26 In Ref. 2, Otsu proposed the renowned automatic threshold theory with standardized and automatic threshold selection features. It is a very simple theory that is directly based on the integration of the histogram, and it has a wide range of applications in unsupervised decision procedures. In Ref. 3, a segmentation method was proposed based on boundary and ellipse detection. The egg boundaries were identified from fecal extract images with heavy background noise. In Ref. 4, a method for splitting clumps of convex objects in binary images was presented. The method is based on finding concavity point-pairs; its application area is biological cells that tend to grow in clumps, such as yeast cells. In Ref. 5, an automatic method was proposed to classify white blood cells using an artificial neural network (ANN) and principal component analysis. In Ref. 6, digital image processing and an ANN were used to identify human helminth eggs on microscopic fecal specimens.

Despite the above work, no truly automated and computer-assisted algorithm has been developed to identify fungi in microscopic fecal images. To address this need, we use digital image processing and pattern recognition to acquire the fungi characteristics and an ANN to identify fungi in microscopic fecal images. The overall process is outlined in Fig. 1. It consists of important stages, such as obtaining five images in differing focal lengths, passing each one through image processing, such as segmentation and feature extraction, and counting the fungi identified by the ANN system.

Fig. 1

Block diagram representation of the overall process.

JBO_20_7_076004_f001.png

We propose an automated method to identify fungi in microscopic fecal images. In Sec. 2, the threshold segmentation method is given.5,7,8 In Sec. 3, characteristics of the fungi and feature extraction are explained.4,9 The proposed method for identifying fungi by the ANN system is given in Sec. 4.10,11 Experimental results are presented in Sec. 5. Section 6 provides our discussion and conclusions.

2.

Threshold Segmentation Method

The patients were recruited from the Sichuan Provincial People’s Hospital. All study participants provided informed consent. All research procedures were performed according to the Declaration of Helsinki. Approval for the study was obtained from the ethics committee of the Sichuan Provincial People’s Hospital.

A fecal specimen may contain hundreds of fungi. The fungi must be counted with high accuracy and correctly segmented. We added a new feature to our previously proposed algorithm to solve the segmentation problem.5,7 A biological microscope acquires five images at differing focal lengths in the same field of vision. First, we segment each image by bottom-hat transformation, a mathematical morphology transformation.8 Then the five images are merged into one. Finally, the combined image is used for segmentation. The new algorithm is explained as follows:

  • Step 1: The original five images are obtained at differing focal lengths.

  • Step 2: The RGB images are converted into grayscale images.

  • Step 3: Bottom-hat transformation is performed on each image. The equation used is as follows:

    Eq. (1)

    Bhat(f)=(fb)bf,
    where f is the input image, b is the structuring element, ; is the dilation operation, and ; denotes the erosion operation.

  • Step 4: Otsu’s method is used to automatically convert the bottom-hat image into the binary image.

  • Step 5: The five binary images are merged into one image. For each pixel, if the sum is greater than or equal to two, we set the new image pixel as one. If the sum is less than two, we set the new image pixel as zero. The method is as follows:

    Eq. (2)

    pixel={1sum20sum<2,

  • Step 6: The connected components in the image are identified and labeled.

  • Step 7: The properties of image regions are measured. If the connected component area—that is, the actual number of pixels in the region—is greater than 400, which is the smallest fungi area, and is less than 1500, which is the largest fungi area—the coordinate of the smallest rectangle containing the region is saved.

  • Step 8: Cut the original five images by the coordinate and obtain some small regional images.

  • Step 9: Apply Otsu’s method to automatically convert the image into the binary image again.

  • Step 10: Repeat steps 7 to 9 until the last component is connected.

An example for segmentation is shown in Fig. 2. The original five images are images A1 to A5. We use bottom-hat transformation on account of the complex background. From the bottom-hat image, we can obtain the profile of the fungi shown in images B1 to B5. The profile is brighter than all the surrounding pixels; therefore, Otsu’s method is used to convert the image into the binary image. The fungi may be broken or connected with impurities, such as in images C1 and C2; therefore, the combined five images are used to determine the connected components. The combined image is image D. If more than one image detects this pixel, we set this pixel as white. This is the first segmentation; a second segmentation is required. We use the first segmentation result and the coordinate of the connected components to cut the connected components from the original images; accordingly, we obtain images E1 to E5. If more than one component is in image D, we use one connected component as an example. The microscope objective moves the same distance on each occasion; consequently, the fungi images are taken in different focal planes, from fuzzy to clear and then to fuzzy again, as with E1 to E5. Then the binary images are obtained through Otsu’s method for the second time, and the regions of interest are achieved. The second segmentation result is F1 to F5. It is evident that the broken fungi in C1 and C2 are complete in F1 and F2.

Fig. 2

Overall fungi segmentation process.

JBO_20_7_076004_f002.png

3.

Fungi Characteristics and Feature Extraction

Different types of fungi have similar shapes, which variously appear like several irregular circles connected together. The characteristics that are used to identify fungi are outlined below.

3.1.

Basic Features

To identify fungi, we select eight basic shape features: area, perimeter, major axis length, minor axis length, eccentricity, filled area, bounding box area, and circularity. The area is the actual number of pixels in the region, while the perimeter is the distance around the boundary of the region. The major axis length is the scalar that specifies the length (in pixels) of the major axis of the ellipse with the same normalized second central moments as the region. The minor axis length is the scalar that specifies the length (in pixels) of the minor axis of the ellipse with the same normalized second central moments as the region. Eccentricity refers to the scalar that specifies the ratio of half-focal length and semi-major axis of the ellipse with the same second-moments as the region. The filled area refers to the scalar specifying the number of “on” pixels in a filled image, while the bounding box area is the area of the smallest rectangle containing the region. Circularity is the ratio of a shape’s compactness measure for which the following equation is used:

Eq. (3)

C=4πSL2,
where S is the filled area and L is the perimeter.

3.2.

Number of Connected Circles

The following process is used to determine if the connected component has circles. If it has circles, they are counted. First, the binary image may have some noisy points. We, therefore, remove the small area and retain the largest one. We then use template matching to detect the circle. Circular templates of differently sized slides are applied to the image. If more than 80% of the pixel values are the same, we record the template’s center coordinates. We typically obtain more than one center point; therefore, clustering is needed. If the distance between two points is very small—i.e., less than five pixels—we believe that the two points represent the same point, and we, therefore, save only one of them. The number of points is at least equivalent to the number of circles. The fungi image and circle centers are shown in Fig. 3.

Fig. 3

Experimental results of circle detection: (a) green points are circle centers obtained by template matching, (b) red points are circle centers after clustering.

JBO_20_7_076004_f003.png

3.3.

Concavity Point

In the digital imaging domain, it is often observed that objects in an image clump together. A method of splitting clumps is to use a concavity point.4,9 A pair of concavity points exists between two circles. A specific number of concavity points is a fungi characteristic. To find the concavity point, the first step is to detect all of these points on the contour of the fungi. Then we take two contour points and imagine a line between them. For example, in Fig. 4(a), a line connects points A and B. If the midpoint of the line, such as point C in the example, is located outside the fungi contour, this contour is concave. The concavity depth is then calculated and a predefined minimum concavity depth value is applied to the size of the fungi.

Fig. 4

Concavity point detection—explanation and illustration: (a) obtain two contour points and imagine a line between them. The midpoint confirmed here is concave. (b) Calculate the point to the straight line distance and the maximum distance, which corresponds to the concavity point. (c) Concave arc in the fungi contour. (d) Find the concavity point in the concave arc.

JBO_20_7_076004_f004.png

Detailed steps of this process are outlined in Fig. 4(b). First, region boundaries in the binary image are traced. Second, we select datum point Pt. We find a point in front of that datum point, and a point behind that datum point, such as points Pt3 and Pt+3. Third, we imagine a line between these two points, Pt3 and Pt+3. If the line midpoint is located outside of the fungi contour, this datum value is a concavity point. Several consecutive concavity points connect to comprise a concave arc, as shown in Fig. 4(c). Fourth, we calculate datum point Pt to the straight line Pt3 and Pt+3 as distance dt, as shown in Fig. 4(b). The maximum distance point in each arc is considered the maximum curvature concavity point. Of course, the distance should be greater than the minimum established concavity depth. We retain these maximum curvature points to count the concavity point numbers. The concavity points are shown in Fig. 4(d).

4.

Identification Methods

4.1.

Filtering Fungi

We first count the feature values of the fungi. There are three types of fungi, as shown in Fig. 5. The feature values are shown in Table 1. The different types of fungi have different values. We classify fungi as budding fungi, two circle fungi, and three circle fungi. We then calculate the average of the basic feature values of some standard fungi for each type. The circle number and concavity point have accurate values. The number of circles is one, two, or three, and the concavity point number is two or four. Because there are five images in one field of vision, the reservation condition is that at least three images must meet the above conditions. Other feature values have ranges of 70% of budding fungi values to 150% of the three circle fungi values. In addition, three images are needed in these ranges. With these conditions, we can remove 95% of the impurities.

Table 1

Desired feature values for different types.

Budding fungiTwo-circle fungiThree-circle fungi
Area6248071,058
Perimeter121138185
Major axis length465266
Minor axis length303337
Eccentricity0.750.780.86
Filled area8521,1071,447
Bounding box area1,4481,6852,814
Circularity0.740.720.53
Number of circles123
Concavity point224

Fig. 5.

Types of fungi: (a) budding fungi, (b) two-circle fungi, and (c) three-circle fungi.

JBO_20_7_076004_f005.png

4.2.

Fungi Identification by Artificial Neural Network

An ANN system is used to identify fungi.6,10,11 The fungi identification is performed by an ANN classification system that consists of two stages. The first stage (ANN-1) combines the five feature values from the five images in differing focal lengths; the second stage (ANN-2) identifies the fungi, as shown in Fig. 6. These two stages are adopted to increase recognition accuracy and reduce computation time. The objective of ANN-1 is to combine the feature values of the same region of interest in five images, while the subsequent ANN-2 stage identifies the fungi using the output from ANN-1. Both ANNs are general multilayer perceptron (MLP) neural networks; the back propagation learning rule is used in both cases.

Fig. 6

Artificial neural network (ANN) system consisting of ANN-1 and ANN-2 stages for identifying fungi.

JBO_20_7_076004_f006.png

In general, the MLP network consists of a set of neurons (perceptrons) in several layers and interneuronal connections. The values import the input layer’s neurons. The neurons in subsequent layers take the sum of the neuron output from the previous layers with different weights and calculate the nonlinear output. The MLP network is basic and is the most widely used neural network in pattern recognition because it can realize almost any type of linear or nonlinear decision boundary between clustered patterns.

ANN-1 includes 10 parallel ANNs; each ANN has five input nodes and one output node. The ANNs have two hidden layers; the numbers of neurons are eight for each of them, respectively. The 10 ANNs respectively correspond to the 10 characteristics outlined in Sec. 3. For example, the first ANN’s goal is to calculate the fungus area. The fungus has five area values in five different focal lengths; this ANN calculates one number as the fungus area. The desired output values of circle number and concavity point are accurate ones; however, the area, perimeter, eccentricity, and other features do not have accurate values. Therefore, we use the estimated values in Sec. 4.1. All desired output values are shown in Table 1. ANN-2 has 10 input nodes and three output nodes. The 10 input nodes receive the feature values that are the output values of ANN-1; the three output nodes indicate the three types of fungi. The ANN has two hidden layers, and the respective number of neurons for each of them is 30.

5.

Evaluation Results

Using the JHAFA-III feces analyzer, an automated instrument that can dilute the sample and automatically take pictures, at two hospitals, we obtained 1000 fungi images (200×5; 200 fields of vision; and five images in differing focal lengths for each field of vision). With the aid of a doctor, we counted the fungi in the image. The fungi images were segmented as described in Sec. 2, and we obtained 5205 connected components, consisting of 2031 fungi and 3174 impurities. We then calculated the morphological feature values, as discussed in Sec. 3, thereby removing 3143 connected components (3015 impurities and 128 fungi) by the 10 feature values described in Sec. 4.1 to achieve 94.5% accuracy. The filtered fungi are shown in Fig. 7. The ANN system was trained with randomly selected samples of 924 fungi obtained from 500 images. The morphological feature values of the fungi, which served as the input data of the network, were calculated as described in Sec. 3. In the test phase, we used another 500 images obtained from 979 fungi. The desired output values were derived from the ground truth obtained from diagnostic experts. These values are shown in Table 1. In these test phases, 916 correctly identified fungi and a 93.6% accuracy for the ANN was achieved. The accuracy was calculated as

Eq. (4)

Accuracy=RS×100%,
where R is the number of correctly identified fungi and S is the total number of fungi. The above computation was executed on a computer with an Intel Core i5-2380P CPU and NVIDIA GeForce GTX 570 graphics card. The program utilized four CPU threads and CUDA technology to provide acceleration. Each vision in the five images took 1.68 s on average.

Fig. 7

Filtered fungi results.

JBO_20_7_076004_f007.png

Each image was individually tested by one ANN for comparison. In the vision of the five images, any connected component identified in one image was considered to be a fungus. The fungi were identified but significant amounts of impurities were also identified. Using this algorithm, the accuracy was 76.5%. This shows the superiority of the proposed two ANNs for five images over one ANN.

6.

Discussion and Conclusion

In this paper, we presented a developed and tested automated system for assisting in the diagnosis of some diseases. An image obtained by a camera attached to a microscope is processed, and the resulting data, including the number of different types of fungi present, are accurately detected and used in diagnosing disease. The camera acquires five images in differing focal lengths. The RGB image is converted into a grayscale image. Bottom-hat transformation and Otsu’s method are then used to automatically convert the grayscale image into the binary image. The five binary images are merged into one image. The connected components are labeled and the area is calculated. If the area is outside the range of 400–1500, we remove this connected component from the binary image. We then excise the preserved connected components in the five images. A second segmentation is needed by Otsu’s method. We next calculate the characteristics of each connected component, including the area, perimeter, circularity, number of circles, and concavity point, and exclude the connected components that do not match the fungi’s feature values.

An ANN system then employs these characteristics to identify the fungi. It comprises two stages: ANN-1 and ANN-2. ANN-1 includes 10 ANNs; each ANN calculates one characteristic. They have five inputs from the five images in differing focal lengths, and one output. The five feature values are combined into one value by ANN-1. The fungi are divided into three categories by their differing characteristics. If multiple shapes exist in a fungus, such as four or more circles, they must be divided into more categories. ANN-2 includes 10 input nodes, which receive the output values of ANN-1 and the three output nodes. By detecting the characteristics of the network input, the ANN system operates with 93.6% accuracy. The identification of each vision takes 1.68 s. The time taken to carry out identification was the same as that taken by the doctor, thus the system could actually be used in a hospital.

The ultimate goal of this study was to develop an automated fungi examination system. The connection of two different ANNs to identify fungi was proved feasible. In actual practice, the acquisition of only one image may not produce sufficiently clear recognition. Images in differing focal lengths can be used to improve the recognition result. The proposed algorithm can handle difficult cases and can be a primary software component of a completely automated system.

Acknowledgments

We would like to express our thanks to professor Yutang Ye and all of the staff in the MOEMIL Laboratory who collected and counted the fungi used in this study. This research was supported partly by the National Natural Science Foundation of China (Nos. 61405028 and 61205004) and Central Universities (University of Electronic Science and Technology of China) Fundamental Research Funds (No. ZYGX2013J065) and the funds of Guangdong-Hong Kong Breakthrough Bidding Project in Key Areas (Nos. 2012205106 and 20091683).

References

1. 

A. V. Zinoviev et al., “Laser fluorescent flow citometer with pulsing excitation,” in Proc. IEEE Conf. on Lasers and Electro-Optics Europe, 217 (1994). Google Scholar

2. 

N. Otsu, “Threshold selection method from gray-level histograms,” IEEE Trans. Syst. Man Cybern., 9 (1), 62 –66 (1979). http://dx.doi.org/10.1109/TSMC.1979.4310076 Google Scholar

3. 

J. Zhang et al., “Cascaded-automatic segmentation for schistosoma japonicum eggs in images of fecal samples,” Comput. Biol. Med., 52 18 –27 (2014). http://dx.doi.org/10.1016/j.compbiomed.2014.05.012 CBMDAW 0010-4825 Google Scholar

4. 

M. Farhan, O. Yli-Harja and A. Niemisto, “A novel method for splitting clumps of convex objects incorporating image intensity and using rectangular window-based concavity point-pair search,” Pattern Recognit., 46 (3), 741 –751 (2013). http://dx.doi.org/10.1016/j.patcog.2012.09.008 PTNRA8 0031-3203 Google Scholar

5. 

S. Nazlibilek et al., “Automatic segmentation, counting, size determination and classification of white blood cells,” Measurement, 55 58 –65 (2014). http://dx.doi.org/10.1016/j.measurement.2014.04.008 0263-2241 Google Scholar

6. 

Y. S. Yang et al., “Automatic identification of human helminth eggs on microscopic fecal specimens using digital image processing and an artificial neural network,” IEEE Trans. Biomed. Eng., 48 (6), 718 –730 (2001). http://dx.doi.org/10.1109/10.923789 Google Scholar

7. 

H. T. Madhloom et al., “An automated white blood cell nucleus localization and segmentation using image arithmetic and automatic threshold,” J. Appl. Sci., 10 (11), 959 –966 (2010). http://dx.doi.org/10.3923/jas.2010.959.966 Google Scholar

8. 

R. M. Haralick, S. R. Sternberg and X. Zhuang, “Image analysis using mathematical morphology,” IEEE Trans. Pattern Anal. Mach. Intell., PAMI-9 (4), 532 –550 (1987). http://dx.doi.org/10.1109/TPAMI.1987.4767941 ITPIDJ 0162-8828 Google Scholar

9. 

M. Farhan, O. Yli-Harja and A. Niemistö, “An improved clump splitting method for convex objects,” in Proc. 7th Int. Workshop on Computational Systems Biology, 35 –38 (2010). Google Scholar

10. 

P. S. Hiremath and P. Bannigidad, “Automatic identification and classification of bacilli bacterial cell growth phases,” IJCA Special Issue on Recent Trends in Image Processing and Pattern Recognition, 1 48 –52 (2010). Google Scholar

11. 

L. Shamir et al., “Pattern recognition software and techniques for biological image analysis,” PLoS Comput. Biol., 6 (11), e1000974 (2010). http://dx.doi.org/10.1371/journal.pcbi.1000974 Google Scholar

Biography

Lin Liu is an associate professor of optical engineering at University of Electronic Science and Technology of China. He received his master’s and PhD degrees from the University of Electronic Science and Technology of China in 2006 and 2009, respectively. His research focuses on optoelectronic integration and laser minuteness process.

Yang Yuan is currently a master’s student at University of Electronic Science and Technology of China. He received his bachelor’s degree from University of Electronic Science and Technology of China in 2013. His research focuses on optical image processing and machine vision detection.

Jing Zhang is a lecturer at the University of Electronic Science and Technology of China. She received her PhD from the University of Electronic Science and Technology of China in 2014. Her research focuses on optical devices and image-processing algorithms.

Haoting Lei is currently a master’s student at the University of Electronic Science and Technology of China. She received her bachelor’s degree from the University of Electronic Science and Technology of China in 2013. Her research focuses on image processing and machine learning.

Qiang Wang is currently a master’s student at the University of Electronic Science and Technology of China. He received his bachelor’s degree from the University of Electronic Science and Technology of China in 2014. His research focuses on optical image processing and machine learning.

Juanxiu Liu is an associate professor of optical engineering at the University of Electronic Science and Technology of China. She received her PhD from the University of Electronic Science and Technology of China in 2010. Her current research focuses on photoelectric measuring instrument and optical image processing.

Xiaohui Du received his bachelor’s degree from the University of Electronic Science and Technology of China in 2013. He is now a PhD student at the University of Electronic Science and Technology of China. His research focuses on photoelectric measuring instruments.

Guangming Ni is now a PhD student at the University of Electronic Science and Technology of China. His research focuses on photoelectric measuring instruments and optical image processing.

Yong Liu is a professor at the University of Electronic Science and Technology of China. He received his PhD from Technische Hogeschool Eindhoven (Holland). His research focuses on optics, optical electronics, and optical fiber communication.

© 2015 Society of Photo-Optical Instrumentation Engineers (SPIE) 1083-3668/2015/$25.00 © 2015 SPIE
Lin Liu, Yang Yuan, Jing Zhang, Haoting Lei, Qiang Wang, Juanxiu Liu, Xiaohui Du, Guangming Ni, and Yong Liu "Automatic identification of fungi under complex microscopic fecal images," Journal of Biomedical Optics 20(7), 076004 (13 July 2015). https://doi.org/10.1117/1.JBO.20.7.076004
Published: 13 July 2015
Lens.org Logo
CITATIONS
Cited by 15 scholarly publications and 1 patent.
Advertisement
Advertisement
RIGHTS & PERMISSIONS
Get copyright permission  Get copyright permission on Copyright Marketplace
KEYWORDS
Fungi

Image segmentation

Binary data

Image processing

Artificial neural networks

Neurons

Microscopes

Back to Top