The embodiments relate generally to systems and methods for text-to-speech (TTS) synthesis.
Conventional speech synthesis methods generate synthesized speech through rule-based methods, various databases, and statistical methods. Existing deep learning-based speech synthesis methods requires a ‘text-voice’ pair of data as high-quality training data in order to generate speech of a specific voice based on an input text. Existing models based on deep learning have the disadvantage of not being able to perform parallel processing to generate synthesized speech and take very long training and inference times. In addition, there is a problem with unnatural speech and the inability to express various emotions. Therefore, there is a need for improved systems and methods for text-to-speech synthesis.
Conventional speech synthesis methods generate synthesized speech through rule-based methods, various databases, and statistical methods. Existing deep learning-based speech synthesis methods requires a ‘text-voice’ pair of data as high-quality training data in order to generate speech of a specific voice based on an input text. Existing models based on deep learning have the disadvantage of not being able to perform parallel processing to generate synthesized speech and take very long training and inference times. In addition, there is a problem with unnatural speech and the inability to express various emotions. Embodiments described herein provide methods capable of short inference time, natural speech, and various speakers and emotional expressions used as integrated models to solve the problems.
Embodiments described herein provide a text to speech synthesis model that allows for speaker and emotion control in real time. Encoded text is combined with vectors representing an encoded style based on an input reference spectrogram, emotion based on an input emotion ID, and speaker based on an input speaker ID. The combined vectors are input to a variance adaptor that further adapts the vector representation with appropriate pitch, energy, and duration. The encoded speech is then decoded via a decoder (e.g., a text to speech decoder followed by a vocoder) to generate an output waveform. The inclusion of additional information (reference spectrogram, emotion ID, speaker ID) allows for a more natural synthesis with control over the voice and emotion in real-time.
Embodiments described herein provide a number of benefits. For example, embodiments described herein provide a framework for real-time text to speech synthesis that allows for control of speaker and emotion. The use of convolutional neural network (CNN) based variants of transformer networks (e.g., conformer) for the encoder and decoder improves the naturalness of synthesized speech. The use of a vocoder that uses a parallel wave GAN solves differences in pronunciation by fine-tuning each dataset.
To further capture global and local dependencies, encoder 118 may further include convolutional neural network (CNN) layers into the feed-forward transformer structure. Including CNN layers to transformer structures takes into account the fact that CNN layers are more effective in generating local information beyond just sequential information. When using a structure changed from a transformer to a CNN-based transformer, the encoder 118 can generate not only sequential information of the text 102 but also information between neighboring phonemes within the text 102. Similarly, decoder 122 may use a CNN-based transformer model to generate not only sequential information of the Mel-spectrogram, but also information from nearby Mel-spectrogram frames.
The latent phoneme sequence representation may be modified by summing the vectors with additional features as illustrated. A reference voice may be input in the form of a spectrogram (e.g., a Mel-spectrogram 104). The Mel-spectrogram 104 may be input to a style encoder 112 to generate a latent representation of the style of the voice in the Mel-spectrogram 104. Mel-spectrogram 104 may represent, for example, a short audio clip of a speaker speaking a sample text in a specified emotion. The structure of style encoder 112 is described in
Similarly, speaker ID 108 may be embedded via embedding block 116 to an embedded speaker ID representation vector. For example, the speaker associated with Mel-spectrogram 104 may be indicated by speaker ID 108 (e.g., via a predefined one-hot encoding). In an example, a fixed number of emotions are supported (e.g., 5 emotions: angry, excited, happy, sad, and surprised) and a fixed number of speakers are supported (e.g., 10 distinct speakers). This may mean that speaker and emotion IDs are indicated via predefined encodings (e.g., one-hot encodings) associated with respective emotions and speakers. During the training process, speakers and their emotions for respective training audio (input as reference Mel-Spectrogram 104) may be indicated via speaker ID 108 and emotion ID 106. In some embodiments, training may be performed as described below with the speaker ID 108 and emotion ID 106 corresponding to the Mel-spectrogram 104, and at inference they may also correspond. In other embodiments, at inference, the speaker ID 108 and/or emotion ID 106 may differ from the Mel-spectrogram 104 in order to modify the output emotion or speaker accordingly.
Variance adaptor 120 may be provided an input vector representation that is a combination of the output vector of encoder 118, style encoder 112, embedding 114, and embedding 116. For example, the combination may be a sum, weighted sum, normalized sum, average, etc. of those vectors. Variance adaptor 120 may adapt the input combination vector representation to adjust pitch, energy, and duration. Details of variance adaptor 120 are described in
Decoder 122 may convert the latent vector representation from variance adaptor 120 into a playable audio waveform. In some embodiments, decoder 122 includes a Mel-spectrogram decoder that produces a Mel-spectrogram, and a vocoder that converts the Mel-spectrogram into a waveform. In some embodiments, decoder 122 directly generates a waveform from the latent vector representation from variance adaptor 120 without first generating a Mel-spectrogram. In some embodiments, positional encoding is applied to the latent vector representation so that positional information may be utilized by decoder 122 in generating the waveform. For example, a combination of sine-wave functions may be applied to the vectors so that each vector has a distinct encoding that represents the position of the vector relative to others.
After summing the input vector 202 with a pitch vector and energy vector, a duration predictor 208 may predict the duration of each phoneme as represented by the summed vector. Length regulator 210 may expand or contract the source phoneme vectors to match the length predicted by duration predictor 208. The duration of a phoneme may be changed by length regulator 210, for example, by up-sampling the phoneme sequence by increasing the number of output vectors 212 and thereby increasing the number of output vectors 212 associated with each phoneme. In some embodiments, the output vector 212 of length regulator 210 is a Mel-spectrogram, and to adjust for duration the Mel-spectrogram frames (Mel-frames) are duplicated. In some embodiments, the input vector 202 is a vector format that is not a Mel-spectrogram, and length regulator 210 converts the output to Mel-spectrogram format as part of length regulation.
Output vectors 212 may be duplicated based on the desired length as predicted by duration predictor 208. A benefit of summing pitch, energy, style, emotion ID, and/or speaker ID representations before length regulation is it has a simpler timestep, as it is related to phonemes rather than the varied output timestep after length regulation. This may result in accurate outputs using fewer resources and/or faster convergence of the models during training. For example, it may be more efficient to sum feature before length regulation in terms of computational complexity to perform calculations in a text sequence as compared to performing calculations after expanding the time sequence with Mel-spectrogram outputs. Since the length of information expressed in voice is generally longer than information expressed in text, it is more computationally efficient to perform computations on the text side of length regulation.
Returning to the description of
Memory 420 may be used to store software executed by computing device 400 and/or one or more data structures used during operation of computing device 400. Memory 420 may include one or more types of transitory or non-transitory machine-readable media (e.g., computer-readable media). Some common forms of machine-readable media may include floppy disk, flexible disk, hard disk, magnetic tape, any other magnetic medium, CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, RAM, PROM, EPROM, FLASH-EPROM, any other memory chip or cartridge, and/or any other medium from which a processor or computer is adapted to read.
Processor 410 and/or memory 420 may be arranged in any suitable physical arrangement. In some embodiments, processor 410 and/or memory 420 may be implemented on a same board, in a same package (e.g., system-in-package), on a same chip (e.g., system-on-chip), and/or the like. In some embodiments, processor 410 and/or memory 420 may include distributed, virtualized, and/or containerized computing resources. Consistent with such embodiments, processor 410 and/or memory 420 may be located in one or more data centers and/or cloud computing facilities.
In some examples, memory 420 may include non-transitory, tangible, machine readable media that includes executable code that when run by one or more processors (e.g., processor 410) may cause the one or more processors to perform the methods described in further detail herein. For example, as shown, memory 420 includes instructions for text-to-speech (TTS) module 430 that may be used to implement and/or emulate the systems and models, and/or to implement any of the methods described further herein.
TTS module 430 may receive input 440 such as text input, reference audio or Mel-spectrogram, speaker ID, and/or emotion ID and generate an output 450 such as a generated Mel-spectrogram or audio waveform. For example, TTS module 430 may be configured to perform text to speech synthesis based on a specified emotion and speaker.
The data interface 415 may comprise a communication interface, a user interface (such as a voice input interface, a graphical user interface, and/or the like). For example, the computing device 400 may receive the input 440 from a networked device via a communication interface. Or the computing device 400 may receive the input 440, such as speaker ID, etc., from a user via the user interface.
Some examples of computing devices, such as computing device 400 may include non-transitory, tangible, machine readable media that include executable code that when run by one or more processors (e.g., processor 410) may cause the one or more processors to perform the processes of method. Some common forms of machine-readable media that may include the processes of method are, for example, floppy disk, flexible disk, hard disk, magnetic tape, any other magnetic medium, CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, RAM, PROM, EPROM, FLASH-EPROM, any other memory chip or cartridge, and/or any other medium from which a processor or computer is adapted to read.
For example, the neural network architecture may comprise an input layer 541, one or more hidden layers 542 and an output layer 543. Each layer may comprise a plurality of neurons, and neurons between layers are interconnected according to a specific topology of the neural network topology. The input layer 541 receives the input data such as training data, user input data, vectors representing latent features, etc. The number of nodes (neurons) in the input layer 541 may be determined by the dimensionality of the input data (e.g., the length of a vector of the input). Each node in the input layer represents a feature or attribute of the input.
The hidden layers 542 are intermediate layers between the input and output layers of a neural network. It is noted that two hidden layers 542 are shown in
For example, as discussed in
The output layer 543 is the final layer of the neural network structure. It produces the network's output or prediction based on the computations performed in the preceding layers (e.g., 541, 542). The number of nodes in the output layer depends on the nature of the task being addressed. For example, in a binary classification problem, the output layer may consist of a single node representing the probability of belonging to one class. In a multi-class classification problem, the output layer may have multiple nodes, each representing the probability of belonging to a specific class.
Therefore, the TTS module 430 may comprise the transformative neural network structure of layers of neurons, and weights and activation functions describing the non-linear transformation at each neuron. Such a neural network structure is often implemented on one or more hardware processors 410, such as a graphics processing unit (GPU).
In one embodiment, the TTS module 430 may be implemented by hardware, software and/or a combination thereof. For example, the TTS module 430 may comprise a specific neural network structure implemented and run on various hardware platforms 560, such as but not limited to CPUs (central processing units), GPUs (graphics processing units), FPGAs (field-programmable gate arrays), Application-Specific Integrated Circuits (ASICs), dedicated AI accelerators like TPUs (tensor processing units), and specialized hardware accelerators designed specifically for the neural network computations described herein, and/or the like. Example specific hardware for neural network structures may include, but not limited to Google Edge TPU, Deep Learning Accelerator (DLA), NVIDIA AI-focused GPUs, and/or the like. The hardware 560 used to implement the neural network structure is specifically configured based on factors such as the complexity of the neural network, the scale of the tasks (e.g., training time, input data scale, size of training dataset, etc.), and the desired performance.
In one embodiment, the neural network based TTS module 430 may be trained by iteratively updating the underlying parameters (e.g., weights 551, 552, etc., bias parameters and/or coefficients in the activation functions 561, 562 associated with neurons) of the neural network based on a loss function. For example, during forward propagation, the training data such as text with associated audio recordings labeled with speaker ID and emotion ID are fed into the neural network. The data flows through the network's layers 541, 542, with each layer performing computations based on its weights, biases, and activation functions until the output layer 543 produces the network's output 550. In some embodiments, output layer 543 produces an intermediate output on which the network's output 550 is based.
The output generated by the output layer 543 is compared to the expected output (e.g., a “ground-truth” such as the corresponding ground truth audio waveform or Mel-spectrogram) from the training data, to compute a loss function that measures the discrepancy between the predicted output and the expected output. Given a loss function, the negative gradient of the loss function is computed with respect to each weight of each layer individually. Such negative gradient is computed one layer at a time, iteratively backward from the last layer 543 to the input layer 541 of the neural network. These gradients quantify the sensitivity of the network's output to changes in the parameters. The chain rule of calculus is applied to efficiently calculate these gradients by propagating the gradients backward from the output layer 543 to the input layer 541.
Parameters of the neural network are updated backwardly from the last layer to the input layer (backpropagating) based on the computed negative gradient using an optimization algorithm to minimize the loss. The backpropagation from the last layer 543 to the input layer 541 may be conducted for a number of training samples in a number of iterative training epochs. In this way, parameters of the neural network may be gradually updated in a direction to result in a lesser or minimized loss, indicating the neural network has been trained to generate a predicted output value closer to the target output value with improved prediction accuracy. Training may continue until a stopping criterion is met, such as reaching a maximum number of epochs or achieving satisfactory performance on the validation data. At this point, the trained network can be used to make predictions on new, unseen data, such as unseen text input.
Neural network parameters may be trained over multiple stages. For example, initial training (e.g., pre-training) may be performed on one set of training data, and then an additional training stage (e.g., fine-tuning) may be performed using a different set of training data. In some embodiments, all or a portion of parameters of one or more neural-network model being used together may be frozen, such that the “frozen” parameters are not updated during that training phase. This may allow, for example, a smaller subset of the parameters to be trained without the computing cost of updating all of the parameters.
The neural network illustrated in
Through the training process, the neural network is “updated” into a trained neural network with updated parameters such as weights and biases. The trained neural network may be used in inference to perform the tasks described herein, for example those performed by module 430. The trained neural network thus improves neural network technology in text-to-speech synthesis.
User device 610, data server 670, and model server 640 may each include one or more processors, memories, and other appropriate components for executing instructions such as program code and/or data stored on one or more computer readable mediums to implement the various applications, data, and steps described herein. For example, such instructions may be stored in one or more computer readable media such as memories or data storage devices internal and/or external to various components of system 600, and/or accessible over network 660. User device 610, data server 670, and/or model server 640 may be a computing device 400 (or similar) as described herein.
In some embodiments, all or a subset of the actions described herein may be performed solely by user device 610. In some embodiments, all or a subset of the actions described herein may be performed in a distributed fashion by various network devices, for example as described herein.
User device 610 may be implemented as a communication device that may utilize appropriate hardware and software configured for wired and/or wireless communication with data server 670 and/or the model server 640. For example, in one embodiment, user device 610 may be implemented as an autonomous driving vehicle, a personal computer (PC), a smart phone, laptop/tablet computer, wristwatch with appropriate computer hardware resources, eyeglasses with appropriate computer hardware (e.g., GOOGLE GLASS®), other type of wearable computing device, implantable communication devices, and/or other types of computing devices capable of transmitting and/or receiving data, such as an IPAD® from APPLER. Although only one communication device is shown, a plurality of communication devices may function similarly.
User device 610 of
In various embodiments, user device 610 includes other applications as may be desired in particular embodiments to provide features to user device 610. For example, other applications may include security applications for implementing client-side security features, programmatic client applications for interfacing with appropriate application programming interfaces (APIs) over network 660, or other types of applications. Other applications may also include communication applications, such as email, texting, voice, social networking, and IM applications that allow a user to send and receive emails, calls, texts, and other notifications through network 660.
Network 660 may be a network which is internal to an organization, such that information may be contained within secure boundaries. In some embodiments, network 660 may be a wide area network such as the internet. In some embodiments, network 660 may be comprised of direct physical connections between the devices. In some embodiments, network 660 may represent communication between different portions of a single device (e.g., a communication bus on a motherboard of a computation device).
Network 660 may be implemented as a single network or a combination of multiple networks. For example, in various embodiments, network 660 may include the Internet or one or more intranets, landline networks, wireless networks, and/or other appropriate types of networks. Thus, network 660 may correspond to small scale communication networks, such as a private or local area network, or a larger scale network, such as a wide area network or the Internet, accessible by the various components of system 600.
User device 610 may further include database 618 stored in a transitory and/or non-transitory memory of user device 610, which may store various applications and data (e.g., model parameters) and be utilized during execution of various modules of user device 610. Database 618 may store reference audio/Mel-spectrograms, model parameters, etc. In some embodiments, database 618 may be local to user device 610. However, in other embodiments, database 618 may be external to user device 610 and accessible by user device 610, including cloud storage systems and/or databases that are accessible over network 660 (e.g., on data server 670).
User device 610 may include at least one network interface component 617 adapted to communicate with data server 670 and/or model server 640. In various embodiments, network interface component 617 may include a DSL (e.g., Digital Subscriber Line) modem, a PSTN (Public Switched Telephone Network) modem, an Ethernet device, a broadband device, a satellite device and/or various other types of wired and/or wireless network communication devices including microwave, radio frequency, infrared, Bluetooth, and near field communication devices.
Data Server 670 may perform some of the functions described herein. For example, data server 670 may store a training dataset including training audio, text, emotion IDs, speaker IDs, etc. Data server 670 may provide data to user device 610 and/or model server 640. For example, training data may be stored on data server 670 and that training data may be retrieved by model server 640 while training a model stored on model server 640.
Model server 640 may be a server that hosts models described herein. Model server 640 may provide an interface via network 660 such that user device 610 may perform functions relating to the models as described herein (e.g., text-to-speech synthesis). Model server 640 may communicate outputs of the models to user device 610 via network 660. User device 610 may display model outputs, or information based on model outputs, via a user interface to user 650.
As illustrated, the method 700 includes a number of enumerated steps, but aspects of the method 700 may include additional steps before, after, and in between the enumerated steps. In some aspects, one or more of the enumerated steps may be omitted or performed in a different order.
At step 702, a system (e.g., computing device 400, user device 610, model server 640, device 800, or device 815) receives, via a data interface (e.g., data interface 415, network interface 617, or an interface to a microphone and/or text input device) an input text (e.g., text 102), a reference spectrogram (e.g., Mel-spectrogram 104), and at least one of an emotion ID (e.g., emotion ID 106) or speaker ID (e.g., speaker ID 108).
At step 704, the system generates, via a first encoder (e.g., encoder 118), a vector representation of the input text. In some embodiments, the generating the vector representation of the input text includes generating a sequence of phoneme embeddings (e.g., phoneme embedding 110). In some embodiments, the first encoder includes at least one CNN layer and at least one self-attention layer.
At step 706, the system generates, via a second encoder (e.g., style encoder 112), a vector representation of the reference spectrogram.
At step 708, the system generates, via a variance adaptor (e.g., variance adaptor 120), a modified vector representation based on a combined representation including a combination of the vector representation of the input text, the vector representation of the reference spectrogram, and at least one of an embedding of the emotion ID or an embedding of the speaker ID. In some embodiments, the modified vector representation is a Mel-Spectrogram. In some embodiments, the modified vector representation may be duplicated by the variance adaptor according to a predicted duration of the related phoneme. For example, in some embodiments, generating the modified vector representation includes generating a duration prediction based on the combined representation, and duplicating the modified vector representation based on the predicted duration. In some embodiments, the variance adaptor generates at least one of a vector representation of a pitch prediction or a vector representation of an energy prediction based on the combined representation. The generating the modified vector representation may be based on a combination of the combined representation and at least one of the vector representation of the energy prediction or the vector representation of the pitch prediction.
At step 710, the system generates, via a decoder (e.g., decoder 122), an audio waveform based on the modified vector representation. In some embodiments, the decoder includes at least one CNN layer and at least one self-attention layer.
In some embodiments, method 700 may further include updating parameters (i.e., training) of at least one of the first encoder, the second encoder, the variance adaptor, or the decoder via backpropagation based on a comparison of the modified vector representation to a ground truth vector representation. In some embodiments, this is a mean square error comparison of Mel-spectrograms.
Device 800 may include one or more microphones, and one or more image-capture devices (not shown) for user interaction. Device 800 may be connected to a network (e.g., network 660). Digital Avatar 810 may be controlled via local software and/or through software that is at a central server accessed via a network. For example, an AI model may be used to control the behavior of digital avatar 810, and that AI model may be run remotely. In some embodiments, device 800 may be configured to perform functions described herein (e.g., via digital avatar 810). For example, device 800 may perform one or more of the functions as described with reference to computing device 400 or user device 610. For example, text to speech synthesis.
Digital avatar 835 may interact with a user via digitally synthesized gestures, digitally synthesized voice, etc. Voice synthesis may be performed as described in
The devices described above may be implemented by one or more hardware components, software components, and/or a combination of the hardware components and the software components. For example, the device and the components described in the exemplary embodiments may be implemented, for example, using one or more general purpose computers or special purpose computers such as a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a programmable logic unit (PLU), a microprocessor, or any other device which executes or responds instructions. The processing device may perform an operating system (OS) and one or more software applications which are performed on the operating system. Further, the processing device may access, store, manipulate, process, and generate data in response to the execution of the software. For ease of understanding, it may be described that a single processing device is used, but those skilled in the art may understand that the processing device includes a plurality of processing elements and/or a plurality of types of the processing element. For example, the processing device may include a plurality of processors or include one processor and one controller. Further, another processing configuration such as a parallel processor may be implemented.
The software may include a computer program, a code, an instruction, or a combination of one or more of them, which configure the processing device to be operated as desired or independently or collectively command the processing device. The software and/or data may be interpreted by a processing device or embodied in any tangible machines, components, physical devices, computer storage media, or devices to provide an instruction or data to the processing device. The software may be distributed on a computer system connected through a network to be stored or executed in a distributed manner The software and data may be stored in one or more computer readable recording media.
The method according to the exemplary embodiment may be implemented as a program instruction which may be executed by various computers to be recorded in a computer readable medium. At this time, the medium may continuously store a computer executable program or temporarily store it to execute or download the program. Further, the medium may be various recording means or storage means to which a single or a plurality of hardware is coupled and the medium is not limited to a medium which is directly connected to any computer system, but may be distributed on the network. Examples of the medium may include magnetic media such as hard disk, floppy disks and magnetic tapes, optical media such as CD-ROMs and DVDs, magneto-optical media such as optical disks, and ROMs, RAMS, and flash memories to be specifically configured to store program instructions. Further, an example of another medium may include a recording medium or a storage medium which is managed by an app store which distributes application, a site and servers which supply or distribute various software, or the like.
Although the exemplary embodiments have been described above by a limited embodiment and the drawings, various modifications and changes can be made from the above description by those skilled in the art. For example, even when the above-described techniques are performed by different order from the described method and/or components such as systems, structures, devices, or circuits described above are coupled or combined in a different manner from the described method or replaced or substituted with other components or equivalents, the appropriate results can be achieved. It will be understood that many additional changes in the details, materials, steps and arrangement of parts, which have been herein described and illustrated to explain the nature of the subject matter, may be made by those skilled in the art within the principle and scope of the invention as expressed in the appended claims.
The instant application is a nonprovisional of and claim priority under 35 U.S.C. 119 to U.S. provisional application No. 63/457,630, filed Apr. 6, 2023, which is hereby expressly incorporated by reference herein in its entirety.
Number | Date | Country | |
---|---|---|---|
63457630 | Apr 2023 | US |