This repository contains the training pipeline for an Intel Image classification system using deep learning. It includes implementations in both TensorFlow and PyTorch, focusing on classifying images into categories such as buildings, forest, mountains etc.
This dataset used here is provided by Intel and is designed for natural scene classification. It contains RGB images across 6 natural categories:
-
Buildings
-
Forest
-
Glacier
-
Mountain
-
Sea
-
Street
To build and compare robust CNN models using TensorFlow and PyTorch for classification using image data. This forms part of a portfolio-ready end-to-end ML project including model training, evaluation, and web deployment.
- Data Augmentation:
RandomFlip,RandomZoom,RandomRotation, etc. - CNN Layers + BatchNorm + Dropout
GlobalAveragePooling2D+ Dense layers- Regularization with
L1L2 EarlyStoppingandModelCheckpointcallbacks
- CNN architecture with similar depth and regularization
AdaptiveAvgPool2dinstead of GAPDropoutandBatchNormused- Best model saved using
torch.save
.
├── TFTrain.py # TensorFlow training script
├── TFTest.py # TensorFlow testing script
├── TorchTrain.py # PyTorch training script
├── TorchTest.py # PyTorch testing script
├── reports/ # Confusion matrices and evaluation visuals
├── Data/
│ ├── train/
│ ├── val/
│ └── test/
├── requirements.txt # Dependencies
├── README.md
└── LICENSE # MIT License
-
TensorFlow
- Best Training Accuracy: 84.25%, Training Loss: 0.5474, Validation Accuracy: 83.0%, Validation Loss: 0.5870
-
PyTorch
- Best Training Accuracy: 87.01%, Training Loss: 0.3631, Validation Accuracy: 87.1%, Validation Loss: 0.3473
- Classification Reports
- Confusion Matrices
python TFTrain.py
python TFTest.pypython TorchTrain.py
python TorchTest.pyMake sure your dataset is placed in the Data/ directory with subfolders:
Data/
├── train/
├── val/
└── test/
- Note: If the Data doesn't have Validation or Test Data Sets, you can divide training Data Set using Split.py uploaded within Data folder. Rename the corresponding datasets in the code.
cd Data
python Split.py ./path # Replace the ./path with your training dataset. Note that you shouldn't name the path as train, val or test to run the code.
cd ..pip install -r requirements.txt- TensorFlow
- PyTorch
- matplotlib, seaborn, scikit-learn
GPU acceleration is recommended if available.
- Dual framework training (TF + Torch)
- Data augmentation and regularization
- Clean modular design for reproducibility
- Evaluation visualizations for clarity
- Ready for deployment in Flask app
The trained models from this repository are integrated into a Flask-based Image Prediction API, allowing you to interact with the models via a simple web interface or programmatically.
You can try out the deployed models here:
Image Prediction API Repository
The API supports both TensorFlow and PyTorch models and provides:
- A web interface for image upload & prediction
- REST API endpoint for programmatic access
- Sample usage with unseen images for real-world testing
MIT License – see LICENSE for full details.
Created by JAGAN-JGUN for professional portfolio showcasing.
For queries or collaboration:
- GitHub: JAGAN-JGUN
- Email: jaganjgun008@gmail.com

