티스토리 뷰

반응형

FastDiff: A Fast Conditional Diffusion Model for High-Quality Speech Synthesis


  • Denoising Diffusion Probabilistic Model은 우수한 합성 성능을 보이지만, iterative sampling process로 인해 속도의 한계가 있음
  • FastDiff
    • 고품질의 음성 합성을 위한 fast conditional diffusion model
    • 다양한 receptive field pattern의 time-aware location-variable convolution stack을 사용하여 adaptive condition으로 long-term dependency를 모델링
    • 품질을 유지하면서 sampling step을 줄이기 위해 noise schedule predictor를 도입
  • 논문 (IJCAI 2022) : Paper Link

1. Introduction

  • 음성 합성을 위한 vocoder로써 generative model을 활용한 다양한 방식들이 제안되고 있음
    • 이때 음성 합성 모델은 다음을 모두 만족할 수 있어야 함
      1. High-Quality : 높은 sampling rate에서도 고품질의 음성 합성이 가능해야 함
        - 즉, highly variable pattern을 가지는 waveform에 대해 다양한 time scale의 detail을 reconstruct 할 수 있어야 함
      2. Fast : 빠르고 real-time으로 동작 수 있어야 함
    • BUT, 기존의 WaveNet과 같은 autoregressive 방식은 고품질의 합성 능력에 비해 상당한 계산 비용의 문제가 있음
      - 그 외의 flow-based, GAN-based model과 같은 non-autoregressive 방식은 sample diversity의 한계가 있음
    • 한편으로 최근의 Denoising Diffusion Probabilistic Model (DDPM)은 최고의 합성 성능을 제시하고 있지만, audio 합성에 적용하기 위해서는 다음의 어려움이 있음
      1. 기존의 generative model과는 달리 diffusion model은 생성된 audio와 reference 간의 차이를 직접적으로 최소화하도록 학습되지 않음
        - 대신 optimal gradient가 주어졌을 때, noisy sample을 denoise 하는 것을 목표로 함
        - 따라서 breathiness나 vocal fold closure 같은 natural voice characteristic이 overly denoise 될 수 있다는 문제가 있음
      2. DDPM의 합성 품질을 보장하기 위해서는 수백번 이상의 denoise step이 필요함
        - 이때 sampling step을 줄이면 perceivable background noise로 인해 품질의 저하가 발생할 수 있음

-> 그래서 고품질의 음성 합성을 지원하면서 빠르게 동작하는 conditional diffusion model인 FastDiff를 제안

 

  • FastDiff
    • Audio 품질 향상을 위해 다양한 receptive field pattern에 대한 Time-Aware Location-Variable Convolution을 채택하여 adaptive condition으로 long-term time dependency를 모델링
    • 추론 가속을 위해 denoising step을 크게 줄일 수 있는, noise schedule predictor를 도입
    • 추가적으로 FastDiff를 기반으로 text-to-speech (TTS) 작업에 대한 end-to-end 모델인 FastDiff-TTS로 확장

< Overall of FastDiff >

  • Time-Aware Location-Variable Convolution stack을 사용하여 adaptive condition으로 long-term dependency를 모델링
  • 품질을 유지하면서 sampling step을 줄이기 위해 noise schedule predictor를 도입
  • 결과적으로 기존 모델들보다 높은 품질을 유지하면서 빠른 추론 속도를 달성

2. Background: Denoising Diffusion Probabilistic Model

  • Denoising Diffusion Probabilistic Model (DDPM)은 고품질의 합성 성능을 입증한 likelihood-based generative model
    • DDPM의 basic idea는 diffusion process를 reverse 하기 위해 gradient neural network를 training 하는 것
    • 즉, unknown data distribution $p_{data}(x_{0})$에서 $i.i.d.$ sample $\{x_{0}\in\mathbb{R}^{D}\}$가 주어지면, DDPM은 marginal distribution $p_{\theta}(x_{0})=\int ...\int p(x_{T})\prod_{t=1}^{T}p_{\theta}(x_{t-1}|x_{t})dx_{1}...dx_{T}$로 $p_{data}(x_{0})$를 근사하는 것을 목표로 함
      1. 여기서 $q(x_{0})$와 같은 data distribution에 대한 diffusion process는, data $x_{0}$에서 latent variable $x_{T}$까지의 fixed Markov chain으로 정의됨
      2. 그리고 small positive constant $\beta_{t}$에 대해, small Gaussian noise가 $q(x_{t}|x_{t-1})$의 function에 따라 $x_{t}$에서 $x_{t-1}$의 distribution에 추가됨
      3. 결과적으로 전체 diffusion process는 fixed noise schedule $\beta_{1},...,\beta_{T}$에 따라 data $x_{0}$를 whitened latent $x_{T}$로 점진적으로 변환하는 것과 같음
    • 한편으로 reverse process는 shared $\theta$에 의해 parameterize 된 $x_{T}$에서 $x_{0}$까지의 Markov chain으로, 각 iteration에서 diffusion process로 추가된 Gaussian noise를 denoise 하여 sample을 recover 하는 방식으로 동작함
      - 이를 통해 DDPM은 고품질의 합성이 가능하지만, reverse sampling 과정에서 target distribution을 reconstruct 하기 위해 수천번의 iterative step이 필요하다는 단점이 있음

3. FastDiff

- Motivation

  • DDPM을 활용하면 고품질의 sample을 생성할 수 있음
    • BUT, audio 생성 작업에서 다음의 몇 가지 어려움이 존재
      1. Clean audio 대신 noisy audio의 dynamic dependency를 capture 하므로 spectrogram fluctuation 외에도 더 많은 variation information이 반영됨
      2. 제한적인 receptive field로 인해 reverse iteration을 줄이면 성능 저하가 발생할 가능성이 높음
        - 결과적으로 iteration step 절감을 통한 추론 가속이 어려움
    • 따라서 FastDiff는 위 문제를 해결하기 위해 다음의 2가지 component를 도입함
      1. Time-Aware Location-Variable Convolution
        - Dynamic dependency에서 noisy sample의 detail을 catch 하는 역할
        - 해당 convolution은 diffusion step, spectrogrm fluctuation을 포함한 음성의 dynamic variation에 따라 condition 되어 모델에 다양한 receptive field pattern을 제공하고 reverse accelceration에 대한 robustness를 보장
      2. Noise Schedule Predictor
        - Reverse iteration을 줄여 추론 속도를 가속하는 역할

Conditional Diffusion Model

- Time-Aware Location-Variable Convolution

  • 기존의 convolution network와 비교하여 location-variable convolution은 audio의 long-term dependency를 효율적으로 모델링할 수 있음
    • 이를 기반으로 diffusion model의 time step에 sensitive 한 Time-Aware Location-Variable Convolution을 도입함
      1. 이때 time step $t$에서 step index를 128-dimensional positional embedding (PE) vector $e_{t}$에 embedding 함:
        $e_{t}=\left[\sin\left(10^{\frac{0\times 4}{63}}t\right),...,\sin(10^{\frac{63\times 4}{63}}t), \cos\left(10^{\frac{0\times 4}{63}}t\right),...,\cos\left(10^{\frac{63\times 4}{63}} t\right)\right]$
      2. Time-Aware Location-Variable Convolution에서 FastDiff는 input sequence의 associated interval에 대한 convolution을 처리하기 위해 multiple predicted variation-sensitive kernel이 필요함
        - 해당 kernel은 time-aware 하고 diffusion step과 acoustic feature를 포함한 noisy audio variation에 sensitive 해야 함
    • 따라서 아래 그림의 (b), (c)와 같이 kernel predictor를 결합하여 Time-Aware Location-Variable Convolution (LVC) module을 구성함
      1. $q$-th time-aware LVC layer의 경우, $3^{q}$ dilation을 가지는 $M$-length window를 사용하여 input $x_{t}\in\mathbb{R}^{D}$를 split 한 다음, 각 $x_{t}^{k}\in\mathbb{R}^{M}$으로 $K$개의 segment를 생성함:
        (Eq. 1) $\{x_{t}^{1},...,x_{t}^{K}\}=\mathrm{split}(x_{t};M,q)$
      2. 다음으로 kernel predictor $\alpha$에 의해 생성된 kernel을 사용하여 input sequence의 associated kernel에 대한 convolution을 수행함:
        (Eq. 2) $\{F_{t},G_{t}\}=\alpha(t,c)$
        (Eq. 3) $z_{t}^{k}=\tanh(F_{t}*x_{t}^{k})\odot \sigma(G_{t}*x_{t}^{k})$
        (Eq. 4) $z_{t}=\mathrm{concat}(\{z_{t}^{1},...,z_{t}^{K}\})$
        - $F_{t}, G_{t}$ : 각각 $x_{t}^{i}$에 대한 filter kernel, gate kernel, $*$ : 1D convolution
        - $\odot$ : element-wise product, $\mathrm{concat}(\cdot)$ : vector 간의 concatenation
    • 해당 time-aware kernel은 noise-level에 adaptive 하고 acoustic feature에 dependent 하기 때문에, FastDiff는 noisy input에서도 빠른 속도로 denoising gradient를 정확하게 추정할 수 있음

