Pet voice translation method and system, electronic equipment and storage medium
Through the pet voice translation method, deep learning models are used to identify pet emotional states and infer intentions, which solves the problem of owners' error in understanding pet needs, realizes personalized voice interaction, and improves the efficiency and accuracy of pet needs satisfaction.
Patent Information
- Application Number
- CN202411682559.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
Due to the lack of interoperability of words, owners will experience errors in understanding pet needs, which will lead to the inability to effectively meet the pet's current needs.
Pet voice translation method is adopted to collect pet audio data through a distributed sound pickup device, combine environmental data and pet breed and age information, and use long and short-term memory network models to identify emotional states, and generate personalized statements for voice interaction.
Accurate identification and inference of pet emotional state are achieved. Through personalized voice interaction, owners can understand pet needs in a timely and accurate manner, thereby meeting pet's current needs faster.
Smart Images

Figure CN119626263A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to a pet voice translation method, system, electronic device and storage medium. Background Art
[0002] With the improvement of living standards, more and more families keep pets such as cats and dogs, and owners are willing to spend more time interacting with their pets. Pets usually express their emotional state through voice, expression, action and other forms, so as to interact with their owners. The calls of pets carry the needs and emotions that pets want to express, and owners judge the needs of their pets through calls and actions.
[0003] Pets and humans do not have a common language, so owners need to rely on daily actions and experience to judge the needs of pets. However, due to the lack of common language, misunderstandings may occur, resulting in an inability to meet the pet's current needs. Summary of the invention
[0004] The technical problem to be solved by this application is that due to language barriers, pet owners may misunderstand their pets, resulting in the inability to meet the current needs of their pets.
[0005] In order to solve the above problems, in order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a pet voice translation method, system, electronic device and storage medium.
[0006] In a first aspect, the present invention discloses a pet voice translation method, characterized in that it comprises the following steps:
[0007] Acquire pet audio data; the pet audio data is obtained through a distributed sound pickup device, the distributed sound pickup device includes a plurality of pickups distributed on a pet wearable device;
[0008] Acquire environmental data, where the environmental data is obtained through a distributed environmental parameter sensor, where the distributed environmental parameter sensor includes a plurality of identical or different sensors, and the plurality of sensors are distributed on the pet wearable device and / or other environmental detectors;
[0009] Extracting acoustic features of pet audio data, and obtaining a feature vector according to the acoustic features, wherein the feature vector includes an audio frame of the audio data and its corresponding acoustic features;
[0010] Based on the long short-term memory network model, the key emotion distribution in the feature vector is obtained to obtain the probability distribution data of the emotion state;
[0011] The pet's breed and age information, emotional state probability distribution data, and environmental data are combined to obtain the pet's predicted intention and generate a personalized statement corresponding to the predicted intention.
[0012] Preferably, the obtaining of pet audio data comprises the following steps:
[0013] Obtaining audio samples of pet calls and corresponding behavior descriptions and environmental factor data, and storing the audio samples and related data in a structured data format;
[0014] Converting the audio sample into a standard digital audio format to obtain pet audio data, establishing a storage database, storing the pet audio data in the database, and establishing an association between the digital audio format and the structured data format;
[0015] The pet audio data is preprocessed to remove background noise, thereby obtaining preprocessed pet audio data.
[0016] Preferably, the preprocessing of the pet audio data to remove background noise to obtain the preprocessed pet audio data specifically includes the following steps:
[0017] The pet audio data is processed by using spectral subtraction, by estimating the background noise spectrum and subtracting the estimated background noise spectrum from the original audio spectrum to obtain the denoised audio sample;
[0018] Perform wavelet transform on the denoised audio samples to convert the audio signal from the time domain to the wavelet domain;
[0019] In the wavelet domain, according to the preset critical frequency range, the wavelet coefficients within the range are enhanced, while the coefficients within the non-critical frequency range are suppressed;
[0020] Through inverse wavelet transform, the enhanced wavelet coefficients are converted from the wavelet domain back to the time domain to obtain the preprocessed pet audio data.
[0021] Preferably, the step of extracting acoustic features of pet audio data, wherein the acoustic features are based on voice tone and emotional state association cluster data to obtain feature vectors, specifically comprises the following steps:
[0022] Performing frame processing on the preprocessed audio samples to obtain an audio frame sequence;
[0023] For each audio frame in the audio frame sequence, convert it into the frequency domain by fast Fourier transform to obtain a frequency domain signal;
[0024] Calculate the acoustic features of each audio frame according to the frequency domain signal, combine each audio frame into a feature vector, and form a feature vector sequence of the audio sample;
[0025] Support vector machine is used to classify the feature vector sequence and determine the calling tone category to which each frame belongs;
[0026] The call tone category sequence is modeled through a hidden Markov model to obtain a hidden state sequence that reflects the emotional state of the entire audio sample;
[0027] The overall emotion expressed by the audio sample is determined according to the hidden state sequence, and the emotion recognition result reflecting the audio sample is obtained.
[0028] Preferably, the key emotion distribution in the acoustic features is obtained based on the long short-term memory network model to obtain the emotional state probability distribution data; the long short-term memory network model is constructed by combining the feature vector with the attention mechanism, and specifically includes the following steps:
[0029] According to the feature vector, a long short-term memory network model is constructed, and the input layer, hidden layer and output layer of the model are set;
[0030] Introducing the attention mechanism into the model, and using the attention weight matrix to enhance the model's ability to capture key emotional features;
[0031] Train the long short-term memory network model and use the training data set to optimize the model parameters to improve the model's emotion recognition accuracy;
[0032] In the output layer of the model, the Softmax function is used to convert the output of the model into the probability distribution of emotional state;
[0033] According to the probability distribution, the emotional state corresponding to the audio sample is determined, and the emotion with the highest probability is selected as the recognition result.
[0034] Preferably, the pet's breed and age information, emotional state probability distribution data, and environmental data are combined to obtain the pet's predicted intention, and a personalized statement corresponding to the predicted intention is generated, which specifically includes the following steps:
[0035] Construct an intention prediction model, combining the pet's breed and age information, emotional state probability distribution data, and environmental data to obtain the pet's predicted intention;
[0036] According to the predicted intention of the pet, a corresponding set of sentences is selected from a pre-constructed sentence library to generate personalized sentences corresponding to the predicted intention.
[0037] Preferably, constructing an intention prediction model, combining the pet's breed and age information, emotional state probability distribution data, and environmental data to obtain the pet's predicted intention, specifically includes the following steps:
[0038] Taking the probability distribution of emotional states and environmental sensor data as input, feature extraction and information fusion are performed through the gated recurrent unit model;
[0039] In the gated recurrent unit model, the model parameters and weights are dynamically adjusted according to the characteristics of the input data to achieve adaptive mapping of the pet's intentions and needs;
[0040] Through model training and optimization, the accuracy of pet intention and demand judgment is continuously improved, and the specific needs of the pet are determined based on the output results.
[0041] In a second aspect, the present invention discloses a pet voice translation system, which includes any one of the pet voice translation methods described above.
[0042] In a third aspect, the present invention discloses an electronic device, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0043] Memory, used to store computer programs;
[0044] The processor is used to implement the steps of the pet voice translation method when executing the program stored in the memory.
[0045] In a fourth aspect, the present invention discloses a storage medium having a computer program stored thereon, wherein the computer program implements the steps of the pet voice translation method as described above when executed by a processor.
[0046] The above technical solution provided by this application has the following advantages compared with the prior art:
[0047] The pet voice translation method, system, electronic device and storage medium provided in this application, with respect to the method, by collecting high-quality pet call audio samples, extracting acoustic features and constructing a deep learning model, accurate recognition of the emotional state of the pet is achieved. Combined with information such as pet breed and age, the intentions and needs of the pet can be inferred, and appropriate soothing sentences can be selected from the sentence library. Through deep neural network technology, a synthetic voice similar to the tone and emotion of the pet's call is generated to achieve personalized voice interaction. Voice interaction between people and pets is achieved. By converting the pet's call into voice, the owner can promptly and accurately know the current needs of the pet, thereby meeting the current needs of the pet more quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0050] Figure 1 A process diagram of a pet voice translation method provided in this application Figure 1 ;
[0051] Figure 2 A process diagram of a pet voice translation method provided in this application Figure 2 . DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0053] First, see Figure 1-2 The present invention discloses a pet voice translation method, which comprises the following steps:
[0054] Step S1: Acquire pet audio data; the pet audio data is obtained through a distributed sound pickup device, and the distributed sound pickup device includes a plurality of pickups distributed on a pet wearable device;
[0055] Step S2: Acquire environmental data, wherein the environmental data is obtained through a distributed environmental parameter sensor, wherein the distributed environmental parameter sensor includes a plurality of identical or different sensors, and the plurality of sensors are distributed on the pet wearable device and / or other environmental detectors;
[0056] Step S3: extracting acoustic features of the pet audio data, and obtaining a feature vector according to the acoustic features, wherein the feature vector includes an audio frame of the audio data and its corresponding acoustic features;
[0057] Step S4: obtaining the key emotion distribution in the feature vector based on the long short-term memory network model to obtain the emotional state probability distribution data;
[0058] Step S5: combining the pet's breed and age information, emotional state probability distribution data, and environmental data to obtain the pet's predicted intention and generate a personalized statement corresponding to the predicted intention.
[0059] Step S6: Perform speech synthesis on the personalized sentence to generate a synthesized speech that is similar to the tone and emotion of a pet's barking, and play the synthesized speech through a speaker.
[0060] Specifically, in step S1, pet audio data is obtained, and pet audio data and environmental sounds are obtained through a distributed sound pickup device, wherein the distributed sound pickup device can be set on the pet's neck collar, harness and other devices, and the distributed sound pickup device is composed of multiple pickups. Since the distributed sound pickup device not only picks up the pet audio data, but also picks up the surrounding environmental noise and other audio, noise reduction and other pre-processing are required before the pet audio data is obtained.
[0061] Specifically, in step S2, the environmental data includes information such as temperature, humidity and light. The distributed environmental parameter sensors can be set in the environment where the pet is located and on the items used by the pet, such as at home, in food bowls, cat litter boxes, etc. In addition, signals can be transmitted and information can be exchanged between the distributed sound pickup device and the distributed environmental parameter sensors.
[0062] Specifically, in step S3, the acoustic features include fundamental frequency, spectral energy distribution, Mel-frequency cepstral coefficients and harmonic noise ratio. A feature vector is generated based on the acoustic features, wherein the feature vector includes audio data and its corresponding acoustic features. The feature vector is used to reflect the tone and emotional state of the pet's call in the audio sample for subsequent processing.
[0063] Specifically, in step S4, a long short-term memory network model is constructed based on the feature vector, the capture of key emotions in the feature vector is strengthened through the attention mechanism, and the probability distribution of the emotional state corresponding to the audio sample is output to facilitate the occurrence frequency of key emotional features.
[0064] Specifically, in step S5, the acquired emotional state probability distribution data and environmental data are combined with the pet's breed and age information, and the pet's predicted intention is judged through a constructed intention prediction model, and a corresponding personalized sentence is generated corresponding to the pet's predicted intention.
[0065] Specifically, in step S6, the personalized soothing sentence is input into the speech synthesis module, and the deep neural network technology is used to generate a synthesized speech with similar voice tone and emotion to the pet's call, and the synthesized speech is played through a speaker to interact with the pet. During the interaction process, the pet's response behavior data is obtained, and the reinforcement learning algorithm is used to optimize the sentence selection strategy and speech synthesis parameters.
[0066] It can be understood that by collecting high-quality audio samples of pet calls, extracting acoustic features and building a deep learning model, the emotional state of the pet can be accurately identified. Combined with information such as pet breed and age, the intention and needs of the pet can be inferred, and appropriate soothing sentences can be selected from the sentence library. Through deep neural network technology, synthetic voices similar to the tone and emotion of the pet's call are generated to achieve personalized voice interaction. Voice interaction between people and pets is achieved. By converting the pet's call into voice, the owner can know the current needs of the pet in a timely and accurate manner, thereby meeting the current needs of the pet more quickly.
[0067] The obtaining of pet audio data comprises the following steps:
[0068] Step S11: obtaining an audio sample of a pet's call and corresponding behavior description and environmental factor data, and storing the audio sample and related data in a structured data format;
[0069] Step S12: converting the audio sample into a standard digital audio format to obtain pet audio data, establishing a storage database, storing the pet audio data in the database, and establishing an association between the digital audio format and the structured data format;
[0070] Step S13: preprocess the pet audio data to remove background noise, and obtain preprocessed pet audio data.
[0071] By establishing a database, the acquired pet audio data can be stored. After the pet audio data is stored, the structured data format and the corresponding data audio format are associated to facilitate subsequent search and find. In addition, the pet audio data is affected by background noise, which can easily affect subsequent processing and cause deviations in the translation results. Preprocessing can make subsequent processing more accurate.
[0072] Step S11 specifically includes the following steps:
[0073] Step S111: for each acquired audio sample, extract the key speech segment in the audio sample using speech recognition technology, and determine the pet behavior description corresponding to the audio sample according to the key speech segment;
[0074] Step S112: Acquire environmental factor data during recording of each audio sample, including the model of the recording device, the environmental noise level during recording, the recording distance, etc.;
[0075] Step S113: Associating each audio sample with its corresponding behavior description and environmental factor data to generate structured data;
[0076] Step S114: extracting features from the audio samples using a feature extraction algorithm to obtain a feature vector for each audio sample;
[0077] Step S115: storing the feature vector and structured data together in a preset database, where each piece of data includes the feature vector, behavior description, and environmental factors of the audio sample;
[0078] Step S116: Based on the data in the database, a pet emotional state recognition model is trained, with the input being the feature vector of the audio sample and the output being the corresponding pet emotional state. If the emotional state output by the model matches the behavioral description corresponding to the audio sample, the model training is judged to be complete.
[0079] It can be understood that for each audio sample obtained, the key speech segments in the audio sample are extracted, such as "woof woof", "woof woof", etc., and the pet behavior description corresponding to the audio sample is determined according to the frequency and order of the keywords, such as "excitedly calling", "fearfully sobbing", etc. At the same time, the environmental factor data of each audio sample during recording is obtained, including the model of the sound pickup device, the decibel of the ambient noise during sound pickup, the number of centimeters of the sound pickup distance from the pet, etc., and each audio sample is associated with its corresponding behavior description and environmental factor data to generate structured JSON format data. Then, the MFCC feature extraction algorithm is used to extract features from the audio sample to obtain a 40-dimensional MFCC feature vector for each audio sample, and the feature vector and structured JSON data are stored together in the MySQL database, and each piece of data includes the MFCC feature vector, behavior description and environmental factors of the audio sample.
[0080] In addition, based on the data in the MySQL database, the support vector machine (SVM) algorithm is used to train the pet emotional state recognition model, with the MFCC feature vector of the audio sample as input and the corresponding pet emotional state as output. The model is trained and tested using the cross-validation method. If the model's emotional state judgment accuracy on the test set exceeds 85% and is consistent with the behavior description corresponding to the audio sample, the pet emotional state recognition model training is considered complete. This allows the model to directly and accurately obtain the pet's call audio to directly judge the current pet's emotional state.
[0081] Step S12 specifically includes the following steps:
[0082] Step S121: determining whether the audio sample format is a standard digital audio format, if not, performing format conversion processing to convert it into standard digital audio format data;
[0083] Step S122: storing the converted standard digital audio format data into a designated database;
[0084] Step S123: Obtain structured data corresponding to the audio sample and extract key field information therein;
[0085] Step S124: judging the correlation between the digital audio format data and the structured data according to the preset correlation rules, and performing correlation mapping between the two;
[0086] Step S125: using a hash algorithm to perform a hash operation on the digital audio format data to obtain a unique hash value;
[0087] Step S126: combining the hash value of the digital audio format data with the key field of the structured data, and generating an association identifier through a connection operation;
[0088] Step S127: storing the association identifier in the database, and establishing an association index between the digital audio format data and the structured data to facilitate subsequent rapid retrieval and access.
[0089] It can be understood that after obtaining the audio sample data, the system will automatically determine whether its format is a standard digital audio format, such as WAV, MP3, etc. If it is not a standard format, the audio processing library such as FFmpeg is used for format conversion, for example, the WMA format is converted to the WAV format. During the conversion process, the sampling rate is set to 41kHz, the bit depth is 16 bits, and the number of channels is 2 to ensure the quality of the converted audio. After the conversion is completed, the digital audio data in the standard format is stored in the AudioData collection of the MongoDB database. At the same time, the system extracts the structured metadata of the audio sample from the MetaInfo table of the associated MySQL database, such as key fields such as audio title, artist, and album. According to the preset association rules, if the audio title contains the artist's name and the duration difference does not exceed 5 seconds, it is determined that the two can be associated. For data that can be associated, the system uses the SHA-256 algorithm to perform a hash operation on the audio data to obtain a hash value with a length of 64 bytes. The hash value is then spliced with the audio ID of the structured data to generate an association identifier in the form of "hash_id". Finally, the association identifier is used as the index field of the AudioData collection of MongoDB, and is associated with the audio ID field of the MetaInfo table of MySQL to form a cross-database association index, enabling fast retrieval and access of audio data and structured metadata. Through this series of processes, the audio data undergoes format conversion, hash calculation, cross-database association, and other processing, and finally forms an efficient association index with the structured data, providing support for subsequent data analysis and applications.
[0090] Step S13 specifically includes the following steps:
[0091] Step S131: using spectral subtraction to process the pet call audio sample, by estimating the background noise spectrum, subtracting the estimated background noise spectrum from the original audio spectrum, to obtain a de-noised audio sample;
[0092] Step S132: performing wavelet transform on the denoised audio samples to convert the audio signals from the time domain to the wavelet domain;
[0093] Step S133: In the wavelet domain, according to a preset key frequency range, the wavelet coefficients within the range are enhanced, while the coefficients within the non-key frequency range are suppressed;
[0094] Step S134: by inverse wavelet transform, the enhanced wavelet coefficients are converted from the wavelet domain back to the time domain to obtain the preprocessed audio samples.
[0095] Specifically, after step S34, it is determined whether the enhanced audio sample meets the preset sound quality requirements. If so, it is output as the final audio sample after preprocessing; if not, it returns to step S32, adjusts the parameters of spectral subtraction and wavelet transform, and reprocesses the audio sample. The preprocessed audio sample is used as the input of subsequent audio processing and analysis, such as speech recognition, speaker recognition, etc., to improve the performance and accuracy of these tasks.
[0096] It is understandable that the pet's call audio sample needs to be subjected to noise reduction processing to remove background noise in order to better obtain the real pet's call audio sample and avoid the subsequent processing being affected by the background noise.
[0097] Step S3 specifically includes the following steps:
[0098] Step S31: performing frame processing on the pre-processed audio samples to obtain an audio frame sequence;
[0099] Step S32: for each audio frame in the audio frame sequence, convert it into the frequency domain by fast Fourier transform to obtain a frequency domain signal;
[0100] Step S33: Calculate the acoustic features of each audio frame according to the frequency domain signal, combine each audio frame and its corresponding acoustic features into a feature vector, and form a feature vector sequence of the audio sample;
[0101] Step S34: using a support vector machine to classify the feature vector sequence, and determining the calling tone category to which each frame feature vector belongs;
[0102] Step S35: Modeling the calling tone category sequence through a hidden Markov model to obtain a hidden state sequence reflecting the emotional state of the entire audio sample;
[0103] Step S36: Determine the overall emotion expressed by the audio sample according to the hidden state sequence, and obtain an emotion recognition result reflecting the audio sample.
[0104] It is understandable that the corresponding pet's call tone and emotional state need to be obtained from the audio sample, and it needs to be processed frame by frame. By extracting acoustic features and building a deep learning model, accurate recognition of the pet's emotional state can be achieved, and feature vectors can be constructed to judge the emotional state of the pet's call more quickly.
[0105] As an embodiment, when the pre-processed audio sample is framed, each frame can be windowed using a Hamming window function to reduce the impact of spectrum leakage. For each audio frame, when it is converted to the frequency domain by fast Fourier transform, a 512-point FFT can be selected, and the frequency resolution is 325Hz. When calculating acoustic features according to frequency domain signals, the fundamental frequency can be obtained by the autocorrelation function method, the spectrum energy distribution can be obtained by segmented accumulation of the amplitude spectrum of the frequency domain signal, the Mel frequency cepstrum coefficient can be obtained by filtering the spectrum by a Mel filter bank, taking the logarithm, and DCT transformation, and the harmonic noise ratio can be obtained by fundamental frequency detection and harmonic peak extraction. The 12-dimensional MFCC, 1-dimensional fundamental frequency, 24-dimensional spectrum energy distribution, and 1-dimensional harmonic noise ratio of each frame are combined into a 38-dimensional feature vector. When the feature vector sequence is classified using a support vector machine, the RBF kernel function can be selected, and the penalty factor C and kernel function parameter g of the SVM are optimized by grid search, and a 10-fold cross validation is performed on the training set to obtain the optimal classification model. When modeling the call tone category sequence through the hidden Markov model, the Baum-Welch algorithm can be used to estimate the state transition probability matrix and observation probability matrix of the HMM, the probability of the state sequence can be calculated through the forward-backward algorithm, and the Viterbi algorithm can be used for decoding to obtain the optimal hidden state sequence. When determining the overall emotion expressed by the audio sample based on the hidden state sequence, the frequency of each emotion in the hidden state sequence can be calculated, and the emotion with the highest frequency is the recognition result.
[0106] Step S4 specifically includes the following steps:
[0107] Step S41: constructing a long short-term memory network model according to the feature vector, and setting the input layer, hidden layer and output layer of the model;
[0108] Step S42: introducing an attention mechanism into the model, and enhancing the model's ability to capture key emotional features through an attention weight matrix;
[0109] Step S43: training the long short-term memory network model, optimizing the parameters of the model using the training data set, and improving the emotion recognition accuracy of the model;
[0110] Step S44: In the output layer of the model, a Softmax function is used to convert the output of the model into a probability distribution of the emotional state;
[0111] Step S45: Determine the emotional state corresponding to the audio sample according to the probability distribution, and select the emotion with the highest probability as the recognition result.
[0112] As an embodiment, when constructing a long short-term memory network model, the number of neurons in the input layer is consistent with the dimension of the MFCC feature vector, the hidden layer can be set to 3 layers, the number of neurons in each layer can be set to 128, and the number of neurons in the output layer is consistent with the number of categories of emotional states. When introducing the attention mechanism in the model, additive attention can be used. By calculating the similarity between the hidden state at the current moment and the hidden state at all moments, an attention weight matrix is generated, and the hidden state is weighted and summed to obtain an attention vector. When training the model, the Adam optimizer can be used, the learning rate is set to 0.01, the batch size is set to 32, and 100 epochs are trained. The cross entropy loss function is used to evaluate the training effect of the model, and the model parameters are updated by the back propagation algorithm. In the output layer of the model, the Softmax function is used to convert the output of the model into a probability distribution of emotional states, and the emotion with the highest probability is selected as the recognition result. When evaluating the emotion recognition results of the model, the holdout method can be used to divide the data set into a training set and a test set, and the ratio can be set to 8:2. Indicators such as the accuracy, precision, recall rate, and F1 value of the model are calculated on the test set to comprehensively evaluate the performance of the model. For example, after training and tuning, the model's accuracy on the test set reached 85%, indicating that the model can better recognize speech in different emotional states.
[0113] Step S5 specifically includes the following steps:
[0114] Step S51: construct an intention prediction model, combining the pet's breed and age information, emotional state probability distribution data, and environmental data to obtain the pet's predicted intention;
[0115] Step S52: According to the predicted intention of the pet, a corresponding set of sentences is selected from a pre-constructed sentence library to generate a personalized sentence corresponding to the predicted intention.
[0116] It can be understood that the breed and age information of the pet in the audio is obtained, combined with the emotional state probability distribution data and environmental data obtained above, and the pet's current needs and intentions are judged through the intention prediction model. The corresponding sentence set is selected from the judged pet's predicted intention, and the sentences are combined according to the semantics to generate the corresponding personalized sentences.
[0117] Step S51 specifically includes the following steps:
[0118] Step S511: taking the probability distribution of emotional states and environmental sensor data as input, and performing feature extraction and information fusion through a gated recurrent unit model;
[0119] Step S512: In the gated recurrent unit model, the parameters and weights of the model are dynamically adjusted according to the characteristics of the input data to achieve adaptive mapping of the pet's intentions and needs;
[0120] Step S513: Through model training and optimization, the accuracy of judging the pet's intentions and needs is continuously improved, and the pet's specific needs are determined based on the output results.
[0121] In some embodiments, the breed and age of the pet can be directly input, which can save the step of determining the breed and age of the pet and increase the accuracy of the determination. For example, for the same pet, the intention and needs of the pet can be directly reflected by combining the previous determination results.
[0122] In some embodiments, the probability distribution of emotional states and environmental sensor data are input into a gated recurrent unit model, which contains 256 hidden layer units and implements nonlinear transformation of features and information fusion through a sigmoid activation function. The model adaptively adjusts recommended strategies for diet, exercise, and rest based on the pet's breed, age, and emotional state. For example, for young golden retrievers, in hot summer, the model recommends increasing water intake and reducing outdoor activity time to avoid the risk of heat stroke and dehydration. Through continuous data collection and iterative model optimization, the accuracy of pet intention and demand judgment continues to improve, reaching more than 90%, providing pets with more intelligent and humane care services.
[0123] Step S52 specifically includes the following steps:
[0124] Step S521: Obtain the intention and demand information of the pet, and use it as the basis for selecting a sentence;
[0125] Step S522: Selecting a number of candidate sentences from the pre-built sentence library according to the pet's intention and needs;
[0126] Step S523: Obtain the breed and age information of the pet, and use it as a reference factor for adjusting the tone and speed of the sentence;
[0127] Step S524: For the candidate sentences, according to the characteristics of the pet breed and age, natural language processing technology is used to appropriately adjust the tone and speed of the sentence;
[0128] Step S525: using a sentiment analysis algorithm to determine the sentiment tendency of the adjusted sentences, and filter out sentences with positive sentiment tendencies;
[0129] Step S526: Using a text similarity algorithm, calculate the similarity between the screened sentences and the pet's intentions and needs, and obtain the sentence with the highest similarity as a candidate.
[0130] Step S527: The sentence with the highest similarity is used as the final personalized soothing sentence, which is output and applied to the pet soothing scenario.
[0131] It can be understood that the corresponding sentences are output according to the intentions and needs of the pet, and the tone and speed of the output sentences are adjusted in combination with the obtained pet breed and age information to achieve personalization. In the interaction with the pet, the owner can better understand the pet's intentions and needs from the sentences. At the same time, the output sentences are more interesting and more in line with the image of the pet. In addition, accurately outputting the intentions and needs of the pet requires a large number of sentences and training to make the judgment more accurate in actual use.
[0132] As an embodiment, first, obtain the intention and demand information of the pet, such as "the puppy is hungry" and "it's time to eat". Then, from the pre-built corpus containing 1,000 sentences, use the keyword matching algorithm to select 50 candidate sentences related to the intention and demand of the pet. Next, according to the breed and age information of the pet, such as "Corgi, 2 years old", a rule-based method is used to adjust the tone and speed of the candidate sentences, such as for puppies, the tone is gentler and the speed is slower. After that, the sentiment analysis algorithm based on the sentiment dictionary is used to calculate the sentiment value of each sentence, and positive sentences with sentiment values greater than 8 are screened out. Subsequently, the Word2Vec word embedding model is used to convert the screened sentences and the pet's intentions and needs into vectors, and the similarity between the sentences and the pet's needs is calculated by cosine similarity to obtain the 5 sentences with the highest similarity. Finally, the sentence with the highest similarity is used as the final personalized soothing sentence, and it is output in the male voice that the Corgi likes the most through speech synthesis technology, and combined with the cartoon image displayed on the screen to soothe the pet's emotions.
[0133] Step S6 specifically includes the following steps:
[0134] Step S61: using a deep neural network, converting the personalized sentence into a synthesized voice with a tone and emotion similar to the pet's bark;
[0135] Step S62: Playing the synthesized voice through the speaker, interacting with the pet by voice, and obtaining the pet's response behavior data to different voices;
[0136] Step S63: extracting features and quantifying scores on the pet response data to obtain pet soothing effect scores for different combinations of sentences and voice parameters;
[0137] Step S64: using sentence selection and speech synthesis parameters as the action space of reinforcement learning, and using the pet soothing effect score as the reward function;
[0138] Step S65: using a deep reinforcement learning algorithm to obtain the optimal sentence selection strategy and speech synthesis parameter combination for personalized pet soothing by continuously trying and optimizing the action strategy;
[0139] Step S66: Apply the optimized sentence selection strategy and speech synthesis parameters to the pet soothing system to improve the effect and personalization of pet soothing.
[0140] It can be understood that by using reinforcement learning algorithms, the interaction strategy is continuously optimized according to the pet's response behavior to make the interaction process smoother. By converting the pet's calls into speech and continuously optimizing the output speech method, the interaction is made more normal and smooth.
[0141] As an embodiment, first, a personalized sentence is selected from a preset soothing sentence library. The sentence library contains about 1,000 sentences, covering pets of different breeds and personalities. The system uses a decision tree algorithm to select the 50 most matching sentences from the sentence library based on the pet's breed, age, gender and other characteristics. Then, a speech synthesis model based on a long short-term memory network (LSTM) is used to convert the selected sentence into a synthetic speech with a similar timbre and emotion to the pet's call. The model is trained on a pet call corpus, which contains 5,000 call samples of 100 kinds of pets. By extracting and modeling the acoustic features of the pet's call, such as the Mel Frequency Cepstral Coefficient (MFCC) and fundamental frequency, the synthesized speech achieves a 90% similarity with the pet's call in timbre and emotion. Then, the synthesized speech is played through a speaker to interact with the pet for 5 minutes, while the camera and microphone are used to record the pet's video and audio response data. The response data was processed to extract 10 behavioral features such as facial expressions, tail wagging, and call frequency, and each feature was quantitatively scored using a support vector machine (SVM) model to obtain a comprehensive score of the pet's soothing effect on the voice, which was used as a reward value for reinforcement learning. Finally, the sentence selection and speech synthesis parameters were used as the action space of the agent, and the deep Q network (DQN) algorithm was used for reinforcement learning. After 1,000 rounds of training, the optimal sentence selection strategy and speech synthesis parameter combination for personalized pet soothing were obtained, which were applied to the pet soothing system, improving the average soothing effect of the pet by 30% and the personalized matching degree by 50%.
[0142] In a second aspect, the present invention discloses a pet voice translation system, which includes any one of the pet voice translation methods described above.
[0143] It can be understood that the pet voice translation system can convert pet calls into sentences that humans can understand, enabling interaction between owners and pets, and facilitating owners to accurately understand the emotional state and needs of their pets. By collecting high-quality audio samples of pet calls, extracting acoustic features and building a deep learning model, accurate recognition of the emotional state of pets can be achieved. Combined with information such as pet breed and age, the intentions and needs of the pet can be inferred, and appropriate soothing sentences can be selected from the sentence library. Through deep neural network technology, synthetic voices similar to the tone and emotion of pet calls are generated to achieve personalized voice interaction. Voice interaction between people and pets is achieved. By converting the calls of pets into voice, owners can promptly and accurately understand the current needs of their pets, thereby meeting the current needs of their pets more quickly.
[0144] In a third aspect, the present invention discloses an electronic device, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0145] Memory, used to store computer programs;
[0146] The processor is used to implement the steps of the pet voice translation method when executing the program stored in the memory.
[0147] It can be understood that electronic devices can realize voice interaction between people and pets. By converting the pet's calls into voice, the owner can timely and accurately know the current needs of the pet, so as to meet the current needs of the pet more quickly. Electronic devices can be directly hung on the pet, such as made into collars, straps, etc. Electronic devices can also transmit signals with the owner's portable electronic devices, and the pet's needs can be sent through wireless signal transmission, so that the owner can remotely obtain the pet's needs and emotional state.
[0148] In a fourth aspect, the present invention discloses a storage medium having a computer program stored thereon, wherein the computer program implements the steps of the pet voice translation method as described above when executed by a processor.
[0149] It can be understood that the storage medium stores a program that can implement a pet voice translation method and realize voice interaction between people and pets. By converting the pet's calls into voice, the owner can know the pet's current needs in a timely and accurate manner, thereby meeting the pet's current needs more quickly.
[0150] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0151] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0152] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0153] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be connected, detachably connected, or integrated; it can be mechanically connected or electrically connected; it can be directly connected or indirectly connected through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0154] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0155] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.
[0156] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0157] The above is a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements 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 pet voice translation method, characterized in that: The following steps are involved: Acquire pet audio data; the pet audio data is obtained through a distributed sound pickup device, the distributed sound pickup device includes a plurality of pickups distributed on a pet wearable device; Acquire environmental data, where the environmental data is obtained through a distributed environmental parameter sensor, where the distributed environmental parameter sensor includes a plurality of identical or different sensors, and the plurality of sensors are distributed on the pet wearable device and / or other environmental detectors; Extracting acoustic features of pet audio data, and obtaining a feature vector according to the acoustic features, wherein the feature vector includes an audio frame of the audio data and its corresponding acoustic features; Based on the long short-term memory network model, the key emotion distribution in the feature vector is obtained to obtain the probability distribution data of the emotion state; The pet's breed and age information, emotional state probability distribution data, and environmental data are combined to obtain the pet's predicted intention and generate a personalized statement corresponding to the predicted intention.
2. The pet voice translation method according to claim 1, characterized in that: The obtaining of pet audio data comprises the following steps: Obtaining audio samples of pet calls and corresponding behavior descriptions and environmental factor data, and storing the audio samples and related data in a structured data format; Converting the audio sample into a standard digital audio format to obtain pet audio data, establishing a storage database, storing the pet audio data in the database, and establishing an association between the digital audio format and the structured data format; The pet audio data is preprocessed to remove background noise, thereby obtaining preprocessed pet audio data.
3. The pet voice translation method according to claim 2, characterized in that: The preprocessing of the pet audio data to remove background noise to obtain the preprocessed pet audio data specifically includes the following steps: The pet audio data is processed by using spectral subtraction, by estimating the background noise spectrum and subtracting the estimated background noise spectrum from the original audio spectrum to obtain the denoised audio sample; Perform wavelet transform on the denoised audio samples to convert the audio signal from the time domain to the wavelet domain; In the wavelet domain, according to the preset critical frequency range, the wavelet coefficients within the range are enhanced, while the coefficients within the non-critical frequency range are suppressed; Through inverse wavelet transform, the enhanced wavelet coefficients are converted from the wavelet domain back to the time domain to obtain the preprocessed pet audio data.
4. The pet voice translation method according to claim 1, characterized in that: The step of extracting acoustic features of pet audio data, wherein the acoustic features are based on voice tone and emotional state association cluster data to obtain feature vectors, specifically comprises the following steps: Performing frame processing on the preprocessed audio samples to obtain an audio frame sequence; For each audio frame in the audio frame sequence, convert it into the frequency domain by fast Fourier transform to obtain a frequency domain signal; Calculate the acoustic features of each audio frame according to the frequency domain signal, combine each audio frame into a feature vector, and form a feature vector sequence of the audio sample; Support vector machine is used to classify the feature vector sequence and determine the calling tone category to which each frame belongs; The call tone category sequence is modeled through a hidden Markov model to obtain a hidden state sequence that reflects the emotional state of the entire audio sample; The overall emotion expressed by the audio sample is determined according to the hidden state sequence, and the emotion recognition result reflecting the audio sample is obtained.
5. The pet voice translation method according to claim 1, characterized in that: The key emotion distribution in the acoustic features is obtained based on the long short-term memory network model to obtain the emotional state probability distribution data; the long short-term memory network model is constructed by combining the feature vector with the attention mechanism, and specifically includes the following steps: According to the feature vector, a long short-term memory network model is constructed, and the input layer, hidden layer and output layer of the model are set; Introducing the attention mechanism into the model, and using the attention weight matrix to enhance the model's ability to capture key emotional features; Train the long short-term memory network model and use the training data set to optimize the model parameters to improve the model's emotion recognition accuracy; In the output layer of the model, the Softmax function is used to convert the output of the model into the probability distribution of emotional state; According to the probability distribution, the emotional state corresponding to the audio sample is determined, and the emotion with the highest probability is selected as the recognition result.
6. The pet voice translation method according to claim 1, characterized in that: Combining the pet's breed and age information, emotional state probability distribution data, and environmental data, the pet's predicted intention is obtained, and a personalized statement corresponding to the predicted intention is generated, which specifically includes the following steps: Construct an intention prediction model, combining the pet's breed and age information, emotional state probability distribution data, and environmental data to obtain the pet's predicted intention; According to the predicted intention of the pet, a corresponding set of sentences is selected from a pre-constructed sentence library to generate personalized sentences corresponding to the predicted intention.
7. The pet voice translation method according to claim 1, characterized in that: Construct an intention prediction model, combine the pet's breed and age information, emotional state probability distribution data, and environmental data to obtain the pet's predicted intention, which specifically includes the following steps: Taking the probability distribution of emotional states and environmental sensor data as input, feature extraction and information fusion are performed through the gated recurrent unit model; In the gated recurrent unit model, the model parameters and weights are dynamically adjusted according to the characteristics of the input data to achieve adaptive mapping of the pet's intentions and needs; Through model training and optimization, the accuracy of pet intention and demand judgment is continuously improved, and the specific needs of the pet are determined based on the output results.
8. A pet voice translation system, characterized in that: The pet voice translation method includes any one of claims 1 to 7.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the pet voice translation method described in any one of claims 1 to 7 when executing the program stored in the memory.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the pet speech translation method as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Emotion catharsis training method and system based on beating and shouting
CN120319404A
Intelligent pet state translation method and system based on multi-modal data
CN120612649A
Man-pet talkback method and system based on multi-modal interaction
CN120636418A
A method and system for human-pet intercom based on multimodal interaction
CN120636418B
Pet language translation method and system based on audio learning
CN120780863A