CN111461337B - Data processing method, device, terminal equipment and storage medium - Google Patents

Data processing method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN111461337B
CN111461337B CN202010148112.7A CN202010148112A CN111461337B CN 111461337 B CN111461337 B CN 111461337B CN 202010148112 A CN202010148112 A CN 202010148112A CN 111461337 B CN111461337 B CN 111461337B
Authority
CN
China
Prior art keywords
data
intention information
neural network
animal
network model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010148112.7A
Other languages
Chinese (zh)
Other versions
CN111461337A (en
Inventor
石真
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhuiyi Technology Co Ltd
Original Assignee
Shenzhen Zhuiyi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhuiyi Technology Co Ltd filed Critical Shenzhen Zhuiyi Technology Co Ltd
Priority to CN202010148112.7A priority Critical patent/CN111461337B/en
Publication of CN111461337A publication Critical patent/CN111461337A/en
Application granted granted Critical
Publication of CN111461337B publication Critical patent/CN111461337B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A40/00Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
    • Y02A40/70Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in livestock or poultry

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Machine Translation (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application provides a data processing method, a data processing device, terminal equipment and a storage medium, and relates to the technical field of terminals. The method comprises the following steps: acquiring data to be identified associated with an animal; determining animal intention information corresponding to the data to be identified according to the data to be identified based on a trained target neural network model, wherein the target neural network model is obtained by training based on a training sample set marked with the intention information; and executing a preset operation according to the animal intention information. According to the embodiment of the application, the animal intention can be identified based on the target neural network model obtained by training the training sample marked with the intention information, and the preset operation is executed according to the identified animal intention, so that the animal intention identification is realized, the understanding of the user on the animal is facilitated, the targeted interaction is realized, and the better interaction between the user and the animal is realized.

Description

Data processing method, device, terminal equipment and storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a data processing method, apparatus, terminal device, and storage medium.
Background
With the abundance of material life, people are increasingly paying attention to animals than before, and it is increasingly desirable to provide better care to animals. While good care is required to meet the needs of animals when they are needed. However, it is often difficult to understand the intent of an animal, especially a new person who has just begun to attend to the animal, so that it is difficult to achieve good interaction with the animal.
Disclosure of Invention
The embodiment of the application provides a data processing method, a data processing device, terminal equipment and a storage medium, so as to solve the problems.
In a first aspect, an embodiment of the present application provides a data processing method, where the method includes: acquiring data to be identified associated with an animal; determining animal intention information corresponding to the data to be identified according to the data to be identified based on a trained target neural network model, wherein the target neural network model is obtained by training based on a training sample set marked with the intention information; and executing a preset operation according to the animal intention information.
Optionally, before the acquiring the data to be identified associated with the animal, the method further comprises: acquiring the training sample set, wherein the training sample set comprises a training sample and intention information corresponding to the training sample; and taking the training sample as input of an initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain the trained target neural network model.
Optionally, the number of the initial neural network models is a plurality, the training samples are used as input of the initial neural network models, intention information corresponding to the training samples is used as expected output of the initial neural network models, the initial neural network models are trained based on a machine learning algorithm, and the trained target neural network models are obtained, including: taking the training samples as input of each initial neural network model, taking intention information corresponding to the training samples as expected output of the initial neural network models, and training each initial neural network model based on a machine learning algorithm to obtain a plurality of trained initial neural network models; selecting at least one trained initial neural network model from a plurality of trained initial neural network models respectively to obtain candidate neural network models in a combined mode, wherein the number of the candidate neural network models is a plurality; testing each candidate neural network model based on a test sample set to obtain an output result corresponding to each candidate neural network model; and determining a target neural network model from the candidate neural network models based on the output result.
Optionally, the acquiring the training sample set includes: acquiring the training sample; classifying the training samples according to preset intention information to obtain classified data to be trained, wherein the data to be trained comprises the training samples and intention information corresponding to the training samples, and the preset intention information comprises at least one piece of intention information; and correspondingly storing the training sample and the intention information corresponding to the training sample to obtain the training sample set.
Optionally, the number of the preset intention information is a plurality of, the testing is performed on each candidate neural network model based on a test sample set to obtain an output result corresponding to each candidate neural network model, including: obtaining the score of each piece of preset intention information corresponding to the test sample set and output by the candidate neural network model; and obtaining an output result corresponding to the candidate neural network model according to the score of each piece of preset intention information.
Optionally, the acquiring the training sample includes: and obtaining the training sample corresponding to the preset intention information based on the preset intention information.
Optionally, the storing the training samples and the intention information corresponding to the training samples correspondingly, to obtain a training sample set includes: dividing the training sample to obtain a divided training sample; and correspondingly storing the segmented training samples and intention information corresponding to the segmented training samples to obtain a training sample set.
Optionally, the acquiring the training sample set further includes: obtaining the similarity between the training samples; determining data to be corrected from the training sample set according to the similarity, wherein the data to be corrected comprises training samples with similarity higher than a preset similarity threshold; and correcting the data to be corrected to update the training sample set.
Optionally, the data to be identified includes at least one of audio data, video data, and animal sign data.
Optionally, the determining, based on the trained target neural network model, the animal intention information corresponding to the data to be identified according to the data to be identified includes: acquiring intention characteristics of the animal based on the trained target neural network model according to the data to be identified, wherein the intention characteristics comprise at least one of voice characteristics, action characteristics and expression characteristics of the animal; and determining animal intention information corresponding to the data to be identified according to the intention characteristics.
Optionally, the performing a preset operation according to the animal intention information includes: generating voice prompt information according to the animal intention information, wherein the voice prompt information is used for prompting the animal intention information.
In a second aspect, an embodiment of the present application provides a data processing apparatus, including: the data acquisition module is used for acquiring data to be identified associated with the animal; the intention recognition module is used for determining animal intention information corresponding to the data to be recognized according to the data to be recognized based on a trained target neural network model, and the target neural network model is obtained by training based on a training sample set marked with the intention information; and the intention output module is used for executing preset operation according to the animal intention information.
Optionally, before the acquiring the data to be identified associated with the animal, the data processing apparatus further comprises: the system comprises a sample set acquisition module and a target model training module, wherein: the sample set acquisition module is used for acquiring the training sample set, wherein the training sample set comprises a training sample and intention information corresponding to the training sample; the target model training module is used for taking the training sample as input of an initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain the trained target neural network model.
Optionally, the number of the initial neural network models is a plurality, and the target model training module includes: an initial model training sub-module, a candidate model combining sub-module, a candidate model testing sub-module, and a target model determining sub-module, wherein: the initial model training sub-module is used for taking the training sample as the input of each initial neural network model, taking the intention information corresponding to the training sample as the expected output of the initial neural network model, and training each initial neural network model based on a machine learning algorithm to obtain a plurality of trained initial neural network models; the candidate model combination sub-module is used for respectively selecting at least one trained initial neural network model from a plurality of trained initial neural network models to be combined to obtain candidate neural network models, and the number of the candidate neural network models is a plurality of; the candidate model testing sub-module is used for testing each candidate neural network model based on a test sample set to obtain an output result corresponding to each candidate neural network model; and the target model determining submodule is used for determining a target neural network model from the candidate neural network models based on the output result.
Optionally, the sample set acquisition module includes: sample acquisition submodule, sample classification submodule and sample set acquisition submodule, wherein: the sample acquisition sub-module is used for acquiring the training samples; the sample classification sub-module is used for classifying the training samples according to preset intention information to obtain classified data to be trained, wherein the data to be trained comprises the training samples and intention information corresponding to the training samples, and the preset intention information comprises at least one intention information; and the sample set acquisition sub-module is used for correspondingly storing the training samples and the intention information corresponding to the training samples to obtain the training sample set.
Optionally, the number of the preset intention information is a plurality of, and the candidate model test submodule includes: a score acquisition unit and a score output unit, wherein: the score obtaining unit is used for obtaining the score of each piece of preset intention information corresponding to the test sample set and output by the candidate neural network model; and the score output unit is used for obtaining an output result corresponding to the candidate neural network model according to the score of each piece of preset intention information.
Optionally, the classified data to be trained includes no-classification data, the intention information corresponding to the no-classification data does not match the preset intention information, and the data processing apparatus 1100 further includes: a candidate intent determination module, a verification data acquisition module, a target intent determination module, and a target intent storage module, wherein: the candidate intention determining module is used for determining candidate intention information corresponding to the non-classified data; the verification data acquisition module is used for acquiring data to be verified based on the candidate intention information; the target intention determining module is used for determining target intention information from the candidate intention information according to the data to be verified; and the target intention storage module is used for taking the target intention information as intention information corresponding to the unclassified data and storing the unclassified data.
Optionally, the sample acquisition submodule includes: an active trigger acquisition unit, wherein: the active trigger acquisition unit is used for acquiring the training sample corresponding to the preset intention information based on the preset intention information.
Optionally, the sample set acquisition submodule includes: sample segmentation unit and sample storage unit, wherein: the sample segmentation unit is used for carrying out segmentation processing on the training samples and obtaining segmented training samples; and the sample storage unit is used for correspondingly storing the segmented training samples and the intention information corresponding to the segmented training samples to obtain a training sample set.
Optionally, the sample set acquisition module further comprises: the system comprises a similarity acquisition sub-module, a data to be corrected determination sub-module and a sample set updating sub-module, wherein: the similarity acquisition sub-module is used for acquiring the similarity between the training samples; the data to be corrected determining submodule is used for determining data to be corrected from the training sample set according to the similarity, wherein the data to be corrected comprises training samples with the similarity higher than a preset similarity threshold value; and the sample set updating sub-module is used for correcting the data to be corrected so as to update the training sample set.
Optionally, the data to be identified includes at least one of audio data, video data, and animal sign data.
Optionally, the intention recognition module includes: an intention feature acquisition sub-module and an animal intention determination sub-module, wherein: the intention characteristic acquisition sub-module is used for acquiring the intention characteristic of the animal based on the trained target neural network model according to the data to be identified, wherein the intention characteristic comprises at least one of the voice characteristic, the action characteristic and the expression characteristic of the animal; and the animal intention determining submodule is used for determining animal intention information corresponding to the data to be identified according to the intention characteristics.
Optionally, the intention output module includes: a voice prompt sub-module, wherein: the voice prompt sub-module is used for generating voice prompt information according to the animal intention information, and the voice prompt information is used for prompting the animal intention information.
In a third aspect, an embodiment of the present application provides a terminal device, including a memory and a processor, the memory being coupled to the processor, the memory storing instructions which, when executed by the processor, perform the method of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored therein program code which is callable by a processor to perform a method as described in the first aspect above.
The embodiment of the application provides a data processing method, a device, terminal equipment and a storage medium, which are used for acquiring data to be identified associated with animals, determining animal intention information corresponding to the data to be identified according to the data to be identified based on a trained target neural network model, wherein the target neural network model is obtained by training based on a training sample set marked with the intention information, and finally executing preset operation according to the animal intention information. Therefore, the target neural network model obtained through training the training sample marked with the intention information can identify the intention of the animal, and execute the preset operation according to the identified intention of the animal, so that the animal intention identification is realized, the understanding of the user on the animal is facilitated, the targeted interaction is realized, and the better interaction between the user and the animal is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates a schematic diagram of an application environment suitable for use with embodiments of the present application;
FIG. 2 is a flow chart of a data processing method according to an embodiment of the present application;
FIG. 3 is a flow chart of a model training method of a target neural network model according to an embodiment of the present application;
FIG. 4 is a flow chart of a model training method of a target neural network model according to another embodiment of the present application;
FIG. 5 shows a schematic flow chart of step S330 in FIG. 4 in an exemplary embodiment of the application;
FIG. 6 is a flow chart of a method for model training of a target neural network model according to yet another embodiment of the present application;
FIG. 7 is a flow chart of a model training method of a target neural network model according to still another embodiment of the present application;
FIG. 8 is a flow chart of a method for model training of a target neural network model according to yet another embodiment of the present application;
FIG. 9 shows a schematic flow chart of step S640 of FIG. 8 in an exemplary embodiment of the application;
FIG. 10 is a flow chart of a data processing method according to another embodiment of the present application;
FIG. 11 is a block diagram showing a data processing apparatus according to an embodiment of the present application;
fig. 12 shows a block diagram of a terminal device for performing a data processing method according to an embodiment of the present application.
Fig. 13 illustrates a storage unit for storing or carrying program code for implementing a data processing method according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Although the current industry discloses a system and a method for recognizing the emotion of animal voice, the emotion of the animal is mainly judged, and the intention of the animal cannot be judged.
Based on the above problems, the inventor proposes a data processing method, a device, a terminal device and a storage medium in the embodiments of the present application, by acquiring data to be identified associated with an animal, and then based on a trained target neural network model, determining animal intention information corresponding to the data to be identified according to the data to be identified, where the target neural network model is trained based on a training sample set labeled with intention information, and finally executing a predetermined operation according to the animal intention information. Therefore, animal intention recognition is realized, the understanding of the user on the animal is facilitated, targeted interaction is realized, and better interaction between the user and the animal is realized.
In order to better understand the data processing method, the device, the terminal equipment and the storage medium provided by the embodiment of the application, an application environment suitable for the embodiment of the application is described below.
Referring to fig. 1, fig. 1 shows a schematic view of an application environment suitable for an embodiment of the present application. The data processing method provided by the embodiment of the application can be applied to the interactive system 100 shown in fig. 1. The interactive system 100 comprises a terminal device 101 and a server 102, the server 102 being in communication connection with the terminal device 101. The server 102 may be a conventional server or a cloud server, which is not specifically limited herein.
The terminal device 101 may include, but is not limited to, a smart speaker, a smart phone, a tablet computer, a laptop portable computer, a desktop computer, a wearable electronic device, and the like. The terminal device 101 comprises a data processing module for receiving the speech signal, which may be a microphone or the like, for example. The terminal device 101 further comprises image acquisition means for acquiring images, which may be, for example, a camera or the like.
Wherein a client application may be installed on the terminal device 101, and a user may communicate with the server 102 based on the client application (e.g., APP, weChat applet, etc.). Specifically, the server 102 is provided with a corresponding server application program, a user may register a user account on the server 102 based on the client application program, and communicate with the server 102 based on the user account, for example, the user logs in the user account on the client application program, inputs text information or voice information through the client application program based on the user account, and after receiving the information input by the user, the client application program may send the information to the server 102, so that the server 102 may receive the information, process and store the information, and the server 102 may also receive the information and return a corresponding output information to the terminal device 101 according to the information.
In some embodiments, the means for processing the data to be identified may also be provided on the terminal device 101, so that the terminal device 101 may implement interaction with the user without relying on establishing communication with the server 102, where the interaction system 100 may only include the terminal device 101.
The above application environments are merely examples for facilitating understanding, and it is to be understood that embodiments of the present application are not limited to the above application environments.
The data processing method, the device, the terminal equipment and the storage medium provided by the embodiment of the application are described in detail through specific embodiments.
Referring to fig. 2, fig. 2 is a schematic flow chart of a data processing method according to an embodiment of the present application, which is applicable to the terminal device, and the flow chart shown in fig. 2 will be described in detail. The data processing method specifically may include the following steps:
step S110: data to be identified associated with the animal is obtained.
Data to be identified associated with the animal is obtained, wherein the data to be identified comprises data information associated with the animal, such as sounds made by the animal, such as sounds, images, videos, etc., of the animal, heart rate of the animal, etc., and the data to be identified can be used for identifying the intention of the animal.
In some embodiments, the terminal device may obtain an identification instruction for instructing the terminal device to obtain data associated with the animal to be identified. The identification instruction may be sent by other terminal devices or may be input based on the terminal devices, and the input main body may be a user or an animal, and the input form may be text, voice, keys, touch, etc., which is not limited in this embodiment.
In other embodiments, the terminal device may also monitor the environment in which the terminal device is located, so as to trigger to execute acquiring the data to be identified associated with the animal when the environment information meeting the preset condition is monitored. For example, the sound of the environment in which the terminal device is located, etc. may be monitored. In one example, the acquisition of data associated with an animal to be identified may be triggered when an animal sound with a sound intensity exceeding a preset intensity is monitored.
In further embodiments, the terminal device may further perform the method for a preset operation period based on the preset operation period, and may not perform the method for a non-preset operation period. The preset working time period can be preset by a system, can be customized by a user, and can be determined according to actual needs. The setting manner of the preset operation time period is not limited in this embodiment.
In some embodiments, the data to be identified may include at least one of audio data, video data, animal sign data.
The audio data associated with the animal may be audio data including sounds made by the animal, and may be acquired by an audio acquisition device such as a microphone or the like. In one example, the audio collection device may be worn in the head region of the animal. In other examples, the audio acquisition device may be worn in other areas of the animal, or may be installed in an active space of the animal instead of being on the animal, which is not limited in this embodiment.
The video data associated with the animal may be video data including an image of the animal, where the video data may be pure video data or audio-video data according to whether audio exists, and the video data may be obtained by video capturing device such as a camera. In one example, one or more video capture devices may be installed in an animal's active space for capturing video data of the animal. In other examples, the video capture device may also be worn on the head region of the animal, where the video capture device may be used to capture video data of the animal's field of view, i.e., to capture video content seen by the animal. This may be used as input data for animal intention recognition, and this embodiment is not limited thereto.
The animal sign data associated with the animal may be sign data including the animal, such as heart rate and blood pressure of the animal, and the sign data may be detected by wearing a sign detection device on an animal limb, such as wearing a heart rate detection device to detect the heart rate of the animal. In one example, a heart rate detection device may be worn at a forelimb area of an animal to collect heart rate data of the animal. In other examples, the animal may be worn in other areas, which is not limited in this embodiment.
Step S120: and determining animal intention information corresponding to the data to be identified according to the data to be identified based on the trained target neural network model.
The target neural network model is obtained through training based on a training sample set marked with intention information, the recognition result can be output according to the data to be recognized, and the terminal equipment can determine animal intention information corresponding to the data to be recognized based on the recognition result. In some examples, the animal intention information may also be the recognition result itself, in other examples, the recognition result may be a score corresponding to a series of intention information, and the terminal device may determine the intention information with the highest score as the animal intention information corresponding to the data to be recognized based on the recognition result.
The training sample set may include at least one training sample of audio, video and animal sign type data and a label corresponding to the training sample, so that the target neural network model may be used to identify at least one of audio data, video data and animal sign data, and obtain corresponding intention information.
Where the animal intent information is the purpose of the animal's expression, representing the animal's desire, i.e. "what the animal wants to dry" as embodied in the language expression. In embodiments of the present application, the intent information may encompass a variety of aspects including, but not limited to, physiological, psychological, and the like. For example, physiological aspects may include, but are not limited to, hunger (want to eat), thirst (want to drink), tired (want to sleep), want to excrete, and the like, psychological aspects may include fear (want to escape), happiness, boring (want to play), doubt, no happiness, want to make contact, and the like.
In some embodiments, limited by the fact that the language used by animals and humans is not exactly the same, it is currently difficult for even a familiar animal to know exactly what the animal is about to do or what is about to be expressed, but a familiar animal person can make a more accurate determination of the general tendency that the animal expects, e.g., based on the cat's expression, movements, the user may not be able to accurately determine what the animal is about to eat, but some users who are more observed with the animal's behavior, familiar with the animal, may be able to determine the current hunger of the animal. Therefore, according to the embodiment of the application, the target neural network model obtained by training the neural network based on the collected training sample set related to the animal can obtain the corresponding animal intention information according to the data to be identified associated with the animal.
In some embodiments, the target neural network model may be run in a server, and the terminal device may obtain the data to be identified associated with the animal, send the data to the server, instruct the server to obtain the animal intention information corresponding to the data to be identified through the target neural network model based on the data to be identified, and return the animal intention information to the terminal device. In other embodiments, the target neural network model may also be running locally at the terminal device, where the target neural network model may provide services in an offline environment.
Step S130: according to the animal intention information, a predetermined operation is performed.
The predetermined operation may be outputting animal intention information by the terminal device, for example, animal intention information may be output by various means such as voice, text, etc., so that the user can learn the intention of the animal corresponding to the data to be recognized. For example, when a cat emits a sound, the terminal device can acquire the sound as data to be identified, and when animal intention information is identified through the target neural network model, the terminal device outputs the intention which the cat wants to express in a voice form to prompt a user, so that people can be assisted in better judging the intention of the animal, and more friendly interaction is performed.
In some embodiments, the terminal device may perform the predetermined operation by transmitting the animal intention information to the other terminal device or the server so as to synchronize the animal intention information to the other terminal device or the server. For example, the client can bind a plurality of accounts, each account can correspond to one terminal device, after the terminal device of the local terminal obtains the animal intention information, the animal intention information can be sent to other terminal devices corresponding to the accounts bound by the client through the client, so that users corresponding to the plurality of terminal devices can synchronously know the intention of the animal, and the animal can be attended to in time.
In other embodiments, the terminal device may also obtain the suggestion information corresponding to the animal intention information, and output the suggestion information and the animal intention information together by the terminal device, so that the user may not only obtain the animal intention information corresponding to the data to be identified, but also obtain the suggestion information corresponding to the animal intention information to further obtain what operation the user may take to meet the animal requirement when the animal presents the animal intention information. For example, when the terminal device obtains that the animal intention information of the cat is boring, care advice information corresponding to the animal intention information, such as articles that the cat likes to play, may be further obtained, and then output together with the animal intention information, such as generating voice "your cat now seems to want to play with the owner, advice to accompany it to play the knitting wool ball and play, so as to assist the user in knowing the animal intention in time, and at the same time, some targeted care advice may be prompted so as to assist in realizing more friendly interaction between the user and the animal.
In addition, in still other embodiments, the terminal device may further determine a control instruction corresponding to the animal intention information according to the animal intention information, and send the control instruction to other terminal devices or servers (which may be denoted as opposite terminals for convenience of description) to instruct the other terminal devices or servers to perform a control operation corresponding to the control instruction. The terminal equipment can locally store at least the mapping relation between the animal intention information and the control instruction so as to determine the corresponding control instruction according to the animal intention information, and the opposite terminal can store at least the mapping relation between the control instruction and the control operation so as to determine the corresponding control operation according to the received control instruction and execute the control operation. In some possible embodiments, the local and opposite terminals of the terminal device may also store mapping relationships among the animal intention information, the control command and the control operation, which is not limited herein.
For example, the opposite end may be an automatic feeding machine, and when the terminal device obtains that the animal intention information is hunger, the terminal device may send the animal intention information corresponding to the index finger feeding command to the automatic feeding machine, so as to instruct the automatic feeding machine to put in food to a specified position for the animal to eat.
According to the data processing method provided by the embodiment, the data to be identified associated with the animal is obtained, then the animal intention information corresponding to the data to be identified is determined according to the data to be identified based on the trained target neural network model, wherein the target neural network model is obtained through training based on a training sample set marked with the intention information, and finally preset operation is executed according to the animal intention information. Therefore, the target neural network model is obtained by training based on the training sample set marked with the intention information, the animal intention information can be identified based on the target neural network model according to the data to be identified associated with the animal, the animal is identified, and the preset operation is executed, so that more friendly interaction with the animal is realized, and the requirement of the animal is met.
In the embodiment of the application, before the data to be identified associated with the animal is acquired, the embodiment of the application also provides a training method of the target neural network model, so that the target neural network model is obtained through training and used for identifying the intention information of the animal. Specifically, referring to fig. 3, fig. 3 shows a model training method of a target neural network model according to an embodiment of the present application, which may be applied to the terminal device or the server, and the method may include:
Step S210: a training sample set is obtained.
The training sample set comprises training samples and intention information corresponding to the training samples.
In some embodiments, because the expression systems of different kinds of animals are different, different sample collection schemes can be adopted for different animals, and training sample sets corresponding to animal kinds can be obtained according to animal kinds so as to train corresponding target neural network models for different animal kinds. At this time, after the terminal device obtains the data to be identified, the animal type corresponding to the data to be identified can be determined first, and then the target neural network model corresponding to the animal type is determined to obtain the animal intention information corresponding to the data to be identified. The different kinds of animals may be, for example, cat, dog, bird, etc., and the present embodiment is not limited thereto.
The training samples can be at least one of three data types of audio data, video data and animal sign data, and each training sample is marked with corresponding intention information. In some embodiments, a large amount of data associated with the animal may be collected in advance, and thus a plurality of training samples may be obtained, and corresponding intention information may be respectively labeled for each training sample, so as to obtain a training sample set. The specific embodiment of obtaining the training sample can be seen in the following examples, which are not described herein.
In some embodiments, based on training sample sets of different data types, various data types may be trained to obtain corresponding target neural network models, i.e., for each data type input, one target neural network model may be trained separately for identifying the data to be identified for that data type.
Step S220: and taking the training sample as input of the initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain a trained target neural network model.
In this embodiment, after the training sample set is obtained, the training sample may be used as an input of an initial neural network model, and the initial neural network model may be constructed from a neural network suitable for the task of intention recognition. And taking the training sample as input of the initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain a trained target neural network model. The machine learning algorithm may be, for example, an adaptive time estimation method (Adaptive Moment Estimation, ADAM), which is not limited in this embodiment.
The neural network employed in the initial neural network model may include, but is not limited to, convolutional neural networks (Convolutional Neural Networks, CNN), recurrent neural networks (Recurrent Neural Network, RNN), graph roll-up neural networks (Graph Convolutional Network, GCN), and the like.
It should be noted that, in this embodiment, the portions not described in detail may refer to the foregoing embodiments, and are not described herein again.
According to the model training method of the target neural network model, the target neural network model which can be used for identifying the animal intention information can be obtained through training, so that the animal intention can be identified, targeted interaction is realized, and the requirements of animals are better met.
Referring to fig. 4, fig. 4 illustrates a model training method of a target neural network model according to another embodiment of the present application, where a specific implementation manner of obtaining a training sample set may include steps S310 to S330, and specifically, the method may include:
step S310: a training sample is obtained.
In some embodiments, sample data (including training samples and corresponding intention information) can be actively collected, and at least one of audio, video, animal signs and other data of the animal under various preset intention information can be actively triggered by preset intention classification, namely preset intention information, so as to obtain training samples corresponding to the preset intention information. Then, as an embodiment, a training sample corresponding to the preset intention information may be obtained based on the preset intention information. In one example, to collect training samples where the intent information of the cat is happy, the cat may be actively amused or stroked with a correct posture, etc., and then a plurality of training samples corresponding to the intent information being happy may be obtained by collecting the data of the cat at this time. Based on the embodiment, because the intention information corresponding to the current training sample is known before the training sample is acquired, a more accurate training sample can be obtained, and a more accurate target neural network model is facilitated to be obtained, so that a user can better understand the intention of an animal, and better care and interaction with the animal can be realized.
In addition, in the active collection process, the professional with high familiarity degree to animals, such as animal breeders, can also provide suggestions of how to trigger the preset intention information, so as to obtain more accurate training samples corresponding to the preset intention information.
In some embodiments, sample data can be collected passively, that is, daily data of animals is collected, then intention information corresponding to fragments in the daily data is determined and marked, and a training sample and intention information thereof can be obtained. More training samples can be obtained, so that the training sample set is continuously expanded.
In one embodiment, a professional such as an animal raising person who is familiar with the animal can observe the daily life of the animal, and meanwhile, any one of an audio and video acquisition device, a physical sign data detection device and the like is arranged in an animal activity area, the animal raising person observes the daily data on site or judges the intention information of the animal according to the acquired daily data, the animal behavior and other performances, the intention information and the time point when the intention appears in the animal are recorded, the data of a time period near the time point is extracted from the acquired daily data, and the intention information is marked, so that a plurality of training samples can be obtained based on the daily data.
Step S320: classifying the training samples according to preset intention information to obtain classified data to be trained.
The data to be trained comprises a training sample and intention information corresponding to the training sample, wherein the preset intention information comprises at least one intention information.
In some embodiments, for actively collected sample data, training samples are classified according to preset intention information, so that training samples corresponding to each intention information in the preset intention information can be obtained, the intention information of the training samples is labeled one by one, and classified data to be trained can be obtained.
In some embodiments, for the passively collected sample data, according to the recorded intention information and the time point when the intention information occurs to the animal, the target fragment data corresponding to the time point can be extracted from the collected daily data based on the time point, and the target fragment data can be data in a time segment from a first preset time interval before the time point to a second preset time interval after the time point.
The first and second preset time intervals may be preset by a program or may be customized by a user, which is not limited in this embodiment. The first preset time interval and the second preset time interval may be equal or different, in an example, the first preset time interval is greater than the second preset time interval, the first preset time interval may be 3s, the second preset time interval may be 1s, and the time length corresponding to the target fragment data is 4s.
Step S330: and correspondingly storing the training samples and the intention information corresponding to the training samples to obtain a training sample set.
After the classified data to be trained are obtained, the training samples and the intention information corresponding to the training samples can be correspondingly stored, and a training sample set is obtained.
In some embodiments, after obtaining classified data to be trained, the starting point and ending point of the time when the disagreement graph appears may be segmented and recorded, and the video, audio, heart rate and other data in the time period are extracted through the starting point and ending point of the time when the disagreement graph appears, so as to obtain a training sample. Specifically, referring to fig. 5, fig. 5 shows a schematic flow chart of step S330 in fig. 4 in an exemplary embodiment of the present application, specifically, S330 may include:
step S331: and carrying out segmentation processing on the training sample to obtain a segmented training sample.
And dividing the training sample aiming at the starting and ending point of the time when the intention information corresponding to the training sample appears, so as to obtain the divided training sample. In some embodiments, the time starting point and the ending point of the appearance of the intention information may be determined by the professional, and the determined time starting point and ending point data may be input to instruct the machine to perform segmentation processing on the training sample according to the input time starting point and ending point data, so as to obtain the segmented training sample, thereby improving the segmentation accuracy.
In other embodiments, the machine may determine the starting point of the time when the intention information appears, and perform the segmentation processing according to the starting point, for example, a repeated segment with the data change amplitude smaller than the preset amplitude in at least a part of the time area in the beginning time period and the ending time period of the training sample may be segmented. The starting time period is data of a preset time length after the training sample starts, and the ending time period is data of a preset time length before the training sample ends. The preset time length may be preset by a program or may be customized by a user, which is not limited herein.
It should be noted that, for training samples of different data types, the data variation amplitude definitions are different.
As one way, if the training sample is audio data, the data variation amplitude may be the variation amplitude of the audio waveform within the preset segment duration, that is, whether there is a target segment whose variation amplitude of the audio waveform is smaller than the variation amplitude of the preset waveform may be detected from at least one of the beginning time period and the ending time period of the training sample, and if there is a target segment, the target segment may be determined as a repeating segment. The preset segment duration may be preset by a program, or may be user-defined, which is not limited herein.
Alternatively, if the training sample is video data, the data change amplitude may be the motion amplitude of the animal in the preset segment duration, that is, whether there is a target segment with a motion amplitude smaller than the preset motion amplitude may be detected from at least one of the beginning time period and the ending time period of the training sample, and if there is a target segment, the target segment may be determined to be a repeated segment. For example, if the video starts and the animal remains stationary for 2 seconds, then the portion of the video may be determined as a repeated segment to be segmented out such that the segmented training sample does not contain repeated segments.
As still another way, if the training sample is animal sign data, the data change amplitude may be the change amplitude of the animal sign data, such as the heart rate, in the duration of the preset segment, that is, whether there is a target segment with the heart rate change amplitude smaller than the preset heart rate change amplitude in at least one of the beginning time period and the ending time period of the training sample may be detected, and if there is a target segment, the target segment may be determined as a repeating segment.
In one example, the data change amplitude may also be a change amplitude of the heart rate deviating from the normal heart rate within a preset segment duration, so as to segment out repeated segments around the normal heart rate, so as to segment out at least one of a preparation stage before the animal intention information appears and a segment after the animal intention information is calms, thereby not only reducing the data size of the training sample, but also improving the data characterization capability of the training sample.
Step S332: and correspondingly storing the segmented training samples and intention information corresponding to the segmented training samples to obtain a training sample set.
The segmented training samples and the intention information corresponding to the segmented training samples are correspondingly stored to obtain a training sample set, so that the data size of the training sample set can be reduced, and the data representation capability of the training sample set can be improved.
Step S340: and taking the training sample as input of the initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain a trained target neural network model.
It should be noted that, in this embodiment, the portions not described in detail may refer to the foregoing embodiments, and are not described herein again.
In addition, in some embodiments, the animal performance of a portion of the segments that may exist in the daily data is temporarily not determinable of the intent information, and the portion of the data may be temporarily unclassified and stored as unclassified data in the classified data to be trained. That is, the classified data to be trained may include sample data classified according to the preset intention information and non-classified data. At this time, the training samples which cannot be classified at present can be subjected to targeted optimization judgment, the preset intention is expanded, the possible intention is determined for the samples which are not classified correspondingly temporarily, and then the determination is verified, so that the preset intention can be continuously expanded, the fine granularity of model classification is improved, the classification which can be realized by the model is enriched, the accuracy of model identification is improved, and the accuracy of animal intention identification is improved.
Specifically, referring to fig. 6, fig. 6 is a flowchart illustrating a model training method of a target neural network model according to another embodiment of the present application, where the method is based on the method framework of fig. 4, and in step S320 in fig. 4, the method may further include:
step S410: and determining candidate intention information corresponding to the non-classified data.
In this embodiment, the classified data to be trained includes non-classified data, where intention information corresponding to the non-classified data is not matched with preset intention information, i.e. intention information corresponding to the non-classified data cannot be determined from the preset intention information.
In some embodiments, if the number of training samples included in the non-classified data is greater than a predetermined number, clustering may be performed on the non-classified data, where the non-classified data is first roughly classified into groups, each group corresponding to a different unknown class. As one approach, one or more candidate intent information candidates corresponding to each set of unclassified data may be determined based on common features between training samples in the set of unclassified data. The common characteristics can be obtained by clustering, and the candidate intention information can be obtained by determining from other intention information except the preset intention information according to the common characteristics. Other intent information may be obtained from the web crawler, as well as from up to web site resources or otherwise, and this embodiment is not limited in this regard.
Step S420: and acquiring data to be verified based on the candidate intention information.
Based on the candidate intention information, actively triggering at least one of the data such as the audio, the video, the animal signs and the like of the animal under the candidate intention information to obtain the data to be verified. The method for actively triggering the acquisition of data may refer to the step of acquiring the training sample in the foregoing embodiment, which is not described herein.
Step S430: and determining target intention information from the candidate intention information according to the data to be verified.
And comparing whether the data to be verified corresponding to the candidate intention information is matched with the unclassified data or not, and determining the data to be verified corresponding to the candidate intention information matched with the unclassified data, so as to determine the target candidate intention information matched with the unclassified data.
Step S440: and taking the target intention information as intention information corresponding to the unclassified data, and storing the intention information corresponding to the unclassified data.
The target intention information is used as intention information corresponding to the unclassified data and is stored corresponding to the unclassified data, so that the unclassified data of which the intention information cannot be judged previously can be optimized pertinently. And the target intention information is classified into the preset intention information, so that the preset intention information can be continuously expanded, the fine granularity of model classification is improved, the intention information classification which can be realized by the model is enriched, the accuracy of model identification is improved, and the accuracy of animal intention identification is improved.
It should be noted that, in this embodiment, the portions not described in detail may refer to the foregoing embodiments, and are not described herein again.
In addition, in some embodiments, in order to further optimize the training sample set to obtain a better model training effect, the processed sample data (including the training sample and the corresponding intention information) may be subjected to a secondary verification, whether there is a sample data with an intention overlapping or a wrong labeling is checked, the existing data with a problem is subjected to a re-labeling or an intention classification is changed, the training sample set is updated, and the optical neural network model is trained by using the updated training sample set to obtain the target neural network model. Specifically, referring to fig. 7, fig. 7 shows a flowchart of a model training method of a target neural network model according to still another embodiment of the present application, and specifically, the method may include:
step S510: a training sample set is obtained.
Step S520: and obtaining the similarity between training samples.
In some embodiments, taking training samples of audio data type as an example, template matching can be performed by a dynamic time warping algorithm (Dynamic Time Warping, DTW), and similarity of audio waveforms of the training samples can be calculated to check whether training samples with intention information overlapping or intention information labeling errors exist. Wherein a dynamic time warping algorithm may be used to measure the similarity between two time sequences.
In one example, the DTW determines each set of similarity points between two time series by extending and shortening the time series of the two training samples, marks the points as similarity points, obtains the sum of distances between each set of similarity points as a normalized path distance (Warp Path Distance), and measures the similarity between the two time series.
Step S530: and determining the data to be corrected from the training sample set according to the similarity.
The data to be corrected comprises training samples with similarity higher than a preset similarity threshold. According to the similarity between every two training samples, determining the training samples with the similarity higher than the preset similarity threshold value from the training sample set as the training samples in the data to be corrected. The preset similarity threshold may be preset by a program or may be customized by a user, which is not limited in this embodiment.
Step S540: and correcting the data to be corrected to update the training sample set.
And re-labeling the data to be corrected, which has problems, namely determining the correction intention information corresponding to the data to be corrected, and modifying the intention information corresponding to the data to be corrected into the correction intention information so as to update the training sample set. Therefore, the training sample set can be subjected to secondary verification, the performance of the training sample set is further improved, the training effect of the target neural network model is optimized, and the more accurate target neural network model is obtained. One embodiment of re-labeling the data to be corrected may refer to the above manner of determining the intention information corresponding to the non-classified data, and the principle is substantially the same, which is not described herein.
Step S550: and taking the training sample as input of the initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain a trained target neural network model.
It should be noted that, in this embodiment, the portions not described in detail may refer to the foregoing embodiments, and are not described herein again.
In some embodiments, when the target neural network model is trained, after each initial neural network model is trained to obtain a plurality of corresponding trained initial neural network models, a plurality of candidate neural network models obtained by a plurality of combination modes based on different algorithm models, namely the trained initial neural network models, are tested based on a test sample set, and candidate neural network models with better model performance are selected from the test sample set to serve as the target neural network models according to test results, so that models which are more suitable for animal intention recognition can be obtained through training, and training efficiency is improved. Specifically, referring to fig. 8, fig. 8 shows a model training method of a target neural network model according to still another embodiment of the present application, where the method may include:
Step S610: a training sample set is obtained.
In some embodiments, step S610 may also be followed by steps S520 to S540 to obtain a more accurate training sample set for subsequent training. In other embodiments, this may or may not be performed, and is not limited in this regard.
Step S620: and taking the training sample as the input of each initial neural network model, taking the intention information corresponding to the training sample as the expected output of the initial neural network model, and training each initial neural network model based on a machine learning algorithm to obtain a plurality of trained initial neural network models.
In this embodiment, the number of initial neural network models is a plurality. Wherein the plurality of trained initial neural network models includes, but is not limited to, a neural network model composed of a neural network such as CNN, RNN, GCN. Specifically, the RNN may specifically employ a long and short term memory network (Long Short Term Memory, LSTM) or a gating loop unit (Gated Recurrent Unit, GRU), which is not limited in this embodiment.
In some embodiments, the same training sample passes through each initial neural network model respectively to obtain an output result, a loss function between the output result and intention information corresponding to the training sample is calculated, model parameters are modified according to whether the loss function meets a convergence condition, the loss function … of the next training sample is obtained based on the modified initial neural network model to train the initial neural network model, until the loss function meets the convergence condition, training can be stopped, and the initial neural network model containing the current model parameters is determined to be a trained initial neural network model.
In one embodiment, the initial neural network model may be trained based on ADAM, and when model parameters of the initial neural network model are corrected based on ADAM, the momentum factor beta_1 may be set to 0.9, the momentum factor beta_2 may be set to 0.999, and the basic LEARNING RATE (learning_rate) may be set to 0.001, and gradually decrease with increasing iteration number, so as to increase convergence RATE. Taking the initial basic learning rate of 0.001 as an example, the basic learning rate is updated to 0.0003 after 300,000 iterations are completed, the basic learning rate is updated to 0.00009 after 600,000 iterations are completed, and so on until the loss function satisfies the convergence condition.
In the above embodiments, the step S220, the step S340, etc. may be referred to for a part of the step S620 not described in detail, and will not be described herein, and the trained initial neural network model is not directly used as the target neural network model, but a subsequent step is performed after that, so as to obtain the target neural network model with better performance, which can be seen in detail.
Step S630: and selecting at least one trained initial neural network model from the plurality of trained initial neural network models to combine to obtain a candidate neural network model.
Wherein the number of candidate neural network models is a plurality.
In some embodiments, at least one neural network model is selected from each of the plurality of neural network models, and then the initial neural network models may be combined according to respective output rules, provided that at least one neural network model is selected from each of the 3 neural network models, the plurality of initial neural network models may be combined according to different output rules, e.g., based on the 3 neural network models A, B, C, at least two of the initial neural network models A, B, C, AB, AC, BC, ABC, etc., may be obtained.
In some embodiments, if the initial neural network model consists of only one neural network model, the output of the neural network model may be taken as the output of the initial neural network model; if the initial neural network model is composed of at least two neural network models, the output of the two neural network models can be used for obtaining the final output result of the initial neural network model according to a preset function. The preset function may be an average, and the specific embodiment may be described in the following examples, which are not repeated here. In addition, the preset function may be other functions, which is not limited in this embodiment.
Based on the foregoing example, after obtaining the scores output by the two models, the final scores of the 3 intents T1, T2, and T3 may be obtained based on the predetermined function according to the scores output by the model M1 and the scores output by the model M2, and output. The predetermined function may be a weighted average, and the weights of each model may be customized, for example, may be 1, which is equivalent to adding the scores output by the model M1 and the model M2 according to each intention, dividing the average value corresponding to each intention by two, and obtaining the final scores of three intentions T1, T2, and T3 respectively as output results: 8.5, 7.5, 6.5.
In other embodiments, the output rule of the initial neural network model may also be that the output result of the neural network model is output only if the output result has a score of 90%. If the score corresponding to each preset intention information in the output result does not reach 90%, information such as incapability of judging can be output, so that the initial neural network model does not output the output result.
In still other embodiments, the output rule of the initial neural network model may further be to output, as the output result of the initial neural network model, the output result having the highest score from among the output results of the neural network model.
The output rule of the candidate neural network model may be other, which is not limited in this embodiment.
In other embodiments, at least one trained initial neural network model may be selected from each of the plurality of trained initial neural network models, and candidate neural network models may be obtained by permutation and combination. For example, based on 3 trained initial neural network models A, B, C, at least two of candidate neural network models such as AB (input first pass a then pass B), BA (input first pass B then pass a), AC, BC, CA, CB, ABC, ACB, BAC, BCA, CAB, CBA, etc., may be obtained, for example, in different ranking orders.
Step S640: and testing each candidate neural network model based on the test sample set to obtain an output result corresponding to each candidate neural network model.
In one embodiment, a portion of the sample data may also be taken from the training sample set as a test sample set to test the model after training. The training samples in the test sample set are marked as test samples, and the intention information corresponding to the training samples is marked as intention information corresponding to the test samples.
And testing each candidate neural network model based on the test sample set to obtain an output result corresponding to each candidate neural network model, specifically, taking the test sample as the input of each candidate neural network model to obtain the output result corresponding to each candidate neural network model.
In some embodiments, the closest intention to the test sample label may be output through model scoring, at this time, the specific implementation of step S640 may refer to fig. 9, fig. 9 shows a schematic flow chart of step S640 in fig. 8 in an exemplary embodiment of the present application, and specifically, step S640 may include:
s641: and obtaining the score of each piece of preset intention information corresponding to the test sample set and output by the candidate neural network model.
In one embodiment, the candidate neural network model may output its score corresponding to each preset intent information according to the test sample based on the Softmax classifier.
In one example, the preset intention information has 3 values marked as intentions T1, T2 and T3, the candidate neural network model is composed of 2 trained initial neural network models M1 and M2, and if the score of each preset intention information corresponding to one test sample output by the model M1, namely, the score of each preset intention information corresponding to the test sample output by the model M1 is 9, 8 and 7, and the score output by the model M2 is 8, 7 and 6, respectively.
S642: and obtaining an output result corresponding to the candidate neural network model according to the score of each piece of preset intention information.
According to the output rule of the candidate neural network model, the output result corresponding to the candidate neural network model can be obtained according to the score of each preset intention information, and reference can be made to the aforementioned step S630.
Step S650: and determining a target neural network model from the candidate neural network models based on the output result.
And determining a target neural network model based on the output result of each candidate neural network model. As one implementation mode, the candidate neural network models can be scored based on the intention information corresponding to the test samples and the output result of the test samples through the candidate neural network models, so that the score of each candidate neural network model to each test sample can be obtained, and then the total score of each candidate neural network model to the test sample set can be obtained. For example, when the intention corresponding to the score of the output result matches with the intention information corresponding to the test sample, a score of 1 may be added, and if the intention does not match, a score of 1 may be subtracted, then the total score of the candidate neural network model based on the whole test sample set may be calculated for each candidate neural network model, and the candidate neural network model with the highest total score may be selected as the target neural network model.
Based on the foregoing example, taking one test sample as an example, if the intention information corresponding to the one test sample is the intention T1, the output result of the test sample obtained by one candidate neural network model is 8.5, 7.5, 6.5 (corresponding to the intents T1, T2, T3), the output result of the candidate neural network model is matched with the intention information corresponding to the test sample, and can be added by 1 score; and the output results of the test sample obtained by the other candidate neural network model are 8, 9 and 7 (corresponding to the intentions T1, T2 and T3), the output result of the candidate neural network model is not matched with the intentions corresponding to the test sample, and the score can be reduced by 1.
It should be noted that, in this embodiment, the portions not described in detail may refer to the foregoing embodiments, and are not described herein again.
In addition, the target neural network model is obtained based on training in any embodiment, so that more accurate identification of animal intention information can be realized, the understanding of the animal by a user can be improved, targeted interaction can be realized, and more friendly interaction between the user and the animal can be realized. Specifically, referring to fig. 10, fig. 10 illustrates a data processing method according to another embodiment of the present application, where the method may include:
Step S710: data to be identified associated with the animal is obtained.
Step S720: and acquiring the intention characteristics of the animal according to the data to be identified based on the trained target neural network model.
The trained target neural network model can perform feature extraction on data to be identified, and the intention features of the animal are obtained and are used for identifying the intention information of the animal.
In this embodiment, the intent features include at least one of voice features, motion features, and expression features of the animal. The voice features can be extracted based on audio data, and the action features and the expression features can be obtained based on video data.
Step S730: and determining animal intention information corresponding to the data to be identified according to the intention characteristics.
Based on the target neural network model trained by any of the foregoing embodiments, animal intention information corresponding to the data to be identified may be determined according to the intention characteristics.
Step S740: according to the animal intention information, a predetermined operation is performed.
As an embodiment, the predetermined operation may be to generate a voice prompt, and the specific embodiment of step S740 may be: according to the animal intention information, generating voice prompt information, wherein the voice prompt information is used for prompting the animal intention information. For example, the animal intention information is boring, and a voice prompt message of 'your pet hungry, please recall feeding and the like' can be generated to prompt the user to feed the animal, so that the animal requirement is met, more friendly and timely interaction with the animal is realized, and the user can be helped to observe the animal and timely recognize the animal intention to prompt the user when the user does not notice the animal, thereby assisting the user in better caring the animal.
It should be noted that, in this embodiment, the portions not described in detail may refer to the foregoing embodiments, and are not described herein again.
Referring to fig. 11, fig. 11 is a block diagram illustrating a data processing apparatus 1100 according to an embodiment of the present application. The data processing apparatus 1100 will be explained below with respect to the block diagram shown in fig. 11, which includes: a data acquisition module 1110, an intent recognition module 1120, and an intent output module 1130, wherein:
a data acquisition module 1110 for acquiring data associated with an animal to be identified;
the intention recognition module 1120 is configured to determine animal intention information corresponding to the data to be recognized according to the data to be recognized based on a trained target neural network model, where the target neural network model is obtained by training based on a training sample set labeled with the intention information;
and an intention output module 1130 for performing a predetermined operation according to the animal intention information.
Further, before the acquiring the data to be identified associated with the animal, the data processing apparatus 1100 further includes: the system comprises a sample set acquisition module and a target model training module, wherein:
the sample set acquisition module is used for acquiring the training sample set, wherein the training sample set comprises a training sample and intention information corresponding to the training sample;
The target model training module is used for taking the training sample as input of an initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain the trained target neural network model.
Further, the initial neural network model is a plurality of models, and the target model training module comprises: an initial model training sub-module, a candidate model combining sub-module, a candidate model testing sub-module, and a target model determining sub-module, wherein:
the initial model training sub-module is used for taking the training sample as the input of each initial neural network model, taking the intention information corresponding to the training sample as the expected output of the initial neural network model, and training each initial neural network model based on a machine learning algorithm to obtain a plurality of trained initial neural network models;
the candidate model combination sub-module is used for respectively selecting at least one trained initial neural network model from a plurality of trained initial neural network models to be combined to obtain candidate neural network models, and the number of the candidate neural network models is a plurality of;
The candidate model testing sub-module is used for testing each candidate neural network model based on a test sample set to obtain an output result corresponding to each candidate neural network model;
and the target model determining submodule is used for determining a target neural network model from the candidate neural network models based on the output result.
Further, the sample set acquisition module includes: sample acquisition submodule, sample classification submodule and sample set acquisition submodule, wherein:
the sample acquisition sub-module is used for acquiring the training samples;
the sample classification sub-module is used for classifying the training samples according to preset intention information to obtain classified data to be trained, wherein the data to be trained comprises the training samples and intention information corresponding to the training samples, and the preset intention information comprises at least one intention information;
and the sample set acquisition sub-module is used for correspondingly storing the training samples and the intention information corresponding to the training samples to obtain the training sample set.
Further, the number of the preset intention information is a plurality of, and the candidate model test submodule includes: a score acquisition unit and a score output unit, wherein:
The score obtaining unit is used for obtaining the score of each piece of preset intention information corresponding to the test sample set and output by the candidate neural network model;
and the score output unit is used for obtaining an output result corresponding to the candidate neural network model according to the score of each piece of preset intention information.
Further, the classified data to be trained includes no classified data, the intention information corresponding to the no classified data does not match the preset intention information, and the data processing apparatus 1100 further includes: a candidate intent determination module, a verification data acquisition module, a target intent determination module, and a target intent storage module, wherein:
the candidate intention determining module is used for determining candidate intention information corresponding to the non-classified data;
the verification data acquisition module is used for acquiring data to be verified based on the candidate intention information;
the target intention determining module is used for determining target intention information from the candidate intention information according to the data to be verified;
and the target intention storage module is used for taking the target intention information as intention information corresponding to the unclassified data and storing the unclassified data.
Further, the sample acquisition submodule includes: an active trigger acquisition unit, wherein:
the active trigger acquisition unit is used for acquiring the training sample corresponding to the preset intention information based on the preset intention information.
Further, the sample set acquisition submodule includes: sample segmentation unit and sample storage unit, wherein:
the sample segmentation unit is used for carrying out segmentation processing on the training samples and obtaining segmented training samples;
and the sample storage unit is used for correspondingly storing the segmented training samples and the intention information corresponding to the segmented training samples to obtain a training sample set.
Further, the sample set acquisition module further includes: the system comprises a similarity acquisition sub-module, a data to be corrected determination sub-module and a sample set updating sub-module, wherein:
the similarity acquisition sub-module is used for acquiring the similarity between the training samples;
the data to be corrected determining submodule is used for determining data to be corrected from the training sample set according to the similarity, wherein the data to be corrected comprises training samples with the similarity higher than a preset similarity threshold value;
and the sample set updating sub-module is used for correcting the data to be corrected so as to update the training sample set.
Further, the data to be identified comprises at least one of audio data, video data and animal sign data.
Further, the intention recognition module 1120 includes: an intention feature acquisition sub-module and an animal intention determination sub-module, wherein:
the intention characteristic acquisition sub-module is used for acquiring the intention characteristic of the animal based on the trained target neural network model according to the data to be identified, wherein the intention characteristic comprises at least one of the voice characteristic, the action characteristic and the expression characteristic of the animal;
and the animal intention determining submodule is used for determining animal intention information corresponding to the data to be identified according to the intention characteristics.
Further, the intent output module 1130 includes: a voice prompt sub-module, wherein:
the voice prompt sub-module is used for generating voice prompt information according to the animal intention information, and the voice prompt information is used for prompting the animal intention information.
The data processing device provided by the embodiment of the present application is used for implementing the corresponding data processing method in the foregoing method embodiment, and has the beneficial effects of the corresponding method embodiment, which is not described herein again.
It can be clearly understood by those skilled in the art that the data processing apparatus provided in the embodiment of the present application can implement each process in the foregoing method embodiment, and for convenience and brevity of description, the specific working process of the foregoing description apparatus and module may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the embodiments provided herein, the modules shown or discussed may be coupled or directly coupled or communicatively connected to each other via some interface, whether an apparatus or module is indirectly coupled or communicatively connected, whether electrically, mechanically or otherwise.
In addition, each functional module in the embodiment of the present application may be integrated in one processing module, or each module may exist alone physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules.
Referring to fig. 12, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 1200 may be a smart phone, tablet, electronic book, etc. capable of running applications. The electronic device 1200 of the present application may include one or more of the following: processor 1210, memory 1220, and one or more application programs, wherein the one or more application programs may be stored in memory 1220 and configured to be executed by the one or more processors 1210, the one or more program configured to perform the methods as described in the foregoing method embodiments.
Processor 1210 may include one or more processing cores. The processor 1210 uses various interfaces and lines to connect various portions of the overall electronic device 1200, perform various functions of the electronic device 1200, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1220, and invoking data stored in the memory 1220. Alternatively, the processor 1210 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 1210 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 1210 and may be implemented solely by a single communication chip.
Memory 1220 may include random access Memory (Random Access Memory, RAM) or Read-Only Memory (rom). Memory 1220 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 1220 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described below, etc. The storage data area may also store data created by the electronic device 1200 in use (e.g., phonebook, audiovisual data, chat log data), and the like.
Referring to fig. 13, a block diagram of a computer readable storage medium according to an embodiment of the application is shown. The computer readable storage medium 1300 has stored therein program code that can be invoked by a processor to perform the methods described in the method embodiments described above.
The computer-readable storage medium 1300 may be an electronic memory such as a flash memory, an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (erasable programmable read only memory, EPROM), a hard disk, or a ROM. Optionally, computer readable storage medium 1300 includes non-volatile computer readable media (non-transitory computer-readable storage medium). The computer readable storage medium 1300 has storage space for program code 1310 that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 1310 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be appreciated by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. A method of data processing, the method comprising:
obtaining a training sample;
classifying the training samples according to preset intention information to obtain classified data to be trained, wherein the data to be trained comprises the training samples and intention information corresponding to the training samples, and the preset intention information comprises at least one piece of intention information;
the classified data to be trained further comprises non-classified data, and intention information corresponding to the non-classified data is not matched with the preset intention information; determining candidate intention information corresponding to the non-classified data; acquiring data to be verified based on the candidate intention information; determining target intention information from the candidate intention information according to the data to be verified; taking the target intention information as intention information corresponding to the unclassified data and storing the intention information corresponding to the unclassified data;
Correspondingly storing the training sample and intention information corresponding to the training sample to obtain a training sample set;
acquiring the training sample set, taking the training sample as input of an initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain a trained target neural network model;
acquiring data to be identified associated with an animal;
determining animal intention information corresponding to the data to be identified according to the data to be identified based on the trained target neural network model;
and executing a preset operation according to the animal intention information.
2. The method according to claim 1, wherein the number of the initial neural network models is plural, the training samples are used as inputs of the initial neural network models, the intention information corresponding to the training samples is used as expected outputs of the initial neural network models, the initial neural network models are trained based on a machine learning algorithm, and the trained target neural network models are obtained, including:
Taking the training samples as input of each initial neural network model, taking intention information corresponding to the training samples as expected output of the initial neural network models, and training each initial neural network model based on a machine learning algorithm to obtain a plurality of trained initial neural network models;
selecting at least one trained initial neural network model from a plurality of trained initial neural network models respectively to obtain candidate neural network models in a combined mode, wherein the number of the candidate neural network models is a plurality;
testing each candidate neural network model based on a test sample set to obtain an output result corresponding to each candidate neural network model;
and determining a target neural network model from the candidate neural network models based on the output result.
3. The method according to claim 2, wherein the number of the preset intention information is a plurality of, the testing each candidate neural network model based on the test sample set, to obtain the output result corresponding to each candidate neural network model, includes:
obtaining the score of each piece of preset intention information corresponding to the test sample set and output by the candidate neural network model;
And obtaining an output result corresponding to the candidate neural network model according to the score of each piece of preset intention information.
4. The method of claim 1, wherein the obtaining training samples comprises:
and obtaining training samples corresponding to the preset intention information based on the preset intention information.
5. The method according to claim 1, wherein storing the training samples and the intention information corresponding to the training samples to obtain the training sample set includes:
dividing the training sample to obtain a divided training sample;
and correspondingly storing the segmented training samples and intention information corresponding to the segmented training samples to obtain a training sample set.
6. The method of claim 1, wherein the acquiring the training sample set further comprises:
obtaining the similarity between the training samples;
determining data to be corrected from the training sample set according to the similarity, wherein the data to be corrected comprises training samples with similarity higher than a preset similarity threshold;
and correcting the data to be corrected to update the training sample set.
7. The method of claim 1, wherein the data to be identified comprises at least one of audio data, video data, animal sign data.
8. The method according to claim 1, wherein the determining, based on the trained target neural network model, the animal intention information corresponding to the data to be identified according to the data to be identified includes:
acquiring intention characteristics of the animal based on the trained target neural network model according to the data to be identified, wherein the intention characteristics comprise at least one of voice characteristics, action characteristics and expression characteristics of the animal;
and determining animal intention information corresponding to the data to be identified according to the intention characteristics.
9. The method of claim 1, wherein said performing a predetermined operation based on said animal intention information comprises:
generating voice prompt information according to the animal intention information, wherein the voice prompt information is used for prompting the animal intention information.
10. A data processing apparatus, the apparatus comprising:
the sample acquisition sub-module is used for acquiring training samples;
The sample classification sub-module is used for classifying the training samples according to preset intention information to obtain classified data to be trained, wherein the data to be trained comprises the training samples and intention information corresponding to the training samples, and the preset intention information comprises at least one intention information; the classified data to be trained further comprises non-classified data, and intention information corresponding to the non-classified data is not matched with the preset intention information; determining candidate intention information corresponding to the non-classified data; acquiring data to be verified based on the candidate intention information; determining target intention information from the candidate intention information according to the data to be verified; taking the target intention information as intention information corresponding to the unclassified data and storing the intention information corresponding to the unclassified data;
the sample set acquisition sub-module is used for correspondingly storing the training samples and the intention information corresponding to the training samples to obtain a training sample set;
the target model training module is used for acquiring the training sample set, taking the training sample as input of an initial neural network model, taking intention information corresponding to the training sample as expected output of the initial neural network model, and training the initial neural network model based on a machine learning algorithm to obtain a trained target neural network model;
The data acquisition module is used for acquiring data to be identified associated with the animal;
the intention recognition module is used for determining animal intention information corresponding to the data to be recognized according to the data to be recognized based on the trained target neural network model;
and the intention output module is used for executing preset operation according to the animal intention information.
11. An electronic device, comprising:
a memory;
one or more processors coupled with the memory;
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-9.
12. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program code which, when executed by a processor, implements the method of any of claims 1 to 9.
CN202010148112.7A 2020-03-05 2020-03-05 Data processing method, device, terminal equipment and storage medium Active CN111461337B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010148112.7A CN111461337B (en) 2020-03-05 2020-03-05 Data processing method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010148112.7A CN111461337B (en) 2020-03-05 2020-03-05 Data processing method, device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111461337A CN111461337A (en) 2020-07-28
CN111461337B true CN111461337B (en) 2023-08-18

Family

ID=71682665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010148112.7A Active CN111461337B (en) 2020-03-05 2020-03-05 Data processing method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111461337B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866192B (en) * 2020-09-24 2021-01-08 汉桑(南京)科技有限公司 Pet interaction method, system and device based on pet ball and storage medium
CN112465604A (en) * 2020-12-14 2021-03-09 深圳依时货拉拉科技有限公司 Order distribution method and device, computer equipment and computer readable storage medium
CN113239232B (en) * 2021-05-17 2023-12-26 北京达佳互联信息技术有限公司 System, method and device for recommending graph neural network, electronic equipment and storage medium
CN113657173B (en) * 2021-07-20 2024-05-24 北京搜狗科技发展有限公司 Data processing method and device for data processing
CN114615422B (en) * 2022-01-18 2023-07-11 深圳市恒天伟焱科技股份有限公司 Method and device for identifying prey, electronic equipment and storage medium
CN116259072B (en) * 2023-01-10 2024-05-10 华瑞研能科技(深圳)有限公司 Animal identification method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416440A (en) * 2018-03-20 2018-08-17 上海未来伙伴机器人有限公司 A kind of training method of neural network, object identification method and device
CN108522342A (en) * 2018-01-23 2018-09-14 北京师范大学 A kind of animal behavior monitoring, analysis and early warning system and its working method based on action and cry
CN109451356A (en) * 2018-12-20 2019-03-08 珠海市微半导体有限公司 A kind of intelligent mobile robot, automatic order method, device and chip
CN109635918A (en) * 2018-10-30 2019-04-16 银河水滴科技(北京)有限公司 The automatic training method of neural network and device based on cloud platform and preset model
CN109729990A (en) * 2018-12-13 2019-05-10 平安科技(深圳)有限公司 Automatic pet feeding method and device, computer storage medium and electronic equipment
CN109871911A (en) * 2017-12-04 2019-06-11 昊翔电能运动科技(昆山)有限公司 Unmanned plane monitors the method for animal health and the unmanned plane of monitoring animal health
CN110210434A (en) * 2019-06-10 2019-09-06 四川大学 Pest and disease damage recognition methods and device
CN110765972A (en) * 2019-10-31 2020-02-07 秒针信息技术有限公司 Animal monitoring method and device, electronic equipment and storage medium
CN110852198A (en) * 2019-10-27 2020-02-28 恒大智慧科技有限公司 Control method, equipment and storage medium for preventing pet dog attack in smart community

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10896370B2 (en) * 2017-03-03 2021-01-19 International Business Machines Corporation Triage of training data for acceleration of large-scale machine learning

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871911A (en) * 2017-12-04 2019-06-11 昊翔电能运动科技(昆山)有限公司 Unmanned plane monitors the method for animal health and the unmanned plane of monitoring animal health
CN108522342A (en) * 2018-01-23 2018-09-14 北京师范大学 A kind of animal behavior monitoring, analysis and early warning system and its working method based on action and cry
CN108416440A (en) * 2018-03-20 2018-08-17 上海未来伙伴机器人有限公司 A kind of training method of neural network, object identification method and device
CN109635918A (en) * 2018-10-30 2019-04-16 银河水滴科技(北京)有限公司 The automatic training method of neural network and device based on cloud platform and preset model
CN109729990A (en) * 2018-12-13 2019-05-10 平安科技(深圳)有限公司 Automatic pet feeding method and device, computer storage medium and electronic equipment
CN109451356A (en) * 2018-12-20 2019-03-08 珠海市微半导体有限公司 A kind of intelligent mobile robot, automatic order method, device and chip
CN110210434A (en) * 2019-06-10 2019-09-06 四川大学 Pest and disease damage recognition methods and device
CN110852198A (en) * 2019-10-27 2020-02-28 恒大智慧科技有限公司 Control method, equipment and storage medium for preventing pet dog attack in smart community
CN110765972A (en) * 2019-10-31 2020-02-07 秒针信息技术有限公司 Animal monitoring method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111461337A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111461337B (en) Data processing method, device, terminal equipment and storage medium
US11335347B2 (en) Multiple classifications of audio data
CN110519617B (en) Video comment processing method and device, computer equipment and storage medium
CN104598644B (en) Favorite label mining method and device
EP3493032A1 (en) Robot control method and companion robot
KR102185469B1 (en) Companion Animal Emotion Bots Device using Artificial Intelligence and Communion Method
US10108707B1 (en) Data ingestion pipeline
CN110930989B (en) Speech intention recognition method and device, computer equipment and storage medium
CN108074571A (en) Sound control method, system and the storage medium of augmented reality equipment
US10789961B2 (en) Apparatus and method for predicting/recognizing occurrence of personal concerned context
CN110505504B (en) Video program processing method and device, computer equipment and storage medium
CN112016367A (en) Emotion recognition system and method and electronic equipment
JP6915637B2 (en) Information processing equipment, information processing methods, and programs
KR102222911B1 (en) System for Providing User-Robot Interaction and Computer Program Therefore
CN112116910A (en) Voice instruction recognition method and device, storage medium and electronic device
CN111243604B (en) Training method for speaker recognition neural network model supporting multiple awakening words, speaker recognition method and system
US20120185417A1 (en) Apparatus and method for generating activity history
CN110197103B (en) Method, device, equipment and storage medium for human-animal interaction
CN115050372A (en) Audio segment clustering method and device, electronic equipment and medium
CN115248843A (en) Method and device for assisting in generating record and record generating system
CN110347303A (en) A kind of information processing method and relevant device
CN109905381A (en) Self-service interview method, relevant apparatus and storage medium
CN113707154B (en) Model training method, device, electronic equipment and readable storage medium
CN114817456B (en) Keyword detection method, keyword detection device, computer equipment and storage medium
CN113420115B (en) Information processing method and device based on man-machine voice dialogue

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant