Skip to content

Based on a given image it identifies its different geological terrain.

Notifications You must be signed in to change notification settings

cosypix/Geo-Engine-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌲 Campus Forest Classification using Satellite Imagery

A machine learning-based land cover classification project that identifies Forest and Non-Forest regions on a university campus using Sentinel-2 satellite imagery and Google Earth Engine.

Python Earth Engine


📍 Study Area

University campus region defined using a custom polygon boundary (centered at approximately 80.02°E, 23.17°N).


🛰️ Data Source

  • Satellite: Sentinel-2 Surface Reflectance (COPERNICUS/S2_SR_HARMONIZED)
  • Date Range: November 2025 - January 2026
  • Cloud Filter: < 30% cloudy pixel percentage

🧹 Preprocessing

  • Cloud masking using QA60 band
  • Median composite generation
  • NDVI calculation: (B8 - B4) / (B8 + B4)

🤖 Classification Models

Three classifiers trained on manually digitized points:

  • Random Forest - ee.Classifier.smileRandomForest(150)
  • SVM - ee.Classifier.libsvm()
  • XGBoost - ee.Classifier.smileGradientTreeBoost(10)

Labels:

  • Forest = 1
  • Non-Forest = 0

📊 Model Comparison

All models trained with 70/30 train-test split.

Model Algorithm Accuracy Kappa Confusion Matrix
Random Forest smileRandomForest(150) 0.9230 0.8454 [[20, 3], [0, 16]]
SVM libsvm 0.9574 0.9126 [[19, 1], [1, 26]]
XGBoost smileGradientTreeBoost(10) 0.9761 0.9523 [[20, 1], [0, 21]]

Confusion Matrix Format: [[TN, FP], [FN, TP]]


� Project Structure

├── notebooks/
│   ├── random_forest/
│   │   └── forest_classification.ipynb
│   ├── svm/
│   │   └── forest_classification.ipynb
│   └── xg_boost/
│       └── forest_classification.ipynb
├── scripts/
│   └── classify_forest.py
├── .env
├── .gitignore
├── requirements.txt
└── README.md

⚙️ Installation

Prerequisites

  • Python 3.10+
  • Google Earth Engine account

Setup

  1. Clone the repository

    git clone <repository-url>
    cd <project-directory>
  2. Create virtual environment & install dependencies

    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
  3. Authenticate Earth Engine

    earthengine authenticate
  4. Configure environment

    Create a .env file:

    EE_PROJECT_ID=your-earth-engine-project-id

🚀 Usage

Run Notebooks

jupyter notebook

Open any notebook in notebooks/ directory and run all cells.

Run Script

python scripts/classify_forest.py

🗺️ Output

Binary classification map:

  • 🌲 Dark Green = Forest
  • Light Gray = Non-Forest

Made with ❤️ using Google Earth Engine

About

Based on a given image it identifies its different geological terrain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •