An animal behavior recognition method and system based on wavelet packet decomposition and state space model
Patent Information
- Application Number
- CN202610735265.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2046-05-26
AI Technical Summary
然而,动物在奔跑、跳跃等剧烈运动时的关键纹理细节往往蕴含在高频分量中,高频信息的丢失直接限制了模型对复杂高动态行为的辨识度
[0054]本发明保护一种基于小波包分解和状态空间模型的动物行为识别方法及系统(AAR-WaveMamba)的整体架构。提出了一种新型轻量级框架,旨在将Mamba模块的高效状态空间建模与多尺度时频分析相协同,以实现精确且高效的动物行为识别。
Smart Images

Figure CN122262834B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of deep learning and wearable sensor signal processing technology, and in particular to an animal behavior recognition method and system based on wavelet packet decomposition and state space model. Background Technology
[0002] Existing behavior recognition methods typically perform indiscriminate stitching or averaging of the three-axis (X, Y, Z) data output from sensors, ignoring the spatial heterogeneity of different animal behaviors. This coarse-grained approach easily introduces noise from non-critical axes, interfering with model judgment. Traditional time-frequency analysis methods such as Discrete Wavelet Transform (DWT) usually assume that high-frequency components are noise and filter them out, only performing deep decomposition on low-frequency components. However, the key texture details of animals during vigorous movements such as running and jumping are often contained in high-frequency components, and the loss of high-frequency information directly limits the model's ability to recognize complex, highly dynamic behaviors. To capture the long-distance temporal dependencies of animal behavior, existing high-precision models (such as Transformer) typically employ self-attention mechanisms, but their computational complexity increases quadratically with the sequence length. This leads to excessive consumption of computing resources, making it difficult to deploy on resource-constrained edge devices; while lightweight models (such as CNNs) struggle to capture global context. Summary of the Invention
[0003] In view of this, the purpose of this invention is to provide an animal behavior recognition method and system based on wavelet packet decomposition and state space model, so as to achieve accurate and efficient animal behavior recognition.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: an animal behavior recognition method based on wavelet packet decomposition and state-space model, comprising the following steps:
[0005] Step S1, Sensor signal acquisition stage: Acquire the three-axis continuous motion signals of the sensor worn by the animal, and use a sliding window to segment the data stream to construct the original sensor signal input;
[0006] Step S2, Dimension-aware data augmentation stage: The dimension-aware data augmentation module DAE is used to perform axial adaptive enhancement and fusion of the sensor signal to generate the processed signal, so as to explicitly solve the directional heterogeneity problem of the three-axis signal;
[0007] Step S3, Multi-scale Time-Frequency Feature Adaptive Fusion Stage: The processed signal is subjected to wavelet packet decomposition (WPD) and Mamba module time-series modeling, and adaptive weighted fusion is performed through the feature routing module to generate fused multi-scale features;
[0008] Step S4, Feature Classifier Recognition Stage: Input the fused multi-scale features into the feature classifier and output the final animal behavior recognition result.
[0009] In a preferred embodiment, step S1 is specifically as follows:
[0010] Step S1.1: Obtain the multi-sensor directional motion dataset collected through the animal's neck collar, and downsample the original signal sampling frequency from 100Hz to 25Hz;
[0011] Step S1.2: Segment the continuous time series using a fixed sliding window of 2 seconds, with an overlap rate of 50% between windows, and construct the original sensor signal input matrix. ,in, Represents the real number field. For batch size, This represents the number of channels in the three-axis sensor, corresponding to the X-axis, Y-axis, and Z-axis respectively. L represents the length of the time series within a single sliding window; when the sampling frequency is 25Hz and the window length is 2s, L=50.
[0012] In a preferred embodiment, step S2 is specifically as follows:
[0013] Step S2.1, L2 pooling: Convert the original sensor signal... Perform L2 pooling along the time dimension to extract the energy description vector for each sensor's spatial axis. The calculation formula is as follows:
[0014] (1)
[0015] Among them, pool L2 ( () represents an L2 pooling operation, and t represents time. For batch size, Represents the number of channels in a triaxial sensor. The length of the time series. This represents the slice of the original sensor signal X at time step t, where the two colons ":" indicate that all batch samples and all sensor channels are selected, respectively.
[0016] Step S2.2: The multilayer perceptron and ReLU activation function convert the energy description vector... The input is a multilayer perceptron (MLP) with a bottleneck architecture, followed by a ReLU activation function in the hidden layer and a Sigmoid activation function at the output. Processing and dynamically calculating the attention weights for generating orientation awareness. :
[0017]
[0018] Step S2.3, Weighted Fusion: Combine the calculated attention weights The signal is then multiplied element-wise with the original sensor signal and added element-wise through the residual connection to generate the processed signal. This adaptively amplifies core dimensional features related to behavior while suppressing noise; the calculation formula is:
[0019] (3)
[0020] in, This indicates element-wise multiplication. This indicates element-wise addition.
[0021] In a preferred embodiment, step S3 is specifically as follows:
[0022] Step S3.1, WPD decomposition: Use the 3-level wavelet packet decomposition WPD to process the signal. Multi-resolution frequency analysis was performed to extract feature sequences of 15 multi-scale nodes from wavelet packet decomposition trees of levels 0 to 3, forming... Where B1 represents the first sub-band sequence, B2 represents the second sub-band sequence, and B... 15 This represents the 15th sub-band sequence;
[0023] Step S3.2, Mamba module time series modeling: For each sub-band sequence generated by WPD, configure parallel Mamba modules based on a selective state-space model to process them independently in order to extract the first... The characteristic sequence of each sub-band ;
[0024] Step S3.3, Feature Routing Module: To filter redundant frequency band features, the feature sequences output by each Mamba module are input into the feature routing module.
[0025] In a preferred embodiment, step S3.2 is specifically as follows:
[0026] Step S3.2.1: Map the input sub-band sequence to a one-dimensional input signal. Construct a continuous linear state-space model and hide the state. Map the input signal to the output response :
[0027] (4)
[0028] (5)
[0029] in, This represents the first derivative of the hidden state with respect to continuous time. The state evolution matrix is... This represents the input projection matrix in a continuous system. Represents the output projection matrix in a continuous system;
[0030] Step S3.2.2: For discrete input sequences A selective mechanism is introduced, which uses a linear layer to select based on the current input. Dynamically generate scale step size Input related projection matrix and output related projection matrix Subsequently, the continuous system is discretized using the zero-order preserve method, and the discrete state matrix is calculated. and :
[0031] (6)
[0032] (7)
[0033] Where I represents the identity matrix, and exp(·) represents the matrix exponential function;
[0034] Step S3.2.3: Using the discretized parameters, iteratively update the hidden state along the sequence dimension through selective scan operations. And calculate the output of the current time step. :
[0035] (8)
[0036] (9)
[0037] Thus, the first The characteristic sequence of each sub-band The corresponding feature dimension is , For batch size, For feature channel dimension, The sequence length of the sub-band.
[0038] In a preferred embodiment, step S3.3 is specifically as follows:
[0039] Step S3.3.1, L2 pooling: For each sub-band feature sequence across time and channel dimensions... Perform L2 pooling to quantize the characteristic energy of each sub-band. They are then concatenated into a unified 15-dimensional energy description vector. :
[0040] (10)
[0041] (11)
[0042] Among them, pool L2 ( () indicates an L2 pooling operation;
[0043] Step S3.3.2, Multilayer Perceptron and Sigmoid Activation Function: Transform the energy description vector... The data is processed sequentially through a Multilayer Perceptron (MLP) and a Sigmoid activation function, and adaptive route weights are generated through a dynamic routing mechanism. :
[0044] (12)
[0045] Step S3.3.3, Weighted Fusion: The generated route weight scalar... Feedback to the corresponding sub-band feature sequence Element-wise multiplication is performed, followed by element-wise addition using residual connections to generate fused multi-scale features. Effectively suppresses redundant frequency band information:
[0046] (13)
[0047] in, This indicates element-wise multiplication. This indicates element-wise addition.
[0048] In a preferred embodiment, step S4 is specifically as follows:
[0049] Step S4.1: The fused multi-scale features output by the feature routing module... Flatten it and input it into a feature classifier composed of multilayer perceptrons;
[0050] Step S4.2: The feature classifier maps high-dimensional features to the classification space, calculates the probability distribution of each category using Softmax, and outputs the final animal activity category recognition result.
[0051] In a preferred embodiment, the final animal activity category identification results include standing, running, eating, trotting, and walking.
[0052] This invention also provides an animal behavior recognition system based on wavelet packet decomposition and a state-space model, including a processor, a memory, and a bus. The memory stores machine-readable instructions executed by the processor. When the system is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the animal behavior recognition method based on wavelet packet decomposition and a state-space model is as described above.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] This invention protects the overall architecture of an animal behavior recognition method and system (AAR-WaveMamba) based on wavelet packet decomposition and state-space model. A novel lightweight framework is proposed, aiming to combine the efficient state-space modeling of the Mamba module with multi-scale time-frequency analysis to achieve accurate and efficient animal behavior recognition.
[0055] DAE Module and Orientation Heterogeneity Reduction Mechanism: Protects the Dimensional Aware Data Augmentation (DAE) mechanism deployed at the front end of the raw sensor signal processing. By dynamically adjusting the weights of each spatial axis, it explicitly addresses the orientation heterogeneity problem of the three-axis data, thereby effectively suppressing noise while enhancing the behavior-related dimensions.
[0056] The cascaded design of the MFF core collaborative architecture: This architecture protects the core of the Multi-Scale Feature Fusion (MFF) module. It unifies and integrates wavelet packet decomposition (WPD) with parallel Mamba model blocks to extract comprehensive full-band time-frequency feature representations, achieving joint computation of multi-resolution frequency analysis and high-efficiency time-series modeling.
[0057] Frequency band adaptive routing mechanism: This protects the adaptive feature routing mechanism integrated within the MFF module. By pooling and quantizing the feature energy of parallel sub-bands and generating dynamic routing weights, it can dynamically calibrate the importance of different frequency sub-bands, ensuring priority processing of highly identifiable feature patterns while effectively suppressing feature redundancy. Attached Figure Description
[0058] Figure 1 This is a flowchart of the overall AAR-WaveMamba method of the present invention, which is a preferred embodiment of the present invention.
[0059] Figure 2 This is a structural diagram of the dimension-aware data augmentation module according to a preferred embodiment of the present invention;
[0060] Figure 3 This is a structural diagram of the multi-scale feature fusion module according to a preferred embodiment of the present invention;
[0061] Figure 4This is a precision confusion matrix diagram of a preferred embodiment of the present invention;
[0062] Figure 5 This is a heat map of sensor axis weights according to a preferred embodiment of the present invention;
[0063] Figure 6 This is a frequency band weighting heatmap of a preferred embodiment of the present invention;
[0064] Figure 7 The image shows a comparison of wavelet decomposition t-SNE according to a preferred embodiment of the present invention; where (a) represents discrete wavelet transform and (b) represents wavelet packet decomposition.
[0065] Figure 8 The above is a comparison diagram of feature fusion t-SNE of a preferred embodiment of the present invention, wherein (a) represents the baseline, (b) represents no fusion, and (c) represents the present method; Detailed Implementation
[0066] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0067] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0068] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0069] This invention validates the proposed AAR-WaveMamba method using a publicly available multi-sensor directional motion dataset of goats. Considering the high kinematic similarity among different foraging behaviors, this invention merges "grazing" and "eating" into a unified "eating" category. The final dataset covers five main activities: standing (18,531 samples), running (373 samples), eating (15,179 samples), trotting (189 samples), and walking (8,671 samples).
[0070] To address the directional heterogeneity of triaxial motion signals and the redundant noise in high-dynamic behavioral features, this invention proposes an animal behavior recognition method based on wavelet packet decomposition and a state-space model. The overall system implementation process is as follows: Figure 1-3 As shown.
[0071] To achieve the above-mentioned technical objectives, the present invention adopts the following technical solution:
[0072] An animal behavior recognition method based on wavelet packet decomposition and state-space model includes the following steps:
[0073] Step S1, Sensor Signal Acquisition Stage: Acquire the three-axis continuous motion signals of the sensors worn by the animal, and use a sliding window to segment the data stream to construct the original sensor signal input.
[0074] Step S2, Dimension-aware Data Augmentation Stage: The dimension-aware data augmentation module (DAE) is used to perform axial adaptive enhancement and fusion of the sensor signal to generate the processed signal, so as to explicitly solve the problem of directional heterogeneity of the triaxial signal.
[0075] Step S3, Multi-scale Time-Frequency Feature Adaptive Fusion Stage: The processed signal is subjected to wavelet packet decomposition (WPD) and time-series modeling by the Mamba module, and adaptive weighted fusion is performed through the feature routing module to generate fused multi-scale features.
[0076] Step S4, Feature Classifier Recognition Stage: Input the fused multi-scale features into the feature classifier and output the final animal behavior recognition result.
[0077] Preferably, in step S1, the sensor signal acquisition stage: the continuous three-axis motion signals of the sensor worn by the animal are acquired, and the data stream is segmented using a sliding window to construct the original sensor signal input, as follows:
[0078] S1.1 Acquire a multi-sensor directional motion dataset collected via an animal's neck collar (containing a triaxial accelerometer). To reduce computational redundancy, the original signal sampling frequency is downsampled from 100Hz to 25Hz;
[0079] S1.2. A fixed sliding window of 2 seconds is used to segment the continuous time series, with an overlap rate of 50% between windows, to construct the original sensor signal input matrix. ,in, Represents the real number field. For batch size, This represents the number of channels in the three-axis sensor, corresponding to the X-axis, Y-axis, and Z-axis respectively. L represents the length of the time series within a single sliding window; when the sampling frequency is 25Hz and the window length is 2s, L=50.
[0080] Preferably, in step S2, the dimension-aware data augmentation stage: a dimension-aware data augmentation module (DAE) is used to perform axial adaptive augmentation and fusion of the sensor signal to generate a processed signal, as follows:
[0081] S2.1, L2 pooling: converting the original sensor signal Perform L2 pooling along the time dimension to extract the energy description vector for each sensor's spatial axis. The calculation formula is as follows:
[0082] (1)
[0083] Among them, pool L2 ( () represents an L2 pooling operation, and t represents time. For batch size, Represents the number of channels in a triaxial sensor. The length of the time series. This represents the slice of the original sensor signal X at time step t, where the two colons ":" indicate that all batch samples and all sensor channels are selected, respectively.
[0084] S2.2, Multilayer Perceptron and ReLU Activation Function Describe Energy Vector The input is a multilayer perceptron (MLP) with a bottleneck architecture, followed by a ReLU activation function in the hidden layer and a Sigmoid activation function at the output. Processing and dynamically calculating the attention weights for generating orientation awareness. :
[0085] (2)
[0086] S2.3, Weighted Fusion: The calculated attention weights are then... Compared with the original sensor signal Perform element-wise multiplication and then element-wise addition via residual connections to generate the processed signal. This adaptively amplifies core dimensional features related to behavior while suppressing noise. The calculation formula is:
[0087] (3)
[0088] in, This indicates element-wise multiplication. This indicates element-wise addition.
[0089] Preferably, in step S3, the multi-scale time-frequency feature adaptive fusion stage: the processed signal is subjected to wavelet packet decomposition (WPD) and Mamba module time-series modeling, and adaptive weighted fusion is performed through the feature routing module to generate fused multi-scale features, as follows:
[0090] S3.1, WPD Decomposition: The processed signal is decomposed using three-level wavelet packet decomposition (WPD). Multi-resolution frequency analysis was performed to extract feature sequences of 15 multi-scale nodes from wavelet packet decomposition trees of levels 0 to 3, forming... ;
[0091] S3.2, Mamba Module Timing Modeling: For each sub-band sequence generated by WPD, a parallel Mamba module based on a selective state-space model is configured to process it independently to extract the first... The characteristic sequence of each sub-band The specific steps are as follows:
[0092] S3.2.1 Mapping the input sub-band sequence into a one-dimensional input signal Construct a continuous linear state-space model and hide the state. Mapping the input signal to the output response :
[0093] (4)
[0094] (5)
[0095] in, This represents the first derivative of the hidden state with respect to continuous time. The state evolution matrix is... This represents the input projection matrix in a continuous system. Represents the output projection matrix in a continuous system;
[0096] S3.2.2, For discrete input sequences A selective mechanism is introduced, which uses a linear layer to select based on the current input. Dynamically generate scale step size Input related projection matrix and output related projection matrix Subsequently, the continuous system is discretized using the zero-order preserve method, and the discrete state matrix is calculated. and :
[0097] (6)
[0098] (7)
[0099] Where I represents the identity matrix, and exp(·) represents the matrix exponential function;
[0100] S3.2.3 Utilizing the discretized parameters, the hidden state is iteratively updated along the sequence dimension through selective scan operations. And calculate the output of the current time step. :
[0101] (8)
[0102] (9)
[0103] Thus, the first The characteristic sequence of each sub-band The corresponding feature dimension is , For batch size, For feature channel dimension, The sequence length of the sub-band.
[0104] S3.3 Feature Routing Module: To filter redundant frequency band features, the feature sequences output by each Mamba module are input into the feature routing module, which specifically includes the following sub-steps:
[0105] S3.3.1, L2 pooling: For each feature sequence across time and channel dimensions... Perform L2 pooling to quantize the characteristic energy of each sub-band. They are then concatenated into a unified 15-dimensional energy description vector. :
[0106] (10)
[0107] (11)
[0108] S3.3.2, Multilayer Perceptron and Sigmoid Activation Function: Describing the energy vector The data is processed sequentially through a multilayer perceptron (MLP) and a sigmoid activation function, generating adaptive route weights through a dynamic routing mechanism. :
[0109] (12)
[0110] S3.3.3, Weighted Fusion: The generated route weight scalar... Feedback to the corresponding sub-band features Element-wise multiplication is performed, followed by element-wise addition using residual connections to generate fused multi-scale features. Effectively suppresses redundant frequency band information:
[0111] (13)
[0112] in, This indicates element-wise multiplication. This indicates element-wise addition.
[0113] Preferably, in step S4, the feature classifier recognition stage: the fused multi-scale features are input into the feature classifier, and the final animal behavior recognition result is output, as follows:
[0114] S4.1 The fused multi-scale features output by the feature routing module Flatten it and input it into a feature classifier composed of multilayer perceptrons;
[0115] S4.2 The feature classifier maps high-dimensional features to the classification space, calculates the probability distribution of each category through Softmax, and outputs the final animal activity category recognition result (e.g., standing, running, eating, trotting, walking).
[0116] In the specific embodiments verifying the technical advantages of this application, all experiments were implemented based on the PyTorch deep learning framework and executed on a workstation equipped with a single NVIDIA GeForce RTX 5090 D GPU. To ensure the fairness of the comparative experiments and the optimization of model performance, the key hyperparameters of AAR-WaveMamba and other benchmark models were rigorously and automatically optimized and set using a grid search strategy. The final determined core parameter combination was: using the Adam optimizer, with an initial learning rate set to... The global batch size was set to 512, and the maximum number of training epochs was 150. Meanwhile, to effectively alleviate overfitting and improve model robustness, the dropout rate between network layers was set to 0.3, and L2 regularization with a weight decay coefficient of 0.1 was introduced.
[0117] (1) To verify the effectiveness of the model proposed in this invention, a comprehensive performance and efficiency comparison experiment was conducted between the method of this invention (AAR-WaveMamba) and existing mainstream benchmark models (including Bi-LSTM, ResNet-18 and Transformer). The specific experimental comparison data are shown in Table 1.
[0118] Table 1. Performance and efficiency comparison of the method of this invention with other advanced models:
[0119]
[0120] As shown in Table 1, the method proposed in this invention demonstrates significant advantages across multiple evaluation metrics. Regarding model recognition accuracy, the method achieves an accuracy of 90.94%, a recall of 84.92%, and an F1 score of 83.07%, with overall classification performance significantly superior to existing comparative models. More importantly, in terms of model lightweighting and operational efficiency, the method has only 0.32M parameters and a computational cost (FLOPs) as low as 0.05G, far lower than the 1.02M and 0.86G of the Transformer model. Simultaneously, the inference throughput of the method reaches 2845 samples / second. The above experimental data fully demonstrate that this invention, through multi-scale time-frequency feature fusion and dimensionality perception mechanisms, significantly reduces the number of model parameters and computational complexity without sacrificing recognition accuracy; on the contrary, it further improves accuracy and inference speed, making it highly suitable for real-time monitoring and recognition applications of animal behavior under resource-constrained conditions.
[0121] (2) This application effectively addresses the differences in behavioral characteristics across different categories, achieving high-precision identification across most behavioral categories. To further evaluate the classification performance of the method in various specific behavioral categories, this invention generates an accuracy-confusion matrix (e.g., Figure 4 (As shown). Experimental results show that the method of the present invention exhibits extremely high recognition accuracy in core behavior categories with a large sample size: the accuracy rate reaches 95.60% for "standing", 93.57% for "running", 88.94% for "walking", and 86.73% for "eating". Although the "trotting" category (n=189 samples) has some misclassifications due to its extremely small data volume and high similarity to "walking" and "running" in physical features, the model still maintains a clear decision boundary overall. This proves that the method of the present invention has a strong feature discrimination ability and can effectively extract and distinguish key action features in complex animal behaviors.
[0122] (3) This application proposal possesses adaptive perception and dynamic weighting capabilities for spatial axes and multi-band features, improving the effectiveness and noise resistance of feature extraction. The attention / weight allocation mechanism designed within the model of this invention can adaptively focus on key features for different behaviors. For example... Figure 5 As shown in the spatial axis weight heatmap, the model assigns differentiated weights to the three-axis sensors (X, Y, and Z axes) (e.g., the Y-axis typically has the highest weight across all actions, remaining around 0.35-0.37), indicating that the model can automatically capture the most representative spatial motion directions; Figure 6As shown in the multi-band (B1-B15) weighted heatmap, the model assigns higher attention weights (0.06-0.09) to low and mid-frequency bands (such as B1-B6 and B10-B15), while significantly reducing the weights (0.03) for certain frequency bands that may contain noise or irrelevant features. This adaptive dynamic weighting mechanism in both the spatial and frequency domains enables the present invention to automatically filter redundant noise and accurately identify the time-frequency features with the highest classification value in complex physical environments.
[0123] (4) The WPD technique used in this application significantly enhances the separability of features compared to DWT. To intuitively verify the superiority of the full-band wavelet packet decomposition method used in this invention, this invention utilizes t-SNE technology to perform two-dimensional visualization dimensionality reduction comparison of the extracted features (e.g., Figure 7 (As shown). Figure 7 (a) shows that when using the traditional discrete wavelet transform (partial decomposition), features of some behaviors (such as "eating" and "walking" and "standing") exhibit significant overlap and aliasing at the boundaries; while Figure 7 As shown in (b), after adopting the wavelet packet full-band decomposition method of the present invention, the feature distribution of various behaviors is more compact (intra-class variance is reduced), and the intervals between different behavior categories are clearer (inter-class distance is increased). This indicates that the signal decomposition strategy of the present invention can more comprehensively preserve detailed action information in high and low frequencies, thereby providing a better feature representation for the back-end classifier.
[0124] (5) The multi-scale feature fusion mechanism proposed in this application significantly improves the clustering effect of the feature space and the robustness of the model. To verify the actual contribution of the feature fusion module proposed in this invention, ablation verification was performed, and a t-SNE visualization of the feature distribution was plotted (e.g., Figure 8 (As shown). Observation Figure 8 (a) Baseline model and Figure 8 (b) The feature distribution without a fusion strategy reveals that the features are relatively loosely distributed in space, and feature points of a few classes (such as "jogging" and "running") are deviated from or marginalized. After introducing the feature fusion mechanism of this invention (such as... Figure 8 As shown in (c), all feature clusters (especially the major categories such as "eating", "walking", and "standing") exhibit high intra-class aggregation and inter-class separation, with a significant reduction in isolated detached feature points. This fully demonstrates that the multi-scale fusion strategy proposed in this application can effectively integrate local details and global semantics, greatly improving the model's feature representation ability and classification stability in complex scenarios.
Claims
1. An animal behavior recognition method based on wavelet packet decomposition and state-space model, characterized in that, Includes the following steps: Step S1, Sensor signal acquisition stage: Acquire the three-axis continuous motion signals of the sensor worn by the animal, and use a sliding window to segment the data stream to construct the original sensor signal input; Step S2, Dimension-aware data augmentation stage: The dimension-aware data augmentation module DAE is used to perform axial adaptive enhancement and fusion of the sensor signal to generate the processed signal, so as to explicitly solve the directional heterogeneity problem of the three-axis signal; Step S3, Multi-scale Time-Frequency Feature Adaptive Fusion Stage: The processed signal is subjected to wavelet packet decomposition (WPD) and Mamba module time-series modeling, and adaptive weighted fusion is performed through the feature routing module to generate fused multi-scale features; Step S4, Feature Classifier Recognition Stage: Input the fused multi-scale features into the feature classifier and output the final animal behavior recognition result; Step S2 is as follows: Step S2.1, L2 pooling: Convert the original sensor signal... Perform L2 pooling along the time dimension to extract the energy description vector for each sensor's spatial axis. The calculation formula is as follows: (1) Among them, pool L2 ( () represents an L2 pooling operation, and t represents time. For batch size, Represents the number of channels in a triaxial sensor. The length of the time series. This represents the slice of the original sensor signal X at time step t, where the two colons ":" indicate that all batch samples and all sensor channels are selected, respectively. Step S2.2: The multilayer perceptron and ReLU activation function convert the energy description vector... The input is a multilayer perceptron (MLP) with a bottleneck architecture, followed by a ReLU activation function in the hidden layer and a Sigmoid activation function at the output. Processing and dynamically calculating the attention weights for generating orientation awareness. : Step S2.3, Weighted Fusion: Combine the calculated attention weights The signal is then multiplied element-wise with the original sensor signal and added element-wise through the residual connection to generate the processed signal. This adaptively amplifies core dimensional features related to behavior while suppressing noise; the calculation formula is: (3) in, This indicates element-wise multiplication. This indicates element-wise addition; Step S3 is as follows: Step S3.1, WPD decomposition: Use the 3-level wavelet packet decomposition WPD to process the signal. Multi-resolution frequency analysis was performed to extract feature sequences of 15 multi-scale nodes from wavelet packet decomposition trees of levels 0 to 3, forming... Where B1 represents the first sub-band sequence, B2 represents the second sub-band sequence, and B... 15 This represents the 15th sub-band sequence; Step S3.2, Mamba module time series modeling: For each sub-band sequence generated by WPD, configure parallel Mamba modules based on a selective state-space model to process them independently in order to extract the first... The characteristic sequence of each sub-band ; Step S3.3, Feature Routing Module: To filter redundant frequency band features, the feature sequences output by each Mamba module are input into the feature routing module.
2. The animal behavior recognition method based on wavelet packet decomposition and state-space model according to claim 1, characterized in that, The specific steps of S1 are as follows: Step S1.1: Obtain the multi-sensor directional motion dataset collected through the animal's neck collar, and downsample the original signal sampling frequency from 100Hz to 25Hz; Step S1.2: Segment the continuous time series using a fixed 2-second sliding window with a 50% overlap between windows to construct the original sensor signal input matrix. ,in, Represents the real number field. For batch size, This represents the number of channels in the three-axis sensor, corresponding to the X-axis, Y-axis, and Z-axis respectively. L represents the length of the time series within a single sliding window; when the sampling frequency is 25Hz and the window length is 2s, L=50.
3. The animal behavior recognition method based on wavelet packet decomposition and state-space model according to claim 1, characterized in that, Step S3.2 is as follows: Step S3.2.1: Map the input sub-band sequence to a one-dimensional input signal. Construct a continuous linear state-space model and hide the state. Mapping the input signal to the output response : (4) (5) in, This represents the first derivative of the hidden state with respect to continuous time. The state evolution matrix is... This represents the input projection matrix in a continuous system. Represents the output projection matrix in a continuous system; Step S3.2.2: For discrete input sequences A selective mechanism is introduced, which uses a linear layer to select based on the current input. Dynamically generate scale step size Input related projection matrix and output related projection matrix Subsequently, the continuous system is discretized using the zero-order preserve method, and the discrete state matrix is calculated. and : (6) (7) Where I represents the identity matrix, and exp(·) represents the matrix exponential function; Step S3.2.3: Using the discretized parameters, iteratively update the hidden state along the sequence dimension through selective scan operations. And calculate the output of the current time step. : (8) (9) Thus, the first The characteristic sequence of each sub-band The corresponding feature dimension is , For batch size, For feature channel dimension, The sequence length of the sub-band.
4. The animal behavior recognition method based on wavelet packet decomposition and state-space model according to claim 1, characterized in that, Step S3.3 is as follows: Step S3.3.1, L2 pooling: For each sub-band feature sequence across time and channel dimensions... Perform L2 pooling to quantize the characteristic energy of each sub-band. They are then concatenated into a unified 15-dimensional energy description vector. : (10) (11) Among them, pool L2 ( () indicates an L2 pooling operation; Step S3.3.2, Multilayer Perceptron and Sigmoid Activation Function: Transform the energy description vector... The data is processed sequentially through a Multilayer Perceptron (MLP) and a Sigmoid activation function, and adaptive route weights are generated through a dynamic routing mechanism. : (12) Step S3.3.3, Weighted Fusion: The generated route weight scalar... Feedback to the corresponding sub-band feature sequence Element-wise multiplication is performed, followed by element-wise addition using residual connections to generate fused multi-scale features. Effectively suppresses redundant frequency band information: (13) in, This indicates element-wise multiplication. This indicates element-wise addition.
5. The animal behavior recognition method based on wavelet packet decomposition and state-space model according to claim 1, characterized in that, Step S4 is as follows: Step S4.1: The fused multi-scale features output by the feature routing module... Flatten it and input it into a feature classifier composed of multilayer perceptrons; Step S4.2: The feature classifier maps high-dimensional features to the classification space, calculates the probability distribution of each category using Softmax, and outputs the final animal activity category recognition result.
6. The animal behavior recognition method based on wavelet packet decomposition and state-space model according to claim 1, characterized in that, The final animal activity category identification results include standing, running, eating, trotting, and walking.
7. An animal behavior recognition system based on wavelet packet decomposition and a state-space model, comprising a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executed by the processor; characterized in that, When the system is running, the processor and the memory communicate via a bus, and the machine-readable instructions are executed by the processor as described in any one of claims 1 to 6, which is an animal behavior recognition method based on wavelet packet decomposition and state space model.
Citation Information
Patent Citations
Cow behavior identification method based on multi-scale weighted adaptive sequential network
CN121071695A
Mama network solenoid valve fault diagnosis method based on frequency domain characteristics
CN121117536A