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.
- Upload an image of a fruit
- A trained image classification model predicts the fruit
- The app recommends a curated YouTube tutorial for making wine from that fruit
The entire flow is presented through a simple Streamlit web app.
- Python
- PyTorch
- Torchvision (ResNet18 with transfer learning)
- Streamlit
- Pillow (PIL)
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
pip install torch torchvision streamlit pillowstreamlit run app.py- 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
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
- Add more training data
- Display prediction confidence in the UI
- Normalize inputs using ImageNet statistics
- Apply data augmentation during training
MIT