Week 2

In week two at Epitech we were split into two main groups that involved the focus of computer science of which we were admitted into the program for. In my case, that focus is Machine Learning and Artificial Intelligence. We began the week by discussing the history of Artificial Intelligence and learning about how and where it originated. In that same day we were challenged to put our prior knowledge of python, neural networks, and machine learning external libraries to the test. We were asked to split up into two groups.

One group was assigned to create a captcha generator from scratch using prior knowledge and, of course, the internet as their primary resource. The second group (my group) was assigned to create a machine learning algorithm that could detect and uncover the captchas generated from that captcha generator, automatically. To do this we had to use libraries such as tensorflow, keras, and opencv. Because computers can not automatically read and output what an image is displaying, we decided to use Opencv, which is a library of programming functions mainly aimed at real-time computer vision. Our specific use for opencv was  to read an image and transcribe it to pixel values that could be more easily read by the computer. Keras was the neural network that we decided to implement because it is compatible with tensorflow and is made specifically for python machine learning. We then decided we would use Mnist (Modified National Institute of Standards and Technology) to train our model.

After training, we ran benchmarks and were able to produce a near-perfect machine learning captcha solver, with an accuracy of 98%, in a matter of hours. The missing two percent could be accounted for by the fact that it took us some time to revise our code so that even with the correct selection by the machine learning model, it was programmed correctly to output the designated answer.

After this introduction to machine learning, we were then split up into pairs of two and asked to think of how this method of machine learning could be utilized in the world today, and create a prototype. My partner and I decided to make our project a nutrient detector in food. It is a known fact that the color of food is strongly associated with the nutrients it contains. With this fact in mind, we thought that it would be interesting to be able to develop a program that analyzed food for its color and generated the nutritional facts based on what color it was. To do this we had to create a supervised machine learning model that detects colors in an image.

We used Opencv and the K-means clustering to facilitate this. We also used the matplot library to visualize what our data looked like in 3 dimensions, because it made things much easier to manipulate once we started analyzing various images of food. We retrieved our training data (thousands of images of food) from an open source data library. So far, we have managed to create a color detector by reading the image with opencv, outputting the data, which is an array of pixels in the form of RGB values, and using k-means to cluster that array and output the two most dominant colors in the image. As of now, our training data contains images that have only white backgrounds, which makes it easy to discard the white background color, leaving us with the single dominant color of the food.

As for next week, we plan on implementing SVM (Supervised Vector Machine) to classify those colors with the associated nutrient content information.

Leave a comment

Design a site like this with WordPress.com
Get started