How to Check Livestock YOLO Datasets for Split Leakage
If training and test sets contain different crops of the same frame, the test result reflects information seen in training. Neighboring barn-video frames may also share animal positions and backgrounds. Treat such frames as related even if their file hashes differ.
Audit the files and their sources
- Record each image's split, filename, source filename and any known recording, camera or session identifier.
- Use file hashes to find exact duplicate files. Use export records and visual checks to resolve related crops or augmented versions. Filename patterns can guide that review.
- Group images at the level you want to generalize across. Hold out recordings for unseen-video evaluation, or entire barns for cross-site evaluation.
- Recount images and instances by class after regrouping, especially rare behaviors in validation and test sets.
Read export counts alongside source counts
The pig feeding package lists 1,090 exports and 454 distinct source-image names. The pig multi-behavior package lists 7,200 exports and 600 base filenames. Use these counts to identify which exports to compare, then check overlap using the files and the source information available.