Livestock and poultry epidemic prevention method and system based on multi-source environment perception and air filter linkage

CN122619409APending Publication Date: 2026-08-21WENS FOODSTUFF GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611104767.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

然而,围绕空气过滤设备构建疫病防御体系的相关技术仍存在显著不足

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122619409A_ABST
    Figure CN122619409A_ABST
Patent Text Reader

Abstract

The application discloses a livestock and poultry epidemic disease defense method and system based on multi-source environment perception and air filter linkage, comprising: acquiring risk factors collected by a target farm in history and air-borne epidemic disease events occurred in the target farm in history, screening core risk factors based on the relationship between the two, and constructing a three-dimensional risk factor graph in combination with typical scene division; adopting a scene perception encoder with an attention mechanism to construct positive and negative sample training epidemic disease risk prediction models with the incidence day as an anchor point; deploying the models on air filter equipment edge nodes, collecting real-time values of each core risk factor of the target farm, identifying the current scene and determining the risk; performing situation self-checking and filter core efficiency deduction through the linkage of an air filter digital twin model, and predicting the defense capability; executing a differentiated defense strategy based on the prediction result, using a reward function integrating a risk reduction range, environmental stability and energy consumption cost to optimize defense parameters online, and realizing accurate and efficient active epidemic disease prevention and control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of livestock and poultry disease prevention and control technology, and in particular to a livestock and poultry disease prevention method and system based on multi-source environmental perception and air filtration linkage. Background Technology

[0002] With the continuous increase in the density of large-scale livestock and poultry farming, airborne diseases have become a core factor threatening the biosecurity of farms. Major diseases such as porcine reproductive and respiratory syndrome (PRRS) and African swine fever can spread over long distances via aerosols, making air filtration systems a standard feature of large-scale farms. However, there are still significant shortcomings in the technologies related to building disease defense systems around air filtration equipment.

[0003] At the environmental perception level, existing solutions are mostly limited to collecting indoor temperature, humidity, and harmful gas concentrations, failing to incorporate the operational parameters of air filtration equipment as dynamic risk factors into the analysis. They also lack a systematic integration of geographical and meteorological factors such as the distribution of surrounding farms and real-time wind direction and speed. This results in a single dimension of risk perception and a lack of sensitive, forward-looking identification of pathogen threats transmitted via airflow. At the risk modeling level, conventional prediction models typically use data from a fixed period before the onset of disease as positive samples and data from any period without disease outbreaks as negative samples when constructing training samples. This ignores the transitional state during the incubation period when environmental data shows abnormalities but has not yet manifested clinical symptoms. Such labeling noise severely weakens the model's accuracy and specificity in identifying early risks. At the response and coordination level, existing solutions generally operate risk warnings and equipment control separately. After a warning is issued, manual experience is still relied upon to determine whether filter replacement or disinfection should be initiated. This results in long response delays and poor decision-making consistency, making it difficult to effectively cut off the transmission chain during the golden window period of pathogen invasion. Therefore, there is an urgent need for a closed-loop method that can systematically integrate multi-source external environmental perception data, incorporate the status of air filter equipment as a dynamic risk factor into the prediction system, and automatically drive air filter self-inspection and differentiated linkage defense through risk perception results. Summary of the Invention

[0004] This invention overcomes the shortcomings of the prior art and provides a method and system for the prevention of livestock and poultry diseases based on multi-source environmental perception and air filter linkage. Its important purpose is to improve the advance warning and accuracy of disease risk warning and enhance the response speed and closed-loop prevention and control efficiency of air filter linkage.

[0005] To achieve the above objectives, the first aspect of this invention provides a method for preventing livestock and poultry diseases based on multi-source environmental sensing and air filtration linkage, comprising: The risk factors and airborne disease events that occurred in the target farm in the past were obtained. Based on the relationship between the two, core risk factors were screened out, and scenario-specific analysis was carried out on each core risk factor in several scenarios to construct a three-dimensional risk factor map. Positive and negative samples are constructed based on the three-dimensional risk factor map to train the disease risk prediction model. The positive samples are used to characterize the data patterns of each core risk factor before a confirmed airborne disease event, and the negative samples are used to characterize the data patterns of each core risk factor during a continuous and stable period without airborne disease events. The trained disease risk prediction model is deployed to the edge node associated with the air filter equipment. Based on the edge node, the real-time values ​​of each core risk factor of the target farm are collected and input into the disease risk prediction model to determine the real-time disease risk and generate real-time disease risk perception information. When the real-time disease risk perception information indicates that disease prevention is required, the air filter status self-check is performed through the air filter digital twin model to generate a diagnostic conclusion code for the air filter equipment and determine whether maintenance is required. If maintenance is not required, the filter efficiency attenuation prediction curve is calculated by combining future weather forecasts and compared with the current disease prevention requirements to predict the disease prevention capability. Based on the diagnostic conclusion code and the disease prevention capability prediction result, a corresponding defense strategy is determined, and the air filter device is controlled to execute the defense strategy.

[0006] In this scheme, the disease risk prediction model consists of a scene-aware encoder based on a multi-head self-attention mechanism and a LightGBM classifier connected in series. The encoder dynamically and interactively weights the input risk factor features, and the classifier performs a nonlinear mapping on the weighted representation and outputs the probability of disease occurrence. The disease risk prediction model is trained in the following way: When the preset model training conditions are met, a positive sample set and a negative sample set are constructed based on the three-dimensional risk factor map. The number of samples in the positive sample set and the negative sample set are counted. The ratio of the number of positive samples to the number of negative samples is calculated as the initial imbalance. The preset model training conditions include the first training of the disease risk prediction model or the existence of an update in the erroneous positive sample set. If the initial imbalance is lower than a preset threshold ratio, it is determined that positive samples are scarce. Data augmentation is performed on the positive sample set to obtain virtual positive samples with similar data characteristics to the positive samples in the positive sample set. The preset threshold ratio is positively correlated with the false detection rate of the disease risk prediction model for airborne disease events. Check the first sample feature distance between the virtual positive sample and all erroneous positive samples in the erroneous positive sample set, and the second sample feature distance between the virtual positive sample and all negative samples in the negative sample set; wherein, the feature distance between any two samples is calculated by the distance between the two samples in each core risk factor dimension; If the feature distance of any first sample is lower than a preset first distance threshold, the virtual positive sample is discarded; if the feature distance of all first samples is not lower than the preset first distance threshold, the virtual positive sample is added to the positive sample set. If the second sample feature distance between the virtual positive sample and any negative sample is lower than a second preset distance threshold, the corresponding negative sample is deleted from the negative sample set. If the initial imbalance is not lower than the preset threshold ratio, the disease risk prediction model is trained based on the positive sample set and the negative sample set. After training is completed, all virtual positive samples in the positive sample set are deleted.

[0007] In this scheme, the loss function corresponding to the disease risk prediction model is: , in, For the joint loss function, To compare the loss weighting coefficients, Let cross-entropy be the loss function. To compare loss functions; The cross-entropy loss function The specific expression is: , in, For the first The label for each sample is 1 for positive samples and 0 for negative samples; The risk probability value output by the disease risk prediction model; Inversely correlated with the preset threshold ratio; The total number of samples in a single batch. Proportional to the false negative rate of the disease risk prediction model for airborne disease events; The contrast loss function The specific expression is: , In the formula: This represents the total number of samples in a single batch. The first in the batch The index of each sample is traversed from 1 to... ; No. The true label of each sample is 1 for positive samples and 0 for negative samples; For the first The Euclidean distance between the center vectors of each sample and the positive samples in the same batch; These are the preset distance boundary hyperparameters.

[0008] In this scheme, the core risk factors are screened out, and scenario-specific analysis is performed on each core risk factor under several scenarios to construct a three-dimensional risk factor map, specifically including: Obtain historical risk factors and airborne disease events from the target farm, and align them by timestamps to generate a time-series dataset. For every two candidate risk factors in the time series dataset, the transfer entropy is calculated. The statistical significance of the transfer entropy is judged by the permutation test. Significant conditional transitivity is retained as directed edges. An environment-disease directed acyclic graph is constructed. The causal effect of each candidate risk factor on the disease event node is calculated. Candidate risk factors that exceed the preset threshold are marked as core risk factors. Based on the historical data of risk factors collected from the target farm, an observation sequence is generated at each historical time point using environmental variable values. A hidden Markov algorithm is used for scene segmentation, dividing each time point into several typical environmental scenes and generating several typical environmental scene labels with timestamps. The typical environmental scenario labels obtained from the segmentation are pasted back to the historical time interval. Under each scenario type, the conditional mutual information value between each core risk factor and the epidemic event is calculated. The conditional mutual information value is used as the specific weight of the corresponding core risk factor under the corresponding scenario. The names and specific parameters of each core risk factor, the causal effect calculated in the global directed acyclic graph, and the conditional mutual information weights calculated in each typical scenario are summarized to form a three-dimensional risk factor map that includes the factor identity dimension, the global effect strength dimension, and the scenario-based response weight dimension.

