티스토리 뷰

반응형

AutoVC: Zero-Shot Voice Style Transfer with Only Autoencoder Loss


  • Many-to-Many voice conversion, zero-shot conversion을 위해 Generative Adversarial Network나 conditional Variational AutoEncoder를 활용할 수 있음
  • AutoVC
    • Bottleneck이 포함된 AutoEncoder에 기반한 style transfer 방식을 도입
    • Self-reconstruction loss에 대해서만 training 함으로써 distribution-matching style transfer를 수행가능
  • 논문 (ICML 2019) : Paper Link

1. Introduction

  • Voice Conversion은 주어진 source speaker의 음성을 target speaker의 음성에 일치시키는 것을 목표로 함
    • 이때 고품질의 voice conversion을 위해서는 다음의 어려움을 해결해야 함:
      1. 대부분의 voice conversion system은 두 speaker가 pair를 이루는 parallel training data에 기반함
      2. 여러 source speaker에서 여러 target speaker에서로 변환할 수 있는 many-to-many conversion을 지원할 수 있어야 함
      3. Unseen speaker에 대한 zero-shot conversion을 지원할 수 있어야 함
    • 한편 voice conversion은 speaker를 domain, voice quality를 style로 취급해 style transfer 문제로 볼 수 있음 
    • 특히 Generative Adversarial Network (GAN), condtional Variational AutoEncoder (cVAE)를 활용 가능
      1. BUT, GAN은 training이 까다롭고 수렴이 fragile 하다는 문제가 있음
      2. cVAE는 training이 쉽지만 GAN과 같은 distribution matching을 보장하지 못하기 때문에 over-smoothing 문제가 발생할 수 있음

-> 그래서 cVAE에서 distribution matching의 이점을 활용할 수 있는 style transfer 기반의 AutoVC를 제안

 

  • AutoVC
    • Distribution matching을 위해 bottleneck이 포함된 vanilla AutoEncoder를 도입
      - Bottleneck을 통해 source에서 style information을 제거하고, style-independent code를 학습하도록 함
    • 추가적으로 self-reconstruction loss만으로 학습되는 해당 cVAE를 기반으로 non-parallel many-to-many voice conversion을 지원하는 AutoVC를 설계
      - 즉, AutoEncoder framework를 기반으로 dimension reduction과 temporal downsampling을 통해 information flow를 constraint 함

< Overall of AutoVC >

  • Bottleneck이 포함된 AutoEncoder를 통해 voice conversion task에 distribution matching의 이점을 반영
  • 결과적으로 기존보다 뛰어난 conversion 성능을 달성

2. Style Transfer AutoEncoder

  • 논문에서는 AutoEncoder가 GAN과 같이 data distribution matching을 수행하도록 함 
    • 먼저 $X$와 같은 uppercase를 random variable/vector, $x$와 같은 lowercase를 deterministic value/random variable instance라고 하자
      - 그러면 $X(1:T)$는 random process이고, $(1:T)$는 $1$에서 $T$까지의 time index collection을 의미함
    • $p_{X}(\cdot |Y)$를 $Y$가 주어졌을 때 $X$의 probability mass function (PMF)/probability density function (PDF)라고 하자
      1. 그러면 $p_{X}(\cdot |Y=y), p_{X}(\cdot |y)$는 $Y$가 specific value $y$를 가질 때 $X$의 PMF/PDF를 의미
      2. 마찬가지로 $\mathbb{E}[X|Y], \mathbb{E}[X|Y=y], \mathbb{E}[X|y]$는 해당 conditional expectation을 나타냄
      3. 추가적으로 $H(\cdot)$은 entropy이고, $H(\cdot | \cdot)$은 conditional entropy

