nshaud / DeepHyperX

Deep learning toolbox based on PyTorch for hyperspectral data classification.
Other
439 stars 122 forks source link

Use block-wise spatial sampling for train/test splitting #30

Open nshaud opened 4 years ago

nshaud commented 4 years ago

The current spatially disjoint train/test split divides the image in 2 for each class. However there might be spatial correlations between the pixels for those regions and this approach is not well-suited to repeated runs or cross-validation anyway. A more robust way to perform a spatially disjoint split is to extract random blocks (i.e. windows larger than the model's patch size) with constraints on class percentages.

See e.g. BlockCV that does this kind of thing in R.