Part 1: Deep Learning and Food Identification
As a reminder, my research project involves finding a new way to automate the process of counting colony-forming units (CFUs) found on contact plates. For this project, I will be exploring the potential of deep learning in classifying a valid bacteria colony, fungus growth, defects (such as air bubbles), etc etc. But what is deep learning you may ask?
My crude explanation for deep learning is that it veers away from the traditional way of creating computer programs. In short, we create a "step-by-step" process, or algorithm, which we use to perform a certain task. Deep learning on the other hand allows us to give data to a computer (such as an image database) and teach how to interpret the data (e.g. tell it what is in each image). When we then give it new data, the computer's trained model would be able to react accordingly. In short, we make the computer imitate the human mind when it comes to learning. The library that I'll be using for any deep learning need is "fast.ai." It is a robust library that allows for very easy manipulation of the syntax for my needs. Furthermore, I am following an amazing course on it by Jeremy Howard who has made the whole learning process much easier, considering the complex topic that is deep learning.
I've been doing most of my deep learning with Jupyter Notebook through jupyterlab, and through Google Colab if I require GPU power when I'm away from my desktop computer. Although it is very basic, I even made a model that can tell the difference between ice cream, pizza and cookies (most of the time)! Yes, I know a pizza isn't a dessert. It's my first model okay? I'll get better!
To simplify what's happening here, I'm loading a trained model (created in a separate notebook) that knows the difference between pizza, ice cream and cookies. Using that, I created an upload button which when given an image, runs the model and outputs a result with a confidence rating between 0 and 1. Despite the simplicity, it really helped to solidify the foundations of deep learning in my head.
Part 2: Image Processing with Threshold Masks
To make it easier for the computer to identify CFUs, pre-processing of the image of the contact plate is done. Pre-processing simply involves changing aspects of the image, such as brightness and contrast, to allow the CFUs on the plate to "stick out" more clearly in the picture. Using OpenCV, I've been experimenting with isolating bacteria colonies as shown in the images below.
As you can see, it's not 100% accurate and the mask profile that I'm using doesn't really work for all cases. But, it's a great start in the right direction.
So yeah! That has been my first/second week as an undergraduate researcher. Again, I'd like to thank the Laidlaw Foundation for giving me such an amazing opportunity. I hope you enjoyed the read! I'm thinking of actually creating a sort of "mini-series" where I make vlogs about my day to day process. While you wait for that though, make sure to keep up to date via my Instagram, @joeceengineering!
Again, thank you so much for reading and I'll see you in the next one!