Training method and device of neural network model for voice processing
By cascading and feature extraction of sample data in speech processing, joint training of multi-task neural network models is achieved, which solves the problems of large model parameters and low training efficiency in the existing technology, and improves the overall performance of speech processing.
Patent Information
- Application Number
- CN202310460997.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2024-10-22
AI Technical Summary
The existing technology is difficult to effectively implement joint training of multi-task neural network models in speech processing, resulting in a large number of model parameters, low training efficiency, and difficulty in sharing feature extraction, which affects the utilization of computing resources.
By cascading sample data in batch dimensions, performing channel dimension cascade and feature extraction, sample feature data that can be shared by various models to be trained is generated, and model parameters are adjusted according to the loss function value to achieve multi-task joint training.
It reduces the number of model parameters, improves the efficiency of single-task training, saves hardware resources, realizes shared feature extraction for multiple tasks, and improves the overall performance of speech processing.
Smart Images

Figure CN118824232A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular, to a training method for a neural network model for speech processing. Background Art
[0002] With the development of artificial intelligence technology, more and more applications have adopted artificial intelligence technology. In audio processing, for example, neural network models for sound event detection, neural network models for speech enhancement, neural network models for echo cancellation and other neural network models for speech processing have been widely used. Among them, Sound Event Detection (SED) refers to the recognition of sounds in the environment to detect the occurrence of events, such as "baby crying, explosions, dog barking", etc.; Speech Enhancement is a technology that extracts clean speech signals from background noise and suppresses noise when the speech signal is interfered by various noises; Echo Cancellation refers to the elimination of far-end signals generated by speaker playback during duplex communication. Summary of the invention
[0003] The present invention provides a training method for a neural network model for speech processing, so as to train the neural network model for speech processing.
[0004] A first aspect of the present invention provides a method for training a neural network model for speech processing, the method comprising:
[0005] According to at least one model to be trained, sample data corresponding to the model to be trained is selected, wherein the sample data of each model to be trained is constructed separately,
[0006] The selected sample data is concatenated in batch dimension to obtain the first sample input data.
[0007] The first sample input data is cascaded in the channel dimension to obtain the cascaded sample input data.
[0008] Based on the cascaded sample input data, feature extraction is performed to obtain sample feature data that can be shared by each model to be trained.
[0009] Input the extracted sample feature data into the model to be trained.
[0010] According to the loss function value between the output result of the model to be trained and the target result, the model parameters of the model to be trained are adjusted until the model to be trained meets the expectations.
[0011] A second aspect of the present invention provides a training device for a neural network model for speech processing, the device comprising:
[0012] A sample acquisition module is used to select corresponding sample data according to at least one model to be trained, wherein the sample data of each model to be trained is constructed separately, and the selected sample data is cascaded in batch dimension to obtain first sample input data.
[0013] A cascader is used to perform channel-dimensional cascading on the first sample input data to obtain cascaded sample input data,
[0014] The feature extractor is used to extract features based on the cascaded sample input data to obtain sample feature data that can be shared by each model to be trained.
[0015] The training module is used to input the extracted sample feature data into the model to be trained, and adjust the model parameters of the model to be trained according to the loss function value between the output result of the model to be trained and the target result, until the model to be trained meets the expectations.
[0016] A third aspect of the present invention provides an inference method for a neural network model for speech processing, the method comprising:
[0017] Get the voice data to be processed.
[0018] The trained neural network model for speech processing is used to process the speech data to be processed.
[0019] in,
[0020] The neural network model for speech processing is trained using the steps of any of the training methods.
[0021] A fourth aspect of the present invention provides an inference device for a neural network model for speech processing, the device comprising:
[0022] The acquisition module is used to obtain the voice data to be processed.
[0023] The speech processing module uses the trained neural network model for speech processing to process the speech data.
[0024] in,
[0025] The neural network model for speech processing is trained using the steps of the training method.
[0026] The present application provides a training method for a neural network model for speech processing, which obtains sample input data by cascading selected sample data in a batch dimension, and cascading and extracting features from the sample input data, thereby facilitating joint training of multiple tasks, reducing the amount of model parameters, and improving the training efficiency of single-task training. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A flowchart of a method for training a neural network model for speech processing is shown.
[0028] Figure 2 A schematic diagram of a sound event detection (SED) model, a speech enhancement model, and an echo cancellation model.
[0029] Figure 3 A structural diagram of a convolutional block.
[0030] Figure 4 This is a schematic diagram of a network structure for jointly training three models: a sound event detection model to be trained, a speech enhancement model to be trained, and an echo cancellation model to be trained in Example 1.
[0031] Figure 5 Based on Figure 4 A schematic diagram of the process of training the model to be trained with a network structure.
[0032] Figure 6 A schematic diagram of the process of performing inference for a trained model.
[0033] Figure 7 This is a schematic diagram of a network structure for jointly training a speech enhancement model and an echo cancellation model in Example 2.
[0034] Figure 8 Based on Figure 7 A schematic diagram of the process of training the model to be trained with a network structure.
[0035] Fig. 9 A schematic diagram of the process of performing inference for a trained model.
[0036] Fig.10 A schematic diagram of a network structure for implementing three examples of joint training of the SED model and the echo cancellation model.
[0037] Fig.11 Based on Fig.10 A schematic diagram of the process of training the model to be trained with a network structure.
[0038] Fig.12 A schematic diagram of the process of performing inference for a trained model.
[0039] Fig.13 This is a schematic diagram of a network structure for jointly training a sound event detection model and a speech enhancement model according to Embodiment 4.
[0040] Fig.14 Based on Fig.14A schematic diagram of the process of training the model to be trained with a network structure.
[0041] Fig.15 A schematic diagram of a network structure for training the SED model in Example 5.
[0042] Fig.16 Based on Fig.15 A schematic diagram of the process of training the model to be trained with a network structure.
[0043] Fig.17 A schematic diagram of a network structure for training a speech enhancement model in Example 6.
[0044] Fig.18 Based on Fig.17 A schematic diagram of the process of training the model to be trained with a network structure.
[0045] Fig.19 A schematic diagram of a network structure for training an echo cancellation model according to Embodiment 7.
[0046] Fig. 20 Based on Fig.19 A schematic diagram of the process of training the model to be trained with a network structure.
[0047] Fig.21 A schematic diagram of a training device for a neural network model for speech processing according to an embodiment of the present application.
[0048] Fig. 22 A schematic diagram of an inference device for a neural network model for speech processing.
[0049] Fig.23 Another schematic diagram of an inference device for a neural network model for speech processing and / or a training device for a neural network model for speech processing according to an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the objectives, technical means and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings.
[0051] For ease of description, in the embodiments of the present application, the neural network model used for sound event detection is called a sound event detection model, the neural network model used for speech enhancement is called a speech enhancement model, and the neural network model used for echo cancellation is called an echo cancellation model.
[0052] See also Figure 1 As shown, Figure 1 A flowchart of a method for training a neural network model for speech processing is provided. The method comprises:
[0053] Step 101, according to at least one model to be trained, select sample data corresponding to the model to be trained, wherein the sample data of each model to be trained is constructed separately,
[0054] As an example, the neural network model for speech processing includes: other models except the echo cancellation model, and at least one of the echo cancellation models for echo cancellation; the sample data includes: sample data corresponding to other models, and third sample data corresponding to the echo cancellation model to be trained, wherein the third sample data includes: near-end microphone sample signals, and far-end reference sample signals,
[0055] Step 102, cascading the selected sample data in batch dimension to obtain first sample input data,
[0056] As an example, in a case where the model to be trained includes only the echo cancellation model to be trained, the far-end reference sample signal in the third sample data is cascaded in a batch dimension to obtain the first sample input data, and the near-end microphone sample signal in the third sample data is cascaded in a batch dimension to obtain the second sample input data;
[0057] As another example, in a case where the model to be trained includes not only the echo cancellation model to be trained, the selected sample data and the far-end reference sample signal in the third sample data are cascaded in a batch dimension to obtain first sample input data, zero-value data having the same dimension as the selected sample data or copy data of the selected sample data are constructed, and the constructed data are cascaded in a batch dimension with the near-end microphone sample signal in the third sample data to obtain second sample input data.
[0058] As another example, when the models to be trained include other models to be trained except the echo cancellation model to be trained, the sample data corresponding to the other models to be trained are cascaded in a batch dimension to obtain the first sample input data;
[0059] As another example, in the case where the model to be trained includes any other model to be trained except the echo cancellation model to be trained, the sample data corresponding to the model to be trained is cascaded in a batch dimension to obtain the first sample input data.
[0060] The batch dimension is the dimension of the batch samples.
[0061] Step 103, cascading the first sample input data to obtain cascaded sample input data,
[0062] As an example, when first sample input data is obtained, more than one first sample input data is fused, and the fused data is sequentially subjected to a first convolution operation, an activation function operation, a batch sample normalization operation, and a second convolution operation to perform channel dimension cascading to obtain cascaded sample input data.
[0063] As another example, when first sample input data and second sample input data are obtained, the first sample input data and the second sample input data are fused, and the fused data are sequentially subjected to a first convolution operation, an activation function operation, a batch sample normalization operation, and a second convolution operation to obtain cascaded sample input data.
[0064] Step 104: extract features based on the cascaded sample input data to obtain sample feature data that can be shared by each model to be trained.
[0065] Step 105: input the extracted sample feature data into the model to be trained.
[0066] As an example, in the case where the model to be trained includes any model to be trained except the echo cancellation model to be trained, and the echo cancellation model to be trained, the extracted sample feature data is input into the encoder of the model to be trained, the sample feature data corresponding to the model to be trained is cut out from the sample feature data output by the encoder, and the remaining sample feature data in the sample feature data output by the encoder is input into the encoder of the echo cancellation model to be trained; wherein, as an example, any model to be trained includes a sound event detection model to be trained, or a speech enhancement model to be trained;
[0067] As another example, when the models to be trained include other models to be trained except the echo cancellation model to be trained, sample feature data corresponding to each model to be trained is respectively segmented from the extracted sample feature data and input into the encoder of the corresponding model to be trained.
[0068] As another example, in a case where the model to be trained includes a sound event detection model to be trained, a speech enhancement model to be trained, and an echo cancellation model to be trained, sample feature data corresponding to the sound event detection model to be trained is cut out from the extracted sample feature data, the cut sample feature data is input into an encoder in the sound event detection model to be trained, the remaining sample feature data in the extracted sample feature data is input into an encoder in the speech enhancement model to be trained, and then sample feature data corresponding to the speech enhancement model is cut out from the sample feature data output by the encoder in the speech enhancement model to be trained, and finally the remaining sample feature data in the sample feature data output by the encoder in the speech enhancement model to be trained is input into the encoder in the echo cancellation model to be trained;
[0069] As another example, in a case where the model to be trained includes only any one model to be trained, the extracted sample feature data is input into the model to be trained.
[0070] Step 106, adjusting the model parameters of the model to be trained according to the loss function value between the output result of the model to be trained and the target result, until the model to be trained meets the expectations.
[0071] As another example, when the model to be trained includes only any one model to be trained, the loss function value is calculated according to the loss function value between the output result of the model to be trained and the target result; when the model to be trained includes multiple models to be trained, the joint loss function value is calculated according to the loss function value between the output result of each model to be trained and its target result, wherein the joint loss function value is the weighted sum of the loss function values of each model to be trained.
[0072] For example, in the case where the model to be trained includes any model to be trained except the echo cancellation model to be trained, and the echo cancellation model to be trained, the joint loss function value is: a fourth loss function value used to characterize the difference between the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result, and a weighted sum of the loss function values used to characterize the difference between the output result of the model to be trained and the target result.
[0073] For another example, when the model to be trained includes a sound event detection model to be trained, a speech enhancement model to be trained, and an echo cancellation model to be trained, the joint loss function value is: a weighted sum of a first loss function value used to characterize the difference between the sound event detection result output by the sound event detection model to be trained and the target sound event detection result, a second loss function value used to characterize the difference between the speech enhancement result output by the speech enhancement model to be trained and the target speech enhancement result, and a fourth loss function value used to characterize the difference between the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result. If the speech enhancement model to be trained includes a classifier for human voice activity detection, the joint loss function value also includes: a weighted sum of a third loss function value used to characterize the difference between the human voice activity detection result output by the speech enhancement model to be trained and the target human voice activity detection result.
[0074] The embodiment of the present application facilitates the implementation of multi-task training through the cascading and feature extraction of sample input data, improves the sharing of network structure, and reduces computing resources.
[0075] To facilitate understanding of the embodiments of the present application, the following explanation is given by taking the training of a sound event detection (SED) model, a speech enhancement model, and an echo cancellation model as examples. It should be understood that the present application is not limited to the above-mentioned specific models, and other neural network models for speech processing may also be applicable.
[0076] In this embodiment, the neural network models used for speech processing include: a sound event detection (SED) model, a speech enhancement model, and an echo cancellation model, wherein:
[0077] As an example, the SED model belongs to a classification task. Compared with the generation of speech enhancement tasks and echo cancellation tasks, the task is relatively simple and does not require too many model parameters. In addition, the SED task is used more frequently in actual scenarios and generally needs to run for 24 hours, so the model structure needs to be miniaturized.
[0078] The speech enhancement model suppresses the noise in noisy speech and enhances the speech. For example, it can be applied to real-time video query and 24-hour audio and video recording in smart cameras to improve speech quality. The number of network layers is too small to remove noise well. Therefore, the speech enhancement model includes multiple encoders to further extract features, and then the enhanced speech is obtained through a speech enhancement decoder.
[0079] The echo cancellation model is usually used in duplex communication. The echo cancellation model input is a two-channel signal. The near-end signal collected by the near-end microphone is mixed with the far-end user voice and the near-end user voice played by the speaker. The far-end user voice signal is used as a reference signal. The purpose of echo cancellation is to eliminate the far-end user voice from the near-end signal. Compared with speech enhancement, the echo cancellation task is more complicated.
[0080] See also Figure 2 As shown, Figure 2 A schematic diagram of a sound event detection (SED) model, a speech enhancement model, and an echo cancellation model.
[0081] The sound event detection model includes: a SED encoder for SED encoding, and a SED classifier, wherein the SED encoder includes at least one convolution block connected in sequence, and the SED classifier includes a first pooling layer connected in sequence for performing a pooling operation on a result output by the SED encoder, and a third convolution layer for performing a convolution operation on an output result of the first pooling layer. As an example, the first pooling layer is an average pooling layer.
[0082] The speech enhancement model includes: a speech enhancement encoder for speech encoding, a speech enhancement encoder for speech decoding, and according to the requirements of inference, it may also include a classifier for voice activity detection (VAD), wherein the speech enhancement encoder includes at least one convolution block connected in sequence, and the speech enhancement decoder includes: a fourth convolution layer for performing a convolution operation on the result output by the speech enhancement encoder, and a first transposed convolution (conv_transpose) layer for upsampling the features output by the fourth convolution layer into an audio signal; the VAD classifier includes a second pooling layer connected in sequence for performing a pooling operation on the result output by the speech enhancement encoder, and a sixth convolution layer for performing a convolution operation on the second pooling layer.
[0083] The echo cancellation model includes: an echo cancellation encoder for echo cancellation encoding and an echo cancellation decoder for echo cancellation decoding, wherein the echo cancellation encoder includes at least one convolution block connected in sequence, and the echo cancellation decoder includes: a fifth convolution layer for performing a convolution operation on a result output by the echo cancellation encoder, and a second transposed convolution layer for upsampling features output by the fifth convolution layer into an audio signal.
[0084] The number of convolution blocks in the SED encoder, the speech enhancement encoder, and the echo cancellation encoder may be the same and have the same structural parameters, or the same number and different structural parameters, or different numbers and the same structural parameters, or different numbers and different structural parameters. For example, the number of convolution blocks in the SED encoder, the speech enhancement encoder, and the echo cancellation encoder are all 4.
[0085] See also Figure 3 As shown, Figure 3 Schematic diagram of a convolution block. The convolution block includes a sequentially connected convolution layer 1, an activation function layer 1, a batch normalization 1 (BN) layer, a depth convolution layer, an activation function layer 2, a batch normalization layer 2, a convolution layer 2, and an adder for adding the input data of the convolution block to the output data of the convolution layer 2.
[0086] As an example, there may be multiple SED encoders, speech enhancement encoders, and echo cancellation encoders, that is, the number of encoders may be determined according to the needs of the model application.
[0087] Embodiment 1
[0088] In this embodiment, the neural network models used for speech processing include: a sound event detection (SED) model, a speech enhancement model, and an echo cancellation model.
[0089] See also Figure 4 As shown, Figure 4 This is a schematic diagram of a network structure for jointly training three models: a sound event detection model to be trained, a speech enhancement model to be trained, and an echo cancellation model to be trained in Example 1. The network structure includes:
[0090] a cascader for cascading the first sample input data and the second sample input data in a channel dimension,
[0091] A feature extractor for extracting features from the concatenated sample input data.
[0092] The sample feature data output by the feature extractor is segmented and the corresponding sample feature data is input into the SED encoder in the sound event detection model to be trained, and the remaining sample feature data is input into the speech enhancement encoder in the speech enhancement model to be trained.
[0093] The sample feature data output by the speech enhancement encoder in the speech enhancement model to be trained is segmented into sample feature data corresponding to the speech enhancement model to be trained, and the segmented sample feature data are respectively input into the speech decoder and VAD classifier in the speech enhancement model to be trained, and the remaining sample feature data in the sample features output by the speech enhancement encoder is input into the echo encoder in the echo cancellation model to be trained, so that the sample feature data input into the echo cancellation model to be trained is extracted through a multi-layer network.
[0094] As an example, the cascader sequentially performs a fusion operation (concat) for signal fusion, a first convolution operation to set a first stride and a first convolution kernel size (kernel_size), an activation function operation, a batch sample normalization (BN, Batch Normalization) operation, and a second convolution operation to set a second stride and a second convolution kernel size on the input first sample input data and the second sample input data, that is, the cascader includes a fusion layer for a fusion operation, a first convolution layer for a first convolution operation, an activation function layer, a BN layer, and a second convolution layer connected in sequence; the number of input channels (c_in) of the first convolution layer is the set first input channel number, and the number of output channels (c_out) of the first convolution layer is the set first output channel number; the number of input channels of the second convolution layer is the set second input channel number, and the number of output channels of the second convolution layer is the set second output channel number;
[0095] For example, the first step length is 32, the first convolution kernel size is 64, the first input channel number is 2, the first output channel number is 48, the second step length is 1, the second convolution kernel size is 1, the second input channel number is 48, and the second output channel number is 32.
[0096] The feature extractor includes at least one or more convolution blocks connected in sequence, for example, four convolution blocks, namely a first convolution block, a second convolution block, a third convolution block, and a fourth convolution block. As an example, the convolution dilation coefficient (dilation) of each convolution block is different, and the causal value (causal) used to characterize the causal relationship of the convolution is different. When causal is true, it indicates that the convolution of the convolution block is causal convolution, and when causal is false, it indicates that the convolution of the convolution block is non-causal convolution;
[0097] For example, the convolution expansion coefficient of the first convolution block is 1, the causal value is false, the convolution expansion coefficient of the second convolution block is 2, the causal value is true, the convolution expansion coefficient of the third convolution block is 4, the causal value is true, and the convolution expansion coefficient of the first convolution block is 8, and the causal value is true.
[0098] As an example, when the number of convolution blocks in the SED encoder, speech enhancement encoder, and echo cancellation encoder is the same, the number of convolution blocks included in the feature extractor can be the same as the number of convolution blocks in the SED encoder, speech enhancement encoder, and echo cancellation encoder, and the structural parameters are the same.
[0099] See also Figure 5 As shown, Figure 5 Based on Figure 4 A schematic diagram of a process of training a model to be trained using a network structure. The training method includes:
[0100] Step 501, obtaining sample data, wherein sample data sets for three tasks, namely, sound event detection, speech enhancement and echo cancellation, are constructed separately and correspond to first sample data, second sample data and third sample data, respectively.
[0101] The first sample data packet contains the speech sample data of the sound event, which can be described as [B1,1,1,N1], where B1 represents the batch sample size (batch_size), N1 is the number of speech signal sampling points, for example, for 4s audio, the sampling rate is 16KHz, then the number of sampling points N1 = 64000, the first number 1 represents the number of channels is 1, and the second number 1 represents that the data dimension required by the model is supplemented by the value 1;
[0102] The sample label data corresponding to the first sample data is label data for describing the classification type, which is [B1, T1]. T1 represents the type of each frame of data. For example, the number of T1 is N1 / 160, that is, every 10 ms is a frame of data.
[0103] The second sample data is the noisy speech sample data, which can be described as [B2, 1, 1, N2], where B2 represents the number of batch samples, and N2 represents the number of speech signal sampling points. The noisy sample speech data (mixed noise signal) can be obtained as follows:
[0104] According to the noisy sample speech signal, the power of the noisy sample speech signal is calculated,
[0105] According to the noise-free sample speech signal, the power of the noise-free sample speech signal is calculated,
[0106] The scaling factor is calculated based on the set signal-to-noise ratio, the power of the noisy sample speech signal, and the power of the noise-free sample speech signal.
[0107] Using the scaling factor, a noisy sample speech signal is determined.
[0108] The above-mentioned sample speech data containing noise can be expressed mathematically as follows:
[0109]
[0110] Among them, noise_spe represents the power of the noisy sample speech signal, clean_spe represents the power of the noise-free sample speech signal (clean signal), snr is the preset signal-to-noise ratio, noisy_signal is the generated mixed noise signal, noise represents the noisy sample speech signal, clean represents the noise-free sample speech signal, and scalar represents the scaling factor.
[0111] The label data corresponding to the second sample data is a noise-free sample speech signal, i.e., the clean signal in formula (1), with a dimension of [[B2, 1, 1, N2]. Since the speech enhancement module to be trained includes a VAD classifier, there is also corresponding classification label data, expressed as [B2, T2]. T2 indicates the type of each frame of data, but there are only two types, 0 or 1, indicating speech or no speech. Similarly, every 10 ms can be a frame of data.
[0112] The third sample data includes: a near-end microphone sample signal and a far-end reference sample signal, wherein the near-end microphone sample signal dimension is [B4, 1, 1, T4], which can be simulated and generated by formula (2).
[0113] nearend_mic_signal=echo_signal+nearend_signal (2)
[0114] In the formula, nearend_signal represents the near-end user sample signal, nearend_mic_signal represents the near-end microphone sample signal, and echo_signal is the echo sample signal generated when the far-end reference sample signal is played by the speaker. The echo sample signal can be collected by the device itself or generated by simulation. The simulation generation is shown in formula (3).
[0115] echo_signal=conv(farend_signal,rir) (3)
[0116] Among them, conv represents the convolution operation, rir is the room impulse response function, which can be obtained through actual acquisition or simulation, farend_signal represents the far-end reference sample signal, and its dimension is [B3,1,1,N3].
[0117] The label data corresponding to the third sample data is an echo-free speech sample signal with a dimension of [B4, 1, 1, T4], corresponding to the near-end user sample signal nearend_signal in formula (2).
[0118] Preferably, the dimension of the near-end microphone sample signal is the same as the dimension of the far-end reference sample signal.
[0119] Step 502: using the first sample data, the second sample data, and the third sample data, obtain the first sample input data and the second sample input data.
[0120] The first sample data, the second sample data, and the remote reference sample signals in the third sample data are concatenated together in a batch dimension as the first sample input data,
[0121] In view of the fact that the original task input channel of the sound event detection and speech enhancement tasks is a single channel, in order to adapt to the echo cancellation task, based on the first sample data, zero-value data having the same dimension as the first sample data, or a copy of the first sample data, is constructed to obtain the fourth sample data. Based on the second sample data, zero-value data having the same dimension as the second sample data, or a copy of the second sample data, is constructed to obtain the fifth sample data.
[0122] The fourth sample data, the fifth sample data, and the near-end microphone sample signals in the third sample data are concatenated together in a batch dimension as second sample input data.
[0123] As an example, if the batch dimension and N dimension of the first sample data, the second sample data, and the third sample data are the same, the first sample input data is [B*3,1,1,N], and similarly, the second sample input data is [B*3,1,1,N]. Since the first sample input data and the second sample input data each occupy one channel, the number of sample input data channels input to the cascade is 2, which can be expressed as [B*3,2,1,N].
[0124] As another example, if the batch dimension and N dimension of the first sample data, the second sample data, and the third sample data are the same, the first sample input data is [B′, 1, 1, N], where the dimensions of B′ include B1, B2, and B3. Similarly, the second sample input data is [B″, 1, 1, N], where the dimensions of B″ include B1, B2, and B4.
[0125] Step 503: input the first sample input data and the second sample input data into the cascader at the same time to perform channel dimension cascading.
[0126] As an example, the cascaded sample input data output by the cascader passes through the feature extractor to obtain the extracted sample feature data, which is [B*3,C,1,M], where C represents the number of feature channels, and M represents the number of sampling points after dimensionality reduction. The data of the first batch [B,C,1,M] is cut out from the batch dimension and sent to the SED encoder of the SED model to be trained. The reason for cutting out the sample feature data of the first batch [B,C,1,M] is that when constructing the input data, the first B dimension is the sound event task data; the remaining samples The feature data [B*2, C, 1, M] is sent to the speech enhancement model to be trained, and then the second batch of sample feature data [B, C, 1, M] is cut out from the sample feature data output by the encoder of the speech enhancement model to be trained and sent to the speech enhancement decoder and VAD classifier respectively. The cut sample feature data corresponds to the speech enhancement model to be trained. Finally, the remaining sample feature data [B, C, 1, M] in the sample feature data output by the encoder of the speech enhancement model to be trained is sent to the encoder and echo cancellation decoder in the echo cancellation model to be trained.
[0127] As another example, the cascaded sample input data output by the cascader passes through the feature extractor to obtain the extracted sample feature data, which is [B~, C, 1, M], where the dimensions of B~ include B1, B2, B3, and B4. The data of the first batch [B1, C, 1, M] are cut out from the batch dimension and sent to the SED encoder of the SED model to be trained. The reason for cutting out the sample feature data of the first batch [B, C, 1, M] is that when constructing the input data, the first B dimension is the sound event task data, and the remaining sample feature data is sent to the speech enhancement model to be trained; then, the sample feature data of the second batch [B2, C, 1, M] are cut out from the sample feature data output by the encoder of the speech enhancement model to be trained and sent to the speech enhancement decoder and VAD classifier respectively. Finally, the remaining sample feature data [B3, C, 1, M] and [B4, C, 1, M] output by the encoder of the speech enhancement model to be trained are sent to the encoder and echo cancellation decoder in the echo cancellation model to be trained.
[0128] Step 504, calculating the value of the joint loss function according to the output results of the SED model to be trained, the speech enhancement model to be trained, and the echo cancellation model to be trained.
[0129] As an example, the joint loss function value is: the weighted sum of a first loss function value used to characterize the SED result output by the SED model to be trained and the target SED result, a second loss function value used to characterize the speech enhancement result output by the speech enhancement model to be trained and the target speech enhancement result, a third loss function value used to characterize the VAD result output by the speech enhancement model to be trained and the target VAD result, and a fourth loss function value used to characterize the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result.
[0130] The mathematical expression is:
[0131] total losss =α1×sed_loss+α2×se_loss+α3×se_vad_loss+α4×echo_loss
[0132] Among them, total_losss is the joint loss function value, sed_loss is the first loss function value, se_loss is the second loss function value, se_vad_loss is the third loss function value, echo_loss is the fourth loss function value, α1, α2, α3, α4 are weighting coefficients, which are generally set to 1. Different weighting coefficients can also be set according to the sample size, training difficulty, and importance of different tasks.
[0133] As an example, the first loss function value and the third loss function value are both cross entropy loss function values (CELoss, Cross Entropy Loss), and the second loss function value and the fourth loss function value are both scale invariant signal-to-noise ratio loss function values (SISNR Loss, Scale Invariant Signal to Noise Ratio).
[0134] The calculation of the cross entropy loss function value is shown in formula (4):
[0135]
[0136] Among them, J represents the number of batch samples, C is the number of categories, and y jc Whether the jth sample is a true sample of category c, the value is 0 or 1, p jc is the probability of identifying the jth sample as category c.
[0137] The SISNR loss is calculated as shown in formula (5):
[0138]
[0139]
[0140]
[0141]
[0142]
[0143] Among them, s represents the label speech signal, s target represents the target speech signal, is the predicted speech signal output by the model, represents the sum of the products of the corresponding positions of the prediction signal and the label signal, ||s|| 2 Represents the power of the label speech signal. Similarly, ||s target || 2 、||e noise || 2 Respectively represent s target Signal and e noise The power of the signal.
[0144] Step 505, according to the value of the joint loss function, adjust the model parameters of each model to be trained until the expected results are achieved, thereby obtaining each trained model.
[0145] In this embodiment, each model to be trained shares a shared network structure composed of a cascader and a feature extractor, which facilitates the hardware design of joint training and reduces hardware resources. Since three tasks can be achieved at once through the shared network structure, it is beneficial to reduce the number of model parameters and save memory usage.
[0146] In this embodiment, the three trained models mentioned above do not run at the same time. For example, sound event detection requires a long time of detection, while speech enhancement only needs to be turned on when someone is speaking. That is to say, when doing speech enhancement, it will detect whether the human voice has ended. If it has ended, the speech enhancement processing will be exited, and the echo cancellation task will only be started in duplex communication.
[0147] See also Figure 6 As shown, Figure 6 A flow chart of performing inference on a trained model. The method includes:
[0148] Step 601, obtaining a speech signal to be processed,
[0149] Step 602: extracting features from the acquired speech signal to be processed to obtain first feature data.
[0150] Step 603: Use the trained SED model to perform SED detection on the extracted first feature data.
[0151] Step 604, determine whether human voice is detected in the SED detection result, if yes, execute step 605, otherwise, perform audio compression storage,
[0152] Step 605: extracting features from the currently processed speech signal to obtain second feature data.
[0153] Step 606: Use the trained speech enhancement model to perform speech enhancement processing on the second feature data and perform VAD detection.
[0154] Step 607, determine whether voice is detected in the VAD detection, if yes, return to step 602, otherwise, perform audio compression storage,
[0155] As another example, when an echo cancellation trigger signal is received, step 608 is executed to extract features of the speech signal to be processed to obtain third feature data.
[0156] Step 609: Use the trained echo cancellation model to perform echo cancellation processing on the third feature data.
[0157] When no echo cancellation trigger signal is received, the process returns to step 602 .
[0158] This embodiment can realize the switching of sound event detection and voice enhancement. When echo cancellation is triggered, it can realize the switching of sound event detection, voice enhancement and echo cancellation, which is beneficial to reduce the running frequency of each task, save computing power and reduce power consumption.
[0159] Embodiment 2
[0160] In this embodiment, the neural network models used for speech processing include two models: a speech enhancement model and an echo cancellation model.
[0161] See also Figure 7 As shown, Figure 7 A schematic diagram of a network structure for implementing joint training of two pairs of speech enhancement models and echo cancellation models. The network structure includes:
[0162] a cascader for cascading the first sample input data and the second sample input data,
[0163] A feature extractor for extracting features from the concatenated sample input data.
[0164] The sample feature data output by the feature extractor is input into the encoder in the speech enhancement model to be trained.
[0165] The output data of the speech enhancement encoder in the speech enhancement model to be trained is input to the echo encoder in the echo cancellation model to be trained, so that the sample feature data input to the echo cancellation model to be trained is extracted through a multi-layer network.
[0166] See also Figure 8 As shown, Figure 8 Based on Figure 7 A schematic diagram of a process of training a model to be trained using a network structure. The training method includes:
[0167] Step 801 : acquiring sample speech data, wherein sample data for speech enhancement to be trained and sample data for echo cancellation to be trained are constructed separately and correspond to the second sample data and the third sample data respectively.
[0168] Step 802, concatenating the second sample data and the remote reference sample signal in the third sample data in a batch dimension as first sample input data;
[0169] Based on the second sample data, construct zero-value data having the same dimension as the second sample data, or duplicate data of the second sample data, to obtain fifth sample data,
[0170] The fifth sample data and the near-end microphone sample signal in the third sample data are concatenated together in a batch dimension as the second sample input data.
[0171] Step 803: input the first sample input data and the second sample input data into the cascader at the same time to perform channel dimension cascading.
[0172] Step 804, calculating the joint loss function value according to the output results of the speech enhancement model to be trained and the echo cancellation model to be trained.
[0173] As an example, the joint loss function value is: the weighted sum of a second loss function value used to characterize the difference between the speech enhancement result output by the speech enhancement model to be trained and the target speech enhancement result, a third loss function value used to characterize the difference between the VAD result output by the speech enhancement model to be trained and the target VAD result, and a fourth loss function value used to characterize the difference between the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result.
[0174] The mathematical expression is:
[0175] total losss =α2×se_loss+α3×se_vad_loss+α4×echo_loss
[0176] Among them, total_losss is the joint loss function value, se_loss is the second loss function value, se_vad_loss is the third loss function value, echo_loss is the fourth loss function value, α2, α3, α4 are weighting coefficients, which are generally set to 1. Different weighting coefficients can also be set according to the sample size, training difficulty, and importance of different tasks.
[0177] As an example, the third loss function value is a cross entropy loss function value (CE Loss, Cross EntropyLoss), and the second loss function value and the fourth loss function value are both scale invariant signal-to-noise ratio loss function values (SISNR Loss, Scale Invariant Signal to Noise Ratio).
[0178] Step 805, according to the joint loss function value, adjust the model parameters of the two models to be trained until the expected results are achieved, thereby obtaining the trained models.
[0179] See also Fig. 9 As shown, Fig. 9 A flow chart of performing inference on a trained model. The method includes:
[0180] Step 901: obtaining a speech signal to be processed.
[0181] Step 902: extracting features from the currently processed speech signal to obtain second feature data.
[0182] Step 903: perform speech enhancement processing on the second feature data using the trained speech enhancement model, and perform VAD detection.
[0183] Step 904, determine whether speech is detected in the VAD detection.
[0184] If yes, when the echo cancellation trigger signal is received, the process returns to step 905 to extract features of the current voice signal to be processed to obtain third feature data. When the echo cancellation trigger signal is not received, the process returns to step 902 to perform feature extraction on the current voice signal to be processed to obtain third feature data.
[0185] Otherwise, return to step 902.
[0186] Step 905: Use the trained echo cancellation model to perform echo cancellation processing on the third feature data.
[0187] As an example, this embodiment can be used in an application scenario involving voice communication.
[0188] Embodiment 3
[0189] In this embodiment, the neural network models used for speech processing include two models: a SED model and an echo cancellation model.
[0190] See also Fig.10 As shown, Fig.10 A schematic diagram of a network structure for implementing joint training of three pairs of SED models and echo cancellation models. The network structure includes:
[0191] a cascader for cascading the first sample input data and the second sample input data,
[0192] A feature extractor for extracting features from the concatenated sample input data.
[0193] The sample feature data output by the feature extractor is input into the encoder in the SED model to be trained.
[0194] The output data of the speech enhancement encoder in the SED model to be trained is input to the echo encoder in the echo cancellation model to be trained, so that the sample feature data input to the echo cancellation model to be trained is extracted through a multi-layer network.
[0195] See also Fig.11 As shown, Fig.11 Based on Fig.10 A schematic diagram of a process of training a model to be trained using a network structure. The training method includes:
[0196] Step 1101, obtaining sample speech data, wherein the sample data of SED and echo cancellation are constructed separately and correspond to the first sample data and the third sample data respectively.
[0197] Step 1102, concatenating the first sample data and the remote reference sample signal in the third sample data in a batch dimension as first sample input data;
[0198] Based on the first sample data, construct zero-value data having the same dimension as the first sample data, or duplicate data of the second sample data, to obtain fourth sample data,
[0199] The fourth sample data and the near-end microphone sample signal in the third sample data are concatenated together in a batch dimension as the second sample input data.
[0200] Step 1103: input the first sample input data and the second sample input data into the cascader at the same time to perform channel dimension cascading.
[0201] Step 1104, calculating the joint loss function value according to the output results of the SED model to be trained and the echo cancellation model to be trained.
[0202] As an example, the joint loss function value is: the weighted sum of a first loss function value used to characterize the SED result output by the SED model to be trained and the target SED result, and a fourth loss function value used to characterize the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result.
[0203] The mathematical expression is:
[0204] total losss =α1×sed_loss+α4×echo_loss
[0205] Among them, total_losss is the joint loss function value, sed_loss is the first loss function value, echo_loss is the fourth loss function value, α1 and α4 are weighting coefficients, which are generally set to 1. Different weighting coefficients can also be set according to the sample size, training difficulty, and importance of different tasks.
[0206] As an example, the first loss function value is a cross entropy loss function value (CE Loss, Cross Entropy Loss), and the fourth loss function value is a scale invariant signal-to-noise ratio loss function value (SISNR Loss, Scale Invariant Signal to Noise Ratio).
[0207] Step 1105, according to the value of the joint loss function, the model parameters of the two models to be trained are adjusted until the expected results are achieved, thereby obtaining the trained models.
[0208] See also Fig.12 As shown, Fig.12 A flow chart of performing inference on a trained model. The method includes:
[0209] Step 1201, obtaining a speech signal to be processed,
[0210] Step 1202: extracting features from the acquired speech signal to be processed to obtain first feature data.
[0211] Step 1203: Use the trained SED model to perform SED detection on the extracted first feature data.
[0212] Step 1204, determine whether a human voice is detected in the SED detection result.
[0213] If yes, then when the echo cancellation trigger signal is received, step 1205 is executed, and when the echo cancellation trigger signal is not received, step 1202 is returned to.
[0214] Otherwise, the audio is compressed and stored, and the process returns to step 1202.
[0215] Step 1205: extract features from the current speech signal to be processed to obtain third feature data.
[0216] Step 1206: Use the trained echo cancellation model to perform echo cancellation processing on the third feature data.
[0217] The above steps 1205 and 1206 are optional steps.
[0218] Embodiment 4
[0219] In this embodiment, the neural network models used for speech processing include two models: a SED model and a speech enhancement model.
[0220] See also Fig.13 As shown, see Fig.13 As shown, Fig.13 This is a schematic diagram of a network structure for jointly training a sound event detection model and a speech enhancement model in Example 4. The network structure includes:
[0221] a cascader for cascading the first sample input data,
[0222] A feature extractor for extracting features from the concatenated sample input data.
[0223] Among them, the sample feature data output by the feature extractor are split into sample feature data corresponding to the sound event detection model to be trained and input into the SED encoder in the sound event detection model to be trained, and the remaining sample feature data are input into the speech enhancement encoder in the speech enhancement model to be trained.
[0224] See also Fig.14 As shown, Fig.14 Based on Fig.14 A schematic diagram of a process of training a model to be trained using a network structure. The training method includes:
[0225] Step 1401, obtaining sample speech data, wherein sample data sets for sound event detection and speech enhancement are constructed separately, corresponding to first sample data and second sample data, respectively.
[0226] Step 1402: concatenate the first sample data and the second sample data in batch dimension as the first sample input data.
[0227] Step 1403, inputting one or more first sample input data into the cascader to perform channel dimension cascading,
[0228] Step 1404, calculate the joint loss function value according to the output results of the SED model to be trained and the speech enhancement model to be trained.
[0229] As an example, the joint loss function value is: the weighted sum of a first loss function value used to characterize the relationship between the SED result output by the SED model to be trained and the target SED result, a second loss function value used to characterize the relationship between the speech enhancement result output by the speech enhancement model to be trained and the target speech enhancement result, and a third loss function value used to characterize the relationship between the VAD result output by the speech enhancement model to be trained and the target VAD result.
[0230] The mathematical expression is:
[0231] total losss =α1×sed_loss+α2×se_loss+α3×se_vad_loss
[0232] Among them, total_losss is the joint loss function value, sed_loss is the first loss function value, se_loss is the second loss function value, se_vad_loss is the third loss function value, α1, α2, α3 are weighting coefficients, which are generally set to 1. Different weighting coefficients can also be set according to the sample size, training difficulty, and importance of different tasks.
[0233] As an example, the first loss function value and the third loss function value are both cross entropy loss function values (CELoss, Cross Entropy Loss), and the second loss function value is a scale invariant signal-to-noise ratio loss function value (SISNR Loss, Scale Invariant Signal to Noise Ratio).
[0234] Step 1405, according to the value of the joint loss function, the model parameters of the two models to be trained are adjusted until the expected results are achieved, thereby obtaining the trained models.
[0235] The trained sound event detection model and speech enhancement model obtained through the above training can be inferred according to steps 601 to 608.
[0236] Embodiment 5
[0237] In this embodiment, the neural network model used for speech processing includes a SED model.
[0238] See also Fig.15 As shown, Fig.15 A schematic diagram of a network structure for training five pairs of SED models. The network structure includes:
[0239] a cascader for cascading the first sample input data,
[0240] A feature extractor for extracting features from the concatenated sample input data.
[0241] The sample feature data output by the feature extractor is input into the encoder in the SED model to be trained.
[0242] See also Fig.16 As shown, Fig.16 Based on Fig.15 A schematic diagram of a process of training a model to be trained using a network structure. The training method includes:
[0243] Step 1601, obtaining sample speech data, wherein SED sample data is constructed separately and corresponds to the first sample data.
[0244] Step 1602: input the first sample data as the first sample input data into the cascader to perform channel dimension cascading.
[0245] Step 1603, based on the SED model to be trained, calculate a first loss function value between the SED result output by the SED model to be trained and the target SED result.
[0246] As an example, the first loss function value is a cross entropy loss function value (CE Loss, Cross EntropyLoss).
[0247] Step 1604: adjust the model parameters of the model to be trained according to the first loss function value until the expected results are achieved, thereby obtaining a trained SED model.
[0248] Embodiment 6
[0249] In this embodiment, the neural network model used for speech processing includes a speech enhancement model.
[0250] See also Fig.17 As shown, Fig.17 A schematic diagram of a network structure for training six pairs of speech enhancement models. The network structure includes:
[0251] a cascader for cascading the first sample input data,
[0252] A feature extractor for extracting features from the concatenated sample input data.
[0253] The sample feature data output by the feature extractor is input into the encoder in the speech enhancement model to be trained.
[0254] See also Fig.18 As shown, Fig.18 Based on Fig.17 A schematic diagram of a process of training a model to be trained using a network structure. The training method includes:
[0255] Step 1801, obtaining sample speech data, wherein speech enhancement is constructed separately, corresponding to the second sample data.
[0256] Step 1802: input the second sample data as the first sample input data into the cascader to perform channel dimension cascading.
[0257] Step 1803, based on the output result of the speech enhancement model to be trained, calculate the second loss function value used to characterize the difference between the speech enhancement result output by the speech enhancement model to be trained and the target speech enhancement result, and the third loss function value used to characterize the difference between the VAD result output by the speech enhancement model to be trained and the target VAD result.
[0258] As an example, the third loss function value is a cross entropy loss function value (CE Loss, Cross Entropy Loss), and the second loss function value is a scale invariant signal-to-noise ratio loss function value (SISNR Loss, Scale Invariant Signal to Noise Ratio).
[0259] Step 1804, according to the second loss function value and the third loss function value, adjust the model parameters of the model to be trained until the expected results are achieved, thereby obtaining a trained speech enhancement model.
[0260] Embodiment 7
[0261] In this embodiment, the neural network model used for speech processing includes an echo cancellation model.
[0262] See also Fig.19 As shown, Fig.19 A schematic diagram of a network structure for training seven pairs of echo cancellation models. The network structure includes:
[0263] a cascader for cascading the first sample input data and the second sample input data,
[0264] A feature extractor for extracting features from the concatenated sample input data.
[0265] The sample feature data output by the feature extractor is input to the echo encoder in the echo cancellation model to be trained.
[0266] See also Fig. 20 As shown, Fig. 20 Based on Fig.19 A schematic diagram of a process of training a model to be trained using a network structure. The training method includes:
[0267] Step 2001: Acquire sample speech data, wherein the sample data for echo cancellation is constructed separately and corresponds to the third sample data.
[0268] Step 2002: Use the far-end reference sample signal in the third sample data as the first sample input data; and use the near-end microphone sample signal in the third sample data as the second sample input data.
[0269] Step 2003: input the first sample input data and the second sample input data into the cascader at the same time to perform channel dimension cascading.
[0270] Step 2004: Calculate, based on the output result of the echo cancellation model to be trained, a fourth loss function value for characterizing the difference between the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result.
[0271] As an example, the fourth loss function values are all scale invariant signal-to-noise ratio loss function values (SISNR Loss, Scale Invariant Signal to Noise Ratio).
[0272] Step 2005: According to the fourth loss function value, the model parameters of the model to be trained are adjusted until the expected results are achieved, thereby obtaining a trained speech enhancement model.
[0273] See also Fig.21 As shown, Fig.21 A schematic diagram of a training device for a neural network model for speech processing according to an embodiment of the present application, the device comprising:
[0274] A sample acquisition module is used to select corresponding sample data according to at least one model to be trained, wherein the sample data of each model to be trained is constructed separately, and the selected sample data are cascaded in batch dimension to obtain a first sample speech signal and a first sample input data,
[0275] a cascade device, configured to cascade the first sample input data of the first sample voice signal to obtain cascaded sample voice signal sample input data,
[0276] A feature extractor is used to extract features based on the cascaded sample speech signal sample input data to obtain sample feature data that can be shared by each model to be trained.
[0277] The training module is used to input the extracted sample feature data into the model to be trained, and adjust the model parameters of the model to be trained according to the loss function value between the output result of the model to be trained and the target result, until the model to be trained meets the expectations.
[0278] See also Fig. 22 As shown, Fig. 22 A schematic diagram of an inference device for a neural network model for speech processing, the device comprising:
[0279] The acquisition module is used to obtain the voice data to be processed.
[0280] The speech processing module uses the trained neural network model for speech processing to process the speech data.
[0281] in,
[0282] The neural network model used for speech processing is trained using the steps of the training method described in the embodiment of the present application.
[0283] Preferably, the neural network model for speech processing comprises: a trained sound event detection model and a trained speech enhancement model.
[0284] The speech processing module comprises:
[0285] The first feature extraction submodule is used to extract features from the acquired speech data to be processed to obtain first feature data.
[0286] The sound event detection submodule is used to perform sound event detection on the first feature data using the trained sound event detection model.
[0287] The second feature extraction submodule is used to extract features from the speech data to be processed to obtain second feature data when a target sound event is detected.
[0288] The speech enhancement submodule is used to perform speech enhancement processing on the second feature data using the trained speech enhancement model.
[0289] The speech enhancement submodule also includes a method for detecting human voice activity on the second feature data using the trained speech enhancement model.
[0290] The device also includes:
[0291] The third feature extraction submodule is used to extract features of the speech signal to be processed to obtain third feature data when the speech enhancement module detects human voice activity.
[0292] The echo cancellation submodule is used to perform echo cancellation processing on the third feature data using the trained echo cancellation model.
[0293] See also Fig.23 As shown, Fig.23 Another schematic diagram of an inference device for a neural network model for speech processing and / or a training device for a neural network model for speech processing according to an embodiment of the present application. The memory stores a computer program, and the processor is configured to execute the computer program to implement at least one of the steps of the training method and the steps of the inference method according to the embodiment of the present application.
[0294] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0295] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0296] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it implements at least one of the steps of the training method and the steps of the reasoning method of the embodiment of the present application.
[0297] As for the apparatus / network-side device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0298] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0299] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A training method for a neural network model for speech processing, It is characterized in that The method includes: According to at least one model to be trained, sample data corresponding to the model to be trained is selected, wherein the sample data of each model to be trained is constructed separately, The selected sample data is concatenated in batch dimension to obtain the first sample input data. The first sample input data is cascaded in the channel dimension to obtain the cascaded sample input data. Based on the cascaded sample input data, feature extraction is performed to obtain sample feature data that can be shared by each model to be trained. Input the extracted sample feature data into the model to be trained. According to the loss function value between the output result of the model to be trained and the target result, the model parameters of the model to be trained are adjusted until the model to be trained meets the expectations.
2. The training method according to claim 1, It is characterized in that The performing channel dimension cascading on the first sample input data comprises: fusing more than one first sample input data, The fused data is sequentially subjected to a first convolution operation, an activation function operation, a batch sample normalization operation, and a second convolution operation; The feature extraction based on the cascaded sample input data includes: Perform at least one convolution operation on the cascaded sample input data; The neural network model for speech processing includes: at least one of other models except the echo cancellation model and the echo cancellation model for echo cancellation; The sample data includes: third sample data corresponding to the echo cancellation model to be trained, wherein the third sample data includes: a near-end microphone sample signal and a far-end reference sample signal.
3. The training method according to claim 2, It is characterized in that In the case where the model to be trained includes only the echo cancellation model to be trained, the step of cascading the selected sample data in a batch dimension includes: The remote reference sample signals in the third sample data are concatenated in batch dimension to obtain the first sample input data. Cascading the near-end microphone sample signals in the third sample data in a batch dimension to obtain second sample input data; In the case where the model to be trained includes more than just the echo cancellation model to be trained, the step of cascading the selected sample data in a batch dimension includes: The selected sample data is cascaded with the remote reference sample signal in the third sample data in batch dimension to obtain the first sample input data, Construct zero-value data with the same dimensions as the selected sample data or a copy of the selected sample data, The constructed data is cascaded with the near-end microphone sample signal in the third sample data in a batch dimension to obtain second sample input data.
4. The training method according to claim 3, It is characterized in that The performing channel dimension cascading on the first sample input data further includes: Cascading the first sample input data and the second sample input data; In the case where the model to be trained includes any model to be trained except the echo cancellation model to be trained, and the echo cancellation model to be trained: The step of inputting the extracted sample feature data into the model to be trained comprises: Input the extracted sample feature data to an encoder in a model to be trained other than the echo cancellation model to be trained, segment the sample feature data corresponding to the model to be trained from the sample feature data output by the encoder, and input the remaining sample feature data to the encoder in the echo cancellation model to be trained; The loss function value between the output result of the model to be trained and the target result includes: According to the output results of the model to be trained and the echo cancellation model to be trained, the value of the joint loss function is calculated. Among them, the joint loss function value is: the weighted sum of the fourth loss function value used to characterize the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result, and the loss function value used to characterize the output result of the model to be trained and the target result.
5. The training method according to claim 4, It is characterized in that The cascading the first sample input data and the second sample input data comprises: The first sample input data and the second sample input data are fused, The fused data is sequentially subjected to a first convolution operation, an activation function operation, a batch sample normalization operation, and a second convolution operation; The any model to be trained is any model to be trained among a sound event detection model to be trained and a speech enhancement model to be trained, In the case where the models to be trained include a sound event detection model to be trained, a speech enhancement model to be trained, and an echo cancellation model to be trained: The step of inputting the extracted sample feature data into the model to be trained comprises: The sample feature data corresponding to the sound event detection model to be trained are cut out from the extracted sample feature data, the cut sample feature data are input into the encoder in the sound event detection model to be trained, and the remaining sample feature data are input into the encoder in the speech enhancement model to be trained, Slice sample feature data corresponding to the sound event detection model to be trained from the sample feature data output by the encoder in the speech enhancement model to be trained, and then input the remaining sample feature data in the sample feature data output by the encoder in the speech enhancement model to be trained into the encoder in the echo cancellation model to be trained; The loss function value between the output result of the model to be trained and the target result includes: Calculate the joint loss function value based on the output results of the sound event detection model to be trained, the speech enhancement model to be trained, and the echo cancellation model to be trained. Among them, the joint loss function value is: the weighted sum of the first loss function value used to characterize the difference between the sound event detection result output by the sound event detection model to be trained and the target sound event detection result, the second loss function value used to characterize the difference between the speech enhancement result output by the speech enhancement model to be trained and the target speech enhancement result, and the fourth loss function value used to characterize the difference between the echo cancellation result output by the echo cancellation model to be trained and the target echo cancellation result.
6. The training method according to claim 2 or 5, It is characterized in that In the case where the models to be trained include two or more models to be trained in addition to the echo cancellation model to be trained: The selected sample data is concatenated in batch dimension to obtain the first sample input data, including: The sample data corresponding to each model to be trained are concatenated in batch dimension to obtain the first sample input data. The step of inputting the extracted sample feature data into the model to be trained comprises: Segmenting the sample feature data corresponding to each model to be trained from the extracted sample feature data, and inputting the segmented sample feature data into the corresponding model to be trained; The loss function value between the output result of the model to be trained and the target result includes: Calculate the loss function value of each model to be trained, The calculated loss function values are weighted and summed to obtain the joint loss function value.
7. The training method according to claim 6, It is characterized in that The other two or more models to be trained include: a sound event detection model to be trained, and a speech enhancement model to be trained, and the speech enhancement model to be trained also includes: a classifier for human voice activity detection, The joint loss function value also includes a weighted summation result of a third loss function value used to characterize the human voice activity detection result output by the speech enhancement model to be trained and the target human voice activity detection result; The sample data also includes: first sample data corresponding to the sound event detection model to be trained, second sample data corresponding to the speech enhancement model to be trained, in, The first sample data contains voice sample data of a sound event. The second sample data contains speech sample data containing noise.
8. The training method according to claim 7, It is characterized in that The second sample data is obtained as follows: According to the noisy sample speech signal, the power of the noisy sample speech signal is calculated, According to the noise-free sample speech signal, the power of the noise-free sample speech signal is calculated, The scaling factor is calculated according to the set signal-to-noise ratio, the power of the noisy sample speech signal, and the power of the noise-free sample speech signal. Determining a noisy speech sample signal using the scaling factor; The third data is obtained as follows: The far-end reference sample signal is convolved with the room impulse response function to obtain the echo sample signal. The echo sample signal is superimposed with the near-end user sample signal to obtain a near-end microphone sample signal.
9. A training device for a neural network model for speech processing, It is characterized in that The device includes: A sample acquisition module is used to select corresponding sample data according to at least one model to be trained, wherein the sample data of each model to be trained is constructed separately, and the selected sample data is cascaded in batch dimension to obtain first sample input data. A cascader is used to perform channel-dimensional cascading on the first sample input data to obtain cascaded sample input data, The feature extractor is used to extract features based on the cascaded sample input data to obtain sample feature data that can be shared by each model to be trained. The training module is used to input the extracted sample feature data into the model to be trained, and adjust the model parameters of the model to be trained according to the loss function value between the output result of the model to be trained and the target result, until the model to be trained meets the expectations.
10. An inference method for a neural network model for speech processing, It is characterized in that The method includes: Get the voice data to be processed. The trained neural network model for speech processing is used to process the speech data to be processed. in, The neural network model for speech processing is trained using the steps of the training method as claimed in any one of claims 1 to 8.
11. The inference method according to claim 10, It is characterized in that The neural network model for speech processing includes: a trained sound event detection model and a trained speech enhancement model. The method of performing speech processing on the speech data to be processed by using the trained neural network model for speech processing comprises: Extracting features from the acquired speech data to be processed to obtain first feature data, Using the trained sound event detection model, performing sound event detection on the first feature data, When a target sound event is detected, feature extraction is performed on the speech data to be processed to obtain second feature data. The trained speech enhancement model is used to perform speech enhancement processing on the second feature data.
12. The inference method according to claim 11, It is characterized in that The neural network model for speech processing also includes a trained echo cancellation model, The method further comprises: Using the trained speech enhancement model, the second feature data is used to detect human voice activity. When human voice activity is detected, the step of extracting features from the acquired speech data to be processed is performed, or feature extraction is performed on the speech signal to be processed to obtain third feature data, and the third feature data is echo-cancelled using the trained echo cancellation model.
13. An inference device for a neural network model for speech processing, It is characterized in that The device includes: The acquisition module is used to obtain the voice data to be processed. The speech processing module uses the trained neural network model for speech processing to process the speech data. in, The neural network model for speech processing is trained using the steps of the training method as claimed in any one of claims 1 to 8.
14. The inference device according to claim 13, It is characterized in that The neural network model for speech processing includes: a trained sound event detection model and a trained speech enhancement model. The speech processing module comprises: The first feature extraction submodule is used to extract features from the acquired speech data to be processed to obtain first feature data. The sound event detection submodule is used to perform sound event detection on the first feature data using the trained sound event detection model. The second feature extraction submodule is used to extract features from the speech data to be processed to obtain second feature data when a target sound event is detected. The speech enhancement submodule is used to perform speech enhancement processing on the second feature data using the trained speech enhancement model.
15. The inference device according to claim 14, It is characterized in that The speech enhancement submodule also includes a method for detecting human voice activity on the second feature data using the trained speech enhancement model. The device also includes: The third feature extraction submodule is used to extract features of the speech signal to be processed to obtain third feature data when the speech enhancement module detects human voice activity. The echo cancellation submodule is used to perform echo cancellation processing on the third feature data using the trained echo cancellation model.
