Train/validation split
Train/validation split
Overview
Splits a dataset’s images, with their annotations, into train and validation datasets, plus a test dataset when you select one. Operation mode decides whether the images stay in the source (Copy) or leave it (Move).
The train and validation datasets don’t need to exist beforehand.
Left empty, each is the node’s own output dataset, Train split or Val split, and a rerun
writes a new version of each instead of creating another set. The test split exists only when
you select a test dataset.
Use it to split the data before training.
Prerequisites
How it works
Uses the destination datasets you select. For a train or validation split not given, it takes its own output dataset for that split — created on the first run, a new empty version of it on a rerun.
Skips images already found in any selected destination. Only unassigned source images enter the new split.
Shuffle data randomizes those images by default.
Without a test set, training gets 80% by default and validation gets the rest.
With a test set, the default is 70/15/15 for train, validation, and test.
All three values must be positive integers that add up to 100.
FAQ
What data can this node split?
It splits images only. Videos stay in the source, and the node does not balance the split by class. There is no setting for a random seed, so separate shuffled runs can produce different splits.
Why is a ratio rejected or a split empty?
The ratio format or total is invalid, or too few unassigned images remain after rounding. Use valid percentages and make sure every enabled split gets at least one image.
Why did a rerun leave existing images where they were?
Ratios apply only to images handled in the current run. The node skips images already found in any destination you selected, and it does not duplicate or rebalance earlier assignments when you change the ratios or Shuffle data. If no unassigned images remain, a rerun returns the selected datasets unchanged. To split the full set again, start with a source that contains all images and use fresh destination datasets.
What does a rerun do with the node's own split datasets?
Each rerun starts a new, empty version of every split dataset the node created, so nothing counts as already split and every image in the source is split again. Earlier splits stay in the version history. With Move, the images an earlier run moved out are no longer in the source, so the new versions receive only the images added to the source since then, and the run fails when the source is empty. Select your own destination datasets when later runs should only add new images to an existing split.
What metadata do destination datasets keep?
Each destination receives the source class list without losing its existing classes. A split dataset the node created is pinned to the source’s ontology, while a destination you selected keeps its own ontology, widened with the source’s classes.
Inputs
Dataset whose images are split. Images that already sit in a split dataset you selected are left where they are, so a rerun into it only handles what is new. Key: SRC_DATASET.
Where the train images go. Leave empty to use the node’s own train output dataset. Key: TRAIN_DATASET.
Where the validation images go. Leave empty to use the node’s own validation output dataset. Key: VAL_DATASET.
Name a dataset here to add a third, test split. Leave empty to split into train and validation only. Key: TEST_DATASET.
Percentage of new images for the train split. The remaining new images go to validation. Minimum: 1. Maximum: 100. Step: 1. Visible when TEST_DATASET is empty. Key: TRAIN_SPLIT_RATIO.
Three slash-separated percentages for train, validation, and test, for example 70/15/15. Split values must sum to 100. Visible when TEST_DATASET is not empty. Key: SPLIT_RATIOS.
Mix the images up before cutting them into splits. Turn this off to split them in the order they come in. Key: RANDOM.
Copy leaves the images in the source dataset as well. Move takes them out of it. Key: OPERATION_MODE.
Options:
- Move (
move) - Copy (
copy)
Outputs
ID of the train dataset. Shown as an artifact. Key: TRAIN_DATASET.
ID of the validation dataset. Shown as an artifact. Key: VAL_DATASET.
ID of the test dataset. Shown as an artifact. Key: TEST_DATASET.
JSON config
Machine-readable node interface for automation and advanced usage.