A voice interaction method and system based on artificial intelligence
By combining connected temporal classification and deep feed-forward sequence memory neural networks, the speech recognition model structure is improved, solving the problems of parameter redundancy and insufficient recognition accuracy, and achieving a more efficient speech recognition effect.
Patent Information
- Application Number
- CN202410527043.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-04-29
AI Technical Summary
There is a parameter redundancy problem in the deep feed-forward sequence memory neural network model, which affects the model performance. In addition, existing speech recognition methods have deficiencies in noise processing and consideration of speech frame relationships, resulting in low recognition accuracy.
Combined with the connection time series classification method, the model structure is improved, the deep feed-forward sequence memory neural network and the convolutional neural network are integrated, and an end-to-end speech recognition model is built through mel filter group feature extraction and secondary feature extraction to reduce the difficulty of model construction. and improve recognition accuracy.
Through the combination of deep feed-forward sequence memory neural network and connected temporal classification model, long-term dependencies are captured, the accuracy of speech recognition and model performance are improved, parameter redundancy is reduced, expressive ability is enhanced, and the complex features of speech signals are improved Adaptability.
Smart Images

Figure CN118280371B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent voice interaction technology, and in particular to a voice interaction method and system based on artificial intelligence. Background Art
[0002] In recent years, with the rapid development of natural language processing, the research on intelligent voice interaction has also entered a stage of rapid development. Only natural language is needed to complete relevant requests, which greatly simplifies the operation process. Therefore, the intelligent voice interaction system has a very wide range of application fields and market prospects.
[0003] Intelligent voice interaction technology mainly includes speech recognition and speech synthesis. In the field of speech recognition, the acoustic model is a model that solves the conversion probability between speech signals and acoustic modeling units. The language model processing process is to convert the results of pattern matching into corresponding text sequences as feedback results for output. Compared with the traditional neural network model, the fully connected feedforward neural network (Feedforword Sequential Memory Nerworks, FSMN) adds memory units on the basis of the feedforward sequence memory neural network to store contextual information related to the currently processed speech signal. On this basis, some scholars proposed the Deep Feedforword Sequential Memory Neural Network (DFSMN), which can solve the above-mentioned gradient vanishing problem well by adding jump connections in the memory block, and increase the length of the model compatible with the speech sequence, so that the model can train longer signal sequences.
[0004] The Connectionist Temporal Classification (CTC) method is the mainstream method in speech recognition, and is usually combined with the Long Short Term Memory (LSTM) model to form an LSTM-CTC acoustic model. However, due to the high computational cost of the LSTM model, it is difficult to fully train the Connectionist Temporal Classification model.
[0005] Although the deep feedforward sequence memory neural network model has achieved good recognition results in speech recognition tasks, it is known from the study of its model structure that the memory modules in each hidden layer of the deep feedforward sequence memory neural network model have the same size, which makes the model redundant in the storage of memory information during training, resulting in an increase in model parameters and affecting the performance of the model. Therefore, it is necessary to improve the structure of the model in view of the parameter redundancy problem existing in the deep feedforward sequence memory neural network model.
[0006] The most commonly used speech feature extraction method in speech recognition is Mel-scale Frequency Cepstral Coefficients (MFCC). However, since the feature length extracted using this method is short, the relationship between each speech frame is not considered, and the noise in the sound signal is not processed, the recognition accuracy is not high. Summary of the invention
[0007] In view of this, the purpose of an embodiment of the present invention is to provide a voice interaction method and system based on artificial intelligence. In order to address the parameter redundancy problem existing in the deep feedforward sequence memory neural network model, the storage unit structure of the model and the connection method between the storage units are improved, and an end-to-end speech recognition model is constructed in combination with a connection timing classification method, which further reduces the difficulty of model construction, and based on the features of the multi-Mel filter group with good speech recognition performance, a convolutional neural network is combined for secondary extraction.
[0008] In a first aspect, an embodiment of the present invention provides a voice interaction method based on artificial intelligence, which includes:
[0009] Collect the voice analog signal, perform preprocessing, and obtain the voice digital signal.
[0010] Based on the Mel-value filter bank feature extraction method, the speech digital signal is processed to obtain primary acoustic features.
[0011] A deep feedforward sequence memory neural network is fused with a connection temporal classification model, and the primary acoustic features are used as input for model training to construct an acoustic model.
[0012] A convolutional neural network is used to perform secondary feature extraction on the primary acoustic features to obtain advanced acoustic features.
[0013] The acoustic model is fused with a convolutional neural network model, and the high-level acoustic features are used as input for model training to construct a secondary acoustic model.
[0014] The secondary acoustic model is used to perform speech recognition on the speech input by the user to obtain text data.
[0015] The text data is matched locally and / or in the cloud, and the results are output to the user.
[0016] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, wherein the collecting the voice analog signal, performing preprocessing, and obtaining the voice digital signal includes:
[0017] Gets the voice analog signal from the audio capture device with the specified number of channels.
[0018] The voice analog signal is uniformly sampled at a specified sampling rate, and the continuous analog signal is converted into a discrete signal to obtain a uniformly sampled voice signal.
[0019] The uniformly sampled speech signal is linearly quantized with a specified number of quantization bits, and continuous sample values are quantized into discrete values to obtain a quantized speech signal.
[0020] The quantized speech signal is subjected to audio encoding using a specified encoding technique to obtain an encoded speech digital signal.
[0021] In combination with the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the method for extracting features based on a Mel-value filter group processes the speech digital signal to obtain primary acoustic features including:
[0022] The speech digital signal is windowed and framed to obtain a speech frame x(t), which represents the speech signal of the t-th frame.
[0023] Perform Fourier transform on each frame of speech signal to obtain the spectrum information X of the speech signal in each time window. f (t)=FFT(x(t)), where FFT stands for Fourier transform, f stands for frequency, and t stands for time step.
[0024] The spectrum information X f Through a set of Mel filters, the Mel spectrum coefficient F=Mel-filter(X f (t)).
[0025] Perform logarithmic transformation to obtain the logarithmic Mel spectrum coefficient , As a primary acoustic feature.
[0026] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the deep feedforward sequence memory neural network is fused with the connection time series classification model, the primary acoustic features are used as input for model training, and the acoustic model is constructed, including:
[0027] The primary acoustic feature As the input of the DFSMN layer for sequence modeling, the output h of the DFSMN layer ta =DFSMN( ), which represents the hidden state of layer a at time step t.
[0028] The output h of the DFSMN layer taApply the ReLU activation function to get the output of the activation layer .
[0029] The output of the activation layer Input to the linear layer for linear transformation to get the output of the linear layer .
[0030] Use the concatenated temporal classification loss function to calculate the model output sequence The distance between the corresponding label sequence and the loss value are obtained , where T is the length of the output sequence, For a given output sequence The probability of observing the label sequence under
[0031] The back-propagation algorithm is used to calculate the gradient of the connection temporal classification loss function with respect to the model parameters.
[0032] According to the calculated gradient information, the optimization algorithm is used to update the model parameters, and the parameter values are adjusted in the opposite direction of the gradient to minimize the connection time series classification loss and obtain the acoustic model.
[0033] Its technical effect is: combining the deep feedforward sequence memory neural network (DFSMN) with the connectionist temporal classification (CTC) model to build an end-to-end speech recognition model. The deep feedforward sequence memory neural network is suitable for processing long sequences and can capture long-term dependencies in speech signals. The model can better understand long-term speech input and improve the accuracy of speech recognition. By adding the ReLU activation function after the DFSMN layer, nonlinear transformation is introduced, which enhances the expressiveness of the model and enables it to better adapt to the complex characteristics of speech signals. After the output of the DFSMN layer is subjected to the ReLU activation function and linear transformation, the label probability distribution sequence of each time step is obtained, which helps to more accurately classify the speech signal at each time step. The CTC loss function is added to compare the output sequence of the model with the label sequence, and the difference between the model prediction sequence and the true label sequence is calculated, thereby guiding the update of the model parameters and optimizing the training effect of the model.
[0034] In combination with the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein the use of a convolutional neural network to perform secondary feature extraction on the primary acoustic features to obtain advanced acoustic features includes:
[0035] The primary acoustic features are filtered using a convolution operation to obtain a convolution output feature. ,in, is the element in the i-th row and j-th column of the primary acoustic feature, is the weight of the convolution kernel, m and n are used to specify the element position in the convolution kernel, and b is the bias term.
[0036] Apply activation function to the output of convolutional layer .
[0037] The output of the activation function is downsampled in the pooling layer, and the maximum value in the area is taken as the output , construct feature representation and obtain high-level acoustic features.
[0038] In combination with the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the fusing of the acoustic model with the convolutional neural network model, taking the high-level acoustic features as input for model training, and constructing a secondary acoustic model includes:
[0039] The output P of the acoustic model is connected in series with the output Q of the high-level acoustic feature to obtain a feature representation M={P, Q}.
[0040] Using cross entropy as the loss function, the loss function is defined as ,in, is the true label, is the output predicted by the model.
[0041] For the parameters of the acoustic model and the parameters of the convolutional neural network, the gradients of the parameters are calculated using the back-propagation algorithm.
[0042] According to the calculated gradient information, the optimization algorithm is used to update the parameters of the model, and finally the secondary acoustic model M=f({P,Q}) is obtained.
[0043] Its technical effect is that the speech features after convolutional neural network feature extraction are more accurate and have smaller dimensions, which can enable the parameters in the connection time series classification to be more fully trained, thereby improving the performance of the model.
[0044] In combination with the first aspect, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein the using the secondary acoustic model to perform speech recognition on the speech input by the user to obtain text data includes:
[0045] The wake-up command voice input by the user is collected, and the predefined wake-up word voice model is used to determine whether it is a wake-up word. If it is determined to be a wake-up word, voice recognition begins.
[0046] The question command voice input by the user is collected, and the question command voice is recognized using the secondary acoustic model to convert it into text data.
[0047] In combination with the first aspect, the embodiment of the present invention provides a seventh possible implementation of the first aspect, wherein the matching the text data locally and / or in the cloud and outputting the result to the user includes:
[0048] The text data is matched with a local knowledge base. If there is a matching item in the local knowledge base, the matching text data is converted into voice or text, and the matching result is output to the user.
[0049] If there is no matching item in the local knowledge base, a search service is requested from the cloud recognition engine to obtain the search results, and the search results are output to the user.
[0050] The technical effect is that when offline, the local knowledge base can be used for matching, which can quickly and effectively find information related to user needs, reducing dependence on external resources. If no matching items are found in the local knowledge base, a search service can be requested from the cloud recognition engine to obtain a wider range of search results.
[0051] In combination with the first aspect, an embodiment of the present invention provides an eighth possible implementation of the first aspect, wherein ROS nodes are used to perform message transmission in the speech recognition and matching process.
[0052] Its technical effect is that through the message transmission process between ROS nodes, the complete processing process from user voice input to voice recognition, knowledge base matching, and speech synthesis is realized. Each node is responsible for a specific function, and data transmission and communication are carried out through ROS topics, realizing the modularity and flexibility of the system.
[0053] In a second aspect, an embodiment of the present invention further provides a voice interaction system based on artificial intelligence, which includes:
[0054] The speech recognition module is used to use the secondary acoustic model to perform speech recognition on the speech input by the user to obtain text data.
[0055] The speech synthesis module is used to match the text data locally and / or in the cloud and output the result to the user.
[0056] The cloud service module is used to receive the text data transmitted by the speech synthesis module and perform network retrieval to output the results to the user.
[0057] The beneficial effects of the embodiments of the present invention are:
[0058] The present invention combines a deep feedforward sequence memory network with a connection time series classification model to train the recognition model, which reduces the parameters of the acoustic model, makes the model structure simpler, and reduces the difficulty of model training.
[0059] Based on the feature extraction method of the logarithmic Mel filter group, the present invention uses a convolutional neural network to perform a secondary extraction improved method, which can better characterize the speech information. The primary acoustic features are used as input, and then the speech recognition task is performed through the deep feedforward sequence memory neural network-connection time series classification recognition model. The entire model uses the connection time series classification as the loss function to update the parameters and complete the end-to-end conversion. The speech features after the secondary feature extraction of the convolutional neural network are more accurate and have a smaller dimension, which can make the parameters in the connection time series classification more fully trained, thereby improving the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0061] Figure 1 The present invention is a flow chart of the voice interaction method based on artificial intelligence. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0063] Please refer to Figure 1 The first embodiment of the present invention provides a voice interaction method based on artificial intelligence, which includes: collecting voice analog signals, performing preprocessing, and obtaining voice digital signals; processing the voice digital signals based on a Mel filter group feature extraction method to obtain primary acoustic features; using a deep feedforward sequence memory neural network and a connection time series classification model to fuse the primary acoustic features as input for model training to construct an acoustic model; using a convolutional neural network to perform secondary feature extraction on the primary acoustic features to obtain advanced acoustic features; fusing the acoustic model with a convolutional neural network model, using the advanced acoustic features as input for model training to construct a secondary acoustic model; using the secondary acoustic model to perform voice recognition on the voice input by the user to obtain text data; matching the text data locally and / or in the cloud, and outputting the results to the user.
[0064] The collecting of the voice analog signal and preprocessing to obtain the voice digital signal comprises:
[0065] Acquire a voice analog signal from an audio acquisition device with a specified number of channels, wherein mono is usually used to simplify processing and reduce the amount of calculation. If stereo input is used, it can be converted to mono for subsequent processing; uniformly sample the voice analog signal at a specified sampling rate, convert the continuous analog signal into a discrete signal, and obtain a uniformly sampled voice signal, wherein the sampling rate is 16kHz, 16,000 samples are collected per second, and the uniformly sampled voice signal is obtained, and these samples represent the values of the voice analog signal at different time points; linearly quantize the uniformly sampled voice signal with a specified number of quantization bits, quantize the continuous sample values into discrete values, and obtain a quantized voice signal, wherein the number of quantization bits is usually 16 bits or 24 bits, and the purpose of quantization is to map the sample values to discrete values within a specific range, so as to facilitate subsequent processing and storage; perform audio encoding on the quantized voice signal with a specified encoding technology to obtain an encoded voice digital signal, wherein the encoding technology can use pulse code modulation (PCM), compression encoding, etc., and the encoded voice digital signal is more suitable for transmission or storage, and maintains the key features of the voice signal.
[0066] The method for extracting the feature of the digital Mel filter bank based on the digital voice signal is used to process the digital voice signal to obtain the primary acoustic feature, which includes: windowing and framing the digital voice signal to obtain a voice frame x(t), which represents the voice signal of the tth frame; performing Fourier transform on the voice signal of each frame to obtain the spectrum information X of the voice signal in each time window. f (t) = FFT (x (t)), which is used to describe the energy distribution of the speech signal at different frequencies, where FFT represents Fourier transform, f represents frequency, and t represents time step; the spectrum information X f Through a set of Mel filters, the Mel spectrum coefficient F=Mel-filter(X f (t)), used to represent the energy distribution of the speech signal at different frequencies; logarithmic transformation is performed to obtain the logarithmic Mel spectrum coefficients , As a primary acoustic feature, logarithmic transformation is used to enhance the low-frequency features, making the energy of the sound at different frequencies easier to distinguish.
[0067] The method of using a deep feedforward sequence memory neural network and a connection time series classification model to fuse the primary acoustic features as input for model training to construct an acoustic model includes: As the input of the DFSMN layer for sequence modeling, the output h of the DFSMN layer ta =DFSMN( ), represents the hidden state of layer a at time step t; the output h of DFSMN layer ta Apply the ReLU activation function to get the output of the activation layer ; The output of the activation layer Input to the linear layer for linear transformation to get the output of the linear layer ; Use the connection time series classification loss function to calculate the model output sequence The distance between the corresponding label sequence and the loss value are obtained , where T is the length of the output sequence, For a given output sequence The probability of observing the label sequence under the condition of θ; the gradient of the connection time series classification loss function to the model parameters is calculated using the back propagation algorithm; according to the calculated gradient information, the model parameters are updated using the optimization algorithm, and the parameter values are adjusted in the opposite direction of the gradient to minimize the connection time series classification loss and obtain the acoustic model.
[0068] Its technical effect is: combining the deep feedforward sequence memory neural network (DFSMN) with the connectionist temporal classification (CTC) model to build an end-to-end speech recognition model. The deep feedforward sequence memory neural network is suitable for processing long sequences and can capture long-term dependencies in speech signals. The model can better understand long-term speech input and improve the accuracy of speech recognition. By adding the ReLU activation function after the DFSMN layer, nonlinear transformation is introduced, which enhances the expressiveness of the model and enables it to better adapt to the complex characteristics of speech signals. After the output of the DFSMN layer is subjected to the ReLU activation function and linear transformation, the label probability distribution sequence of each time step is obtained, which helps to more accurately classify the speech signal at each time step. The CTC loss function is added to compare the output sequence of the model with the label sequence, and the difference between the model prediction sequence and the true label sequence is calculated, thereby guiding the update of the model parameters and optimizing the training effect of the model.
[0069] The method of using a convolutional neural network to perform secondary feature extraction on the primary acoustic features to obtain advanced acoustic features includes: using a convolution operation to perform a filtering operation on the primary acoustic features to extract local features and obtain a convolution output feature. ,in, is the element in the i-th row and j-th column of the primary acoustic feature, is the weight of the convolution kernel, m and n are used to specify the element position in the convolution kernel, and b is the bias term; the activation function is applied to the output of the convolution layer , introduce nonlinear transformation to enhance the expressiveness of the model; downsample the output of the activation function in the pooling layer to reduce the dimension of the feature, extract more significant features, and take the maximum value in the region as the output , construct feature representation and obtain high-level acoustic features.
[0070] The method of fusing the acoustic model with the convolutional neural network model and using the high-level acoustic features as input for model training to construct a secondary acoustic model includes: concatenating the output P of the acoustic model with the output Q of the high-level acoustic features to obtain a feature representation M={P, Q}; using cross entropy as a loss function, defining a loss function, expressed as ,in, is the true label, is the output predicted by the model; for the parameters of the acoustic model and the parameters of the convolutional neural network, the back propagation algorithm is used to calculate the gradient of the parameters respectively; according to the calculated gradient information, the optimization algorithm is used to update the parameters of the model, and finally the secondary acoustic model M=f({P,Q}) is obtained.
[0071] Its technical effect is that the speech features after convolutional neural network feature extraction are more accurate and have smaller dimensions, which can enable the parameters in the connection time series classification to be more fully trained, thereby improving the performance of the model.
[0072] Among them, the use of the secondary acoustic model to perform speech recognition on the voice input by the user to obtain text data includes: collecting the wake-up command voice input by the user, and judging whether it is a wake-up word through a predefined wake-up word voice model. If it is judged to be a wake-up word, the speech recognition starts to execute; specifically, calling the system() function to record the user's wake-up command voice, generate a specified audio file, call the SDK file encapsulated with the predefined wake-up word voice model for recognition, and judge whether it is a wake-up word; collecting the question command voice input by the user, using the secondary acoustic model to perform speech recognition on the question command voice, and converting it to obtain text data.
[0073] Among them, matching the text data locally and / or in the cloud and outputting the results to the user includes: matching the text data in the local knowledge base, if there is a match in the local knowledge base, converting the matching text data into voice or text, and outputting the matching results to the user; if there is no match in the local knowledge base, requesting a retrieval service from the cloud recognition engine, obtaining the retrieval results, and outputting the retrieval results to the user.
[0074] The technical effect is that when offline, the local knowledge base can be used for matching, which can quickly and effectively find information related to user needs, reducing dependence on external resources. If no matching items are found in the local knowledge base, a search service can be requested from the cloud recognition engine to obtain a wider range of search results.
[0075] Among them, ROS nodes are used to carry out message transmission in the process of speech recognition and matching.
[0076] Specifically, the ROS node includes: an offline recording mode node, which is used to receive the user's voice input and publish the recorded voice data through a ROS topic; a voice recognition node, which is used to receive the voice data published from the offline recording mode node, perform voice recognition processing, and publish the recognized text information through a ROS topic for subsequent processing; a voice recognition result topic, which serves as a communication channel between the voice recognition node and other nodes and is used to transmit the result information of voice recognition; a knowledge base matching node, which is used to receive the text information published by the voice recognition result topic, match the local knowledge base, and if a matching item is found in the local knowledge base, publish the matching result through a ROS topic; a knowledge base matching result topic, which serves as a communication channel between the knowledge base matching node and other nodes and is used to transmit the result information of knowledge base matching; a speech synthesis node, which is used to receive the text information of the matching result or the retrieval result, perform speech synthesis processing, and publish the synthesized voice data through a ROS topic for subsequent output to the user; a speech synthesis result topic, which serves as a communication channel between the speech synthesis node and other nodes and is used to transmit the result information of speech synthesis.
[0077] Its technical effect is that through the message transmission process between ROS nodes, the complete processing process from user voice input to voice recognition, knowledge base matching, and speech synthesis is realized. Each node is responsible for a specific function, and data transmission and communication are carried out through ROS topics, realizing the modularity and flexibility of the system.
[0078] The second embodiment of the present invention provides a voice interaction system based on artificial intelligence, which includes: a voice recognition module, which is used to use the secondary acoustic model to perform voice recognition on the voice input by the user to obtain text data; a voice synthesis module, which is used to match the text data locally and / or in the cloud, and output the result to the user; a cloud service module, which is used to receive the text data transmitted by the voice synthesis module and perform network retrieval, and output the result to the user.
[0079] The computer program product of the artificial intelligence-based voice interaction method and device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0080] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, it can execute the above-mentioned artificial intelligence-based voice interaction method, thereby reducing the parameters of the acoustic model, reducing the difficulty of model training, and better characterizing the voice information.
[0081] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0082] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A voice interaction method based on artificial intelligence, characterized in that: include: Collect voice analog signals, perform preprocessing, and obtain voice digital signals; Based on the Mel-value filter bank feature extraction method, the speech digital signal is processed to obtain primary acoustic features; Using a deep feedforward sequence memory neural network and a connection time series classification model, the primary acoustic features are used as input for model training to construct an acoustic model; Using a convolutional neural network, performing secondary feature extraction on the primary acoustic features to obtain advanced acoustic features; The acoustic model is integrated with a convolutional neural network model, and the high-level acoustic features are used as input for model training to construct a secondary acoustic model; Using the secondary acoustic model to perform speech recognition on the speech input by the user to obtain text data; Match the text data locally and / or in the cloud, and output the results to the user; The method for extracting features based on the Mel filter bank is used to process the speech digital signal to obtain the primary acoustic features, including: windowing and framing the speech digital signal to obtain a speech frame x(t), which represents the speech signal of the tth frame; performing Fourier transform on the speech signal of each frame to obtain the spectrum information X of the speech signal in each time window. f (t) = FFT(x(t)), where FFT represents Fourier transform, f represents frequency, and t represents time step; the spectrum information X f Through a set of Mel filters, the Mel spectrum coefficient F=Mel-filter(X f (t)); perform logarithmic transformation to obtain the logarithmic Mel spectrum coefficient , As a primary acoustic feature; The deep feedforward sequence memory neural network is fused with the connection time series classification model, and the primary acoustic features are used as input for model training to construct an acoustic model, including: the primary acoustic features As the input of the DFSMN layer for sequence modeling, the output h of the DFSMN layer ta =DFSMN( ), represents the hidden state of layer a at time step t; the output h of DFSMN layer ta Apply the ReLU activation function to get the output of the activation layer ; The output of the activation layer Input to the linear layer for linear transformation to get the output of the linear layer ; Use the connection time series classification loss function to calculate the model output sequence The distance between the corresponding label sequence and the loss value are obtained , where T is the length of the output sequence, For a given output sequence The probability of observing the label sequence under the condition of θ; using the back propagation algorithm to calculate the gradient of the connection time series classification loss function to the model parameters; according to the calculated gradient information, using the optimization algorithm to update the model parameters, adjusting the parameter value in the opposite direction of the gradient to minimize the connection time series classification loss, and obtaining the acoustic model; The method of using a convolutional neural network to perform secondary feature extraction on the primary acoustic feature to obtain a high-level acoustic feature includes: using a convolution operation to perform a filtering operation on the primary acoustic feature to obtain a convolution output feature. ,in, is the element in the i-th row and j-th column of the primary acoustic feature, is the weight of the convolution kernel, m and n are used to specify the element position in the convolution kernel, and b is the bias term; the activation function is applied to the output of the convolution layer ; Downsample the output of the activation function in the pooling layer and take the maximum value in the area as the output , construct feature representation and obtain high-level acoustic features; The method of fusing the acoustic model with the convolutional neural network model and using the high-level acoustic features as input for model training to construct a secondary acoustic model includes: concatenating the output P of the acoustic model with the output Q of the high-level acoustic features to obtain a feature representation M={P, Q}; using cross entropy as a loss function, defining a loss function, expressed as ,in, is the true label, is the output predicted by the model; for the parameters of the acoustic model and the parameters of the convolutional neural network, the back propagation algorithm is used to calculate the gradient of the parameters respectively; according to the calculated gradient information, the optimization algorithm is used to update the parameters of the model, and finally the secondary acoustic model M=f({P,Q}) is obtained.
2. The artificial intelligence-based voice interaction method according to claim 1, characterized in that: The collecting of the voice analog signal and preprocessing to obtain the voice digital signal comprises: Get the voice analog signal from the audio acquisition device with the specified number of channels; Uniformly sampling the voice analog signal at a specified sampling rate, converting the continuous analog signal into a discrete signal, and obtaining a uniformly sampled voice signal; Linearly quantizing the uniformly sampled speech signal with a specified number of quantization bits, quantizing continuous sample values into discrete values, and obtaining a quantized speech signal; The quantized speech signal is subjected to audio encoding using a specified encoding technique to obtain an encoded speech digital signal.
3. The artificial intelligence-based voice interaction method according to claim 1, characterized in that: The using the secondary acoustic model to perform speech recognition on the speech input by the user to obtain text data includes: Collect the wake-up command voice input by the user, and determine whether it is a wake-up word through the predefined wake-up word voice model. If it is determined to be a wake-up word, voice recognition starts to execute; The question command voice input by the user is collected, and the question command voice is recognized using the secondary acoustic model to convert it into text data.
4. The artificial intelligence-based voice interaction method according to claim 1, characterized in that: The matching of the text data locally and / or in the cloud and outputting the result to the user comprises: Performing knowledge base matching on the text data in the local knowledge base, if there is a matching item in the local knowledge base, converting the matching text data into voice or text, and outputting the matching result to the user; If there is no matching item in the local knowledge base, a search service is requested from the cloud recognition engine to obtain the search results, and the search results are output to the user.
5. The artificial intelligence-based voice interaction method according to claim 4, characterized in that: ROS nodes are used to carry out message transmission in the process of speech recognition and matching.
6. A voice interaction system based on artificial intelligence, characterized in that: include: A speech recognition module is used to perform speech recognition on the speech input by the user using a secondary acoustic model to obtain text data; A speech synthesis module, used to match the text data locally and / or in the cloud, and output the result to the user; A cloud service module, used to receive the text data transmitted by the speech synthesis module and perform network search, and output the results to the user; In the speech recognition module, the method for constructing the secondary acoustic model includes: collecting a speech analog signal, performing preprocessing, and obtaining a speech digital signal; processing the speech digital signal based on a Mel filter group feature extraction method to obtain primary acoustic features; using a deep feedforward sequence memory neural network and a connection time series classification model to fuse the primary acoustic features as input for model training to construct an acoustic model; using a convolutional neural network to perform secondary feature extraction on the primary acoustic features to obtain advanced acoustic features; fusing the acoustic model with a convolutional neural network model, using the advanced acoustic features as input for model training to construct a secondary acoustic model; The method for extracting the feature of the digital Mel filter bank based on the digital voice signal is used to process the digital voice signal to obtain the primary acoustic feature, which includes: windowing and framing the digital voice signal to obtain a voice frame x(t), which represents the voice signal of the tth frame; performing Fourier transform on the voice signal of each frame to obtain the spectrum information X of the voice signal in each time window. f (t) = FFT(x(t)), where FFT represents Fourier transform, f represents frequency, and t represents time step; the spectrum information X f Through a set of Mel filters, the Mel spectrum coefficient F=Mel-filter(X f (t)); perform logarithmic transformation to obtain the logarithmic Mel spectrum coefficient , As a primary acoustic feature; The deep feedforward sequence memory neural network is fused with the connection time series classification model, and the primary acoustic features are used as input for model training to construct an acoustic model, including: the primary acoustic features As the input of the DFSMN layer for sequence modeling, the output h of the DFSMN layer ta =DFSMN( ), represents the hidden state of layer a at time step t; the output h of DFSMN layer ta Apply the ReLU activation function to get the output of the activation layer ; The output of the activation layer Input to the linear layer for linear transformation to get the output of the linear layer ; Use the connection time series classification loss function to calculate the model output sequence The distance between the corresponding label sequence and the loss value are obtained , where T is the length of the output sequence, For a given output sequence The probability of observing the label sequence under the condition of θ; using the back propagation algorithm to calculate the gradient of the connection time series classification loss function to the model parameters; according to the calculated gradient information, using the optimization algorithm to update the model parameters, adjusting the parameter value in the opposite direction of the gradient to minimize the connection time series classification loss, and obtaining the acoustic model; The method of using a convolutional neural network to perform secondary feature extraction on the primary acoustic feature to obtain a high-level acoustic feature includes: using a convolution operation to perform a filtering operation on the primary acoustic feature to obtain a convolution output feature. ,in, is the element in the i-th row and j-th column of the primary acoustic feature, is the weight of the convolution kernel, m and n are used to specify the element position in the convolution kernel, and b is the bias term; the activation function is applied to the output of the convolution layer ; Downsample the output of the activation function in the pooling layer and take the maximum value in the area as the output , construct feature representation and obtain high-level acoustic features; The method of fusing the acoustic model with the convolutional neural network model and using the high-level acoustic features as input for model training to construct a secondary acoustic model includes: concatenating the output P of the acoustic model with the output Q of the high-level acoustic features to obtain a feature representation M={P, Q}; using cross entropy as a loss function, defining a loss function, expressed as ,in, is the true label, is the output predicted by the model; for the parameters of the acoustic model and the parameters of the convolutional neural network, the back propagation algorithm is used to calculate the gradient of the parameters respectively; according to the calculated gradient information, the optimization algorithm is used to update the parameters of the model, and finally the secondary acoustic model M=f({P,Q}) is obtained.
