A method and system for recognizing behavior of livestock and poultry based on a brain-like network

By using a brain-like network-based livestock behavior recognition method, the problems of equipment deployment and computing energy consumption of video surveillance and IMU sensors in grassland free-range scenarios are solved, achieving efficient and stable livestock behavior recognition, which is suitable for grassland free-range or large-scale grazing scenarios.

CN121881010BActive Publication Date: 2026-05-19QINGDAO UNIV OF TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO UNIV OF TECH
Filing Date
2026-03-20
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies suffer from high deployment costs, insufficient network coverage, and limited power supply in grassland free-range or large-scale grazing scenarios, resulting in low accuracy in livestock behavior recognition. IMU sensor-based methods are computationally intensive, power-intensive, susceptible to wear loosening and posture drift, and lack the ability to model temporal structures and rhythmic patterns, leading to false triggering or repeated recognition problems.

Method used

A brain-like network-based livestock behavior recognition method is adopted. By separating gravity component estimation from motion component, trigger judgment, pulse coding and brain-like network construction, the structural decoupling of posture trend and dynamic behavior is achieved, reducing the amount of computation and energy consumption. Furthermore, the nonlinear expression capability of brain-like networks and the fusion of behavioral state machines are utilized to improve recognition accuracy and stability.

Benefits of technology

While reducing computational load and energy consumption, it improves the accuracy and stability of livestock behavior recognition, adapts to the long-term operation of wearable devices with limited battery capacity, reduces false triggering and repeated recognition, and is suitable for grassland free-range or large-scale grazing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121881010B_ABST
    Figure CN121881010B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent livestock breeding, and particularly relates to a livestock behavior recognition method and system based on a brain-like network. The method comprises the following steps: acquiring collar-end data; performing gravity component estimation and motion component separation according to the collar-end data to obtain gravity component data and motion component data respectively; performing trigger determination on the gravity component data and the motion component data to obtain trigger determination data; performing pulse coding according to the trigger determination data to obtain pulse coding data; constructing a brain-like network according to the pulse coding data to obtain a brain-like network model; and performing behavior state machine fusion according to the brain-like network model to obtain a livestock behavior recognition model. The present application realizes long-term stable recognition of livestock behavior at a low-power collar end, effectively reducing the energy consumption burden caused by continuous calculation. Through gravity gating inhibition and state machine fusion, the anti-interference ability to head-shaking interference, loose wearing and transient noise is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent livestock farming technology, and in particular to a method and system for recognizing livestock and poultry behavior based on brain-like networks. Background Technology

[0002] With the development of large-scale and intelligent farming, monitoring livestock and poultry behavior has become an important technical means for health assessment, reproductive management, and disease early warning. Existing technologies typically rely on video surveillance systems or behavior recognition methods based on traditional deep learning models (such as convolutional neural networks and recurrent neural networks). However, in grassland free-range or large-scale grazing scenarios, video solutions struggle to operate stably for extended periods due to high camera deployment costs, insufficient network coverage, and limited power supply. In recent years, data-driven behavior recognition methods based on collar-type IMU sensors have gradually been applied in the livestock field. However, existing technologies often employ continuous signal feature extraction combined with traditional machine learning or deep learning models for recognition, resulting in high computational demands and power consumption, making them unsuitable for long-term operation of wearable devices with limited battery capacity. Furthermore, IMU signals are susceptible to factors such as collar loosening, posture drift, and head-shaking impacts, leading to unstable estimation of the gravity component and affecting behavior recognition accuracy. In addition, traditional threshold detection methods lack the ability to model temporal structures and rhythmic patterns, easily causing false triggering or repeated recognition problems. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention proposes a method and system for livestock and poultry behavior recognition based on brain-like networks, thereby resolving at least one of the aforementioned technical problems.

[0004] This application provides a method for livestock and poultry behavior recognition based on brain-like networks, including the following steps:

[0005] Step S1: Obtain collar end data; perform gravity component estimation and motion component separation based on collar end data to obtain gravity component data and motion component data respectively;

[0006] Step S2: Perform trigger determination on the gravity component data and motion component data to obtain trigger determination data;

[0007] Step S3: Perform pulse coding based on the trigger determination data to obtain pulse coded data;

[0008] Step S4: Construct a brain-like network based on the pulse coding data to obtain a brain-like network model; fuse the behavioral state machine based on the brain-like network model to obtain a livestock and poultry behavior recognition model.

[0009] In step S1 of this invention, by estimating the gravity component and separating the motion component from the collar-end data, the attitude trend term and dynamic behavior term in the original IMU signal are structurally decoupled, avoiding long-term interference from gravity drift or changes in wearing angle on behavior recognition, thus improving the stability and repeatability of motion features from the source. In step S2, by triggering the gravity component and motion component, event-based compression processing of the continuous sampling stream is achieved, so that the system only enters the calculation stage when significant behavioral changes occur, reducing unnecessary computation and energy consumption. In step S3, the triggering result is converted into pulse-coded data, transforming the original continuous amplitude signal into a sparse pulse stream expression, matching the event-driven characteristics of the brain-like network, reducing redundant computation and enhancing sensitivity to changes in behavioral rhythm. In step S4, by constructing a brain-like network and fusing it with a behavioral state machine, the neural response result is combined with regularized state constraints. On the one hand, the nonlinear expression capability of the brain-like network for complex dynamic patterns is utilized; on the other hand, the state machine mechanism suppresses transient misjudgments, achieving stable output of recognition results.

[0010] Preferably, step S1 specifically includes:

[0011] Acquire data from the collar end;

[0012] Based on the data from the collar end, collar loosening is determined, and collar loosening data is obtained;

[0013] The fast and slow gravity data were compared to the data on the loosening of the collar.

[0014] Angular velocity-gated gravity suppression is applied to fast and slow gravity data to obtain gravity suppression data;

[0015] By projecting the gravity suppression data along the gravity cone constraint direction, gravity component data can be obtained.

[0016] Wearing coordinate data is obtained by reconstructing the wearing coordinates based on gravity suppression data;

[0017] Motion component separation is performed on the wearer's coordinate data to obtain motion component data.

[0018] This invention uses collar loosening detection and fast / slow gravity comparison to identify gravity estimation shifts caused by loosening of the collar or posture drift, avoiding misinterpretation of changes in the wearing structure as changes in animal behavior. Angular velocity gating gravity suppression combined with gravity cone constraint direction projection effectively suppresses transient interferences such as head shaking and high-frequency jitter that contaminate gravity estimation, improving the long-term stability of posture components. Based on this, wearing coordinate reconstruction is performed, returning motion data to a unified body reference frame, eliminating feature distortions caused by differences in wearing angles, and achieving accurate separation of motion components.

[0019] Preferably, the angular velocity gating gravity suppression specifically refers to:

[0020] The difference in gravity data at different speeds is calculated and the angular velocity gating coefficient is generated, resulting in difference data and angular velocity gating coefficient data, respectively.

[0021] Gravity update suppression is performed based on the difference data and angular velocity gating coefficient data to obtain gravity suppression data.

[0022] This invention achieves adaptive suppression control of the gravity update process by introducing a joint modulation mechanism of the difference between fast and slow gravity and the angular velocity gating coefficient. The difference calculation allows for real-time representation of the degree of deviation in gravity estimation caused by transient disturbances; the angular velocity gating coefficient generation dynamically adjusts the gravity update weight based on the angular velocity intensity, thereby actively freezing or weakening gravity updates during high angular velocity phases such as head-turning and sharp turns, preventing linear acceleration from being incorrectly absorbed into the gravity component. This invention effectively suppresses attitude contamination and directional jumps, improves the long-term stability and physical consistency of gravity estimation, and provides a more reliable reference signal for motion component separation and behavior trigger determination.

[0023] Preferably, step S2 specifically includes:

[0024] Gravity stability domains are constructed from gravity component data to obtain gravity stability domain data;

[0025] Dual-channel abrupt change detection is performed on the motion component data to obtain dual-channel detection data, which includes axial direction detection and tangential direction detection. The dual-channel detection data includes axial direction detection data and tangential direction detection data.

[0026] Sparse constraint data is obtained by constraining the sparse event rate based on gravity stability domain data and dual-channel detection data.

[0027] Consistency hysteresis decision is performed on sparse constraint data to obtain trigger decision data.

[0028] This invention achieves hierarchical constraints and anti-interference control of the behavior triggering process by constructing a gravity stabilization domain and dual-channel mutation detection in synergy. The gravity stabilization domain represents the stable range of the attitude reference and can suppress false triggering during periods of drastic attitude changes or wearer disturbances. The axial and tangential dual-channel mutation detection correspond to impact-type and rhythmic motion characteristics, respectively, improving the ability to capture different types of behavior changes. This invention, through sparse event rate constraints and consistent hysteresis decision-making, ensures that the trigger output has temporal continuity and anti-jitter capabilities, avoiding repeated triggering caused by high-frequency noise or occasional impacts.

[0029] Preferably, the axial direction detection specifically includes:

[0030] The axial component data is obtained by extracting the axial component data from the motion component data.

[0031] Local trajectory data is obtained by constructing a local trajectory based on the axial component data.

[0032] Local energy evolution is performed on local trajectory data to obtain energy evolution data;

[0033] Gradient curvature coupling data is obtained by performing gradient curvature coupling processing on energy evolution data.

[0034] The phase breakage index is calculated based on the gradient curvature coupling data to obtain the phase breakage index data;

[0035] Axial phase stability failure detection was performed based on phase breakage index data to obtain axial mutation data;

[0036] Conflict morphology screening is performed on the axial mutation data to obtain axial direction detection data.

[0037] This invention achieves structured identification of abrupt behaviors by performing multi-level processing on axial motion signals, from trajectory construction to energy evolution, and then to gradient curvature coupling and phase breakage index calculation. Compared with single-image or threshold detection, representing motion characteristics from two dimensions—energy change trend and trajectory geometry—can distinguish between transient impacts and continuous vibrations, improving the accuracy of identifying behaviors such as stomping and head-swinging. Phase stability violation detection filters out random noise from a temporal consistency perspective, while conflict pattern screening avoids short-term abnormal repetitive triggering.

[0038] Preferably, the tangential direction detection specifically includes:

[0039] Tangential component data is obtained by extracting the tangential component data from the motion component data;

[0040] Energy transition processing is performed on the tangential component data to obtain tangential mutation data;

[0041] Directional filtering and rhythm detection were performed on the tangential mutation data to obtain directional filtering data and rhythm detection data, respectively.

[0042] The directional screening data and rhythm detection data are integrated to obtain tangential detection data.

[0043] This invention represents lateral swaying and periodic behaviors by performing energy transition analysis on the tangential component and combining directional and rhythmic filtering. Energy transition processing captures rapid changes in lateral motion intensity over short periods, avoiding false detections caused by relying solely on amplitude judgment. Directional filtering distinguishes the dominant direction of left and right swaying, improving sensitivity to gait deviations or lateral impacts. Rhythm detection identifies continuous periodic patterns, aiding in the stable determination of rhythmic behaviors such as rumination and walking. By integrating directional and rhythmic information, tangential direction detection effectively distinguishes random noise from real behavioral changes, improving the accuracy and robustness of trigger determination.

[0044] Preferably, step S3 specifically includes:

[0045] The trigger type is encoded based on the trigger determination data to obtain the trigger encoding data;

[0046] Perform event semantic anchoring processing on the triggered encoded data to obtain triggered aligned data;

[0047] The trigger alignment data is encoded by selecting the channel to obtain the trigger selection data;

[0048] Pulse encapsulation is performed based on the trigger selection data to obtain pulse coded data.

[0049] This invention achieves efficient mapping from continuous event streams to brain-like input forms by transforming trigger determination results into structured pulse expressions. Trigger type encoding enables different mutation morphologies to be classified during the encoding stage, avoiding repeated parsing in subsequent networks; event semantic anchoring ensures that the trigger time window is aligned with the behavioral context, improving temporal consistency; the encoding channel selection mechanism dynamically allocates input channels based on event characteristics, reducing invalid neural activation; and pulse encapsulation transforms sparse events into discrete pulse streams that can drive brain-like networks, thereby reducing computational burden and enhancing temporal representation capabilities.

[0050] Preferably, the brain-like network construction specifically involves:

[0051] The input layer data is obtained by constructing a polarity mapping input based on the pulse code data.

[0052] The neural parameters are initialized from the input layer data to obtain neural parameter data.

[0053] Sparse topology generation of sub-network routing is performed based on neural parameter data to obtain intermediate layer data;

[0054] Neurodynamic constraint training is performed based on intermediate layer data to obtain subnetwork training data;

[0055] Lightweight transfer learning is performed based on the subnetwork training data to obtain a brain-like network model.

[0056] This invention achieves a structured, brain-like representation of impulse events by constructing a polarity-mapped input and a sparse subnetwork topology. Polarity mapping enhances the ability to distinguish differences in behavioral direction and intensity; neural parameter initialization combined with end-side constraints ensures stable network operation under low power consumption; sparse subnetwork routing reduces invalid connections and improves computational efficiency; neurodynamic constraint training makes the network response more closely resemble the rhythmic characteristics of actual behavior; and lightweight transfer learning achieves rapid adaptation while maintaining model structural stability.

[0057] Preferably, the behavior state machine fusion specifically includes:

[0058] Neural response data was obtained by analyzing neural responses using a brain-like network model.

[0059] Behavioral confidence screening is performed on the neural response data to obtain neural screening data;

[0060] Behavioral constraint data is generated by performing behavioral constraint generation on neural screening data.

[0061] A behavioral state architecture is constructed based on behavioral constraint data to obtain a behavioral state model.

[0062] By isolating the main state of events from the behavioral state model, a livestock and poultry behavior recognition model is obtained.

[0063] This invention achieves a two-layer constraint of "neural reasoning result - regularized stable output" by integrating the output of a brain-like network with a behavioral state machine structure. Neural response parsing and confidence screening can filter out low-confidence excitations and reduce the risk of transient misjudgment; behavioral constraint generation transforms continuous neural responses into logically related behavioral conditions, improving the consistency of recognition results; the construction of the behavioral state architecture enables different main states and sub-states to form an ordered transition structure, avoiding frequent jumps; the event main state isolation mechanism can separate short-term anomalies such as shocks and head-flipping from long-term behavioral states, ensuring stable and reliable output results.

[0064] Preferably, this application also provides a livestock and poultry behavior recognition system based on brain-like networks, used to execute the livestock and poultry behavior recognition method based on brain-like networks as described above. The livestock and poultry behavior recognition system based on brain-like networks includes:

[0065] The attitude and motion decoupling module is used to acquire collar-end data; based on the collar-end data, gravity component estimation and motion component separation are performed to obtain gravity component data and motion component data respectively;

[0066] The dual-channel trigger determination module is used to determine the trigger based on gravity component data and motion component data, and obtain trigger determination data.

[0067] The pulse coding module is used to perform pulse coding based on the trigger determination data to obtain pulse coding data;

[0068] The brain-like behavior fusion and recognition module is used to construct a brain-like network based on pulse coding data to obtain a brain-like network model; and to fuse the behavior state machine based on the brain-like network model to obtain a livestock and poultry behavior recognition model.

[0069] The beneficial effects of this invention are as follows: In step S1, by separating the gravity component estimation from the motion component, physical decoupling of the posture trend term and dynamic behavior term is achieved, eliminating the long-term contamination of motion characteristics by changes in wearing angle and gravity drift, and ensuring the consistency of the input signal in the body reference frame. In step S2, a trigger determination mechanism is introduced, transforming the continuous high-frequency sampling stream into a sparse event stream, which only enters the calculation stage when the posture stability domain is disrupted or a sudden motion occurs, reducing invalid computation and suppressing noise-induced false triggers from the source. In step S3, the trigger events are mapped to time-discrete pulse sequences through pulse coding, making the data structure naturally match the event-driven computation mode of brain-like networks, reducing energy consumption and enhancing the ability to express behavioral rhythms. In step S4, by combining the nonlinear temporal modeling capability of brain-like networks with the rule constraints of behavioral state machines, complex dynamic behavior patterns are captured on the one hand, and short-term anomalies are logically isolated and stable output is controlled on the other. Attached Figure Description

[0070] Other features, objects, and advantages of this application will become more apparent from the following detailed description of the non-limiting embodiments, taken with reference to the accompanying drawings:

[0071] Figure 1 A flowchart illustrating the steps of a method for livestock and poultry behavior recognition based on a brain-like network is shown in one embodiment.

[0072] Figure 2 A flowchart illustrating the steps of an embodiment of an attitude motion decoupling method is shown.

[0073] Figure 3 A flowchart illustrating the steps of a dual-channel trigger determination method according to an embodiment is shown.

[0074] Figure 4 A flowchart illustrating the steps of a pulse coding method according to an embodiment is shown;

[0075] Figure 5 A flowchart illustrating the steps of a brain-like network construction method according to an embodiment is shown. Detailed Implementation

[0076] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0077] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. Functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.

[0078] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0079] Please see Figures 1 to 5 This application provides a method for livestock and poultry behavior recognition based on brain-like networks, including the following steps:

[0080] Step S1: Obtain collar end data; perform gravity component estimation and motion component separation based on collar end data to obtain gravity component data and motion component data respectively;

[0081] In one embodiment, triaxial acceleration and triaxial angular velocity data are collected at the collar end. The system performs dual-timescale gravity estimation processing on the acceleration data, constructing a faster-updating gravity estimation channel and a slower-updating gravity estimation channel (in the fast gravity estimation channel, an exponential smoothing method with a small time constant is used for updating). The system uses the fast gravity estimation value of the previous moment as a basis, according to the formula... , Let this be the current fast gravity vector. For rapid gravity smoothing coefficient, This refers to the current time index or the current sampling time. This represents the fast gravity vector from the previous moment. For the normalized acceleration vector at the current time, perform recursive calculations, where Take a smaller value (e.g., 0.7–0.9). After each update, re-normalize the result and multiply it by the standard gravity amplitude to maintain a stable gravity vector amplitude. In the slow gravity estimation channel, an exponential smoothing method with a larger time constant is used for updates, calculated as follows: , This represents the slow gravity vector at the current moment. This is the smoothing coefficient for slow gravity. This represents the slow-moving gravity vector from the previous moment. This is the normalized acceleration vector for the current moment, shared with the fast channel, where... A larger value (e.g., 0.98–0.995) is used to form a long-term stable gravity reference direction. The update results are also normalized. An exponential smoothing method is used (in each update cycle, the system first saves the gravity estimate from the previous moment as the basis for the current calculation. Based on the set smoothing weights, the previous estimate is linearly fused with the current normalized acceleration direction to obtain a new intermediate estimate. This intermediate result is then normalized to eliminate numerical accumulation errors and ensure direction normalization. After normalization, it is multiplied by the standard gravity amplitude to restore the actual scale of the gravity vector). The two types of gravity estimates are continuously updated, and the degree of difference between them is calculated. When the angular velocity amplitude exceeds a preset threshold, or the difference between the fast and slow gravity estimates increases significantly, an angular velocity gating mechanism is triggered, reducing the update weight of the fast channel or temporarily freezing its update process. The system imposes directional constraints on candidate gravity directions (temporary gravity directions obtained at the current moment from acceleration normalization results or fast gravity updates after gating adjustment), limiting them to the conical range formed by the previous stable gravity direction. Using the stable gravity direction as a reference, the system removes the gravity component from the original acceleration to obtain pure motion components, and outputs motion component data after processing with the worn coordinate reconstruction. The gravity component data is a low-frequency component vector reflecting the gravity direction and its amplitude, estimated from the original triaxial acceleration; the motion component data is the remaining dynamic component after subtracting the gravity component from the original acceleration.

[0082] Step S2: Perform trigger determination on the gravity component data and motion component data to obtain trigger determination data;

[0083] In one embodiment, the system constructs a gravity stability domain based on the change in the angle between adjacent units of the gravity direction. When the change in this direction is less than a preset angle threshold and continues for a set time, the current attitude is determined to be in a stable state. The system performs dual-channel abrupt change detection on the motion components: on the one hand, it extracts the axial motion component along the gravity direction, calculates its rate of change and peak-valley amplitude within a short time window, and when it simultaneously meets the characteristics of high rate of change and short duration, it is determined to be an impact-type candidate event; on the other hand, it extracts the tangential motion component perpendicular to the gravity direction, calculates its exponential smoothing value of energy and energy increment, and when a significant energy jump occurs, it is determined to be a motion start candidate event, and random noise is eliminated by combining the consistency of the tangential direction. The system counts the number of triggers per unit time and compares it with the frequency of target events. When triggers are too frequent, it adaptively increases the judgment threshold or extends the refractory period to suppress false triggers. The system generates trigger determination data by outputting the trigger type, corresponding evidence identifier, and holding duration through consistency and hysteresis. For example, the system performs consistency processing, counting candidate event types in several consecutive frames within a sliding time window. When the same type meets the trigger conditions in N (15-60) consecutive frames, or its occurrence ratio exceeds a preset consistency ratio threshold, the type is confirmed as a valid trigger. At the same time, the specific condition flags met during this triggering process are recorded, such as "rate exceeding threshold," "peak and valley reaching standard," "energy transition," and "direction consistency," forming a corresponding set of evidence identifiers. The system sets hysteresis parameters, such as setting entry and exit thresholds for each trigger type, with the exit threshold being lower than the entry threshold. When the relevant indicator exceeds the entry threshold, the system enters the trigger state. The system exits the trigger state only when the indicator is continuously lower than the exit threshold and continues to reach the set duration. During the trigger state holding period, the trigger flag remains valid, and the holding time is accumulated synchronously. The system output includes: the trigger type determined by the event category after consistency confirmation; the set of evidence identifiers composed of the condition flags met during this determination process; and the holding duration from entering the trigger state to meeting the exit conditions.

[0084] Step S3: Perform pulse coding based on the trigger determination data to obtain pulse coded data;

[0085] In one embodiment, the system selects an appropriate encoding strategy based on the trigger type: for impact events, differential threshold encoding is used with a short refractory period; for rhythmic events, phase anchoring encoding is used, for example, the system performs bandpass filtering on the target rhythmic signal to extract its main frequency band components; the system calculates the instantaneous phase information of the signal through zero-crossing detection or Hilbert transform, and selects a fixed phase point (e.g., a rising zero-crossing point or a position with a phase of 0°) as the reference trigger point; within each cycle, when the signal reaches the fixed phase position, a standardized anchoring pulse is generated, and the remaining pulses are encoded according to the offset relative to the reference phase. The system determines the event semantic anchor point within the trigger time window: for impact events, the moment with the largest signal change rate is selected as the anchor point; for motion start events, the moment when the energy first exceeds a preset threshold is selected as the anchor point; for rhythmic events, the moment when a stable zero-crossing feature is formed after bandpass filtering is selected as the anchor point, and the current time window is realigned to the time axis with the anchor point as the zero point. The system generates a channel mask based on the trigger type, retaining only key channels related to that type of event, such as axial components, tangential components, or angular velocity channels. For each reserved channel, the system maintains a real-time reconstructed value. When the deviation of the current signal from the reconstructed value exceeds a positive threshold, a positive pulse is output; when it falls below a negative threshold, a negative pulse is output. The thresholds are adaptively adjusted based on the target discharge rate. For example, the system sets a target discharge rate and calculates the current actual discharge rate within a sliding time window. When the current actual discharge rate is higher than the target value, the positive and negative thresholds are appropriately increased to reduce the trigger probability; when the current actual discharge rate is lower than the target value, the thresholds are appropriately decreased to increase the trigger probability. The threshold adjustment range is controlled according to the deviation ratio, for example, the adjustment amount is proportional to (target discharge rate - current actual discharge rate) and limited to a preset upper and lower bound. The system encapsulates the pulse results into a sparse event list, including timestamp differences, channel identifiers, and pulse polarity, and adds start and end boundary pulses at the start and end positions of the events to obtain pulse-coded data.

[0086] Step S4: Construct a brain-like network based on the pulse coding data to obtain a brain-like network model; fuse the behavioral state machine based on the brain-like network model to obtain a livestock and poultry behavior recognition model.

[0087] In one embodiment, the system establishes a polarity mapping input layer based on the pulse coding results, splits each physical channel into a positive polarity input unit and a negative polarity input unit, and separates the polarity of the pulse coding results of each physical feature channel according to the sign: when the feature increment is positive or exceeds the positive threshold, the positive polarity input unit is triggered, and when the feature increment is negative or below the negative threshold, the negative polarity input unit is triggered, and the start and end boundary pulses are set as independent input channels. The system initializes spiking neuron parameters, including leakage characteristics, discharge threshold, and refractory period, and performs fixed-point quantization to adapt to the embedded computing environment. For example, during spiking neuron initialization, specific parameters include: membrane time constant (e.g., 10–50 ms) to control potential decay rate; leakage coefficient (0.90–0.99); discharge threshold (e.g., a normalized potential value multiple of 0.5–1.2); reset potential (set to 0 or resting potential); resting potential reference; refractory period (e.g., 5–20 ms); initial synaptic weights (e.g., a normalized weight range of 0.1–0.5); and synaptic time constant to control synaptic current decay. These parameters are deployed using fixed-point quantization formats, such as Q1.15 or Q8.8, to uniformly scale membrane potential, weights, and thresholds to adapt to the integer arithmetic environment of embedded low-power processors. Based on different trigger types, corresponding sub-network paths are activated, and sparse connections are constructed between the input layer, hidden layer, and readout layer. Only valid connections are saved to achieve event-driven updates. For example, in terms of network structure construction, the input layer consists of multi-channel pulse units after event encoding, including positive polarity input units, negative polarity input units, and start-end boundary event channels. The hidden layer is divided into several neuron clusters according to function, such as impulse response clusters (short time constant, low threshold), rhythm maintenance clusters (long time constant, high threshold), and posture steady-state clusters (medium time constant, stable weight). The readout layer consists of behavior category output units, such as feeding output neurons, rumination output neurons, walking output neurons, resting output neurons, and transient event output neurons. The system only establishes sparse connections related to the corresponding trigger type. For example, impulse type input channels are only connected to impulse response clusters, rhythm type channels are connected to rhythm maintenance clusters, and each hidden cluster is then connected to the corresponding behavior readout unit. Connection relationships are stored through a connection index table and a connection weight table. Only valid connection indices and weight values ​​are saved, and no storage or computing resources are allocated to unconnected paths. This enables an event-driven update mechanism, where the state of the relevant neurons is only updated when an input pulse arrives.

[0088] During the training phase, corresponding neurodynamic characteristics are set for different sub-networks. For example, the system can be divided into three types of functional sub-networks: impulse sub-networks, rhythmic sub-networks, and steady-state posture sub-networks. Impulsive sub-networks are used for transient event recognition, emphasizing rapid response to sudden changes; rhythmic sub-networks are used for periodic behavior recognition, emphasizing the ability to accumulate repetitive patterns over time and maintain rhythm; steady-state posture sub-networks are used for distinguishing between static or slow activities, highlighting the ability to continuously represent stable states. All three types of sub-networks structurally share a common input layer interface to uniformly receive event-encoded pulse signals, but each is configured with independent clusters of hidden layer neurons and corresponding readout units.

[0089] The hidden layers of the impulse subnetwork are used to identify transient bursts of events. Its structure comprises three parts: a fast-response neuron cluster, a marginal enhancement neuron cluster, and an inhibitory regulation neuron cluster. The fast-response neuron cluster is used for rapid integration and firing response to high-frequency, bursty impulse inputs. These neurons employ short membrane time constants (e.g., 5–15 ms), short synaptic time constants (e.g., 3–10 ms), low firing thresholds, and short refractory periods. This cluster directly receives sparse connections from high-rate-of-change input channels, using a unidirectional feedforward connection. There are no or only weak coupling connections between neurons. The marginal enhancement neuron cluster is used to identify peak or abrupt boundary features of the input signal. Its structure includes several neurons with differential input weight distributions, receiving weighted inputs from positive and negative rate-of-change channels, respectively. The membrane time constant is slightly higher than that of the fast-response cluster, and the threshold is moderate to suppress noise interference. A unidirectional enhancement connection exists between this cluster and the fast-response cluster to amplify the identified impulse features. The inhibitory regulation neuron cluster is used to prevent repeated triggering within a short period. Its neurons employ a moderate membrane time constant and a high threshold, primarily receiving input from fast-response clusters and applying inhibitory connections (negative weighted connections) to them, forming local inhibitory loops to achieve rapid reset and stable control after transient responses.

[0090] The rhythmic subnetwork is used to identify periodic or repetitive behavioral patterns. Its hidden layers include a cluster of periodic accumulation neurons, a cluster of phase-synchronizing neurons, and a cluster of rhythmic stable neurons. The cluster of periodic accumulation neurons is used for time integration of continuous periodic inputs. These neurons have relatively long membrane time constants (e.g., 30–80 ms) and synaptic time constants (e.g., 20–60 ms), with a moderately increased firing threshold. This cluster receives rhythmic-related channels from the input layer and employs a sparse feedforward connection structure, allowing neurons to accumulate pulse inputs over multiple time windows. The cluster of phase-synchronizing neurons is used to identify the phase consistency of periodic signals. Structurally, it comprises several neuronal units with weakly coupled connections, forming a local synchronization loop. The neuron parameters are set to medium-long time constants and medium thresholds, and phase-synchronized firing behavior is enhanced through lateral excitation connections. This cluster receives the output of the periodic accumulation cluster and synchronously reinforces the output. The cluster of rhythmic stable neurons is used to suppress unstable periodic signals. These neurons employ higher thresholds and longer refractory periods, and regulate abnormal firing of the periodic accumulation cluster through inhibitory connections. Its function is to maintain stable output only when the periodic pattern occurs continuously, thereby avoiding misjudgment.

[0091] The steady-state posture subnetwork is used to identify static or slowly changing states. Its hidden layers include a cluster of low-frequency stable neurons, a cluster of slowly changing trend neurons, and a cluster of noise-suppressing neurons. The low-frequency stable neuron cluster represents continuous, low-change input signals. These neurons employ a moderate membrane time constant (e.g., 20–40 ms) and a high firing threshold, firing only when the input is continuously stable. Input connections are primarily low-frequency channels with relatively low connection density to reduce the impact of transient disturbances. The slowly changing trend neuron cluster detects slowly changing trends. These neurons receive low-pass filtered input pulse signals, have a longer synaptic time constant, and a threshold higher than that of the impact-type network. This cluster has a bidirectional weak connection with the low-frequency stable cluster. The noise-suppressing neuron cluster suppresses short-term fluctuations and random noise inputs. These neurons primarily receive high-frequency fluctuation signals from the input layer and suppress abnormal activation of the low-frequency stable neuron cluster through negative-weighted connections. Its structure is a feedforward inhibitory connection structure and does not participate in positive output decision-making.

[0092] In terms of neurodynamic settings, impact-type networks employ shorter membrane and synaptic time constants to accelerate potential decay and enhance response to transient impulses, while appropriately lowering the firing threshold to improve sensitivity to transient changes. Rhythmic networks use longer membrane and synaptic time constants, allowing neurons to accumulate input information over a longer period, and moderately increasing the firing threshold to enhance stable recognition of periodic patterns. Steady-state posture networks use moderate time constants and relatively high stability thresholds to suppress short-term fluctuations, making the system more inclined to output persistent state judgments. The system utilizes lightweight transfer learning, fine-tuning only the readout layer threshold and gain parameters to adapt to individual differences. That is, after completing basic network training, the system no longer adjusts the synaptic weights and time constants of the hidden layers, but only fine-tunes the readout layer parameters, including the output threshold, output gain coefficient, and bias term. Small-scale optimization of these parameters using a small number of labeled samples allows the network to quickly adapt to different scenarios or individual differences while maintaining the underlying temporal dynamics structure. In the inference phase (the real-time computation phase during actual deployment and operation after network structure determination and parameter training, i.e., using the determined parameters to discriminate behavior against new input data), the discharge count or membrane potential level of the readout layer is mapped (linearly normalized or Sigmoid mapping) to the behavior confidence level, and then input into the hierarchical behavior state machine after reliability gating. The state machine performs state transition control according to the entry threshold judgment, minimum residence time, and cooling constraints, and inserts events such as impacts or head-flipping as additional events without changing the main behavior state. The system outputs the livestock and poultry behavior recognition results.

