This project builds an image classification model to identify food items (Pizza, Steak, Sushi) using Transfer Learning with a pre-trained EfficientNet-B0 model.
Instead of training from scratch, we reuse knowledge from ImageNet to achieve high accuracy with limited data and faster training.
Classify food images into:
- Pizza 🍕
- Steak 🥩
- Sushi 🍣
- Use pretrained EfficientNet-B0
- Freeze feature extraction layers
- Replace classifier head for 3 classes
model.classifier = nn.Sequential(
nn.Dropout(p=0.2),
nn.Linear(in_features=1280, out_features=3)
)- Data preprocessing (resize, normalize, augment)
- Load pretrained model
- Freeze backbone layers
- Train classifier
- Evaluate on validation + custom images
- Good performance on unseen images
- Example predictions:
- Pizza: ~49%
- Steak: ~53%
- Sushi: ~81%
FoodVision_Mini_Transfer_Learning.ipynb
data/
models/
README.md
pip install torch torchvisionRun notebook in Google Colab: FoodVision_Mini_Transfer_Learning.ipynb
- Transfer learning reduces training time
- EfficientNet provides strong feature extraction
- Works well with small datasets
- Add more classes
- Fine-tune full model
- Deploy using Flask/FastAPI
- Python
- PyTorch
- Torchvision
- Google Colab