Cherry Leaf Mold Detection
I built a mold-detection system for cherry tree leaves using fuzzy C-Means, a soft clustering method where a leaf can belong to more than one group at once. That makes it easy to flag the borderline, low-confidence leaves that need a closer look. I preprocessed 4205 leaf images and compared five clustering methods.
- Python
- OpenCV
- NumPy
- Pandas
- Matplotlib
- Git
- GitHub
- Overleaf
The goal was to show why non-exclusive clustering matters, because in real life it is not all about zeros and ones.
My family's cherry garden is what started this. Detecting mold on the leaves matters, but you cannot call every leaf fully molded or fully healthy.
For feature extraction I used color histograms. Each image was split into red, green, and blue channels with 8 bins per channel, which gives a 512-value vector that describes the leaf’s colors.
To improve the clustering I cleaned the dataset with DBSCAN. It started at 4205 leaf images and dropped to 3928 after cleaning.
My non-exclusive method was fuzzy clustering , specifically Fuzzy c-Means with four metrics (1.2, 1.5, 2.0, 2.5), saving every prediction with its confidence. I wrote my own implementation, with the math in the report, and it matched the library version closely.
I compared against k-Means and hierarchical clustering using ARI scores, which showed the value of keeping the in-between cases.
Predictions were saved to local folders by confidence: above 90 percent (high), or between 40 and 60 percent (mid).
Why does comparing high confidence with mid matter?
On these leaves, the dose of treatment can be adjusted to the mold level, which leads to a more balanced prescription and better use of the material.
Questions
What problem does this solve?
It flags cherry leaves that are only partly molded, not just fully healthy or fully molded, so the treatment dose can match the real mold level.
Why fuzzy clustering instead of normal clustering?
Fuzzy clustering lets a leaf belong partly to more than one group, which keeps the in-between cases that strict clustering would force into a single bucket.
How big was the dataset?
About 4205 leaf images, reduced to 3928 after cleaning with DBSCAN.