[0093] Preferably, step S1 specifically includes:

[0094] Step S11: Obtain data from the collar end;

[0095] In one embodiment, the system acquires data from the collar end. The collar end collects triaxial acceleration and triaxial angular velocity data at a fixed sampling rate, along with timestamp information and operating status indicators such as device temperature and battery level. The system performs saturation detection and missing data completion on the raw acquisition sequence: when the amplitude of any axial data remains at a prolonged limit within a continuous sampling period, or when an abnormal jump in the timestamp is detected, the current time window is marked as a low-confidence state, and a corresponding sensor validity flag is generated for subsequent processing modules to perform gating judgment. For short-term missing or abnormal samples, the system uses nearest-neighbor interpolation or hold-before data to complete the data. In the preprocessing stage, only first-order recursive filtering or moving median filtering is used to smooth the data.

[0096] Step S12: Determine if the collar is loose based on the data from the collar end, and obtain the collar looseness data;

[0097] In one embodiment, the system constructs an attitude reference inconsistency index within a sliding time window: using the slow gravity direction (an estimate of the gravity unit direction obtained by long-term exponential smoothing of the acceleration direction with a small update weight (e.g., 0.98–0.995)) as the long-term reference direction, the deviation ratio of the acceleration modulus relative to the standard gravity value is statistically analyzed, and the square of the angular velocity is smoothed to obtain an angular velocity energy index. When the angular velocity energy remains at a low level for a long period (indicating that the animal has not engaged in violent movement), but the gravity direction continues to drift significantly, and this drift lasts for more than a set time; or when the deviation ratio of the acceleration modulus shows a slow upward trend without being accompanied by sudden movement characteristics, it is determined that the wearing structure is loose or slipping. The system outputs a loosening indicator and a loosening level based on the drift amplitude. The loosening level includes the following conditions: Level 1 loosening is determined when the detected angle change exceeds a preset first angle threshold (e.g., a value set within the range of 5 to 10 degrees) and the duration of the change exceeds a preset first time threshold; Level 2 loosening is determined when the angle change exceeds a preset first angle threshold (e.g., a value set within the range of 10 to 20 degrees) or the displacement or gap change ratio exceeds a first ratio threshold (e.g., 5%); Level 3 loosening is determined when the angle change exceeds a higher-level angle threshold (e.g., above 20 degrees) or the displacement or gap change ratio exceeds a second ratio threshold (e.g., 10%) and the duration of the state reaches a set time.

[0098] Step S13: Compare the fast and slow gravity data of the collar loosening data to obtain fast and slow gravity data;

[0099] In one embodiment, after determining collar loosening, the system performs fast and slow gravity comparison processing on the loosening data. Fast gravity refers to the gravity estimate obtained by exponential smoothing with a larger update weight, resulting in a shorter time constant, used to quickly track short-term attitude changes. Slow gravity refers to the gravity estimate obtained by exponential smoothing with a smaller update weight, resulting in a longer time constant, used to represent a long-term stable reference gravity direction. The system maintains two sets of gravity estimates in parallel: one set is the fast gravity estimate, using a larger update weight (0.7–0.9, e.g., 0.8) for exponential smoothing to quickly track short-term attitude changes; the other set is the slow gravity estimate, using a smaller update weight (0.95–0.995, e.g., 0.98 or 0.99) for exponential smoothing, used to characterize a long-term stable reference gravity direction. The system calculates the magnitude difference between fast and slow gravity, as well as the angle difference between them per unit direction, to assess the consistency of the current attitude estimate. When a loose collar indicator is detected as valid, or when the amplitude and direction differences between fast and slow gravity simultaneously exceed preset thresholds, the system determines that the current gravity update process may be affected by loosening or abnormal movement. The system outputs a gravity inconsistency indicator and simultaneously provides information on the level of difference.

[0100] Step S14: Perform angular velocity-gated gravity suppression on the fast and slow gravity data to obtain gravity suppression data;

[0101] In one embodiment, the system performs gating suppression processing on fast and slow gravity data based on angular velocity. The system calculates the amplitude and trend of the current angular velocity, and generates a gravity update gating coefficient based on the aforementioned difference between fast and slow gravity. When the angular velocity amplitude exceeds a preset threshold, or the rate of change of angular velocity increases significantly, the gating coefficient is reduced; when the difference between fast and slow gravity further exceeds the threshold, the gating coefficient is further reduced to enhance the suppression strength. When updating the fast gravity estimate, the system uses a gating hybrid approach, that is, based on the original exponential smooth update, a weighted fusion between the current acceleration and the existing gravity estimate is introduced, where the gating coefficient is used to adjust the degree of influence of linear acceleration on the gravity update, i.e. , For fast gravity vector estimation, This is the smoothing coefficient for the fast gravity exponent. To update the gating coefficient for gravity, This represents the current acceleration vector. When the gating coefficient falls below the freeze threshold, the rapid gravity update process is paused, and a freeze flag is generated to prevent the erroneous absorption of instantaneous linear acceleration into the gravity component during head-shaking, sharp turns, or violent motion phases. The system outputs gated gravity data.

[0102] Step S15: Project the gravity suppression data into the gravity cone constraint direction to obtain gravity component data;

[0103] In one embodiment, the system performs conical constraint projection processing on the gated gravity direction. The system saves the gravity reference direction that was confirmed to be stable at the previous moment. When the current candidate gravity direction is obtained (the current candidate gravity direction refers to the gravity unit direction calculated based on sensor data at this moment that has not yet undergone conical constraint verification. It is derived from the acceleration normalization result or the fast gravity direction after gated fusion), the system calculates the angle between the candidate direction and the reference direction (the reference direction is the gravity direction that has been confirmed to be valid through stability determination at the previous moment and is used as a comparison benchmark for the current direction change. This direction is usually the gravity direction output at the previous moment or the long-term stable gravity direction). If the angle is less than or equal to a preset conical half-angle threshold, the current candidate direction is directly accepted as the new gravity direction; if the angle exceeds the threshold, it is considered that there is a risk of single-window direction change, and the system rotates and adjusts the candidate direction along the plane spanned by it and the reference direction, so that it is restricted to the boundary of the conical surface with the reference direction as the axis and the half-angle as the preset threshold, thereby obtaining the constrained projection direction. The system combines the projection direction with the gravity amplitude to generate gravity component data.

[0104] Step S16: Reconstruct the wearing coordinates based on the gravity suppression data to obtain the wearing coordinate data;

[0105] In one embodiment, when a collar loosening indicator is detected as valid or a long-term directional drift occurs, the system performs coordinate self-alignment. Within a time window where the angular velocity is low and gravity is in a stable region, the system determines the current stable gravity direction as the body's vertical axis. Within a time interval where tangential motion energy is lowest (tangential motion energy refers to the energy index of the dynamic acceleration component perpendicular to the gravity direction, which can be obtained by averaging the squared tangential component over a short time window or by exponential smoothing; when this energy index reaches a local minimum within a certain time interval and the overall fluctuation is small, it indicates that the device is in a relatively static or slowly stable state, and at this time, the tangential motion energy is considered to be at its lowest), the system extracts the principal horizontal direction features, for example, by estimating the principal direction within a short time window or by direction consistency analysis, to determine the body's front-back or left-right orientation. Based on the aforementioned vertical axis and principal horizontal direction, a mutually orthogonal three-axis body coordinate base is constructed, forming a rotational relationship from the wearing coordinate system to the body coordinate system. After completing the coordinate base construction, the system uniformly converts the subsequently collected inertial measurement data to the body coordinate system for output, while simultaneously outputting the corresponding attitude parameters and rotational relationship information. The system is configured to update a cooldown period, during which coordinate self-alignment will not be repeated.

[0106] Motion component separation is performed on the wearer's coordinate data to obtain motion component data.

[0107] In one embodiment, after completing the wear coordinate reconstruction, the system performs motion component separation processing on the wear coordinate data. Using the determined gravity component as a reference, the corresponding gravity influence is subtracted from the original acceleration data to obtain the dynamic motion component. To prevent attitude estimation errors from propagating to subsequent modules, when a frozen gravity update or a gravity inconsistency flag is detected, the system applies amplitude limiting constraints to the dynamic component and performs a short-time window consistency check. For example, when dynamic energy abnormally increases while angular velocity does not change synchronously, the dynamic component is downweighted (multiplied by a preset confidence weight coefficient, which takes values ​​between 0 and 1). The dynamic component is decomposed in the body coordinate system to obtain the axial motion component along the gravity direction and the tangential motion vector perpendicular to the gravity direction. These axial and tangential motion components serve as the basic data output for subsequent dual-channel mutation detection and behavioral feature extraction, thereby achieving stable and reliable motion information representation.

[0108] Preferably, the angular velocity gating gravity suppression specifically refers to:

[0109] The difference in gravity data at different speeds is calculated and the angular velocity gating coefficient is generated, resulting in difference data and angular velocity gating coefficient data, respectively.

[0110] In one embodiment, the system reads the fast gravity vector and the slow gravity vector at the current moment in parallel. First, it calculates the magnitude difference between the two vectors, i.e., the overall size of the difference between the two vectors; simultaneously, it calculates the angular difference between the two vectors. These magnitude and directional differences together constitute the gravity difference data. The system calculates the magnitude of the current angular velocity and the change in the magnitude of the angular velocity at adjacent moments. Based on the angular velocity and gravity difference information, an angular velocity gating coefficient is generated according to a preset segmentation rule: when the angular velocity magnitude exceeds a threshold or the angular velocity change exceeds a threshold, the gating coefficient is attenuated; when the gravity magnitude difference or directional difference exceeds a threshold, the gating coefficient is attenuated again. The attenuation ratio is scaled using a scaling factor less than one. The system imposes upper and lower limit constraints on the gating coefficient, keeping it between a preset minimum value and one, and outputs the gravity difference data and the angular velocity gating coefficient data respectively.

[0111] Gravity update suppression is performed based on the difference data and angular velocity gating coefficient data to obtain gravity suppression data.