- Problem Formulation

  • Speech가 다음의 stochastic process에 의해 생성된다고 가정하자 
    • 먼저 speaker identity $U$는 speaker population $p_{U}(\cdot)$에서 추출된 random variable이고,
      1. Content vector $Z=Z(1:T)$는 joint content distribution $p_{Z}(\cdot)$에서 추출한 random process
        - Content는 phonetic, prosodic information을 의미
      2. Speaker identity와 content가 주어지면 speech segement $X=X(1:T)$는 speech distribution $p_{X}(\cdot |U,Z)$에서 randomly sample 된 random process로 얻어짐
        - 즉, content $Z$를 uttering 하는 speaker $U$의 distribution을 characterizing 하는 것과 같음

        - $X(t)$ : speech waveform의 mel-spectrogram
    • 이때 $u$에 관계없이 각 speaker가 동일한 양의 gross information을 생성한다고 하자:
      (Eq. 1) $H(X|U=u)=h_{speech}=\text{constant}$
    • 그리고 두 variable set $(U_{1},Z_{1},X_{1}), (U_{2},Z_{2},X_{2})$가 해당 과정에서 생성된 independent and identically distributed (i.i.d.) random sample이라고 하면,
      - $(U_{1},Z_{1},X_{1})$은 source spaeker에 속하고, $(U_{2},Z_{2},X_{2})$는 target speaker에 속함
    • 이때 논문은 $X_{1}$의 content를 preserve 하면서 speaker $U_{2}$의 speaker characteristic과 일치하는 conversion output $\hat{X}_{1\rightarrow 2}$를 생성하는 것을 목표로 함 
      1. 그러면 ideal speech converter는 다음의 desirable property를 가짐:
        (Eq. 2) $p_{\hat{X}_{1\rightarrow 2}}(\cdot | U_{2}=u_{2},Z_{1}=z_{1})=p_{X}(\cdot | U=u_{2},Z=Z_{1})$
      2. 즉, (Eq. 2)는 target speaker identity $U_{2}=u_{2}$, source speech의 content $Z_{1}=z_{1}$이 주어졌을 때, converted speech는 $u_{2}$가 $z_{1}$을 uttering 해야 하는 것을 의미 
    • $U_{1}, U_{2}$가 training set에서 seen인 경우, 기존의 standard multi-speaker conversion과 동일
      - 특히 $U_{1}$ 또는 $U_{2}$가 training set에서 unseen인 경우, zero-shot conversion task가 됨

