CoolFace
Apppublic

Hazelnut42/Fruit_Detection

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
App README

๐ŸŽ Fruit Ninja: Multi-Class Fruit Detection

Detect 10 types of fruits using YOLOv8 deep learning model!

๐ŸŽฏ Demo

Upload an image containing fruits, and the model will detect and classify them automatically.

Supported Fruits:

  • โ€”๐ŸŽ Apple
  • โ€”๐Ÿฅ‘ Avocado
  • โ€”๐Ÿซ Blueberry
  • โ€”๐Ÿซ‘ Capsicum
  • โ€”๐Ÿ’ Cherry
  • โ€”๐Ÿฅ Kiwi
  • โ€”๐Ÿฅญ Mango
  • โ€”๐ŸŠ Orange
  • โ€”๐Ÿˆ Rockmelon
  • โ€”๐Ÿ“ Strawberry

๐Ÿ“Š Model Performance

MetricValue
mAP@0.588.17%
mAP@0.5:0.9560.72%
F1 Score84.41%
Precision89.70%
Recall79.72%
Inference Speed~30 FPS (GPU)

Per-Class Performance (AP@0.5)

FruitAccuracy
๐Ÿ“ Strawberry97.53%
๐Ÿฅญ Mango95.75%
๐Ÿซ Blueberry95.04%
๐Ÿ’ Cherry93.73%
๐Ÿฅ Kiwi89.97%
๐ŸŽ Apple88.82%
๐ŸŠ Orange88.52%
๐Ÿฅ‘ Avocado84.50%
๐Ÿซ‘ Capsicum82.54%
๐Ÿˆ Rockmelon65.30%

๐Ÿ”ง Model Details

  • โ€”Architecture: YOLOv8n (Nano)
  • โ€”Parameters: 3.0M
  • โ€”Dataset: deepNIR (922 images, 10 classes)
  • โ€”Training: 100 epochs, 27.8 minutes on Tesla T4
  • โ€”Framework: Ultralytics YOLOv8

๐Ÿš€ Training Configuration

python
TRAINING_PARAMS = {
    'epochs': 100,
    'batch': 16,
    'imgsz': 640,
    'lr0': 0.01,
    'optimizer': 'AdamW',

    # Data Augmentation
    'mosaic': 1.0,
    'mixup': 0.1,
    'hsv_h': 0.015,
    'hsv_s': 0.7,
    'hsv_v': 0.4,
    'degrees': 10.0,
    'translate': 0.1,
    'scale': 0.5,
    'fliplr': 0.5,
}

๐Ÿ“ How to Use

  1. 1.Upload an image containing fruits
  2. 2.Adjust confidence threshold (optional)
  3. 3.Click "Detect Fruits"
  4. 4.View results with bounding boxes and labels

๐ŸŽ“ Academic Context

This model was developed as part of a Computer Vision course homework assignment (HW3: Fruit Ninja). The goal was to train a deep learning model for multi-class fruit detection suitable for agricultural automation applications.

Real-world Applications:

  • โ€”Automated fruit counting in orchards
  • โ€”Quality control in packing facilities
  • โ€”Yield estimation for harvest planning
  • โ€”Robotic fruit picking systems

๐Ÿ“š References

๐Ÿ“„ License

MIT License - Feel free to use for educational purposes!


Developed by: [Your Name] Course: Computer Vision Date: October 2025