How yannasyr/landcover works
Project type and purpose
• This is a machine-learning pipeline for land-cover segmentation from satellite images, built to train, evaluate, and submit predictions for the ENS Challenge Data 2021.
• It comprises exploratory notebooks, a training codebase, and scripts to generate the CSV submission.
File structure
Top-level:
• archives/ – Jupyter notebooks and exploratory scripts used for early data visualization and proof-of-concept.
• csv_output/ – Scripts that load a trained model, run inference on test images, and write the challenge-format CSV.
• training/ – Core production code: data loading, preprocessing, model definitions, training loop, evaluation, and utilities.
• requirements.txt – Python dependencies.
Inside training/:
• LandCoverData.py & Landscapedata.py – custom Dataset implementations for train/test.
• normalisation.py & utils.py – preprocessing and helper functions.
• models.py – network architectures (e.g., SegFormer or U-Net variants).
• lossesSegFormerRGB.txt – loss function notes.
• train.py & main.py & arg_parser.py – CLI entry points to kick off training with configurable hyperparameters.
• metrics.py – evaluation metrics (IoU, accuracy).
Insights from the README
• The workflow expects a “dataset_UNZIPPED” folder with train/images, train/masks, and test/images.
• You install dependencies, then run the training module to produce a model checkpoint.
• The csv_output scripts convert model outputs on the test set into the submission CSV.
a. Main components:
1. Data Storage
• Raw GeoTIFF files (train images, train masks, test images)
2. Experimentation/Exploration
• Jupyter notebooks under archives/ for visual inspection and prototyping
3. Preprocessing & Data Loader
• normalisation.py, augmentation routines, LandCoverData.py / Landscapedata.py
4. Model Architectures
• models.py defines one or more segmentation models
5. Training Engine
• train.py, main.py with argument parsing, orchestrating epochs, checkpointing
6. Evaluation
• metrics.py computes IoU, accuracy on validation set
7. Inference & Submission
• csv_output scripts load checkpoints, run inference on test images, assemble CSV
b. Relationships and interactions
• Training Engine → Model Architectures (models are instantiated)
• Training Engine → Evaluation → Feedback to Training Engine (early stopping, logging)
• Trained Model Checkpoints → Inference & Submission
• Archives notebooks connect to Data Storage for ad-hoc analysis but do not feed into production pipeline.
c. Architectural patterns and design principles
• Layered / pipeline pattern: clear stages (Ingest → Preprocess → Train → Evaluate → Export)
• Separation of concerns: data handling, model definition, training logic, evaluation, submission are in separate modules
• CLI-driven reproducibility: arg_parser.py / main.py let you configure experiments from the command line
d. Key technologies
• Python 3.x
• Deep learning framework (e.g., PyTorch or TensorFlow; as listed in requirements.txt)
• NumPy, GDAL or rasterio for GeoTIFF I/O
• Pandas for CSV output
• Jupyter for notebooks