Skip to content

DNSdecoded/landuse-cnn-eurosat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🌍 EuroSAT Land Use Classification with CNN

A deep learning project that classifies satellite images into 10 land use categories using a custom-built Convolutional Neural Network (CNN). Trained and evaluated on the EuroSAT RGB dataset.

Sample Predictions


📁 Dataset

  • Source: EuroSAT (RGB only)
  • Size: 27,000 images
  • Classes:
    • AnnualCrop
    • Forest
    • HerbaceousVegetation
    • Highway
    • Industrial
    • Pasture
    • PermanentCrop
    • Residential
    • River
    • SeaLake
  • Image Size: 64×64 pixels

🧠 Model Architecture

A lightweight CNN trained from scratch:

[Conv2d(3→32) → ReLU → MaxPool] →
[Conv2d(32→64) → ReLU → MaxPool] →
[Conv2d(64→128) → ReLU → MaxPool] →
Flatten → FC(8192→256) → ReLU → Dropout(0.5) → FC(256→10)

🛠️ Training Configuration

Setting Value
Optimizer Adam
Learning Rate 0.001
Batch Size 32
Epochs 15
Dropout 0.3
Hardware Tesla T4 (Colab)

📊 Results

Metric Score
Accuracy 91%
Macro F1 ~0.90
External Img Supported ✅
Explainable Grad-CAM ✅

Classification Report (excerpt):

Class Precision Recall F1-score
Forest 0.97 0.99 0.98
Residential 0.98 0.97 0.97
PermanentCrop 0.76 0.91 0.83
... ... ... ...

🔍 Features

  • ✅ CNN trained from scratch
  • 📦 Preprocessing and normalization via torchvision
  • 🖼️ External image inference support
  • 🎯 Grad-CAM visualization for explainability
  • 💾 Model saving/loading in .pth format

🚀 Getting Started

Prerequisites

  • Python 3.7+
  • PyTorch
  • torchvision
  • matplotlib
  • numpy
  • scikit-learn

Installation & Usage

git clone https://github.com/your-username/landuse-cnn-eurosat.git
cd landuse-cnn-eurosat
pip install -r requirements.txt

Open eurosat_cnn.ipynb in Google Colab or Jupyter and run all cells to:

  • Download the EuroSAT dataset
  • Train the CNN model
  • Evaluate on test data
  • Run inference on external satellite images
  • Visualize Grad-CAM heatmaps

📁 File Structure

landuse-cnn-eurosat/
│
├── eurosat_cnn.ipynb         # Main notebook  
├── requirements.txt          # Python dependencies  
├── assets/  
│   ├── sample_predictions.png  
│   └── gradcam_visuals.png  
└── README.md

💡 Future Improvements

  • Experiment with deeper architectures like ResNet18 or Vision Transformers (ViT)
  • Deploy as a web app with Streamlit or Gradio
  • Convert model to ONNX or TFLite for mobile deployment
  • Test on higher-resolution or multi-spectral satellite datasets
  • Add more explainability methods beyond Grad-CAM

🧑‍💻 Author

Sanjay Sakhinala
AI/ML Enthusiast | Open to AI Roles
📫 LinkedIn • 📧 sanjaysakhinala@gmail.com


📚 References

  • EuroSAT Dataset Paper
  • PyTorch Documentation
  • Grad-CAM: Selvaraju et al., 2017

⭐ If you found this project useful, please give it a star on GitHub!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors