Sow farrowing risk early warning method, device and system

By using multimodal perception of visual and vital signs signals, the behavior and physiological characteristics of sows can be monitored in real time, solving the problems of lag and underreporting in manual monitoring during sow farrowing. This enables intelligent monitoring and data recording of the sow farrowing process, improving the survival rate of newborn piglets and the efficiency of breeding management.

CN122123808APending Publication Date: 2026-06-02AGRI INFORMATION INST OF CHINESE ACAD OF AGRI SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610001913.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-04
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Current technologies lack intelligent early warning systems for sow farrowing, leading to delayed manual monitoring, missed reports, and untimely risk responses, which affect the survival rate of newborn piglets and the economic benefits of pig farming.

Method used

By using multimodal perception of visual data and vital signs, the behavior and physiological characteristics of sows are extracted. Combined with posture estimation models and target detection algorithms, the sows' farrowing status and the birth of newborn piglets are monitored in real time, triggering alarms and recording farrowing process data.

Benefits of technology

It enables intelligent monitoring of the sow's farrowing process, timely warning of abnormal conditions, improves the survival rate of newborn piglets and the efficiency of breeding management, and reduces losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122123808A_ABST
    Figure CN122123808A_ABST
Patent Text Reader

Abstract

The application provides a sow delivery risk early warning method, device and system, the method comprises the following steps: extracting the behavior characteristics of sows based on the visual data of sow delivery area, and extracting physiological characteristics based on the vital signs signals of sows, and determining whether the sows enter the labor state according to the combination of behavior characteristics and physiological characteristics; when it is determined that the sows enter the labor state, monitoring the birth event of newborn piglets based on the continuous visual data, and monitoring the abnormal conditions in the delivery process based on the visual data and / or vital signs signals; for each newborn piglet monitored, evaluating the movement activity of the newborn piglet after birth based on the visual data of the newborn piglet; when the abnormal conditions or the movement activity is insufficient, triggering an alarm; and recording the delivery process data. The application can realize intelligent monitoring and data recording of the sow delivery process, and greatly improve the survival rate of newborn piglets and the breeding management efficiency.
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, device and system for early warning of farrowing risks in sows. Background Technology

[0002] In modern pig farming, the onset and farrowing of sows are crucial to piglet survival rates and economic benefits. Traditionally, this relies on manual monitoring by farm workers, who observe the sow's behavior and condition to determine if farrowing is imminent or if dystocia is occurring. However, due to limited manpower and the fact that multiple sows are often in labor simultaneously, manual monitoring is prone to delays or omissions. When farm workers fail to detect signs of impending labor or dystocia in a timely manner, it may result in the inability to provide timely assistance, leading to newborn piglet suffocation or postpartum health problems for the sow, causing economic losses for farmers. Even with video surveillance in some farms, long hours of monitoring are required, and neglecting to monitor can still lead to missed opportunities. Furthermore, the current lack of intelligent early warning systems for the sow farrowing process means that remedial measures can only be taken after an incident occurs, making it difficult to mitigate losses promptly. Therefore, there is an urgent need for a technology that can automatically monitor signs of impending labor in sows and provide timely warnings when abnormalities are detected, in order to improve the timeliness and effectiveness of sow farrowing management. Summary of the Invention

[0003] This invention provides a method, device, and system for early warning of risks associated with sow farrowing, addressing the shortcomings of existing manual monitoring techniques for sow farrowing, such as delays, missed reports, and untimely risk responses. It achieves intelligent monitoring and data recording of the sow farrowing process, significantly improving the survival rate of newborn piglets and the efficiency of breeding management. The technical solution proposed by this invention is as follows: In a first aspect, the present invention provides a method for early warning of farrowing risks in sows, comprising: Behavioral features of sows are extracted based on visual data of the sow's farrowing area, and physiological features are extracted based on the sow's vital signs. The combination of the behavioral features and the physiological features is used to determine whether the sow has entered the farrowing state. Once the labor process is determined, the birth of newborn piglets is monitored based on continuous visual data, and abnormal conditions during the delivery process are monitored based on visual data and / or vital signs. For each newborn piglet monitored, the piglet's motor activity after birth was assessed based on the newborn piglet's visual data; An alarm is triggered when an abnormal condition is detected, or when the child's activity level is insufficient; and the delivery process data is recorded.

[0004] Optionally, the behavioral feature is a motion amplitude parameter obtained based on skeletal key point detection, and the physiological feature is a heart rate or respiratory rate obtained based on millimeter-wave radar signals. The step of determining whether the sow has entered the farrowing state based on a combination of the behavioral and physiological features includes: When the rate of change of the motion amplitude parameter exceeds a first preset threshold, a first determination signal is generated; When the increase in heart rate or respiratory rate relative to the reference value exceeds the second preset threshold, a second determination signal is generated; When the first and second determination signals are both established, the sow is determined to be in the pre-partum state.

[0005] Optionally, the monitoring of abnormal conditions during childbirth includes: The newborn piglets in the visual data are identified by the target detection model, the birth time of the newborn piglets is recorded, and the farrowing interval is calculated based on the continuously recorded birth times. When the birthing interval exceeds a third preset threshold, it is determined to be a first abnormal situation; Simultaneously, the bleeding area in the sow's hindquarters is monitored based on the visual data; If the bleeding area increases beyond a fourth preset threshold within a preset time period after the birth of newborn piglets, it is determined to be a second abnormal condition. The bleeding area in the hindquarters region of the sow monitored based on the visual data includes: In the visual data, a region of interest including the sow's vulva and the surrounding ground is defined; The image of the region of interest is converted to the HSV color space to separate the tonal information of the image; Based on the hue information, the number of pixels within a preset hue range is counted, and the number of pixels is used as a parameter characterizing the bleeding area.

[0006] Optionally, the monitoring of abnormal conditions during childbirth also includes: Based on the vital signs signals, the sow's respiratory rate and heart rate are obtained; When, during childbirth, the fluctuation range of the respiratory rate exceeds a preset percentage of the baseline value, and / or the duration of the heart rate exceeding the fifth preset threshold reaches the first preset time window, it is determined to be a third abnormal condition.

[0007] Optionally, the assessment of the newborn piglets' motor activity after birth based on their visual data includes: The visual data of the newborn piglets is tracked to generate a position sequence of the newborn piglets within a second preset time window; The cumulative movement distance of newborn piglets is calculated based on the location sequence. When the cumulative movement distance is lower than the sixth preset threshold, it is determined that the piglets have insufficient exercise vitality.

[0008] Secondly, the present invention also provides a sow farrowing risk early warning device, comprising the following modules: The pre-partum state judgment module is used to extract the sow's behavioral characteristics based on visual data of the sow's farrowing area, and extract physiological characteristics based on the sow's vital signs signals, and determine whether the sow has entered the pre-partum state based on the combination of the behavioral characteristics and the physiological characteristics. The abnormal state monitoring module is used to monitor the birth events of newborn piglets based on continuous visual data after determining that the piglets have entered the labor state, and to monitor abnormal conditions during the parturition process based on visual data and / or vital signs signals. The exercise activity assessment module is used to assess the exercise activity of each newborn piglet after birth based on the visual data of the newborn piglet. The alarm recording module is used to trigger an alarm when an abnormal situation is detected or when the child's activity level is insufficient; and to record data of the childbirth process.

