Xgboost pet health discrimination method and device based on gradient boosting
By using a gradient boosting XGBoost model-based pet health assessment method, combined with multiple sensors and data analysis algorithms, the problem of insufficient automation and intelligence in pet health monitoring technology is solved. This enables accurate prediction and timely warning of pet health status, improving the user experience.
Patent Information
- Application Number
- CN202411556481.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2044-11-04
AI Technical Summary
Existing pet health monitoring technologies have low levels of automation and intelligence, weak data processing capabilities and predictive accuracy, making it difficult to achieve real-time and accurate judgments.
The XGBoost model based on gradient boosting is adopted, combined with multiple sensors and data analysis algorithms. By acquiring historical detection data of pet cat litter boxes, ten-fold cross-validation and model training are performed to optimize model parameters. Exponential weighted moving average is used for smoothing, and real-time monitoring and health abnormality warnings are issued.
It enables accurate prediction and timely warning of pet health conditions, improves automation and intelligence, provides personalized health advice, and enhances user experience.
Smart Images

Figure CN119560145B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical diagnosis technical field and is applied to the pet industry taking pet cats as the object, and particularly relates to a data analysis and prediction method and device based on an XGBoost algorithm. BACKGROUND
[0002] The pet health condition monitoring technologies currently used in the pet industry mainly include remote health monitoring, intelligent collars and genetic testing. The remote health monitoring technology can transmit pet health data in real time to the pet owner's mobile phone or computer through wireless transmission technology, so that the owner can monitor the pet's physiological data and behavior data at any time and anywhere, realizing the real-time and convenience of pet health monitoring, but it cannot accurately judge and predict the pet's health condition through the pet's physiological and behavioral conditions and give suggestions on corresponding measures, and the intelligence and automation degree is relatively low.
[0003] The intelligent collar is a technology that monitors various data of pets in real time through built-in sensors and chips and transmits data to the pet owner's mobile phone or computer through Bluetooth or Wi-Fi wireless transmission technology. This technology can record the behavior data of pets and analyze the behavior patterns of pets through built-in intelligent algorithms to provide personalized health suggestions, but its data processing capability is low and it cannot accurately predict data, and the grasp of the pet's health condition has a certain lag.
[0004] Genetic prediction is a technology that predicts the susceptibility of pets to diseases and their sensitivity to drugs by detecting the genetic sequence of pets. Genetic information is an important reference index for pet health, and through genetic testing, the genetic condition of pets can be more accurately understood and potential health problems can be detected early, but this technology can only predict health problems and provide related suggestions, and does not have the function of capturing the physiological and behavioral conditions of pets in normal life, so other technologies must be matched to meet the needs of pet owners for pet health condition monitoring in actual operation and application.
[0005] Cat litter box brands on the market such as SNOW and MAX can achieve automatic monitoring of excrement and timely cleaning through gravity sensing, infrared detection and other technologies, but the sensing ability and timeliness of the reaction to the entry and exit of pets are low. The application collects data through devices such as built-in four-corner pressure plate movement detection cameras, automatically detects the entry of pet cats and automatically opens and closes, closes automatically, and opens until the excrement is scooped, with stronger sensing ability, automation level and timeliness.
[0006] Commonly used data prediction algorithm programs include time series analysis and regression analysis. Time series analysis is a statistical method for analyzing and predicting time-ordered data. It can analyze data trends, seasonality, periodicity, and outliers based on historical data. However, it has high data dependency, irregular data, and may cause data loss or abnormalities.
[0007] Regression analysis is a widely used method in statistics, mainly used to study the relationship between one or more independent variables (also known as explanatory variables or predictor variables) and a dependent variable (also known as response variable or outcome variable). It has certain flexibility and adaptability, but it can only analyze the relationship between a small number of variables. It is not effective in handling the interaction between a large number of variables, especially the impact of common factors on the dependent variable. It requires independent variables to be independent of each other, has high data quality requirements, and is complex and computationally intensive. The prediction accuracy, efficiency, and generalization ability of these two algorithms are relatively low. SUMMARY
[0008] The present application overcomes the above-mentioned shortcomings of the prior art and provides a pet health discrimination method and device based on a gradient boosting xgboost model.
[0009] The first aspect of the present application relates to a pet health discrimination method based on a gradient boosting xgboost model, comprising the following steps:
[0010] S1. Obtain the historical detection data records of the intelligent pet litter box, which include the daily body weight, excretion frequency, single excretion weight, total excretion weight, excretion duration, and label data of cat health status normal or abnormal of all sample cats;
[0011] S2. Divide the data set and verify and train the xgboost model using the ten-fold cross-validation data set division method on the historical detection data, and optimize the xgboost model in each cross-validation;
[0012] S3. Train the recognition model based on the xgboost algorithm according to the historical detection data to obtain the cat health status discrimination model corresponding to the intelligent pet litter box and the health index importance corresponding to the pet litter box;
[0013] S4. Monitor the performance of the xgboost model, and perform incremental update of the pet health discrimination model based on the xgboost algorithm and continuous optimization of the model parameters and feature selection according to the historical detection data and new detection data;
[0014] S5. Smoothing the pet health indicators by using an exponentially weighted moving average to obtain a warning threshold of the intelligent pet litter box, and when the real-time detection data of the intelligent pet litter box exceeds the warning threshold, a pet health abnormality warning is given to the pet owner.
[0015] Preferably, the historical detection data records of the intelligent pet litter box obtained in step S1 include:
[0016] All detection data of the intelligent pet litter box is obtained by using pressure sensors at four corners of the litter box, each item of the monitoring data is preprocessed, missing values are filled by polynomial interpolation, abnormal values are analyzed by box plot, and after data standardization, each item of the preprocessed data is arranged in time series, and the detection data includes pet health data and label data of whether normal.
[0017] Preferably, the data set division method of ten-fold cross-validation and the optimization of the xgboost model in step S2 include:
[0018] S21. The detection data of all sample cats is divided into ten subsets by stratified sampling method, which can ensure that the distribution of two categories of normal and abnormal in each subset is similar, and each subset is used as the validation set of the xgboost model in each cross-validation, and the rest is used as the training set. Repeat the above steps ten times to ensure that each subset is used as a validation set once, and perform ten-fold cross-validation;
[0019] S22. In each data set division, the xgboost model is trained and tested, and the hyperparameters are optimized in each cross-validation to improve the learning ability and generalization ability of the model.
[0020] Preferably, the pet health discrimination model training based on historical detection data in step S3 includes:
[0021] S31. The detection data of the cat is input into the extreme gradient boosting tree xgboost model, the model is trained by iteration of multiple decision trees, the output of each decision tree is added to the output of the previous decision tree, and the outputs of all decision trees are integrated to obtain the classification result of the health status of the sample cat;
[0022] S32. The Softmax loss function of the xgboost model in the health status classification problem can convert the original output of the model into a probability distribution, and the probability of the test cat sample for each category is output by using the dedicated decision tree trained for each health status category in iteration, and the category with the highest probability is the final health status of the cat.
[0023] S33. Utilize the xgboost algorithm to perform importance index screening on the various data of the historical detection data, and select feature indexes for input of the warning model.
[0024] Preferably, the pet health discrimination model based on the xgboost algorithm is self-updated and continuously optimized according to the historical detection data and new detection data in step S4, which comprises:
[0025] S41. In the model training process, the performance of the xgboost model is monitored using the validation set, such as accuracy, recall rate and other indicators. When the model performance reaches the preset threshold or no longer improves significantly, the model updating mechanism is triggered;
[0026] S42. Continuously collect new pet health data, including new cases, new physical examination results, etc. After preprocessing the new data to ensure consistency with the training set data format, add the new data to the historical detection training set. For large-scale data sets, the xgboost model uses multi-core CPU and distributed computing resources, and improves the training speed and efficiency of the model through parallel processing and distributed computing. The xgboost model is retrained using this data set to realize incremental updating of the model;
[0027] S43. In the incremental learning process, adjust the hyperparameters of the xgboost model, use cross-validation and other techniques to adjust the learning rate, the depth and node number of the decision tree, the subsampling rate, the column sampling rate and other hyperparameters to optimize the model performance, and introduce a regularization term in the objective function to control the complexity of the xgboost model, prevent overfitting and improve the generalization ability of the xgboost model;
[0028] S44. Analyze the importance of the features, automatically select the optimal features, filter and optimize the features according to the importance evaluation results of the features, remove redundant features, and continuously monitor the performance of the model after the model is deployed in actual application, adjust the xgboost model parameters and feature selection strategy in a timely manner according to the feedback and data changes in actual application, and improve the prediction accuracy of the xgboost model.
[0029] Preferably, the intelligent pet litter box derives a warning threshold and warns the pet owner of pet health abnormalities in step S5, which comprises:
[0030] S51. Determine the smoothing parameter of the exponentially weighted moving average model and initialize it, calculate the exponentially weighted moving average value of the historical detection data and update it with newly collected data, analyze the smoothing result and see the trend and pattern of the pet health index, set the warning threshold according to the exponentially weighted moving average value and a certain standard deviation multiple;
[0031] S52. Construct an xgboost model and train the xgboost model using the historical detection data to obtain the warning model of the intelligent pet litter box;
[0032] S53. When the real-time monitoring data of the intelligent pet litter box exceeds the warning threshold, the pet owner is warned of the pet health abnormality.
[0033] The second aspect of the present application relates to a pet health discrimination device based on a gradient boosting xgboost model, comprising a memory and one or more processors, the memory storing executable code, and the one or more processors executing the executable code to implement a pet health discrimination method based on a gradient boosting xgboost model.
[0034] The third aspect of the present application relates to a computer-readable storage medium having a program stored thereon, which is executed by a processor to implement a pet health discrimination method based on a gradient boosting xgboost model.
[0035] Traditional pet health monitoring technology more or less faces problems such as low automation and intelligence level, weak data processing capability and result prediction accuracy, and difficulty in realizing real-time monitoring. Accordingly, the present application monitors multiple different indexes related to pet health condition by combining multiple devices including pressure sensors, and determines the judgment result and warning data threshold according to multiple data preprocessing and data analysis algorithms and models. The present application can also learn and train the data set, give feasible suggestions, and the monitoring data, warnings and suggestions are real-time, improving the automation and intelligence level. The present application uses XGBoost algorithm based on gradient ascent, prevents overfitting through Shrinkage and Subsampling methods under the algorithm, adds a regularization term in the objective function and uses the second derivative of the loss function with respect to the function to be solved for optimization, thereby improving the performance and information retention of the model and reducing the risk of overfitting again. The serial trees and nodes between the trees of the same level are parallelized to speed up the training. For continuous feature values and sparse data, XGBoost uses specific approximation algorithms and strategies to handle them, improving the efficiency and accuracy of the algorithm on large-scale data sets. Moreover, XGBoost can automatically handle missing values in the data without additional preprocessing.
[0036] The present application can automatically collect, process and analyze pet health data by integrating multiple sensors and data analysis algorithms, without or with only a small amount of human intervention, significantly improving the level of automation of monitoring. The use of advanced machine learning algorithms such as XGBoost also enables the present application to accurately predict and judge the health status of pets, providing more intelligent health advice for pet owners.
[0037] The present application uses the XGBoost algorithm, which has excellent performance and accuracy when processing large-scale data sets. By iteratively training multiple decision trees and combining the outputs of each decision tree, XGBoost can capture complex relationships and patterns in the data, enabling accurate prediction of pet health status. In addition, the present application further improves the quality of data and the predictive ability of the model through data preprocessing, feature selection and other steps.
[0038] Based on the XGBoost model, the present application introduces regularization terms, uses Shrinkage and Subsampling methods, effectively preventing overfitting. At the same time, by adjusting the hyperparameters of the model and optimizing the objective function, the performance and prediction accuracy of the model are further improved. In addition, the present application also uses parallelization and distributed computing techniques to speed up the training of the model and improve the ability to handle large-scale data sets.
[0039] The advantages of the present application are: the present application can timely issue a warning when the pet's health status is abnormal by real-time monitoring of the pet's physiological and behavioral data combined with the prediction results of the XGBoost model, providing timely intervention opportunities for pet owners, which is of great significance for the health management and disease prevention of pets.
[0040] Based on the prediction results of the XGBoost model and the real-time monitoring data of the pet, the present application can provide personalized, targeted and practical health advice for pet owners based on the specific circumstances and health status of the pet, and can also adjust the model parameters and feature selection strategies in a timely manner according to the feedback and data changes in actual application, to adapt to the health monitoring needs of different pets and different situations, thus being more flexible and universal.
[0041] Through real-time monitoring, timely warning and personalized advice, the present application can significantly improve the user experience of pet owners. Pet owners can more conveniently understand the health status of their pets and take necessary intervention measures in a timely manner, which helps to avoid unnecessary suffering and disease distress for pets and improves the welfare level of pets. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1is the overall framework diagram of the present application.
[0043] Figure 2 is a pet health judgment flowchart of an embodiment of the present application. DETAILED DESCRIPTION
[0044] The technical solutions of the present application are further described below with reference to the accompanying drawings.
[0045] Embodiment 1
[0046] The present embodiment relates to a pet health discrimination method based on a gradient boosting xgboost model, comprising the following steps:
[0047] S1. Obtain the historical detection data records of the intelligent pet litter box, which includes the daily body weight, excretion frequency, single excretion weight, total excretion weight, excretion duration, and label data of cat health status normal or abnormal of all sample cats;
[0048] S2. Divide the dataset and verify and train the xgboost model using the ten-fold cross-validation dataset division method for the historical detection data, and optimize the xgboost model in each cross-validation;
[0049] S3. According to the historical detection data, the recognition model training based on the xgboost algorithm is carried out, and the cat health status discrimination model corresponding to the intelligent pet litter box and the health index importance corresponding to the pet litter box are obtained;
[0050] S4. Monitor the performance of the xgboost model, and perform incremental update of the pet health discrimination model based on the xgboost algorithm and continuous optimization of the model parameters and feature selection according to the historical detection data and new detection data;
[0051] S5. Smooth the pet health index using the exponential weighted moving average, and obtain the warning threshold of the intelligent pet litter box. When the real-time detection data of the intelligent pet litter box exceeds the warning threshold, the pet owner is warned of pet health abnormalities.
[0052] First, the breed, age, and gender of the pet cat are uploaded to the cloud and entered into the built-in database of the intelligent pet litter box. The intelligent pet litter box is equipped with a mobile detection camera, which will take a snapshot and upload data to the cloud whenever a pet cat enters. The data before, during, and after the cat enters are collected and calculated by the pressure sensors at the four corners of the intelligent pet litter box, so as to obtain the daily body weight, excretion amount, and excretion frequency of the pet cat. The data indicating abnormal health status of the pet cat is labeled as an abnormal label.
[0053] The built-in data system views the statistical information of the data set or checks the missing values of the data through the built-in function in the built-in programming system. Assuming that the changes between the data can be fitted with a polynomial function, a suitable polynomial function order is selected and a polynomial function is determined between the degree of overfitting and the accuracy of data fitting. The polynomial function is fitted by the data collected by the intelligent cat litter box through the built-in numpy.polyfit program. The fitted polynomial function is applied to the position of the missing value to estimate the missing value and fill it in the position of the missing data.
[0054] The outliers are analyzed and processed using the box plot. The quartiles (Q1, Q3), median (Median), interquartile range (IQR = Q3-Q1), and upper and lower limits defined by Q1-1.5IQR and Q3+1.5IQR of the data set are calculated. The box plot is drawn according to the calculated statistics. The data points outside the upper and lower limits in the box plot are identified as outliers. The outliers are selected to be deleted or retained according to data fitting, prediction accuracy, etc., or replaced with mean or median. The mean (μ) and standard deviation (σ) of the data set are calculated. For each value in the data set, the formula (x-μ) / σ is used for standardization processing. The data processed in this way will have a distribution with a mean of 0 and a standard deviation of 1, thereby completing the data standardization processing. The processed data is arranged in time series. The detection data includes pet health data and label data whether normal or not.
[0055] The columns of features (such as breed, day, previous day weight, etc.) and target variables (such as daily weight, excretion amount, excretion frequency, etc.) are determined. According to this, the data set is divided into a training set and a test set in a ratio of 7:3. If the features include classification data (such as cat breed), the features are encoded. For numerical features, standardization or normalization processing can be performed, but since XGBoost is relatively insensitive to feature scaling, this process can be optionally performed. If the data has time series characteristics, time-related features (such as date, month, day of the week, day difference, etc.) are created.
[0056] The model is trained as follows. First, the parameters of XGBoost are set, such as learning rate, maximum depth of tree, number of trees, etc., and then the training set data is used to train the XGBoost model. The data set division method of ten-fold cross-validation is adopted. The detection data of all sample cats is randomly shuffled to ensure that each data point has an equal chance of being selected into the training set or test set in each iteration. The shuffled data set is evenly (or as evenly as possible) divided into ten non-overlapping subsets using stratified sampling. The size of each subset is about one-tenth of the original data set (if the size of the data set cannot be divided by 10, some subsets may have one more or one less data point than others). The stratified sampling can ensure that the distribution of the two categories in each subset is similar. Each of the subsets is used as the validation set of the xgboost model in each cross-validation, and the rest is used as the training set. The number of iterations is set to 10, and the variables (such as accuracy, recall, etc.) used to store the results of each iteration are set. Ensure that each of the subsets is used as a validation set once, and the remaining nine subsets are combined as a training set. Train the model on the training set and evaluate it on the test set. Record the evaluation results. Maintain the independence of data division in each iteration of the ten-fold cross-validation, i.e. the test set should not be visible during training. The evaluation indicators (such as accuracy, recall, etc.) recorded in the 10 iterations are summarized, and their average values are calculated. According to the summary results, adjust the parameters to optimize the performance of the model.
[0057] Basic parameters that affect the training process and final performance of the XGBoost model are set, such as learning rate (eta), maximum depth of tree (max_depth), number of trees (n_estimators), regularization terms (such as alpha and lambda), etc. The data set is divided into two subsets according to a certain feature, and the structure of the tree (including node splitting and leaf node values) is constructed based on these subsets. The first decision tree is trained using the training set data. For each subsequent tree, XGBoost trains and attempts to predict the residuals (i.e. the difference between the predicted value and the actual value) through a new tree based on the residuals of the previous tree in order to more accurately approximate the true value. The output of each tree is added to the output of the previous tree to form the final prediction for the current sample and the process is iterated until a predetermined number of trees is reached or other stopping conditions are met (such as no improvement in performance on the validation set). During training, XGBoost calculates the contribution of each feature to the model's prediction, resulting in a feature importance score to determine the feature indicators that have the greatest impact on the classification result.
[0058] Before training the XGBoost model, the objective parameter needs to be set to multi:softmax (output the class index with the highest probability) or multi:softprob (output the probability of each class). The number of classes (i.e., the number of different health conditions of the cat) is specified through the num_class parameter. The model is trained using the training set data, and during the training process, XGBoost trains a dedicated set of decision trees for each class. These decision trees work together to minimize the Softmax loss function, which encourages the model to output a probability distribution that matches the actual class label.
[0059] When using multi:softprob as the objective function, the output of the XGBoost model will be a vector with a length equal to the number of classes. Each element of this vector corresponds to the predicted probability of a class. These predicted probabilities are calculated from the model's raw output (usually unnormalized scores or logits for each class) through the Softmax function. The Softmax function converts logits into a probability distribution where the sum of probabilities for all classes is 1.
[0060] For a given test cat sample, the XGBoost model will output a probability distribution vector. Traverse this vector to find the class with the highest probability. This class is identified as the cat's health condition predicted by the model. Output this class as the final classification result, and you can attach the corresponding probability value as needed to increase the credibility of the result.
[0061] Evaluate the performance of the trained XGBoost model by calculating evaluation metrics such as accuracy, recall, F1 score, confusion matrix, etc. for the prediction results of the test set data. For the input test data, the XGBoost model will output a classification result representing the cat's health condition (such as healthy, sub-healthy, sick, etc.) based on the knowledge learned during the model training process (i.e., the cumulative output of multiple decision trees). Based on the model's classification results and feature importance scores, the cat's health condition can be explained and further diagnosed.
[0062] After the model is trained, use the model to predict the test set and calculate performance metrics such as mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), etc. to evaluate the accuracy of the model. Then adjust the parameters of XGBoost based on the evaluation results to optimize the performance of the model; and analyze the features that have a greater impact on the model's prediction results, and further improve the encoding, scaling, and creation of time-dependent features based on feature importance. After model optimization, continue to use the optimized model to continue prediction on new or future data.
[0063] A smoothing parameter a (a value range between 0 to 1) is set to moderate the influence of historical data and the latest data on the smoothing result, the first smoothing value is initialized and the smoothing process is started, for each subsequent data point in the sequence, its smoothing value is calculated using the following recursive formula:
[0064] Test smoothing value t = a x (data point t ) + (1-a) x smoothing value t-1
[0065] Wherein the smoothing value t represents the smoothing value of the current data point, the data point t represents the value of the current data point, the smoothing value t-1 represents the smoothing value of the previous data point. According to the above recursive formula, the smoothing value of each data point in the sequence is calculated in turn until the entire data sequence is processed. The new data sequence composed of the smoothing value of each data point is obtained after the smoothing process is completed, which reflects the overall trend of the data, and the warning threshold of the pet litter box is determined in combination with the normal and abnormal data labels. When the real-time detection data of the intelligent pet litter box exceeds the warning threshold, the pet owner is warned of pet health abnormalities. And according to the prediction result, the corresponding strategy or decision is made.
[0066] Embodiment 2
[0067] This embodiment relates to a pet health discrimination device based on a gradient boosting xgboost model, comprising a memory and one or more processors, the memory stores executable code, and the one or more processors execute the executable code to implement the pet health discrimination method based on the gradient boosting xgboost model of embodiment 1.
[0068] Embodiment 3
[0069] This embodiment relates to a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the pet health discrimination method based on the gradient boosting xgboost model of embodiment 1.
[0070] The above only describes the embodiments of the present application and does not limit the present application. For those skilled in the art, the present application can have various changes and variations. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the scope of claims of the present application.
Claims
1. A pet health discrimination method based on a gradient boosting xgboost model, characterized in that, Comprising the following steps: S1. Obtain the historical detection data record of the intelligent pet litter box, which includes the daily body weight, excretion frequency, single excretion weight, total excretion weight, excretion duration, and label data of cat health status of all sample cats; S2. Divide the dataset and verify and train the xgboost model using the ten-fold cross-validation dataset division method on the historical detection data, and optimize the xgboost model in each cross-validation; S3. According to the historical detection data, the recognition model based on the xgboost algorithm is trained to obtain the cat health status discrimination model corresponding to the intelligent pet litter box and the health index importance corresponding to the pet litter box; comprising: S31. Input the detection data of the cat into the extreme gradient boosting tree xgboost model, and the model is trained by iteration of multiple decision trees. The output of each decision tree is added to the output of the previous decision tree, and the outputs of all decision trees are integrated to finally obtain the classification result of the health status of the sample cat; S32. The xgboost model uses a Softmax loss function in the health status classification problem, which can convert the original output of the model into a probability distribution. The probability of each class is output by using the dedicated decision tree trained for each health status category in the iteration, and the class with the highest probability is the final cat health status; S33. Use the xgboost algorithm to screen the importance indicators of the historical detection data, and select the feature indicators used as the input of the warning model; S4. Monitor the performance of the xgboost model, and perform incremental update of the pet health discrimination model based on the xgboost algorithm and continuous optimization of the model parameters and feature selection according to the historical detection data and new detection data; comprising: S41. In the model training process, the performance of the xgboost model is monitored using the validation set, including accuracy and recall rate indicators. When the model performance reaches the preset threshold or no longer improves significantly, the model update mechanism is triggered; S42. Continuously collect new pet health data, including new cases and new physical examination results. After preprocessing the new data to ensure consistency with the training set data format, add the new data to the historical detection training set. For large-scale data sets, the xgboost model uses multi-core CPU and distributed computing resources, and improves the training speed and efficiency of the model through parallel processing and distributed computing. The xgboost model is retrained using this data set to realize incremental update of the model; S43. In the incremental learning process, adjust the hyperparameters of the xgboost model, adjust the learning rate, the depth and node number of the decision tree, the subsampling rate, and the column sampling rate hyperparameters using cross-validation technology to optimize the model performance, and introduce a regularization term in the objective function to control the complexity of the xgboost model, prevent overfitting, and improve the generalization ability of the xgboost model; S44. Analyze the importance of the features, automatically select the optimal features, filter and optimize the features according to the importance evaluation results of the features, remove redundant features, and continuously monitor the performance of the model after the model is deployed in actual application, adjust the xgboost model parameters and feature selection strategy in time according to the feedback and data changes in actual application, and improve the prediction accuracy of the xgboost model; S5. Smooth the pet health indicators by using an exponential weighted moving average to obtain a warning threshold of the intelligent pet litter box, and when the real-time detection data of the intelligent pet litter box exceeds the warning threshold, a pet health abnormality warning is given to the pet owner. 2.The pet health discrimination method based on the gradient boosting xgboost model according to claim 1, characterized in that, The step S1 obtains the historical detection data record of the intelligent pet litter box, including: All detection data of the intelligent pet litter box is obtained by using pressure sensors at four corners of the litter box, each item of the monitoring data is preprocessed, missing values are filled by polynomial interpolation, abnormal values are processed by box plot analysis, and after data standardization, each item of the preprocessed data is arranged into a time series, and the detection data includes pet health data and label data of whether normal. 3.The pet health discrimination method based on the gradient boosting xgboost model of claim 1, wherein, The data set division method of step S2 adopts ten-fold cross-validation to divide the data set and optimize the xgboost model, including: S21. The detection data of all sample cats is divided into ten subsets by stratified sampling method, which can ensure that the distribution of two categories of normal and abnormal in each subset is similar, and each subset is used as the validation set of the xgboost model in each cross-validation, and the rest is used as the training set, and the above steps are repeated ten times to ensure that each subset is used as a validation set once, and the ten-fold cross-validation is performed; S22. In each data set division, the xgboost model is trained and detected, and the hyperparameters are optimized in each cross-validation to improve the learning ability and generalization ability of the model. 4.The pet health discrimination method based on the gradient boosting xgboost model of claim 1, wherein, The step S5 of the intelligent pet litter box obtains the warning threshold and gives the pet health abnormality warning to the pet owner, including: S51. Determine the smoothing parameter of the exponential weighted moving average model and initialize it, calculate the exponential weighted moving average value of the historical detection data and update it with newly collected data, analyze the smoothing result and view the trend and pattern of the pet health indicators, and set the warning threshold according to the exponential weighted moving average value and a certain standard deviation multiple; S52. Build an xgboost model and train the xgboost model using the historical detection data to obtain the warning model of the intelligent pet litter box; S53. When the real-time monitoring data of the intelligent pet litter box exceeds the warning threshold, the pet owner is given the pet health abnormality warning. 5.A pet health discrimination device based on a gradient boosting xgboost model, characterized in that, An apparatus includes a memory having executable code stored therein and one or more processors that execute the executable code to implement a method for determining pet health based on a gradient boosting xgboost model as claimed in any one of claims 1-4.
6. A computer-readable storage medium, characterized in that, A computer program product has stored thereon a program that, when executed by a processor, implements a method for determining pet health based on a gradient boosting xgboost model as claimed in any one of claims 1-4.
Citation Information
Patent Citations
Chicken health state detection method and detection model building method thereof
CN116484916A
Health state monitoring method and device, health station bin, equipment and medium
CN118116598A