[0112] In one embodiment, the system suppresses the gravity update process based on gravity difference data and angular velocity gating coefficient data. The system uses the gating coefficient to adjust the update weight of rapid gravity, achieving a control strategy of suppressing updates during high angular velocity phases and smoothly following during low angular velocity phases. The system normalizes the current acceleration vector to obtain candidate gravity directions. Within the existing framework of rapid gravity exponential smooth update, the system uses gating mixing to weight and fuse the candidate directions with the previous rapid gravity direction according to the gating coefficient, and then combines this with preset update weights to complete the current rapid gravity update. , Let this be the current fast gravity vector. This is the smoothing coefficient for the fast gravity exponent. The angular velocity gating coefficient, The candidate gravity direction after normalization of the current acceleration. The direction of the unit of rapid gravity at the previous moment. This represents the gravity constant. When the gating coefficient is below the freeze threshold, the system directly triggers the freeze flag, maintaining the fast gravity equal to the previous result without performing an update. For slow gravity, updates are only allowed when the gravity difference is below the threshold and the angular velocity is at a low level; otherwise, it remains unchanged, thus maintaining the stability of the long-term reference direction. The system outputs gravity suppression data, including the updated fast gravity, slow gravity, gating coefficient, freeze flag, and the difference level information for this window.

[0113] Preferably, step S2 specifically includes:

[0114] Step S21: Construct a gravity stability domain for the gravity component data to obtain gravity stability domain data;

[0115] In one embodiment, the system normalizes the current gravity vector to obtain a unit gravity direction vector as the attitude reference. It calculates the degree of change in gravity direction between adjacent moments. Within a preset time window, it statistically analyzes the maximum fluctuation value of gravity direction change and simultaneously calculates the average angular velocity within the corresponding time period. When the maximum directional fluctuation within the window is less than a preset angle threshold, and the average angular velocity is lower than a preset threshold, and these conditions are met continuously for a set time (e.g., one to three seconds), the system is determined to have entered the gravity stability domain, generating a stability flag and recording the duration of stability. When any condition is violated, the system exits the stability domain, and the reason for exit is recorded, such as a sudden change in direction or an increase in angular velocity. The system outputs gravity stability domain data, including the stability flag, the duration of stability, and the reason for exit.

[0116] Step S22: Perform dual-channel abrupt change detection on the motion component data to obtain dual-channel detection data, wherein the dual-channel abrupt change detection includes axial direction detection and tangential direction detection, and the dual-channel detection data includes axial direction detection data and tangential direction detection data;

[0117] In one embodiment, in the body coordinate system, the system decomposes dynamic acceleration into an axial component along the direction of gravity and a tangential amplitude perpendicular to the direction of gravity. In axial detection, the system calculates the variation amplitude of the axial component between adjacent moments and statistically analyzes the peak-to-trough difference within a short time window. When the axial variation amplitude exceeds a preset threshold and the duration is shorter than the set impact judgment time, it is determined as an axial impact event, an axial impact flag is output, and a refractory period is initiated to avoid repeated triggering. Simultaneously, impact level information is provided (the axial impact level is graded based on the axial peak-to-trough difference amplitude. The peak-to-trough difference is compared with multiple grading threshold intervals; different amplitude intervals correspond to different levels). In tangential detection, the system exponentially smooths the square of the tangential amplitude to obtain a tangential energy index and calculates its increment. When the energy increment / change increment and the energy level simultaneously exceed a preset threshold, it is determined as a motion initiation event, and a tangential trigger flag and corresponding level are output (the preset threshold interval is divided based on the smoothed energy index and its increment). Consistency analysis is performed on the tangential direction at consecutive moments; if the directional correlation is low, the trigger result is downgraded to a noise candidate. The system outputs dual-channel detection data, including axial impact indicator, axial level, tangential trigger indicator, tangential level, evidence set (the evidence set consists of various condition indicators triggered during this judgment process, including amplitude compliance indicator, duration compliance indicator, energy compliance indicator, and direction consistency indicator), and current refractory period state (a refractory period timer is started after an event is detected; the state is in the refractory period while the timer is still running; it returns to the non-refractory period state after the timer ends).

[0118] Step S23: Perform sparse event rate constraints based on gravity stability domain data and dual-channel detection data to obtain sparse constraint data;

[0119] In one embodiment, the system performs sparse event rate constraint control based on gravity stability domain data and dual-channel detection data. The system maintains an event counter and time base, calculates the event occurrence rate per unit time, and sets a target event rate range based on preset parameters. This range can be configured according to battery power consumption budget or operating level. For example, the target event rate range can be configured in stages according to the device power consumption level. For instance, a lower target upper limit and narrower range are set in low power mode, a medium range is set in standard mode, and the upper limit is appropriately relaxed in high performance mode. Specifically, the corresponding upper and lower limits of the event rate can be calculated based on the maximum number of pulse processing times allowed per unit time or the average current budget, and stored as a configurable parameter table. When the current event rate is higher than the target upper limit, the system enters a current limiting state: based on a preset occurrence ratio (e.g., 1.2-1.5), the axial detection threshold and tangential detection threshold are increased, and the refractory period of impact events is extended. When the event rate is lower than the target lower limit and within the gravity stability domain, the system allows a slow reduction in the relevant thresholds to restore detection sensitivity. If the system is not currently in a gravity-stable region (i.e., the attitude fluctuates significantly), the detection threshold is forcibly increased, and rhythmic triggering is prohibited to prevent excessive false alarms under unstable attitudes. The system outputs sparse constraint data, including threshold update information, refractory period update information (refractory period update information refers to the minimum trigger interval parameter adjusted for impact-type or high-frequency event detection units. When entering a current-limiting state, the system extends this minimum interval; when the event rate returns to normal, it can gradually return to the default value. This information is used to control the repetitive triggering frequency of similar events), current event rate status (current event rate status describes the position of the real-time event occurrence frequency relative to the target interval, divided into three states: below the lower limit, within the interval, and above the upper limit), and a flag indicating whether the system is in a current-limiting state.

[0120] Step S24: Perform consistency hysteresis decision on sparse constraint data to obtain trigger decision data.

[0121] In one embodiment, entry and exit thresholds are set for different trigger types, and a minimum dwell time is configured. When an axial impact signal is detected and the system is in a gravity-stable region, an impact trigger result can be generated immediately. However, similar impact events must meet a preset cooling time before they can be triggered again to prevent duplicate counting. For tangential motion initiation triggers, multiple consecutive time windows must meet the entry conditions before a motion start trigger is determined; when exiting, multiple consecutive time windows must be below the exit threshold before an end is determined, thus creating hysteresis. When there is a conflict between axial and tangential evidence, the system makes a decision according to preset priority rules. For example, rhythmic or continuous motion triggers prioritize maintaining the current main state, while impact triggers are only recorded as additional events and do not change the main behavior state. The system outputs trigger determination data, including trigger flag, trigger type, dwell time, and evidence identifier (the evidence identifier includes the feature category number corresponding to the trigger, such as axial abrupt change feature, tangential consistency feature, rhythmic energy feature, gravity-stable region determination result, etc.; it can also be represented in bitmap form to show whether each determination condition is met).

[0122] Preferably, the axial direction detection specifically includes:

[0123] The axial component data is obtained by extracting the axial component data from the motion component data.

[0124] In one embodiment, in the body coordinate system after the wear coordinate reconstruction, the current dynamic motion vector and the corresponding unit vector of the gravity direction are read. The system projects the dynamic motion vector onto the gravity direction to obtain the axial scalar component along the gravity direction. The system performs short-time window smoothing on this axial component, which can be achieved using the sliding median or first-order recursive smoothing method, to obtain the smoothed axial component result. Simultaneously, the original axial value, the smoothed value, and the current data validity flag are output. When it is detected that the system is not in the gravity stability region, only a low-confidence flag is output. The system obtains the axial component data.

[0125] Local trajectory data is obtained by constructing a local trajectory based on the axial component data.

[0126] In one embodiment, the system employs a sliding time window of a preset length (e.g., sixteen to sixty-four sampling points) to extract the smoothed axial components in chronological order, forming a local trajectory vector corresponding to the current moment. While constructing the local trajectory, the system calculates a first-order change sequence for the data within the window to represent the rate of change between adjacent sampling points; the system also calculates a second-order change sequence to represent the acceleration characteristics. The system extracts multiple statistics, including the average value of the axial components within the window, the average absolute value, the maximum amplitude of the rate of change, and the index of the location of peaks in the trajectory. The aforementioned local trajectory vector, change sequence, and statistical indicators together constitute the local trajectory data.

[0127] Local energy evolution is performed on local trajectory data to obtain energy evolution data;

[0128] In one embodiment, the system performs square summation on the axial trajectory data within the current sliding window to obtain the axial energy density of that window. The system uses a sliding update method to calculate the difference between energy values ​​at adjacent time points, obtaining the energy change. The system calculates the difference in energy change between adjacent time points to form an energy acceleration index. The system acquires / calculates the background energy baseline and updates the historical energy using exponential smoothing to obtain a long-term reference energy level. The system calculates the normalized growth rate of the current energy change relative to the background baseline. The system outputs energy evolution data, including the current energy value, energy change, energy acceleration, background energy baseline, and normalized energy growth rate.

[0129] Gradient curvature coupling data is obtained by performing gradient curvature coupling processing on energy evolution data.

[0130] In one embodiment, the system constructs a curvature index using the first-order and second-order change sequences of the local trajectory. Specifically, the ratio of the overall amplitude of the second-order change to the overall amplitude of the first-order change is used as the curvature measure. The change amplitude is calculated using an absolute value summation method. Simultaneously, the average amplitude of the first-order change sequence is calculated as the gradient strength index. The normalized energy acceleration value, curvature index, and normalized gradient strength are categorized into intervals, for example, into low, medium, and high levels. A rule table is then established for combined judgment. For example, when all three indices are at a high level, it is judged as a high coupling potential; when two of them are at a medium or higher level, it is judged as a medium coupling potential; and the rest are judged as a low coupling potential. The highest value of the corresponding dimension of the three indices is activated, calculated, mapped, and normalized to between 0 and 1 to obtain the coupling potential index. Alternatively, a valid coupling flag can be generated only when the curvature index exceeds a threshold, the gradient strength meets the standard, and the energy acceleration is higher than the background baseline by a certain proportion; otherwise, it is not triggered. To avoid amplifying single-point noise, the system performs amplitude limiting on the coupling potential exponent and employs a short-time-window smoothing method for stabilization. The system outputs gradient curvature coupling data.

[0131] The phase breakage index is calculated based on the gradient curvature coupling data to obtain the phase breakage index data;

