티스토리 뷰

반응형

Fre-GAN 2: Fast and Efficient Frequency-Consistent Audio Synthesis


  • 대규모의 TTS 모델은 resource가 제한된 device에 적용하기 어려우므로 neural vocoder는 효율적이면서도 고품질의 합성이 가능해야 함
  • Fre-GAN 2
    • Audio의 low/high-frequency에서 합성을 수행하고, inverse discrete wavelet transform을 통해 target-resolution audio를 reproduce
    • 적은 수의 parameter 만으로 고품질의 audio를 합성할 수 있도록 adversarial periodic feature distillation을 도입
  • 논문 (ICASSP 2022) : Paper Link

1. Introduction

  • Vocoder는 mel-spectrogram과 같은 low-resolution acoustic feature를 high-resolution waveform으로 변환
    • 최신 text-to-speech (TTS) 모델은 실제와 비슷한 audio를 합성할 수 있지만, complexity의 증가를 요구함
    • 결과적으로 mobile device와 같은 low-resource 환경에는 부적합할 수 있음
      - 대표적으로 WaveNet은 autoregressive 방식으로 인해 추론 속도가 상당히 느림
      - WaveGlow는 invertible flow를 활용하여 병렬적으로 합성이 가능하지만 여전히 높은 complexity를 보임
  • HiFi-GAN과 같이 Generative Adversarial Network (GAN)을 활용한 vocoder들이 등장하고 있음
    • 특히 HiFi-GAN은 다양한 periodic pattern을 modelling 함으로써 효율적이면서도 높은 품질의 합성이 가능함
    • 앞선 연구인 Fre-GAN의 경우 다양한 scale의 spectral 분포를 capture 하기 위해서 resolution-connected generator와 resolution-wise discriminator를 도입함
      - BUT, 여전히 높은 complexity로 인해 low-resource device에서는 동작하기 어려움

-> 그래서 low-resource 환경에서도 사용할 수 있는 빠르고 효율적인 frequency-consistent audio 합성 모델인 Fre-GAN 2를 제안

 

  • Fre-GAN 2
    • Audio의 low/high component 만을 합성하고, inverse Discrete Wavelet Transform (iDWT)을 통해 generator에서 target-resolution audio를 reproduce 하는 방식
    • Information 손실을 줄이고 모든 component를 reproduce 하기 위해 downsampling 방식으로 Discrete Wavelet Transform (DWT)를 적용하는 Fre-GAN의 resolution-wise discriminator를 도입
      - Discriminator에서 DWT를 활용함으로써 sub-audio domain에 대한 최적화가 가능
    • 적은 수의 parameter로 audio 품질을 높이기 위해, Adversarial Periodic Feature Distillation (APFD)을 도입

< Overall of Fre-GAN 2 >

  • Fre-GAN의 구조와 iDWT를 활용하여 빠른 추론 속도와 높은 합성 품질을 지원
  • Knowledge distillation을 활용한 효과적인 parameter 수 절감
  • 결과적으로 10.91배의 추론 속도 향상과 21.23배의 parameter 압축을 달성

2. Fre-GAN 2

- Generator

  • Fre-GAN 2는 high-resolution audio 합성의 model complexity를 완화하는 것을 목표로 함
    • 이를 위해 mel-spectrogram에서 target resolution audio의 low/high-frequency sub-audio part를 합성하고, iDWT를 적용하여 target resolution audio를 reproduce
    • inverse Discrete Wavelet Transform (iDWT)는:
      $\hat{x} = \phi^{-1} (\hat{x}_{low}, \hat{x}_{high})$
      - $\hat{x}, \hat{x}_{low}, \hat{x}_{high}$ : 각각 iDWT로 reporduce 된 생성 audio, audio에서 생성된 low-frequency component, high-frequency component 
      - $\phi^{-1}$ : iDWT
    • 이때 DWT는 invertible 하므로 Fre-GAN 2는 sub-audio set에서 target-resolution audio를 reproduce 하는 것이 가능
  • 모델 압축을 위해 Resolution-Connected Generator (RCG)와 upsampled mel-spectrogram conditioning을 제거하여 Fre-GAN을 단순화
    • Fre-GAN은 RCG를 통해 서로 다른 resolution의 waveform을 합산하여 다양한 level의 spectral 분포를 점진적으로 capture
    • Fre-GAN 2는 sub-audio 합성과 iDWT를 통해 다양한 frequency domain representation을 capture
      - Multi-level sub-audio 합성을 위해 Fre-GAN 2를 확장하여 multi-level iDWT로 target audio를 reproduce 할 수 있음
      - 위의 확장을 통해 audio를 더 빠르게 합성하고 parameter를 압축할 수 있음

