티스토리 뷰
Paper/TTS
[Paper 리뷰] LiteTTS: A Lightweight Mel-spectrogram-free Text-to-wave Synthesizer Based on Generative Adversarial Networks
feVeRin 2024. 1. 8. 16:46반응형
LiteTTS: A Lightweight Mel-spectrogram-free Text-to-wave Synthesizer Based on Generative Adversarial Networks
- 빠른 속도로 고품질의 음성을 합성할 수 있는 lightweight end-to-end text-to-speech 모델이 필요
- LiteTTS
- Feature prediction module과 waveform generation module을 결합한 single framework
- Feature prediction module은 input text 및 prosodic information에 대한 latent space embedding을 추정
- Waveform generation module은 추정된 latent embedding을 condition으로 waveform을 합성
- Pre-trained model을 사용하지 않고 domain transfer technique을 사용하여 모델을 jointly train
- 논문 (INTERSPEECH 2021) : Paper Link
1. Introduction
- Text-to-Speech (TTS) 시스템의 품질은 지속적으로 향상되고 있음
- Tacotron2, Transformer TTS와 같은 autoregressive 모델
- 안정적인 합성이 가능하지만 추론 속도가 느림 - FastSpeech2 같은 non-autoregressive 모델
- 병렬 처리가 가능하기 때문에 빠른 추론이 가능함
- Tacotron2, Transformer TTS와 같은 autoregressive 모델
- 대부분의 TTS 모델은 two-stage 방식을 활용함
- (1) Feature predicton module이 input text로부터 Mel-spectrogram을 생성하고, (2) Waveform generation module이 Mel-spectrogram으로부터 vocoder를 통해 waveform을 합성
- 이러한 Two-stage 방식은 두 module 간의 error propagation 문제가 발생할 수 있음
- Mel-spectrogram 생성을 위한 decoder가 필요하기 때문에 network size가 커지는 문제도 있음
- 이때, network에서 Mel-spectrogram decoder를 제거할 수 있으면 모델 size를 상당히 줄일 수 있음
-> 그래서 intermediate speech representation인 Mel-spectrogram을 생성하지 않는 fully text-to-wave 모델인 LiteTTS를 제안
- LiteTTS
- Generative Adversarial Network (GAN) style의 waveform generation module을 활용하여 직접적으로 waveform을 합성
- Text에서 prosodic information을 추출하기 위한 domain transfer technique의 적용
- 작고 빠른 처리 속도를 가진 효율적인 architecture의 구현
< Overall of LiteTTS >
- 13.4M의 parameter 만을 필요로하는 작은 크기의 fully text-to-wave 모델
- Domain transfer를 활용해 음성 합성 과정에 prosodic information을 반영
- 결과적으로 3.84의 높은 MOS 달성과 Tacotron2 보다 5배 빠른 합성이 가능
2. Proposed Model
- LiteTTS는 prosody encoder
, text encoderEpEp , domain transfer encoderEtEt , alignment moduleEfEf , duration predictorAA , waveform generatorPP , discriminator blockGG 로 구성됨DD phoneme과mm -length reference Mel-spectrogram은 각각nn ,x=[x1,x2,...,xm]x=[x1,x2,...,xm] 으로 표현되고, 모델의 input으로 사용됨Z=[z1,z2,...,zn]Z=[z1,z2,...,zn] - Phonetic information은 text encoder를 통해 얻어지고, prosody information은 domain transfer encoder나 prosody encoder를 통해 얻어짐
- 해당 두 source는 Mel-spectrogram과 동일한 length로 확장되어 waveform generator를 통해 음성으로 합성됨
- Discriminator는 음성이 합성된 음성인지 실제 녹음된 음성인지를 판별