[0009] Thirdly, the present invention also provides a sow farrowing risk early warning system, comprising: The visual acquisition unit is used to collect visual data of the farrowing area of ​​sows. The vital signs acquisition unit is used to collect vital signs signals from sows. As described in the second aspect, a sow farrowing risk warning device; The device is connected to the visual acquisition unit and the vital signs acquisition unit.

[0010] Fourthly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the sow farrowing risk warning method as described in the first aspect above.

[0011] Fifthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the sow farrowing risk warning method as described in the first aspect above.

[0012] In a sixth aspect, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the sow farrowing risk warning method as described in the first aspect above.

[0013] Based on the above technical solution, the beneficial effects of the present invention compared with the prior art are as follows: The present invention provides a method, device, and system for early warning of sow farrowing risks. Based on visual data and vital signs from the sow's farrowing area, it automatically extracts features to determine whether the sow has entered the farrowing state. This eliminates the need for constant manual observation, avoiding delays and omissions due to insufficient manpower. Traditional manual monitoring or video surveillance requires active observation by personnel; neglecting monitoring can lead to missed critical moments, and existing methods lack intelligent early warning, often relying on post-accident remediation. The present invention, after determining that the sow has entered the farrowing state, continuously monitors newborn piglet birth events and abnormal conditions during the farrowing process based on visual data. When abnormal conditions or insufficient activity in newborn piglets are detected, an alarm is immediately triggered, enabling timely measures to reduce losses. Traditional methods struggle to comprehensively and systematically record farrowing process data. The present invention records farrowing process data during monitoring, achieving intelligent monitoring and data recording of the sow's farrowing process. This facilitates subsequent analysis and summarization, providing a basis for breeding management and significantly improving the survival rate of newborn piglets and the efficiency of breeding management.

[0014] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.

[0015] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the sow farrowing risk early warning method provided by the present invention.

[0018] Figure 2 This is a schematic diagram of the application scenario provided by the present invention.

[0019] Figure 3 This is a schematic diagram of the sow farrowing risk early warning device provided by the present invention.

[0020] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention.

[0021] Figure label: 1. Edge device; 2. Limit bar; 3. Visual acquisition unit; 4. Vital signs acquisition unit; 5. Labor event archiving and linkage module. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0023] The purpose of this invention is to overcome the shortcomings of existing technologies in manual monitoring of sow farrowing, such as delays, missed reports, and untimely risk responses, and to provide a method, device, and system for early warning of sow farrowing risks. Through a multimodal perception approach combining visual acquisition units and vital sign acquisition units, the invention monitors and analyzes the behavioral characteristics and physiological state of sows before and after farrowing, promptly detecting signals that the sow is about to give birth and issuing early warnings for potential dystocia risks. This achieves intelligent monitoring and recording of important data during the sow's farrowing process, significantly improving the survival rate of newborn piglets and the efficiency of breeding management.

[0024] Reference Figure 1 As shown, the sow farrowing risk early warning method includes: S110. Extract behavioral characteristics of the sow based on visual data of the sow's farrowing area, and extract physiological characteristics based on the sow's vital signs signals. Determine whether the sow has entered the farrowing state based on the combination of the behavioral characteristics and the physiological characteristics.

[0025] Image sequences of the sow's farrowing area are acquired through visual acquisition unit 3. Visual acquisition unit 3 can be a network camera, depth camera, etc. In this embodiment, a 4-megapixel infrared network camera is specifically used as visual acquisition unit 3. (Refer to...) Figure 2 As shown, the camera is fixedly installed on the side wall of the farrowing pen 2, with its field of view covering the pen where the sow is located, ensuring that the sow's body, especially her hindquarters and abdomen, can be completely captured. In low-light conditions at night, the camera automatically activates its infrared illumination function, continuously outputting a high-definition video stream at a frame rate of ≥25 frames per second as the visual data source for analysis.

[0026] The vital signs acquisition unit 4 collects the sow's respiratory and heartbeat signals. The vital signs acquisition unit 4 can be a millimeter-wave radar, bio-radar, contact heart rate monitor, etc. In this embodiment, a frequency-modulated continuous wave millimeter-wave radar operating in the 77GHz band is specifically used as the vital signs acquisition unit 4. This radar is installed above the restraint bar 2, with its beam aimed at the sow's chest and abdomen area. The radar continuously transmits frequency-modulated continuous waves to the sow's body and receives the echoes. By detecting the surface vibrations caused by the sow's breathing and heartbeat, it generates vital signs signals containing respiratory and heartbeat information. Alternatively, wearable devices, such as a harness with bioelectric sensors, can be used to collect the sow's body temperature, electrical activity (EDA), and body movement signals. Body temperature reflects the sow's basal metabolism and health status, EDA reflects the sow's stress level, and body movement signals further supplement the sow's activity status information.

[0027] For visual data, image analysis algorithms, such as deep learning-based pose estimation models, are used to detect skeletal keypoints in each frame of the sow's image, obtaining positional information of key body parts such as the ear base, shoulder, elbow, thigh, and knee joints. The pose estimation model employs a convolutional neural network architecture based on HRNet (High-Resolution Net). HRNet is an advanced variant of convolutional neural networks. Its core idea is to maintain multiple feature subnetworks from high resolution to low resolution in parallel throughout the network process, and through repeated bidirectional fusion across subnetworks of different resolutions, the high-resolution representation can retain detailed information while also acquiring rich semantic context from the low-resolution representation. This design ultimately outputs a keypoint heatmap with extremely high spatial accuracy, thereby achieving precise localization of keypoints.

[0028] The posture estimation model takes visual data of the sow's farrowing area as input, with a resolution of 512×512. The output consists of the position coordinates and visibility confidence scores of 17 skeletal keypoints (including joints such as the ear root, shoulder, elbow, thigh, and knee). Based on these position coordinates, the model determines the sow's current posture (standing, lying down, or sitting up) and behavioral changes. By calculating the changes in the sow's position and posture in adjacent frames, a sow's activity level index is obtained to characterize her behavioral features. For example, the number of times the sow changes from standing to lying down or repeatedly gets up per unit time is defined as the activity level index. If the activity index continuously exceeds the preset behavioral characteristic change threshold within a certain period of time, such as 30 minutes, This indicates that the sow is exhibiting frequent and unstable behaviors. Before farrowing, sows often show unusually active behaviors such as pacing back and forth and repeatedly getting up and lying down, which can be used to determine whether the sow has entered the farrowing stage.

[0029] The training process of the above pose estimation model is as follows: Prepare a dataset of sow images and label the true coordinates of skeletal keypoints. Input the labeled data into the model for forward propagation, and the model predicts coordinate positions by regressing the heatmap of the keypoints. During training, the mean squared error loss is calculated based on the predicted heatmap output by the network and the Gaussian distributed true heatmap generated based on the true coordinates, and the model parameters are adjusted using the backpropagation algorithm. Pre-trained weights on the ImageNet dataset are used for model initialization during training.

