Building an M&M Colour Classifier

Building an M&M Colour Classifier

In this tutorial, we'll learn Building an M&M Colour Classifier. It has nothing special that is used by experts around the world.

One of my third year Electronic and Electrical Engineering projects was to build a machine which can sort M&Ms according to their colour. The final version could sort approximately 47 sweets per minute, and won our team a few bottles of beers for our work.

Perhaps one day I will write an article detailing that process, but what I want to talk about today is the colour classification; how it classified sweets originally, and two years later, using my new-found data science knowledge to solve this problem. I’ve been using the test data as a proving ground for experimenting with various machine learning techniques as I learn them, so this blog aims to document my learning process.

The data was gathered by running M&Ms through the machine, jotting down the red, green and blue values the colour sensor returned, and logging the colour of the sweet. A long and tedious process indeed. The classification process was entirely manual; I examined where the clusters presided, and set up bounding boxes to classify sweets that fell inside them.

This was functional enough for an electronics project (and enough to win the beer), but it came with a host of problems with hacky workaround solutions.

To begin with, the machine had no idea how to deal with outliers — it would give the sweets a jiggle and rescan them, and if that didn’t work, it threw them in a waste bin. The shapes and orientations of the distributions were also not considered. This became problematic especially for red and orange sweets, as their bounding boxes intersected. If a sweet fell in the intersection region, the machine would jiggle and rescan until it fell into the exclusive red or orange boxes (the red box wins in this demo). The machine also hard classified sweets, which caused many red/orange mixups. Let’s look at the confusion matrix for this technique.

numpy python classification engineering machine-learning

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Hire Machine Learning Engineer | Offshore Machine Learning Experts

We are a Machine Learning Services provider offering custom AI solutions, Machine Learning as a service & deep learning solutions. Hire Machine Learning experts & build AI Chatbots, Neural networks, etc. 16+ yrs & 2500+ clients.

top 30 Python Tips and Tricks for Beginners

In this post, we'll learn top 30 Python Tips and Tricks for Beginners

Top Machine Learning Projects in Python For Beginners [2021] | upGrad blog

If you want to become a machine learning professional, you’d have to gain experience using its technologies and also by completing projects. Top Machine Learning Projects in Python For Beginners [2021]

Top Machine Learning Projects in Python For Beginners [2021]

If you want to become a machine learning professional, you’d have to gain experience using its technologies. The best way to do so is by completing projects. Take a look at this article and we will help you become an expert

5 Latest Technology Trends of Machine Learning for 2021

Check out the 5 latest technologies of machine learning trends to boost business growth in 2021 by considering the best version of digital development tools. It is the right time to accelerate user experience by bringing advancement in their lifestyle.