This package is intended for running deep learning classifiers on hyperspectral data for mapping invasive alien plants. Models are pretrained using self-supervision and/or noisy land cover label data and then fine-tuned using point labels.
Currently this package is under heavy development
Current and planned data sources, models and module features are indicated below
- Sentinel 2
- Hyperspectral
- Logging with W&B
- Hyperparameter tuning with W&B sweeps
First, install dependencies
# clone project
git clone https://github.com/GMoncrieff/hyper-iap
# install project
cd hyper-iap
pip install -r requirements.txt
Next, train classifiers using the command line.
python train.py --model_class=vit.simpleVIT
For a full list of command line options run
python train.py --help
You can also import individual modules and incorporate them into python workflows
from lightning import Trainer, seed_everything
from hyperiap.models.vit import simpleVIT
from hyperiap.datasets.xarray_module import XarrayDataModule
from hyperiap.litmodels.litclassifier import LitClassifier
xmod = XarrayDataModule()
model = LitClassifier(simpleVIT(data_config=xmod.config()))
trainer = Trainer(limit_train_batches=5, limit_val_batches=3, max_epochs=2)
trainer.fit(model, datamodule=xmod)
trainer.validate(datamodule=xmod)
The module builds on contributions and implementations from :
- TempCNN - Pelletier et al., 2019
- BreizhCrops - Rußwurm et al., 2019
- ViT - Dosovitskiy et al., 2021
- SpectralFormer - Hong et al., 2021
- Full Stack Deep Learning
- xbatcher
- zen3geo
The land cover labels used from pre-training from