Install the native ESPnet XEUS adapter, cache frozen XEUS representations, and train Model A or SPAM-augmented Model B onset/rime recognizers on Mandarin singing audio. Before starting, create the local/third_party/phonespam-env environment from Run phone recognition inference and alignment and prepare annotations with Train the onset/rime recognizer.
XEUS uses its native ESPnet audio normalization and encoder with masking and dropout disabled, preserving native convolution timing during label assignment and inference. Both --layer-index -1 and --layer-index 19 select the nineteenth block output before final normalization, matching the official extraction example without ML-SUPERB learned layer weighting. For duration-budgeted experiments, extract the full cache once, then select subsets with Run few-shot recognition experiments.
Install and download
Install the verified ESPnet package into the isolated phonespam-env environment:
uv pip install --python local/third_party/phonespam-env/bin/python espnet==202610.post2Download the official XEUS configuration and checkpoint (approximately 2.3 GB) to a local directory, and keep that directory available for subsequent raw-audio inference:
local/third_party/phonespam-env/bin/hf download espnet/xeus \
model/config.yaml model/xeus_checkpoint_new.pth \
--local-dir local/assets/xeusAlternatively, pass --backbone espnet/xeus during extraction to download through the Hugging Face cache automatically and record the resolved model revision.
Extract and train Model A
Reuse the jobs.json created during annotation preparation. If that directory already contains extracted features from another backbone, prepare a separate directory for XEUS so you do not overwrite the existing cache. Pass --python to select an alternative extraction environment, and use --device cuda on an NVIDIA GPU.
Extract frozen XEUS features from jobs.json:
uv run --project research/phone-recognition phone-recognition recognizer extract \
local/data/phone-recognition/onset-rime/jobs.json \
--backbone local/assets/xeus \
--layer-index -1 \
--device cpuTrain Model A directly on the extracted XEUS cache:
uv run --project research/phone-recognition phone-recognition recognizer train \
local/data/phone-recognition/onset-rime/manifest.json \
--config research/phone-recognition/configs/base.toml \
--output local/runs/phone-recognition/xeus \
--no-spam-features \
--device cpuEvaluate the trained checkpoint on the validation split:
uv run --project research/phone-recognition phone-recognition recognizer evaluate \
local/data/phone-recognition/onset-rime/manifest.json \
--checkpoint local/runs/phone-recognition/xeus/best.pt \
--split validation \
--output local/runs/phone-recognition/xeus/validation.jsonCalibrate SPAM and train Model B
Model A does not require SPAM calibration. For Model B, fit a projection directly from the extracted XEUS cache. Existing WavLM or MMS SPAM projections cannot be used with XEUS features even when dimensions match, and any prior passed with calibrate --prior must match the same encoder and layer. Calibration reads only the training partition, uses eligible single-phone segments with the saved XEUS frame timing, and reuses cached features without loading the encoder or audio.
Calibrate a SPAM projection from the XEUS feature cache:
uv run --project research/phone-recognition phone-recognition calibrate \
--dataset local/data/phone-recognition/onset-rime/manifest.json \
--output local/assets/spam/xeus-onset-rime.pt \
--count 500Train Model B using the calibrated XEUS SPAM checkpoint:
uv run --project research/phone-recognition phone-recognition recognizer train \
local/data/phone-recognition/onset-rime/manifest.json \
--config research/phone-recognition/configs/base.toml \
--output local/runs/phone-recognition/xeus-b \
--use-spam-features \
--spam-checkpoint local/assets/spam/xeus-onset-rime.pt \
--device cpuBecause the cache records the backbone, layer, and model revision, you do not need to supply them again during training or calibration. Model B saves the projection inside its checkpoint for raw-audio inference and Pinyin forced alignment, which follow the evaluation and alignment commands.



