티스토리 뷰

반응형

Glow-WaveGAN: Learning Speech Representations from GAN-based Variational Auto-Encoder for High Fidelity Flow-based Speech Synthesis


  • Text-to-Speech 모델은 주로 mel-spectrogram과 같은 low-resolution intermediate representation에 의존하므로 vocoder와 acoustic model 간의 mismatch가 존재함
  • Glow-WaveGAN
    • Pre-designed intermediate representation에 의존하지 않고 GAN과 결합된 VAE를 사용하여 speech에서 latent representation을 직접 학습
    • 이후 flow-based acoustic model을 활용해 text의 latent representation을 모델링
  • 논문 (INTERSPEECH 2021) : Paper Link

1. Introduction

  • Text-to-Speech (TTS) pipeline은 크게 acoustic model과 vocoder의 two-stage로 나누어짐
    • Acoustic model은 주어진 text나 phoneme sequence에 대해 mel-spectrogram과 같은 intermediate representation을 생성하고, vocoder는 해당 representation으로부터 audio sample을 생성함
      1. 이때 Tacotron2와 같은 attention-based autoregressive (AR) model은 frame-by-frame으로 mel-spectrogram을 생성하여 우수한 품질을 달성했음
      2. 한편으로 FastSpeech, FastSpeech2와 같은 non-autoregressive acoustic model은 alignment prediction을 활용해 기존 AR model보다 빠른 합성이 가능함
        - 특히 Glow-TTS와 같이 flow-based model을 기반으로 dynamic programming을 통해 alignment를 얻어 TTS 성능을 향상할 수 있음
    • Vocoder도 마찬가지로 previous sample에 의존하는 AR model을 고려할 수 있지만, high-temporal resolution을 가지는 audio를 합성하는데 상당히 느린 속도를 보임
      - 한편으로 MelGAN, HiFi-GAN과 같은 Generative Adversarial Network (GAN) 기반의 non-AR vocoder는 빠른 속도와 우수한 품질을 지원하고 있음
    • BUT, TTS는 여전히 two-stage pipeline으로 인해 acoustic model과 vocoder 간의 mismatch 문제가 존재함
      1. 이는 text에서 생성된 acoustic feature가 음성에서 직접적으로 추출된 acoustic feature와 다른 distribution에 위치하기 때문
      2. 특히 model parameter를 추정하기 위해 일반적으로 사용되는 Mean Squared Error (MSE)는 numerical difference만 고려하므로 over-smoothing 문제를 일으킬 수 있음
        - 이때 GAN을 활용하여 target speech distribution을 모델링하면 해당 문제를 극복할 수 있음

-> 그래서 acoustic model과 vocoder 간의 mismatch를 줄일 수 있는 Glow-WaveGAN을 제안

 

  • Glow-WaveGAN
    • Flow-based acoustic model의 target distribution이 vocoder의 distribution과 일치하는지를 확인하는 Variational Auto-Encoder (VAE)를 도입
      1. 이때 mel-spectrogram과 같은 pre-designed acoustic feature는 사용하지 않음
      2. 즉, VAE의 encoder는 speech representation을 추출하는 extractor 역할을 수행하고, decoder는 latent representation에서 waveform을 reconstruction 하는 vocoder 역할을 수행
    • 추가적으로 reconstructed speech의 품질을 향상하기 위해 output에 GAN을 적용

< Overall of Glow-WaveGAN >

  • Flow-based acoustic model을 사용하여 VAE로부터 hidden representation의 distribution을 학습하는 TTS model
  • 결과적으로 Glow-WaveGAN은 기존보다 뛰어난 합성 품질을 달성

2. Method

  • Glow-WaveGAN은 WaveGAN module과 Glow-TTS module로 구성됨
    • WaveGAN module은 waveform reconstruction을 위해 latent speech representation을 학습하고, Glow-TTS module은 WavGAN module에서 학습한 representation에 input text를 mapping 함
      - 이때 latent speech representation의 robust distribution을 학습하도록 VAE를 통한 feature extraction, reconstruction을 수행
    • 추가적으로 reconstruct 된 음성의 품질을 향상하기 위해 latent representation을 input으로 사용하는 pitch prediction을 도입하고, GAN을 활용해 target speech distribution을 모델링함
    • 최종적으로 flow-based acoustic model을 사용하여 VAE encoder에서 추출된 latent representation의 distribution을 학습
      - 이를 통해 Glow-WaveGAN은 acoustic model과 waveform reconstruction module이 모두 동일한 distribution을 따르도록 할 수 있음

Overall of Glow-WaveGAN

