What's new

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

  • Hey Guest! Please turn off your adblocker to help us keep the community running. Thank you

This Machine learning Project will blow your mind.

Domain names for just 88 cents!


Sep 4, 2017
Port Harcourt
Knowing Artificial intelligence, Machine learning and data science is great.

But coming up with useful projects can be a bit tough.

Today’s guest, Michael Tesař, has done a lot of projects and he shares some of them with me.

my favourite is the colour recognizer program he wrote.

This program identifies the colour of objects placed near the webcam.

Here's a description of the machine learning project:

This is my neuronal network playground.

I began to learn some machine learning libraries for Python and I wanted to do some meaningful project. I mean, we all start with Iris flower and Mnist dataset. I desired to do as much as I could do by myself to understand what is under the hood in those example codes.

ColorRecognizer has only one goal, to identify the colour presented to a web camera. I use Python 3.6, OpenCV2 and Scikit-learn library under the macOS 10.13.

Idea is to connect web camera to GUI with OpenCV2 which is essentially pretty simple and straightforward. Then I calculate an average value for R, G, and B for my screen (height x width). One hook is that OpenCV2 uses BGR format, so you have to keep that in mind.

Each time you run the program, a new session is started with training dataset and trained model loaded into the system.

If you run it for the first time it will automatically build it for you.

Maybe you’re asking, how does the computer know which colour is which?

This is up to the user to teach it (since it is machine learning).

You have to annotate some frames with the colour. The user can do it by pressing keyboard (k for black, w for white, r for red etc.).

I have run about 1500 training sets and each time you close the app you also save your classification model and your annotation. It means it is basically smarter with every new session (in case you show something new to the computer).

Even though I use a very elementary algorithm called Decision Tree Model, you can see on demo video that is quite accurate when the screen is filled with some colour.

Here is a demo of the project below:
Currently, I am working on a new deep learning version to learn a bit from image processing with TensorFlow. This time I won’t compute the mean of R, G, and B value – eventually, the computer would learn by itself (i.e. we will only care about the main colour on screen).

It has its own limits in adding new colours. Every time you have to teach it manually. I mean, you have to tell it that we have a new colour, its name and show some samples. Since I use usual web camera, I cannot recognize smaller nuances in colours due to lighting, brightness and saturation setup. It still has some problem to recognize red from orange in bad lighting.

So if you want to find out how Michael Tesař overcame the challenge of coming up with smart projects I suggest you read more here.

Michael Tesař Talks About AI, and his Colour Recognizer Project.