The palm fruit project that failed, and what I would propose now
Not everything I worked on shipped. One project from my time as a data scientist at a consultancy failed, and it is the one I think about most.
The job
A client in palm oil wanted harvested fruit sorted by a camera. The model had to tell four things apart:
| Class | What it is |
|---|---|
| Fresh fruit bunch | A harvested bunch that is good to process |
| Empty fruit bunch | A bunch with the fruit gone |
| Loose fruit | Fruit that has come off the bunch |
| Rotten bunch | A bunch that has gone bad |
We treated it as an object detection problem: train a model on footage from the site and have it label what it sees.
Why it failed
The cameras on site were not high quality, and the model could only be as good as the frames it was given.
We kept working on the model when the problem was the picture. No amount of training fixes an image that does not show the difference you are asking the model to find.
What I would propose now
Over the years I have come to think object detection alone was never the right answer. I would propose changing how the bunches reach the camera:
- Put every harvested bunch on a conveyor belt.
- Pass the bunches through a box, one at a time.
- Inside the box, let an object detection model, or sensors, judge each bunch up close.
- Filter out the bad bunches as they leave the box.
The box is the point. It turns a hard problem into an easier one before any model is involved: one bunch in view, always at the same distance. It also means the answer does not have to come from a camera at all. If a sensor can tell a rotten bunch from a fresh one more reliably, use the sensor.
What I took from it
When the data is bad at the source, change the source.
I was hired to build a model, so I tried to solve the problem with a model. The better proposal would have had less machine learning in it and more conveyor belt.
I ask a different first question now: what would make this easy to see? If the answer is a physical change, that goes in the proposal before any model does.