[0009] In this solution, the real-time data of each core risk factor of the target farm collected from the edge nodes is input into the disease risk prediction model to determine the real-time disease risk and generate real-time disease risk perception information. Specifically, this includes: The trained disease risk prediction model is serialized and stored in the non-volatile storage unit of the air filter equipment associated edge node. At the same time, the hidden Markov scene model used for scene recognition is also stored in the non-volatile storage unit to achieve local inference. By collecting real-time values ​​of each core risk factor of the target farm at fixed intervals through the deployed edge nodes, a multi-source real-time data frame sequence is generated and used as observation input to identify the current scene identifier. The core risk factor list and specific weights of the current scene are extracted from the three-dimensional risk factor map. According to the core risk factor list, the instantaneous values ​​of the core risk factors are extracted from the multi-source real-time data frame sequence, and the mean, slope of change and cumulative duration of exceeding the warning threshold of each core risk factor in the past preset window are read. These values ​​are then concatenated with the specific weights and the current scene identifier to form the real-time core risk factor feature vector. The real-time core risk factor feature vector is input into the disease risk prediction model. The interaction weights between the features of each factor are calculated in parallel through a multi-head self-attention layer. After weighted fusion, the real-time weighted risk representation vector is output and fed into the LightGBM classifier to accumulate the leaf node scores along the decision tree route. The real-time risk probability value is obtained through mapping. The variance of multiple output probability values ​​is used as a measure of cognitive uncertainty. Real-time risk probability values, cognitive uncertainty measures, current scene identifiers, and uncertainty levels are encapsulated to generate real-time disease risk perception information.

[0010] In this solution, the process of generating a diagnostic conclusion code for the air filter equipment through a digital twin model of the air filter and determining whether maintenance is required is described. If maintenance is not required, the filter efficiency attenuation prediction curve is derived by combining future weather forecasts, and the disease prevention capability is predicted by comparing it with current disease prevention needs. Specifically, this includes: A digital twin model of an air filter device is constructed. The digital twin model includes a porous media resistance sub-model describing the change of filter material porosity with the total amount of retained particles, a Darcy flow sub-model describing the relationship between airflow pressure drop and flow velocity, and a fractal growth sub-model describing the growth of dust cake layer on the filter element surface. When real-time disease risk perception information triggers the linkage defense warning, the current readings of the differential pressure sensor of the primary filter section, the filtration wind speed sensor, the temperature and humidity of the air filter inlet, and the particulate matter concentration sensor readings of the air filter inlet are input into the digital twin model for parallel simulation, and the theoretical differential pressure value, theoretical filtration wind speed value, and theoretical filtration efficiency value of each filter section under the same working conditions are output. The residuals are calculated item by item between the theoretical values ​​and the actual physical parameters. The pressure difference residual is the absolute value of the difference between the theoretical pressure difference and the actual pressure difference, the filtration velocity residual is the absolute value of the difference between the theoretical filtration velocity and the actual filtration velocity, and the filtration efficiency residual is the absolute value of the difference between the actual filtration efficiency estimated based on the pressure difference and the operating time and the theoretical filtration efficiency. When the differential pressure residual exceeds the first threshold and the actual differential pressure is higher than the theoretical differential pressure, it is diagnosed as abnormal blockage or moisture-induced caking of the filter element. When the filtration velocity residual exceeds the second threshold but the differential pressure residual is normal, it is diagnosed as leakage in the air duct or a decrease in fan efficiency. When the filtration efficiency residual exceeds the third threshold and the actual efficiency is lower than the theoretical efficiency, it is diagnosed as filter material damage or frame seal failure, and a diagnostic conclusion code is generated. The weather forecast data for the location of the breeding farm for a preset period of time is obtained through an external meteorological forecast service interface. The weather forecast data is used as an external boundary condition to input into the digital twin model. The distribution of particulate matter deposition inside the filter element at the current moment is used as the initial state for iterative deduction to generate a prediction curve of the filter element filtration efficiency decay over a preset period of time in the future. The system reads the current risk probability value from the real-time disease risk perception information that triggers the linkage defense warning, determines the minimum filtration efficiency threshold required to block airborne diseases under the current risk level based on the pre-calibrated risk level and filtration efficiency mapping table, compares it hourly with the attenuation prediction curve, and outputs the defense capability prediction result containing the diagnostic conclusion code.

[0011] This solution also includes real-time feedback optimization of the sample set based on real-time disease risk perception information, specifically including: If the real-time disease risk perception information indicates that disease prevention is needed and an airborne disease event is observed to occur within a preset time period in the future, a real-time positive sample is generated and added to the positive sample set based on the collected external environmental data of the farm and the air filter intake side operating parameters in the current scenario. If the real-time disease risk perception information indicates that disease prevention is needed and no airborne disease event is observed within a preset time period, then erroneous positive samples are generated and an erroneous positive sample set is established based on the collected external environmental data of the farm and the air filter intake side operating parameters in the current scenario. If the real-time disease risk perception information indicates that no disease prevention is needed and no airborne disease event is observed within a preset time period, a real-time negative sample is generated and added to the negative sample set based on the collected external environmental data of the farm and the air filter inlet side operating parameters in the current scenario. If the real-time disease risk perception information indicates that no disease prevention is needed and an airborne disease event is observed to occur within a preset time period in the future, a real-time positive sample is generated and added to the positive sample set based on the collected external environmental data of the farm and the operating parameters of the air filter intake side in the current scenario. At the same time, negative samples in the negative sample set whose feature distance from the real-time positive samples is lower than a preset third distance threshold are deleted, wherein the third distance threshold is greater than the second distance threshold.

[0012] In this solution, the step of determining the corresponding defense strategy based on the diagnostic conclusion code and the disease prevention capability prediction result, and selecting the optimal action parameters to execute the linkage defense strategy on the air filter equipment, specifically includes: Obtain the prediction results of disease prevention capabilities, read the prevention capability status category, diagnostic conclusion code and filter efficiency attenuation prediction curve of the disease prevention capability prediction results, and map the disease prevention capability prediction results into a list of differentiated linkage defense strategies to be executed; When the prediction result is that the defense capability is sufficient and the status is normal, a defense strategy list is generated, which includes the internal circulation boost mode, the default fan speed and the basic disinfection duration; when the prediction result is that maintenance and adjustment are required in advance, fan frequency compensation and maintenance operation items are added. When the prediction result is that the filter needs to be replaced immediately, the ventilation mode is limited to the minimum fresh air volume internal circulation, an emergency replacement work order is generated and pushed to the maintenance team, and the disinfection time is adjusted to the maximum preset value. After the replacement is completed and the defense capability is re-evaluated and confirmed by the digital twin model, the standard defense mode is switched back. The state space is established based on the current risk probability value, defense capability status category, deviation of indoor temperature and environmental stability, and wind speed and direction forecast values ​​for the future preset period. The continuous action space is established based on the fan speed adjustment increment, disinfection duration adjustment increment, and internal circulation valve opening adjustment increment. A deep Q-network architecture is used to construct a reinforcement learning agent and set a reward function. Each time the coordinated defense is triggered, the current state vector is input into the online policy network of the deep Q network to obtain the action value estimate of each discretized action combination. The action combination with the highest action value is selected as the optimal defense action parameter through a greedy policy, written into the defense policy list and sent to the corresponding execution mechanism. After the defense action is completed, the disease risk prediction model is called again to calculate the risk probability value after the defense, the actual fan power consumption and disinfection agent usage are recorded, the actual reward value is calculated, and the current state, executed action, actual reward and new state after the defense are encapsulated as experience tuples and stored in the experience replay pool of a fixed-length circular queue structure. When the number of experience tuples in the experience replay pool reaches the preset batch size, random sampling is performed. The mean square error between the temporal difference target value and the action value estimate of each experience in the sample is calculated. The weights of the online policy network are updated by backpropagation. The weights of the online policy network are synchronized to the target policy network every fixed update period to achieve incremental policy iteration.

[0013] A second aspect of the present invention provides a livestock and poultry disease prevention system based on multi-source environmental perception and air filter linkage. The system includes: a memory, a processor, and a communication interface. The memory contains a livestock and poultry disease prevention method program based on multi-source environmental perception and air filter linkage. When the processor executes the livestock and poultry disease prevention method program based on multi-source environmental perception and air filter linkage, it implements the livestock and poultry disease prevention method steps as described in any of the above claims.

[0014] A third aspect of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a program for a livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage, wherein when the program for a livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage is executed by a processor, it implements the steps of the livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage as described in any of the preceding claims. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments or examples of the present invention, the drawings used in the embodiments or examples will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained according to these drawings without creative effort.

[0016] Figure 1 A flowchart of a livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage is provided as an embodiment of the present invention; Figure 2 A flowchart of a differential air filter linkage control parameter optimization driven by defense capability prediction is provided in one embodiment of the present invention; Figure 3 A block diagram of a livestock and poultry disease prevention system based on multi-source environmental perception and air filter linkage is provided in an embodiment of the present invention; The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0017] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0018] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0019] Figure 1 A flowchart of a livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage is provided as an embodiment of the present invention; like Figure 1 As shown, this invention provides a flowchart of a livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage, including: S102, obtain the risk factors collected in the target farm in history and the airborne disease events that occurred in the target farm in history, screen out the core risk factors based on the relationship between the two, and conduct scenario-specific analysis of each core risk factor in several scenarios to construct a three-dimensional risk factor map; S104. Based on the three-dimensional risk factor map, construct positive and negative samples to train the disease risk prediction model. The positive samples are used to characterize the data patterns of each core risk factor before a confirmed airborne disease event, and the negative samples are used to characterize the data patterns of each core risk factor during a continuous and stable period without airborne disease events. S106, The trained disease risk prediction model is deployed to the edge node associated with the air filter equipment. Based on the edge node, the real-time values ​​of each core risk factor of the target farm are collected in real time and input into the disease risk prediction model to determine the real-time disease risk and generate real-time disease risk perception information. S108, when the real-time disease risk perception information indicates that disease prevention is required, the air filter status self-check is performed through the air filter digital twin model to generate the air filter equipment diagnostic conclusion code and determine whether maintenance is required. If maintenance is not required, the filter efficiency attenuation prediction curve is calculated by combining future weather forecasts and compared with the current disease prevention requirements to predict the disease prevention capability. S110, based on the diagnostic conclusion code and the disease prevention capability prediction result, determine the corresponding defense strategy, and control the air filter device to execute the defense strategy.

[0020] Furthermore, in a preferred embodiment of the present invention, the process of screening to obtain core risk factors and performing scenario-specific analysis on each core risk factor under several scenarios to construct a three-dimensional risk factor map specifically includes: Obtain historical risk factors and airborne disease events from the target farm, and align them by timestamps to generate a time-series dataset. For every two candidate risk factors in the time series dataset, the transfer entropy is calculated. The statistical significance of the transfer entropy is judged by the permutation test. Significant conditional transitivity is retained as directed edges. An environment-disease directed acyclic graph is constructed. The causal effect of each candidate risk factor on the disease event node is calculated. Candidate risk factors that exceed the preset threshold are marked as core risk factors. Based on the historical data of risk factors collected from the target farm, an observation sequence is generated at each historical time point using environmental variable values. A hidden Markov algorithm is used for scene segmentation, dividing each time point into several typical environmental scenes and generating several typical environmental scene labels with timestamps. The typical environmental scenario labels obtained from the segmentation are pasted back to the historical time interval. Under each scenario type, the conditional mutual information value between each core risk factor and the epidemic event is calculated. The conditional mutual information value is used as the specific weight of the corresponding core risk factor under the corresponding scenario. The names and specific parameters of each core risk factor, the causal effect calculated in the global directed acyclic graph, and the conditional mutual information weights calculated in each typical scenario are summarized to form a three-dimensional risk factor map that includes the factor identity dimension, the global effect strength dimension, and the scenario-based response weight dimension.

[0021] Specifically, the risk factors and disease event records historically collected from the target farm are first integrated into a unified time-series dataset by aligning and integrating them with timestamps. These risk factors include outdoor temperature and humidity, wind speed and direction, rainfall, particulate matter concentration at the air filter inlet, pressure difference at the primary filter inlet, and upwind risk exposure index. The purpose of constructing the environment-disease directed acyclic graph (DAG) is to screen out core risk factors with a real driving effect on disease occurrence from numerous candidate risk factors, rather than simply statistically correlated co-variables. Furthermore, the transfer entropy is calculated for every two candidate risk factors. Transfer entropy measures the contribution of a variable's past state to reducing the uncertainty of another variable's current state. Compared to linear correlation coefficients, it captures non-linear directional information transmission better. The statistical significance of the transfer entropy is determined through permutation tests, and only significant conditional transmission relationships are retained as directed edges. This allows the construction of the environment-disease DAG, avoiding the misjudgment of statistically accidental covariance as causal relationships. Next, intervention operations are performed on each variable node in the graph, and the expected change in the probability of the disease event after cutting off the influence of its parent node is calculated as the causal effect size. Variables with causal effect sizes exceeding a preset threshold are marked as core risk factors. This step removes confounding bias at the mechanism level and ensures that the selected factors have an independent driving effect on the disease.

[0022] Considering that seasonal and diurnal variations in the aquaculture environment can cause the risk-driving intensity of the same factor to drift, this invention employs a Hidden Markov Model (HMM) for unsupervised scene segmentation of environmental time series. The state transition probability matrix and observation probability distribution parameters are estimated iteratively using the Baum-Welch algorithm, and then the hidden state sequence at each time point is decoded using the Viterbi algorithm. This automatically segments typical environmental scenarios such as high temperature and humidity, low temperature and dryness, and sudden temperature changes, avoiding the subjectivity of manual segmentation. After attaching scene labels, the conditional mutual information value between the core risk factor and the disease event is calculated for each scenario. Conditional mutual information measures the additional information increment of a factor for disease prediction after a given scenario, and is used as the specific weight for that scenario. Finally, the name identifier of each core risk factor, the global causal effect size, and the conditional mutual information weights for each scenario are summarized into a three-dimensional risk factor map. This map endows risk factors with environmental context awareness, allowing the same factor to have differentiated response weights in different scenarios, providing refined and adaptive prior guidance for subsequent prediction models.

[0023] Furthermore, in a preferred embodiment of the present invention, the disease risk prediction model is composed of a scene-aware encoder based on a multi-head self-attention mechanism and a LightGBM classifier connected in series. The encoder dynamically and interactively weights the input risk factor features, and the classifier performs a nonlinear mapping on the weighted representation and outputs the probability of disease occurrence. The disease risk prediction model is trained in the following manner: When the preset model training conditions are met, a positive sample set and a negative sample set are constructed based on the three-dimensional risk factor map. The number of samples in the positive sample set and the negative sample set are counted. The ratio of the number of positive samples to the number of negative samples is calculated as the initial imbalance. The preset model training conditions include the first training of the disease risk prediction model or the existence of an update in the erroneous positive sample set. If the initial imbalance is lower than a preset threshold ratio, it is determined that positive samples are scarce. Data augmentation is performed on the positive sample set to obtain virtual positive samples with similar data characteristics to the positive samples in the positive sample set. The preset threshold ratio is positively correlated with the false detection rate of the disease risk prediction model for airborne disease events. Check the first sample feature distance between the virtual positive sample and all erroneous positive samples in the erroneous positive sample set, and the second sample feature distance between the virtual positive sample and all negative samples in the negative sample set; wherein, the feature distance between any two samples is calculated by the distance between the two samples in each core risk factor dimension; If the feature distance of any first sample is lower than a preset first distance threshold, the virtual positive sample is discarded; if the feature distance of all first samples is not lower than the preset first distance threshold, the virtual positive sample is added to the positive sample set. If the second sample feature distance between the virtual positive sample and any negative sample is lower than a second preset distance threshold, the corresponding negative sample is deleted from the negative sample set. If the initial imbalance is not lower than the preset threshold ratio, the disease risk prediction model is trained based on the positive sample set and the negative sample set. After training is completed, all virtual positive samples in the positive sample set are deleted.

[0024] It should be noted that the first distance threshold is used to prevent the generated virtual positive samples from being too similar to historical false positive samples, thus avoiding the model repeatedly learning incorrect patterns. The second distance threshold is used to clean up "blurred" samples from the negative sample set that have similar features to positive samples. The third distance threshold is used for online, more stringent negative sample cleaning, and its value is greater than the second threshold. Its purpose is to clean up negative samples that may cause model confusion within a wider range based on new real positive samples.

[0025] It should be noted that the preset threshold ratio is positively correlated with the false detection rate of the disease risk prediction model for airborne disease events, and is at least the lower limit and at most the upper limit of the preset threshold ratio. The initial value of the preset threshold ratio during the first training of the disease risk prediction model is the upper limit of the preset threshold ratio. During the first training, the preset ratio is set to 50%, and subsequent training will vary based on the model's false detection rate, with a maximum of 50% and a minimum of 10%.

[0026] The reason for setting a dynamic threshold that adjusts for the false positive rate is that as the set of false positive samples accumulates, the model's false positive rate gradually decreases. If the same preset ratio is maintained to keep the number of positive samples high, it means there are still many fictitious positive samples, which is the cause of the high false positive rate. Therefore, to adapt to different stages of model training (initially requiring a high proportion of positive samples to maintain a low false negative rate, and then considering reducing the false positive rate once the false negative rate stabilizes), a dynamic preset threshold is set to control the proportion of positive samples. Without this threshold, although the model's false positive rate can still decrease as the set of false positive samples accumulates, this process is very slow, involves a large amount of unnecessary loss, and can lead to overfitting (because the proportion of positive samples remains unchanged, resulting in a large number of positive samples with duplicate features), ultimately leading to an increase in the false negative rate.

