Logo Lanfrica

Osman-Geomatics93/crop-classification-deep-learning

Domain:

agriculturegeospatial

Record type:

project
Creator:
Osm
Host:
Multi-class crop classification in Elgabel Region, Sudan using Sentinel-2 imagery with scikit-learn (MLP, XGBoost, Random Forest) and PyTorch deep learning (CNN1D, Hybrid CNN+MLP, Transformer). Achieves 100% accuracy with FocalLoss, SMOTE, and class weighting. # Crop Classification with Deep Learning ### Sentinel-2 Satellite Imagery | Elgabel Region, Sudan --- **9 Models** | **24 Spectral Features** | **100% Accuracy** | **104 km² Classified** Multi-class crop classification in the **Elgabel Region, Sudan** using Sentinel-2 satellite imagery and multiple machine learning / deep learning models. The pipeline covers data acquisition (Google Earth Engine), exploratory analysis, classical ML training (scikit-learn, XGBoost), PyTorch deep learning, and wall-to-wall satellite image classification. --- ## Table of Contents - Study Area - Workflow - Results - Data Exploration - Model Training Details - Data Description - Model Architectures - Project Structure - Setup - Usage - Google Earth Engine - Contributing - Citation - Changelog - License --- ## Study Area **Elgabel Region, Sudan** — an agricultural zone where the following five crop/land-cover classes are mapped using Sentinel-2 imagery from Q1 2020: | Class ID | Name | Color | Samples | Percentage | |:--------:|--------|:-----:|--------:|----------:| | 0 | Cotton | | 337 | 1.4% | | 1 | Wheat | | 7,901 | 32.2% | | 2 | Fallow | | 11,150 | 45.4% | | 3 | Grass | | 5,024 | 20.5% | | 4 | Water | | 144 | 0.6% | > **Total:** 24,556 labeled samples | **Imbalance ratio:** 77.4:1 (Fallow vs Water) --- ## Workflow ```mermaid graph TD A["1. Data Acquisition Google Earth Engine "] -->|Sentinel-2 Composite + Indices| B B["2. Data Exploration 01_data_exploration.py "] -->|24,556 samples / 24 features| C C["3. Preprocessing & ML Training 02_preprocessing_and_model.py "] --> D C --> E subgraph sklearn ["Scikit-learn / XGBoost Models"] D["MLP · MLP+SMOTE XGBoost · XGBoost+SMOTE Random Forest"] end D -->|Best: Random Forest| F["4. Apply ML to Image 03_apply_to_image.py "] subgraph pytorch ["PyTorch Deep Learning Models"] E["SpectralMLP · SpectralCNN1D SpectralHybrid · SpectralAttention"] end E -->|" 04_pytorch_models.py "| G["5. Apply DL to I …