When the Brazilian immunologist Helder Nakaya visited the Evandro Chagas Institute in Belém (the capital of the state of Pará, Brazil) in 2017, there was an uproar because one of its best microscopists retired and much of the knowledge was used for rapid and accurate identification of the protozoan Leishmania would be lost.
“I was appalled at the waste of losing all the expertise that it had taken decades to acquire. We started researching and trying to train a computer program to use this expert’s knowledge to identify microorganisms cheaply,” Nakaya told Agência FAPESP .
Five years later, a group of researchers led by Nakaya and the scientist Mauro César Cafundó de Morais published the results of a study showing that artificial intelligence can be used to detect Trypanosoma cruzi, the parasite that causes Chagas disease, in images of blood samples taken with a smartphone camera and analyzed with optical microscope.
The algorithm developed by the group is available from an article in the journal PeerJ.
“We got good results in this machine learning initiative. The algorithm works well for Chagas and can be adapted for other purposes that depend on images, such as analyzing samples of stool, skin and colposcopies,” said Nakaya, a principal investigator at the Center for Research on Inflammatory Diseases (CRID), a Research, Innovation and Dissemination Center (RIDC) funded by FAPESP and hosted by the University of São Paulo’s Ribeirão Preto Medical School (FMRP-USP). Nakaya is also a researcher at Albert Einstein Jewish Hospital (HIAE), Scientific Platform Pasteur-USP (SPPU) and Instituto Todos pela Saúde (ITpS).
One of the techniques used to diagnose Chagas is performed by microscopists trained to detect the parasite in blood samples. This requires a professional microscope that can be connected to a high-resolution camera, but the method tends to be too expensive and unaffordable for low-income patients.
Classified by the World Health Organization (WHO) as one of 20 neglected tropical diseases (NTDs), Chagas is a chronic infectious condition whose prevention requires control of its vectors, the triatomines (kissing bugs), and thus a response from public health services.
Endemic in 21 countries in the Americas, infection with the parasite Trypanosoma cruzi affects about 6 million people, with an annual incidence of 30,000 new cases in the region, leading to 14,000 deaths per year on average. About 70 million people are estimated to be at risk of contracting the disease because they live in areas exposed to triatomines.
Deaths from Chagas are on the decline in Brazil, yet they averaged 4,000 over the past decade.
Machine learning
The machine learning method developed by the researchers was based on a random forest algorithm trained to detect and count T. cruzi trypomastigotes in mobile phone images. Trypomastigotes are the extracellular form of the protozoa and the only stage that circulates in the bloodstream of patients with acute Chagas.
Images of blood smear samples taken with a camera capable of 12 megapixel resolution were analyzed to arrive at a set of features common to 1,314 parasites, including morphometric parameters (shape and size), color and texture.
In this part of the study, parasite specialists João Santana Silva, Paola Minoprio and Ricardo Gazzinelli trained the algorithm to recognize T. cruzi, assisted by machine learning and image processing specialists Roberto Marcondes César Jr. and Luciano da Fontoura Costa.
The features were divided into training and test sets and classified using the random forest algorithm. The resulting accuracy and sensitivity values were considered high (87.6% and 90.5%, respectively).
The researchers also analyzed the area under the receiver operating characteristic curve (AUC-ROC), a graphical representation widely used to assess diagnostic accuracy and optimal test cut-off. The result was 0.942, considered outstanding (the higher the area under the curve, the more accurate the test).
The authors conclude that automating the analysis of images acquired with a mobile device is a viable alternative to reduce costs and achieve efficiency in the use of the optical microscope. “The point is to generate images and analyze them under a microscope that can be sent to remote parts of Brazil. The app itself must tell whether it is images of the parasite that causes Chagas. It is therefore important to have a robust and affordable microscope that can collect the images automatically,” Nakaya said.
The algorithm is open software so the scientific community can contribute data and resources, he added, noting that getting a supply of cheap microscopes is a challenge.