Ear tag system for pig behavior recognition based on three-axis attitude angle
By designing a pig behavior identification ear tag system based on three-axis attitude angles and utilizing gyroscope modules and intelligent algorithms, high-precision, low-power identification of pig behavior is achieved, solving the problems of inaccurate identification and high power consumption in existing technologies and improving the level of intelligent breeding management.
Patent Information
- Application Number
- CN202510946510.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-10-10
Smart Images

Figure CN120753206A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent management of livestock, in particular to a pig behavior recognition ear tag system based on three-axis attitude angle, which is used to realize automatic recognition and remote monitoring of pig behavior. BACKGROUND
[0002] With the development of intelligent breeding, the health management of pigs gradually shifts from manual inspection to intelligent recognition relying on wearable devices. Traditional recognition methods are mostly based on infrared temperature measurement, image analysis or acceleration sensors, but there are still deficiencies in continuous behavior pattern recognition, behavior chain construction and energy consumption control.
[0003] The three-axis attitude angle (i.e. yaw, pitch, roll) collected by the gyroscope can provide continuous data of the spatial motion state of the pig, which is an important signal source for describing the behavior state of the individual. However, there is currently a lack of an ear tag system that focuses on the identification path of the attitude angle, which can rely solely on attitude angle data to achieve accurate identification of pig behavior and avoid the cost and power consumption problems caused by multiple sensor cooperation.
[0004] Therefore, it is urgent to design an ear tag system for behavior recognition that integrates a gyroscope and uses three-axis attitude angle data as the only basis for behavior recognition, establishes a complete hardware and software recognition path, and realizes the closed-loop capability of behavior determination and early warning output. SUMMARY
[0005] The purpose of the present application is to provide a pig behavior recognition ear tag system based on three-axis attitude angle, which can realize real-time collection, behavior recognition and remote early warning of pig behavior, and improve the intelligent level of breeding and reduce management costs.
[0006] The system structure of the present application includes the following contents: Wearable terminal: an intelligent ear tag that can be worn on the ear of a pig, used to realize fixed installation and stable collection of the device; Gyroscope sensor: a low-power three-axis gyroscope module integrated in the ear tag, used to collect real-time three-axis attitude angle data such as yaw, pitch and roll of the pig; Attitude angle acquisition module: responsible for sampling, filtering and standardizing the three-axis angle data; Behavior recognition module: used to perform behavior recognition operations based on the attitude angle data, outputting behavior category labels or early warning information. This module can include but is not limited to the following mechanisms: Weighted scoring function based on attitude angle fluctuation amplitude; Fast Fourier transform analysis of frequency domain energy features based on time series attitude angle signals; Mutation detection algorithms based on sliding window statistics (such as Z-score or coefficient of variation CV); State transition probability modeling method based on discretized behavior state labels.
[0007] Communication module: used to send recognition results to the back-end management platform or cloud via low-power wireless methods such as Bluetooth and LoRa; Early warning output module: converts behavior recognition results into structured behavior tags, log information or real-time alarms to assist managers in decision-making.
[0008] In the system of the present invention, three-axis attitude angle data is collected in real time by a gyroscope sensor integrated into the ear tag terminal, without relying on other sensors such as accelerometers, temperature sensors, and sound modules. The ear tag terminal is a dedicated identification terminal, and its structural and functional design focuses on supporting pig behavior recognition and early warning, rather than a general information collection device.
[0009] In the system described in this invention, the core behavioral judgment module of the recognition module is based on modeling and reasoning based on three-axis attitude angle data (i.e., yaw, pitch, and roll) collected by the gyroscope sensor. Although the system can technically be expanded at the hardware level to include other sensors (such as accelerometers, thermometers, and microphones), the technical approach of this invention explicitly focuses on abnormal behavior analysis using three-axis attitude angles as the primary signal source.
[0010] The various recognition algorithm modules described in this invention (including weighted scoring models, frequency domain feature extraction, mutation detection mechanisms, and behavioral state transition modeling) are based on the analysis of continuous attitude angle signals, rather than relying on the collaborative calculation of other modalities. Therefore, even if the system adds other hardware modules in the future, as long as the recognition path still focuses on attitude angle judgment and analysis, it will be considered to be using the core method logic of this invention and fall within the scope of protection.
[0011] The present invention aims to solve the following technical problems: Wearability: The ear tag structure is easy to wear and monitor over a long period of time, enabling continuous tracking of individual pigs’ spatial postures. Low power consumption and high reliability: Relying on a single gyroscope sensor to collect three-axis attitude angle data, reducing overall system power consumption and material costs; High-precision recognition capability: Utilizing a combined algorithm mechanism, it enables real-time, high-confidence recognition of multiple behaviors, including estrus, labor, startle, and mania; Continuous behavior chain judgment: supports evolutionary path modeling of attitude angle behavior states, timely identifies continuous abnormal behavior sequences and outputs warnings; Closed-loop system architecture: Build a full-process system structure of "ear tag terminal → data collection → behavior recognition → communication upload → output warning".
[0012] Compared with the prior art, the present invention has the following significant advantages: Simple structure and easy deployment: This system uses an ear tag terminal with an internal integrated gyroscope to complete three-axis attitude angle data acquisition, without the need for complex wiring or external equipment, and is suitable for large-scale pig use.
[0013] Accurate identification and efficient algorithm: Through mechanisms such as weighted scoring, frequency domain analysis, mutation detection and state transition modeling, the system can accurately identify typical behaviors such as lying down, feeding, and estrus, thereby improving the intelligent level of breeding management.
[0014] Low power consumption and strong adaptability: The sampling frequency and recognition period can be dynamically adjusted to achieve low-power operation, adapt to pigs of different sizes and breeds, and are suitable for all-weather continuous behavior monitoring.
[0015] Single signal and less interference: This system performs behavior analysis based only on three-axis attitude angle signals, avoiding environmental interference caused by multimodal information such as images and sounds, and improving recognition stability and robustness.
[0016] Data can be remotely and synchronously analyzed: support uploading recognition results to the remote management platform via Bluetooth, LoRa, Wi-Fi, etc., to achieve behavior logging, health trend assessment and intelligent early warning.
[0017] The system of the present invention forms a clear structure-data-model integrated recognition link through the complete path of "ear tag + posture angle sensor + behavior recognition algorithm". It is particularly worth emphasizing that the present invention has clearly pointed out in the specification: While the ear tag system can theoretically be expanded to include other sensing modules (such as acceleration, temperature, and sound), this invention established a primary recognition approach based solely on three-axis attitude angle data during the design and modeling phase. The various models and decision-making mechanisms within the behavior recognition module utilize yaw, pitch, and roll data captured by the gyroscope as their primary input.
[0018] Therefore, even if a multimodal sensing device is introduced into another person's system, as long as its recognition logic continues to rely on the three-axis attitude angle as the core judgment basis, it should be considered to fall within the scope of the technology covered by the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 , system structure diagram; Figure 2 、 three Axis attitude angle collection and processing flow chart; Figure 3 ,Multi-dimensional algorithm structure diagram; Figure 4 , attitude angle frequency domain analysis diagram; Figure 5 , state transition path diagram; Figure 6 , attitude angle behavior trend graph (weak vs. normal); Figure 7 , ear tag wearing structure diagram. DETAILED DESCRIPTION
[0020] To further illustrate the structure and method of the present invention, the following section describes the technical implementation scheme of the present invention in detail, combining the system composition, operating mechanism, and multiple practical application scenarios. The present invention is not limited to the following specific examples; any equivalent replacement, module combination, and functional expansion within the technical concept of the present invention are considered to be within the scope of the technical solution of the present invention.
[0021] Example 1: Rollover Behavior Identification Based on Weighted Scoring Function
[0022] In this embodiment, the ear tag terminal collects the pig's three-axis posture angle data through the built-in gyroscope sensor. The system sets a weighted scoring function: in: : The maximum fluctuation amplitude of the attitude angle within the unit time window; : Weight coefficient obtained by empirical setting or historical data training; S: Active behavior score.
[0023] When S exceeds the set threshold and persists for more than 5 seconds, it is considered a continuous rollover behavior. This behavior recognition model runs on the local processing chip, directly outputting rollover alarms and uploading them to the cloud platform via the LoRa module.
[0024] Example 2: Identification of manic behavior based on frequency domain feature extraction
[0025] This embodiment uses the fast Fourier transform (FFT) method to perform spectrum conversion on the continuously collected attitude angle data and extract the power peak P in the range of 0.2–0.4 Hz. peak .
[0026] When the power of this frequency band continues to be abnormally amplified within a certain period of time (2.5 times higher than the daily average), the system will mark it as high-frequency and violent behavior, and combined with the behavior library, it will be determined as "suspected madness."
[0027] Example 3: Startle behavior recognition based on sliding window
[0028] The system sets a 10-second sliding window and performs a Z-score test on the fluctuation range of Pitch and Roll:
[0029] If |Z| > 2.5 occurs more than five times in a row, the "mutational abnormal behavior" flag is triggered. This algorithm is used to identify stress-related anomalies such as startle and sudden jump, and is suitable for deployment in stress monitoring scenarios.
[0030] Example 4: Identifying labor warning based on state transition path
[0031] This embodiment discretizes the attitude angle fluctuation range and maps it into behavior states: Pitch > 30°: State B (supine) Roll ±20°: State C (left and right roll) Yaw Δ> 45°: State A (frequent head turning) The system records the state sequence: B->C->A->C->A. If the sequence highly matches the known "prenatal anxiety" template and continues to appear, it is judged as "suspected labor" based on the behavioral scoring threshold.
[0032] Example 5: Energy consumption control and dynamic sampling strategy
[0033] During inactive periods (such as at night), the system automatically reduces the posture angle sampling frequency to 1 Hz. When it detects significant fluctuations in the pig's status, it dynamically switches to a 10 Hz sampling rate and activates the recognition module at full power, achieving a dynamic balance between energy conservation and recognition accuracy. This strategy, pre-configured in the embedded firmware, is suitable for long-term deployment in large-scale pig farms.
[0034] Example 6: Identifying pig estrus behavior based on spatial diffusion and turning frequency
[0035] Before and after a pig enters estrus, its movement path will show characteristics of increased spatial trajectory diffusion and increased turning frequency. The system uses the following posture angle index combination to identify: Yaw change frequency: ΔYaw > 30° ≥ 15 times per minute; Attitude angle trajectory dispersion D: The sampling path coverage area is significantly higher than its historical average within 10 minutes (e.g., more than 2 times); Direction switching density: The Yaw repeatedly swings within the range of ±45° for a number of times ≥ the threshold.
[0036] When the system detects that the above three conditions are met at the same time and the behavior lasts for more than 15 minutes, it outputs the "suspected estrus behavior" mark.
[0037] This method avoids judgment errors based on calls or body temperature and has stronger behavioral universality.
[0038] Example 7: Pig fighting behavior recognition based on posture angle mutation and high-frequency jitter
[0039] When pigs fight, they usually show violent head twisting, rolling, and violent body confrontation. The system mainly judges based on the following posture angle feature combination: The Z-score of Roll and Pitch exceeds ±3 continuously within a 10-second sliding window for a duration of ≥ 5 seconds; Yaw high-frequency change rate exceeds the set threshold (e.g. 3 times / second); The roll angle fluctuates violently above 30° and exceeds the set frequency (e.g. > 10 times / minute); The state sequence is identified as: turn head A → roll over C → turn head A again → look up B, which matches the "fighting action path".
[0040] Based on the above conditions, the system automatically determines whether the pigs are involved in suspected fighting behavior, outputs a high-level risk alert, and generates a log for traceability management.
[0041] Example 8: Identifying Pigs' Frequent Biting Behavior Based on Slightly Repeated Posture Angle Patterns When pigs exhibit abnormal behavior such as agitation, licking fences, or biting companions, their heads often exhibit high-frequency, small-amplitude, and rhythmic, repetitive back-and-forth pitching movements. This behavior can be modeled and identified by the slight periodic changes in pitch angle. The specific method is as follows:
[0042] 1. Attitude angle feature extraction: Pitch oscillation frequency range: mainly concentrated in 0.6–1.5 Hz; Pitch peak-to-valley amplitude Δθ: averaged between 5–20° (representing slight pitch); Spectral feature P_peak extraction:
[0043]
[0044] If the power spectrum peak in this frequency range exceeds twice the historical background threshold, it is considered as high-intensity repetitive biting behavior.
[0045] 2. Continuity rule: If the pitch peak interval is stable at around 0.8s and occurs ≥ 10 times in a row, it is considered abnormal repetitive biting.
[0046] 3. Output content: The system marks "frequent biting behavior"; It can be combined with other behavioral markers for joint intervention (such as anxiety during breeding period, abnormal environmental stimulation, etc.).
[0047] Example 9: Field deployment of ear tag wearing method
[0048] The ear tag terminal used in this system is designed with full consideration of the physiological structure of pigs and environmental factors at the breeding site, ensuring the stability of three-axis attitude angle data collection and the safety of wearing.
[0049] 1. Wearing position and method: The ear tag is installed on the pig's ear near the root area through a bilateral clip-on structure or a puncture-fixed structure; This position has a relatively stable spatial reference point and can better reflect the spatial orientation and movement state of the individual's head; Ensure the authenticity and representativeness of posture angle change signals without affecting pigs' feeding, resting and social behavior.
[0050] 2. Stability and anti-tampering structure: The ear tag is made of medical-grade flexible material and has a lightweight design to avoid burden. Supports multiple fixing methods such as anti-tamper screws, closed-loop cable ties, and buckle locking, and has a certain ability to prevent human disassembly and pigs from breaking out on their own; When worn, the center of gravity of the device fits inward against the ear, ensuring that the three-axis gyroscope chip is located at the center of gravity, enhancing the stability of posture data sampling.
[0051] 3. Deployment process: During the weaning to fattening stage, farmers can uniformly wear ear tag terminals during the pig vaccination stage; The system will automatically bind the individual’s identity and establish a digital profile with the identification platform; No subsequent manual intervention is required. The device automatically collects and uploads attitude angle data, and the platform performs behavior recognition and log recording.
[0052] 4. Operation, maintenance and replacement: If the device runs out of power or is damaged, the breeder can quickly replace it in the pen; The system supports rebinding via Bluetooth or handheld terminals to ensure continuity of device use.
[0053] Example 10: Identifying behavioral changes of early symptoms of African swine fever (ASF) based on posture angle fluctuation trends.
[0054] In the early stages of African swine fever, pigs often exhibit the following behavioral characteristics: Mental fatigue and unsteadiness; Reduced activity and prolonged lying down time; The movement of getting up and lying down is slow, and the frequency of turning over is reduced; The individual's body position is tilted and the standing posture is asymmetrical.
[0055] These behavioral changes can be modeled and identified through the stability and fluctuation of the three-axis attitude angles. In particular, in the absence of thermal sensation and acceleration input, early motion abnormality signals can still be accurately extracted.
[0056] 1. Attitude angle stability degradation index
[0057] In the sliding window w=60s, the standard deviation of Pitch and Roll per second is calculated:
[0058] If both tend to be 0 for a long time, it may mean that you have been motionless or lying down for a long time.
[0059] 2. Posture angle deviation index
[0060] Calculate the average Roll deviation (i.e. sideways tilt): If the deviation persists >20° and remains stable for ≥10 minutes, it indicates an abnormal posture or a weak recumbent state.
[0061] 3. Activity frequency sparseness analysis: Record the number of Yaw and Pitch peaks within one minute; If it is less than 30% of the individual's average daily activity, it is considered "abnormal inactivity" behavior.
[0062] Output identification tag: Early warning of suspected weakness behavior / disease (ASF related).
[0063] The support system issues a "concern behavior alert" and recommends manual inspection.
Claims
1. An ear tag system for identifying abnormal pig behavior, characterized in that: include: A terminal device that can be worn on the pig's ear; The gyroscope sensor integrated in the terminal device is used to collect the pig's three-axis attitude angle data in real time, including yaw angle (Yaw), pitch angle (Pitch) and roll angle (Roll); A behavior recognition module, configured to perform a behavior recognition operation based on the three-axis attitude angle data and output a behavior category label or warning information; The behaviors include but are not limited to estrus, labor, startle, rolling, madness and the like.
2. The system according to claim 1, wherein: The behavior recognition module includes at least one of the following recognition mechanisms: A weighted scoring model based on the amplitude of attitude angle change; Frequency domain feature extraction based on attitude angle time series data; Mutation detection algorithm based on sliding window statistics; State transition modeling algorithm based on discretized behavior labels.
3. The system according to claim 1, wherein: The three-axis attitude angle is directly collected by the gyroscope sensor, and the terminal device does not need to rely on other sensors such as accelerometers, temperature sensors or microphones to achieve behavior recognition.
4. The system according to claim 1, wherein: The behavior recognition module is deployed in an embedded processing chip inside the terminal device, or communicates with a remote server wirelessly to achieve data analysis.
5. The system according to claim 1, wherein The terminal device sends the identification result to the pig management platform via a low-power wireless communication method, and the communication method includes but is not limited to Bluetooth, LoRa, Wi-Fi or cellular network.
6. The system according to claim 1, wherein: The acquisition frequency of the attitude angle data can be dynamically adjusted to improve sampling accuracy during target behavior recognition and reduce energy consumption during non-target periods.
7. The system according to claim 1, wherein: The behavior recognition module supports behavior classification and logging functions for evaluating pig behavior trends and health status.
8. The system according to any one of claims 1 to 7, wherein: The main feature extraction and classification judgment basis in the behavior recognition module is the three-axis attitude angle data. Even if the system integrates other types of sensors, the dominant input signal of its recognition logic is still limited to the attitude angle data collected by the gyroscope.