Cross-species animal behavior identification method and system based on motion sensor
Through the combination of multi-species data set joint training and the dual-channel feature decoupling module and species batch normalization module, the problems of insufficient generalization ability and insufficient data sample size of cross-species animal behavior recognition technology are solved, and efficient feature extraction and behavior recognition performance is achieved.
Patent Information
- Application Number
- CN202510687849.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing animal behavior recognition technology based on deep learning and motion sensors is insufficient in generalization capabilities in cross-species scenarios, and due to insufficient data sample size, insufficient feature expression capabilities and poor generalization performance.
Using a joint training strategy of multi-species data sets, the dual-channel feature decoupling module and the species-based batch normalization module are used to achieve efficient capture of common behavioral characteristics across species and accurate acquisition of species-specific motion characterization, alleviating the problem of domain invariance-specific equilibrium and the problem of model convergence caused by heterogeneity of data distribution across species.
It significantly improved the cross-species generalization ability of animal behavior monitoring models, overcome the problem of insufficient sample size of a single species, and achieved more efficient feature extraction and behavior recognition performance.
Smart Images

Figure CN120217166A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of animal behavior detection, and particularly relates to a cross-species animal behavior recognition method and system based on motion sensors. Background Art
[0002] Automated animal activity recognition (AAR) technology based on motion sensors has become an important support for the development of intelligent animal husbandry. By remotely monitoring animal behavior changes, the workload of veterinarians can be significantly reduced, and at the same time, the efficiency of ranch management can be improved. In practical applications, motion sensors are often embedded in intelligent collars, ear tags or leg devices (such as Whistle Fit, Ceres Tags) worn by animals to collect multi-dimensional motion data such as acceleration and angular velocity in real time. Subsequently, through intelligent computing technology, daily behaviors of animals such as walking, running, ruminating, lying down, etc. can be recognized, and abnormal states of animals such as lameness and estrus can be detected.
[0003] Currently, deep learning dominates the task of animal behavior recognition assisted by motion sensors. This is because it has excellent feature extraction capabilities and shows good performance in distinguishing animal behaviors in various scenarios. For example, a research team studied the application of a multilayer perceptron (MLP) in cattle behavior recognition in 2021. Compared with several machine learning methods such as the traditional support vector machine (SVM), its accuracy reached 93.4%. Subsequently, the MLP model they developed was used for further research and showed promising excellent results under different experimental conditions. In addition, the convolutional neural network (CNN), as the most commonly used method in animal behavior recognition tasks, has an accuracy that can exceed 90%. This is mainly attributed to the ability of CNN to capture local temporal dependencies and exhibit scale invariance. In addition, the latest research has also explored hybrid models based on the combination of CNN and recurrent neural network (RNN) for animal behavior classification. Research shows that these hybrid models often show more ideal performance compared to single CNN and RNN models.
[0004] Although the above methods have achieved excellent performance in animal behavior recognition tasks, they still face many challenges in actual training and deployment. First, most of the existing algorithms are built based on training sets of a single species, resulting in a significant decline in the generalization ability of the model in cross-species scenarios; moreover, for different species, the model needs to be repeatedly designed and trained, which is not only time-consuming and laborious, but also severely limits the scalability of the algorithm in practical applications. Second, for deep learning models to achieve high-performance behavior recognition, they usually rely on large-scale labeled data. However, in practice, data acquisition is difficult and the labeling cost is high, making the models built based on limited single-species data sets have problems of insufficient feature expression ability and poor generalization performance.
[0005] In summary, the existing animal behavior recognition technologies based on deep learning and motion sensors still face the following problems in actual training and deployment: (1) Insufficient cross-species generalization: Most of the existing algorithm frameworks are built based on single-species training sets. Due to the significant heterogeneity of motion features (such as behavior modalities and motion laws) between different species, the model parameter space mismatches the target domain distribution, resulting in a significant decline in cross-species generalization ability.
[0006] (2) Insufficient data sample size: Deep learning relies on large-scale labeled data. However, in practice, data acquisition is relatively difficult, and the cost of relying on expert annotation is too high, making the traditional modeling methods based on limited single-species data sets have insufficient feature expression ability and poor generalization performance, and it is difficult to achieve cross-scenario migration.
[0007] To solve the above problems and considering that there may be common features in the behavior patterns of different species, the present invention proposes a cross-species animal behavior recognition method and system based on motion sensors. Summary of the Invention
[0008] To solve the above problems existing in the prior art, the present invention proposes a cross-species animal behavior recognition method and system based on motion sensors, which adopts a joint training strategy for multi-species data sets and effectively overcomes the limitation of insufficient single-species sample size by integrating the behavior feature information of different species. The core innovation of the present invention is to solve the domain invariance-specificity balance problem in cross-species behavior representation learning through a dual mechanism: on the one hand, a dual-channel feature decoupling module is constructed to provide a joint optimization mechanism for parameter sharing and specificity constraint, so as to achieve efficient capture of cross-species common behaviors and directional acquisition of unique motion features between species; on the other hand, a species-specific batch normalization module is established to alleviate the covariate shift problem caused by the heterogeneity of cross-species data distributions by independently fitting the data distributions of each species. This dual representation learning mechanism breaks through the generalization bottleneck of traditional models and significantly improves the practical applicability of behavior monitoring models.
[0009] To achieve the above technical objectives, the present invention adopts the following technical solutions: Method for identifying cross-species animal behaviors based on motion sensors, comprising the following steps: Step S1, data preprocessing stage: Through the nearest neighbor interpolation technique, unify the data dimensions of sensor data from different species in the case of inconsistent sampling frequencies; Step S2, feature extraction stage: Adopt a feature extraction method based on convolutional operations to simultaneously obtain shared and unique behavioral features among different species. This method involves two core modules: a dual-channel feature decoupling module and a species-specific batch normalization module; Step S3, behavior classification stage: Achieve animal behavior recognition through a species-specific classifier.
[0010] Preferably, in step S1, unify the data dimensions from different species through the nearest neighbor interpolation technique, specifically as follows: S1.1, set the data dimensions corresponding to the sampling frequency.
[0011] S1.2, adopt the nearest neighbor interpolation technique to uniformly map the dimensions of multi-species input data to the preset dimension size in step S1.1.
[0012] S1.3, perform feature extraction on the unified data.
[0013] Preferably, in step S2, adopt the proposed feature extraction method to simultaneously obtain shared and unique behavioral features among different species, specifically as follows: The proposed feature extraction method includes two core modules: a dual-channel feature decoupling module and a species-specific batch normalization module.
[0014] The dual-channel feature decoupling module is specifically as follows: The dual-channel feature decoupling module proposed in this embodiment has a dual-branch structure: Branch one uses a shared-full rank convolutional layer to capture the common features among species, and branch two assigns a specific unique-low rank convolutional layer for each species to obtain the specific behavioral features of each species. As Figure 2 shown.
[0015] Suppose there are species participating in the framework construction, represents the feature of species in a certain network layer, , , respectively represent the number of channels, height, and width of the feature, ; subsequently, input the feature into branch one, and branch one is a shared-full rank convolutional layer including convolution kernels, used to learn the common features among species; Meanwhile, input the feature Input to Branch 2. Branch 2 is a unique-low-rank convolutional layer shared by multiple species, used to obtain personalized features of the species. , 、 、 respectively represent the number of channels, height, and width of the feature ; The operation of the unique-low-rank convolutional layer is expressed as: (1); Among them, represents the parameter value of the unique-low-rank convolutional layer corresponding to the species , represents a matrix with a dimension of , represents reshaping the dimension of the matrix to ; The matrix is initialized with random values conforming to the Gaussian distribution , where is the variance, and the matrix is initialized to zero. This means that is initialized to zero during training. It should be noted that the method proposed in the present invention simultaneously trains the shared and species-specific convolutional parameters from scratch.
[0016] The species-specific batch normalization module is as follows: The species-specific batch normalization module assigns independent batch normalization layers to each species, and these layers are located after the two branches or the fully connected layer of the dual-channel feature decoupling module. As shown in Figure 3 .
[0017] First, the module configures independent batch normalization layers for each animal species, and each layer is equipped with its own trainable parameters , where and respectively represent the moving mean and moving variance.
[0018] Second, let represent the feature of the th sample of a specific channel of a certain network layer in the training batch of the species , where is the size of the training batch, and the corresponding output is expressed as: (2); Among them, , where represents the corresponding normalized feature, represents the expected value, represents variance, represents the minimum constant. These global statistics learned during the training phase , namely the moving mean and moving variance, will be used for normalizing the features corresponding to the same species during the test phase .
[0019] In the above preferred solution, the present invention designs two modules in step S2, namely the dual-channel feature decoupling module and the species-specific batch normalization module, enabling the cross-species animal behavior monitoring method based on motion sensors to learn cross-species common and specific behavior features, alleviating the model convergence problem caused by the heterogeneity of cross-species data distributions. At the same time, by adopting the joint training strategy of multi-species datasets, the defect of insufficient single-species sample size is effectively overcome.
[0020] Preferably, in step S3, the final behavior recognition is achieved through a species-specific classifier, as Figure 1 shown. This species-specific classifier configures independent classifiers for each animal species to classify diverse animal behaviors. Specifically, the extracted behavior features are input into the species-specific classifier according to the species category labels , which altogether contains classifiers designed with independent parameters. Each classifier corresponds to a single different species and consists of a fully connected layer. The output logical value can be expressed as , and through the softmax function, the probability that the sample belongs to the corresponding species for each behavior category can be obtained , where , represents the total number of behavior categories contained in species , represents the probability value that the sample belongs to the th behavior category in species . The category with the largest probability value is the final recognition result of the model; , respectively represent the logical values obtained after the th sample and the th sample of species pass through the classifier .
[0021] The present invention also discloses a cross-species animal behavior recognition system based on motion sensors for executing the above method, including the following modules: Data preprocessing module: Through the nearest neighbor interpolation technique, unify the data dimensions of sensor data from different species at different sampling frequencies; Feature extraction module: A feature extraction method based on convolutional operations is used to obtain the shared and unique behavioral features among different species; the feature extraction method involves a dual-channel feature decoupling module and a species-specific batch normalization module; Behavior classification module: The recognition of animal behaviors is realized through species-specific classifiers.
[0022] A cross-species animal behavior recognition method and system based on motion sensors provided by the present invention realizes the efficient extraction of cross-species common behavioral features and the accurate capture of species-specific motion representations, and at the same time alleviates the covariate shift problem caused by the heterogeneity of cross-species data distributions. Description of the drawings
[0023] Figure 1 It is a flowchart of a cross-species animal behavior recognition method based on motion sensors according to a preferred embodiment of the present invention; Figure 2 It is a dual-channel feature decoupling module according to a preferred embodiment of the present invention; Figure 3 It is a species-specific batch normalization module according to a preferred embodiment of the present invention; Figure 4 It is a comparison result diagram of the present invention and a baseline framework on horse (a), sheep (b), and cattle (c) datasets; Figure 5 It is a comparison result diagram of the confusion matrices of the baseline framework (a) and the present invention (b) on horse, sheep, and cattle datasets; Figure 6 It is a comparison diagram of the accuracies of the model on the training set and the validation set of three different animal species under the conditions of not containing the dual-channel feature decoupling module and the species-specific batch normalization module (a) and containing the dual-channel feature decoupling module and the species-specific batch normalization module (b); Figure 7 It is a comparison diagram of the classification performances of the baseline framework and the method proposed by the present invention under different data scales (100%, 75%, 50%, 25%, and 10%); Figure 8 It is a block diagram of a cross-species animal behavior recognition system based on motion sensors according to a preferred embodiment of the present invention. Detailed implementation manners
[0024] The following will make a detailed description of the preferred embodiments of the present invention in conjunction with the drawings.
[0025] In the process of animal behavior monitoring in the prior art, the following two technical problems are inevitably faced: (1) The balance problem between domain invariance and specific features in behavioral representation learning When constructing a cross-species animal behavior monitoring system, it is necessary to meet the representational requirements in two aspects: both extracting domain-invariant behavioral features shared by different species and retaining the species-specific motion representational differences. Traditional models constructed based on single-species data cannot handle this pair of conflicting requirements, resulting in the loss of key discriminative features or the introduction of species-specific interference in cross-species scenarios.
[0026] (2) The problem of model convergence caused by the heterogeneity of cross-species data distributions Different species have significant distribution differences in terms of behavior patterns, motion amplitudes, etc. Direct joint training will lead to difficult model convergence due to covariate shift. Traditional standardization methods such as batch normalization will destroy the unique data distribution laws of each species when mixing multi-species data, seriously weakening the feature discriminative ability of the model.
[0027] Aiming at the two major problems faced by the prior art, namely, the balance problem between domain invariance and specific features in behavioral representation learning and the problem of model convergence caused by the heterogeneity of cross-species data distributions, this embodiment proposes a cross-species animal behavior recognition method based on motion sensors, which realizes the efficient extraction of cross-species common behavioral features and the accurate capture of species-specific motion representations, while alleviating the covariate shift problem caused by the heterogeneity of cross-species data distributions. Specifically, as Figures 1 to 3 shown, this embodiment discloses a cross-species animal behavior recognition method based on motion sensors, which includes the following steps: Step S1, data preprocessing stage: Through the nearest neighbor interpolation technique, unify the data dimensions of sensor data from different species in the case of inconsistent sampling frequencies; in this step: S1.1, Combine literature research and empirical analysis to set the data dimensions corresponding to the optimal sampling frequency.
[0028] S1.2, Use the nearest neighbor interpolation technique to uniformly map the dimensions of multi-species input data to the dimension size preset in step S1.1.
[0029] S1.3, Input the unified data into a monitoring model based on a convolutional neural network for further feature extraction.
[0030] Step S2, feature extraction stage: The present invention improves and optimizes the existing animal behavior recognition model to obtain a new feature extraction network for simultaneously obtaining the shared and unique behavioral features among different species. This feature extraction network mainly includes a convolutional layer, a batch normalization layer, a max pooling layer, a global average pooling layer, and a fully connected layer. Among them, the present invention improves the convolutional layer and the batch normalization layer to obtain two core modules: a dual-channel feature decoupling module and a species-specific batch normalization module. Specifically: See Figure 2, Dual-channel Feature Decoupling Module: The dual-channel feature decoupling module proposed in this embodiment has a dual-branch structure: Branch 1 uses a shared-full rank convolutional layer to capture the common features among species, and Branch 2 assigns a specific unique-low rank convolutional layer to each species to obtain the unique behavioral features of each species.
[0031] Suppose there are species participating in the framework construction. denotes the feature of species at a certain network layer. , , respectively represent the number of channels, height, and width of the feature. ; Subsequently, the feature is input into Branch 1, which is a shared-full rank convolutional layer including convolution kernels, used to learn the common features among species; Meanwhile, the feature is input into Branch 2, which is a unique-low rank convolutional layer unique to each of the multiple species, used to obtain the personalized features of the species , , , respectively represent the number of channels, height, and width of the feature ; The operation of the unique-low rank convolutional layer is expressed as: (3); Among them, denotes the parameter value of the unique-low rank convolutional layer corresponding to species , denotes a matrix with a dimension of , denotes reshaping the dimension of matrix to ; Matrix is initialized with random values conforming to the Gaussian distribution , where is the variance, and matrix is initialized to zero. This means that is initialized to zero during training. It should be noted that the method proposed in the present invention trains the shared and species-specific convolutional parameters simultaneously from scratch.
[0032] See Figure 3 , Species-specific Batch Normalization Module: The species-specific batch normalization module assigns independent batch normalization layers to each species, and these layers are located after the two branches or fully connected layers of the dual-channel feature decoupling module.
[0033] The per-species batch normalization module configures independent batch normalization layers for each animal species, and each layer is equipped with trainable parameters corresponding to each species corresponding to each species , where and represent the moving average and moving variance respectively; Let represent the feature of the th sample in a specific channel of a certain network layer in the training batch for species , where is the size of the training batch, and the corresponding output is expressed as: (4); Among them, , where represents the corresponding normalized feature, represents the expected value, represents the variance, represents the minimum constant. These global statistics learned during the training phase , that is, the moving average and moving variance, will be used to normalize the features corresponding to the same species during the test phase .
[0034] Step S3, behavior classification phase: Animal behavior recognition is achieved through a species-specific classifier
[0035] In this embodiment, a species-specific classifier based on a fully connected layer is introduced after feature extraction. This module adopts an independent parameterized design corresponding to different species, aiming to achieve accurate diverse behavior classification, as shown in Figure 1 . The extracted behavior features are input into the species-specific classifier according to the species category label , which contains a total of classifiers with independent parameter designs. Each classifier corresponds to a single different species and consists of a fully connected layer. The output logical value can be expressed as . Through the softmax function, the probability that this sample belongs to each behavior category of the corresponding species can be obtained, where , , represents the total number of behavior categories included in species , represents the probability that this sample belongs to the rd behavior category in species . The category with the largest probability value is the final recognition result of the model; , respectively represent species the th sample and the logical values obtained after the classifier
[0036] The following further illustrates the remarkable technical effects of the present invention in combination with experiments.
[0037] 1. Experimental Data and Settings 1.1 Experimental Data This experiment uses three publicly available datasets in the prior art for evaluation. The specific details are summarized in Table 1.
[0038] Horse Dataset: The horse dataset contains 87,621 two - second samples, which are obtained from six horses through a neck - mounted inertial measurement unit at a sampling rate of 100 Hz. Based on existing horse behavior recognition research, this experiment considered five commonly used labeled behaviors, including eating, galloping, standing, trotting, and walking, with proportions of 18.31%, 4.50%, 5.84%, 28.62%, and 42.73% respectively. Among them, the present invention extracts the three - axis acceleration in the motion signal, and further makes the tensor shape of each two - second sample be 1×3×200.
[0039] Sheep Dataset: The sheep dataset contains 149,725 two - second samples, which are collected from nine sheep through a neck - mounted accelerometer at a sampling rate of 12.5 Hz. Five behaviors, including eating, walking, scratching, standing, and resting, are combined into three main unified behaviors, namely eating, active (including walking and scratching), and inactive (including standing and resting), with proportions of 19.74%, 15.53%, and 64.73% respectively. The tensor size of each sample is 1×3×25.
[0040] Cattle Dataset: The cattle dataset is collected from six different cattle through a neck - mounted accelerometer at a sampling rate of 25 Hz. Based on existing cattle behavior recognition research, the present invention considered five common cattle behaviors, including eating, rumination, resting, moving, and salt supplementation, with proportions of 6.10%, 19.32%, 54.25%, 16.29%, and 4.04% respectively. This dataset contains a total of 10,429 two - second data samples, and each sample consists of three - axis accelerometer data with a tensor structure of 1×3×50.
[0041] Table 1 Datasets Collected from Horses, Sheep, and Cattle
[0042] 1.2 Experimental Settings To ensure that the present invention does not introduce bias towards any single species during the model training process and to demonstrate the effectiveness of the method proposed by the present invention in data-constrained scenarios, in this experiment, the data was downsampled so that the training data volume for all species was equal to match the number of samples of the species with the least amount of data. These sampled data were then combined and used to train the model proposed by the present invention. During the training process, the number of samples of different species in each batch should be kept consistent. In this experiment, precision, recall, F1-score, and accuracy were used as evaluation metrics to measure the overall performance of the classification network. To verify the generalization ability of the method of the present invention, a stratified 5-fold cross-validation method was adopted, where three folds of samples were used for training, one fold for validation, and one fold for testing.
[0043] During the training process, in this experiment, L2 regularization with a weight decay of 0.06 was applied in the loss function to mitigate overfitting. The training used the Adam optimizer with an initial learning rate of 0.0001, and the learning rate was reduced to 0.1 times the original value every 20 training epochs. The training was conducted for 100 epochs with a batch size of 256. The model with the highest accuracy on the validation set was saved and evaluated on the test set to verify its performance. To evaluate the proposed monitoring framework, the present invention compared it with a baseline framework that adopted a single-species training mode, that is, each model was independently trained and evaluated using only the data of a single species. The baseline framework referred to the model architecture proposed in existing technical research, which had been verified effective in the task of identifying the behaviors of horses and goats. All tests were conducted on the NVIDIA GeForce RTX 2080 graphics processing unit using the PyTorch platform.
[0044] 2. Performance Comparison between the Present Invention and the Baseline Framework To verify the effectiveness of the method proposed by the present invention, it was experimentally compared with the baseline framework on three datasets of horses, sheep, and cows, and the results are shown in Figure 4Among them. The results show that the method proposed in the present invention presents better performance in different species classifications. The accuracy rates on the horse, sheep, and cattle datasets reach 96.44%, 92.89%, and 90.01% respectively, the F1 scores reach 96.02%, 86.79%, and 88.40% respectively, the precision rates reach 95.07%, 87.39%, and 85.76% respectively, and the recall rates reach 97.03%, 86.59%, and 91.60% respectively. Compared with the baseline framework, the accuracy rates of the present invention on the horse, sheep, and cattle datasets are increased by 6.04%, 2.06%, and 3.66% respectively, the F1 scores are increased by 10.33%, 3.67%, and 7.90% respectively, the precision rates are increased by 12.46%, 3.87%, and 8.96% respectively, and the recall rates are increased by 6.24%, 3.66%, and 4.03% respectively. This indicates that the present invention has good potential in using multi-species data to improve the behavior classification performance of each species.
[0045] Figure 5 The recall confusion matrices obtained by the framework proposed in the present invention and the baseline framework on the three species test sets were compared. The results show that, compared with the baseline framework, the present invention shows different degrees of improvement in almost all behavior categories. In particular, the recognition accuracy of various behaviors of horses can be increased to more than 95%, and the recognition accuracy of cattle behaviors reaches more than 90%. Although the classification accuracies of the feeding and active behaviors of sheep are still not satisfactory, the method of the present invention has increased these indicators by 6.68% and 4.18% respectively. It can be observed that the grazing and active behaviors of sheep are prone to misjudgment, which is consistent with the findings of existing researchers in the study of sheep behavior recognition. This misclassification phenomenon may stem from the similarity of the movement patterns shown by sheep in grazing and active behaviors. Therefore, exploring potential solutions to mitigate the impact of behavior pattern similarity on classification performance is a direction worthy of attention in future research.
[0046] 3. Ablation experiments 3.1. Evaluation of the dual-channel feature decoupling module and the species-specific batch normalization module In order to evaluate the contribution of the dual-channel feature decoupling module and the species-specific batch normalization module to the cross-species behavior recognition performance, a systematic ablation experiment was designed in this experiment. Specifically, in the method proposed in the present invention, four experimental configurations were constructed: (1) without the two modules; (2) only integrating the dual-channel feature decoupling module; (3) only integrating the species-specific batch normalization module; (4) simultaneously integrating the dual-channel feature decoupling module and the species-specific batch normalization module. The experimental results are shown in Table 2. The performance of directly adopting the cross-species feature extraction parameter sharing strategy (without any module) is the worst, which verifies that a simple parameter sharing mechanism is difficult to effectively adapt to the differences between species.
[0047] When the species-specific batch normalization module is used alone, the classification performance improves significantly with the increase in the degree of adaptation to species characteristics, fully demonstrating the importance of independent normalization for different data distributions. In the configuration where the dual-channel feature decoupling module and the species-specific batch normalization module are used jointly, the model achieves optimal performance. Specifically, the accuracy rates of the horse, sheep, and cattle datasets increase by 8.67%, 2.02%, and 11.64% respectively, the F1 scores increase significantly by 13.69%, 3.66%, and 19.79%, the precision rates increase by 15.84%, 3.93%, and 17.26% respectively, and the recall rates also increase by 7.13%, 3.74%, and 11.93%. These experimental results strongly support the core hypothesis of this study: by extracting common behavioral features through shared-full rank convolution and combining with unique-low rank convolutional layers to capture species-specific patterns, it is possible to effectively balance cross-species common learning and differential learning. It is worth noting that when only the dual-channel feature decoupling module is used without enabling the species-specific batch normalization module, the model performance deteriorates, which may be due to the forced sharing of the feature space without adapting to the species distribution, resulting in conflicts during the parameter learning process.
[0048] Table 2 Data table showing the impact of the dual-channel feature decoupling module and the species-specific batch normalization module on the performance of the method proposed in the present invention
[0049] Figure 6 Shows the training and validation accuracy curves of the frameworks without integration and with the simultaneous integration of the dual-channel feature decoupling module and the species-specific batch normalization module on three different species. Through comparative analysis, it can be found that when both modules are integrated simultaneously, compared with the configuration without using these modules, the convergence speed is faster and the training trajectory is smoother. This phenomenon indicates that the two newly proposed modules can effectively extract robust feature representations from multi-species data, alleviate data heterogeneity, and accelerate model convergence.
[0050] 3.2. Analysis of the dual-channel feature decoupling module 3.2.1. Analysis of the operation of the unique-low rank convolutional layer The unique-low rank convolutional layer adapts to species-specific feature extraction by introducing low-rank decomposition technology, effectively reducing the number of parameters while maintaining the model's expressive power. To verify its advantages, in this embodiment, the framework with the unique-low rank convolutional layer is compared with the version using the shared-full rank convolutional layer. The experimental results are shown in Table 3. Within the range of low-rank values (2 - 16), the framework integrating the unique-low rank convolutional layer shows significant performance advantages compared to the full-rank convolutional version, which strongly validates the effectiveness of the unique-low rank convolutional layer in enhancing the model's classification ability. In addition, the number of parameters of the unique-low rank convolutional layer is significantly less than that of the shared-full rank convolutional layer, highlighting its significant improvement in computational resource efficiency.
[0051] Table 3 Data table of the influence of different values on the performance of the dual-channel feature decoupling module in this framework
[0052] 3.2.2 Hyperparameter Analysis In the dual-channel feature decoupling module, hyperparameters are used to control the rank value of the exclusive-low-rank convolutional layer. To explore the influence of the value on the model performance, this experiment evaluated the framework performance when ∈ {2, 4, 8, 12, 16}. The experimental results are shown in Table 3. The analysis shows that when is 12, the cross-species animal behavior monitoring framework achieves the optimal performance in the behavior classification tasks of horses and cows, and all evaluation indicators reach their peaks; at the same time, it also maintains good recognition accuracy in the behavior classification of sheep. This finding not only confirms the significant impact of the low rank value on the model performance, but also provides an important reference for hyperparameter optimization: a moderate low rank constraint can achieve the best balance between model capacity and generalization ability, thereby effectively improving the cross-species behavior classification effect.
[0053] 4 Robustness Analysis of Changes in Dataset Size The present invention constructs a cross-species animal behavior recognition method by integrating multi-species motion signal datasets, aiming to capture a wider range of motion patterns among different species, and provides a potential solution to alleviate the performance degradation caused by insufficient sample size of a single species. To verify the classification ability of this method in scenarios with limited sample size, this embodiment compared the classification performance of the baseline framework and the framework proposed by the present invention at different ratios (i.e., 100%, 75%, 50%, 25%, and 10%) of the original dataset. The results are as Figure 7 shown. The framework proposed by the present invention shows significant stability in the behavior classification of horses and sheep, and as the dataset size decreases, its performance advantage over the baseline framework gradually expands. These findings indicate that the method of the present invention has good robustness and can effectively utilize the diversity of multi-species datasets, especially in scenarios with scarce data. It should be noted that in the behavior classification task of cows, when the dataset size is reduced from 100% to 25%, the method of the present invention shows a similar trend to the aforementioned species (horses and sheep). Although the performance drops significantly at a data ratio of 10%, it still continuously outperforms the baseline framework. This phenomenon may be attributed to the unique behavior patterns of cows, such as rumination and licking salt. When the sample size drops to a specific threshold, it is difficult to fully enhance the diversity of these specific behaviors even by aggregating multi-species data, thus limiting the performance improvement space.
[0054] As Figure 8 shown, this embodiment discloses a cross-species animal behavior recognition system based on motion sensors for performing the above method, including the following modules: Data preprocessing module: Through the nearest neighbor interpolation technique, unify the data dimensions of sensor data from different species at different sampling frequencies; Feature extraction module: Adopt a feature extraction method based on convolutional operations to obtain shared and unique behavioral features among different species; the feature extraction method involves a dual-channel feature decoupling module and a species-specific batch normalization module; Behavior classification module: Realize the recognition of animal behaviors through species-specific classifiers.
[0055] For other contents of this embodiment, reference can be made to the above method embodiment.
[0056] In summary, the present invention proposes a cross-species animal behavior recognition method and system based on motion sensors, which adopts a joint training strategy of multiple species datasets, aiming to improve the cross-species generalization ability of the behavior recognition model and overcome the limitation of insufficient single-species sample size.
[0057] Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification is only to illustrate the principle of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed.
Claims
1. A method for cross-species animal behavior recognition based on motion sensors, characterized in that It includes the following steps: Step S1: Unify the data dimensions of sensor data from different species at different sampling frequencies through the nearest neighbor interpolation technique; Step S2: Use a feature extraction method based on convolutional operations to obtain the shared and unique behavioral features among species; the feature extraction method involves a dual-channel feature decoupling module and a species-specific batch normalization module; Step S3: Implement the recognition of animal behaviors through a species-specific classifier.
2. The method for cross-species animal behavior recognition based on a motion sensor according to claim 1, wherein Step S1 is specifically as follows: S1.1: Set the data dimensions corresponding to the sampling frequency; S1.2: Use the nearest neighbor interpolation technique to uniformly map the dimensions of multi-species input data to the preset dimension size in Step S1.1; S1.3: Extract features from the unified data.
3. The method for cross-species animal behavior recognition based on a motion sensor according to claim 1, characterized in that, In Step S2: The dual-channel feature decoupling module has a dual-branch structure: Branch 1 uses a shared-full rank convolutional layer to capture the common features among species, and Branch 2 assigns a specific unique-low rank convolutional layer for each species to obtain the unique behavioral features of each species; The species-specific batch normalization module assigns an independent batch normalization layer for each species, and the batch normalization layer is located after the two branches or the fully connected layer of the dual-channel feature decoupling module.
4. The method for cross-species animal behavior recognition based on a motion sensor according to claim 3, wherein, The dual-channel feature decoupling module in Step S2 is specifically as follows: Suppose there are species participating in the framework construction, represents the characteristics of species in a certain network layer, , , respectively represent the number of channels, height, and width of this feature, ; Input the feature into Branch 1, which is a shared-full rank convolutional layer including a convolutional kernel and is used to learn the common features among species; meanwhile, input the feature into Branch 2, which is a unique-low rank convolutional layer specific to each of multiple species and is used to obtain the personalized features of the species , 、 、 represent the number of channels, height, and width of the feature respectively; the operation of the unique-low rank convolutional layer is expressed as: (1); Among them, represents a species corresponding to the parameter values of the exclusive-low rank convolutional layer, represents a matrix of dimension ; represents reshaping the dimension of the matrix to ; the matrix is initialized with random values conforming to the Gaussian distribution , where is the variance, and the matrix is initialized to zero.
5. The method for cross-species animal behavior recognition based on a motion sensor according to claim 4, wherein, The species-specific batch normalization module in Step S2 is specifically as follows: The per-species batch normalization module configures independent batch normalization layers for each animal species, and each layer is equipped with trainable parameters corresponding to each species corresponding to the species , where and respectively represent the moving mean and moving variance, which are used to normalize the features corresponding to the same species during the test phase corresponding to the species; Let represent the species of the th sample in a specific channel of a certain network layer in the training batch, where is the size of the training batch, and the corresponding output is expressed as: (2); Among them, , here represents the corresponding normalized feature, represents the expected value, represents the variance, represents the minimum constant.
6. The method for cross-species animal behavior recognition based on a motion sensor according to claim 4 or 5, characterized in that, Step S3 is specifically as follows: S3.
1. Input the extracted behavioral features into the species-specific classifier according to the species category label ; The species-specific classifier consists of a total of classifiers designed with independent parameters Each classifier corresponds to a single different species and consists of a fully connected layer. The output logical value is expressed as . By passing through the softmax function, the probabilities of the corresponding sample belonging to the corresponding species for each behavior category are obtained , where , represents the total number of behavior categories contained in species , represents the probability value that the sample belongs to the th behavior category in species . The category with the largest probability value is the final recognition result of the model; and respectively represent the logical values obtained after the th sample and the th sample of species pass through the classifier 7. A cross-species animal behavior recognition system based on motion sensors, for performing the method according to any one of claims 1-6, characterized in that, It includes the following modules: Data preprocessing module: Unify the data dimensions of sensor data from different species at different sampling frequencies through the nearest neighbor interpolation technique; Feature extraction module: Use a feature extraction method based on convolutional operations to obtain the shared and unique behavioral features among species; The feature extraction method involves a dual-channel feature decoupling module and a species-specific batch normalization module; Behavior classification module: Implement the recognition of animal behaviors through a species-specific classifier.
Citation Information
Patent Citations
Animal language conversion method and device, electronic equipment and storage medium
CN119943059A