scieee AI-readable full text Open interactive document viewer

Automatic Detection of Trypanosomes on the Blood Stream

José Rui Neto Faria

Abstract

Hoje em dia existem várias doenças consideradas perigosas. Duas delas, a doença de chagas e a do sono, são mortais e causadas pelos parasitas protozoários: Trypanosoma cruzi (T. cruzi) e Trypanosoma brucei (T. brucei) respetivamente. Essas doenças aparecem geralmente na América Latina e África sendo transmitidas a seres humanos e animais por pequenos insetos como o triatomine e tsetse através de mordidas.Estas causam elevado número de mortes por diagnósticos tardios. A doença de chagas tem duas fases, a inicial(aguda), que dura até duas semanas depois da infeção,sendo que nesta fase um grande grupo de parasitas circula na corrente sanguínea e os sintomas são quase inexistentes tornando o seu diagnóstico atempado difícil. Na segunda fase, a fase crónica, os parasitas desaparecem da corrente sanguínea e movem-se para o coração e músculos digestivos, e em alguns anos a doença pode levar à morte da pessoa por falha desses orgãos. A doença do sono também tem duas fases, a fase inicial,que pode durar desde uma semana a dois anos dependendo da sub-espécie de T.brucei, nesta fase existe um grande número de parasitas na corrente sanguínea e alguns pacientes sofrem de dores de cabeça e febre. Na segunda fase o parasita chega ao sistema nevoso causando a deterioração da saúde mental do paciente e levando à sua morte. Este projeto disponibiliza uma solução móvel que consegue detetar ambas as doenças nos seus estados iniciais encontrando os respetivos parasitas e permitindo o seu tratamento.Com esta aplicação, o utilizador tira fotos de uma amostra de sangue pertencente a um paciente, usando um microscópio com adaptador. A foto será segmentada de modo a separar o fundo da imagem do resto dos componentes seguindo-se a identificação dos parasitas. Com isto torna-se possível a deteção destas doenças em países menos desenvolvidos onde os serviços de saúde e o seu acesso aos mesmos não são garantidos.

Full text

