Speech recognition method, system, device and medium
By using a method based on the Transformer model in speech recognition, the characteristics of the Mel frequency cepspectral coefficients are extracted and global speech feature extraction is performed, and the problem of insufficient recognition accuracy in complex environments in multiple regions is solved, and higher recognition accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202411723881.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing offline speech recognition methods have poor adaptability in complex environments in multiple regions, which can easily lead to ineffective recognition or incorrect speech clips being misidentified, reducing the accuracy and effectiveness of recognition.
The speech recognition method based on the Transformer model is adopted to extract the features of the Mel frequency cepspectral coefficients, and the Transformer model is used to generate initial coding features from the time domain and the frequency domain. Combining the Gaussian residual self-attention mechanism and the multi-layer perceptron layer, global speech feature extraction and feature transformation are performed, and the text content of the speech signal data is finally generated.
It improves the accuracy and adaptability of speech recognition, reduces the negative impact of noise on recognition accuracy, can better understand long speech sequences and context information, and improves the accuracy and effectiveness of recognition.
Smart Images

Figure CN119600998A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of language signal processing, and in particular to a speech recognition method, system, device and medium. Background Art
[0002] Speech recognition technology processes speech signals into speech feature vectors first, and then converts the feature vectors into text sequences. In a military battlefield environment, speech recognition can convert ambient audio into key information data including time, coordinates, etc. This information plays a decisive role in the analysis of battlefield situations, which not only effectively exerts subjective initiative, but also improves the efficiency of commanding military decision-making.
[0003] Existing offline speech recognition technologies can be roughly divided into two categories: traditional speech recognition methods and speech recognition methods based on deep learning. Traditional speech recognition methods mainly use basic non-parametric models to extract important features from speech signals through mathematical operations, mainly including GMM, HMM, KNN, etc. The extracted features can be used as inputs of classification or regression models, so that the classification or regression models can learn and make accurate predictions. Speech recognition methods based on deep learning include: an automatic speech recognition method based on the combination of CNN and HMM. This method learns the relevant feature representations in the speech signal by determining the appropriate window size and the number of filters in spectral processing, thereby inferring the conditional probability distribution of the speech category, and finally realizing an automatic speech recognition system that combines convolutional neural networks with hidden Markov models (HMM); an automatic speech recognition method that combines CNN with long short-term memory (LSTM). This method uses CNN as an encoder for feature extraction, extracts local features of audio signals through 120 filter groups, and enhances the model's ability to handle complex speech. The speech processing capability is improved, and then LSTM is used for time series modeling to capture the long-distance dependencies in the speech signal. In the decoding stage, a decoder based on the attention mechanism is introduced to enable the model to focus more effectively on the relevant parts of the input features, thereby improving the recognition accuracy; a speech recognition algorithm based on the HMM model is designed. By analyzing the relevant technologies of speech signal preprocessing, a variable step-size block frequency domain LMS filtering denoising algorithm and a dual threshold endpoint detection algorithm based on short-time energy and short-time average zero-crossing rate are designed. Finally, the speech signal is modeled based on the HMM model to realize the design of an offline speech recognition algorithm.
[0004] However, existing offline speech recognition methods have poor adaptability in complex environments in multiple regions, which can easily lead to invalid recognition or misrecognition of erroneous speech segments, thereby reducing the accuracy and effectiveness of recognition. Summary of the invention
[0005] In view of the fact that the prior art has significant limitations in performance in multi-regional environments, resulting in a high error rate in recognition data, the present invention proposes a speech recognition method, system, device and medium, which generates a correspondence between text words in speech signal data and target text based on a Transformer model; generates text content corresponding to the speech signal to be recognized based on the correspondence; thereby solving the problems existing in the prior art.
[0006] A speech recognition method comprises the following steps:
[0007] Collecting speech signal data to be recognized and extracting Mel-frequency cepstral coefficient features of the speech signal data;
[0008] The Mel frequency cepstral coefficient feature is input into the speech recognition model based on the Transformer model, and the initial coding feature is generated from the two dimensions of time domain and frequency domain through two layers of convolutional layers; after introducing the position code into the initial coding feature, it is input into the encoder composed of multiple coding layers with the same structure in series, and the final coding feature is output; wherein each coding layer takes the output of the previous layer as input, and the initial coding feature first passes through the Gaussian residual self-attention mechanism layer to extract the global speech feature, and then passes through the multi-layer perceptron layer for feature transformation, and outputs the coding representation feature of the next layer; the final coding feature and the tag sequence of the target text are input into the decoder composed of multiple decoding layers with the same structure in series, and the final decoding result is output; wherein each decoding layer takes the output of the previous layer as input, first learns the internal relationship between the target text words through the Gaussian residual self-attention mechanism layer, generates internal features, and inputs the internal features and the final coding feature into the multi-layer perceptron layer through the cross-attention mechanism to generate the corresponding relationship between the text words of the speech signal data and the target text;
[0009] The text content corresponding to the speech signal to be recognized is generated according to the corresponding relationship.
[0010] Furthermore, the method of generating initial coding features from two dimensions of time domain and frequency domain by using the Mel-frequency cepstral coefficient features of the speech signal data through two convolutional layers specifically includes the following steps:
[0011] The Mel-frequency cepstral coefficient features of the speech signal data are passed through two convolutional layers to generate hidden layer representation features in both the time domain and the frequency domain.
[0012] The hidden layer representation features are expanded through linear transformation to obtain the initial encoding features.
[0013] Furthermore, the extracting of Mel-frequency cepstral coefficient features of speech signal data specifically comprises the following steps:
[0014] The speech signal data is passed through a high-pass filter to enhance the high-frequency components in the speech signal, which is expressed as:
[0015] s′(n)=s(n)-αs(n-1),
[0016] Where, s(n) is the original signal, s′(n) is the pre-emphasized signal, α is the pre-emphasis coefficient, s(n-1) represents the speech sampling value at time n-1, and n represents the nth sampling point;
[0017] The enhanced speech signal is divided into multiple short-time frames, wherein each frame has a time of 20ms to 30ms;
[0018]
[0019] Where w(n) is the windowing function value, and N represents the size of the window, that is, the number of sampling points;
[0020] The non-negative matrix factorization (NMF) algorithm is used to separate the human voice from each frame of speech signal data;
[0021] Perform fast Fourier transform on each frame of human voice time domain signal obtained after separation to obtain the spectrum;
[0022] The Mel filter is used to process the spectrum and extract the Mel frequency cepstral coefficient features of each frame of speech signal.
[0023] Furthermore, the method of using the non-negative matrix decomposition (NMF) algorithm to separate the human voice from each frame of speech signal data comprises the following steps:
[0024] Perform short-time Fourier transform on each frame of input speech signal data;
[0025] Randomly initialize non-negative matrices B and G, and use KL divergence to update matrices B and G respectively:
[0026]
[0027]
[0028] Where f,k represents the fth row and the kth column; X is an X*T-dimensional matrix; G T is the transposed matrix of matrix G.
[0029] The two matrices B and G finally obtained are subjected to inverse Fourier transform respectively to obtain the corresponding time domain signals of noise and human voice.
[0030] Furthermore, the time domain signal of each frame of human voice obtained after separation is subjected to fast Fourier transform to obtain a spectrum, which is expressed as:
[0031]
[0032] Among them, F(k) is the fast Fourier result, that is, it represents the spectrum, and s′(n) represents the windowed signal.
[0033] The method of using a Mel filter to process the spectrum and extracting the Mel frequency cepstral coefficient features of each frame of speech signal comprises the following steps:
[0034] Process the spectrum through a set of Mel filters:
[0035]
[0036] Among them, H m (k) is the gain of the mth Mel filter; M(k) represents the Mel frequency; F(n)| 2 Represents the square of the amplitude of the nth frequency point; k represents the frequency index, which represents the kth point of the discrete frequency.
[0037] Take the logarithm of the energy of the filter bank output;
[0038] The logarithmic energy value is subjected to discrete cosine transform to remove the correlation in the energy spectrum and obtain the final Mel-frequency cepstral coefficient feature.
[0039] In the decoder, a residual connection is used between the input of each decoding layer and the output of the previous decoding layer, and a layer normalization operation is performed.
[0040] The present invention also includes a speech recognition system, comprising:
[0041] The acquisition module is used to acquire the speech signal data to be recognized and extract the Mel-frequency cepstral coefficient features of the speech signal data;
[0042] A speech recognition module is used to input the Mel frequency cepstral coefficient features into a speech recognition model based on a Transformer model, and generate initial coding features from two dimensions of time domain and frequency domain through two convolutional layers; after introducing position coding into the initial coding features, the features are input into an encoder composed of a plurality of coding layers of the same structure in series, and the final coding features are output; wherein each coding layer takes the output of the previous layer as input, and the initial coding features are first subjected to a Gaussian residual self-attention mechanism layer to extract global speech features, and then subjected to feature transformation through a multi-layer perceptron layer, and the coding representation features of the next layer are output; the final coding features and the tag sequence of the target end text are input into a decoder composed of a plurality of decoding layers of the same structure in series, and the final decoding results are output; wherein each decoding layer takes the output of the previous layer as input, and first learns the internal relationship between the target end text words through a Gaussian residual self-attention mechanism layer to generate internal features, and the internal features and the final coding features are input into a multi-layer perceptron layer through a cross-attention mechanism to generate the corresponding relationship between the text words of the speech signal data and the target end text;
[0043] The generating module is used to generate text content corresponding to the speech signal to be recognized according to the corresponding relationship.
[0044] The present invention also includes a speech recognition computer device, including: a memory, a processor, and a computer program stored in the memory, and the processor implements the steps of the speech recognition method when executing the computer program.
[0045] The present invention also includes a readable storage medium, wherein the readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, they are used to execute the steps of the speech recognition method.
[0046] The present invention provides a speech recognition method, system, device and medium, which have the following beneficial effects:
[0047] The present invention can capture the changes in timbre, pitch and speech frequency of speech signals by extracting Mel-frequency cepstral coefficient features. Transformer uses these features as input to better capture semantic information in speech signals, thereby improving recognition accuracy. Transformer can maintain strong adaptability in more complex environments by globally modeling the entire input sequence, capture effective features of speech signals, and reduce the negative impact of noise on recognition accuracy. The speech signal is directly mapped to text output through a multi-layer encoding layer and decoding layer structure, and timing dependencies can be captured globally, especially when processing long speech sequences, so contextual information can be better understood and recognition accuracy can be improved. The problem of insufficient recognition accuracy of existing offline speech recognition methods in multi-regional battlefield environments is effectively overcome. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flow chart of a speech recognition method according to an embodiment of the present invention;
[0049] Figure 2 4 is a structural diagram of a multi-task training sequence in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0051] like Figure 1 As shown, the present invention proposes a speech recognition method, which specifically includes the following steps:
[0052] S1. Collect voice signals.
[0053] S1.1 Sampling: According to the Nyquist sampling theorem, the sampling frequency should be at least twice the highest frequency of the signal to avoid aliasing effects. The sampling frequency is 44kHz.
[0054] S1.2. Quantization: Converting the amplitude of an analog signal into a finite number of discrete values.
[0055] S1.3, Encoding: Convert the quantized discrete values into binary codes so that computers can better store and process them.
[0056] S2. Speech signal preprocessing.
[0057] S2.1, pre-emphasis: The high-frequency components in the speech signal are enhanced through a high-pass filter, which effectively compensates for the attenuation of the low-frequency components of the speech signal during recording or transmission, especially in an environment with low noise and high-frequency noise interference, which can improve the performance of subsequent feature extraction and recognition. As shown in formula (1):
[0058] s′(n)=s(n)-αs(n-1)(1);
[0059] Where s(n) is the original signal, s′(n) is the pre-emphasized signal, and α is the pre-emphasis coefficient, which is usually between 0.9 and 1.0.
[0060] S2.2, Frame division and window function processing: Since the speech signal is non-stationary, it needs to be divided into short time frames for processing, each frame is about 20 to 30ms. In order to reduce the boundary effect between frames, a window function is applied to each frame, such as formula (2), thereby reducing spectrum leakage.
[0061]
[0062] Voice separation: The non-negative matrix factorization (NMF) algorithm is used to achieve voice separation on each frame of the speech signal after pre-emphasis, framing and window function processing; the specific steps of the algorithm are briefly described as follows:
[0063] 1) Perform short-time Fourier transform on each frame of mixed signal.
[0064] 2) Randomly initialize the non-negative matrices B and G, use the KL divergence formula (3) to update the matrix B, and then use the KL divergence formula (4) to update the matrix G:
[0065]
[0066]
[0067] 3) Perform inverse Fourier transform on the two matrices B and G obtained in the end, and the corresponding time domain signals of noise and human voice can be obtained.
[0068] S3: Speech feature extraction stage.
[0069] Fast Fourier Transform: After the speech signal is pre-emphasized, segmented into short-time frames, and separated from the human voice, a fast Fourier transform is performed on each frame to obtain the spectrum:
[0070]
[0071] Mel filter: The spectrum is then processed through a set of Mel filters, which are designed based on the auditory characteristics of the human ear and aim to simulate the nonlinear perception of humans at different frequencies on a Mel scale:
[0072]
[0073] Among them, H m (k) is the gain of the mth Mel filter.
[0074] Obtain the Mel-frequency cepstrum coefficients: Take the logarithm of the energy output by the filter bank, then perform discrete cosine transform on the logarithmic energy value to remove the correlation in the energy spectrum to obtain the final Mel-frequency cepstrum coefficients.
[0075] S4, speech recognition model, including encoder and decoder, which are responsible for encoding speech features and decoding character sequences respectively.
[0076] After preprocessing, the speech signal is first processed by convolution to obtain a feature map. The feature map extracted by convolution is linearly transformed and expanded into a vector as the input feature. Next, position encoding is introduced. Since the Transformer itself does not have the ability to process the sequence order, position encoding needs to be added to the feature to help the model understand the temporal structure of the input feature. Position encoding is to map the features of each moment to a high-dimensional space through encoding, so that each position in the sequence has a unique representation. In this way, the feature sequence extracted by convolution can better represent the temporal information after position encoding and input into the Transformer model. The Gaussian function is used to adjust the weight distribution between different input elements. The Gaussian residual self-attention layer helps capture long-distance dependencies in the sequence. The multi-layer perceptron further processes the features through nonlinear activation functions to improve the representation ability of the model. The MLP captures the comprehensive features of each element in the input sequence through the fully connected layer, helping the Transformer model to better understand the input.
[0077] The encoder consists of multiple encoding layers with the same structure connected in series. Each encoding layer contains two sublayers: Gaussian residual self-attention mechanism sublayer and multi-layer perceptron (MLP) sublayer. First, the input speech signal first passes through two layers of 3×3 convolutional layers (with a step size of 2) to generate hidden layer representation features X in the time domain and frequency domain. Then, the feature map is expanded through linear transformation to obtain the initial code X0, and the position code is added so that the model can use the time series information of the speech signal. After that, it is processed by the encoding layer: each layer of the encoder is processed by the output X of the previous layer l As input, the global speech features are first extracted through the Gaussian residual self-attention mechanism; then the features are transformed through the multi-layer perceptron, and the encoding representation X of the next layer is output. l +1. Before each sub-layer processing, residual connections and normalization layers are used to enhance training stability and alleviate the gradient vanishing problem. The last layer encoder outputs X final As the final representation of the encoder, it is used by the decoder.
[0078] The decoder consists of N decoding layers of the same structure connected in series. Unlike the encoder, each decoding layer contains three sublayers: Gaussian residual self-attention mechanism sublayer, cross-attention layer, and multi-layer perception sublayer. The input of the decoder includes the output X of the encoder final and the target end’s tag sequence. The first layer input is X final and the start special marker of the target text (multi-task training sequence). At the same time, the position encoding is added to the decoder input to enable the decoder to perceive the order of words in the sequence. During the decoding layer processing, the Gaussian residual self-attention mechanism sublayer: learns the internal relationship of the target end (between text words) and generates the output D lCross Attention Layer: Combined with the output D of the current decoding layer l and encoder output X final , capturing the relationship between the source text and the target text. Finally, the multi-layer perceptron sublayer further processes the features and outputs the decoded representation D of the next layer. l+1 Each sub-layer also uses residual connections and normalization layers; the output of the last layer of decoder is the final decoding result D final , which is used to generate the corresponding text sequence. After multiple layers of processing, the decoder generates the relationship between the source text words and the target text words. Finally, the model maps these internal features to actual text output through a linear layer to obtain the recognition result. The core task of the recognition module is to generate the target character sequence from the output of the decoder. According to the target text label during the training process, the model continuously adjusts the parameters through the optimization process so that the target text can be accurately generated when given a voice input.
[0079] Inspired by the Transformer model, the present invention applies the model structure to the field of speech recognition. The model structure is as follows: Figure 1 As shown in the figure, the encoder is composed of N coding layers of the same structure connected in series, and each coding layer contains two sub-layers, namely the Gaussian residual self-attention mechanism and the multi-layer perceptron layer. The input signal first passes through two layers of 3×3 convolutional layers with a step size of 2 to generate hidden layer representations in the time domain and frequency domain; then, a linear transformation is used to expand the feature map to obtain the input code, and position coding is added so that the model can use the position relationship and voice relationship to map the voice feature sequence to the corresponding character sequence; in addition, before each sub-layer is processed, a residual connection and layer normalization operation will be performed with the output of the previous sub-layer, thereby ensuring the stability of training and alleviating the problem of gradient disappearance caused by long-distance coding. The decoder is also composed of N decoding layers of the same structure connected in series. Unlike the encoder, each decoding layer contains three sub-layers. The bottom layer uses the Gaussian residual self-attention layer to learn the internal relationship between the target text words; then the output of this layer and the encoder output result are input into the cross-attention layer (CrossAttention) to learn the relationship between the source text words and the target text words; the decoder uses learnable position encoding and specially marks the input text, so that different tasks such as transcription, translation, and multi-language recognition can be performed on the same input audio signal. Figure 2 shown.
[0080] In the speech recognition task, in order to enable the decoder to perform different tasks such as transcription, translation, and multi-language recognition on the same input audio signal, the present invention proposes a standardized marking process, which uses specific marking symbols to indicate the start of the task, the task type, and other necessary task information. The specific process is as follows:
[0081] (1) Start marker: <|start oftranscript|> is used as the start marker of the input, indicating that the decoder is about to enter a new task segment. This marker can provide a unified starting point for subsequent analysis steps.
[0082] (2) Voice activity detection: First, determine whether the input audio signal contains voice content and perform voice activity detection (VAD). This step is to avoid invalid processing of silent segments and improve system processing efficiency and accuracy. If a voice signal is detected, the system will proceed to the next step; if a silent signal is detected, the system will skip processing or wait for the next valid audio input.
[0083] (3) Speech type prediction: Once a speech signal is detected, the system predicts the language type of the speech and selects the corresponding language tag token; this token provides the decoder with information to identify and analyze the language background, enabling the decoder to automatically adapt to language changes in multilingual tasks and improve recognition accuracy.
[0084] (4) Task type selection: According to the specific task requirements, add the <|transcribe|> or <|translate|> tag to the next token to specify the task type as transcription (i.e., direct conversion into text) or translation (i.e., translating speech into target language text). In addition, use the <|no timestamps|> tag to control whether to add timestamps to the transcribed or translated text to facilitate subsequent content retrieval and editing.
[0085] (5) End marker: After the task processing is completed, add the end time marker <|EOT|> to indicate the end of the task. This end marker not only ensures that the decoder can distinguish the boundaries of the task, but also facilitates the system to accurately divide the paragraphs when switching tasks or batch processing.
[0086] S5. Use the common language Mandarin corpus, adopt the Adam optimizer and Noam learning rate to train the model, and use the final model to recognize the input speech and obtain the output text.
[0087] Based on the same inventive concept, the present invention also proposes a speech recognition system, comprising:
[0088] The acquisition module is used to acquire the speech signal data to be recognized and extract the Mel-frequency cepstral coefficient features of the speech signal data.
[0089] The speech recognition module is used to input the Mel frequency cepstral coefficient features into the speech recognition model based on the Transformer model, generate initial coding features from the two dimensions of time domain and frequency domain through two convolutional layers; introduce position coding into the initial coding features and input them into an encoder composed of multiple coding layers with the same structure in series, and output the final coding features; wherein each coding layer takes the output of the previous layer as input, the initial coding features first pass through the Gaussian residual self-attention mechanism layer to extract global speech features, and then pass through the multi-layer perceptron layer to perform feature transformation, and output the coding representation features of the next layer; the final coding features and the tag sequence of the target end text are input into a decoder composed of multiple decoding layers with the same structure in series, and the final decoding results are output; wherein each decoding layer takes the output of the previous layer as input, first learns the internal relationship between the target end text words through the Gaussian residual self-attention mechanism layer, generates internal features, and inputs the internal features and the final coding features into the multi-layer perceptron layer through the cross-attention mechanism to generate the corresponding relationship between the text words of the speech signal data and the target end text.
[0090] The generating module is used to generate text content corresponding to the speech signal to be recognized according to the corresponding relationship.
[0091] The present invention also provides a speech recognition computer device, comprising: a memory, a processor and a computer program stored in the memory, and the processor implements the steps of the speech recognition method when executing the computer program.
[0092] The present invention further provides a readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, they are used to execute the steps of the speech recognition method.
[0093] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A speech recognition method, characterized in that: The following steps are involved: Collecting speech signal data to be recognized and extracting Mel-frequency cepstral coefficient features of the speech signal data; The Mel frequency cepstral coefficient feature is input into the speech recognition model based on the Transformer model, and the initial coding feature is generated from the two dimensions of time domain and frequency domain through two layers of convolutional layers; after introducing the position code into the initial coding feature, it is input into the encoder composed of multiple coding layers with the same structure in series, and the final coding feature is output; wherein each coding layer takes the output of the previous layer as input, and the initial coding feature first passes through the Gaussian residual self-attention mechanism layer to extract the global speech feature, and then passes through the multi-layer perceptron layer for feature transformation, and outputs the coding representation feature of the next layer; the final coding feature and the tag sequence of the target text are input into the decoder composed of multiple decoding layers with the same structure in series, and the final decoding result is output; wherein each decoding layer takes the output of the previous layer as input, first learns the internal relationship between the target text words through the Gaussian residual self-attention mechanism layer, generates internal features, and inputs the internal features and the final coding feature into the multi-layer perceptron layer through the cross-attention mechanism to generate the corresponding relationship between the text words of the speech signal data and the target text; The text content corresponding to the speech signal to be recognized is generated according to the corresponding relationship.
2. A speech recognition method according to claim 1, characterized in that: The method generates initial coding features from two dimensions of time domain and frequency domain by using the Mel frequency cepstral coefficient features of the speech signal data through two convolutional layers, specifically comprising the following steps: The Mel-frequency cepstral coefficient features of the speech signal data are passed through two convolutional layers to generate hidden layer representation features in both the time domain and the frequency domain. The hidden layer representation features are expanded through linear transformation to obtain the initial encoding features.
3. A speech recognition method according to claim 1, characterized in that: The method of extracting the Mel-frequency cepstral coefficient features of the speech signal data specifically comprises the following steps: The speech signal data is passed through a high-pass filter to enhance the high-frequency components in the speech signal, which is expressed as: s′(n)=s(n)-αs(n-1), Where, s(n) is the original signal, s′(n) is the pre-emphasized signal, α is the pre-emphasis coefficient, s(n-1) represents the speech sampling value at time n-1, and n represents the nth sampling point; The enhanced speech signal is divided into multiple short-time frames, wherein each frame has a time of 20ms to 30ms; Where w(n) is the windowing function value, and N represents the size of the window, that is, the number of sampling points; The non-negative matrix factorization (NMF) algorithm is used to separate the human voice from each frame of speech signal data; Perform fast Fourier transform on each frame of human voice time domain signal obtained after separation to obtain the spectrum; The Mel filter is used to process the spectrum and extract the Mel frequency cepstral coefficient features of each frame of speech signal.
4. A speech recognition method according to claim 3, characterized in that: The method of using the non-negative matrix decomposition (NMF) algorithm to separate the human voice from each frame of speech signal data comprises the following steps: Perform short-time Fourier transform on each frame of input speech signal data; Randomly initialize non-negative matrices B and G, and use KL divergence to update matrices B and G respectively: Where f,k represents the fth row and the kth column; X is an X*T-dimensional matrix; G T is the transposed matrix of matrix G. The two matrices B and G finally obtained are subjected to inverse Fourier transform respectively to obtain the corresponding time domain signals of noise and human voice.
5. A speech recognition method according to claim 4, characterized in that: The time domain signal of each frame of human voice obtained after separation is subjected to fast Fourier transform to obtain a spectrum, which is expressed as: Among them, F(k) is the fast Fourier result, that is, it represents the spectrum, and s′(n) represents the windowed signal.
6. A speech recognition method according to claim 3, characterized in that: The method of using a Mel filter to process the spectrum and extracting the Mel frequency cepstral coefficient features of each frame of speech signal comprises the following steps: Process the spectrum through a set of Mel filters: Among them, H m (k) is the gain of the mth Mel filter; M(k) represents the Mel frequency; F(n)| 2 Represents the square of the amplitude of the nth frequency point; k represents the frequency index, which represents the kth point of the discrete frequency. Take the logarithm of the energy of the filter bank output; The logarithmic energy value is subjected to discrete cosine transform to remove the correlation in the energy spectrum and obtain the final Mel-frequency cepstral coefficient feature.
7. A speech recognition method according to claim 1, characterized in that: In the decoder, a residual connection is used between the input of each decoding layer and the output of the previous decoding layer, and a layer normalization operation is performed.
8. A speech recognition system, characterized in that: include: The acquisition module is used to acquire the speech signal data to be recognized and extract the Mel-frequency cepstral coefficient features of the speech signal data; A speech recognition module is used to input the Mel frequency cepstral coefficient features into a speech recognition model based on a Transformer model, and generate initial coding features from two dimensions of time domain and frequency domain through two convolutional layers; after introducing position coding into the initial coding features, the features are input into an encoder composed of a plurality of coding layers of the same structure in series, and the final coding features are output; wherein each coding layer takes the output of the previous layer as input, and the initial coding features are first subjected to a Gaussian residual self-attention mechanism layer to extract global speech features, and then subjected to feature transformation through a multi-layer perceptron layer, and the coding representation features of the next layer are output; the final coding features and the tag sequence of the target end text are input into a decoder composed of a plurality of decoding layers of the same structure in series, and the final decoding results are output; wherein each decoding layer takes the output of the previous layer as input, and first learns the internal relationship between the target end text words through a Gaussian residual self-attention mechanism layer to generate internal features, and the internal features and the final coding features are input into a multi-layer perceptron layer through a cross-attention mechanism to generate the corresponding relationship between the text words of the speech signal data and the target end text; The generating module is used to generate text content corresponding to the speech signal to be recognized according to the corresponding relationship.
9. A speech recognition computer device, characterized in that include: A memory, a processor, and a computer program stored in the memory, wherein the processor implements the steps of the speech recognition method according to any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, they are used to execute the steps of the speech recognition method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Speech enhancement method
CN110767244A
Music genre identification method and device, equipment and storage medium
CN113450828A
Multi-dialect speech recognition method, system, device and medium
CN118038851A
Audio-to-text method and device, electronic equipment and readable storage medium
CN118800236A
KR20220112560A
Cited By
Variable bit rate quantization speech recognition method for intelligent speech controller
CN120727015A