A method and system for controlling the temperature of a pig population environment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAZHONG AGRI UNIV
- Filing Date
- 2025-10-20
- Publication Date
- 2026-08-07
AI Technical Summary
[0012]本发明针对现有技术中存在的技术问题,提供一种猪群环境温度控制方法及系统,克服人工经验或单一因素控制的精确性低的问题
[0027]本发明提供的一种猪群环境温度控制方法及系统,通过多模态感知获取数据,构建一个结构化的多维特征向量,包含视觉行为与生理特征集、物理环境特征集
和生产背景信息集
;然后,将该向量输入一个评估与决策模型,生成动态的环境控制目标,并驱动外部控制器执行,能够精确实现对猪舍内环境温度的控制。
Smart Images

Figure CN121187388B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of animal husbandry technology, and more specifically, to a method and system for controlling the ambient temperature of a pig herd. Background Technology
[0002] In modern, intensive livestock and poultry farming (especially pig farming), precise environmental control is crucial for improving production efficiency, ensuring animal welfare, and reducing operating costs. Livestock and poultry (such as pigs) are highly sensitive to environmental temperature; unsuitable temperatures can directly lead to heat stress, causing decreased feed intake, stunted growth, weakened immunity, and even death, resulting in significant economic losses. Therefore, providing a precise "thermal comfort zone" for pig herds in real time is a key issue that precision animal husbandry aims to address.
[0003] The existing technologies for controlling the ambient temperature in pig houses mainly include the following:
[0004] 1. Manual Experience Control Method: This is the most traditional method. The farmer observes the behavior of the pigs based on the "age-temperature" recommendation chart and personal experience (such as whether they huddle together or pant), and manually adjusts equipment such as fans, heating lamps, and water curtains.
[0005] 2. Automatic control scheme based on environmental sensors: This is currently the most widely used automation scheme. Temperature and humidity sensors are installed in the pigsty. The controller (such as a PLC) performs simple threshold control or PID control based on the difference between a preset fixed temperature value (e.g., set to 25℃) and the sensor reading, driving the start and stop of equipment such as fans.
[0006] 3. Early intelligent solutions based on single visual behavior analysis: Some research or commercial products have begun to try using cameras to analyze pig behavior. For example, image processing technology is used to identify whether pigs are "huddled together" (judging it as cold) or "lying down scattered" (judging it as hot), and this is used as a basis for adjusting the environment. Some solutions also determine the calmness of pigs by analyzing their overall activity intensity.
[0007] The existing control schemes have the following disadvantages:
[0008] Human experience-based control relies on subjective human judgment, resulting in unstable and inconsistent control effects, and it cannot be standardized and scaled up in large-scale farms.
[0009] The solution based on environmental sensors only measures the physical parameters of "air," so it ignores radiant heat (such as hot / cold radiation from the roof or walls), wind speed, and ground humidity, which have a significant impact on the pigs' perceived temperature. This results in a discrepancy between the target temperature set and the actual feeling of the pigs.
[0010] Solutions based on single visual behaviors (such as huddling) observe "lagging results" that occur quite some time after the stress state has occurred. Therefore, when the system detects huddling, the pig herd has actually been chilled for a long time, resulting in a loss of welfare and productivity, and lacks foresight and timeliness.
[0011] Therefore, all existing solutions have failed to effectively integrate the direct physiological signals of the pig herd (such as respiratory rate), intentional behaviors (such as using wet zones for cooling), and comprehensive environmental indicators (such as black ball temperature). As a result, their assessment dimensions are singular and the information is one-sided, making it impossible to form a comprehensive, accurate, and robust judgment of comfort. Summary of the Invention
[0012] This invention addresses the technical problems existing in the prior art by providing a method and system for controlling the ambient temperature of pig herds, overcoming the problem of low accuracy in control based on human experience or single factors.
[0013] According to a first aspect of the present invention, a method for controlling the ambient temperature of a pig herd is provided, comprising:
[0014] Visual image information of pigs in pig pens is collected using image acquisition devices, and physical environmental information of pig pens is collected using environmental devices.
[0015] Based on the collected visual image information of the pig herd, a set of visual behavior and physiological characteristics of the pig herd is extracted. ;
[0016] Based on the collected physical environment information of pig pens and the pig production background information provided by the breeding management system, the physical environment feature sets of the pig herd are extracted respectively. and production background feature set ;
[0017] Based on visual behavior and physiological characteristics Physical environment feature set and production background feature set , forming multidimensional feature vectors ;
[0018] Based on the multidimensional feature vector Calculate a quantitative index reflecting the current true feelings of the pig herd, wherein the quantitative index is the thermal comfort score. ;
[0019] Based on the thermal comfort score Determine the target temperature for the dynamic environment. ;
[0020] Based on the dynamic environmental target temperature The ambient temperature inside the pigpen is controlled.
[0021] According to a second aspect of the present invention, a pig herd environmental temperature control system is provided, comprising:
[0022] The acquisition module is used to acquire visual image information of pigs in the pigpen based on image acquisition equipment, and to acquire physical environmental information of the pigpen based on environmental equipment;
[0023] The extraction module is used to extract a set of visual behavior and physiological characteristics of the pig herd based on the collected visual image information. ; and based on the collected physical environment information of pig pens and the pig production background information provided by the breeding management system, respectively extract the physical environment feature sets of the pig herd. and production background feature set Among them, the set of visual behavior and physiological characteristics Physical environment feature set and production background feature set , forming multidimensional feature vectors ;
[0024] The calculation module is used to calculate based on the multidimensional feature vector. Calculate a quantitative index reflecting the current true feelings of the pig herd, wherein the quantitative index is the thermal comfort score. ;
[0025] The determination module is used to determine the thermal comfort score. Determine the target temperature for the dynamic environment. ;
[0026] The control module is used to control the target temperature of the dynamic environment. The ambient temperature inside the pigpen is controlled.
[0027] This invention provides a method and system for controlling environmental temperature in pig herds. It acquires data through multimodal sensing and constructs a structured multidimensional feature vector, including visual behavioral and physiological feature sets. Physical environment feature set and production background information set Then, the vector is input into an evaluation and decision-making model to generate dynamic environmental control targets and drive the external controller to execute them, which can accurately control the temperature of the pigsty environment. Attached Figure Description
[0028] Figure 1 A flowchart of a method for controlling the ambient temperature of a pig herd, provided in one embodiment of the present invention;
[0029] Figure 2 This is a schematic diagram of a pig herd environmental temperature control system provided in one embodiment of the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. In addition, the technical features of the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined with each other to form feasible technical solutions. Such combinations are not constrained by the order of steps and / or structural composition patterns, but must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0031] Before introducing the method provided by this invention, let's first introduce the terms and concepts involved in this invention.
[0032] ADG: Average Daily Gain. A core indicator for measuring the growth rate of pigs, usually measured in grams per day.
[0033] BGT: Black Globe Temperature. A comprehensive indicator reflecting the thermal effects of air temperature, radiant heat, and wind speed on living organisms.
[0034] DZP: Drinking Zone Patterns. A set of characteristic indicators used to quantify the interaction patterns of pig herds with specific functional areas (such as drinking zones) to determine their intention to actively cool down.
[0035] FCR: Feed Conversion Ratio. It refers to the ratio of feed consumption to the weight gain of pigs, and is a key indicator of feed efficiency; the lower the better.
[0036] FFT: Fast Fourier Transform. An efficient algorithm used to transform signals from the time domain to the frequency domain and analyze the frequency components of the signal.
[0037] LLR: Lateral Lying Ratio. It refers to the proportion of the total area of a pig herd where pigs are in a lateral lying position.
[0038] PIM: Posture and Inactivity Metrics. A set of characteristic indicators used to quantify the static recumbent posture and activity level of pigs.
[0039] PLC: Programmable Logic Controller. An industrial automation control device used to receive signals and execute control commands.
[0040] POR: Pen Occupancy Ratios. A set of characteristic indicators used to quantify the aggregation status of pig herds at both macro and micro levels.
[0041] ROI: Region of Interest. In image processing, it refers to a local area of an image that is of particular interest and requires analysis and processing.
[0042] RRE: Respiration Rate Estimates. A set of characteristic indicators that reflect the core physiological signal (respiratory rate) of a population and their reliability, estimated through sophisticated algorithms.
[0043] Figure 1 A flowchart of a method for controlling the ambient temperature of a pig herd, as provided in one embodiment of the present invention, is shown below. Figure 1 As shown, the method includes:
[0044] Step 1: Collect visual image information of the pigs in the pigpen using image acquisition equipment, and collect physical environmental information of the pigpen using environmental equipment.
[0045] In some embodiments of the present invention, visual image information of a pig herd in a pigpen is acquired based on an image acquisition device, including:
[0046] An image acquisition device is installed on the top or side of the pigpen to capture visual image information of the pigs in the pigpen around the clock. The image acquisition device is an RGB-D camera, a thermal imaging camera, or a high-definition RGB camera with infrared supplementary light.
[0047] In normal operation, the image acquisition device collects visual image information of the pig herd at a low frequency; when a sudden change in pig behavior or the activation of environmental equipment is detected, the image acquisition device automatically switches to a high frequency to collect visual image information of the pig herd.
[0048] The physical environmental information of the pigpen collected based on environmental equipment includes:
[0049] Temperature and humidity sensors, black ball thermometers, and wind speed sensors are evenly distributed in the pigsty to collect real-time information on the physical environment inside the pigsty.
[0050] Understandably, image acquisition devices (preferably RGB-D cameras or thermal imaging cameras, or high-definition RGB cameras with infrared illumination) are installed on the top or side of the pigpen to capture visual image information of the pig herd around the clock.
[0051] The image acquisition device employs a dynamic variable sampling frequency strategy to collect visual image information of the pig herd. Under normal conditions, the image acquisition device monitors at a low frequency (e.g., 1-3 minutes / frame); when a "trigger event" such as a sudden change in behavior or the activation of environmental equipment is detected, the image acquisition device automatically switches to a high frequency (e.g., 10-20 seconds / frame), achieving a balance between low load and high response.
[0052] For collecting information on the physical environment within the pigsty, temperature and humidity sensors, black sphere thermometers (BGT), and wind speed sensors are evenly deployed throughout the pigsty to collect physical environmental parameters in real time. The introduction of the black sphere thermometer is crucial because it can comprehensively reflect the combined thermal effects of air temperature, radiant heat, and wind speed on the pigs.
[0053] Step 2: Based on the collected visual image information of the pig herd, extract the set of visual behavior and physiological characteristics of the pig herd. .
[0054] In some embodiments of the present invention, the step of extracting a set of visual behavior and physiological characteristics of the pig herd based on the collected visual image information of the pig herd is described. ,include:
[0055] Visual segmentation is performed on the collected visual image information of the pig herd to obtain the outline mask of each pig and the position information of each outline.
[0056] Based on the contour mask of each pig, the positional information of each contour, and consecutive frame images, a set of visual behavior and physiological features of the pig herd is extracted. .
[0057] Understandably, for the visual image information of the pig herd captured by image acquisition equipment, a lightweight instance segmentation model (e.g., YOLOv8-seg architecture) is run on an edge computing device to process the input image. Besides YOLOv8-seg, any other instance segmentation model can be used, such as Mask R-CNN, SOLOv2, etc., or a two-step approach of object detection + image segmentation can be employed. After image processing, the output is a precise pixel-level contour mask for each pig in the image, along with the positional information of each contour (e.g., centroid coordinates, bounding box). If an RGB-D camera is used, depth information can also be output to help resolve the issue of overlapping pigs.
[0058] A series of quantitative indicators were extracted from the pig's silhouette mask, location, and consecutive image frames to form a set of visual behavior and physiological characteristics of the pig herd. Among them, the set of visual behavior and physiological characteristics ( Includes one or more of the following:
[0059] Characteristics reflecting the spatial distribution and posture of pig herds, such as the posture and low activity characteristic family PIM and the group aggregation and organization family POR;
[0060] Features that reflect the interaction intentions of pig herds with specific functional areas, such as the wet area usage pattern feature family DZP;
[0061] Characteristics that reflect the physiological state of a pig herd, such as the herd respiratory rate characteristic family RRE.
[0062] Among them, the attitude and low activity (PIM) family ( (e.g., the area ratio of side-lying positions) (e.g., low activity ratio, etc.)
[0063] Group aggregation organization degree (POR) family ( (e.g., average nearest neighbor distance, DBSCAN cluster radius, hotspot residency concentration) )wait);
[0064] Wet Zone Use Pattern (DZP) family ( (e.g., wetland occupancy rate) (and its hysteresis indication);
[0065] Group respiratory rate ( ) and its quality indicators (SNR, peak sharpness).
[0066] Among them, the Posture and Low Activity Feature family (PIM) is used to quantify the static recumbent posture and activity level of pig herds, mainly including the percentage of lateral recumbent area. and activity index Of which, the area occupied by the lateral recline accounted for... The calculation method is as follows: A lightweight pose classification model is used to identify pigs lying on their sides from the visual image information of the pig herd, and the proportion of the pixel area of the lying-on-the-side pigs to the total pixel area of the pig herd is calculated. This feature is a strong correlation indicator with heat stress.
[0067] Activity Index The average pixel change intensity of consecutive grayscale image frames within the pig's activity area was calculated, and this average pixel change intensity was normalized using a baseline from the nighttime resting period to obtain an activity index reflecting the group's tranquility. This characteristic index significantly increased in the early stages of heat stress and significantly decreased during cold stress.
[0068] Posture and Low Activity Characteristics (PIM) can also include other indicators such as the proportion of low-activity pigs (e.g., those that remain motionless for extended periods).
[0069] The family of features of group aggregation organization degree (POR) is defined as ( This feature family quantifies the "expansion" or "contraction" aggregation state of pig herds at both macro and micro levels. The Group Aggregation Organization family of features, POR, includes group aggregation degree. Group occupancy ratio The average nearest neighbor distance between pigs and the average radius within a DBSCAN cluster.
[0070] Among them, the degree of group aggregation This is represented as follows: The centroid coordinates of all pigs are analyzed using clustering algorithms such as DBSCAN, and the proportion of pigs in a "clustered" state is calculated. This characteristic indicator is a strong correlation indicator with cold stress.
[0071] Group occupancy ratio This is represented as follows: merge the outlines of all pigs, calculate the minimum convex hull area of the merged outline, and divide the minimum convex hull area by the effective area of the pigpen to obtain the group's pen area ratio. .
[0072] Other characteristics of the group aggregation organization family of features, POR, may include the average nearest neighbor distance between pigs and the average radius within a DBSCAN cluster.
[0073] The wet zone usage pattern (DZP) family is represented as ( This feature family quantifies the interaction patterns between pig herds and specific functional areas (especially drinking / wet / spraying areas) to determine their intention to actively cool down.
[0074] The wet zone usage pattern feature family DZP includes wet zone lying-down time. The occupancy rate of wet areas, the frequency of visits, and their lag or trend over time.
[0075] Among them, the duration of lying down in the wet area The results were obtained as follows: the waterer / spray area was calibrated as the "wet area" and the region of interest (ROI). Based on the posture classification results, the total time that pigs spent in the "curled / belly-lying" or "side-lying" posture within the ROI was counted. This is the most critical indicator for judging the behavior of "using the wet area for cooling".
[0076] The wet zone usage pattern feature family DZP can also include other feature indicators such as wet zone occupancy rate, access frequency, and its time lag or trend of change.
[0077] The population respiratory rate characteristic family RRE includes the population mean respiratory rate. And quality indicators, this family of features estimates the core physiological signal of the population, respiratory rate, through sophisticated algorithms, and provides an assessment of its reliability.
[0078] Among them, the average respiratory rate of the population The estimation is mainly achieved through non-contact visual methods to accurately quantify the core physiological indicator of pig herds, namely respiratory rate. This is obtained through a multi-step precision algorithm, specifically including:
[0079] Step 1: Select multiple candidate pigs that meet the preset conditions from all the pigs in the herd.
[0080] Understandably, not every pig in an image is suitable for respiratory rate estimation. If a pig is moving, eating, or severely obscured by other pigs, its body movements will contain a lot of noise, or even be completely unobservable. Therefore, the first step is to automatically identify the most "ideal" observation subject from the herd.
[0081] Specifically, based on the pig information processed by the "instance segmentation model" (the outline information of each pig and the position information of each outline), and filtered according to preset conditions, the following preset conditions are applied:
[0082] 1. Posture conditions: Prioritize pigs that are identified as "side-lying" by the posture classification model. This is because the chest and abdomen contours of pigs are clearest in the side-lying posture, and the rise and fall caused by breathing are most obvious.
[0083] 2. Static condition: Compare the position and shape of pigs in several consecutive frames and filter out those individuals that have not undergone significant displacement or posture changes in a short period of time (e.g., 5-10 seconds).
[0084] 3. Obstruction conditions: Exclude individuals that are severely obstructed by other pigs or objects such as fences, and ensure that their chest and abdomen areas are clearly visible.
[0085] After this step, the system identified several "candidate pigs" that were most suitable for respiratory analysis.
[0086] Step 2: Determine the Region of Interest (ROI) for each candidate pig.
[0087] Understandably, after finding a suitable "candidate pig," it is not necessary to analyze its entire body; only the key areas that reflect respiratory movements need to be focused on. The purpose of this step is to precisely and automatically select a small region for analysis on the candidate pig's body, namely the region of interest (ROI).
[0088] Specifically, using the pig's outline mask and posture information, a small rectangular or circular region is automatically located and defined as the Region of Interest (ROI) on the side of its chest and abdomen. This region is where the body's undulations are most regular and significant during breathing. Precisely locating the ROI minimizes interference from unrelated movements of the head, limbs, and other parts. The second step allows for the location of the ROI for each candidate pig.
[0089] Step 3: Calculate the average motion value of all pixels in the vertical direction within the region of interest (ROI) of each candidate pig in each frame image based on the optical flow method, and obtain the original time series signal representing the respiratory motion of each candidate pig.
[0090] Understandably, this step uses optical flow to extract the respiratory signal from the region of interest (ROI) for each pig. This is the core step in converting visual pixel motion into analyzable mathematical signals, with the aim of quantifying and recording the extremely weak periodic pixel motion caused by respiration within the ROI.
[0091] Specifically, the preferred method is "Dense Optical Flow," which is a technique for calculating the direction and speed of motion of each pixel in an image between consecutive frames.
[0092] For each candidate pig, the video is analyzed frame by frame, and the optical flow vector of all pixels within the region of interest (ROI) for each candidate pig is calculated. Since the chest and abdomen of a pig move upward (inhalation) and downward (exhalation) during breathing, special attention is paid to the vertical component of the optical flow vector.
[0093] The average vertical motion value of pixels within the region of interest (ROI) for each pig is calculated and recorded for each frame. Over time, this forms a raw time-series signal representing respiratory motion. The waveform of this time-series signal approximates the respiratory fluctuation curve of the pig.
[0094] Step 4: Perform bandpass filtering and fast Fourier transform on the original time series signal of each candidate pig to obtain the power spectrum.
[0095] Understandably, the raw time-series signal obtained in the third step may contain noise (such as slight body tremors, changes in lighting, etc.). The purpose of this step is to accurately identify the most dominant frequency component from this mixed signal; this dominant frequency is the pig's respiratory rate.
[0096] Specifically, the original signal is first bandpass filtered. Based on the physiological knowledge of pigs, their respiratory rate is usually within a specific range (e.g., 0.25 Hz to 1.67 Hz, or 15-100 breaths / minute). Filtering can effectively remove noise outside this range.
[0097] Applying the Fast Fourier Transform (FFT) to the bandpass filtered signal is an efficient algorithm that can transform the signal from the time domain (signal strength changes over time) to the frequency domain (the distribution of signal energy at different frequencies).
[0098] Step 5: Detect the dominant peak value on the power spectrum as the respiratory rate of each candidate pig.
[0099] Understandably, the Fourier transform will produce a power spectrum. The peaks on the power spectrum represent the frequency components with the strongest energy in the signal. Automatically detecting the dominant peaks on the power spectrum and their corresponding frequency values is the estimated single respiratory frequency of each candidate pig.
[0100] Step 6: Calculate the quality index of respiratory rate for each candidate pig, and average the respiratory rates of pigs with quality indices higher than the quality index threshold to obtain the group average respiratory rate representing the current state of the entire herd. .
[0101] Understandably, since high-quality results are not always obtained from every calculation, this step aims to assess the reliability of each estimation result and average only the high-quality results to obtain the final population representative value in order to ensure that the final output "population average respiratory rate" is stable and reliable.
[0102] Specifically, several quality metrics are calculated based on the results of each Fast Fourier Transform (FFT) analysis. For example:
[0103] Signal-to-noise ratio (SNR): The ratio of the height of the main peak in the power spectrum to the average height of the other parts. A higher SNR indicates a clearer respiratory signal.
[0104] Peak sharpness: The "thickness" or "thinness" of the main peak. A sharp, clear peak usually represents a very regular breathing pattern.
[0105] Set a quality threshold. A result is considered reliable only if the quality metric (such as SNR) of a single estimate is higher than this threshold.
[0106] All reliable respiratory rate results from different "candidate pigs" that have passed quality assessment are weighted or directly averaged to obtain a robust herd average respiratory rate that can represent the current state of the entire herd. .
[0107] Step 3: Based on the collected physical environment information of the pigpens and the pig production background information provided by the breeding management system, extract the physical environment feature sets of the pig herd. and production background feature set .
[0108] Understandably, the set of physical environment features ( ): Measured directly by physical sensors, including but not limited to: dry-bulb temperature ( ), relative humidity (RH), black ball temperature ( (BGT), wind speed ( ), as well as optional gas concentrations (ammonia / hydrogen sulfide), gas pressure, thermal index, etc.
[0109] Production background information collection ( ): Input or calibrated by the aquaculture management system, and usually remains unchanged over a period of time. Including but not limited to: age in days ( ), population density ( (Number of heads / effective area), weight range (or weight estimate), diet stage, health status indicators, stall structure parameters, etc.
[0110] Step 4, based on the set of visual behavior and physiological characteristics Physical environment feature set and production background feature set , forming multidimensional feature vectors .
[0111] Understandably, steps 2 and 3 above extract three types of feature indicators, which are then concatenated to form a total feature vector. :
[0112] .
[0113] Step 5, based on the multidimensional feature vector Calculate a quantitative index reflecting the current true feelings of the pig herd, wherein the quantitative index is the thermal comfort score. .
[0114] Step 6, based on the thermal comfort score Determine the target temperature for the dynamic environment. .
[0115] This invention designs a two-level mapping. The first level mapping maps multidimensional feature vectors. Mapped to thermal comfort scores of the pig herd The second level of mapping will include thermal comfort ratings. Mapped to dynamic environmental target temperature .
[0116] The two-level mappings are explained below.
[0117] First-level mapping: Comfort assessment model. This step is the core of the entire intelligent assessment module. Its function is to map the complex "multi-dimensional feature vector" constructed in the previous step. This is transformed into a single, intuitive, and precise quantitative indicator that reflects the current true feelings of the pig herd: "thermal comfort score". ".
[0118] In some embodiments of the present invention, based on the multidimensional feature vector Calculate a quantitative index reflecting the current true feelings of the pig herd, wherein the quantitative index is the thermal comfort score. ,include:
[0119] Based on the multidimensional feature vector Based on a rule-based scoring model, the thermal comfort score of the pig herd was calculated. ;or,
[0120] Based on the multidimensional feature vector A regression model based on supervised learning was used to calculate the thermal comfort score of the pig herd. .
[0121] Understandably, multidimensional feature vectors can be transformed in two ways. Mapped to thermal comfort rating The first approach uses a rule-based scoring model. The idea behind this model is to establish an objective, interpretable scoring system that does not require subjective expert annotation. It employs an objective method that combines a single-index availability function based on a standard threshold with bounded aggregation.
[0122] Specifically, it includes two steps:
[0123] (1) For each key physiological, behavioral and environmental feature index in the multidimensional feature vector Define a standardized availability / deviation function. Its output range is [-1, 1]. This function aims to quantify the degree of deviation of a single indicator from its "physiological and behavioral optimal zone", where +1 represents severe heat, -1 represents severe cold, and 0 represents comfort.
[0124] Specifically, based on each characteristic index value and its corresponding comfort zone threshold, a detachability function is defined for each characteristic index using a hyperbolic tangent function. The comfort zone threshold is adaptively adjusted according to the age or weight range of the pig herd. These functions are designed based on publicly available animal physiology literature and breeding practice data, and their core parameters (such as the comfort zone threshold) can be adaptively adjusted according to the age / weight range of the pig herd. The preferred function form is the hyperbolic tangent function. This allows for smooth, bounded, and nonlinear mapping.
[0125] Example 1: Degree function of respiratory rate (RRE) Taking fattening pigs (60–120 kg) as an example, their respiratory rate in the physiological comfort zone exist[ , The respiratory rate is between [ ] and [ ], measured in BPM. The desirability function is defined as:
[0126]
[0127] Among them, among them, , The slope parameter controls the sensitivity to deviation, and the respiratory rate within the physiological comfort zone of the pig herd. exist[ , Between, for example, the respiratory rate within the physiological comfort zone of a pig herd. Between [25, 35] BPM.
[0128] When the respiratory rate is lower When the degree function outputs a negative value, it can be used; when it is in and When the value is between zero and zero, the degree function outputs zero; when it is higher than zero... When the time is right, the output of the degree function is positive.
[0129] In generating the available function value for each feature index, in addition to the tanh function, other S-shaped functions with similar characteristics, such as the sigmoid function or piecewise linear functions, can be used to approximate the "dead zone-linear-saturation" control curve.
[0130] Example 2: Group Clustering Degree (POR, measured by average nearest neighbor distance) Taken as an example, the desirability function Let the target distance under comfortable conditions be... (This value can be adapted to density). When the actual distance (Crowding) indicates a slightly cold condition; when (Excessive dispersion) indicates excessive heat.
[0131] Other indicators, such as the percentage of low-activity / side-lying position (PIM), wet zone occupancy (DZP), and black sphere temperature (BGT), are all compared using a similar method, with their values compared to the corresponding "comfort zone" or "benchmark value" for their age group. The deviation score of the function mapping to [-1,1].
[0132] 2. Rating aggregation and robustness
[0133] Scoring the deviation of all individual indicators The data is aggregated to obtain the final overall comfort score. .
[0134] Weighted bounded aggregation: using weighted summation and passing through The function is bounded to ensure that the final output remains in the interval [-1, 1].
[0135]
[0136] in, For each feature indicator, the initial weight can be set according to the physiological importance of each indicator (e.g., RRE and BGT have higher weights). Furthermore, the system can slowly and data-driven fine-tune the weights based on long-term (e.g., monthly) production performance data (e.g., average daily weight gain (ADG), feed conversion ratio (FCR), and stress event incidence rate) to achieve self-optimization for production performance.
[0137] It should be noted that when the computational quality of a certain feature is substandard (e.g., the signal-to-noise ratio (SNR) of the RRE is too low), its corresponding weights will be affected. The weights are dynamically decayed to 0, and other weights are normalized to ensure system robustness. This also applies to the final output. First-order low-pass filtering and bidirectional hysteresis are applied to the sequence (corresponding to different time periods) to avoid frequent fluctuations in the control system caused by brief disturbances.
[0138] The second method is based on multidimensional feature vectors. A regression model based on supervised learning was used to calculate the thermal comfort score of the pig herd. In some embodiments of the present invention, feature vectors are collected in different seasons and different pig houses, and the comfort scores of the pig herd are labeled based on the multidimensional feature vectors to form a training dataset of [feature vector, comfort score label]; a machine learning regression model is trained based on the training dataset; and the multidimensional feature vectors are... The input is a machine learning regression model trained to output a predicted thermal comfort score. .
[0139] Understandably, comfort ratings are used as an alternative. Pre-trained supervised learning regression models, such as gradient boosting decision trees (XGBoost), random forests, or deep neural networks, can be used. This model requires training on a large amount of data labeled with subjective comfort levels (-1 to 1) by experts to learn a non-linear mapping from feature vectors to comfort scores.
[0140] Model Construction: This method requires a dataset containing expert annotations. A training dataset (feature vector, expert label) is formed by collecting massive amounts of data from different seasons and pig houses, and having animal behavior experts retrospectively rate the video recordings with subjective comfort (e.g., between -1 and +1).
[0141] Model Functionality: A well-trained model can learn the complex, non-linear mapping relationship between features and expert scores. During real-time execution, the model receives feature vectors. As input, the predicted comfort score is directly output. .
[0142] Applicable scenarios: This method is suitable for scenarios with sufficient data and expert resources, where it is desirable for the model to automatically discover unknown feature interaction relationships.
[0143] The two embodiments provided by this invention enable the comfort assessment step to combine the objectivity and interpretability of the preferred embodiment with the strong nonlinear fitting capability of the alternative embodiment, and can be flexibly selected or combined according to the actual application scenario.
[0144] The second level of mapping is to abstract comfort ratings. Translated into specific, actionable engineering objectives: dynamic environmental target temperature. Its core formula is:
[0145] A mathematical model of "benchmark + compensation" is adopted:
[0146]
[0147] Parameter analysis:
[0148] Standard baseline temperature. Recommended temperatures obtained from authoritative feeding standards (such as NRC standards) based on the pigs' age or weight are presented in a lookup table format to provide a scientific benchmark for the system.
[0149] Temperature sensitivity coefficient. Defines the maximum permissible temperature compensation range (e.g., 1.5~3.0℃), and this range is related to the age of the pigs, reflecting the differences in physiological tolerance of pigs at different growth stages.
[0150] Response positivity coefficient. An adjustable dimensionless constant used to control the steepness of the compensation curve, i.e., the "positivity" of the system response.
[0151] (Hyperbolic tangent function): This is a key technical feature of this invention. Its S-shaped nonlinear characteristics provide comfort for pig herds ( This creates a "conditioning dead zone" to prevent frequent equipment starts and stops, allows for rapid response during uncomfortable situations, and, in extreme cases, safely limits the temperature compensation value through its saturation characteristics. Within this range, the stability and security of the system are ensured.
[0152] This "benchmark + nonlinear compensation" approach ensures the smoothness and robustness of the control. Specific Implementation
[0153] fattening pig herds, Oh my god, look up the table. Real-time inference (Slightly hot), let's assume , .
[0154]
[0155] Output The controller operates at the limited step, resulting in a temperature drop without significant overshoot.
[0156] It should be noted that this invention incorporates an anomaly detection and conservative backoff mechanism: to ensure the system's safety and reliability under all circumstances, a backoff mechanism is designed. When an anomaly is detected, such as camera obstruction, loss of critical sensor data, or low quality of indicator calculation (e.g., insufficient RRE signal-to-noise ratio), the system automatically switches to "conservative mode," abandoning complex model calculations and directly outputting the baseline temperature determined by age. It also sends an alert to the administrator. This ensures the system's "bottom-line security."
[0157] Step 7, based on the dynamic environmental target temperature The ambient temperature inside the pigpen is controlled.
[0158] Understandably, this is based on the dynamic environmental target temperature. The ambient temperature inside the pigpen is controlled.
[0159] It should be noted that, in addition to controlling the ambient temperature inside the pigsty, this invention can also control environmental parameters such as ventilation volume and humidity. The controlled equipment is not limited to fans; it can be any pigsty environmental control equipment such as heaters, sprinklers, wet curtains, and automatic roller shutters.
[0160] Figure 2 This invention provides a structural diagram of a pig herd environmental temperature control system according to an embodiment of the present invention. The system includes a data acquisition module 201, an extraction module 202, a calculation module 203, a determination module 204, and a control module 205, wherein:
[0161] The acquisition module 201 is used to acquire visual image information of pigs in the pigpen based on the image acquisition device, and to acquire physical environmental information of the pigpen based on the environmental device.
[0162] Extraction module 202 is used to extract a set of visual behavior and physiological characteristics of the pig herd based on the collected visual image information. ; and based on the collected physical environment information of pig pens and the pig production background information provided by the breeding management system, respectively extract the physical environment feature sets of the pig herd. and production background feature set Among them, the set of visual behavior and physiological characteristics Physical environment feature set and production background feature set , forming multidimensional feature vectors ;
[0163] Calculation module 203 is used to calculate based on the multidimensional feature vector Calculate a quantitative index reflecting the current true feelings of the pig herd, wherein the quantitative index is the thermal comfort score. ;
[0164] Determining module 204, used to determine the thermal comfort score. Determine the target temperature for the dynamic environment. ;
[0165] Control module 205 is used to control the target temperature of the dynamic environment. The ambient temperature inside the pigpen is controlled.
[0166] It is understood that the pig herd environmental temperature control system provided by the present invention corresponds to the pig herd environmental temperature control method provided in the foregoing embodiments. The relevant technical features of the pig herd environmental temperature control system can be referred to the relevant technical features of the pig herd environmental temperature control method, and will not be repeated here.
[0167] The method and system for controlling the ambient temperature of a pig herd provided in this invention have the following advantages:
[0168] (1) It achieves accuracy and predictability in assessment: Existing technologies rely on delayed behavioral or incomplete environmental parameters, while this invention, by introducing respiratory rate (RRE), the "gold standard" physiological indicator, can directly capture the early physiological response to heat stress. Therefore, this invention can intervene in pig herds before significant decline in production performance or extreme behaviors (such as huddling or mud bathing) occur, solving the problems of inaccurate assessment and delayed response.
[0169] (2) Stability and safety of decision-making are achieved: Existing automatic control logic is simple and prone to environmental fluctuations. The "benchmark + nonlinear compensation" decision-making model designed in this invention utilizes the S-shaped characteristics of the tanh function to form an "adjustment dead zone" when the pig herd is comfortable, avoiding frequent start-ups and shutdowns of equipment and energy waste; it can respond quickly when the pig herd is uncomfortable; and it can limit the compensation amount to a safe range when the pig herd is extremely uncomfortable. Therefore, this invention achieves smooth, stable and safe closed-loop control, solving the problem of simple and crude control logic.
[0170] (3) The system achieves comprehensiveness and robustness: Existing technologies often rely on only a single information source. This invention integrates multi-dimensional information such as physiology, behavior, environment, and production background, and designs a confidence-weighted and conservative backoff mechanism. Therefore, even if some information sources temporarily fail, the system can still make relatively reliable judgments or safely switch to the basic mode, greatly improving the system's comprehensive adaptability and reliability in complex aquaculture sites.
[0171] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0172] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0173] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0174] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0175] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0176] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0177] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for controlling the ambient temperature of a pig herd, characterized in that, include: Visual image information of pigs in pig pens is collected using image acquisition devices, and physical environmental information of pig pens is collected using environmental devices. Based on the collected visual image information of the pig herd, a set of visual behavior and physiological characteristics of the pig herd is extracted. ; Based on the collected physical environment information of pig pens and the pig production background information provided by the breeding management system, the physical environment feature sets of the pig herd are extracted respectively. and production background feature set ; Based on visual behavior and physiological characteristics Physical environment feature set and production background feature set , forming multidimensional feature vectors ; Based on the multidimensional feature vector Calculate a quantitative index reflecting the current true feelings of the pig herd, wherein the quantitative index is the thermal comfort score. ,include: The multidimensional feature vector Each feature index Define a standardized availability function. , where i represents the feature index number, and the degree function is available. The output range is [-1, 1]. The availability function aims to quantify the degree of deviation of a single feature index from its "physiological and behavioral optimal zone", where +1 represents severe heat, -1 represents severe cold, and 0 represents comfort. Specifically, based on each characteristic index value and its corresponding comfort zone threshold, a detachment function for each characteristic index is defined using the hyperbolic tangent function, and the comfort zone threshold is adaptively adjusted according to the age or weight range of the pig herd. The thermal comfort score of the pig herd is obtained by aggregating and calculating the values of each feature index and its corresponding takeability function. : ; in, The weight of each feature indicator; Based on the thermal comfort score Determine the target temperature for the dynamic environment. ,include: ; in, The standard baseline temperature is the recommended temperature obtained from authoritative feeding standards based on the pig's age or weight. This is the temperature sensitivity coefficient; The response positivity coefficient; It is the hyperbolic tangent function; Based on the dynamic environmental target temperature The ambient temperature inside the pigpen is controlled.
2. The method for controlling the ambient temperature of a pig herd according to claim 1, characterized in that, Visual image information of pigs in pig pens is collected using image acquisition devices, including: An image acquisition device is installed on the top or side of the pigpen to capture visual image information of the pigs in the pigpen around the clock. The image acquisition device is an RGB-D camera, a thermal imaging camera, or a high-definition RGB camera with infrared supplementary light. In normal operation, the image acquisition device acquires visual image information of the pig herd at a low frequency; when a sudden change in pig behavior or the activation of environmental equipment is detected, the image acquisition device automatically switches to a high frequency to acquire visual image information of the pig herd. The physical environmental information of the pigpen collected based on environmental equipment includes: Temperature and humidity sensors, black ball thermometers, and wind speed sensors are evenly distributed in the pigsty to collect real-time information on the physical environment inside the pigsty.
3. The method for controlling the ambient temperature of a pig herd according to claim 1, characterized in that, Based on the collected visual image information of the pig herd, a set of visual behavior and physiological characteristics of the pig herd is extracted. ,include: Visual segmentation is performed on the collected visual image information of the pig herd to obtain the outline mask of each pig and the position information of each outline. Based on the contour mask of each pig, the positional information of each contour, and consecutive frame images, a set of visual behavior and physiological features of the pig herd is extracted. ; The set of visual behaviors and physiological characteristics It must contain at least one or more of the following: The characteristics reflecting the spatial distribution and posture of pig herds include at least the posture and low activity feature family PIM and the group aggregation and organization family POR. Features reflecting the interaction intentions of pig herds with specific functional areas, wherein the features reflecting the interaction intentions of pig herds with specific functional areas include at least the wet area usage pattern feature family DZP; The characteristics reflecting the physiological state of a pig herd include at least the herd respiratory rate characteristic family (RRE).
4. The method for controlling the ambient temperature of a pig herd according to claim 3, characterized in that, The posture and low-activity feature family PIM includes the lateral recumbent area percentage. and activity index The lateral recumbent area accounts for It is obtained in the following way: A lightweight pose classification model is used to identify pigs lying on their sides from the visual image information of the pig herd, and the proportion of the pixel area of the pigs lying on their sides to the total pixel area of the pig herd is calculated. The activity index It is obtained in the following way: The average pixel change intensity of continuous grayscale image frames within the pigs' activity area is calculated, and the average pixel change intensity is normalized using the baseline of the nighttime resting period to obtain an activity index reflecting the group's tranquility. The group aggregation organization degree family of features POR includes group aggregation degree. Group occupancy ratio The average nearest neighbor distance among pigs and the average radius within a DBSCAN cluster, wherein the group aggregation degree It is obtained in the following way: The centroid coordinates of all pigs were analyzed using the DBSCAN clustering algorithm to calculate the proportion of pigs in the "clustered" state to the total number. The ratio of the area occupied by the group It is obtained in the following way: Merge the outlines of all pigs, calculate the minimum convex hull area of the merged outline, and divide the minimum convex hull area by the effective area of the pigpen to obtain the group-to-pen area ratio. ; The wet area usage pattern feature family DZP includes the duration of lying down in the wet area. The occupancy rate of the wet area, the frequency of access, and the lag or trend of change over time, wherein the duration of lying down in the wet area. It is obtained in the following way: By calibrating the waterer / spray area as the "wet area" and the region of interest (ROI), the total time that pigs spent in the "curled / belly-lying" or "side-lying" posture in the ROI was counted based on the posture classification results. The population respiratory rate feature family RRE includes the population mean respiratory rate. Among them, the average respiratory rate of the population Obtain it through the following methods: Select multiple candidate pigs that meet the preset conditions from all pigs in the herd; Determine the region of interest (ROI) for each candidate pig; The average motion value of all pixels in the vertical direction within the region of interest (ROI) of each candidate pig in each frame image is calculated using the optical flow method, thus obtaining the original time series signal representing the respiratory motion of each candidate pig. For each candidate pig, the original time series signal is subjected to bandpass filtering and fast Fourier transform to obtain the power spectrum. The dominant peak value on the power spectrum was detected as the respiratory rate of each candidate pig; The respiratory rate quality index of each candidate pig is calculated, and the respiratory rates of pigs with quality indices higher than the quality index threshold are averaged to obtain the population average respiratory rate representing the current state of the entire pig herd. .
5. The method for controlling the ambient temperature of a pig herd according to claim 4, characterized in that, The process of selecting multiple candidate pigs that meet preset conditions from all pigs in the herd includes: Candidate pigs that meet the following three conditions are selected from all pigs: The first condition is that the pig is identified as lying on its side; The second condition is: the changes in the position and shape of the pig in several consecutive frames of images are all less than the change threshold; Third condition: The chest and abdominal area of the pig is not obscured in the image; The determination of the Region of Interest (ROI) for each candidate pig includes: Based on the contour mask and pose information of each candidate pig, a rectangular or circular region is located on the side of the chest and abdomen of the candidate pig as the region of interest (ROI).
6. The method for controlling the ambient temperature of a pig herd according to claim 1, characterized in that, The set of physical environmental characteristics of the pig herd The set of physical environmental characteristics of the pig herd, directly measured by environmental equipment. Including dry bulb temperature Relative humidity (RH) and black ball temperature Wind speed , as well as gas concentration, gas pressure and thermal index; The set of production background features Including the age of the pigs Pig herd density The parameters include the pig's weight range, diet stage, health status indicators, and pen structure.
7. The method for controlling the ambient temperature of a pig herd according to claim 3, characterized in that, The multidimensional feature vector The characteristic indicators include the respiratory rate (RRE) of the swine herd, and the take-up function of the RRE. Defined as: ; in, Indicates the respiratory rate of the pig herd. , The slope parameter controls the sensitivity to deviation, and the respiratory rate within the physiological comfort zone of the pig herd. exist[ , ]between.
8. The method for controlling the ambient temperature of a pig herd according to claim 1, characterized in that, The thermal comfort score is used as a basis for the assessment. Determine the target temperature for the dynamic environment. It also includes: When a preset abnormal state is detected, the dynamic environmental target temperature is determined. The steps are switched to directly outputting based on the production background feature set. Standard base temperature ; The abnormal states include image acquisition devices being blocked and malfunctioning, data loss from environmental devices, or the quality of the acquired visual image information not meeting the requirements.
9. A temperature control system for pig herds, characterized in that, include: The acquisition module is used to acquire visual image information of pigs in the pigpen based on image acquisition equipment, and to acquire physical environmental information of the pigpen based on environmental equipment; The extraction module is used to extract a set of visual behavior and physiological characteristics of the pig herd based on the collected visual image information. ; and based on the collected physical environment information of pig pens and the pig production background information provided by the breeding management system, respectively extract the physical environment feature sets of the pig herd. and production background feature set Among them, the set of visual behavior and physiological characteristics Physical environment feature set and production background feature set , forming multidimensional feature vectors ; The calculation module is used to calculate based on the multidimensional feature vector. Calculate a quantitative index reflecting the current true feelings of the pig herd, wherein the quantitative index is the thermal comfort score. ,include: The multidimensional feature vector Each feature index Define a standardized availability function. , where i represents the feature index number, and the degree function is available. The output range is [-1, 1]. The availability function aims to quantify the degree of deviation of a single feature index from its "physiological and behavioral optimal zone", where +1 represents severe heat, -1 represents severe cold, and 0 represents comfort. Specifically, based on each characteristic index value and its corresponding comfort zone threshold, a detachment function for each characteristic index is defined using the hyperbolic tangent function, and the comfort zone threshold is adaptively adjusted according to the age or weight range of the pig herd. The thermal comfort score of the pig herd is obtained by aggregating and calculating the values of each feature index and its corresponding takeability function. : ; in, The weight of each feature indicator; The determination module is used to determine the thermal comfort score. Determine the target temperature for the dynamic environment. ,include: ; in, The standard baseline temperature is the recommended temperature obtained from authoritative feeding standards based on the pig's age or weight. This is the temperature sensitivity coefficient; The response positivity coefficient; It is the hyperbolic tangent function; The control module is used to control the target temperature of the dynamic environment. The ambient temperature inside the pigpen is controlled.
Citation Information
Patent Citations
Pig respirator rate detecting method and device on basis of machine vision
CN102499687A
Pig house environment regulation control system and method based on multiple sensors
CN119002595A
Breeding environment temperature control system for pig farm
CN120103897A