File size: 4,856 Bytes
dc3fb2b
 
 
 
 
 
 
 
 
 
 
 
 
239ec70
f75e736
dc3fb2b
f5f6c39
dc3fb2b
239ec70
 
 
dc3fb2b
 
239ec70
f75e736
dc3fb2b
 
 
 
239ec70
dc3fb2b
 
 
9f9823a
dc3fb2b
f5f6c39
 
dc3fb2b
 
239ec70
dc3fb2b
8d1f3ca
dc3fb2b
 
239ec70
dc3fb2b
 
 
 
 
 
 
239ec70
 
 
 
 
 
 
 
 
dc3fb2b
80416a2
dc3fb2b
 
 
 
 
be8e00d
dc3fb2b
 
 
be8e00d
dc3fb2b
 
 
239ec70
 
 
be8e00d
dc3fb2b
 
 
 
 
 
239ec70
dc3fb2b
 
ce2d4e4
dc3fb2b
 
239ec70
dc3fb2b
 
 
 
 
239ec70
dc3fb2b
239ec70
 
 
 
 
 
6f9fe7b
f5f6c39
239ec70
f5f6c39
239ec70
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
license: cc-by-4.0
tags:
  - semantic-segmentation
  - sentinel-2
  - kelp-mapping
  - pytorch
  - skema
---

# SKeMa: Satellite-based Kelp Mapping

## Model Description

SKeMa is a Python-based tool for semantic segmentation of kelp in Sentinel-2 satellite imagery, developed for coastal monitoring. It uses a deep learning model from the Segmentation Models PyTorch library, with a MaxViT-Tiny-512 encoder and UNet decoder. The model outputs a binary GeoTIFF (kelp = 1, non-kelp = 0).

**Authors**: Mohsen Ghanbari, Neil Ernst, Taylor A. Denouden, Luba Y. Reshitnyk, Piper Steffen, Alena Wachmann, Alejandra Mora-Sotoa, Eduardo Loos, Margot Hessing-Lewis, Nic Dedeluke, Maycira Costa  
**License**: Creative Commons Attribution 4.0 International (CC-BY-4.0)  
**Citation**: SKeMa models by Mohsen Ghanbari et al., SPECTRAL Remote Sensing Laboratory, University of Victoria, DOI: [10.57967/hf/6790](https://huggingface.co/m5ghanba/SKeMa)  
**GitHub**: [m5ghanba/skema](https://github.com/m5ghanba/skema)  
**PyPI**: [skema-kelp](https://pypi.org/project/skema-kelp/)

## Intended Use

- **Primary Use**: Mapping kelp in Sentinel-2 imagery for environmental research and industry applications.
- **Users**: Researchers, coastal ecologists, and industries analyzing Sentinel-2 data.
- **Out of Scope**: Non-Sentinel-2 imagery or non-kelp segmentation tasks.

## Model Architecture

- **Framework**: PyTorch, Segmentation Models PyTorch (SMP) library.
- **Encoder**: MaxViT-Tiny-512.
- **Decoder**: UNet.
- **Input Channels**: 13 (Sentinel-2 bands B2, B3, B4, B8, B5; substrate; bathymetry; slope; spectral indices with the order NDVI; NDWI; GNDVI; ClI; NDVIRE).
- **Model Types**:
  - `model_full`: Uses all 13 channels, including substrate, bathymetry, and slope (optimized for BC coast).
  - `model_s2bandsandindices_only`: Uses Sentinel-2 bands and indices only (no bathymetry/substrate/slope).

## Input Data

- **Required**: Sentinel-2 `.SAFE` folder (download from [Copernicus Browser](https://dataspace.copernicus.eu/)).
- **For `model_full`**: Bathymetry (`Bathymetry.tif`) and substrate TIFFs (`NCC_substrate_20m.tif`, etc.) from BC coast sources (see GitHub README).

## Output Format

- Binary GeoTIFF (`output.tif`): Kelp = 1, non-kelp = 0.
- Intermediate files:
  - `<SAFE_name>_B2B3B4B8.tif`: 10m resolution, 4-band GeoTIFF (B02, B03, B04, B08).
  - `<SAFE_name>_B5B6B7B8A_B11B12.tif`: 20m resolution, 6-band GeoTIFF.
  - For `model_full`: `<SAFE_name>_Bathymetry.tif`, `<SAFE_name>_Substrate.tif`.

## Usage Instructions

### Installation via pip (Recommended)

```bash
pip install skema-kelp
```

### Installation from source

1. **Install**:
   ```bash 
   git clone https://github.com/m5ghanba/skema.git
   cd skema
   python -m venv skema_env
   source skema_env/bin/activate  # On Windows: skema_env\Scripts\activate
   pip install .
   ```
   See [GitHub README](https://github.com/m5ghanba/skema) for detailed setup.

2. **Run**:
   ```bash
   skema --input-dir path/to/sentinel2/safe/folder --output-filename output.tif --model-type model_full
   # Or for S2-only model:
   skema --input-dir path/to/sentinel2/safe/folder --output-filename output.tif --model-type model_s2bandsandindices_only
   
   # For help:
   skema --help
   ```

3. **Dependencies** (from `requirements.txt`):
   - PyTorch (GPU: `torch==2.1.0`, see GitHub for CUDA setup).
   - Others: `numpy`, `rasterio`, `segmentation-models-pytorch`.

## Training Data

- **Source**: Sentinel-2 imagery from Copernicus Browser, BC coast bathymetry/substrate data.
- **Region**: Optimized for British Columbia coastal waters.
- **Note**: Bathymetry/substrate files required for `model_full` are available online (see GitHub README).

## Limitations

- Optimized for BC coast; performance may vary elsewhere.
- `model_full` requires specific bathymetry/substrate data.
- Assumes Sentinel-2 `.SAFE` format input.

## Citation

Please cite as:

> SKeMa model by Mohsen Ghanbari et al., SPECTRAL Remote Sensing Laboratory, University of Victoria, DOI: [10.57967/hf/6790](https://huggingface.co/m5ghanba/SKeMa).

**BibTeX:**

```bibtex
@software{skema_2026,
  author       = {Mohsen Ghanbari, Neil Ernst, Taylor A. Denouden, Luba Y. Reshitnyk, Piper Steffen, Alena Wachmann, Alejandra Mora-Sotoa, Eduardo Loos, Margot Hessing-Lewis, Nic Dedeluke, Maycira Costa},
  title        = {SKeMa: Satellite-based Kelp Mapping using Semantic Segmentation on Sentinel-2 imagery},
  year         = 2026,
  publisher    = {Hugging Face},
  doi          = {10.57967/hf/6790},
  url          = {https://huggingface.co/m5ghanba/SKeMa}
}
```

## Links

- **PyPI Package**: https://pypi.org/project/skema-kelp/
- **GitHub Repository**: https://github.com/m5ghanba/skema
- **Documentation**: https://github.com/m5ghanba/skema#readme
- **Issues/Support**: https://github.com/m5ghanba/skema/issues