[0030] For vital signs signals, bandpass filtering and spectral analysis were performed on signals acquired by millimeter-wave radar to obtain respiratory rate and heart rate. Body temperature signals acquired by wearable devices were monitored and recorded in real time, and their fluctuations were analyzed. After denoising the electrodermal activity (EDA) signals, characteristic parameters such as the amplitude and frequency of skin conductance level (SCL) and skin conductance response (SCR) were extracted to assess the sow's stress state. Body movement signals were integrated to obtain the sow's activity level over a period of time. Physiological characteristics include respiratory rate, heart rate, body temperature, and multiple EDA parameters.

[0031] Pre-set thresholds for behavioral and physiological changes. When a sow's activity level exceeds the preset behavioral threshold, and her heart rate and respiratory rate increase relative to normal baseline values ​​exceed the preset physiological threshold, or when abnormal increases or decreases in body temperature, significantly increased skin conductance parameters indicating stress levels, or a marked increase in physical activity occur, the sow is determined to be in the process of farrowing. This triggers continuous monitoring mode and marks the sow as being in the process of farrowing.

[0032] S120. Once the state of impending labor is determined, the birth events of newborn piglets are monitored based on continuous visual data, and abnormal conditions during the parturition process are monitored based on visual data and / or vital signs signals.

[0033] After the sow is determined to be in labor, real-time image data of the farrowing area is continuously acquired using a 4-megapixel infrared network camera. Target detection algorithms, such as the YOLO series, are used to analyze the real-time video frames. This algorithm, after training, can accurately distinguish between small, pink, moving newborn piglets and the sow's body, representing detected targets with bounding boxes. When the confidence level of a piglet target detected in the image for the first time exceeds a set threshold, the first piglet is confirmed to have been successfully born, the current timestamp is recorded, and counting begins. As farrowing progresses, whenever a new piglet is detected that has not appeared in previous frame sequences, the count is incremented by 1, and the time of birth is recorded. If the interval between two detected newborn piglets is too short, such as less than a preset time, the continuity of their location trajectories is used to determine if it is a duplicate identification of the same piglet, filtering out redundant counts.

[0034] The anomaly monitoring process based on visual data involves analyzing images from the visual data using target detection and posture recognition algorithms. Key skeletal points and body contours of the sow are extracted to determine her current posture (standing, lying down, or sitting) and any behavioral changes. If abnormal behavior is detected in the sow during farrowing, such as sudden stillness after prolonged and violent struggling, or abnormal discharge from the birth canal identified by visual characteristics such as color and shape, it may indicate an abnormality in the farrowing process, such as dystocia or fetal obstruction.

[0035] The abnormal monitoring process based on vital signs involves continuously monitoring the sow's respiratory and heart rates acquired by millimeter-wave radar, as well as body temperature, skin conductance, and body movement signals collected by wearable devices. For a period postpartum, visual data is used to assess persistent vulvar bleeding in the sow. Changes in blood color and area in the images are used to determine if the bleeding area continues to increase beyond a safe threshold. Combined with vital signs such as rapid breathing, rapid heartbeat that does not return to normal for an extended period, abnormally high or low body temperature, persistently high stress levels in skin conductance, and abnormally increased or decreased body movement, this may indicate severe abnormalities such as massive hemorrhage. Furthermore, based on the recorded piglet birth time series, if no new piglets are detected within a preset maximum interval, and the sow continues to strain during farrowing, while vital signs show high respiratory and heart rates, a tense and unrelaxed posture, abnormal body temperature, high stress levels in skin conductance, and abnormal body movement, combined with the sow's struggling state in the visual data, dystocia is suspected, and a dystocia risk signal is output.

[0036] S130. For each newborn piglet monitored, assess the piglet's motor activity after birth based on the newborn piglet's visual data.

[0037] For a period of time after birth, infrared network cameras continuously collect image data of newborn piglets, focusing on their movement. Motion analysis algorithms are used to analyze the collected visual data. For example, the piglets' activity level is assessed by calculating indicators such as distance traveled, speed, frequency, and amplitude of movements over a certain period. Specifically, for each detected piglet, the positional change of its bounding box center between consecutive frames is calculated. and area changes Accumulate movement distance within a preset time window This is used to measure activity levels. If a piglet moves too little distance within a 30-second period and its movements are weak, combined with visual data showing the piglet's body posture remaining in the same position for an extended period, it is judged to have insufficient activity. To reduce the false positive rate, multiple checks are performed before determining insufficient activity in a piglet, such as analyzing the piglet's abdominal movements through magnified image analysis to detect weak breathing. It is a two-dimensional coordinate vector representing the pixel coordinates of the center point of the bounding box of the piglet in the k-th frame image. Indicates the piglet at the kth... The coordinates of the center point of the bounding box in frame 1 (i.e., the previous frame). The area A of the bounding box is calculated from its width and height, i.e., A = width * height (unit: pixels). 2 ΔA represents the change in the area of ​​the bounding box of the same piglet between two adjacent frames. That is, ΔA = A. k A k , Representing the k-th frame image, ... and the k-th frame image respectively. The area of ​​the bounding box corresponding to the frame image.

[0038] S140. When an abnormal situation is detected, or when the activity level is insufficient, an alarm is triggered; and the delivery process data is recorded.

[0039] When abnormal conditions are detected during farrowing, such as sow hemorrhage, dystocia, or insufficient activity in newborn piglets, an alarm mechanism is immediately triggered. The alarm module includes an integrated audible and visual alarm and a wireless communication device. When a danger occurs, the on-site alarm is activated: the alarm installed in the farrowing pen emits a high-intensity sound (e.g., 105dB) accompanied by a red flashing light at a certain frequency (e.g., 2Hz) for a certain duration (e.g., 10 seconds), which attracts the attention of on-site personnel. If the situation persists after 15 seconds following the alarm trigger, a voice prompt is played via a preset voice module to enhance the urgency of the alarm. Simultaneously, the alarm information is uploaded to the aggregation module via a wireless module (e.g., 4G / LTE) in the communication unit. The backend server pushes the event data to the farm management personnel's mobile application and the monitoring room's large screen, and can also send SMS notifications. The remote message includes key information such as the abnormality type ("hemorrhage," "dystocia," "insufficient piglet activity"), the time of occurrence, and the pen number, facilitating rapid location and handling by staff.

[0040] Throughout the farrowing process, various relevant data are automatically recorded, including sow behavioral characteristics, vital signs (including respiratory rate, heart rate, body temperature, skin conductance parameters, and activity level), birth time of newborn piglets, kinetic activity assessment results, and any abnormalities that occur during farrowing. This data is stored in a database for subsequent analysis and summarization, providing a basis for optimizing breeding management and improving early warning methods. It also helps veterinarians assess and diagnose the health status of sows and newborn piglets.

[0041] Traditional methods rely on manual supervision by farm workers, which is prone to delays or omissions due to limited manpower and the simultaneous presence of multiple sows in farrowing. This invention, however, automatically extracts features from visual data and vital signs in the sow's farrowing area to determine if she has entered the farrowing stage, eliminating the need for constant manual observation and avoiding delays and omissions caused by insufficient manpower. Traditional manual monitoring or video surveillance requires active observation by personnel; neglecting monitoring can lead to missed critical moments, and existing methods lack intelligent early warning systems, often relying on remedial measures after an incident. This invention, after determining that the sow has entered the farrowing stage, continuously monitors newborn piglets for birth events and abnormalities during the farrowing process based on visual data. When abnormalities are detected or newborn piglets show insufficient activity, an alarm is immediately triggered, allowing for timely intervention and minimizing losses. Traditional methods struggle to comprehensively and systematically record farrowing process data. This invention records farrowing process data during monitoring, achieving intelligent monitoring and data recording of the sow's farrowing process. This facilitates subsequent analysis and summarization, providing a basis for breeding management and significantly improving newborn piglet survival rates and breeding management efficiency.

