D IFFUSION -B ASED V OICE C ONVERSION WITH F AST M AXIMUM L IKELIHOOD S AMPLING S CHEME
Anonymous authors
Paper under double-blind review
A BSTRACT
Voice conversion is a common speech synthesis task which can be solved in different ways depending on a particular real-world scenario.
The most challenging one often referred to as one-shot many-to-many voice conversion consists in copying target voice from only one reference utterance in the most general case when both source and target speakers do not belong to the training dataset.
We present a scalable high-quality solution based on diffusion probabilistic modeling and demonstrate its superior quality compared to state-of-the-art one-shot voice conversion approaches.
Moreover, focusing on real-time applications, we investigate general principles which can make diffusion models faster while keeping synthesis quality at a high level.
As a result, we develop a novel Stochastic Differential
Equations solver suitable for various diffusion model types and generative tasks as shown through empirical studies and justify it by theoretical analysis.
I NTRODUCTION
Voice conversion (VC) is the task of copying the target speaker’s voice while preserving the linguistic content of the utterance pronounced by the source speaker.
Practical VC applications often require a model which is able to operate in one-shot mode (i.e. when only one reference utterance is provided to copy the target speaker’s voice) for any source and target speakers.
Such models are usually referred to as one-shot many-to-many models (or sometimes zero-shot many-to-many models, or just any-to-any VC models).
It is challenging to build such a model since it should be able to adapt to a new unseen voice having only one spoken utterance pronounced with it, so it was not until recently that successful one-shot VC solutions started to appear.
Conventional one-shot VC models are designed as autoencoders whose latent space ideally contains only the linguistic content of the encoded utterance while target voice identity information (usually taking shape of speaker embedding) is fed to the decoder as conditioning.
Whereas in the pioneering
AutoVC model (Qian et al., 2019) only speaker embedding from the pre-trained speaker veriﬁcation network was used as conditioning, several other models improved on AutoVC enriching conditioning with phonetic features such as pitch and loudness (Qian et al., 2020; Nercessian, 2020), or training voice conversion and speaker embedding networks jointly (Chou & Lee, 2019).
Also, several papers (Lin et al., 2021; Ishihara & Saito, 2020; Liu et al., 2021b) made use of attention mechanism to better fuse speciﬁc features of the reference utterance into the source utterance thus improving the decoder performance.
Apart from providing the decoder with sufﬁciently rich information, one of the main problems autoencoder VC models face is to disentangle source speaker identity from speech content in the encoder.
Some models (Qian et al., 2019; 2020; Nercessian, 2020) solve this problem by introducing an information bottleneck.
Among other popular solutions of the disentanglement problem one can mention applying vector quantization technique to the content information (Wu et al., 2020; Wang et al., 2021), utilizing features of Variational AutoEncoders (Luong & Tran, 2021;
Saito et al., 2018; Chou & Lee, 2019), introducing instance normalization layers (Chou & Lee, 2019;
Chen et al., 2021b), and using Phonetic Posteriorgrams (PPGs) (Nercessian, 2020; Liu et al., 2021b).
The model we propose in this paper solves the disentanglement problem by employing the encoder predicting “average voice”: it is trained to transform mel features corresponding to each phoneme into mel features corresponding to this phoneme averaged across a large multi-speaker dataset.
As for decoder, in our VC model, it is designed as a part of a Diffusion Probabilistic Model (DPM) since this class of generative models has shown very good results in speech-related tasks like raw waveform generation (Chen et al., 2021a; Kong et al., 2021) and mel feature generation (Popov et al., 2021; Jeong et al., 2021).
However, this decoder choice poses a problem of slow inference because DPM forward pass scheme is iterative and to obtain high-quality results it is typically necessary to run it for hundreds of iterations (Ho et al., 2020; Nichol & Dhariwal, 2021).
Addressing this issue, we develop a novel inference scheme that signiﬁcantly reduces the number of iterations sufﬁcient to produce samples of decent quality and does not require model re-training.
Although several attempts have been recently made to reduce the number of DPM inference steps (Song et al., 2021a; San-Roman et al., 2021; Watson et al., 2021; Kong & Ping, 2021; Chen et al., 2021a), most of them apply to some particular types of DPMs.
In contrast, our approach generalizes to all popular kinds of DPMs and has a strong connection with likelihood maximization.
This paper has the following structure: in Section 2 we present a one-shot many-to-many VC model and describe DPM it relies on; Section 3 introduces a novel DPM sampling scheme and establishes its connection with likelihood maximization; the experiments regarding voice conversion task as well as those demonstrating the beneﬁts of the proposed sampling scheme are described in Section 4; we conclude in Section 5.
V OICE CONVERSION DIFFUSION MODEL
As with many other VC models, the one we propose belongs to the family of autoencoders.
In fact, any conditional DPM with data-dependent prior (i.e. terminal distribution of forward diffusion) can be seen as such: forward diffusion gradually adding Gaussian noise to data can be regarded as encoder while reverse diffusion trying to remove this noise acts as a decoder.
DPMs are trained to minimize the distance (expressed in different terms for different model types) between the trajectories of forward and reverse diffusion processes thus, speaking from the perspective of autoencoders, minimizing reconstruction error.
Data-dependent priors have been proposed by Popov et al.
(2021) and Lee et al.
, and we follow the former paper due to the ﬂexibility of the continuous DPM framework used there.
Our approach is summarized in Figure 1.
2. E NCODER
We choose average phoneme-level mel features as speaker-independent speech representation.
To train the encoder to convert input mel-spectrograms into those of “average voice”, we take three steps:
• First, we apply Montreal Forced Aligner (McAuliffe et al., 2017) to a large-scale multispeaker LibriTTS dataset (Zen et al., 2019) to align speech frames with phonemes.
• Next, we obtain average mel features for each particular phoneme by aggregating its mel features across the whole LibriTTS dataset.
• The encoder is then trained to minimize mean square error between output mel-spectrograms and ground truth “average voice” mel-spectrograms (i
e. input mel-spectrograms where each phoneme mel feature is replaced with the average one calculated on the previous step).
The encoder has exactly the same Transformer-based architecture used in Grad-TTS (Popov et al., 2021) except that its inputs are mel features rather than character or phoneme embeddings.
Note that unlike Grad-TTS the encoder is trained separately from the decoder described in the next section.
2. D ECODER
Whereas the encoder parameterizes the terminal distribution of the forward diffusion (i.e. the prior), the reverse diffusion is parameterized with the decoder.
Following Song et al.
(2021c)
we use Itˆo calculus and deﬁne diffusions in terms of stochastic processes rather than discrete-time Markov chains.
The general DPM framework we utilize consists of forward and reverse diffusions given by the following Stochastic Differential Equations (SDEs):
[Equation]
where t ∈ [0 , 1] , −→ W and ←− W are two independent Wiener processes in R n , β t is non-negative function referred to as noise schedule , s θ is the score function with parameters θ and ¯ X is n -dimensional vector.
It can be shown (Popov et al., 2021) that the forward SDE (1) allows for explicit solution:
[Equation]
where I is n × n identity matrix.
Thus, if noise follows linear schedule β t = β 0 + t ( β 1 − β 0 ) for βand β 1 such that e − (cid:82) 10 β s ds is close to zero, then Law ( X 1 ) is close to N ( ¯ X, I) which is the prior in this DPM.
The reverse diffusion (2) is trained by minimizing weighted L 2 loss:
[Equation]
where p t |
( X t | X 0 ) is the probability density function (pdf) of the conditional distribution (3) and λ t = 1 − e − (cid:82) t 0 β s ds .
The distribution (3) is Gaussian, so we have
[Equation]
At training, time variable t is sampled uniformly from [0 , 1] , noisy samples X t are generated according to the formula (3) and the formula (5) is used to calculate loss function L on these samples.
Note that X t can be sampled without the necessity to calculate intermediate values { X s } 0 <s<t which makes optimization task (4) time and memory efﬁcient.
A well-trained reverse diffusion (2) has trajectories that are close to those of the forward diffusion (1), so generating data with this DPM can be performed by sampling ˆ X 1 from the prior N ( ¯ X, I) and solving SDE (2) backwards in time.
The described above DPM was introduced by Popov et al.
(2021) for text-to-speech task
and we adapt it for our purposes.
We put ¯ X = ϕ
( X 0 ) where ϕ is the encoder, i.e. ¯ X is the “average voice” mel-spectrogram which we want to transform into that of the target voice.
We condition the decoder s θ =
s θ ( ˆ X t , ¯ X, g t ( Y ) , t ) on some trainable function g t ( Y ) to provide it with information about the target speaker ( Y stands for forward trajectories of the target mel-spectrogram at inference and the ones of the training mel-spectrogram at training).
This function is a neural network trained jointly with the decoder.
We experimented with three input types for this network:
• d-only – the input is the speaker embedding extracted from the target mel-spectrogram Ywith the pre-trained speaker veriﬁcation network employed in (Jia et al., 2018); • wodyn – in addition, the noisy target mel-spectrogram Y t is used as input;
• whole – in addition, the whole dynamics of the target mel-spectrogram under forward diffusion { Y s | s = 0 . 5 / 15 , 1 . 5 / 15 , .., 14 . 5 / 15 } is used as input.
The decoder architecture is based on U-Net (Ronneberger et al., 2015) and is the same as in GradTTS but with four times more channels to better capture the whole range of human voices.
The speaker conditioning network g t ( Y ) is composed of 2 D convolutions and MLPs and described in detail in Appendix G. Its output is 128 -dimensional vector which is broadcast-concatenated to the concatenation of ˆ X t and ¯ X as additional 128 channels.
2. R ELATED VC MODELS
To the best of our knowledge, there exist two diffusion-based voice conversion models: VoiceGrad (Kameoka et al., 2020) and DiffSVC (Liu et al., 2021a).
The one we propose differs from them in several important aspects.
First, neither of the mentioned papers considers a one-shot many-tomany voice conversion scenario.
Next, these models take no less than 100 reverse diffusion steps at inference while we pay special attention to reducing the number of iterations (see Section 3) achieving good quality with as few as 6 iterations.
Furthermore, VoiceGrad performs voice conversion by running Langevin dynamics starting from the source mel-spectrogram, thus implicitly assuming that forward diffusion trajectories starting from the mel-spectrogram we want to synthesize are likely to pass through the neighborhood of the source mel-spectrogram on their way to Gaussian noise.
Such an assumption allowing to have only one network instead of encoder-decoder architecture is too strong and hardly holds for real voices.
Finally, DiffSVC performs singing voice conversion and relies on PPGs as speaker-independent speech representation.
M AXIMUM LIKELIHOOD SDE SOLVER
In this section, we develop a ﬁxed-step ﬁrst-order reverse SDE solver that maximizes the loglikelihood of sample paths of the forward diffusion.
This solver differs from general-purpose
Euler-Maruyama SDE solver (Kloeden & Platen, 1992) by inﬁnitesimally small values which can however become signiﬁcant when we sample from diffusion model using a few iterations.
Consider the following forward and reverse SDEs deﬁned in Euclidean space R n for t ∈ [0 , 1] :
[Equation]
where −→ W is a forward Wiener process (i.e. its forward increments −→ W t − −→ W s are independent of −→ W s for t > s ) and ←− W is a backward Wiener process (i.e. backward increments ←− W s − ←− W t are independent of ←− W t for s < t ).
Following Song et al.
(2021c)
we will call DPM (6) Variance Preserving (VP).
For simplicity we will derive maximum likelihood solver for this particular type of diffusion models.
The equation (1) underlying VC diffusion model described in Section 2 can be transformed into the equation (6-F) by a constant shift and we will call such diffusion models Mean Reverting Variance
Preserving (MR-VP).
VP model analysis carried out in this section can be easily extended (see
Appendices D, E and F) to MR-VP model as well as to other common diffusion model types such as sub-VP and VE described by Song et al
The forward SDE (6-F) allows for explicit solution:
[Equation]
for all 0 ≤ s < t ≤ 1 .
This formula is derived by means of Itˆo calculus in
Appendix A.
The reverse SDE (6-R) parameterized with a neural network s θ is trained to approximate gradient of the log-density of noisy data X t :
[Equation]
where the expectation is taken with respect to noisy data distribution Law( X t ) with pdf p t ( · ) and λ t is some positive weighting function.
Note that certain Lipschitz constraints should be satisﬁed by coefﬁcients of SDEs (6) to guarantee existence of strong solutions (Liptser & Shiryaev, 1978), and throughout this section we assume these conditions are satisﬁed as well as those from (Anderson, 1982) which guarantee that paths ˆ X generated by the reverse SDE (6-R) for the optimal θ ∗ equal forward SDE (6-F) paths X in distribution.
The generative procedure of a VP DPM consists in solving the reverse SDE (6-R) backwards in time starting from ˆ X 1 ∼ N (0 , I) .
Common Euler-Maruyama solver introduces discretization error (Kloeden & Platen, 1992) which may harm sample quality when the number of iterations is small.
At the same time, it is possible to design unbiased (Henry-Labord ` ere et al., 2017) or even exact (Beskos & Roberts, 2005) numerical solvers for some particular SDE types.
The Theorem 1 shows that in the case of diffusion models we can make use of the forward diffusion (6-F) and propose a reverse SDE solver which is better than the general-purpose Euler-Maruyama one in terms of likelihood.
The solver proposed in the Theorem 1 is expressed in terms of the values deﬁned as follows:
[Equation]
where n is data dimensionality, Var ( X 0 | X t ) is the covariance matrix of the conditional data distribution
Law( X 0 | X t ) (so, Tr(Var ( X 0 | X t )) is the overall variance across all n dimensions) and the expectation E X t [ · ] is taken with respect to the unconditional noisy data distribution Law( X t ) .
Theorem 1.
Consider a DPM characterized by SDEs (6) with reverse diffusion trained till optimality.
Let N ∈ N be any natural number and h = 1 /N .
Consider the following class of ﬁxed step size h reverse SDE solvers parameterized with triplets of real numbers { (ˆ κ t,h , ˆ ω t,h , ˆ σ t,h ) | t
= h, 2 h, .., 1 } :
[Equation]
where θ ∗ is given by (8), t = 1 , 1 − h, .., h and ξ t are i.i.d.
samples from N (0 , I) .
Then:
(i) Log-likelihood of sample paths X =
{ X kh } Nk =
under generative model
ˆ X is maximized for ˆ κ t,h = κ ∗ t,h , ˆ ω t,h = ω ∗ t,h and ˆ σ t,h
= σ ∗ t,h .
(ii) Assume that the SDE solver (11) starts from random variable ˆ X 1 ∼ Law ( X 1 ) .
If X 0 is a constant or a Gaussian random variable with diagonal isotropic covariance matrix (i
e. δ 2 I for δ > 0 ), then generative model
ˆ X is exact for ˆ κ t,h
= κ ∗ t,h , ˆ ω t,h = ω ∗ t,h and ˆ σ t,h
= σ ∗ t,h .
The Theorem 1 provides an improved DPM sampling scheme which comes at no additional computational cost compared to standard methods (except for data-dependent term in σ ∗ as discussed in
Section 4.3) and requires neither model re-training nor extensive search on noise schedule space.
The proof of this theorem is given in Appendix C. Note that it establishes optimality of the reverse SDE solver (11) with the parameters ( 10 ) in terms of likelihood of discrete paths
X = { X kh } N k
=0 while
[Table]
the optimality of continuous model (6-R) on continuous paths { X t } t ∈ [0 , 1] is guaranteed for a model with parameters θ
= θ ∗ as shown in (Song et al., 2021c).
The class of reverse SDE solvers considered in the Theorem 1 is rather broad: it is the class of all ﬁxed-step solvers whose increments at time t are linear combination of ˆ X t , s θ ( ˆ X t , t ) and Gaussian noise with zero mean and diagonal isotropic covariance matrix.
As a particular case it includes
Euler-Maruyama solver ( ˆ κ t,h ≡ 0 , ˆ ω t,h ≡ 0 , ˆ σ t,h ≡ √ β t h ) and for ﬁxed t and h →
we have κ ∗ t,h
= ¯ o (1) , ω ∗ t,h =
¯ o (1) and σ ∗ t,h = √ β t h (1 + ¯ o (1))
(the proof is given in Appendix B), so the optimal SDE solver signiﬁcantly differs from general-purpose Euler-Maruyama solver only when N is rather small or t has the same order as h , i.e. on the ﬁnal steps of DPM inference.
The result (ii) from the Theorem 1 strengthens the result (i) for some particular data distributions, but it may seem useless since in practice data distribution is far from being constant or Gaussian.
However, in case of generation with strong conditioning (e.g. mel-spectrogram inversion) the assumptions on the data distribution may become viable: in the limiting case when our model is conditioned on c = ψ ( X 0 ) for an injective function ψ , random variable X 0 | c becomes a constant ψ − 1 ( c ) .
E XPERIMENTS
We trained two groups of models: Diff-VCTK models on VCTK (Yamagishi et al., 2019) dataset containing 109 speakers ( 9 speakers were held out for testing purposes) and Diff-LibriTTS models on
LibriTTS (Zen et al., 2019) containing approximately 1100 speakers ( 10 speakers were held out).
For every model both encoder and decoder were trained on the same dataset.
Training hyperparameters, implementation and data processing details can be found in Appendix H. For mel-spectrogram inversion, we used the pre-trained universal HiFi-GAN vocoder (Kong et al., 2020) operating at 22 .
05 kHz.
All subjective human evaluation was carried out on Amazon Mechanical Turk (AMT) with Master assessors to ensure the reliability of the obtained Mean Opinion Scores (MOS).
In all
AMT tests we considered unseen-to-unseen conversion with 25 unseen (for both Diff-VCTK and
Diff-LibriTTS ) speakers: 9 VCTK speakers, 10 LibriTTS speakers and 6 internal speakers.
For
VCTK source speakers we also ensured that source phrases were unseen during training.
We place other details of listening AMT tests in Appendix I. A small subset of speech samples used in them is available at our demo page https://diffvc-fast-ml-solver.github.io which we encourage to visit.
We also plan to release the code as well as the pre-trained models shortly.
As for sampling, we considered the following class of reverse SDE solvers:
[Equation]
where t = 1 , 1 − h, .., h and ξ t are i.i.d.
samples from N (0 , I) .
For ˆ κ t,h = κ ∗ t,h , ˆ ω t,h = ω ∗ t,h and ˆ σ t,h = σ ∗ t,h (where κ ∗ t,h , ω ∗ t,h and σ ∗ t,h are given by (10))
it becomes maximum likelihood reverse SDE solver for MR-VP DPM (1-2) as shown in Appendix D.
In practice it is not trivial to estimate variance of the conditional distribution
Law ( X 0 | X t ) , so we skipped this term in σ ∗ t,h assuming this variance to be rather small because of strong conditioning on g t ( Y ) and just used ˆ σ t,h
= σ t − h,t calling this sampling method ML-N ( N = 1 /h is the number of SDE solver steps).
We also experimented with Euler-Maruyama solver EM-N (i.e. ˆ κ t,h = 0 , ˆ ω t,h = 0 , ˆ σ t,h = √ β t h ) and “probability ﬂow sampling” from (Song et al., 2021c) which we denote by PF-N ( ˆ κ t,h = − 0 .
5 , ˆ ω t,h = 0 , ˆ σ t,h = 0 ).
[Table]
[Table]
4. S PEAKER CONDITIONING ANALYSIS
For each dataset we trained three models – one for each input type for the speaker conditioning network g t ( Y ) (see Section 2.2).
Although these input types had much inﬂuence neither on speaker similarity nor on speech naturalness, we did two experiments to choose the best models (one for each training dataset) in terms of speaker similarity for further comparison with baseline systems.
We compared voice conversion results (produced by ML-30 sampling scheme) on 92 source-target pairs.
AMT workers were asked which of three models (if any) sounded most similar to the target speaker and which of them (if any) sounded least similar.
For Diff-VCTK and Diff-LibriTTS models each conversion pair was evaluated 4 and 5 times respectively.
Table 1 demonstrates that for both
Diff-VCTK and Diff-LibriTTS the best option is wodyn , i.e. to condition the decoder at time t on the speaker embedding together with the noisy target mel-spectrogram Y t .
Conditioning on Y t allows making use of diffusion-speciﬁc information of how the noisy target sounds whereas embedding from the pre-trained speaker veriﬁcation network contains information only about the clean target.
Taking these results into consideration, we used Diff-VCTK-wodyn and Diff-LibriTTS-wodyn in the remaining experiments.
4. A NY - TO - ANY VOICE CONVERSION
We chose four recently proposed VC models capable of one-shot many-to-many synthesis as the baselines:
• AGAIN-VC
(Chen et al., 2021b), an improved version of a conventional autoencoder AdaINVC solving the disentanglement problem by means of instance normalization; • FragmentVC
(Lin et al., 2021), an attention-based model relying on wav2vec 2.0 (Baevski et al., 2020) to obtain speech content from the source utterance; • VQMIVC (Wang et al., 2021), state-of-the-art approach among those employing vector quantization techniques; • BNE-PPG-VC
(Liu et al., 2021b), an improved variant of PPG-based VC models combining a bottleneck feature extractor obtained from a phoneme recognizer with a seq2seq-based synthesis module.
As shown in (Kim et al., 2021), PPG-based VC models provide high voice conversion quality competitive even with that of the state-of-the-art VC models taking text transcription corresponding
[Table]
to the source utterance as input.
Therefore
[Table]
we can consider BNE-PPG-VC a state-of-the-art model in our setting.
Baseline voice conversion results were produced by the pre-trained VC models provided in ofﬁcial
GitHub repositories.
Since only BNE-PPG-VC has the model pre-trained on a large-scale dataset (namely, LibriTTS + VCTK)
[Table]
we did two subjective human evaluation tests: the ﬁrst one comparing
Diff-VCTK with AGAIN-VC , FragmentVC and VQMIVC trained on VCTK and the second one comparing Diff-LibriTTS with BNE-PPG-VC .
The results of these tests are given in Tables 2 and 3 respectively.
Speech naturalness and speaker similarity were assessed separately.
AMT workers evaluated voice conversion quality on 350 source-target pairs on 5 -point scale.
In the ﬁrst test, each pair was assessed 6 times on average both in speech naturalness and speaker similarity evaluation; as for the second one, each pair was assessed 8 and 9 times on average in speech naturalness and speaker similarity evaluation correspondingly.
No less than 41 unique assessors took part in each test.
Table 2 demonstrates that our model performs signiﬁcantly better than the baselines both in terms of naturalness and speaker similarity even when 6 reverse diffusion iterations are used.
Despite working almost equally well on VCTK speakers, the best baseline VQMIVC shows poor performance on other speakers perhaps because of not being able to generalize to different domains with lower recording quality.
Although Diff-VCTK performance also degrades on non-VCTK speakers, it achieves good speaker similarity of MOS 3 . 6 on VCTK ones when ML-30 sampling scheme is used and only slightly worse MOS 3 .
5 when 5 x less iterations are used at inference.
Table 3 contains human evaluation results of Diff-LibriTTS for four sampling schemes: ML-30 with 30 reverse SDE solver steps and ML-6 , EM-6 and PF-6 with 6 steps of reverse diffusion.
The three schemes taking 6 steps achieved real-time factor (RTF) around 0 .
1 on GPU (i.e. inference wastimes faster than real time) while the one taking 30 steps had RTF around 0 .
The proposed model
Diff-LibriTTS-ML-30 and the baseline BNE-PPG-VC show the same performance on the VCTK test set in terms of speech naturalness the latter being slightly better in terms of speaker similarity which can perhaps be explained by the fact that BNE-PPG-VC was trained on the union of VCTK and
LibriTTS whereas our model was trained only on LibriTTS.
As for the whole test set containing unseen LibriTTS and internal speakers also, Diff-LibriTTS-ML-30 outperforms BNE-PPG-VC model achieving MOS 4 . 0 and 3 .
4 in terms of speech naturalness and speaker similarity
respectively.
Due to employing PPG extractor trained on a large-scale ASR dataset LibriSpeech (Panayotov et al., 2015),
BNE-PPG-VC has fewer mispronunciation issues than our model but synthesized speech suffers from more sonic artifacts.
This observation makes us believe that incorporating PPG features in the proposed diffusion VC framework is a promising direction for future research.
Table 3 also demonstrates the beneﬁts of the proposed maximum likelihood sampling scheme over other sampling methods for a small number of inference steps: only ML-N scheme allows us to use as few as N = 6 iterations with acceptable quality degradation of MOS 0 .
2 and 0 .
1 in terms of naturalness and speaker similarity respectively while two other competing methods lead to much more signiﬁcant quality degradation.
4. M AXIMUM LIKELIHOOD SAMPLING
To show that the maximum likelihood sampling scheme proposed in Section 3 generalizes to different tasks and DPM types, we took the models trained by Song et al.
(2021c) on CIFAR- 10 image generation task and compared our method with other sampling schemes described in that paper in terms of Fr´echet Inception Distance (FID).
The main difﬁculty in applying maximum likelihood SDE solver is estimating data-dependent term E
[Tr (Var ( X 0 | X t ))] in σ ∗ t,h .
Although in the current experiments we just set this term to zero, we can think of two possible ways to estimate it:
• approximate Var ( X 0 | X t ) with Var ( ˆ X 0 | ˆ X t = X t ) : sample noisy data X t , solve reverse SDE with sufﬁciently small step size starting from terminal condition ˆ X t =
X t several times, and calculate sample variance of the resulting solutions at initial points ˆ X 0 ; • use the formula (58) from Appendix C to calculate Var ( X 0 | X t ) assuming that X 0 is distributed normally with mean and variance equal to sample mean and sample variance computed on the training dataset.
Experimenting with these techniques and exploring new ones seems to be an interesting future research direction.
Another important practical consideration is that the proposed scheme is proven to be optimal only for score matching networks trained till optimality.
Therefore, in the experiments whose results are reported in Table 4 we apply maximum likelihood sampling scheme only when t ≤ τ while using standard Euler-Maruyama solver for t > τ for some hyperparameter τ ∈ [0 , 1] .
Such a modiﬁcation relies on the assumption that score matching network is closer to being optimal for smaller noise.
Table 4 shows that despite likelihood and FID are two metrics that do not perfectly correlate (Song et al., 2021b), in most cases our maximum likelihood SDE solver performs best in terms of FID.
Also, it is worth mentioning that although τ = 1 is always rather a good choice, tuning this hyperparameter can lead to even better performance.
One can ﬁnd randomly chosen generated images for various sampling methods in Figure 2.
C ONCLUSION
In this paper, the novel one-shot many-to-many voice conversion model has been presented.
Its encoder design and powerful diffusion-based decoder made it possible to achieve good results both in terms of speaker similarity and speech naturalness even on out-of-domain unseen speakers.
Subjective human evaluation veriﬁed that the proposed model delivers scalable VC solution with competitive performance.
Furthermore, aiming at fast synthesis, we have developed and theoretically justiﬁed the novel sampling scheme.
The main idea behind it is to modify the general-purpose Euler-Maruyama
SDE solver so as to maximize the likelihood of discrete sample paths of the forward diffusion.
Due to the proposed sampling scheme, our VC model is capable of high-quality voice conversion with as few as 6 reverse diffusion steps.
Moreover, experiments on the image generation task show that all known diffusion model types can beneﬁt from the proposed SDE solver.
A F ORWARD VP SDE SOLUTION
Since function γ − 1 0 ,t X t is linear in X t , taking its differential does not require second order derivative term in Itˆo’s formula:
[Equation]
Integrating this expression from s to t results in an Itˆo’s integral:
[Equation]
or
[Equation]
The integrand on the right-hand side is deterministic and belongs to L 2 [0 , 1] (for practical noise schedule choices), so its It ˆ o’s integral is a normal random variable, a martingale (meaning it has zero mean) and satisﬁes It
ˆ o’s isometry which allows to calculate its variance:
[Equation]
Thus
[Equation]
B T HE OPTIMAL COEFFICIENTS ASYMPTOTICS
First derive asymptotics for γ :
[Equation]
Then ﬁnd asymptotics for µ , ν and σ 2 : µ t − h,t =
[Equation]
[Equation]
Finally we get asymptotics for κ ∗ , ω ∗ and σ ∗ :
[Equation]
C P ROOF OF THE T HEOREM
The key fact necessary to prove the Theorem 1 is established in the following
Lemma 1.
Let p 0 | t ( ·| x ) be pdf of conditional distribution Law ( X 0 | X t
= x ) .
Then for any t ∈ [0 , 1] and x ∈ R n s
[Equation]
Proof of the Lemma 1.
As mentioned in (Song et al., 2021c), an expression alternative to (8) can be derived for θ ∗ under mild assumptions on the data density (Hyv ¨ arinen, 2005; Vincent, 2011):
[Equation]
where Law ( X 0 ) is data distribution with pdf p 0 ( · ) and Law ( X t | X 0 = x 0 ) has pdf p t | 0 ( ·| x 0 ) .
By
Bayes formula we can rewrite this in terms of pdfs p t ( · ) and p 0 | t ( ·| x t ) of distributions Law ( X t ) and
Law ( X 0 | X t = x t ) correspondingly:
[Equation]
For any n -dimensional random variable ξ with ﬁnite second moment and deterministic vector a we have
[Equation]
In our case ξ = ∇ log p t | 0 ( X t | X 0 ) and a =
s θ ( X t , t ) , so E (cid:107) ξ − E ξ (cid:107) 2 2 is independent of θ .
Thus
[Equation]
Therefore, the optimal score estimation network s θ ∗ can be expressed as
[Equation]
for all t ∈ [0 , 1] and x ∈ supp { p t } = R n .
As proven in Appendix A, Law ( X t | X 0 ) is Gaussian with mean vector γ 0 ,t X 0 and covariance matrix (1 − γ 20 ,t ) I , so ﬁnally we obtain
[Equation]
[Equation]
Now let us prove the Theorem 1.
Proof of the Theorem 1.
The sampling scheme (11) consists in adding Gaussian noise to a linear combination of ˆ X t and s θ ∗ ( ˆ X t , t ) .
Combining (11) and the Lemma 1 we get
[Equation]
where ξ t are i
[Equation]
i
[Equation]
d. random variables from standard normal distribution N (0 , I) for t = 1 , 1 − h, .., h .
Thus, the distribution ˆ X t − h | ˆ X t is also Gaussian:
[Equation]
which leads to the following formula for the transition densities of the reverse diffusion:
[Equation]
Moreover, comparing ˆ µ t,h and ˆ ν t,h with µ t − h,t and ν t − h,t deﬁned in (9) we deduce that
[Equation]
If we also want ˆ µ t,h = µ t − h,t to be satisﬁed, then we should have
[Equation]
i.e. ˆ ν t,h =
ν t − h,t and ˆ µ t,h = µ t − h,t iff ˆ κ t,h = κ ∗ t,h and ˆ ω t,h = ω ∗ t,h for the parameters κ ∗ t,h and ω ∗ t,h deﬁned in (10).
As for the corresponding densities of the forward process X , they are Gaussian when conditioned on the initial data point X 0 :
[Equation]
where coefﬁcients µ t − h,t , ν t − h,t and σ t − h,t are deﬁned in (9).
This formula for Law ( X t − h | X t , X 0 ) follows from the general fact about Gaussian distributions appearing in many recent works on diffusion probabilistic modeling (Kingma et al., 2021): if Z t | Z s ∼ N ( α t | s Z s , σ 2 t | s I) and Z t | Z 0 ∼
N ( α t | 0 Z 0 , σ 2 t | 0 I) for 0 < s < t , then
[Equation]
This fact is a result of applying Bayes formula to normal distributions.
In our case α t | s = γ s,t and σ 2 t | s = 1 − γ 2 s,t .
To get an expression for the densities p t − h | t ( x t − h | x t ) similar to (39), we need to integrate out the dependency on data X 0 from Gaussian distribution Law ( X t − h | X t , X 0 ) :
[Equation]
which implies the following formula:
[Equation]
Note that in contrast with the transition densities (39) of the reverse process ˆ X , the corresponding densities (45) of the forward process X are not normal in general.
Our goal is to ﬁnd parameters ˆ κ , ˆ ω and ˆ σ that maximize log-likelihood of sample paths
X under probability measure with transition densities ˆ p .
Put t k = kh for k = 0 , 1 , .., N and write down this log-likelihood:
[Equation]
The last term does not depend on ˆ κ , ˆ ω and ˆ σ , so we can ignore it.
Let R k be the k -th term in the sum above.
Since we are free to have different coefﬁcients ˆ κ t,h , ˆ ω t,h and ˆ σ t,h for different steps, we can maximize each R k separately.
Terms R k can be expressed as
[Equation]
From now on we will skip subscripts of µ , ν , σ , ˆ µ , ˆ ν , ˆ σ , ˆ κ , ˆ ω , κ ∗ and ω ∗ for brevity.
Denote
Q
[Equation]
Using the formula (44) for the densities of X together with the explicit expression for the Gaussian density p t k | t k +1 ,
[Equation]
( x t k | X t k +1 , X 0 ) and applying Fubini’s theorem to change the order of integration
[Equation]
we rewrite R k as
[Equation]
The formula (48) implies that the integral of Q ( x t k , X t k
+1 , X 0 ) with respect to x t k can be seen as expectation of log ˆ p t k | t k +1 ( ξ |
X t k +1 ) with respect to normal random variable ξ with mean µX t k +1 + νX 0 and covariance matrix σ 2 I .
Plugging in the expression (39) into (48)
[Equation]
we can calculate this integral:
[Equation]
Thus
[Equation]
terms R k we want to maximize equal
[Equation]
Maximizing R k with respect to ( ˆ κ, ˆ ω, ˆ σ ) is equivalent to minimizing E X tk +1 S k where S k is given by
[Equation]
where the expectation with respect to ξ ∼ N ( µX t k +1 + νX 0 , σ 2 I) can be calculated using the fact that for every vector ˆ a we can express E ξ (cid:107) ξ − ˆ a (cid:107) 2 2 as
[Equation]
So
[Equation]
the outer expectation with respect to Law( X 0 | X t k +1 ) in (52) can be simpliﬁed:
[Equation]
where all the expectations in the formula above are taken with respect to the conditional data distribution Law( X 0 |
X t k +1 ) .
So, the resulting expression for the terms S k whose expectation with respect to Law ( X t k +1 )
we want to minimize is
[Equation] [Equation]
Now it is clear that κ ∗ t k +1 ,h and ω ∗ t
k +1 ,h are optimal because ˆ µ t k
+1 ,h ( κ ∗ t
k +1 ,h , ω ∗ t
k +1 ,h )
= µ t k ,t k + and ˆ ν t k
+1 ,h ( κ ∗ t
k +1 ,h ) =
ν t k ,t k +1 .
For this choice of parameters we have
[Equation] [Equation]
[Equation]
Note that E (cid:2) (cid:107) X 0 (cid:107) 22 | X t k +1 (cid:3) − (cid:107) E
[ X 0 | X t k +1 ]
(cid:107) 22 =
Tr (Var ( X 0 | X t k +1 )) is the overall variance of
Law ( X 0 |
X t k +1 ) along all n dimensions.
Differentiating E X tk +1 S k with respect to ˆ σ shows that the optimal σ ∗ t k +1 ,h should satisfy
[Equation]
which is indeed satisﬁed by the parameters σ ∗ t,h deﬁned in (10).
Thus, the statement (i) is proven.
When it comes to proving that ˆ X is exact, we have to show that Law ( ˆ X t k )
=
Law ( X t k ) for every k = 0 , 1 , .., N .
By the assumption that Law ( ˆ X 1 ) =
Law ( X 1 ) it is sufﬁcient to prove that ˆ p t k
| t k +1 ( x t k | x t k +1 )
≡ p t k | t k +1 ( x t k | x t k +1 ) since the exactness will follow from this fact by mathematical induction.
If X 0 is a constant random variable, Law( X 0 | X t )
=
Law ( X 0 ) also corresponds to the same constant, so
Var ( X 0 | X t ) =
meaning that σ ∗ t,h = σ t − h,t , and the formulae (39) and (45) imply the desired result.
Let us now consider the second case when X 0 ∼ N (¯ µ, δ 2 I) .
It is a matter of simple but lengthy computations to prove another property of Gaussian distributions similar to (43): if
Z 0 ∼ N (¯ µ, δ 2 I) and Z t | Z 0 ∼ N ( a t Z 0 , b 2 t I) , then Z 0 | Z t ∼ N ( b 2 t b 2 t + δ 2 a 2 t ¯ µ + δ 2 a t b 2 t
+ δ 2 a 2 t Z t , δ 2 b 2 t b 2 t + δ 2 a 2 t I) and Z t ∼ N (¯ µa t , ( b 2 t + δ 2 a 2 t ) I) .
In our case a t = γ 0 ,t and b 2 t = 1 − γ 20 ,t , therefore
Law ( X 0 | X t ) = N (cid:32)
[Equation]
So, Var ( X 0 | X t ) does not depend on X t and
[Equation]
Since Law ( X t | X t − h ) , Law ( X t − h ) and Law ( X t ) are Gaussian, Bayes formula implies that
Law ( X t − h | X t ) is Gaussian as well with the following mean and covariance matrix:
[Equation]
The distribution Law ( ˆ X t − h | ˆ X t ) is also Gaussian by the formula (39), so to conclude the proof we just need to show that E [ ˆ X t − h | ˆ X t
= x ] = E [ X t − h | X t = x ] and Var ( ˆ X t − h | ˆ X t = x ) =
Var ( X t − h | X t = x ) for every x ∈ R n for the optimal parameters (10).
Recall that for κ ∗ t,h and ω ∗ t,h we have ˆ µ t,h ( κ ∗ t,h , ω ∗ t,h ) =
µ t − h,t and ˆ ν t,h ( κ ∗ t,h ) =
ν t − h,t .
Utilizing the formulae (9), (39), (58) and the fact that γ 0 ,t − h · γ t − h,t = γ 0 ,t (following from the deﬁnition of γ in (7))
we conclude that
[Equation]
20 ,t ¯ µ + γ t − h,t 1 − γ 20 ,t − h + δ 2 γ 20 ,t − h 1 − γ 20 ,t + δ 2 γ 20 ,t x = E
[ X t − h | X t = x ] , (62)
Var ( ˆ X t − h | ˆ X t = x ) =
( σ ∗ t,h )
I = (cid:32) σ 2 t − h,t + ν 2 t − h,t
δ 2 (1 − γ 20 ,t ) 1 − γ 20 ,t + δ 2 γ 20 ,t (cid:33)
I = (cid:32) (1 − γ 20 ,t − h )(1 − γ 2 t − h,t ) 1 − γ 20 ,t + γ 20 ,t − h δ 2 (1 − γ 2 t − h,t )(1 − γ 20 ,t )(1 − γ 20 ,t + δ 2 γ 20 ,t ) (cid:33)
I = 1 − γ 2 t − h,t (1 − γ 20 ,t )(1 − γ 20 ,t + δ 2 γ 20 ,t ) (cid:0) (1 − γ 20 ,t − h )(1 − γ 20 ,t ) + δ 2 γ 20 ,t (1 − γ 20 ,t − h ) (cid:1) I + 1 − γ 2 t − h,t (1 − γ 20 ,t )(1 − γ 20 ,t + δ 2 γ 20 ,t ) (cid:0) δ 2 γ 20 ,t − h (1 − γ 2 t − h,t ) (cid:1) I = 1 − γ 2 t − h,t (1 − γ 20 ,t )(1 − γ 20 ,t + δ 2 γ 20 ,t ) (cid:0) (1 − γ 20 ,t − h )(1 − γ 20 ,t ) + δ 2 γ 20 ,t − h (1 − γ 20 ,t ) (cid:1) I =
(1 − γ 2 t − h,t )(1 − γ 20 ,t − h + δ 2 γ 20 ,t − h ) 1 − γ 20 ,t + δ 2 γ 20 ,t
I =
Var ( X t − h | X t = x ) .
D R EVERSE MR-VP SDE SOLVER
MR-VP DPM is characterized by the following forward and reverse diffusions:
[Equation]
Using the same method as in Appendix A
[Equation]
we can show that for s < t
[Equation]
With the following notation:
[Equation]
we can write down the parameters of Gaussian distribution X s | X t , X 0 :
[Equation]
The Lemma 1 for MR-VP DPMs takes the following shape:
[Equation]
The class of reverse SDE solvers we consider is
[Equation]
where t = 1 , 1 − h, .., h and ξ t are i.i.d.
samples from N (0 , I) .
Repeating the argument of the
Theorem 1 leads to the following optimal (in terms of likelihood of the forward diffusion sample paths) parameters:
[Equation] [Equation]
which are actually the same as the optimal parameters (10) for VP DPM.
It is of no surprise since
MR-VP DPM and VP-DPM differ only by a constant shift.
E R EVERSE SUB -VP SDE SOLVER
Sub-VP DPM is characterized by the following forward and reverse diffusions:
[Equation] [Equation]
Using the same method as in Appendix A
[Equation]
we can show that for s < t
[Equation]
Note that for s = 0 this expression simpliﬁes to
[Equation]
With the following notation:
[Equation]
we can write down the parameters of Gaussian distribution X s | X t , X 0 :
[Equation]
The Lemma 1 for sub-VP DPMs takes the following shape:
[Equation]
The class of reverse SDE solvers we consider is
[Equation]
where t = 1 , 1 − h, .., h and ξ t are i.i.d.
samples from N (0 , I) .
Repeating the argument of the
Theorem 1 leads to the following optimal (in terms of likelihood of the forward diffusion sample paths) parameters:
[Equation]
F R EVERSE VE SDE SOLVER
VE DPM is characterized by the following forward and reverse diffusions:
[Equation] [Equation]
Since for s < t
[Equation]
similar argument as in Appendix A allows showing that
[Equation]
With the following notation:
[Equation]
we can write down the parameters of Gaussian distribution X s | X t , X 0 :
[Equation]
The Lemma 1 for VE DPMs takes the following shape:
[Equation]
Repeating the argument of the Theorem 1 leads to the following optimal (in terms of likelihood of the forward diffusion sample paths) reverse SDE solver:
[Equation]
where
[Equation]
, (89) t = 1 , 1 − h, .., h and ξ t are i.i.d.
samples from N (0 , I) .
G S PEAKER CONDITIONING NETWORK
The function x · tanh ( softplus ( x )) is used as a non-linearity in the speaker conditioning network g t ( Y ) .
First, time embedding t e is obtained by the following procedure: time t ∈ [0 , 1] is encoded with positional encoding (Song et al., 2021c), then resulting 256 -dimensional vector t (cid:48) is passed through the ﬁrst linear module with 1024 units, then a non-linearity is applied to it
and then it is passed through the second linear module with 256 units.
Next, noisy mel-spectrogram
Y t for wodyn input type or Y t concatenated with { Y s | s = 0 .
5 / 15 , 1 . 5 / 15 , .., 14 . 5 / 15 } for whole is passed through 6 blocks consisting of 2 D convolutional layers each followed by instance normalization and Gated Linear Unit.
The number of input and output channels of these convolutions is (1 , 64) , (32 , 64) , (32 , 128) , (64 , 128) , (64 , 256) , (128 , 256) for wodyn input type and the same but with 16 input channels in the ﬁrst convolution for whole input type.
After the 2 nd and 4 th blocks
MLP 1 ( t e ) and MLP 2 ( t e ) are broadcast-added where MLP 1 ( MLP 2 ) are composed of a nonlinearity followed by a linear module with 32 ( 64 ) units.
After the last 6 th block the result is passed through the ﬁnal convolution with 128 output channels and average pooling along both time and frequency axes is applied resulting in 128 -dimensional vector.
All convolutions except for the ﬁnal one have (kernel, stride, zero padding) =
(3 , 1 , 1) while for the ﬁnal one the corresponding parameters are (1 , 0 , 0) .
Denote the result of such processing of Y by c for wodyn and whole input types.
Clean target mel-spectrogram Y 0 is used to obtain 256 -dimensional speaker embedding d with the pre-trained speaker veriﬁcation network (Jia et al., 2018) which is not trained.
Vectors d , c and t (cid:48) are concatenated (except for d-only input type where we concatenate only d and t (cid:48) ), passed through a linear module with 512 units followed by a non-linearity and a linear module with 128 units.
The resulting 128 -dimensional vector is the output of the speaker conditioning network g t ( Y ) .
H T RAINING HYPERPARAMETERS AND OTHER DETAILS
Encoders and decoders were trained with batch sizes 128 and 32 and Adam optimizer with initial learning rates 0 . 0005 and 0 .
0001 correspondingly.
Encoders and decoders in VCTK models were trained for 500 and 200 epochs respectively; as for LibriTTS models, they were trained for 300 and 110 epochs.
The datasets were downsampled to 22 .
05 kHz which was the operating rate of our VC models.
VCTK recordings were preprocessed by removing silence in the beginning and in the end of utterances.
To ﬁt GPU memory, decoders were trained on random speech segments of approximately 1 . 5 seconds rather than on the whole utterances.
Training segments for reconstruction and the ones used as input to the speaker conditioning network g t ( Y ) were different random segments extracted from the same training utterances.
Noise schedule parameters β 0 and β 1 were set to 0 .
05 and 20 . 0 .
Our VC models operated on mel-spectrograms with 80 mel features and sampling rate 22 .
05 kHz.
Short-Time Fourier Transform was used to calculate spectra with 1024 frequency bins.
Hann window of length 1024 was applied with hop size 256 .
For Diff-LibriTTS models we used simple spectral subtraction algorithm in mel domain with spectral ﬂoor parameter β = 0 .
02 as post-processing to reduce background noise sometimes produced by these models.
Noise spectrum was estimated on speech fragments automatically detected as the ones corresponding to silence in source mel-spectrogram.
I D ETAILS OF AMT TESTS
For fair comparison with the baselines all the recordings were downsampled to 16 kHz; we also normalized their loudness.
In speech naturalness tests workers chosen by geographic criterion were asked to assess the overall quality of the synthesized speech, i.e to estimate how clean and natural (human-sounding) it was.
Five-point Likert scale was used: 1 - “Bad”, 2 - “Poor”, 3 - “Fair”, 4 - “Good”, 5 - “Excellent”.
Assessors were asked to wear headphones and work in a quiet environment.
As for speaker similarity tests, workers were asked to assess how similar synthesized samples sounded to target speech samples in terms of speaker similarity.
Assessors were asked not to pay attention to the overall quality of the synthesized speech (e.g. background noise or incorrect pronunciation).
Five-point scale was used: 1 - “Different: absolutely sure”, 2 - “Different: moderately sure”, 3 - “Cannot decide more same or more different”, 4 - “Same: moderately sure”, 5 - “Same: absolutely sure”.