- The AutoEncoder Framework

  • AutoVC는 AutoEncoder framework를 기반으로 voice conversion을 수행함 
    • 해당 framework는 content embedding을 생성하는 content encoder $E_{c}(\cdot)$, speaker embedding을 생성하는 speaker encoder $E_{s}(\cdot)$, content/speaker embedding에서 음성을 생성하는 decoder $D(\cdot, \cdot)$으로 구성됨 
    • Conversion
      1. Conversion 과정에서 source speech $X_{1}$이 content encoder에 전달되어 content information을 추출함 
      2. Target speech는 speaker encoder에 전달되어 target speaker information을 제공함
      3. Decoder는 source speech의 content information과 target speaker information을 기반으로 converted speech를 생성함:
        (Eq. 3) $C_{1}=E_{c}(X_{1}),\,\,\, S_{2}=E_{s}(X_{2}),\,\,\, \hat{X}_{1\rightarrow 2}=D(C_{1},S_{2})$
        - $C_{1}, \hat{X}_{1\rightarrow 2}$ : random process, $S_{2}$ : random vector
    • Training
      1. 논문에서는 speaker encoder가 speaker dependent embedding을 추출하도록 pre-train 되어 있다고 가정하므로 content encoder와 decoder만을 training 함 
        - 이때 parallel data를 사용하지 않으므로 training에는 self-reconstruction loss만 필요
      2. 구체적으로 content encoder에 대한 input은 $X_{1}$이지만, style encoder에 대한 input은 동일한 speaker $U_{1}$의 utterance $X'_{1}$이 됨
      3. 이를 기반으로 각 input speech $X_{1}$에 대해 AutoVC는 다음의 self-reconstruction을 학습함:
        (Eq. 4) $C_{1}=E_{c}(X_{1}),\,\,\, S_{2}=E_{s}(X'_{1}),\,\,\, \hat{X}_{1\rightarrow 1}=D(C_{1},S_{1})$
      4. 결과적으로 loss function은 self-reconstruction error와 content code reconstruction error를 weighted combination 하여 얻어짐:
        (Eq. 5) $\min_{E_{c}(\cdot),D(\cdot, \cdot)}\mathcal{L}=\mathcal{L}_{recon}+\lambda\mathcal{L}_{content}$
        - 여기서,
        (Eq. 6) $\mathcal{L}_{recon}=\mathbb{E}[|| \hat{X}_{1\rightarrow 1}-X_{1}||_{2}^{2}]$
        (Eq. 7) $\mathcal{L}_{content}=\mathbb{E}[||E_{c}(\hat{X}_{1\rightarrow 1})-C_{1} ||_{1}]$

AutoEncoder Framework

- Why Does It Work?

  • (Eq. 2)의 AutoEncoder-based training은 information bottleneck으로 인해 ideal voice conversion을 수행할 수 있음 
    • 이론적으로 논문의 AutoEncoder framework는 다음을 보장함
    • [Therorem 1.] (Eq. 3), (Eq. 4)의 AutoEncoder framework에 대해 다음의 가정이 주어진다고 하자:
      1. Assumption 1. 동일한 speaker의 다른 utterance에 대한 speaker embedding을 동일하다. 즉, $U_{1}=U_{2}$이면 $E_{s}(X_{1})=E_{s}(X_{2})$
      2. Assumption 2. 다른 speaker의 speaker embedding은 서로 다르다. 즉, $U_{1}\neq U_{2}$이면 $E_{s}(X_{1})\neq E_{s}(X_{2})$
      3. Assumption 3. $\{X_{1}(1:T)\}$는 bounded second moment를 가지는 ergodic stationary order-$\tau$ Markov process:
        (Eq. 7) $p_{X_{1}(t)}(\cdot |X_{1}(1:t-1),U_{1})=p_{X_{1}(t)}(\cdot | X_{1}(t-\tau:t-1),U_{1})$
      4. 추가적으로 $X_{1}$은 finite cardinarity를 가진다고 가정하면,
        Assumption 4. $n$을 $C_{1}$의 dimension이라고 했을 때 $n=\lfloor n^{*}+T^{2/3}\rfloor$이고, 여기서 $n^{*}$는 $p_{X_{1}}(\cdot |U_{1})^{2}$의 optimal coding length
      5. 그러면 다음이 성립한다:
        $\lim_{T\rightarrow \infty}\mathcal{L}=0$일 때 각 $T$에 대해 content encoder $E_{c}^{*}$ decoder $D^{*}(\cdot, \cdot ;T)$이 존재하고,
        (Eq. 8) $\lim_{t\rightarrow \infty}\frac{1}{T}KL(p_{\hat{X}_{1\rightarrow 2}}(\cdot | u_{2},z_{1}) || p_{X}(\cdot | U=u_{2},Z=z_{1}))=0$
        - $KL(\cdot || \cdot)$ : KL-divergence
    • 앞선 [Thm. 1]은 다음과 같이 해석할 수 있음:
      1. Frame 수 $T$가 충분히 크고 bottleneck dimension $n$이 적절하면 (Eq. 5)에 대한 loss function의 global optimizer가 (Eq. 2)의 ideal conversion property를 근사적으로 만족함 
      2. 즉, [Thm. 1]은 desired distribution matching을 달성하기 위해 AutoEncoder를 사용할 수 있음
        - 이때 content encoder의 bottleneck dimension을 speaker independent information을 coding 하기에 충분하도록 설정해야 함

AutoVC의 동작

  • 위 그림과 같이 speech에는 speaker information (회색), speaker-independent information인 content information (strip)의 2가지 information이 포함됨
    • Bottleneck이 input speech $X_{1}$만큼 wide 하다고 가정하면,
      1. Self-reconstruction을 수행하는 가장 쉬운 방법은 $X_{1}$을 그대로 content embedding $C_{1}$에 copy 하는 것이 됨
      2. BUT, $C_{1}$의 dimension이 감소함에 따라 $C_{1}$은 information을 lost 하게 되므로 AutoEncoder는 perfect reconstruction을 위해 이미 $S_{1}$을 통해 제공된 speaker information을 lost 하는 것을 선택함
      3. 이 경우, 위 그림의 (a)와 같이 $C_{1}$에 일부 speaker information이 포함될 수 있음
    • 한편으로 bottleneck이 narrow 하면,
      1. Content encoder는 speaker information 뿐만 아니라 content information도 lost 할 수 있음
      2. 이 경우, 위 그림의 (b)와 같이 perfect reconstruction이 불가능함
    • 따라서 위 그림의 (c)와 같이, $C_{1}$의 dimension이 모든 speaker information을 제거하면서 content information을 손상하지 않도록 적절하게 선택되면 다음의 2가지 property를 만족할 수 있음:
      1. Perfect reconstruction이 가능함
      2. Speaker disentanglement를 달성할 수 있음
        - 즉, content embedding $C_{1}$에는 source speaker $U_{1}$에 대한 information이 전혀 포함되지 않음
    • 한편으로 해당 property를 기반으로 귀류법을 통해 AutoVC의 ideal conversion을 보장할 수 있음:
      1. AutoVC에서 conversion의 품질이 낮다고 가정하자.
      2. 이때 앞선 property 1.에 따라 source, target speaker가 동일한 reconstruction task는 고품질을 보장할 수 있음
      3. BUT, (Eq. 3)에 따라 output speech $\hat{X}_{1\rightarrow 2}$는 $C_{1}, S_{2}$에만 access 할 수 있으므로, 모두 source speaker $U_{1}$에 대한 information을 포함하지 않아야 함
        - 그러면, 위 그림의 (d)와 같이 self-reconstruction/conversion을 구분할 수 없음
      4. 따라서 conversion 품질이 낮은데 reconstruction 품질이 높다는 것은 모순이므로, AutoVC는 고품질의 conversion을 보장 가능함

3. AutoVC Architecture

  • AutoVC는 speaker encoder, content encoder, decoder로 구성됨
    • 이때 AutoVC는 $N\times T$ size의 mel-spectrogram에서 동작함
      - $N$ : mel-frequency bin, $T$ : time step (frame) 수
    • Spectrogram inverter는 output mel-spectrogram을 waveform으로 변환하기 위해 사용됨

AutoVC Architecture

- The Speaker Encoder

  • [Thm. 1]assumption 1, 2에 따라, speaker encoder는 동일한 speaker의 다른 utterance에 대해 동일한 embedding을 생성하고, 다른 speaker에 대해서는 다른 embedding을 생성해야 함
    • 기존 many-to-many conversion에서는 speaker ID를 one-hot encoding 하여 사용하지만, zero-shot conversion을 위해서는 unseen speaker에서도 generalizable 한 embedding을 사용해야 함
    • 따라서 speaker encoder는 cell size가 768인 2개의 LSTM layer stack을 활용함
      - 이때 last time의 output을 select 하여 fully-connected layer를 통해 256 dimension으로 project 하여 $256\times 1$ vector의 speaker embedding을 얻음
    • Speaker encoder는 동일한 speaker의 서로 다른 utterance 간 embedding similarity를 최대화하고 다른 speaker 간의 similairty를 최소화하는 GE2E loss로 pre-train 됨 
      - 논문에서는 VoxCeleb1, LibriSpeech로 pre-train 함

- The Content Encoder

  • Content encoder의 input은 각 time step에서 speaker embedding $E_{s}(X_{1})$과 concatenate 된 $X_{1}$의 80-dimensional mel-spectrogram을 사용함
    • 이때 concatenated feature는 3개의 $5\times 1$ convolutional layer로 전달되고, 각 layer는 batch normalization과 ReLU activation을 가짐
      - Channel 수는 512
    • 이후 output은 2개의 bidirectional LSTM layer stack으로 전달됨
      - Forward/backward cell dimension이 32이므로 combined dimension은 64
    • 논문은 information bottleneck을 구성하기 위해, bidirectional LSTM의 forward/backward output을 32로 downsampling 함
      1. Forward output에 대한 downsampling에서는 time step $\{0,32,64,...\}$를 유지하고, backward output에서는 time step $\{31, 63, 95,...\}$를 유지함
      2. 결과적으로 2개의 $32\times T/32$ matrix가 content embedding으로 얻어짐
        - 논문에서는 이를 각각 $C_{1\rightarrow}, C_{1\leftarrow}$로 나타냄
      3. 즉, 해당 downsampling은 temporal axis에 대한 dimension reduction으로 볼 수 있고, channel axis에 대한 dimension reduction과 함께 information bottleneck을 구성하게 됨

- The Decoder

  • Decoder에서는 먼저 content, speaker embedding을 upsampling 하여 original temporal resolution으로 restore 함
    • 여기서 upsampled feature를 각각 $U_{\rightarrow}, U_{\leftarrow}$라고 하자:
      (Eq. 9) $U_{\rightarrow}(:,t)=C_{1\rightarrow}(:,\lfloor t/32\rfloor)$
      $\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, U_{\leftarrow}(:,t)=C_{1\leftarrow}(:,\lfloor t/32\rfloor)$
      - $(:,t)$ : $t$-th column의 indexing
    • 그러면 기본적으로 각 time step의 각 embedding이 past/future information을 모두 포함해야 함
      1. 이때 speaker embedding은 vector를 $T$번 copy 하는 것으로 얻어질 수 있음
      2. 이후 upsampled embedding을 concatenate 하여 512 channel을 가지는 3개의 $5\times 1$ convolutional layer에 전달한 다음, cell dimension이 1024인 3개의 LSTM layer에 전달함
      3. 그리고 LSTM layer의 output은 $1\times 1$ convolution layer를 통해 80-dimension으로 project 됨
        - 해당 projection output $\tilde{X}_{1\rightarrow 2}$는 converted speech의 initial estimate와 같음
    • AutoVC는 spectrogram의 fine detail을 initial estimate에 더 반영하기 위해 추가적으로 post-network를 도입함
      1. Post-network는 5개의 $5\times 1$ convolutional layer로 구성되고, 첫 4개 layer에 대해 batch normalization과 hyperbolic tangent가 적용됨
        - 첫 4개 layer의 channel dimension은 512이고 final layer에서는 80을 사용
      2. Post-network의 output을 residual signal $R_{1\rightarrow 2}$이라고 하면, final conversion output은 해당 residual을 initial estimate에 adding 하여 얻어짐:
        (Eq. 10) $\hat{X}_{1\rightarrow 2}=\tilde{X}_{1\rightarrow 2}+R_{1\rightarrow 2}$
    • Training 과정에서 reconstruction loss는 initial, final reconstruction result 모두에 적용됨
      1. 구체적으로 (Eq. 5)의 loss 외에도 다음의 initial reconstruction loss를 추가함:
        (Eq. 11) $\mathcal{L}_{recon0}=\mathbb{E}[|| \tilde{X}_{1\rightarrow 1}-X_{1}||_{2}^{2}]$
        - $\tilde{X}_{1\rightarrow 1}$ : $U_{2}=U_{1}$일 때 $\tilde{X}_{1\rightarrow 2}$의 reciprocal
      2. 결과적으로 total loss는:
        (Eq. 12) $\min_{E_{c}(\cdot),D(\cdot, \cdot)}\mathcal{L}=\mathcal{L}_{recon}+\mu\mathcal{L}_{recon0} + \lambda\mathcal{L}_{content}$
        - (Eq. 12)[Thm. 1]의 기반이 되는 (Eq. 5)와는 다르지만, 경험적으로 AutoVC의 수렴성을 향상 가능

- The Spectrogram Inverter

  • 논문에서는 4개의 deconvolution layer로 구성된 WaveNet vocoder를 활용함
    • AutoVC에서 mel-spectrogram의 frame rate는 62.5Hz이고 sampling rate는 16kHz이므로, 해당 deconvolution layer는 sampling rate와 일치하도록 spectrogram을 upsampling 함
    • 이후 upsampled spectrogram에 대해 standard 40-layer WaveNet conditioning을 적용하여 waveform을 생성함

4. Experiments

- Settings

  • Dataset : VCTK
  • Comparisons : StarGAN-VC, Multi-target-VC

- Results

  • Traditional Many-to-Many Conversion
    • Many-to-Many conversion 측면에서 AutoVC가 가장 우수한 MOS를 달성함

Many-to-Many Conversion 결과

  • Zero-Shot Conversion
    • Zero-shot conversion 측면에서도 AutoVC가 가장 우수한 성능을 보임

Zero-Shot Conversion 결과

  • Bottleneck Dimension Analysis
    • AutoVC에서 bottleneck dimension은 content code와 source speaker information의 disentanglement에 영향을 미침
    • 이때 다음의 model을 AutoVC와 비교
      1. Narrow model은 $C_{1\rightarrow},C_{1\leftarrow}$의 dimension을 32에서 16으로 줄이고, downsampling을 32에서 128로 늘려 구성
      2. Wide model은 $C_{1\rightarrow},C_{1\leftarrow}$의 dimension을 256으로 늘리고, sampling coefficient를 8로 줄여 구성
    • 결과적으로 narrow model은 낮은 classification accuracy (good disentanglement)를 가지지만 reconstruction error가 높고, wide model은 reconstruction error가 낮지만 classification accuracy가 높음
      - AutoVC는 reconstruction error, accuracy 측면에서 최적의 결과를 달성함

Bottleneck Dimension의 효과

 

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