[0042] In an optional embodiment, the behavioral feature is a motion amplitude parameter obtained based on skeletal key point detection, and the physiological feature is a heart rate or respiratory rate obtained based on millimeter-wave radar signals. The step S110 above, which involves determining whether a sow has entered the farrowing state based on a combination of the behavioral and physiological features, includes: S1101. When the rate of change of the motion amplitude parameter exceeds a first preset threshold, a first determination signal is generated. S1102. When the increase in heart rate or respiratory rate relative to the reference value exceeds the second preset threshold, a second determination signal is generated. S1103. When the first determination signal and the second determination signal are both established, the sow is determined to have entered the farrowing state.

[0043] Visual data of the sow's farrowing area is continuously acquired. This visual data refers to a sequence of dynamic images containing the sow and its surrounding environment, continuously acquired by the visual acquisition unit 3. A pose estimation model (such as YOLO-pose) is used to detect skeletal key points in each frame of the image. This allows for the acquisition of positional information for key body parts of the sow (e.g., joints at the base of the ear, shoulder, elbow, thigh, and knee), and the calculation of motion amplitude parameters for these key body parts. For multiple consecutive frames, the rate of change of these motion amplitude parameters is calculated. For example, multiple frames are continuously acquired within a certain time interval (e.g., 1 second), and the positional changes of key body parts of the sow between adjacent frames are analyzed to obtain motion amplitude parameters. The rate of change of these motion amplitude parameters in adjacent time intervals is then calculated.

[0044] A first preset threshold is set, which is derived from statistical analysis of a large amount of pre-partum behavioral data of sows. When the calculated rate of change of the movement amplitude parameter exceeds the first preset threshold, a first judgment signal is generated. This indicates that the sow has exhibited abnormal restlessness or trembling behavior. Before farrowing, sows often exhibit typical behaviors such as frequent standing, lying down, circling, and anxiety, which lead to an increased rate of change of the movement amplitude parameter. For example, under normal circumstances, the rate of change of the sow's movement amplitude parameter fluctuates within a certain range. When farrowing is approaching, this rate of change may increase significantly, exceeding the preset first preset threshold. This situation indicates abnormal sow activity.

[0045] A millimeter-wave radar installed above the restraint bar 2 continuously transmits frequency-modulated continuous waves towards the sow's chest and abdomen, and receives the echo signals reflected from her body surface. This echo signal is down-converted by a mixer to form a raw baseband signal containing vital signs information. The raw baseband signal is then bandpass filtered, separating the signal component corresponding to respiratory movements by setting a passband range of 0.2-0.5 Hz, and simultaneously separating the signal component corresponding to heartbeat movements by setting a passband range of 1-2 Hz. The filtered respiratory and heartbeat signals are then subjected to Fast Fourier Transform (FFT) to obtain their respective power spectral density curves. In the power spectral analysis, the maximum spectral peak frequency is found within a predetermined respiratory frequency band (typically 0.2–0.5 Hz). This frequency corresponds to the fundamental frequency of respiratory movements; the heartbeat signal finds its main peak frequency in the 1-2Hz frequency band. This frequency corresponds to the fundamental frequency of the heartbeat. Based on the spectral analysis results, physiological parameters are calculated through frequency conversion: the maximum spectral peak frequency is... Multiply by 60 to get the respiratory rate RR (breaths / min). The main peak frequency Multiply by 60 to get the heart rate HR (beats / min). .

[0046] A second preset threshold is set in advance, which is based on the respiratory rate of the sow in her normal resting state. and heart rate baseline The threshold is determined by a certain percentage increase. When the increase in heart rate or respiratory rate relative to the baseline value exceeds the second preset threshold over a continuous period, it indicates a significant increase in the sow's heart rate or respiration, generating a second judgment signal. As the sow approaches farrowing, her autonomic nervous system is affected by stress, and her respiratory rate and heart rate typically increase significantly. For example, a sow's normal resting heart rate is 60-80 beats per minute and her respiratory rate is 10-15 beats per minute; as farrowing approaches, her heart rate may rise to over 100 beats per minute and her respiratory rate may rise to over 20 beats per minute, exceeding the preset second threshold. Furthermore, millimeter-wave radar can also detect changes in the sow's breathing pattern, such as intermittent rapid breathing or abdominal breathing, which are also signs of impending farrowing. The analysis module outputs indicators of abnormal physiological states in the sow based on these indicators.

[0047] When both the first and second judgment signals are generated simultaneously—that is, when the rate of change of the movement amplitude parameter exceeds the first preset threshold, and the increase in heart rate or respiratory rate relative to the baseline value exceeds the second preset threshold—the sow is determined to have entered the farrowing state. At this time, continuous monitoring mode is activated, and the sow is marked as being in the farrowing state for subsequent detailed monitoring of the farrowing process. It can be set... A Boolean variable representing "abnormal sow activity level". If a Boolean variable represents "significantly increased heart rate or respiration in sows", then the triggering condition for the onset of farrowing can be expressed as: Right now and When both are true, it is considered to meet the criteria for the labor state.

[0048] This invention uses a combination of behavioral and physiological characteristics to make a judgment, avoiding errors that may arise from judging based on a single characteristic. For example, relying solely on behavioral characteristics might misjudge abnormal agitation in sows caused by other reasons (such as being startled) as impending labor; relying solely on physiological characteristics might overlook situations where physiological indicators show no obvious changes but the sow is actually close to delivery. Combining both methods allows for a more accurate identification of whether a sow has entered the labor stage, improving the reliability of the judgment.

[0049] In an optional embodiment, the monitoring of abnormal conditions during labor described in S120 above includes: S1201: Identify newborn piglets in the visual data using a target detection model, record the birth time of the newborn piglets, and calculate the farrowing interval based on the continuously recorded birth times; when the farrowing interval exceeds a third preset threshold, it is determined to be a first abnormal situation. Simultaneously, execute S1202.

[0050] A pre-trained object detection model was used to analyze visual data (such as video frames) of the sow's farrowing area. The object detection model, trained on a large amount of labeled images of newborn piglets, accurately identified newborn piglets in the images and marked their locations with bounding boxes. When the object detection model first detected a newborn piglet in a frame, and the confidence level of that piglet was higher than a set threshold, the current timestamp was recorded as the piglet's birth time. As the farrowing process continued, each new newborn piglet not seen in previous frames was detected, and its birth time was recorded using the same method. Based on the continuously recorded birth times of newborn piglets, the time interval between two adjacent piglets was calculated, i.e., the farrowing interval. For example, if the birth time of the first piglet is t1 and the birth time of the second piglet is t2, then the farrowing interval T = t2 - t1.

