티스토리 뷰

반응형

MQTTS: A Vector Quantized Approach for Text to Speech Synthesis on Real-World Spontaneous Speech


  • Text-to-Speech에서 human-level diversity를 반영할 필요가 있음
  • MQTTS
    • Mel-spectrogram based autoregressive model의 alignment mismatch 문제를 해결하기 위해 multiple code group으로 학습된 discrete code를 활용
    • 합성 품질 향상을 위해 clean silence prompt를 활용하고 multiple code generation과 monotonic alignment architecture를 도입
  • 논문 (AAAI 2023) : Paper Link

1. Introduction

  • Text-to-Speech (TTS)에서 사용되는 standard corpora는 대부분 통제된 환경에서 녹음된 음성을 활용함
    • 즉, TTS 모델은 paralinguistic information을 전달하는 다양한 prosody를 반영하기 어려움
    • 이를 해결하기 위해, YouTube나 podcast 등에서 수집된 real-world speech의 사용을 고려할 수 있음
      - 이때 해당 real-world speech로 TTS를 학습하기 위해서는, 기존의 통제된 data와 달리 prosody나 background noise의 higher variation에 대응할 수 있어야 함
    • 실제로 Tacotron2와 같은 mel-spectrogram based autoregressive model은 추론 중에 적절한 text-audio alignment를 생성하지 못하므로 unintelligible speech가 발생함
      1. BUT, training 중에는 명확한 alignment가 학습될 수 있기 때문에, 추론 시 발생하는 alignment 실패는 decoding procedure의 error accumulation에서 비롯된다고 볼 수 있음
      2. 이때 mel-spectrogram을 learned discrete codebook으로 대체하는 경우, error accumulation 문제를 해결 가능
        - Discrete representation의 input noise에 대한 resiliency가 더 높기 때문

-> 그래서 real-world speech를 활용과 추론 alignment 실패 문제를 해결하기 위해 multi-codebook을 도입한 MQTTS를 제안

 

  • MQTTS (Multi-codebook vector Quantized TTS)
    • Alignment 실패를 해결하기 위해 learned discrete codebook을 도입
    • 이때 single codebook은 real-world speech에 대해 distorted reconstruction이 발생하므로 다양한 prosody pattern을 반영하기에 충분하지 않음
      - 따라서 multi-code sampling과 monotonic alignment를 위해 multiple codebook에 적합한 architecture를 설계
    • 추가적으로 추론 중에 clean silence audio prompt를 사용하여 real-world noisy corpus에 대해 clean speech를 생성할 수 있도록 함

< Overall of MQTTS >

  • Mel-spectrogram based autoregressive model의 alignment mismatch 문제를 해결하기 위해 multiple code group으로 학습된 discrete code를 활용
  • 합성 품질 향상을 위해 clean silence prompt를 활용하고 multiple code generation과 monotonic alignment architecture를 도입
  • 결과적으로 기존 모델들과 비교하여 다양하고 우수한 합성 성능을 달성 

2. MQTTS

  • MQTTS의 training은 two-stage로 구성됨
    1. First stage에서 quantizer는 quantization loss $\mathcal{L}_{VQ}$와 input $\mathbf{x}$와 output $\mathbf{y}$ 간의 reconstruction loss를 jointly minimizing 하여 raw waveform $\mathbf{x}$를 discrete code $\mathbf{c}=\{c_{t}\}, t\in[1,...,T]$로 mapping 함
      - 이때 discriminator는 additional adversarial loss를 사용하여 reconstruction을 guide 함
      - 여기서 quantizer의 encoder, decoder를 각각 $Q_{E}, Q_{D}$, discriminator를 $D$, learnable codebook embedding을 $N$개 codebook에 대해 $G_{i}$로 나타냄 ($i\in[1,...,N]$)
    2. Second stage에서는 quantize를 fix 하고, multi-speaker TTS와 phoneme sequence $\mathbf{h}$를 활용하기 위해 speaker embedding $\mathbf{s}$를 condition으로 $\mathbf{c}$에서 autoregressive generation을 수행하는 transformer를 training 함

