An environmental anomaly analysis method based on sheep breeding environment monitoring data
By constructing an adaptive inhibition factor and a physiological stress assessment mechanism, the problems of false alarms and false alarms of the LSTM model in the sheep farming environment monitoring system were solved, and accurate anomaly detection of the sheep house environment was achieved, improving the reliability and responsiveness of the system.
Patent Information
- Application Number
- CN202510984332.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2045-07-17
AI Technical Summary
Existing LSTM-based sheep farming environmental monitoring systems are inadequate in identifying false alarms and persistent anomalies caused by routine operations. They cannot effectively distinguish between benign data fluctuations and real faults, leading to false alarms and missed reports, and thus failing to meet the high-reliability environmental monitoring requirements of modern farming.
By constructing an adaptive inhibition factor based on humidity change rate and a physiological stress assessment mechanism, combined with a long short-term memory prediction model, we can obtain a routine operation false alarm inhibition factor and a persistent risk amplification factor. By integrating dual optimization factors to correct the initial prediction error, we can achieve accurate assessment of environmental anomalies.
It significantly improves the accuracy of monitoring abnormal sheepfold environments, reduces false alarms, enhances the ability to identify hidden risks such as persistent high humidity and high temperature, and provides more stable and reliable intelligent protection.
Smart Images