[0051] The first abnormal condition determination process is as follows: A third preset threshold T3 is pre-set. This threshold is the upper limit of the range calculated based on a large amount of data on farrowing intervals during normal farrowing processes. During farrowing, the farrowing interval T is monitored in real time. When the calculated farrowing interval T exceeds the third preset threshold T3, it is determined to be the first abnormal condition, which may indicate that the sow is experiencing dystocia, fetal entrapment, or other problems.

[0052] S1202. Monitor the bleeding area in the hindquarters of the sow based on the visual data; if the bleeding area increases beyond a fourth preset threshold within a preset time period after the birth of newborn piglets, it is determined to be a second abnormal condition.

[0053] The step of monitoring the bleeding area of ​​the sow's hindquarters based on the visual data includes: defining a region of interest (ROI) in the visual data that includes the sow's vulva and the surrounding ground; converting the image of the ROI to a Hue-Saturation-Value (HSV) color space to separate the hue information of the image; counting the number of pixels within a preset hue range based on the hue information, and using the number of pixels as a parameter characterizing the bleeding area.

[0054] Specifically, in the visual data, i.e., video frames, a region encompassing the sow's vulva and the surrounding ground is manually or automatically designated as the Region of Interest (ROI). This region is where bleeding is most likely to occur and requires focused monitoring. The image of the ROI is converted from the RGB color space to the HSV color space. The HSV color space decomposes the color information of an image into three components: hue, saturation, and value. Compared to the RGB color space, the HSV color space better aligns with human color perception and exhibits better performance in color recognition and segmentation tasks. The hue information of the image in the HSV color space is then extracted. Since blood typically has a specific hue range, a preset hue range that accurately represents blood color is pre-defined. Based on this hue information, the number of pixels within the preset hue range is counted, and this number of pixels is used as a parameter representing the bleeding area. A higher number of pixels indicates a larger bleeding area.

[0055] The second abnormal condition determination process is as follows: within a preset time period t after the birth of newborn piglets... preset Internally, continuously monitor the bleeding area in the sow's hindquarters. Preset time period t preset The time range is set based on common postpartum hemorrhage in sows. A fourth preset threshold is pre-defined. When the increase in the bleeding area (i.e. the number of pixels within the preset color range) exceeds the fourth preset threshold A4, it is determined to be the second abnormal condition, which may indicate that the sow has serious problems such as massive bleeding.

[0056] During farrowing, the S1202 is used to monitor potential complications, including postpartum hemorrhage in the sow and dystocia (prolonged labor). Bleeding areas are detected in the infrared network camera image as piglets are born. It is still being updated. Normal parturition bleeding is generally limited and gradually stops as piglets are born; however, if the red area on the ground expands rapidly or continues to increase over a long period, it indicates possible severe bleeding from the birth canal. Specifically, the analysis module calculates... rate of change over time If within 5 minutes postpartum Continues to increase and exceeds the safety threshold (For example, if the blood volume exceeds a certain number of milliliters), abnormal bleeding is determined to have occurred. At this time, a warning sign indicating a risk of massive hemorrhage in the sow will be generated. Simultaneously, based on the piglet birth time sequence recorded in step S1201, it is determined whether suspected dystocia has occurred: under normal circumstances, the average interval between piglets is about 15 minutes; if it exceeds the preset maximum interval... If, for example, no new piglets are born after 30 minutes and the sow continues to strain, dystocia (absence of labor) is suspected. The analysis module can verify, using radar data, whether the sow is still in a state of intense uterine contractions, characterized by high breathing and heart rate and a tense, unrelaxed posture. If the condition of "no piglets born for an extended period and the sow still straining" is met, a dystocia risk signal is output. In summary, when either abnormally heavy bleeding or labor cessation occurs, it is determined that the sow's farrowing process is in danger, requiring immediate intervention.

[0057] This invention uses a target detection model trained on a large amount of data to identify newborn piglets, accurately and quickly determining the moment of their birth. This avoids oversights and errors that may occur with manual observation, providing a reliable data foundation for calculating farrowing intervals and thus improving the accuracy of identifying the first abnormal condition (excessively long farrowing interval). Converting images to the HSV color space and statistically analyzing bleeding area parameters based on hue information allows for more accurate identification of bleeding areas, reducing the impact of factors such as lighting changes and background interference on bleeding area monitoring and improving the accuracy of identifying the second abnormal condition (abnormally large bleeding area). The entire monitoring process is conducted in real time, enabling the acquisition of newborn piglet birth information, farrowing intervals, and changes in bleeding area in the sow's hindquarters. Any abnormalities can be immediately identified, allowing farm personnel to take timely measures. When an abnormality is detected, an alarm mechanism can be triggered promptly, notifying farm personnel to handle the situation and preventing further damage to the health of the sow and newborn piglets due to delayed intervention, thereby improving the safety and success rate of the farrowing process.

[0058] This invention trains a YOLOv11 model using a large amount of image data labeled with newborn piglets to obtain a target detection model. This model can accurately identify newborn piglets in video frames of the sow's farrowing area and mark their locations with bounding boxes. The training data comes from videos captured by infrared network cameras installed in actual pig farm farrowing pens, and is obtained through manual annotation. The annotations include the bounding box location of each piglet (including piglets partially covered by the amniotic sac at birth) to ensure good generalization ability of the model. YOLOv11 employs an improved backbone network and feature pyramid detection head to adapt to the detection needs of targets with significant size differences (such as sows and newborn piglets). The model's task is to detect and locate newborn piglets in video frames in real time, accurately identify piglet birth events, and generate precise bounding box information for each piglet. The model input is a real-time image of the sow's farrowing area with a resolution of 640×640. The model output is the piglet detection results, including the bounding box coordinates (x, y, width, height) of each detected piglet, detection confidence, detection timestamp, and category label.

[0059] Training Process: First, an image dataset containing sows and piglets is prepared, with each training image labeled with the true bounding box location of the piglets. The labeled dataset undergoes preprocessing and augmentation to improve model robustness. This includes: removing frames with low resolution or severe occlusion; performing data augmentation on the image data, such as random cropping, scaling, rotation, brightness and contrast adjustment, and horizontal flipping, to simulate changes in the infrared network camera's viewing angle and different lighting conditions; and using Generative Adversarial Networks (GANs) to synthesize simulated images to supplement the training data for relatively rare anomalies. The preprocessed and augmented image dataset is then input into the object detection model for forward propagation to obtain predicted bounding boxes. A multi-task loss function (including bounding box regression loss, object confidence loss, and class classification loss) is calculated based on the true and predicted bounding boxes, and model parameters are adjusted through backpropagation. During training, data augmentation techniques such as random cropping, scaling, and rotation are used to improve model robustness.

