Grading Tomatoes with an ESP32 and ML

Wait 5 sec.

If you’ve ever worked with produce, you might know about grading. In addition to deciding if, say, a strawberry is good or not, they also have to sort them by color. Turns out, you don’t care if one package of berries is a bit redder than another, but you do care if one package has too much color variation. [Pmalfa31] applied an ESP32 and machine learning to grading tomatoes.The system knows in advance if you are processing standard tomatoes or cherry tomatoes and uses two different sets of learned data depending on which you select. The program receives raw data from an optical sensor and then processes it to remove empty belt images, compute statistical information, and group readings for a single fruit together.One thing we liked was the program’s heuristic checking of validity. It knows the approximate size of the tomato, so the code notes if the fruit seems too big for a cherry tomato or too small for a standard tomato. This reduces, but doesn’t eliminate, miscategorizations.The code is a stack hog, so the program has to request a much larger stack. If you want to try it yourself, there is a simulator on the web available, so you don’t even need any hardware or tomatoes to try it.Computers have lots of uses on a modern farm.