A Chongqing dialect speech recognition method based on a transformer composed of dual encoders

Through the dual-encoder Transformer model and dropout mechanism, the problem of low accuracy of Chongqing dialect speech recognition is solved, higher recognition accuracy and robustness are achieved, and it is suitable for the unclear pronunciation characteristics of the elderly.

CN116416968BActive Publication Date: 2024-09-24CHONGQING UNIV +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111656134.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-09-24
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

Existing automatic speech recognition technology has low accuracy when dealing with Chongqing dialect, especially when the elderly have unclear pronunciation. It is difficult to effectively capture the difference between initial consonants and finals, resulting in limited recognition accuracy, and traditional models such as CNN and RNN There are vanishing and exploding gradient problems when processing long sequences, which cannot meet the requirements of language models.

Method used

Using a Transformer model composed of dual encoders, the speech data is vectorized through Fourier transformation and VGG network, combined with the multi-head attention mechanism and forward propagation layer, using the Gate CNN network and KL divergence loss function to design two different decoder to enhance model robustness and improve model stability through dropout mechanism.

Benefits of technology

It improves the accuracy of Chongqing dialect speech recognition, enhances the robustness of the model, can more effectively deal with the elderly's inarticulate speech and dialect characteristics, and improves the overall performance of speech recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The invention discloses a Chongqing dialect speech recognition method of a transformer composed of dual encoders, comprising the following steps: 1) acquiring speech data; 2) performing Fourier transformation on the speech data to obtain a speech spectrum diagram; 3) obtaining a vector V; 4) acquiring an input X of a transformer model; 5) obtaining parameters Q, K, and V; 6) inputting parameters Q, K, and V into encoders encoder1 and encoder encoder2 of the transformer model to obtain encoder outputs Y1 and Y2, respectively; 7) inputting encoder output Y1 into a Gate CNN network to obtain a speech recognition text probability distribution p1; inputting encoder output Y2 into a decoder of the transformer model to obtain a speech recognition text probability distribution p2; 8) calculating to obtain a speech recognition text P. The invention designs two different decoders to respectively decode two dropout outputs, further increasing the robustness of the entire decoding structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of speech recognition, and in particular to a Chongqing dialect speech recognition method of a transformer composed of dual encoders. Background Art

[0002] Alzheimer's disease (AD) is an age-related syndrome, and its incidence rate increases rapidly with age, becoming the fourth largest "killer" of the elderly after heart disease, cerebrovascular disease, and tumors. However, for Chongqing and underdeveloped areas around the world, its awareness rate, consultation rate, diagnosis rate, and treatment rate are all lower than the world average. Therefore, automatic speech recognition technology that can accurately identify Chongqing dialect will help promote early screening of dementia, especially early screening of Alzheimer's disease. Clinical studies have shown that quantifiable signs of cognitive decline associated with AD and mild cognitive impairment (MCI) are detectable in patient language. Machine learning (ML) models have been shown to successfully detect AD using speech and language variables, such as analyzing sentence content from speech-recognized text to infer the patient's health status. Since the transcript should be accurate enough to correctly represent syntactic and linguistic features, current methods usually rely on transcription by trained transcriptionists. But this will take a lot of time and effort, so in this article, the present invention will focus on how to improve the accuracy of automatic speech recognition (ASR) technology in Chongqing dialect recognition. Chinese is a language based on syllables. We first analyzed the differences in syllables between Mandarin and Chongqing dialect, mainly comparing the differences between initial consonants and finals. At the same time, some elderly people have slurred pronunciation, which puts higher demands on the speech recognition model serving such users. Therefore, whether using an end-to-end automatic speech recognition model or a pipeline automatic speech recognition model, a single model structure will find it difficult to capture the different pronunciations of characters. Therefore, its accuracy in speech recognition applications of Chongqing dialect is very limited.

