Skip to main content

InputPreprocessing

The input_preprocessing key of the config.

Defines how input tensors are prepared before being provided to the model. Each training dataset split (train, val, test) can have its own preprocessing configuration, as can input data at inference ("predict") time. All take their base configuration from "default", which can be overridden for each group.

FieldTypeRequiredDefaultDescription
defaultDefaultInputPreprocessingyesDefault input preprocessing configuration
trainTrainInputPreprocessingnonull
valValTestSplitInputPreprocessingnonull
testValTestSplitInputPreprocessingnonull
predictPredictInputPreprocessingnonull

DefaultInputPreprocessing

Controls how windows are processed before being provided to the model.

This class applies default rules to all training-time splits (train/val/test), as well as the predict preprocessor at inference time. Most values can be overriden by the non-default preprocessors.

CONCEPTUAL OVERVIEW:

Raw windows are not passed directly into the model during forward passes. They are first cropped or tiled into "inputs", which may subsequently be transformed by one or more transformation functions, serially. Each "input" is treated as an independent item in a batch to the model.

A config author can define input_size to specify the edge length of each square crop, as well as input_mode, which determines whether the model will see a single random crop or the full grid of cropped inputs. Desired behavior here is variable based on the model, the data split, and whether we are performing fine-tuning or inference.

The size of the windows being provided to preprocessors is determined as follows:

  • training time: labeled_data_prep.window_preparer
  • inference time: prediction_requests.partitioners

SCENARIOS:

Window size == input_size
═════════════════════════════════════════════════════════

input_mode has no practical effect — one input either way.

window
┌──────────┐
│ │
│ input │ input_size × input_size
│ (=window)│
│ │
└──────────┘
Window size > input_size
════════════════════════════════════════════════════════════════════
input_mode: all_tiles             input_mode: single_random_crop
───────────────────── ──────────────────────────────
Tile the full window with         Take ONE random input from
a grid of inputs (complete the window (used during
spatial coverage). training for augmentation
via random positioning).
window                            window
┌───────────────────────────┐ ┌───────────────────────────┐
│ ┌──────────┬──────────┐ │ │░░░░░░░░░░░░░░░░░░░░░░░░░░│
│ │ │ │ │ │░░░░░░░░░░░░░░░░░░░░░░░░░░│
│ │ input 1 │ input 2 │ │ │░░░░┌──────────┐░░░░░░░░░░│
│ │ │ │ │ │░░░░│ │░░░░░░░░░░│
│ ├──────────┼──────────┤ │ │░░░░│ random │░░░░░░░░░░│
│ │ │ │ │ │░░░░│ input │░░░░░░░░░░│
│ │ input 3 │ input 4 │ │ │░░░░│ │░░░░░░░░░░│
│ │ │ │ │ │░░░░└──────────┘░░░░░░░░░░│
│ └──────────┴──────────┘ │ │░░░░░░░░░░░░░░░░░░░░░░░░░░│
└───────────────────────────┘ └───────────────────────────┘
Each input is input_size          Input is input_size × input_size
× input_size. Edge inputs at a random position.
may overlap at predict time ░ = window pixels not seen
(see PredictInputPreprocessing by the model in this pass.
.overlap_pixels).
Window size < input_size
═════════════════════════════════════════════════════════

INVALID — raises an error at runtime. The window must be at least as large as input_size.

NOTE:

input_mode is inherited by the val and test splits (unless overridden per-split), however:

  • train always uses single_random_crop
  • predict always tiles
FieldTypeRequiredDefaultDescription
input_sizeinteger (≥ 1)yesSide length of the square input fed to the model.
input_modeInputModeyesHow windows are converted to model inputs. all_tiles: tile the full window with a grid of inputs (complete spatial coverage). single_random_crop: take one random input from the window (training augmentation via random positioning). Inherited by val/test splits unless overridden per-split. Train always uses single_random_crop regardless of this setting. Predict always tiles regardless of this setting.
transformsarray of TransformnonullThe transforms to apply to the input tensors before they are provided to the model.

TrainInputPreprocessing