Overall of Fre-GAN 2

- Discriminator

  • Sub-audio에서 reproduce 된 target-resolution waveform을 학습하기 위해 Fre-GAN의 resolution-wise discriminator를 채택
    • Resolution-wise discriminator는 downsampling 방식으로 average pooling 대신 DWT를 사용
      - 이를 통해 target resolution audio를 sub-audio set로 disentangle 함으로써 sub-audio set에서 reproduce 된 audio를 information loss 없이 각 frequency domain에 대해 학습할 수 있음
    • DWT는 invertible 하므로 resolution-wise discriminator는 generator가 각 sub-audio를 합성하는 방법을 학습하도록 유도함
      - 결과적으로 discriminator의 DWT로 인해 generator는 target resolution audio를 합성하지 않고 sub-audio domain에서 audio의 consecutive/periodic pattern을 학습할 수 있음
    • Resolution-wise Discriminator의 구성
      1. Resolution-wise multi-scale discriminator (RSD)
        - RSD는 서로 다른 audio scale에서 동작하는 3개의 sub-discriminator로 구성
        - Target resolution audio / DWT를 포함하는 stacked sub-audio set / Multi-level DWT를 포함하는 stacked sub-audio set
      2. Resolution-wise multi-period discriminator (RPD) 
        - RPD는 audio에서 서로 다른 periodic information을 capture 하는 5개의 sub-discriminator로 구성

        - Fre-GAN 2는 $p \in \{ 2,3,5,7,11 \}$인 period $p$를 사용
    • Generator와 discriminator에 대해 least-squares GAN objective를 적용하고, 이때 generator에 대한 feature matching loss:
      $\mathcal{L}_{adv}(D) = \sum_{n=0}^{4} \mathbb{E} \left[ (D^{P}_{n}(x) - 1)^{2} + (D_{n}^{P}(G(s)))^{2}\right] + \sum_{m=0}^{2} \mathbb{E} \left[ (D_{m}^{S}(\phi^{m}(x)-1))^{2} + (D^{S}_{m}(\phi^{m}(G(s))))^{2}\right]$
      $\mathcal{L}_{adv}(G) = \sum_{n=0}^{4} \mathbb{E} \left[ (D^{P}_{n}(G(s))-1)^{2}\right] + \sum_{m=0}^{2} \mathbb{E} \left[ (D^{S}_{m}(\phi^{m}(G(s)))-1)^{2}\right]$

      $\mathcal{L}_{fm}(G) = \mathbb{E} \left[ \sum_{i=0}^{T-1} \frac{1}{N_{i}} || D^{(i)}(x) - D^{(i)}(G(s))||_{1}\right]$
      - $x$ : ground-truth audio, $s$ : ground-truth audio의 input mel-spectrogram
      - $G(s)$의 output은 iDWT를 통해 reproduce 되는 생성 audio
      - $D$ : RPD $D^{P}$와 RSD $D^{S}$로 구성된 discriminator, $\phi^{m}$ : $m$-level DWT
      - $T$ : discriminator의 layer 수, $D^{(i)}$ : discriminator의 $i$-th layer feature map, $N_{i}$ : 각 layer의 unit 수

