We built an end-to-end image classification system to:
- 🥝 Identify whether the input fruit is a blackberry or a lime
- 🧺 Determine how the fruit is presented: e.g. Halved, In a Container, Whole, etc.
The app uses transfer learning via pre-trained ResNet-18, and is deployed as a live web app using Gradio on Hugging Face Spaces.
- ✅ Collected manually
- 🎯 2 produce categories:
- blackberry
- lime
- 🎯 6 variation categories:
- Halved
- In Context
- In a Container
- Single Berry
- Small Group
- Whole
Total images: ~6000
Split: 70% Train, 20% Validation, 10% Test
The original dataset has been published in kaggle, can be refered through the link.
- Base Model:
ResNet-18(pretrained on ImageNet) - Two-stage classifiers:
produce_classifier.pth– blackberry vs limevariation_classifier.pth– 6-class variation
- Frozen all layers except the final classification head
- Optimizer:
Adam - Loss:
CrossEntropyLoss - Epochs:
5
- Accuracy: 100%
- Precision, Recall, F1-score: 1.00 for both classes
- Accuracy: 99%
- Macro & Weighted F1-score: 0.99
🧪 Try the live web app:
👉 Hugging Face Space:
https://huggingface.co/spaces/brs13/blackberry-lime-classifier
- Click the link above to launch the app.
- Upload a fruit image (blackberry or lime).
- The app will:
- Predict the produce type (blackberry or lime).
- Predict its visual presentation category (e.g., Whole, Halved).
- You will also see example images and model outputs.
This project includes a detailed and self-contained HTML report summarizing everything we did.
- Clone or download this GitHub repository to your computer.
- Locate the file named
index.htmlin the root directory. - Double-click the file to open it in any modern web browser (e.g., Chrome, Firefox, Safari).
- The report contains:
- ✅ Full project description
- 📊 Confusion matrices and performance results
- 🧠 Model details and training setup
- 🚀 Summary, future work, and app links