티스토리 뷰
Paper/TTS
[Paper 리뷰] Glow-WaveGAN: Learning Speech Representations from GAN-based Variational Auto-Encoder for High Fidelity Flow-based Speech Synthesis
feVeRin 2024. 6. 20. 11:27반응형
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을 생성함
- 이때 Tacotron2와 같은 attention-based autoregressive (AR) model은 frame-by-frame으로 mel-spectrogram을 생성하여 우수한 품질을 달성했음
- 한편으로 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 문제가 존재함
- 이는 text에서 생성된 acoustic feature가 음성에서 직접적으로 추출된 acoustic feature와 다른 distribution에 위치하기 때문
- 특히 model parameter를 추정하기 위해 일반적으로 사용되는 Mean Squared Error (MSE)는 numerical difference만 고려하므로 over-smoothing 문제를 일으킬 수 있음
- 이때 GAN을 활용하여 target speech distribution을 모델링하면 해당 문제를 극복할 수 있음
- Acoustic model은 주어진 text나 phoneme sequence에 대해 mel-spectrogram과 같은 intermediate representation을 생성하고, vocoder는 해당 representation으로부터 audio sample을 생성함
-> 그래서 acoustic model과 vocoder 간의 mismatch를 줄일 수 있는 Glow-WaveGAN을 제안
- Glow-WaveGAN
- Flow-based acoustic model의 target distribution이 vocoder의 distribution과 일치하는지를 확인하는 Variational Auto-Encoder (VAE)를 도입
- 이때 mel-spectrogram과 같은 pre-designed acoustic feature는 사용하지 않음
- 즉, VAE의 encoder는 speech representation을 추출하는 extractor 역할을 수행하고, decoder는 latent representation에서 waveform을 reconstruction 하는 vocoder 역할을 수행
- 추가적으로 reconstructed speech의 품질을 향상하기 위해 output에 GAN을 적용
- Flow-based acoustic model의 target distribution이 vocoder의 distribution과 일치하는지를 확인하는 Variational Auto-Encoder (VAE)를 도입
< 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을 따르도록 할 수 있음
- WaveGAN module은 waveform reconstruction을 위해 latent speech representation을 학습하고, Glow-TTS module은 WavGAN module에서 학습한 representation에 input text를 mapping 함

- 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을 학습함
- 여기서 encoder는 input
를 hidden featurew 로 encoding 하고 decoder는z 에서z 를 reconstruct 함:w
(Eq. 1)z=Enc(w)∼q(z|w)
(Eq. 2)ˆw=Dec(z)∼p(w|z)
- : input waveformw
- : hidden feature의 distribution으로,q(z|w) 하에서 waveformp(w|z) 를 reconstruct하는데 사용됨ˆw - 해당 VAE에는 일반적으로 reconstruction objective
과 같은 prior regularization term이 포함됨:Lrecon
(Eq. 3)Lvae=Lrecon+DKL(q(z|w)||p(z))
- : Kullback-Leibler divergence,DKL : prior distributionp(z) - 한편으로 reconstruction 성능 향상을 위해 Parallel WaveGAN의 multi-resolution STFT loss를 채택하여 frequency-domain에서
와w 간의 distance를 계산함ˆw
- 이를 통해 음성의 time-frequency characteristic을 효과적으로 학습할 수 있음
- 여기서 encoder는 input
- 구조적으로 VAE는 아래 그림과 같이 구성됨
- Encoder는 음성의 abstact information을 summarize 하기 위한 downsampling convolution layer stack을 사용
- 이때 acoustic model은 sample-level에서 long-term dependency를 학습하기 어렵기 때문에, residual block에서는 long-range context 모델링을 위한 dilated convolution을 채택 - Encoding 이후에는 learned latent distribution
의 statistics로 평균과 분산을 얻음q(z|w)=N(Zμ,Zσ) - Decoder는 encoder의 반대로써, sampling 된
를 speechz 로 upsamping 하는 transposed convolution layer stack을 사용ˆw
- Encoder는 음성의 abstact information을 summarize 하기 위한 downsampling convolution layer stack을 사용
- 추가적으로 논문은 pitch information을 활용해 latent representation
를 향상함z - 이를 위해, 다음의 frame-level pitch reconstuction objective를 사용하여 sampled
로부터 pitch information을 예측하는 pitch predictor를 도입:z
(Eq. 4)Lpitch=||f(z)−p||2
- : log-scale로 추출된 pitch,p : 2개의 convolution layer, linear output layer로 구성된 predictorf(⋅)
- Pitch extraction의 frame-shift는 total down-sampling factor에 따라 달라짐
- 이를 위해 encoder, decoder를 포함하는 VAE를 사용하여 unsupervised manner로 speech representation을 학습함

