Skip to content

YuhaoLin2005/landcover-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Landcover Classifier

Automated land cover classification: Landsat 8/9 OLI → Decision Tree + Random Forest → 5-class map.

Cross-validated: Both methods run independently, then compared pixel-by-pixel. Only disagreement pixels (~3%) need human review.

Quick Start

pip install -r requirements.txt
python tests/test.py                        # Verify environment
python classify.py --config config/fuzhou.yaml --image your_image.tif

How It Works

7-band Landsat + DEM + Slope + Road Density
        │
        ├──→ Decision Tree (10-step priority rules, white-box)
        │         ↓
        ├──→ Random Forest (100 trees, DT-guided core sampling)
        │         ↓
        └──→ Cross-Validation: compare every pixel
                  │
           96-98% agree (auto-pass)
            2-4% disagree → interactive HTML review
                  │
              Post-process (native tools preferred)
                  │
              Final 5-class GeoTIFF + Accuracy Report

For a New City

1. Search: "{city} land cover NDVI threshold remote sensing site:scholar.google.com"
2. Copy config/template.yaml → config/{city}.yaml
3. Adjust thresholds from literature (each parameter has valid range)
4. Run classification
5. Review ROI candidates in roi_review.html
6. Review disagreement points in accuracy_review.html

File Structure

├── SKILL.md               ← AI agent entry point
├── classify.py            ← Main entry
├── core/                  ← Classification engines
├── tools/                 ← ROI sampling, agreement, accuracy
├── templates/             ← Interactive HTML + JSON log
├── config/                ← City-specific parameters
├── tests/                 ← Verification data
└── docs/                  ← Adaptation guide

Requirements

  • Python 3.8+
  • GDAL (command-line tools)
  • ArcGIS (optional, for native post-processing)
  • scikit-learn, numpy, scipy

About

Landsat 8/9 OLI → 5-class land cover: Decision Tree + Random Forest cross-validation with 96.98% agreement. Interactive HTML review. Adaptable to any city.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors