PureForest_clone / README.md
longdpkr's picture
Upload README.md with huggingface_hub
2de6027 verified
metadata
license: etalab-2.0
task_categories:
  - image-classification
  - other
tags:
  - Aerial
  - Lidar
  - Point Cloud
  - Forest
  - Tree Species
  - Earth Observation
  - Multimodal
  - IGN
size_categories:
  - 100K<n<1M

PureForest Clone

This is a clone of the original IGNF/PureForest dataset, re-uploaded as zip archives for easier downloading and use.

Original paper: PureForest: A Large-Scale Aerial Lidar and Aerial Imagery Dataset for Tree Species Classification in Monospecific Forests Charles Gaydon, Floryne Roche — IGN, 2024


Dataset Overview

PureForest is the largest publicly available dataset for tree species classification from:

  • ALS (Aerial Lidar Scanning) point clouds — high density: ~40 pts/m²
  • VHR (Very High Resolution) aerial images — 0.2 m resolution, 250×250 pixels, NIRGB channels
Property Value
Total patches 135,569
Coverage 339 km²
Forests 449 distinct monospecific forests
Departments 40 French departments
Semantic classes 13 (grouping 18 tree species)
Patch size 50 m × 50 m

Dataset Structure

PureForest_clone/
├── train.zip        # 69,111 patches (~51.4 GB)
├── val.zip          # 13,523 patches (~10 GB)
├── test.zip         # 52,935 patches (~39.3 GB)
└── metadata/        # Metadata files

Each .npz patch file contains:

  • intensities — Lidar intensity values
  • classes — semantic class label (integer 0–12)
  • Point cloud coordinates (x, y, z) colorized with aerial imagery

File Naming Convention

{SPLIT}-{ClassName}-C{ClassID}-{PatchID}.npz

Example: TRAIN-Quercus_ilex-C1-177_13_242.npz
         TEST-Abies_alba-C9-001_02_015.npz

Semantic Classes

Class ID Species Common Name
0 Quercus (deciduous) Deciduous oak
1 Quercus ilex Evergreen oak
2 Fagus sylvatica Beech
3 Castanea sativa Chestnut
4 Robinia pseudoacacia Black locust
5 Pinus pinaster Maritime pine
6 Pinus sylvestris Scotch pine
7 Pinus nigra Black pine
8 Pinus halepensis Aleppo pine
9 Abies alba Fir
10 Picea abies Spruce
11 Larix decidua Larch
12 Pseudotsuga menziesii Douglas

Train/Val/Test Split Distribution

Class Train Val Test
(0) Deciduous oak 22.92% 32.35% 52.59%
(1) Evergreen oak 16.80% 2.75% 19.61%
(2) Beech 10.14% 12.03% 7.62%
(3) Chestnut 4.83% 1.09% 0.38%
(4) Black locust 2.41% 2.40% 0.60%
(5) Maritime pine 6.61% 7.10% 3.85%
(6) Scotch pine 16.39% 17.95% 8.51%
(7) Black pine 6.30% 6.98% 3.64%
(8) Aleppo pine 5.83% 1.72% 0.83%
(9) Fir 0.14% 5.32% 0.05%
(10) Spruce 3.73% 4.64% 1.64%
(11) Larch 3.67% 3.73% 0.48%
(12) Douglas 0.23% 1.95% 0.20%

Download & Setup

Step 1 — Download zip files

from huggingface_hub import hf_hub_download

for split in ["train", "val", "test"]:
    hf_hub_download(
        repo_id="longdpkr/PureForest_clone",
        filename=f"{split}.zip",
        repo_type="dataset",
        local_dir="./PureForest"
    )

Or using the CLI:

huggingface-cli download longdpkr/PureForest_clone train.zip --repo-type=dataset
huggingface-cli download longdpkr/PureForest_clone val.zip --repo-type=dataset
huggingface-cli download longdpkr/PureForest_clone test.zip --repo-type=dataset

Step 2 — Extract zip files

import zipfile
from pathlib import Path

dataset_dir = Path("./PureForest")

for split in ["train", "val", "test"]:
    zip_path = dataset_dir / f"{split}.zip"
    print(f"Extracting {split}.zip ...")
    with zipfile.ZipFile(zip_path, "r") as zf:
        zf.extractall(dataset_dir)
    print(f"Done: {split}/")

Or manually using WinRAR / 7-Zip.

After extraction, the structure should be:

PureForest/
├── train/
│   ├── TRAIN-Quercus_ilex-C1-xxx.npz
│   └── ...
├── val/
│   ├── VAL-Fagus_sylvatica-C2-xxx.npz
│   └── ...
└── test/
    ├── TEST-Pinus_sylvestris-C6-xxx.npz
    └── ...

Loading Data

Load a single patch

import numpy as np

data = np.load("train/TRAIN-Quercus_ilex-C1-177_13_242.npz")

print(list(data.keys()))     # show available keys
print(data["classes"])       # class label (0-12)

PyTorch Dataset

import numpy as np
import torch
from torch.utils.data import Dataset
from pathlib import Path


class PureForestDataset(Dataset):
    def __init__(self, split="train", data_dir="./PureForest"):
        self.files = sorted(Path(data_dir) / split).glob("*.npz"))
        
    def __len__(self):
        return len(self.files)
    
    def __getitem__(self, idx):
        data = np.load(self.files[idx])
        label = int(data["classes"])
        # add your preprocessing here
        return data, label


train_dataset = PureForestDataset(split="train")
val_dataset   = PureForestDataset(split="val")
test_dataset  = PureForestDataset(split="test")

print(f"Train: {len(train_dataset)} | Val: {len(val_dataset)} | Test: {len(test_dataset)}")

With RandLA-Net

This dataset is compatible with RandLA-Net for point cloud classification. Place extracted folders under the datasets/ directory of your RandLA-Net project:

RandLA-Net/
└── datasets/
    └── PureForest/
        ├── train/
        ├── val/
        └── test/

License

This dataset is a clone of IGNF/PureForest and inherits its original license: Etalab Open License 2.0.


Citation

If you use this dataset in your research, please cite the original paper:

@misc{gaydon2024pureforest,
    title     = {PureForest: A Large-Scale Aerial Lidar and Aerial Imagery Dataset
                 for Tree Species Classification in Monospecific Forests},
    author    = {Charles Gaydon and Floryne Roche},
    year      = {2024},
    eprint    = {2404.12064},
    archivePrefix = {arXiv},
    url       = {https://arxiv.org/abs/2404.12064}
}

Acknowledgements

Original dataset by IGN — Institut national de l'information géographique et forestière. Lidar data from the Lidar HD program. Aerial imagery from ORTHO HR®.