Algorithm Search⌘K

Problemintro

Automatic speech recognition

Also called ASR, speech-to-text.

Transcribe the words spoken in an audio signal into text.

Automatic speech recognition (ASR) takes an audio signal of speech and outputs the sequence of words that was said. The signal is first turned into a sequence of feature frames, and the recognizer searches for the word sequence that best explains those frames. The usual measure of quality is the word error rate on a named test set. Statistical recognizers state the task as the search for the most probable word sequence, which splits into an acoustic model and a language model by the source-channel model.

In plain words

A person speaks, and the computer must write down the words. The sound is cut into short slices, a hundredth of a second each, and each slice is described by a few numbers. The same word sounds different from speaker to speaker and from one time to the next, words run into each other without pauses, and the number of slices for a word is not fixed.

So the computer does not look the slices up in a table. It weighs every word sequence it can think of by two questions: how well does this sequence match the sounds, and how likely is it as a sentence of the language? It outputs the sequence with the best combined answer. The answers are counted by how many words are wrong, missing or extra.

Definition

The input is a speech signal, sampled at for example 16 kHz. A front end turns it into a sequence of feature frames O=o1…oTO = o_1 \ldots o_T, usually one frame every 10 ms over a window of 25 ms, for example the MFCC vectors with their delta features. The output is a word sequence W=w1…wUW = w_1 \ldots w_U over a vocabulary VV, with UU not known in advance.

There is no exact answer to compute: the correct output is the transcript that a human would write, under agreed rules of normalization. A recognizer is judged by the corpus word error rate of its outputs against reference transcripts on a test set that it was not trained on. The statistical form of the task, with a model of the joint distribution of words and frames, is

W∗=arg⁡max⁡W∈V∗P(W∣O)=arg⁡max⁡Wp(O∣W) P(W),W^* = \arg\max_{W \in V^*} P(W \mid O) = \arg\max_{W} p(O \mid W)\, P(W),

by Bayes' theorem, because p(O)p(O) does not depend on WW. This rule minimizes the probability that the whole sentence is wrong, if the model is correct. It does not minimize the expected number of word errors; a decoder that targets the WER picks the hypothesis with the least expected word errors, for example from a confusion network.

Variants

  • Isolated words or continuous speech. An isolated word recognizer knows where each word starts and ends. In continuous speech the word boundaries are hidden, and their number is not known.
  • Vocabulary size. Digit strings and command sets have tens of words, the Resource Management task had about 1000 and the Wall Street Journal tasks had 5000 and 20000 words. Open vocabulary systems handle words that are not in a fixed list, often with subword units.
  • Speaker dependent or independent. A speaker dependent system is trained for one person. A speaker independent system must work for anyone, often with speaker adaptation at test time.
  • Speaking style and channel. Read speech, broadcast news and conversational telephone speech get harder in this order. Noise, far microphones and accents make each of them harder.
  • Streaming or offline. A streaming recognizer outputs words with a short delay while the audio arrives. An offline one sees the whole utterance first.
  • Related tasks. Keyword spotting looks for a few words only, speaker diarization finds who spoke when, and forced alignment finds the times of words that are already known.

Examples

  • Digits. "Call 5 5 5 0 1 2 3" from a phone line, with a vocabulary of 11 words and no language model beyond "any digit string".
  • Dictation. Read sentences from newspaper text, as in the Wall Street Journal evaluations. On the Nov'93 tests, the system of Young, Odell and Woodland 1994 had a word error rate of 4.90 percent on the 5k task and 12.67 percent on the 20k task (measurements).
  • Conversational speech. Telephone conversations between strangers, with hesitations, restarts and overlapping speech, are much harder than read speech.
  • Template matching. A recognizer for a few command words that a single user records once can compare the input with each recording by dynamic time warping and output the closest word.

Known algorithms