[0003] The output of automatic speech recognition (ASR) is a piece of text. For a good automatic speech recognition model (ASR), the output text should conform to the language model, which is similar to natural language generation. Therefore, if a convolutional neural network (CNN) is used, since the convolutional neural network (CNN) only focuses on local information and cannot capture the contextual relationship of the text, the convolutional neural network (CNN) cannot meet the requirements of the language model, and the recurrent neural network (RNN) has the limitations of gradient disappearance and explosion on long sequences, which also limits the effectiveness of the recurrent neural network (RNN) in speech recognition tasks. The present invention will select a sequence-to-sequence attention model transformer based on a language model. The model is usually composed of an encoder and a decoder, where the encoder can be composed of multiple recurrent neural network (RNN) layers. The attention layer is mainly used as an interface between the encoder and the decoder. This model architecture avoids repeated calculations because the transformer relies entirely on the attention mechanism to learn the global dependency between input and output, and allows more parallel calculations, which has achieved good results in natural language generation tasks such as machine translation. Aiming at the characteristics of Chongqing dialect, the present invention proposes a dual-encoder transformer structure. The outputs of the two encoders are passed through different decoders so that the output of the final model can fuse the outputs of two different decoders together, thereby enhancing the robustness of the entire transformer.

[0004] ASR technology is an important part of artificial intelligence, which enables computers to "understand" human speech. The development of ASR technology helps people communicate with more artificial intelligence products and realize "human-computer interaction", so that people can enjoy the convenience and efficiency brought to life by technological development. Therefore, the speech recognition model for Chongqing dialect proposed in the present invention will help Chongqing dialect to be more accurately "recognized" by computers, so that early screening of Alzheimer's disease can be promoted in more areas.

[0005] The implementation of ASR can be divided into pipeline or end2end ideas, among which the main difference lies in the recognition unit of the acoustic model. Different model recognition units (word pronunciation model, character pronunciation model, semi-syllable model or phoneme model) have a great impact on the amount of speech training data, speech recognition rate, and flexibility. For speech recognition systems with medium vocabulary or above, the recognition unit is small, the amount of calculation is small, and the required model storage is also small, but the problem is that the corresponding speech segment is difficult to locate and segment, as well as more complex recognition model rules. With the development of deep learning, it has a stronger modeling ability and tends to use pinyin, character, and word models. The present invention is also developed based on word model granularity. Chongqing dialect has certain differences from Mandarin in initials and finals, and most AD patients are elderly people, and their pronunciation often has slurred speech. Therefore, it is difficult for general transformer models to capture the differences and effective information. If ASR technology is used to analyze the subject's speech content for scoring of test items such as orientation and immediate recall, the key to intelligent testing lies in how to deal with problems such as the subject's slurred speech and Chongqing dialect in the recognition content.

[0006] ASR technology, whether pipeline or end2end, needs to be optimized in terms of acoustic model or language model, as summarized below:

[0007] 1) Language models based on statistics are affected by the size of the corpus, their effectiveness is limited, and statistical information has limited expressive power at the semantic level.

[0008] 2) The language model is not integrated into the acoustic model, and most deep learning-based acoustic models use CNN or RNN-like structures, which cannot achieve large-scale parallel computing.

[0009] 3) Due to the inaccurate pronunciation and slurred speech of the Chongqing dialect among the elderly, model fusion is often more accurate than a single model. Summary of the invention

[0010] The object of the present invention is to provide a Chongqing dialect speech recognition method using a transformer composed of dual encoders, comprising the following steps:

[0011] 1) Get voice data.

[0012] The speech data includes a dialect.

[0013] 2) Perform Fourier transform on the speech data to obtain a speech spectrogram.

[0014] 3) Use the VGG network to vectorize the speech spectrogram and obtain the vector v.

[0015] The vector v looks like this:

[0016] v=VGG(DFT(A)) (1)

[0017] Where A is the voice data.

[0018] 4) Obtain the input X of the transformer model. The transformer model includes encoder 1, encoder 2 and decoder. Encoder 1 and encoder 2 have different output values.

[0019] The input X of the transformer looks like this:

[0020] X=PE(DFT(A))+Fbank(v) (2)

[0021] Where PE is the position encoding function.

[0022] 5) Transform the input X to obtain parameters Q, K, and V.

[0023] Parameters Q, K, and V are as follows:

[0024] Q=XW Q ,K=XW K ,V=XW V (3)

[0025] Where W Q , W K , W V is the weight.

[0026] 6) Input the parameters Q, K, and V into the encoders encoder1 and encoder2 of the transformer model to obtain encoder output Y1 and encoder output Y2 respectively.

[0027] 7) Input the encoder output Y1 into the Gate CNN network to obtain the speech recognition text probability distribution p1;

[0028] Input the encoder output Y2 into the decoder of the transformer model to obtain the speech recognition text probability distribution p2;

[0029] The encoder includes a multi-head attention layer and a forward propagation layer.

[0030] The output of the multi-head attention layer MultiHead(Q,K,V) is as follows:

[0031] MultiHead(Q,K,V)=Concat(head1,...,head h )W O (4)

[0032] Among them, the parameter head i As shown below:

[0033] head i =Attention(QW i Q ,KW i K ,VW i V ),i=1,2,...,h (5)

[0034] Where h is the number of attention layers; W i Q , W i K , W i V is the weight of the i-th layer.

[0035] Attention(Q,K,V) is as follows:

[0036]

[0037] In the formula, is the normalization parameter;

[0038] The output FFN(x) of the forward propagation layer is as follows:

[0039] FFN(x)=max(0,xW1+b1)W2+b2 (7)

[0040] Where b1 and b2 are biases;

[0041] The input x of the forward propagation layer is as follows:

[0042] x=norm(X+MultiHead(Q,K,V)) (8)

[0043] The output Y of the encoder is as follows:

[0044] Y=FFN(x) (9)

[0045] The encoder's loss function Loss is as follows:

[0046] Loss = Loss1 + α * Loss KL (10)

[0047] Where Loss1 is the decoding loss function; α is the weight of the divergence loss function in the total loss function;

[0048] Among them, KL divergence loss function Loss KL As shown below:

[0049]

[0050] Where, L is the number of encoders; y 1,n ,y 2,n is the output of the nth encoder.

[0051] 8) Calculate and obtain the speech recognition text P.

[0052] The speech recognition text P is as follows:

[0053] P=(1-λ)*P1+λ*P2 (12)

[0054] In the formula, λ is the weight coefficient.

[0055] The technical effect of the present invention is unquestionable. The present invention analyzes the differences between the application of ASR technology in Chongqing dialect and Mandarin, and adopts two dropouts to increase the robustness of the entire ASR model based on the inaccurate and unclear pronunciation of Chongqing elderly people.

[0056] According to the results obtained from the two dropouts, the present invention designs two different decoders to decode the two dropout outputs respectively, further increasing the robustness of the entire decoding structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a flow chart of speech recognition;

[0058] Figure 2 It is the voice data processing flow;

[0059] Figure 3 For the model structure. DETAILED DESCRIPTION

[0060] The present invention is further described below in conjunction with the embodiments, but it should not be understood that the above subject matter of the present invention is limited to the following embodiments. Without departing from the above technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the art, which should all be included in the protection scope of the present invention.

[0061] Embodiment 1:

[0062] See also Figure 1 , 23. A Chongqing dialect speech recognition method using a transformer composed of dual encoders, comprising the following steps:

[0063] 1) Get voice data.

[0064] The speech data includes a dialect.

[0065] 2) Perform Fourier transform on the speech data to obtain a speech spectrogram.

[0066] 3) Use the VGG network to vectorize the speech spectrogram and obtain the vector v.

[0067] The vector v looks like this:

[0068] v=VGG(DFT(A)) (1)

[0069] Where A is the voice data.

[0070] 4) Obtain the input X of the transformer model. The transformer model includes encoder encoder1, encoder encoder2 and decoder decoder.

[0071] The input X of the transformer looks like this:

[0072] X=PE(DFT(A))+Fbank(v) (2)

[0073] Where PE is the position encoding function. Fbank() represents the speech feature extraction operation.

[0074] 5) Transform the input X to obtain parameters Q, K, and V.

[0075] Parameters Q, K, and V are as follows:

[0076] Q=XW Q ,K=XW K ,V=XW V (3)

[0077] Where W Q , W K , W V is the weight.

[0078] 6) Input the parameters Q, K, and V into the encoders encoder1 and encoder2 of the transformer model to obtain encoder output Y1 and encoder output Y2 respectively.

[0079] 7) Input the encoder output Y1 into the Gate CNN network to obtain the speech recognition text probability distribution p1;

[0080] Input the encoder output Y2 into the decoder of the transformer model to obtain the speech recognition text probability distribution p2;

[0081] The encoder includes a multi-head attention layer and a forward propagation layer.

[0082] The output of the multi-head attention layer MultiHead(Q,K,V) is as follows:

[0083] MultiHead(Q,K,V)=Concat(head1,...,head h )W O (4)

