Xgboost pet health discrimination method and device based on gradient lifting
By applying a pet health discrimination method based on the gradient-enhancing XGBoost model in pet health monitoring, the problems of low automation and intelligence level and weak data processing capabilities in the existing technology are solved, and accurate prediction and real-time monitoring of pet health status are achieved, providing pet owners with efficient and personalized health advice.
Patent Information
- Application Number
- CN202411556481.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The existing pet health monitoring technology has defects in terms of low automation and intelligence level, weak accuracy in data processing capabilities and result prediction, and difficulty in real-time monitoring.
The pet health discrimination method based on the gradient-enhanced XGBoost model is adopted. By obtaining the historical detection data of the smart pet cat litter box, 10-fold cross-verification and model training, a cat's health status discrimination model is established, and data smoothing is performed through exponential weighted moving average, pet health indicators are monitored in real time, and warnings are issued in a timely manner.
It improves the automation and intelligence level of pet health monitoring, realizes accurate prediction and judgment of pet health status, provides personalized and practical health suggestions for pet owners, and significantly improves the real-time and accuracy of monitoring.
Smart Images

Figure CN119560145A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of technical diagnosis and is applied to the pet industry with pet cats as the target, and specifically relates to a data analysis and prediction method and device based on an XGBoost algorithm. Background Art
[0002] At present, the pet health monitoring technologies used in the pet industry mainly include remote health monitoring, smart collars and genetic testing. Remote health monitoring technology can transmit the pet's health data to the pet owner's mobile phone or computer in real time through wireless transmission technology, so that the owner can monitor the pet's various physiological data and behavioral data anytime and anywhere, and realize the real-time and convenient pet health monitoring. However, it cannot accurately judge and predict the pet's health status through the pet's physiological and behavioral conditions and give suggestions for countermeasures. The degree of intelligence and automation is relatively low;
[0003] Smart collars are a technology that uses built-in sensors and chips to monitor various data of pets in real time and transmit the data to the pet owner's mobile phone or computer through wireless transmission technologies such as Bluetooth or Wi-Fi. This technology can record the pet's behavioral data and analyze the pet's behavior patterns through built-in intelligent algorithms to provide personalized health advice, but its data processing capacity is low and it cannot make accurate data predictions, and there is a certain lag in understanding the health status of pets;
[0004] Gene prediction is a technology that predicts a pet's susceptibility to diseases and its sensitivity to drugs by detecting its gene sequence. Genetic information is an important reference indicator for pet health. Through genetic testing, we can more accurately understand the genetic status of pets and discover potential health problems early. However, this technology can only predict health problems and provide relevant suggestions. It does not have the function of capturing the physiological and behavioral conditions of pets in their normal lives. Therefore, in actual operation and application, it must be combined with other technologies to meet the needs of pet owners for monitoring the health status of their pets.
[0005] Cat litter box brands on the market, such as SNOW and MAX, can automatically monitor and clean up excrement through gravity sensing, infrared detection and other technologies, but their perception of pets entering and exiting and their timeliness of response are relatively low. On this basis, the present invention collects data from its built-in four-corner pressure plate motion detection camera and other equipment, automatically detects the entry of pet cats and opens and closes autonomously, and automatically scoops the excrement after closing and opens after scooping. It has stronger perception 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 used to analyze and predict data based on time sequence. It can analyze data trends, seasonality, periodicity, outliers, etc. based on historical data, but it has high data dependence, irregular data, and may cause missing or abnormal data.
[0007] Regression analysis is a widely used method in statistics. It is mainly used to study the relationship between one or more independent variables (also called explanatory variables or predictor variables) and a dependent variable (also called response variable or outcome variable). It has certain flexibility and adaptability, but it can usually only analyze the relationship between a small number of variables. It is less effective in dealing with the interaction between a large number of variables, especially the influence of common factors of variables on dependent variables. It also requires that the independent variables are independent of each other, has high requirements on data quality, and has a large and complex calculation workload. The prediction accuracy, efficiency and generalization ability of these two algorithms are also relatively low. Summary of the invention
[0008] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provide a pet health identification method and device based on the gradient boosting xgboost model.
[0009] The first aspect of the present invention relates to a pet health identification method based on a gradient boosting xgboost model, comprising the following steps:
[0010] S1. Obtain the historical test data record of the smart pet litter box, the historical test data includes the daily weight, number of defecation, single defecation weight, total defecation weight, defecation time and label data of normal or abnormal health status of all sample cats;
[0011] S2. The historical detection data is divided into data sets using a ten-fold cross-validation data set division method, and the xgboost model is verified and trained, and the xgboost model is optimized in each cross-validation;
[0012] S3. Performing a recognition model training based on the xgboost algorithm according to the historical detection data to obtain a cat health status discrimination model corresponding to the smart pet cat litter box and the importance of health indicators corresponding to the pet cat litter box;
[0013] S4. Monitor the performance of the xgboost model, and perform incremental updates of the pet health discrimination model based on the xgboost algorithm and continuous optimization of its model parameters and feature selection according to the historical detection data and the new detection data;
[0014] S5. The pet health index is smoothed using an exponentially weighted moving average to obtain a warning threshold of the smart pet litter box. When the real-time detection data of the smart pet litter box exceeds the warning threshold, a pet health abnormality warning is issued to the pet owner.
[0015] Preferably, the step S1 of obtaining the historical detection data record of the smart pet litter box includes:
[0016] All detection data of the smart pet litter box are obtained by using pressure sensors at the four corners of the cat litter box, and data preprocessing is performed on each item in the monitoring data. Missing values are filled by polynomial interpolation, outliers are processed by box plot analysis, and data standardization is performed. Then, the preprocessed data are arranged into a time series. The detection data includes pet health data and label data on whether it is normal.
[0017] Preferably, the data set partitioning method using ten-fold cross validation described in step S2 to partition the data set and optimize the xgboost model includes:
[0018] S21. The detection data of all sample cats are divided into ten subsets by stratified sampling. The stratified sampling can ensure that the distribution of the two categories in each subset is similar. Each cross-validation uses each subset as a validation set of the xgboost model, and the rest as a training set. 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;
[0019] S22. In each data set division, the xgboost model is trained and tested. In each cross-validation, the hyperparameters are tuned to improve the learning and generalization capabilities of the model.
[0020] Preferably, the algorithm-based pet health discrimination model training according to historical detection data in step S3 includes:
[0021] S31. Input the detection data of the cat into the extreme gradient boosting tree xgboost model, the model iteratively trains multiple decision trees, the output of each decision tree is added to the output of the previous decision tree, and the output of each decision tree is combined to finally 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 classification problem can convert the original output of the model into a probability distribution, and use the exclusive decision tree trained for each health category in iteration to output the probability of the test cat sample being each category, and the category with the highest probability is the final cat health status;
[0023] S33. Use the xgboost algorithm to screen the importance index of each item of the historical detection data, and select feature indexes used as input of the warning model.
[0024] Preferably, the self-updating and continuous optimization of the pet health discrimination model based on the xgboost algorithm according to the historical detection data and the new detection data in step S4 includes:
[0025] S41. During the model training process, the performance of the xgboost model, such as accuracy, recall and other indicators, is monitored using the validation set. When the model performance reaches a preset threshold or no longer improves significantly, a model update 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 that it is consistent with the training set data format, the new data is added to the historical detection training set. For large-scale data sets, the xgboost model uses multi-core CPUs 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 achieve incremental updates of the model;
[0027] S43. In the incremental learning process, the hyperparameters of the xgboost model are adjusted, and the learning rate, the depth and number of nodes of the decision tree, the subsampling rate, the column sampling rate and other hyperparameters are adjusted using cross-validation and other techniques to optimize the model performance, and a regularization term is introduced into 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, screen and optimize the features according to the importance evaluation results of the features, and remove redundant features. After the model is deployed in actual applications, the performance of the model will be continuously monitored. According to the feedback and data changes in the actual application, the xgboost model parameters and feature selection strategy will be adjusted in time to improve the prediction accuracy of the xgboost model.
[0029] Preferably, the smart pet litter box in step S5 obtains a warning threshold and warns the pet owner of abnormal pet health, including:
[0030] S51. Determine and initialize the smoothing parameters of the exponentially weighted moving average model, calculate the exponentially weighted moving average of the historical detection data and update it with the newly collected data, analyze the smoothing results and check the trends and patterns of the pet health indicators, and set a warning threshold based on the exponentially weighted moving average and a certain standard deviation multiple;
[0031] S52. Construct an xgboost model, and use the historical detection data to train the xgboost model to obtain the warning model of the smart pet cat litter box;
[0032] S53. When the real-time monitoring data of the smart pet litter box exceeds the warning threshold, the pet owner is warned of abnormal pet health.
[0033] The second aspect of the present invention relates to a pet health judgment device based on a gradient boosting xgboost model, comprising a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement a pet health judgment method based on a gradient boosting xgboost model of the present invention.
[0034] The third aspect of the present invention relates to a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements a pet health identification method based on a gradient boosting xgboost model of the present invention.
[0035] Traditional pet health monitoring technology more or less faces the problems of low automation and intelligence level, weak data processing capability and result prediction accuracy, and difficulty in achieving real-time monitoring. Accordingly, the present invention combines various devices including pressure sensors to simultaneously monitor multiple different indicators related to pet health status and obtain judgment results and determine judgment basis and warning data thresholds based on various data preprocessing and data analysis algorithms and models. It can also learn and train data sets and give feasible relevant suggestions. The monitoring data, warnings and suggestions are all real-time, thereby improving the level of automation and intelligence. The present invention uses an XGBoost algorithm based on gradient ascent, and uses methods such as shrinkage and subsampling under the algorithm to prevent overfitting; adds a regularization term to the objective function and uses the second-order derivative of the loss function with respect to the desired function for optimization, thereby improving the performance and information retention of the model and further reducing the risk of overfitting; and parallelizes the processing of nodes at the same level between serial trees, thereby accelerating the training speed; XGBoost uses specific approximate algorithms and strategies to process continuous eigenvalues and sparse data, thereby improving the efficiency and accuracy of the algorithm on large-scale data sets; and XGBoost can automatically process missing values in the data without the need for additional preprocessing.
[0036] The present invention integrates multiple sensors and data analysis algorithms to automatically collect, process and analyze the health data of pets, without or with only a small amount of human intervention, significantly improving the automation level of monitoring. The use of advanced machine learning algorithms such as XGBoost also enables the present invention to accurately predict and judge the health status of pets, providing pet owners with more intelligent health advice.
[0037] The present invention 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 the complex relationships and patterns in the data, thereby achieving accurate prediction of the health status of pets. In addition, the present invention further improves the quality of the data and the predictive ability of the model through steps such as data preprocessing and feature selection.
[0038] Based on the XGBoost model, the present invention effectively prevents the occurrence of overfitting by introducing regularization terms, using shrinkage and subsampling methods. 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 invention also adopts technical means such as parallelization and distributed computing to speed up the training speed of the model and improve the ability to process large-scale data sets.
[0039] The advantages of the present invention are: by real-time monitoring of various physiological and behavioral data of pets, combined with the prediction results of the XGBoost model, the present invention can issue timely warnings when abnormalities occur in the health status of pets, providing pet owners with timely intervention opportunities, which is of great significance for pet health management and disease prevention.
[0040] According to the prediction results of the XGBoost model and the real-time monitoring data of the pet, the present invention can provide personalized, targeted and practical health advice to pet owners based on the specific situation and health status of the pet. It can also adjust the model parameters and feature selection strategies in time according to the feedback and data changes in actual applications to adapt to the health monitoring needs of different pets and different situations, thereby being more flexible and universal.
[0041] Through real-time monitoring, timely warnings, and personalized suggestions, the present invention 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 prevent the pets from suffering unnecessary pain and disease and improve the welfare level of the pets. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1It is the overall framework diagram of the present invention.
[0043] Figure 2 4 is a pet health determination flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0045] Example 1
[0046] This embodiment relates to a pet health determination method based on a gradient boosting xgboost model, comprising the following steps:
[0047] S1. Obtain the historical test data record of the smart pet litter box, the historical test data includes the daily weight, number of defecation, single defecation weight, total defecation weight, defecation time and label data of normal or abnormal health status of all sample cats;
[0048] S2. The historical detection data is divided into data sets using a ten-fold cross-validation data set division method, and the xgboost model is verified and trained, and the xgboost model is optimized in each cross-validation;
[0049] S3. Performing a recognition model training based on the xgboost algorithm according to the historical detection data to obtain a cat health status discrimination model corresponding to the smart pet cat litter box and the importance of health indicators corresponding to the pet cat litter box;
[0050] S4. Monitor the performance of the xgboost model, and perform incremental updates of the pet health discrimination model based on the xgboost algorithm and continuous optimization of its model parameters and feature selection according to the historical detection data and the new detection data;
[0051] S5. The pet health index is smoothed using an exponentially weighted moving average to obtain a warning threshold of the smart pet litter box. When the real-time detection data of the smart pet litter box exceeds the warning threshold, a pet health abnormality warning is issued to the pet owner.
[0052] Firstly, the breed, age and gender of the pet cat are uploaded to the cloud by themselves and entered into the built-in database of the smart pet cat litter box. The smart pet cat litter box is equipped with a motion detection camera. Whenever the pet cat enters, it will capture the data and upload the data to the cloud. The pressure sensors at the four corners of the smart pet cat litter box collect the data before, during and after the cat comes in and calculate the difference, so as to obtain the daily weight, excretion volume and excretion frequency of the pet cat, and mark the data indicating abnormal health status of the pet cat with abnormal labels.
[0053] The built-in data system checks the statistical information of the data set or checks the missing data values through the built-in functions in the built-in programming system, assumes that the changes between the data can be fitted by a polynomial function, selects a suitable polynomial function order to balance the degree of overfitting and the accuracy of data fitting, and determines the polynomial function, fits the polynomial function using the data collected by the smart litter box through the built-in numpy.polyfit program, and applies the fitted polynomial function to the position of the missing value to estimate the missing value and fill it into the missing data position.
[0054] Use box plot analysis to process outliers, calculate the quartiles (Q1, Q3), median (Median) and interquartile range (IQR = Q3-Q1) of the data set, and the upper and lower bounds defined by Q1-1.5IQR and Q3+1.5IQR, draw a box plot based on the calculated statistics, identify the data points in the box plot that exceed the upper and lower bounds as outliers, and choose to delete or retain outliers based on data fit, prediction accuracy, etc., or replace outliers with the mean and median. Calculate the mean (μ) and standard deviation (σ) of the data set, and for each value in the data set, use the formula (x-μ) / σ for standardization. The processed data will have a distribution with a mean of 0 and a standard deviation of 1, thereby completing the data standardization process. The processed data is arranged as a time series, and the detection data includes pet health data and label data of whether it is normal.
[0055] Determine the columns that serve as features (such as breed, day, weight the day before, etc.) and target variables (such as weight on the day, excretion volume, number of excretions, etc.), and split the data set into training and test sets in a ratio of 7:3. If the features contain categorical data (such as cat breed), encode the features; for numerical features, standardization or normalization can be performed, but since XGBoost is relatively insensitive to feature scaling, this process can be performed selectively; if the data has time series characteristics, time-related features (such as date, month, day of the week, day difference, etc.) will be created.
[0056] The model is trained below. 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 partitioning method of ten-fold cross validation is adopted. The detection data of all sample cats are randomly shuffled to ensure that each data point has an equal chance to be 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 by 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, then some subsets may have one more or one less data point than other subsets.). The stratified sampling can ensure that the distribution of the two categories in each subset is similar. Each cross validation uses each subset as the validation set of the xgboost model, and the rest as the training set. The number of iterations is set to 10 times, and the variables used to store the results of each iteration (such as accuracy, recall, etc.) are ensured to ensure that each subset is used as a validation set once, and the remaining nine subsets are combined as training sets. The model is trained on the training set and evaluated on the test set. The evaluation results are recorded. The independence of data partitioning is maintained in each iteration of the ten-fold cross validation, that is, the test set should be invisible during the training process. The evaluation indicators (such as accuracy, recall, etc.) recorded in 10 iterations are summarized and their averages are calculated. The parameters are adjusted according to the summarized results to optimize the model performance.
[0057] Set basic parameters that affect the training process and final performance of the XGBoost model, such as learning rate (eta), maximum tree depth (max_depth), number of trees (n_estimators), regularization terms (such as alpha and lambda), etc. Divide the dataset into two subsets based on a certain feature and build the structure of the tree based on these subsets (including node splits and leaf node values) Use the training set data to train the first decision tree. For each subsequent tree, XGBoost will train based on the residuals of the previous tree (that is, the difference between the predicted value and the actual value) and try to predict these residuals through the new tree 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 the predetermined number of trees is reached or other stopping conditions are met (such as performance on the validation set is no longer improved). During the training process, XGBoost calculates the contribution of each feature to the model prediction, thereby obtaining a feature importance score to determine the feature index that has the greatest impact on the classification result.
[0058] Before training the XGBoost model, you need to set the objective parameter to multi:softmax (output the index of the category with the highest probability) or multi:softprob (output the probability of each category). The number of categories (that is, the number of different categories of cat health) is specified through the num_class parameter. The model is trained using the training set data. During the training process, XGBoost trains a unique set of decision trees for each category. These decision trees work together to minimize the Softmax loss function, which encourages the model to output a probability distribution that matches the actual category label.
[0059] When using multi:softprob as the objective function, the output of the XGBoost model will be a vector whose length is equal to the number of categories. Each element of this vector corresponds to the predicted probability of a category. These predicted probabilities are calculated from the raw output of the model (usually the unnormalized scores or logits for each category) through the Softmax function. The Softmax function converts the logits into a probability distribution where the sum of the probabilities of all categories is 1.
[0060] For a given test cat sample, the XGBoost model will output a probability distribution vector. Traverse this vector and find the category with the highest probability. This category is identified as the cat's health condition predicted by the model. Output this category as the final classification result, and you can add corresponding probability values as needed to increase the credibility of the result.
[0061] The performance of the trained XGBoost model is evaluated by calculating the accuracy, recall, F1 score, confusion matrix and other evaluation indicators of the prediction results of the test set data. For the input test data, the XGBoost model will output a classification result based on the knowledge learned during the model training process (i.e., the cumulative output of multiple decision trees), indicating the health status of the cat (such as healthy, sub-healthy, sick, etc.). According to the classification results of the model and the feature importance score, the health status of the cat can be explained and further diagnosed.
[0062] After the model is trained, the model is used to predict the test set and calculate the performance indicators of the prediction results, such as mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), etc., to evaluate the accuracy of the model. Then adjust the parameters of XGBoost according to the evaluation results to optimize the model performance; analyze the features that have a greater impact on the model prediction results, and further improve the encoding, scaling and creation of time-related features based on the importance of the features. After the model is optimized, continue to use the optimized model to continue predicting new or future data.
[0063] Set the smoothing parameter α (the value range of α is between 0 and 1) so that the influence of historical data and the latest data on the smoothing result is moderate, initialize the first smoothing value and start smoothing. For each subsequent data point in the sequence, use the following recursive formula to calculate its smoothing value:
[0064] test smoothing value t =α×(data point t )+(1-α)×smoothing value t-1
[0065] The smoothing value t Indicates the smoothed value of the current data point. t Indicates the value of the current data point, smoothed 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 the original data point obtained after the smoothing process to reflect the overall trend of the data, and the warning threshold of the pet litter box is determined in combination with normal and abnormal data labels. When the real-time detection data of the smart pet litter box exceeds the warning threshold, the pet owner is warned of abnormal pet health. And formulate corresponding strategies or decisions based on the prediction results.
[0066] Example 2
[0067] The present embodiment relates to a pet health determination device based on a gradient boosting xgboost model, comprising a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement a pet health determination method based on a gradient boosting xgboost model of embodiment 1.
[0068] Example 3
[0069] The present embodiment relates to a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, a pet health identification method based on a gradient boosting xgboost model of embodiment 1 is implemented.
[0070] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A pet health identification method based on the gradient boosting xgboost model, characterized in that: The following steps are involved: S1. Obtain the historical test data record of the smart pet litter box, the historical test data includes the daily weight, number of defecation, single defecation weight, total defecation weight, defecation time and label data of normal or abnormal health status of all sample cats; S2. The historical detection data is divided into data sets using a ten-fold cross-validation data set division method to perform data set division and xgboost model verification and training, and the xgboost model is optimized in each cross-validation; S3. Performing a recognition model training based on the xgboost algorithm according to the historical detection data to obtain a cat health status discrimination model corresponding to the smart pet cat litter box and the importance of health indicators corresponding to the pet cat litter box; S4. Monitor the performance of the xgboost model, and perform incremental updates of the pet health discrimination model based on the xgboost algorithm and continuous optimization of its model parameters and feature selection according to the historical detection data and the new detection data; S5. The pet health index is smoothed using an exponentially weighted moving average to obtain a warning threshold of the smart pet litter box. When the real-time detection data of the smart pet litter box exceeds the warning threshold, a pet health abnormality warning is issued to the pet owner.
2. A pet health discrimination method based on the gradient boosting xgboost model according to claim 1, characterized in that: The step S1 of obtaining the historical detection data record of the smart pet litter box includes: All detection data of the smart pet litter box are obtained by using pressure sensors at the four corners of the cat litter box, and data preprocessing is performed on each item in the monitoring data. Missing values are filled by polynomial interpolation, outliers are processed by box plot analysis, and data standardization is performed. Then, the preprocessed data are arranged into a time series. The detection data includes pet health data and label data on whether it is normal.
3. A pet health discrimination method based on the gradient boosting xgboost model according to claim 1, characterized in that: The data set partitioning method using ten-fold cross validation described in step S2 to partition the data set and optimize the xgboost model includes: S21. The detection data of all sample cats are divided into ten subsets by stratified sampling. The stratified sampling can ensure that the distribution of the two categories in each subset is similar. Each cross-validation uses each subset as a validation set of the xgboost model, and the rest as a training set. 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 tested. In each cross-validation, the hyperparameters are tuned to improve the learning and generalization capabilities of the model.
4. A pet health discrimination method based on the gradient boosting xgboost model according to claim 1, characterized in that: The step S3 of performing algorithm-based pet health discrimination model training based on historical detection data includes: S31. Input the detection data of the cat into the extreme gradient boosting tree xgboost model, the model iteratively trains multiple decision trees, the output of each decision tree is added to the output of the previous decision tree, and the output of each decision tree is combined to finally obtain the classification result of the health status of the sample cat; S32. The Softmax loss function of the xgboost model in the health classification problem can convert the original output of the model into a probability distribution, and use the exclusive decision tree trained for each health category in iteration to output the probability of the test cat sample being each category, and the category with the highest probability is the final cat health status; S33. Use the xgboost algorithm to screen the importance index of each item of the historical detection data, and select feature indexes used as input of the warning model.
5. A pet health discrimination method based on the gradient boosting xgboost model according to claim 1, characterized in that: The self-updating and continuous optimization of the pet health discrimination model based on the xgboost algorithm according to the historical detection data and the new detection data in step S4 includes: S41. During the model training process, the performance of the xgboost model, such as accuracy, recall and other indicators, is monitored using the validation set. When the model performance reaches a preset threshold or no longer improves significantly, a model update mechanism is triggered; S42. Continuously collect new pet health data, including new cases, new physical examination results, etc. After preprocessing the new data to ensure that it is consistent with the training set data format, the new data is added to the historical detection training set. For large-scale data sets, the xgboost model uses multi-core CPUs 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 achieve incremental updates of the model; S43. In the incremental learning process, the hyperparameters of the xgboost model are adjusted, and the learning rate, the depth and number of nodes of the decision tree, the subsampling rate, the column sampling rate and other hyperparameters are adjusted using cross-validation and other techniques to optimize the model performance, and a regularization term is introduced into 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, screen and optimize the features according to the importance evaluation results of the features, and remove redundant features. After the model is deployed in actual applications, the performance of the model will be continuously monitored. According to the feedback and data changes in the actual application, the xgboost model parameters and feature selection strategy will be adjusted in time to improve the prediction accuracy of the xgboost model.
6. A pet health identification method based on the gradient boosting xgboost model according to claim 1, characterized in that: The smart pet litter box in step S5 obtains a warning threshold and warns the pet owner of abnormal pet health, including: S51. Determine and initialize the smoothing parameters of the exponentially weighted moving average model, calculate the exponentially weighted moving average of the historical detection data and update it with the newly collected data, analyze the smoothing results and check the trends and patterns of the pet health indicators, and set a warning threshold based on the exponentially weighted moving average and a certain standard deviation multiple; S52. Construct an xgboost model, and use the historical detection data to train the xgboost model to obtain the warning model of the smart pet cat litter box; S53. When the real-time monitoring data of the smart pet litter box exceeds the warning threshold, the pet owner is warned of abnormal pet health.
7. A pet health identification device based on the gradient boosting xgboost model, characterized in that: It includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement a pet health identification method based on a gradient boosting xgboost model as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, a pet health identification method based on a gradient boosting xgboost model as described in any one of claims 1-6 is implemented.
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
Method and System for Examining Health Conditions of an Animal
US20230154617A1
Cited By
Pet health state monitor based on multiple sensors
CN121420913A
Intelligent cat health detection method and system based on space-time behavior residual analysis
CN122245734A