Add B3 FP16 speaker model: README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119# ReDimNet2-B3 mixed FP16 for SpeechlessDo
Native CoreML speaker embeddings with fixed FP16 windows derived from[PalabraAI/redimnet2](https://github.com/PalabraAI/redimnet2):`model_name=b3`, `dataset=vb2+vox2+cnc2_v0`, `train_type=lm`.The training mixture is VoxBlink2 + VoxCeleb2 + CN-Celeb2. The MIT license andupstream attribution are included alongside the model.
Upstream checkpoint: [`b3-vb2+vox2+cnc2_v0-lm.pt`](https://github.com/PalabraAI/redimnet2/releases/download/v1.0.0/b3-vb2+vox2+cnc2_v0-lm.pt).SHA-256: `b64989536ef8822447d72517ad9019b870a951e85a3f176f0ed42d2a4c3d811d`.
## Files and interface
The app downloads five files, **22,947,458 bytes in total**:
| File | Purpose || ---------------------------------------------------------------------- | ----------------------------------------------------------- || `redimnet2_b3_frontend.onnx` | FP32 waveform preprocessing for CoreML windows, on CPU || `redimnet2_b3_fp16_weights.onnx` | FP16 weights with FP32 CPU computation for short utterances || `redimnet2_b3_fp16.mlpackage/Manifest.json` | CoreML package manifest || `redimnet2_b3_fp16.mlpackage/Data/com.apple.CoreML/model.mlmodel` | Native FP16 MLProgram network || `redimnet2_b3_fp16.mlpackage/Data/com.apple.CoreML/weights/weight.bin` | FP16 network weights |
`provenance.json` lists each file's exact size and SHA-256. Both mirrors mustserve identical bytes. The original app registry is`src-tauri/src/managers/model_sources.rs` in the SpeechlessDo repository.
Input is real float32 mono PCM at 16 kHz. The ONNX frontend maps a 48,000-samplewindow to `[1, 1, 72, 296]` features. The native CoreML package accepts the samecontiguous features as `[1, 72, 296]` and returns float32 `embedding` of shape`[1, 192]`. Its network computes in FP16; input/output and waveform preprocessingremain FP32. Normalize embeddings before cosine comparison. This model producesvoice fingerprints, not transcribed text, names, or separated audio stems.
## App runtime
macOS uses the native CoreML API via SpeechlessDo's Swift bridge, with`computeUnits=cpuAndGPU` and low-precision GPU accumulation disabled. Compiledcaches are keyed by the contents of all three CoreML package files.
Speech shorter than 3 seconds keeps its original length on the FP16-weight,FP32-compute CPU model. Longer utterances are fully covered by evenly spaced,overlapping real 3-second windows. Normalize each window's embedding, average,and normalize again. The app does not repeat or pad speech to fill a window.Pyannote segmentation remains on CPU.
The app's bundled ONNX Runtime 1.23.2 fragments the earlier FP16 ONNX graph intomany CPU/CoreML partitions. Fully dynamic and enumerated native CoreML exportsalso placed substantial computation on CPU in this experiment. Fixed nativeFP16 windows use GPU: the measured CoreML plan prefers GPU for all 756 operations,including all 206 convolution/linear/matmul operations. This is compute-planplacement, not a per-execution hardware counter. A warm fixed-window networkprediction measured about 3.2 ms on the evaluation M5 Max.
The 2026-11-10 ONNX CoreML experiment used ORT 1.31.1; its timing is not an appperformance claim. Other app models keep their existing runtime. Other operatingsystems continue using CAM++.
Clustering retains complete-link cosine distance with the app's automaticcutoff of 0.9; known speaker counts are supported. Speaker consolidation, VAD,ASR cut planning and minutes generation are shared with the existing pipeline.
## Accuracy and scope
The final app embedding policy was separately evaluated on the frozen English LibriSpeechprotocol: 10 calibration speakers, 19 test speakers, 133 queries per duration.
| Version | 3-second EER | 1-second EER | 3-second calibrated BER | 1-second calibrated BER || ---------------- | -----------: | -----------: | ----------------------: | ----------------------: || Original B3 FP32 | 0.1253% | 1.2531% | 0.4386% | 3.2790% || App FP16 policy | 0.1253% | 1.2531% | 0.4386% | 3.2790% |
The 3-second app result uses the native FP16 network; the 1-second result usesthe FP16-weight CPU path. Each version calibrates thresholds on the same independent calibration set.Both versions misidentify 0/133 three-second queries and 2/133 one-secondqueries when selecting the most similar of 19 known speakers. That is not theunknown-speaker rejection rate. A zero observed error count does not implyzero deployment errors. These English tests do not establish large-scaleChinese, noisy/far-field, or minutes content quality.
On three AMI headset-mix meetings (57.6 minutes), the final window policy'spost-consolidation DER was **14.95%**, versus the recorded CAM++ baseline of**17.89%**. Two meetings improved; TS3003a regressed from **13.02% to 16.96%**.The earlier full-utterance B3 FP32 experiment achieved 12.84%, so these resultsmust not be presented as a universal accuracy gain from FP16. The local Chineseclip has no human speaker annotation and does not establish minutes quality.
See SpeechlessDo's `docs/development/speaker-app-coreml-integration.md` fornative full-meeting regression and runtime validation. The earlier FP32 meetingscores must not be relabeled as FP16 app results.
## Reproduction and hosting
The export does not retrain weights. Use`scripts/export-redimnet-coreml.py` with the frozen checkpoint already in thelocal Torch cache, the evaluated FP32 ONNX source, and a real 16 kHz WAV.It extracts the exact waveform frontend and converts the embedding networkwith coremltools 9.0, FP16 compute, fixed 296-frame features, and macOS 12 as theminimum deployment target. Export in a fresh directory. CoreML package IDs canchange on re-export, so validate and freeze the actual bytes before updatingregistry hashes.
Publish the five files plus `README.md`, `LICENSE`, `NOTICE` and`provenance.json` under `redimnet2-b3-fp16-v1/` in both`trevorlink/speechless-diarization` repositories on Hugging Face and ModelScope.This keeps the derivative's MIT license with its files and preserves theexisting segmentation/CAM++ artifacts and licenses.
The app lazily installs the files under `models/diarization/` using its existingresumable, size-limited, SHA-256-verified downloader. Chinese locales preferModelScope; other locales prefer Hugging Face, with fallback to the othermirror. These are internal diarization dependencies, not selectable ASR engines.
```shpython3 scripts/publish-redimnet-speaker.py --model-dir /path/to/native-coreml# Inspect the prepared package before explicitly publishing:uv run --with huggingface_hub --with modelscope scripts/publish-redimnet-speaker.py \ --model-dir /path/to/native-coreml --publish --env-file ~/AI/.env.local```redimnet2-b3-fp16-v1/README.mdAdded+119