Voice digital recognition method for mobile terminal, storage medium and mobile terminal
By building the acoustic model of CNN and CTC on the mobile terminal, the speech digit recognition delay problem under the limitations of server capacity and network bandwidth is solved, efficient and accurate speech digit recognition is achieved, meeting the real-time demand and promoting the development of technology.
Patent Information
- Application Number
- CN202410871611.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-03
AI Technical Summary
Existing server-based speech digit recognition methods are prone to delays and queuing problems during peak user periods, are difficult to meet real-time requirements, and are limited by server capacity and network bandwidth.
CNN and CTC are used to build acoustic models for mobile terminals. Through spectral feature extraction and language model training, end-to-end speech digital recognition is achieved, reducing dependence on server resources, and maintaining efficient operation in unstable network environments.
It realizes direct speech digit recognition on mobile terminals, improves the accuracy and speed of recognition, meets the real-time needs of users, and opens up new possibilities for the development of speech digit recognition technology.
Smart Images

Figure CN118588084A
Abstract
Description
Technical Field
[0001] The present invention relates to a voice recognition method, and in particular to a mobile-end-oriented voice digit recognition method, a storage medium, and a mobile terminal. Background Art
[0002] In recent years, with the rapid development of deep learning, big data, mobile internet, and cloud computing, artificial intelligence (AI) has made tremendous progress. Intelligent voice interaction, as a key area of AI, is rapidly maturing and becoming a hot topic in the industry. Voice digit recognition, a key branch of intelligent voice interaction technology, poses a threat to network security as the internet continues to evolve and the proliferation of automated programs. Automatic voice digit recognition can effectively verify user legitimacy, improve the security of internet systems, and prevent information leakage and unauthorized resource use.
[0003] Speech digit recognition primarily involves automatically or semi-automatically converting the digits contained in speech using computers or terminal devices to accurately identify the digits. However, traditional server-based speech digit recognition methods face several bottlenecks, particularly in the face of the rapidly growing number of internet users and the challenges posed by automated programs to network security. Limited by server capacity and network bandwidth, these methods are prone to delays and queues during peak user periods, making it difficult to meet real-time requirements. Against this backdrop, developing mobile-oriented speech digit recognition methods has become crucial. Summary of the Invention
[0004] The purpose of the present invention is to solve the technical problem that the existing server-based voice digit recognition method is limited by server capacity and network bandwidth, resulting in delays and queuing during peak user periods, making it difficult to meet real-time requirements, and to provide a mobile-oriented voice digit recognition method, storage medium, and mobile terminal.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] A method for mobile-oriented voice digit recognition includes the following steps:
[0007] Step 1: Construct a speech digit dataset, preprocess the speech digit data, and annotate the speech digits in the speech digit dataset to obtain the actual digital text labels corresponding to the speech digits;
[0008] Step 2: Divide the preprocessed speech digit dataset into a training set and a test set;
[0009] Step 3: Extract spectrum features from the training set and the test set respectively to obtain spectrum feature maps of the training set and the test set;
[0010] Step 4: Build an acoustic model for mobile devices based on CNN (Convolutional Neural Network) and CTC (Connectionist Temporal Classification); train the CNN using the spectral feature map of the training set as input; then send the output layer vector of the trained CNN to the CTC for decoding, calculate the probability between the spoken numbers in the training set and the corresponding digital pinyin, and use the digital pinyin with the highest probability as the output of the CTC to obtain the digital pinyin sequence corresponding to the spoken numbers in the training set;
[0011] Step 5: Build a language model and train the language model using the training set to obtain a trained language model. Then, send the digit-pinyin sequence output by CTC to the trained language model for correction to obtain the digital recognition text corresponding to the phonetic digits in the training set.
[0012] Step 6: Establish a loss function optimization target based on the consistency correlation coefficient according to the actual digital text label and the digital recognition text obtained in step 5, and use the Adam algorithm to iteratively optimize the acoustic model and language model until the model converges;
[0013] Step 7: Send the spectral feature map of the test set to the optimized acoustic model and language model to obtain the digital recognition text corresponding to the test set, and compare it with the actual digital text label to obtain the recognition accuracy and speed.
[0014] Furthermore, step 6 is specifically as follows: step 6.1, based on the actual digital text label and the digital recognition text obtained in step 5, establish the following loss function optimization objective based on the consistency correlation coefficient:
[0015]
[0016] Where: θ is the parameter of the acoustic model and language model; CER is the error rate; d is the edit distance; l is the length of the text;
[0017] Step 6.2: Use the Adam algorithm to optimize the parameters θ of the acoustic model and language model until the model converges.
[0018] Furthermore, in step 4, the CNN includes a ReLU activation function, as well as 10 convolutional layers, 5 pooling layers, 1 Dropout layer, and 2 fully connected layers; the 10 convolutional layers are divided into 5 groups, and the 5 groups of convolutional layers are each connected to 1 pooling layer to form 5 convolutional pooling units; the 5 convolutional pooling units are connected in series in sequence;
[0019] The Dropout layer and two fully connected layers are connected in sequence and connected to the convolutional pooling unit at the end, which is connected to the input of the CTC as the output of the CNN.
[0020] Each convolutional layer contains a 3×3 convolution kernel with ReLU activation function; the number of neurons in the two fully connected layers is 128 and 1428 respectively.
[0021] Furthermore, in step 1, the speech digital data set is preprocessed as follows:
[0022] The speech data set is filtered out if the speech speed is faster than the preset speed, the semantics are unclear, the speech does not correspond to the digital text, the speech duration is shorter than the preset minimum duration, and the speech duration is longer than the preset maximum duration.
[0023] Furthermore, the speech digit set is divided into a repeated speech set and a non-repeated speech set;
[0024] Eliminate the speech whose duration is less than the first preset minimum duration and whose duration is greater than the first preset maximum duration from the repeated speech collection;
[0025] The speech in the non-repeated speech set whose speech duration is less than the second preset minimum duration and whose speech duration is greater than the second preset maximum duration is eliminated.
[0026] Furthermore, the first preset minimum duration is 3 seconds, and the first preset maximum duration is 30 seconds;
[0027] The second preset minimum duration is 2 seconds, and the first preset maximum duration is 15 seconds.
[0028] Furthermore, in step 3, spectrum features are extracted from the training set and the test set respectively, specifically:
[0029] The training set and test set are pre-emphasized, framed, windowed and short-time Fourier transformed respectively.
[0030] At the same time, the present invention also provides a storage medium on which a trained model is stored or deployed, and its special feature is that when the model is executed by the processor, the steps of the aforementioned mobile-oriented voice digit recognition method are implemented.
[0031] At the same time, the present invention also provides a mobile terminal, including a memory, a processor, and a program stored in the memory and runnable on the processor, the special feature of which is that when the processor executes the program, the steps of the aforementioned mobile-oriented voice digit recognition method are implemented.
[0032] The beneficial effects of the present invention are:
[0033] 1. The present invention does not rely on servers and networks. It adopts a shallow neural network structure of CNN+CTC. The model is small and can be directly deployed on mobile terminals, reducing resource consumption and bandwidth dependence on servers. It not only meets users' expectations for real-time performance, but also maintains efficient operation in unstable network environments, opening up new possibilities for the further development and promotion of speech digit recognition technology. In addition, unlike traditional speech recognition methods, the CNN used in the present invention realizes end-to-end training and prediction, ensuring the global optimal performance of the acoustic model and providing effective support for the robustness of the overall acoustic model.
[0034] 2. The present invention adopts the CNN+CTC acoustic model and uses the spectral feature map as the input of CNN instead of directly using the waveform signal, thereby improving the feature recognition, contributing to more accurate speech digit recognition, and improving the recognition accuracy.
[0035] 3. The present invention also provides a readable storage medium / terminal device / readable storage medium capable of executing the above method steps, which can promote and apply the method of the present invention and realize digital speech recognition on corresponding hardware devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 1 is a flow chart of steps 1-8 in an embodiment of a method for mobile-end-oriented voice digit recognition according to the present invention;
[0037] Figure 2 It is a structural diagram of CNN in an embodiment of the mobile-oriented voice digit recognition method of the present invention. DETAILED DESCRIPTION
[0038] To make the purpose, advantages and features of the present invention more clear, the following is a further detailed description of the mobile-oriented voice digit recognition method, storage medium, and mobile terminal proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more clear according to the following specific embodiments.
[0039] The present embodiment provides a method for mobile terminal-oriented voice digit recognition, which specifically includes the following steps:
[0040] Step 1: Preprocess the voice digit data, construct a voice digit dataset, and annotate the voice digits in the voice digit dataset to obtain the actual digital text labels corresponding to the voice digits.
[0041] In order to ensure the robustness and generalization of the model, the above-mentioned digital voice data includes voices of different ages and different scenarios when it is acquired.
[0042] The main purpose of the above-mentioned preprocessing is to eliminate unqualified speech, thereby eliminating the interference of these unqualified speech. The speech digital set is specifically divided into a repeated speech set and a non-repeated speech set; the preprocessing is specifically as follows: for the repeated speech set, eliminate the speech in the repeated speech set with a speech speed greater than the preset speech speed, unclear semantics, not corresponding to the digital text, speech duration less than the first preset minimum duration, and speech duration greater than the first preset maximum duration; in this embodiment, the first preset minimum duration is set to 3 seconds, and the first preset maximum duration is 30 seconds. For non-repeated speech, eliminate the speech in the digital speech data set with a speech speed greater than the preset speech speed, unclear semantics, not corresponding to the digital text, speech duration less than the second preset minimum duration, and speech duration greater than the second preset maximum duration; the second preset minimum duration is 2 seconds, and the second preset maximum duration is 15 seconds. It should be noted that the above-mentioned specific settings for the first preset minimum duration, the second preset minimum duration, the first preset maximum duration, and the second preset maximum duration are only a specific embodiment of the present invention. In other embodiments of the invention, those skilled in the art may also set them to 1.5 seconds, 2.5 seconds, 3.5 seconds, 25 seconds, 16 seconds, etc. according to actual needs.
[0043] Step 2: Divide the preprocessed speech digital data set into a training set and a test set according to a certain ratio; for example: the training set accounts for 70% and the test set accounts for 30%; or the training set accounts for 80% and the test set accounts for 20%; or the training set accounts for 75% and the test set accounts for 35%, etc.
[0044] Step 3: In the time domain, the waveform description ability of speech is poor, and analysis is very difficult. In the frequency domain, since the frequency components of each vowel when people speak are relatively fixed, it is easier to distinguish different vowels and perform speech analysis based on the speech spectrum. Therefore, the feature extraction process mainly focuses on studying the frequency domain of speech to extract frequency-related characteristics.
[0045] The training set and the test set are respectively subjected to pre-emphasis, framing, windowing and short-time Fourier transform, so as to extract the spectrum features of the training set and the test set respectively and obtain the spectrum feature maps of the training set and the test set.
[0046] Step 4: Build an acoustic model for mobile devices based on CNN (convolutional neural network) and CTC (connectionist temporal classification), see Figure 2CNN specifically includes the ReLU activation function, as well as 10 convolutional layers, 5 pooling layers, 1 Dropout layer and 2 fully connected layers; the 10 convolutional layers are divided into 5 groups, and the output ends of the 5 groups of convolutional layers are respectively connected to 1 pooling layer to form 5 convolutional pooling units; the 5 convolutional pooling units are connected in series in sequence; the Dropout layer and the 2 fully connected layers are connected in sequence and connected to the output end of the convolutional pooling unit at the end, which serves as the output end of CNN and the input end of CTC; each convolutional layer contains a 3×3 convolution kernel of the ReLU activation function; the number of neurons in the 2 fully connected layers are 128 and 1428 respectively.
[0047] Due to its regular design and repeated, stackable convolutional blocks, it performs well in feature extraction. After convolution, it is followed by a pooling layer to reduce the spatial dimension of the features. The dropout layer randomly interrupts the connections in the neural network to prevent overfitting.
[0048] The CNN is trained with the spectral feature map of the training set as input; the output layer vector of the trained CNN is then sent to the CTC for decoding, the probability between the spoken numbers in the training set and the corresponding digital pinyin is calculated, and the digital pinyin with the highest probability is used as the output of the CTC to obtain the digital pinyin sequence corresponding to the spoken numbers in the training set.
[0049] Step 5: Build a language model and train the language model using the training set to obtain a trained language model. Then, send the numeric pinyin sequence output by CTC to the trained language model for correction to obtain the numeric recognition text corresponding to the phonetic numbers in the training set.
[0050] Step 6: Establish a loss function optimization target based on the consistency correlation coefficient according to the actual digital text label and the digital recognition text obtained in step 5, and use the Adam algorithm to optimize the acoustic model and language model until the loss function no longer decreases after multiple iterative optimizations, that is, the model converges.
[0051] Step 6.1. Based on the actual digital text label and the digital recognition text obtained in step 5, establish the following loss function optimization objective based on the consistency correlation coefficient:
[0052]
[0053] Where: θ is the parameter of the acoustic model and language model; CER is the error rate, 1-CER is the accuracy rate; d is the edit distance; l is the length of the text.
[0054] In step 6.2, use the Adam algorithm to optimize the parameters θ of the acoustic model and language model until the loss function no longer decreases after multiple iterations of optimization. The specific hyperparameters used in this process are: learning rate - 0.0001, beta_1 - 0.9, beta_2 - 0.999, epsilon - 10e-8, and learning rate decay - 0.0.
[0055] Step 7: Send the spectral feature map of the test set to the optimized acoustic model and language model, predict the digital recognition text corresponding to the test set, and compare it with the actual digital text label to obtain the recognition accuracy and speed.
[0056] The word accuracy of the automatic speech digit recognition method of the present invention is compared with that of the existing CTC, CTC+Long Short-Term Memory (Long Short-Term Memory Network), CTC+Bidirectional (Bidirectional)+LSTM, CTC+Bi+Transformer, Transformer, Listen, Attend, and Spell (Listen, Attend, and Spell), Generalized Random Forest (Generalized Random Forest), Synchronized-Transformer, and Adaptive independence assumption Non-autoregressive Transformer (Adaptive independence assumption Non-autoregressive Transformer) models, as shown in Table 1 below:
[0057] Table 1 Comparison of word accuracy performance between the proposed model and other methods
[0058]
[0059]
[0060] It can be seen from the above table that the voice digit recognition method of the present invention is more accurate than other language recognition models.
[0061] Some prediction results of the experiment on the test set are shown in Table 2 below:
[0062] Table 2 Efficiency and performance results of the model of the present invention
[0063]
[0064] It can be seen from Table 2 above that the speech digit recognition method of the present invention has a faster average recognition speed and a smaller model.
[0065] The mobile-oriented automatic voice digit recognition method of the present invention can be applied in a readable storage medium, which stores a program. The above-mentioned mobile-oriented automatic voice digit recognition method can be stored as a trained model or deployed and stored in the readable storage medium. When the deployed model is executed by the processor, the various steps of the above-mentioned mobile-oriented automatic voice digit recognition method are implemented.
[0066] In addition, the mobile-oriented automatic voice digit recognition method of the present invention can also be applied to a mobile terminal device, including a memory, a processor, and a model stored in the memory and executable on the processor, wherein the processor executes the model to implement the steps of the mobile-oriented automatic voice digit recognition method of the present invention. The terminal device here can be a handheld computer, a mobile phone, etc., and the processor can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, or other programmable logic device.
Claims
1. A method for mobile terminal-oriented voice digit recognition, characterized in that: The following steps are involved: Step 1: construct a voice digit data set, preprocess the voice digit data, and annotate the voice digits in the voice digit data set to obtain the actual digital text labels corresponding to the voice digits; Step 2, dividing the preprocessed speech digital data set into a training set and a test set; Step 3: Extract spectrum features from the training set and the test set respectively to obtain spectrum feature graphs of the training set and the test set; Step 4: Build an acoustic model for mobile terminals based on CNN and CTC; train CNN using the spectral feature map of the training set as input; then send the output layer vector of the trained CNN to CTC for decoding, calculate the probability between the spoken numbers and the corresponding digital pinyin in the training set, and use the digital pinyin with the highest probability as the output of CTC to obtain the digital pinyin sequence corresponding to the spoken numbers in the training set; Step 5: Build a language model and train the language model with the training set to obtain a trained language model; then send the digital pinyin sequence output by CTC to the trained language model for correction to obtain the digital recognition text corresponding to the voice numbers in the training set; Step 6: Establish a loss function optimization target based on the consistency correlation coefficient according to the actual digital text label and the digital recognition text obtained in step 5, and use the Adam algorithm to iteratively optimize the acoustic model and language model until the model converges; Step 7: Send the spectral feature map of the test set to the optimized acoustic model and language model to obtain the digital recognition text corresponding to the test set, and compare it with the actual digital text label to obtain the recognition accuracy and speed.
2. The method for mobile-oriented voice digit recognition according to claim 1, characterized in that: Step 6 is as follows: Step 6.1: According to the actual digital text label and the digital recognition text obtained in step 5, establish the following loss function optimization objective based on the consistency correlation coefficient: Where: θ is the parameter of the acoustic model and language model; CER is the error rate; d is the edit distance; l is the text length; Step 6.2: Use the Adam algorithm to optimize the parameters θ of the acoustic model and language model until the model converges.
3. The method for mobile-end-oriented voice digit recognition according to claim 1 or 2, characterized in that: In step 4, the CNN includes a ReLU activation function, as well as 10 convolutional layers, 5 pooling layers, 1 Dropout layer, and 2 fully connected layers; The 10 convolutional layers are divided into 5 groups, and each of the 5 groups of convolutional layers is connected to a pooling layer to form 5 convolutional pooling units; the 5 convolutional pooling units are connected in series in sequence; The Dropout layer and the two fully connected layers are connected in sequence and connected to the convolutional pooling unit at the end, and connected as the output of CNN to the input of CTC; Each convolutional layer contains a 3×3 convolution kernel of the ReLU activation function; the number of neurons in the two fully connected layers is 128 and 1428 respectively.
4. The method for mobile-end-oriented voice digit recognition according to claim 3, characterized in that: In step 1, the speech digital data set is preprocessed as follows: The speech in the speech digital data set is eliminated if the speech speed is faster than the preset speed, the semantics is unclear, the speech does not correspond to the digital text, the speech duration is shorter than the preset minimum duration, and the speech duration is longer than the preset maximum duration.
5. The method for mobile-oriented voice digit recognition according to claim 4, characterized in that: The voice digit set is divided into a repeated voice set and a non-repeated voice set; Eliminate the speech whose speech duration is less than the first preset minimum duration and whose speech duration is greater than the first preset maximum duration in the repeated speech collection; The speech whose speech duration is less than the second preset minimum duration and whose speech duration is greater than the second preset maximum duration are eliminated from the non-repetitive speech set.
6. The method for mobile-end-oriented voice digit recognition according to claim 5, characterized in that: The first preset minimum duration is 3 seconds, and the first preset maximum duration is 30 seconds; The second preset minimum duration is 2 seconds, and the first preset maximum duration is 15 seconds.
7. The method for automatic recognition of speech digits for mobile terminals according to claim 1, characterized in that: In step 3, the spectral features of the training set and the test set are extracted as follows: The training set and test set are pre-emphasized, framed, windowed and short-time Fourier transformed respectively.
8. A storage medium on which a trained model is stored or deployed, characterized in that: When the model is executed by a processor, the steps of the mobile-oriented voice digit recognition method as described in any one of claims 1 to 7 are implemented.
9. A mobile terminal comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the mobile-oriented voice digit recognition method as described in any one of claims 1 to 7 are implemented.