[0027] The specific working principle is as follows: By using virtual positive samples, deleting some negative samples, and controlling the proportion of positive samples with a preset threshold, a low false negative rate is initially ensured. However, a problem arises: a large number of virtual positive samples can significantly increase the model's false positive rate. Therefore, by continuously maintaining a set of erroneous positive samples, the model continuously explores and collects erroneous positive sample space, thereby gradually reducing the negative contribution of virtual positive samples to the false positive rate. To further reduce the suppressive effect of virtual positive samples on reducing the false positive rate, once the false negative rate stabilizes and the positive sample set has accumulated enough real negative samples, the preset threshold proportion is dynamically set... It is positively correlated with the false positive rate, thus further controlling the negative effects of virtual positive samples under the general trend of decreasing false positive rate. It avoids the model from getting trapped in the negative effect of model overfitting caused by the dense distribution of positive samples in the feature space, which ultimately leads to an increase in the model's false negative rate. It can dynamically adapt to different stages of model training and achieve the effect of maximizing the efficiency of reducing false positive rate while ensuring a low false negative rate. It adapts to the "better to be wrong than wrong" industry attribute of pig breeding scenario. A risk model was specially designed, and adaptive improvements were made to sample operation and training function to serve the expected attribute of "better to be wrong than wrong".

[0028] It should be noted that the loss function corresponding to the disease risk prediction model is: , in, For the joint loss function, To compare the loss weighting coefficients, Let cross-entropy be the loss function. To compare loss functions; The cross-entropy loss function The specific expression is: , in, For the first The label for each sample is 1 for positive samples and 0 for negative samples; The risk probability value output by the disease risk prediction model; Inversely correlated with the preset threshold ratio; The total number of samples in a single batch. Proportional to the false negative rate of the disease risk prediction model for airborne disease events; The contrast loss function The specific expression is: , In the formula: This represents the total number of samples in a single batch. The first in the batch The index of each sample is traversed from 1 to... ; No. The true label of each sample is 1 for positive samples and 0 for negative samples; For the first The Euclidean distance between the center vectors of each sample and the positive samples in the same batch; These are the preset distance boundary hyperparameters.

[0029] It should be noted that this scheme designs a joint loss function for the disease risk prediction model, which is composed of a weighted average of cross-entropy loss and contrast loss. The cross-entropy loss is used to constrain the consistency between the risk probability output by the model and the true label, and its expression incorporates a positive sample weight coefficient and an adaptive adjustment factor for the false negative rate.

[0030] Specifically, the positive sample weight coefficient is configured to be inversely correlated with the aforementioned preset threshold ratio used to trigger data augmentation. That is, when the preset threshold ratio is high, it indicates that the proportion of virtual positive samples in the training set is relatively large, and the model's fit to positive samples is already sufficient. In this case, appropriately reducing the positive sample weight coefficient helps to avoid the model over-focusing on the positive class and sacrificing the discrimination accuracy of the negative class. Conversely, when the preset threshold ratio is low, the positive sample weight coefficient is increased to strengthen the model's learning of scarce positive samples. At the same time, an adaptive adjustment factor proportional to the model's current false negative rate is introduced into the cross-entropy loss, and this factor acts on the positive sample weight coefficient in an exponential form.

[0031] The design logic is as follows: when the model exhibits a high false negative rate on the validation set or online feedback, it indicates that the current model is insufficiently sensitive to disease risk. In this case, the adjustment factor dynamically amplifies the contribution of positive samples to the loss, forcing the model to pay more attention to risk patterns that may trigger the disease. Conversely, when the false negative rate is low, the adjustment factor tends to be constant to avoid overcompensation leading to an increase in the false positive rate. The contrastive loss function is used to shorten the feature distance between positive samples and the center of positive samples within the same batch, while pushing negative samples away from the center, thereby forming a clearer class distinction boundary in the feature space. The distance boundary hyperparameter set in the contrastive loss is used to control the expected minimum interval between positive and negative samples. When the distance between a negative sample and the center of a positive sample is less than this boundary, the loss function will penalize it, prompting the model to push negative samples away from high-risk feature regions. Through the synergistic optimization of the two loss functions mentioned above, the disease risk prediction model can maintain its sensitivity to capturing early and weak risk signals, while effectively suppressing false alarms caused by insufficient positive samples or overlapping features, thus achieving a dynamic balance between the industry's "better to be wrong than to miss" prevention and control orientation and an acceptable false alarm rate.

[0032] It is worth mentioning that the method described in this solution, which constructs positive and negative samples using a three-dimensional risk factor map and trains the constructed disease risk prediction model to obtain a deployable disease risk prediction model that meets expectations, also includes the following steps: All core risk factors and their data source identifiers are extracted from the three-dimensional risk factor map. Based on the identifiers, continuous monitoring values ​​of each factor on the time axis are extracted from historical external environment data to form a structured factor value matrix with core risk factors as columns and time points as rows. Using the date of occurrence of a confirmed airborne disease event as the anchor point, the mean, slope of change, and cumulative duration of exceeding the warning threshold of each core risk factor within a preset retrospective period before the anchor point are extracted from the structured factor numerical matrix, assembled into a positive sample feature vector and labeled as positive. From the same farm, after manual verification, a stable observation period with the same scene type as the positive sample anchor point was selected from the continuous stable period of no clinical cases. The same time period as the positive sample was extracted for feature extraction and negative sample feature vector was constructed and labeled as negative. After constructing positive and negative samples, the statistical feature vector of the core risk factor of each sample is concatenated with the scene type identifier to which the sample belongs to generate an extended feature vector. The extended feature vector is then input into a scene perception encoder based on a multi-head self-attention mechanism to model the interaction relationship between the core risk factors in the extended feature vector in parallel. A multi-head self-attention layer generates query vectors, key vectors, and value vectors for each core risk factor feature. The dot product of the query vector and the key vector is used to measure the correlation strength between factors. After normalization, the value vectors are used as weight coefficients to perform weighted summation, and finally, a weighted risk representation vector that integrates scenario context information is output. The weighted risk representation vector is fed into a classifier composed of LightGBM. In the LightGBM classifier, a decision tree is grown layer by layer according to the principle of maximizing the split gain of the leaf nodes. The weighted risk representation vector is nonlinearly mapped and the predicted probability of the disease occurrence is output. During training, a combination of contrastive loss and cross-entropy loss is used for optimization. Contrastive loss minimizes the distance between samples of the same class and maximizes the distance between samples of different classes, while cross-entropy loss optimizes the difference between the predicted probability and the true label. The encoder and classifier parameters are updated synchronously until convergence, and the output is a disease risk prediction model that meets expectations.

[0033] It is important to note that in livestock and poultry disease risk prediction, the quality of sample construction directly determines the model's ability to identify early warning signals. Traditional methods of randomly dividing time periods can lead to abnormal data during the incubation period being mislabeled as negative, reducing the model's specificity. Therefore, this approach extracts core risk factors and their data sources from a three-dimensional risk factor map, and selectively extracts continuous monitoring values ​​of each factor along the time axis, forming a structured matrix with factors as columns and time as rows. This transforms multidimensional heterogeneous data into standardized input that can be directly used for modeling. Using the confirmed onset date as the anchor point, the mean, slope of change, and cumulative duration exceeding the warning threshold for each factor within the retrospective period are extracted as positive sample features. These statistics can characterize the gradual drift trend of environmental parameters before the disease outbreak, rather than single-point instantaneous values, thus providing more stable early risk signals. Negative samples are strictly limited to a continuous and stable period of time with the same scenario type as positive samples and no clinical cases verified by manual verification. This ensures that negative samples do not contain abnormal disturbances in the incubation period. This scenario-based control design eliminates the interference of seasonal background differences on sample comparison and makes the risk boundary learned by the model more specific.

[0034] To capture the non-independent coupling effects between risk factors, this invention concatenates sample feature vectors with scene type identifiers and inputs them into a scene-aware encoder based on a multi-head self-attention mechanism. This encoder generates query, key, and value vectors for each factor, adaptively learning the interaction strength between factors through the dot product of the query and key, and weighting and fusing the value vectors according to the strength to output a weighted risk representation vector rich in scene context. This process enables the model to dynamically adjust the influence weights between factors based on the current scene. For example, in high-temperature and high-humidity scenarios, it automatically strengthens the interaction between particulate matter concentration and humidity at the air filter inlet, while in low-temperature and dry scenarios, it emphasizes the correlation between the upwind risk exposure index and wind speed. Compared to linear fusion with fixed weights, this method has stronger non-linear modeling capabilities. Subsequently, a LightGBM classifier performs layer-by-layer splitting and probability mapping on the weighted representation, efficiently constructing a decision ensemble using the leaf node gain maximization principle, balancing prediction accuracy and inference speed. During training, contrastive loss and cross-entropy loss are combined. Contrastive loss brings similar samples closer together and pushes apart dissimilar samples within the same batch, enhancing the encoder's ability to distinguish between positive and negative samples. Cross-entropy loss ensures the calibration of the predicted probability with the true label. The two work together to update the encoder and classifier parameters, enabling the model to learn robust discrimination boundaries in the subtle differences between the stable observation period and the incubation period of the epidemic. Ultimately, this results in an epidemic risk prediction model with scene adaptability and sensitive early warning.

[0035] Furthermore, the step of collecting real-time values ​​of each core risk factor of the target farm based on the edge nodes and inputting them into the disease risk prediction model to determine the real-time disease risk and generate real-time disease risk perception information specifically includes: The trained disease risk prediction model is serialized and stored in the non-volatile storage unit of the air filter equipment associated edge node. At the same time, the hidden Markov scene model used for scene recognition is also stored in the non-volatile storage unit to achieve local inference. By collecting real-time values ​​of each core risk factor of the target farm at fixed intervals through the deployed edge nodes, a multi-source real-time data frame sequence is generated and used as observation input to identify the current scene identifier. The core risk factor list and specific weights of the current scene are extracted from the three-dimensional risk factor map. According to the core risk factor list, the instantaneous values ​​of the core risk factors are extracted from the multi-source real-time data frame sequence, and the mean, slope of change and cumulative duration of exceeding the warning threshold of each core risk factor in the past preset window are read. These values ​​are then concatenated with the specific weights and the current scene identifier to form the real-time core risk factor feature vector. The real-time core risk factor feature vector is input into the disease risk prediction model. The interaction weights between the features of each factor are calculated in parallel through a multi-head self-attention layer. After weighted fusion, the real-time weighted risk representation vector is output and fed into the LightGBM classifier to accumulate the leaf node scores along the decision tree route. The real-time risk probability value is obtained through mapping. The variance of multiple output probability values ​​is used as a measure of cognitive uncertainty. Real-time risk probability values, cognitive uncertainty measures, current scene identifiers, and uncertainty levels are encapsulated to generate real-time disease risk perception information.

[0036] It should be noted that after the model is trained offline, it needs to be deployed to the production environment to achieve real-time risk perception. Considering the limited network bandwidth of farms and the sensitivity of disease early warning to response delays, this solution serializes the trained disease risk prediction model and embeds it into the edge computing node associated with the air filter equipment. At the same time, the Hidden Markov Model for scene recognition is deployed to each edge computing node, so that the inference process is completed locally at the data source, avoiding the delay and network outage risks caused by cloud transmission.

[0037] Edge nodes collect real-time values ​​of various core risk factors of the target farm at fixed intervals to generate multi-source real-time data frame sequences. In order to transfer the scene perception capability of offline modeling to the online stage, the edge nodes call the hidden Markov model scene recognition module deployed locally. Taking the environmental data sequence of consecutive time periods before the current time as the observation input, the optimal hidden state path is solved by the Viterbi algorithm and the end state is taken as the current scene identifier. This scene identifier shares the same set of hidden state definitions as the scene segmentation results during offline modeling.

[0038] Subsequently, based on the current scene identifier, a list of core risk factors corresponding to the scene and the specific weights of each factor are extracted from the 3D risk factor map. Instantaneous values ​​of each factor are extracted from the real-time data frame according to the list. Simultaneously, the mean, slope of change, and cumulative duration exceeding the warning threshold for each factor within a preset window are read from the memory buffer and concatenated with the specific weights and scene identifier to form a real-time risk factor feature vector. This real-time risk factor feature vector is input into the model. First, a multi-head self-attention layer calculates the interaction weights of each factor in the current scene in parallel and performs weighted fusion. Then, the LightGBM classifier routes along the fixed decision tree structure to the leaf nodes and accumulates the scores, obtaining the real-time risk probability value through mapping. Simultaneously, the self-attention layer undergoes multiple random dropout mask samplings and repeated forward propagation. The variance of the multiple output probability values ​​is statistically analyzed as a measure of cognitive uncertainty. When the model encounters unfamiliar environmental combinations that differ significantly from the training distribution, the prediction results from multiple samplings tend to diverge, increasing the variance. Based on this, a low-confidence warning is marked, prompting manual review, thereby avoiding blindly triggering defensive actions in data drift scenarios. Ultimately, risk probability values, uncertainty measures, scenario identifiers, and uncertainty levels are encapsulated into structured real-time disease risk perception information. This provides both point-based estimation of early warning intensity and interval-based estimation of reliability, upgrading risk perception from a single numerical output to decision-level information with confidence calibration. This provides a more sufficient basis for triggering subsequent coordinated defense decisions.

[0039] Furthermore, in a preferred embodiment of the present invention, the step of generating a diagnostic conclusion code for the air filter equipment through a digital twin model of the air filter and determining whether maintenance is required, and if no maintenance is required, then combining future weather forecasts to extrapolate the filter efficiency attenuation prediction curve, and comparing it with current disease prevention needs to predict disease prevention capabilities, specifically includes: A digital twin model of an air filter device is constructed. The digital twin model includes a porous media resistance sub-model describing the change of filter material porosity with the total amount of retained particles, a Darcy flow sub-model describing the relationship between airflow pressure drop and flow velocity, and a fractal growth sub-model describing the growth of dust cake layer on the filter element surface. When real-time disease risk perception information triggers the linkage defense warning, the current readings of the differential pressure sensor of the primary filter section, the filtration wind speed sensor, the temperature and humidity of the air filter inlet, and the particulate matter concentration sensor readings of the air filter inlet are input into the digital twin model for parallel simulation, and the theoretical differential pressure value, theoretical filtration wind speed value, and theoretical filtration efficiency value of each filter section under the same working conditions are output. The residuals are calculated item by item between the theoretical values ​​and the actual physical parameters. The pressure difference residual is the absolute value of the difference between the theoretical pressure difference and the actual pressure difference, the filtration velocity residual is the absolute value of the difference between the theoretical filtration velocity and the actual filtration velocity, and the filtration efficiency residual is the absolute value of the difference between the actual filtration efficiency estimated based on the pressure difference and the operating time and the theoretical filtration efficiency. When the differential pressure residual exceeds the first threshold and the actual differential pressure is higher than the theoretical differential pressure, it is diagnosed as abnormal blockage or moisture-induced caking of the filter element. When the filtration velocity residual exceeds the second threshold but the differential pressure residual is normal, it is diagnosed as leakage in the air duct or a decrease in fan efficiency. When the filtration efficiency residual exceeds the third threshold and the actual efficiency is lower than the theoretical efficiency, it is diagnosed as filter material damage or frame seal failure, and a diagnostic conclusion code is generated. The weather forecast data for the location of the breeding farm for a preset period of time is obtained through an external meteorological forecast service interface. The weather forecast data is used as an external boundary condition to input into the digital twin model. The distribution of particulate matter deposition inside the filter element at the current moment is used as the initial state for iterative deduction to generate a prediction curve of the filter element filtration efficiency decay over a preset period of time in the future. The system reads the current risk probability value from the real-time disease risk perception information that triggers the linkage defense warning, determines the minimum filtration efficiency threshold required to block airborne diseases under the current risk level based on the pre-calibrated risk level and filtration efficiency mapping table, compares it hourly with the attenuation prediction curve, and outputs the defense capability prediction result containing the diagnostic conclusion code.

[0040] It should be noted that in the current operation and maintenance of air filtration systems in livestock farms, the health status assessment of air filter equipment mainly relies on fixed-period differential pressure inspections or usage countdowns. This method cannot perceive the actual blockage distribution and efficiency degradation rate inside the filter element, nor can it distinguish whether abnormal pressure differences are caused by normal dust accumulation, filter media caking due to moisture, or pipeline leaks. When the risk of disease suddenly increases, maintenance personnel cannot determine whether the current air filter has sufficient filtration capacity to resist the intrusion of pathogenic aerosols based solely on a single differential pressure reading. This can easily lead to blind replacement resulting in waste or failure to replace in a timely manner, creating a protective vacuum. To address this issue, this solution constructs a digital twin model of the air filter equipment. This model consists of three coupled physical mechanism sub-models: the porous media resistance sub-model describes the process of the filter media porosity gradually decreasing as the total amount of trapped particles increases; the Darcy flow sub-model describes the velocity response relationship of the airflow driven by the pressure difference across the filter media; and the fractal growth sub-model describes the geometric evolution of dust particles accumulating in a fractal structure on the filter element surface to form a filter cake layer. The three sub-models are coupled and linked by sharing the particle deposition amount variable of each micro-element layer inside the filter element, thereby faithfully reproducing the real-time operating status of the air filter equipment in digital space.

