Speech recognition network, method, device and medium based on cross-layer connection attention

By introducing a cross-layer connection module into the Transformer encoder-decoder structure, learning the intermediate attention map information of the previous encoding layer, the problem of insufficient attention map in the existing technology is solved, significantly improving the accuracy of speech recognition, and achieving more Accurate contextual relationship representation.

CN114360507BActive Publication Date: 2024-11-01EEASY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111577740.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2024-11-01
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

The attention map in the existing Transformer-based speech recognition system is not sufficient to accurately represent the contextual relationship of input features, resulting in limited speech recognition accuracy.

Method used

Using a Transformer-based encoder-decoder structure, the intermediary attention map information of the previous encoding layer is learned between each encoding layer through a cross-layer connection module, and a more accurate attention map is generated, thereby improving the accuracy of speech recognition.

Benefits of technology

With almost no increase in the number of parameters, the accuracy of speech recognition is significantly improved, and through experimental verification, the optimized attention map can better represent context dependencies and improve the recognition effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114360507B_ABST
    Figure CN114360507B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of speech recognition technology, and provides a speech recognition network, method, device and storage medium based on cross-layer connection attention. The speech recognition network is constructed based on the encoder-decoder structure of Transformer. The Transformer encoder of the speech recognition network includes multiple coding layers, and cross-layer connection modules are connected between adjacent coding layers. The coding layer is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module when generating an attention map, so that the attention map generated by each coding layer can more accurately represent the context dependency, thereby significantly improving the speech recognition accuracy of the speech recognition network with an almost negligible increase in the number of parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of speech recognition technology, and in particular relates to a speech recognition network, method, device and storage medium based on cross-layer connection attention. Background Art

[0002] With the rapid development of deep learning technology in recent years, the development speed of speech recognition technology has reached a new height, especially end-to-end speech recognition technology has become a hot research topic in recent years. The end-to-end speech recognition system integrates the acoustic module, language module, and pronunciation dictionary into a deep neural network structure, making the model more concise and more conducive to parameter optimization. End-to-end speech recognition systems are mainly divided into neural network structures based on CTC (Graves, Alex, et al. "Connectionist temporal classification: labelling unsegmented sequence datawith recurrent neural networks." Proceedings of the 23rd internationalconference on Machine learning. 2006.), RNN Transducer (Graves, Alex, Abdel-rahman Mohamed, and Geoffrey Hinton. "Speech recognition withdeep recurrent neural networks." 2013 IEEE international conference onacoustics, speech and signal processing. Ieee, 2013.) structures, and encoder-decoder structures based on attention mechanisms (Chan, William, et al. "Listen, attend and spell." arXiv preprintarXiv:1508.01211 (2015).) structures. Transformer (Vaswani, Ashish, et al. "Attention is all you need." Advances in neural information processing systems. 2017.) is a codec structure based on the self-attention mechanism. It was first proposed in the field of machine translation and has achieved outstanding results in the field of speech recognition in recent years. The key factor in the effectiveness of the Transformer structure is the multi-head self-attention mechanism, which calculates and generates an attention map to represent the strength of the correlation dependency between each feature in the input sequence. Therefore, the effectiveness of the attention map largely determines the effect of the Transformer.However, many recent studies have shown that the attention map of the traditional Transformer is not sufficient to represent more accurate contextual relationships. In order to better capture contextual relationships, Conformer (Gulati, Anmol, et al. "Conformer: Convolution-augmented transformerfor speech recognition." arXiv preprint arXiv:2005.08100 (2020).) adds a convolutional neural network layer after the self-attention layer to enhance the network's learning of local information. However, this method does not directly optimize the attention map, and the additional convolutional neural network layer increases the number of parameters. The method of Xu et al. (Xu, Menglong, Shengqiang Li, and Xiao-Lei Zhang. "Transformer-based end-to-end speech recognition with local dense synthesizer attention." ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing(ICASSP). IEEE, 2021.) directly generates attention maps through a two-layer feedforward neural network. However, this method of generating attention maps through fixed parameters is not as robust as the method of adaptively generating by the attention mechanism. Summary of the invention