[0132] In one embodiment, the system counts the number of sign changes between adjacent sampling points in local trajectory data and uses the proportion of this number to the window length as the flip rate. The system combines the peak positions in the local trajectory to analyze whether there are structural features such as consecutive segments of the same sign followed immediately by opposite segments. When a clear unidirectional impact followed by a rapid reverse change is detected near the peak, an impact reversal flag is generated. When the flip rate reaches a set threshold, the system performs a weighted fusion of the normalized flip rate and the coupling potential index with preset weights to form a fracture strength value. The impact reversal flag increases the fracture strength gain when a unidirectional impact followed by a rapid reverse change structure is detected near the peak. If the reversal rate does not reach the minimum threshold, it is directly judged as a low-level condition. When the reversal rate reaches the standard but the coupling potential index is insufficient, its highest level is limited to no more than the medium level. A high-level phase break is only judged when both the reversal rate and the coupling potential index are in the high range, or when the reversal rate is higher than the high threshold and an impact reversal indicator is present, it is directly judged as a high-level phase break. When the reversal rate is in the medium range and the coupling potential index exceeds the set range, it is judged as a medium-level condition. All other cases are judged as low-level, and a preset value corresponding to the level is given as the phase break index value. The system limits the coupling potential index within a certain range before combining it. The system outputs phase break index data, including the reversal rate, the impact reversal indicator, and the phase break index value.

[0133] Axial phase stability failure detection was performed based on phase breakage index data to obtain axial mutation data;

[0134] In one embodiment, the system maintains a phase-stabilized state machine to track the stable state of the current axial trajectory. When the phase breakage index is below a stability threshold for multiple consecutive time windows, a stable state is determined; when the phase breakage index is above a failure threshold for multiple consecutive time windows, phase stability failure is determined. The system also requires at least one auxiliary condition to be met simultaneously when determining failure, such as the gradient curvature coupling potential index exceeding a set threshold, or the energy growth rate exceeding a set threshold. Once stability failure is confirmed, the system generates axial abrupt change data, records the trigger time, phase breakage index value, coupling potential index, and abrupt change level, and initiates a preset refractory period to prevent the aftershocks of the same impact from being repeatedly identified. The system outputs the axial abrupt change data.

[0135] Conflict morphology screening is performed on the axial mutation data to obtain axial direction detection data.

[0136] In one embodiment, the system performs conflict morphology screening on axial mutation data to generate axial direction detection results. The system classifies axial mutations based on indicators such as mutation duration, peak coupling potential index, phase reversal characteristics, energy growth trend, and phase reversal rate. If the mutation duration is short, the peak coupling potential index is high, and there is a clear post-impact reversal characteristic, it is classified as an impact type. If the mutation duration is long, the energy change shows a continuous growth trend, and the phase reversal rate is low, it is classified as a gradual change type. If phase reversals are frequent and the energy fluctuates repeatedly in a short period, it is classified as an oscillation type, and its detection results are downweighted. When the current time window is not in the gravitational stability region, or when there is a strong tangential mutation and the axial morphology is judged to be oscillation type, the system marks the result as low confidence, only as an event record, and does not participate in high-level judgment. The system outputs axial direction detection data, including axial impact indicators, axial transition indicators, confidence level indicators, evidence indicators, and intensity levels (events close to the judgment threshold are classified as low intensity, impacts significantly higher than the threshold and with a short duration are classified as medium intensity, and events with peak values ​​significantly higher than the threshold and accompanied by obvious reversal characteristics are classified as high intensity).

[0137] Preferably, the tangential direction detection specifically includes:

[0138] Tangential component data is obtained by extracting the tangential component data from the motion component data;

[0139] In one embodiment, the system reads the current dynamic motion vector and the corresponding unit vector of gravity direction in the body coordinate system. The system calculates the projection of the dynamic motion vector onto the gravity direction to obtain the axial component; the system subtracts the gravity direction component corresponding to the axial component from the original dynamic motion vector to obtain the tangential motion vector perpendicular to the gravity direction. The system calculates the amplitude of the tangential vector. The system statistically analyzes the median of the tangential amplitude or a scale index based on absolute deviation within a short time window, and uses this as a normalization factor to standardize the current tangential amplitude to obtain the normalized tangential intensity. The system outputs tangential component data, including the tangential vector, tangential amplitude, normalized tangential amplitude, and the corresponding scale parameter (the median of the tangential amplitude within the window, or the dispersion index calculated based on absolute deviation. The aforementioned is used as a normalization factor to map the current tangential amplitude to a relative intensity range).

[0140] Energy transition processing is performed on the tangential component data to obtain tangential mutation data;

[0141] In one embodiment, the system squares the normalized tangential amplitude and updates it using exponential smoothing to obtain a tangential energy index; the system calculates the change in energy between adjacent time points. The system calculates / obtains the background baseline of the tangential energy, forms a long-term reference level through smoothing updates, and calculates the normalized transition exponent of the current energy change relative to the background baseline. When the tangential energy change exceeds a preset threshold and the normalized transition exponent is higher than the corresponding threshold, a tangential transition candidate flag is generated. To avoid misjudgment caused by single-point noise, the system requires that the candidate flag appear at least a certain number of times within several consecutive time windows before it can be confirmed as a valid mutation, and a cooling-off period is initiated to prevent repeated triggering. The system outputs tangential mutation data, including the transition flag, transition exponent, current energy value, energy change, and mutation start time information.

[0142] Directional filtering and rhythm detection were performed on the tangential mutation data to obtain directional filtering data and rhythm detection data, respectively.

[0143] In one embodiment, regarding directional screening, the system excludes random collisions or instantaneous noise based on the directional consistency of tangential vectors. The system calculates the directional similarity between tangential vectors at adjacent time points and statistically analyzes their average consistency level and low quantile consistency index within a sliding window. When a tangential transition candidate flag exists, and both the average directional consistency value and the low quantile value are higher than a preset threshold, it is determined to be a directionally consistent motion start event; otherwise, the transition result is downgraded to a noise candidate, only recorded and not included in the high-level judgment. The system outputs directional screening data, including directional consistency flags and consistency level information. The consistency level information is obtained by calculating the directional similarity between tangential vectors within the sliding window to obtain continuous consistency values, such as average consistency and low quantile consistency, and is categorized according to a preset range. For example, consistency above the high threshold is classified as high consistency, between the high and low thresholds as medium consistency, and below the low threshold as low consistency. In rhythm detection, the system performs a lightweight bandpass approximation on the normalized tangential amplitude, such as using two-stage recursive filtering or simplified frequency detection for the target frequency band, to extract rhythm energy within a specific frequency range. For example, it performs a single-stage smoothing process on the normalized tangential amplitude signal to remove high-frequency jitter. A simplified bandpass approximation structure is used, such as cascading a low-pass filter unit and a high-pass filter unit to form the bandpass response for the target frequency band. Envelope extraction or energy accumulation is performed on the bandpass signal to obtain the rhythm energy curve. The system detects local peak positions and calculates the time interval between adjacent peaks. Within a sliding window, it statistically analyzes whether the peak interval falls within a preset time range and the fluctuation amplitude is below a threshold, while the rhythm energy remains consistently above a set level. If these conditions are met, the rhythm is considered stable. When the rhythm energy is above the threshold for a continuous period and the interval between adjacent peaks falls within the preset time range and maintains small fluctuations, stable rhythm behavior is determined, and a rhythm flag and rhythm stability level are output. The system obtains directional screening data and rhythm detection data respectively.

[0144] The directional screening data and rhythm detection data are integrated to obtain tangential detection data.

[0145] In one embodiment, when the directional motion initiation condition is met and no rhythmic feature is detected, a tangential motion initiation flag is output to identify behavioral transitions such as standing to walking or changing direction. When the rhythm detection condition is met, a rhythm flag is output, and the corresponding dominant frequency band, stability, and duration information are recorded for the identification of periodic behaviors such as rumination or feeding. If both directional motion and rhythmic feature are met simultaneously, it is preferentially determined to be a rhythmic event, and a motion background label is added to avoid misinterpreting periodic behavior as a single mutation. When not in a gravity-stable domain or in an event rate-limited state, the system increases the integration judgment threshold and performs confidence downgrading on the output results to reduce the risk of false detection. The confidence level is obtained by the system pre-setting a set of necessary and enhanced conditions for the tangential initiation and rhythmic outputs respectively, and generating corresponding condition satisfaction flags in the current window; the system counts the number of satisfied flags, divides them by the total number of conditions for that type of output, and obtains the normalized confidence level. If gravity instability or current limiting exists, the confidence level is capped at low / medium (e.g., a maximum output of 0.5 or a direct reduction of one level). Alternatively, the system calculates the compliance levels of sub-criteria such as directional consistency, energy transition, and rhythm stability, mapping each sub-criteria to 0 / 1 or discrete levels; the final confidence level is the lowest among all necessary sub-criteria (i.e., if any one criterion is weak, a high confidence level is not allowed). In conflict scenarios (where directional consistency and rhythm are simultaneously established), the confidence level is calculated based on the rhythm path, and a "motion background" evidence bit is added, without separately increasing the confidence level. The system outputs tangential detection data, including tangential start marker, rhythm marker, confidence level, evidence identifier, duration, and intensity level.

[0146] Preferably, step S3 specifically includes:

[0147] Step S31: Encode the trigger type based on the trigger determination data to obtain the trigger encoding data;

[0148] In one embodiment, the system reads the trigger type, confidence level, evidence identifier, and duration information from the trigger determination result and maps them to preset discrete codes. For example, the no-trigger state is encoded as "zero-zero", axial impact as "zero-one", tangential motion start as "zero-two", rhythm candidate as "zero-three", and attitude disruption or loosening calibration as "zero-four". When multiple trigger evidences exist within the same time window, the system makes a decision according to a preset priority rule, with priority from high to low as rhythm, motion start, axial impact, and calibration event; the main determination result is written into the main coding field, and secondary evidence not selected as the main determination is written into the auxiliary coding field. The system sets the coding intensity level, such as high, medium, and low, based on the confidence level of the trigger result (the confidence level is the discretized result after dividing the generated confidence into intervals. For example, the confidence value is divided into three intervals: low, medium, and high. When the confidence is in the low interval, it is marked as low level; when it is in the medium interval, it is marked as medium level; and when it is in the high interval, it is marked as high level). The system outputs trigger coding data, including the main code, auxiliary code, strength level, and trigger time information.

[0149] Step S32: Perform event semantic anchoring processing on the trigger encoded data to obtain trigger aligned data;

