Wav2Letter is a simple end-to-end model for speech recognition, combining a convolutional acoustic model with a CTC decoding step. Given MFCC features extracted from an audio clip, the network outputs, for each time frame, a probability distribution over a 29-symbol alphabet (26 lowercase letters, an apostrophe, a space and a CTC blank symbol). It is trained to output letters directly from transcribed speech, without requiring force alignment of phonemes [1].
This repository ships the pre-quantized int8 TFLite Wav2Letter model published by the
ARM ML-zoo, compiled
for NXP i.MX 8M Plus, i.MX 93, i.MX 95, and i.MX 952 processors. It also contains the script used to download and
compile these assets (recipe.sh) and an inference example (example.py).
This repository contains the ARM ML-zoo Wav2Letter model, quantized to int8 upstream and compiled by NXP for i.MX 8M Plus, i.MX 93, i.MX 95, and i.MX 952 processors.
This model is a derivative work with the following changes from the original:
--accelerator-config ethos-u65-256 --optimise Performance),
tags lf-6.18.20_2.0.0 and lf-6.18.37_2.1.0.3.1.3, 3.2.1, and 3.2.3.Original model available at: https://github.com/ARM-software/ML-zoo/tree/master/models/speech_recognition/wav2letter.
| Information | Value |
|---|---|
| Input shape | MFCC feature window (1, 296, 39), int8 |
| Input example | example_input.flac (audio clip from the LibriSpeech dataset [2], CC BY 4.0) |
| Output shape | Character-probability tensor (1, 1, 148, 29), int8 quantized; dequantize with the output tensor's scale / zero point before CTC decoding (see example.py) |
| Output example | Decoded transcription string (see example.py) |
| FLOPS | 6,982 MOPS |
| Number of parameters | 23.8 M |
| File size (int8) | ~22.7 MB (assets/quantized_tflite_model/wav2letter_int8.tflite) |
| Source framework | TensorFlow Lite |
The model recognizes a 29-symbol alphabet: the 26 lowercase letters a-z, an apostrophe ', a space, and a CTC
blank symbol.
All models run with the eIQ LiteRT (TensorFlow Lite) runtime and the corresponding NPU delegate (VX for i.MX 8M Plus, Ethos-U for i.MX 93, Neutron for i.MX 95 / i.MX 952). The same information is captured in release_manifest.json.
| Asset | Runtime | Precision | HW target | BSP & SDK versions | Link to asset |
|---|---|---|---|---|---|
| i.MX 8M Plus Quantized | LiteRT | INT8 | i.MX 8M Plus | - | Download |
| i.MX 93 Precompiled | LiteRT | INT8 | i.MX 93 | BSP lf-6.18.20_2.0.0, VELA_TAG = lf-6.18.20_2.0.0 | Download |
| i.MX 93 Precompiled | LiteRT | INT8 | i.MX 93 | BSP lf-6.18.37_2.1.0, VELA_TAG = lf-6.18.37_2.1.0 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3 | Download |
The i.MX 8M Plus asset is identical (same sha256) to the hardware-independent int8 model provided for host
(x86) inference at assets/quantized_tflite_model/wav2letter_int8.tflite.
This model inherits all limitations from the original ARM ML-zoo Wav2Letter model. Additional limitations:
example.py, which affects latency for long audio.The model was trained by the original authors (flashlight / ARM ML-zoo) on the LibriSpeech dataset [2]. NXP did not retrain this model; the training procedure is detailed on the Wav2Letter (flashlight) GitHub page.
An example of how to use the model is in example.py (run on a PC). Install the dependencies from
requirements.txt first.
# Run on PC:
python example.py -m assets/quantized_tflite_model/wav2letter_int8.tflite -i example_input.flac
The example loads an audio file, extracts MFCC features, runs Wav2Letter over a sliding window, decodes the character probabilities with a CTC greedy decoder, and prints the transcribed text.
Please refer to the i.MX Machine Learning User Guide for details on how to run the models on each platform.
The recipe installs the eIQ Neutron SDK from the NXP eIQ PyPI Distribution Portal. Configure pip once to use it:
python -m pip config --user set global.index https://eiq.nxp.com/repository
python -m pip config --user set global.index-url https://eiq.nxp.com/repository
python -m pip config --user set global.trusted-host eiq.nxp.com
python -m pip config --user set global.extra-index-url https://pypi.org/simple
python -m pip config --user set global.find-links https://eiq.nxp.com/repository/
To download the quantized int8 model and compile the platform-specific variants, run:
bash recipe.sh
The Vela tag and eIQ Neutron SDK version can be passed as optional positional arguments (defaulting to
lf-6.18.20_2.0.0 and 3.2.3 respectively):
bash recipe.sh [IMX_ETHOS_U_VELA_TAG] [EIQ_NEUTRON_SDK_VERSION]
# e.g.:
bash recipe.sh lf-6.18.37_2.1.0 3.2.3
The generated files are:
assets/quantized_tflite_model/wav2letter_int8.tflite - hardware-independent int8 model (downloaded as-is
from the ARM ML-zoo); also linked as assets/imx8mplus/wav2letter_int8.tflite for i.MX 8M Plus.assets/imx93/<IMX_ETHOS_U_VELA_TAG>/wav2letter_int8_vela.tflite - Vela-compiled for i.MX 93.assets/imx95/<EIQ_NEUTRON_SDK_VERSION>/wav2letter_int8_converted.tflite - Neutron-converted for i.MX 95.assets/imx952/<EIQ_NEUTRON_SDK_VERSION>/wav2letter_int8_converted.tflite - Neutron-converted for i.MX 952.This model is released under the Apache License 2.0, the same license as the original ARM ML-zoo Wav2Letter model.
If you use this model, please cite both this work and the original model:
@article{collobert2016wav2letter,
title={Wav2letter: an end-to-end convnet-based speech recognition system},
author={Collobert, Ronan and Puhrsch, Christian and Synnaeve, Gabriel},
journal={arXiv preprint arXiv:1609.03193},
year={2016}
}
@inproceedings{panayotov2015librispeech,
title={Librispeech: an asr corpus based on public domain audio books},
author={Panayotov, Vassil and Chen, Guoguo and Povey, Daniel and Khudanpur, Sanjeev},
booktitle={2015 IEEE international conference on acoustics, speech and signal processing (ICASSP)},
pages={5206--5210},
year={2015},
organization={IEEE}
}