AlgorithmTimeSpacePropertiesCode
Connectionist temporal classificationΘ(T (U + K)) worstΘ(T U) extradeterministicexactofflineiterative1 language
CTC prefix beam searchO(T W K) worstO(W K + T W) extradeterministicnot exactonlineiterative1 language
Lattice-free MMIΘ(T (N + E + P)) worstΘ(T (N + P)) extradeterministicexactofflineiterative1 language
MAP speaker adaptationO(k T M n) worstO(M n) extradeterministicnot exactofflineiterative1 language
Maximum likelihood linear regressionO(k (T M n + M n^3 + R n^4)) worstO(M n + R n^2) extradeterministicnot exactofflineiterative1 language
Maximum mutual information trainingΘ(T (N + E + P)) worstΘ(T (N + P)) extradeterministicexactofflineiterative1 language
Mel filter bankO(W + N log N + M N) worstO(M N) extradeterministicexactnot in placeonline1 language
Mel-frequency cepstral coefficientsO(T (N log N + M N + K M)) worstO(M N + T K) extradeterministicexactnot in placeonline1 language
Perceptual linear predictionO(N log N + M N + M p + p^2) worstO(M N) extradeterministicexactnot in placeonline1 language
RASTA filteringO(T B) worstO(B) extradeterministicexactnot in placeonline1 language

Bounds

The search space is V∗V^*, and even for a fixed length UU there are ∣V∣U|V|^U word sequences, so no recognizer enumerates them. With an HMM acoustic model and an n-gram language model, the Viterbi approximation is a best path problem in a graph with TT layers, one per frame, and takes time linear in TT times the number of arcs of the decoding graph. This is exact for the best state path, and decoders still prune it with a beam because the graphs have millions of arcs.

The exact rule that sums over the state paths of each word sequence is harder. Lyngsø and Pedersen 2002 proved that finding the most probable string that a hidden Markov model emits is NP-hard (a theorem), and the most probable word sequence of an HMM recognizer is a problem of this kind. This is one reason why decoders use the best path, or approximate the sum on a lattice.

There is no useful lower bound on the WER: it depends on the data, and human transcribers also disagree with each other on hard speech.

Reductions

  • To HMM decoding. With the Viterbi approximation, recognition is HMM decoding on one large HMM whose states are the states of the phone models in all the words and word sequences that the language model allows.
  • To a weighted transducer. The language model G, the lexicon L, the context dependency C and the HMMs H are weighted finite-state transducers, and their composition gives one decoding graph. Recognition becomes a best path search through it.
  • From the source-channel model. The source-channel model reduces the task to two models that can be trained apart, one on audio with transcripts and one on text, the same split as in noisy channel spelling correction.

Applications

Dictation and voice typing, voice assistants and command interfaces, captions for video and live broadcasts, transcription of meetings and call centers, voice search, and the input of spoken language translation. Speech recognition also gives the word times for audio search and for corpus studies of speech.

References

  1. Frederick Jelinek, Continuous speech recognition by statistical methods, Proceedings of the IEEE 64(4), 1976, pages 532 to 556, the statement of recognition as the search for the most probable word string given the acoustic data
  2. Lalit R. Bahl, Frederick Jelinek and Robert L. Mercer, A maximum likelihood approach to continuous speech recognition, IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-5(2), 1983, pages 179 to 190, the decomposition into an acoustic processor, a language model and a decoder
  3. Mark Gales and Steve Young, The application of hidden Markov models in speech recognition, Foundations and Trends in Signal Processing 1(3), 2008, pages 195 to 304, the chapter on the architecture of an HMM-based recognizer
  4. Xuedong Huang, Alex Acero and Hsiao-Wuen Hon, Spoken Language Processing, Prentice Hall PTR, 2001, the part on speech recognition (acoustic models, language models and search)
  5. Rune B. Lyngsø and Christian N. S. Pedersen, The consensus string problem and the complexity of comparing hidden Markov models, Journal of Computer and System Sciences 65(3), 2002, pages 545 to 569, the NP-hardness of finding the most probable string of a hidden Markov model

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml