Case Study 05

Food Context Classification via Transfer Learning

ResNet-50 · home vs. restaurant vs. packaged food

PyTorchResNet-50Transfer Learning
View on GitHub (opens in new tab)

The Problem

Most food-image classifiers try to identify what the food is. This project asked a different question: can a model reliably classify the context a food photo was taken in — at home, in a restaurant, or as packaged goods — using scene cues rather than the dish itself?

Approach

  1. 01Fine-tuned a pretrained ResNet-50 on a food-context dataset labeled by scene (home, restaurant, packaged) rather than by dish.
  2. 02Ran four separate training strategies — baseline transfer learning, standard data augmentation, injected synthetic noise, and a combined approach — to isolate which techniques actually helped.
  3. 03Evaluated all four strategies on a held-out test set using consistent metrics for a fair, controlled comparison.

Visuals

Bar chart comparing test accuracy across four training strategies: Baseline at 94.5%, Augmentation at 91.7%, Synthetic at 93.1%, and Combined at 86.3%
Test accuracy across all four training strategies — baseline wins, combined augmentation+noise loses the most ground.
Line charts showing training and validation loss decreasing over 10 epochs, and training and validation accuracy, with validation accuracy plateauing below training accuracy
Loss and accuracy curves for the synthetic-noise variant — validation accuracy plateaus while training accuracy keeps climbing.

Results

94.5% test accuracy with the plain baseline transfer-learning model — the best of the four.

Synthetic noise came closest at 93.1%; augmentation alone dropped to 91.7%; combining both hurt most, falling to 86.3%.

Training curves show validation accuracy plateauing while training accuracy kept climbing — a sign of mild overfitting the augmentation strategies didn't fix.

Reflection

The most useful finding was a negative one: none of the augmentation strategies beat the plain baseline, and stacking them made things worse, not better. It's a good reminder that more complexity in a training pipeline isn't automatically better — augmentation choices need to be validated against your specific dataset, not assumed to help.