[0084] Among them, the parameter head i As shown below:

[0085] head i =Attention(QW i Q ,KW i K ,VW i V ),i=1,2,...,h (5)

[0086] In the formula, h is the number of attention layers, which means how many times the attention operation will be performed. i Q , W i K , W i V is the weight of the i-th layer.

[0087] Attention(Q,K,V) is as follows:

[0088]

[0089] In the formula, is the parameter used for normalization;

[0090] The output FFN(x) of the forward propagation layer is as follows:

[0091] FFN(x)=max(0,xW1+b1)W2+b2 (7)

[0092] Where b1 and b2 are biases;

[0093] The input x of the forward propagation layer is as follows:

[0094] x=norm(X+MultiHead(Q,K,V)) (8)

[0095] The output Y of the encoder is as follows:

[0096] Y=FFN(x) (9)

[0097] The encoder's loss function Loss is as follows:

[0098] Loss = Loss1 + α * Loss KL (10)

[0099] Where Loss1 is the decoding loss function; α is the weight of the divergence loss function in the total loss function;

[0100] Among them, KL divergence loss function Loss KL As shown below:

[0101]

[0102] Where, L = 2; y 1,n ,y 2,n is the output of the nth encoder.

[0103] 8) Calculate and obtain the speech recognition text P.

[0104] The speech recognition text P is as follows:

[0105] P=(1-λ)*P1+λ*P2 (12)

[0106] In the formula, λ is the weight coefficient.

[0107] The terms used in the present invention are explained as follows:

[0108] ASR: Automatic Speech Recognition

[0109] NLP: Natural Language Processing

[0110] Transformer: Algorithm structure consisting of encoder and decoder

[0111] Encoder: Encoder

[0112] Decoder: Decoder

[0113] Pipeline: Pipeline solution, hierarchical (segmented) implementation

[0114] end2end: an end-to-end one-stop solution.

[0115] Embodiment 2:

[0116] A Chongqing dialect speech recognition method using a transformer composed of dual encoders comprises the following steps:

[0117] 1) Based on the audio, signal processing technology and Fourier transform are used to obtain the spectrum of a single audio file, and the vector expression of the entire structure graph is extracted through the VGG network structure.

[0118] The formula can be expressed as:

[0119] V=VGG(DFT(A))

[0120] A: audio file; DFT: discrete Fourier transform; VGG: VGG network; V: vector representation of VGG output

[0121] 2) According to the spectrum graph, the position information of each spectrum unit in the original image is obtained, and it is embedded, vectorized, and input into the transformer together with Fbank.

[0122] Encoder calculation process and formula:

[0123] The transformer input X consists of two parts: position encoding and Fbank. PE is the position encoding function:

[0124] X=PE(DFT(A))+Fbank(V)

[0125] Convert input X to Q, K, V:

[0126] Q=XW Q ,K=XW K ,V=XW V

[0127] Attention calculation formula:

[0128]

[0129] Multi-head attention layer:

[0130] MultiHead(Q,K,V)=Concat(head1,...,head h )W O

[0131] in:

[0132] head i =Attention(QWi Q ,KW i K ,VW i V ),i=1,2,...,h

[0133] Forward propagation layer:

[0134] FFN(x)=max(0,xW1+b1)W2+b2

[0135] in:

[0136] x = norm(X + MultiHead(Q,K,V))

[0137] The output of the encoder is:

[0138] Y=FFN(x)

[0139] The calculation process of decoder is similar to that of encoder. For details, refer to Figure 3 , I will not go into details.

[0140] The same input passes through two encoders. Due to the existence of dropout, the two results Y1 and Y2 are different. The final word distribution is obtained by inputting them separately and splicing them together as the final decoded word list distribution. The output of the two encoders (with dropout, it can be understood as adding noise), but through the KL divergence constraint (noise removal), there is the concept of adversarial generation in it, and GAN has been proven to be effective. Dropout is a common skill in deep learning. It is used in the training stage to enhance the robustness of the model in the prediction stage. Through two dropouts, double network outputs can be obtained from the same input, and then the two outputs are continued to the subsequent network. The outputs of the two dropouts are constrained by the KL divergence loss function.

[0141]

[0142] The final loss function will be:

[0143] Loss = Loss1 + α * Loss KL

