Artificial intelligence is already present in many industries - from logistics, through industry and production to services. Self learning algorithms would never catch a flu or take a maternity leave. Its phenomenon is based on its ability to adapt to changing environment where it performs its duties. 

Food industry is a great example that has not been omitted by the digital revolution. It is unique due to the fact it affects every single person on earth. That is why we would like to introduce a handful of use cases where AI meets and optimises the food industry. 

Sorting

Quality is one of the biggest factor in every company processing and manufacturing food. To maximise it, the product sorting process have to be optimal and effective. The technology allows to automatise sorting, which used to require plenty of recurrent work done by the people. Additionally intelligent computer vision algorithms increase efficiency and make it possible for those kind of products like fruits and vegetables to come to the production line and then to the customer without people needed. 

 Maintenance of cleanliness

This rather obvious topic, keeping sterile conditions while food processing can be a much harder task then considered. Lets face this problem from AI perspective and try to take advantage of its capabilities. It cannot be denied production automatisation improves performance, but it does not mean that the products are flawless, clean and, what is the most important, safe to eat. That’s where machine vision and ultrasound detection take its key part, with detecting microbiological food particles on production lines. Based on such information in real time, you can react and raise the quality standard - and save substances used to care for a sterile environment. 

Recommendation system

Let’s dive deeper into one practical use case from food industry. Suppose we run a retail stores network. You would like to increase amount of wines sold in your shops. Nowadays there is a enormous variety of products from all over the world, presenting different tastes and aromas. Question is how you can find the wines, that would appeal to your customers? 

We would present our solution with example of artificial intelligence usage. It turns out that only by analysing the wine chemical composition one can provide useful conclusions about its quality. 

Firstly - the data. We would be using a dataset containing information of miscellaneous wine ingredients and properties, such as density or alcohol percentage and quality rating given for around 1500 types of wines. Let’s see how well are the components correlated. 



 

We can see that the quality is highly dependent on alcohol volume, but very poorly on volatile acidity, which means acetic acid content in wine. We would like to stress out the fact it is only a correlation which does not imply direct dependence.  That’s why we cannot conclude quality just  from alcohol volume. But why do we consider correlations while making a system for automatical quality recognition? 

 

The charts provide us dependences between rating and components with high correlation on the first one and low on the second. On the first chart when we see the wine in the bottom left corner, it is by highly probable quality is poor. Model trained on our data would be capable of learning those patterns and achieve high accuracy in wine selection. In the second graph, the blue and orange dots are mixed up strongly. Knowing only the density and amount of sulfur dioxide, neither man nor any model will be able to predict the quality of wine.


 


 

Because of high correlation between certain components, we can suppose we could create a recommendation system. Firstly we would create a decision tree model due to its high performance with little data. It creates a tree-like decision structure based on wine components. It turns out that accuracy is about 68%, which means in 68% cases it judges the quality of wine the same as a group of sommeliers. That’s much better result than flipping a coin, but we can easily improve it.  

The next model we will test will be random forest. Just like when people evaluate wines, we prefer to take the average of several testers' ratings, because each of them has their own preferences, specializes in different species and may have a worse day, so random forest takes a summary assessment of many decision trees. We have improved the efficiency to 82%, which gives a good approximation of the tester's judge. In the chart below we see the ROC curve for both classifiers. This is one way to assess the quality of the model. The more convex the graph, the more likely it is to correctly predict wine quality. As we thought, a better model in this case is random forest. 



Our Predictive models reach 82% accuracy comparing to people, make decisions below seconds, are always available and never get tired.

Summary

Starting from the preparation of ingredients, through their segregation and ending with the proportion selection, artificial intelligence has tools fit to the requirements of even the most demanding food producers. In addition, as examples from other sectors of the industry show, non digital companies lose in the battle against their competitors in the race for consumers. If you are still skeptical after reading our post, please contact us.