# Senegal Land Cover & Crop Classification Pipeline
A unified, config-driven pipeline for pixel-level land cover and crop-type classification of Senegal satellite imagery. Supports five feature extraction approaches, five classifier types, multi-seed ensemble aggregation, and whole-map inference.
---
## Table of Contents
1. Overview
2. Repository Structure
3. Installation
4. Quick Start
5. Configuration Reference
6. Feature Approaches
7. Classification Tasks
8. Models
9. Training Strategies
10. Analysis Scripts
11. Visualization
12. Output Files
13. Data Requirements
---
## Overview
This pipeline was refactored from a collection of ~30 single-purpose scripts into a modular package. All behaviour is controlled through a single `config.yaml` file — no source edits are required to switch approaches, years, or models.
The pipeline supports:
- **Two classification tasks**: land cover (8 classes) and main crop type (7 classes)
- **Five feature approaches**: raw Sentinel-2 + SAR time series, Tessera representations, spectral-temporal metrics (STM), AlphaEarth EFMs, and spectral matching NDVI
- **Five classifier types**: Random Forest, Logistic Regression, XGBoost, SVM, MLP
- **Multi-seed ensemble aggregation**: train N models with different random seeds, average their probability outputs
- **Whole-map inference**: classify every pixel in the scene, not just labelled fields
- **Three analysis utilities**: year-on-year change detection, cropland combo mask generation, accuracy summarization
---
## Repository Structure
```
senegal_kinabalu/
│
├── classify.py # Main pipeline entry point
├── config.yaml # All run settings (edit this, not the source)
│
├── utils/
│ ├── data_loading.py # Config loading, label loading, per-approach feature loaders
│ ├── geo_utils.py # GeoTIFF conversion, raster clipping, chunk grid, save helpers
│ ├── preprocessing.py # Train/val/test splitting, SMOTE, label remapping, safe stacking
│ └ …