[0144] The core of Gate CNN is to add a threshold switch to the activation value of the convolution to determine the probability of passing it to the next layer. The convolution is divided into two parts during calculation. One part is the convolution activation value, namely B. The difference between B and ordinary convolution is that it does not use Tanh, but directly linear, but it will pass through a sigmoid operator. For the decoder of the transformer, let x1, x2, ... x i-1 It represents the decoding result of the transformer before the i-th moment, which will be combined with the state variable obtained by the encoder for decoding. This process is repeated until the decoding is completed to obtain the final text output. The decoding result at the i-th moment is actually a probability distribution p1 for the vocabulary. After Gate CNN decoding, the output at the i-th moment is also a probability distribution p2 for the vocabulary. Since the two vocabularies are the same and describe the output at the same time, the final vocabulary distribution at this moment will become:

[0145] P=(1-λ)*P1+λ*P2

Claims

1. A Chongqing dialect speech recognition method using a transformer composed of dual encoders, characterized in that: The following steps are involved: 1) Obtain voice data; 2) Perform Fourier transform on the speech data to obtain a speech spectrogram; 3) Use the VGG network to vectorize the speech spectrogram to obtain the vector v; The vector v looks like this: v=VGG(DFT(A)) (1) In the formula, A is the voice data; 4) Obtaining an input X of a transformer model; the transformer model includes an encoder encoder1, an encoder encoder2, and a decoder decoder; 5) Transform the input X to obtain parameters Q, K, and V; 6) Input the parameters Q, K and V into the encoders encoder1 and encoder2 of the transformer model to obtain encoder output Y1 and encoder output Y2 respectively; 7) Input the encoder output Y1 into the Gate CNN network to obtain the speech recognition text probability distribution p1; Input the encoder output Y2 into the decoder of the transformer model to obtain the speech recognition text probability distribution p2; 8) Calculate and obtain the speech recognition text P; The speech recognition text P is as follows: P=(1-λ)*P1+λ*P2 (2) In the formula, λ is the weight coefficient.

2. The Chongqing dialect speech recognition method of a transformer composed of dual encoders according to claim 1, characterized in that: The speech data includes a dialect.

3. The Chongqing dialect speech recognition method of a transformer composed of dual encoders according to claim 1, characterized in that: The input X of the transformer looks like this: X=PE(DFT(A))+Fbank(v) (3) Where PE is the position encoding function.

4. The Chongqing dialect speech recognition method of a transformer composed of dual encoders according to claim 1, characterized in that: Parameters Q, K, and V are as follows: Q=XW Q ,K=XW K ,V=XW V (4) Where W Q , W K , W V is the weight.

5. The Chongqing dialect speech recognition method of a transformer composed of dual encoders according to claim 1, characterized in that: The encoder includes a multi-head attention layer and a forward propagation layer; The output of the multi-head attention layer MultiHead(Q,K,V) is as follows: MultiHead(Q,K,V)=Concat(head1,...,head h )W O (5) Among them, the parameter head i As shown below: Where h is the number of attention layers; is the weight of the i-th layer; Attention(Q,K,V) is as follows: In the formula, is the normalization parameter; The output FFN(x) of the forward propagation layer is as follows: FFN(x)=max(0,xW1+b1)W2+b2 (8) Where b1 and b2 are biases; The input x of the forward propagation layer is as follows: x=norm(X+MultiHead(Q,K,V)) (9) The output Y of the encoder is as follows: Y = FFN (x) (10).

6. The Chongqing dialect speech recognition method of a transformer composed of dual encoders according to claim 1, characterized in that: The encoder's loss function Loss is as follows: Loss=Loss1+α*Loss KL (11) Where Loss1 is the decoding loss function; α is the weight of the divergence loss function in the total loss function; Among them, KL divergence loss function Loss KL As shown below: Where, L is the number of encoders; y 1,n ,y 2,n is the output of the nth encoder.

Citation Information

Patent Citations

  • Text generation method and device, electronic equipment and computer readable medium

    CN111326157A

  • Streaming and non-streaming mixed speech recognition system and streaming speech recognition method

    CN113257248A

  • Method for improving Chongqing dialect speech recognition through transfer learning

    CN116416967A

  • Speech recognition method and device, electronic equipment and storage medium

    CN118136005A

  • Multi-turn dialogue response generation with persona modeling

    US20210027770A1