Overall of MQTTS

- Quantization of Raw Speech

  • Quantizer Architecture
    • Quantizer decoder $Q_{D}$와 discriminator $D$의 backbone으로 HiFi-GAN을 채택함
      - 이때 input mel-spectrogram을 discrete code의 learned embedding으로 대체함
      - $Q_{E}$의 경우 deconvolution layer를 convolution layer로 대체하는 방식으로 HiFi-GAN을 reverse 함
    • 여기서 navie 하게 HiFi-GAN architecture를 사용하면 quantization loss $\mathcal{L}_{VQ}$와 training divergence가 explose 함
      - HiFi-GAN의 residual block의 unnormalized output 때문에 발생
    • 따라서 aggregation 이전에 모든 residual block의 output에 group 당 16개 channel이 있는 group normalization을 적용
      - 추가적으로 decoder $Q_{D}$의 input에 speaker embedding을 broadcast-add 함
  • Multiple Codebook Learning
    • Single codebook을 사용하면 real-world speech가 제대로 reconstruction 되지 않으므로, vq-wav2vec의 concept를 활용하여 multiple codebook으로 quantization을 수행함
      - 이때 각 $c_{t}$는 $N=4$의 code로 represent 되고 final embedding은 $N$ code embedding의 concatenation과 같음
    • 먼저 codebook $G_{i}$에 해당하는 individual code를 $c_{t,i}$라고 하자:
      (Eq. 1) $c_{t,i}=\arg\min_{z\in G_{i}}||z_{t,i}^{c}-z||_{2}$
      - 여기서 $Q_{E}$의 output인 $z_{t}^{c}$에서 discrete code $c_{t,i}$를 얻기 위해 $z_{t}^{c}$의 embedding dimension을 $N$개의 equal part로 slice 하고, 각 part를 $z_{t,i}^{c}$로 나타냄
    • 그러면 decoder에 대한 input $z_{t}^{q}$는 straight-through gradient estimator에 의해 얻어짐:
      (Eq. 2) $z_{t,i}^{q}=z_{t,i}^{c}+\mathrm{sg}[G_{i}(c_{t,i})-z_{t,i}^{c}],\,\,\, z_{t}^{q}=\mathrm{concat}[z_{t,i}^{q}]$
      - $\mathrm{sg}[\cdot]$ : stop gradient operator, $G_{i}(\cdot)$ : 주어진 code의 embedding을 반환하는 역할, $\mathrm{concat}[\cdot]$ : embedding dimension의 모든 code를 concatenate
    • 결과적으로 final loss $\mathcal{L}_{F}$는 HiFi-GAN loss term $\mathcal{L}_{GAN}$과 additional quantization loss $\mathcal{L}_{VQ}$로 구성됨:
      (Eq. 3) $\mathcal{L}_{F}=\lambda\mathcal{L}_{VQ}(Q_{E},Q_{D},G)+\mathcal{L}_{GAN}(Q_{E},Q_{D},G,D)$
      (Eq. 4) $\mathcal{L}_{VQ}(Q_{E},Q_{D},G)=\mathbb{E}_{x}\left[\frac{1}{T}\sum_{i=1}^{N}\sum_{t=1}^{T}(|| \mathrm{sg}[z_{t,i}^{c}]-z_{t,i}^{q} ||_{2}^{2}+\gamma || z_{t,i}^{c}-\mathrm{sg}[z_{t,i}^{q}]||_{2}^{2})\right]$
      - $\gamma, \lambda$ : 각각 commitment loss와 quantization loss weight에 대한 hyperparameter

