티스토리 뷰

반응형

DiffVoice: Text-to-Speech with Latent Diffusion


  • Text-to-Speech 모델의 성능 향상을 위해 latent diffusion을 활용할 수 있음
  • DiffVoice
    • Adversarial training을 활용한 variational autoencoder를 통해 speech signal을 phoneme-rate representation으로 encode
    • Diffusion model을 통한 latent representation과 duration의 joint modelling
  • 논문 (ICASSP 2023) : Paper Link

1. Introduction

  • Diffusion model은 합성 작업에서 뛰어난 성능을 보이고 있음
    • Text-to-Speech (TTS)에서는 acoustic model에 적용되어 text input이 주어졌을 때, log mel-spectrogram을 생성함
    • 이때 diffusion model을 사용하여 x0Rd에 대한 data density p(x0)직접 modelling하는 것은 여러 문제점이 있음
      1. Intermediate latent variable xtx0와 같은 shape을 가지도록 제한됨
        - Diffusion sampling은 score estimator sθ(xt,t)에 대한 반복적인 평가를 필요로 하기 때문
      2. Diffusion model은 p(x0)의 모든 mode를 capture 하려고 하므로, imperceptible detail에 대해 많은 modelling capacity를 소비함
    • Latent Diffusion Model은 위 문제점들을 완화할 수 있음
      - Encoder fϕ()을 적용하여 data를 latent code z0=fϕ(x0)로 encoding 한 다음,

      - Diffusion model로 latent density pϕ(z0)를 modelling하여 decoder로 gψ(z0)를 생성 가능

-> 그래서 Latent Diffusion Model을 기반으로한 diffusion TTS model인 DiffVoice를 제안

 

  • DiffVoice
    • VAE-GAN 기반의 autoencoder를 활용하여 time에 따른 down-sampling을 지원
      - 이를 통해 mel-spectrogram yRN×Dmel을 latent code z0RM×Dlatent로 encoding
      - N : frame 수, M : phoneme 수
    • Dynamic-rate down-sampling을 통해 latent space에서 single diffusion model을 사용하여 phoneme duration과 mel-spectrogram을 joint modelling
      - 이때 phoneme duration이 다른 factor들과 함께 joint modelling되므로 generic inverse problem solving algorithm을 DiffVoice에 결합할 수 있음

< Overall of DiffVoice >

  • Adversarial training을 통해 speech signal을 phoneme-rate representation으로 encode
  • Latent Diffusion Model을 활용하여 latent representation과 phoneme duration 간의 joint modelling을 지원
  • 결과적으로 우수한 TTS 품질을 달성하고 zero-shot 문제로의 확장이 가능

2. DiffVoice

  • yRN×Dmel이 log mel-spectrogram이라고 하자.
    - N : frame 수, Dmel : mel filter-bank size
    - 이때 wΣMΣ가 모든 phoneme의 집합이라고 했을 때, 해당하는 phoneme sequence

- Dynamic Down-Sampling of Speech

  • DiffVoice는 Variational AutoEncoder (VAE)를 사용하여 speech를 compact latent space로 encoding 함
    • DiffVoice는 wy 사이의 alignment를 얻기 위해 phoneme sequence에 대해 학습된 CTC based ASR model을 활용
      - Minimal-CTC를 사용하여 각 phoneme에 대해 단 하나의 sharp spike가 생성되도록 보장
    • w=(wi)Mi=1의 각 wi에 대해 CTC-alignment의 position은, a=(ai)Mi=1ai
      - a는 strictly increasing 하므로 a0:=0, di:=(aiai1)로 둘 수 있음
      - Positive sequence d=(di)Mi=1은 phoneme duration을 포함
    • 근사 posterior qϕ(z0|y,a) 다음과 같이 정의됨:
      1. Encoder Conformer에 의해 y를 처리한 다음,
      2. Output frame-rate latent representation eRN×Denc는 frame (ai)Mi=1에서 값을 gathering 하여, ˜eRM×Denc로 down-sampling 됨
      3. 이후 ˜e는 linear projection 된 다음 split 되어 평균 μRM×Dlatent와 log 분산 logσRM×Dlatent를 생성
      4. 최종적으로 z0RM×Dlatent는:
        qϕ(z0|y,a):=N(z0;μ,σ)=Mi=1Dlatentk=1N((z0)i,k;μi,k,σi,k)
    • 이때 prior p(z0) standard Normal density로써:
      p(z0):=Mi=1Dlatentk=1N((z0)i,k;0,1)
    • Conditional density pψ(y|z0,a) 다음과 같이 정의됨:
      1. z0RM×Dlatent가 alignment a에 따라 ˜z0RN×Dlatent로 up-sampling 됨
        - 이때 1iM:(˜z0)ai,=(z0)i,이고, ja:(˜z0)j,=0 
      2. 이후 ˜z0hRN×Ddec를 얻기 위해 decoder conformer에 전달되고, 각 frame에서 ˜yRN×Dmel로 linear projection 됨
      3. 최종적으로 pψ는:
        pψ(y|z0,a):=Nj=1Dmelk=112bexp(|yj,k˜yj,k|b)
        - b(0,) : 학습을 조절하기 위한 hyper-parameter
    • 따라서 DiffVoice의 VAE는 LVAE=E(y,a)[Lϕ,ψ(y,a)]를 최적화하여 학습됨
      - Lϕ,ψ(y,a)=DKL(qϕ(z0|y,a)||p(z0))+Eqϕ(z0|y,a)logpψ(y|z0,a)

DiffVoice Architecture

