CoolFace
Modelpublic

trunk-reporter/imbe-asr-base-512d

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes9downloads
Model Card

IMBE-ASR Base (48.6M params, d=512, 8 layers)

Edge-friendly speech recognition from IMBE vocoder parameters. Runs at 15x real-time on a Raspberry Pi 5.

Code: trunk-reporter/imbe-asr | Best model: imbe-asr-large-1024d | P25 fine-tuned: imbe-asr-base-512d-p25

Results

Evaluated on LibriSpeech-IMBE speaker-split validation. The included 3-gram KenLM halves WER with minimal overhead.

Decode methodWERCER
Greedy10.55%3.32%
Beam + 3-gram KenLM (α=0.7, β=2.0)4.84%1.99%
For maximum accuracy, use imbe-asr-large-1024d (3.35% WER with 5-gram LM). Use this model for edge deployment where the large model doesn't fit.

Architecture

ParameterValue
d_model512
Layers8
Heads8
d_ff2048
Parameters48.6M

Conformer-CTC, trained on ~1,220 hours of IMBE-encoded speech, 25 epochs.

Files

FileFormatSizeNotes
model.safetensorsSafeTensors205 MBPyTorch weights
config.jsonJSONArchitecture config
model.onnxONNX fp32195 MBFull precision
model_int8.onnxONNX int857 MBQuantized, Python ORT
model_uint8.onnxONNX uint859 MBQuantized, C engine compatible
stats.npzNumPy2 KBNormalization stats (required)
lm/3gram.binKenLM trie (3-gram, q8)501 MBLanguage model for beam search
lm/unigrams.txtVocabulary9 MBUnigrams for beam decoder

Edge Deployment (Raspberry Pi 5, 4GB)

RuntimeFormat10s callRTFRAM
C engine (70KB)fp32 ONNX660ms0.07x~300 MB
C engine (70KB)uint8 ONNX788ms0.08x~140 MB
PyTorchsafetensors800ms0.08x995 MB

Usage

Greedy decode (fast, no dependencies)

python
import onnxruntime as ort, numpy as np

session = ort.InferenceSession("model_int8.onnx")
stats = np.load("stats.npz")
features = ((raw_params - stats["mean"]) / stats["std"]).astype(np.float32)
log_probs, out_lengths = session.run(None, {
    "features": features.reshape(1, -1, 170),
    "lengths": np.array([features.shape[0]], dtype=np.int64),
})

Beam search + KenLM (recommended)

python
import onnxruntime as ort, numpy as np
from pyctcdecode import build_ctcdecoder

session = ort.InferenceSession("model_int8.onnx")
stats = np.load("stats.npz")

VOCAB = list(" ABCDEFGHIJKLMNOPQRSTUVWXYZ'")
labels = [""] + VOCAB
decoder = build_ctcdecoder(
    labels=labels,
    kenlm_model_path="lm/3gram.bin",
    unigrams=open("lm/unigrams.txt").read().splitlines(),
    alpha=0.7,   # LM weight — tuned on LibriSpeech-IMBE
    beta=2.0,    # word insertion bonus
)

features = ((raw_params - stats["mean"]) / stats["std"]).astype(np.float32)
log_probs, out_lengths = session.run(None, {
    "features": features.reshape(1, -1, 170),
    "lengths": np.array([features.shape[0]], dtype=np.int64),
})
text = decoder.decode(log_probs[0, :out_lengths[0]], beam_width=100)

Install dependencies: pip install pyctcdecode kenlm

Limitations

  • Trained on clean speech, not real P25 radio. See imbe-asr-base-512d-p25 for P25 adaptation.
  • English only.