- VAE for Learning Representation and Reconstruction

  • Two-stage TTS에서 acoustic model과 vocoder 간의 mismatch를 완화하기 위해, 논문은 acoustic model이 vocoder로부터 latent feature의 distribution을 직접적으로 학습하는 것을 목표로 함
    • 이를 위해 encoder, decoder를 포함하는 VAE를 사용하여 unsupervised manner로 speech representation을 학습함 
      1. 여기서 encoder는 input $w$를 hidden feature $z$로 encoding 하고 decoder는 $z$에서 $w$를 reconstruct 함:
        (Eq. 1) $z=\mathrm{Enc}(w)\sim q(z|w)$
        (Eq. 2) $\hat{w}=\mathrm{Dec}(z)\sim p(w|z)$
        - $w$ : input waveform
        - $q(z|w)$ : hidden feature의 distribution으로, $p(w|z)$ 하에서 waveform $\hat{w}$를 reconstruct하는데 사용됨
      2. 해당 VAE에는 일반적으로 reconstruction objective $L_{recon}$과 같은 prior regularization term이 포함됨:
        (Eq. 3) $L_{vae}=L_{recon}+D_{KL}(q(z|w)||p(z))$
        - $D_{KL}$ : Kullback-Leibler divergence, $p(z)$ : prior distribution
      3. 한편으로 reconstruction 성능 향상을 위해 Parallel WaveGAN의 multi-resolution STFT loss를 채택하여 frequency-domain에서 $w$와 $\hat{w}$ 간의 distance를 계산함
        - 이를 통해 음성의 time-frequency characteristic을 효과적으로 학습할 수 있음
    • 구조적으로 VAE는 아래 그림과 같이 구성됨
      1. Encoder는 음성의 abstact information을 summarize 하기 위한 downsampling convolution layer stack을 사용
        - 이때 acoustic model은 sample-level에서 long-term dependency를 학습하기 어렵기 때문에, residual block에서는 long-range context 모델링을 위한 dilated convolution을 채택
      2. Encoding 이후에는 learned latent distribution $q(z|w)=\mathcal{N}(Z_{\mu}, Z_{\sigma})$의 statistics로 평균과 분산을 얻음
      3. Decoder는 encoder의 반대로써, sampling 된 $z$를 speech $\hat{w}$로 upsamping 하는 transposed convolution layer stack을 사용 
    • 추가적으로 논문은 pitch information을 활용해 latent representation $z$를 향상함
    • 이를 위해, 다음의 frame-level pitch reconstuction objective를 사용하여 sampled $z$로부터 pitch information을 예측하는 pitch predictor를 도입:
      (Eq. 4) $L_{pitch}=|| f(z)-p||_{2}$
      - $p$ : log-scale로 추출된 pitch, $f(\cdot)$ : 2개의 convolution layer, linear output layer로 구성된 predictor
      - Pitch extraction의 frame-shift는 total down-sampling factor에 따라 달라짐

Auto-Encoder Architecture

- GAN for High-Fidelity Speech Reconstruction

  • 앞선 VAE로 reconstruct 된 음성에는 audio artifact가 존재할 수 있으므로, 논문은 GAN을 도입해 품질을 더욱 향상함
    • 이를 위해, pitch predictor를 포함한 VAE를 GAN의 generator로 처리함
    • 즉, generator는 waveform을 hidden $z$로 encoding 한 다음, $q(z|w)$에서 sampling 된 $z$로 음성을 생성함
      - Discriminator는 real sample $w$와 생성된 sample $\hat{w}$를 classify 하도록 최적화되고, 합성 시에는 generator의 decoder 부분만 waveform reconstruction에 사용됨
    • Adverasrial training을 위해, 논문은 least-squares GAN objective를 활용하여 다음과 같이 generator, discriminator loss를 정의함:
      (Eq. 5) $L_{adv\text{_}g}=(D(G(w))-1)^{2}$
      (Eq. 6) $L_{adv\text{_}d}(D(w)-1)^{2}+D(G(w))^{2}$
      - $G$ : generator (VAE의 encoding, decoding part에 해당)
      - $D$ : Universal MelGAN의 multi-resolution spectrogram discriminator
    • 추가적으로 generator를 training 하기 위해 feature matching loss를 추가함:
      (Eq. 7) $L_{fm}=\sum_{s}\sum_{i}\frac{1}{N_{i}}||D_{s}^{i}(w)-D_{s}^{i}(G(w))||_{1}$
      - Feature matching loss는 각 discriminator의 intermediate layer에서 추출된 feature map 간의 $L1$ distance를 최소화하는 것을 목표로 함
      - $D_{s}^{i}(\cdot)$ : $s$-th discriminator의 $i$-th output, $N_{i}$ : 각 layer의 unit 수
    • 최종적으로 앞선 loss들을 결합한 full objective는:
      (Eq. 8) $L=\lambda_{1}L_{kl}+\lambda_{2}L_{pitch}+\lambda_{3}L_{recon}+\lambda_{4}L_{adv\text{_}g}+\lambda_{5}L_{fm}$
      - $L_{kl}$ : (Eq. 3)의 Kullback-Leiblelr divergence
      - $\lambda_{1}=10, \lambda_{2}=1, \lambda_{3}=1, \lambda_{4}=1,\lambda_{5}=20$으로 설정
    • 한편으로 discriminator는 adversarial loss $L_{adv\text{_}d}$로 최적화되고, 전체 training procedure는 아래 [Algorithm 1]을 따름
      - 이때 decoder VAE와 discriminator를 결합한 architecture는 input representation $Z$를 mel-spectrogram으로 대체하여 GAN-based vocoder로써 사용할 수 있음