[0003] The purpose of the present invention is to provide a speech recognition network, method, device and storage medium based on cross-layer connection attention, aiming to solve the problem that the attention map of the Transformer-based speech recognition system in the prior art is not effective enough and cannot accurately represent the contextual relationship of the input features.

[0004] On the one hand, the present invention provides a speech recognition network based on cross-layer connection attention, wherein the speech recognition network is constructed based on the encoder-decoder structure of Transformer, and the Transformer encoder of the speech recognition network includes multiple encoding layers, and cross-layer connection modules are connected between adjacent encoding layers. The encoding layer is used to learn the information of the intermediate attention map of the previous encoding layer through the cross-layer connection module when generating an attention map.

[0005] Specifically, each of the coding layers includes an attention map generation module, which is used to learn the convolutional inductive bias of the intermediate attention map of the previous coding layer through the cross-layer connection module, and obtain the attention map of the coding layer using the Softmax function based on the convolutional inductive bias, the intermediate attention map of the coding layer and preset parameters. The intermediate attention map of each coding layer is the intermediate output of the attention map generation module of the coding layer before the Softmax function.

[0006] Preferably, the cross-layer connection module is a convolution kernel with a size of A two-dimensional convolutional layer.

[0007] Preferably, the speech recognition network includes a downsampling layer, the Transformer encoder, a Transformer decoder and a Softmax classification layer connected in sequence, the Transformer encoder includes 12 encoding layers, adjacent encoding layers are connected with the cross-layer connection module, and the Transformer decoder includes 6 decoding layers.

[0008] On the other hand, the present invention provides a speech recognition method based on the above-mentioned speech recognition network, the method comprising:

[0009] Preprocessing the speech to be recognized to obtain speech features of the speech to be recognized;

[0010] The speech features are input into the trained speech recognition network to obtain a speech recognition result.

[0011] Preferably, the preprocessing includes a cepstral mean variance normalization operation, the speech features include 80-dimensional Fbank features and 3-dimensional pitch features, and the Transformer decoder in the speech recognition network uses a beam search algorithm with a beam width of 5 for decoding to obtain the speech recognition result.

[0012] Specifically, the method further includes:

[0013] Get the training set;

[0014] Preprocessing the speech in the training set to obtain speech features of each speech;

[0015] Based on the speech features of each speech, the speech recognition network is trained to obtain the trained speech recognition network.

[0016] Preferably, the loss function used in training the speech recognition network is a cross entropy loss function, and before the step of training the speech recognition network, the step includes:

[0017] The speech features are enhanced to train the speech recognition network according to the enhanced speech features, wherein the enhancement processing includes speed disturbance and SpecAugment processing.

[0018] On the other hand, the present invention also provides a speech recognition device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0019] On the other hand, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0020] The speech recognition network of the present invention is constructed based on the encoder-decoder structure of Transformer. The Transformer encoder of the speech recognition network includes multiple coding layers. Cross-layer connection modules are connected between adjacent coding layers. The coding layer is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module when generating an attention map, so that the attention map generated by each coding layer can more accurately represent the context dependency, thereby significantly improving the speech recognition accuracy of the speech recognition network with an almost negligible increase in the number of parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a structural diagram of a speech recognition network based on cross-layer connection attention provided in Embodiment 1 of the present invention;

[0022] Figure 2 is a flow chart for implementing a network training method for a speech recognition network based on cross-layer connection attention provided in Embodiment 2 of the present invention;

[0023] Figure 3 is a flow chart for implementing a speech recognition method based on a cross-layer connected attention speech recognition network provided in Embodiment 3 of the present invention;

[0024] Figure 4A The fourth embodiment of the present invention provides a different The character error rate performance of the speech recognition network based on cross-layer connection attention on the validation set;

[0025] Figure 4B is a visualization effect diagram of the attention map under different models provided in the fourth embodiment of the present invention; and

[0026] Figure 5 It is a structural diagram of a speech recognition device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0028] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments:

[0029] Embodiment 1:

[0030] Figure 1 The structural diagram of the speech recognition network based on cross-layer connection attention provided in the first embodiment of the present invention is shown for the convenience of explanation, and only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0031] The speech recognition network based on cross-layer connection attention provided by the embodiment of the present invention is constructed based on the encoder-decoder structure of Transformer. The Transformer encoder 10 of the speech recognition network 1 includes multiple encoding layers 101, such as Figure 1 As shown, adjacent coding layers 101 of the speech recognition network 1 are connected with a cross-layer connection module 102. The coding layer 101 is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module 102 when generating the attention map, so that the attention map generated by each coding layer 101 can more accurately represent the context dependency, thereby significantly improving the speech recognition accuracy of the speech recognition network with an almost negligible increase in the amount of parameters.

[0032] Preferably, the speech recognition network includes a downsampling layer, a Transformer encoder, a Transformer decoder and a Softmax classification layer connected in sequence, the Transformer encoder includes 12 encoding layers, and a cross-layer connection module is connected between adjacent encoding layers. The Transformer decoder includes 6 decoding layers, so as to determine the specific composition of the encoder and decoder in the speech recognition network through experimental data. Among them, the downsampling layer is used to downsample the input speech features to reduce the length of the speech features. Specifically, the downsampling layer can usually be composed of 2 convolutional layers with a step size of 2.

[0033] Specifically, each coding layer includes an attention map generation module, and the attention map generation module of each coding layer is used to learn the convolutional inductive bias of the intermediate attention map of the previous coding layer through the cross-layer connection module. Based on the convolutional inductive bias, the intermediate attention map of the coding layer and the preset parameters, the attention map of the coding layer is obtained using the Softmax function. The intermediate attention map of each coding layer is the intermediate output of the attention map generation module of the coding layer before the Softmax function. Specifically, the preset parameter is the weight parameter of the intermediate attention map of the coding layer, and the sum of the weight parameter of the convolutional inductive bias and the weight parameter of the intermediate attention map of the coding layer is 1. Preferably, the preset parameter is 0.8, so as to set the above preset parameters according to experimental results.

[0034] Preferably, each cross-layer connection module is a convolution kernel with a size of A two-dimensional convolution layer is used to set the size of the convolution kernel according to the experimental results to optimize the performance of the speech recognition network.

[0035] If the cross-layer connection model is a convolutional layer, then for the attention map generation module of any encoding layer except the first encoding layer, the generated attention map is calculated as follows:

[0036]

[0037]

[0038] Among them, A represents the attention map generated by the attention map generation module, express function, The function is used to normalize the attention scores and make them sum to 1 to prevent the gradient disappearance problem. Indicates the above preset parameters, represents the above convolutional inductive bias, represents the intermediate attention map of the encoding layer, represents the intermediate attention map of the previous encoding layer of this encoding layer, Represents a convolution operation.

[0039] In a specific implementation, each encoding layer may include an attention map generation module, a value prediction module, and a feedforward neural network module. Among them, the attention map generation module usually adopts a multi-head self-attention mechanism to generate an attention map used to represent the contextual relationship by means of vector dot product. The calculation method of the attention map is as follows:

[0040]

[0041]

[0042]

[0043]

[0044] in, , Indicates The query vector and key vector corresponding to the attention head, , represents the parameters of the linear projection layer, Represents the model dimension, Indicates Attention head, take , represents the number of attention heads, Indicates The intermediate attention map learned by the attention heads, represents the scaling factor, Represents the concatenation operation, the final intermediate attention map Intermediate attention map obtained by each attention head Then, based on the intermediate feature maps of the current layer and the previous layer, The function can get the attention map .

[0045] Getting the attention map After that, the value prediction module performs the following calculations:

[0046]

[0047]

[0048]

[0049] in, Indicates The value vector corresponding to the attention head, are the parameters of the linear mapping layer, Multiple attention heads The output of the value prediction module is obtained by splicing Depend on and attention map After point multiplication, the parameters are The linear layer is obtained.

