Skip to content

arshraeis710-hash/Geospatial_land_classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geospatial Land Classifier

A deep learning-based satellite image classification system built using PyTorch and ResNet18. The model is trained on the EuroSAT RGB dataset and can classify satellite imagery into 10 different land-use categories.

Features

  • Satellite image classification using ResNet18
  • Transfer learning with pretrained ImageNet weights
  • GPU acceleration support (CUDA)
  • Validation accuracy tracking during training
  • Command-line prediction interface

Dataset

This project uses the EuroSAT RGB Dataset.

The dataset is not included in this repository due to its size.

Please download the dataset manually and place it inside the project directory.

Expected Directory Structure

Geospatial_land_classifier/
│
├── archive/
│   └── EuroSAT_RGB/
│       ├── AnnualCrop/
│       ├── Forest/
│       ├── HerbaceousVegetation/
│       ├── Highway/
│       ├── Industrial/
│       ├── Pasture/
│       ├── PermanentCrop/
│       ├── Residential/
│       ├── River/
│       └── SeaLake/
│
├── dataset.py
├── train.py
├── predict.py
├── requirements.txt
└── README.md

Supported Classes

The model can classify images into the following categories:

  • AnnualCrop
  • Forest
  • HerbaceousVegetation
  • Highway
  • Industrial
  • Pasture
  • PermanentCrop
  • Residential
  • River
  • SeaLake

Prerequisites

  • Python 3.10 or later
  • Git
  • NVIDIA GPU (optional, for faster training)

Installation

1. Clone the Repository

git clone https://github.com/arshraeis710-hash/Geospatial_land_classifier.git
cd Geospatial_land_classifier

2. Create a Virtual Environment

python -m venv .venv

3. Activate the Virtual Environment

Windows PowerShell

.\.venv\Scripts\Activate.ps1

Windows Command Prompt

.venv\Scripts\activate.bat

4. Install Dependencies

pip install -r requirements.txt

5. Download the Dataset

Download the EuroSAT RGB dataset and place it inside the archive directory as shown in the folder structure above.

Training the Model

To train the model:

python train.py

After training is completed, the model weights will be saved as:

geospatial_model.pth

Example output:

Training initialized on: cuda
Epoch 1/10 | Loss: 0.5671 | Val Accuracy: 89.37%
...
Model weights successfully saved as geospatial_model.pth

Running Predictions

To classify a satellite image:

python predict.py path/to/image.jpg

Example:

python predict.py archive/EuroSAT_RGB/Highway/Highway_1.jpg

Example output:

Top 3 Predictions:
Highway: 92.14%
River: 5.32%
Residential: 2.54%

Geospatial Analysis Result: Highway

Model Architecture

  • ResNet18
  • Transfer Learning
  • CrossEntropy Loss
  • Adam Optimizer
  • PyTorch

Performance

Training configuration:

  • ResNet18 pretrained on ImageNet
  • 17 training epochs
  • Batch size: 32

Validation Accuracy:

~92% - 93%

## Notes

- The model is designed for satellite and aerial imagery.
- Predictions on ordinary photographs (people, animals, vehicles, etc.) are not meaningful because the   model was trained exclusively on satellite images.
- Best results are achieved with images similar to those found in the EuroSAT dataset.

## Author

"Arsh Raeis Ahmed"

About

Satellite image land-use classification using PyTorch and ResNet18 trained on the EuroSAT dataset.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages