Automated System for Diagnosis Intestinal Parasites by Computerized Image Analysis

In this study, human fecal parasite detection technique based on Filtration and Steady Determinations Thresholds System (F-SDTS) was proposed. The recognition method includes three stages. First stage, a preprocessing subsystem is realized for obtaining unique features after performing noise reduction, contrast enhancement, segmentation and other morphological process are applied for feature extraction stage of F-SDTS approach. Second stage, a feature extraction mechanism which is based on five features of the three characteristics (shape, shell smoothness, and size) is used. Third stage, Filtration with Steady Determinations Thresholds System (F-SDTS) classifier is used for recognition process using the ranges of feature values as a database to identify and classify the type of parasite. The technique enables to classify two different parasite eggs from their microscopic images which are roundworms (Ascaris lumbricoides ova, ALO) and whipworms (Trichuris trichiura ova, TTO). Finally, simulation result shows overall success rates are almost 93% and 94% in Ascaris lumbricoides and Trichuris trichiura, respectively.


Introduction
Human intestinal parasite worms infecting air, food, and water are the cause of major disease and health issues.The most common symptoms of worm infestation include diarrhea, stomach bloating, and digestive disorders.Other symptoms include anemia, asthma, constipation, fatigue, low immune system, nervousness, skin rash.There are over 100 different types of parasitic worms living in human bodies.Parasites are organisms that live on or in other organisms, obtaining nutrients to live.This causes harm in the process.For most parasites to survive, a host is required to complete the life cycle.Parasites and worms can invade our bodies through food and water intake, and through transmitting agents (like mosquitoes), sexual conduct, or through the nose and skin.There are 3200 varieties of parasites in two major groups; the protozoa and the Helminthes.That includes nematodes, trematodes, and cestodes (Yang & Park, 2001).
The different types of nematodes, common roundworms (Ascaris lumbricoides), hookworms, whipworms (Trichuris trichiura) were studied.Roundworms look similar to an earthworm and can produce 200,000 eggs daily.The parasitic disorders are recognized through the identification of parasitic organisms in the blood, urine, feces, and tissues by using the appropriate recognition methods (Ash & Orihel, 1990).People with intestinal parasite infections are usually under-nourished and weak.Human intestinal parasites can be present in any disease, in any person and at any age.This article analyzes the microscopic images of two kinds of human parasitic worms: Ascaris Lumbricoides ova (ALO) and Trichuris trichiura ova (TTO).
In previous studies, microscopic imaging analysis has been used for recognition and detection of parasites (Daugschies, Imarom, & Bollwahn, 1999).These morphological features were subsequently included in the computation of classification indices.The parasite types were then recognized by using the calculated indices (Sommer, 1996).Yang et al. (2001) has proposed an automated method to detect common helminths eggs in microscopic fecal specimen images.For that purpose, the digital image processing techniques and artificial neural network (ANN) classifier are used.ANN classification was performed by two sub classifiers.Most ANNs classify given patterns according to their geometric clustering in the pattern space.An ANN identified the parasite species based on their characteristics.In his study, four features were selected based on three morphological characteristics representing shape, shell smoothness, and size.Sengur and Turkoglu (2004) have proposed a method of recognizing parasite eggs using pattern recognition techniques.In their study, the feature extraction mechanism based on the invariant moments and artificial neural network classifier was used; using that method, it was reported that more than 90% true recognition rates were obtained (Avci & Akpolat, 2006).Finally, classification was carried out: a specific pattern was assigned to a specific class according to its characteristic features, selected for it (Freeman & Skapura, 1992;Bishop, 1996).Dogantekin (2008) proposed a robust technique based on invariant moments-adaptive network based fuzzy inference system (ANFIS) for recognition of human parasite eggs in microscopic images.The technique presented in the study enabled classification of sixteen different parasite eggs from their microscopic images.This proposed recognition method included three stages.Avci and Asaf (2009) proposed an expert diagnosis system for classifying human parasite eggs based on multi-class SVM, which was based on invariant moments and multi-class support vector machine (MCSVM) for classification of human parasite eggs in microscopic images.This method consists of preprocessing stage, feature extraction stage, classification stage, and testing stage.For this purpose, the proposed approach was tested by using test data to detect sixteen kinds of parasites.At the end of the test, 97.70% overall success rates were obtained.Al Badawi and Al Sonni (2011) have proposed a software to recognize the parasite in microscope images, whether the object is Taenia egg or not and calculate the error percentage.Basically, the program used a number of Matlab techniques in image processing that they were enabled to detect the parasite.In his study, the feature measured was the radius by using a number of equations and statistical analysis to estimate the radius of taenia, which was under ranges from 145 to 170 pixels after applying 40 tests and became a standard database to identify the taenia egg.Their study didn't depend on the color of the egg, which variation in color wouldn't be a problem but because the noise was a problem.theyhave mentioned that using a number of algorithms and techniques didn't remove the noise completely, but it could reduce it because some noises were deeply affected in the image and that only the reason for appearing an error in a false analysis.
If the organisms are present in the fecal specimen, they examine the sizes, shape, and numbers to identify the species of parasite, the degree of infection, and appropriate therapeutic modalities.With the current method of medical microscopic image processing, doctors need to extract features manually through a microscope, drawing conclusion according to the Parasitology atlas book.In this way, it requires a heavy workload, and the diagnoses rely exclusively on the experience of the doctors.Thus, it is difficult to maintain enough people with expertise in diagnostic medical Parasitology.Furthermore, diagnostic medical Parasitologists are expected to maintain high standards of proficiency in the identification of rare parasites.In biomedical engineering, the study of how to implement engineering with medical practice is rapidly growing which is designed to help medical doctors diagnose their patients.Besides the advancement of medical electronics equipment in the diagnosis of disease, there is still room for improvement, especially when the diagnosis occurs in volume or its being manually inspected by technologists.
The aim of this paper is to present a viable method for detecting human parasites using image processing which evaluates five features in the body structure of the parasite.In order to diagnose parasites in the human body, fecal examination is the most the common.This approach makes the detection highly accurate and less time consuming.

Methodology and Analysis
If the organisms are present in the fecal specimen, they examine the sizes, shape, and numbers to identify the species of parasite, the degree of infection, and appropriate therapeutic modalities.With the current method of medical microscopic image processing, doctors need to extract features manually through a microscope, drawing conclusion according to the Parasitology atlas book.In this way, it requires a heavy workload, and the diagnoses rely exclusively on the experience of the doctors.Thus, it is difficult to maintain enough people with expertise in diagnostic medical Parasitology.Furthermore, diagnostic medical Parasitologists are expected to maintain high standards of proficiency in the identification of rare parasites.In biomedical engineering, the study of how to implement engineering with medical practice is rapidly growing which is designed to help medical doctors diagnose their patients.Besides the advancement of medical electronics equipment in the diagnosis of disease, there is still room for improvement, especially when the diagnosis occurs in volume or its being manually inspected by technologists.
In this paper, parasite images were collected as an input data from Hospital Universiti Sains Malaysia (HUSM), Kelantan, Malaysia.For both types of parasites, Ascaris Lumbricoides ova (ALO) and Trichuris trichiura ova (TTO), 100 images were collected for each, by using a microscope which is attached to a digital camera, and connected to PC with special software (Camera: Olympus XC50, U-CMAD3, Japan.Microscope: Model-BX41TF-FL_CCD, Olympus, serial number: BG22578.Software: AnalySIS docu, copyright 1986-2007, Olympus Soft Imaging Solutions GmbH).
In a microscope, the magnification powers might have many objectives that enlarged objects like 10x-20x or so.In this study, the input data or image acquisitions are under the magnification power 10x and the values of feature extraction belong to the magnification power 10x only.The main reasons to choose magnification power 10x rather than 20x and 40x are: 1) In 10x, the general characteristics of parasites are clear and enough to determine the features of these parasites.
2) The field of view under 10x is wider and can recognize the eggs among the other surrounding objects.
3) In the lab, both of 20x and 40x are mostly used to study for an internal egg description, while the features this study are focusing on descriptions of an external egg.4) To decrease the number or images which are taken from the whole slide since 10x is less magnification power and wide field of view.
Based on ideas, it has written three methods in preprocessing stage and performed three of them in the system to see which method can reach to better results in terms to detect ALO and TTO parasites in the images.There are three different methods for preprocessing stage, as shown in Figure 1, are: 1) Preprocessing method I (Pre-Method I): It contents noise reduction using median filter and image enhancement by contrast enhancement and adjustment with gray thresholds.
2) Preprocessing method II (Pre-Method II): It contents noise reduction using median filter and edge detection using 'canny' filter.
3) Preprocessing III (Pre-Method III): It contents image enhancement by contrast enhancement, edge enhancement using unsharp, noise reduction using median filter and edge detection using 'canny' filter.
Among these three methods, only one method is the most suitable due to less error in the results and keeping the data of the image away from being lost.Based on the experimental results, pre-method III was the best method.Pre-method III removed the noise totally since the median filter was used twice.Contrast enhancement was performed, so the brightest and the darkest pixel values are estimated.Sharpness method was used to sharpen the outlines of all objects, then using edge detection to clarify the edge of all objects in the image within specific thresholds of low-level and high-level pixel intensity and specific value of Gaussian's sigma.The differences between the three pre-processing methods are in the use of some processing tools and sequences of those tools.For example, in pre-method I, it used converting images from gray images to binary images, based on threshold images.This was not useful, since it helped to lose the main features of the image, although this method is widely used in image processing, which is why, (the pre-method I) wasn't successful.It wasn't successful in this study because it deals with parasite eggs and very small details, which must be recognized in the detection stage.
Additionally, pre-method II ignored the converted image to prevent the loss of detail regarding input data, but it used edge detection with canny filter.That is a way to detect the edge of hard sharp objects.Since the two kinds of parasite eggs in this study have very clear borders, using edge detection with canny filter was one of the main steps of the preprocessing stage.However, using pre-method II was not a solution for all images that have been tested because some eggs have hard background artifacts, which means their borders wouldn't be very obvious and sharp.
While in pre-method III, most problems in pre-method I & II have been solved for better results by using edge enhancement (sharpness) and edge detection ('canny' filter) together.From the beginning, it twice used a median filter to reduce artifacts and remove as much noise as it can.Median filtering is one of the suitable filters for noise reduction, and it has been used in this work.During our work, few images were hard to delete or reduce the noises especially the small noises that attach to our objects (eggs).From this, the idea has come out.That idea could solve the problem of removing the small noises and give a higher percentage of successful detection for both kinds of parasites ALO and TTO.This idea is to use a median filter twice with same mask size rather than using it once only, and we have approved that using a median filter twice gives slightly up better in results than using the filter once.In pre-method III, median filtering with a mask size 2 x 2 for ALO detection was applied twice.Experimentally, we found out that using median filter twice in a preprocessing stage reduces the error of detecting ALO parasite.The ratio of error reduced to 6% in ALO, which means that using median filter twice is better than using a median filter once, see Figure 2. When we use a median filter one time only, it gives 87% of successful for ALO.While applying a median filter twice, it gives best results reach to 93% for ALO.
Figure 2. Comparison of using median filter (once and twice) for detecting ALO While, median filtering with a mask size 3 x 3 for TTO detection was proceeded twice.Experimentally, we found out that using a median filter twice in a preprocessing stage reduces the error of detecting ALO parasite.The record of error reduced to 4% in ALO, which means that using a median filter twice is better than using median filter once, see Figure 3.When we use a median filter one time only, it gives 90% of successful for TTO.While applying median filter twice, it gives better results reach to 94% for TTO.The five edge detection techniques are 'sobel', 'prewitt', 'log', 'roberts' and 'canny'.These techniques are performed and obtained certain results in terms of success in parasite detection.In "Figure 4", we see the differences of results when five techniques are processed that with using sobel technique obtained 42% only of ALO detection, and prewitt technique obtained 48% only, while log technique has 56% of success in detection ALO, and roberts technique is a less ratio of detection by 20% only but in canny technique, the ratio of success is the best of all five techniques, and the ratio is 93%.
In Figure 5, for detection TTO the five techniques are performed and the ratios of successful detection in sobel, prewitt, log, roberts, and canny techniques are 44%, 51%, 60% 31% and 94%, respectively.So canny filter is the suitable technique than other four techniques that have been tested.From Figure 4 and Figure 5, we can see the nearest success ratio to a canny technique ratio, log technique.That is due to both techniques are depending on a factor to detect the specific threshold of objects' edges.For example, in detecting ALO the best value of the factor which is called sigma, in log technique is 2.5 and gave us a ratio of success reaches to 67%, while in detecting TTO the sigma value is 2.6 and the ratio of success reaches to 63%.One method that is used in this study and comes recommended is shown in Figure 6.The features have to be extracted by using digital image processing techniques for localizing and classifying the parasite eggs in a given image.To develop a totally automated system and image segmentation, the algorithm for feature extraction and classification should all be automated.In addition, dedicated hardware equipment is necessary to scan complete images of each specimen under the microscope.In this paper, an automated method to detect common helminth eggs in microscopic fecal specimen images and to identify the correct species using digital image processing technique is proposed.That proposed method is Filtration and Steady Determination System (F-SDTS).

