https://github.com/parth147op/intel-image-classification
Intel Image Classification using CNN & Transfer Learning (VGG16) with Streamlit demo.
https://github.com/parth147op/intel-image-classification
cnn computer-vision deep-learning image-classification keras streamlit tensorflow transfer-learning
Last synced: about 2 months ago
JSON representation
Intel Image Classification using CNN & Transfer Learning (VGG16) with Streamlit demo.
- Host: GitHub
- URL: https://github.com/parth147op/intel-image-classification
- Owner: parth147op
- License: other
- Created: 2025-09-29T14:29:31.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-05T17:46:10.000Z (9 months ago)
- Last Synced: 2025-10-05T19:29:00.194Z (9 months ago)
- Topics: cnn, computer-vision, deep-learning, image-classification, keras, streamlit, tensorflow, transfer-learning
- Language: Jupyter Notebook
- Homepage:
- Size: 2.57 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ผ๏ธ Intel Image Classification with CNNs & Transfer Learning






> ๐ง A complete end-to-end deep-learning pipeline โ from data preprocessing and CNN training to a deployment-ready Streamlit app.
---
## ๐ Project Overview
This project focuses on **scene image classification** using Convolutional Neural Networks (CNNs) and Transfer Learning.
The dataset consists of natural scenes categorized into six classes, and the goal was to develop a high-accuracy model deployable via Streamlit.
**Highlights**
- ๐งฉ Baseline CNN from scratch (80 % accuracy)
- โ๏ธ Transfer learning with **VGG16** (88 %)
- ๐ฏ Fine-tuned model reaching **90 %+ validation accuracy**
- ๐ Visualizations: confusion matrix and Grad-CAM interpretability
- ๐ฅ๏ธ Frontend built in **Streamlit**
---
## ๐ Dataset
- **Source:** [Intel Image Classification Dataset โ Kaggle](https://www.kaggle.com/puneet6060/intel-image-classification)
- **Classes:** `buildings`, `forest`, `glacier`, `mountain`, `sea`, `street`
- **Split:**
- Train โ 14 000
- Validation โ 3 000
- Test โ 3 000
---
## ๐งฑ Architecture & Approach
### Data preparation
- Verified and removed corrupted images
- Applied extensive augmentation (`rotation`, `shift`, `zoom`, `brightness`, `flip`)
- Normalized pixels to [0, 1]
### Baseline CNN
- 3 convolutional + pooling layers
- Dense layer (256 neurons + dropout)
- Accuracy โ 80 % @ 10 epochs
### Transfer Learning โ VGG16
- Pre-trained ImageNet base
- Custom head: `Flatten โ Dense(512 ReLU) โ Dropout โ Softmax(6)`
- Validation โ 88 %
### Fine-tuned Model
- Unfrozen last block (`block5_conv1โ3`)
- LR = 1e-5, early stopping
- Validation โ 90.4 %, Test โ 90.2 %
### Hyperparameter Optimization
- Tuned with **Keras Tuner**: conv blocks, filters, dense units, dropout, optimizer, LR
---
## ๐ Results
| Model | Validation Acc | Test Acc |
|:------|:---------------:|:--------:|
| Baseline CNN | 80 % | 78.5 % |
| VGG16 (frozen) | 88.4 % | 87.5 % |
| **VGG16 (fine-tuned)** | **90.4 %** | **90.2 %** |
**Classification Report**
```
precision recall f1-score support
buildings 0.91 0.87 0.89 437
forest 0.97 0.99 0.98 474
glacier 0.87 0.85 0.86 553
mountain 0.86 0.84 0.85 525
sea 0.92 0.92 0.92 510
street 0.89 0.94 0.92 501
accuracy 0.90 3000
```
---
## ๐ธ Visualizations
| Confusion Matrix |
|:-----------------|
|  |
**Streamlit App Demo**

---
## ๐งฉ Tech Stack
- **Languages:** Python (Numpy, Pandas)
- **Frameworks:** TensorFlow 2.14 ยท Keras 3.3.3 ยท Streamlit
- **Visualization:** Matplotlib ยท Seaborn ยท OpenCV
- **Tools:** Jupyter Notebook ยท Keras Tuner ยท Git
---
## ๐ Deployment & MLOps



### Deployment Options
- Dockerized App
```bash
docker build -t intel-cnn-api .
docker run -p 8501:8501 intel-cnn-api
```
- Deploy on AWS ยท GCP ยท Render ยท Streamlit Cloud
- Production server โ NGINX + Gunicorn
### MLOps Extensions
- CI/CD pipeline (GitHub Actions)
- Model registry (MLflow / Weights & Biases)
- Drift monitoring & auto-rollback
---
## ๐จ Streamlit App
**Run locally**
```bash
streamlit run app/app.py
```
**Features**
- Upload JPG/PNG image
- Displays prediction + confidence chart
- Clean and responsive UI
---
## โ๏ธ Setup Guide
```bash
# 1๏ธโฃ Clone repo
git clone https://github.com/parthhpatel/intel-image-classification.git
cd intel-image-classification
# 2๏ธโฃ Create virtual environment
python -m venv venv
.env\Scriptsctivate
# 3๏ธโฃ Install requirements
pip install -r requirements.txt
# 4๏ธโฃ Run app or notebook
streamlit run app/app.py
# or
jupyter notebook notebooks/Intel_Image_Classification.ipynb
```
---
## ๐๏ธ Folder Structure
```
intel-image-classification/
โโโ notebooks/
โ โโโ Intel_Image_Classification.ipynb
โโโ app/
โ โโโ app.py
โ โโโ intel_cnn_best.h5
โโโ results/
โ โโโ confusion_matrix.png
โ โโโ streamlit_demo.png
โโโ requirements.txt
โโโ README.md
โโโ .gitignore
โโโ LICENSE
```
---
## ๐ง Key Learnings
- Built CNN & transfer-learning pipelines
- Fine-tuned pre-trained architectures
- Hyperparameter tuning with Keras Tuner
- Grad-CAM model interpretability
- Streamlit deployment and MLOps readiness
---
## ๐งพ License
Released under the **MIT License**.
See the [LICENSE](LICENSE) file for details.
---
## ๐ค Author
**Parth Patel**
๐ง [parthhpatel2504@gmail.com](mailto:parthhpatel2504@gmail.com)
๐ [LinkedIn](https://www.linkedin.com/in/parth-patel-8990a9281/) ยท [GitHub](https://github.com/parth147op)
---
> ๐ From data to deployment โ making deep learning models interpretable, performant and production-ready.