[0150] In one embodiment, the system selects the corresponding anchor point location based on the main encoding type and determines the event start time. For axial impact events, the moment when the axial change rate reaches its maximum value or the moment when the coupling potential index first exceeds the threshold is selected as the anchor point; for tangential motion start events, the first moment when the tangential transition index stably exceeds the threshold within several consecutive windows is selected as the anchor point; for rhythm candidate events, the first stable zero-crossing point or the first periodic peak of the signal after bandpass processing is selected as the anchor point. After determining the anchor point, the system rearranges the current encoding time window, constructs an alignment interval centered on the anchor point that includes the preceding and following time periods, and uniformly converts the original timestamps of each channel into a relative time representation relative to the anchor point. The system outputs trigger alignment data, including the anchor point time, the lengths of the preceding and following windows, and the aligned multi-channel time series.

[0151] Step S33: Select the encoding channel for the trigger alignment data to obtain the trigger selection data;

[0152] In one embodiment, the system generates a channel mask based on the main coding type and evidence identifier to filter key feature channels semantically related to the current event. For axial impact events, only the axial component, its gradient, and angular velocity modulus are retained; for tangential motion initiation events, the tangential amplitude, tangential direction consistency index, and angular velocity yaw component are retained; for rhythmic candidate events, the bandpass-processed tangential amplitude and period peak indication signal are retained; for calibration events, only the gravity direction change characteristics and angular velocity energy index are retained. When the coding strength level is low, or the system is in an event rate current-limited state, the channel set is pruned, retaining only the minimum number of core channels, while increasing the coding step size to reduce pulse density and power consumption. The system outputs trigger selection data, including the channel mask, coding step size configuration, and current discharge rate budget information.

[0153] Step S34: Perform pulse encapsulation based on the trigger selection data to obtain pulse coded data.

[0154] In one embodiment, for each selected channel, the system maintains a corresponding reconstruction reference value and calculates the deviation between the current signal value and the reference value. When the deviation exceeds a preset positive step size threshold, a positive pulse is output, and the reconstruction reference value is simultaneously increased; when the deviation is below a negative step size threshold, a negative pulse is output, and the reconstruction reference value is correspondingly decreased. This method forms an error-driven incremental modulation pulse stream, realizing the event-based representation of the signal. The system limits the maximum number of pulses within a unit time window. When the preset upper limit is exceeded, the encoding step size is temporarily increased or pulses from low-priority channels are discarded to maintain the discharge rate budget. The system adds start and end boundary pulses at the beginning and end positions of each encoding window to identify the segment range. The system not only determines whether the deviation exceeds the positive or negative threshold, but also records the degree to which the deviation exceeds the step size threshold, or the currently used step size level. When a multi-step size mechanism is used, different step sizes correspond to different pulse intensity levels; when the deviation is significantly greater than the threshold, it can also be mapped to a higher intensity indicator, thereby obtaining intensity information. The system encapsulates the pulse results as a sparse event list, including time difference, channel identifier, pulse polarity and intensity information, to obtain pulse coded data.

[0155] Preferably, the brain-like network construction specifically involves:

[0156] Step S41: Construct the input polarity mapping based on the pulse code data to obtain the input layer data;

[0157] In one embodiment, the system reads the time difference, channel identifier, pulse polarity, and intensity information contained in the pulse coding result, and performs polarity splitting on each physical channel, mapping it to two independent indices: a positive polarity input unit and a negative polarity input unit. When a positive polarity pulse is detected, only the corresponding positive polarity input unit is activated; when a negative polarity pulse is detected, only the corresponding negative polarity input unit is activated, thereby explicitly distinguishing signal direction information at the input layer. For start and end boundary pulses, the system allocates independent control channels to trigger the switching of subsequent sub-network paths or processing flows. The system recovers the discrete time step based on the time difference value, for example, reconstructing it at a millisecond-level time resolution, and merges multiple pulses within the same time step, using either a counting method or a saturation counting method to avoid numerical overflow. The system forms an input layer pulse matrix or event list structure as input layer data for the brain-like network model.

[0158] Step S42: Initialize the neural parameters of the input layer data to obtain neural parameter data;

[0159] In one embodiment, the system uniformly adopts a spiking neuron model in the input layer, intermediate layer, and readout layer, and performs fixed-point configuration based on edge computing power and storage budget. The spiking neuron model includes an input section consisting of a weighted synaptic input accumulation module, used to receive pulse signals from previous neurons or input channels, and accumulate and sum them according to corresponding weights to form the input current value of the current time step; the intermediate structure is a membrane potential state register unit, including a membrane potential register, a leakage attenuation operation unit, and a threshold comparison unit. At each time step, the membrane potential of the previous time step is first processed by leakage attenuation, and then the current input current is added to obtain the updated membrane potential; then, a threshold comparison is used to determine whether the discharge condition has been met, and a refractory period counter is used to determine whether pulse emission is allowed; the output section is a pulse generation and reset unit. When the membrane potential exceeds the threshold and is not in the refractory period, a discrete pulse signal is output, and the membrane potential is reset to the reference value and the refractory period counter is started. The output data includes the pulse flag of the current time step and the updated membrane potential value, used to pass to the next layer or readout layer. The system quantizes the range of membrane potential values, for example, by using a fixed-point representation in a fixed format. Neuron firing thresholds are set to preset levels, such as high, medium, and low, to match different target firing rate requirements. The leakage coefficient is selected based on the behavioral subnetwork type; for example, impact-type subnetworks use shorter time constants to enhance transient response, while rhythm-type subnetworks use longer time constants to maintain periodic memory characteristics. The refractory period is represented in discrete time steps, facilitating implementation at the edge through shifting and simple calculations. Synaptic weights are initialized to small random values ​​or template values ​​based on a rule base to ensure network initial state stability. The system outputs neural parameter data, including threshold settings, leakage coefficients, refractory period configurations, quantization parameters, and weight initialization seeds.

[0160] Step S43: Generate sparse topology for sub-network routing based on neural parameter data to obtain intermediate layer data;

[0161] In one embodiment, the system constructs a sub-network routing table based on trigger type and input channel set. For example, axially correlated inputs are connected only to the impact hidden cluster, tangential bandpass channels are connected only to the rhythm hidden cluster, and gravity and angular velocity channels are connected to the calibration hidden cluster, thereby achieving semantically partitioned sub-network organization. The network topology is stored in the form of a sparse adjacency list, limiting the maximum number of input and output connections for each neuron to control the computational scale. Connection generation follows the principle of nearest neighbor priority and a small number of shortcuts across clusters, that is, prioritizing the establishment of connections within the same functional cluster and establishing a small number of auxiliary connections between different clusters. During the inference phase / after the model has completed training or parameter solidification, in the execution phase where real-time input data is processed and recognition results are output in the actual operating environment, only connections triggered by events are updated to achieve event-driven computation. For each connection, the system writes the corresponding discrete-time delay parameters and initial weight values ​​to form a routing table, adjacency table, delay list, and weight list. The system outputs intermediate layer data.

[0162] Step S44: Perform neurodynamic constraint training based on the intermediate layer data to obtain sub-network training data;

[0163] In one embodiment, the system performs neurodynamic constraint training on each subnetwork based on intermediate layer data to generate subnetwork training data. The training process is carried out offline or during low-frequency maintenance, selecting a small number of labeled event segments as calibration samples. For the impact subnetwork, a short-term peak discharge and rapid fallback dynamic constraint is applied, meaning that within a short time interval after the event begins, the readout layer discharge count must reach a preset level, and then quickly return to a low discharge state after the time interval ends. For the rhythm subnetwork, a phase-locked constraint is applied, meaning that when the peak interval between adjacent cycles falls within the target range, the hidden layer discharge maintains a stable rhythmic pattern. During training, only the readout layer weights and a small number of key synaptic connections are updated, while the remaining connections remain frozen to reduce computational complexity and maintain topological stability. Weight updates adopt simplified rules based on pulse temporal correlation, such as increasing the weight level when both are activated within the same time window and decreasing the weight level when activated out of order, combined with weight range pruning and sparsity maintenance constraints to prevent excessive weight growth or overly dense networks. The system outputs subnetwork training data, including trained weight parameters and frozen connection identifiers.

[0164] Step S45: Perform lightweight transfer learning based on the subnetwork training data to obtain a brain-like network model.

[0165] In one embodiment, when a new individual or in a new wearing state, the system does not retrain the entire network. Instead, it performs local adaptive adjustments while maintaining the topology and most weights. The system uses short-term unlabeled running data to statistically analyze the baseline firing rate and readout layer bias of each sub-network, and adjusts the neuron firing threshold to ensure the overall firing rate falls within a preset target range. Only the readout layer is linearly calibrated, for example, by adjusting the output gain, bias, or a few key weight levels (key weight levels are a small number of discretized weight parameters in the readout layer that have a significant impact on the classification results), to clearly separate the confidence distributions of the impact, motion, and rhythmic outputs. After the migration adjustment is completed, the updated parameters are written to non-volatile storage, and an update cooldown period is set to avoid model drift caused by frequent adjustments. The system outputs a brain-like network model, including network topology, neuron parameters, weight parameters, routing table, and readout configuration, which can be directly used for edge-side event-driven inference.

[0166] Preferably, the behavior state machine fusion specifically includes:

[0167] Neural response data was obtained by analyzing neural responses using a brain-like network model.

[0168] In one embodiment, the system performs neural response analysis based on a constructed brain-like network model to generate neural response data. At the end of each trigger window, it reads two types of output information corresponding to each behavioral category from the readout layer: one is the pulse discharge count for that category, and the other is the average or peak value of the neuron membrane potential for that category. The system normalizes the pulse count, converting it into the average discharge ratio per unit time step; it performs interval normalization on the membrane potential, mapping it to a response intensity value between zero and one. The two normalization results are fused, and a response score for that category can be generated by taking the maximum value or by weighting with a fixed weight. While generating the score, the system records the corresponding evidence information, including the time of the response peak, the response duration, and the routing identifier of the triggered subnetwork. The system outputs neural response data, including arrays of response scores for each category, arrays of peak times, arrays of durations, and routing identifier information.

[0169] Behavioral confidence screening is performed on the neural response data to obtain neural screening data;

[0170] In one embodiment, the system performs behavioral confidence screening on neural response data to generate neural screening data. The system performs reliability gating on the response scores of each behavioral category. When the current time window is not in the gravity-stable region, is in an event rate limiting state (within the current sliding time window, the number of events or pulses triggered per unit time exceeds a preset upper limit threshold, or multiple consecutive windows are in a high event density state), or an abnormally high overall discharge rate of the readout layer is detected (possibly due to noise interference), all scores are uniformly downweighted to reduce the risk of misjudgment. The system sorts the scores of each category and calculates the difference between the highest-scoring category and the second-highest-scoring category to evaluate the decision discrimination. An entry threshold and an exit threshold are set. When the highest score reaches the entry threshold and the difference between it and the second-highest score exceeds a preset gap threshold, it is determined to be a valid candidate behavior; if only one of the conditions is met, it is marked as a low-confidence candidate and delayed until the next time window for review and decision. The system outputs neural screening data, including the category identifiers of the first and second ranked categories, the score of the first-ranked candidate, the difference between the two, the confidence level, and gating reason information.

