Skip to content

About

ResNet50 vs InceptionV3 transfer learning on Intel Image Classification (92.6% test accuracy), deployed via Gradio.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intel Scene Classification — Transfer Learning (ResNet50 vs InceptionV3)

Transfer learning image classifier that sorts natural-scene photos into six categories — buildings, forest, glacier, mountain, sea, street — using two pretrained CNN backbones, ResNet50 and InceptionV3. The best-performing model is deployed as an interactive Gradio app.

Overview

  • Dataset: Intel Image Classification (~17K images, 6 classes)
  • Backbones: ResNet50 and InceptionV3, both pretrained on ImageNet
  • Training strategy: two-stage transfer learning
    1. Feature extraction — backbone frozen, train a new classification head
    2. Fine-tuning — unfreeze the top ~30 backbone layers, continue training at a much lower learning rate
  • Callbacks: EarlyStopping, ModelCheckpoint, ReduceLROnPlateau
  • Augmentation: random flip, rotation, zoom, and contrast — applied to the training set only
  • Deployment: Gradio app — upload a photo, get the top-3 predicted classes with confidence scores

Results

Evaluated on a held-out test set of 3,000 images:

Model Accuracy Precision Recall F1-score Parameters Pred. Time (ms/image)
ResNet50 92.60% 0.9260 0.9260 0.9257 23,600,006 8.50
InceptionV3 91.80% 0.9178 0.9180 0.9176 21,815,078 9.60

ResNet50 was selected for deployment — it's more accurate and faster at inference, with no efficiency trade-off in InceptionV3's favor.

Per-class F1-score

Class ResNet50 InceptionV3
buildings 0.93 0.92
forest 0.99 0.99
glacier 0.87 0.86
mountain 0.88 0.87
sea 0.96 0.95
street 0.94 0.93

Key finding: class confusion

Both models struggle most with glacier vs. mountain — visually similar snow/rock textures lead to the highest cross-class error rate (66–71 misclassifications out of ~550 images per model). A secondary, smaller confusion appears between buildings and street.

Project structure

.
├── notebook.ipynb              # Full pipeline: EDA → training → evaluation → Gradio
├── app.py                      # Standalone Gradio app (loads the saved model, no retraining)
├── deployment_config.json      # Class names, image size, and model path used by app.py
└── report.docx                 # Short written report (results, graphs, comparison, conclusion)

Note: the saved model file (best_resnet50_final.keras, ~210 MB) is not included in this repo — it exceeds GitHub's file size limits. See Model below for the download link.

Model

best_resnet50_final.keras is hosted on Kaggle as the notebook's Output (it's generated by running the training notebook, not manually uploaded elsewhere):

  1. Open the Kaggle notebook
  2. Go to the Output tab
  3. Download best_resnet50_final.keras
  4. Place it in this repo's root folder, next to app.py and deployment_config.json, before running the app

Running the app locally

#running-the-app-locally

pip install tensorflow gradio numpy pillow
python app.py

Then open the printed local URL (e.g. http://127.0.0.1:7860) in your browser and upload an image.

Notebook

The full training/evaluation notebook (data exploration, two-stage transfer learning, evaluation, Gradio section) is also available on Kaggle: Intel-Scene-Classification-TransferLearning

Tech stack

TensorFlow / Keras · scikit-learn · Gradio · pandas · seaborn · matplotlib

About

ResNet50 vs InceptionV3 transfer learning on Intel Image Classification (92.6% test accuracy), deployed via Gradio.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages