Keerthan Krishnamoorthy
he/him | age 15 | Winnipeg, MB
Canada Wide Science Fair Intermediate Gold Medal | Canada Wide Science Fair Challenge Award for Digital Technology | Manitoba Schools Science Symposium Gold Medal
Edited by Pranav Khanolkar
Water is one of the most essential facets of human life, yet billions of people worldwide don't have access to safe drinking water. Harmful micro-organisms in contaminated drinking water can lead to several diseases and even death. Many current methods of detecting micro-organisms are generally bulky and require electricity as well as other resources which are not easily accessible in remote areas which are most affected by contaminated drinking water. This project aims to solve that problem by developing a deep learning-based mobile phone application and an inexpensive paper microscope. Using deep learning technology, the mobile application can quickly detect any harmful bacteria found in the water and subsequently alert the user.
INTRODUCTION
For the past several decades, various drinking water crises have griped parts of the world, endangering the most vulnerable people and countries. According to the World Health Organization, over 2 billion people around the world live in water-stressed conditions (WHO, 2019). While many people living in these in these conditions live in developing countries such as India or Yemen, the issue of unsafe drinking water also extends to developed countries. For instance, Canada, a country well known for its abundance of freshwater, still has several remote communities, such as indigenous reserves, which contain unsafe drinking water (Hofste et al., 2019). Water stress can entail water sources contaminated by faecal matter, micro-plastics, viruses, and several forms of bacteria and micro-organisms. These contaminants cause many diseases including diarrhoea, hepatitis A, and various others, leading to nearly a million water-contamination-related deaths annually (WHO, 2019). Pre-emptive detection of harmful micro-organisms and bacteria can serve as a warning system to prevent contaminated water consumption and potentially to save lives. Several current methods of analysing water, such as centrifugation (National Research Council, 1999) and faecal analysis (Cabral, 2010), require the use of expensive and bulky lab equipment, a consistent source of electricity, and other resources. Such equipment and resources are often not easily accessible in areas most affected by the crisis of contaminated drinking water.
This project’s goal is to create a relatively inexpensive, easily accessible, and reliable tool which gives people their own ability to analyse water samples and provide information about the micro-organisms found, with the aim to determine whether water from certain sources is suitable to drink.
PROCEDURE
To achieve this project's goal, a mobile application (app) which utilises deep learning technology was developed. A mobile app format was chosen because phones are capable tools which can be found even in remote areas. It is designed to be used in conjunction with an inexpensive paper microscope to enhance the zoom ability of a phone camera. The app analyses a picture of a water sample taken utilising the paper microscope, provides information of what it finds and suggestions of whether to proceed with drinking the water. A CNN is a deep learning neural network, designed for processing structured arrays of data (Wood, 2019). It was chosen because CNNs perform well in picking up patterns in data. Deep learning is the process where machines and algorithms develop artificial neural networks through trial and error, where rewards are given for correct guesses and penalties are given for wrong guesses (IBM Cloud Education, 2020). This combination makes a CNN the ideal choice for the image recognition done in this project.
The procedure for building the app followed four steps:
Data collection
The image data for training the neural network was provided by the Environmental Microorganism Dataset (Li et al., 2021) which contains 1,260 images of 21 classes of harmful and non-harmful micro-organisms found in water, including Euglena and Gonyaulax. The neural network was trained for both harmful and non-harmful micro-organisms to prevent false positives. The variety of the dataset was increased through data-augmentation of the dataset images, including rotations, zooms, and reflections. The data was split with an 80:20 ratio of training to testing data. As such, 1008 images were used for training the CNN and the remaining 252 images were used for testing the trained CNN.
Training
For training the CNN, a ResNet50 architecture was utilised. A ResNet50 architecture provides as it provided the best trade-off in terms of accuracy to time taken for training and because of its unique ability to form residual blocks or “skip connections” during the training process, which allows for speed-ups. This CNN was trained for image classification, where the neural network takes an image and classifies the objects that are recognised within it. The 1,008 pre-labelled training images, were used for training the neural network to learn characteristics that are distinctive to each class/label (e.g., Gonyaulax, Epistylis, etc.) The neural network was trained for a total of 15 epochs (training cycles), achieving an accuracy of approximately 93 percent [fig.1]. Other tools used for developing the neural network include libraries such as Tensorflow, Keras, and PyTorch.
App integration
Integration of the trained model into a mobile app required two steps. 1) Converting the trained model into one which could run on the relatively restrained capabilities of phone hardware, 2) Developing a mobile app utilizing the converted model and relevant APIs.
The trained model was converted into a lite version using tools within the TensorFlow library. By converting the model, benefits such as lower power usage and lower computational costs were achieved, making it ideal for a mobile phone integration. The mobile app was developed using the Android Gradle Plugin Library within the Android Studio IDE (Integrated Development Environment).
Paper microscope
The mobile app was designed to be used in conjunction with a paper microscope. In this project, the paper microscope was sourced from Foldscope Instruments. These paper microscopes are inexpensive and assist the phone camera by providing a zoom of approximately 140x. These are already in use in some locations to facilitate easy diagnosis of malaria, meaning there is already a delivery network, making it the ideal tool to take advantage of and utilise with the app.
The complete process of the mobile app is provided in Figure 2.
RESULTS
Evaluation of the prototype mobile app was done using the 20% of image dataset allocated to testing. As highlighted in Figure 3, the trained CNN model provided an accuracy of 93% with a loss of approximately 7% on the test data. The accuracy and loss percentage values were neural network's ratio of rewards (correct inferences) to penalties (incorrect inferences).
The results indicate that this method of detecting micro-organisms successfully achieved the goal of building a relatively inexpensive and reliable method of analysing water samples.
DISCUSSION
Testing of the prototype app on sample data has shown promising results. The importance of pre-emptively detecting harmful micro-organisms cannot be undermined. Detection of these micro-organisms before consumption can prevent millions of people from getting infected and succumbing to diseases. The method of using an app and an inexpensive paper microscope to detect micro-organisms could provide people who are most vulnerable to water contamination with an alternative method for detection which does not involve the use of expensive and bulky lab equipment. This will enable people to make more informed decisions about their drinking water and can motivate people to seek methods of accessing cleaner, safer drinking water.
The use of a smartphone app to analyse water samples will also provide users with a sense of control, as well as allowing multiple tests to be done repeatedly, which may not have been possible though the use of traditional lab equipment.
FUTURE DEVELOPMENTS
Future developments of this project include making the trained model more robust through collecting and utilizing more real-world data. Currently, I am contacting universities to collaborate with a lab to add more micro-organisms to the app’s database to make predictions more confident and increase variety.
CONCLUSION
This project was successfully achieved its goal of creating an easily accessible and inexpensive method of detecting micro-organisms in drinking water, through the development of a deep-learning-based mobile app, and inexpensive paper microscopes. This method gives the people most vulnerable to contaminated water in places without conventional lab setups and resources. An easily accessible way to make sure their drinking water is safe, reducing the risk of serious health complications from drinking contaminated water. If implemented, this technology has the direct potential to save lives by reducing the risk of serious health complications from drinking contaminated water.
ACKNOWLEDGEMENTS
First and foremost, I would like to thank my parents and teachers for supporting me by guiding me through any doubts, as well as inspiring me to work hard. This project could not have happened without your support.
I would also like to especially thank the Environmental Microorganism Dataset team for making their dataset publicly available.
REFERENCES
Cabral, J. P. S. (2010). Water Microbiology. Bacterial Pathogens and Water. International Journal of Environmental Research and Public Health, 7(10), 3657–3703. https://doi.org/10.3390/ijerph7103657
Hofste, R. W., Reig, P., & Schleifer, L. (2019). 17 Countries, Home to One-Quarter of the World’s Population, Face Extremely High Water Stress. Www.wri.org. https://www.wri.org/insights/17-countries-home-one-quarter-worlds-population-face-extremely-high-water-stress
IBM Cloud Education. (2020, May 1). What is Deep Learning? Www.ibm.com; IBM. https://www.ibm.com/cloud/learn/deep-learning
Li, Z., Li, C., Yao, Y., Zhang, J., Rahaman, M. M., Xu, H., Kulwa, F., Lu, B., Zhu, X., & Jiang, T. (2021). EMDS-5: Environmental Microorganism image dataset Fifth Version for multiple image analysis tasks. PLOS ONE, 16(5), e0250631. https://doi.org/10.1371/journal.pone.0250631
National Research Council. (1999). Identifying Future Drinking Water Contaminants. In nap.nationalacademies.org (pp. 173–205). National Academies Press. https://nap.nationalacademies.org/read/9595/chapter/11#184
Wood, T. (2019, May 17). Convolutional Neural Networks. DeepAI. https://deepai.org/machine-learning-glossary-and-terms/convolutional-neural-network
World Health Organization. (2019, June 14). Drinking-water. Who.int; World Health Organization: WHO. https://www.who.int/news-room/fact-sheets/detail/drinking-water
BIBLIOGRAPHY
7.6. Residual Networks (ResNet) — Dive into Deep Learning 0.14.3 documentation. (n.d.). D2l.ai. https://d2l.ai/chapter_convolutional-modern/resnet.html
Connor Shorten. (2019, January 24). Introduction to ResNets. Medium; Towards Data Science. https://towardsdatascience.com/introduction-to-resnets-c0a830a288a4
Microorganisms That May Be Found In Drinking Water. (2019). Mecknc.gov. https://www.mecknc.gov/HealthDepartment/EnvironmentalHealth/GWS/Pages/Learn%20About%20Contaminants.aspx
Reid, K. (2019, April 16). Global Water crisis: Facts, FAQs, and How to Help. World Vision. https://www.worldvision.org/clean-water-news-stories/global-water-crisis-facts
Team, K. (n.d.). Keras documentation: ResNet and ResNetV2. Keras.io. https://keras.io/api/applications/resnet/
World Health Organization (WHO), & United Nations Children’s Fund (UNICEF). (2021). Progress on household drinking water, sanitation and hygiene 2000-2020: Five years into the SDGs. https://washdata.org/sites/default/files/2021-07/jmp-2021-wash-households.pdf