- Model Architecture
- Text Encoder
EtEt - Text encoder는 input
로부터 phonetic embeddingxx 를 생성Ht=Et(x)Ht=Et(x)
-Ht=[ht1,ht2,...,htm]Ht=[ht1,ht2,...,htm] - Input
는 positional embedding을 추가하기 전에, learnable phonetic embedding lookup table을 사용하여 먼저 embedding 됨xx
- 이후 결합된 embedding은 여러 개의 lite Feed-Forward Transformer (lite-FFT) block을 통과하여 high-level phonetic embedding 를 얻음HtHt - lite-FFT는 기존 attention module을 대체하기 위해 Long-Short Range Attention (LSRA)를 채택
- LSRA는 input information을 병렬로 처리하는 두개의 branch를 활용함
- Attention branch는 convolution branch가 local information을 얻을 때, global knowlege를 수집하는 것을 목표로함
-> 결과적으로 LSRA를 통해 더 적은 수의 parameter를 사용하면서도 높은 성능을 달성
- Text encoder는 input
- Prosody Encoder
EpEp - TTS 모델에서 음성의 data 분포를 효과적으로 모델링하기 위해서는 prosody가 필수적임
- FastSpeech2의 경우, predictor network를 사용하여 energy, pitch에 대한 prosodic knowledge를 모델에 제공했음
- BUT, 각 prosodic factor 별로 predictor network를 사용하는 것은 최적의 선택이 아님
- 특히 neural network의 경우 over-parameterize 되기 쉽기 때문에 전체 성능을 손상시키지 않으면서 전체의 3/4를 제거 가능
-> 따라서, single network는 하나 이상의 특정 task를 수행할 수 있음 - 앞선 insight를 기반으로, input acoustic feature에서 여러개의 prosodic feature를 추출하는 single network를 설계
- Prosody encoder는 acoustic feature 를 input으로하여 prosody embeddingZZ 을 출력Hp=[hp1,hp2,...,hpn]Hp=[hp1,hp2,...,hpn] - Single prosody network
는 여러 prosodic factor를 함께 제공할 수 있도록 구성됨EpEp
- Embedding 다음에 pitch/energy prediction을 수행하여 prosody embedingHpHp 에 두 information이 반영되도록 함HpHp
- 이때 pitch/energy prediction loss는:Lp=1n∑ni=1||pi−ˉpi||1 Le=1n∑ni=1||ei−ˉei||1
- : 각각 ground-truth pitch/energy,p,e : 예측된 pitch/energyˉp,ˉe
- Alignment Block
A - Alignment block
는A -length frame-level prosody embeddingn 를Hp -length phoneme-level prosody representationm 로 변환˜Hp
-˜Hp=A(Hp) - 학습 단계에서, prosody embedding
는 phonetic embedding과 결합되어˜Hp 를 생성Hc=Ht+˜Hp
- 이때, 는 input utterance의 phoneme과 prosody information을 모두 전달Hc
- Alignment block
- Duration Predictor
P - Duration predictor는 각 phoneme에 해당하는 Mel-spectrogram frame 수인 duration을 예측하는데 사용됨
- Text embedding
가 주어지면, vectorHt 는,ˉd=[ˉd1,ˉd2,...,ˉdm] 로써ˉd=P(Ht) 개의 input phoneme에 대한 예측 duration을 나타냄m
- 이때,∑mi=1ˉdi=n - Duration predictor에 대한 loss function은:
Ldur=1m∑mi=1||di−ˉdi||1
- : ground-truth durationd - 이후, embedding
는 durationHc 에 따라 확장됨ˉd
- (i.g.) 의Hc -th frame은i 번 반복되어 stack됨di
- 결과적으로 에 대한 확장으로Hc 를 얻음He=[he1,he2,...,hen]
- 그리고 나서 embedding 는 waveform generatorHe 로 가기 전에 projection layer를 통과함G
- Domain Transfer Encoder
Ef - Input phoneme sequence
를 사용하여x -length embedding을 생성함m Hf=Ef(x) - Embedding
와 embeddingHf 이 서로 가까워지도록 하는 loss function˜Hp 를 사용하여, 동일한 prosody domain에 대한 knowledge를 share하도록 함Lc
- 이때 로써 pair-wise ranking loss, cosine similarity 등 보다 단순히 L1 loss를 사용하는 것이 더 효과적임Lc - 학습이 진행됨에 따라, loss function
로 인해Lc 에서 형성되는 prosody information이˜Hp 로 전달됨Hf
- 추론 과정에서 domain transfer block은 의미있는 pitch와 energy information을 가지는 를 추출해야함Hf
- 이후, 는Hf 대체하여 phonetic embedding˜Hp 에 직접 제공됨Ht
- Input phoneme sequence
- Waveform Generator
and DiscriminatorG D - 일반적으로 intermediate speech representation인 Mel-spectrogram을 생성하기 위해 encoder 다음에 decoder를 필요로함
- BUT, LiteTTS는 lightweight 모델을 설계하기 위해 Mel-spectrogram을 사용하지 않음 - 학습 과정에서 waveform generator
의 input으로 hidden embeddingG 의 fixed-length segment가 사용되고, 이후 generatorHe 는 input을 upsampling하여 raw waveform을 생성G - Discriminator
는 input이 합성된 것인지 실제 recoding된 reference인지를 판별D
- 일반적으로 intermediate speech representation인 Mel-spectrogram을 생성하기 위해 encoder 다음에 decoder를 필요로함

