File size: 7,662 Bytes
30d31c2 271b41d 7d59e9e 271b41d 337ef99 271b41d 337ef99 271b41d 71a3679 271b41d ccf89e3 337ef99 30d31c2 71a3679 271b41d 30d31c2 271b41d 337ef99 30d31c2 271b41d 30d31c2 337ef99 b4fac0d 337ef99 271b41d 337ef99 30d31c2 337ef99 dbcc455 71a3679 271b41d b4fac0d 271b41d |
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 123 124 125 126 127 128 129 130 131 132 133 134 135 |
---
license: cc-by-nc-4.0
---
# ๐ฒ AGBD: A Global-scale Biomass Dataset ๐ณ
Authors: Ghjulia Sialelli ([[email protected]](mailto:[email protected])), Torben Peters, Jan Wegner, Konrad Schindler
## ๐ Updates
* The dataset was last modified on **Dec. 4th, 2024**
* See the [changelog](changelog.md) for more information about what was updated!
## ๐ Quickstart
To get started quickly with this dataset, use the following code snippet:
```python
# Install the datasets library if you haven't already
!pip install datasets
# Import necessary modules
from datasets import load_dataset
# Load the dataset
dataset = load_dataset('prs-eth/AGBD', trust_remote_code=True, streaming=True)["train"] # Options: "train", "validation", "test"
# Iterate over the dataset
for sample in dataset:
features, label = sample['input'], sample['label']
```
This code will load the dataset as an `IterableDataset`. You can find more information on how to work with `IterableDataset` objects in the [Hugging Face documentation](https://huggingface.co/docs/datasets/access#iterabledataset).
---
## ๐ Dataset Overview
Each sample in the dataset contains a **pair of pre-cropped images** along with their corresponding **biomass labels**. For additional resources, including links to the preprocessed uncropped data, please visit the [project page on GitHub](https://github.com/ghjuliasialelli/AGBD/).
### โ๏ธ Load Dataset Options
The `load_dataset()` function provides the following configuration options:
- **`norm_strat`** (str) : `{'pct', 'mean_std', 'none'}` (default = `'pct'`)
The strategy to apply to process the input features. Valid options are: `'pct'`, which applies min-max scaling with the 1st and 99th percentiles of the data; `'mean_std'` which applies Z-score normalization; and `'none'`, which returns the un-processed data.
- **`encode_strat`** (str) : `{'sin_cos', 'onehot', 'cat2vec', 'none'}` (default = `'sin_cos'`)
The encoding strategy to apply to the land classification (LC) data. Valid options are: `'onehot'`, one-hot encoding; `'sin_cos'`, sine-cosine encoding; `'cat2vec'`, cat2vec transformation based on embeddings pre-computed on the train set.
- **`input_features`** (dict)
The features to be included in the data, the default values being:
```
{'S2_bands': ['B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B8A', 'B09','B11', 'B12'],
'S2_dates' : False, 'lat_lon': True, 'GEDI_dates': False, 'ALOS': True, 'CH': True, 'LC': True,
'DEM': True, 'topo': False}
```
- **`additional_features`** (list) (default = `[]`)
A list of additional features the dataset should include. *Refer to the [documentation below](#add-feat-anchor) for more details.* Possible values are:
```
['s2_num_days', 'gedi_num_days', 'lat', 'lon', 'agbd_se', 'elev_lowes', 'leaf_off_f', 'pft_class', 'region_cla', 'rh98', 'sensitivity', 'solar_elev', 'urban_prop']
```
This metadata can later be accessed as such:
```
from datasets import load_dataset
dataset = load_dataset('AGBD.py',trust_remote_code=True,streaming=True)
for sample in dataset['train']:
lat = sample['lat']
break
```
- **`patch_size`** (int) (default =`15`)
The size of the returned patch (in pixels). The maximum value is **25 pixels**, which corresponds to **250 meters**.
---
### ๐ผ๏ธ Features Details
Each sample consists of a varying number of channels, based on the `input_features` and `encode_strat` options passed to the `load_dataset()` function. The channels are organized as follows:
| Feature | Channels | Included by default?| Description |
| --- | --- | --- | --- |
| **Sentinel-2 bands** | `B01, B02, B03, B04, B05, B06, B07, B08, B8A, B09, B11, B12` | Y | Sentinel-2 bands, in Surface Reflectance values |
| **Sentinel-2 dates** | `s2_num_days, s2_doy_cos, s2_doy_sin` | N | Date of acquisition of the S2 image (in number of days wrt the beginning of the GEDI mission); sine-cosine encoding of the day of year (DOY).|
| **Geographical coordinates** | `lat_cos, lat_sin, lon_cos, lon_sin` | Y | Sine-cosine encoding of the latitude and longitude.|
| **GEDI dates** | `gedi_num_days, gedi_doy_cos, gedi_doy_sin` | N | Date of acquisition of the GEDI footprint (in number of days wrt the beginning of the GEDI mission); sine-cosine encoding of the day of year (DOY).|
| **ALOS PALSAR-2 bands** | `HH,HV` | Y | ALOS PALSAR-2 bands, gamma-naught values in dB.|
| **Canopy Height** | `ch, ch_std`| Y | Canopy height from Lang et al. and associated standard deviation. |
| **Land Cover Information** | `lc_encoding*, lc_prob`| Y | Encoding of the land class, and classification probability (as a percentage between 0 and 1).|
| **Topography** | `slope, aspect_cos, aspect_sin` | N | Slope (percentage between 0 and 1); sine-cosine encoded aspect of the slope.|
| **Digital Elevation Model (DEM)** | `dem` | Y | Elevation (in meters).|
This corresponds to the following value for `input_features` :
```
{'S2_bands': ['B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B8A', 'B09','B11', 'B12'],
'S2_dates' : False, 'lat_lon': True, 'GEDI_dates': False, 'ALOS': True, 'CH': True, 'LC': True,
'DEM': True, 'topo': False}
```
Regarding `lc_encoding*`, the number of channels follows this convention:
- `sin_cos` (default) : 2 channels
- `cat2vec` : 5 channels
- `onehot` : 14 channels
- `none` : 1 channel
Should you get stuck, you can debug the number of channels using the `compute_num_features()` function in [AGBD.py](AGBD.py).
In summary, the channels are structured as follows:
```plaintext
(Sentinel-2 bands) | (Sentinel-2 dates) | (Geographical coordinates) | (GEDI dates) | (ALOS PALSAR-2 bands) | (Canopy Height) | (Land Cover Information) | (Topography) | DEM
```
---
### โ Additional Features
<a name="add-feat-anchor"></a>
You can include a list of additional features from the options below in your dataset configuration:
- **`"agbd_se"` - AGBD Standard Error**: The uncertainty estimate associated with the aboveground biomass density prediction for each GEDI footprint.
- **`"elev_lowes"` - Elevation**: The height above sea level at the location of the GEDI footprint.
- **`"leaf_off_f"` - Leaf-Off Flag**: Indicates whether the measurement was taken during the leaf-off season, which can impact canopy structure data.
- **`"pft_class"` - Plant Functional Type (PFT) Class**: Categorization of the vegetation type (e.g., deciduous broadleaf, evergreen needleleaf).
- **`"region_cla"` - Region Class**: The geographical area where the footprint is located (e.g., North America, South Asia).
- **`"rh98"` - RH98 (Relative Height at 98%)**: The height at which 98% of the returned laser energy is reflected, a key measure of canopy height.
- **`"sensitivity"` - Sensitivity**: The proportion of laser pulse energy reflected back to the sensor, providing insight into vegetation density and structure.
- **`"solar_elev"` - Solar Elevation**: The angle of the sun above the horizon at the time of measurement, which can affect data quality.
- **`"urban_prop"` - Urban Proportion**: The percentage of the footprint area that is urbanized, helping to filter or adjust biomass estimates in mixed landscapes.
- **`"gedi_num_days"` - Date of GEDI Footprints**: The specific date on which each GEDI footprint was captured, adding temporal context to the measurements.
- **`"s2_num_days"` - Date of Sentinel-2 Image**: The specific date on which each Sentinel-2 image was captured, ensuring temporal alignment with GEDI data.
- **`"lat"` - Latitude**: Latitude of the central pixel.
- **`"lon"` - Longitude**: Longitude of the central pixel. |