Inspiration

Inspired by the Workshop of Bühler, we were concerned about the food that's being wasted in the food industry. Because already small contaminations of the grain in form of different plants, stones and so on can cause whole tuckloads of grain to go bad, we wanted to create an easy way to detect these contaminations. That way, if we detect some stuff in the grain that doesn't belong there, the grain can be cleaned of the contamination with the help of machines, ensuring that it stays fresh until used for production of food.

Because high-tech solutions can be expensive, and manual inspection can take really long, we build a simple solution that can detect such contamination with the help of a raspberry pi and the camera for it. Using cheap components, this device is accesible not only for the big grain processing plants, but also for farmers and truck drivers, making it possible to already evaluate the quality of the grain before it arrives at the plant.

What it does

The challenge by Bühler was to find some contminations, e.g. Beans, Stones or Hay in a batch of grain and to show the data in an appropriate way. We chose to use the camera of the Raspberry pi to take a picture, run a detection software that we made, and then display the result on a webpage, making it usable from any device with an internet browser.

How we built it

We used a Raspberry PI with a camera to capture images and a Java color recognition algorithm to detect areas which fall into the same category. The whole process is controlled by a python script on a FLASK web server and the results are displayed on a web page.

The color recognition algorithm works by splitting the image in equally small pieces and calculating the average color in each square. Then it calculates the average color distance to each category and matches the square appropriately.

Challenges we ran into

At first, we tried to use TensorFlow to train the PC to detect the contaminations and to group them into appropriate categories. However, since we only have limited knowledge of Machine Learning, we didn't get a recognition rate we deemed good enough to work with, so we scrapped that idea. We tried to use alternative models such as comparing sections of the image with images of clean, non-contaminated grain, but that didn't yield satisfactory results either. We also had some trouble setting up the pi, but after connectinmg everything to a mobile hotspot, it was easy and we got a working prototype.

Accomplishments that we're proud of

We hooked up different technologies and devices to create a prototype of a contamination-detection machine: An image is captured, corrected and analysed before it is displayed by a web-interface.

What we learned

Machine learning is not easy. Hooking up different technologies is possible but can lead to difficulties. First try / idea may not always work and might has to be thrown away

What's next for Low-cast grain-contamination detection

Faster, even realtime detection of contaminated grain Collection of data and long-term analysis

Share this project:

Updates