Overall of FastDiff

- Accelerated Sampling

  • Noise Predictor
    • 수백~수천 step의 sampling을 피하기 위해 FastDiff는 Bilateral Denoising Diffusion Model (BDDM)에서 도입된 noise scheduling algorithm을 활용하여 training noise schedule 보다 짧은 sampling schedule을 예측함
      - 해당 scheduling method는 WaveGrad의 grid search나 DiffWave의 fast sampling보다 우수한 성능을 보임
    • 여기서 noise predictor는 continuous noise schedule $\hat{\beta}\in \mathbb{R}^{T_{m}}$을 iteratively derive 함
      1. 구체적으로 BDDM에서는 noise schedule prediction을 위해 tighter Evidence Lower BOund (ELBO)를 도입
        - 즉, leaned diffusion network $\theta$가 주어지면 scheduling network $\phi$는 surrogate objective 간의 차이를 줄이는 것을 목표로 함
        - 여기서 $\hat{\beta}$와 같은 efficient $N$-step noise schedule은 well-leaned noise scheduling network $\phi$에 의해 유도될 수 있음
      2. 결과적으로 noise schedule predictor $\phi$를 학습하기 위해 forward/reverse distribution에 대한 KL divergence로 loss function을 구성함:
        (Eq. 5) $\mathcal{L}_{\phi}=\frac{1}{2(1-\beta_{t}-\alpha^{2}_{t})} \left|\left| \sqrt{1-\alpha^{2}_{t}}\epsilon_{t}-\frac{\beta_{t}}{\sqrt{1-\alpha_{t}^{2}}}\epsilon_{\theta}(x_{t},\alpha_{t})\right|\right|_{2}^{2}+C_{t}$
        - $C_{t}=\frac{1}{4}\log \frac{1-\alpha^{2}_{t}}{\beta_{t}}+\frac{D}{2}\left(\frac{\beta_{t}}{1-\alpha_{t}^{2}}-1\right)$ : training 중에 ignore 되는 constant

Noise Predictor Training

  • Schedule Alignment
    • FastDiff는 training 중에 $T=1000$의 discrete time step을 사용함
    • Sampling 중에 $t$에 대한 condition이 필요한 경우, $N\ll T$를 사용하여 $T_{m}$-step sampling noise schedule $\hat{\beta}$를 $T$-step training noise schedule $\beta$에 aligning하여 $T_{m}$ discrete time index를 근사함

Noise Scheduling Algorithm

- Training, Noise Scheduling and Sampling

  • [Algorithm 1]과 같이 FastDiff는,
    • 다음의 2개의 module을 개별적으로 parameterize 함:
      1. Iterative refinement model $\theta$ : score function의 variational bound를 최소화하는 역할
      2. Noise predictor $\phi$ : tighter evidence lower bound를 위해 noise schedule을 최적화하는 역할
    • 추론 시에는 [Algorithm 3]과 같이,
      1. 먼저 one-shot noise scheduling procedure를 통해 tighter, efficient noise schedule $\hat{\beta}$를 얻음
        - 이를 통해 FastDiff는 sampling 속도를 가속할 수 있고, searched noise schedule은 고품질 생성을 유지할 수 있을 만큼 충분히 robust 함
      2. 이후 schedule alignment를 사용하여 continuous noise schedule을 discrete time index $T_{m}$에 mapping
      3. 최종적으로 Gaussian noise를 iteratively refine 하여 고품질의 sample을 생성함