- Training Losses
- HiFi-GAN의 generator-discriminator architecture를 채택
- Discriminator block
는 2개의 sub-module, Multi-Period Discriminator (MPD)와 Multi-Scale Discriminator (MSD)로 구성D
- 각 sub-module은 각각 서로 다른 period와 scale로 audio input을 처리하는 여러개의 sub-discriminator로 구성됨 - Waveform generation과 Discriminator 학습은 LSGAN의 objective function을 사용:
LGAN(D;G)=Ev,s[∑Kk=1(Dk(v)−1)2+(Dk(G(s)))2] LGAN(G;D)=Es[∑Kk=1(Dk(G(s))−1)2]
- : 서로 다른 periodicity, scale의 ground-truth waveformv
- :s 와 동일,He : sub-discriminator의 총 개수K
- : MPD/MSD의 sub-discriminatorDk - Generator에는 추가적으로 feature matching loss가 적용됨:
Lfeat(G;D)=Ex,s[∑Kk=1∑Ti=11Ni||Dik(x)−Dik(G(s))||1]
- : sub-discriminatorT 의 layer 수Dk
- :Ni -th layer의 전체 feature 수i
- : 해당 layer의 featureDi - 추가적으로 안정성 향상을 위한 auxiliary loss로써, multi-resolution STFT loss
를 사용Lmrstft
- 다양한 frame size, hop size, FFT size에서 생성된 STFT와 ground-truth waveform 간의 차이를 capture - 따라서, 최종 loss는:
LG=LGAN(D;G)+λfLfeat(G;D)+Ldur+λmLmrstft+Lp+Le+λcLc LD=LGAN(G;D)
- 는 각각 2, 30, 5λf,λm,λc
- Discriminator block
3. Experiments
- Settings
- Datasets : LJSpeech
- Comparisons : FastSpeech2, Tacotron2
- Results
- Evaluation
- LiteTTS는 FastSpeech2, Tacotron2의 절반도 되지 않는 13.4M의 parameter만 필요로 함
- Real-Time Factor (RTF) 측면에서 LiteTTS는 Tacotron2 보다 5배, FastSpeech2 보다 1.6배 빠르게 audio 합성이 가능
- 추론 단계에서 phonetic embedding 와 transferred prosodyHt 가 병렬로 계산되기 때문Hf - Multiplay-Accumulate Operations (MACs) 측면에서 LiteTTS는 27.0GMACs만을 사용하여 Tacotron2, FastSpeech2 보다 연산 비용이 낮음
- 음성 품질 측면에서도 LiteTTS는 3.84 MOS로 FastSpeech2 보다 높은 값을 보임
- Autogregressive 모델인 Tacotron2 보다는 MOS가 다소 낮았지만 통계적으로 유의하지는 않음

- Ablation Inference
- LiteTTS는 추론 시 phonetic embedding
와 prosody embeddingHt 를 사용함Hf - (a)
만 사용하는 경우Ht
: Pitch, energy contour가 flat 하게 나타남 (prosody information이 없기 때문) - (b)
만 사용하는 경우Hf
: 다양한 prosody가 나타남 - (c)
모두 사용하는 경우Ht,Hf
: (b)와 비슷하게 다양한 prosody를 가짐
- (a)
- Automatic Speech Recognition (ASR)로 합성된 음성을 평가해 보면,
- (a)와 (c)의 PER이 (b) 보다 상당히 낮음
- (b)는 phonetic information을 사용하지 않기 때문
- LiteTTS는 추론 시 phonetic embedding


반응형