- Conditional Synthesis with Transformer

  • Second stage에서는 past sequence $\mathbf{c}_{<t}$가 주어지면 $c_{t}$를 autoregressive 하게 생성하도록 transformer를 training 함
    • 아래 그림과 같이 transformer는 global speaker embedding $s=E_{SPK}(x)$와 phoneme sequence $\mathbf{h}$로 additionally condition 됨
    • 이때 $E_{SPK}$에 대해 pre-trained speaker embedding extractor와 2개의 linear layer, ReLU activation을 사용함
    • Transformer는 log-likelihood를 최대화하도록 training 됨:
      (Eq. 5) $\mathcal{L}_{T}=\mathbb{E}_{\mathbf{c}}\left[-\sum_{t}\log p(c_{t}|\mathbf{c}_{<t},\mathbf{s},\mathbf{h})\right]$
  • Architectural Design
    • 일반적인 encoder-decoder architecture는 low-level에서 high-level representation까지 complex semantic correlation이 있다고 가정함
    • BUT, TTS에서 cross attention은 low-level audio representation을 사용하여 alignment pattern을 pre-estimating 하는 데 사용되는 단순한 unique alignment임
      - 따라서 MQTTS는 decoder의 마지막 layer에만 cross attention layer를 적용하고 unique alignment를 얻기 위해 single-head cross attention을 사용
      - 나아가 이러한 unique alignment map을 통해 monotonic alignment를 활용할 수 있음
    • 결과적으로 ALiBi로 positional encoding을 대체하여 모델이 encoder, decoder 모두에 대해 long input sequence를 합성할 수 있도록 함
  • Multi-output Transformer
    • Sampling technique은 autoregressive model의 성능에 상당한 영향을 미치지만 multi-code setting에 적용하는 것은 어려움
      - 단순하게 linear layer를 사용하여 한 번에 $N$개의 code를 예측하도록 하면, 각 code의 distribution에만 개별적으로 access 할 수 있음
      - Nucleus sampling은 $N$ code의 joint distribution에 대해 top-$p$ candidate가 필요하므로 theoretically infeasible 함
    • 위 문제를 해결하기 위해, MQTTS는 additional transformer decoder를 사용하여 code의 conditional distribution을 explicitly modeling 하는 방식을 사용하고 이를 sub-decoder module이라고 함
      1. Time sequence에 따라 동작하는 main decoder와 달리 sub-decoder는 fixed size $N$의 codebook group에 걸쳐 sequential 하게 동작함
      2. 아래 그림과 같이, time $t$에서 sub-decoder는 main decoder의 output state인 $O_{t}$를 starting condition으로 하고 주어진 $\mathbf{c}_{t,<i}$에 대해 sequential 하게 $c_{t, i}$를 생성함
        - 여기서 positional encoding 없이 각 codebook group에 대해 separate embedding을 사용
      3. 이를 통해 각 conditional distribution $p(c_{t,i}| \mathbf{c}_{t,<i},O_{t})$에 대해 time $t$에서 nucleus sampling을 각각 적용할 수 있음
      4. 전체 $c_{t}$를 생성한 후, $c_{t}$는 next step $O_{t+1}$을 생성하기 위해 main decoder에 autoregressively feedback 됨
  • Repetition Token
    • Speech signal은 high temporal similarity를 보이므로 transformer가 repeating code를 예측하도록 만들 수 있음
    • 따라서 additional token으로 repetition token을 도입하여 해당 transition을 explicitly modeling 함
      - 즉, consecutive repeated token은 해당 repetition token으로 대체되고, 추론 시에는 original token으로 decode 됨

Multi-Output Transformer