- GAN for High-Fidelity Speech Reconstruction
- 앞선 VAE로 reconstruct 된 음성에는 audio artifact가 존재할 수 있으므로, 논문은 GAN을 도입해 품질을 더욱 향상함
- 이를 위해, pitch predictor를 포함한 VAE를 GAN의 generator로 처리함
- 즉, generator는 waveform을 hidden
로 encoding 한 다음,z 에서 sampling 된q(z|w) 로 음성을 생성함z
- Discriminator는 real sample 와 생성된 samplew 를 classify 하도록 최적화되고, 합성 시에는 generator의 decoder 부분만 waveform reconstruction에 사용됨ˆw - Adverasrial training을 위해, 논문은 least-squares GAN objective를 활용하여 다음과 같이 generator, discriminator loss를 정의함:
(Eq. 5)Ladv_g=(D(G(w))−1)2
(Eq. 6)Ladv_d(D(w)−1)2+D(G(w))2
- : generator (VAE의 encoding, decoding part에 해당)G
- : Universal MelGAN의 multi-resolution spectrogram discriminatorD - 추가적으로 generator를 training 하기 위해 feature matching loss를 추가함:
(Eq. 7)Lfm=∑s∑i1Ni||Dis(w)−Dis(G(w))||1
- Feature matching loss는 각 discriminator의 intermediate layer에서 추출된 feature map 간의 distance를 최소화하는 것을 목표로 함L1
- :Dis(⋅) -th discriminator의s -th output,i : 각 layer의 unit 수Ni - 최종적으로 앞선 loss들을 결합한 full objective는:
(Eq. 8)L=λ1Lkl+λ2Lpitch+λ3Lrecon+λ4Ladv_g+λ5Lfm
- : (Eq. 3)의 Kullback-Leiblelr divergenceLkl
- 으로 설정λ1=10,λ2=1,λ3=1,λ4=1,λ5=20 - 한편으로 discriminator는 adversarial loss
로 최적화되고, 전체 training procedure는 아래 [Algorithm 1]을 따름Ladv_d
- 이때 decoder VAE와 discriminator를 결합한 architecture는 input representation 를 mel-spectrogram으로 대체하여 GAN-based vocoder로써 사용할 수 있음Z

- Flow-based Acoustic Model
- VAE와 GAN을 포함하는 WaveGAN을 통해 latent representation을 추출하는 extractor와 waveform을 합성하는 speech reconstructor를 얻을 수 있음
- 이에 따라 acoustic model은 latent represent
의 distribution을 모델링하도록 설계되고, 논문은 Glow-TTS를 기반으로 invertible transformation을 적용해z 의 likelihood를 최대화함z - 먼저 training data의 statistics
를 추출하자Zμ,Zσ - 이때 Glow-TTS는 flow-based decoder
를 통해 conditional prior distributionfdec:c→z 를 transforming 하여 speech representationPC(c|t) 의 conditional distribution을 모델링함PZ(z|t)
- : text sequencet - Prior distribution
의 경우, textPC(c|t) 의 각 token에서 statisticst=t1:M 을 계산Cμ=Cμ1:M,Cσ=Cσ1:M
- : sequence lengthM - 그러면 다음과 같이 variable change를 사용하여
의 log-likelihood를 얻을 수 있음:Z
(Eq. 9)logPZ(z|t)=logPC(c|t)+log|det
- 여기서 prior distribution 는 isotropic multivariate Gaussian distribution을 따름
- 이때 Glow-TTS는 flow-based decoder
- Target variable
와 input variable 의 sequence는 완전히 다르므로, 를 계산하려면 두 sequence를 align 해야 함- 이때 Glow-TTS와 마찬가지로 Monotonic Alignment Search (MAS)를 사용하여
에서 각 로 mapping 함
- 여기서 이면 - 결과적으로 prior distribution의 log-likelihood는:
(Eq. 10)
- : WaveGAN의 speech representation 의 length
- Parameter set 와 alignment 의 trainable variable은 iteratively optimize 됨
- 이때 Glow-TTS와 마찬가지로 Monotonic Alignment Search (MAS)를 사용하여
- 해당 Glow-TTS를 사용하여 WaveGAN의 explicit distribution
를 prior conditional distribution 로 변환함
- 각 training step에서는 pre-sampled constant target을 사용하는 대신 에서 target 를 sampling 함 - 추론 시 flow-based acoustic model은 text에서 distribution
를 따르는 를 생성할 수 있음
- 이는 WaveGAN의 decoder에 추가로 전달되어 high-fidelity의 reconstuction을 지원함
- 이에 따라 acoustic model은 latent represent
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
에 exact pitch information이 반영될 수 없음

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

반응형