I’ve always worked with numerical data, but recently, I was offered to experiment with something very different: images and computer vision. That sounded both complex and exciting. So instead of analyzing numbers, I decided to teach a model how to recognize plants. Let me tell you how it went.
1. Problem Definition
The goal was simple: Train a custom object detection model capable of detecting and classifying plant types in real-world images.
Unlike pre-trained datasets, this project required building everything from scratch:
Collecting my own images
Manually labeling bounding boxes
Training a YOLOv8 model
Testing generalization on unseen plants
2. Data Collection
Since I have way too many plants at home, I decided to use them for science. I grouped them into three categories: 🌿 Leafy plants 🌵 Cactus 🌱 Succulents
Dataset Composition:
Leafy plants: 45 images
Cactus: 24 images
Succulents: 24 images
Images were captured with variations in lighting, background, angles and distance. This introduced basic variability. At some point, I ran out of cactus. (Not my favorite category, clearly.)So I generated 3–5 additional cactus images using AI (Nano Banana, OpenAI image generation) to slightly balance the dataset. Not ideal. But realistic.