[0171] Behavioral constraint data is generated by performing behavioral constraint generation on neural screening data.

[0172] In one embodiment, the system converts the current candidate behavior results into a structured constraint set, predefining mutual exclusion and compatibility relationships for various behaviors. For example, rumination, feeding, and walking are set as mutually exclusive groups, allowing only one of them as the dominant state at any given time; standing and rumination are set as compatible groups, but conditions such as low tangential energy must be met; limping behavior is limited to being allowed only in the walking state. Constraints are implemented in the form of rule tables, with each rule containing preconditions, candidate behavior conditions, and allow or reject decisions. For example, when the current state is walking and there is a gait asymmetry indicator, limping is allowed; when the candidate behavior is rumination and a stable rhythm is detected without axial impact, it is allowed to proceed; when the candidate behavior is running but the energy level is insufficient, it is directly rejected. Each constraint rule is accompanied by a necessary evidence bitmap to identify the source of the required detection features, ensuring traceability of the decision. The system outputs behavior constraint data, including the mutually exclusive set, the compatible set, the preconditions, and the required evidence identifiers.

[0173] A behavioral state architecture is constructed based on behavioral constraint data to obtain a behavioral state model.

[0174] In one embodiment, the system adopts a three-layer state machine structure, including a main state layer, a sub-state layer, and an event state layer. The main state layer adopts a finite state machine structure, including a state table, a current state register, a candidate buffer, and a counter unit. The state table predefines the main state number and priority; the candidate buffer is used to cache the candidate results of the most recent consecutive time windows; the entry counter and exit counter are used to count the number of windows that continuously meet the entry condition or exit condition, respectively, and the corresponding parameters include the entry window number threshold, the exit window number threshold, the minimum dwell time parameter of the main state parameter, and the main state cooldown time parameter; the sub-state layer establishes an independent sub-state sub-table for each main state, including the sub-state number, the allowed switching matrix, and the sub-state determination condition. The sub-state transition counter and minimum sub-state duration parameters are configured to control the stable output of subdivided modes such as slow walking and fast walking, head down and head up. The event state layer adopts an independent event queue structure, including an event type table, a timestamp buffer, an intensity level field, and an evidence identifier field, and configures an event duration counter and event trigger threshold parameters. The state machine structure parameters (such as the state table, allowed transition matrix, mutual exclusion relationship, etc.) are preset rule parameters. Time-related and threshold-related parameters (such as the entry window threshold, exit window threshold, minimum dwell time parameter of the main state, main state cooldown time parameter, event trigger threshold parameter, etc.) can be given empirical initial value ranges in the initial stage of the system, and then determined based on statistical analysis and offline calibration of sample data. Some threshold parameters related to confidence or energy can be optimized by combining the aforementioned neural network output characteristics, for example, by tuning based on the false positive rate and false negative rate on the validation set. The event state does not participate in the main state transition logic, but only outputs an abnormal trigger signal to the sub-state layer when the continuous trigger threshold and safety rules are met. The main state represents core behavior categories, such as lying down, standing, walking, and feeding. Sub-states represent sub-forms within the main state, such as slow walking versus fast walking, or head tilting versus head tilting while feeding. Event states record transient events, such as impacts, head-shaking, or calibration behaviors, and do not directly alter the main state. State transitions employ a combination of hysteresis, minimum dwell time, and a cooling-off mechanism. Entering a main state requires meeting candidate conditions and passing behavioral constraint checks within several consecutive time windows; exiting a main state requires the state to be below the exit threshold for several consecutive windows. Each main state has a minimum dwell time; during this dwell time, only sub-state transitions are allowed, not main state jumps. A cooling-off period is initiated after a main state transition to prevent rapid back-and-forth fluctuations. The system outputs a behavioral state model, including a set of states, transition rules, entry and exit window parameters, minimum dwell time, cooling-off time, and a priority table.

[0175] By isolating the main state of events from the behavioral state model, a livestock and poultry behavior recognition model is obtained.

[0176] In one embodiment, the system employs an insertion-without-perturbation strategy for event-type outputs such as impacts, head-shaking, and loosening calibration. That is, when a corresponding event is detected, only the event type, occurrence time, intensity level, and evidence information are recorded in the event queue, and an event marker is added to the current main state, without directly triggering a main state transition. An abnormal sub-state is only allowed to be triggered when a certain type of event occurs frequently within a continuous time period and meets preset safety rules; for example, frequent continuous impacts can trigger an abnormal behavior sub-state determination. The recorded event marker information can be used for statistical analysis, such as calculating the number of ruminations or impact frequencies, and can also serve as a basis for risk warnings, such as lameness risk alerts. The system outputs a livestock behavior recognition model, including a main state sequence, sub-state sequences, and event log records.

[0177] Preferably, this application also provides a livestock and poultry behavior recognition system based on brain-like networks, used to execute the livestock and poultry behavior recognition method based on brain-like networks as described above. The livestock and poultry behavior recognition system based on brain-like networks includes:

[0178] The attitude and motion decoupling module is used to acquire collar-end data; based on the collar-end data, gravity component estimation and motion component separation are performed to obtain gravity component data and motion component data respectively;

[0179] The dual-channel trigger determination module is used to determine the trigger based on gravity component data and motion component data, and obtain trigger determination data.

[0180] The pulse coding module is used to perform pulse coding based on the trigger determination data to obtain pulse coding data;

[0181] The brain-like behavior fusion and recognition module is used to construct a brain-like network based on pulse coding data to obtain a brain-like network model; and to fuse the behavior state machine based on the brain-like network model to obtain a livestock and poultry behavior recognition model.

Claims

1. A method for livestock and poultry behavior recognition based on brain-like networks, characterized in that, Includes the following steps: Step S1: Obtain data from the collar end; Gravity component estimation and motion component separation are performed based on data from the collar end, resulting in gravity component data and motion component data respectively; Step S2: Construct a gravity stability domain for the gravity component data to obtain gravity stability domain data; Dual-channel abrupt change detection is performed on the motion component data to obtain dual-channel detection data, which includes axial direction detection and tangential direction detection. The dual-channel detection data includes axial direction detection data and tangential direction detection data. Sparse constraint data is obtained by constraining the sparse event rate based on gravity stability domain data and dual-channel detection data. A consistency hysteresis decision is performed on sparse constraint data to obtain trigger decision data; Step S3: Perform pulse coding based on the trigger determination data to obtain pulse coded data; Step S4: Construct a brain-like network based on the pulse coding data to obtain a brain-like network model; fuse the behavioral state machine based on the brain-like network model to obtain a livestock and poultry behavior recognition model; The axial direction detection is specifically as follows: Axial component data is obtained from motion component data; local trajectory data is constructed based on axial component data; local energy evolution is performed on local trajectory data to obtain energy evolution data; gradient curvature coupling is performed on energy evolution data to obtain gradient curvature coupling data; phase breakage index is calculated based on gradient curvature coupling data to obtain phase breakage index data; axial phase stability failure detection is performed based on phase breakage index data to obtain axial abrupt change data; and conflict morphology is screened from axial abrupt change data to obtain axial direction detection data. Tangential direction detection specifically involves: Tangential component acquisition is performed on the motion component data to obtain tangential component data; energy transition processing is performed on the tangential component data to obtain tangential mutation data; directional filtering and rhythm detection are performed on the tangential mutation data to obtain directional filtering data and rhythm detection data, respectively. The directional screening data and rhythm detection data are integrated to obtain tangential detection data.

2. The method according to claim 1, characterized in that, Step S1 is as follows: Acquire data from the collar end; Based on the data from the collar end, collar loosening is determined, and collar loosening data is obtained; The fast and slow gravity data were compared to the data on the loosening of the collar. Angular velocity-gated gravity suppression is applied to fast and slow gravity data to obtain gravity suppression data; By projecting the gravity suppression data along the gravity cone constraint direction, gravity component data can be obtained. Wearing coordinate data is obtained by reconstructing the wearing coordinates based on gravity suppression data; Motion component separation is performed on the wearer's coordinate data to obtain motion component data.

3. The method according to claim 2, characterized in that, Angular velocity gating gravity suppression specifically refers to: The difference in gravity data at different speeds is calculated and the angular velocity gating coefficient is generated, resulting in difference data and angular velocity gating coefficient data, respectively. Gravity update suppression is performed based on the difference data and angular velocity gating coefficient data to obtain gravity suppression data.

4. The method according to claim 1, characterized in that, Step S3 is as follows: The trigger type is encoded based on the trigger determination data to obtain the trigger encoding data; Perform event semantic anchoring processing on the triggered encoded data to obtain triggered aligned data; The trigger alignment data is encoded by selecting the channel to obtain the trigger selection data; Pulse encapsulation is performed based on the trigger selection data to obtain pulse coded data.

5. The method according to claim 1, characterized in that, The specific construction of brain-like networks is as follows: The input layer data is obtained by constructing a polarity mapping input based on the pulse code data. The neural parameters are initialized from the input layer data to obtain neural parameter data. Sparse topology generation of sub-network routing is performed based on neural parameter data to obtain intermediate layer data; Neurodynamic constraint training is performed based on intermediate layer data to obtain subnetwork training data; Lightweight transfer learning is performed based on the subnetwork training data to obtain a brain-like network model.

6. The method according to claim 1, characterized in that, The fusion of behavioral state machines specifically involves: Neural response data was obtained by analyzing neural responses using a brain-like network model. Behavioral confidence screening is performed on the neural response data to obtain neural screening data; Behavioral constraint data is generated by performing behavioral constraint generation on neural screening data. A behavioral state architecture is constructed based on behavioral constraint data to obtain a behavioral state model. By isolating the main state of events from the behavioral state model, a livestock and poultry behavior recognition model is obtained.

7. A livestock and poultry behavior recognition system based on brain-like networks, characterized in that, For executing the brain-like network-based livestock and poultry behavior recognition method as described in claim 1, the brain-like network-based livestock and poultry behavior recognition system comprises: The attitude and motion decoupling module is used to acquire collar-end data; based on the collar-end data, gravity component estimation and motion component separation are performed to obtain gravity component data and motion component data respectively; The dual-channel trigger determination module is used to determine the trigger based on gravity component data and motion component data, and obtain trigger determination data. The pulse coding module is used to perform pulse coding based on the trigger determination data to obtain pulse coding data; The brain-like behavior fusion and recognition module is used to construct a brain-like network based on pulse coding data to obtain a brain-like network model; and to fuse the behavior state machine based on the brain-like network model to obtain a livestock and poultry behavior recognition model.