Pet behavior identification method and system based on information recovery
Through information recovery technology, high sampling frequency data is used to train the teacher network and the IR and ID modules are designed, which solves the problem of reduced performance of automatic recognition of pet behavior under low sampling frequency, and achieves energy-efficient pet behavior monitoring and health status assessment.
Patent Information
- Application Number
- CN202410714541.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-10-01
AI Technical Summary
The low sampling frequency in the existing pet behavior automatic recognition technology causes the sensor monitoring performance to decrease, making it impossible to effectively improve the performance of the pet behavior recognition model.
Using a method based on information recovery, by training the teacher classification network and reconstruction network, using high sampling frequency data to guide the training of the student classification network, and designing information reconstruction (IR) and information distillation (ID) modules to force the student network to extract more complete, More discriminative features to make up for the lack of information in low sampling frequency data.
It achieves an improvement in sensor monitoring performance at low sampling frequency, improves the accuracy and energy efficiency of pet behavior recognition, and extends the battery life of the device.
Smart Images

Figure CN118736667A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of behavior recognition, and in particular relates to a pet behavior recognition method and system based on information recovery. Background Art
[0002] In contemporary society, many families keep pets. Pets are not only people's loyal companions, but also provide people with spiritual comfort and support. For example, pets can effectively reduce people's loneliness, anxiety and stress, thereby improving people's quality of life. At the same time, some pets also play an important role in specific fields, such as police dogs and search and rescue dogs, which can assist the police in performing tasks and provide timely rescue. Given the profound impact of pets on human life, their health status has naturally become the focus of widespread concern. Changes in pet behavior can usually indirectly indicate their health status. For example, abnormal behaviors such as loss of appetite, decreased activity or increased lying time may be a sign of physical discomfort in pets. At present, the traditional human observation method is mainly relied on to assess the health status of pets, but this method often has significant delays and subjectivity. Due to the defects of human observation, there is an urgent need for intelligent behavior monitoring technology to more accurately monitor pet behavior and health status. In response to this, technicians have begun to try to use advanced scientific and technological means, such as cameras, wearable devices, etc., to monitor and analyze pet behavior in real time and continuously, so as to grasp the health status of pets more accurately and timely.
[0003] Although the current mainstream visual monitoring technology has been widely used, there are still many limitations if it is used for pet behavior monitoring. First, the coverage of surveillance cameras is limited and it is impossible to track the activities of pets in all directions. In addition, visual monitoring is easily affected by external environmental factors such as interference from obstructions and lighting conditions, which will inevitably undermine the accuracy of behavior monitoring. In contrast, wearable sensors, such as accelerometers and gyroscopes, have shown obvious advantages in the field of pet intelligent behavior monitoring due to their small size, portability, independence from external facilities, easy deployment, and resistance to external interference, and have gradually been widely used. These sensors are usually integrated into the collars or harnesses of pets and can directly record the motion signals of pets. Through deep learning technology, the collected motion signals can be further analyzed and used to monitor the daily behaviors of animals, such as eating, drinking, and walking, so as to better provide a precise and scientific basis for the assessment of the health status of pets. For example, based on the EMADE framework, the data collected by multi-dimensional high-frequency sensors can be analyzed to identify and record the scratching and shaking behavior of dogs, which helps to determine whether the dog suffers from pruritus. [1](Griffies JD, Zutty J, Sarzen M, et al. Wearable sensor shown to specifically quantify pruritic behaviors in dogs [J]. BMC veterinary research, 2018, 14: 1-10.), using FilterNet based on CNN and LSTM architecture, using an accelerometer mounted on a collar to classify important canine health-related behaviors (such as drinking, eating, and scratching) [2] (Chambers RD, Yoder NC, Carson AB, et al. Deep Learning Classification of Canine Behavior Using a Single Collar-Mounted Accelerometer: Real-World Validation [J]. Animals, 2021, 11 (6): 1549.) Using a deep learning model based on long short-term memory networks to process data captured by accelerometers, gyroscopes, and magnetometers, the behavioral activities of learning cats can be detected. [3] (Hussain A, Ali S, Joo MI, et al. A Deep Learning Approach for Detecting and Classifying Cat Activity to Monitor and Improve Cat's Well-being using Accelerometer, Gyroscope, and Magnetometer. IEEE SensorsJournal. 2023; 24(2): 1996.) etc.
[0004] With the continuous development of sensor technology and deep learning, animal behavior automatic recognition (AAR) technology has made significant progress. With its high efficiency, accuracy, sustainability and easy data analysis, AAR has become a powerful tool for modern animal management and has gradually been applied to the intelligent monitoring of pet behavior and health. It can monitor pets' daily activities and classify pet behaviors.
[0005] High-precision behavior monitoring performance often relies on motion signals with high sampling frequencies. However, in practice, the use of wearable sensors for long-term real-time monitoring of animals usually requires the device to continuously collect data and transmit this information continuously. In this process, high sampling frequencies will increase the energy consumption of wearable sensors, thereby shortening the battery life. In response to this, existing research work usually chooses to reduce the sampling frequency of the device to reduce energy loss. However, this method inevitably leads to the loss of key information in the motion signal, thereby reducing the recognition performance of pet behavior. In response to this problem, it is generally addressed from two directions: one is to find the optimal sampling frequency to achieve a relative balance between monitoring performance and energy budget; the other is to select a suitable optimal classification algorithm to compensate for the performance loss caused by low sampling frequency. However, neither of these two technologies can fundamentally eliminate the problem of sensor monitoring performance degradation due to the loss of some information caused by the reduction of sampling frequency. Based on this, how to effectively improve the performance of pet behavior recognition models based on low sampling frequency data has become an urgent problem to be solved in this field. . Summary of the invention
[0006] In view of the problem of sensor monitoring performance degradation caused by low sampling frequency in existing pet behavior automatic recognition technology, the present invention discloses a pet behavior recognition technology based on information recovery to achieve the goal of maintaining high monitoring performance of the sensor at a low sampling frequency.
[0007] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0008] The pet behavior recognition method based on information recovery comprises the following steps:
[0009] Step S1, using the data collected at a high sampling frequency to train the teacher classification network and the reconstruction network;
[0010] Step S2: using the trained teacher network to guide the training of the student classification network;
[0011] Step S3: input the data collected at a low sampling frequency into the trained student network for pet behavior recognition.
[0012] Preferably, in step S1, the high sampling frequency is a frequency greater than 20 Hz; and in step S3, the low sampling frequency is a frequency less than 20 Hz.
[0013] Preferably, step S1, using data obtained at a high sampling frequency to train the teacher network, is as follows:
[0014] S1.1. Training a convolutional neural network-based teacher classification network
[0015] The network consists of convolutional and pooling layers for feature extraction and fully connected layers for final classification.
[0016] S1.1.1. Given a high-sampling frequency instance of animal behavior of type C (x high ,y) is used as the input for training the network. high is the image converted from the sensor signal, y is a one-hot encoding;
[0017] S1.1.2. x high Input classification network T, generate a logarithm Z T , then Z T Substitute into the softmax function to calculate the posterior probability of each type of activity
[0018]
[0019] Among them, e is a natural constant, and its value is approximately 2.718281828459045, is the logarithmic value of class C;
[0020] S1.1.3. To reduce the classification error of all training samples in X, choose to minimize the cross entropy loss between the posterior probability and the original one-hot encoding
[0021]
[0022] Where y=[y 1 ,y 2 ,…,y C ],y C is the one-hot encoding for animal behavior of type C; Under the supervision of , the teacher classification network can capture the motion patterns of different activities and perform accurate classification.
[0023] After training the teacher classification network, its feature extractor is used to continue training the teacher reconstruction network.
[0024] S1.2. Training a teacher reconstruction network based on the trained teacher classification network
[0025] The reconstruction network consists of multiple transposed convolutional layers, where the feature size change is prescribed to be symmetric with that in the teacher feed-forward feature extractor in order to produce images of the same size as the original teacher input.
[0026] S1.2.1. x high Input the above trained teacher feature extractor with fixed parameters to obtain the feature vector e T .
[0027] S1.2.2. The feature vector e T Input the reconstruction network R to generate the reconstructed image R(e T ).
[0028] S1.2.3, minimize the reconstructed image R(e T ) and the input image x high The reconstruction loss between To obtain a reconstruction network R with good information reconstruction ability, It can be expressed as:
[0029]
[0030] in, represents the mean square error loss function.
[0031] Preferably, step S2, using the trained teacher network to guide the training of the student classification network. Under the guidance of the above-mentioned trained teacher network, this step aims to train a reliable student classification network using low sampling frequency data. Specifically as follows:
[0032] S2.1, by the corresponding high sampling frequency instances (x high ,y) are downsampled in turn to obtain instances (x low ,y),x low It is an image converted from a sensor signal at a low sampling frequency, and a low sampling frequency training dataset X′ is constructed. Among them, the high sampling frequency instance and the low sampling frequency instance have the same class label, and the student classification network has the same architecture as the teacher classification network.
[0033] S2.2, x low Input the student classification network S and get the logarithm z S , and then use the softmax function to get the posterior probability of each category
[0034]
[0035] S2.3. Basic training is achieved by maximizing the predicted probability of the corresponding category activity, that is, minimizing the posterior probability of all training samples in X′ The cross entropy loss between the one-hot encoding y
[0036]
[0037] However, due to the loss of key information, the classification network cannot extract comprehensive and sufficiently discriminative features from low sampling frequency data, so relying solely on low sampling frequency data to train the classification network often leads to poor model performance. Compared with a single classification network, adding an image reconstruction branch based on the extracted representation vector helps the network generate more complete and discriminative features. Therefore, the present invention designs an IR module based on a reconstruction network to extract more complete and discriminative behavioral features, as follows.
[0038] S2.4. Design IR module
[0039] S2.4.1. x low Input the student classification network S and get the feature vector e s .
[0040] S2.4.2. s Input the trained teacher reconstruction network R with fixed parameters to generate the reconstructed image R(e s ), and through the IR loss function Make the reconstructed image close to image x high :
[0041]
[0042] Since there are inherent correlations along the time points and sensor axes in the behavior samples, in the above loss function Under the constraint of , the student classification network S can utilize the existing information in the low-sampling frequency data to improve the missing details in the extracted features.
[0043] Considering the importance of the inherent correlations in behavioral samples for recovering missing information, we further design an ID module that can force the features of the student network to mimic the correlations built into the features of the teacher network along both the temporal and sensor axes.
[0044] S2.5. Design ID module
[0045] S2.5.1, when the image x low When inputting the student classification network S, the features of different layers are collected L represents the number of layers. At the same time, the corresponding high sampling frequency image x high Input the trained teacher classification network T to obtain its characteristics Note that the parameters of the network T remain unchanged during this training process.
[0046] S2.5.2. Use the paired (teacher-student) features of each layer to calculate the ID loss of the corresponding layer
[0047] The calculation process of the information recovery loss of the first layer in the ID module is:
[0048] In this step, the feature map and The dimensions of are the same as c×a×t, where c is the number of channels, a and t refer to the axis dimension and time dimension respectively. and are input into the Temporal Correlation Distillation (TCD) branch and the Axis Correlation Distillation (ACD) branch to calculate the ID module loss
[0049] In the TCD branch, first and Reshaped into two 2D feature maps of size t×ac, where each vector of length ac is considered as a feature along the time dimension. Then, matrix multiplication is performed on each 2D feature map and its corresponding transpose to generate the teacher and student temporal correlation matrices, respectively. and Then, each horizontal vector of these two matrices is L2 normalized. In order to force the student network feature map to mimic the temporal correlation in the teacher network feature map, the TCD loss is defined right The negative cosine similarity between the normalized vectors u and v is penalized:
[0050]
[0051] In the ACD branch, the inter-axis correlations within the feature maps are transferred from the teacher network to the student network. and Reshape into two 2D feature maps of size a×tc, and then generate two axis-to-axis correlation matrices by matrix multiplication and Then use and The normalized vector in is used to calculate the ACD loss by a similar operation as in the TCD branch (Equation 7).
[0052] The loss of layer l It is the combination of the loss functions of the TCD branch and the ACD branch. Since the temporal correlation and inter-axis correlation are contained in the intermediate features of each network layer, the total ID loss for all L layers is Penalization is performed to achieve relevance distillation from the teacher to the student feature map:
[0053]
[0054] At loss Under the constraint of , the ID module forces the student feature map to mimic the temporal and inter-axis correlations hidden in the teacher feature map across network layers. Finally, according to the obtained classification loss IR loss and ID loss The loss function is obtained by using linear combination Realize the optimization of student classification network S.
[0055] in, It is expressed as:
[0056]
[0057] Among them, λ 1 and λ 2 Yes Control and The weight coefficient of the effect.
[0058] Through the loss in formula (10), the behavior recognition technology based on information recovery proposed by the present invention can make full use of the information obtained from high sampling frequency data to help recover the missing information in low sampling frequency data, thereby improving the performance of the student classification network. In practical applications, the enhanced student network can be directly used to use low sampling frequency data to infer different categories of pet behavior activities, thereby achieving high energy efficiency pet behavior recognition.
[0059] In the above preferred solution, the present invention designs two modules (i.e., IR module and ID module) in step S2 to help the student network trained with low sampling frequency data to recover and enhance lost information. This process can achieve the function of making the extracted features more complete and more distinguishable, thereby improving the monitoring performance of the sensor.
[0060] Preferably, in step S3, the data collected at a low sampling frequency is input into a trained student network to predict pet behavior.
[0061] In practical applications, wearable sensors are first used to collect pet behavior data at a low sampling frequency. Then, the collected low sampling frequency data is processed using the student classification network improved by the present invention to further monitor the pet's behavior and evaluate its health status.
[0062] The present invention also discloses a pet behavior recognition system based on information recovery, based on the above method, comprising the following modules:
[0063] Teacher network training module: uses data collected at a high sampling frequency to train the teacher classification network and reconstruction network;
[0064] Student classification network training module: Use the trained teacher network to guide the training of the student classification network;
[0065] Pet behavior recognition module: The data collected at a low sampling frequency is input into the trained student network for pet behavior recognition.
[0066] The present invention has the following technical effects:
[0067] 1. The present invention proposes a behavior recognition technology based on information recovery, which utilizes the information in high sampling frequency data to make up for the information loss in the feature extraction process of the classification network trained under low sampling frequency data, thereby achieving the purpose of enhancing the sensor monitoring performance under low sampling frequency.
[0068] 2. The preferred embodiment of the present invention designs an information reconstruction (IR) module, which reconstructs features with the help of a pre-trained teacher reconstruction network to generate an image similar to the high sampling frequency input, thereby achieving the purpose of promoting the student network to extract more comprehensive features.
[0069] 3. The preferred embodiment of the present invention designs an information distillation (ID) module, whose function is to promote the model to recover lost information by prompting the characteristics of the student network to imitate the internal correlation of the trained teacher classification network characteristics along the time axis and the sensor axis. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 It is a flow chart of a pet behavior recognition method based on information recovery according to a preferred embodiment of the present invention.
[0071] Figure 2 It is a flow chart of teacher network training in a preferred embodiment.
[0072] Figure 3 It is a flow chart of student classification network training in a preferred embodiment.
[0073] Figure 4 It is a block diagram of a pet behavior recognition system based on information recovery according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0074] The preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0075] like Figure 1 As shown, this embodiment discloses a pet behavior recognition method based on information recovery, which includes the following steps:
[0076] Step S1, using data collected at a high sampling frequency (greater than 20 Hz) to train the teacher classification network and the reconstruction network;
[0077] Step S2: using the trained teacher network to guide the training of the student classification network;
[0078] Step S3: input the data collected at a low sampling frequency (less than 20 Hz) into the trained student network for pet behavior recognition.
[0079] In this embodiment, step S1, using data obtained at a high sampling frequency to train the teacher network, is as follows:
[0080] S1.1. Training a convolutional neural network-based teacher classification network
[0081] The network consists of convolutional and pooling layers for feature extraction and fully connected layers for final classification.
[0082] S1.1.1. Given a high-sampling frequency instance of animal behavior of type C (x high ,y) is used as the input for training the network. high is the image converted from the sensor signal, y is a one-hot encoding;
[0083] S1.1.2. x high Input classification network T, generate a logarithm z T , then z T Substitute into the softmax function to calculate the posterior probability of each type of activity
[0084]
[0085] Among them, e is a natural constant, and its value is approximately 2.718281828459045, is the logarithmic value of class C;
[0086] S1.1.3. To reduce the classification error of all training samples in X, choose to minimize the cross entropy loss between the posterior probability and the original one-hot encoding
[0087]
[0088] Where y=[y 1 ,y 2 ,…,y C ],y C is the one-hot encoding for animal behavior of type C; Under the supervision of , the teacher classification network can capture the motion patterns of different activities and perform accurate classification.
[0089] After training the teacher classification network, its feature extractor is used to continue training the teacher reconstruction network.
[0090] S1.2. Training a teacher reconstruction network based on the trained teacher classification network
[0091] The reconstruction network consists of multiple transposed convolutional layers, where the feature size change is prescribed to be symmetric with that in the teacher feed-forward feature extractor in order to produce images of the same size as the original teacher input.
[0092] S1.2.1. x high Input the above trained teacher feature extractor with fixed parameters to obtain the feature vector e T .
[0093] S1.2.2. The feature vector e T Input the reconstruction network R to generate the reconstructed image R(e T ).
[0094] S1.2.3, minimize the reconstructed image R(e T ) and the input image x high The reconstruction loss between To obtain a reconstruction network R with good information reconstruction ability, It can be expressed as:
[0095]
[0096] in, represents the mean square error loss function.
[0097] Figure 2 The overall training process of the teacher network is shown.
[0098] In this embodiment, step S2 uses the trained teacher network to guide the training of the student classification network. Under the guidance of the trained teacher network, this step aims to train a reliable student classification network using low sampling frequency data. The details are as follows:
[0099] S2.1, by the corresponding high sampling frequency instances (x high ,y) are downsampled in turn to obtain instances (x low ,y),x low It is an image converted from a sensor signal at a low sampling frequency, and a low sampling frequency training dataset X′ is constructed. Among them, the high sampling frequency instance and the low sampling frequency instance have the same class label, and the student classification network has the same architecture as the teacher classification network. Figure 3 The overall training architecture of the student classification network is shown.
[0100] S2.2, x low Input the student classification network S and get the logarithm zS , and then use the softmax function to get the posterior probability of each category
[0101]
[0102] S2.3. Basic training is achieved by maximizing the predicted probability of the corresponding category activity, that is, minimizing the posterior probability of all training samples in X′ The cross entropy loss between the one-hot encoding y
[0103]
[0104] However, due to the loss of key information, the classification network cannot extract comprehensive and sufficiently discriminative features from low sampling frequency data, so relying solely on low sampling frequency data to train the classification network often leads to poor model performance. Compared with a single classification network, adding an image reconstruction branch based on the extracted representation vector helps the network generate more complete and discriminative features. [4] ([4]Shao R, Perera P, Yuen PC, et al. Open-set adversarial defense with clean-adversarial mutual learning[J]. International Journal of Computer Vision, 2022, 130(4): 1070-1087.) Therefore, an IR module based on a reconstruction network is designed to extract more complete and discriminative behavioral features, as follows.
[0105] S2.4. Design IR module
[0106] S2.4.1. x low Input the student classification network S and get the feature vector e S .
[0107] S2.4.2. S Input the trained teacher reconstruction network R with fixed parameters to generate the reconstructed image R(e S ), and through the IR loss function Make the reconstructed image close to image x high :
[0108]
[0109] Since there are inherent correlations along the time points and sensor axes in the behavior samples, in the above loss function Under the constraint of , the student classification network S can use the existing information in the low sampling frequency data to improve the missing details in the extracted features. [5,6,7] ([5]Casella E,Khamesi AR,Silvestri SA framework for therecognition of horse gaits through wearabledevices[J].Pervasive and MobileComputing,2020,67:101213.[6]Chakravarty P,Cozzi G,Ozgul A,et al.A novelbiomechanical approach for animal recognition behavior using accelerometers[J].Methods in Ecology and Evolution, 2019, 10 (6): 802-814. [7] Cornou C, Lundbye-Christensen S. Classifying sows' activity types from acceleration patterns: application of the multi-process Kalman filter [J]. Applied Animal BehaviorScience, 2008, 111 (3-4): 262-273.).
[0110] Considering the importance of the inherent correlations in behavior samples for recovering missing information, we further design an ID module, which can force the features of the student network to mimic the correlations built into the features of the teacher network along both the temporal and sensor axes.
[0111] S2.5. Design ID module
[0112] S2.5.1, when the image x low When inputting the student classification network S, the features of different layers are collected L represents the number of layers. At the same time, the corresponding high sampling frequency image x high Input the trained teacher classification network T to obtain its characteristics Note that the parameters of the network T remain unchanged during this training process.
[0113] S2.5.2. Use the paired (teacher-student) features of each layer to calculate the ID loss of the corresponding layer
[0114] The calculation process of the information recovery loss of the first layer in the ID module is:
[0115] In this step, the feature map and The dimensions of are the same as c×a×t, where c is the number of channels, a and t refer to the axis dimension and time dimension respectively. and are input into the Temporal Correlation Distillation (TCD) branch and the Axis Correlation Distillation (ACD) branch to calculate the ID module loss
[0116] In the TCD branch, first and Reshaped into two 2D feature maps of size t×ac, where each vector of length ac is considered as a feature along the time dimension. Then, matrix multiplication is performed on each 2D feature map and its corresponding transpose to generate the teacher and student temporal correlation matrices, respectively. and Then, each horizontal vector of these two matrices is L2 normalized. In order to force the student network feature map to mimic the temporal correlation in the teacher network feature map, the TCD loss is defined right The negative cosine similarity between the normalized vectors u and v is penalized:
[0117]
[0118] In the ACD branch, the inter-axis correlations within the feature maps are transferred from the teacher network to the student network. and Reshape into two 2D feature maps of size a×tc, and then generate two axis-to-axis correlation matrices by matrix multiplication and Then use and The normalized vector in is used to calculate the ACD loss by a similar operation as in the TCD branch (Equation 7).
[0119] The loss of layer l It is the combination of the loss functions of the TCD branch and the ACD branch. Since the temporal correlation and inter-axis correlation are contained in the intermediate features of each network layer, the total ID loss for all L layers is Penalization is performed to achieve relevance distillation from the teacher to the student feature map:
[0120]
[0121] At loss Under the constraint of , the ID module forces the student feature map to mimic the temporal and inter-axis correlations hidden in the teacher feature map across network layers. Finally, according to the obtained classification loss IR loss and ID loss The loss function is obtained by using linear combination Realize the optimization of student classification network S.
[0122] in, It is expressed as:
[0123]
[0124] Among them, λ 1 and λ 2 Yes Control and The weight coefficient of the effect.
[0125] Through the loss in formula (10), the behavior recognition technology based on information recovery proposed by the present invention can make full use of the information obtained from high sampling frequency data to help recover the missing information in low sampling frequency data, thereby improving the performance of the student classification network. In practical applications, the enhanced student network can be directly used to use low sampling frequency data to infer different categories of pet behavior activities, thereby achieving high energy efficiency pet behavior recognition.
[0126] In this embodiment, step S3, the data collected at a low sampling frequency is input into the trained student network to predict the pet behavior.
[0127] In practical applications, wearable sensors are first used to collect pet behavior data at a low sampling frequency. Then, the collected low sampling frequency data is processed using the student classification network improved by the present invention to further monitor the pet's behavior and evaluate its health status.
[0128] like Figure 4 As shown, this embodiment discloses a pet behavior recognition system based on information recovery, based on the above method embodiment, including the following modules:
[0129] Teacher network training module: uses data collected at high sampling frequency (greater than 20Hz) to train the teacher classification network and reconstruction network;
[0130] Student classification network training module: Use the trained teacher network to guide the training of the student classification network;
[0131] Pet behavior recognition module: The data collected at a low sampling frequency (less than 20 Hz) is input into the trained student network for pet behavior recognition.
[0132] For other contents of this embodiment, please refer to the above method embodiment.
[0133] The above are preferred embodiments of the present invention. Those skilled in the art may make several improvements and modifications without departing from the principles of the present invention. These improvements and modifications should also be considered as within the scope of protection of the present invention.
Claims
1. A pet behavior recognition method based on information recovery, characterized in that: The following steps are involved: S1, train the teacher classification network and reconstruction network using data collected at a high sampling frequency; S2, use the trained teacher network to guide the training of the student classification network; S3. Input the data collected at a low sampling frequency into the trained student network for pet behavior recognition.
2. The pet behavior recognition method based on information recovery as claimed in claim 1, characterized in that: Step S1 is specifically as follows: S1.
1. Train a teacher classification network based on a convolutional neural network as follows: S1.1.
1. Given a high-sampling frequency instance of animal behavior of type C (x high ,y) as the input for training the network; where x high is the image converted from the sensor signal, y is a one-hot encoding; S1.1.
2. x high Input classification network T, generate a logarithm z T , then z T Substitute into the softmax function to calculate the posterior probability of each type of activity Among them, e is a natural constant, is the logarithmic value of class C; S1.1.
3. Choose to minimize the cross entropy loss between the posterior probability and the original one-hot encoding Where y=[y1,y2,…,y C ],y C is the one-hot encoding for animal behavior of type C; Under the supervision of, the teacher classification network can capture the motion patterns of different activities and classify them; After training the teacher classification network, the teacher reconstruction network is trained using the feature extractor; S1.
2. Train the teacher reconstruction network based on the trained teacher classification network, as follows: S1.2.
1. x high Input the trained teacher feature extractor with fixed parameters to obtain the feature vector e T ; S1.2.
2. The feature vector e T Input the reconstruction network R to generate the reconstructed image R(e T ); S1.2.3, minimize the reconstructed image R(e T ) and the input image x high The reconstruction loss between To obtain the reconstruction network R, where It is expressed as: in, represents the mean square error loss function.
3. The pet behavior recognition method based on information recovery as claimed in claim 2, characterized in that: Step S2 is specifically as follows: S2.1, by sampling the high sampling frequency instances (x high ,y) are downsampled in turn to obtain instances (x low ,y),x low is an image converted from a sensor signal at a low sampling frequency, and a low sampling frequency training data set X′ is constructed; wherein the high sampling frequency instance and the low sampling frequency instance have the same class label, and the architecture of the student classification network is the same as that of the teacher classification network; S2.2, x low Input the student classification network S and get the logarithm z S , and then use the softmax function to get the posterior probability of each category S2.
3. Minimize the posterior probability of all training samples in X′ The cross entropy loss between the one-hot encoding y S2.4, design IR module to extract behavioral features; S2.
5. Design an ID module to force the features of the student network to mimic the correlations built into the features of the teacher network along the time and sensor axes.
4. The pet behavior recognition method based on information recovery as claimed in claim 3, characterized in that: Step S2.4 is as follows: S2.4.
1. x low Input the student classification network S and get the feature vector e S ; S2.4.
2. S Input the trained teacher reconstruction network R with fixed parameters to generate the reconstructed image R(e S ), and through the IR loss function Make the reconstructed image close to image x high :
5. The pet behavior recognition method based on information recovery as claimed in claim 4, characterized in that: Step S2.5 is as follows: S2.5.1, when the image x low When inputting the student classification network S, the features of different layers are collected L represents the number of layers; at the same time, the high sampling frequency image x high Input the trained teacher classification network T to obtain its characteristics The parameters of the network T remain unchanged during the training process; S2.5.
2. Use the paired features of each layer to calculate the ID loss of the corresponding layer 6. The pet behavior recognition method based on information recovery as claimed in claim 5, characterized in that: In step S2.5.2, in the ID module, the calculation process of the information recovery loss of the first layer is as follows: Feature Map and The dimensions of are the same as c×a×t, where c is the number of channels, a and t refer to the axis dimension and time dimension respectively; feature map and Both are input into the temporal correlation distillation TCD branch and the inter-axis correlation distillation ACD branch to calculate the ID module loss In the TCD branch, first and Reshape into two 2D feature maps of size t×ac, where each vector of length ac is regarded as a feature along the time dimension; then, matrix multiplication is performed on each 2D feature map and its corresponding transpose to generate the teacher and student temporal correlation matrices, respectively and Then, each horizontal vector of these two matrices is L2 normalized; TCD loss is defined right The negative cosine similarity between the normalized vectors u and v is penalized: In the ACD branch, the inter-axis correlations within the feature map are transferred from the teacher network to the student network; first, and Reshape into two 2D feature maps of size a×tc, and then generate two axis-to-axis correlation matrices by matrix multiplication and Then use and The normalized vector in is used to calculate the ACD loss through a similar operation as in the TCD branch as shown in Equation 7: The loss of layer l It is the loss function combination of TCD branch and ACD branch; the total ID loss of all L layers Penalization is performed to achieve relevance distillation from the teacher to the student feature map: At loss Under the constraint of , the ID module forces the student feature map to mimic the temporal and inter-axis correlations hidden in the teacher feature map across network layers; finally, according to the obtained classification loss IR loss and ID loss The loss function is obtained by using linear combination To achieve the optimization of the student classification network S; It is expressed as: Among them, λ1 and λ2 are control and The weight coefficient of the effect.
7. A pet behavior recognition system based on information recovery, based on the method according to any one of claims 1 to 6, characterized in that Includes the following modules: Teacher network training module: uses data collected at a high sampling frequency to train the teacher classification network and reconstruction network; Student network training module: Use the trained teacher network to guide the training of the student classification network; Pet behavior recognition module: The data collected at a low sampling frequency is input into the trained student network for pet behavior recognition.