[0041] When real-time disease risk perception information indicates the need for defense, the current readings of the primary filter section differential pressure sensor, the filtration velocity sensor, the air filter inlet temperature and humidity sensor, and the air filter inlet particulate matter concentration sensor are simultaneously input into the digital twin model for parallel simulation. Based on the primary filter section differential pressure data, the theoretical differential pressure, theoretical filtration velocity, and theoretical filtration efficiency are derived segment by segment through the porous media resistance sub-model and the Darcy flow sub-model. Subsequently, residuals are calculated item by item between theoretical values ​​and actual physical parameters. A combined diagnostic logic using three types of residuals enables precise fault location: An abnormal differential pressure residual coupled with an actual differential pressure higher than the theoretical value indicates an additional source of resistance within the filter element beyond normal dust accumulation, such as filter media caking due to excessive humidity or pore blockage by high-concentration sticky particles; an abnormal filtration velocity residual but a normal differential pressure residual indicates a leak in the ductwork causing the actual airflow to be lower than the design value, or dust accumulation on the fan impeller causing the speed-airflow relationship to deviate from the calibration curve; an abnormal filtration efficiency residual coupled with an actual efficiency lower than the theoretical value directly points to filter media damage, frame seal failure, or improper installation leading to dust-laden airflow bypass. This residual-based diagnostic method transforms vague equipment anomaly judgments into clear, actionable conclusion codes, providing precise fault location for subsequent maintenance decisions.

[0042] Based on this, hourly weather forecast data for the location of the aquaculture farm is obtained through an external weather forecast interface for a predetermined period of time. This data is then input into the digital twin model as an external boundary condition. Using the simulated particle deposition distribution inside the filter element at the current moment as the initial state, a forward iterative extrapolation is performed to generate a predicted decay curve for the filter element's filtration efficiency over the future period. Simultaneously, the current risk probability value is read from the risk perception information that triggers defense alerts. Based on a pre-defined mapping table between risk levels and filtration efficiency, the minimum filtration efficiency threshold required for the current risk level is determined, and the decay prediction curve is compared hourly with the minimum threshold. This prediction of defense capabilities based on future trends elevates air filter maintenance decisions from a passive response of "repairing only after problems occur" to proactive planning of "predicting when it will be insufficient," directly linking equipment status assessment with disease prevention needs and establishing a decision-making link between risk perception and equipment maintenance.

[0043] Furthermore, in a preferred embodiment of the present invention, the method further includes real-time feedback optimization of the sample set based on real-time disease risk perception information, specifically: If the real-time disease risk perception information indicates that disease prevention is needed and an airborne disease event is observed to occur within a preset time period in the future, a real-time positive sample is generated and added to the positive sample set based on the collected external environmental data of the farm and the air filter intake side operating parameters in the current scenario. If the real-time disease risk perception information indicates that disease prevention is needed and no airborne disease event is observed within a preset time period, then erroneous positive samples are generated and an erroneous positive sample set is established based on the collected external environmental data of the farm and the air filter intake side operating parameters in the current scenario. If the real-time disease risk perception information indicates that no disease prevention is needed and no airborne disease event is observed within a preset time period, a real-time negative sample is generated and added to the negative sample set based on the collected external environmental data of the farm and the air filter inlet side operating parameters in the current scenario. If the real-time disease risk perception information indicates that no disease prevention is needed and an airborne disease event is observed to occur within a preset time period in the future, a real-time positive sample is generated and added to the positive sample set based on the collected external environmental data of the farm and the operating parameters of the air filter intake side in the current scenario. At the same time, negative samples in the negative sample set whose feature distance from the real-time positive samples is lower than a preset third distance threshold are deleted, wherein the third distance threshold is greater than the second distance threshold.

[0044] It should be noted that this solution establishes a sample self-correction and continuous model optimization mechanism based on online feedback for the epidemic risk prediction model. The core idea is to compare each risk perception made by the system during actual operation with real-world incidence observations over a future period, and automatically supplement and clean the training sample set based on the comparison results, forming a closed loop of "perception-verification-correction".

[0045] When a high-risk warning is issued and an airborne disease actually occurs during the observation period, it proves the model's judgment is accurate. In this case, the real-time environmental data that triggered the warning is extracted and added to the positive sample set as a new "real-time positive sample," reinforcing the model's memory of this risk pattern. Conversely, if no disease occurs during the observation period after a high-risk warning is issued, it indicates a false alarm, and this data is marked as an "erroneous positive sample" and stored separately. Similarly, when a low-risk assessment is made, the result is compared with the actual situation. If there is indeed no disease, the current data is added to the negative sample set as a "real-time negative sample," enriching the description of the safe environmental state. However, if a disease unexpectedly occurs under a low-risk assessment, this represents a serious underreporting. The missed risk pattern must be immediately added to the positive sample set as a "real-time positive sample," allowing the model to learn immediately and prevent the same loophole from recurring.

[0046] More importantly, whenever a new real-time positive sample is confirmed, a proactive search is performed in the negative sample set to identify and remove historical negative samples that are overly similar in features to the new positive sample. This aims to eliminate "dirty data" with high-risk features that are mislabeled, which can severely obscure the model's decision boundaries. Setting a "third distance threshold" that is greater than the second distance threshold is intended to sweep away these interfering factors over a wider range, forcing the model to learn clearer and stricter decision boundaries between positive and negative samples, thereby continuously improving its accuracy and specificity in practical applications.

[0047] Figure 2 A flowchart of a differential air filter linkage control parameter optimization driven by defense capability prediction is provided in one embodiment of the present invention; like Figure 2 As shown, this invention provides a flowchart for optimizing differentiated air filter linkage control parameters driven by defense capability prediction, including: Obtain the prediction results of disease prevention capabilities, read the prevention capability status category, diagnostic conclusion code and filter efficiency attenuation prediction curve of the disease prevention capability prediction results, and map the disease prevention capability prediction results into a list of differentiated linkage defense strategies to be executed; When the prediction result is that the defense capability is sufficient and the status is normal, a defense strategy list is generated, which includes the internal circulation boost mode, the default fan speed and the basic disinfection duration; when the prediction result is that maintenance and adjustment are required in advance, fan frequency compensation and maintenance operation items are added. When the prediction result is that the filter needs to be replaced immediately, the ventilation mode is limited to the minimum fresh air volume internal circulation, an emergency replacement work order is generated and pushed to the maintenance team, and the disinfection time is adjusted to the maximum preset value. After the replacement is completed and the defense capability is re-evaluated and confirmed by the digital twin model, the standard defense mode is switched back. The state space is established based on the current risk probability value, defense capability status category, deviation of indoor temperature and environmental stability, and wind speed and direction forecast values ​​for the future preset period. The continuous action space is established based on the fan speed adjustment increment, disinfection duration adjustment increment, and internal circulation valve opening adjustment increment. A deep Q-network architecture is used to construct a reinforcement learning agent and set a reward function. Each time the coordinated defense is triggered, the current state vector is input into the online policy network of the deep Q network to obtain the action value estimate of each discretized action combination. The action combination with the highest action value is selected as the optimal defense action parameter through a greedy policy, written into the defense policy list and sent to the corresponding execution mechanism. After the defense action is completed, the disease risk prediction model is called again to calculate the risk probability value after the defense, the actual fan power consumption and disinfection agent usage are recorded, the actual reward value is calculated, and the current state, executed action, actual reward and new state after the defense are encapsulated as experience tuples and stored in the experience replay pool of a fixed-length circular queue structure. When the number of experience tuples in the experience replay pool reaches the preset batch size, random sampling is performed. The mean square error between the temporal difference target value and the action value estimate of each experience in the sample is calculated. The weights of the online policy network are updated by backpropagation. The weights of the online policy network are synchronized to the target policy network every fixed update period to achieve incremental policy iteration.

[0048] It should be noted that in the existing disease prevention and control system of farms, the decision-making process after a risk warning is triggered relies heavily on human experience. Maintenance personnel must determine the appropriate defensive actions and their intensity within a tight timeframe, resulting in poor decision-making consistency and difficulty in balancing prevention effectiveness with operating costs. When air filtration equipment is in different stages of performance degradation, the same risk level may require completely different combinations of defense parameters. For example, if the filter element resistance is high and the equipment is still operated at the default speed, the positive pressure inside the shed may not be achieved, thus weakening the physical barrier against pathogenic aerosols. To address these issues, after obtaining the disease prevention capability prediction results, the system first reads the prevention capability status category, diagnostic conclusion code, and filter element filtration efficiency degradation prediction curve, mapping the prediction conclusions into a list of directly executable, differentiated, and interconnected defense strategies. When the defense capability is sufficient, the internal circulation pressurization and basic disinfection are started with default parameters; when maintenance is required in advance, the fan frequency compensation is automatically added to offset the air volume loss caused by the increase in filter resistance, and targeted maintenance items are given; when the filter needs to be replaced immediately, the minimum fresh air volume internal circulation is forcibly limited to block the intrusion path of unfiltered air, and an emergency replacement work order is pushed at the same time and the disinfection intensity is increased to the maximum, forming a graded response system that is precisely matched with the risk situation and equipment status.