- Inference

  • Transformer inference를 위해 nucleus sampling을 채택하고 fully decoded code를 $Q_{D}$로 전달하여 raw waveform을 reconstruct 함
    1. Monotonic Alignment
      • 먼저 $A(i,j)$를 step $i$의 encoder state와 step $j$의 decoder state 간의 cross attention value라고 하자
        - MQTTS의 cross attention은 single-head, single-layer이므로 $A(i,j)$는 unique 함
      • 그러면 추론 중에 time $t$의 새로운 decoder state가 주어지면, 전체 encoder state sequence 대신 $[b_{k},b_{k}+1,...,b_{k}+N_{w}]$의 $N_{w}$ encoder state에 대한 cross attention만 계산할 수 있음
        - 이때 $b_{k}$는 recursive 하게 정의됨:
        (Eq. 6) $b_{0}=0, \,\,\, b_{k+1}=\left\{\begin{matrix}
        b_{k}+1, & \textrm{if}\,\, \frac{\exp\{A(b_{k},k)\}}{\sum_{i=0}^{N_{w}}\exp\{ A(b_{k},k+i)\}}<\frac{1}{N_{w}} \\
        b_{k}, & \textrm{otherwise} \\
        \end{matrix}\right.$
      • Decoder는 sequential 하게 한 번에 encoder state의 특정 context window $N_{w}$에만 attend 할 수 있으므로,
        - Context window는 $b_{k}$의 first encoder state의 Softmax attention weight가 주어진 threshold $N_{w}^{-1}$보다 낮은 경우에만 step forward 됨
      • 일반적으로 $N_{w}$가 작을수록 phonetic context가 작아지는 대신, monotonic alignment가 stricter 해짐
        - 실험적으로 $N_{w}$가 3에서 6 사이일 때, 잘 동작하는 것으로 나타남
    2. Audio Prompt
      • Noisy corpus에 대해 training 할 때, 추론 중에 undesired background noise가 sampling 될 수 있음
      • 따라서 MQTTS가 clean speech를 합성할 수 있도록, silence clip에서 $Q_{E}$로 encoding 된 code의 3 frame을 앞부분에 추가함
        - Clean speech 이전에는 clean silence가 있는 경우가 많으므로, 모델은 background noise 없이 합성을 수행할 수 있음

3. Experiments

- Settings

  • Dataset : GigaSpeech
  • Comparisons : VITS, TransformerTTS

- Results

  • Quantizer Analysis
    • Single codebook ($N=1$)을 사용하는 경우, input phone sequence가 크게 distort 됨
      - 즉, original input을 reconstruct 하기 위해서는 multiple code group이 필요함
    • 결과적으로 mel-spectrogram 기반의 HiFi-GAN과 비교하여 MQTTS의 quantizer는 $N=4$의 160 code size를 사용할 때 MOS 측면에서 가장 우수한 성능을 보임 

Quantizer 비교

  • Performance
    • 전체적인 성능 측면에서 MQTTS는 가장 우수한 합성 성능을 보임
    • 한편으로 monotonic alignment, sub-decoder, duration predictor를 각각 제거하는 경우, 성능 저하가 발생함
      - 즉, 제안된 approach가 MQTTS의 성능 향상에 유효하다고 볼 수 있음

모델 성능 비교

  • Autoregressive model의 alignment와 MQTTS의 alignment를 비교해 보면, Tacotron2는 inference alignment에 완전히 실패하는 반면, MQTTS는 명확한 alignment를 생성할 수 있음
    - TransformerTTS의 경우 alignment가 후반부 sequence까지 이어지지 않으므로 초반부의 text 이후로는 unrecognizable noise가 발생하는 것으로 나타남

Alignment 비교

  • VITS와 MQTTS를 비교해 보면, pitch contour 측면에서 MQTTS가 주어진 text에 대해 더 다양한 음성을 합성할 수 있는 것으로 나타남

Pitch Contour 비교

  • Audio Prompt and SNR
    • 다양한 표준 편차 $\sigma$에서 추출한 audio prompt white noise에 대한 SNR을 비교해보면
    • $\sigma$가 증가함에 따라 SNR이 감소하므로 MQTTS가 prompt에 의해 guide 된다고 볼 수 있음

SNR 비교

 

반응형
댓글
최근에 올라온 글
최근에 달린 댓글
«   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