[0050] Finally, the output of the entire encoding layer is composed of the output of the value prediction module After the feedforward neural network module, it is obtained. The feedforward neural network module consists of two linear layers with a ReLU activation function in the middle. The output calculation process of the entire encoding layer is as follows:

[0051]

[0052] in, represents the output of the encoding layer, , , , , Represents the intermediate feature dimension.

[0053] In an embodiment of the present invention, a speech recognition network is constructed based on a Transformer encoder-decoder structure. The Transformer encoder of the speech recognition network includes multiple coding layers. Adjacent coding layers are connected by cross-layer connection modules. The coding layer is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module when generating an attention map, so that the attention map generated by each coding layer can more accurately represent the context dependency, thereby significantly improving the speech recognition accuracy of the speech recognition network with an almost negligible increase in the amount of parameters.

[0054] Embodiment 2:

[0055] Figure 2 The implementation process of the network training method of the speech recognition network based on cross-layer connection attention provided by the second embodiment of the present invention is shown. For the convenience of explanation, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0056] In step S201, a training set is obtained.

[0057] The embodiments of the present invention are applicable to speech recognition devices, which may be mobile phones, tablet computers, wearable devices, smart speakers, vehicle-mounted devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and other devices. The embodiments of the present application do not impose any restrictions on the specific types of speech recognition devices.

[0058] In an embodiment of the present invention, the above-mentioned training set can be obtained based on the AISHELL-1 (Bu, Hui, et al. "Aishell-1: An open-source mandarin speech corpus and a speech recognition baseline." 2017 20th Conference of the Oriental Chapter of the InternationalCoordinating Committee on Speech Databases and Speech I / O Systems andAssessment (O-COCOSDA). IEEE, 2017.) data set, Magicdata data set, etc.

[0059] In step S202, the speech in the training set is preprocessed to obtain speech features of each speech.

[0060] In an embodiment of the present invention, the audio may be processed using a Kaldi speech toolkit or the like to obtain speech features consisting of 80-dimensional Fbank features and 3-dimensional pitch features. The frame length and time displacement of the speech may be set to 25ms and 10ms, and then the global cepstrum mean variance normalization operation (CMVN) may be used to normalize the above speech features to obtain the final speech features. Of course, the above speech features may also be MFCC (Mel Frequency Cepstrum Coefficient, Mel frequency cepstrum coefficient) features, etc., which are not limited here.

[0061] Before the speech features are input into the speech recognition network, preferably, the speech features are enhanced to train the speech recognition network according to the enhanced speech features, thereby improving the robustness of the speech recognition network. The enhancement process includes speed perturbation and SpecAugment processing.

[0062] In step S203, the speech recognition network is trained based on the speech features of each speech to obtain a trained speech recognition network.

[0063] In an embodiment of the present invention, the speech recognition network is a speech recognition network based on cross-layer connection provided in Embodiment 1. The loss function used for training the speech recognition network may be a cross-entropy loss function. Of course, the speech recognition network may also be jointly trained using a loss function consisting of a time series classification loss (CTC) function and a cross-entropy loss (CE) function. Specifically, the Transformer encoder may use a connection time series classification loss, and the Transformer decoder may use a cross-entropy loss, and corresponding parameters are assigned to the two losses respectively.

[0064] In an embodiment of the present invention, a training set is obtained, the speech in the training set is preprocessed to obtain the speech features of each speech, and based on the speech features of each speech, a speech recognition network is trained to obtain a trained speech recognition network, thereby realizing the training of the speech recognition network based on cross-layer connection attention.

[0065] Embodiment three:

[0066] Figure 3 The implementation process of the speech recognition method based on cross-layer connection attention provided by the third embodiment of the present invention is shown. For the convenience of explanation, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0067] In step S301, the speech to be recognized is preprocessed to obtain speech features of the speech to be recognized.

[0068] In an embodiment of the present invention, the audio may be processed using a Kaldi speech toolkit or the like to obtain speech features consisting of 80-dimensional Fbank features and 3-dimensional pitch features. The frame length and time displacement of the speech may be set to 25ms and 10ms, and then the global cepstrum mean variance normalization operation (CMVN) may be used to normalize the speech features to improve the noise robustness of the speech features. Of course, the above-mentioned speech features may also be MFCC (Mel Frequency Cepstrum Coefficient, Mel frequency cepstrum coefficient) features, etc., which are not limited here.

[0069] In step S302, the speech features are input into the trained speech recognition network to obtain a speech recognition result.

[0070] In the embodiment of the present invention, the method described in the second embodiment can be used to obtain a trained speech recognition network. When the Transformer decoder uses the beam search algorithm for decoding, the beam width can be set according to actual needs. Preferably, the Transformer decoder in the speech recognition network uses the beam search algorithm with a beam width of 5 for decoding, so as to determine the beam width of the beam search algorithm according to experimental results to obtain better speech recognition results.

[0071] In an embodiment of the present invention, the speech to be recognized is preprocessed to obtain speech features of the speech to be recognized, and the speech features are input into a trained speech recognition network to obtain a speech recognition result, wherein the speech recognition network is constructed based on the encoder-decoder structure of Transformer, and a cross-layer connection module is connected between adjacent coding layers of the speech recognition network. The coding layer is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module when generating an attention map, so that the attention map generated by each coding layer can more accurately represent the context dependency, thereby significantly improving the speech recognition accuracy of the speech recognition network with an almost negligible increase in the amount of parameters.

[0072] Embodiment 4:

[0073] This embodiment further verifies and explains the above-mentioned speech recognition network based on cross-layer connection attention in combination with experimental examples.

[0074] (1) Dataset used in this experiment

[0075] The AISHELL-1 (Bu, Hui, et al. "Aishell-1: An open-source mandarin speechcorpus and a speech recognition baseline." 2017 20th Conference of theOriental Chapter of the International Coordinating Committee on SpeechDatabases and Speech I / O Systems and Assessment (O-COCOSDA). IEEE, 2017.) dataset contains 11 scenarios including smart home, unmanned driving, industrial production, etc. The recording process was carried out in a quiet indoor environment, and three different devices were used for collection: high-fidelity microphone (44.1kHz, 16-bit); Android phone (16kHz, 16-bit); iOS phone (16kHz, 16-bit). The dataset has about 400 speakers from different regions of China participating in the recording, including about 150 hours of training set, 10 hours of validation set and 5 hours of test set.

[0076] The Magicdata dataset includes multiple scenarios such as interactive question and answer, music search, SNS information, home command and control, etc. The recording process was conducted in a quiet indoor environment, with about 1,080 speakers from different accent regions in China participating in the recording, including about 710 hours of training set, 15 hours of validation set and 30 hours of test set.

[0077] (2) Experimental description

[0078] The experiments and tests in this experimental example all use a deep learning framework based on Pytorch. The speech recognition network based on cross-layer connection attention consists of 12 encoding layers and 6 decoding layers. All multi-head self-attention is set to 4 heads. The model dimension is 256, and the convolution kernel size of the convolution layer in the cross-layer connection module is , the intermediate feature dimension of the feedforward neural network module is 2048. In the training, the Adam (Kingma, Diederik P., and Jimmy Ba. "Adam: A methodfor stochastic optimization." arXiv preprint arXiv:1412.6980 (2014).) optimization algorithm is used to optimize the model parameters. Specifically, the number of warm-up steps is set to 25000. The total number of iterations on the AISHELL-1 dataset is 50, and the total number of iterations on the Magicdata dataset is 30. During the training process, the batch size is dynamically determined according to the length of the input audio sequence to improve training efficiency. In this experimental example, the character error rate (CER) is used as an evaluation indicator to measure the performance of different methods. All experiments were completed on a machine with 3 NVIDIA GeForce RTX 3090 GPUs.

[0079] (3) Experimental results

[0080] To determine the hyperparameters The impact of different The character error rate performance of the speech recognition network provided in the following embodiment 1 on the validation set is selected with the lowest CER. For subsequent experiments. The value is taken from 0.6 to 1 with an interval of 0.1. When it is equal to 1, it is equivalent to the ordinary Transformer structure. The experimental results are as follows Figure 4A As shown, when When α is equal to 0.8, the speech recognition network based on cross-layer connection attention shows the lowest character error rate on the AISHELL-1 validation set. The average value is 0.8.

[0081] Table 1: Comparison of experimental results of different models on the AISHELL-1 dataset

[0082]

[0083] As shown in Table 1, this experimental example compares the speech recognition network based on cross-layer connection attention with other advanced methods on the AISHELL-1 dataset. The baseline model for speech recognition in this experimental example is the Transformer speech recognition model implemented on the ESPnet speech toolkit (the "Transformer (we implement)" row in Table 1). Except that the cross-layer connection attention mechanism is not used, all other settings are the same as the cross-layer connection attention Transformer of the present invention. In the absence of an additional language model, its character error rate on the AISHELL-1 test set reaches 6.78%, and its recognition effect is better than TDNN-LFMMI (Bu, Hui, et al. "Aishell-1: An open-source mandarin speechcorpus and a speech recognition baseline." 2017 20th Conference of theOriental Chapter of the International Coordinating Committee on SpeechDatabases and Speech I / O Systems and Assessment (O-COCOSDA). IEEE, 2017.), which is relatively reduced by 11.02%. Due to the improvement in the effectiveness of the attention map brought about by cross-layer connection attention, the speech recognition network proposed in Example 1 (the "Cross-layer Connection Attention Transformer" row in Table 1) has a significantly lower character error rate than the above-mentioned baseline model (the test set CER dropped from 6.78% to 6.46%), a relative reduction of 4.72%.

[0084] Table 2: Comparison of experimental results of different models on Magicdata dataset

[0085]

[0086] The results on the Magicdata dataset are shown in Table 2. The speech recognition network provided in Example 1 achieves a validation set CER of 5.27% and a test set CER of 5.61%. Compared with the above-mentioned benchmark model, the speech recognition network provided in Example 1 can achieve a relative CER reduction of 2.94% on the test set.

[0087] As shown in Table 3, the cross-layer connection module is crucial for the speech recognition network provided in Example 1 to achieve good performance. The convolution kernel replaces When the convolution kernel is increased, the performance will drop significantly. Compared with the above baseline model, the convolution kernel also has a significant reduction in character error rate, but it will cause a large increase in the number of parameters. Overall, the convolution module only adds a few parameters, but brings a significant reduction in character error rate.

[0088] Table 3: Impact of the cross-layer connection module on the performance of the speech recognition network provided in Example 1

[0089]

[0090] In addition, this experimental example also performs a visual analysis of the attention map. Figure 4B The attention graphs of the lowest layer (layer 1), the middle layer (layer 6) and the highest layer (layer 12) of the above-mentioned baseline model (Figure a) and the speech recognition network described in Example 1 (Figure b) are respectively shown. As can be seen from the figure, the attention graph of the highest layer of the speech recognition network described in Example 1 is significantly improved. In addition, it can be seen that the lowest layer of the above-mentioned baseline model (traditional Transformer model) did not successfully capture the dependencies between the input features at different times, and its attention graph is very chaotic. In contrast, the lowest layer of the speech recognition network described in Example 1 can already learn local information very well, thereby providing a better basis for the prediction of attention graphs in subsequent layers. Similarly, the intermediate encoding layer of the speech recognition network described in Example 1 is also more inclined to pay attention to local information. From the experimental results, it can be seen that the speech recognition network described in Example 1 correctly recognized the input speech, but the above-mentioned baseline model produced some errors.

[0091] Embodiment five:

[0092] Figure 5 The structure of a speech recognition device provided in Embodiment 5 of the present invention is shown. For the sake of convenience, only the parts related to the embodiment of the present invention are shown.

[0093] The speech recognition device 5 of the embodiment of the present invention includes a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50. When the processor 50 executes the computer program 52, the steps in the above-mentioned method embodiments are implemented, for example: Figure 3 Alternatively, when the processor 50 executes the computer program 52, the functions of the speech recognition network described in the first embodiment are implemented, for example Figure 1 Figure 2. Functionality of a speech recognition network based on cross-layer connected attention.

[0094] In an embodiment of the present invention, a speech recognition network is constructed based on a Transformer encoder-decoder structure. The Transformer encoder of the speech recognition network includes multiple coding layers. Adjacent coding layers are connected by cross-layer connection modules. The coding layer is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module when generating an attention map, so that the attention map generated by each coding layer can more accurately represent the context dependency, thereby significantly improving the speech recognition accuracy of the speech recognition network with an almost negligible increase in the amount of parameters.

[0095] Embodiment six:

[0096] In an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps in the above method embodiment are implemented, such as Figure 3 Alternatively, when the computer program is executed by a processor, the functions of the speech recognition network described in the first embodiment are realized, for example Figure 1 Figure 2. Functionality of a speech recognition network based on cross-layer connected attention.

[0097] In an embodiment of the present invention, a speech recognition network is constructed based on a Transformer encoder-decoder structure. The Transformer encoder of the speech recognition network includes multiple coding layers. Adjacent coding layers are connected by cross-layer connection modules. The coding layer is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module when generating an attention map, so that the attention map generated by each coding layer can more accurately represent the context dependency, thereby significantly improving the speech recognition accuracy of the speech recognition network with an almost negligible increase in the amount of parameters.

[0098] The computer-readable storage medium of the embodiment of the present invention may include any entity or device or recording medium capable of carrying computer program code, for example, ROM / RAM, magnetic disk, optical disk, flash memory and other memories.

[0099] 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 and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A speech recognition network based on cross-layer connection attention, wherein the speech recognition network is constructed based on a Transformer encoder-decoder structure, and the Transformer encoder of the speech recognition network includes multiple encoding layers, characterized in that: A cross-layer connection module is connected between adjacent coding layers. The coding layer is used to learn the information of the intermediate attention map of the previous coding layer through the cross-layer connection module when generating an attention map. Each coding layer includes an attention map generation module. The attention map generation module adopts a multi-head self-attention mechanism. The attention map generation module is used to learn the convolutional inductive bias of the intermediate attention map of the previous coding layer through the cross-layer connection module. Based on the convolutional inductive bias, the intermediate attention map of the coding layer and preset parameters, the attention map of the coding layer is obtained using the Softmax function. The intermediate attention map of each coding layer is the intermediate output of the attention map generation module of the coding layer before the Softmax function. The speech recognition network includes a downsampling layer, a Transformer encoder, a Transformer decoder and a Softmax classification layer connected in sequence. The speech recognition network is used to recognize the input speech to obtain a speech recognition result.

2. The network according to claim 1, characterized in that The cross-layer connection module is a convolution kernel with a size of A two-dimensional convolutional layer.

3. The network according to claim 1, characterized in that The Transformer encoder includes 12 encoding layers, and the Transformer decoder includes 6 decoding layers.

4. A speech recognition method based on the speech recognition network according to any one of claims 1 to 3, characterized in that: The method comprises: Preprocessing the speech to be recognized to obtain speech features of the speech to be recognized; The speech features are input into the trained speech recognition network to obtain a speech recognition result.

5. The speech recognition method according to claim 4, characterized in that: The preprocessing includes a cepstral mean variance normalization operation, the speech features include 80-dimensional Fbank features and 3-dimensional pitch features, and the Transformer decoder in the speech recognition network uses a beam search algorithm with a beam width of 5 for decoding to obtain the speech recognition result.

6. The speech recognition method according to claim 4, characterized in that: The method further comprises: Get the training set; Preprocessing the speech in the training set to obtain speech features of each speech; Based on the speech features of each speech, the speech recognition network is trained to obtain the trained speech recognition network.

7. The speech recognition method according to claim 6, characterized in that: The loss function used in training the speech recognition network is a cross entropy loss function. Before the step of training the speech recognition network, the step includes: The speech features are enhanced to train the speech recognition network according to the enhanced speech features, wherein the enhancement processing includes speed disturbance and SpecAugment processing.

8. A speech recognition device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 4 to 7 are implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 4 to 7 are implemented.