- Adversarial Periodic Feature Distillation

  • 작은 parameter를 가지는 Fre-GAN 2 (student Fre-GAN 2)의 품질을 향상하기 위해,
    • 큰 parameter를 가지는 teacher Fre-GAN 2에서 student Fre-GAN 2로의 knowledge distillation을 적용
      - 이를 위해 Adversarial Feature-map Distillation (AFD)을 채택하고, discriminator를 periodic information을 capture 할 수 있는 multi-period discriminator로 수정
    • Adversarial Periodic Feature Distillation (APFD)를 위해
      1. Periodic feature discriminator는:
        teacher Fre-GAN 2의 final transposed convolution block의 output feature와 student Fre-GAN 2의 transformed feature를 input으로 사용
      2. Adversarial training은:
        Student Fre-GAN 2가 teacher Fre-GAN 2의 feature를 모방하여 periodic feature discriminator를 속이는 방식
      3. 이때 학습 안정화를 위해 spectral normalization이 모든 periodic feature discriminator에 적용됨
    • Periodic feature discriminator와 student model의 generator $G$에 LSGAN objective를 적용하고, 이때 student generator에 대한 feature matching loss는:
      $\mathcal{L}_{kd}(D^{kd}) = \sum_{n=0}^{3} \mathbb{E} \left [ || D^{kd}_{n}(f_{t})-1||_{2} + ||D^{kd}_{n}(T(f_{s}))||_{2} \right ]$
      $\mathcal{L}^{kd}_{adv}(G) = \sum_{n=0}^{3} \mathbb{E} \left [ (D_{n}^{kd}(T(f_{s}))-1)^{2}\right ]$
      $\mathcal{L}^{kd}_{fm}(G)= \mathbb{E} \left[ \sum_{i=0}^{T-1} \frac{1}{N_{i}} || D^{kd, (i)}(f_{t}) - D^{kd,(i)}(T(f_{s}))||_{1}\right]$
      - $D^{kd}$ : priodic feature discriminator
      - $f_{t}, f_{s}$ : 각각 teacher, student 모델의 final MRF output의 feature map
      - $T$ : teacher와 student 모델 간의 feature map size를 match 하는 변환 함수
    • $f_{t}$와 $T(f_{s})$ 사이의 $L_{1}$ loss를 사용하면 feature matching objective를 최적화하기 어려우므로 knowledge distillation에서는 feature 간의 $L_{1}$ distance를 사용하지 않음

- Final Loss

  • APFD이 적용된 student Fre-GAN 2의 total loss:
    $\mathcal{L}_{total}(G) = \mathcal{L}_{adv}(G) + \lambda_{fm} \mathcal{L}_{fm}(G) + \lambda_{mel}\mathcal{L}_{mel}(G) + \lambda_{adv}^{kd}(G) + \lambda_{fm}^{kd}\mathcal{L}_{fm}^{kd}(G)$
    - $\lambda_{fm} = 2, \lambda_{mel} = 45, \lambda_{adv}^{kd} = 1, \lambda_{fm}^{kd} = 2$
    - $\mathcal{L}_{mel}$ : target mel-spectrogram과 예측된 mel-spectrogram 간의 $L_{1}$ loss 

3. Experiments

- Settings

  • Dataset : LJSpeech 
  • Comparisons : HiFi-GAN, Fre-GAN, WaveNet
  • Fre-GAN 2 구성
    - Fre-GAN 2 (V1) : large parameter model
    - Fre-GAN 2 (V2) : small parameter model

- Results

  • Audio Quality and Inference Speed
    • MOS 측면에서 Fre-GAN 2는 HiFi-GAN, WaveNet 보다 높은 성능을 보임
      - 정량적인 metric인 MCD와 RMSE, PESQ 측면에서도 Fre-GAN 2는 더 나은 성능을 보임 
    • 추론 속도 측면에서 multi-level iDWT를 적용한 Fre-GAN 2는,
      - CPU에서 25.88배, GPU에서 1145.49배의 추론 속도 개선을 달성

성능 비교 결과

  • Performance Evaluation
    • Fre-GAN 2와 다른 모델들 간의 선호도 평가를 수행했을 때, Fre-GAN 2 (V1)은 HiFi-GAN과 거의 동일한 선호도를 보이면서도 추론 속도 개선, parameter 압축 면에서 가장 우수한 것으로 나타남
    • 특히 Fre-GAN 2 (V2)의 경우 Fre-GAN (V1)에 비해 10.91배의 추론 속도 가속이 가능하고, parameter 수는 21.33배 더 압축할 수 있음
    • Knowledge distillation을 적용했을 때, Fre-GAN 2의 성능은 향상됨
      - 특히 APFD를 사용한 Fre-GAN (V2)는 다른 모델들보다 높은 선호도를 보임

Fre-GAN 2 (V1) 기준 선호도 비교
Fre-GAN 2 (V2) 기준 선호도 비교
Knowledge Distillation이 적용된 Fre-GAN 2 기준 선호도 비교

  • Ablation Study
    • Knowledge distillation에 대한 ablation study를 수행
      - $L_{1}$ loss를 사용하는 경우, audio의 metallic sound가 증가하는 경향을 보임
      - 결과적으로 APFD를 사용했을 때 가장 높은 합성 품질을 달성함
    • Sub-audio modelling에 대한 ablation study를 수행
      - Pseudo Quadratic Mirror Filter Bank (PQMF)와 iDWT를 비교
      - 결과적으로 iDWT가 PQMF보다 더 나은 reconstruction 성능을 보임

Knowledge Distillation에 대한 Ablation Study
Sub-audio Modelling에 대한 Ablation Study

 

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