[0060] Bounding box regression loss This measures the positional and shape differences between the predicted bounding boxes and the manually labeled ground truth bounding boxes. The goal is to make the predicted boxes as close as possible to the ground truth boxes. The bounding box regression loss uses the CIoU loss. First, the predicted box ( ) and the real frame ( The intersection area of ​​( ) divided by their union area gives the intersection-union ratio. . IoU values ​​range from 0 to 1, with higher values ​​indicating greater overlap. CIoU loss, based on IoU, takes into account center distance and aspect ratio, providing a more comprehensive metric. . is the square of the Euclidean distance between the center points of the predicted and ground truth boxes. c is the diagonal length of the smallest closure region containing both the predicted and ground truth boxes. v is a parameter measuring aspect ratio consistency. α is a positive trade-off parameter. By minimizing CIoULoss, the model learns to adjust the parameters of the bounding box so that it not only overlaps more with the ground truth boxes but also has more accurate center points and more similar shapes.

[0061] Target confidence loss L obj This optimizes the model's ability to determine the presence of an object within the bounding box (i.e., the confidence score). Binary cross-entropy loss (BCE) is used, with the following formula: L obj = [y log(p)+(1 y) log(1 p)] Where: y is the true label (1 indicates a target, 0 indicates no target), and p is the confidence score predicted by the model.

[0062] Category classification loss L cls The formula used to correctly identify target categories (such as sows, newborn piglets, and abnormal events) is: L cls = α t (1 p t )γlog(p t ) Where: p t α represents the confidence level of the predicted probability. t The dynamic adjustment factor (range [0.25, 0.75]) alleviates class imbalance (e.g., there are far more piglet samples than abnormal samples); γ is the focusing factor (default 1.5), which reduces the weight of easily classified samples and focuses on difficult-to-classify samples.

[0063] Total loss for: The piglet detection results output by the target detection model are directly used in subsequent farrowing monitoring. Bounding box coordinates are used to establish piglet movement trajectories for vitality assessment; detection timestamps are used to record piglet birth times, thereby calculating the farrowing interval. When the farrowing interval exceeds a threshold, a dystocia warning is triggered.

[0064] In an optional embodiment, the monitoring of abnormal conditions during labor described in S120 above further includes: S1203. Based on the vital signs signals, obtain the sow's respiratory rate and heart rate; when the fluctuation of the respiratory rate exceeds a preset percentage of the baseline value during farrowing, and / or the duration of the heart rate exceeding the fifth preset threshold reaches the first preset time window, it is determined to be a third abnormal condition.

[0065] In the period leading up to farrowing, sows undergo multiple vital sign monitoring sessions to collect data on their respiratory and heart rates during periods of relative stability. These data are then statistically analyzed to calculate the average respiratory and heart rates, which serves as the baseline. This baseline reflects the sow's respiratory and heart rate levels under normal physiological conditions, providing a reference standard for subsequent assessment of abnormalities. For example, analysis of 10 monitoring sessions reveals a baseline respiratory rate of 12-16 breaths per minute and a baseline heart rate of 60-80 beats per minute for sows.

[0066] During farrowing, vital signs are monitored in real time, and the sow's respiratory and heart rates are extracted. The fluctuation range of the respiratory rate relative to a baseline value is calculated. A preset percentage (e.g., 30%) is set; when the fluctuation range of the respiratory rate exceeds this preset percentage, it is considered abnormal. For example, if the baseline value is 14 breaths per minute and the preset percentage is 30%, a respiratory rate below 14 × (1-30%) = 9.8 breaths / minute or above 14 × (1+30%) = 18.2 breaths / minute is considered abnormal. Simultaneously, the sow's heart rate is continuously monitored, and the duration for which the heart rate continuously exceeds a fifth preset threshold (e.g., 90 beats per minute) is recorded. A first preset time window (e.g., 5 minutes) is set; when the duration for which the heart rate continuously exceeds the fifth preset threshold reaches the first preset time window, the heart rate is considered abnormal. For example, if the fifth preset threshold is 90 beats per minute and the first preset time window is 5 minutes, a heart rate exceeding 90 beats per minute for more than 5 consecutive minutes is considered abnormal. When the fluctuation range of respiratory rate exceeds a preset percentage of the baseline value, and / or the duration of heart rate exceeding the fifth preset threshold reaches the first preset time window, it is determined to be a third abnormal condition. This means that as long as either the respiratory rate abnormality or the heart rate abnormality is met, or both conditions are met simultaneously, it can be determined that the sow has experienced a third abnormal condition during farrowing.

[0067] It should be noted that if any one or more of the above-mentioned first, second, and third abnormal conditions occur, it is considered an abnormal condition during childbirth.

[0068] In addition to monitoring the birth of newborn piglets and hindquarter bleeding in sows based on visual data, this invention also introduces monitoring of respiratory and heart rates based on vital signs, enabling a more comprehensive understanding of the sow's farrowing status from a physiological perspective. Respiration and heart rate are crucial indicators reflecting the sow's bodily functions and health. By monitoring changes in these parameters, potential internal physiological abnormalities during farrowing, such as hypoxia, pain, and infection, can be detected promptly, overcoming the limitations of relying solely on visual monitoring and improving the comprehensiveness and accuracy of abnormality detection. By setting parameters such as baseline values, preset percentages, and a first preset time window, abnormalities in respiratory and heart rates can be precisely quantified. This precise judgment method avoids misjudgments caused by individual accidental factors, improving the reliability of abnormality warnings. For example, an abnormality is only determined when the heart rate consistently exceeds a threshold for a certain period, effectively excluding temporary increases in heart rate caused by brief activity or emotional fluctuations in the sow. This makes the warning information more accurate and reliable, providing a strong basis for farmers to take timely measures. Recording and analyzing respiratory and heart rate data of sows during farrowing, as well as corresponding abnormal conditions, can provide rich data support for breeding management. Farmers can use this data to understand individual differences and farrowing patterns in sows, and formulate more scientific and reasonable breeding management strategies. This invention combines vital sign monitoring technology with an abnormal condition judgment algorithm to achieve automatic monitoring and early warning of abnormal conditions during farrowing. This process eliminates the need for real-time manual observation and judgment, greatly reducing the workload of farm workers and improving breeding efficiency.

[0069] This invention utilizes a multimodal fusion time-series model to identify the sow's impending labor state and provide early warning of abnormal labor. The model is trained based on a constructed multimodal training dataset. The dataset construction process includes: collecting farrowing instances of sows of various breeds and sizes, with varying numbers of piglets, and visual and radar signal data (i.e., the aforementioned vital signs) under different lighting conditions, such as day and night, by setting up infrared network cameras and radar in actual pig farm farrowing pens; preprocessing the radar signal data to extract physiological feature sequences (such as respiratory rate and heart rate), and aligning them with behavioral feature sequences extracted from the visual data. These synchronized behavioral and physiological feature sequences are then labeled with time labels for key events (such as detection of piglet birth, severe sow contractions, onset of impending labor, and occurrence of abnormal bleeding), thereby constructing a multimodal time-series dataset with clear supervisory signals for model training and validation.

[0070] The multimodal fusion time-series model employs a Long Short-Term Memory (LSTM) network to fuse and learn the temporal patterns of the labeled behavioral and physiological feature sequences, thereby comprehensively identifying labor status, abnormal fatigue, or cessation of labor. The model takes behavioral and physiological feature sequences within a time window as input and outputs a judgment of labor status and a prediction of whether abnormal conditions such as no delivery or persistently elevated heart rate will occur in the next time period. The input to the multimodal fusion time-series model consists of behavioral feature sequences extracted from image sequences (e.g., motion amplitude parameters per second over the past 30 minutes) and physiological feature sequences extracted from radar signals (e.g., respiratory rate and heart rate per second over the past 30 minutes). The output is a classification result of labor status (whether delivery is imminent) and a judgment result of abnormal conditions.

[0071] During training, the radar time-series data used to extract physiological feature sequences was first augmented by adding noise and shifting the sampling rate. Then, behavioral and physiological feature sequences aligned with key event time labels were input into a multimodal fusion time-series model. The model used an LSTM network to perform deep feature extraction and pattern learning on the temporal features of both modalities, capturing long-term dependencies in the sequence data. The two temporal features extracted by the LSTM network were then fused, and state prediction was performed based on the fused features, outputting both labor state classification results and abnormal condition judgment results. Based on the differences between the model's predictions and the actual labels, a comprehensive loss function (e.g., a weighted sum combining labor state classification loss and abnormality prediction loss) was calculated. The model parameters were adjusted using a backpropagation algorithm to continuously optimize the network's temporal pattern recognition capability. This training process ensured that the model could directly learn complex temporal patterns in behavioral and physiological feature sequences, while accurately identifying the sow's labor state and abnormal conditions. By employing an end-to-end LSTM-based training approach, the model can deeply explore the intrinsic correlations and synergistic changes among temporal features of different modalities, effectively capturing the trends of physiological parameters and behavioral characteristics evolving over time, and improving the accuracy and robustness of comprehensive judgments on labor status and abnormal conditions. After training, the model can simultaneously achieve accurate identification of labor status and early warning of abnormal delivery based on real-time collected behavioral and physiological feature sequences.

[0072] Deploying offline-trained models to on-site edge computing devices requires a series of optimizations based on hardware and software conditions to meet real-time and stability requirements. First, model compression and acceleration techniques are employed to reduce inference latency. This embodiment converts the trained YOLOv11 model into efficient inference formats such as TensorRT and reduces model size using model pruning and quantization: redundant convolutional channels are pruned to reduce computation, 8-bit fixed-point quantization replaces 32-bit floating-point calculations to accelerate inference, and fine-tuning ensures that the model accuracy remains almost unchanged after quantization. For sequence models, distillation techniques are used to approximate the behavior of complex models with smaller models, achieving near-perfect prediction performance with lower computational cost. Second, the software architecture implements multi-threaded parallelism and asynchronous inference. Infrared network camera video streams and radar signal streams are acquired and preprocessed by independent threads. The analysis module schedules the GPU to load image models and sequence models for parallel execution, fully utilizing hardware resources. When the image frame rate is high and radar data updates are slow, a buffer queue and asynchronous event triggering mechanism coordinate the fusion of the two data streams, ensuring the overall process does not block. For multi-model collaborative inference processes, a pipeline approach can be adopted: first, the YOLO model is executed to detect new piglet targets; then, the posture estimation model is run in parallel to determine the sow's state, i.e., behavioral characteristics; finally, the results (i.e., behavioral and physiological characteristics) are fused to give a comprehensive judgment. This design improves throughput and response speed, ensuring timely response to emergencies.

[0073] Furthermore, this embodiment supports a local-cloud collaborative deployment strategy. By default, all algorithms are completed independently on the local edge device 1, enabling real-time on-site monitoring and response. When a difficult or computationally intensive situation is detected, edge device 1 can encrypt and send the relevant frame data to the cloud server. The cloud then utilizes its powerful computing resources to run advanced algorithms for further analysis and feeds the results back to the edge for decision-making reference. This cloud-edge collaborative mechanism, as a supplement, improves the ability to handle complex situations while leaving routine high-frequency detection tasks to be completed at the edge to reduce bandwidth consumption. After the model is deployed, a comprehensive operation monitoring and update mechanism needs to be established. The comparison results between the model output and the actual situation are recorded in real time, and false alarms or missed alarms are archived and analyzed so that the model can be retrained or fine-tuned periodically using new data to continuously improve the model's accuracy and robustness. Through the above measures, the sow farrowing status detection model based on infrared network cameras and radar described in this invention can run efficiently on the resource-constrained edge device 1, realizing intelligent monitoring and anomaly early warning of the entire sow farrowing process, achieving significant results in ensuring the safety of sows and piglets.

[0074] In an optional embodiment, assessing the postnatal motor activity of the newborn piglets based on their visual data includes: The visual data of the newborn piglets is tracked to generate a position sequence of the newborn piglets within a second preset time window; the cumulative movement distance of the newborn piglets is calculated based on the position sequence, and when the cumulative movement distance is lower than a sixth preset threshold, it is determined that the piglets have insufficient exercise vitality.

[0075] Specifically, after the target detection model identifies the same newborn piglet target in consecutive video frames, it records its position data within a second preset time window (typically 180 seconds). For each frame, the coordinates p of the center point of the piglet's bounding box are recorded. k =(x k ,y k This forms a position sequence {P1, P2, ..., P}. n}, where n is the total number of frames within the second preset time window. Based on the obtained position sequence, the position change of the bounding box center between consecutive frames is calculated. ,in, , representing horizontal displacement; , representing vertical displacement. The cumulative distance traveled by the piglets is calculated within the second preset time window. To measure activity level. The calculated cumulative movement distance D is compared with a sixth preset threshold. The comparison shows that when the cumulative exercise distance is lower than the sixth preset threshold, it is determined that the exercise vitality is insufficient.

[0076] This invention utilizes the visual characteristics of newborn piglets to accurately identify and track each piglet in consecutive video frames. Even in complex situations such as piglets occluding each other, high movement speed, or changing lighting conditions, it maintains high tracking accuracy, thereby generating a precise position sequence. Based on this position sequence, the cumulative movement distance of the newborn piglet within a second preset time window can be obtained by calculating and summing the distances between adjacent positions. This calculation method accurately reflects the actual movement of the piglets during that time period, avoiding errors caused by subjective judgment or simple measurement methods.

[0077] The sow farrowing risk warning device provided by the present invention is described below. The sow farrowing risk warning device described below can be referred to in correspondence with the sow farrowing risk warning method described above.

[0078] The sow farrowing risk early warning device provided by this invention refers to... Figure 3 As shown, it includes: The pre-partum state judgment module 610 is used to extract the sow's behavioral characteristics based on visual data of the sow's farrowing area, and extract physiological characteristics based on the sow's vital signs signals, and judge whether the sow has entered the pre-partum state based on the combination of the behavioral characteristics and the physiological characteristics. The abnormal state monitoring module 620 is used to monitor the birth events of newborn piglets based on continuous visual data after determining that the piglets have entered the labor state, and to monitor abnormal conditions during the delivery process based on visual data and / or vital signs signals. The exercise activity assessment module 630 is used to assess the exercise activity of each newborn piglet after birth based on the visual data of the newborn piglet. The alarm triggering module 640 is used to trigger an alarm when an abnormal situation is detected or when the motor activity is insufficient; and to record the delivery process data.

[0079] The sow farrowing risk early warning system provided by the present invention is described below. The sow farrowing risk early warning system described below can be referred to in correspondence with the sow farrowing risk early warning device described above.

[0080] The sow farrowing risk early warning system provided by this invention includes: Visual acquisition unit 3 is used to acquire visual data of the farrowing area of ​​sows; Vital signs acquisition unit 4 is used to collect vital signs signals of sows; The sow farrowing risk warning device described above; The device is connected to the visual acquisition unit and the vital signs acquisition unit.

[0081] The sow farrowing risk early warning system utilizes an edge device 1 as a local intelligent analysis unit. The edge device 1 includes a production analysis module, a communication and storage module, and an alarm module. The production analysis module performs target, key point, and region detection and kinematic statistics on the video frames from the visual acquisition unit 3. Combined with the vital sign signals acquired by the vital sign acquisition unit 4, it outputs a classification result of the labor state (whether labor is imminent) and an abnormality judgment result. The communication and storage module provides network connectivity (such as Ethernet / Wi-Fi / 4G) and local storage space to ensure that data can be recorded and stored simultaneously during network outages, and automatically re-transmitted after network recovery. The alarm module integrates an audible and visual alarm (such as a buzzer and flashlight) and a communication interface for executing alarm actions.

[0082] The hardware-level production analysis module is specifically implemented in software as three modules: a labor state judgment module, an abnormal state monitoring module, and a physical activity assessment module. The sow's pre-partum state assessment module extracts behavioral characteristics from visual data and physiological characteristics from vital signs. Based on the combination of behavioral and physiological characteristics, it comprehensively determines whether the sow has entered the pre-partum state. Once the pre-partum state is determined, the abnormal state monitoring module is activated. It continuously monitors the birth events of newborn piglets based on visual data and simultaneously monitors abnormal conditions during the parturition process. For each newborn piglet identified by the abnormal state monitoring module, the motor activity assessment module evaluates its motor activity based on its post-birth visual data sequence to determine if there is any lack of vitality.

[0083] The sow farrowing risk early warning system also includes a farrowing event archiving and linkage module 5. The overall workflow of the system is as follows: the visual acquisition unit 3 and the vital signs acquisition unit 4 synchronously and continuously acquire the sow's visual data and vital signs signals, and send the data to the production analysis module. The farrowing state judgment module analyzes the received multimodal data. Once the system determines that the sow has entered the farrowing state, it automatically triggers the continuous monitoring mode and activates the abnormal state monitoring module. The abnormal state monitoring module begins operation, monitoring piglet birth events and sow health status in real time. For each newborn piglet, the movement vitality assessment module is immediately activated to track and assess its movement status within minutes of birth. When the abnormal state monitoring module or the movement vitality assessment module identifies any abnormal condition (such as dystocia, massive hemorrhage, or insufficient piglet vitality), an alarm trigger signal is immediately generated. This signal is sent to the alarm module, which then executes alarm operations, including activating on-site audible and visual alarms and sending remote alarm information to management personnel. Throughout the process, the communication and storage modules ensure temporary data caching and stable data upload. All alarm events and birthing process data (such as the time of labor and the timestamp of piglet birth) are ultimately aggregated into the birthing event archiving and linkage module 5 to form a complete and traceable electronic birthing record.

[0084] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740. The processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions stored in the memory 730 to execute a sow farrowing risk warning method.

[0085] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the sow farrowing risk warning method provided by the above methods.

[0087] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the sow farrowing risk warning method provided by the above methods.

[0088] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0089] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for early warning of farrowing risks in sows, characterized in that, include: Behavioral features of sows are extracted based on visual data of the sow's farrowing area, and physiological features are extracted based on the sow's vital signs. The combination of the behavioral features and the physiological features is used to determine whether the sow has entered the farrowing state. Once the labor process is determined, the birth of newborn piglets is monitored based on continuous visual data, and abnormal conditions during the delivery process are monitored based on visual data and / or vital signs. For each newborn piglet monitored, the piglet's motor activity after birth was assessed based on the newborn piglet's visual data; An alarm is triggered when an abnormal condition is detected, or when the child's activity level is insufficient; and the delivery process data is recorded.