FACULDADE DE ENGENHARIA DA UNIVERSIDADE DO PORTO Automatic Detection of Trypanosomes on the Blood Stream José Rui Neto Faria Mestrado Integrado em Engenharia Informática e Computação Supervisor at FEUP: Luís Filipe Pinto de Almeida Teixeira Supervisor at FhP: Fábio Filipe Costa Pinho July 22, 2016 Automatic Detection of Trypanosomes on the Blood Stream José Rui Neto Faria Mestrado Integrado em Engenharia Informática e Computação Approved in oral examination by the committee: Chair: João Carlos Pascoal Faria External Examiner: Pedro Manuel Henriques da Cunha Abreu Supervisor: Luís Filipe Pinto de Almeida Teixeira July 22, 2016 Abstract Despite the major advancements in Medical Science of the XXI century, there are still dangerous diseases spread worldwide. Two of them chagas disease and the sleeping sickness are potentially life-threatening illnesses caused by the protozoan parasites: Trypanosoma cruzi (T. cruzi) and Trypanosoma brucei (T. brucei) respectively. These diseases are mainly found in Latin America and Africa being transmitted to humans and animals by small insects like triatomine bugs and tsetse flies either by bite or contact with their faeces, killing a high number of people by late diagnostic. The chagas disease has two phases, the initial (acute) phase lasts about two months after infection, in this phase a high number of parasites circulate in the blood stream, but in most cases the symptoms are absent or mild. In the second phase, chronic phase, the parasites are hidden mainly in the heart and digestive muscles, in later years the infection can lead to sudden death or heart failure caused by progressive destruction of the heart muscle and digestive system. The sleeping sickness also has two phases, the initial phase, last from some weeks to one or two years depending of the sub-species of the T.brucei parasite, in this phase a high number of parasites circulate in the blood stream, and some patients suffer from fever and aches. In the second phase, the parasite reaches the nervous system causing mental deterioration and other neurological problems leading to the death of the patient. The objective of this work was to create a mobile solution that can help detect both the diseases in the initial stages by detecting the trypanossomes parasites. With this application, the user takes a photo of a thin blood smear sample of a patient using an adapter that attaches the mobile device to a microscope, then the image is segmented in order to separate the components of the blood from its background. Later, the application will try to confirm if the parasites segmented are the correct ones, informing the user if the donor of the blood is infected. With this, it becomes possible to make the detection of the diseases in countries where the health services are poorly developed and people do not have good access to it. This mobile application is fast and reliable due to its analysis sensibility of 97.37% and its short execution time of approximately 32 seconds on a high-end android device i ii Resumo Hoje em dia existem várias doenças consideradas perigosas. Duas delas, a doença de chagas e a do sono, são mortais e causadas pelos parasitas protozoários: Trypanosoma cruzi (T. cruzi) e Trypanosoma brucei (T. brucei) respetivamente. Essas doenças aparecem geralmente na América Latina e África sendo transmitidas a seres humanos e animais por pequenos insetos como o triatomine e tsetse através de mordidas. Estas doenças causam elevado número de mortes devido a diagnósticos tardios. A doença de chagas tem duas fases, a inicial(aguda), que dura até duas semanas depois da infeção, sendo que nesta fase um grande grupo de parasitas circula na corrente sanguínea e os sintomas são quase inexistentes tornando o seu diagnóstico atempado difícil. Na segunda fase, a fase crónica, os parasitas desaparecem da corrente sanguínea e movem-se para o coração e músculos digestivos levando à morte por falha desses mesmos orgãos. A doença do sono também tem duas fases, a fase inicial,que pode durar desde uma semana a dois anos dependendo da sub-espécie de T.brucei, nesta fase existe um grande número de parasitas na corrente sanguínea e alguns pacientes sofrem de dores de cabeça e febre. Na segunda fase o parasita chega ao sistema nervoso causando a deterioração da saúde mental do paciente levando à sua morte. Este projeto disponibiliza uma solução móvel que permite detetar ambas as doenças nos seus estados iniciais encontrando os respetivos parasitas e permitindo o seu tratamento. Com esta aplicação, o utilizador tira fotos de uma amostra de sangue pertencente a um paciente, usando um microscópio com adaptador ou microstage. A foto será segmentada de modo a separar o fundo da imagem do resto dos componentes seguindo-se a identificação dos parasitas. Com isto torna-se possível a deteção destas doenças em países menos desenvolvidos onde os serviços de saúde e o acesso aos mesmos não são garantidos. Esta solução é rápida e eficaz devido à sensibilidade de 97.37% na sua análise e à sua curta duração de 32 segundos num dispositivo android considerado high-end. iii iv Acknowledgements I would like to thank my thesis supervisor professor Luís Filipe Pinto de Almeida Teixeira of Faculdade de Engenharia do Porto, its door was always open whenever I ran into problem and the discussions I had with him made me see the problem in a different light. I would also like to thank the engineer Fábio Filipe Costa Pinho, my responsible in Fraunhofer AICOS, his guidance and insight helped my to organize my project. I would also like to acknowledge Maria João Medeiros de Vasconcelos and Luis Filipe Caeiro Margalho Guerra Rosado, engineers in Fraunhofer AICOS for helping me with the management of resources and for having the availability to hear my problems and to help me find the solutions. In last I want to thank Rui Neves and Simão Felgueiras, colleagues of mine that were also doing their thesis in Fraunhofer AICOS, and by whom I learned many things in order to improve my project. José Rui Neto Faria v LIST OF FIGURES xii List of Tables 3.1 Differentblurtypes................................. 12 3.2 Different types of color spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.1 TCGFEfeatures................................... 34 4.2 Classificationalgorithms .............................. 35 4.3 Results of classification algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.1 Process duration on a computer . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.2 Process duration on an Asus Zenfone 2 . . . . . . . . . . . . . . . . . . . . . . . 46 5.3 Process duration on a galaxy nexus . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.4 Resultsoftheprogram ............................... 48 xiii LIST OF TABLES xiv Abbreviations CPU central process unit KNN K-nearest neighbours OpenCV Open Source Computer Vision Library RAM Random Access Memory RGB Red,Green,Blue ROI Region of interest SVM Support vector machine T. b. gambiense Trypanosoma brucei gambiense T. b. rhodesiense Trypanosoma brucei rhodesiense T. brucei Trypanosoma brucei T. cruzi Trypanosoma cruzi xv Chapter 1 Introduction 1.1 Motivation Trypanosomes infect a variety of hosts and are responsible for many diseases that affected humans and animals alike, two of the most dangerous diseases to humans chagas disease and sleeping sickness, are caused by T.cruzi and T.brucei two sub-species of Trypanosomes. Chagas disease is a potentially life-threatening illness, being found mainly in Latin America. Per year there are 41,200 new cases of T cruzi infection, 14,400 infants are born with congenital Chagas disease and 12,000 die from it[eme]. The cost of treatment for Chagas disease remains substantial. In Colombia alone, the annual cost of medical care for all patients with the disease was estimated to be about US$ 267 million in 2008 [CHA].Spraying insecticide to control the bugs responsible for the transmission of it would cost nearly US$ 5 million annually. The sleeping sickness cases are generally prevalent in Africa, in 1998 40 000 cases were reported, but more than 300 000 cases were undiagnosed and untreated [SLE]. A more recent epidemic happened in Africa and the prevalence of the disease reached 50% in several villages in Angola, South Sudan and the Democratic Republic of the Congo. In the last years the cases of the disease decreased to 9878 cases in 2009 and 3796 in 2014 due to control efforts.The estimated number of actual cases is below 20 000 and the estimated population at risk is 65 million people[SLE]. This project aims to help the reduction of these numbers by giving a portable option for detecting both diseases in the early stages and making the treatment possible. 1.2 Project and objectives The objective of this work is to create an android application that detects if someone is infected with the early stages of the chagas disease or the sleeping sickness by analyzing a picture of a blood sample retrieved from a possibly infected person and detecting the parasite responsible for the diseases: Trypanosoma cruzi or Trypanosoma brucei respectively. For that first a good computer 1 Introduction vision methodology must be created using as support the contextualization of the problem and the searched state of the art. This application should run in a variety of android devices and have a good performance depending of the mobile system hardware like battery, processor and memory. The work of the application can be reduced to 3 steps: acquire a picture either by taking a photo of the blood sample using an adapter to attach the device to a microscope or by loading an image from the gallery, analyze it using methods from computer vision and show the result to the user. 1.3 Structure of the dissertation The present document has five other chapters: Chapter 2: Gives background about the diseases and the related parasites in order to help the reader understanding better the processes that will be used in the application and how it will work; Chapter 3: Makes a revision and evaluation of the work done in the area which this project is inserted, this includes the existent computer vision algorithms, similar mobile applications in the market and conclusions about the collected information; Chapter 4: Explains the used computer vision methodology, all its steps and how it was used in an android application Chapter 5: Tests a group of images and its results are discussed. Chapter 6: Concludes the dissertation and points out future. 2 Chapter 2 Background 2.1 Chagas disease 2.1.1 Transmission Chagas disease, also known as American trypanosomiasis, is a potentially life-threatening illness caused by the Trypanosoma cruzi (T. cruzi). This parasite is mainly transmitted by contact with faeces/urine of infected blood-sucking triatomine bugs. These bugs are active at night and live in the cracks of the poorly constructed houses. They usually bite exposed areas of skin and defecate close to them. When the person smears the faeces into the bite, the eyes, the mouth or into any skin break the parasite enters the body and the disease starts [CHA]. The T.cruzi can also be transmitted by consumption of food contaminated with it, blood transfusion from infected donors, passage from an infected mother to her newborn, organ transplant from infected donors and laboratory accidents[CDCb]. Figure 2.1: Triatomine bugs [CHA] 2.1.2 Stages There are two phases of Chagas disease: the acute phase and the chronic phase. The first phase, lasts from the first weeks to the first months of the infection. It is usually symptom free or with 3 Background mild symptoms associated, generally mistaken for other diseases. These symptoms can include fever, fatigue, body aches, headache, rash, loss of appetite, diarrhea, and vomiting. The most recognized marker of acute Chagas disease is called Romaña’s sign, which includes swelling of the eyelids on the side of the face near the bite wound or where the bug faeces were deposited or accidentally rubbed into the eye. It his in this phase that a high number of parasite circulate in the blood, being the phase when it is easier to detect a disease from a blood sample and where the application of the project will be used[eme]. The chronic phase is when the most symptoms are felt, as the parasites stop to circulate in the blood and hide themselves mainly in the heart and digestive muscles of the infected person [CHA] feeding on their cells, this causes a progressive destruction of the muscles, leading to sudden death or heart failure of its carrier[eme]. 2.1.3 Diagnosis The chagas disease can be detected by observation of the parasite T.cruzi in a thin blood smear, this method can only be used in the acute phase of the disease because as said in chapter 2.1.2 the parasites in the chronic phase are no longer circulating on the bloodstream of the infected person[CDCb]. In the chronic phase serologic tests are used to detect the disease if symptoms of it are detected in the patient. This method tests the presence of a specific antibodies to T.cruzi and is not as well developed as the one used in the acute phase [eme]. 2.1.4 Treatment The treatment of the chagas disease is different depending on the phase of the illness the patient is in. During the acute phase and in the beginning of the chronic phase of the disease when the patient symptoms do not exist or are mild an anti-parasitic treatment is used, this treatment has as objective to eliminate the parasites in the blood stream by using benznidazole and nifurtimox, which have a reduced effect as the patient’s time without diagnosis and respective treatment increases. This treatment is not possible in pregnant women or by people with kidney or liver failure. Nifurtimox is also contra-indicated for people with a background of neurological or psychiatric disorders.[CHA] The symptomatic treatment is used in the chronic phase,when the anti-parasitic treatment should not be given, helping people who have cardiac or intestinal problems caused by the chagas disease, this solution will not cure the infected person but will improve life quality[eme]. 2.1.5 The parasite The protozoan parasite, Trypanosoma cruzi, causes Chagas disease and it will be detected by the application so that it can be possible to know if the patient is infected. This parasite lives part of its life in the blood and/or tissues of the infected hosts and the rest of it in the digestive tracts of the infecting bugs. In its life cycle the Trypanosoma cruzi can change between many forms like trypomastigotes (figure 2.2a), amastigotes (figure 2.2b) and epimastigotes (figure 2.2c), to better explain this 4 Background (a) T. cruzi trypomastigote in thin blood smears stained with Giemsa[CDCb]. (b) Trypanosoma cruzi amastigotes in heart tissue[CDCb]. (c) Trypanosoma cruzi epimastigote from culture[CDCb]. Figure 2.2: The phases of trypanosoma cruzi. changes, their purpose and when they happen we need to talk about the life cycle of the parasite. The Trypanosoma cruzi life cycle can be divided in 2 major phases: the human stages and the Triatomine bug stages. Figure 2.3: Life cycle of T.Cruzi [CDCb] The first stage starts with the bite of the Triatomine bug, when this insect takes a blood meal and releases trypomastigotes in its faeces near the bite wound, later the parasite either by the wound or by other skin break infects the host. Once inside of the wound the parasite invades the nearer cells and differentiates into intracellular amastigotes. In this phase the parasite can multiply by binary fission using cells infected tissue, after multiplying in the cell the parasite transforms into trypomastigotes and goes to the blood stream, then when finding a suitable cell it transforms 5 Literature review Table 3.1: Different blur types Type characteristics Mean filter After convolving the content of the window with the kernel the value of the pixel is the mean value of the group pixels contained in the window Median filter After convolving the content of the window with the kernel the value of the pixel is the median value of the group pixels contained in the window Gaussian filter In this blur the window is convoluted with a kernel created by a Gaussian function, the result is the value of the central pixel of the window Kuwahara filter This blur divides the window in 4 sub-windows and calculates the mean value of each, in the end the value of the central pixel is the mean value of that region that has the smallest variance. Nagao-Matsuyama filter This blur uses a 5x5 window divided in 9 sub-windows to calculate the value of its central pixel, its value is the mean of the sub-window with the lowest variance These types of algorithms are greatly affected by the size of the window, generally the biggest the window size the blurriest the result is (figure 3.1), this property is one of the most important properties of the process. (a) Original figure 1(b) Window size 3 (c) Window size 7 (d) Window size 15 Figure 3.1: Gaussian blur 12 Literature review 3.1.1.2 Image resize This is one of the most simple preprocessing methods, its objective is not to improve the results of the posterior operations but to make the overall program faster. This method generally by reducing the resolution or size of the figure reduces the quantity of pixels to be analyzed, this makes algorithms that have to get and modify the information of all the pixels in the figure faster due to their reduced number. The image resize can be a double-edged sword due to the result of the operation, an figure that has been reduced a lot will lose important information and will deteriorate the results of the segmentation,feature extraction and classification phases. 3.1.1.3 Image crop The objective of this preprocessing method is the same as the image resize but is applied in a different way. With image crop the size of the figure will be changed not due to a universal resize but a cut of regions of the figure that will not be necessary for the rest of the program. The problem of this method is that can not be easily applied to all figure due to the fact that, in some figures, the region of interest is hard to discover and consequently the area to be cut too. The big advantage compared to the figure resize is the fact that, as said before, the pixels are not changed and the discarded information is not necessary avoiding problems in later stages of the project. 3.1.1.4 Modification of color space This type of method tries to correct or enhance the color information of an figure, making the later steps of the overall object recognition process faster and more reliable. For that generally the original figure color space is changed to another color space that can be either a different representation of the same colors with different properties or a totally new color space created by the user using information present in the figure[?]. In Table 3.2 some of the most well known color spaces are identified and characterized. 1This figure is taken from http://imgbuddy.com/blood-smear-staining.asp 13 Literature review Table 3.2: Different types of color spaces color space characteristics RGB This is one of most common color spaces, each color is represented by the sum of the red,green and blue colors HSV In this color space each color is represented by the hue, saturation, and value(or brightness) GRAY In this color space every color is represented by a gray-scale color, generally is used to simplify the figure LAB In this color space every color is represented by lightness and a and b coordinate for the color-opponent dimension CMY It represents the 3 links used in color printing: cyan, magenta and yellow CMYK It represents the 4 links used in color printing: cyan, magenta, yellow and black As said before the user can also create their own color space this can be reached by either changing the components from an existent color space, or by using many different channels to create an figure, making the identification of the different components of the figure easier. An example of a created color space could be an gray-scale figure where the pixel value is calculated by subtracting the RGB channel Red to the sum of the Blue and Green channels, this would create figure where only the components that have a red color component inferior to the sum of the other two would be shown, and the brighter components would be the ones where the red component is minor compared to the other two. This step can also be used as an intermediate step in the color segmentation algorithms being applied generally to a copy of the figure to allow the selection of component existent in the figure. 3.1.2 Segmentation The segmentation is the process of dividing the figure into multiple smaller segments. The objective is to simplify and change the representation of an figure into something easier to analyze. In our current problem that would be dividing the background, foreground and its elements that represent the many constituents of the blood smear, later they can be identified individually in the classification phase using the features extracted. Segmentation algorithms are generally based in two image properties: intensity values discontinuity and similarity. The first spots different segments by detecting the abrupt changes between them like the color and brightness change of a group of pixels. The second category finds different segments by encountering similar groups of pixels.[AaKK10] 14 Literature review 3.1.2.1 Using the difference between color channels This method uses the difference in the color channels of the image color space to remove the majority of the background and some elements of the foreground that are not the desired object. In the first step of this segmentation algorithm the figure is separated in different sub-figures, which one representing the presence of a channel in the original figure, the darker the pixel the weaker is the value of the represented channel in that pixel[SMUCBLRP13]. This step can be applied to many different color spaces like the RGB, HSV, LAB and CMYK, for explanation proposes the example below will be in a RGB color space. (a) Original figure 2(b) Red channel (c) Green channel (d) Blue channel Figure 3.2: Representation of RGB figure In Figure 3.2, the parasite positioned in the center of the figure is mainly red and blue the green channel is weaker and the intensity of the background in the 3 channels is almost the same. So, by taking advantage of these differences, and computing the difference between the blue and green channels some information of the figure can be retrieved. The result of this operation is the figure 3.3a where the background is dark and the parasite and some unwanted subsets are lighter[SMUCBLRP13]. To improve the result of the previous operation a color threshold following the formula below should be applied. f(n) =    white if | Blue-Green |> T black otherwise 2This figure is taken from http://imgbuddy.com/blood-smear-staining.asp 15 Literature review The last step divides the figure in two different colors, black and white, using a value T to decide each pixel value, if the value of the pixel is greater than T the pixel is white otherwise is black. In the figure 3.3b the white region represents the wanted component (the parasite) and some unwanted subsets such as blood cells and platelets that can be removed later in other segmentation steps. The figure 3.3b represents the result of the threshold operation with the T value at 50 in a range of intensity between 0 (black)and 255(white). The final result is figure 3.3c where only the white areas of the figure are maintained in the original picture[SMUCBLRP13]. (a) Difference between blue and green channels (b) Figure 3.3a with Threshold of t=50 (c) Final result of combine figure 3.3b with figure 3.2a Figure 3.3: Channel subtraction process 3.1.2.2 Background subtraction This algorithm separates the background and foreground of the figure using a representation of the background alone, the objective is to remove the parts of the figure that are similar to the represented background, the result would be identical to the figure 3.3c. This method is not as flexible as the one in the section 3.1.2.1 but it is fast and reliable to remove the background of a figure, the biggest problem is that the background of the figures suffering the process must always be equal to background to be subtracted or the algorithm will fail[KCHD05]. 3.1.2.3 Area threshold This method works by comparing the size of the objects in the figure, the objective is to remove the objects that are bigger and smaller than the desired element.It is generally applied in a black and white figure so that it is easier to know the borders and consequently the size of the objects, for example using figure 3.3b of the chapter 3.1.2.1 we could calculate the size of each white area and apply the algorithm[SMUCBLRP13]. f(n) =    white Area =< T and Area > t black otherwise First, the size of each set of pixels with similar information are counted giving the area of the object or element present in the figure, later if the area is bigger than t (minimum threshold) 16 Literature review and smaller than T (maximum threshold) the object will appear in the mask otherwise it will be ignored and absent in the mask. (a) After maximum threshold (b) After minimum threshold Figure 3.4: Area threshold As we can see in the figure 3.4b the results of this algorithm are promising, the number of objects to be analyzed are greatly reduced and because of that the overall performance will increase, but it also has a big problem, the variables T and t, if the values of the minimum and the maximum threshold are incorrect the object we want to find can also be deleted creating problems for the rest of the program and leading to the creation of false negative results. 3.1.2.4 Split-and-Merge (a) Initial figure to be divided in sub-figures (b) Division of the figure into smaller quarters (c) Division of the yellow quarter in quarters (d) Division of the green and yellow quarter (e) Final result Figure 3.5: Split and merge process 17 Literature review This is a simple method that divides the figure in many different sub-figures. This algorithm starts by dividing the initial figure in four different quarters (figure 3.5b), after that the program will test them with the predicate. In the predicate the color present in the quarters is tested, if the quarter has a big variation of color inside of it, then it is divided again in more quarters (figure 3.5d), otherwise the division does not occur and instead of it if the neighbours quarters have a similar color are merged(figure 3.5e). This phase is repeated until every segment as a similar color inside of it and division is not possible[KG08]. In the end the result of this algorithm is an figure divided by its color variance, changing if the color space was altered in the preprocessing phase. 3.1.2.5 Watershed Watershed is a group of algorithms that separate the figure in sub-figures by detecting the color difference between areas, all of them start in the same way, first the gray figure is converted to an intensity gradient magnitude of an figure, this gradient will look like a topographic surface, and will have maximums and minimums created by clearer and darker intensities[CHYL09]. The watersheds algorithms are divided in: •flooding algorithm:This algorithm finds the separations of the sub-figures by "flooding" the minimum points of the intensity gradient, when different water sources meet a separation of the figures is created, the resulting group of separations are all the lines where the figures is divided. •rainfall algorithm:in this algorithm "raindrops" are placed in each pixel of the figure, the raindrop will flow to a local minimum using gradient descent, all the pixels with the same minimum are part of the same sub-figure. Figure 3.6: Example of figure gradient 3 The watershed algorithm has problems with noise, conducting to over-segmentation of areas, to reduce that risk a blur algorithm(chapter 3.1.1.1) should be used before the operation[CHYL09]. 3This figure is taken from http://photos1.blogger.com/blogger/3551/3073/320/Reliefimg.jpg 18 Literature review 3.1.2.6 Mean-shift The mean-shift algorithm is an advanced and versatile technique for clustering based segmentation that divides the figure in sub-figures modeling feature vectors associated with each pixel(color,position) with a density function. After the creation of a 2d space of the points with the density function, the algorithm for each pixel will: •create a search window:This window can be rectangular or circular and includes many different pixels, and it will be positioned in the figure. •calculate the mass center of the window:in this stage using the density function of the pixels the figure will calculate the mass center of them. •move window to mass center:after the last step the center of the window is positioned in the mass center moving the window to a denser group. •return to second step: this will happen until the center of the window is the same as the mass center. The objective is to associate the many pixels to a denser area, and with them create a subfigure. This algorithm is considered efficient and robust but its results depends on the density function used[Ngu]. 3.1.3 Feature extraction Feature extraction is one of the most important step to resolving successfully an object recognition problem, from the resulting features of its appliance to the classification systems (chapter 3.1.4) will be trained and if the wrong type of features are chosen the classification will, consequently, fail in the identification of the parasite creating false positive and negative results. 3.1.3.1 Using color histogram A color histogram is a representation of the quantity of pixels of each color present in the figure, it can be built for many color representations, like HSV, RGB and YCM. To help the explanation the RGB color space will be used, to use this type of histogram, first the figure must be divided in the 3 channels and its intensity sub-histograms must be extracted, the final results represent the distribution of the color in the figure. For example, looking at figure 3.7 we come to the conclusion that the figure has not many pixels with strong blue and green channels. This type of features are good for identification of an object that has always similar color distribution otherwise if the object can appear with many different colors, or is identified in places where the lightning changes its color value then the use of this features causes incorrect results and must be avoided [SB91]. 19 Literature review Figure 3.7: RGB color histogram 3.1.3.2 Hu moments Hu moments are features derivated from algebraic combinations of the first 3 orders of normalized central moments, describing, characterizing, and quantifying the shape of an object in an figure[Li10]. Hu Moments are normally extracted from the silhouette or outline of an object in an figure, extracting a shape feature vector (i.e. a list of numbers) to represent the shape of the object[Li10]. Later that feature vector will be compared to others to find if the objects are the same. In the end this type of features fails to identify objects whose shape can change in different figures creating problems in the classification phase. 3.1.3.3 Color correlogram The color correlogram (henceforth correlogram) can be seen as an extended colour histogram, it expresses how the spatial correlation of pairs of colors changes with distance. Informally a color correlogram of and figure is a table where each entry represents the probability of finding a pixel of color j at a distance k from a pixel of color i in the figure[JKM+94]. This type of features is robust, tolerating changes in the viewing positions, changes in background,partial occlusions, camera zoom and are a good solution for problems of figure recognition, but has the same problem as Hu Moments, objects which the shape is not constant can not be correctly identified[JKM+94]. 3.1.3.4 SIFT Scale-invariant feature transform is an algorithm that detects and extracts the local features of an figure, that features are scale, rotation and brightness invariant[Low99]. The SIFT algorithm can be divided in many stages: •Detection: In this stage the algorithm identifies the interest points of the figure, for that, features like corners and edges of the figure are separated and detected. First Lowe’s method transforms the figure in a matrix of feature vectors, is this part that makes the features invariant.Then key locations are found by the difference of gaussians founding the best local features. •Description:After the last step the features are extracted, indexed and saved. •Matching: In the last stage of the algorithm, the saved points are compared to the points of the figure. To improve the matching of points the euclidean distance can be used. 20 Literature review 3.1.4 Classification In this phase the program, using the information retrieved by the segmentation and feature extraction phase learns what an object is, and later can identify it. 3.1.4.1 K-nearest neighbours In object recognition, the k-Nearest Neighbours algorithm is a machine learning method used for classification of objects. In the KNN algorithm the objects are evaluated by comparing with other objects that were learned by it, this algorithm is also known as a lazy algorithm[K-n]. The algorithm is divided in two parts: learning and classification, in the first one a group of figures and their respective features (see chapter 3.1.3) are given to the algorithm and their classification, with that information the algorithm will create a representation of the needed groups in a 2d feature space (figure 3.8a, where the green triangles and the red circles represent different groups). In the second stage, classification, an figure is evaluated by the algorithm using the model established previously, in this phase the features of the evaluated figure is compared to the others that were given in the previous step and then the figure is placed on the 2d space, from there the algorithm will find the K closest figures (figure 3.8b, where blue quad is the new figure), in the end the algorithm chooses the class of the figure by seeing the classes of the closest points and going with the majority (figure 3.8b). (a) End of learning stage KNN (b) Beginning of classification stage KNN,k=3 (c) End of classification stage Figure 3.8: KNN process This algorithm is robust and works well with big quantities of data being a good solution to the problem of classifying a big quantity of different objects its biggest problem is the definition of the parameter K and its high computational cost[K-n]. 3.1.4.2 Support Vector Machine The support vector machine is a supervised learning model that classifies an figure as being one of two classes.This algorithm receives a group of figures, maps them in a 2D space using their features and then tries to find a function that translates the general rule of the figures (figure 3.9), 21 Literature review 28 Chapter 4 Implementation 4.1 Image Dataset In this section the figure requirements and figure acquisition methods used in the program will be explained. 4.1.1 Image Dataset Requirements The figures to be used in the project must follow the requirements: •The blood smear must be prepared by a specialized doctor; •The blood smear figures should be acquired with 1000X magnification stained with giemsa; •The blood smear figure should be acquired with a low-cost commercial microscope or with Fraunhofer microstage prototype that can automatically take pictures of samples; 4.1.2 Image acquisition The acquisition of figures of blood smears infected with trypanosomas was achieved by photographing existent samples in Fraunhofer AICOS prior to the start of the project. The blood smears were photographed by attaching smart-phones like samsung S5, asus zenfone2 and htc, that have a good camera resolution to a microscope using an adapter or to fraunhofer microstage prototype. The figures acquired are in .jpg format, with many different resolutions. 4.2 Preprocessing Preprocessing techniques are used before the segmentation phase in order to assure that the figure satisfies certain assumptions and to improve the overall performance of the next phases. 29 Implementation 4.2.1 Image cropping The first step taken to improve the program’s performance and the final result was a cropping of the figure given to it. The objective is to reduce the information to be processed by the program but maintain the good results, to achieve that first the area of interest of the figure must be detected. Generally this area is circular, lighter and has many small elements that will be analyzed by the program (see fig 4.1a). To detect the ROI (region of interest) first a copy of the figure is converted to a gray/scale figure, then the figure is blurred multiple times using a median blur with a windows size that follows the formula: Window =   IW/WF IW >= IH IH/WF IW < IH Where IW and IH are the original figure width and height respectively, and the WF is the window factor a constant with value 80. This value was achieved by test and observation of different values and their respective result. The result from the last step is an figure where the majority of the components are blurry and blended with the background of the region of interest. The next step is an Otsu threshold that will create a mask that separates the background and foreground of the figure, the objective of this method is to remove the rest of the components that did not blend with the background, for that, if one or more components are detected they will be removed using a flood fill for each of them that starts in the central point, the final result will be similar to the figure 4.1b. (a) Original figure (b) ROI mask (c) Cropped figure Figure 4.1: Crop process After getting the mask from the previous steps that identifies the ROI of the original figure (fig. 4.1b) a new smaller figure is created by cropping the original figure to the width and height space of the white region within the created mask (fig. 4.1c ). 4.3 Segmentation Segmentation is the process of dividing the given figure to multiple segments that include or not relevant information, the objective is to separate these segments and get the information relevant 30 Implementation to the resolution of problem. The result must be some type of figure that assigns a label to each pixel and where pixels with the same label share some type of characteristic. In this program the segmentation is divided in three big steps: determining aperture diameter, color and area segmentation. The objective of theses steps is to create a mask that include components with similar characteristics to the parasites to be detected in the figure. 4.3.1 Determining the aperture diameter This is the first step of the segmentation, and its objective its not to change the figure or the information in with but to get the diameter of the microscope aperture. This information will be used in the next steps of the segmentation that depend on the size of the of the figure. The diameter is calculated by counting the number of white pixels in each row and column in the mask of the pre-processing step (fig. 4.1b) and choosing the highest count. The previous calculation is needed as a fail-safe for the possible misalignment of the ROI in the figure. 4.3.2 Color segmentation using LAB color space (a) Original figure (b) Channel l (c) Channel a with contrast enhancement (d) Channel b Figure 4.2: Lab channels of the figure 31 Implementation The objective of this segmentation algorithm is to create a starting mask that separates the background and the foreground of the blood smear, the second includes the trypanosomes and other elements. In order to achieve the objective established in the paragraph above a copy of the figure is converted to the lab color space and its channels are separated in different figures. Later the contrast of the channel "a" is improved by the use of a CLAHE with a clip limit of 4(figure 4.2). In the end the difference between the channels b and a with improved contrast will be calculated and a gray-scale figure will be created where the lighter areas symbolize the locals with the biggest difference between the channels (fig. 4.3a). (a) Difference between channel a and b (b) Result from Adaptive threshold Figure 4.3: Result from Color segmentation The last step is an adaptive mean threshold (Figure 4.3b) that uses a different window size according to the aperture diameter by using the formula: WindowSize =9∗diameter 362 The constant 9/362 was reached after testing and observing the results of different window sizes in figures with different resolutions. In the color segmentation, spaces like HSV and RGB were tested but shown worst result than lab, the only result similar to the figure 4.3a has been the subtraction of the channels blue and green of the RGB color space, but the mask has more unwanted elements than its lab color space contra-part. The improvement of the contrast of the channel "a" in the lab color space was also thought after observation of the results of different contrast enhancement techniques on all the channels of the figure. The conclusions of this experiment was that the channel that possessed the best information was the "a" channel and that if not exaggerated the improvement of its contrast could improve the overall result of the program. The consequence from making the contrast process too strong was the appearance of extra non-parasites elements in the mask generated that would make the program slower and its results worse. 32 Implementation 4.3.3 Area threshold As we can see in Figure 4.3b the result is a mask that includes not only the parasites but other components many of them identified by the difference in size and form. This segmentation step aims to resolve part of that problem by using the mask generated in the color segmentation. The algorithm will detect all the white objects in the figure using blob detection algorithms and store them in a vector. Later the area of the detected blobs is calculated in pixels and compared with a value that is considered the minimum value of the area of the parasite if the area of the blob is smaller than the minimum area then that blob is removed from the mask. The formula to reach the value of the minimum area threshold is: MA =5/11∗D Where D is the diameter of the focal aperture that is discovered in the first step of the segmentation, the objective of this formula is to adapt the minimum area to the resolution of the figure given. For example, if an figure has lower resolution the areas of the blobs will be lower due to the lower number of pixels in total in the figure, but because of the same reason the focal diameter will also be smaller reducing, consequently, the minimum area. The 5/11 constant was reached by observation of different area values in figures with different aperture diameters, from that a rule was extracted and tested again in the same figures with the original resolution and different resolutions to see if the results were similar. (a) Mask from color segmentation (b) Result from area threshold Figure 4.4: Result from Area segmentation 4.4 Features A feature is a piece of information used to resolve computational problems, in figure processing this features can be structures of the component like points, edges or objects, or general information about the object like its color, geometry and texture. This information in the classification phase of an object recognition problem is used to identify and separate objects in groups influencing the result of the classification phase. 33 Implementation In these project to detect and extract features from each object of the segmented mask a library called "TCGFE" was used. This library was created at Fraunhofer AICOS for a previous company project called MalariaScope, and was provided in order to improve the overall classification process. The "TCGFE" uses a mask and the original figure and generates from there 152 normalized features that can be divided in 3 major groups: texture,color and geometry features (Table 4.1). In the end the library creates a matrix with all the information and outputs it to a .csv and a .yml file, later this information will be used as intermediate step in the classification phase.[RCEc16] Table 4.1: TCGFE features Group Family Channels Features Geometry Binary Area, Maximum Diameter, Minimum Diameter, Perimeter, Convex Hull Area,Solidity, Elongation Bounding Box Area, Extent, Equivalent Diameter, Circularity,Elliptical Symmetry, Radial Variance, Compactness Index, Principal Axis Ratio, Bounding Box Ratio,Irregularity Indexes, Eccentricity, Asymmetry Indexes, Asymmetry Ratios, Lengthening Index, Asymmetry Celebi Color C* and h (from L*C*h) Energy, Mean, Standard Deviation, Entropy, Skewness, Kurtosis,L1 Norm, L2 Normb Texture DFT Grayscale Mean, Standard Deviation, Minimum, Maximum GLRM Grayscale Short run emphasis , Long run emphasis , Grey level non-uniformity ,Run percentage , Low grey level runs emphasis , High grey level runs emphasis , Short run low grey level emphasis , Short run high grey level emphasis , Long run low grey level emphasis , Long run high grey level emphasis GLCM R,G,B (from RGB) Energy, Entropy, Contrast, Dissimilarity, Homogeneity, Correlation, Maximum probability Laplacian Grayscale Mean, Standard Deviation, Minimum, Maximum The classification is the last step of the program and one of the most important. This step is responsible for the classification of the components detected in the segmentation giving the final verdict about the identity of the component.To make a decision, first a classifier must be created and trained creating a model that identifies the wanted object using a group of features like geometric, color and textures features. After the training, the program must be tested to assure that the model created is the correct one and to know the accuracy of the classification. In the end if the classification was well trained then it can be used to label all the segmented objects as being part of a group. The classification in this program will try to group the segmented components between parasites and non-parasites, then the last group will be removed returning a mask where all the components are parasites. 34 Implementation To improve the performance and efficacy of the classifier to be used in the project a second smaller program was created to help with the training and testing of different classification models. This program uses two distinct groups of figures to train and test the various classification models. In the end the program will return a .xml file of the trained model to be used in the project and a .txt file with the results of the test phase. In the next sub-chapters the training and test phase of the smaller program and the use of the classification in the project will be explained. The results of the test phase and, consequently, the chosen model will also be explained. 4.5 Classification 4.5.1 Classification training In this sub-section, the classification training stage is presented.This step aims to find patterns from features extracted and, using them, build a model that can identify the trypanossomes in the thin blood smear figures (Figure 4.7). The classification algorithms used to train the models were SVM, decision tree, boosted decision tree, random forest and KNN. The first four algorithms are part of the supervised learning methods, and the last one is the unique unsupervised learning method tested in this project. Some of the classification algorithms used can be optimized by changing the parameters and features utilized to train them.The processes required for each learning algorithm are summarized in Table 4.2. Table 4.2: Classification algorithms Classifier Optimization Feature selection Supervised learning SVM yes no Decision tree yes no Boosted decision tree yes no Random forest yes no KNN yes yes To train the classification a group of blood smear figures were selected and then marked with the help of an expert from Instituto de Higiene e Medicina Tropical, giving result to three figures: the original (and unmodified) figure used to extract the features and the existent components in the sample and the negative and positive figures where the respective components of the same figure are marked with green quads(Figure 4.5). This marking of the figures make it easier to change, remove or add figures to the process making it more dynamic. 35 Implementation (a) Original figure (b) Positive Image (c) Negative Image Figure 4.5: Resulting figures of the marking process After reading the three figures mentioned above the program uses the segmentation step to create a mask from the original figure that will have all the components. The program also creates a positive and negative mask from the green quads present in the other two figures where the white filled quads represent the area of interest. Later the final positive and negative mask are created by using an "and" operation between the segmentation mask and the mask generated by the green quads in the positive and negative figures containing the parasites and the non-parasites elements respectively. (a) Mask (b) Positive Mask (c) Negative Mask Figure 4.6: Resulting figures of the marking process After the creation of the final negative and positive mask the features will be extracted, labeled and prepared to be used in the train phase of the classification algorithms. All the features of the negative mask are labeled as -1 (not the parasite) otherwise if their origin is the positive mask they are labeled 1 (parasite). The previous steps are repeated until all the marked figures are analyzed and their features labeled and extracted creating a .csv and .yml files with all the information processed. The generated files are used in the last step of the training phase that involves the creation of the classification model, that is saved to .xml file to be used later in the project to identify the parasites and in the test phase of the classification phase. In the end, the training phase was done with 400 positive components (parasites) and 800 negative elements (non parasites), these numbers are not balanced because of the quantity of elements existent in each blood sample. An attempt to balance this number could increase the false positive results of the classifier. 36 Implementation Figure 4.7: Learning phase of the program 4.5.2 Classification testing In this sub-section, the classification test stage is explained. This step aims to test and validate the classification models created previously allowing to understand which better identifies the parasite in the thin blood smear figures (Figure 4.8). 37 Implementation 44 Chapter 5 Validation of the mobile application In this chapter the results of the previously created computer vision methodology will be tested with a group of figures and some metrics will be extracted. The objective is to understand how different figures can change the different metrics of the program.To achieve that a group of ten figure named amX, where X is the number of the figure, were used to test the program and their results saved. 5.1 Execution time In this section the time metric of the created methodology that identifies and counts the trypanosomes in the figures will be calculated and discussed. Thus for better results the program was tested with ten figures in three different devices: •Computer: the C++ version of the methodology was tested in a 64 bit Linux computer, with 8 GB RAM and an Intel core i7-3770S processor with frequency of 3.10 GHz; •Asus zenfone 2: the converted methodology was run in this mobile phone, with 4 GB RAM and an Atom Z3580-Quad core processor with a frequency of 2.33 GHz; •Samsung Google Galaxy Nexus I9250: This smart-phone executed the converted methodology, its specifications include 1 GB RAM and a Dual-core cortex-A9 processor with 1.2 GHz of frequency; The devices above have a big range of specifications and their use will help to understand better the generated results. To get a more complete analysis of the time length of the process the time metrics were divided in three groups: the preprocessing plus segmentation duration, the features extraction plus classification duration and the total duration of the methodology. The Tables 5.1, 5.2 and 5.3 show the duration in seconds of the methodology with the ten figures around the three devices and an average of the results. 45 Validation of the mobile application Table 5.1: Process duration on a computer Image preprocessing + segmentation duration (seconds) features extraction + classification duration (seconds) total duration (seconds) am1 5.66 12.22 17.88 am2 5.27 7.32 12.59 am3 5.28 20.72 26 am4 5.37 13.33 18.70 am5 5.41 16.18 21.59 am6 5.38 15.55 20.93 am7 2.17 9.25 11.42 am8 2.31 11.59 13.90 am9 2.13 4.21 6.34 am10 5.34 11.77 17.11 average 4.43 12.22 16.65 Table 5.2: Process duration on an Asus Zenfone 2 Image preprocessing + segmentation duration (seconds) features extraction + classification duration (seconds) total duration (seconds) am1 7.59 27.46 35.05 am2 7.22 17.31 24.53 am3 7.12 43.90 51.02 am4 7.19 30.76 37.95 am5 7.53 36.10 43.63 am6 7.22 34.56 41.78 am7 2.89 16.29 19.18 am8 3.06 21.03 24.09 am9 2.83 6.92 9.75 am10 7.59 25.04 32.63 average 6.02 25.94 31.96 46 Validation of the mobile application Table 5.3: Process duration on a galaxy nexus Image preprocessing + segmentation duration (seconds) features extraction + classification duration (seconds) total duration (seconds) am1 29.37 72.20 101.57 am2 27.70 36.54 64.24 am3 28.01 108.09 136.10 am4 27.54 79.66 107.20 am5 27.79 93.77 121.56 am6 27.69 86.34 114.03 am7 10.59 38.36 48.95 am8 11.48 52.31 63.79 am9 10.50 16.10 26.60 am10 28.41 64.65 93.06 average 22.91 64.80 87.71 In general, the preprocessing and the segmentation phases are faster than the feature extraction and classification phases in all the three tested devices due to the duration of the feature extraction that happens in the classification phase. The specifications can make a big difference in the duration of the method, computers generally have better specifications and are, consequently, faster but they stray away of the objective, a portable solution. For that the two mobile phones were tested, the method duration was longer than in the computer but still considered good. In the results big variations of the preprocessing and segmentation duration can be seen in the figures am7, am8 and am9 compared to the rest, this happens because of the differences in color of these figures compared to the rest, this makes the segmentation faster due to the fact that the first step of the segmentation (color segmentation) creates a smaller mask (with less components) and the following steps like the area threshold are faster. The variation of duration also happens in the features extraction and classification phase due to the size of the segmented mask, a bigger mask will have more elements detected. The features must be extracted from each element detected and used to classify them. With this we can say that blood samples with a big quantity of parasites will be slower than a sample without parasites. 47 Validation of the mobile application (a) am1 (b) am9 Figure 5.1: Image example 5.2 Results In this sections the results of the execution of the program in the ten figures are presented and discussed. After running the program in a mobile device the results were: Table 5.4: Results of the program Image detected parasites false positives false negative am1 40 1 0 am2 22 1 0 am3 55 0 0 am4 41 1 1 am5 47 1 0 am6 47 2 1 am7 60 6 3 am8 66 4 1 am9 31 2 3 am10 36 1 3 total 445 19 12 Given the results in Table 5.4, the sensibility of the total of the figures can be calculated:97.37% this result is not too different from the one in the section 4.5.3, the difference in the results can be due to the use of different figures in smaller quantity. Other conclusion reached from the observation of this test was the fact that some groups of parasites are counted as one parasite, this happen due to the fact that the segmentation is unable to understand where the body of one stops and the other starts. Other problem detected is that sometimes the segmentation detects part of the background together with elements of the figure, but this one is corrected in the classification phase that treats the background as other element to be tested. 48 Chapter 6 Conclusions and future work Nowadays one of the most common diagnostic test of the diseases are the analysis of blood samples. This type of test generally is made by identifying and counting certain types of structures present in the blood, making it a strong candidate to be automatized and improved. This led to the creation of this project that has as objective to analyze blood samples and to try to discover trypanossomes to know if the patient is infected, not only the solution must be automated but also portable being aimed to android portable devices. Interest in computer vision approaches as better alternatives to time-consuming diagnostics has been growing. The biggest problem of this approach is the need of high quality figures to apply the processing methodology and its performance in the mobile devices that generally are less powerful than computers. Thus, a literature review has been done and some relevant information was acquired, like a group of method that could be used and adapted to resolve the problem at hand in an efficient way. The primary objective of this project was to create a computer vision methodology that could detect trypanossomes in an efficient way.The proposed solution was divided in four phases, preprocessing, segmentation, feature extraction and classification. In the preprocessing phase a simple crop is applied in the figure in order to eliminate some irrelevant information. The segmentation follows the preprocessing by segmenting the figure by color and area. And this classification and feature extraction work together to classify the detected elements using the TCGFE library and a KNN. Future improvements of the project should focus on the improvement segmentation phase by better detecting the limits of each figure component and avoiding situation where a cluster of parasites is detected as one entity. In the end, the creation of the prototype of the mobile application could be seen as a successful starting point, being the future work in this application aimed to improve the overall speed of the analysis of each blood sample. 49 Conclusions and future work 50 References [AaKK10] Salem Saleh Al-amri, N V Kalyankar, and S D Khamitkar. Image Segmentation by Using Threshod Techniques. Journal of Computing, 2(5):83–86, 2010. [ABO] About | opencv. http://opencv.org/about.html. (Accessed on 06/27/2016). [Ath] Athelas | yc hacks. http://ychacks.devpost.com/submissions/ 25781-athelas/. (Accessed on 02/04/2016). [CDCa] Cdc - african trypanosomiasis. http://www.cdc.gov/parasites/ sleepingsickness/. (Accessed on 02/02/2016). [CDCb] Cdc - chagas disease. http://www.cdc.gov/parasites/chagas/. (Accessed on 02/02/2016). [CHA] Who | chagas disease. http://www.who.int/topics/chagas_ disease/en/. (Accessed on 02/01/2016). [CHYL09] Cheng Chieh Chiang, Yi Ping Hung, Hsuan Yang, and Greg C. Lee. Regionbased image retrieval using color-size features of watershed regions. Journal of Visual Communication and Image Representation, 20(3):167–177, 2009. [Col] Smartphone, finger prick, 15 minutes, diagnosis—done! | the fu foundation school of engineering & applied science - columbia university. http://engineering.columbia.edu/ smartphone-finger-prick-15-minutes-diagnosis%E2%80% 94done-0?utm_content=buffer2cf71&utm_medium=social& utm_source=twitter.com&utm_campaign=buffer. (Accessed on 02/04/2016). [CV95] Corinna Cortes and Vladimir Vapnik. Support vector machine. Machine learning, 20(3):273–297, 1995. [eme] Chagas disease (american trypanosomiasis): Background, pathophysiology, epidemiology. http://emedicine.medscape.com/article/ 214581-overview. (Accessed on 06/02/2016). [Fas] Fastcv computer vision sdk - qualcomm developer network. https: //developer.qualcomm.com/software/fastcv-sdk. (Accessed on 06/27/2016). [iPh] iphone microscope camera adapter | skylight. http://www. skylightscope.com/. (Accessed on 06/27/2016). 51 REFERENCES [JKM+94] Jing Huang, S.R. Kumar, Mandar Mitra, Wei-Jing Zhu, and Ramin Zabih. Image indexing using color correlograms. In Proceedings of IEEE Computer Society Conference on Computer Vision and Pattern Recognition, volume 191, pages 762–768, 1994. [K-n] K-nearest neighbor. http://www.scholarpedia.org/article/ K-nearest_neighbor#Classification_decision_rule_and_ confusion_matrix. (Accessed on 06/21/2016). [KCHD05] Kyungnam Kim, Thanarat H. Chalidabhongse, David Harwood, and Larry Davis. Real-time foreground-background segmentation using codebook model. Real-Time Imaging, 11(3):172–185, 2005. [KG08] Deepali Kelkar and Surendra Gupta. Improved quadtree method for split merge image segmentation. In Proceedings - 1st International Conference on Emerging Trends in Engineering and Technology, ICETET 2008, pages 44–47, 2008. [Kri14] Scott Krig. Image pre-processing. In Computer Vision Metrics, pages 39–83. Springer, 2014. [Leu07] K Ming Leung. Naive bayesian classifier, 2007. [Li10] Dongguang Li. Analysis of moment invariants on image scaling and rotation. In Innovations in Computing Sciences and Software Engineering, pages 415–419, 2010. [Low99] David G Lowe. Object recognition from local scale-invariant features. In Computer vision, 1999. The proceedings of the seventh IEEE international conference on, volume 2, pages 1150–1157. Ieee, 1999. [Mal] Malaria scope. http://www.fraunhofer.pt/en/fraunhofer_ aicos/projects/internal_research/malaria-scope.html. (Accessed on 02/02/2016). [Mic] Microstage - motorized microscope stage for smartphone. http://www.fraunhofer.pt/en/ fraunhofer_aicos/projects/academic_research/ microstage---motorized-microscope-stage-for-smartphone. html. (Accessed on 06/27/2016). [Ngu] Thu Huong Nguyen. Mean shift segmentation. [RCEc16] Luis Rosado, Jose Manuel Costa, Dirk Elias, and Jaime cardoso. Automated detection of malaria parasites on thick blood smears via mobile devices. In Procedia Computer Science, page TBD, 2016. [SB91] Michael J Swain and Dana H Ballard. Color indexing. International journal of computer vision, 7(1):11–32, 1991. [SLE] Who | sleeping sickness. http://www.who.int/trypanosomiasis_ african/parasite/en/. (Accessed on 04/02/2016). 52 REFERENCES [SMUCBLRP13] Roger Soberanis-Mukul, Víctor Uc-Cetina, Carlos Brito-Loeza, and Hugo Ruiz-Piña. An automatic algorithm for the detection of Trypanosoma cruzi parasites in blood sample images. Computer Methods and Programs in Biomedicine, 112(3):633–639, 2013. 53