Skip to content

Training, validation and test splits for video: how data leakage happens across clips

Cutting long recordings into clips makes data leakage easy: near-identical footage slips into both training and test sets, and test scores stop meaning anything. Here's how it happens and how to split video safely.

By Ashleigh Johnson,

Splitting video by clip spreads one recording across train and test sets; splitting by source keeps each recording in one split.

Data leakage happens when the test set contains footage the model has already seen in training, or footage so similar it might as well have. In video, the usual cause is splitting by clip instead of by source recording. Keep every clip from one recording, event or contributor in the same split, and most leakage disappears.

Every model is trained on one slice of data, tuned on a second and judged on a third: the training, validation and test splits. The rule is simple. The test set must contain nothing the model has already seen. With video, that rule is surprisingly easy to break.

What is data leakage in video datasets?

Data leakage is any route by which information from the test set reaches the model during training. Shachar Kaufman, Saharon Rosset and Claudia Perlich set out a formal definition in their 2012 paper Leakage in Data Mining: Formulation, Detection, and Avoidance. The problem is widespread: a 2023 review by Sayash Kapoor and Arvind Narayanan of Princeton University, published in the journal Patterns, found leakage in 294 papers across 17 scientific fields.

Video makes leakage easier because one recording becomes many samples. A common division is 80% of the data for training and 10% each for validation and test. At 30 frames per second, a one-minute recording holds 1,800 frames. Cut it into five-second clips and you get 12 clips, most sharing the same people, lighting, background and camera.

Now assign those 12 clips at random using the 80/10/10 ratio. The chance that all of them land in the same split is about 7%, so roughly 93% of recordings end up with clips on both sides of the line.

How leakage happens

Video is rarely split as one file per moment. Long recordings are cut into short clips, and clips are often divided randomly across splits. That's where leakage creeps in.

  • Neighbouring clips. Two clips cut seconds apart from the same recording look almost identical. Put one in training and one in test, and the model is tested on a scene it has effectively memorised.

  • Same scene, different camera. Multiple angles of the same event can end up on both sides of the split.

  • Re-uploads and edits. The same footage often exists as a trimmed, cropped or re-encoded copy.

  • Same people, places and devices. A model can learn a specific street, room or camera rather than the task itself.

The result is test scores that look excellent and models that disappoint in the real world.

The test set is meant to stand in for the real world. As Andrew Ng puts it in Machine Learning Yearning:

“Choose dev and test sets to reflect data you expect to get in the future and want to do well on.”

A leaked test set reflects your training data instead, so it can't tell you how the model will do on footage it has never seen.

How to split video safely and avoid data leakage

Work through these checks before the first training run, and repeat them whenever new footage is added.

  • Split by source, not by clip. Keep every clip from one recording, event or contributor in the same split.

  • Deduplicate first. Use perceptual hashing to find near-duplicates before splitting.

  • Hold out whole conditions. Reserve some locations, devices or time periods only for testing.

  • Track provenance. Splits are only as reliable as the metadata that says where each clip came from.

That last point is where data sourcing matters. Clips that arrive with source IDs, capture dates and contributor records make clean splits possible. Clips that don't make leakage almost inevitable. Motion56 sources video with this provenance attached, so each clip can be traced back to its recording before it is assigned to a split.

For more on sourcing and preparing footage, see our section on training data.

Send us your AI training brief

Send a brief