Skip to content

aurobles/wine-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fruit to Wine Tutorial

A beginner-friendly machine learning project that predicts the type of fruit from an image and recommends a wine-making tutorial based on the result.

This project was built to learn machine learning by building small, understandable systems rather than optimizing for production-level accuracy.


What it does

  1. Upload an image of a fruit
  2. A trained image classification model predicts the fruit
  3. The app recommends a curated YouTube tutorial for making wine from that fruit

The entire flow is presented through a simple Streamlit web app.


Tech stack

  • Python
  • PyTorch
  • Torchvision (ResNet18 with transfer learning)
  • Streamlit
  • Pillow (PIL)

Project structure

wine-classification/
│
├── app.py                  # Streamlit entry point
│
├── src/                     # Core logic
│   ├── train_model.py       # Model training
│   ├── predict_fruit.py     # Inference logic
│   ├── label_mapping.py     # Dataset to label mapping
│   └── fruit_to_tutorial.py # Fruit to wine tutorial mapping
│
├── models/
│   └── fruit_model.pth      # Trained model weights
│
├── data/
│   └── dataset/             # ImageFolder-style dataset
│
├── LICENSE
└── README.md

How to run

1. Install dependencies

pip install torch torchvision streamlit pillow

2. Run the app

streamlit run app.py

Model notes

  • Uses transfer learning with a pretrained ResNet18
  • Trained on a small custom dataset
  • Confidence scores typically range between 55–75 percent, which is expected for a beginner-scale model
  • The goal is learning and experimentation, not production accuracy

Why this project exists

This project was created in response to requests for a simple and honest beginner machine learning example.

Design goals:

  • Minimal abstraction
  • Clear separation of training, inference, and application logic
  • Easy to read, modify, and extend

Possible improvements

  • Add more training data
  • Display prediction confidence in the UI
  • Normalize inputs using ImageNet statistics
  • Apply data augmentation during training

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages