scieee AI-readable full text Open interactive document viewer

Multi-speaker Neural Vocoder

Barbany Mayor, Oriol

Abstract

Deep learning has revolutionized almost every engineering branch over the past decades and have also been successfully applied to text-to-speech, where it yields state-of-the-art performance and overcomes classical approaches. This work focuses in the implementation of a speech synthesis system based in Recurrent Neural Networks (RNNs) that holds many speakers with a unique model. Despite the fact that other systems only share some layers across speakers but maintain independent blocks for every identity, this dissertation explore the possibilities of implementing an adaptation of the end-toend model SampleRNN conditioned to both speech parameters and speaker identity that allow an entire shared framework.

Full text

Universitat Polit` ecnica de Catalunya Bachelor’s Thesis Multi-speaker Neural Vocoder A dissertation submitted to the Escola T`ecnica Superior d’Enginyeria de Telecomunicaci´o de Barcelona Universitat Polit`ecnica de Catalunya by Oriol Barbany Mayor In partial fulfillment of the requirements for the degree in Telecommunications Technologies and Services Engineering Advisor: Dr. Antonio Bonafonte Barcelona, June 2018 ii Abstract Deep learning has revolutionized almost every engineering branch over the past decades and have also been successfully applied to text-to-speech, where it yields state-of-the-art performance and overcomes classical approaches. This work focuses in the implementation of a speech synthesis system based in Recurrent Neural Networks (RNNs) that holds many speakers with a unique model. Despite the fact that other systems only share some layers across speakers but maintain independent blocks for every identity, this dissertation explore the possibilities of implementing an adaptation of the end-to- end model SampleRNN conditioned to both speech parameters and speaker identity that allow an entire shared framework. Speech parameters, which in this thesis are extracted with Ahocoder, are proofed to be intrinsically dependent of the speaker. This allows to use the simplest presented adaptation of the SampleRNN as a low-rate vocoder that significantly reduces the bit-rate given that only acoustic parameters have to be sent instead of the whole waveform in order to decode an utterance. This behavior proof the efficiency of the proposed shared structure, but hinders other tasks such as voice conversion due to the futility of speaker identity in the model. Some experiments regarding the model parameters have been conducted to optimize the results and a novel approach of non-causality named as look ahead is proposed. With the aim of tackling the voice conversion problem given the speaker dependencies, a bottle neck approach inspired by the VQ-VAE model and an adversarial framework are proposed to obtain latent speaker-independent representations from speech parameters. This also allows a new kind of speaker interpolation named as eigen-voice representation that aims to mimic a new and unknown speaker given a short utterance. Promising results arise from this proposal as it could be used to tackle one of the only inconveniences of deep learning, which is the huge amount of data that the models demand to learn the structure of an input signal, and could also be used for other tasks like hardening the security of speech-based biometric systems. iii Resum Durant les ´ultimes d`ecades, l’aprenentatge profund o deep learning ha revolucionat pr`acticament totes les branques de l’enginyeria i ha estat aplicat amb `exit en la s´ıntesi de veu, on obt´e els millors resultats sobrepassant amb difer`encia els anteriors assolits amb sistemes cl`assics. Aquest treball se centra en la implementaci´o d’un sistema de s´ıntesi de veu basat en xarxes neuronals recurrents amb un ´unic model per varis locutors. Encara que altres sistemes ´unicament comparteixen algunes capes entre parlants per`o mantenen blocs independents per a cada locutor, aquesta tesis explora les possibilitats d’implementar una adaptaci´o del model SampleRNN condicionant tant a par`ametres propis de la parla com a la identitat del parlant que permet una estructura compartida. Es demostra que els par`ametres de la parla, extrets mitjan¸cant l’Ahocoder en aquesta tesis, s´on intr´ınsecament dependents del locutor. Aquest fet permet usar l’adaptaci´o m´es simple presentada del SampleRNN com un vocoder de baixa velocitat que redueix significativament la taxa de bits transmesa ja que nom´es es necessita enviar els par`ametres propis de la parla per descodificar un senyal de veu. Aquest comportament demostra l’efici`encia de l’estructura compartida proposada, per`o dificulta altres tasques com la conversi´o de veu per la futilitat de la identitat del locutor en el model. S’han portat a terme varis experiments pel que fa a par`ametres del model per tal d’optimitzar els resultats i es proposa un nou enfocament de no causalitat anomenat look ahead. Amb l’objectiu d’abordar el problema de la conversi´o de veu donat les depend`encies amb el locutor, es proposa una estrat`egia de coll d’ampolla inspirada pel VQ-VAE i una arquitectura adversativa per tal d’obtenir representacions latents dels par`ametres de la parla sense informaci´o del parlant. Aix`o tamb´e permet un nou tipus d’interpolaci´o de locutors anomenada representaci´o eigen-voice que pret´en imitar la veu d’un locutor nou i desconegut amb un petit fragment de senyal de veu. Aquesta proposta aporta resultats prometedors ja que es podria fer servir per afrontar un dels ´unics desavantatges de l’aprenentatge profund, que ´es l’enorme quantitat de dades que es necessiten perqu`e un model aprengui l’estructura del senyal d’entrada, i tamb´e per altres tasques com la millora de la seguretat en sistemes biom`etrics basats en la veu. iv Resumen Durante las ´ultimas d´ecadas, el aprendizaje profundo o deep learning ha revolucionado pr´acticamente todas las ramas de la ingenier´ıa y ha estado aplicado con ´exito en la s´ıntesis de voz, donde obtiene los mejores resultados sobrepasando con diferencia los anteriores obtenidos con sistemas cl´asicos. ´ Este trabajo se centra en el desarrollo de un sistema de s´ıntesis de voz basado en redes neuronales recurrentes con un ´unico modelo para varios locutores. Aunque otros sistemas ´unicamente comparten algunas capas entre hablantes pero mantienen bloques independientes para cada locutor, ´esta tesis explora las posibilidades de implementar una adaptaci´on del modelo SampleRNN condicionado a par´ametros propios del hable y a la identidad del locutor que permite una estructura compartida. Se demuestra que los par´ametros del habla, extra´ıdos mediante Ahocoder en ´esta tesis, son intr´ınsecamente dependientes del locutor. ´ Este hecho permite usar la adaptaci´on m´as simple presentada de SampleRNN como un vocoder de baja velocidad que reduce significativamente la tasa de bits transmitida puesto que solo necesita enviar los par´ametros del habla para decodificar una se˜nal de voz. ´ Este comportamiento demuestra la eficiencia de la estructura compartida propuesta, pero dificulta otras tareas como la conversi´on de voz por la futilidad de la identidad del locutor en el modelo. Se realizaron varios experimentos referentes a los par´ametros del modelo con la intenci´on de optimizar los resultados y se propone un nuevo enfoque de no causalidad al que se refiere como look ahead. Con el objetivo de abordar el problema de la conversi´on de voz dadas las dependencias con el locutor, se propone una estrategia de cuello de botella inspirada por VQ-VAE y una arquitectura adversativa para obtener representaciones latentes de los par´ametros del hable sin informaci´on del hablante. Esto tambi´en permite un nuevo tipo de interpolaci´on de locutores llamada representaci´on eigen-voice que pretende imitar la voz de un locutor nuevo y desconocido con un peque˜no fragmento de se˜nal de voz. Esta propuesta aporta resultados prometedores porque se podr´ıa usar para combatir uno de los ´unicos inconvenientes del aprendizaje profundo, que es la enorme cantidad de datos que se necesitan para que un modelo aprenda la estructura de una se˜nal de entrada, tanto como para otras tareas como la mejora de la seguridad en sistemas biom´etricos basados en voz. v “The study is to proceed on the basis of the conjecture that every aspect of learning or any other feature of intelligence can in principle be so precisely described that a machine can be made to simulate it. An attempt will be made to find how to make machines use language, form abstractions and concepts, solve kinds of problems now reserved for humans, and improve themselves.” Dartmouth Artificial Intelligence Conference, 1955 vi Acknowledgments Firstly, I would like to express my sincere gratitude to my advisor Dr. Antonio Bonafonte for the continuous support of my bachelor’s thesis and related research, for his patience, motivation, and immense knowledge in both speech synthesis and deep learning. His guidance helped me in all the time of investigation and writing of this thesis. I thank Georgina Dorca, who loaned me her source code from the bachelor’s thesis and helped me understand it in early stages when all seemed a mess to me, as well as Santiago Pascual, who helped me fine-tune the architecture and tackle some difficulties with Pytorch. My sincere thanks also goes to the TALP research center and the administrators of the computing resources who gave me access to the laboratory and research facilities. Without they precious support it would have not be possible to conduct this research. Besides the research fellows, I would like to thank all who kindly helped in the development of several experiments by taking their subjective evaluations. Last but not the least, I would like to thank my family: my parents and my sister for supporting me throughout writing this thesis and my life in general. vii Revision history and approval record Revision Date Purpose 0 10/04/2018 Document creation 1 14/06/2018 State of the art chapter revision 2 30/06/2018 Introduction and Methodology chapters revision 3 01/07/2018 Final revision Document Distribution List Name e-mail Oriol Barbany Mayor [email protected] Dr. Antonio Bonafonte [email protected] Written by: Reviewed and approved by: Date 10/04/2018 Date 01/06/2018 Name Oriol Barbany Mayor Name Dr. Antonio Bonafonte Position Project Author Position Project Supervisor viii Contents Abstract ii Resum iii Resumen iv Acknowledgements vi List of Figures xi List of Tables xii List of Abbreviations xiii 1 Introduction 1 1.1 Statementofpurpose................................. 1 1.2 Project requirements and specifications . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Methodsandprocedures ............................... 2 1.4 WorkPlan....................................... 3 1.5 Incidences....................................... 3 2 State of the art 4 2.1 Classicalapproaches ................................. 4 2.1.1 Concatenative synthesis . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1.2 Statistical Parametric Speech Synthesis . . . . . . . . . . . . . . . . . . . 6 2.2 Deep Neural Network-based Speech Synthesis . . . . . . . . . . . . . . . . . . . 7 2.2.1 WaveNet.................................... 8 2.2.2 SampleRNN.................................. 10 2.2.3 VQ-VAE.................................... 12 2.2.4 Efficient Neural Audio Synthesis . . . . . . . . . . . . . . . . . . . . . . . 13 3 Methodology 15 3.1 Multi-speaker Neural Vocoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1.1 Datastructure ................................ 16 3.1.2 Normalization................................. 19 3.1.3 Lookahead .................................. 20 3.2 VoiceConversion ................................... 20 3.2.1 Bottle-Neckapproach............................. 21 3.2.2 Adversarialtraining.............................. 22 3.3 Eigen-voice representation .............................. 24 4 Results 26 4.1 Speechdataset .................................... 26 4.2 Learningstrategy................................... 27 4.3 Objectiveevaluation ................................. 28 4.4 SubjectiveEvaluation................................. 31 5 Budget 33 Contents ix 6 Conclusions 34 6.1 Futurework...................................... 34 Bibliography 38 A Neural Networks 39 A.1 Multi-LayerPerceptron................................ 39 A.2 Optimization ..................................... 40 A.3 Recurrent Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 A.4 Convolutional Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 A.5 Embeddings...................................... 46 B Work Plan 47 B.1 WorkPackages .................................... 47 B.2 Ganttdiagram .................................... 50 C Unfolded structure of SampleRNN modules 52 D Resulting plots 54 D.1 Outputdistributions ................................. 54 D.2 Normalizationplots.................................. 55 Chapter 1. Introduction 3 From the beginning, this dissertation was conceived as a continuation of a previous bachelor’s thesis carried by Dorca Saez (2018) and supervised by Antonio Bonafonte. The generated code was therefore recycled and used as starting point since some adaptations and improvements have been added on the baseline Pytorch model. The code is written in Python 3 as the programming language and it uses the previously mentioned library Pytorch, which is a deep learning framework that provides Tensors and Dynamic neural networks in Python with strong GPU acceleration. Additionally, some Bash scripting has been used to start the pertinent experiments and generate samples with the desired models, which all have been run with GPUs at the computer cluster CALCULA pf VEU group. 1.4 Work Plan The project was structured in the Work Packages exposed below. The breakdown of each one and the Gantt diagram with the planned schedule were presented as an independent document and are included in appendix B. WP1 Environment familiarization WP2 Theoretical learning WP3 Multi-speaker Neural Vocoder WP4 Voice Conversion WP5 Eigen-voice representation WP6 Documentation 1.5 Incidences The major incidence was related to data preparation. This step took more long than expected and some troubles in the training process arose. Modifications on PyTorch parameters such as learning rate, weight normalization or scheduler were applied and results became as expected. Moreover, models have been training between 3 and 6 days, which sometimes delay the modifications as some of the evaluations cannot be done in early stages of the experiments were output is basically random noise. The huge amount of required memory due to the large database needed for this project also lagged the resource allocation on the CALCULA servers. Some of the hypothesis were wrong at first glance, which made the project found non-desired yet interesting and usable solutions as explained in section 1.1. Overall, this obstacles made the project move forward slowly than predicted, which excluded the integration of a parametric speech synthesis model acting as the first stage of the TTS system from the desired results and reduced the time scheduled for some other work packages such as the eigen-voice representation. This is further justified in chapter 6, where a future work section is presented with the desired evolution of this work including the aforementioned integration. 4 2 State of the art Speech synthesis, also known as TTS, is defined as the artificial production of human voice. The aim is therefore to generate an audio signal that utters an input text with as naturalness and intelligibility as possible. Naturalness describes how closely the output sounds like human speech, while intelligibility is the ease with which the output is understood. In this chapter, some of the current approaches will be discussed and differentiated under the umbrellas of classical and deep learning-based approaches. The aim is to give a brief introduction to the background of this project making special emphasis on the deep learning papers that inspired the methodology explained in chapter 3. 2.1 Classical approaches Despite deep learning-based speech synthesizers have yield the state-of-the-art performance, the yet most widely used system called concatenative units (section 2.1.1) differ from these and will be reviewed. In addition, SPSS, which has leveraged the speech synthesis research during the last decade will be analyzed (section 2.1.2). With these two methods, a trade-off intrinsic to the nature of each one shows up. On the one hand, concatenative synthesis offer high-quality results, but on the other hand they are not as robust neither they offer as much flexibility when dealing with voice characteristics as SPSS. 2.1.1 Concatenative synthesis The large popularity of this system and the reason why it has been operating during many years, lies in the fact that it uses real speech, which is recorded in a variety of prosodic contexts to fit as many usage cases as possible, and thus it has an unquestionably high level of naturalness. In one of the most well-known approaches of concatenative synthesis (Hunt and Black, 1996), it is proposed to segment signals from a large speech database by phonemes (although some other works segment by diphones1). Then, those segments, also known as units, are concatenated with the aim of generating the desired utterance given a target phoneme sequence extracted from text. When concatenating units to generate quality speech, it is important to take into account the discontinuities of e.g. phase and pitch as well as the differences in prosody between those units. As it was mentioned before, the same units are usually recorded with different expressiveness to adapt the target prosody on every context. Although that having a large database means a high probability of founding a matching unit, some processing tools are often needed to smooth discontinuities and force the prosody to match. These transformations degrade the quality but offer a higher flexibility without needing a huge database. The selection of units is therefore performed by minimizing a mixture of a target cost Ct and a concatenation cost Ccthat are pondered by the weight ρas in equation (2.1). The 1A diphone is a voice unit with the length of a phoneme but defined in between of two phonemes as it is the more stable point and the less influenced by co-articulation, which is the effect of neighboring phonemes. Chapter 2. State of the art 5 Figure 2.1: Illustration of the unit selection method based on target and concatenation costs from Deep Learning for Siri’s Voice (Apple) minimization of this total cost aims to find the pre-recorded unit or segment from the database uithat best matches a set of targets tiderived from the text using the system front-end. For instance, this target could contain the desired duration, prosodic information, identity of speaker, etc. Optimal unit selection can be performed with the Viterbi algorithm (J. Viterbi, 1967). However, to obtain near real-time synthesis on large speech databases, containing tens of thousands of units, a pruned version is used. ˆuN 1= arg min uN 1 ρ N X i=1 Ct(ui, ti) + (1 −ρ) N X i=2 Cc(ui−1, ui) (2.1) The target cost Ctmeasures the perceptual similarity between a unit from the database ui and a target unit ti, i.e. the worthiness of getting a certain unit to match the desired prosody. It is defined as a sum of p−weighted differences between the target elements and the features of ui, which are extracted from the source sounds, and usually consist of a prosodic feature vector with the pitch and duration of the phonemes. On the other hand, the concatenation cost takes into account the discontinuities between successive units uiand ui−1. Thus, it is defined zero when evaluating the concatenation cost of consecutive units that have been segmented from a single speech signal of the database. These two costs are depicted in figure 2.1. Overall, concatenative synthesis offer quality results but demands a large database to fit all prosodic contexts. 6 2.1. Classical approaches Figure 2.2: HMM-based speech synthesis system from Black et al. (2009) 2.1.2 Statistical Parametric Speech Synthesis A different approach is SPSS, being the most popular variation the Hidden Markov Model (HMM)-based generation synthesis, which offers more customization since it is based on choosing the desired speaker characteristics (such as the duration of phonemes, expressiveness, identity, etc.) and synthesizing the artificial utterance with mathematical models, i.e. not directly dealing with real data once models are trained. This means that the same database used in Concatenative Synthesis could be used to train the models, but the system could be implemented without that data, as the needed parameters are already learned. This happens again with all the DNN-based approaches, and therefore this is also considered a machine learning technique. SPSS popularity lies in its flexibility to change prosodic and spectral content of the generated voice. Another highlight of this technique is its low memory footprint once the model is trained due to the lack of an intrinsic speech database like in concatenative synthesis, even though that quality is not as high than with real speech segments. Other milestone of this technique is the so-called speaker adaptation, which allows to incorporate new speakers despite a hypothetic low amount of data by fulfilling the model by adapting or combining those corresponding to other speakers (Black et al.,2009). SPSS also allows speaker interpolation, which is based in combining the characteristics of the already trained speakers to synthesize new voices. This concept will be further reviewed and a new proposal based on it, is exposed in section 3.3. In a first stage, the speech signal is represented in a parameterized way, meaning that it gets encoded in a vocoder that creates an acoustic feature vector in a windowed frame. The linguistic parameters of each phoneme in a given phonetic and prosodic context are then represented by a stochastic generative model, usually a HMMs, and finally parametric representation is followed and some speech parameters of both types spectral like MFCCs and excitation such as pitch are extracted (as depicted in figure 2.2). Chapter 2. State of the art 7 2.2 Deep Neural Network-based Speech Synthesis Over the past decades, deep learning has revolutionized almost every engineering branch such as that of interest which is Natural Language Processing (NLP), that includes but is not limited to speech synthesis, machine translation, information retrieval and speech recognition. Although the idea of simulating the behavior of neurons was presented 75 years ago (McCulloch and Pitts,1943), it hasn’t really been large-scale applied since last years, when the symbiosis of new algorithms, the availability of huge amounts of data to handle and an increase of computation power enhanced by GPUs has allowed to implement functional DNNs that operate in reasonably short times. With the deep learning approach, speech synthesis has surpassed the trade-off that was briefly exposed in section 2.1 by providing high quality speech as unit selection synthesis does with the flexibility and robustness of SPSS. In those problems called time series, which are basically about forecasting sequential discrete data with a natural order, there are two major deep learning architectures: RNNs and Convolutional Neural Networks (CNNs). The predicted values are based on the previously observed ones and in a DNN this is achieved by either having temporal connections that provide memory to the network or by taking a time span of sample as inputs respectively. Raw audio signals are challenging to model because they have correlations at both neighboring samples and between ones thousand of samples apart. For those readers who are not familiarized with neural networks and their mentioned architectures, please refer to appendix A before continuing with this section as some previous knowledge is assumed. In this appendix, first the basic concept of Artifitial Neural Networks (ANNs) and the Multi-Layer Perceptron (MLP) are introduced. Also some fundamental concepts that will be mentioned during this work such as classification and regression, parameter optimization, backpropagation, stochastic gradient descent, mini-batch, or overfitting are explained in there. Then, the appendix introduce advanced architectures that will be used in a variety of experiments such as RNNs, that allow to model temporal series, and their deep variants such as the wellknown GRU and Long Short-Term Memory (LSTM). CNNs are also explained and their use in both its original purpose which is image processing and as a substitute of RNNs is detailed. Finally, the concept of embeddings to represent categorical features is also discussed. All these concepts are the fundamentals of all the architectures proposed for speech synthesis and that are explained in this chapter and in the proposal. An unintuitive improvement to DNN-based speech synthesis had been driving by focusing the problem as it was about classification instead of regression even when data is implicitly continuous. Categorical or Multinoulli distribution is more flexible and can more easily model arbitrary distributions because it doesn’t assume any distribution of the data. This implies that output is no longer a real value but a discrete one represented by a class. In case of having 8-bit integer values to quantize the signal, this means that there are 256 possible discrete values and thus 256 classes. Reconstructed speech signals achieve less quality degrading when non-linear instead of uniform quantization is applied. Therefore, a previous µ−law companding transformation (ITU-T. Recommendation G. 711,1988) is used before classifying into the hypothetic 256 classes. A model to hold many speakers out of the same shared DNN structure also achieve better results than learning the parameters of a single isolated speaker Fan et al. (2015). In Pascual de 8 2.2. Deep Neural Network-based Speech Synthesis la Puente (2016) it is proposed to have some common layers to exploit the linguistic information shared by all speakers, with a multi-output architecture with isolated paths for each of the speakers. This suggests that internal representation is shared among multiple speakers. In this case, the learning of the base shared structure can be transferred for a new speaker to achieve speaker adaptation like in SPSS (see section 2.1.2) with limited training data, achieving good results in naturalness and similarity to the original speaker. Voice conversion is another NLP problem which consists in changing the speaker given a signal uttered by another subject. It could be though that adding an input with the speaker ID would be enough to train the network to synthesize with another speaker given some speech parameters. Nevertheless, these speech parameters are not independent from the speaker and this is the latent representation that is used to train the network. This means that the speaker label can be obviated and no effective voice conversion is achieved with this approach. This conclusion was stated by Chou et al. (2018), who introduced the idea of training like in a Generative Adversarial Network (GAN). This concept will be further reviewed in section 3.2.2. Some relevant works regarding DNN-based speech synthesis have been already exposed, but the most relevant papers for the development of this thesis are exposed in the following sections. First of all, Wavenet and their parallel variant are exposed for being this approach the one that yet achieves better quality metrics. After this, the baseline model for this project is more extensively exposed as chapter 3 is entirely based on it. Therefore, some equations of the model and the reason of multi-level architecture with modules running at different clock rates is argued. The following paper is VQ-VAE, which inspired the bottle-neck experiment exposed in section 3.2.1 and presents an interesting topic called as voice-style transfer. The last paper was included for the techniques that were proposed on it for adapting the state of the art models for a real-time TTS that could be implemented on a mobile CPU. This was a great milestone due to the good results obtained despite of the huge compression of the model and the parallelization in generation. 2.2.1 WaveNet WaveNet (van den Oord et al.,2016) is a DNN for generating raw audio waveforms. The model is fully probabilistic and autoregressive, with the predictive distribution for each audio sample conditioned on all previous ones. A single WaveNet can capture the characteristics of many different speakers with equal fidelity, and can switch between them by conditioning on the speaker identity. The joint probability of a waveform x={x1, . . . , xT}is factorized as a product of conditional probabilities (equation (2.2)), which distribution is modeled by a stack of convolutional layers. There are no pooling layers as the output of the model has the same dimensionality as the input, which is formed using the previously predicted samples. The use of causal convolutions, ensures that the model cannot depend on any future steps, and the dilation allows to increase the receptive field by orders of magnitude without needing many layers or large filters that would greatly increase computational cost. The result of this combination are the so-called causal dilated convolutions, which are depicted in figure 2.3. p(x) = T Y t=1 p(xt|x1, . . . , xt−1) (2.2) Chapter 2. State of the art 9 Because models with causal convolutions do not have recurrent connections, they are typically faster to train than RNNs, especially when applied to very long sequences. One of the problems of causal convolutions is that they require many layers, or large filters to increase the receptive field. For example, in Fig. 2 the receptive field is only 5 (= #layers + filter length - 1). In this paper we use dilated convolutions to increase the receptive field by orders of magnitude, without greatly increasing computational cost. A dilated convolution (also called ` a trous, or convolution with holes) is a convolution where the filter is applied over an area larger than its length by skipping input values with a certain step. It is equivalent to a convolution with a larger filter derived from the original filter by dilating it with zeros, but is significantly more efficient. A dilated convolution effectively allows the network to operate on a coarser scale than with a normal convolution. This is similar to pooling or strided convolutions, but here the output has the same size as the input. As a special case, dilated convolution with dilation 1yields the standard convolution. Fig. 3 depicts dilated causal convolutions for dilations 1,2,4, and 8. Dilated convolutions have previously been used in various contexts, e.g. signal processing (Holschneider et al., 1989; Dutilleux, 1989), and image segmentation (Chen et al., 2015; Yu & Koltun, 2016). Input Hidden Layer Dilation = 1 Hidden Layer Dilation = 2 Hidden Layer Dilation = 4 Output Dilation = 8 Figure 3: Visualization of a stack of dilated causal convolutional layers. Stacked dilated convolutions enable networks to have very large receptive fields with just a few layers, while preserving the input resolution throughout the network as well as computational efficiency. In this paper, the dilation is doubled for every layer up to a limit and then repeated: e.g. 1,2,4,...,512,1,2,4,...,512,1,2,4,...,512. The intuition behind this configuration is two-fold. First, exponentially increasing the dilation factor results in exponential receptive field growth with depth (Yu & Koltun, 2016). For example each 1,2,4,...,512 block has receptive field of size 1024, and can be seen as a more efficient and discriminative (non-linear) counterpart of a 1×1024 convolution. Second, stacking these blocks further increases the model capacity and the receptive field size. 2.2 SOFTMAX DISTRIBUTIONS One approach to modeling the conditional distributions p(xt|x1, . . . , xt−1)over the individual audio samples would be to use a mixture model such as a mixture density network (Bishop, 1994) or mixture of conditional Gaussian scale mixtures (MCGSM) (Theis & Bethge, 2015). However, van den Oord et al. (2016a) showed that a softmax distribution tends to work better, even when the data is implicitly continuous (as is the case for image pixel intensities or audio sample values). One of the reasons is that a categorical distribution is more flexible and can more easily model arbitrary distributions because it makes no assumptions about their shape. Because raw audio is typically stored as a sequence of 16-bit integer values (one per timestep), a softmax layer would need to output 65,536 probabilities per timestep to model all possible values. To make this more tractable, we first apply a µ-law companding transformation (ITU-T, 1988) to the data, and then quantize it to 256 possible values: f(xt) = sign(xt)ln (1 + µ|xt|) ln (1 + µ), 3 Figure 2.3: Visualization of a stack of dilated causal convolutional layers from van den Oord et al. (2016) WaveNet doubles the dilation for every layer up to a limit and then repeats it by stacking one or more of the same blocks like the one shown in figure 2.3. Exponentially increasing the dilation factor translates into exponential growth of the receptive field with depth, meaning that with 32 layers 1024 samples can be encompassed. Note that this is done by only considering two inputs for each convolution. WaveNet can be conditioned in order to produce speech with the required characteristics given a desired utterance. In a multi-speaker setting, the speaker could be chosen by feeding its identity as an extra input and, in the same manner, linguistic features about the text would be feed for TTS. In this case, the joint probability of the waveform xis conditioned by an additional input hand can be expressed as in equation (2.3). p(x|h) = T Y t=1 p(xt|x1, . . . , xt−1,h) (2.3) The model can be conditioned on other inputs with both global and local conditioning. On the one hand, global conditioning is characterized by a single latent representation hthat influences the output distribution across all timesteps, e.g. a speaker embedding in a multispeaker setting. On the other hand, local conditioning is a second time-series htwith a lower sampling frequency than the audio signal, e.g. linguistic features in a TTS. The time-series has to be transformed using a learned up-sampling that maps it to a new time-series with the same resolution as the audio signal. This concept of global and local conditioners will be further and deeper reviewed in chapter 3. The achieved receptive field of WaveNet is of 240 milliseconds, which encompasses a lot of audio samples, e.g. with a typical sampling frequency of 16kHz this would mean a scope of 3840 samples. Nevertheless, WaveNet was found to sometimes have unnatural prosody by stressing wrong words in a sentence, which could be due to the long-term dependency of fundamental frequency (F0) contours. This was solved by also taking into account other linguistic features to condition the model as the F0, which was predicted with an external model at a lower frequency (200 Hz) and thus allowed to learn long-range dependencies. 10 2.2. Deep Neural Network-based Speech Synthesis Parallel WaveNet Training a WaveNet is quite fast, as the CNN architecture allows to parallelize all time steps as they outputs and inputs are known. This approach take ground truth xas input samples, following thus what is called as professor forcing (Lamb et al.,2016). When generating samples, however, each input sample must be drawn from the output distribution before it can be fed in as input at the next time step. Therefore, WaveNet is poorly suited to parallel processing and hard to deploy in a real-time production setting. The resulting update called parallel WaveNet, is capable of generating high-fidelity speech samples with 1000×speed-up relative to original WaveNet. This translates to more than 20 times faster than real-time (van den Oord et al., 2017a). Inverse Autoregressive Flows (IAFs) are stochastic generative models whose latent variables are arranged so that all elements of a high dimensional observable sample have a known distribution and therefore can be generated in parallel. The goal of this work was to marry the best features of both models: the efficient training of the original WaveNet and the timesaving sampling of IAF networks. This is achieved with what they refer as Probability Density Distillation. The procedure was to use a fully-trained WaveNet model as a teacher to train the IAF, also called as the student in this particular framework. The IAF is smaller than the original WaveNet and, although the architecture is also based in dilated convolutions, the generation of each sample does not depend on any of the previous generated samples. This means that generation can be done in parallel and therefore is better suited to modern computational hardware. The student network is randomly initialized and is fed random white noise and speaker conditioners as an input with the aim of generating a continuous audio waveform as output once trained. Therefore, to generate the correct distribution for timestep xt, the IAF can implicitly infer what it would have output at previous timesteps x1, . . . , xt−1based on the noise inputs z1, . . . , zt−1and the known speech conditioners, which allows it to output all xtin parallel given zt. Transforming uncorrelated noise into structured samples requires more training time compared to CNNs but the inference is much faster as required in production environments. During training, the waveforms generated by the student network are then fed to the teacher, which scores each sample based on the similarity of original WaveNet’s outputs. The loss function to backpropagate is the Kullback-Leiber(KL) between the teacher’s and the student’s distribution. Some extra loss functions are added, including perceptual loss to avoid bad pronunciations, contrastive loss to reduce the noise, and a power loss to help match the energy of real human speech. 2.2.2 SampleRNN SampleRNN (Mehri et al.,2017) is a model for generating unconditional audio sample by sample. It combines memory-less modules with RNNs in a hierarchical structure as depicted in image 2.4, where the lowest tier processes individual samples and each higher module operates on an increasingly longer timescale and at a lower temporal resolution. This is done to tackle the dependencies that raw audio signals have both with neighboring samples and over very long time spans. Chapter 2. State of the art 11 Published as a conference paper at ICLR 2017 Figure 1: Snapshot of the unrolled model at timestep iwith K= 3 tiers. As a simplification only one RNN and up-sampling ratio r= 4 is used for all tiers. Here we are formalizing the frame-level module in tier k. Note that following equations are exclusive to tier kand timestep tfor that specific tier. To increase the readability, unless necessary superscript (k)is not shown for t,inp(k),W(k) x,h(k),H(k),W(k) j, and r(k). inpt=(Wxf(k) t+c(k+1) t; 1 < k < K f(k=K) t;k=K(4) ht=H(ht−1, inpt)(5) c(k) (t−1)∗r+j=Wjht; 1 ≤j≤r(6) Our approach of upsampling with r(k)linear projections is exactly equivalent to upsampling by adding zeros and then applying a linear convolution. This is sometimes called “perforated” upsampling in the context of convolutional neural networks (CNNs). It was first demonstrated to work well in Dosovitskiy et al. (2016) and is a fairly common upsampling technique. 2.2 SAMPLE-LEVEL MODULE The lowest module (tier k= 1; Eqs. 7–9) in the SampleRNN hierarchy outputs a distribution over a sample xi+1, conditioned on the F S(1) preceding samples as well as a vector c(k=2) ifrom the next higher module which encodes information about the sequence prior to that frame. As F S(1) is usually a small value and correlations in nearby samples are easy to model by a simple memoryless module, we implement it with a multilayer perceptron (MLP) rather than RNN which slightly speeds up the training. Assuming eirepresents xiafter passing through embedding layer (section 2.2.1), conditional distribution in Eq. 1 can be achieved by following and for further clarity two consecutive sample-level frames are shown. In addition, Wxin Eq. 8 is simply used to linearly combine a frame and conditioning vector from above. f(1) i−1=flatten([ei−F S(1) , . . . , ei−1]) (7) f(1) i=flatten([ei−F S(1)+1, . . . , ei]) inp(1) i=W(1) xf(1) i+c(2) i(8) p(xi+1|x1, . . . , xi) = Softmax(MLP (inp(1) i)) (9) We use a Softmax because we found that better results were obtained by discretizing the audio signals (also see van den Oord et al. (2016)) and outputting a Multinoulli distribution rather than using a Gaussian or Gaussian mixture to represent the conditional density of the original real-valued signal. When processing an audio sequence, the MLP is convolved over the sequence, processing 3 Figure 2.4: Unrolled model at timestep iwith K= 3 tiers Mehri et al. (2017). As a simplification, only one RNN and up-sampling ratio r= 4 was used for all tiers. Due to the unconditional nature of SampleRNN, its outputs are basically random audio that maintain the structure of the input, being this speech or music in the author’s proposal. This means that it cannot be considered a vocoder that could be used for TTS. The conditioning of this model to speech and speaker parameters was done during this dissertation and the process is explained in chapter 3. As mentioned before and in contrast to WaveNet, SampleRNN has different modules operating at different clock-rates and thus have more flexibility in allocating the amount of computational resources in modeling different levels of abstraction. This can be used to allocate very limited resources to the module responsible for sample level alignments and more resources to model long dependencies which vary slowly, e.g. identity of phoneme being spoken. The entire hierarchy is able to model the joint probability of a waveform (equation (2.2)) and is jointly trained end-to-end by back-propagation. The frame-level modules, i.e. all tiers excluding the first one with k= 1, are deep RNNs that operate on non-overlapping frames of different frame sizes F S(k)and summarize the history of its inputs into a fixed-length conditioning vector h(k) twith trelated to the clock-rate of that tier for the next module downward. This hidden state is a function H, representing one of the known memory cells reviewed in section A.3, that depend on the previous hidden state and an input (equation (2.4)). h(k) t=Hh(k) t−1,inp(k) t(2.4) For the top tier k=K,inp(K) tis the input frame, i.e. the previously predicted samples, and for intermediate modules (1 < k < K) it is a linear combination of the conditioning vector from the higher tier and the current input frame with a learned up-sampling done with either a fully-connected layer or an equivalent 1D-convolution with a unit size kernel2(equation (2.5)). The purpose of the up-sampling is to map the vector cinto a series of r(k)vectors (equation 21D-convolutions with kernel size 1 are popular in deep learning literature because they are equivalent to fully-connected linear layers but accept inputs with three dimensions, being this the number of filters also named as channels. The inconvenient of linear layers is that, by definition, they have an input shape of (Nbatch, L) and don’t accept extra dimensions. 12 2.2. Deep Neural Network-based Speech Synthesis (2.6)), being r(k)the ratio between temporal resolutions of the modules. inp(k) t=   W(k) xf(k) t+c(k+1) t; 1 ≤k < K f(k=K) t;k=K(2.5) c(k) (t−1)∗r+j=W(k) jh(k) t; 1 ≤j≤r(2.6) The sample-level module at time toutputs a distribution over a sample xt+1 conditioned on the FS(1) preceding samples and the conditioning vector from the upper tier c(k=2) t. The first tier has a small associated frame size and, given that no memory is needed for considering correlations to nearby samples, a MLP with a softmax output is used to speed up the training (equation (2.7)). p(xt+1|x1, . . . , xt) = Softmax(MLP(inp1 t)) (2.7) The input vector is computed with equation 2.5 as in the other tiers. Nevertheless, the frame used in the first tier f(1) tis not formed by raw audio but with samples such as et, which represent the raw audio sample xtafter passing through an embedding layer of F S(1) outputs of qdifferent discrete values, e.g. q= 256 for an 8-bit quantization (equation 2.8). f(1) t=flatten([et−F S(1)+1, . . . , et]) (2.8) In order to tackle the computation charge of training RNNs and thus improve the efficiency of this process, Truncated Back-Propagation Through Time (TBPTT) is used. It basically consists in splitting each sequence into short subsequences (best results were reported to be obtained with a length of 512 samples) with the aim of propagating gradients only to the beginning of each subsequence instead of the whole sequence. Despite TBPTT is used, SampleRNN can still mimic the existing long-term structure of the data because of the hierarchical architecture. 2.2.3 VQ-VAE VQ-VAE stands for Vector Quantized-Variational AutoEncoder (VAE), and it was presented within the paper titled Discrete Neural Representation Learning (van den Oord et al.,2017b). A VAE is a two-stage network which first stage encodes a given input into a latent representation of smaller dimension with a known distribution, typically a unit Gaussian. The second stage, decodes the latents to obtain a reconstruction as similar to the input as possible. This architecture therefore have a bottle-neck that provokes a feature compression followed by an inverse structure that achieve the input size. VQ-VAE has been successfully tested in different types of data such as audio, image and video. Unlike VAE, VQ-VAE has discrete instead of continuous latent codes and the samples drawn from these index an embedding table; that is why they reference the Vector Quantifier in the naming. These latent embeddings plus a one-hot embedding for the speaker, are then used to Chapter 3. Methodology 19 Input TargetOverlap Input TargetOverlap 0 79 80 1119 1120 1040 2159 2160 Figure 3.2: Structure of the audio data from index fsamples[3] −fsamples[i], to 1119 −fsamples[i], where fsamples[3] = 80 and fsamples[2] = 20. This means that only 1040 samples are taken of the 1120 (from index 0 to 1119 for the first batch) but starting on different points for every frame level module. Regarding the first tier, the samples from index fsamples[3] −fsamples[1] with fsamples[1] = 20 to the end are taken, resulting in the number exposed above: 1059 = 1119 −(80 −20). 3.1.2 Normalization The speech parameters extracted with Ahocoder are normalized before feeding them to the model with the aim of controlling the magnitude of the gradients in training. The chosen normalization function was a simple feature scaling, which bounds each of the conditioners from 0 to 1 and is computed with equation (3.2). Note that each element of the conditioner vector is independently normalized. ˆ x=x−xmin xmax −xmin (3.2) With the hypothesis of having speaker-dependent conditioners, a normalization for each speaker was proposed as a derivate experiment to isolate the speech features to the source. This supposition can be clearer by thinking about the pitch of each speaker. In human speech, this value varies from 50 to 500 Hz, and adult males use to have lower fundamental frequencies than females or children. The pitch varies to give intonation to a phrase but if normalized by speaker it have similar profiles for same level of expressiveness. Some plots illustrating the effect of this normalization are shown in chapter 4 for some of the other speech parameters whose behavior is not so evident as in the pitch case. In both cases, maximum and minimum values for each of the parameters were found for the training partition of the speech dataset, so it could happen that some features of the other partitions overpass the bounds. 20 3.2. Voice Conversion 3.1.3 Look ahead The main difference between a vocoder that is decoding a live conversation that is remotely encoded and the one that generates speech in a TTS system is that in the second case, the complete sequence of speech parameters that will be fed to the vocoder are known. This means that in contrast with a possible phone call were both ends are talking at real time, after synthesizing a speech signal, all parameters that will condition the model are already extracted either from raw text or from another speech signal like in Ahocoder. Note that by using deep learning and more concretely architectures derived from RNNs, the model has memory and thus to provide context only the current and following frames are needed because all the previous ones are remembered and stored as the hidden states. This contrast with other classical approaches were this kind of context would need a window centered on the sample of interest. With this idea in mind, the causality that speech synthesizers inherited from the vocoders used in decoding is questioned and another experiment is derived from it. The proposal is then to not only use the 43 parameters extracted from the current 80 samples but also the ones computed with the following window. This means that in this experiment there will be 86 features conditioning the output, being these the ones corresponding to the current and future frames except from the last 5 ms segment of audio which will have the same features twice. 3.2 Voice Conversion Voice conversion is a technique to modify a speech waveform which freely converts non-para- linguistic information while preserving linguistic information (Toda et al.,2016). This means that the changes in intonation, pauses and the spoken text is exactly the same but the speaker changes. To develop this technique, a deep understanding of how to effectively factorize speech acoustics into its individual components such as linguistic, non-linguistic, and para-linguistic information using various technologies, such as machine learning, is needed. Moreover, voice conversion has great potential to develop various applications not only for flexible control of speaker identity of synthetic speech in TTS systems but also as a speaking aid for vocally handicapped people such as dysarthric and laryngectomees patients, as a voice changer to flexibly generate various types of emotional and expressive speech, for vocal effects to produce more varieties of singing voices, for enhanced mobile speech communication using wide-band speech, accent conversion for computer assisted language learning, and so on. Therefore, it is worthwhile to study this technique for both scientific purposes and industrial applications. Although a simple conversion function, such as a global linear transformation or frequency warping with a constant warping rate for modifying the spectral envelope, is capable of changing speaker identity, it is insufficient to convert a specific source speaker’s voice into another specific target speaker’s voice. A more sophisticated conversion function to effectively model a nonlinear mapping between source and target voices needs to be developed to convert speaker identity. This is why some approaches using deep learning have been derived from this challenge by assuming that the linear transformation explained in section 3.1.2 would not be enough, but a neural network could learn a non-linear function capable of freeing the linguistic parameters of the speaker information. The objective is therefore to design a network capable of learning this complex non-linear function that could take the acoustic features extracted with Ahocoder and output a trans- Chapter 3. Methodology 21 formation of them without speaker information. The identity of the speaker will be fed as an extra input as in the previous case, but this time the network will not be able to guess the speaker solely based on the acoustic features. This means that the model will be forced to give importance to the speaker identity that previously was meaningless to achieve good results in synthesis. Once this differentiation is done and the network is fully trained by feeding the identity of the speakers that and its correspondent features, this identity could be swapped in generation to obtain the desired voice. 3.2.1 Bottle-Neck approach This approach to tackle voice conversion is inspired by VQ-VAE (section 2.2.3) and can be seen as the first stage of an auto-encoder. The purpose is to compress the speech features into a lower dimension called latent representation or code as in figure 3.3. Figure 3.3: Schematic of an auto-encoder with 3 hidden layers from Wikipedia By forcing a bottle-neck, the conditioners will ideally only preserve the linguistic information as the speaker identity is independently fit as in the SampleRNN model. Therefore, the unique difference with the baseline adapted model depicted in figure C.1 is that the output of Ahocoder will not only be applied one linear layer that expands it to the proper dimension that fit the number of hidden units og the GRUs. Different experiments have been run with a variety of values for the independent conditioner dimension, the lower number of channels before the expansion to 1024. An example with a narrower dimension of 10 is depicted in figure 3.4. Bottle-neck Tier 3 Speaker-dependent conditioners (128 ×13 ×43) Conv1D Channels: 43→40 Kernel size: 1 Conv1D Channels: 40→30 Kernel size: 1 Conv1D Channels: 30→20 Kernel size: 1 Conv1D Channels: 20→10 Kernel size: 1 Speaker-independent conditioners (128 ×13 ×10) Conv1D Channels: 10→1024 Kernel size: 1 Figure 3.4: Example of a bottle-neck with independent dimension 10 22 3.2. Voice Conversion 3.2.2 Adversarial training Another approach for voice conversion that was already introduced by the advisor of this thesis in the project proposal, is based in transforming the speech features to be independent of the speaker like in the bottle-neck approach but not necessarily with the same architecture. This new features are then used by SampleRNN and by a network that tries to guess the speaker from them. During the development of this thesis, a similar work was presented by Chou et al. (2018) and the architecture proposed for the discriminator was adapted to the needs of SampleRNN. The concept of adversarial training was in both cases inspired by Generative Adversarial Networks (GANs). GANs were introduced by Goodfellow et al. (2014) and they are formed by a pair of simultaneously trained networks called generator and discriminator. On the one hand, the purpose of the discriminator is to assign a probability that tells if the inputs of that network are fake or not. On the other hand, the generator tries to fool the discriminator by synthesizing outputs from noise inputs that seem real. Once the loss of the discriminant is backpropagated, the gradients of the input are used to update the weights of the generative network and thus tell which parts of the generated object to change in order to yield a greater probability in being real as seen by the discriminator. In the proposed formulation, the so-called discriminator is a classifier that tries to guess the speaker solely based on the latent representation of the conditioners which ideally are independent from the speaker once the network is trained. Note that the concept differs from the original GAN formulation as there is no fooling with fake data but with a transformation of it. With the architecture of discriminant depicted in figure 3.5, Chou et al. (2018) reported a drop of verification accuracy from 0.916 to 0.451, which demonstrates that the desired independence between the linguistic information and the speaker is achieved. The conditionerCNN module was changed in a variety of experiments, where bottle-necks with different narrower dimensions and other approaches were the number of channels was not reduced were tried. In order to train an adversarial model, two optimizers are needed to independently train both the discriminant to classify better and the rest of the network to, in this case, generate speech similar to the target with the premise of using the speaker-independent speech parameters. Both optimizers use ADAM and minimize the losses computed with the NLL function. One of the optimizers only applies back-propagates on the parameters of the discriminant and minimizes the classification loss L2. The other optimizer, applies on the rest of the model parameters, i.e. the ones belonging to SampleRNN and the conditionerCNN. The loss to minimize in this case is not only L1, which is determined by the likelihood of the output distribution and the target, but also on L2with inverted sign to avoid the discriminant from guessing the speaker from the latents. The expression of the total loss minimized by the second optimizer follows equation (3.3), where λis a hyper-parameter. L=L1−λL2(3.3) The discriminant depicted in figure 3.5 includes some modules that have not yet been introduced. First of all and differing from all the previous diagrams of architectures, the activation functions are shown in the discriminant network because there are not Rectified Linear Units (ReLUs) between layers like in the other cases. They are Leaky ReLUs and, as it can be seen Chapter 3. Methodology 23 ConditionerCNN Discriminant FrameLevelRNN Speaker-dependent speech parameters (128 ×13 ×43) Conv1D Channels: 43→43 Kernel size: 1 Conv1D Channels: 43→43 Kernel size: 1 Conv1D Channels: 43→50 Kernel size: 1 Speaker-independent speech parameters (128 ×13 ×50) Spectra-like latent representation (128 ×1×13 ×50) Reflection Padding Size: 2 ×2 Conv2D Channels: 1→512 Kernel size: 5 ×5 LeakyReLU Reflection Padding Size: 2 ×2 Conv2D Channels: 512→512 Kernel size: 5 ×5 InstanceNorm2D Size: 512 + + + + Reflection Padding Size: 2 ×2 Conv2D Channels: 512→512 Kernel size: 5 ×5 LeakyReLU Reflection Padding Size: 2 ×2 Conv2D Channels: 512→512 Kernel size: 5 ×5 InstanceNorm2D Size: 512 Reflection Padding Size: 2 ×2 Conv2D Channels: 512→512 Kernel size: 5 ×5 LeakyReLU Reflection Padding Size: 2 ×2 Conv2D Channels: 512→512 Kernel size: 5 ×5 InstanceNorm2D Size: 512 Reflection Padding Size: 2 ×2 Conv2D Channels: 512→512 Kernel size: 5 ×5 LeakyReLU Reflection Padding Size: 2 ×2 Conv2D Channels: 512→512 Kernel size: 5 ×5 InstanceNorm2D Size: 512 Flattened output tensor (128 ×512 ∗13 ∗50) Fullyconnected layer Inputs: 512*13*50 Outputs: 6 Log-Softmax Speaker prediction Speaker batch (128 ×1) As one-hot with 6 unique speakers Conv1D Channels: 50→1024 Kernel size: 1 Embedding Inputs: 6 Outputs: 1024 + + InputRNN Target Figure 3.5: Diagram of the adversarial training architecture in figure A.1, it is almost the same as the ReLU but a identity function with a slope of 0.01 for negative outputs instead of a constant 0. Also note that in this case convolutions are 2- dimensional. This was done to explode the temporal redundancy of speech conditioners. In order to do so, the latents are rearranged into a spectra-like representation with an extra dimension of 1 channel like if it was a gray-scale image. Before the convolutional layer, there is a reflection padding of size 2 ×2 that enlarges the input. A reflection padding example of the same size applied to a 3 ×3 matrix is shown below.    1 2 3 4 5 6 7 8 9   −→ 2×2 Reflection Padding −→              9 8 7 8 9 8 7 6 5 4 5 6 5 4 3 2 1 2 3 2 1 6 5 4 5 6 5 4 9 8 7 8 9 8 7 6 5 4 5 6 5 4 3 2 1 2 3 2 1              The padding is needed because in this case the kernel size is 5×5 and the output dimensions of the spectra-like representation would decrease in 5 units for every convolutional layer. In general, the output size after a convolution of kernel size Kand padding Pboth symmetric in width and height dimensions, is given by the following expression, where the input has a structure of (batch size ×channels ×W1×H1). In the case of wanting the same dimensions in both input and output of a convolutional layer with kernel size K= 5, a padding of size P= 2 is needed. W2=W1−K+ 2P+ 1 ; H2=H1−K+ 2P+ 1 24 3.3. Eigen-voice representation Within the discriminant, there is a pattern of stacking 2 convolutional layers with the respective paddings and activation functions that is repeated four times. Each output of these pseudo-modules is added to the result of the previous one except for the first case which is directly summed to the input. This is know as residual connections and was recently introduced by Wu et al. (2015). With network depth increasing, accuracy gets saturated and then degrades rapidly. Unexpectedly, such degradation is not caused by overfitting, and adding more layers to a suitably deep model leads to higher training error. Residual learning eases the training of DNNs and enables them to be substantially deeper without saturating the accuracy by copying the layers from the learned shallower model and then adding the input with an identity mapping. Moreover, the use of residual connections allows to perform iterative refinement of features (Jastrz¸ebski et al.,2018). Just before summing up the inputs and outputs of each residual connection module, an instance normalization is applied. This concept was introduced by Ulyanov et al. (2016) and was originally oriented to train high-performance architectures for real-time image generation. The normalization function is shown in equation (3.4). Y=X−E[X] qV ar[X] + ε(3.4) For this project, ε= 1 ·10−5as it is the default value of the instance normalization function implemented within the Pytorch library. Mean and standard deviation are calculated perdimension separately for each object in a mini-batch and have a momentum of η= 0.1 that defines an update rule which follows the expression shown below, where ˆxis the estimated statistic and xtis the new observed value. ˆ xnew = (1 −η)·ˆ x+η·xt 3.3 Eigen-voice representation Deep learning achieves state-of-the-art results in speech synthesis and is able to generate different voices from the same model. Nevertheless, one of the only inconveniences of these methods is the huge amount of data that the models demand to learn the structure of an input signal for each of the speakers. For this work, a minimum of 14 minutes of speech signal is used to learn the representation of a single speaker for a multi-speaker model (see table 4.1). By achieving voice conversion, this model could read an input text with as many voices as the model have been trained with, but would not be able to speak with new voices. In works like Pascual de la Puente (2016), experiments regarding speaker interpolation were tried with the aim of synthesizing new speakers. With a model which feeds the speaker identity as a one-hot vector, this would be as easy as putting various values into the input vector that would act as probabilities of belonging to each of the trained speakers. Inspired by a similar solution presented to a problem for facial recognition by Turk and Pentland (1991), the idea of this section is to create a basis of speakers that could ideally represent any new voice. With the speaker embeddings computed on the tier 3 of SampleRNN and using the discriminant network depicted in figure 3.5 to predict the values of this embedding, the predicted Chapter 3. Methodology 25 speaker vector could be feed directly to the 1D-convolution as if it was the speaker embedding. A dimension of 6 could not be enough to represent the characteristics of many speakers, but some experiments to find the appropriate one are derived from this proposal. When the proper number of dimensions of the embedding is achieved, with a large enough database every speaker identity could be represented. The mapping of the speakers of the training database should be orthogonal vectors forming the basis or at least as much independent embeddings as the dimension of it. This idea could theoretically replicate any voice with a very short duration audio of the target speaker if the conditions exposed above are satisfied. For the current implementation, embeddings have a rank of 6, meaning that they are all linearly independent. This indicates that a higher dimension of embedding would be needed as some voices of teen speakers are not well modeled as it is exposed in section 4.3. The projections of the embedding obtained with the SampleRNN model can be seen in figure 3.6. (a) (b) (c) Figure 3.6: 2D (a) and 3D (b) and (c) embedding projections obtained with Principal Component Analysis dimensionality reduction technique visualized with Tensorflow Projector 26 4 Results The results obtained for each of the experiments presented in chapter 3 as well as the value of the parameters that were fine-tuned in each of them are exposed below. Moreover, the database used in the development of this thesis will also be exposed. The results are presented under two big umbrellas of objective and subjective metrics. On the one hand, the comparison is done by analyzing the evolution of the loss function during the training and the mathematical similarity between target and generated signals. On the other hand, subjective metrics were acquired by performing perceptual tests to human listeners that rated the quality of the generated audio. 4.1 Speech dataset The speech dataset used to train the model was formed by six voices from the TC-STAR project (Bonafonte et al.,2006), where half of them are males and the other half are females. TC-STAR project, is financed by European Commission and envisaged as a long-term effort to advance research in all core technologies for Speech-to-Speech Translation (SST). SST technology is a combination of automatic speech recognition, spoken language translation and TTS). The objectives of the project are ambitious: making a breakthrough in SST that significantly reduces the gap between human and machine translation performance. The project targets a selection of unconstrained conversational speech domains—speeches and broadcast news—and three languages: European English, European Spanish, and Mandarin Chinese. Accurate translation of unrestricted speech is well beyond the capability of today’s state-of-the-art research systems. Therefore, advances are needed to improve the state-of the-art technologies for speech recognition and speech translation. In some works like in Pascual de la Puente (2016), it is recommended to balanced the data per user so all of them have approximately the same amount of samples to train. Nevertheless, all the available database was used to investigate if it is really necessary to compensate the input data or there is no observable preference and thus a larger database can be used. Moreover, the approach of not balanced data was also taken to avoid the few length restricted by speaker denoted with the identifier 76, which barely have a quarter of the others. Table 4.1 shows a summary of the used database, which is, as the union of corpus 11 and 33. The first one contains audios were transcriptions of the European Parliament are read and thus are based in spoken language while the second one contains the reading of news and therefore is based in written language. Each speaker is denoted by a numeric identifier and its sex either male (M) or female (F) is specified. It is also specified if the main purpose of each speaker was focused on baseline voices for TTS (B) or for voice conversion (V). In this work, all voices have been used for both purposes. Speech recordings were originally sampled at 96 kHz with a resolution of 24 bits per sample. Nevertheless, with the aim of conserving the audio format specifications of SampleRNN, the database was down-sampled to 16 kHz and non-linearly quantified with µ−law using 8 bits. The whole speech dataset was split into three subsets of 80%, 10% and 10% for training, validation and test respectively. Each audio was pseudo-randomly taken with the premise of approximately having the same proportion of speakers in every partition to avoid unseen identities. Chapter 4. Results 27 72 (F;B) 73 (M;B) 75 (F;V) 76 (F;V) 79 (M;V) 80 (M;V) Whole database 07:58:18 07:29:47 02:01:16 01:09:55 01:50:34 01:56:06 Corpus 11 01:03:56 01:00:07 00:53:47 00:02:23 00:45:26 00:54:55 Corpus 33 00:00:00 00:00:00 00:11:51 00:11:41 00:11:28 00:12:09 Used database 01:03:56 01:00:07 01:05:38 00:14:04 00:56:53 01:07:04 Table 4.1: Table with database length broken down for each speaker and corpus 4.2 Learning strategy As explained in chapter 3, all models were trained with stochastic gradient descent using a mini-batch size of 128 and minimizing the NLL with ADAM optimizer. The decay rates, which determine the inertia on the update of the biased first and second moment estimations, take the default values recommended by Pytorch library of β1= 0.9 and β1= 0.999. Learning rate is set to an initial value of lr0= 10−4, as it was found to offer the best results. With a value of 10−3, seemingly overfitting was reached at early stages and the generated samples didn’t satisfy the requirements. By decaying the learning rate to a value of 10−5, training was better than in the last case as it didn’t collapse, but the evolution of the loss was very irregular. An external learning rate controller called scheduler was also used to force decrease its value after some milestones because it was find that the output curves made a sudden change in the first epochs. This is why the scheduler was set two milestones at epochs 15 and 35 with γ= 0.1, which means that the supposedly fixed learning rate evolves as shown in the expression below. Note that ADAM changes the learning rate and thus the scheduler reduces it by a factor γin every milestone but it will not take the values shown in the example. lr =       lr0= 10−4epoch < 15 lr0·γ= 10−515 ≤epoch < 35 lr0·γ2= 10−6epoch ≥35 Weight normalization (Salimans and Kingma,2016), which consists in decoupling the length and the direction of each weights, was also used to speed-up the convergence. It was applied to the 1-D Convolutional layers, where each weight wwas re-parametrized into an scalar g representing the gain and a vector vas shown in equation (4.1). When the weight is decoupled, the gradient descent is applied on the loss functions computed with respect to these two new parameters ∇vL,∇gL. Weight normalization speeds-up the training and it is computationally cheaper in front of other approaches such as batch normalization. w=g ||v||v(4.1) 28 4.3. Objective evaluation 4.3 Objective evaluation Although the samples generated with models trained with around a hundred epochs sounded natural and were very similar to the targets after the incorporation of the learning controllers exposed above, some of the samples saturated. Normally this saturation ended up corrupting the audio from the start of this unwanted high energy noise to the end. Nevertheless, some of the corrupted signals obtained with the look ahead approach (see section 3.1.3), showed a saturation of only around 9500 samples (0.6s at a sample rate of 16kHz) that ended up with a normal behavior. This temporal saturation is depicted in figure 4.1. The plots of the output distribution and their corresponding generated waveforms for two audios representing normal behavior and saturation are included in section D.1. Figure 4.1: Waveform (below) and its spectrogram (above) of a generated signal that saturated on the middle samples In order to tackle this instability, some research of this topic started but no similar works were found. The only idea was to change the approach referring the initial states of the RNN. This parameter derived in two experiments were its value was either learned during the training like in the default situation, i.e. like in all the other experiments, or a null tensor. Nevertheless, the saturation still prompted on some of the generated files and the only alternative was to select the non-corrupted audios for the perceptual test. Regarding the experiment related to conditioners’ normalization (section 3.1.2), it was first found that only the pitch feature, which inspired this approach to independently normalize with the aim of giving importance to the speaker identity, had the predicted behavior. Some plots of the feature evolution are included in section D.2, where the exact same sentence is uttered by the speakers from the voice conversion speech subset (see table 4.1). As it can be seen in figure D.3, the independent normalization of the logarithmic pitch contour is very similar in all the audios of the different speakers, whilst the joint normalization would be enough to identify the speaker and thus no extra input parameter would be needed. For instance, note that in the joint normalization, it is very easy to distinguish between females (75, 76) and males (79, 80). This means that it would be impossible to change the speaker because the network doesn’t need its identity for being this information included in the features. This is why this redundancy implies the futility of this input observed in the results. Virtually all the other features resulted in very similar normalizations for both joint and independent approaches. The only exception was found with the MFCC of order 4, where the joint normalization acted as a scale factor for speakers 76, 79 and 80 due to a peak of speaker 75 at about sample 300. This is not an advantage for speaker isolation, but could be useful Chapter 6. Conclusions 35 rameters given text was proposed by Zen et al. (2013). Therefore a next step would be to extract speech parameters directly from text instead of audio signals like in Ahocoder. The advantage of using a system based in DNNs is that the model could be jointly trained like in Tacotron (Wang et al.,2017), an end-to-end generative TTS model that synthesizes speech directly from characters and train the model from scratch with < text, audio > pairs. With a similar framework,the optimal parameters mentioned in the closure of chapter 4 could be found. In fact, in the Neural Discrete Audio Representation paper (van den Oord et al.,2017b), the latents extracted with VQ-VAE that are then used to condition the Wavenet model to output the desired speech, are shown to be similar to the human-designed alphabet of phonemes. The features previously extracted with Ahocoder could be therefore substituted with this new representation, which probably is more efficient from the perspective of both voice conversion and audio synthesis as it achieves what authors call voice-style transfer (see 2.2.3). The bachelor’s thesis carried by Dorca Saez (2018) integrated MUSA, a parametric TTS system developed during the master’s thesis of Pascual de la Puente (2016). Although the integration of both systems allowed to map text into speech parameters and then condition the SampleRNN model, it significantly degrades the quality. For this reason, the results presented in this dissertation were only extracted from more reliable parametric TTS modules that allowed to evaluate the presented model without introducing external errors. When referring to the use of the SampleRNN model as a vocoder, after incorporating more speakers to the database to have a wider range of different voices, some experiment such as alternative representations for low-rate coding, bandwidth extension and speech enhancement could be derived. The need of a larger database prompts when trying to synthesize voices that are very different from the ones in the database. This can be first solved by balancing the data, but some voices more similar to the kid of the vocoder database would be probably needed. In Kleijn et al. (2017), a similar proposal based in low-rate speech with the Wavenet model. Regarding to the recurrent units, an option to change from GRUs to Quasi-Recurrent Neural Networks (QRNNs) could be implemented with the aim of fastening-up the training and inference. See section A.3 for more details about RNN architectures. Bottle-neck could be better trained by designing a full VAE. This framework is aimed to obtain the same features in both the input and the output, with latents of lower dimension (see figure 3.3). Once this module is independently trained, the first stage of this VAE, i.e. the bottle-neck previously depicted in figure 3.4, could be incorporated to the model with frozen coefficients. This means that the latent representation achieved with the training of the VAE would be preserved and no problems regarding the difficulty of training with the whole model would arise. The adversarial training framework inspired by the work of Chou et al. (2018) was only the first stage of a proposed two-stage system. The second stage was another pair of generator and discriminator which was trained to create a residual signal to patch the output obtained in the first stage. This was designed to improve the quality of speech as they reported to obtain blurry spectra and artifacts. The training of the second stage is done after the first stage is already trained and their parameters remain frozen. This was nevertheless not implemented because the problem was in losing linguistic information and not in noisy outputs. The need of using this two-stage system is not discarded for future results with the adversarial framework model including the latents of the independently trained bottle-neck. 36 Bibliography Albelwi, S. and Mahmood, A. (2017). A Framework for Designing the Architectures of Deep Convolutional Neural Networks. Entropy, 242(19). Black, A. W., Zen, H., and Tokuda, K. (2009). Statistical Parametric Speech Synthesis. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, pages 1229–1232. Bonafonte, A., H¨oge, H., Kiss, I., Moreno, A., Ziegenhain, U., Heuvel, H. V. D., Hain, H., Wang, X. S., and Garcia, M. N. (2006). TC-STAR : Specifications of Language Resources and Evaluation for Speech Synthesis. Proceedings of the Language Resources and Evaluation Conference LREC06, pages 311–314. Bradbury, J., Merity, S., Xiong, C., and Socher, R. (2016). Quasi-Recurrent Neural Networks. CoRR, abs/1611.0:1–11. Britz, D. (2016). Recurrent Neural Networks Tutorial, Part 1 – Introduction to RNNs. http://www.wildml.com/2015/09/ recurrent-neural-networks-tutorial-part-1-introduction-to-rnns/. Cho, K., van Merrienboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., and Bengio, Y. (2014). Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. CoRR. Chou, J.-c., Yeh, C.-c., Lee, H.-y., and Lee, L.-s. (2018). Multi-target Voice Conversion without Parallel Data by Adversarially Learning Disentangled Audio Representations. CoRR, pages 2–6. Dorca Saez, G. (2018). Neural Audio Generation for Speech Synthesis. Bachelor’s thesis, Universitat Polit`ecnica de Catalunya. Drugman, T. and Stylianou, Y. (2014). Maximum Voiced Frequency Estimation: Exploiting Amplitude and Phase Spectra. IEEE Signal Processing Letters, 21(10):1230–1234. Erro, D., Sainz, I., Navas, E., and Hernaez, I. (2014). Harmonics plus Noise Model based Vocoder for Statistical Parametric Speech Synthesis. IEEE Journal on Selected Topics in Signal Processing, 8(2):184–194. Fan, Y., Qian, Y., Soong, F. K., and He, L. (2015). Unsupervised speaker adaptation for DNN- based TTS synthesis. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, pages 4475–4479. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative Adversarial Nets. Advances in Neural Information Processing Systems 27, pages 2672–2680. Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural Comput., 9(8):1735–1780. Hunt, A. J. and Black, A. W. (1996). Unit selection in a concatenative speech synthesis system using a large speech database. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, 1:373–376. Bibliography 37 ITU-T. Recommendation G. 711 (1988). Pulse Code Modulation (PCM) of voice frequencies. J. Viterbi, A. (1967). Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Transactions on Information Theory, IT-13(2):260–269. Jastrz¸ebski, S., Arpit, D., Ballas, N., Verma, V., Che, T., and Bengio, Y. (2018). Residual Connections Encourage Iterative Inference. In ICLR, pages 1–14. Kalchbrenner, N., Elsen, E., Simonyan, K., Noury, S., Casagrande, N., Lockhart, E., Stimberg, F., van den Oord, A., Dieleman, S., and Kavukcuoglu, K. (2018). Efficient Neural Audio Synthesis. CoRR, abs/1802.0. Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. CoRR, abs/1412.6980. Kleijn, W. B., Lim, F. S. C., Luebs, A., Skoglund, J., Stimberg, F., Wang, Q., and Walters, T. C. (2017). Wavenet based low rate speech coding. CoRR, pages 3–7. Kozakowski, P. and Michalak, B. (2017). SampleRNN-pytorch. https://github.com/ deepsound-project/samplernn-pytorch. L. Smith, S., Kindermans, P.-J., Ying, C., and V. Le, Q. (2018). Don’t decay the learning rate, increase the batch size. ICLR, pages 1–11. Lamb, A., Goyal, A., Zhang, Y., Zhang, S., Courville, A., and Bengio, Y. (2016). Professor Forcing: A New Algorithm for Training Recurrent Networks. NIPS. Masters, D. and Luschi, C. (2018). Revisiting Small Batch Training for Deep Neural Networks. CoRR, pages 1–18. McCulloch, W. S. and Pitts, W. (1943). A Logical Calculus of the Idea Immanent in Nervous Activity. Bulletin of Mathematical Biophysics, 5:115–133. Mehri, S., Kumar, K., Gulrajani, I., Kumar, R., Jain, S., Sotelo, J., Courville, A., and Bengio, Y. (2017). SampleRNN: An Unconditional End-to-End Neural Audio Generation Model. ICLR, pages 1–11. Olah, C. (2015). Understanding LSTM Networks. http://colah.github.io/posts/ 2015-08-Understanding-LSTMs/. Pascual de la Puente, S. (2016). Deep learning applied to speech synthesis. Master’s thesis, Universitat Polit`ecnica de Catalunya. Salimans, T. and Kingma, D. P. (2016). Weight normalization: A simple reparameterization to accelerate training of deep neural networks. CoRR, abs/1602.07868. Toda, T., Chen, L. H., Saito, D., Villavicencio, F., Wester, M., Wu, Z., and Yamagishi, J. (2016). The voice conversion challenge 2016. Proceedings of the Annual Conference of the International Speech Communication Association, INTERSPEECH, 08-12-Sept:1632–1636. Turk, M. and Pentland, A. (1991). Eigenfaces for recognition. J. Cognitive Neuroscience, 3(1):71–86. Ulyanov, D., Vedaldi, A., and Lempitsky, V. (2016). Instance Normalization: The Missing Ingredient for Fast Stylization. CoRR. 38 Bibliography van den Oord, A., Dieleman, S., Zen, H., Simonyan, K., Vinyals, O., Graves, A., Kalchbrenner, N., Senior, A., and Kavukcuoglu, K. (2016). WaveNet: A Generative Model for Raw Audio. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, pages 1–15. van den Oord, A., Li, Y., Babuschkin, I., Simonyan, K., Vinyals, O., Kavukcuoglu, K., van den Driessche, G., Lockhart, E., Cobo, L. C., Stimberg, F., Casagrande, N., Grewe, D., Noury, S., Dieleman, S., Elsen, E., Kalchbrenner, N., Zen, H., Graves, A., King, H., Walters, T., Belov, D., and Hassabis, D. (2017a). Parallel WaveNet: Fast High-Fidelity Speech Synthesis. CoRR. van den Oord, A., Vinyals, O., and Kavukcuoglu, K. (2017b). Neural Discrete Representation Learning. In NIPS. Wang, Y., Skerry-Ryan, R. J., Stanton, D., Wu, Y., Weiss, R. J., Jaitly, N., Yang, Z., Xiao, Y., Chen, Z., Bengio, S., Le, Q. V., Agiomyrgiannakis, Y., Clark, R., and Saurous, R. A. (2017). Tacotron: A fully end-to-end text-to-speech synthesis model. CoRR, abs/1703.10135. Wu, S., Zhong, S., and Liu, Y. (2015). Deep Residual Learning for Image Recognition. CoRR, pages 1–17. Zen, H., Senior, A., and Schuster, M. (2013). Statistical parametric speech synthesis using deep neural networks. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, pages 7962–7966. 39 A Neural Networks Artifitial Neural Networks (ANNs) were conceived with the aim of mathematically model human intellectual abilities by biologically plausible engineering designs and thus bringing the concept of artificial intelligence. Nevertheless, even the so-called Deep Neural Networks (DNNs), which are ANNs with many layers, are not as complex as a real neural network as they barely have hundreds of synapses in front of 1011 neurons with 104synapses each one on a real brain. A.1 Multi-Layer Perceptron An ANN is a set of neurons, which are basic units of the network. The activation of those is simply a linear combination of an input vector x={x0, x, 1, . . . , xN}, which is pondered by a set of weights denoted as wplus a bias term b(equation (A.1)). a=wTx+b(A.1) Some neurological studies have already demonstrated that a non-linear behavior is shown in each neuron given an input stimulus. In order to mimic that, the activation described of equation (A.1) is applied a non-linear function f. Moreover, this allows to obtain arbitrary shape decision regions that fit to almost any kind of problem with the proper depth and width. Note that this functions have to be continuous but at the same time differentiable in order to optimize the weights. These functions are typically linear for small values and saturate for large ones. Some common names for non-linear functions used in neural networks are hyperbolic tangent, Rectified Linear Unit (ReLU) and sigmoid. y=f(wTx+b) (A.2) The hooking of many of these basic units creates the Multi-Layer Perceptron (MLP), which is the simplest type of ANNs as it only have feed-forward connections. Neurons can be stacked in parallel and also concatenated, i.e. the output of one neuron is the input of the following giving therefore width and depth to the network respectively. The framework is thus formed by many layers which don’t necessary have the same number of neurons in each of them as depicted in figure A.2. The leftmost layer of the network is called input layer while the rightmost is the output layer. In between layers are named as hidden, because its values are not observed in the training set as they are not target values neither inputs. As the number of hidden layers increases, the network can start being denoted as a DNN. Deep-learning methods are capable of learning multiple levels of representation by composing non-linear modules. Each one transforms the output of the previous level, or raw input in case of the first layer, into a more abstract level representation. Therefore, with the composition of enough of such transformations, very complex functions can be learned. 40 A.2. Optimization −3−2−10123 0 1 2 3 x f(x) ReLU tanh −3−2−1 0 1 2 3 0 1 2 3 x f(x) Leaky ReLU Sigmoid Figure A.1: Typical activation functions and their derivatives illustrated with dashed lines Input #1 Input #2 Input #3 Input #4 Output #1 Output #2 Output #3 Hidden layers Input layer Output layer Figure A.2: Overview of a fully-connected MLP with three hidden layers A.2 Optimization There are essentially two types of supervised problems to tackle with DNNs; classification and regression. These deal with a discrete set of classes and a continuous domain of possible values respectively. When classifying, the desired outputs, also called labels or classes, are in a form of a one-hot encoding vector, which have only one value set to 1, corresponding to the target class, and the 0 elsewhere, e.g. [0,0,0,1,0]. The loss, which depends on the parameters of the network, evaluates the difference between the targets and the outputs. Before comparing them, the final layer is often applied a softmax function (equation (A.3)) to express the probabilities of belonging to a class. S(yi) = eyi Pjeyj(A.3) Appendix A. Neural Networks 41 Regression aims to model and analyze several variables, when the focus is on the relationship between an output dependent variable and one or more independent variables which are treated as the inputs of the network. These outputs are a real value, such as an integer or floating point value, often representing quantities, like amounts and sizes. For each of that problems, a loss function to minimize with respect to the parameters of the network is defined in order to train the model. In the regression case, loss functions depend on the distance from target to result, whereas in classification problems it only depends on either if class is well predicted or not, e.g. euclidean loss for regression and cross entropy for classification (equations (A.4a) and (A.4b) respectively). L=1 N N X i=1 (yi−fθ(xi))2(A.4a) L=− N X i=1 yilog(S(fθ(xi))) (A.4b) Virtually in all cases, functions to optimize are not convex and therefore have lots of minimums. Gradient Descent algorithms are used to move the parameters of the network in small steps which size is determined by the learning rate ηin the opposite direction of the derivative of the loss. The update of the weights is shown in equation (A.5). Nevertheless, this algorithm does not necessarily achieves a global minima, meaning that suboptimal weights are typically used, but it is more important to find a minimum that generalizes well. w=w−η∇wL(A.5) In order to test if the model works well with unseen data, the whole dataset is usually chopped in three subsets for the purposes of training, validating and testing. The first one is used to optimize the model by computing its outputs and then backpropagating the error to update the weights and biases. In each iteration, the gradient is computed with either all the training dataset or a fraction of it called batch. There are also two variants of the algorithm labeled as of Stochastic Gradient Descent, when only one example is used to update the weights, and as mini-batch Gradient Descent when only a few samples are considered. These are fast algorithms but have much more variance in the update than the Gradient Descent algorithm, which means that path to the minimum is not a straight curve as depicted in figure A.3. An epoch is defined as the pass of the entire training dataset to the network, which means that in the batch case it will be equivalent to the quotient between the dataset size and the batch size. The validation set is used to fine-tune hyper-parameters of the DNN such as the number of layers or neurons. This data is therefore not explicitly used to train the model but it’s not really unseen as the parameters are chosen to minimize the loss on it. This is the reason why a third partition of truly unseen data is needed to test the model. 42 A.2. Optimization Figure A.3: Comparison between Gradient Descent algorithms from Hands-On Machine Learning with Scikit-Learn and TensorFlow chapter 4 10 20 30 40 50 60 70 80 90 100 0.2 0.4 0.6 0.8 overfitting Epochs Error Training set Validation set Figure A.4: Overview of a model with optimal weights reached at epoch 50 As it was stated before, the purpose when optimizing is to find a model that generalizes well and thus avoid overfitting. This phenomena is the production of an analysis that corresponds too closely or exactly to the training data, and may therefore fail to fit additional data or predict future observations reliably. It could be said that the model is too adapted or memorizes the training dataset, meaning that it doesn’t generalize well. Overfitting can be detected when training loss keep diminishing while validation loss grow (figure A.4). The best model is therefore attributed to the parameters which give the best results in the non-trained elements, unless in those special cases that training dataset compromises all possible occurrences. This can be solved with early stopping, which make the training stop not only when the maximum number of iterations is reached, but also when the best model from the perspective of the validation loss has not been improved in a certain number of iterations. This is a simple yet effective solution to avoid overfitting but it requires more memory as a copy of the best and last parameters. Appendix A. Neural Networks 43 A.3 Recurrent Neural Networks Recurrent Neural Networks (RNNs) and their variants have leveraged completely the sequences processing and prediction problem, which makes them lead to interesting results in the speech synthesis field, where an acoustic signal of variable length has to be generated out of a set of textual entities. The idea behind RNNs is to make use of sequential information. Hidden layers have memory cells that condition future outputs. Theoretically, the retention of an RNN can be of arbitrarily long sequences, but in practice they are limited to looking back only a few steps. A typical RNN scheme is depicted in figure A.5, where the following notation is used: •xt: Input at time step t. •st: Hidden state at time step t. It is calculated as the sum of the multiplication of the previous hidden state and the current input by a weight matrix respectively (equation (A.6)). For the computation of the first hidden state, s−1is usually initialized to all zeros st=f(Uxt+W st−1) (A.6) •ot: Output at time step t. It is calculated solely based on the memory at time t:st. s o x V U W Unfold st−1 ot−1 xt−1 st ot xt st+1 ot+1 xt+1 V U V U V U W W W W Figure A.5: Unfolded RNN representation inspired by Britz (2016) Because the parameters are shared by all time steps in the network, the gradient at each output depends not only on the calculations of the current time step, but also the previous time steps. This is called Back-Propagation Through Time (BPTT) and it basically means that, in order to compute the gradient at t,t−1 steps have to be backpropagated and then summed up. The loss with respect to the weight matrix Wcan be then computed with the rule chain based the relation of parameters expressed on equation (A.6): ∂Et ∂W= t X k=0 ∂Et ∂ot ∂ot ∂st ∂st ∂sk ∂sk ∂W The activation functions have null derivatives at both ends and it turns that the gradient values shrink exponentially fast, eventually vanishing completely after a few time steps. This is the so-called vanishing gradient problem and doesn’t allow RNN to have long-range dependencies. All kind of neural networks have the potential of generating this problem, but RNNs are especially affected because of its dependencies with all past inputs. 44 A.3. Recurrent Neural Networks (a) (b) Figure A.6: Comparison between a regular RNN (a) and a LSTM (b) (Olah,2015) The inverse case is known as the exploding gradient problem, and it basically means that gradients take enormous values and thus in long sequences taking a value of NaN (not a number). This problem is therefore obvious to detect and have simpler solutions such as clipping the gradient at a given threshold. One of the most common solutions to vanishing gradients are the Long Short-Term Memorys (LSTMs), a version of RNNs. This architecture was introduced by Hochreiter and Schmidhuber (1997) and uses a gating mechanism to capture long-term dependencies. The chain structure is the same as in simple RNNs, but the repeating module has a different structure of four layers, represented by yellow boxes in figure A.6. The cell state (red horizontal line in figure A.6b) is the key of LSTMs, and it is based on having minor linear interactions with the outputs of the sigmoid layers, also known as gates. The outputs of these three gates (named forget, input and output from left to right) are between zero and one, which describes how much of each component should be discarded or remembered. A commonly used variation of the LSTM is called Gated Recurrent Unit (GRU) and was introduced by Cho et al. (2014). Overall, this approach combines the forget and input gates into a single update gate, while the other is known as the reset gate. Moreover, GRUs merge the cell and hidden states as they don’t have an output gate. Seeing this, it’s obvious that this architecture have fewer parameters than LSTMs and this may train faster or need less data to generalize. RNNs and their variants exposed above, are a powerful tool for modeling sequential data, but the dependence of each time-step’s computation on the previous time-step’s output limits parallelism and makes RNNs unwieldy for very long sequences. Quasi-Recurrent Neural Networks (QRNNs) are the state of the art to neural sequence modeling and alternate convolutional layers (see section A.4), which apply in parallel across time-steps, and a minimalist recurrent pooling function that applies in parallel across channels. Due to their increased parallelism, they are up to 16 times faster at train and test time (Bradbury et al.,2016). Appendix B. Work Plan 51 TODAY WEEKS: 1 2345678 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 100% complete WP 4 Voice Conversion 100% complete WP 4 - T1 Bottleneck+GAN 100% complete WP 4 - T2 Training 100% complete WP 4 - T3 Evaluation 100% complete WP 5 Eigen-voice 100% complete WP 5 - T1 SPK to embedding 100% complete WP 5 - T2 Joint training 100% complete WP 5 - T3 WP3/WP4 100% complete WP 5 - T4 Discriminant 100% complete WP 6 Documentation 100% complete WP 6 - D1 Repository 100% complete WP 6 - D2 PW 100% complete WP 6 - D3 PCR 100% complete WP 6 - D4 FR FINISH-TO-START FINISH-TO-FINISH 52 C Unfolded structure of SampleRNN modules Tier 3 Tier 2 Tier 1 Ahocoder xi+80, . . . , xi+159 condi+1 Frame-Level Module Window 80 samples Speaker ID xi+140, . . . , xi+159 (128 ×1059) Frame-Level Module Take 20 last samples Embedding Number of embeddings: 256 Embedding size: 256 Conv1D Channels: 256→1024 Kernel size: 20 + Conv1D Channels: 1024→1024 Kernel size: 1 Conv1D Channels: 1024→256 Kernel size: 1 Log-Softmax P(xi+80|x<i+80) c(3) c(3) c(3) c(3) c(2) (128 ×1040 ×1024) c(2) c(2) c(2) Figure C.2: Unfolded structure of the sample level tier of the adapted model Appendix C. Unfolded structure of SampleRNN modules 53 Tier 3 Tier 2 Tier 1 Ahocoder xi, . . . , xi+79 (128 ×13 ×80) condi (128 ×13 ×43) spki (128 ×13) Conv1D Channels: 43→1024 Kernel size: 1 Conv1D Channels: 80→1024 Kernel size: 1 Embedding Number of embeddings: 6 Embedding size: 6 Conv1D Channels: 6→1024 Kernel size: 1 + GRU Input size: 1024 Hidden size: 1024 GRU Input size: 1024 Hidden size: 1024 ConvT1D Channels: 1024→1024 Kernel size: 4 Window 80 samples Speaker ID xi+60, . . . , xi+79 (128 ×52 ×20) Conv1D Channels: 20→1024 Kernel size: 1 Take 20 last samples + GRU Input size: 1024 Hidden size: 1024 GRU Input size: 1024 Hidden size: 1024 ConvT1D Channels: 1024→1024 Kernel size: 20 Sample-Level Module c(3) c(3) c(3) c(3) c(2) c(2) c(2) c(2) Figure C.1: Unfolded structure of the frame level tiers of the adapted model 54 D Resulting plots D.1 Output distributions (a) Output distribution (b) Waveform Figure D.1: Correct output distribution behavior during 1000 samples (62.5 ms) and its correspondent waveform rotated to fit the axis of (a) (a) Output distribution (b) Waveform Figure D.2: Saturated output distribution behavior during 1000 samples (62.5 ms) and its correspondent waveform rotated to fit the axis of (a) Appendix D. Resulting plots 55 D.2 Normalization plots 0 50 100 150 200 250 0 0.5 1 Sample log(f0) Speaker 75 Speaker 76 Speaker 79 Speaker 80 (a) Independent normalization 0 50 100 150 200 250 0 0.5 1 Sample log(f0) Speaker 75 Speaker 76 Speaker 79 Speaker 80 (b) Joint normalization Figure D.3: Normalized logarithmic pitch contour 0 50 100 150 200 250 0 0.5 1 Sample MV F Speaker 75 Speaker 76 Speaker 79 Speaker 80 (a) Independent normalization 0 50 100 150 200 250 0 0.5 1 Sample MV F Speaker 75 Speaker 76 Speaker 79 Speaker 80 (b) Joint normalization Figure D.4: Evolution of normalized maximum voiced frequency 56 D.2. Normalization plots 0 50 100 150 200 250 0 0.5 1 Sample MF CC(p=4) (a) Independent normalization 0 50 100 150 200 250 0 0.5 1 Sample MF CC(p=4) (b) Joint normalization Figure D.5: Evolution of normalized Mel-Frequency Cepstral Coefficient (MFCC) order 3 0 50 100 150 200 250 0 0.5 1 Sample MF CC(p=4) (a) Independent normalization 0 50 100 150 200 250 0 0.5 1 Sample MF CC(p=4) (b) Joint normalization Figure D.6: Evolution of normalized MFCC order 4 0 50 100 150 200 250 0 0.5 1 Sample MF CC(p=19) (a) Independent normalization 0 50 100 150 200 250 0 0.5 1 Sample MF CC(p=19) (b) Joint normalization Figure D.7: Evolution of normalized MFCC order 19