Figure 6. The algorithm of the F-SDTS technique
In the feature extraction stage, five features have been selected based on three characteristics.Those characteristics represent shape, shell smoothness, and size (these parameters are section area, object's length, object's width, length of boundary, and roundness).These five features are obtained by image processing tools on MATLAB environment.The five parameters are the major features that are able to detect the parasite eggs and each parameter have limited maximum and minimum values, which are called range.These ranges are recorded by experimenting and testing until the best results are obtained.Practically speaking, each object will have five values of five features, and each value of five features should be within the range of feature values.Otherwise, one of these feature values will fall out of the range, indicating the object is not a parasite.In other words, every object in the image will not be qualified for parasite suspicion if any feature's value of the five parameters is not within the range.Table 1 shows feature values records of some parasites.

FV1
[ 1239, 42.31, 37.35, 111, 91] [551, 35.73, 19.68, 78, 84] FV2 [1797, 55.88, 41.19, 139, 85] [536, 37.27, 18.37, 77, 78] FV3 [1234, 43.78, 35.98, 138, 81] [529, 36.10, 18.70, 79, 79] FV4 [1647, 54.70, 38.78, 121, 86] [564, 37.99, 19.43, 85, 76] FV5 [1466, 45.68, 40.95, 121, 86] [532, 36.45, 18.83, 76,   After the feature extraction stage, the system calculates the number of objects inside the input image-N, and then moving to task-1 which deletes all objects out of the area range.The system will calculate N again (N-number of remaining objects).Here the logic of this system works by giving 0 or 1 (if N = 0 then the logic will give 0, while N > 0 the logic will give 1).The system passes to the next task (Task-2) only if the logic of previous task is 1.Otherwise, logic is 0, the system will stop and gives 'no parasite' as a result of this image and it will request for next image.Task-2 is about removing all objects out of boundary length range and same as the previous procedure that recalculating N and if the logic is 1, it passes to Task-3 while the logic gives 0 then it stops and request for next image.Task-3 is about deleting all objects out of length range and again after calculating N if logic is 0 the system stops and requests new image but if logic is 1, then Task-4 is the next task and it's about removing all objects out of a width range and N will be calculated, so if logic is 1 means passing to Task-5 but if logic is 0 then the system requests next image.Task-5 is about deleting all objects out of roundness range and same as before recalculating N. The Task-6 is the last task of this system only if logic is 1 to give the last decision whether the image has N-number of parasite(s) (ALO, TTO or both) or this image has not parasite and then it requests a new image.Task-6 is an additional task and practically it helps to remove special kind of confusing objects which appeared in most of fecal specimens, see Figure 7. Task-6 is about removing all objects out of PVC range (PVC is Pixel Value of Centroid of an object in the original color image), but If the logic is 0 the system will stop and ask for next image.This procedure of classifier is running to all 50 images which are taken from each patient's specimen.

Result and Analysis
In this part, we will analyze and discuss the results of our work at each stage besides giving some comparisons between methods that have been tested to get the best results which all of them are experimental methods with certain results.Every research has a way to analyze the work and show the results, here our choice is to analyze every step of this study in a preprocessing stage, feature extraction stage and classification stage, separately.

Edge Threshold Evaluation
Basically, the external borders of two kinds of parasites have very clear and kind of thick.So we have used some steps to reduce the artifacts and bright the borders for easy removing of the surrounding objects.
In pervious chapter, contrast enhancement was a part of our treatment to enhance the image to become better in characteristics with a good borders sharpness for easy distinguishing from noises of the image.The technique that is used to enhance the contrast and adjust image intensity values, is adjust image within intensity values and this technique has low in and high in, low out and high out values of image pixels with gamma value as shown below: Adjust image within intensity values ([low_in high_in], [low_out high_out], gamma) Where low_in and high_in are the intensities in the input image which are replaced to low_out and high_out in the output image.For low_in, high in, low out and high out, all values are default values.By experimenting, we found out that using default values of low in, high in, low out and high out (means [0.0 1]) is better to keep the image information safe from the losing.
Gamma is a very important factor and it was the main player in this step.In details, we have to talk about the algorithm of this factor that we use Logarithmic-law and Power-law transformations to map a narrow range of intensity values in the input image into a wider range of intensities in the output image.The logarithmic transformation is given by: log(1 )   s c r (1) Where c is a constant and r >=0.The log transformation is often used to compress dynamic range.As with logarithmic transformation, we use power-law transformation to expand a certain range of intensity values.The power-law transformation is shown below: (2) By convention the exponent of the power-law equation is called gamma.When gamma (γ) greater than 1 expands the range of darker intensity values of the image, while gamma less than 1 expands the range of brighter intensity values of the image.Definitely, when gamma = c = 1, we have a petty identity mapping.
Meantime, as the exponent is called gamma, the operation used to correct the power-law response phenomenon is called gamma correction.The adjust image within intensity values can take an additional argument which specifies the gamma correction factor.Referring to the value of gamma, the mapping between values in the input and output images may be nonlinear.For example, the value halfway which is between low and high may map to a value either greater than or less than the value halfway, that is between the bottom and top.
Gamma can be any value between 0 and infinity.If gamma is 1 (the default value), the mapping is linear.If gamma is less than 1, the mapping is weighted toward higher (brighter) output values.And if gamma is greater than 1, the mapping is weighted toward lower (darker) output values."Figure 8" illustrates the three transformation curves figuring how values are mapped when gamma is less than, equal to, and greater than 1.  ms in other In Figure 11, we can see the curve of ALO goes slightly up when the value of alpha increases from 0.0 to 1.0 and we recorded few points on the curve that is shown when alpha equals to 0.0, 0.1, 0.2, 0.5, 0.7, 0.9 and 1.0 the results of success in detecting ALO in terms of percentage are 85%, 86%, 88%, 90%, 92%, 93% and 92%, respectively.Obviously, at value 0.9 it recorded the high ratio of success which is 93%.And this alpha value has been considered in the system.After applying the unsharp masking as mentioned in chapter 3 by using 'special 2-D filter' function with α = 0.9, the filter is: -0.4737 -0.0526 -0.4737 Special 2-D filter('unsharp') = -0.05263.1053 -0.0526 -0.4737 -0.0526 -0.4737 While the other curve in the same figure, which represents TTO, is showing unstable truck when we apply the values of alpha from 0.0-1.0.The values of alpha that applied are 0.0, 0.1, 0.2, 0.5, 0.7, 0.9 and 1.0.The ratios of success in detection TTO are 85%, 87%, 87%, 88%, 92%, 94% and 90%, respectively.From these results, we can see the high ration of success is 94% when alpha equals to 0.9, and based on that we have considered this value of alpha in the system.

Comparison of Edge Detection Efficiency
The efficiency of edge detection comes with trying various techniques of edge detection and applying different values of factor until we reach to the best result with high efficiency.In this study, we tried five techniques of edge detection to find which one is a suitable for better detecting with good results.Parameters are very important because they are the keys to eliminate unwanted objects in the image and focus on the threshold and the characteristics of the wanted objects.
The five edge detection techniques are 'sobel', 'prewitt', 'log', 'roberts' and 'canny'.These techniques are performed and obtained certain results in terms of success in parasite detection.In Figure 12, we see the differences of results when five techniques are processed that with using sobel technique obtained 42% only of ALO detection, and prewitt technique obtained 48% only, while log technique has 56% of success in detection ALO, and roberts technique is a less ratio of detection by 20% only but in canny technique the ratio of success is the best of all five techniques and the ratio is 93%. Figure 14 illuminates the performance of the five techniques in terms of output image after using these techniques and we can see in canny technique many unwanted small details are eliminated and it focuses on high thresholds cells based on parameters' values.In Figure 13, for detection TTO the five techniques are performed and the ratios of successful detection in sobel, prewitt, log, roberts, and canny techniques are 44%, 51%, 60% 31% and 94%, respectively.So canny filter is the suitable technique than other four techniques that have been tested.Figure 15 shows the performance of the five edge detection techniques in terms of output image after using these techniques and we can see in canny technique that it focuses on high thresholds cells based on parameters' values and it eliminates the small details with low thresholds inside the images.
From Figure 12 and Figure 13, we can see the nearest success ratio to canny technique ratio is log technique.
That is due to both techniques are depending on factor to detect the specific threshold of objects' edges.For example, in detecting ALO the best value of the factor which is called sigma (as mention in previous chapter) in log technique is 2.5 and gave us a ratio of success reaches to 67%, while in detecting TTO the sigma value is 2.6 and the ratio of success reaches to 63%.demonstrate that pre-method III is the best method for the detection of helminth eggs, which a success rate of 93% for ALO with 7% error, and 94% for TTO with 6% error.Compared to pre-method I & II, which are less successful in terms of results, Pre-method III is the technique that reaches the best results in detection of parasites.As shown in Table 2, pre-method I and II was 73% and 81% successful at ALO detection; and 75%, 84% of TTO successful detection.The main point of the comparison in Table 2 is to show that using 'unsharp masking' and 'Canny' edge detection (Solomon & Breckon, 2011) together is more powerful to detect ALO and TTO types of parasitic worms.% Ratio of Successful detect for overall images 93% 94% Table 3 clearly shows that 93% of successful detection is achieved for ALO and 94% of successful detecting was reached for TTO.This result can be reliably reached using the recommended methods in this study, which is ready to be used to detect ALO & TTO automatically.
Based on the demonstrated results, errors exist at a rate of 7% in ALO and 6% in TTO.However, these errors may be overestimated or ignored when it gives the last decision of each patient because based on a medical report which is saying, whenever it's been found one parasite or 10's of parasites in the specimen of patient, the result will be same that means patient is infected with that kind of disease, whether ALO or TTO besides that in practice every single patient will source the system with 50 images as an input data which are going to be captured from a patient's specimen under a microscope and each single image is going to be analyzed separately.So, if the system finds one parasite (which it's very seldom that can detect one parasite only in one patient's specimen) or finds 10's parasites then the system will decide, whether that the patient is infected with ALO, TTO, with both worms or not infected, see Figure 18.

Conclusion
The systematic diagnosis of two types of human parasitic worms, Ascaris Lumbricoides ova (ALO) and Trichuris trichiura ova (TTO) used an image processing technique with MATLAB toolbox.The algorithm presented in this paper is limited to the basic diagnosis of these kinds of parasitic worms.Basically, we have experimented three methods in preprocessing stage to achieve the best one that gives good results in the end.One of these three methods has simple and strong technique which performed in this study.This technique is capable of detecting the existence of ALO and TTO parasites within a few seconds per image; thus, this method can replace the conventional methods of detecting worms in biomedical applications.This software program can count the number of parasites which have been detected for each single patient.Furthermore, a user friendly environment GUI is provided, which helps to show results consuming less in manpower and in time as well, reaches to 1-2 seconds per image as compared to conventional methods.

Figure 1 .
Figure 1.Three different Pre-processing methods

Figure 3 .
Figure 3.Comparison of using median filter (once and twice) for detecting TTO

Figure 4 .
Figure 4. Comparison of five different filters applied in ALO detection

Figure 5 .
Figure 5.Comparison of five different filters applied in TTO detection

Figure 7 .
Figure 7. Classifier tasks in classification stage Figure Figure 11.

Figure 12 .Figure 13 .
Figure 12.Comparison results of five different filters applied in ALO detection

Figure 14 .Figure 15 .
Figure 14.Comparison of performance of five edge detection techniques to detect ALO, (a) sobel technique, (b) prewitt technique, (c) log technique, (d) roberts technique, and (e) canny technique Automated detection of ALO and TTO parasites, a) original image, b) image after processing c) outlined the parasites in an output image

Table 1 .
Feature values for some ALO and TTO

Table 2 .
Comparison of three Pre-Methods

Table 3 .
Records by using F-SDTS Technique