This project is a deep learning–based image classification system that identifies natural scenes such as buildings, forests, glaciers, mountains, seas, and streets. It uses MobileNetV2 with transfer learning for model training and a Streamlit web app for interactive predictions.
- ✅ Train a CNN using MobileNetV2 on Intel’s Natural Scene dataset.
- ✅ Use data augmentation to improve generalization.
- ✅ Save and load the trained model (
scene_classifier_model.h5
). - ✅ Deploy a Streamlit app to classify uploaded images.
- ✅ Outputs the predicted class along with confidence percentage.
.
├── app.py # Streamlit web application
├── train_model.py # Model training script
├── scene_classifier_model.h5 # Saved trained model (generated after training)
├── data/ # Dataset folder (download from Kaggle)
└── README.md # Project documentation
The model is trained on the Intel Image Classification Dataset from Kaggle:
🔗 Intel Image Classification Dataset
-
Classes (6 total):
- 🏙️ Buildings
- 🌲 Forest
- 🧊 Glacier
- ⛰️ Mountain
- 🌊 Sea
- 🚦 Street
-
Clone the repository
git clone https://github.com/mithun-27/natural-scene-classifier.git cd natural-scene-classifier
-
Install dependencies
pip install -r requirements.txt
Example
requirements.txt
:streamlit tensorflow pillow numpy
-
Download the dataset
- Download from Kaggle: Intel Image Classification Dataset
- Extract it into the
data/
folder.
Run the training script:
python train_model.py
This will:
- Load and preprocess the dataset.
- Train a MobileNetV2-based classifier.
- Save the trained model as
scene_classifier_model.h5
.
Start the app:
streamlit run app.py
Then, open the provided local URL in your browser.
- Upload an image (
jpg
,jpeg
, orpng
). - Click Classify Image.
- See the predicted class and confidence score.
Below are example screenshots of the app in action:


- Base Model: MobileNetV2 (pretrained on ImageNet).
- Input Size: 150×150 RGB images.
- Optimizer: Adam (lr = 0.001).
- Loss Function: Categorical Crossentropy.
- Training Epochs: 5 (can be increased for better accuracy).
- Increase training epochs for higher accuracy.
- Fine-tune MobileNetV2 layers.
- Deploy as a web service (Flask/FastAPI backend).
- Add support for more scene categories.
Developed by Mithun 🚀
- 📧 Email: kvl202014@gmail.com
- 💻 GitHub