[0049] To further optimize the real-time selection of defense action execution parameters, this scheme constructs a deep Q-network reinforcement learning agent. The agent's state space is composed of the current risk probability value, defense capability status category, environmental stability deviation of the in-building temperature and ammonia concentration, and predicted wind speed and direction for future periods. The continuous action space is composed of incremental adjustments to fan speed, disinfection duration, and internal circulation valve opening. This allows the agent to make global decisions based on a comprehensive consideration of risk status, equipment health, and external weather conditions. The deviation of the in-building temperature and environmental stability serves as an indicator for monitoring the effectiveness of defense actions and is not included in the feature input of the risk prediction model. The reward function is designed as a weighted combination of risk reduction reward, environmental stability maintenance reward, and equipment energy consumption cost penalty, ensuring that the agent must balance in-building environmental comfort and operational economy while pursuing rapid risk reduction. After each defense operation, the risk probability is recalculated and the actual energy consumption is recorded. The current state, action, reward, and new state are encapsulated as experience tuples and stored in the experience replay pool. When the accumulated experience reaches the batch size, random sampling is performed for temporal differential learning. Backpropagation updates the weights of the online policy network and is periodically synchronized to the target policy network. This incremental learning mechanism after each real defense event allows the defense strategy to automatically evolve with slow time-varying factors such as equipment aging and seasonal changes, continuously approaching the optimal balance between long-term prevention and control and low-cost operation, achieving a leap from fixed rule response to adaptive continuous optimization.

[0050] It is worth mentioning that the mathematical expression for the reward function of a reinforcement learning agent is: , in, For the first The cumulative reward value after each defensive action is completed; To reduce risk That is, the difference between the probability values ​​of disease risk before and after the implementation of the defense action, normalized to the interval [0,1]; During the defense execution period Temperature sensor readings inside the cell at each sampling time; Set a median value for the comfort temperature zone inside the building; During the defense execution period Ammonia concentration sensor readings at each sampling time; This represents the upper limit of the safe threshold for ammonia concentration. This represents the total number of environmental parameter samples taken during the defense execution period. To prevent the difference in operating frequencies between the front and rear wind turbines; Duration of the defensive action; The power coefficient per unit frequency increment of the wind turbine; This refers to the unit price of the disinfectant. This refers to the amount of disinfectant consumed by the disinfection equipment per unit time. Working hours of disinfection equipment; The risk reduction reward weighting coefficient; The weighting coefficient is maintained for environmental stability; This is the weighting coefficient for equipment energy consumption costs.

[0051] It should be noted that α, β, and γ are all positive real numbers that satisfy α + β + γ = 1. They are determined by traversing and optimizing through offline grid search with the goal of maximizing long-term cumulative rewards.

[0052] Figure 3 An embodiment of the present invention provides a livestock and poultry disease prevention system 3 based on multi-source environmental perception and air filter linkage. The system includes: a memory 301, a processor 302, and a communication interface 303. The memory 301 contains a livestock and poultry disease prevention method program based on multi-source environmental perception and air filter linkage. When the processor 302 executes the livestock and poultry disease prevention method program based on multi-source environmental perception and air filter linkage, it implements the livestock and poultry disease prevention method steps as described above.

[0053] Another aspect of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a program for a livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage, wherein when the program for a livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage is executed by a processor, it implements the steps of the livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage as described in any of the preceding claims.

[0054] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for preventing livestock and poultry diseases based on multi-source environmental perception and air filtration linkage, characterized in that, include: The risk factors and airborne disease events that occurred in the target farm in the past were obtained. Based on the relationship between the two, core risk factors were screened out, and scenario-specific analysis was carried out on each core risk factor in several scenarios to construct a three-dimensional risk factor map. Positive and negative samples are constructed based on the three-dimensional risk factor map to train the disease risk prediction model. The positive samples are used to characterize the data patterns of each core risk factor before a confirmed airborne disease event, and the negative samples are used to characterize the data patterns of each core risk factor during a continuous and stable period without airborne disease events. The trained disease risk prediction model is deployed to the edge node associated with the air filter equipment. Based on the edge node, the real-time values ​​of each core risk factor of the target farm are collected and input into the disease risk prediction model to determine the real-time disease risk and generate real-time disease risk perception information. When the real-time disease risk perception information indicates that disease prevention is required, the air filter status self-check is performed through the air filter digital twin model to generate a diagnostic conclusion code for the air filter equipment and determine whether maintenance is required. If maintenance is not required, the filter efficiency attenuation prediction curve is calculated by combining future weather forecasts and compared with the current disease prevention requirements to predict the disease prevention capability. Based on the diagnostic conclusion code and the disease prevention capability prediction result, a corresponding defense strategy is determined, and the air filter device is controlled to execute the defense strategy.

2. The livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage according to claim 1, characterized in that, The disease risk prediction model consists of a scene-aware encoder based on a multi-head self-attention mechanism and a LightGBM classifier connected in series. The encoder dynamically and interactively weights the input risk factor features, and the classifier performs a non-linear mapping on the weighted representation and outputs the probability of disease occurrence. The disease risk prediction model is trained in the following way: When the preset model training conditions are met, a positive sample set and a negative sample set are constructed based on the three-dimensional risk factor map. The number of samples in the positive sample set and the negative sample set are counted. The ratio of the number of positive samples to the number of negative samples is calculated as the initial imbalance. The preset model training conditions include the first training of the disease risk prediction model or the existence of an update in the erroneous positive sample set. If the initial imbalance is lower than a preset threshold ratio, it is determined that positive samples are scarce. Data augmentation is performed on the positive sample set to obtain virtual positive samples with similar data characteristics to the positive samples in the positive sample set. The preset threshold ratio is positively correlated with the false detection rate of the disease risk prediction model for airborne disease events. Check the first sample feature distance between the virtual positive sample and all erroneous positive samples in the erroneous positive sample set, and the second sample feature distance between the virtual positive sample and all negative samples in the negative sample set; wherein, the feature distance between any two samples is calculated by the distance between the two samples in each core risk factor dimension; If the feature distance of any first sample is lower than a preset first distance threshold, the virtual positive sample is discarded; if the feature distance of all first samples is not lower than the preset first distance threshold, the virtual positive sample is added to the positive sample set. If the second sample feature distance between the virtual positive sample and any negative sample is lower than a second preset distance threshold, the corresponding negative sample is deleted from the negative sample set. If the initial imbalance is not lower than the preset threshold ratio, the disease risk prediction model is trained based on the positive sample set and the negative sample set. After training is completed, all virtual positive samples in the positive sample set are deleted.

3. The livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage according to claim 2, characterized in that, The loss function corresponding to the disease risk prediction model is: , in, For the joint loss function, To compare the loss weighting coefficients, Let cross-entropy be the loss function. To compare loss functions; The cross-entropy loss function The specific expression is: , in, For the first The label for each sample is 1 for positive samples and 0 for negative samples; The risk probability value output by the disease risk prediction model; Inversely related to the preset threshold ratio; The total number of samples in a single batch. Proportional to the false negative rate of the disease risk prediction model for airborne disease events; The contrast loss function The specific expression is: , In the formula: This represents the total number of samples in a single batch. The first in the batch The index of each sample is traversed from 1 to... ; No. The true label of each sample is 1 for positive samples and 0 for negative samples; For the first The Euclidean distance between the center vectors of each sample and the positive samples in the same batch; These are the preset distance boundary hyperparameters.

4. The livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage according to claim 1, characterized in that, The screening process yields core risk factors, and scenario-specific analysis is performed on each core risk factor under several scenarios to construct a three-dimensional risk factor map, specifically including: Obtain historical risk factors and airborne disease events from the target farm, and align them by timestamps to generate a time-series dataset. For every two candidate risk factors in the time series dataset, the transfer entropy is calculated. The statistical significance of the transfer entropy is judged by the permutation test. Significant conditional transitivity is retained as directed edges. An environment-disease directed acyclic graph is constructed. The causal effect of each candidate risk factor on the disease event node is calculated. Candidate risk factors that exceed the preset threshold are marked as core risk factors. Based on the historical data of risk factors collected from the target farm, an observation sequence is generated at each historical time point using environmental variable values. A hidden Markov algorithm is used for scene segmentation, dividing each time point into several typical environmental scenes and generating several typical environmental scene labels with timestamps. The typical environmental scenario labels obtained from the segmentation are pasted back to the historical time interval. Under each scenario type, the conditional mutual information value between each core risk factor and the epidemic event is calculated. The conditional mutual information value is used as the specific weight of the corresponding core risk factor under the corresponding scenario. The names and specific parameters of each core risk factor, the causal effect calculated in the global directed acyclic graph, and the conditional mutual information weights calculated in each typical scenario are summarized to form a three-dimensional risk factor map that includes the factor identity dimension, the global effect strength dimension, and the scenario-based response weight dimension.

