Intelligent sheep house environment regulation and control system and method based on multiple sensors
By using a multi-sensor system and a behavior-environment coupling model, the sheep's discomfort index is calculated in real time, and a collaborative control strategy is generated. This solves the problem of the disconnect between the sheepfold environmental control system and the physiological needs of the sheep, and realizes personalized and forward-looking control, thereby improving the health and production efficiency of the sheep flock.
Patent Information
- Application Number
- CN202511978868.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-20
AI Technical Summary
Existing sheepfold environmental control systems cannot respond to the sheep's real physiological needs in real time. The control logic is disconnected from the sheep, the coordination of multiple devices is poor, and the control response is lagging, resulting in insufficient or excessive control, which affects the health of the flock and production efficiency.
A multi-sensor system is used to collect environmental parameters and video data in real time. The sheep discomfort index is calculated through a behavior-environment coupling model to generate a coordinated control strategy. Combined with video analysis and machine learning algorithms, intelligent control driven by biofeedback is achieved.
It enables personalized and forward-looking environmental regulation of sheep flocks, improves the health and production efficiency of sheep flocks, avoids regulatory conflicts, and enhances the accuracy and response speed of regulation.
Smart Images

Figure CN121704618A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of livestock breeding environment control, more particularly, the present application relates to a kind of sheep house environment intelligent regulation and control system and method based on multiple sensors. BACKGROUND
[0002] Sheep house environment regulation is the key link of modern intensive sheep production, and suitable temperature, humidity, air quality and ventilation conditions are the basis for ensuring the health of sheep, improving feed conversion rate and reproductive performance. Traditional or semi-automatic control method cannot cope with the dynamic environmental load caused by day and night temperature difference, seasonal change and sheep density change.
[0003] At present, the common sheep house environment regulation system mainly relies on temperature, humidity, ammonia and other sensors deployed in the shed, and compares the collected environmental parameter data with the preset fixed threshold value, and then independently controls the fan, wet curtain, heater and other equipment. This method has obvious shortcomings: first, its regulation logic is based on static threshold, which cannot perceive the real thermal state of the core receptor of sheep, for example, the same temperature, different humidity, wind speed combination or different growth stages of sheep produce different thermal effects, and single parameter threshold control easily leads to insufficient or excessive regulation. Second, each environmental factor regulation device often acts independently, lacks coordination strategy, and may cause regulation conflict, such as excessive ventilation to reduce ammonia concentration in summer, which may cause low temperature or high wind speed in the shed, and even cause cold stress of sheep. Finally, the existing technology responds to environmental changes passively and laggingly, and usually starts regulation only when the environmental parameters have deviated from the comfort zone, which cannot realize preventive intervention based on biological feedback.
[0004] Therefore, in view of the above problems, a sheep house environment intelligent regulation system and method based on multiple sensors are proposed to solve the problems of disconnection between regulation logic and real physiological needs of sheep, poor coordination of multiple devices and lagging regulation response in the prior art. SUMMARY
[0005] In order to overcome the above-mentioned defects of the prior art, the embodiments of the present application provide a sheep house environment intelligent regulation system and method based on multiple sensors to solve the problems raised in the background art.
[0006] To achieve the above-mentioned purpose, the present application provides the following technical scheme: a sheep house environment intelligent regulation method based on multiple sensors, comprising the following steps: S1: through multiple groups of sensor nodes deployed in the interior of sheep house, real-time acquisition of multiple environmental parameter data including temperature, humidity, wind speed, ammonia concentration and light intensity; S2: through at least one video acquisition device deployed in the interior of sheep house, continuously acquiring real-time monitoring video stream data of sheep in the sheep house; S3: Real-time identify and calculate the number of sheep in at least two pre-defined typical postures in the sheep flock from the real-time monitoring video stream data, the typical postures at least include the gathering posture and the scattering posture; S4: Align and fuse the number of sheep calculated in step S3 with the multiple environmental parameter data collected in step S1 in space-time, input into a pre-generated behavior-environment coupling model, and the model outputs a quantitative sheep flock discomfort index; S5: Compare the sheep flock discomfort index with the preset threshold range, when the index exceeds the threshold range, based on the numerical value, exceeding direction and change trend of the index, trigger the control strategy generator to generate a control instruction sequence containing specific control equipment, control action and expected control duration; S6: Issue the control instruction sequence to the corresponding environmental control execution equipment to drive the equipment to execute joint action, and return the execution state feedback during the action execution process; S7: Within a preset evaluation period after executing the control instruction sequence, repeat steps S1 to S4 to calculate a new sheep flock discomfort index, evaluate the control effect, and decide whether to terminate, maintain or adjust the current control strategy according to the evaluation result.
[0007] Preferably, step S3 specifically includes: S31: Process the input real-time monitoring video stream frame by frame, and use a deep learning-based instance segmentation model to segment the outline of each sheep in the image; S32: Extract the skeleton key point information of the segmented single sheep outline; S33: Determine the posture category of the sheep according to the skeleton key point information through a posture classification model; S34: Calculate the average value of the number of sheep in the "gathering posture" in all video frames within a preset time window T1, and the proportion P_cluster of the total number of sheep, and the proportion P_normal of the number of sheep in the "normal standing or prone posture"; S35: The ratio or difference of the proportions P_cluster and P_normal is used as the core behavior feature parameter input into the behavior-environment coupling model.
[0008] Preferably, the pre-generation process of the behavior-environment coupling model includes: M1: Collect a historical data set covering at least one complete seasonal cycle, the data set includes time-synchronized environmental parameter time series and corresponding sheep flock behavior video clips; M2: Extract behavioral features from the historical behavioral video clips at fixed intervals to form a behavioral feature time series, wherein the behavioral features include at least the clustering ratio; M3: Analyze the lagged correlation between the change events of specific parameters in the environmental parameter time series and the change events of characteristic values in the behavioral characteristic time series, and determine the lag time τ of different environmental factors causing changes in flock behavior; M4: Construct model training samples. Each sample uses the change in environmental parameters ΔE within a time window of length τ before a certain time t as the input feature and the behavioral feature value B_t at time t as the output label. M5: Use machine learning regression algorithms to train the behavior-environment coupling model so that it can predict the current flock behavior characteristic value B_pred based on the historical environmental parameter change ΔE. M6: The actual observed behavioral feature value B_t is compared with the model predicted value B_pred, and the absolute value of the difference is normalized and defined as the flock discomfort index.
[0009] Preferably, in step M3, the method for determining the lag time τ is as follows: for each type of environmental parameter, calculate its cross-correlation function with the behavioral feature sequence under different time delays, and take the delay time corresponding to the peak value of the cross-correlation function as the initial lag time τ_init corresponding to the environmental parameter; and statistically analyze all historical data of sheep pens, and take the mode or median of the initial lag time τ_init as the final determined lag time τ.
[0010] Preferably, the working logic of the control strategy generator in step S5 includes: S51: Analyze the main contributing environmental factors that cause the current sheep flock's discomfort index to exceed the limit. The analysis is based on the internal feature weights of the behavior-environment coupling model or determined by calculating the sum of the products of the degree to which each current environmental parameter deviates from its comfort range and its weight. S52: If the main contributing factor is determined to be "high temperature accompanied by low wind speed", then generate the first-level control instruction: first, increase the longitudinal ventilation equipment to more than 80% of the rated power and continue for at least 10 minutes; S53: During the execution of the first-level control instruction, if the rate of decrease of the sheep discomfort index is lower than the preset threshold V1, a second-level control instruction is generated: while maintaining ventilation, the wet curtain cooling system is started, and the start-stop cycle of the wet curtain water pump is controlled to be 2 minutes on and 3 minutes off. S54: If the main contributing factor is "high ammonia concentration", the generated control command will prioritize controlling the ground ventilation equipment and roof exhaust equipment to work together, and calculate the necessary ventilation volume required to achieve the target concentration, thereby controlling the opening degree of the equipment.
[0011] Preferably, in step S53, the start-up conditions of the evaporative cooling system further include: calculating the theoretical evaporative cooling potential under the current conditions based on the real-time collected outdoor air humidity; when the theoretical evaporative cooling potential is lower than 3°C, limiting the maximum start-up time of the evaporative cooling pump or reducing its start-up priority.
[0012] Preferably, the evaluation of the regulatory effect in step S7 specifically includes: S71: Record the current flock discomfort index I_start at time point t_start after the start of the control command; S72: After the control command is executed, wait for an evaluation delay time corresponding to the lag time τ of the behavior-environment coupling model, and calculate the new flock discomfort index I_eval at the time point t_eval=t_start+τ+Δt (Δt is a fixed observation window, such as 30 minutes); S73: Calculate the control effectiveness value η=(I_start-I_eval) / I_start; S74: If η is greater than the effective threshold η_th, the current regulation is deemed effective, and the current regulation parameter combination is recorded; if η is less than or equal to η_th, the current regulation is deemed ineffective, and the current data is fed back as a negative sample to the regulation strategy generator for subsequent strategy optimization.
[0013] A multi-sensor-based intelligent control system for sheepfold environment, used to implement the above method, the system comprising: The sensor array module is distributed inside the sheepfold and at the air inlet to collect environmental parameter data in real time, including at least temperature, humidity, wind speed and ammonia concentration. The video acquisition and analysis module includes cameras deployed at key locations in the sheepfold and a behavior analysis unit connected to them. The behavior analysis unit is used to process video streams and calculate the proportion of sheep in different predefined postures in the flock in real time. The data fusion and central processing module is communicatively connected to the sensor array module and the video acquisition and analysis module. It is used to receive and spatiotemporally align environmental parameter data and behavioral ratio data, run a pre-stored behavior-environment coupling model, and calculate the sheep discomfort index. The regulation strategy generation module, either integrated into the data fusion and central processing module or set up independently, is used to generate a specific environmental regulation instruction sequence based on the sheep discomfort index. The actuator control module is communicatively connected to the regulation strategy generation module and is used to receive the regulation command sequence and convert it into control signals for environmental regulation equipment, including at least a fan, a wet curtain pump, a heater, and a roller shutter motor. The system status monitoring and feedback module is used to monitor the operating status of the environmental control equipment, collect environmental and behavioral data after control, and feed them back to the data fusion and central processing module for effect evaluation.
[0014] Preferably, the behavior analysis unit in the video acquisition and analysis module integrates a lightweight convolutional neural network model. The network model includes, in sequence, a backbone network for feature extraction, a region proposal network for instance segmentation, and a sub-network for key point detection and pose classification. It can perform end-to-end real-time processing of the video stream and directly output the pose category of each sheep.
[0015] Preferably, the data fusion and central processing module also stores a simplified simulation model of the thermal environment and airflow field of a three-dimensional sheepfold space; Before generating control instructions for the ventilation equipment, the control strategy generation module first inputs the current environmental state and the proposed control action as boundary conditions into the simplified simulation model to quickly simulate and predict the wind speed and temperature distribution in the main activity area of the sheep after the control. The control strategy generation module fine-tunes the equipment opening degree and wind direction angle in the control command based on the simulation prediction results in order to optimize airflow organization.
[0016] The technical effects and advantages of this invention are as follows: To address the problem that existing technologies rely on fixed thresholds and cannot respond to the actual physical sensations of sheep, this invention deploys video capture devices and runs behavioral analysis algorithms to extract key posture features such as flock agglomeration ratios in real time. This behavioral feature sequence is then analyzed synchronously with time-series environmental parameter data to train a behavior-environment coupled model. This model can quantitatively assess the stress level of sheep caused by environmental changes and output a flock discomfort index. Using this index as the core decision-making basis, the system replaces traditional single-parameter threshold judgments, making regulatory actions directly linked to the flock's biological feedback. This achieves a shift in regulatory goals from "environmental parameters meeting standards" to "flock comfort," improving individual welfare and providing a data foundation for precision animal husbandry.
[0017] To address the potential regulatory conflicts arising from independent operation of multiple devices, this invention designs a time-series regulation strategy generator guided by the changing trend of the sheep's discomfort index. When the system determines that intervention is necessary, it first analyzes the main environmental contributing factors causing discomfort and generates a phased, multi-device coordinated instruction sequence. For example, for heat stress, the system prioritizes high-volume ventilation for cooling; if this is ineffective, it then adds evaporative cooling using wet curtains, while automatically limiting the use of wet curtains based on the outside humidity to prevent over-humidification. This multi-device coordinated control, based on feedback from the core biological state and with logical sequence and conditional constraints, effectively avoids contradictory operations between different regulatory objectives (such as cooling and ammonia removal), ensuring the consistency and safety of regulatory measures.
[0018] To address the issue of delayed response in existing technologies, this invention introduces lag time analysis of historical data into the behavior-environment coupling model, clarifying the time difference between environmental changes and the sheep's behavioral response. Utilizing this understanding, the system not only reacts to the current state of the environment but also monitors recent trends in environmental parameters and combines this with model predictions of potential behavioral shifts. This allows for the potential initiation of mild or preventative interventions before the sheep exhibit obvious signs of adverse behavior. Furthermore, after each intervention, the system delays the process by an evaluation window matching the behavioral response lag time to quantify the effectiveness of the intervention. Cases of poor performance are used as feedback data for continuous optimization of the intervention strategy, forming a closed-loop control system with learning and adaptive capabilities, significantly improving the foresight and overall efficiency of the intervention. Attached Figure Description
[0019] Fig. 1 This describes the overall system workflow of the present invention.
[0020] Fig. 2 This is the core processing and data analysis workflow of the present invention.
[0021] Fig. 3 This invention relates to the intelligent control decision-making and execution process. Detailed Implementation
[0022] 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, and 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.
[0023] Example 1 As attached Figs. 1 to 3 The following is a flowchart illustrating an intelligent control system and method for sheepfold environment based on multiple sensors: First, multi-source data is collected synchronously: temperature, humidity, wind speed, ammonia, and light sensors are deployed in a distributed manner to continuously acquire physical environmental parameters inside the sheepfold and at the air inlet; at the same time, network cameras installed in key locations in the sheepfold are used to continuously collect video streams of sheep activities.
[0024] Subsequently, the system enters the information fusion and intelligent decision-making stage: the video stream is processed by specialized behavioral analysis algorithms to quantify the proportional characteristics of postures that reflect the thermal comfort state of the sheep flock; these behavioral characteristics, along with spatiotemporally calibrated environmental parameter data, are fed into a pre-trained "behavior-environment coupling model." This model decodes the complex mapping relationship between environmental changes and the collective behavioral response of the sheep flock, and outputs a scalar value called the "Sheep Discomfort Index." This index, as a comprehensive indicator measuring the immediate welfare status of the sheep flock, directly triggers and guides subsequent regulatory decisions.
[0025] When the index exceeds the preset comfort range, a "regulation strategy generator" with phased logic will be activated. It analyzes the main environmental triggers causing discomfort and generates a series of orderly and coordinated control instructions, such as ventilating first and then cooling, or specifically strengthening ammonia removal. These instructions are converted into specific control signals to drive the actuators such as fans, evaporative cooling pumps, heaters, and roller shutters.
[0026] Finally, the system introduces an evaluation step based on delayed feedback: after implementing control measures, a period of time matching the lag in the sheep's behavioral response is waited, the discomfort index is recalculated, the actual effect of the control measures is evaluated, and this experience (whether successful or not) is used as learning data to optimize future decision-making logic.
[0027] The more specific implementation method is as follows: The process of identifying and calculating the proportion of sheep poses from the video stream is implemented as follows: First, the input real-time video is decoded frame by frame and fed into an instance segmentation model based on a convolutional neural network. This model uses a lightweight Mask R-CNN architecture, with its backbone network employing MobileNetV3, ensuring segmentation accuracy while meeting the real-time requirements of edge device deployment. The model's task is to accurately segment the contour mask of each sheep in a complex barn background, even if there is partial occlusion between sheep.
[0028] After obtaining the single sheep mask, the next step is pose estimation. The system employs a variant of the keypoint detection algorithm based on Part Affinity Fields, defining 13 key body parts for the sheep's morphology, including the nose tip, ear roots, neck, shoulders, rump, and limb joints. Based on the pixel information within the mask area, the two-dimensional coordinates of these keypoints are inferred. These keypoint coordinates constitute the raw data describing the single sheep's pose.
[0029] Then, a lightweight, fully connected neural network pose classifier begins to work. This classifier takes the normalized coordinate vectors of 13 keypoints as input, performs multiple nonlinear transformations, and outputs the probability distribution of the sheep belonging to each predefined pose category.
[0030] These posture categories include at least "aggregated postures" (characterized by multiple sheep standing close together with key points spatially overlapping) and "normal standing or lying postures." To quantify group behavior, the system uses a sliding time window (e.g., The statistics are performed in units of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ... Simultaneously calculate the average proportion of "normal posture". Ultimately, the system combines these into a more discriminative behavioral feature, such as using a ratio. or difference Combined features can more sensitively capture the overall shift in flock behavior patterns, for example, when... An increase in the value indicates that aggregation behavior is more prominent than normal behavior, which may foreshadow an increase in environmental stress.
[0031] Furthermore, the pre-training process of the "behavior-environment coupling model" is the process of establishing a quantitative causal model between environmental disturbances and the behavioral responses of sheep. First, a large-scale historical dataset needs to be constructed, requiring the collection of time-series data covering at least one complete cycle of spring, summer, autumn, and winter, ensuring that the data includes various extreme and mild climatic conditions.
[0032] The dataset consists of two parts: one is high frequency (e.g., each...) Time series data of various environmental parameters collected. Second, the time-series data of behavioral characteristics within the corresponding time period, which were recorded synchronously and processed according to the aforementioned method. (e.g., clustering ratio sequence).
[0033] The preliminary step is lag time analysis. Environmental changes affect the physiological perception of sheep flocks and ultimately manifest as behavioral changes, a process with a significant time lag. Therefore, it is necessary to quantitatively identify the dominant lag time between each key environmental factor (such as temperature and ammonia concentration) and behavioral characteristics (such as aggregation). This is achieved by calculating the cross-correlation function between the two. Using temperature... With clustering degree For example, calculate multiple offsets from negative to positive. Cross-correlation function under value : in and This is the sequence mean. (Function value) Characterized the advance of temperature sequence The degree of linear correlation between each time unit and the current clustering sequence. When When a peak occurs, it indicates that the offset... The strongest correlation was found under the following conditions, corresponding to The value is considered to be the initial hysteresis time of temperature's influence on aggregation behavior. For example, the analysis might find that when (i.e., 60) Assuming the data interval is )hour, Reaching negative peak This means that the currently observed increase in clustering is likely related to 60 This is closely related to previous temperature rise events.
[0034] Next is model sample construction. Based on a defined lag time. Historical data is divided into a large number of training samples. The input features of each sample... It's the past Changes in various environmental parameters over a period of time (e.g.) , This describes the "stress" recently exerted by the environment. Sample label That is the current moment. Actual behavioral characteristic value (e.g., the degree of clustering). The model itself can be trained using non-linear regression algorithms such as Gradient Boosting Decision Tree (GBDT). GBDT can handle the interaction effects between environmental features well; for example, the combined effect of high temperature and high humidity on behavior may be much greater than the sum of their individual effects.
[0035] After the model is trained, for a given new input (i.e., the most recent input), (Environmental changes over a period of time), it will output a predicted value corresponding to the sheep's behavioral characteristics at the current moment. This predicted value represents the baseline behavior that the model, based on historical patterns, believes a flock "should" exhibit under given environmental history. Finally, there's the "Flock Discomfort Index." Defined as the actual observed behavioral feature value Compared with the baseline value predicted by the model Normalized absolute value of the deviation between: It measures not the absolute good or bad of behavior, but rather the degree of deviation of current behavior from "normal" behavior under similar historical environmental conditions. A high I value indicates abnormal flock behavior that cannot be explained by historical patterns of recent environmental changes, strongly suggesting the existence of stressors (such as specific temperature and humidity combinations, unsuitable airflow, etc.) that have not been directly captured or comprehensively assessed by sensors, providing a precise trigger signal for regulation.
[0036] Furthermore, in order to ensure the lag time parameter To ensure robustness and universality, and to avoid model bias caused by the specificity or random fluctuations of data from individual sheep pens, a statistical optimization strategy based on multiple data sources is adopted in the model development process. Specifically, during the model development phase, historical data from multiple sheep pen units with different structures and stocking densities are collected within the same period.
[0037] For the data from each sheepfold unit, the above cross-correlation analysis was performed independently to calculate an initial lag time estimate for a specific environmental parameter-behavioral characteristic pair (such as temperature-aggregation). ,in Representing the Each sheepfold unit. Thus, for a given pair of parameters, a set of estimates will be obtained. Subsequently, statistical analysis is performed on this set to calculate its mode or median. For example, regarding the lag time of ammonia concentration's effect on aggregation degree, analyzing data from 10 sheep pens might yield a set that... Its mode is 90. The system then uses this mode value as the global, final lag time parameter for that parameter. Smooth out the timing disruptions caused by special events (such as temporary repairs or abnormal feeding) in individual sheep pens.
[0038] Furthermore, the control strategy generator transforms the abstract "discomfort index" into specific equipment actions. When the discomfort index... When the stress level is exceeded, the generator first needs to determine which environmental factors(s) are the main contributors to the current stress. This is done through a weighted deviation calculation: for each monitored environmental parameter... Calculate its current value Relative to its independent comfort range median absolute deviation .
[0039] Simultaneously, the feature importance weights of this parameter are extracted from the trained "behavior-environment coupling model" (such as the GBDT model). This weight reflects the parameter's ability to explain behavioral variation in historical data. Finally, a comprehensive score is calculated. The environmental parameter with the highest score is determined as the primary contributing factor. Combining the deviation of the current state with the weight of historical influences, and based on the determination of the primary contributing factor, the policy generator invokes a preset, phased policy template.
[0040] For example, if the generator determines that "the temperature is too high and accompanied by low wind speed," it will activate the "cooling priority" strategy template. The first-stage instruction aims to quickly enhance convective heat dissipation; the command is: turn on all longitudinal tunnel fans to... Rated power, while closing side windows that may interfere with airflow organization, and running continuously for 12 hours. The goal of this phase is to attempt to solve the problem using minimal energy consumption (operating at incomplete power). After issuing a command, the policy generator enters a monitoring state. It continuously tracks the discomfort index. The rate of decline during and after the first phase of instruction execution. If at a preset evaluation time point (e.g., 30 minutes after instruction start). ), calculated The rate of descent is lower than the preset empirical threshold. (e.g., 0.15) If the result is negative, then the first stage effect is deemed insufficient.
[0041] At this point, the generator will initiate the second phase of instructions: increase the wind turbine power to To maximize ventilation, and provided that external conditions are met (see subsequent explanation), start the evaporative cooling pad pump and adopt an "on" configuration. ,closure The system operates in an intermittent mode. Phased upgrades avoid excessive use of high-energy-consuming equipment (such as evaporative cooling pads) during periods of mild discomfort, achieving a balance between energy efficiency and control effectiveness. If the primary contributing factor is determined to be "high ammonia concentration," an "air quality priority" strategy is activated. At this time, the generator will adjust the ammonia concentration based on the sheepfold volume (Vol) and the target ammonia concentration. and current concentration The required theoretical ventilation volume is calculated using an exponential decay model. Subsequently, the command system coordinates the control of the ground ventilation system (responsible for introducing fresh air from the bottom) and the roof exhaust system (responsible for expelling stale air from the top), setting their respective opening degrees according to the calculated air volume ratio to ensure the formation of an effective vertical airflow and quickly reduce the ammonia concentration in the sheep's respiratory layer.
[0042] Furthermore, in the "cooling-first" strategy, a pre-assessment constraint mechanism based on environmental physical conditions is introduced when the evaporative cooling pads are activated. This prevents the evaporative cooling pads from being activated when the external air humidity is already close to saturation, which would result in weak evaporative cooling and even increase the humidity inside the building, potentially leading to energy waste and equipment damage. The system reads the real-time external dry-bulb temperature. and wet-bulb temperature The difference between the two ( This reflects the maximum theoretical drying capacity of the air. Combined with the actual evaporation efficiency coefficient of the wet curtain... (Typically 0.6 to 0.8, depending on the material of the evaporative cooling pad and the wind speed), which can be used to estimate the approximate cooling effect that the evaporative cooling pad system can achieve. : The system presets a validity threshold, for example When calculated At that time, it was considered that the evaporative cooling potential was sufficient, and the strategy generator was allowed to activate the wet curtain as originally planned. If so, the restriction condition will be triggered.
[0043] At this point, even if the logic flow requires initiating a second-stage cooling command, the system will not (or will cautiously) activate the evaporative cooling pad, or significantly modify its operating parameters. For example, the intermittent operation mode of the evaporative cooling pad pump will be adjusted to a more conservative "on" state. ,closure The system only keeps the evaporative cooling pads moist to prevent scale buildup, rather than primarily for cooling. Simultaneously, the system generates a warning log, alerting administrators that "current external humidity is high, evaporative cooling efficiency is low, and ventilation cooling is the primary method of cooling."
[0044] Furthermore, the evaluation of the regulatory effect constitutes the feedback loop of the closed-loop control. Its design must consider the physiological lag in the herd's behavioral response; otherwise, misjudgments will occur. The specific implementation process of this step is as follows: at the precise moment when the regulatory command sequence begins execution, it is marked as... Record the sheep discomfort index calculated at this moment. Subsequently, the system enters a waiting period. The length of this waiting period depends on the lag time of environmental factors related to the current main regulatory objective, as determined in the previous "behavior-environment coupling model". For example, if the current regulation is primarily aimed at addressing heat stress (with temperature as the main contributing factor), then the waiting period should at least include the lag time of the temperature effect. (e.g., 120) In addition, a fixed behavior observation window (e.g., 30) This allows the flock sufficient time to adjust its behavior and for the system to collect stable new data. Therefore, the evaluation time point is set to... .exist At that moment, the system re-collects data, runs the model, and calculates a new flock discomfort index. .
[0045] Next, the effectiveness of this regulatory action will be calculated. It is defined as the percentage decrease in the discomfort index: Set a threshold to represent "significantly effective". (For example, 0.3). If This indicates that the control measures have achieved good results. The system will store the scenario of this successful case (including initial environmental parameters, behavioral characteristics, identified main factors, and specific instruction sequences) as a positive sample in the "Excellent Strategy Library" for future rapid decision-making reference or strategy optimization in similar scenarios.
[0046] if If the control effect fails to meet expectations, the system will determine that the control measures have not achieved the desired results. At this point, the system will feed the complete process data (environmental status, control commands, and inefficient results) as a negative sample to the control strategy generator. The generator can use these negative samples to adjust its internal branch decision logic or strategy parameters through offline learning. For example, under certain temperature and humidity combinations, it can increase the intensity of the first-stage ventilation or trigger the second stage earlier.
[0047] Furthermore, the physical embodiment of this solution is a multi-sensor-based intelligent environmental control system for sheep pens. This system consists of multiple functional modules integrated through a communication network. The sensor array module comprises various industrial-grade environmental sensors, distributed and deployed at different heights within the sheep pen (e.g., 0.5 meters). 1.0 1.5 The system includes an air intake and a sampling frequency configurable every 30 seconds. or each .
[0048] The video acquisition and analysis module includes a high-definition network camera and its supporting edge computing device. The camera has a resolution of 15... The frame rate captures 1080P video streams, and the edge computing device has the aforementioned lightweight neural network model built in, which is responsible for real-time processing of the video stream and extraction of behavioral features.
[0049] The data fusion and central processing module is usually deployed on a local server or in the cloud. It is the computing and command center of the system. It receives data from the first two modules, runs the "behavior-environment coupling model", calculates the discomfort index, and coordinates subsequent processes.
[0050] The control strategy generation module, as a core software component within the central processing module, is responsible for generating specific control command sequences.
[0051] The actuator control module includes an industrial PLC (programmable logic controller) or an IoT controller. It receives instruction sequences and converts them into relay switch signals, analog output signals, or bus instructions to directly control the start, stop, speed, and position of terminals such as fan frequency converters, water pump contactors, heaters, and roller shutter motors.
[0052] The system status monitoring and feedback module is responsible for collecting status feedback from each actuator (such as whether it has started, current power), energy consumption data, and a new round of environmental and behavioral data after adjustment, and sending it back to the central processing module to complete the closed loop.
[0053] All modules exchange data via Ethernet, RS485, or wireless LoRa to form a complete Internet of Things (IoT) system integrating sensing, decision-making, execution, and feedback.
[0054] Furthermore, to achieve real-time sheep behavior analysis on resource-constrained edge devices, the core algorithms in the video acquisition and analysis module require specialized lightweight design. A feasible implementation is to adopt an improved YOLOv5s architecture. YOLOv5s itself is an object detection model that achieves a good balance between accuracy and speed. In this application, it has been specifically modified: a channel attention module (such as SEBlock) is embedded in the neck network of the model, enabling the network to focus more on the key feature regions of the sheep, improving robustness under complex lighting or partial occlusion. At the same time, the detection head of the original model is expanded to output three branches in parallel: the first branch is responsible for object detection (bounding boxes and sheep class confidence); the second branch is responsible for instance segmentation, outputting a pixel-level mask for each sheep; and the third branch is responsible for keypoint estimation, outputting a heatmap of 13 predefined keypoints. This avoids the cascading errors and cumulative latency caused by splitting the task into multiple independent models.
[0055] After training, redundant neural connections are removed using model pruning techniques, and the model weights are converted from floating-point numbers to low-bit integers (such as INT8) using quantization techniques. The optimized composite model can run on Jetson Nano or similar performance edge computing boxes, achieving a real-time processing speed of nearly 15 frames per second for 1080P resolution video streams. It directly outputs the bounding box, mask, and pose category of each sheep in each frame, reducing the computational pressure on the central server and lowering network bandwidth requirements.
[0056] Furthermore, to predict the effects of control actions in three-dimensional space when generating control strategies, especially ventilation strategies involving spatial airflow organization, and to avoid creating localized airflow dead zones or temperature unevenness, a simplified three-dimensional sheepfold computational fluid dynamics (CFD) model of reduced order is integrated into the data fusion and central processing module. This model is not a time-consuming full-scale CFD simulation, but a surrogate model trained using data-driven methods (such as intrinsic orthogonal decomposition (POD) combined with Kriging interpolation) based on a large number of pre-completed full CFD simulation results.
[0057] It geometrically simplifies the sheepfold into several key control volumes, each with its own temperature, humidity, and airflow status. When the control strategy generator proposes a preliminary ventilation command (e.g., turn on fans A and B, turn off fan C), it first inputs the current temperature and humidity distribution inside and outside the sheepfold, solar radiation intensity, and the proposed command as boundary conditions into this reduced-order CFD model. The model can quickly simulate the effect of executing the command within seconds. -10 At that time, the interior of the sheepfold, especially the height level where the sheep mainly move (0.5 meters), should be kept clean. Up to 1.2 The predicted distribution map of the three-dimensional wind speed and temperature field.
[0058] The strategy generator analyzes this forecast map and finds that the predicted wind speed in certain areas (such as corners or near material troughs) is still below 0.2. Or the temperature forecast is higher than in other areas. The above indicates poor airflow organization.
[0059] At this point, the generator does not directly send the original command, but instead fine-tunes and optimizes it. For example, while keeping the total ventilation volume unchanged, the command might adjust the louver angle of fan A downwards by 15 degrees to directly blow into the still air zone, or briefly increase the power of a certain rooftop fan to enhance the extraction of localized hot air. Subsequently, the fine-tuned command is input back into the reduced-order model for verification until the predicted spatial distribution meets the uniformity requirements, at which point the optimized command, which has undergone "spatial effect pre-evaluation," is finally issued.
[0060] To illustrate the technical solution more clearly, a complete end-to-end explanation is provided below using a specific application scenario. Assume an east-west oriented, longitudinally ventilated, enclosed fattening sheep pen. On a summer afternoon at 13:00, the system begins a work cycle.
[0061] Step 1: Data synchronous acquisition and preprocessing.
[0062] Sensor array module report: Average indoor temperature relative humidity average wind speed ammonia concentration Light intensity .
[0063] Outdoor weather station report: Temperature ,humidity Wind speed Meanwhile, two edge computing boxes deployed at both ends of the sheepfold are processing the video stream in real time.
[0064] Taking one of them as an example, after its internal lightweight YOLO model processes the current frame, the output image contains the detection results of 85 sheep. After the pose classifier determines, 22 of them are in a "gathered pose", 58 are in a "normal standing or lying pose", and the rest are in a "normal standing or lying pose". Only the attitude is uncertain. The system presses 10. Window statistics: Past 10 Inside, the proportion of "aggregated posture" from Gradually climbing to the current level "Normal posture" ratio Then from Descending to Calculate the ratio of behavioral characteristics. .
[0065] Step 2: Reasoning of the behavior-environment coupling model and calculation of the discomfort index.
[0066] The data fusion module combines environmental data with behavioral feature values. Perform timestamp alignment (unify to 13:00).
[0067] The model then begins to work. It first reviews a past period corresponding to the temperature lag time. Historical data, specifically environmental changes from 11:00 to 13:00: Temperature change was calculated. (Significant increase), change in ammonia concentration (Slight increase), wind speed change .
[0068] These changes The input feature vectors are fed into a pre-trained GBDT model. Based on patterns learned from historical data, the model predicts the ratio of sheep behavior features in the current (13:00) environment. What should it be? Assume the model outputs the predicted value. The actual observed value In historical data, the maximum and minimum values of this behavioral characteristic ratio were respectively... and The sheep discomfort index is then calculated as follows: The system's preset comfort index upper limit is .current The condition was determined to be "uncomfortable," triggering regulation.
[0069] Step 3: Generation and pre-evaluation of control strategies.
[0070] The control strategy generator initiates root cause analysis. It calculates the weighted deviation of each parameter: temperature deviation. (The median comfort value is 22) Model weights Assuming a score of 0.5, the score is... Wind speed deviation (The median comfort value is taken as 1.0) ), weight The score is 0.3. Ammonia concentration deviation (Comfort median value) ), weight The score is 0.2. Therefore, temperature score The reading was significantly highest, with the primary contributing factor identified as "higher temperature," and the current wind speed was 0.2. The temperature is far below the comfort median, therefore the overall assessment is "high temperature accompanied by low wind speed". Based on this, the "cooling priority" strategy template is selected.
[0071] First, generate the first-stage instructions: start all The vertical fan is set at a frequency of 40. (about (Rated power), continuous operation for 12 ( Before sending instructions, the policy generator invokes a simplified CFD reduction model for pre-evaluation. Inputs include the current internal and external environment and... Typhoon 40 The "Full Open" command causes the model to... Internal return prediction: after execution The average wind speed at the sheep's activity level will rise to 1.2. However, the wind speed in the area north of the trough was still only 0.3. Therefore, the generator fine-tunes the instructions: while keeping the total power constant, it adjusts the power output of the component located on the north side. Adjust the louvers of the typhoon fan downwards by 10 degrees, and turn on an additional small auxiliary agitator fan aimed at the calm wind zone. After fine-tuning, the simulation was repeated, predicting a more uniform wind speed distribution. Finally, the optimized first-stage composite command was issued.
[0072] Step 4: First phase execution and effect tracking.
[0073] The actuator control module receives instructions and controls the frequency converter and fan louvers to operate. From 13:00 to 13:12, the fan operates according to the instructions.
[0074] The system continuously monitored during this period. Until 13:30 (30 minutes after the start of control). Video analysis shows The proportion stopped rising and stabilized at about, The value is approximately 0.385.
[0075] The wind speed sensor shows that the average wind speed at the active layer has risen to 1.0. At this point, calculate the discomfort index for the half hour from 13:00 to 13:30. Changes: Since the behavior changes little, the model predictions are... The actual values may be slightly adjusted due to environmental changes (increased wind speed), but the actual values will vary. The change is lagging, assuming the instantaneous time calculated at this moment is... The value is approximately 0.35. The rate of decrease is approximately... well below the threshold The system determined that the first phase was insufficient.
[0076] Step 5: Second-stage decision-making and condition check.
[0077] The strategy generator is preparing to initiate the second-stage command. However, an evaporation potential check is performed before generating the wet curtain start command. Read the current (13:30) out-of-division data: , (Through humidity conversion or direct measurement). Take the wet curtain efficiency coefficient. ,calculate: The conditions are met. Therefore, generate the second-stage instructions: 1) The frequency of the longitudinal wind turbines in Taiwan has been increased to 50. ( (Power). 2) Start the wet curtain circulating water pump and operate it in intermittent mode: Turn on ,closure The instruction will begin execution at 13:32.
[0078] Step 6: Delayed evaluation and closed-loop learning.
[0079] The system has entered the effect evaluation waiting period. Since this control measure primarily targets temperature, the evaluation delay time is based on… Set, plus 30 The observation window is used as the evaluation point. During this period, the system will perform normal monitoring, but no major policy changes will be made.
[0080] At 15:30, the system collected the latest data: indoor temperature. ,humidity Wind speed Video analysis shows , , The model predicts current behavioral characteristics based on the environmental history from 13:00 to 15:30 (including changes brought about by regulation). Actual value Calculate the new discomfort index: Calculate the regulation effectiveness value: This indicates that the current regulatory measures have been very effective.
[0081] The system records this successful case in the database: Time (summer afternoon), Initial state (high temperature and low wind speed), ), main factors (high temperature + low wind speed), implementation strategy (first phase: Power + louver fine-tuning + auxiliary fan, 12 Phase Two: Power + intermittent evaporative cooling pad operation, continuing until evaluation), final effect ( It dropped to 0.111. This case can serve as a priority reference for strategy selection in similar scenarios in the future, thereby continuously optimizing the system's response speed and energy efficiency.
[0082] Finally, the following points should be noted: First, in the description of this application, it should be noted that, unless otherwise specified and limited, the terms "installation", "connection", and "linkage" should be interpreted broadly, and can be mechanical or electrical connections, or internal connections between two components, or direct connections. "Up", "down", "left", "right", etc. are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may change. Secondly: The accompanying drawings of the embodiments disclosed in this invention only involve the structures involved in the embodiments disclosed in this invention. Other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of this invention can be combined with each other. In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for intelligent control of sheepfold environment based on multiple sensors, characterized in that, Includes the following steps: S1: Through multiple sets of sensor nodes deployed inside the sheepfold, real-time data on various environmental parameters, including temperature, humidity, wind speed, ammonia concentration, and light intensity, are collected. S2: Continuously acquire real-time monitoring video stream data of the sheep flock inside the sheepfold through at least one video acquisition device deployed inside the sheepfold; S3: From the real-time monitoring video stream data, identify and calculate the proportion of sheep in the flock that are in at least two predefined typical postures, wherein the typical postures include at least a clustered posture and a dispersed posture. S4: The sheep number ratio calculated in step S3 is spatiotemporally aligned and fused with the various environmental parameter data collected in step S1, and then input into a pre-generated behavior-environment coupling model. The model outputs a quantified sheep discomfort index. S5: Compare the sheep discomfort index with a preset threshold range. When the index exceeds the threshold range, based on the value of the index, the direction of the exceedance, and the trend of change, trigger the control strategy generator to generate a control instruction sequence that includes specific control equipment, control actions, and expected control duration. S6: Send the control command sequence to the corresponding environmental control execution device, drive the device to perform joint actions, and return execution status feedback during the execution of the actions; S7: During a preset evaluation period after the execution of the control instruction sequence, repeat steps S1 to S4, calculate a new flock discomfort index, evaluate the control effect, and decide whether to terminate, maintain, or adjust the current control strategy based on the evaluation results.
2. The intelligent control method for sheepfold environment based on multiple sensors according to claim 1, characterized in that, Step S3 specifically includes: S31: Process the input real-time monitoring video stream frame by frame, and use a deep learning-based instance segmentation model to segment the outline of each sheep in the image. S32: Extract the skeletal key point information from the segmented single sheep outline; S33: Based on the skeleton key point information, determine the current posture category of the sheep using a posture classification model; S34: Within the preset time window T1, the average number of sheep judged as "clustered posture" in all video frames is P_cluster, which is the proportion of the total estimated number of sheep, and the proportion of sheep judged as "normal standing or lying posture" is P_normal. S35: The ratio or difference between the proportion P_cluster and the proportion P_normal is used as the core behavioral feature parameter input into the behavior-environment coupling model.
3. The intelligent control method for sheepfold environment based on multiple sensors according to claim 1 or 2, characterized in that, The pre-generation process of the behavior-environment coupling model includes: M1: Collect historical datasets covering at least one complete seasonal cycle, including time-synchronized environmental parameter time series and corresponding sheep behavior video clips; M2: Extract behavioral features from the historical behavioral video clips at fixed intervals to form a behavioral feature time series, wherein the behavioral features include at least the clustering ratio; M3: Analyze the lagged correlation between the change events of specific parameters in the environmental parameter time series and the change events of characteristic values in the behavioral characteristic time series, and determine the lag time τ of different environmental factors causing changes in flock behavior; M4: Construct model training samples. Each sample uses the change in environmental parameters ΔE within a time window of length τ before a certain time t as the input feature and the behavioral feature value B_t at time t as the output label. M5: Use machine learning regression algorithms to train the behavior-environment coupling model so that it can predict the current flock behavior characteristic value B_pred based on the historical environmental parameter change ΔE. M6: The actual observed behavioral feature value B_t is compared with the model predicted value B_pred, and the absolute value of the difference is normalized and defined as the flock discomfort index.
4. The intelligent control method for sheepfold environment based on multiple sensors according to claim 3, characterized in that, In step M3, the method for determining the lag time τ is as follows: for each type of environmental parameter, calculate its cross-correlation function with the behavioral feature sequence under different time delays, and take the delay time corresponding to the peak value of the cross-correlation function as the initial lag time τ_init corresponding to the environmental parameter; and statistically analyze all historical data of sheep pens, and take the mode or median of the initial lag time τ_init as the final determined lag time τ.
5. The intelligent control method for sheepfold environment based on multiple sensors according to claim 1, characterized in that, The working logic of the regulation strategy generator in step S5 includes: S51: Analyze the main contributing environmental factors that cause the current sheep flock's discomfort index to exceed the limit. The analysis is based on the internal feature weights of the behavior-environment coupling model or determined by calculating the sum of the products of the degree to which each current environmental parameter deviates from its comfort range and its weight. S52: If the main contributing factor is determined to be "high temperature accompanied by low wind speed", then generate the first-level control instruction: first, increase the longitudinal ventilation equipment to more than 80% of the rated power and continue for at least 10 minutes; S53: During the execution of the first-level control instruction, if the rate of decrease of the sheep discomfort index is lower than the preset threshold V1, a second-level control instruction is generated: while maintaining ventilation, the wet curtain cooling system is started, and the start-stop cycle of the wet curtain water pump is controlled to be 2 minutes on and 3 minutes off. S54: If the main contributing factor is "high ammonia concentration", the generated control command will prioritize controlling the ground ventilation equipment and roof exhaust equipment to work together, and calculate the necessary ventilation volume required to achieve the target concentration, thereby controlling the opening degree of the equipment.
6. The intelligent control method for sheepfold environment based on multiple sensors according to claim 5, characterized in that, In step S53, the start-up conditions of the evaporative cooling system also include: calculating the theoretical evaporative cooling potential under the current conditions based on the real-time collected outdoor air humidity; when the theoretical evaporative cooling potential is lower than 3°C, limiting the maximum start-up time of the evaporative cooling pump or reducing its start-up priority.
7. The intelligent control method for sheepfold environment based on multiple sensors according to claim 1, characterized in that, The evaluation of the regulatory effect in step S7 specifically involves: S71: Record the current flock discomfort index I_start at time point t_start after the start of the control command; S72: After the control command is executed, wait for an evaluation delay time corresponding to the lag time τ of the behavior-environment coupling model, and calculate the new flock discomfort index I_eval at the time point t_eval=t_start+τ+Δt (Δt is a fixed observation window, such as 30 minutes); S73: Calculate the control effectiveness value η=(I_start-I_eval) / I_start; S74: If η is greater than the effective threshold η_th, the current regulation is deemed effective, and the current regulation parameter combination is recorded; if η is less than or equal to η_th, the current regulation is deemed ineffective, and the current data is fed back as a negative sample to the regulation strategy generator for subsequent strategy optimization.
8. A multi-sensor-based intelligent control system for sheepfold environment, characterized in that, The system for implementing the method of any one of claims 1 to 7 comprises: The sensor array module is distributed inside the sheepfold and at the air inlet to collect environmental parameter data in real time, including at least temperature, humidity, wind speed and ammonia concentration. The video acquisition and analysis module includes cameras deployed at key locations in the sheepfold and a behavior analysis unit connected to them. The behavior analysis unit is used to process video streams and calculate the proportion of sheep in different predefined postures in the flock in real time. The data fusion and central processing module is communicatively connected to the sensor array module and the video acquisition and analysis module. It is used to receive and spatiotemporally align environmental parameter data and behavioral ratio data, run a pre-stored behavior-environment coupling model, and calculate the sheep discomfort index. The regulation strategy generation module, either integrated into the data fusion and central processing module or set up independently, is used to generate a specific environmental regulation instruction sequence based on the sheep discomfort index. The actuator control module is communicatively connected to the regulation strategy generation module and is used to receive the regulation command sequence and convert it into control signals for environmental regulation equipment, including at least a fan, a wet curtain pump, a heater, and a roller shutter motor. The system status monitoring and feedback module is used to monitor the operating status of the environmental control equipment, collect environmental and behavioral data after control, and feed them back to the data fusion and central processing module for effect evaluation.
9. The intelligent control system for sheepfold environment based on multiple sensors according to claim 8, characterized in that, The behavior analysis unit in the video acquisition and analysis module integrates a lightweight convolutional neural network model. The network model includes a backbone network for feature extraction, a region proposal network for instance segmentation, and a sub-network for keypoint detection and pose classification. It can perform end-to-end real-time processing of the video stream and directly output the pose category of each sheep.
10. The intelligent control system for sheepfold environment based on multiple sensors according to claim 8, characterized in that, The data fusion and central processing module also stores a simplified simulation model of the thermal environment and airflow field of a three-dimensional sheepfold space. Before generating control instructions for the ventilation equipment, the control strategy generation module first inputs the current environmental state and the proposed control action as boundary conditions into the simplified simulation model to quickly simulate and predict the wind speed and temperature distribution in the main activity area of the sheep after the control. The control strategy generation module fine-tunes the equipment opening degree and wind direction angle in the control command based on the simulation prediction results in order to optimize airflow organization.