- Adversarial Training

  • 위의 최적화 식만을 사용하면 VAE는 high-frequency detail이 부족한 spectrogram을 생성하게 됨
    • 따라서 DiffVoice VAE의 high-fidelity reconstruction을 보장하기 위해, adversarial loss를 추가
    • Adversarial training은 VAE가 먼저 수렴한 다음 적용되고 sepctrogram decoder를 통해 수행됨
      1. Spectrogram decoder는 random initialized 2D convolution stack과 linear projection을 통해 spectrogram residual을 생성
      2. 이때 2D convolution은 spectral norm regularization에 의해 regularize 되고, leaky ReLU를 통해 interleave 됨
      3. Discriminator는 leaky ReLU에 의해 interleave 된 spectral norm regularization을 사용하는 2D convolution stack
    • Stochastic map을 (y,a)ˆy로, generator를 G(y,a)로, discriminator를 D()라 하자
      1. Adversarial training을 위해 least square loss LG,LD와 feature matching loss LfeatG를 사용하여 G,D를 학습
      2. 결과적으로 adversarial training을 위한 최종 loss Ladv LG,LD,LfeatG,LVAE의 weighted sum:
        LD:=E(y,a)[j,k(Dj,k(y)1)2]+E(y,a)[j,k(Dj,k(ˆy))2]
        LG:=E(y,a)[j,k(Dj,k(G(y,a))1)2]
        LfeatG:=E(y,a)[1LL=11d||D()(y)D()(G(y,a))||1]
        - Discriminator의 output은 2D matrix이고, Dj,kj,k-th value
        - Feature matching loss LfeatG에서 LD의 layer 수
        - D()d element가 있는 layer 의 hidden feature map 

Adversarial Training을 위해 수정된 Decoder

- Latent Diffusion Model

  • DiffVoice는 VAE가 완전히 학습된 후, weight를 freeze 하여 음성을 latent representation으로 encoding
    • Diffusion model을 통해 integer duration sequence d를 modelling 하기 위해서
      1. uUniform[0,1)M으로 sampling 하여 uniform dequantization을 적용한 다음, ˜d=du를 정의함
        - 추가적으로 분포를 normalize 하기 위해 선택된 constant c0,c1lj:=log(˜dj+c0)+c1를 취함
      2. 이때 l=(lj)Mj=1z0의 concatentation을 x0:=[l;z0]RM×(Dlatent+1)로 정의하면,
      3. Latent Diffusion Model은 density p0(x0|w)에서 sampling을 수행하는 것을 목표로 함
    • DiffVoice는 Variance Preserving SDE를 활용하여 generative modelling을 수행
      1. 여기서 Ito SDE는:
        dXt=12β(t)Xtdt+β(t)dBt
        - Xt : RM×(D+1)에서의 random process
        - t[0,1]이고, Bt : RM×(D+1)-valued standard Brownian motion
      2. ˉα(t):=exp(t0β(s)ds)라고 하면, Ito SDE에 대한 transition density는:
        p0t(xt|x0,w)=N(xt;x0ˉα(t),(1ˉα(t))I)
      3. Text를 condition으로 하는 score estimator sθ(xt,t,w)는, sθ(xt,t,w)xtlogpt(xt|w)의 denoising score matching으로 학습되고, time에 따른 weight λt가 적용됨
      4. 결과적으로 SDE 과정에 대한 loss LSDE:
        LSDE:=E{λtE(x0,w)Ext|x0[||sθ(xt,t,w)xtlogp0t(xt|x0,w)||22]} 
    • 추론 과정에서는,
      1. Latent Diffusion Model을 사용하여 p0(x0|w)에서 x0를 sampling
      2. 이후 x0lz0로 split 하고
      3. l에서 alignment a를 reconstruct 한 다음, spectrogram decoder를 통해 (z0,a)에서 log mel-spectrogram ˆy를 decoding

- Solving Inverse Problems with DiffVoice

  • A가 differentiable 할 때 o=A(x0)RO라고 가정하면,
    xtlogpt(xt|o,w)=xtlogpt(xt|w)+xtlogpt(o|xt,w)
  • p0(x0|o,w)에서 sampling 하기 위해서, xtlogpt(o|xt,w)에 대한 estimator를 추가
    • 여기서 E[x0|xt,w]를 근사하는 πθ(xt,t,w):
      πθ(xt,t,w):=1ˉα(t)(xt+(1ˉα(t))sθ(xt,t,w))
    • Weighting function ξ(t):[0,1][0,)를 취하면:
      xtlogpt(o|xt,w)ξ(t)xt||A(πθ(xt,t,w))A(x0)||22

DiffVoice Conformer Block의 Hyeprparameter 설정

3. Experiments

- Settings

- Results

  • Single Speaker Text-to-Speech
    • LJSpeech dataset에 대해 single speaker TTS 품질을 비교
    • MOS 측면에서 DiffVoice는 가장 우수한 합성 품질을 보임

Single Speaker에 대한 합성 품질 비교

  • Multi-Speaker Text-to-Speech
    • LibriTTS dataset에 대해 multi-speaker TTS 품질을 비교
    • 마찬가지로 DiffVoice는 가장 우수한 합성 품질을 달성

Multi-Speaker에 대한 합성 품질 비교

  • Utterance-level-X-vector를 활용하여 zero-shot adaptation 실험을 진행
    • 이때 DiffVoice는 prompt-based zero-shot adaptation을 활용
    • 결과적으로 zero-shot 환경에서도 DiffVoice는 가장 우수한 합성 품질을 보임

Zero-shot 환경에서의 합성 품질 비교

  • Text-based Speech Editing
    • RetrieverTTS와 비슷하게 text-based speech inpainting에 대한 성능 평가를 진행
    • 결과적으로 DiffVoice가 speech inpainting에 대해서도 우수한 성능을 보임

Speech Inpainting에 대한 실험 결과

 

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