--- dataset_info: features: - name: image dtype: image - name: idx dtype: int64 - name: label dtype: string - name: longitude dtype: float64 - name: latitude dtype: float64 - name: easting dtype: float64 - name: northing dtype: float64 - name: elevation dtype: float64 - name: time dtype: int64 - name: cluster dtype: int64 configs: - config_name: labelled drop_labels: false data_files: - split: train path: - data/train/**/*.tif - data/train/metadata.csv - split: test path: - data/test/**/*.tif - data/test/metadata.csv - config_name: unlabelled data_files: - split: train path: - "data/orthomosaic/*.tif" --- # Background Leafy Spurge Dataset is a collection of top-down aerial images of grasslands in western Montana, USA. We surveyed a 150-hectare study area with a DJI Mavic 3M Drone from 50m above the ground surface and we assembled the images into a contiguous orthomosaic using Drone Deploy software. Many scenes in the study area contain a weed plant, leafy spurge (*Euphorbia esula*), which upsets the ecology of areas throughout North America. Botanists visited 1000 sites in the study area and gathered ground truth of leafy spurge presence/absence within 0.5 x 0.5 m plots. The position of these plots was referenced within the orthomosaic and these areas were cropped from the larger image. The resulting processed data are 1024 x 1024 pixel .tif files, though note the labelled areas correspond to the 39 x 39 pixel square (half-meter side length) found at the center of these crops. We include the context around the ground truth areas for experimental purposes. Our primary objective in serving these data is to invite the research community to develop classifiers that are effective early warning systems of spurge invasion at the highest spatial resolution possible. # Data loading and pre-processing As a Hugging Face dataset, you may load Leafy Spurge training set as follows: ```python from datasets import load_dataset ds = load_dataset('mpg-ranch/leafy_spurge', 'labelled', split='train') ds['image'][405] ``` We will now center crop the image to the size of the ground truth: ```python from torchvision.transforms import CenterCrop, Compose ground_truth_sz = 39 ccrop = Compose([CenterCrop(ground_truth_sz)]) def preproc_transforms(examples): examples["pixel_values"] = [ccrop(image.convert("RGB")) for image in examples["image"]] return examples ds = ds.map(preproc_transforms, batched=True) ds['pixel_values'][405] ``` # Geographic splits within the training set We gathered ground truth data at multiple sites, and observations within a site were geographically clustered. We suggest using the cluster feature as a means to establish holdout sets for cross-validated hyperparameter tuning. This will simluate model performance when classifying leafy spurge at new sites (such as those of the test set). You can filter by cluster metadata as follows: ```python #define holdout sets with ground truth clusters; 6 and 7 overlap geographically holdout_sets = [[0], [1], [2], [4], [5], [6,7], [8]] set_0 = ds.filter(lambda example: example['cluster'] in holdout_sets[0]) set_0['cluster'] ```