작심삼일

[Glow-TTS] Glow-TTS: A Generative Flow for Text-to-Speech via Monotonic Alignment Search (NIPS 20) 본문

Deep Learning/Text-to-Speech

[Glow-TTS] Glow-TTS: A Generative Flow for Text-to-Speech via Monotonic Alignment Search (NIPS 20)

yun_s 2021. 11. 16. 13:39
728x90
반응형

My Opinion

Glow-TTS 이전의 TTS들, 예를 들면 Transformer TTS 등을 아직 읽어보지 않아서 정확한 차이점은 잘 모르겠다.

하지만 이 논문에서 강조하는 것을 보면, maximum likelihood를 그 자체로 활용해 학습에 사용했다는 사실과 aligmnemt를 잘 찾는다는 것이 Glow-TTS의 novelty일 것 같다.


Introduction

TTS는 입력 문장을 발화 음성으로 바꾸는 것이며, 딥러닝 기반 TTS가 좋은 성능을 보이고 있다.

 

본 논문에서는 flow-based generative model for parallel TTS인 Glow-TTS를 제안한다.

Glow-TTS는 alignment를 학습한다.

Flow와 dynamic programming의 특징을 살려서 입력 문장과 발화 음성 간의 alignment를 찾는다.


Related Work

Alignment Estimation between Text and Speech

입력 문장과 발화 음성 간의 alignment를 계산할 때 보통 hidden Markov models(HMMS)가 사용됐다.

음성 인식 분야에서는 HMMs의 단점을 극복하기 위해 Connectionist Temporal Classification(CTC)를 사용했다.

제안하는 방법은 generative 하기 때문에 CTC와 다르고, 관찰에 의한 가정 없이 parallel 하게 하므로 HMMs와도 다르다.

 

Text-to-Speech Models

이전까지 사용되던 parallel TTS 모델들은 pre-trained autoregressive TTS 모델로부터 alignment를 가져와야 했다.

Glow-TTS는 alignment를 스스로 학습한다.

 

Flow-based Generative Models

Flow-based generative model은 invertible transformation을 통해 데이터의 완벽한 likelihood를 계산할 수 있다.


Glow-TTS

1. Training and Inference Procedures

Glow-TTS는 flow-based decoder $f_{dec}: z \rightarrow x$를 이용해 conditional prior distribution $P_Z (z|c)$를 transforming 하면서 conditional distribution of mel-spectrograms $P_X (x|c)$를 만든다.

이때, $x$와 $c$는 각각 mel-spectrogram과 text다.

변수 변환을 통해 데이터의 exact log-likelihood를 다음과 같이 계산할 수 있다.

$\log P_X (x|c) = \log P_Z (z|c) + \log \left| det \frac{\partial f^{-1}_{dec}(x)}{\partial x}\right|$

 

데이터와 prior distribution을 네트워크 파라미터 $\theta$와 alignment function $A$로 나타낼 수 있다.

Prior distribution $P_Z$는 isotropic multivariate Gaussian distribution이고, prior distribution의 $\mu, \sigma$는 text encoder $f_{enc}$로부터 얻을 수 있다.

Text encoder는 text condition $c=c_{1:T_{text}}$와 $\mu=\mu_{1:T_{text}}, \sigma=\sigma_{1:T_{text}}$를 매핑시킨다. ($T_{text}$: 입력 문장의 길이)

Alignment function $A$는 $z_j ~ N(z_j;\mu_i, \sigma_i)$일 때 $f_{enc}:A(j)$와 발화의 latent representation을 매핑시킨다.

우리는 A가 입력 문장을 skip 하거나 반복하지 않도록 monotonic 하며 surjective 하다고 가정했다.

Prior distribution은 다음과 같이 표현된다.

$\log P_Z (z|c; \theta, A)=\displaystyle \sum ^{T_{mel}}_{j=1}\log N(z_j;\mu_{A(j)}, \sigma_{a(j)})$

$T_{mel}$: length of the input mel-spectrogram

 

우리의 목표는 다음 수식처럼 데이터의 log-likelihood를 최대화하는 alignment $A$와 파라미터 $\theta$를 찾는 것이다.

$\displaystyle \max_{\theta, A}L(\theta, A)=\max_{\theta, A} \log P_X (x|c;A, \theta)$

 

하지만 global solution을 찾는 것은 힘드므로, 목표를 두 단계로 나눴다.

첫째는 다음 식과 같이 현재 파라미터 $\theta$에 대해 가장 probable한 monotonic alignment $A^*$를 찾는 것이다.

$A^* = \underset{A}{\arg\max}\log P_X(x|c;A, \theta) = \underset{A}{\arg\max}\displaystyle \sum^{T_{mel}}_{j=1}\log N(z_j; \mu_{A(j)}, \sigma_{A(j)})$

둘째는 log-likelihhod $\log p_X(x|c;\theta, A^*)$를 최대화하도록 파라미터 $\theta$를 업데이트하는 것이다.

 

첫 번째 문제를 해결하기 위해 monotonic alignment search(MAS)를 적용했고, 이는 아래에 자세히 설명되어있다.

가장 probable 한 monotonic alignment $A^*$를 찾기 위해 alignment $A^*$로부터 얻은 duration label과 일치하도록 아래 수식과 같이 duration predictor $f_{dur}$를 학습했다.

$d_i = \displaystyle \sum^{T_{mel}}_{j=1}1_{A^*(j)=i}, i=1, ..., T_{text}$

 

FastSpeech의 구조를 따라서 우리도 duration predictor를 text encoder 앞에 뒀고, logarithmic domain에서 MSE로 학습시켰다.

또한, duration predictor가 maximum likelihood에 영향을 끼치지 않도록 backward pass단계에서 gradient를 지우기 위해 stop gradient operator $sg[·]$를 적용했다.

Duration predictor의 loss는 다음과 같다.

$L_{dur}=\mathit{MSE}(f_{dur}(sg[f_{enc}(c)]), d)$

 

2. Monotonic Alignment Search

MAS는 다음과 같은 알고리즘으로 진행된다.

 

3. Model Architecture

Decoder

Glow-TTS에서 가장 핵심인 부분은 flow-based decoder다.

Decoder는 normalization layer, invertible $1 \times 1$ conv layer, affine coupling layer로 이루어진 multiple blocks 여러 개로 이루어져 있다.

 

Encoder and Duration Predictor

Encoder의 구조는 Transformer TTS를 따라 했지만, 두 가지를 바꿨다.

Self-attention 모듈에 positional encoding을 빼고 relative position representation을 넣었다.

그리고, encoder pre-net에 residual connection을 추가했다.

Duration predictor는 conv layer 2개, ReLU, layer normalization, dropout, projection layer으로 이루어져 있다.


Experiments & Results


Conclusion

Glow-TTS는 maximum likelihood를 바로 사용해 학습할 수 있는 flow-based generative model이다.

제안하는 모델은 입력 문장과 발화 사이의 가장 probable 한 monotonic alignment를 찾는다.

Tacotron2보다 속도가 더 빠르다.


Reference

Kim, Jaehyeon, et al. "Glow-TTS: A Generative Flow for Text-to-Speech via Monotonic Alignment Search." Advances in Neural Information Processing Systems 33 (2020).

728x90
반응형
Comments