Modelresearch
Tacotron
Also called Tacotron 2.
An attention-based encoder-decoder that maps characters or phonemes to mel spectrogram frames, one step at a time, followed by a vocoder.
Tacotron is a text-to-speech model that maps a sequence of characters, or phonemes, to a sequence of spectrogram frames. It is an encoder-decoder model with attention, the same design as neural machine translation. The encoder reads the text once. The decoder is a recurrent network that makes the frames one step at a time, and at each step an attention layer chooses which part of the text to read. The first Tacotron (Wang and colleagues 2017) predicted mel frames, turned them into a linear spectrogram, and made the waveform with the Griffin-Lim algorithm. Tacotron 2 (Shen and colleagues 2018) predicts mel frames only and makes the waveform with a WaveNet vocoder. Both learn the alignment between text and sound from pairs of text and audio, with no hand-made durations.
The machine
Sizes: input symbols, output frames, mel bands, frames of 50 ms with a hop of 12.5 ms, and audio at 24 kHz. Shapes are for one utterance. The description is of Tacotron 2; the first version follows.
Mel spectrogram. The target is the short-time Fourier transform magnitude with a Hann window, passed through an 80-band mel filter bank from 125 Hz to 7.6 kHz, clipped below at 0.01 and log-compressed. It has shape .
Encoder. The characters go through a learned embedding of size 512, three 1-D convolutions with 512 filters of width 5, batch normalization and ReLU, and one bidirectional LSTM with 256 units in each direction. The output has shape .
Attention. Location-sensitive attention is additive attention that also sees where it looked before. At decoder step , with the decoder state and the sum of all earlier attention weights, a vector of shape ,
is 32 filters of length 31, so has shape , and the hidden size of the score is 128. The context vector is , of shape 512. The location term pushes the attention to move forward through the text.
Decoder. The previous frame goes through a pre-net of two layers of 256 ReLU units with dropout 0.5, which is kept on at synthesis time. Its output and feed two LSTM layers of 1024 units. A linear map of the LSTM output and gives the next frame, of shape 80, and a second linear map with a sigmoid gives the probability that the utterance has ended. Generation stops at the first frame where that probability is above 0.5. One frame is made per step.
Post-net. Five 1-D convolutions with 512 filters of width 5 and tanh read the whole predicted mel spectrogram and add a residual to it, which corrects details using frames on both sides.
Training. The loss is the summed squared error of the frames before and after the post-net, plus the stop token loss. During training the decoder gets the true previous frame (teacher forcing).
Vocoder. A WaveNet of 30 dilated convolution layers in 3 cycles is trained on the predicted mel spectrograms. Its output is a mixture of 10 logistic distributions for each 16-bit sample.
The first Tacotron. It used a character embedding of size 256 and the CBHG module: a bank of 1-D convolutions of widths 1 to 16, max pooling, projections, a highway network and a bidirectional GRU. The decoder had a GRU attention layer with content-based tanh attention and two residual GRU layers of 256 cells, and it emitted frames per step. A second CBHG module mapped the 80-band mel output to a linear magnitude spectrogram, and Griffin-Lim made the waveform from the magnitudes raised to the power 1.2. The paper reports that Griffin-Lim converges by 50 iterations.
Standing assumptions. Normalized text (numbers and abbreviations written out), one speaker or a speaker embedding, and an attention that moves forward through the text.
What it counts
The decoder defines a sequence of frames by . It is trained as a regression, so it gives one output, close to the mean of the training frames for a context; it is not a probability model of the frames.
- Steps. Synthesis takes sequential decoder steps, or for the first version. One second of audio at a hop of 12.5 ms is 80 frames, so 80 steps.
- Attention cost. Each step scores all encoder outputs, so the attention costs over the utterance, and the location convolution adds per step.
- Vocoder cost. The WaveNet vocoder of Tacotron 2 is autoregressive over samples: 24000 sequential steps per second of audio. This, not the mel decoder, is the slow part.
- Example of the location features. With and earlier weights , a filter that weighs the next position, , gives . The score can use it to favor positions just after the ones already read.
Relation to other models
- Encoder-decoder models with attention for translation are the template. The differences are a continuous output with a regression loss, a stop token in place of an end symbol, and the location term in the attention.
- FastSpeech replaces the attention and the step-by-step decoder by explicit durations and a parallel decoder. Its first version took the durations from the attention of an autoregressive teacher.
- VITS finds a hard monotonic alignment by dynamic programming in place of soft attention, and makes the waveform in the same network.
- WaveNet in its first form was conditioned on linguistic features from a classic front end. Tacotron 2 conditions it on predicted mel frames, which removes the hand-made front end apart from text normalization.
- HiFi-GAN and other parallel vocoders can replace WaveNet behind the same mel output; the VITS paper uses this pairing as a baseline.
Known results in the model
- Tacotron quality (measurement). On 100 unseen phrases, each rated 8 times by crowd-sourced native speakers on a 1 to 5 scale, the first Tacotron had a mean opinion score of 3.82 ± 0.085, against 3.69 ± 0.109 for an LSTM parametric system and 4.09 ± 0.119 for a concatenative system. The training data was about 24.6 hours of one female speaker of North American English.
- Tacotron 2 quality (measurement). On 100 test examples with at least 8 ratings each, Tacotron 2 had a MOS of 4.526 ± 0.066 (95% confidence interval) against 4.582 ± 0.053 for the recordings, 4.341 ± 0.051 for WaveNet with linguistic features, 4.166 ± 0.091 for concatenative synthesis and 4.001 ± 0.087 for Tacotron with Griffin-Lim.
- Attention failures (observation). Soft attention can skip, repeat or stop early on long or unusual inputs, because nothing forces it to be monotonic. The location term reduces this. Later models make the alignment monotonic by construction, with durations or a dynamic program.
- Regression to the mean (observation). A squared error loss on frames gives smooth, averaged spectra. The post-net and the neural vocoder restore much of the detail, but the model cannot sample different prosodies for one text, apart from the variation that pre-net dropout gives.
References
- Wang et al. 2017, Section 3 (the CBHG module, the encoder, the decoder, the post-processing net and Griffin-Lim), Table 1 (the hyper-parameters) and the MOS table
- Jonathan Shen, Ruoming Pang, Ron J. Weiss and colleagues, Natural TTS synthesis by conditioning WaveNet on mel spectrogram predictions, ICASSP 2018, arXiv:1712.05884, Section 2 (the mel spectrogram, the encoder, the location-sensitive attention, the decoder, the post-net and the WaveNet vocoder) and Table 1 (MOS)
- Paul Taylor, Text-to-Speech Synthesis, Cambridge University Press, 2009, Chapter 3 (The text-to-speech problem), for the front end and back end that Tacotron replaces with one network
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 2HQKP5 Edit this page History Report an error Markdown