5. The livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage according to claim 1, characterized in that, The process of collecting real-time values ​​of core risk factors of the target farm based on the edge nodes, inputting them into the disease risk prediction model to determine real-time disease risk, and generating real-time disease risk perception information specifically includes: The trained disease risk prediction model is serialized and stored in the non-volatile storage unit of the air filter equipment associated edge node. At the same time, the hidden Markov scene model used for scene recognition is also stored in the non-volatile storage unit to achieve local inference. By collecting real-time values ​​of each core risk factor of the target farm at fixed intervals through the deployed edge nodes, a multi-source real-time data frame sequence is generated and used as observation input to identify the current scene identifier. The core risk factor list and specific weights of the current scene are extracted from the three-dimensional risk factor map. According to the core risk factor list, the instantaneous values ​​of the core risk factors are extracted from the multi-source real-time data frame sequence, and the mean, slope of change and cumulative duration of exceeding the warning threshold of each core risk factor in the past preset window are read. These values ​​are then concatenated with the specific weights and the current scene identifier to form the real-time core risk factor feature vector. The real-time core risk factor feature vector is input into the disease risk prediction model. The interaction weights between the features of each factor are calculated in parallel through a multi-head self-attention layer. After weighted fusion, the real-time weighted risk representation vector is output and fed into the LightGBM classifier to accumulate the leaf node scores along the decision tree route. The real-time risk probability value is obtained through mapping. The variance of multiple output probability values ​​is used as a measure of cognitive uncertainty. Real-time risk probability values, cognitive uncertainty measures, current scene identifiers, and uncertainty levels are encapsulated to generate real-time disease risk perception information.

6. The livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage according to claim 1, characterized in that, The process involves using a digital twin model of the air filter to perform a self-check of the air filter's status, generating a diagnostic conclusion code for the air filter equipment, and determining whether maintenance is required. If maintenance is not required, the process combines future weather forecasts to extrapolate the filter cartridge efficiency degradation curve and compares it with current disease prevention needs to predict disease prevention capabilities. Specifically, this includes: A digital twin model of an air filter device is constructed. The digital twin model includes a porous media resistance sub-model describing the change of filter material porosity with the total amount of retained particles, a Darcy flow sub-model describing the relationship between airflow pressure drop and flow velocity, and a fractal growth sub-model describing the growth of dust cake layer on the filter element surface. When real-time disease risk perception information triggers the linkage defense warning, the current readings of the differential pressure sensor of the primary filter section, the filtration wind speed sensor, the temperature and humidity of the air filter inlet, and the particulate matter concentration sensor readings of the air filter inlet are input into the digital twin model for parallel simulation, and the theoretical differential pressure value, theoretical filtration wind speed value, and theoretical filtration efficiency value of each filter section under the same working conditions are output. The residuals are calculated item by item between the theoretical values ​​and the actual physical parameters. The pressure difference residual is the absolute value of the difference between the theoretical pressure difference and the actual pressure difference, the filtration velocity residual is the absolute value of the difference between the theoretical filtration velocity and the actual filtration velocity, and the filtration efficiency residual is the absolute value of the difference between the actual filtration efficiency estimated based on the pressure difference and the operating time and the theoretical filtration efficiency. When the differential pressure residual exceeds the first threshold and the actual differential pressure is higher than the theoretical differential pressure, it is diagnosed as abnormal blockage or moisture-induced caking of the filter element. When the filtration velocity residual exceeds the second threshold but the differential pressure residual is normal, it is diagnosed as leakage in the air duct or a decrease in fan efficiency. When the filtration efficiency residual exceeds the third threshold and the actual efficiency is lower than the theoretical efficiency, it is diagnosed as filter material damage or frame seal failure, and a diagnostic conclusion code is generated. The weather forecast data for the location of the breeding farm for a preset period of time is obtained through an external meteorological forecast service interface. The weather forecast data is used as an external boundary condition to input into the digital twin model. The distribution of particulate matter deposition inside the filter element at the current moment is used as the initial state for iterative deduction to generate a prediction curve of the filter element filtration efficiency decay over a preset period of time in the future. The system reads the current risk probability value from the real-time disease risk perception information that triggers the linkage defense warning, determines the minimum filtration efficiency threshold required to block airborne diseases under the current risk level based on the pre-calibrated risk level and filtration efficiency mapping table, compares it hourly with the attenuation prediction curve, and outputs the defense capability prediction result containing the diagnostic conclusion code.

7. The livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage according to claim 1, characterized in that, Real-time feedback optimization of sample sets based on real-time disease risk perception information also includes: If the real-time disease risk perception information indicates that disease prevention is needed and an airborne disease event is observed to occur within a preset time period in the future, a real-time positive sample is generated and added to the positive sample set based on the collected external environmental data of the farm and the air filter intake side operating parameters in the current scenario. If the real-time disease risk perception information indicates that disease prevention is needed and no airborne disease event is observed within a preset time period, then erroneous positive samples are generated and an erroneous positive sample set is established based on the collected external environmental data of the farm and the air filter intake side operating parameters in the current scenario. If the real-time disease risk perception information indicates that no disease prevention is needed and no airborne disease event is observed within a preset time period, a real-time negative sample is generated and added to the negative sample set based on the collected external environmental data of the farm and the air filter inlet side operating parameters in the current scenario. If the real-time disease risk perception information indicates that no disease prevention is needed and an airborne disease event is observed to occur within a preset time period in the future, a real-time positive sample is generated and added to the positive sample set based on the collected external environmental data of the farm and the operating parameters of the air filter intake side in the current scenario. At the same time, negative samples in the negative sample set whose feature distance from the real-time positive samples is lower than a preset third distance threshold are deleted, wherein the third distance threshold is greater than the second distance threshold.

8. The livestock and poultry disease prevention method based on multi-source environmental perception and air filtration linkage according to claim 1, characterized in that, The step of determining the corresponding defense strategy based on the diagnostic conclusion code and the disease prevention capability prediction result, and selecting the optimal action parameters to execute the linkage defense strategy on the air filter equipment, specifically includes: Obtain the prediction results of disease prevention capabilities, read the prevention capability status category, diagnostic conclusion code and filter efficiency attenuation prediction curve of the disease prevention capability prediction results, and map the disease prevention capability prediction results into a list of differentiated linkage defense strategies to be executed; When the prediction result is that the defense capability is sufficient and the status is normal, a defense strategy list is generated, which includes the internal circulation boost mode, the default fan speed and the basic disinfection duration; when the prediction result is that maintenance and adjustment are required in advance, fan frequency compensation and maintenance operation items are added. When the prediction result is that the filter needs to be replaced immediately, the ventilation mode is limited to the minimum fresh air volume internal circulation, an emergency replacement work order is generated and pushed to the maintenance team, and the disinfection time is adjusted to the maximum preset value. After the replacement is completed and the defense capability is re-evaluated and confirmed by the digital twin model, the standard defense mode is switched back. The state space is established based on the current risk probability value, defense capability status category, deviation of indoor temperature and environmental stability, and wind speed and direction forecast values ​​for the future preset period. The continuous action space is established based on the fan speed adjustment increment, disinfection duration adjustment increment, and internal circulation valve opening adjustment increment. A deep Q-network architecture is used to construct a reinforcement learning agent and set a reward function. Each time the coordinated defense is triggered, the current state vector is input into the online policy network of the deep Q network to obtain the action value estimate of each discretized action combination. The action combination with the highest action value is selected as the optimal defense action parameter through a greedy policy, written into the defense policy list and sent to the corresponding execution mechanism. After the defense action is completed, the disease risk prediction model is called again to calculate the risk probability value after the defense, the actual fan power consumption and disinfection agent usage are recorded, the actual reward value is calculated, and the current state, executed action, actual reward and new state after the defense are encapsulated as experience tuples and stored in the experience replay pool of a fixed-length circular queue structure. When the number of experience tuples in the experience replay pool reaches the preset batch size, random sampling is performed. The mean square error between the temporal difference target value and the action value estimate of each experience in the sample is calculated. The weights of the online policy network are updated by backpropagation. The weights of the online policy network are synchronized to the target policy network every fixed update period to achieve incremental policy iteration.

9. A livestock and poultry disease prevention system based on multi-source environmental perception and air filtration linkage, characterized in that, The system includes: a memory, a processor, and a communication interface. The memory contains a program for a livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage. When the program for a livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage is executed by the processor, it implements the steps of the livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a livestock and poultry disease prevention method program based on multi-source environmental perception and air filter linkage. When the livestock and poultry disease prevention method program based on multi-source environmental perception and air filter linkage is executed by a processor, it implements the steps of the livestock and poultry disease prevention method based on multi-source environmental perception and air filter linkage as described in any one of claims 1 to 8.