This project demonstrates how to use Transfer Learning with TensorFlow and TensorFlow Hub to classify images from the Food101 dataset (10-class, 10% subset). We compare the performance of two pretrained models β ResNet-50 and EfficientNetV2 β as feature extractors.
Transfer learning leverages the learned patterns of large pretrained models to solve custom image classification tasks with minimal training data. This notebook:
Loads and processes the Food101 (10%) dataset
Uses ResNet-50 and EfficientNetV2 from TensorFlow Hub
Visualizes sample data and training performance
Compares model accuracy and loss over epochs
Python
TensorFlow & Keras
TensorFlow Hub
Matplotlib
NumPy
ImageDataGenerator
TensorBoard
Google Colab (GPU Runtime)
Classes:
chicken_curry, chicken_wings, fried_rice, grilled_salmon, hamburger, ice_cream, pizza, ramen, steak, sushi
Open the notebook in Google Colab
Ensure GPU runtime is enabled (Runtime β Change runtime type β GPU)
Run the cells step-by-step
Use TensorBoard (locally or inline) to visualize logs
Model Accuracy (After 5 Epochs) ResNet-50 ~55.8% EfficientNetV2 ~74.6%
EfficientNetV2 significantly outperformed ResNet-50 on this small dataset in terms of validation accuracy and faster convergence.
Random food image samples
Training vs. Validation Loss and Accuracy plots
TensorBoard logs (Note: tensorboard.dev is deprecated)
Fine-tune the feature extractor layers
Use data augmentation to prevent overfitting
Train on the full Food101 dataset
Deploy the best model as an API
Feel free to fork, improve, or open issues. Collaboration is welcome!