A Generative Adversarial Network Speech Conversion Method Based on Dynamic Parameter Adjustment
By introducing parameter dynamic adjustment technology into the generative adversarial network, the distortion and noise problems of feature capture and retention in speech conversion are solved. Especially in non-parallel corpus scenarios, the quality of speech conversion is improved and more natural and high-quality speech is achieved. Voice conversion effect.
Patent Information
- Application Number
- CN202410924703.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-11
AI Technical Summary
Existing speech conversion technology has distortion and noise problems in capturing and retaining the speaker's speech characteristics. Especially in non-parallel corpus scenarios, it is difficult to obtain completely parallel speech data, which affects the quality of conversion.
Using a generative adversarial network based on dynamic parameter adjustment, through feature extraction, batch normalization, self-attention mechanism, adaptive average pooling and regularization technology, the speech features are dynamically adjusted to enhance the robustness and generalization ability of the model. Generate more natural and high-quality speech.
It improves the quality of speech conversion, especially in non-parallel corpus scenarios, enhances the performance of traditional models, and enhances the correlation between input features by dynamically adjusting parameters to ensure more natural and high-quality speech conversion.
Smart Images

Figure CN118486313B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of speech style conversion, and more specifically, to a generative adversarial network speech conversion method and system based on dynamic parameter adjustment. Background Art
[0002] Voice conversion is an important technology in intelligent voice technology. Its goal is to convert the voice of one speaker into the voice of another speaker, or to change the voice characteristics of the speaker, such as gender, age, emotion, etc. This technology has a wide range of applications, including personalized speech synthesis, oral assistance systems, video game simulation character sound design, film and television dubbing and other fields.
[0003] There are some technical difficulties in speech conversion technology. The first difficulty is speech feature modeling. Speech signals are highly complex time series data, covering a wealth of speech features. Due to the differences between different speakers, it is a challenge to effectively capture and model these features. In addition, although some current speech conversion methods have achieved conversion between different speakers, the conversion quality is lacking. The main reason is that there are distortions and noises in the speech conversion process, especially when the model does not have enough training data or faces a multi-speaker scenario, the problem is more obvious. In addition, speech conversion similarity is an important reference indicator for us to evaluate speech quality, including speaker-specific information such as timbre and pitch. How to better capture and retain the speech features of the target speaker is an important challenge. Although the speech conversion algorithm based on parallel corpus has achieved good conversion results, it is difficult to collect large-scale parallel corpus. In most practical scenarios, it is difficult for us to obtain completely parallel speech data. Therefore, speech conversion research based on non-parallel corpus scenarios has more important technical value and practical significance. In the case of non-parallel corpus, there does not need to be a one-to-one correspondence between the source speech and the target speech in the training set. Non-parallel corpus involves speech data from different speakers, different speech contents, and even across languages. It can meet most practical application scenarios and is more universal in practical applications. Summary of the invention
[0004] In order to solve the above technical problems, the present invention proposes a generative adversarial network voice conversion method and system based on dynamic parameter adjustment.
[0005] The first aspect of the present invention provides a method for generating adversarial network voice conversion based on dynamic parameter adjustment, comprising:
[0006] Step S01: In the feature extraction stage, the fundamental frequency F0, spectrum envelope SP and non-periodic component AP of the speaker's speech are extracted frame by frame from the speech sample, and the 36-dimensional encoded spectrum envelope (Coded_SP) is calculated to obtain the mean, standard deviation and regularized encoded spectrum envelope list of the fundamental frequency. 128 frames are intercepted from the speech samples of speaker A and speaker B respectively to generate random data pairs (Dataset). Therefore, the dimension of each sample X is [1,36,128], and then X is mapped to [1,128,36,128] dimensions through a 2d convolutional layer. The 128 output channels mean that the network extracts 128 different feature maps from the original single-channel input. Multi-channel feature representation helps the model capture complex and detailed audio characteristics and provide a richer information basis for style transfer.
[0007] Step S02: Use the batch normalization (BatchNorm2d) method to independently normalize each input feature tensor X to obtain the normalized feature tensor Y. By normalizing the data of each batch to maintain the stability of the input distribution, it helps to speed up the training speed and increase the convergence of the model.
[0008] Step S03: The feature tensor Y is dot-producted using the query, key, and value convolution layers to obtain the output Z of the self-attention layer.
[0009] Step S04: Input the normalized feature tensor Y into the adaptive average pooling layer, reduce the spatial dimensions (width and height) of each feature channel to 1x1, and obtain the pooled feature tensor L. Compress the entire feature map into a single numerical representation, providing a global context feature for each channel.
[0010] Step S05: A convolution operation is performed on the pooled tensor L feature map through a convolution layer to obtain a feature tensor M to map it to the same dimensional space as the input feature map.
[0011] Step S06: The feature tensor M obtained by the convolution operation is nonlinearly transformed through the Sigmoid activation function to obtain the tensor representation N of gamma, so as to ensure that the generated gamma value is within the range of (0, 1).
[0012] Step S07: Use regularization technology (Dropout) to adjust the attention Z output to increase the robustness of the model.
[0013] Step S08: The dynamically adjusted gamma value N is weighted on the self-attention layer output Z to obtain the final output P, so that the model can learn more complex speech representations.
[0014] Step S09: Load statistical information, convert the fundamental frequency of speaker A into the fundamental frequency information of speaker B, use the model file obtained in the training process to perform speech conversion, and finally use the WORLD vocoder to synthesize audio with F0, Coded_SP and AP speech features to generate the converted target speaker's speech.
[0015] In this solution, step S02 is specifically as follows:
[0016] ;
[0017] in, and are the mean and variance of the batch data, is a small constant, and are the learned parameters, is the scaling factor used to adjust the scale of the normalized data, The parameters allow the model to learn how widely the data should be distributed, controlling the variance of the data. is the translation parameter, which is used to adjust the mean of the normalized data. and The learning process is completed through the back propagation of the network, which is used to scale and translate the normalized data respectively.
[0018] First, input the feature tensor , where the dimensions are expressed as: is the batch size, is the number of channels, is the height, For each channel in the input feature tensor X, the mean and variance of all elements of the channel are calculated, that is, in the spatial dimension (that is, all elements of each channel). pixels) to calculate the mean and variance.
[0019] ;
[0020] ;
[0021] in, Indicates Channels at position The pixel value of .
[0022] Each element of each channel is then normalized using the calculated mean and variance.
[0023] ;
[0024] Finally, we use the learnable parameters to scale and translate the normalized data to get the output of the batch normalization layer. .
[0025] ;
[0026] In this solution, step S03 is specifically as follows:
[0027] First, the feature tensor Generate queries through convolutional layers ,key Sum .
[0028] ;
[0029] in, is a convolutional layer with a kernel size of 1x1 and resized to .
[0030] ;
[0031] is a convolutional layer, and the output dimension is adjusted to .
[0032] ;
[0033] The same convolutional layer adjusts the dimension of the generated V to ; Then, calculate the self-attention score:
[0034] ;
[0035] Here the matrix multiplication is to calculate the dot product at all positions of each sample. Then use Function calculation attention weight (Attention Map):
[0036] ;
[0037] in, represents an element in the score matrix, and the denominator is the value of all possible (i.e., all elements in the row Finally, the attention weights are applied to the values Get the weight output Z of the self-attention mechanism.
[0038] ;
[0039] In this solution, step S04 is specifically as follows:
[0040] The input feature tensor After the adaptive average pooling layer, the normalized feature tensor is obtained .
[0041] ;
[0042] in, Indicates the channel, Indicates that the channel is at position The above formula calculates the value of the input channel The average value of all elements in .
[0043] In this solution, step S05 is specifically as follows:
[0044] For the size of the input feature , using the 2d convolutional layer nn.Conv2d( , , kernel_size=1) for convolution, the calculation is as follows:
[0045] ;
[0046] in, represents the output feature tensor after the convolution operation, is the output channel index, is the input channel index, is the batch index, Indicates that the input feature tensor is in batches ,aisle ,high and width The value of . It is The input channel pairs The weights of the 1×1 convolution kernels for the output channels, It is The bias term for each output channel.
[0047] In this solution, step S06 is specifically as follows:
[0048] The output of the 2d convolutional layer nn.Conv2d is . Then, apply the following function to each element of M:
[0049] ;
[0050] Finally, the function outputs a value between 0 and 1 in each dimension.
[0051] In this solution, step S07 is specifically as follows:
[0052] The attention output Z is adjusted using regularization techniques to obtain the result D to increase the robustness of the model. The adjustment process is as follows: for each input element, the probability Generates a mask that determines which elements will be set to zero. Specifically, for each input element (all dimensions), generate a random number ,like ,but (That is, the element is "discarded" or set to zero). Otherwise, (That is, the element is retained.) On small data sets, Dropout is used as a regularization method to randomly set some neurons in the network to zero, so that the network can learn more robust features and prevent the model from overfitting on the training data.
[0053] In this solution, step S08 is specifically as follows:
[0054] After calculating the attention output Z, the regularization technique Dropout is applied to increase the generalization ability of the model, and then the dynamic The parameter M is used to adjust the attention output, and then added to the input original feature X to get the final output P. Specifically:
[0055] ;
[0056] In the above formula, M is the calculated dynamic adjustment parameter gamma, D is the output of the self-attention mechanism after the regularization adjustment layer, and X is the original feature tensor. After obtaining the final output P, the data P is input into the downsampling module of the generative adversarial network for model training.
[0057] In this solution, step S09 is specifically as follows:
[0058] The fundamental frequency F0, spectral envelope SP, non-periodic parameters AP and encoded spectral envelope information are extracted in the same manner as in step S01, and then the trained generative model is used to convert the speech style. Finally, the converted features are resynthesized into an audio signal. The converted features include the fundamental frequency, spectral envelope and non-periodic parameters, and the model outputs the corresponding features of the target style.
[0059] The second aspect of the present invention also provides a generative adversarial network speech conversion system based on dynamic parameter adjustment, the system comprising: a speech feature extraction module, a model training module, and a speech conversion module, the system being used to execute any step of the generative adversarial network speech conversion method based on dynamic parameter adjustment.
[0060] The invention discloses a speech conversion method of a generative adversarial network based on dynamic parameter adjustment. In the feature extraction stage, the fundamental frequency, spectrum envelope and non-periodic features of speech are extracted. In the training stage, first, the input feature tensor is batch normalized, and the normalized speech data is processed by the dot product of the query, key and value convolution layers to obtain the output of the self-attention layer, and then the global information is aggregated through the adaptive average pooling layer. Secondly, the pooled feature tensor is convolved through the convolution layer, and the result of the convolution operation is nonlinearly transformed through the Sigmoid activation function to obtain the gamma adjustment parameter. Then, the regularization technology (Dropout) is used to increase the robustness of the model. Finally, a dynamic gamma value is generated by adaptive average pooling and convolution operations to adjust the intensity of attention output. By weighting the speech spectrum features, the correlation between the input features is strengthened, which helps to generate more natural and higher quality speech. In the conversion stage, the trained generation model is used to convert the speech style, and the target speaker's speech is synthesized by the vocoder. The present invention combines the speaker's spectral envelope characteristics with the dynamic parameter gamma value to assist in training, enhances the long-distance dependency between input features, and improves the performance of the traditional speech conversion model. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments or exemplary embodiments of the present invention, the following will describe the embodiments.
[0062] The drawings required for the exemplary description are briefly introduced. Obviously, the drawings in the following description are
[0063] The figures are only some embodiments of the present invention. For ordinary technicians in this field,
[0064] On the premise of labor, other drawings can also be obtained as shown in these drawings.
[0065] Figure 1 The present invention shows a method for generating adversarial network voice conversion based on dynamic parameter adjustment;
[0066] Figure 2 A comparison diagram between the method provided by the present invention and the traditional method is shown;
[0067] Figure 3 A flow chart of the method of the training phase of the present invention is shown;
[0068] Figure 4 A method flow chart of the conversion phase of the present invention is shown. DETAILED DESCRIPTION
[0069] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0070] In the following description, many specific details are set forth to provide a thorough understanding of the present invention; however, the present invention
[0071] The present invention may also be implemented in other ways different from those described herein, and therefore, the protection scope of the present invention is not limited to the following.
[0072] It is not limited to the specific embodiments disclosed below.
[0073] Example 1
[0074] Figure 1 A flow chart of a method for generating adversarial network speech conversion based on dynamic parameter adjustment of the present invention is shown.
[0075] like Figure 1 As shown, the first aspect of the present invention provides a method for generating adversarial network voice conversion based on dynamic parameter adjustment, comprising:
[0076] Step S01: In the feature extraction stage, extract the speaker's voice fundamental frequency F0, spectrum envelope SP and non-periodic component AP frame by frame, and extract the m-dimensional coded spectrum envelope (Coded_SP). Get the mean, standard deviation and regularized list of the fundamental frequency. Take n frames from each of the speech samples of speaker A and speaker B, generate random data pairs (Dataset) as input feature X, and then map X to dimension, where c is the number of output feature channels. The network extracts a variety of different feature maps from the original single-channel input. Multi-channel feature representation helps the model capture complex and detailed audio characteristics and provide a richer information basis for style transfer.
[0077] Step S02: Use the batch normalization (BatchNorm2d) method to independently normalize each input feature tensor X to obtain a normalized feature tensor Y.
[0078] Step S03: The feature tensor Y is dot-producted using the query, key, and value convolution layers to obtain the output feature tensor Z of the self-attention layer.
[0079] Step S04: Input the normalized feature tensor Y into the adaptive average pooling layer, reduce the spatial dimensions (width and height) of each feature channel to 1x1, and obtain the pooled feature tensor L. Compress the entire feature map into a single numerical representation, providing a global context feature for each channel.
[0080] Step S05: A convolution operation is performed on the pooled tensor L feature map through a convolution layer to obtain a feature tensor M to map it to the same dimensional space as the input feature map.
[0081] Step S06: The feature tensor M obtained by the convolution operation is nonlinearly transformed through the Sigmoid activation function to obtain the tensor representation N of gamma, so as to ensure that the generated gamma value is within the range of (0, 1).
[0082] Step S07: Use regularization technology (Dropout) to adjust the attention output Z to increase the robustness of the model.
[0083] Step S08: The dynamically adjusted gamma value N is weighted on the self-attention layer output Z to obtain the final output P, so that the model can learn more complex speech representations.
[0084] Step S09: Load statistical information, convert the fundamental frequency of speaker A into the fundamental frequency information of speaker B, use the model file obtained in the training process to perform speech conversion, and finally use the WORLD vocoder to synthesize audio with F0, Coded_SP and AP speech features to generate the converted target speaker's speech.
[0085] It should be noted that the step S02 is specifically as follows:
[0086] ;
[0087] in, and are the mean and variance of the batch data, is a small constant, and are the learned parameters, is the scaling factor used to adjust the scale of the normalized data, The parameter allows the model to learn how wide the data should be distributed, which is used to control the variance of the data. During the training process, the network can learn that different feature channels should have different distribution ranges. By adjusting the value to achieve. is the translation parameter, which is used to adjust the mean of the normalized data. and The learning process is completed through the back propagation of the network, which is used to scale and translate the normalized data respectively.
[0088] First, input the feature tensor , where the dimensions are expressed as: is the batch size, is the number of channels, is the height, For each channel in the input feature tensor X, the mean and variance of all elements of the channel are calculated, that is, in the spatial dimension (that is, all elements of each channel). pixels) to calculate the mean and variance.
[0089] ;
[0090] ;
[0091] in, Indicates Channels at position Then, each element of each channel is normalized using the calculated mean and variance.
[0092] ;
[0093] Finally, we use the learnable parameters to scale and translate the normalized data to get the output of the batch normalization layer. .
[0094] ;
[0095] in, Representative Channels at position The output, and Represents scaling parameters and translation parameters; , respectively represent the dimension values corresponding to the output of the batch normalization layer, which are batch size, number of channels, height, and width.
[0096] It should be noted that the step S03 is specifically as follows:
[0097] The feature tensor The output Z of the self-attention layer is obtained by performing dot products on the query, key, and value convolutional layers.
[0098] It should be noted that the step S04 is specifically as follows:
[0099] The input feature tensor After the adaptive average pooling layer, the normalized feature tensor is obtained .
[0100] ;
[0101] in, Indicates the channel, Indicates that the channel is at position The above formula calculates the value of the input channel The average value of all elements in .
[0102] It should be noted that the step S05 is specifically as follows:
[0103] For the size of the input feature , using the 2d convolutional layer nn.Conv2d( , , kernel_size=1) for convolution, the calculation is as follows:
[0104] ;
[0105] in, represents the output feature tensor after the convolution operation, is the output channel index, is the input channel index, is the batch index, Indicates that the input feature tensor is in batches ,aisle ,high and width The value of . It is The input channel pairs The weights of the 1×1 convolution kernels for the output channels, It is The bias term for each output channel.
[0106] It should be noted that the step S06 is specifically as follows:
[0107] The output of nn.Conv2d is (where b is the batch index, c is the channel index, and h and w are indices of the spatial dimensions.) Then, the following function is applied to each element of M:
[0108] ;
[0109] Finally, the function outputs a value between 0 and 1 in each dimension.
[0110] It should be noted that the step S07 is specifically as follows:
[0111] The attention output Z is adjusted using regularization techniques to obtain the result D to increase the robustness of the model. The adjustment process is as follows: for each input element, the probability Generates a mask that determines which elements will be set to zero. Specifically, for each input element (all dimensions), generate a random number ,like ,but (That is, the element is "discarded" or set to zero). Otherwise, (That is, the element is retained.) On small data sets, Dropout is used as a regularization method to randomly set some neurons in the network to zero, so that the network can learn more robust features and prevent the model from overfitting on the training data.
[0112] It should be noted that the step S08 is specifically as follows:
[0113] After calculating the attention output Z, the regularization technique Dropout is applied to increase the generalization ability of the model, and then the dynamic The parameter M is used to adjust the attention output, and then added to the input original feature X to get the final output P. Specifically:
[0114] ;
[0115] In the above formula, M is the calculated dynamic adjustment parameter gamma, D is the output of the self-attention mechanism after the regularization adjustment layer, and X is the original feature tensor. After obtaining the final output P, the data P is input into the downsampling module of the generative adversarial network for model training.
[0116] It should be noted that the step S09 is specifically as follows:
[0117] The fundamental frequency F0, spectral envelope SP, non-periodic parameters AP and encoded spectral envelope information are extracted in the same manner as in step S01, and then the trained generative model is used to convert the speech style. Finally, the converted features are resynthesized into an audio signal. The converted features include the fundamental frequency, spectral envelope and non-periodic parameters, and the model outputs the corresponding features of the target style.
[0118] Example 2
[0119] Figure 2 A comparison diagram between the method provided by the present invention and the traditional method is shown;
[0120] Figure 3 A flow chart of the method of the training phase of the present invention is shown;
[0121] In this embodiment, the basic features of the speaker's speech are extracted and the speech style conversion is implemented using the provided method, and the method is compared with the traditional recurrent generative adversarial network method.
[0122] The present invention provides a method for generating adversarial network voice conversion based on dynamic parameter adjustment, the steps of which are as follows:
[0123] Step S01: In the feature extraction stage, extract the speaker's voice fundamental frequency F0, spectrum envelope SP and non-periodic component AP frame by frame, and extract the m-dimensional coded spectrum envelope (Coded_SP). Get the mean, standard deviation and regularized list of the fundamental frequency. Take n frames from each of the speech samples of speaker A and speaker B, generate random data pairs (Dataset) as input feature X, and then map X to 2D convolution layer. dimension, where c is the number of output feature channels. The network extracts a variety of different feature maps from the original single-channel input. Multi-channel feature representation helps the model capture complex and detailed audio characteristics and provide a richer information basis for style transfer.
[0124] The proposed method is compared with the traditional CycleGAN-VC2 in speech conversion of non-parallel data on the VCC2018 dataset. Four groups of speech samples are selected, each containing two speakers, speaker A and speaker B. 81 sentences are used for training and 35 sentences are used for testing (each audio is about 3~5s), the sampling rate is 16000Hz, and the frame shift is 5ms. Including SM2->SM1, TS1->SF3, SM3->TF1, SF1->SM1, where F represents female and M represents male. The experimental results cover the conversion between the same sex and the opposite sex.
[0125] In this experiment, the spectrum envelope feature m is extracted as 36-dimensional, and the speech frames n are intercepted from the speech samples of speaker A and speaker B as 128, which are used to load training data and generate random data pairs (Dataset) as input features X, so the input of X is (1,36,128). Then, 2d convolution is used to map it to X[1,128,36,128] for training.
[0126] Step S02: perform batch normalization on the input feature X.
[0127] ;
[0128] in, and are the mean and variance of the batch data, is a small constant (for numerical stability, this experiment takes ), and is the learned parameter, and Initialized to 1, Initialized to 0, so This ensures that the batch normalization layer does not make any changes to the scale of the activations during the initial stages of training. In the initial state, the normalized output will directly map back to its original standard deviation, because the normalization operation normalizes the input to a distribution with mean 0 and variance 1, and then multiplies it by will not change the scale of the distribution. Initializing to 0 means that in the initial stage of training, the batch normalization layer does not adjust the mean position of the activations. and The learning process is completed through the back propagation of the network, which is used to scale and translate the normalized data respectively.
[0129] First, input the feature tensor , where the dimensions from left to right are: 1 batch size, 128 channels, 36 for height, and 128 for width of feature map. For each channel in the input feature tensor X, the mean and variance of all elements of the channel are calculated, that is, the mean and variance are calculated in the spatial dimension (that is, all 36x128 pixels of each channel).
[0130] ;
[0131] in, Indicates Channels at position The pixel value of .
[0132] Each element of each channel is then normalized using the calculated mean and variance.
[0133] ;
[0134] Finally, we use the learnable parameters to scale and translate the normalized data to get the output of the batch normalization layer. .
[0135] ;
[0136] Step S03:
[0137] First, the feature tensor Generate queries through convolutional layers ,key Sum .
[0138] ;
[0139] in, is a convolutional layer with a kernel size of 1x1 and resized to .
[0140] ;
[0141] is a convolutional layer, and the output dimension is adjusted to .
[0142] ;
[0143] The same convolutional layer adjusts the dimension of the generated V to . Then, calculate the self-attention score:
[0144] ;
[0145] Here the matrix multiplication is to calculate the dot product at all positions of each sample. Then use Function calculation attention weight (Attention Map):
[0146] ;
[0147] in, represents an element in the score matrix, and the denominator is the value of all possible (i.e., all elements in the row Finally, the attention weights are applied to the values Get the weight output Z of the self-attention mechanism.
[0148] ;
[0149] It should be noted that the step S04 is specifically as follows:
[0150] The input feature tensor After the adaptive average pooling layer, the normalized feature tensor is obtained .
[0151] ;
[0152] in, Indicates the channel, Indicates that the channel is at position The above formula calculates the value of the input channel The average value of all elements in .
[0153] Step S05: Dimensions of input features , using nn.Conv2d( , , kernel_size=1) is convolved to obtain .
[0154] Step S06: The output of nn.Conv2d is . Then, apply the Sigmoid function to each element of M:
[0155] ;
[0156] Finally, the function outputs a value between 0 and 1 in each dimension.
[0157] Step S07:
[0158] Use regularization techniques to adjust the attention output Adjust to get the result , increasing the robustness of the model. For each input element, with probability (This experiment is set to 10%) to generate a mask that determines which elements will be set to zero. Specifically, for each input element (all dimensions), generate a random number ,like ,but , (i.e. the element is "discarded" or set to zero). Otherwise, then (That is, the element is retained). On small data sets, Dropout is used as a regularization method to randomly "turn off" some neurons in the network, allowing the network to learn more robust features and prevent the model from overfitting on the training data.
[0159] Step S08: After calculating the attention output Z, apply a regularization layer (Dropout) to increase the generalization ability of the model, and then use the dynamic The parameter M is used to adjust the attention output, and then added to the input original feature X to get the final output P. Specifically:
[0160] ;
[0161] In the above formula, M is the calculated dynamic adjustment parameter gamma, D is the output of the self-attention mechanism after the regularization adjustment layer, and X is the original feature tensor. After obtaining the final output P, the data P is input into the downsampling module of the generative adversarial network for model training.
[0162] Step S09: Utilize the fundamental frequency (F0), spectrum envelope (SP), aperiodic parameters (AP) and encoded spectrum envelope information extracted from Pyworld and Librosa libraries in step S01. Then use the trained generative model to convert the speech style, and finally use the Pyworld library to resynthesize the converted features (fundamental frequency, spectrum envelope and aperiodic parameters) into an audio signal, and the model output is the corresponding features of the target style.
[0163] The provided method is compared with the traditional cycle generative adversarial network speech style transfer (CycleGAN-VC2) method, and the effectiveness of the provided method is further illustrated by objective experimental results. Figure 4 The figure shows an example comparing the detection results of the method provided in this embodiment with those of the traditional method.
[0164] The comparison of Mel-cepstral distortion is shown in Table 1. According to multiple sets of experimental results, the provided methods have significantly reduced Mel-cepstral distortion (MCD) compared with traditional methods.
[0165] Table 1 Comparison of Mel-cepstrum distortion values between the provided method and the traditional method
[0166] .
Claims
1. A method for speech conversion based on a generative adversarial network with dynamic parameter adjustment, characterized in that: The steps include: Step S01: In the feature extraction stage, the fundamental frequency F0, spectrum envelope SP and non-periodic component AP of the speaker's speech are extracted frame by frame from the speech sample, and the spectrum envelope Coded_SP after m-dimensional encoding is extracted; the mean value, standard deviation and regularized encoded spectrum envelope list of the fundamental frequency are obtained; the speech frame feature parameters of length n are intercepted from the speech samples of speaker A and speaker B, and random data pairs Dataset are generated as input features X, and then X is mapped to through a 2d convolution layer Dimension, where c is the number of output feature channels. The network extracts a variety of different feature maps from the original single-channel input. Multi-channel feature representation helps the model capture complex and detailed audio characteristics and provides a richer information basis for style transfer. Step S02: using the batch normalization BatchNorm2d method to independently normalize each input feature tensor X to obtain a normalized feature tensor Y; Step S03: The feature tensor Y is dot-producted using the query, key, and value convolution layers to obtain the output feature tensor Z of the self-attention mechanism layer; Step S04: Input the normalized feature tensor Y into the adaptive average pooling layer AdaptiveAvgPool2d, reduce the spatial dimensions of each feature channel, i.e., width and height, to 1x1, and obtain the pooled feature tensor L; Step S05: Perform a convolution operation on the pooled tensor L feature map through a convolution layer to obtain a feature tensor M, and map M to the same dimensional space as the input feature map; Step S06: The feature tensor M obtained by the convolution operation is nonlinearly transformed by a Sigmoid activation function to obtain a tensor representation N of gamma, so as to ensure that the generated gamma value is within the range of (0, 1); Step S07: Use the regularization technique Dropout to adjust the attention output Z to increase the robustness of the model; Step S08: The dynamically adjusted gamma value N is weighted on the self-attention layer output Z to obtain the final output P, so that the model learns a more complex speech table to obtain the final output P, and then the data P is input into the downsampling module of the generative adversarial network for model training; Step S09: Load statistical information, convert the fundamental frequency of speaker A into the fundamental frequency information of speaker B, use the model file obtained in the training process to perform speech conversion, and finally use the WORLD vocoder to synthesize audio with F0, Coded_SP and AP speech features to generate the converted target speaker's speech.
2. According to claim 1, a method for generating adversarial network voice conversion based on dynamic parameter adjustment is characterized in that: The step S02 is specifically as follows: ; in, and are the mean and variance of the batch data, is a small constant, and are the learned parameters, is the scaling factor used to adjust the scale of the normalized data, The parameters allow the model to learn how wide the distribution of the data should be, which is used to control the variance of the data; is the translation parameter, which is used to adjust the mean of the normalized data; and The learning process is completed through the back propagation of the network, which is used to scale and translate the normalized data respectively; X is the input feature tensor; First, input the feature tensor , where the dimensions are expressed as: is the batch size batchsize, is the number of channels, is the height, is a feature map of width width; for each channel in the input feature tensor X, the mean and variance of all elements of the channel are calculated, that is, in the spatial dimension, that is, all elements of each channel Calculate the mean and variance of pixels; ; ; in, Indicates Channels at position The pixel value of Then, each element of each channel is normalized using the calculated mean and variance; ; Finally, we use the learnable parameters to scale and translate the normalized data to get the output of the batch normalization layer. : , in, Representative Channels at position The output, and Represents scaling parameters and translation parameters; , respectively represent the dimension values corresponding to the output of the batch normalization layer, which are batch size, number of channels, height, and width.
3. The method for generating adversarial network voice conversion based on dynamic parameter adjustment according to claim 2 is characterized in that: The step S03 is specifically as follows: First, the feature tensor Generate queries through convolutional layers ,key Sum ; ; in, is a convolutional layer with a kernel size of 1x1 and resized to ; ; is a convolutional layer, and the output dimension is adjusted to ; ; The same convolutional layer adjusts the dimension of the generated V to ; Then, calculate the self-attention score: ; Here the matrix multiplication is to calculate the dot product at all positions of each sample, and then use Function calculation attention weight Attention Map: ; in, represents an element in the score matrix, and the denominator is the value of all possible , sum up, that is, the sum of all elements in the row Exponentially and, finally, apply attention weights to the values Get the weight output Z of the self-attention mechanism: 。 4. The method for speech conversion based on a generative adversarial network with dynamic parameter adjustment according to claim 1, characterized in that: The step S04 is specifically as follows: The input feature tensor After the adaptive average pooling layer, the normalized feature tensor is obtained , the corresponding formula is as follows: ; in, Indicates the channel, Indicates that the channel is at position The above formula calculates the value of the input channel The average value of all elements in .
5. The method for speech conversion based on a generative adversarial network with dynamic parameter adjustment according to claim 4 is characterized in that: The step S05 is specifically as follows: For the size of the input feature , using the 2d convolutional layer nn.Conv2d( , , kernel_size=1) for convolution, the calculation is as follows: ; in, represents the output feature tensor after the convolution operation, is the output channel index, is the input channel index, is the batch index, Indicates that the input feature tensor is in batches ,aisle ,high and width The value of It is The input channel pairs The weights of the 1×1 convolution kernels for the output channels, It is The bias term for each output channel.
6. The method for speech conversion based on a generative adversarial network with dynamic parameter adjustment according to claim 5, characterized in that: The step S06 is specifically as follows: The output of the 2d convolutional layer nn.Conv2d is , then apply the following function to each element of M: ; Finally, the function outputs a value between 0 and 1 in each dimension.
7. The method for generating adversarial network voice conversion based on dynamic parameter adjustment according to claim 3 is characterized in that: The step S07 is specifically as follows: The attention output Z is adjusted using regularization techniques to obtain the result D to increase the robustness of the model. The adjustment process is as follows: for each input element, the probability Generates a mask that determines which elements are to be zeroed, specifically, for each input element in all dimensions , generate a random number ,like ,but , that is, the element is "discarded" or set to zero, otherwise, , that is, the element is retained.
8. The method for speech conversion based on a generative adversarial network with dynamic parameter adjustment according to claim 7, characterized in that: The step S08 is specifically as follows: After calculating the attention output Z, the regularization technique Dropout is applied to increase the generalization ability of the model, and then the dynamic The parameter M is used to adjust the attention output, and then added to the input original feature X to get the final output P, specifically: ; In the above formula, M is the calculated dynamic adjustment parameter gamma, D is the output of the self-attention mechanism after the regularization adjustment layer, and X is the original feature tensor. After obtaining the final output P, the data P is input into the downsampling module of the generative adversarial network for model training.
9. The method for speech conversion based on a generative adversarial network with dynamic parameter adjustment according to claim 1, characterized in that: The step S09 is specifically as follows: In the conversion stage, the fundamental frequency F0, spectral envelope SP, non-periodic parameters AP and encoded spectral envelope information are extracted in the same way as in step S01, and then the trained generative model is used to convert the speech style. Finally, the converted features are resynthesized into an audio signal. The converted features include fundamental frequency, spectral envelope and non-periodic parameters, and the model output is the corresponding features of the target style.
10. A generative adversarial network voice conversion system based on dynamic parameter adjustment, the system comprising: A speech feature extraction module, a model training module, and a speech conversion module. The system is used to execute any step of the generative adversarial network speech conversion method based on dynamic parameter adjustment as described in claims 1 to 9.