Training Algorithm

- Flow-based Acoustic Model 

  • VAE와 GAN을 포함하는 WaveGAN을 통해 latent representation을 추출하는 extractor와 waveform을 합성하는 speech reconstructor를 얻을 수 있음
    • 이에 따라 acoustic model은 latent represent $z$의 distribution을 모델링하도록 설계되고, 논문은 Glow-TTS를 기반으로 invertible transformation을 적용해 $z$의 likelihood를 최대화함
    • 먼저 training data의 statistics $Z_{\mu}, Z_{\sigma}$를 추출하자
      1. 이때 Glow-TTS는 flow-based decoder $f_{dec}:c\rightarrow z$를 통해 conditional prior distribution $P_{C}(c|t)$를 transforming 하여 speech representation $P_{Z}(z|t)$의 conditional distribution을 모델링함
        - $t$ : text sequence
      2. Prior distribution $P_{C}(c|t)$의 경우, text $t=t_{1:M}$의 각 token에서 statistics $C_{\mu}=C_{\mu_{1:M}}, C_{\sigma}=C_{\sigma_{1:M}}$을 계산
        - $M$ : sequence length
      3. 그러면 다음과 같이 variable change를 사용하여 $Z$의 log-likelihood를 얻을 수 있음:
        (Eq. 9) $\log P_{Z}(z|t)=\log P_{C}(c|t)+\log \left|\det\frac{\partial f_{dec}^{-1}(z)}{\partial z} \right|$
        - 여기서 prior distribution $P_{C}$는 isotropic multivariate Gaussian distribution을 따름
    • Target variable $z$와 input variable $t$의 sequence는 완전히 다르므로, $\log P_{C}(c|t)$를 계산하려면 두 sequence를 align 해야 함
      1. 이때 Glow-TTS와 마찬가지로 Monotonic Alignment Search (MAS)를 사용하여 $z$에서 각 $c$로 mapping 함
        - 여기서 $c_{j}\sim \mathcal{N}(c_{j};C_{\mu_{i}},C_{\sigma_{i}})$이면 $A(j)=i$
      2. 결과적으로 prior distribution의 log-likelihood는:
        (Eq. 10) $\log P_{C}(c|t;\Theta,A)=\sum_{j=1}^{N}\log \mathcal{N}(c_{j};C_{\mu_{A(j)}}, C_{\sigma_{A(j)}})$
        - $N$ : WaveGAN의 speech representation $Z$의 length
        - Parameter set $\Theta$와 alignment $A$의 trainable variable은 iteratively optimize 됨
    • 해당 Glow-TTS를 사용하여 WaveGAN의 explicit distribution $\mathcal{N}(Z_{\mu},Z_{\sigma})$를 prior conditional distribution $P(c|t)$로 변환함
      - 각 training step에서는 pre-sampled constant target을 사용하는 대신 $\mathcal{N}(Z_{\mu},Z_{\sigma})$에서 target $z$를 sampling 함
    • 추론 시 flow-based acoustic model은 text에서 distribution $\mathcal{N}(Z_{\mu}, Z_{\sigma})$를 따르는 $\hat{z}$를 생성할 수 있음
      - 이는 WaveGAN의 decoder에 추가로 전달되어 high-fidelity의 reconstuction을 지원함

3. Experiments

- Settings

  • Dataset : LJSpeech, VCTK
  • Comparisons : Glow + HiFi-GAN

- Results

  • MOS 측면에서 Glow-WaveGAN은 가장 우수한 성능을 달성함

모델 성능 비교

  • Pitch predictor의 효과를 확인하기 위해, input에 stop-gradient operator를 추가하여 Glow-WaveGAN을 training 함
    • 이때 stop-gradient가 적용된 경우 모델이 전혀 수렴하지 않는 것으로 나타남
    • 즉, pitch predictor를 사용하지 않으면 speech representation $Z$에 exact pitch information이 반영될 수 없음

Pitch Loss 비교

  • 추가적으로 VCTK의 unseen speaker에 대한 합성 품질을 비교했을 때도, Glow-WaveGAN의 성능이 가장 뛰어남

Unseen Speaker에 대한 성능 비교

 

반응형
댓글
최근에 올라온 글
최근에 달린 댓글
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Total
Today
Yesterday