A pig disease early warning method, system and device
By acquiring and analyzing the physiological and behavioral parameters of pigs, combined with pathogen and environmental monitoring data, early warning information is generated, which solves the problem that the existing system cannot fully understand the environment of pig breeding sites and promptly warn of diseases, and improves the efficiency of disease early warning.
Patent Information
- Application Number
- CN202411459608.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-18
AI Technical Summary
The existing environmental intelligent monitoring and early warning system of pig farms cannot achieve comprehensive monitoring and management of multiple environmental parameters, resulting in the inability to fully understand the environmental conditions of pig farms, and thus fail to promptly warn of animal population diseases.
By obtaining the physiological parameters and behavioral parameters of each individual's pig, calculate its health value, and combine the diseased primary monitoring data and environmental monitoring data to determine whether it exceeds the preset threshold and generate early warning information of different levels.
It achieves more comprehensive health status monitoring and environmental assessment of pig groups, can timely detect health abnormalities and environmental unsuitability, and improves the efficiency of disease early warning.
Smart Images

Figure CN118969296B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of animal breeding technology, and in particular to a pig disease early warning method, system and equipment. Background Art
[0002] Although the existing intelligent monitoring and early warning system for the pig farm environment has been able to monitor and manage the pig farm environment, there are still some problems and shortcomings. For example, the existing system can usually only monitor a single environmental parameter, and cannot achieve comprehensive monitoring and management of multiple environmental parameters. Therefore, it is impossible to fully understand the environmental conditions of pig farms, and thus it is impossible to provide timely early warnings for animal group diseases. Summary of the invention
[0003] The present application provides a method, system and device for early warning of pig diseases, aiming to solve the technical problem of low efficiency of early warning of pig diseases in the prior art.
[0004] In order to solve the above technical problems, the present application provides a method for early warning of pig diseases, comprising the following steps:
[0005] Acquire physiological parameters and behavioral parameters of each individual pig in the target pig group; the physiological parameters and behavioral parameters are acquired based on the individual pig monitoring device; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement state data, eating data and sleep data;
[0006] Based on the physiological parameters and the behavioral parameters, obtaining a health value of a corresponding individual pig;
[0007] Based on the health values of all individual pigs in the target pig group, determine whether the number of individual pigs with health abnormalities exceeds a preset health abnormality threshold; if the number of individual pigs with health abnormalities exceeds the preset threshold, obtain pathogen monitoring data of the target pig group; the pathogen monitoring data is obtained based on the pathogen monitoring device;
[0008] Determine whether the pathogen monitoring data exceeds a preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, send disease warning information to the breeder;
[0009] If the pathogen monitoring data does not exceed the preset pathogen threshold, then obtain the environmental monitoring data of the target pig population; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data;
[0010] The environmental monitoring data is input into a preset environmental assessment model to obtain an environmental assessment value output by the preset environmental assessment model; the environmental assessment value is compared with a first threshold value, and if the environmental assessment value is less than or equal to the first threshold value, a first level warning information is generated; the first level warning information is used to characterize that the target pig group is in an unsuitable environment; if the environmental assessment value is greater than the first threshold value, the environmental assessment value is compared with a second threshold value; if the environmental assessment value is greater than the first threshold value and less than or equal to the second threshold value, a second level warning information is generated; the second level warning information is used to characterize that the target pig group is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold value, a third level warning information is generated; the third level warning information is used to characterize that the target pig group is in a suitable environment; the first threshold value is less than the second threshold value.
[0011] As some optional implementations of the present application, before inputting the environmental monitoring data into a preset environmental assessment model to obtain the environmental assessment value output by the preset environmental assessment model, the method further includes:
[0012] The temperature and humidity data, the light intensity data, the harmful gas concentration data and the stocking density data are subjected to data format standardization processing, and the data in each information after the data format standardization processing is subjected to data extraction processing, data conversion processing and data cleaning processing based on ETL data integration technology, and loaded into a target data storage library;
[0013] Use UTC time as the benchmark and ensure that all data sources are recorded in the same timestamp format; use the Network Time Protocol to synchronize the clocks of all data sources, and sort or adjust all data by timestamp before data integration to ensure the timing correctness of the data;
[0014] If there is a timing inconsistency due to data collection or transmission delays, use interpolation technology or time window method to process it to ensure the continuity and integrity of the data in the time dimension.
[0015] As some optional implementations of the present application, each internal node of the preset environmental assessment model represents a test on an attribute, each branch represents the result of the test, and each leaf node represents a class label; various labels are summarized and analyzed to generate an environmental assessment value;
[0016] The objective function expression of the preset environmental assessment model is: in, represents the model parameters, N represents the total number of data points, K represents the number of decision trees in the random forest, represents the weight value of the kth decision tree, represents the true label of the Mth data point, represents the predicted label of the k-th decision tree for the M-th data point; 1 represents the indicator function, if , the result is 1, otherwise it is 0.
[0017] As some optional implementation modes of the present application, when comparing the environmental assessment value with the first threshold, if the environmental assessment value is less than or equal to the first threshold, a first level warning information is generated; the first level warning information is used to characterize that the target pig population is in an unsuitable environment; if the environmental assessment value is greater than the first threshold, the environmental assessment value is compared with the second threshold; if the environmental assessment value is greater than the first threshold and less than or equal to the second threshold, a second level warning information is generated; the second level warning information is used to characterize that the target pig population is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold, a third level warning information is generated; the third level warning information is used to characterize that the target pig population is in a suitable environment; after the first threshold is less than the second threshold, it also includes:
[0018] The warning information is sent to a user end so that the user can adjust the environmental parameters of the target pig group based on the warning information.
[0019] As some optional embodiments of the present application, obtaining the health value of the corresponding individual pig based on the physiological parameters and the behavioral parameters includes:
[0020] Based on the physiological parameters and the behavioral parameters, feature extraction is performed to obtain the average physiological parameters and the average behavioral parameters of the current day; the average physiological parameters include the individual pig identification number and the average temperature data, the average heart rate data and the average respiratory rate data; the average behavioral parameters include the individual pig identification number and the average exercise data, the average eating data and the average sleep data;
[0021] The average values of the physiological parameters and the average values of the behavioral parameters of the current day are input into the trained health scoring model to obtain the health value of the corresponding individual pig; the health scoring model is trained based on the average values of the physiological parameters and the average values of the behavioral parameters of the historical days.
[0022] The health scoring model is optimized using the following function: Where n is the number of samples; C is the number of categories; y i,c represents the actual category indicator variable of sample i. If the actual category indicator variable of sample i is c, then y i,c =1, otherwise 0; Represents the model's predicted probability that sample i belongs to category c.
[0023] As some optional implementation modes of the present application, the warning information includes the environmental parameter information and stocking density information, as well as recommended adjustment measures and warning level values.
[0024] On the other hand, the embodiment of the present application further provides: a pig disease early warning system, comprising:
[0025] Parameter monitoring equipment, used to monitor environmental parameters in the breeding grounds of the target pig group and generate parameter information of the breeding grounds of the target pig group;
[0026] Image acquisition equipment is used to monitor the number of all pigs in the breeding site of the target pig group and generate stocking density information;
[0027] Pathogen monitoring equipment is used to monitor pathogens in the breeding facilities of target pig groups and generate pathogen monitoring information;
[0028] A big data analysis device for obtaining physiological parameters and behavioral parameters of each individual pig in a target pig group; the physiological parameters and behavioral parameters are obtained based on the individual pig monitoring device; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement status data, eating data and sleep data; based on the physiological parameters and the behavioral parameters, the health value of the corresponding individual pig is obtained; based on the health values of all individual pigs in the target pig group, it is determined whether the number of individual pigs with health abnormalities exceeds a preset health abnormality threshold; if the number of individual pigs with health abnormalities exceeds the preset threshold, the pathogen monitoring data of the target pig group is obtained; the pathogen monitoring data is obtained based on the pathogen monitoring device; it is determined whether the pathogen monitoring data exceeds the preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, a disease warning message is issued to the breeder; if the pathogen monitoring data does not exceed the preset pathogen threshold , then obtain the environmental monitoring data of the target pig group; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; input the environmental monitoring data into a preset environmental assessment model to obtain the environmental assessment value output by the preset environmental assessment model; compare the environmental assessment value with a first threshold, if the environmental assessment value is less than or equal to the first threshold, generate a first level warning information; the first level warning information is used to characterize that the target pig group is in an unsuitable environment; if the environmental assessment value is greater than the first threshold, compare the environmental assessment value with a second threshold; if the environmental assessment value is greater than the first threshold and less than or equal to the second threshold, generate a second level warning information; the second level warning information is used to characterize that the target pig group is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold, generate a third level warning information; the third level warning information is used to characterize that the target pig group is in a suitable environment; the first threshold is less than the second threshold.
[0029] As some optional implementations of the present application, the big data analysis device includes:
[0030] An individual pig analysis module is used to obtain physiological parameters and behavioral parameters of each individual pig in the target pig group; the physiological parameters and the behavioral parameters are obtained based on the individual pig monitoring device; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement state data, eating data and sleep data; based on the physiological parameters and the behavioral parameters, the health value of the corresponding individual pig is obtained;
[0031] The pathogen analysis module is used to determine whether the number of individual pigs with abnormal health exceeds a preset abnormal health threshold based on the health values of all individual pigs in the target pig group; if the number of individual pigs with abnormal health exceeds the preset threshold, the pathogen monitoring data of the target pig group is obtained; the pathogen monitoring data is obtained based on the pathogen monitoring device; determine whether the pathogen monitoring data exceeds the preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, send disease warning information to the breeder;
[0032] An environmental analysis module is used to obtain environmental monitoring data of a target pig population if the pathogen monitoring data does not exceed a preset pathogen threshold; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; the environmental monitoring data is input into a preset environmental assessment model to obtain an environmental assessment value output by the preset environmental assessment model; the environmental assessment value is compared with a first threshold, and if the environmental assessment value is less than or equal to the first threshold, a first-level warning information is generated; the first-level warning information is used to characterize that the target pig population is in an unsuitable environment; if the environmental assessment value is greater than the first threshold, the environmental assessment value is compared with a second threshold; if the environmental assessment value is greater than the first threshold and less than or equal to the second threshold, a second-level warning information is generated; the second-level warning information is used to characterize that the target pig population is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold, a third-level warning information is generated; the third-level warning information is used to characterize that the target pig population is in a suitable environment; the first threshold is less than the second threshold.
[0033] As some optional embodiments of the present application, the stocking density data is obtained based on an image acquisition device through the following steps:
[0034] Based on a preset shooting frequency, images of the target pig group are collected to obtain an image set of the target pig group;
[0035] Performing denoising and parameter adjustment on the target pig group image set to improve image quality;
[0036] After using threshold segmentation or edge detection to identify individual pigs in the image, the individual pigs in the image are counted based on the object recognition algorithm to obtain the target number of pigs;
[0037] The stocking density is calculated based on the number of pigs and the area of the breeding facility for the target pig group.
[0038] On the other hand, an embodiment of the present application provides: a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above method.
[0039] Compared with the prior art, the pig disease early warning method provided in this application collects the pig's body temperature, heart rate, respiratory rate (physiological parameters) and movement status, eating and sleeping data (behavioral parameters) through special monitoring equipment. This monitoring method can track the health status of each pig in real time and detect any abnormal changes in time. Based on the collected physiological and behavioral data, the health value of each individual is calculated. This health value is a quantitative assessment of the health status of the pig, which can be used to preliminarily determine whether there are health problems. The health values of all pigs are summarized to determine whether the number of individuals with abnormal health in the entire group exceeds the preset health abnormality threshold. If exceeded, the pathogen monitoring data is further checked; if not exceeded, the environmental factors are examined. Based on the pathogen monitoring results and environmental monitoring data (such as temperature and humidity, light intensity, harmful gas concentration, etc.), the possible causes of health abnormalities are further identified. This includes assessing whether the environment poses a threat to the health of pigs and whether the feeding conditions need to be adjusted. Different levels of early warning information are generated based on the output of the environmental assessment model. This information will be graded according to severity to help breeders take corresponding preventive or intervention measures.
[0040] Compared with the existing technology, this pig disease early warning method provides the following technical advances and advantages: by real-time monitoring of multiple physiological and behavioral parameters of individuals, it is possible to more comprehensively understand the health status of pigs, detect abnormalities in time, and respond quickly. By calculating the health value through data analysis, quantitative health information can be provided to help breeders more accurately judge the health status of pigs. By setting different health abnormality thresholds and environmental thresholds, the system can flexibly adjust the early warning level and adopt different response strategies according to actual conditions. In addition to considering the health data of the pigs themselves, it also combines environmental factors and pathogen data to provide a more comprehensive health management solution. The multi-level early warning system ensures that health risks at different levels can be responded to in a timely and appropriate manner, thereby minimizing the outbreak and spread of diseases. That is, the technical solution described in this application provides a highly automated and intelligent solution for the health management of pig groups by integrating the health data of individuals and groups and environmental influencing factors, which significantly improves the efficiency and accuracy of pig health management. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation of the present application or the technical solution in the prior art, the following is a brief introduction to the drawings required for the specific implementation or the prior art description. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, each element or part is not necessarily drawn according to the actual scale.
[0042] Figure 1 This is a schematic diagram of the structure of a pig disease early warning system involved in this application;
[0043] Figure 2 This is a schematic diagram of the structure of a big data analysis device involved in this application;
[0044] Figure 3 A schematic diagram of a process for early warning of pig diseases involved in this application;
[0045] Figure 4 It is a logical diagram of step S30 involved in this application.
[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] To solve the technical problem that the existing technology has low early warning efficiency for pig group diseases, such as Figure 1 As shown, the embodiment of the present application provides a pig disease early warning system, comprising:
[0049] Parameter monitoring equipment, used to monitor environmental parameters in the breeding grounds of the target pig group and generate parameter information of the breeding grounds of the target pig group;
[0050] Image acquisition equipment is used to monitor the number of all pigs in the breeding site of the target pig group and generate stocking density information;
[0051] Pathogen monitoring equipment is used to monitor pathogens in the breeding facilities of target pig groups and generate pathogen monitoring information;
[0052] A big data analysis device, used to obtain the physiological parameters and behavioral parameters of each individual pig in the target pig group; the physiological parameters and the behavioral parameters are obtained based on the individual pig monitoring device; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement status data, eating data and sleep data; based on the physiological parameters and the behavioral parameters, the health value of the corresponding individual pig is obtained; based on the health values of all individual pigs in the target pig group, it is judged whether the number of individual pigs with health abnormalities exceeds the preset health abnormality threshold; if the number of individual pigs with health abnormalities exceeds the preset threshold, the pathogen monitoring data of the target pig group is obtained; the pathogen monitoring data is obtained based on the pathogen monitoring device; it is judged whether the pathogen monitoring data exceeds the preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, a disease warning information is issued to the breeder; if the pathogen monitoring data does not exceed the preset pathogen threshold value, then obtain the environmental monitoring data of the target pig group; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; input the environmental monitoring data into a preset environmental assessment model to obtain the environmental assessment value output by the preset environmental assessment model; compare the environmental assessment value with a first threshold value, and if the environmental assessment value is less than or equal to the first threshold value, generate a first-level warning information; the first-level warning information is used to characterize that the target pig group is in an unhealthy state; if the environmental assessment value is greater than the first threshold value, compare the environmental assessment value with a second threshold value; if the environmental assessment value is greater than the first threshold value and less than or equal to the second threshold value, generate a second-level warning information; the second-level warning information is used to characterize that the target pig group has potential health risks; if the environmental assessment value is greater than the second threshold value, generate a third-level warning information; the third-level warning information is used to characterize that the target pig group is in good condition; the first threshold value is less than the second threshold value.
[0053] Specifically, Figure 2 As shown, the big data analysis device includes:
[0054] An individual pig analysis module is used to obtain physiological parameters and behavioral parameters of each individual pig in the target pig group; the physiological parameters and the behavioral parameters are obtained based on the individual pig monitoring device; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement state data, eating data and sleep data; based on the physiological parameters and the behavioral parameters, the health value of the corresponding individual pig is obtained;
[0055] The pathogen analysis module is used to determine whether the number of individual pigs with abnormal health exceeds a preset abnormal health threshold based on the health values of all individual pigs in the target pig group; if the number of individual pigs with abnormal health exceeds the preset threshold, the pathogen monitoring data of the target pig group is obtained; the pathogen monitoring data is obtained based on the pathogen monitoring device; determine whether the pathogen monitoring data exceeds the preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, send disease warning information to the breeder;
[0056] An environmental analysis module is used to obtain environmental monitoring data of a target pig population if the pathogen monitoring data does not exceed a preset pathogen threshold; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; the environmental monitoring data is input into a preset environmental assessment model to obtain an environmental assessment value output by the preset environmental assessment model; the environmental assessment value is compared with a first threshold, and if the environmental assessment value is less than or equal to the first threshold, a first-level warning information is generated; the first-level warning information is used to characterize that the target pig population is in an unhealthy state; if the environmental assessment value is greater than the first threshold, the environmental assessment value is compared with a second threshold; if the environmental assessment value is greater than the first threshold and less than or equal to the second threshold, a second-level warning information is generated; the second-level warning information is used to characterize that there is a potential health risk in the target pig population; if the environmental assessment value is greater than the second threshold, a third-level warning information is generated; the third-level warning information is used to characterize that the target pig population is in good condition; the first threshold is less than the second threshold.
[0057] Specifically, the stocking density data is obtained based on an image acquisition device through the following steps:
[0058] Based on a preset shooting frequency, images of the target pig group are collected to obtain an image set of the target pig group;
[0059] Performing denoising and parameter adjustment on the target pig group image set to improve image quality;
[0060] After using threshold segmentation or edge detection to identify individual pigs in the image, the individual pigs in the image are counted based on the object recognition algorithm to obtain the target number of pigs;
[0061] The stocking density is calculated based on the number of pigs and the area of the breeding facility for the target pig group.
[0062] Based on the above pig disease early warning system, the present application embodiment also provides a pig disease early warning method, such as Figure 3 As shown, the following steps are included:
[0063] Step S10, obtaining the physiological parameters and behavioral parameters of each individual pig in the target pig group; the physiological parameters and the behavioral parameters are obtained based on the individual pig monitoring equipment; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement status data, eating data and sleep data; based on the physiological parameters and the behavioral parameters, the health value of the corresponding individual pig is obtained.
[0064] Specifically, obtaining the health value of the corresponding individual pig based on the physiological parameter and the behavioral parameter includes:
[0065] Based on the physiological parameters and the behavioral parameters, feature extraction is performed to obtain the average physiological parameters and the average behavioral parameters of the current day; the average physiological parameters include the individual pig identification number and the average temperature data, the average heart rate data and the average respiratory rate data; the average behavioral parameters include the individual pig identification number and the average exercise data, the average eating data and the average sleep data;
[0066] Inputting the average values of the physiological parameters and the behavioral parameters of the current day into the trained health scoring model to obtain the health value of the corresponding individual pig; the health scoring model is obtained by training based on the average values of the physiological parameters and the behavioral parameters of the historical days;
[0067] The health scoring model is constructed using gradient boosting algorithms such as XGBoost, LightGBM or CatBoost, and is optimized by the following function expression: Where n is the number of samples; C is the number of categories; y i,c represents the actual category indicator variable of sample i. If the actual category indicator variable of sample i is c, then y i,c =1, otherwise 0; Represents the model's predicted probability that sample i belongs to category c.
[0068] In one embodiment, a health score model is constructed using XGBoost and optimized using a cross entropy loss function:
[0069] Step 1) Data collection: Obtain the following data from the monitoring equipment, as shown in Table 1:
[0070] Physiological parameters: body temperature, heart rate, respiratory rate;
[0071] Behavioral parameters: movement status, eating data, sleep data;
[0072] Table 1: Data collection form
[0073] Individual ID body temperature Heart rate Respiratory rate Movement status Eating data Sleep data 1 38.5 75 18 high normal normal 2 39.2 80 20 middle Small amount reduce ... ... ... ... ... ... ...
[0074] Step 2) Data preprocessing:
[0075] Calculate daily average values: Calculate the average values of daily physiological parameters and behavioral parameters of each pig, as shown in Table 2:
[0076] Table 2: Data preprocessing results
[0077] Individual ID body temperature Heart rate Respiratory rate Movement status Eating data Sleep data 1 38.5 75 18 high normal normal 2 39.0 78 19 middle Small amount reduce ... ... ... ... ... ... ...
[0078] Feature Engineering: Standardizing or normalizing data to convert categorical data (e.g., motion state, high, medium, low) into numerical form (e.g., high = 2, medium = 1, low = 0).
[0079] Model Training
[0080] Choose an algorithm: Use XGBoost as an example.
[0081] Training data preparation: Divide the processed data into training set and validation set.
[0082] import xgboost as xgb
[0083] from sklearn.model_selection import train_test_split
[0084] # Features and labels
[0085] X = data[['Average body temperature', 'Average heart rate', 'Average breathing rate', 'Average exercise status', 'Average eating data', 'Average sleeping data']]
[0086] y = data['health status'] # Health status labels are converted to numerical values (e.g. healthy = 0, slightly unwell = 1, severely unwell = 2)
[0087] # Split data
[0088] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
[0089] Model initialization and training:
[0090] # Initialize the XGBoost classifier
[0091] model = xgb.XGBClassifier(objective='multi:softprob', num_class=3,eval_metric='mlogloss')
[0092] # Train the model
[0093] model.fit(X_train, y_train)
[0094] Step 3) Model optimization:
[0095] Suppose there is a pig health scoring model, whose goal is to classify the health status of each pig into three states:
[0096] Category 0: healthy; Category 1: slightly unwell; Category 2: seriously unwell.
[0097] The actual category of the pig with identification number Pig001 is 0, and the probability of the healthy category predicted by the model is [0.8, 0.15, 0.05]; the actual category of the pig with identification number Pig002 is 1, and the probability of the healthy category predicted by the model is [0.1, 0.7, 0.2]; the actual category of the pig with identification number Pig003 is 3, and the probability of the healthy category predicted by the model is [0.2, 0.3, 0.5].
[0098] Calculate the cross entropy loss value for each sample:
[0099] Pig001:
[0100] Pig002:
[0101] Pig003:
[0102] Calculate the overall cross entropy loss value:
[0103] By calculating the cross entropy loss, we can evaluate the predictive performance of the model. If the loss value is high, it means that the gap between the model's predicted probability and the actual category is large. The process of optimizing the model involves adjusting the model parameters (for example, through the gradient descent algorithm) to minimize the loss value, thereby improving the classification accuracy of the model.
[0104] Using cross entropy loss in the health scoring model can effectively measure the performance of the model in classifying health status. By optimizing the cross entropy loss, we can improve the model's prediction accuracy for the health status of individual pigs, thereby better managing and maintaining the health of the pig herd.
[0105] Cross entropy loss is used to measure the gap between the probability distribution predicted by the model and the actual category. During the training process, by minimizing the cross entropy loss, the model's predicted probability will become closer and closer to the probability distribution of the actual category, thereby improving the model's classification accuracy.
[0106] Step S20: based on the health values of all individual pigs in the target pig group, determine whether the number of individual pigs with health abnormalities exceeds the preset health abnormality threshold; if the number of individual pigs with health abnormalities exceeds the preset threshold, obtain the pathogen monitoring data of the target pig group; the pathogen monitoring data is obtained based on the pathogen monitoring equipment; determine whether the pathogen monitoring data exceeds the preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, send disease warning information to the breeder.
[0107] Here is a sample code written in Python that shows how to implement this technique:
[0108] class AnimalHealthMonitor:
[0109] def __init__(self, health_threshold, pathogen_threshold):
[0110] self.health_threshold = health_threshold # Health abnormality threshold
[0111] self.pathogen_threshold = pathogen_threshold # pathogen threshold
[0112] def check_health(self, health_values):
[0113] """
[0114] Check whether the number of individuals with abnormal health in the target pig population exceeds the preset abnormal health threshold.
[0115] :param health_values: List of health values of all individuals in the target pig group
[0116] :return: Whether the health abnormality threshold is exceeded
[0117] """
[0118] abnormal_count = sum(1 for value in health_values if value < 0.5) # Assume 0.5 is the health value threshold
[0119] if abnormal_count > self.health_threshold:
[0120] return True
[0121] return False
[0122] def get_pathogen_data(self):
[0123] """
[0124] Obtain pathogen surveillance data for target swine populations.
[0125] :return: Pathogen monitoring data (here assumed to be a simulated value)
[0126] """
[0127] # In actual implementation, data should be read from pathogen monitoring devices
[0128] # Simulated data example
[0129] import random
[0130] return random.uniform(0, 1) # Assume that pathogen data is between 0 and 1
[0131] def check_pathogen(self, pathogen_data):
[0132] """
[0133] Determine whether the pathogen monitoring data exceeds the preset pathogen threshold.
[0134] :param pathogen_data: Pathogen monitoring data
[0135] :return: Whether the pathogen threshold is exceeded
[0136] """
[0137] if pathogen_data > self.pathogen_threshold:
[0138] return True
[0139] return False
[0140] def send_alert(self):
[0141] """
[0142] A first-level warning message is sent to the breeder.
[0143] """
[0144] print("Level 1 warning: The target pig herd is in poor health and pathogen monitoring data exceeds the threshold!")
[0145] def monitor(self, health_values):
[0146] """
[0147] Implement health monitoring and early warning logic.
[0148] :param health_values: List of health values of all individuals in the target pig group
[0149] """
[0150] if self.check_health(health_values):
[0151] pathogen_data = self.get_pathogen_data()
[0152] if self.check_pathogen(pathogen_data):
[0153] self.send_alert()
[0154] # Example usage
[0155] if __name__ == "__main__":
[0156] # Set the threshold
[0157] health_threshold = 5 # Assume that more than 5 pigs have abnormal health and need to be checked for pathogens
[0158] pathogen_threshold = 0.7 # Assume that the pathogen data exceeds 0.7 and an alarm is issued
[0159] # Create monitoring object
[0160] monitor = AnimalHealthMonitor(health_threshold, pathogen_threshold)
[0161] # Sample health value data
[0162] health_values = [0.4, 0.6, 0.3, 0.7, 0.2, 0.5, 0.4, 0.3, 0.9,0.1] # Example data
[0163] # Execution monitoring
[0164] monitor.monitor(health_values)
[0165] Code Explanation:
[0166] 1. Class AnimalHealthMonitor:
[0167] init: Initialize the threshold.
[0168] check_health: Determines whether the number of individuals with abnormal health exceeds the preset threshold. Here, it is assumed that a health value below 0.5 is considered abnormal.
[0169] get_pathogen_data: simulates obtaining pathogen monitoring data. In actual applications, it should be replaced with the logic of obtaining data from monitoring equipment.
[0170] check_pathogen: Determines whether the pathogen data exceeds the preset threshold.
[0171] send_alert: Sends warning information to the breeder.
[0172] monitor: Comprehensively check health values and pathogen data and issue early warnings.
[0173] That is, set the threshold and create an AnimalHealthMonitor instance, provide health value data and perform monitoring.
[0174] In actual applications, it is necessary to access the interface of pathogen monitoring equipment to obtain real data, and the processing and threshold settings of health values and pathogen data should be adjusted according to actual conditions.
[0175] This code is a basic example. Actual applications may require more complex logic and data processing.
[0176] Below, we take a specific example to illustrate how to implement each step:
[0177] Collect health value data: The health value of each individual in the target pig group needs to be obtained through sensors or recording systems. The health value can be body temperature, heart rate or other physiological indicators.
[0178] Determine health abnormalities: Define the criteria for health abnormalities (such as body temperature above 38.5°C or below 36.0°C). Count the number of individuals with health abnormalities and compare them with the preset health abnormality threshold.
[0179] Obtain pathogen monitoring data: When the number of abnormal individuals exceeds the threshold, data (such as pathogen concentration or infection rate) is automatically obtained from the pathogen monitoring device.
[0180] Judging pathogen data: Setting thresholds for pathogen data; comparing data obtained from monitoring equipment with the thresholds.
[0181] Send early warning information: If pathogen data exceeds the threshold, an alert is sent to the breeder via SMS, email or app.
[0182] For example, there is a farm where the goal is to monitor the health status of the pig herd.
[0183] Collect health value data: obtain the body temperature data of each pig through the body temperature sensor.
[0184] Set abnormal body temperature standards: body temperature > 39.5℃ is considered abnormal.
[0185] If the body temperature of 10 pigs exceeds 39.5℃ and the set abnormal health threshold is 5, further inspection will be triggered.
[0186] Get pathogen monitoring data: Use pathogen monitoring equipment (such as air quality monitors) to obtain pathogen concentration data for the pig house. Assume that the concentration value returned by the data is 0.8 (concentration unit is CFU / m³). Set the pathogen concentration threshold to 0.7 CFU / m³. Compare the obtained concentration value of 0.8 with the threshold of 0.7 and find that it exceeds the threshold. Send a message to the breeder through the system: "Alert: The health of the pig herd is abnormal, and the pathogen concentration exceeds the threshold. Please check and take action immediately!"
[0187] Python sample code
[0188] class AnimalHealthMonitor:
[0189] def __init__(self, health_threshold, pathogen_threshold):
[0190] self.health_threshold = health_threshold
[0191] self.pathogen_threshold = pathogen_threshold
[0192] def check_health(self, health_values):
[0193] abnormal_count = sum(1 for value in health_values if value > 39.5) # The abnormal temperature threshold is set to 39.5°C
[0194] return abnormal_count > self.health_threshold
[0195] def get_pathogen_data(self):
[0196] import random
[0197] return random.uniform(0.5, 1.0) # Simulate pathogen concentration data
[0198] def check_pathogen(self, pathogen_data):
[0199] return pathogen_data > self.pathogen_threshold
[0200] def send_alert(self):
[0201] print("Level 1 warning: The health of the pig herd is abnormal, and the pathogen concentration exceeds the threshold! Please check and take measures immediately.")
[0202] def monitor(self, health_values):
[0203] if self.check_health(health_values):
[0204] pathogen_data = self.get_pathogen_data()
[0205] if self.check_pathogen(pathogen_data):
[0206] self.send_alert()
[0207] # Example usage
[0208] if __name__ == "__main__":
[0209] health_threshold = 5 # Health abnormality threshold
[0210] pathogen_threshold = 0.7 # pathogen concentration threshold
[0211] monitor = AnimalHealthMonitor(health_threshold, pathogen_threshold)
[0212] health_values = [39.6, 39.7, 39.5, 39.8, 39.9, 39.4, 39.6, 39.7,39.8, 39.9] # Example body temperature data
[0213] monitor.monitor(health_values)
[0214] By following these steps and examples, it is possible to effectively implement a monitoring system and take timely action when the health of the pig herd is abnormal.
[0215] Step S30: If the pathogen monitoring data does not exceed the preset pathogen threshold, then obtain the environmental monitoring data of the target pig population; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; input the environmental monitoring data into a preset environmental assessment model to obtain the environmental assessment value output by the preset environmental assessment model; Figure 4As shown, the environmental assessment value is compared with a first threshold value. If the environmental assessment value is less than or equal to the first threshold value, a first level warning information is generated; the first level warning information is used to characterize that the target pig group is in an unhealthy state; if the environmental assessment value is greater than the first threshold value, the environmental assessment value is compared with a second threshold value; if the environmental assessment value is greater than the first threshold value and less than or equal to the second threshold value, a second level warning information is generated; the second level warning information is used to characterize that there is a potential health risk in the target pig group; if the environmental assessment value is greater than the second threshold value, a third level warning information is generated; the third level warning information is used to characterize that the target pig group is in good condition; the first threshold value is less than the second threshold value.
[0216] In some embodiments, before inputting the environmental monitoring data into a preset environmental assessment model to obtain the environmental assessment value output by the preset environmental assessment model, the process further includes:
[0217] The temperature and humidity data, the light intensity data, the harmful gas concentration data and the stocking density data are subjected to data format standardization processing, and the data in each information after the data format standardization processing is subjected to data extraction processing, data conversion processing and data cleaning processing based on ETL data integration technology, and loaded into a target data storage library;
[0218] Use UTC time as the benchmark and ensure that all data sources are recorded in the same timestamp format; use the Network Time Protocol to synchronize the clocks of all data sources, and sort or adjust all data by timestamp before data integration to ensure the timing correctness of the data;
[0219] If there is a timing inconsistency due to data collection or transmission delays, use interpolation technology or time window method to process it to ensure the continuity and integrity of the data in the time dimension.
[0220] In some embodiments, each data point should contain a timestamp indicating the exact time when the data was collected. For example, the temperature sensor may record data once a minute, and each data collection has a timestamp recording the time of the data. Based on the above timestamp, the data is synchronized according to the following steps:
[0221] Timestamp alignment: Align all data based on timestamps. Even if the timestamps of different data sources are slightly offset, they need to be aligned to the same time point through interpolation or alignment technology.
[0222] Interpolation processing: For some data sources that may not have data collected at a certain point in time, interpolation methods can be used to fill in blank data to ensure continuity and consistency in time.
[0223] Data merging: Merge the synchronized data into the same dataset. This dataset should contain timestamps and corresponding parameter information, stocking density information, and pathogen monitoring information.
[0224] After the data is merged, data standardization is required to ensure the comparability and consistency between different types of data. Data standardization usually includes the following steps:
[0225] Numerical normalization: Normalize all data to the same numerical range. For example, normalize parameter data such as temperature and humidity to the range of 0 to 1 so that they have similar importance and weight.
[0226] Standardization: Data of different magnitudes or units can be standardized. For example, a standardization method (such as Z-score standardization) can be used to make the mean of all data 0 and the variance 1, thereby eliminating the dimensional influence of the data.
[0227] In a specific embodiment, assume that the following data needs to be processed: the temperature data range is between 20°C and 30°C; the humidity data range is between 40% and 80%; the stocking density information is an integer value, such as the number of individual pigs per square meter; the pathogen monitoring information is a concentration value, such as the number of pathogens in each cubic meter of air.
[0228] Data standardization steps:
[0229] For temperature and humidity data, you can normalize them to the range of 0 to 1, for example:
[0230] Temperature standardization formula: Standardized temperature = (measured temperature value - 20) / 10;
[0231] Humidity standardization formula: Standardized humidity = (measured humidity value - 40) / 40;
[0232] For the stocking density information, since it is an integer value, the normalization method can be used directly, such as dividing it by the total area of the breeding site of the target pig group to obtain the number of individual pigs per square meter.
[0233] For pathogen monitoring information, since it is usually a concentration value, a standardization method, such as Z-score standardization, can be used to ensure that all pathogen monitoring data are compared in the same dimension.
[0234] It can be seen that through the synchronization of timestamps and the standardization of data, environmental data, individual pig distribution data and health monitoring data from different sources can be integrated into a unified data set. Such data processing and standardization process provides consistent and comparable data for the subsequent health assessment model, so that the health status of the target pig group breeding site can be accurately assessed. That is, the parameter information, stocking density information and pathogen monitoring information are merged into the same data set, and the data is synchronized based on the timestamp, including: the parameter information, stocking density information and pathogen monitoring information are standardized in data format, and the data in each information after the data format standardization is extracted, converted and cleaned based on ETL data integration technology, and loaded into the target data repository; UTC time is used as the benchmark, and all data sources are ensured to be recorded in the same timestamp format; the network time protocol is used to synchronize the clocks of all data sources, and all data are sorted or adjusted according to the timestamp before data integration to ensure the time sequence correctness of the data; if the time sequence is inconsistent due to data collection or transmission delay, interpolation technology or time window method is used to process to ensure the continuity and integrity of the data in the time dimension.
[0235] Specifically, each internal node of the preset environmental assessment model represents a test on an attribute, each branch represents a result of the test, and each leaf node represents a class label; each class label is summarized and analyzed to generate an environmental assessment value.
[0236] The preset environmental assessment model can be obtained by training based on the following steps:
[0237] 1) Data preparation and merging: Merge parameter information, stocking density information, and pathogen monitoring information into a unified data set and synchronize the timestamps. Assume the following data: Parameter information: including temperature, humidity, ammonia concentration, carbon dioxide concentration, etc. Stocking density information: the number of individual pigs in each area. Pathogen monitoring information: the concentration of various pathogens in the air. These data have their own timestamps when they are collected. They need to be aligned according to the timestamps and merged into the same data set.
[0238] 2) Data preprocessing: Check and process any missing data points, use interpolation methods or delete missing data points to ensure the integrity and availability of the data. Standardize or normalize each feature to ensure that they are in the same numerical range.
[0239] 3) Training of preset environmental assessment models:
[0240] Randomly select a data subset: Randomly select a subset from the merged data set, which may contain some parameter information, stocking density information, and pathogen monitoring information.
[0241] A preset environmental assessment model is constructed, wherein the objective function expression of the preset environmental assessment model is: in, represents the model parameters, N represents the total number of data points, K represents the number of decision trees in the random forest, represents the weight value of the kth decision tree, represents the true label of the Mth data point, represents the predicted label of the k-th decision tree for the M-th data point; 1 represents the indicator function, if , the result is 1, otherwise it is 0.
[0242] Specifically, when comparing the environmental assessment value with the first threshold, if the environmental assessment value is less than or equal to the first threshold, a first level warning information is generated; the first level warning information is used to characterize that the target pig population is in an unhealthy state; if the environmental assessment value is greater than the first threshold, the environmental assessment value is compared with the second threshold; if the environmental assessment value is greater than the first threshold and less than or equal to the second threshold, a second level warning information is generated; the second level warning information is used to characterize that the target pig population has potential health risks; if the environmental assessment value is greater than the second threshold, a third level warning information is generated; the third level warning information is used to characterize that the target pig population is in good condition; after the first threshold is less than the second threshold, it also includes:
[0243] The warning information is sent to a user end so that the user can adjust the environmental parameters of the target pig group based on the warning information.
[0244] It should be noted that the warning information includes the parameter information, stocking density information and pathogen monitoring information, recommended adjustment measures and warning level value.
[0245] It should be noted that the temperature and humidity sensors are installed in the center and corners of the pig house, and are all installed about 1.5 meters from the ground, so as to obtain the representative temperature of the individual pig activity area; the light intensity sensor is installed at the light source of the pig house or at the same installation position as the temperature sensor; the harmful gas concentration sensor is installed at the vents and corners of the pig house; the image acquisition module is installed on the ceiling or wall of the pig house to ensure that the individual pig activity area can be fully covered; the pathogen monitoring module is installed in the ventilation system of the pig house or in a place with good air circulation to ensure that air samples can be effectively collected for pathogen detection.
[0246] The purpose of setting the temperature and humidity sensor is to monitor the temperature and humidity in the pig house in real time, ensure that the environmental temperature and humidity are suitable for the growth of individual pigs, prevent overheating or overcooling, and prevent diseases and mold growth caused by excessive humidity; the purpose of setting the light intensity sensor is to measure the light intensity, ensure that the lighting conditions meet the growth needs of individual pigs, and avoid the impact of excessive or weak light on individual pigs; the purpose of setting the image acquisition module is to capture the image of individual pigs in real time, monitor the behavior and health status of individual pigs, and analyze stocking density and health problems through image processing technology; the purpose of setting the pathogen monitoring module is to monitor the concentration of pathogens in the air in real time, such as bacteria, viruses and fungi, so as to timely detect potential disease outbreaks and take prevention and control measures.
[0247] It should be noted that the following harmful gas concentrations need to be collected in the target pig breeding sites:
[0248] Ammonia (NH3): Produced by the decomposition of pig manure and urine, it is irritating to the respiratory system of individual pigs.
[0249] Hydrogen sulfide (H2S): Produced by the decomposition of organic matter, it can cause serious harm to the health of individual pigs.
[0250] Carbon dioxide (CO2): At high concentrations, it can affect the breathing and health of individual pigs.
[0251] Methane (CH4): While not directly harmful, high concentrations can cause environmental issues and facility risks.
[0252] When monitoring pathogens, pathogens of common concern include:
[0253] Bacteria: Swine flu (H1N1), Escherichia coli (E. coli), Erysipelothrixrhusiopathiae.
[0254] Viruses: Classical swine fever virus (CSFV), African swine fever virus (ASFV), porcine coronavirus (PEDV).
[0255] Fungi: Aspergillus, Fusarium.
[0256] Parasites: Toxoplasma, round worms (Ascaris suum).
[0257] In actual application scenarios, the parameter monitoring module, the image acquisition module and the pathogen monitoring module can collect data based on a preset periodic data collection cycle, such as the collection cycle of temperature, humidity, light intensity, and harmful gas concentration is automatically recorded every hour; the stocking density information is automatically recorded every day through the image acquisition device and infrared sensing module; the pathogen monitoring information is tested once a week to record the type and quantity of pathogens. It can also be collected based on the collection instructions issued by the big data analysis module, which can be set based on actual needs.
[0258] The parameter information, the stocking density information and the pathogen monitoring information may be sent to the cloud database or the local server at the same time as being sent to the big data analysis module to avoid data loss, but data tampering should be avoided during the sending process.
[0259] In some embodiments, the technical solution of the present application can be implemented by Python, that is:
[0260] import numpy as np
[0261] import pandas as pd
[0262] # Assume there is a data set containing the physiological and behavioral parameters of pigs
[0263] data = pd.DataFrame({
[0264] 'AnimalID': ['A001', 'A002', 'A003', 'A004'],
[0265] 'BodyTemperature': [37.5, 38.0, 37.2, 39.1],
[0266] 'HeartRate': [60, 70, 65, 75],
[0267] 'RespirationRate': [30, 35, 28, 40],
[0268] 'ActivityLevel': [80, 60, 90, 70],
[0269] 'Feeding': [500, 450, 550, 480],
[0270] 'SleepingHours': [8, 7, 9, 6]
[0271] })
[0272] # Calculate health value (the example is simplified, the actual calculation may be more complicated)
[0273] def calculate_health_values(row):
[0274] # Here we simply use body temperature, heart rate and sleep data as the basis for health assessment
[0275] health_score = 100 - abs(37.5 - row['BodyTemperature']) - (row['HeartRate'] - 60) - abs(8 - row['SleepingHours'])
[0276] return health_score
[0277] # Add health value column
[0278] data['HealthValue'] = data.apply(calculate_health_values, axis=1)
[0279] # Assume threshold
[0280] HEALTH_THRESHOLD = 80
[0281] PATHOGEN_THRESHOLD = 1.5
[0282] ENVIRONMENTAL_FIRST_THRESHOLD = 2
[0283] ENVIRONMENTAL_SECOND_THRESHOLD = 5
[0284] # Determine the number of pigs with abnormal health
[0285] unhealthy_count = len(data[data['HealthValue'] < HEALTH_THRESHOLD])
[0286] # Assume pathogen monitoring data
[0287] pathogen_data = 2.0 # Simplified representation
[0288] # Early Warning System
[0289] if unhealthy_count > HEALTH_THRESHOLD:
[0290] if pathogen_data > PATHOGEN_THRESHOLD:
[0291] alert_level = "Level 1 Alert"
[0292] else:
[0293] # Environmental monitoring data
[0294] environmental_data = {'Temperature': 20, 'Humidity': 30, 'LightIntensity': 500, 'HarmfulGasLevel': 0.3}
[0295] # Simplified representation of environmental assessment model
[0296] environmental_score = environmental_data['Temperature'] +environmental_data['Humidity'] / 10 - environmental_data['LightIntensity'] / 100 + environmental_data['HarmfulGasLevel']
[0297] if environmental_score <= ENVIRONMENTAL_FIRST_THRESHOLD:
[0298] alert_level = "First level warning"
[0299] elif ENVIRONMENTAL_FIRST_THRESHOLD < environmental_score <= ENVIRONMENTAL_SECOND_THRESHOLD:
[0300] alert_level = "Second level warning"
[0301] else:
[0302] alert_level = "Third level warning"
[0303] else:
[0304] alert_level = "Environment is good, no warning"
[0305] print("Warning information:", alert_level)
[0306] Code Explanation:
[0307] Data simulation: First, a DataFrame containing pig IDs and their corresponding physiological and behavioral data was simulated.
[0308] Health value calculation: A function is defined to calculate the health value based on the given data.
[0309] Threshold judgment: Based on the calculated health value and the set threshold, determine whether further inspection of pathogen data or environmental data is required.
[0310] Early warning system: Generates different levels of early warning information based on pathogen data and environmental data.
[0311] This is just an example. The actual implementation may need to consider more details, such as real-time data acquisition, more complex health assessment algorithms, specific implementation details of the environmental assessment model, etc.
[0312] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.
[0313] In this application, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0314] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "and / or" appearing in the full text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme that satisfies both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0315] The embodiment of the present application also provides a computer device, which may include: a processor, such as a central processing unit (CPU), a communication bus, a user interface, a network interface, and a memory. Among them, the communication bus is used to realize the connection and communication between these components. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory may also be a storage device independent of the aforementioned processor.
[0316] In the computer device, the network interface is mainly used for data communication with the network server; the user interface is mainly used for data interaction with the user; the processor and memory in the computer device of this embodiment can be set in the computer device, and the computer device calls the pig disease early warning system stored in the memory through the processor, and executes the pig disease early warning method provided by this embodiment.
[0317] It should be noted that the above-mentioned computer device can be an external hardware device that can run independently, or it can be a hardware device that comes with the pig disease early warning system itself.
[0318] Based on the same inventive concept as the aforementioned embodiment, this embodiment provides a computer-readable storage medium, on which a computer program is stored, and a processor executes the computer program to implement the aforementioned method.
[0319] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.
[0320] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A pig disease early warning method, characterized in that: The following steps are involved: Obtain the physiological and behavioral parameters of each individual pig in the target pig group; The physiological parameters and the behavioral parameters are obtained based on the individual pig monitoring equipment; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement status data, eating data and sleep data; feature extraction is performed based on the physiological parameters and the behavioral parameters to obtain the average physiological parameter value and the average behavioral parameter value of the current day; the average physiological parameter value includes the individual pig identification number and its body temperature data average value, heart rate data average value and respiratory rate data average value; the average behavioral parameter value includes the individual pig identification number and its movement data average value, eating data average value and sleep data average value; the average physiological parameter value and the average behavioral parameter value of the current day are input into the trained health scoring model to obtain the health value of the corresponding individual pig; the health scoring model is obtained by training based on the average physiological parameter value and the average behavioral parameter value of the historical day; the health scoring model is optimized using the following function: Where n is the number of samples; C is the number of categories; y is i,c represents the actual category indicator variable of sample i. If the actual category indicator variable of sample i is c, then y i,c =1, otherwise 0; Represents the model's predicted probability that sample i belongs to category c; Based on the health values of all individual pigs in the target pig group, determine whether the number of individual pigs with health abnormalities exceeds a preset health abnormality threshold; if the number of individual pigs with health abnormalities exceeds the preset threshold, obtain pathogen monitoring data of the target pig group; the pathogen monitoring data is obtained based on the pathogen monitoring device; Determine whether the pathogen monitoring data exceeds a preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, send disease warning information to the breeder; If the pathogen monitoring data does not exceed the preset pathogen threshold, then obtain the environmental monitoring data of the target pig population; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; The temperature and humidity data, the light intensity data, the harmful gas concentration data and the stocking density data are processed by data format standardization, and the data in each information after data format standardization is extracted, converted and cleaned based on ETL data integration technology, and loaded into the target data repository; UTC time is used as a benchmark, and it is ensured that all data sources are recorded in the same timestamp format; the network time protocol is used to synchronize the clocks of all data sources, and before data integration, all data are sorted or adjusted according to timestamps to ensure the timing correctness of the data; if the timing is inconsistent due to data collection or transmission delays, interpolation technology or time window method is used to process it to ensure the continuity and integrity of the data in the time dimension; the environmental monitoring data is input into to a preset environmental assessment model, and obtain an environmental assessment value output by the preset environmental assessment model; compare the environmental assessment value with a first threshold value, and if the environmental assessment value is less than or equal to the first threshold value, generate a first level warning information; the first level warning information is used to characterize that the target pig population is in an unsuitable environment; if the environmental assessment value is greater than the first threshold value, compare the environmental assessment value with a second threshold value; if the environmental assessment value is greater than the first threshold value and less than or equal to the second threshold value, generate a second level warning information; the second level warning information is used to characterize that the target pig population is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold value, generate a third level warning information; the third level warning information is used to characterize that the target pig population is in a suitable environment; the first threshold value is less than the second threshold value; Each internal node of the preset environmental assessment model represents a test on an attribute, each branch represents the result of the test, and each leaf node represents a class label; various labels are summarized and analyzed to generate an environmental assessment value; The objective function expression of the preset environmental assessment model is: in, represents the model parameters, N represents the total number of data points, K represents the number of decision trees in the random forest, represents the weight value of the kth decision tree, represents the true label of the Mth data point, represents the predicted label of the k-th decision tree for the M-th data point; 1 represents the indicator function, if , the result is 1, otherwise it is 0.
2. The pig disease early warning method according to claim 1, characterized in that: In the step of comparing the environmental assessment value with a first threshold, if the environmental assessment value is less than or equal to the first threshold, generating a first level warning information; the first level warning information is used to indicate that the target pig population is in an unsuitable environment; if the environmental assessment value is greater than the first threshold, comparing the environmental assessment value with a second threshold; If the environmental assessment value is greater than the first threshold and less than or equal to the second threshold, a second level warning information is generated; The second level warning information is used to indicate that the target pig population is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold, a third level warning information is generated; The third level warning information is used to indicate that the target pig population is in a suitable environment; After the first threshold is less than the second threshold, the method further includes: The warning information is sent to a user end so that the user can adjust the environmental parameters of the target pig group based on the warning information.
3. The pig disease early warning method according to claim 1, characterized in that: The warning information includes environmental parameter information and stocking density information, as well as recommended adjustment measures and warning level values.
4. A pig disease early warning system, characterized in that: include: Parameter monitoring equipment, used to monitor environmental parameters in the breeding grounds of the target pig group and generate parameter information of the breeding grounds of the target pig group; Image acquisition equipment, used to monitor the number of all pigs in the breeding site of the target pig group and generate stocking density information; Pathogen monitoring equipment is used to monitor pathogens in the breeding facilities of target pig groups and generate pathogen monitoring information; Big data analysis equipment to obtain physiological and behavioral parameters of each individual pig in the target pig group; The physiological parameters and the behavioral parameters are obtained based on the individual pig monitoring equipment; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement status data, eating data and sleep data; feature extraction is performed based on the physiological parameters and the behavioral parameters to obtain the average physiological parameter value and the average behavioral parameter value of the current day; the average physiological parameter value includes the individual pig identification number and its body temperature data average value, heart rate data average value and respiratory rate data average value; the average behavioral parameter value includes the individual pig identification number and its movement data average value, eating data average value and sleep data average value; the average physiological parameter value and the average behavioral parameter value of the current day are input into the trained health scoring model to obtain the health value of the corresponding individual pig; the health scoring model is obtained by training based on the average physiological parameter value and the average behavioral parameter value of the historical day; the health scoring model is optimized using the following function: Where n is the number of samples; C is the number of categories; y is i,c represents the actual category indicator variable of sample i. If the actual category indicator variable of sample i is c, then y i,c =1, otherwise 0; Represents the model's predicted probability that sample i belongs to category c; based on the health values of all individual pigs in the target pig group, determine whether the number of individual pigs with health abnormalities exceeds the preset health abnormality threshold; if the number of individual pigs with health abnormalities exceeds the preset threshold, obtain the pathogen monitoring data of the target pig group; the pathogen monitoring data is obtained based on the pathogen monitoring device; determine whether the pathogen monitoring data exceeds the preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, issue disease warning information to the breeder; if the pathogen monitoring data does not exceed the preset pathogen threshold, obtain the environmental monitoring data of the target pig group; the environmental monitoring The data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; the temperature and humidity data, the light intensity data, the harmful gas concentration data and the stocking density data are standardized, and the data in each information after the data format standardization is extracted, converted and cleaned based on the ETL data integration technology, and loaded into the target data repository; UTC time is used as the benchmark, and it is ensured that all data sources are recorded in the same timestamp format; the network time protocol is used to synchronize the clocks of all data sources, and before data integration, all data are sorted or adjusted according to the timestamp to ensure Ensure the timing correctness of the data; if the timing inconsistency is caused by data collection or transmission delay, use interpolation technology or time window method to process it to ensure the continuity and integrity of the data in the time dimension; input the environmental monitoring data into a preset environmental assessment model to obtain the environmental assessment value output by the preset environmental assessment model; compare the environmental assessment value with the first threshold, and if the environmental assessment value is less than or equal to the first threshold, generate a first-level warning information; the first-level warning information is used to characterize that the target pig population is in an unsuitable environment; if the environmental assessment value is greater than the first threshold, compare the environmental assessment value with the second threshold; if the environmental assessment value is greater than the first threshold, compare the environmental assessment value with the second threshold; If the value is greater than the first threshold and less than or equal to the second threshold, a second-level warning information is generated; the second-level warning information is used to characterize that the target pig population is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold, a third-level warning information is generated; the third-level warning information is used to characterize that the target pig population is in a suitable environment; the first threshold is less than the second threshold; each internal node of the preset environmental assessment model represents a test on an attribute, each branch represents the result of the test, and each leaf node represents a class label; the various labels are summarized and analyzed to generate an environmental assessment value; the objective function expression of the preset environmental assessment model is: in, represents the model parameters, N represents the total number of data points, K represents the number of decision trees in the random forest, represents the weight value of the kth decision tree, represents the true label of the Mth data point, represents the predicted label of the k-th decision tree for the M-th data point; 1 represents the indicator function, if , the result is 1, otherwise it is 0.
5. The pig disease early warning system according to claim 4, characterized in that: The big data analysis device comprises: An individual pig analysis module is used to obtain the physiological parameters and behavioral parameters of each individual pig in the target pig group; the physiological parameters and the behavioral parameters are obtained based on the individual pig monitoring equipment; the physiological parameters include the individual pig identification number and its body temperature data, heart rate data and respiratory rate data; the behavioral parameters include the individual pig identification number and its movement state data, eating data and sleep data; feature extraction is performed based on the physiological parameters and the behavioral parameters to obtain the average physiological parameter value and the average behavioral parameter value of the current day; the average physiological parameter value includes the individual pig identification number and its body temperature data average value, heart rate data average value and respiratory rate data average value; the average behavioral parameter value includes the individual pig identification number and its movement data average value, eating data average value and sleep data average value; the average physiological parameter value and the average behavioral parameter value of the current day are input into the trained health scoring model to obtain the health value of the corresponding individual pig; the health scoring model is obtained by training based on the average physiological parameter value and the average behavioral parameter value of the historical day; the health scoring model is optimized using the following function: Where n is the number of samples; C is the number of categories; y is i,c represents the actual category indicator variable of sample i. If the actual category indicator variable of sample i is c, then y i,c =1, otherwise 0; Represents the model's predicted probability that sample i belongs to category c; a pathogen analysis module, used to determine whether the number of individual pigs with health abnormalities exceeds a preset health abnormality threshold based on the health values of all individual pigs in the target pig group; if the number of individual pigs with health abnormalities exceeds the preset threshold, the pathogen monitoring data of the target pig group is obtained; the pathogen monitoring data is obtained based on the pathogen monitoring device; determine whether the pathogen monitoring data exceeds the preset pathogen threshold; if the pathogen monitoring data exceeds the preset pathogen threshold, a disease warning message is issued to the breeder; The environmental analysis module is used to obtain the environmental monitoring data of the target pig group if the pathogen monitoring data does not exceed the preset pathogen threshold; the environmental monitoring data includes temperature and humidity data, light intensity data, harmful gas concentration data and stocking density data; the temperature and humidity data, the light intensity data, the harmful gas concentration data and the stocking density data are standardized, and based on the ETL data integration technology, the data in each information after the data format standardization is extracted, converted and cleaned, and loaded into the target data repository; UTC time is used as the benchmark, and it is ensured that all data sources are recorded in the same timestamp format; the network time protocol is used to synchronize the clocks of all data sources, and before data integration, all data are sorted or adjusted according to the timestamp to ensure the timing correctness of the data; if the timing inconsistency is caused by data collection or transmission delay, interpolation technology or time window method is used to process it to ensure the continuity and integrity of the data in the time dimension; the environmental monitoring Data is input into a preset environmental assessment model to obtain an environmental assessment value output by the preset environmental assessment model; the environmental assessment value is compared with a first threshold value, and if the environmental assessment value is less than or equal to the first threshold value, a first-level warning information is generated; the first-level warning information is used to characterize that the target pig population is in an unsuitable environment; if the environmental assessment value is greater than the first threshold value, the environmental assessment value is compared with a second threshold value; if the environmental assessment value is greater than the first threshold value and less than or equal to the second threshold value, a second-level warning information is generated; the second-level warning information is used to characterize that the target pig population is in a partially unsuitable environment; if the environmental assessment value is greater than the second threshold value, a third-level warning information is generated; the third-level warning information is used to characterize that the target pig population is in a suitable environment; the first threshold value is less than the second threshold value; each internal node of the preset environmental assessment model represents a test on an attribute, each branch represents the result of the test, and each leaf node represents a class label; each type of label is summarized and analyzed to generate an environmental assessment value; The objective function expression of the preset environmental assessment model is: ,in, represents the model parameters, N represents the total number of data points, K represents the number of decision trees in the random forest, represents the weight value of the kth decision tree, represents the true label of the Mth data point, represents the predicted label of the k-th decision tree for the M-th data point; 1 represents the indicator function, if , the result is 1, otherwise it is 0.
6. The pig disease early warning system according to claim 4, characterized in that: The stocking density data is obtained based on the image acquisition device through the following steps: Based on a preset shooting frequency, images of the target pig group are collected to obtain an image set of the target pig group; Performing denoising and parameter adjustment on the target pig group image set to improve image quality; After using threshold segmentation or edge detection to identify individual pigs in the image, the individual pigs in the image are counted based on the object recognition algorithm to obtain the target number of pigs; The stocking density is calculated based on the number of pigs and the area of the breeding facility for the target pig group.
7. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Multi-source data anomaly detection and bad data correction method for pig farm
CN117555886A
Intelligent monitoring platform and monitoring method for livestock breeding
CN118135500A
Swine flu emergency processing system based on grading early warning algorithm
CN118155862A