Training, Sampling Algorithm

- FastDiff-TTS

  • 기존의 text-to-speech (TTS) 모델은 acoustice module, vocoder의 two-stage pipeline을 사용함
    • 이러한 TTS pipeline을 단순화하기 위해 FastDiff를 확장하여 intermediate feature를 사용하지 않는 fully end-to-end model인 FastDiff-TTS를 구성
    • 즉, FastDiff-TTS는 explicit 하게 mel-spectrogram을 생성할 필요 없이 phoneme과 같은 context에서 waveform을 직접 생성하는 것을 목표로 함
    • Architecture
      1. FastDiff-TTS의 architecture는 non-autoregressive TTS 모델인 FastSpeech2를 backbone으로 함
      2. 먼저 encoder에서는 phoneme embedding sequence를 phoneme hidden sequence로 변환하고, duration predictor는 desired waveform output과 일치하도록 encoder output을 expand 함
      3. 이때 aligned sequence가 주어지면 variance adaptor는 hidden sequence에 pitch information을 추가함
      4. 최종적으로 FastDiff를 vocoder로 사용하여 adapted hidden sequence를 speech waveform을 변환함
    • Training Loss
      1. FastDiff-TTS는 기존 TTS 모델과 달리 sample 품질 향상을 위한 additional loss나 adversarial training이 필요 없음
        - 즉, 이를 통해 FastDiff-TTS는 TTS 과정을 크게 단순화함
      2. 여기서 FastDiff-TTS의 final training loss는 다음 term들로 구성됨:
        - Duration prediction loss $\mathcal{L}_{dur}$ : log-scale에서 예측된 word-level duration과 ground-truth 간의 mean squared error
        - Diffusion loss $\mathcal{L}_{diff}$ : 추정된 noise와 Gaussian noise 간의 mean squared error

        - Pitch reconstruction loss $\mathcal{L}_{pitch}$ : 예측된 pitch sequence와 ground-truth 간의 mean squared error
      3. 이때 pitch recontruction loss $\mathcal{L}_{pitch}$는 TTS의 one-to-many mapping 문제를 처리하는데 도움을 줌

4. Experiments

- Settings

- Results

  • Comparison with Other Models
    • MOS 측면에서 FastDiff는 ground-truth와 0.24의 차이만을 보이면서 가장 높은 품질을 달성했고 PESQ, STOI 측면에서도 상당한 개선을 보임
    • 추론 속도 측면에서 FastDiff는 다른 diffusion architecture들과는 달리 4번의 reverse step 만으로도 고품질의 음성을 생성할 수 있음

모델 성능 비교

  • Ablation Study
    • FastDiff의 time-aware location-variable convolution을 일반적인 convolution으로 대체하는 경우 sampling 속도와 품질이 크게 저하됨
    • Noise predictor 대신 grid search를 사용하는 경우에도 오디오 품질의 저하가 나타남
    • 한편으로 discrete time step을 condition으로 사용할 때 FastDiff는 더 우수한 품질의 sample을 합성할 수 있음

Ablation Study 결과

  • Generalization to Unseen Speakers
    • Unseen speaker의 mel-spectrogram inversion 성능을 확인해 보면,
    • FastDiff가 out-of-domain generalization 측면에서도 가장 우수한 것으로 나타남

Unseen Speaker에 대한 결과

  • End-to-End Text-to-Speech
    • FastDiff를 TTS 작업으로 확장한 FastDiff-TTS의 TTS 성능을 비교해 보면
    • FastDiff-TTS는 FastSpeech2와 같은 기존 TTS 모델보다 더 우수한 MOS 성능을 달성함

Text-to-Speech 성능 비교

 

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