⬆️ ⬇️

As a Japanese farmer using deep learning and TensorFlow cucumbers sorted





The capabilities of modern cognitive systems are still limited, but over time they evolve and become more perfect. They are already used in many areas, including agriculture. A vivid example of this is the system created by a Japanese engineer. About a year ago, a Japanese man named Makoto Koike decided to help his parents who grow cucumbers. In Japan, large and direct cucumbers are considered an extra-class product, so all farmers tend to grow these vegetables of exactly this form.



It is rather difficult to do this, and Koyke was convinced of this in his own experience. "Each cucumber is different from the others - they all come in different shapes, qualities and freshness," says the engineer. In order for the final product to hit the stores, vegetables must be sorted. In Japan, there are nine classes of cucumbers. The classification is made according to the shape, size and a number of other properties. The higher the grade, the more expensive the cucumber.





Classes of cucumbers according to Japanese standards

')

Sorting is difficult. And although in Japan there are automatic sorting machines, they are not too popular, because they are quite expensive, and they do not work perfectly. The engineer decided to help parents achieve the perfect automatic sorting of vegetables by creating their own sorter. In order to improve the quality and efficiency of such a system, he decided to involve neural networks in sorting. Now they are able to recognize and classify images with a high degree of accuracy, exceeding human capabilities. This applies to both speed and accuracy.



The caring son made the decision to use Google, TensorFlow, as a basis for his open-source sorting-cucumber algorithm. A year ago, the company just opened the source code of this product for everyone. TensorFlow allows the developer to use ready-made code and the capabilities of neural networks, rather than creating everything from scratch. To create your own project, you need to download the code, read the instructions, and you can start working.



In addition to the code, you also need hardware. The Japanese decided to use the Arduino Micro and Raspberry Pi 3. Electronics was used as the main controller for working with the camera and sending images to the Google Cloud, where information was analyzed. The boards also control the sorter servos.







At the first stage, the engineer taught the system to recognize images and determine whether a cucumber or something else is depicted in the photo. After checking the performance of the system, a more complex algorithm was created, which already classified cucumbers according to the standards adopted in Japan.



After this, a conveyor and sorting system was developed. The camera photographed the cucumbers passing through the pipeline, the neural network classified them. It only remained to distribute the cucumbers in boxes, based on the class of each vegetable. For this, Koike created a robotic arm, which was engaged in "physical work".







In order to get photos of cucumbers of different classes, sorted by his mother, the Japanese spent about three months. He had to make and upload to the system more than 7000 images of cucumbers. And this was not enough. When the test was carried out only with images, the system worked with an accuracy of 95%. But when it came to photographing real cucumbers, accuracy dropped to 70%. As it turned out, the problem is that the base of several thousand photographs is not enough for a high-quality learning system.



The second problem is that the system consumes a lot of resources, time and energy. The current sorter is a normal Windows desktop PC that is used to train the neural network. And although the computer converts the photographs taken by the cameras into images with a resolution of 80 * 80 pixels, the training of the system based on them takes 2-3 days. The fact is that several thousand of such pictures are required. And since the photos have a low resolution, the sorter operates with such properties as shape, length and level of error. Color, texture, scratches - all this goes unnoticed and cannot be used at this stage. If you increase the resolution of photos, it will increase the accuracy of the system. But at the same time, the time it takes to train a neural network will increase.



The Japanese plan to solve their problem with another Google service. Now the corporation offers the Cloud Machine Cloud Learning (Cloud ML) platform at a low price. Thousands of powerful servers are involved here. They effectively process information and help train the neural system based on TensorFlow.



Now Makoto Koike plans to use Google ML for his own purposes. “I can use the service to create a training system based on much better images. I can also use different configurations, parameters and algorithms of the neural system, which can help to find the option that will make the system more accurate. ”



So far, Koyke’s work with Google ML is unavailable, he continues to experiment. But it is possible that in a few months, the Japanese parent's cucumber farm will supply vegetables that are classified exclusively accurately. The Japanese are still perfectionists.

Source: https://habr.com/ru/post/397305/



All Articles