Figure CN120806268B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data anomaly analysis, and particularly relates to an environment anomaly analysis method based on sheep breeding environment monitoring data. BACKGROUND
[0002] In modern animal husbandry, large-scale sheep farms generally deploy Internet of Things (IoT) environment monitoring systems to achieve fine management and maximize production efficiency. The system collects key environmental parameters such as temperature, relative humidity, ammonia concentration and carbon dioxide concentration in real time by deploying various sensors in the sheep shed, thereby forming multi-dimensional environmental time series data. Effective analysis of such data to timely discover and warn of environmental conditions that may pose a threat to the health of the sheep herd is an important technical direction in the current field of intelligent breeding. To achieve the above goal, existing technologies have developed from traditional fixed threshold alarm methods to intelligent anomaly detection using machine learning algorithms. One representative technical solution is the long short-term memory (LSTM) based prediction model anomaly detection method. The technical logic of this method is as follows: first, a large amount of multi-dimensional environmental time series data collected under normal operating conditions is used to train an LSTM neural network model. Given the technical advantages of LSTM networks in learning long-term dependencies and complex dynamic patterns in time series data, the model can accurately grasp the change patterns of the sheep shed environment under normal conditions. In practical applications, the method uses the real environmental data of the recent period as input and uses the trained LSTM model to predict the environmental parameter value at the next time. Then, by calculating the difference between the predicted value and the actual value collected at the next time, a quantitative prediction error is obtained. When the value of the prediction error exceeds a pre-set threshold, the system determines that the current environmental condition deviates from the learned normal pattern and generates an anomaly alarm.
[0003] Although the above-mentioned anomaly detection method based on the long short-term memory (LSTM) prediction model is theoretically advanced, it has been found in the process of testing and deploying it in the actual sheep breeding production environment that the method has two technical defects originating from its algorithmic mechanism, which makes it difficult to ensure the accuracy and comprehensiveness of the warning in practical applications, and cannot meet the demand for high reliability of environmental monitoring in modern breeding.
[0004] The first defect is that the method cannot effectively distinguish between normal production operations and real abnormalities, resulting in false positives. In the daily management of modern sheep farms, regular operations such as high-pressure water gun flushing are required to maintain the hygiene of the pens. Such operations can cause a short-term rapid increase in relative humidity. For LSTM models that have learned the pattern of smooth changes, this sudden change in data is unpredictable, resulting in large prediction errors and false alarms. Because such operations account for a very small percentage of normal data (sample imbalance) and their execution time and pattern have randomness and high variance (non-strict fixedness of personnel operation time), the LSTM model cannot effectively learn them as normal patterns during training. Therefore, the prior art cannot distinguish between benign data changes caused by regular beneficial operations and malignant events caused by real failures, resulting in false alarms that seriously interfere with the normal work of managers. The second defect is that the method cannot effectively identify persistent state abnormalities, resulting in a fatal risk of missed alarms. As a change detector, the core function of the LSTM model is to identify events that deviate from the normal dynamic trajectory. When the environment enters a persistent and stable dangerous state due to some reason (for example, the ventilation system fails after flushing operations, or due to extreme weather, equipment failure), whether it is a cold stress environment with high humidity and coldness or a heat stress environment with high temperature and humidity, although the state itself has a very big physiological harm to the sheep, due to the extremely low data change rate, the LSTM model will gradually adapt to this new stable state and can accurately predict it, resulting in a prediction error that decreases to near zero. This inherent defect in the mechanism makes the prior art lose the ability to detect slow-developing environmental risks such as chronic cold stress and the peak phase of acute heat stress events. SUMMARY
[0005] Therefore, the present application aims to provide an environmental anomaly analysis method based on sheep breeding environment monitoring data to solve the problems of false positives of regular operations and missed alarms of persistent abnormalities.
[0006] To achieve the above-mentioned purpose, the technical scheme of the present application is as follows:
[0007] An environmental anomaly analysis method based on sheep breeding environment monitoring data, the method comprising the following steps:
[0008] Step S1: obtaining the initial prediction error of the sheep shed environment through a long short-term memory prediction model;
[0009] Step S2: obtaining a regular operation false alarm suppression factor by analyzing the relative humidity change characteristics;
[0010] Step S3: obtaining a persistent risk amplification factor by modeling the environmental stress degree and cumulative impact;
[0011] Step S4: correcting the initial error by fusing the conventional operation false alarm suppression factor and the persistence risk amplification factor to obtain a final risk score;
[0012] Step S5: obtaining an environmental anomaly assessment by jointly evaluating the dynamic relative risk and the physiological stress risk.
[0013] Further, the initial prediction error of the sheep shed environment obtained by the long short-term memory prediction model comprises:
[0014] Deploying Internet of Things sensors and a local server in the sheep shed and setting the data acquisition frequency of the sensors; collecting multi-dimensional environmental monitoring time series data through multiple Internet of Things sensors in the sheep shed, and the collected data includes temperature time series data and relative humidity time series data;
[0015] Pre-training the long short-term memory prediction model through historical environmental monitoring data of the sheep shed in a normal state to obtain a long short-term memory prediction model for predicting the environment of the sheep shed;
[0016] Predicting the temperature time series data and the relative humidity time series data by the long short-term memory prediction model, and obtaining the initial prediction error of the sheep shed environment by the actual monitoring data and the prediction data.
[0017] Further, the conventional operation false alarm suppression factor is obtained by analyzing the relative humidity change characteristics, comprising:
[0018] Obtaining the relative humidity time series data of the sheep shed; for the sheep shed relative humidity data at the target time, the calculation result of subtracting the sheep shed relative humidity data at the previous time is taken as the first sheep shed humidity change evaluation; the greater value between the first sheep shed humidity change evaluation and the constant 0 is taken as the second sheep shed humidity change evaluation;
[0019] Setting a short-time time window, for the sheep shed relative humidity data at the target time, obtaining the standard deviation of the first-order difference sequence of the sheep shed relative humidity time series data in the short-time time window; the calculation result of dividing the second sheep shed humidity change evaluation by the standard deviation of the first-order difference sequence of the sheep shed relative humidity time series data is taken as the third sheep shed humidity change evaluation;
[0020] Mapping the inverse of the third sheep shed humidity change evaluation by a power function with a natural constant as the base number; the calculation result of subtracting constant 1 from the corresponding obtained mapping result is taken as the first conventional operation false alarm evaluation;
[0021] Setting a signal sharpening index, taking the signal sharpening index as an exponential term, taking the first conventional operation false alarm evaluation as the base number, and taking the corresponding obtained exponential calculation result as the second conventional operation false alarm evaluation;
[0022] Subtracting the constant 1 from the second routine operation false alarm evaluation result to obtain a routine operation false alarm suppression factor.
[0023] Further, the obtaining of the persistence risk amplification factor by modeling the environmental stress degree and the cumulative influence comprises:
[0024] The instantaneous physiological stress index is obtained by performing nonlinear quantization processing on the current temperature and humidity deviation degree; the total stress cumulative value is obtained by performing dynamic weighted cumulative processing on the instantaneous stress index; and the persistence risk amplification factor is obtained by performing saturation mapping analysis on the total stress cumulative value.
[0025] Further, the obtaining of the instantaneous physiological stress index by performing nonlinear quantization processing on the current temperature and humidity deviation degree comprises:
[0026] A high-humidity danger critical humidity, a saturation humidity, and a humidity influence coefficient on physiological stress are set; a suitable temperature and a physiological tolerance temperature range for sheep growth are set; for any target moment, a larger value between a calculation result of subtracting the sheep shed relative humidity data of the target moment from the high-humidity danger critical humidity and the constant 0 is taken as a first humidity difference; a calculation result of subtracting the high-humidity danger critical humidity from the saturation humidity is taken as a denominator, the first humidity difference is taken as a numerator, a calculation result of multiplying a fraction formed by the numerator and the denominator by the humidity influence coefficient on physiological stress and adding the constant 1 is taken as a high-humidity amplification factor under temperature stress.
[0027] A calculation result of dividing a calculation result of subtracting the sheep shed temperature data of the target moment from the suitable temperature for sheep growth by a square of a calculation result of the physiological tolerance temperature range for sheep growth is taken as a bidirectional symmetry and nonlinear evaluation of temperature deviation; a calculation result of multiplying the bidirectional symmetry and nonlinear evaluation of temperature deviation by the high-humidity amplification factor under temperature stress is taken as the instantaneous physiological stress index.
[0028] Further, the obtaining of the total stress cumulative value by performing dynamic weighted cumulative processing on the instantaneous stress index comprises:
[0029] Setting a forgetting factor based on a two-hour stress half-life; taking a product of the instantaneous physiological stress index at the target time and the data collection interval of the sensor as the instantaneous stress evaluation at the target time; for the first time, taking the instantaneous stress evaluation at the first time as the total stress cumulative evaluation at the first time; for other target times, taking the forgetting factor as a weight of the total stress cumulative evaluation at the previous time of the target time, taking a result of subtracting the forgetting factor from a constant 1 as a weight of the instantaneous stress evaluation at the target time, and performing a weighted sum of the total stress cumulative evaluation at the previous time of the target time and the instantaneous stress evaluation at the target time, and taking a result of the weighted sum as the cumulative stress evaluation with a forgetting effect; setting a stress sensitivity coefficient, and taking a result of dividing the cumulative stress evaluation with the forgetting effect by the stress sensitivity coefficient as the total stress cumulative value.
[0030] Further, the obtaining the persistent risk amplification factor by performing saturation mapping analysis on the total stress cumulative value, comprising:
[0031] Setting a maximum additional amplification coefficient; performing mapping on the total stress cumulative value by a tanh function, and taking a result of multiplying the maximum additional amplification coefficient and the mapping result and adding a constant 1 as the persistent risk amplification factor.
[0032] Further, the obtaining the final risk score by correcting the initial error by fusing the conventional operation false alarm suppression factor and the persistent risk amplification factor, comprising:
[0033] Obtaining a conventional operation false alarm suppression factor and a persistent risk amplification factor at a target time; taking a result of multiplying the conventional operation false alarm suppression factor at the target time and the persistent risk amplification factor at the target time as a final risk optimization factor at the target time; and taking a result of multiplying the final risk optimization factor at the target time and an initial prediction error at the target time as a final risk score at the target time.
[0034] Further, the obtaining the environmental anomaly evaluation by jointly evaluating the dynamic relative risk and the physiological stress risk, comprising:
[0035] Setting a long-time window for dynamic relative risk evaluation, a conventional operation false alarm factor screening threshold and a persistent risk amplification factor screening threshold, for any final risk score at a target time, if the conventional operation false alarm suppression factor at the target time is greater than the conventional false alarm factor screening threshold and the persistent risk amplification factor at the target time is less than the persistent risk amplification factor screening threshold, then adding the final risk score at the target time to a final risk baseline distribution set;
[0036] obtaining a percentile rank of the real-time final risk score in the final risk baseline distribution set by comparing the real-time final risk score with the final risk baseline distribution set in real time, and taking the percentile rank as a first real-time risk assessment; for cumulative stress assessment with forgetting effect at any target time, calculating a proportion of the cumulative stress assessment exceeding a stress sensitivity coefficient, and taking the proportion as a first continuous risk assessment;
[0037] obtaining an environmental anomaly assessment through parallel risk judgment of the first real-time risk assessment and the first continuous risk assessment.
[0038] Further, the obtaining an environmental anomaly assessment through parallel risk judgment of the first real-time risk assessment and the first continuous risk assessment specifically comprises:
[0039] setting a first real-time risk warning split point and a second real-time risk warning split point; if the first real-time risk assessment is greater than or equal to the first real-time risk warning split point and less than the second real-time risk warning split point, triggering a warning level early warning; if the first real-time risk assessment is greater than or equal to the second real-time risk warning split point, triggering a danger level early warning;
[0040] setting a first continuous risk warning proportion, a second continuous risk warning proportion and a third continuous risk warning proportion; if the first continuous risk assessment first exceeds the first continuous risk warning proportion, triggering an attention level early warning; if the first continuous risk assessment exceeds the second continuous risk warning proportion, triggering a warning level early warning; if the first continuous risk assessment exceeds the third continuous risk warning proportion, triggering a danger level early warning.
[0041] Compared with the prior art, the present application has the following advantages:
[0042] The environmental anomaly analysis method based on sheep breeding environment monitoring data provided by the present application significantly improves the accuracy and practicality of sheep house environment anomaly monitoring by introducing a double optimization factor mechanism. In actual breeding scenarios, common high-pressure flushing, spray disinfection and other operations can cause rapid humidity fluctuations, which are easily misjudged as environmental anomalies by traditional models. The present application constructs an adaptive suppression factor based on the humidity change rate, effectively identifies such benign dramatic change behaviors, avoids frequent triggering of false alarms by the system, reduces the interference burden of management personnel, and improves the credibility of the early warning system in daily operation.
[0043] On the other hand, for the implicit risk state of persistent high humidity and high temperature, the application realizes continuous monitoring and dynamic amplification of the slowly deteriorating environment by constructing a unified physiological stress evaluation mechanism and a saturated response modeling. When the environment deviates from the optimal interval but changes are not obvious, the system can still send a risk signal in time according to the physiological load accumulation, making up for the vulnerability of traditional prediction models that are difficult to identify in stable abnormal adaptability. This technical path effectively improves the response capability to key risks such as heat stress and cold stress, providing more stable and reliable intelligent protection for breeding safety. BRIEF DESCRIPTION OF DRAWINGS
[0044] The accompanying drawings, which form a part of this application, are intended to provide further understanding of the application and are incorporated herein in their entirety. The schematic embodiments of the application and their descriptions are used to explain the application and do not constitute an improper limitation on the application. In the drawings:
[0045] Figure 1 A method flowchart of an environment anomaly analysis method based on sheep breeding environment monitoring data according to an embodiment of the application. DETAILED DESCRIPTION
[0046] The application will be described in detail below with reference to the accompanying drawings and embodiments.
[0047] Reference Figure 1 is a method flowchart of an environment anomaly analysis method based on sheep breeding environment monitoring data provided by an embodiment of the application, as Figure 1 shown, an environment anomaly analysis method based on sheep breeding environment monitoring data can include:
[0048] Step S1, obtaining the initial prediction error of the sheep shed environment by the long short-term memory prediction model.
[0049] In the process of environment anomaly analysis based on sheep breeding environment detection data, first, deploy Internet of Things sensors and local servers in the sheep shed and set the data collection frequency of the sensors; collect multi-dimensional environment monitoring time series data through multiple Internet of Things sensors in the sheep shed, the collected data including temperature time series data and relative humidity time series data; pre-train the long short-term memory prediction model through the environment monitoring data of the sheep shed in the historical normal state to obtain the long short-term memory prediction model for sheep shed environment parameter prediction; predict the temperature time series data and the relative humidity time series data by the long short-term memory prediction model, and obtain the initial prediction error of the sheep shed environment through the difference between the actual monitoring data and the predicted data.
[0050] It should be noted that the LSTM model is trained and obtained using the environment monitoring data in the historical normal operating state, and its function is to predict the environment parameters at the next moment according to the input data at the current and past time.
[0051] In step S2, a normal operation false alarm suppression factor is obtained by analyzing the relative humidity change feature.
[0052] In the prior art, the data change caused by normal production operation cannot be distinguished from real malignant environmental abnormality. To solve this problem, the present application first needs to capture and temporarily shield false alarms caused by any form of normal operation characterized by a large amount of moisture entering, such as high-pressure flushing or spray disinfection. The common data feature of these false alarms is that the relative humidity of the environment will inevitably rise sharply for a short time. In contrast, the change in temperature is uncertain because of the specific operation mode, such as using cold water, warm water or hot water for flushing, and environmental compensation measures, such as whether the heating device is turned on at the same time, so it should not be a necessary condition for identifying such normal operations.
[0053] Therefore, in this step, a normal operation false alarm suppression factor is obtained by analyzing the relative humidity change feature. Specifically, the relative humidity time series data of the sheep shed is obtained; the calculation result of subtracting the sheep shed relative humidity data at the target time from the sheep shed relative humidity data at the previous time is taken as the first sheep shed humidity change evaluation; and the greater value between the first sheep shed humidity change evaluation and the constant 0 is taken as the second sheep shed humidity change evaluation.
[0054] A short-time time window is set. In the embodiment of the present application, the length of the short-time time window is set to 1 hour before the target time. For the sheep shed relative humidity data at the target time, the standard deviation of the first-order difference sequence of the sheep shed relative humidity time series data in the short-time time window is obtained; the calculation result of dividing the second sheep shed humidity change evaluation by the standard deviation of the first-order difference sequence of the sheep shed relative humidity time series data is taken as the third sheep shed humidity change evaluation; the inverse of the third sheep shed humidity change evaluation is mapped by a power function with a natural constant as the base number; the calculation result of subtracting the constant 1 from the corresponding obtained mapping result is taken as the first normal operation false alarm evaluation; a signal sharpening index is set, the signal sharpening index is taken as an exponential term, the first normal operation false alarm evaluation is taken as a base number, and the corresponding obtained exponential calculation result is taken as a second normal operation false alarm evaluation; the calculation result of subtracting the constant 1 from the second normal operation false alarm evaluation is taken as a normal operation false alarm suppression factor.
[0055] In an embodiment, it is assumed that the relative humidity data at the th time is , the standard deviation of the first-order difference sequence of the sheep shed relative humidity time series data in the previous short-time time window at the th time is ; the signal sharpening index is ; then the th The formula for calculating the false alarm suppression factor for routine operations at each time point is:
[0056]
[0057] in, Indicates the first False alarm suppression factor for routine operations at each time point; Indicates the first Relative humidity data at each moment; Indicates the first Relative humidity data at each moment; Indicates the first Standard deviation of the first difference sequence of relative humidity time series data of sheep shed within the previous short time window at time point; Indicates the signal sharpening index; Let e represent the natural constant.
[0058] It should be noted that in the above formula for calculating the false alarm suppression factor for routine operations, through... Ensure that the false alarm suppression factor for routine operations only focuses on the positive increase in humidity, which is limited by its own recent standard deviation. Normalization is performed, and the adaptive normalization mechanism ensures that the standard for assessing whether humidity changes are drastic is relative to recent normal values. This allows the method to adapt to different seasons and environmental contexts at different times. This function performs a mapping, smoothly mapping the normalized humidity change value to a... The amplitude of humidity change is calculated by applying a signal sharpening exponential index. When the humidity increment is very small relative to recent fluctuations, the signal value approaches 0; when the humidity increment is very large, the signal value approaches 1. This amplitude signal is then sharpened exponentially to ensure that suppression is only triggered during truly drastic humidity changes, such as high-pressure washing. For moderate humidity fluctuations, a larger sharpening exponent significantly suppresses the amplitude. For example, when the amplitude is 0.8, the sharpened value is 0.41, insufficient to completely reduce the false alarm suppression factor for routine operations to 0. Conversely, an amplitude caused by a washing operation, such as 0.98, has a sharpened value of 0.92, which is still very close to 1. Finally, by subtracting the sharpened signal from the constant 1, when a routine operation caused by a large amount of water injection occurs, the sharpened signal value approaches 1, and the routine operation false alarm suppression factor approaches 0, thus effectively suppressing the prediction error. In all other cases, the sharpened signal will remain at 0 or a small value, so that the routine operation false alarm suppression factor stably approaches 1, without affecting the system's detection of other real anomalies.
[0059] At this point, the routine operation false alarm suppression factor is obtained by analyzing the relative humidity change characteristics.
[0060] Step S3: Obtain the persistence risk amplification factor by modeling the environmental stress degree and cumulative impact.
[0061] After the optimization in step S2, the routine operation false alarm suppression factor can identify and temporarily suppress all large prediction errors caused by sudden humidity increases. The core idea of this design is to suppress first and verify later, but this tolerant suppression strategy itself also brings a new problem: it cannot distinguish between a benign and normal routine operation and a persistent high-humidity risk caused by equipment failure (e.g., uncontrolled humidifier, continuous water supply pipeline leakage, or ineffective ventilation system after flushing operation). These persistent high-humidity (or high-humidity cold, high-humidity warm) environments caused by equipment failure pose a significant threat to the physiological health of the sheep herd. However, the existing technical solutions have fundamental defects in detecting such risks. First, the LSTM prediction model, which is the technical basis, is designed to detect dynamic changes. When the environment enters a persistent and stable high-humidity state due to failure, although this state itself is dangerous, the LSTM model will gradually adapt to this new stable state due to its extremely low data change rate. After the input time window is completely filled with these stable high-humidity data, the model will accurately predict the same stable high-humidity data at the next time, resulting in a sharp decrease in prediction error to near zero level. This is the inevitable false negative problem of LSTM model as a change detector when dealing with persistent state abnormalities. Second, a seemingly direct alternative solution is to add a simple fixed threshold detection. However, this method has two major defects: first, it cannot effectively assess different levels of harm (e.g., relative humidity of 86% and 96% are considered the same type of alarm); second, it cannot quantify the cumulative effect of harm (short-term high humidity and long-term high humidity are considered the same type of alarm), so it cannot achieve accurate hierarchical early warning of risks.
[0062] In summary, to address this false negative issue and overcome the limitations of simple threshold detection, this invention obtains an instantaneous physiological stress index by nonlinearly quantifying the current temperature and humidity deviation; obtains a total stress accumulation value by dynamically weighting and accumulating the instantaneous stress index; and obtains a persistent risk amplification factor by performing saturation mapping analysis on the total stress accumulation value. The core idea of this persistent risk amplification factor is to construct a validator for the recovery process and the persistent state. After the quiet period triggered by the routine operation false alarm suppression factor ends, the persistent risk amplification factor is activated, and its task is to continuously assess whether the environmental state itself is healthy. An instantaneous stress degree of the current environment deviating from a healthy state is quantified using a mathematical model anchored to the optimal range. Then, this stress degree is accumulated with a forgetting effect to obtain a cumulative stress value that reflects the overall physiological load. Finally, based on this cumulative value, the persistent risk amplification factor nonlinearly amplifies a prediction error that may have become very small through a function simulating biological saturation response.
[0063] Specifically, firstly, the instantaneous physiological stress index is obtained by nonlinearly quantifying the current temperature and humidity deviation. Then, the critical humidity for high humidity risk, saturation humidity, and the influence coefficient of humidity on physiological stress are set. In this embodiment of the invention, the critical humidity for high humidity risk is set according to the general standards for livestock environmental control. The saturation humidity is set according to the physical upper limit. The influence coefficient of humidity on physiological stress is set to 2, indicating that the amplification effect on total stress is 3 times when humidity reaches saturation. This parameter can be adjusted according to the actual scenario and is not required. The suitable temperature and physiological tolerance temperature range for sheep flock growth are set. In this embodiment, the suitable temperature for sheep flock growth is set to 20 degrees Celsius based on the center value of the thermoneutrality zone of adult house-raised sheep. According to sheep physiology, severe cold or heat stress occurs when the ambient temperature is below 5 degrees Celsius or above 35 degrees Celsius. The deviation between the two critical temperatures and the optimal temperature is 15 degrees Celsius; therefore, the physiological tolerance temperature range is set to 15 degrees Celsius. For any target time, the relative humidity data of the sheepfold at the target time is subtracted from the high-humidity danger critical humidity. The larger value between the calculated result and the constant 0 is taken as the first humidity difference; the result of subtracting the saturated humidity from the high humidity danger threshold humidity is taken as the denominator, the first humidity difference is taken as the numerator, the resulting fraction is multiplied by the influence coefficient of humidity on physiological stress and added to the constant 1, and the result is taken as the amplification factor of high humidity under temperature stress; the result of subtracting the sheepfold temperature data at the target time from the suitable temperature for sheep growth is divided by the square of the result of the physiological tolerance temperature range for sheep growth, and the result is taken as the bidirectional symmetric and nonlinear evaluation of temperature deviation; the result of multiplying the bidirectional symmetric and nonlinear evaluation of temperature deviation with the amplification factor of high humidity under temperature stress is taken as the instantaneous physiological stress index.
[0064] In one implementation, assume the first The temperature data at each moment is ;No. The relative humidity data at each moment is The critical humidity level for high humidity is... ; saturated humidity is The effect coefficient of humidity on physiological stress is: The suitable temperature for sheep to grow is The physiologically tolerable temperature range is Then the first The formula for calculating the instantaneous physiological stress index at each moment is:
[0065]
[0066] in, Indicates the first Instantaneous physiological stress index at a given moment; Indicates the first Temperature data at each moment; This indicates the suitable temperature for sheep to grow. Indicates the physiologically tolerable temperature range; This represents the coefficient indicating the effect of humidity on physiological stress. Indicates the first Relative humidity data at each moment; This indicates the critical humidity level indicating a high humidity danger zone. This indicates saturated humidity.
[0067] It should be noted that when calculating the instantaneous physiological stress index... Time through This achieves bidirectional, symmetrical, and nonlinear quantification of temperature deviation. First, The deviation of temperature from the optimum point was calculated; both positive (overheating) and negative (overcooling) values represent stress. The squaring operation serves two purposes: first, it unifies positive and negative deviations into a positive stress intensity; second, it amplifies the impact of severe deviations in a non-linear manner—that is, the stress caused by a 20-degree Celsius temperature deviation is much greater than twice that caused by a 10-degree Celsius deviation. This is then divided by the physiologically tolerable temperature range. Normalization was performed to make this a baseline stress value with clear physiological significance. This term simulates the universal amplification effect of high humidity under any temperature stress; whether it accelerates heat loss (cold stress) or hinders heat dissipation (heat stress), high humidity exacerbates physiological stress. By multiplying these two terms, It has become a simple indicator that can uniformly quantify all persistent temperature and humidity risks.
[0068] After obtaining the instantaneous physiological stress index, the total stress accumulation value is obtained by dynamically weighting and accumulating the instantaneous stress index. Specifically, a forgetting factor is set based on a two-hour stress half-life. The instantaneous physiological stress index at the target time is multiplied by the data acquisition interval of the sensor as the instantaneous stress assessment at the target time. For the first time, the instantaneous stress assessment at the first time is used as the total stress accumulation assessment at the first time. For other target times, the forgetting factor is used as the weight of the total stress accumulation assessment at the previous time, and the result of subtracting the forgetting factor from the constant 1 is used as the weight of the instantaneous stress assessment at the target time. A weighted sum of the total stress accumulation assessment at the previous time and the instantaneous stress assessment at the target time is then performed, and the resulting weighted sum is used as the cumulative stress assessment with forgetting effect. A stress sensitivity coefficient is set, and the cumulative stress assessment with forgetting effect is divided by the stress sensitivity coefficient as the total stress accumulation value.
[0069] In one implementation, assume the first The total cumulative stress value at each time point is The forgetting factor is The data acquisition interval of the sensor is The stress sensitivity coefficient is Then the first The expression for calculating the total cumulative stress value at each time point is:
[0070]
[0071] in, Indicates the first The total cumulative value of stress at each moment; Indicates the forgetting factor; Indicates the first The total cumulative stress value at each moment; Indicates the first Instantaneous physiological stress index at a given moment; Indicates the data acquisition interval of the sensor; This represents the stress sensitivity coefficient.
[0072] Finally, by performing a saturation mapping analysis on the total accumulated stress value, the persistent risk amplification factor is obtained. Specifically, a maximum additional amplification coefficient is set; the total accumulated stress value is mapped using the tanh function; the result of multiplying the maximum additional amplification coefficient with the corresponding mapping result and adding it to a constant 1 is used as the persistent risk amplification factor.
[0073] In one embodiment, it is assumed that the maximum additional amplification factor is Then the first The calculation expression of the persistence risk amplification factor at the i-th moment is:
[0074]
[0075] wherein, represents the persistence risk amplification factor at the i-th moment; represents the maximum additional amplification coefficient; represents the tanh hyperbolic tangent function; represents the total stress cumulative value at the i-th moment. It should be noted that the stress sensitivity coefficient represents the cumulative stress required to cause a typical saturated response. The value is set to match the early warning mechanism with the physiological tolerance limit of the flock. When calibrating its key thresholds, the system must take into account all major risk types comprehensively. In the present application, we follow the worst-case principle to calibrate , i.e. taking the risk type that is the most urgent and develops the fastest as the reference for setting, to ensure the highest safety redundancy and the fastest response capability of the system. In high-density confined farming environments, acute heat stress is generally considered a more urgent risk than cold stress that develops faster and leads to large-scale death, because once the ventilation system fails, internal temperature and harmful gases can accumulate rapidly in a short time. While cold stress is also dangerous, its process is relatively moderate, and animals have certain autonomous adjustment behaviors such as gathering and curling.
[0076] Therefore, in the present embodiment, the critical condition for calibrating is selected as a severe heat stress event. When the environment is at 35 degrees Celsius and the relative humidity is 85% for 4 hours, it is enough to cause irreversible physiological damage to the flock. This is used to calculate
[0077] .
[0078] First, the instantaneous stress index under this condition is calculated:
[0079]
[0080] Then, the cumulative stress value for 4 hours (for simplicity, the forgetting factor is not considered here) is calculated:
[0081]
[0082] The unit here is a dimensionless stress index·sampling point number, and for ease of understanding, its physical meaning is equivalent to 48 sampling points under the condition that the basic heat stress is 1. To verify the rationality of this threshold, its performance in a severe cold stress scenario is investigated. Assuming that the environment is 5 degrees Celsius and the relative humidity is 95%, the instantaneous stress index :
[0083]
[0084] reaching a critical threshold The time required is:
[0085] 20.6 sampling points, 20.6 sampling points x 5 minutes / sampling point ≈ 103 minutes ≈ 1.7 hours, which means that the system will trigger a significant risk amplification about 1.7 hours after the occurrence of a severe cold stress. This response time is timely and effective for preventing risks such as sheep hypothermia.
[0086] In summary, by setting the threshold for more urgent heat stress not only ensures a rapid response to the most deadly risk, but also verifies that the setting is also sensitive enough to the risk in the other direction, proving the rationality of the parameter setting.
[0087] In the calculation of the persistent risk amplification factor, the core is to map the cumulative stress value with the forgetting effect to the saturation response function, formula is the implementation of the exponential weighted moving average, which simulates the process of cumulative injury and self-repair of the body over time to obtain the total cumulative stress value at the current time. This cumulative value is divided by the stress sensitivity coefficient to obtain a standardized stress level, and finally this standardized stress level is input into the tanh function. Here, the tanh function mapping is selected because it is a classic mathematical model for describing various saturation phenomena in nature (such as dose-response relationship), which can well simulate the tolerance-stress-saturation response process of the organism to cumulative stress. When the cumulative stress is small, the persistent risk amplification factor is close to 1 and does not amplify. When the cumulative stress becomes very large because of continuous exposure to an unfavorable environment, the persistent risk amplification factor will significantly increase, and the magnitude and speed of the increase are jointly controlled by and eventually saturating to . Amplifying the small prediction error given by an original LSTM ensures that persistent risk events are accurately alarmed.
[0088] So far, the persistent risk amplification factor is obtained by modeling the environmental stress degree and cumulative impact.
[0089] Step S4, the initial error is corrected to obtain the final risk score by fusing the conventional operation false alarm suppression factor and the persistent risk amplification factor.
[0090] The purpose of this step is to calculate a final score that can reflect the real risk level of the current sheep house environment to the sheep herd. The initial error is corrected by fusing the conventional operation false alarm suppression factor and the persistent risk amplification factor to obtain the final risk score. Specifically, the conventional operation false alarm suppression factor and the persistent risk amplification factor at the target time are obtained; the calculation result of the multiplication of the conventional operation false alarm suppression factor at the target time and the persistent risk amplification factor at the target time is taken as the final risk optimization factor at the target time; and the calculation result of the multiplication of the final risk optimization factor at the target time and the initial prediction error at the target time is taken as the final risk score at the target time.
[0091] It should be noted that the initial prediction error is corrected using the conventional operation false alarm suppression factor to identify and suppress false abnormal signals caused by conventional operation; then the persistent risk amplification factor is used to perform risk gain on the corrected result to amplify and highlight the real physiological stress accumulated by the persistent adverse environmental state, thereby obtaining the final risk score.
[0092] At this point, the final risk score is obtained by fusing the conventional operation false alarm suppression factor and the persistent risk amplification factor to correct the initial error.
[0093] Step S5, obtaining an environmental abnormality evaluation by jointly evaluating the dynamic relative risk and the physiological stress risk.
[0094] This step is based on the result obtained in step S4, and adopts a dual-channel fusion evaluation strategy to finally determine and warn the environmental abnormality. This design aims to combine the advantages of relative dynamic evaluation and absolute physiological evaluation to comprehensively cover sudden abnormalities and persistent risks, thereby ensuring the reliability of the warning.
[0095] The determination logic of the method includes the following two parallel risk evaluation channels:
[0096] 1. Dynamic relative risk assessment channel: This channel aims to identify sudden or patterned abnormality relative to the recent normal state. First, a long time window for dynamic relative risk assessment is set, in the embodiment of the present application, the length of the long time window for dynamic relative risk assessment is set to 72 hours, and the routine operation false alarm factor screening threshold and the persistent risk amplification factor screening threshold, in the embodiment of the present application, the routine operation false alarm factor screening threshold is set to 0.99, and the persistent risk amplification factor screening threshold is set to 1.01, and the specific values can be adjusted according to the actual scene, and no requirement is made; for the final risk score of any target moment, if the routine operation false alarm suppression factor of the target moment is greater than the routine false alarm factor screening threshold and the persistent risk amplification factor of the target moment is less than the persistent risk amplification factor screening threshold, the final risk score of the target moment is added to the final risk baseline distribution set. The set is updated with time sliding, which dynamically reflects the normal risk fluctuation level under the current environmental background. For each newly calculated final risk score, the system compares it with the baseline distribution, calculates its percentile rank, and the value of the percentile rank quantifies the abnormality degree of the current risk relative to the recent normal.
[0097] 2. Absolute physiological risk assessment channel: This channel aims to identify the cumulative risk that poses an absolute threat to the physiological health of the flock due to the persistent deviation of the environment from the optimum interval. The total stress accumulation value calculated in step S3 is used as the risk measure of this channel. The total stress accumulation value directly quantifies the total physiological load borne by the flock in a period of time, which is directly related to the severity and duration of the environmental deviation from the optimum interval.
[0098] Fusion warning process: The evaluation results of the above two channels are fused, and when any of the following conditions is met, a warning event of the corresponding level is triggered:
[0099] Condition one (finding mutation or relative abnormality): The output of the dynamic relative risk assessment channel, that is, the percentile rank, exceeds the preset statistical quantile, when the percentile rank is greater than 99.0, a warning level warning is triggered; when the percentile rank is greater than 99.9, a danger level warning is triggered.
[0100] Condition two (finding persistent absolute risk): The output of the absolute physiological risk assessment channel, that is, the total stress accumulation value, reaches the critical proportion of the stress sensitivity coefficient. The stress sensitivity coefficient itself represents the critical cumulative damage amount that leads to significant physiological damage, so all warnings must occur before it reaches 100%. The warning logic is as follows:
[0101] When the total stress accumulation value first exceeds 30% of the stress sensitivity coefficient, a warning of the attention level is triggered, prompting the management personnel that the environment is deviating from the normal and needs to be paid attention to.
[0102] When the total stress accumulation value exceeds 60% of the stress sensitivity coefficient, a warning of the warning level is triggered, indicating that the cumulative damage has reached an unacceptable level, and intervention measures need to be taken.
[0103] When the total stress accumulation value exceeds 90% of the stress sensitivity coefficient, the highest level of warning of the danger level is triggered, indicating that the environment has approached a critical point of irreversible damage to the sheep flock, and immediate emergency treatment must be taken.
[0104] It should be noted that the triggered warning event transmits the warning information to the breeding management personnel through user interface display, sending text messages, and driving sound and light alarms. Through this dual-channel fusion determination mechanism, the present application realizes comprehensive risk coverage. The dynamic relative risk assessment channel can sensitively find various abnormal events that do not conform to the recent pattern; the physiological risk assessment channel constitutes a safety bottom line, ensuring that even in the case of a very slow and continuous deterioration of the environment, leading to no significant relative risk, once the cumulative physiological stress reaches a dangerous absolute level, the system can still accurately trigger the warning, which fundamentally solves the missing report defect of the single determination mechanism.
[0105] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for analyzing environmental anomalies based on sheep farming environment monitoring data, characterized in that, The method includes the following steps: Step S1: Obtain the initial prediction error of the sheepfold environment using a long short-term memory prediction model; Step S2: Obtain the false alarm suppression factor for routine operations by analyzing the characteristics of relative humidity changes; Step S3: Obtain the persistence risk amplification factor by modeling the degree of environmental stress and cumulative impact; Step S4: Correct the initial error by integrating the routine operation false alarm suppression factor and the persistent risk amplification factor to obtain the final risk score; Step S5: Obtain an assessment of environmental anomalies by jointly evaluating dynamic relative risk and physiological stress risk; The method of obtaining a false alarm suppression factor for routine operations by analyzing the characteristics of relative humidity changes includes: acquiring time-series data of relative humidity in sheep pens; for the relative humidity data of sheep pens at a target time, subtracting it from the relative humidity data of sheep pens at the previous time as the first sheep pens humidity change assessment; taking the larger value between the first sheep pens humidity change assessment and the constant 0 as the second sheep pens humidity change assessment; setting a short-time window, and for the relative humidity data of sheep pens at the target time, obtaining the standard deviation of the first-order difference sequence of the relative humidity time-series data of sheep pens within the short-time window; dividing the second sheep pens humidity change assessment by the... The standard deviation of the first-order difference sequence of relative humidity time series data in sheep pens is used as the third sheep pens humidity change assessment. The negative of the third sheep pens humidity change assessment is mapped using a power function with the natural constant as the base. The result of subtracting the corresponding mapping result from the constant 1 is used as the first routine operation false alarm assessment. A signal sharpening index is set, and the signal sharpening index is used as the index term. The first routine operation false alarm assessment is used as the base, and the result of the corresponding index calculation is used as the second routine operation false alarm assessment. The result of subtracting the second routine operation false alarm assessment from the constant 1 is used as the routine operation false alarm suppression factor. The method of obtaining a persistent risk amplification factor by modeling the degree of environmental stress and its cumulative impact includes: obtaining an instantaneous physiological stress index by performing nonlinear quantification on the current temperature and humidity deviation; obtaining a total stress cumulative value by performing dynamic weighted cumulative processing on the instantaneous stress index; and obtaining a persistent risk amplification factor by performing saturation mapping analysis on the total stress cumulative value. The step of obtaining a persistent risk amplification factor by performing saturated mapping analysis on the total accumulated stress value includes: setting a maximum additional amplification coefficient; mapping the total accumulated stress value through a tanh function; and using the result of multiplying the maximum additional amplification coefficient by the corresponding mapping result and adding it to a constant 1 as the persistent risk amplification factor. The method of obtaining an environmental anomaly assessment by jointly evaluating dynamic relative risk and physiological stress risk includes: setting a long-term window for dynamic relative risk assessment, a screening threshold for routine operation false alarm factors, and a screening threshold for persistent risk amplification factors; for any target time, if the routine operation false alarm suppression factor at that target time is greater than the routine false alarm factor screening threshold and the persistent risk amplification factor at that target time is less than the persistent risk amplification factor screening threshold, then the final risk score at that target time is added to the final risk baseline distribution set; by comparing the real-time final risk score with the final risk baseline distribution set, the percentile rank of the real-time final risk score in the final risk baseline distribution set is obtained, and this percentile rank is used as the first real-time risk assessment; for any target time, the cumulative stress assessment with a forgetting effect is calculated, and the proportion of the cumulative stress assessment exceeding the stress sensitivity coefficient is calculated, and this proportion is used as the first persistent risk assessment; and the environmental anomaly assessment is obtained by performing parallel risk judgment through the first real-time risk assessment and the first persistent risk assessment.
2. The method for environmental anomaly analysis based on sheep farming environment monitoring data according to claim 1, characterized in that, The initial prediction error obtained by the long short-term memory prediction model for the sheepfold environment includes: IoT sensors and a local server were deployed in the sheepfold, and the data acquisition frequency of the sensors was set. Multi-dimensional environmental monitoring time series data were collected through multiple IoT sensors in the sheepfold. The collected data included temperature time series data and relative humidity time series data. By pre-training a long short-term memory prediction model using environmental monitoring data under historical normal conditions of sheep sheds, a long short-term memory prediction model for predicting environmental parameters of sheep sheds can be obtained. The temperature time series data and relative humidity time series data are predicted using a long short-term memory prediction model, and the initial prediction error of the sheepfold environment is obtained by comparing actual monitoring data with the predicted data.
3. The method for environmental anomaly analysis based on sheep farming environment monitoring data according to claim 1, characterized in that, The instantaneous physiological stress index is obtained by performing nonlinear quantization on the current temperature and humidity deviation, including: Define the critical humidity for high humidity, saturation humidity, and the influence coefficient of humidity on physiological stress; define the suitable temperature range and physiological tolerance temperature range for sheep growth; for any target time, take the larger value between the calculation result of subtracting the critical humidity for high humidity from the relative humidity data of the sheepfold at the target time and the constant 0 as the first humidity difference; take the calculation result of subtracting the critical humidity for high humidity from the saturation humidity as the denominator, take the first humidity difference as the numerator, multiply the resulting fraction by the influence coefficient of humidity on physiological stress and add it to the constant 1 as the amplification factor of high humidity under temperature stress; The result of subtracting the sheepfold temperature data at the target time from the suitable temperature for sheep growth, divided by the square of the calculated result of the physiological tolerance temperature range for sheep growth, is used as a bidirectional symmetric and nonlinear assessment of temperature deviation; the result of multiplying the bidirectional symmetric and nonlinear assessment of temperature deviation by the amplification factor of high humidity under temperature stress is used as the instantaneous physiological stress index.
4. The method for environmental anomaly analysis based on sheep farming environment monitoring data according to claim 1, characterized in that, The process of obtaining the total accumulated stress value by dynamically weighting and accumulating the instantaneous stress index includes: A forgetting factor is set based on a two-hour stress half-life; the instantaneous physiological stress index at the target time is multiplied by the data acquisition interval of the sensor as the instantaneous stress assessment at the target time; for the first time, the instantaneous stress assessment at the first time is used as the total stress cumulative assessment at the first time; for other target times, the forgetting factor is used as the weight of the total stress cumulative assessment at the previous time, and the result of subtracting the forgetting factor from the constant 1 is used as the weight of the instantaneous stress assessment at the target time. A weighted sum is then performed on the total stress cumulative assessment at the previous time and the instantaneous stress assessment at the target time, and the corresponding weighted sum is used as the cumulative stress assessment with forgetting effect; a stress sensitivity coefficient is set, and the result of dividing the cumulative stress assessment with forgetting effect by the stress sensitivity coefficient is used as the total stress cumulative value.
5. The method for environmental anomaly analysis based on sheep farming environment monitoring data according to claim 1, characterized in that, The process of correcting the initial error by fusing a routine operational false alarm suppression factor and a persistent risk amplification factor to obtain the final risk score includes: Obtain the routine operation false alarm suppression factor and the persistent risk amplification factor at the target time; multiply the routine operation false alarm suppression factor and the persistent risk amplification factor at the target time as the final risk optimization factor at the target time; multiply the final risk optimization factor at the target time by the initial prediction error at the target time as the final risk score at the target time.
6. The method for environmental anomaly analysis based on sheep farming environment monitoring data according to claim 1, characterized in that, The step of performing parallel risk assessment through a first real-time risk assessment and a first continuous risk assessment to obtain an environmental anomaly assessment specifically includes: Set a first real-time risk alarm threshold and a second real-time risk alarm threshold; if the first real-time risk assessment is greater than or equal to the first real-time risk alarm threshold and less than the second real-time risk alarm threshold, a warning level alert is triggered; if the first real-time risk assessment is greater than or equal to the second real-time risk alarm threshold, a danger level alert is triggered. Set a first continuous risk alarm ratio, a second continuous risk alarm ratio, and a third continuous risk alarm ratio; if the first continuous risk assessment exceeds the first continuous risk alarm ratio for the first time, a warning level alert is triggered; if the first continuous risk assessment exceeds the second continuous risk alarm ratio, a warning level alert is triggered; if the first continuous risk assessment exceeds the third continuous risk alarm ratio, a danger level alert is triggered.
Citation Information
Patent Citations
Sheep house environment monitoring system and method based on big data
CN116256020A
Information monitoring method and system for cattle and sheep breeding environment
CN119863331A