Training split must always use single random crop.

FieldTypeRequiredDefaultDescription
transformsarray of TransformnonullTransforms to apply to inputs. Replaces default transforms; takes precedence over additional_transforms.
additional_transformsarray of TransformnonullAdditional transforms to apply beyond the default transforms.
samplerTrainingSamplernonullSamples down the data to a smaller set based on the given strategy.
input_mode"single_random_crop"no"single_random_crop"

ValTestSplitInputPreprocessing

FieldTypeRequiredDefaultDescription
transformsarray of TransformnonullTransforms to apply to inputs. Replaces default transforms; takes precedence over additional_transforms.
additional_transformsarray of TransformnonullAdditional transforms to apply beyond the default transforms.
samplerTrainingSamplernonullSamples down the data to a smaller set based on the given strategy.
input_modeInputModenonullHow windows are converted to model inputs. Overrides the default value for this split.

PredictInputPreprocessing

Preprocessing overrides for the predict (inference) split.

overlap_pixels controls how much adjacent inputs overlap when tiling a window. Used to reduce boundary artifacts in dense prediction (i.e. segmentation, per-pixel regression, embeddings)::

overlap_pixels = 0                         overlap_pixels > 0
──────────────────────────────────── ───────────────────────────────────────
window                                    window
┌─────────────────────────────────┐ ┌─────────────────────────────────────┐
│ ┌──────────────┬──────────────┐ │ │ ┌──────────────┬────┬──────────────┐ │
│ │ │ │ │ │ │ │····│ │ │
│ │ │ │ │ │ │ │····│ │ │
│ │ input 1 │ input 2 │ │ │ │ input 1 │····│ input 2 │ │
│ │ │ │ │ │ │ │····│ │ │
│ │ │ │ │ │ │ │····│ │ │
│ ├──────────────┼──────────────┤ │ │ ├──────────────┼────┼──────────────┤ │
│ │ │ │ │ │ │··············│····│··············│ │
│ │ │ │ │ │ ├──────────────┼────┼──────────────┤ │
│ │ input 3 │ input 4 │ │ │ │ │····│ │ │
│ │ │ │ │ │ │ │····│ │ │
│ │ │ │ │ │ │ input 3 │····│ input 4 │ │
│ └──────────────┴──────────────┘ │ │ │ │····│ │ │
└─────────────────────────────────┘ │ │ │····│ │ │
│ └──────────────┴────┴──────────────┘ │
No shared pixels between └─────────────────────────────────────┘
adjacent inputs.
···· = overlap region seen by
adjacent inputs; predictions
merged by the postprocessor.
FieldTypeRequiredDefaultDescription
overlap_pixelsinteger (≥ 0)no0Overlap between adjacent inputs when tiling; also used when merging inference outputs. Not relevant for vector-based tasks.
transformsarray of TransformnonullTransforms to apply to inputs. Replaces default transforms; takes precedence over additional_transforms.
additional_transformsarray of TransformnonullAdditional transforms to apply beyond the default transforms.

InputMode

Allowed values: "single_random_crop", "all_tiles"

Transform

One of the following, selected by its name field:

nameType
manualEscapeHatchComponent
olmoearth_normalizeOlmoEarthNormalize
random_flipRandomFlip
sentinel1_to_decibelsSentinel1ToDecibels

TrainingSampler

One of the following, selected by its name field:

nameType
randomRandomSampler

OlmoEarthNormalize

FieldTypeRequiredDefaultDescription
name"olmoearth_normalize"yes

RandomFlip

FieldTypeRequiredDefaultDescription
name"random_flip"yes
xbooleannotrueFlip the image horizontally
ybooleannotrueFlip the image vertically

Sentinel1ToDecibels

Convert Sentinel-1 RTC data from linear to decibel scale.

FieldTypeRequiredDefaultDescription
name"sentinel1_to_decibels"yes

RandomSampler

FieldTypeRequiredDefaultDescription
name"random"yes
num_samplesinteger (≥ 0)yesThe number of samples to take
replacebooleannofalseWhether sampled items can be sampled again