2. The method for early warning of farrowing risks in sows according to claim 1, characterized in that, The behavioral characteristics are movement amplitude parameters obtained based on skeletal key point detection, and the physiological characteristics are heart rate or respiratory rate obtained based on millimeter-wave radar signals. The step of determining whether the sow has entered the farrowing state based on a combination of the behavioral and physiological characteristics includes: When the rate of change of the motion amplitude parameter exceeds a first preset threshold, a first determination signal is generated; When the increase in heart rate or respiratory rate relative to the reference value exceeds the second preset threshold, a second determination signal is generated; When the first and second determination signals are both established, the sow is determined to be in the pre-partum state.

3. The method for early warning of farrowing risks in sows according to claim 1, characterized in that, The monitoring of abnormal conditions during childbirth includes: The newborn piglets in the visual data are identified by the target detection model, the birth time of the newborn piglets is recorded, and the farrowing interval is calculated based on the continuously recorded birth times. When the birthing interval exceeds a third preset threshold, it is determined to be a first abnormal situation; Simultaneously, the bleeding area in the sow's hindquarters is monitored based on the visual data; If the bleeding area increases beyond a fourth preset threshold within a preset time period after the birth of newborn piglets, it is determined to be a second abnormal condition. The bleeding area in the hindquarters region of the sow monitored based on the visual data includes: In the visual data, a region of interest including the sow's vulva and the surrounding ground is defined; The image of the region of interest is converted to the HSV color space to separate the tonal information of the image; Based on the hue information, the number of pixels within a preset hue range is counted, and the number of pixels is used as a parameter characterizing the bleeding area.

