Add dataset split methodology: SplitMetadata infrastructure, benchmark split enforcement, and CLI split commands#18
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
…nforcement, CLI split commands Agent-Logs-Url: https://github.com/VoDaiLocz/Lock-ART./sessions/8c1bc471-0b09-4dd2-9406-3208cb4888c3 Co-authored-by: VoDaiLocz <88762074+VoDaiLocz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix dataset split methodology risks and enforce separation
Add dataset split methodology: SplitMetadata infrastructure, benchmark split enforcement, and CLI split commands
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The benchmark workflow had no train/val/test separation, making it trivial to overfit profiles to benchmark images and cherry-pick results. The Anti-DreamBooth set_C split was documented as "holdout metadata" rather than being actively used for held-out evaluation.
Core split infrastructure (
src/auralock/core/splits.py)SplitTypeenum (TRAIN,VALIDATION,TEST,DEVELOPMENT)SplitMetadatadataclass — tracksimage_ids,split_method, deterministicsplit_hash,split_ratio,random_seed; includesverify_no_leakage()and full JSON serializationcompute_split_hash()— short SHA-256 fingerprint over sorted image IDs + seed, enabling tamper detectioncreate_random_split()— seeded, leakage-free train/val/test partitioning with full metadatasave_split_manifest()/load_split_manifest()— JSON persistence for reproducible split assignmentsvalidate_split_manifest()— checks cross-split overlap and hash integrity, returns list of issueswarn_non_test_split()— emitsUserWarningwhen benchmarking on non-TEST splitsPlaced in
core/(notbenchmarks/) to avoid the circular importservices → benchmarks → lora → services.benchmarks/splits.pyis a re-export shim.Benchmark enforcement (
src/auralock/services/protection.py)BenchmarkSummarygainssplit_metadata: SplitMetadata | None = None; serialized into_report_dict()benchmark_file()— whensplit_metadataprovided: raisesValueErrorif image not in split, warns on non-TESTbenchmark_directory()— filters images to declared split members, warns on excluded images and non-TEST splitsCLI split commands (
src/auralock/cli.py)New
auralock splitsub-command group:auralock split create <dir> --output splits.json [--train-ratio 0.7 --val-ratio 0.15 --test-ratio 0.15 --seed 42]auralock split validate splits.json— exits 1 with details on leakage or hash mismatchauralock benchmarkgains--split-manifestand--split-typeoptions; prints a non-test-split bias warning to stdout before running.Anti-DreamBooth set_C note
Corrected the misleading "set_C is preserved as holdout metadata" note to explicitly document set_C as the held-out validation split for measuring out-of-sample protection effectiveness.