avatar SaqibBedar
All projects

Date Fruit Classification

A computer vision system that classifies 10 date fruit varieties from images, built to compare transfer learning against a model trained from scratch — then shipped as a working web app.

Computer Vision PyTorch Academic project
Date Fruit Classification project thumbnail

Overview

Date variety sorting is normally a manual, visual task — this project explores whether a model can do it reliably instead. I built two classifiers on the same 7,000-image dataset: a ResNet-50 fine-tuned on ImageNet weights, and a lightweight CNN trained entirely from scratch, so I could directly compare what transfer learning buys you against a simpler model built from the ground up.

The better-performing model is wired into a small Flask app where you can upload a photo and get a prediction back, with confidence thresholding to flag inputs the model isn't sure about.

Highlights

  • Reached 93.96% test accuracy fine-tuning ResNet-50, after first training frozen-backbone and then unfreezing the final block for a second training pass.
  • Trained a custom CNN from scratch as a baseline comparison — it edged out ResNet-50 on validation accuracy despite having roughly 60x fewer parameters.
  • Used confusion-matrix analysis to find that most misclassifications came from three visually similar varieties, rather than random model error.
  • Packaged the trained model into a Flask web app for live image upload and inference, including basic rejection of obviously-non-date inputs.

Quick Facts

93.96%Final test accuracy
7,000Dataset images
10Classes
ResNet-50Fine-tuned backbone
Custom CNNBuilt from scratch
FlaskDeployed as a web app

Built With

Python PyTorch Torchvision Flask NumPy Matplotlib

Built with Hamza Khan Tariq, supervised by Prof. Syed Muhammad Naqi.