4. The method for early warning of farrowing risks in sows according to claim 1, characterized in that, The monitoring of abnormal conditions during childbirth also includes: Based on the vital signs signals, the sow's respiratory rate and heart rate are obtained; When, during childbirth, the fluctuation range of the respiratory rate exceeds a preset percentage of the baseline value, and / or the duration of the heart rate exceeding the fifth preset threshold reaches the first preset time window, it is determined to be a third abnormal condition.

5. The method for early warning of farrowing risks in sows according to claim 1, characterized in that, The assessment of the newborn piglets' motor activity after birth based on their visual data includes: The visual data of the newborn piglets is tracked to generate a position sequence of the newborn piglets within a second preset time window; The cumulative movement distance of newborn piglets is calculated based on the location sequence. When the cumulative movement distance is lower than the sixth preset threshold, it is determined that the piglets have insufficient exercise vitality.

6. A sow farrowing risk early warning device, characterized in that, include: The pre-partum state judgment module is used to extract the sow's behavioral characteristics based on visual data of the sow's farrowing area, and extract physiological characteristics based on the sow's vital signs signals, and determine whether the sow has entered the pre-partum state based on the combination of the behavioral characteristics and the physiological characteristics. The abnormal state monitoring module is used to monitor the birth events of newborn piglets based on continuous visual data after determining that the piglets have entered the labor state, and to monitor abnormal conditions during the parturition process based on visual data and / or vital signs signals. The exercise activity assessment module is used to assess the exercise activity of each newborn piglet after birth based on the visual data of the newborn piglet. The alarm recording module is used to trigger an alarm when an abnormal situation is detected or when the child's activity level is insufficient; and to record data of the childbirth process.

7. A sow farrowing risk early warning system, characterized in that, include: The visual acquisition unit is used to collect visual data of the farrowing area of ​​sows. The vital signs acquisition unit is used to collect vital signs signals from sows. The sow farrowing risk early warning device as described in claim 6; The device is connected to the visual acquisition unit and the vital signs acquisition unit.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the sow farrowing risk warning method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the sow farrowing risk warning method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the sow farrowing risk warning method as described in any one of claims 1 to 6.