Deep Learning for the Food Industry
So far in this series of blog posts, we have covered the advantages of implementing a deep learning machine vision system to facilitate factory automation in industrial settings, as well as running through the essentials of training a deep learning system for machine vision.
In this blog post we will be looking at utilising deep learning machine vision systems for industrial food applications.
Why Deep Learning for Food?
In the food industry, deep learning can really advance industrial efficiency. The individual cost of food units tends to be low, with a high rate on production lines; this means in the cases of foods like nuts, fruits, and vegetables, huge amounts of time and money can be saved by automating the quality control checking process.
How to Automate Food Quality Control Checks
Combining machine vision with deep learning technology can pave the way to creative and highly efficient solutions in the food industry. It all comes back to what deep learning excels at: classification, recognition, reading, and detecting.
All these tasks apply to industrial food contexts very well, for example classifying types of foods, recognising common food defects, reading food labels, and detecting presences of food damage.
Collecting Data for an Industrial Food Dataset
Following the advice in our last blog, in this instance you should use a large data set for deep learning – most likely thousands of images – comprising all the possible variations in your application, not only in differing types of foods, but all possible forms that food could take. For example, an underripe orange may appear yellow, so the convolutional neural network would need to rely on shape and texture rather than just colour.
A deep learning system will need to be trained to know every identifying aspect of a recognisable food product, as food can vary quite a lot. Provide plenty of varying images of each type of food, rather than purely ‘perfect’ images like the one above.
After collecting your data, you will need to label the images (e.g. ‘orange, pass’) and divide them into data subsets (~60% training set, ~30% evaluation set, and ~10% validation set). Data augmentation is best practiced in order to pad out the data set and increase inference capability in your trained model.
Examples of Deep Learning in the Food Industry
Deep learning excels with industrial food lines because it is brilliant at recognising food types, detecting defects, sorting and grading based on visual clues.
Deep Learning for Fruit Sorting
Deep Learning recognition can be used to pass or fail food units.
Take fruit sorting, for example – a fully automated deep learning machine vision system will be able to pass or fail individual samples, distinguish them other fruits, or even detect blemishes and grade them based on quality, such as with the oranges below.
Deep learning vision systems can perform with high accuracy and precision when grading food.
Deep Learning for Grading Eggs
Grading usually calls for a subjective eye, but objective visual clues can be very useful to not only passing and failing food samples, but to determining higher and lower-quality foods.
The price of eggs, for example, is particularly affected by their appearance compared to, say, peanuts. Eggs are also highly fragile and prone to cracking, meaning that time and money sinkholes can be common if the system of detecting breakages is not stringent enough.
Deep learning used to detect cracks (left) and dirt (right).
Luckily, deep learning performs very well at recognising eggshell cracks as well as relying on visual cues such as size, colour, and presence of speckles to determine the grading.
Deep Learning to Assess Meat
Deep learning can also look for visual cues on other animal products such as meat, fish, and poultry – as long as it is taught in the data training phase to recognise things like hairs, feathers, and haematoma (internal bleeding), it will recognise the presence or absence of these undesirables on the production line.
Deep learning to Grade Pizza Toppings
The key takeaway here is that the reason deep learning works so well with food is its adaptability to many different kinds of foods – here below we can see deep learning being used to recognise uneven distribution or even a total absence of pizza toppings, which means bad examples can be caught out and rejected, saving money, time and packaging resources in the long run.
Deep learning is able to detect the absence of pizza toppings (left).
Deep learning isn’t just for meat, fruit, eggs, and pizza; its adaptability makes it a highly effective solution for problems in industrial food lines, and in a very wide variety of food-based contexts.
Deep learning can be used to pass or fail baked goods such as bread by detecting acceptable or unacceptable colour and lightness.
Case Study: Deep Learning in the Food Industry
The following case study describes how deep learning has been successfully utilised in an application focused on sorting deshelled mussels based on detecting shell fragments.
Using X-ray imaging, the mussels were imaged, processed, and differentiated into two classes: ‘pass’ and ‘fail'.
The mussels were then located using the blob analysis functionality in Matrox Imaging Library (MIL).
Time taken to prepare the data was 4 hours, and data augmentation was practiced six times. The actual training took three hours, and comprised 12,000 images.
Using Matrox Imaging Library (MIL) and an embedded system with GeForce GTX 1080Ti and Core i7, an inference rate of <5ms per mussel was achieved, with an accuracy of 99% according to the system integrator.
Cutting Edge Deep Learning Solutions from ClearView Imaging
We understand that preparing for a deep learning machine vision project can feel like a mountainous task. At ClearView Imaging, not only do we supply all the components you will need for your machine vision project, but we also have a great team of technical engineers and vision experts with the knowledge and experience to help you with your application. Whatever the question or query, feel free to get in touch via our contact page.
Stay tuned to this series of blogs as we continue to explore deep learning in a variety of machine vision contexts.
Whether you’re an OEM, a system integrator, engineer or even an end user, be sure to check our great range of machine vision products for the best machine vision components on the market.