Back to Projects
2025 Academic

Grape Object Detection in smartphone images and video

A Deep Learning model for automatic detection of Grape fruit in smartphone images and video.

Grape Object Detection in smartphone images and video - Main Feature

More Screens & Details


Detecting grape bunches in uncontrolled agricultural environments presents significant computer vision hurdles: occlusion by leaves, variable lighting conditions, and complex backgrounds. Furthermore, developing a model capable of running on resource-constrained devices with limited labeled data (only 300 images from the WGISD dataset) required careful architectural choices.

The Solution

I developed a complete Computer Vision pipeline using KerasCV and YOLOv8:

  • Training Strategy: Implemented a Transfer Learning approach (pre-trained on COCO) with a two-stage process (Warm-up followed by Fine-tuning) to adapt the model without overfitting.
  • Data Augmentation: Configured a robust pipeline with geometric transformations (rotation, shearing) and fotometric changes (brightness, contrast, saturation) to artificially expand dataset variability.
  • Audit & Interpretation: Beyond standard metrics, I used Grad-CAM to visualize model activation maps, discovering a critical "Contextual Bias" where the neural network learned to associate the vineyard soil texture with the presence of grapes.

Conclusion

Demonstrated consistent inference on video streams at 15 FPS. The project validated the viability of one-stage detectors for real-time precision viticulture and provided scientific insights into the "black box" behavior of CNNs regarding environmental context.