"""Combine immutable pilot runs into one readable English technical report.""" import html import json from pathlib import Path from .train import write_report def main(): root = Path(__file__).resolve().parent runs = [] for folder,title in (("results","V1: uncentered architecture winner"), ("results_centered","V1: centered-target control"), ("results_v2_raw","V2: MLP, class-balanced activity"), ("results_v2_centered","V2: MLP, centered + class-balanced"), ("results_v2_gru","V2: GRU, centered + class-balanced")): file = root/folder/"results.json" if file.exists(): report = json.loads(file.read_text()) data_folder = "pilot" if folder in ("results","results_centered") else "pilot_v2" metadata_file = root/data_folder/"manifest.json" if metadata_file.exists(): metadata = json.loads(metadata_file.read_text()) report["dataset_limitations"] = ["Only 32 synthetic identities and 4 held-out test identities; no real-microphone robustness claim.",*metadata.get("limitations",[])] report["source_metadata"] = {k:metadata.get(k) for k in ("dataset_repo","dataset_revision","source_license","attribution","teacher_repo","teacher_revision","pilot_revision")} write_report(report,root/folder/"report.html") runs.append((folder,title,report)) ood = [] for name,title in (("ood_v1_v2.json","Frozen V1 uncentered → new emotions"), ("ood_centered_v2.json","Frozen V1 centered → new emotions")): if (root/name).exists(): ood.append((title,json.loads((root/name).read_text()))) def row(name,metrics,val=None): per = metrics.get("per_speaker",{}) macro = sum(v["closed_set_accuracy"] for v in per.values())/max(len(per),1) return "
| Feature context ms | Validation EER % | Test EER % | Oracle stable-context EER % |
|---|
These are the predefined V1 MLP-192 context ablations, not a test-set architecture selection. The selected model remains the validation winner. Stable-context diagnostics retain only contexts with at least90% of frames from the target speaker, using ground-truth labels; this barely changes error. Longer context alone does not solve the pilot's speaker-generalization failure.
" artifact = root/"artifacts"/"selection.json" selection = json.loads(artifact.read_text()) if artifact.exists() else {} scaling = "" manifest_path = root/"pilot_v2"/"manifest.json" if manifest_path.exists(): records = json.loads(manifest_path.read_text())["conversations"] duration = sum(r.get("duration_s",0) for r in records) wall = sum(r.get("feature_seconds",0) for r in records) rtf = wall/max(duration,1) scaling = f"Measured V2 feature calls processed {duration:.0f} seconds of audio in {wall:.1f} seconds: wall RTF {rtf:.3f}. Linear extrapolation to 100,000 × 24-second conversations is {100000*24*rtf/3600:.1f} hours just for feature calls, excluding waveform synthesis, downloads and teacher work. This includes local HTTP/serialization and is not isolated on-device ASR timing. Full-frame float16 caching would occupy about 61.4 GB; 500,000 independent 25-frame contexts alone would occupy 25.6 GB before metadata/caches.
" (root/"report.html").write_text("""Result: keep the experimental student identity gate off by default. The lightweight predictors are very fast, and the centered-target control improves speaker discrimination, but this small held-out pilot does not establish reliable multi-user filtering. The original TYGER turn-taking GRU remains unchanged. A direct ECAPA teacher is a separate baseline, not proof that the student works.
Fifteen actual CPU training runs were completed: eleven initial architecture/size/context/loss comparisons, one centered-target control, and three broader-emotion class-balanced runs. The linked per-run reports include all eleven initial comparisons. All identity splits are disjoint. Architecture selection and operating thresholds use validation identities only. EER below is evaluated on unseen test identities; lower is better. The operating point targets approximately 5% validation impostor false accepts and is then frozen for testing. Adjacent windows are correlated. Macro accuracy averages speakers equally.
| Run | Validation EER % | Test EER % ↓ | Teacher cosine ↑ | Macro identity % ↑ | False accept % ↓ | False reject % ↓ |
|---|
These controls use full clean source utterances and separate long enrollment clips, unlike the short noisy student windows. They quantify teacher/voice-profile consistency, not equal-context speed or accuracy.
| Corpus | Validation EER % | Test EER % | Teacher cosine | Macro identity % | False accept % | False reject % |
|---|
Frozen Nemotron ASR 3.5 layer 15 produces 1024-dimensional frames every 80 ms. An MLP, small GRU, or causal temporal CNN predicts normalized 192D SpeechBrain ECAPA embeddings, plus a three-way speech/silence/ambiguous-overlap head. Every 320 ms supplies four new frames. Models span 148k–470k parameters; contexts are 320, 640, 960, and 2000 ms. Predictor training and latency measurements use CPU only; the TTS GPU is untouched.
The pilot has 32 synthetic identities: 24 train, 4 validation, 4 test, 64 procedural 24-second conversations and 4,800 decision hops per corpus. Two clean long enrollment utterances per voice are excluded from conversation source clips. V1's bounded extraction found only fatigue/exhaustion and low-background-noise conditions, so it cannot establish emotional robustness. V2 samples anger, amusement, elation, sadness and background-noise-conditioned speech through bounded remote tar ranges; its probe utterances are new while identity splits and enrollment targets remain fixed. V2's 383 source clips, including enrollment sources, are German-heavy (338 German, 45 English), so this is not balanced English-emotion validation. Room noise, reverb, telephone filtering, interruptions, overlaps and synchronized synthetic playback leakage are procedural, not recordings of real users.
Standard ECAPA embeddings have a shared mean component. Average cosine can therefore look deceptively high even for a constant-vector predictor. The centered control fits a mean and residual radius from training identities only, regresses residual directions, and reconstructs standard ECAPA outputs. Its lower absolute cosine can coexist with better verification. Normalized MSE is a rescaled cosine loss; the loss ablation changes regression/activity weighting, not independent geometry. Class balancing addresses rare overlap labels but does not guarantee overlap rejection.
Temporal accumulation analyses use ground-truth speaker resets and are optimistic; they did not rescue V1 verification. Unknown rejection must be read alongside known acceptance: rejecting almost everyone is not success. Word-alignment occupancy may label untranscribed vocal bursts as silence. Four held-out voices cannot establish performance for real microphones, ages, accents, or unrelated background speakers. Enrollment embeddings are approximate cues, never secure authentication.
Do not begin a 100,000-conversation/500,000-window run merely because the predictor is fast. V1 measured roughly 2,300–5,200 training windows/s on CPU, around 2–4 minutes per 500,000-window epoch before feature I/O. Actual frozen-ASR feature extraction dominates end-to-end corpus cost; multiply measured feature throughput, not student throughput, when budgeting. Caching every frame of 100,000 24-second conversations would exceed a 40 GB working budget, so a larger run must selectively store supervised windows or use an iterable/procedural feature pipeline. A broader intermediate pilot and stronger validation are the next justified steps.
"""+scaling+"Run python -m unittest speaker_v2.test_predictor -v; use python -m speaker_v2.train --help and the data preparation README for exact commands and source metadata. Frozen checkpoint out-of-domain tests use python -m speaker_v2.evaluate without threshold adaptation. No private microphone recordings or enrolled user voiceprints are included.
"+html.escape(json.dumps(selection,indent=2))+"