Bearing fault diagnosis method based on XGBoost and feature combination
Patent Information
- Application Number
- CN202311485678.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-11-08
AI Technical Summary
该方法选择随机森林算法作为模型,该算法在处理小规模数据集时表现较好,但在处理大规模复杂数据时,准确率偏低、泛化能力较弱、效率不够高,此外,该模型较复杂,解释性相对较差
[0030] 1. This invention employs Bayesian optimization for hyperparameter optimization. Compared to traditional methods such as manual parameter tuning, grid search, and random search, which all require enumeration when setting hyperparameter ranges and are heavily influenced by human experience, lacking universality, Bayesian optimization only requires setting the maximum and minimum values of specified parameters and the number of iterations. It automatically searches for the optimal value. In each iteration, it reviews the previous iteration results, abandoning those with poor results and instead searching for the optimal solution closer to better results. This method is more intelligent and better suited to today's environments with large or complex datasets. Furthermore, under the same parameter range and number of iterations, it has a shorter running time, and the resulting hyperparameter combinations can improve model accuracy and efficiency.
Smart Images

Figure CN117520960B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of mechanical manufacturing technology, and specifically relates to a bearing fault diagnosis method based on XGBoost and feature combination. Background Technology
[0002] In recent years, with the rapid development of industries such as chemical and oil and gas, the use of centrifugal compressors has become increasingly widespread. These units transport hazardous chemicals, so a malfunction in any part of the equipment can trigger a chain reaction, leading to anything from equipment shutdown and repairs to hazardous chemical leaks, causing numerous adverse effects on society. Bearings are one of the key and most vulnerable components of this equipment. Statistics show that over 41% of machine failures in rotating equipment are caused by bearings. Bearing failures are not sudden but rather a gradual and progressive process. If they can be predicted early in the bearing's lifespan, on-site maintenance costs and many adverse hazards can be significantly reduced. Therefore, accurate and timely prediction of bearing problems is extremely important.
[0003] Currently, there are three main methods used for bearing fault diagnosis:
[0004] 1. Fault diagnosis models based on signal processing widely use methods such as Fast Fourier Transform (FFT), Wavelet Transform (WT), and Empirical Mode Decomposition (EMD). These methods directly analyze measurable signals using mathematical methods such as correlation functions to obtain specific results. However, these methods are easily affected by signal noise and are highly dependent on signal detection and processing. In industrial settings, centrifugal compressors operate in complex environments, and the vibration signals measured are almost always non-stationary multi-component signals. The useful signals are often submerged in strong noise backgrounds. Therefore, the requirements for detection methods and equipment are very high, and these methods are difficult to implement.
[0005] 2. Deep learning-based fault diagnosis models widely used include Artificial Neural Networks (ANNs) and Long Short-Term Memory Networks (LSTMs). Although deep learning algorithms have significant advantages in automatic identification and extraction of data features, they are commonly used in fields such as speech recognition, image processing, and text recognition, and are less frequently used for structured data collected by SCADA systems with distinct features.
[0006] 3. Machine learning-based fault diagnosis models, widely used methods include Random Forest (RF) and Support Vector Machine (SVM). RF is easy to extend and less prone to overfitting, but the model is more complex, has relatively poor interpretability, and takes a long time to process large amounts of data; SVM is suitable for processing small sample data, but the training time is long when processing large-scale data.
[0007] The above fault diagnosis models are mainly for rolling bearings. However, centrifugal compressors in the petrochemical industry, due to their large loads and high speeds, mainly use sliding bearings. Although sliding bearings and rolling bearings have similarities, their structural differences are significant, resulting in different faults. Under high temperature, high speed, and high load conditions, the journal and bearing shell of a sliding bearing undergo thermal expansion, the bearing clearance disappears, and the metal comes into direct contact, leading to bearing shell wear, bearing failure, and other serious bearing damage. This often causes even greater damage to the unit and a sharp increase in maintenance costs.
[0008] Patent application No. 202011386823.4 discloses a bearing fault diagnosis method based on random search and convolutional neural networks. By combining a random search algorithm to optimize hyperparameters and establishing a convolutional neural network model, it is used for intelligent diagnosis of rolling bearing faults, solving the problems of insufficient accuracy in traditional methods and the tedious and time-consuming manual parameter tuning in intelligent methods. This method first initializes the hyperparameter combination, then configures the distribution function of the random search, then continuously updates the distribution function of the random search, and finally, after multiple experiments, selects the optimal bearing diagnosis model. Compared with traditional methods, this method improves accuracy and increases the efficiency of hyperparameter optimization. The random search used in this method is a basic optimization algorithm. While it performs well when the parameter space is small, its efficiency becomes very low when the parameter space becomes large or complex, requiring significant time and computational resources for searching, and potentially missing excellent hyperparameter combinations. Furthermore, the convolutional neural network used in this method is one of the representative algorithms of deep learning. It has a great advantage in the automatic identification and extraction of data features, but it is more suitable for fields such as speech recognition, image processing, and text recognition. It is less commonly used for structured data collected by SCADA systems with obvious features.
[0009] Patent application number 202110708178.1 discloses a bearing fault diagnosis method based on random forest and feature fusion, including data processing steps, feature extraction steps, feature fusion steps, model training steps, and fault diagnosis steps. It is a method for intelligent and automated bearing fault diagnosis by extracting time-domain and frequency-domain features separately, fusing them, and using a random forest algorithm. This solves the problems of low accuracy and untimely prediction in traditional methods of equipment fault diagnosis. While the method selects the random forest algorithm as the model, which performs well on small datasets, it suffers from low accuracy, weak generalization ability, and insufficient efficiency when dealing with large-scale complex data. Furthermore, the model is relatively complex and has relatively poor interpretability.
[0010] It is evident that existing methods suffer from insufficient accuracy and efficiency in bearing fault diagnosis, particularly when processing large volumes of structured data acquired by SCADA systems with clearly defined characteristics. Furthermore, existing methods are inefficient in hyperparameter optimization, hindering timely and accurate prediction of bearing faults and potentially causing missed optimal maintenance opportunities. Additionally, traditional methods, which rely solely on sealing gas flow rate for fault identification, are prone to misdiagnosis. Summary of the Invention
[0011] The purpose of this invention is to overcome the shortcomings of the prior art and provide a bearing fault diagnosis method based on XGBoost and feature combination that combines the BO-XGBoos algorithm and sealing gas flow characteristics to diagnose centrifugal compressor bearing faults, thereby improving the accuracy of the judgment and achieving effective early warning of bearing faults.
[0012] The objective of this invention is achieved through the following technical solution: a bearing fault diagnosis method based on XGBoost and feature combination, comprising the following steps:
[0013] S1. Data preprocessing, including the following sub-steps:
[0014] S11. Collect bearing operation data and handle missing and outlier values in the collected data: For missing values, use a loop in Jupyter to find the missing value, calculate the average of the data in the 5 rows before the missing value, and if there are less than 5 rows of data before the missing value, take the data after the missing value to make up the missing value, and fill the missing value position with the average value; For outlier values, call the Isolation Forest module in the SkLearn library to find and delete the outlier values, and then fill the missing values formed by deleting the outlier values, calculate the average of the data in the 3 rows before the missing value position and fill the missing value position;
[0015] S12. Extract features from the dataset and remove data features irrelevant to bearing fault diagnosis; calculate the correlation of the data using the Spearman rank correlation coefficient, then use a multiple regression model to identify the data most suitable as the dependent variable, and finally delete the remaining data.
[0016] S13. Mark the fault data. Based on the equipment operation and maintenance records, mark the fault data and count the number of fault data and normal data.
[0017] S14. Determine the ratio of fault data to normal data. If the ratio is lower than the preset threshold, use the SMOTE method to oversample the fault data until the ratio of fault data to normal data is not less than the preset threshold.
[0018] S15. Extract fault data and use the min() function to find the minimum value in the fault data;
[0019] S16. Divide the processed dataset into a training set and a test set;
[0020] S2. Construct the BO-XGBoost and feature combination model, including the following three sub-steps:
[0021] S21. Use the BO algorithm to find the optimal combination of hyperparameters, including the number of weak learners n_estimators, the maximum depth of the weak learner decision tree max_depth, the weight reduction coefficient learning_rate, and the number of iterations.
[0022] S22. Constructing the BO-XGBoost model: Substitute the optimal hyperparameter combination into the XGBoost algorithm to form the BO-XGBoost model;
[0023] S23. Construct a line graph model of sealing gas flow rate characteristics: Call the matplotlib module to read the test set data, use the dependent variable data determined in S12 as the x-axis and the sealing gas flow rate as the y-axis to create a line graph, and draw a straight line parallel to the x-axis as the reference line with the minimum value of the fault data as the benchmark; call the clear_output function in the IPython.display module to import the collected sealing gas flow rate data to form a monitoring value curve. If any point on the monitoring value curve is below the reference line, an early warning will be issued, and the reference line and the monitoring value curve will be displayed through the display function.
[0024] S3. Train the BO-XGBoost model, including the following sub-steps:
[0025] S31. Input the training set data into the BO-XGBoost model, train the model until the number of iterations is reached, and select the optimal model from them;
[0026] S32. Import the test set data into the trained BO-XGBoost model, predict the dependent variable, and output the predicted value.
[0027] S33. Calculate the coefficient of determination and mean squared error between the predicted and true values, and calculate the model running time. Compare the coefficient of determination, mean squared error, and model running time with the expected values. If the coefficient of determination is less than the expected value, or the mean squared error is greater than the expected value, or the model running time is greater than the expected value, then re-optimize the hyperparameters using Bayesian optimization, substitute the optimal combination into XGBoost to rebuild the model, and perform training and prediction until the coefficient of determination, mean squared error, and model running time all reach the expected values. Then output the model as the final BO-XGBoost prediction model.
[0028] S4. Input the bearing operation data to be predicted into the BO-XGBoost prediction model and the sealing gas flow characteristic line graph model respectively. If the predicted value output by the BO-XGBoost prediction model exceeds the set reference value, an early warning will be issued. If any point on the monitoring value curve in the sealing gas flow characteristic line graph model is above the reference line, an early warning will be issued. When both models output early warnings, the combined model will output a fault alarm.
[0029] The beneficial effects of this invention are:
[0030] 1. This invention employs Bayesian optimization for hyperparameter optimization. Compared to traditional methods such as manual parameter tuning, grid search, and random search, which all require enumeration when setting hyperparameter ranges and are heavily influenced by human experience, lacking universality, Bayesian optimization only requires setting the maximum and minimum values of specified parameters and the number of iterations. It automatically searches for the optimal value. In each iteration, it reviews the previous iteration results, abandoning those with poor results and instead searching for the optimal solution closer to better results. This method is more intelligent and better suited to today's environments with large or complex datasets. Furthermore, under the same parameter range and number of iterations, it has a shorter running time, and the resulting hyperparameter combinations can improve model accuracy and efficiency.
[0031] 2. The XGBoost algorithm selected in this invention, compared with traditional random forests, support vector machines, gradient boosting decision trees, etc., has a loss function that performs a second-order Taylor expansion on the error part, thus achieving higher accuracy. In addition, it performs parallel selection for each weak learner, such as the decision tree building process, to find suitable child nodes for splitting features and feature values, thereby improving operational efficiency. When tested on the same dataset, XGBoost's speed and accuracy are higher than other algorithms. Based on the inherent advantages of this algorithm, it is more suitable for processing today's large and complex databases.
[0032] 3. Combining the BO-XGBoost algorithm with sealing gas flow characteristics to diagnose centrifugal compressor bearing faults can improve the accuracy of the judgment and achieve effective early warning of bearing faults. Attached Figure Description
[0033] Figure 1 This is a flowchart of the bearing fault diagnosis method for a centrifugal compressor according to the present invention;
[0034] Figure 2 This is a schematic diagram of the Bayesian optimization principle of the present invention;
[0035] Figure 3This is a schematic diagram of the XGBoost algorithm of the present invention;
[0036] Figure 4 This is a comparison chart of predicted and actual values for the test set data. Detailed Implementation
[0037] Based on the similarities and differences between sliding bearings and rolling bearings, this invention will use machine learning and feature combination methods to diagnose bearing faults in centrifugal compressors.
[0038] Firstly, regarding the selection of machine learning algorithms, existing technologies struggle with noise handling in complex environments when collecting vibration signals. The dataset required for this invention comprises pressure, differential pressure, temperature, flow rate, and rotational speed collected during equipment operation. These data are readily available in industrial environments and are generally supported by mature monitoring and storage systems, such as SCADA systems. Therefore, data collection is convenient and requires no additional detection equipment. Addressing the time-consuming nature of traditional machine learning algorithms when processing large-scale data, this invention selects the XGBoost algorithm. This algorithm not only boasts high prediction accuracy but also fast training speed. Caching techniques and parallelization can further accelerate model training, resulting in superior performance, especially when handling large-scale datasets.
[0039] Secondly, regarding the selection of characteristics, under normal operating conditions, there is a gap between the bearing bush and the bearing shell. During rotation, the gap is filled with lubricating oil for cooling and lubrication, carrying away heat. Simultaneously, due to the special structure of centrifugal compressors and the potentially hazardous nature of the transmission medium, sealing gas is usually introduced into the bearing area to prevent lubricating oil from entering the process and causing oil leakage or even greater damage. To avoid this, the sealing gas pressure is usually slightly higher than the lubricating oil pressure. Therefore, some sealing gas can seep into the lubricating oil system through the gap between the shaft and the bearing bush. Under high temperature, high speed, and high load operating conditions, the journal and bearing bush of the sliding bearing undergo thermal expansion, gradually reducing the bearing gap and the flow area of the sealing gas. Consequently, the sealing gas flow rate also decreases. As the gap becomes smaller... Direct contact between metals causes bearing wear, which increases the flow area and sealing gas consumption. Because this expansion process is short and the gap between the shaft and bearing is already small, and data acquisition is usually intermittent, it is difficult to see the decreasing flow trend. However, wear is irreversible. Once it occurs, the gap will widen and the sealing gas flow will increase. Subsequently, once data acquisition begins, the increasing trend of the flow curve will be more obvious. Therefore, the increase in sealing gas flow can be used as a reference for diagnosing sliding bearing faults. However, the sealing gas control system is complex. Before entering the system, its temperature, valve opening (flow rate), cleanliness, etc., must be strictly controlled. In addition, it is also affected by the complex and ever-changing environment on site. Therefore, it is inaccurate to predict bearing faults based solely on this point.
[0040] To address the aforementioned issues, this solution combines the XGBoos algorithm with sealing gas flow characteristics to diagnose centrifugal compressor bearing faults, thereby improving the accuracy of the diagnosis.
[0041] Definitions of abbreviations and key terms
[0042] 1. Centrifugal compressor: The impeller of the internal rotor drives the gas to rotate at high speed, which generates centrifugal force. Due to the diffusion flow of the gas in the impeller, the flow velocity and pressure of the gas after passing through the impeller are increased, and compressed gas is continuously produced.
[0043] 2. Sliding bearings: Bearings that operate under sliding friction. Sliding bearings operate smoothly, reliably, and without noise. Under liquid lubrication conditions, the sliding surfaces are separated by lubricating oil and do not come into direct contact, which can greatly reduce friction loss and surface wear, and the oil film also has a certain vibration absorption capacity.
[0044] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0045] like Figure 1 As shown, a bearing fault diagnosis method based on XGBoost and feature combination according to the present invention includes the following steps:
[0046] S1. Data preprocessing, including the following sub-steps:
[0047] S11. Collect bearing operation data and handle missing and outlier values in the collected data: Because errors may occur when the system acquires data in actual work, data processing is necessary to avoid importing erroneous data. Specifically, for missing values, a loop is used in Jupyter to find them, and the average of the data in the five rows preceding the missing value is calculated. If there are fewer than five rows of data before the missing value, the remaining data is used to fill in the missing value position with the average. For outliers, the Isolation Forest module in the SkLearn library is called to find and delete outliers. This module is a tree-based method that attempts to detect outliers by isolating them, making it suitable for handling large datasets. This module can accurately find outliers, and then fill in the missing values resulting from deleting outliers by calculating the average of the three rows of data preceding the missing value position (if there are fewer than three rows, the remaining data is used to fill in the missing value position) and filling in the missing value position.
[0048] S12. Extract features from the dataset, removing data features irrelevant to bearing fault diagnosis and retaining valuable features to improve data quality. This is because some parameters collected during equipment operation parameter collection are not for monitoring equipment status, such as start-up count and running time; these features need to be removed. Each model algorithm typically has only one dependent variable. If multiple dependent variables exist in the collected data, such as four monitoring points for centrifugal compressor bearings, three features need to be removed to meet model computation requirements. In this case, Spearman's rank correlation coefficient is used to calculate the correlation between the data. A correlation coefficient close to 1 indicates a strong linear relationship between two variables. Then, a multiple regression model is used to identify the most suitable data for the dependent variable, using two parameters as dependent variables and other parameters as independent variables. The model's goodness of fit (R²) is then used to determine the optimal data for the dependent variable. 2 This method is used to determine which parameter is more suitable as the primary dependent variable. If a parameter has a high R-squared value in the multiple regression model, it indicates that it has a stronger explanatory power for the model and is more suitable as the primary dependent variable. The dataset collected in this invention contains four dependent variables. Using Spearman's rank correlation coefficient and a multiple regression model, one feature was ultimately selected as the dependent variable, and the remaining data were deleted.
[0049] S13. Mark the fault data. Based on the equipment operation and maintenance records, mark the fault data and count the number of fault data and normal data.
[0050] S14. Import the SMOTE() function from the imblearn library for SMOTE oversampling. Determine the ratio of fault data to normal data. If the ratio is lower than a preset threshold, SMOTE oversampling is applied to the fault data. Because equipment stability is a key concern for maintenance personnel in the petrochemical industry under normal circumstances, repairs are carried out immediately after a fault, resulting in a significant shortage of fault data in the dataset. This leads to a clear imbalance between normal and fault data, causing the model to perform well on the training set but poorly on the test set. To improve this situation, oversampling is necessary. This invention uses SMOTE oversampling, which involves randomly selecting a point from the minority class data, finding the four closest sample points, and randomly selecting four new sample points from the four line segments connecting the selected sample point and the four closest sample points. This process is repeated until the ratio of fault data to normal data is not less than the preset threshold. In this embodiment, there are 492 fault data points, which are expanded to 2800, consistent with the normal data volume.
[0051] S15. Extract fault data and use the min() function to find the minimum value in the fault data, which will be used as the reference line data for drawing the line chart later. In this embodiment, it is 282.
[0052] S16. Divide the processed dataset into a training set and a test set in a 7:3 ratio. The training set is used to train the established model, while the test set is used as a tool to evaluate the model's fault diagnosis capability.
[0053] S2. Construct the BO (Bayesian Optimization)-XGBoost and feature combination model, including the following three sub-steps:
[0054] S21. Use the BO algorithm to find the optimal combination of hyperparameters, including the number of weak learners n_estimators, the maximum depth of the weak learner decision tree max_depth, the weight reduction coefficient learning_rate, and the number of iterations.
[0055] Bayesian optimization (BO) is a global optimization algorithm based on probability distributions. It's a method for optimizing black-box functions, finding the global optimum in fewer iterations. Based on Bayes' theorem and Gaussian process regression, it gradually approaches the global optimum by continuously exploring and utilizing the objective function. Bayesian optimization has two core components: a probabilistic surrogate model and a sampling function. Depending on whether the number of parameters is fixed, probabilistic surrogate models are divided into parametric and non-parametric models. Compared to parametric models with fixed parameters, non-parametric models are more flexible, and Bayesian methods are less prone to overfitting. Gaussian processes are a commonly used non-parametric model. The sampling function is constructed based on the posterior probability distribution, and the next optimal evaluation point is selected by maximizing the sampling function. In simple terms, the Bayesian optimization process involves reviewing previous iterations during each iteration, avoiding searching for solutions near x with poor results, and instead looking for solutions near x with better results. This significantly improves search efficiency. The Bayesian optimization process is as follows: Figure 2 As shown. The specific implementation method is as follows: First, the parameter value range and the number of iterations are set. In this embodiment, the number of weak learners (n_estimators), the maximum depth of the weak learner decision tree (max_depth), and the weight reduction coefficient (learning_rate) are set to (50, 150), (3, 10), and (0.05, 0.15), respectively; then, the BO algorithm is used to calculate and select the parameter combination that makes the acquisition function obtain the maximum value as the optimal hyperparameter combination;
[0056] The BO algorithm uses Gaussian regression; Gaussian process regression is a probability model based on Gaussian distribution, used to model the objective function. It consists of the mean function m:x→R and the covariance function k:x×x→R, representing the uncertainty estimate of the objective function at different input values. The model of this process is: f(x)=gp(m(x),k(x,x)), where g represents the Gaussian function;
[0057] The specific optimization process for Gaussian regression is as follows:
[0058] S211. Determine whether the model is initialized. If so, use the set of maximum collection function value points selected in the previous round as training data. Otherwise, randomly generate initialization points as training data.
[0059] S212. Perform Gaussian regression: Obtain the mean μ of the Gaussian regression using the training data. s and variance σ s 2 The expression is as follows:
[0060] μ s (x)=μ0(x)+k(x) T (k+σ 2 I) -1 (ym) (1)
[0061]
[0062] Where y represents the observed value; s represents the number of evaluations; and k(x) represents the number of evaluations. T Let μ0(x) be the transpose of k(x,x), and let μ0(x) be the initial mean of the Gaussian regression. 2 Let I be the initial noise variance, and let I be the identity matrix.
[0063] S213. The acquisition function is a key strategy for selecting the next sampling point. It combines the uncertainty of the prior model with information from existing observations to evaluate the improvement of the objective function at different input values. Common acquisition (AC) functions include PI-based, expected improvement (EI), and confidence boundary (UCB) functions, which aim to balance exploration and utilization to help find possible optimal solutions. The acquisition function of this invention uses the PI acquisition function, which selects the position as the evaluation point based on the PI strategy preference, where the improvement is smaller than the current optimal objective function value. PI Acquisition Function The calculation method is as follows:
[0064]
[0065] Among them, D 1:s Indicates the observed dataset; v *ξ represents the current optimal function value; φ represents the equilibrium parameter; φ represents the cumulative density function of the standard normal distribution; p() represents the PI acquisition function.
[0066] S214. Calculate the value of the maximum acquisition function and determine whether the value is greater than the preset target value. If so, output the parameters corresponding to the maximum acquisition function as the dataset for the next round of training and return to step S211 until the set number of iterations is reached; otherwise, return to step S212.
[0067] S215. Select the optimal model and obtain the optimal parameters. In this embodiment, the optimal combination is: n_estimators = 104, max_depth = 10, learning_rate = 0.11637, and the number of iterations is 25.
[0068] In optimizing hyperparameters, this case study uses 5-fold cross-validation to calculate the mean squared error (MSE) of the model. The sample dataset is divided into five subsets: four are used as training data, and the remaining subset is used as validation data. This process is repeated five times, selecting one subset as validation data each time and using the rest as training data. The error from these five iterations is averaged to obtain the final error estimate. Using K-fold cross-validation avoids the influence of dataset selection on the results, thus improving model performance.
[0069] S22. Constructing the BO-XGBoost Model: Substitute the optimal hyperparameter combination into the XGBoost algorithm to form the BO-XGBoost model. XGBoost is a machine learning algorithm based on the Gradient Boosting framework, capable of handling classification and regression problems. It is based on Classification and Regression Trees (CART) and Random Forest. For a training set, XGBoost iterates through multiple rounds, keeping the tree model unchanged in each iteration. First, a model is obtained by training with a CART tree. Each time a new tree is added, a bias value is generated for each sample. This sample bias value is then used as a new training set, denoted as Model 1 bias. CART trees are then used to train a new model, resulting in Model 2 bias. This process is repeated until a set exit condition is met. All models are then superimposed to obtain the optimal model. The specific principle and process are as follows: Figure 3 As shown, it performs a second-order Taylor expansion of the loss function and adds regularization to the objective function, which improves accuracy and prevents overfitting. Furthermore, it can handle missing values and supports parallel computation, thereby improving both accuracy and speed.
[0070] The overall expression for the XGBoost objective function is as follows:
[0071]
[0072] The first part of the formula is the loss function, which is the sum of the errors between the true value and the predicted value; the second part is the regularization term, which sums up the complexity of t trees and is used to prevent overfitting. The expression for the regularization term is as follows:
[0073]
[0074] In the formula, γ and λ represent coefficients controlling the penalty intensity; T represents the number of leaf nodes in the current tree; ω j This represents the weight of the j-th leaf node;
[0075] The objective function is simplified using a second-order Taylor expansion, and the regularization term is substituted into the objective function expression to obtain:
[0076]
[0077] g i h represents the first gradient of the loss function. j I represents the second gradient of the loss function; j Let represent the set of leaf node samples; simplifying equation (6), we obtain the following expression:
[0078]
[0079] In the formula, G j express H j express
[0080] Transforming the objective function into a quadratic function, the optimal solution is expressed as follows:
[0081]
[0082] Substituting the optimal solution into the objective function, we obtain the optimal objective function:
[0083]
[0084] After calculating the optimal objective function, the gradient of the error with respect to the parameters is calculated using the backpropagation algorithm. Then, the model parameters are updated using the gradient descent algorithm until the set number of training iterations is reached. Finally, the model with the best performance is selected as the final prediction model.
[0085] S23. Construct a line graph model of sealing gas flow rate characteristics: Call the matplotlib module to read the test set data, use the dependent variable data determined in S12 as the x-axis and the sealing gas flow rate as the y-axis to create a line graph, and draw a straight line parallel to the x-axis as the reference line with the minimum value of the fault data as the benchmark; call the clear_output function in the IPython.display module to import the collected sealing gas flow rate data to form a monitoring value curve. If any point on the monitoring value curve is below the reference line, an early warning will be issued, and the reference line and the monitoring value curve will be displayed through the display function.
[0086] S3. Train the BO-XGBoost model, including the following sub-steps:
[0087] S31. Input the training set data into the BO-XGBoost model, train the model until the number of iterations is reached, and select the optimal model from them;
[0088] S32. Import the test set data into the trained BO-XGBoost model, predict the dependent variable, and output the predicted value.
[0089] S33. Calculate the coefficient of determination and mean squared error between the predicted and actual values, and calculate the model running time. Compare the coefficient of determination, mean squared error, and model running time with the expected values respectively. For the BO-XGBoost model, the coefficient of determination (R²) is generally chosen. 2 The evaluation is based on mean squared error (MSE) and runtime (efficiency). 2 R is an indicator for evaluating the goodness of fit of a regression model; it represents the proportion of variance in the dependent variable explained by the model. 2 The value of is between 0 and 1; the closer it is to 1, the better the model fits. MSE is the most commonly used evaluation metric in regression models; it is the average of the sum of squares of the differences between the predicted and actual values. The smaller the value, the better the model's predictive ability. Runtime is the time from when the model starts running until it finally predicts the result. Generally, the shorter the time, the better, indicating high model efficiency. If the coefficient of determination is less than the expected value, or the mean squared error is greater than the expected value, or the model runtime is greater than the expected value, then Bayesian optimization is used to optimize the hyperparameters again. The optimal combination is then substituted into XGBoost to rebuild the model for training and prediction until the coefficient of determination, mean squared error, and model runtime all reach the expected values. Finally, the model is output as the final BO-XGBoost prediction model.
[0090] S4. Input the bearing operation data to be predicted into the BO-XGBoost prediction model and the sealing gas flow characteristic line graph model respectively. If the predicted value output by the BO-XGBoost prediction model exceeds the set reference value, an early warning will be issued. If any point on the monitoring value curve in the sealing gas flow characteristic line graph model is above the reference line, an early warning will be issued. When both models output early warnings, the combined model will output a fault alarm.
[0091] Substituting the actual and predicted values of the objective function from the test set in this embodiment into the calculation, the predicted values are compared with the actual values, for example... Figure 4 As shown in the figure. In this case, the coefficient of determination is 0.996, almost close to 1, indicating that the fitting effect meets expectations. The average of the sum of squares of the differences between the true and predicted values of the objective function in the test set is 0.00019, demonstrating the model's excellent predictive ability. The time taken for the model to output the predicted value from the start of its operation is 0.45 seconds, a very short time, indicating high model efficiency.
[0092] Since the feature model references the measured values, it only needs to check whether the latest collected feature data value is above or below the reference line. If it is above, a fault warning will be output.
[0093] When actual parameters are input, if the BO-XGBoost model predicts a value exceeding the reference value, it will issue a warning. Similarly, if the feature model predicts a value exceeding the reference line, it will also issue a warning. When both models issue warnings, the combined model will issue an alarm to alert maintenance personnel for intervention. Once the combined model is built, only the newly collected data needs to be imported. The model will automatically process and analyze the data, then output prediction results to diagnose and predict the condition of the bearing, eliminating the need for manual judgment.
[0094] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.
Claims
1. A bearing fault diagnosis method based on XGBoost and feature combination, characterized in that, Includes the following steps: S1. Data preprocessing, including the following sub-steps: S11. Collect bearing operation data and handle missing and outlier values in the collected data: For missing values, use a loop in Jupyter to find the missing value, calculate the average of the data in the 5 rows before the missing value, and if there are less than 5 rows of data before the missing value, take the data after the missing value to make up the missing value, and fill the missing value position with the average value; For outlier values, call the Isolation Forest module in the SkLearn library to find and delete the outlier values, and then fill the missing values formed by deleting the outlier values, calculate the average of the data in the 3 rows before the missing value position and fill the missing value position; S12. Extract features from the dataset and remove data features irrelevant to bearing fault diagnosis; calculate the correlation of the data using the Spearman rank correlation coefficient, then use a multiple regression model to identify the data most suitable as the dependent variable, and finally delete the remaining data. S13. Mark the fault data. Based on the equipment operation and maintenance records, mark the fault data and count the number of fault data and normal data. S14. Determine the ratio of fault data to normal data. If the ratio is lower than the preset threshold, use the SMOTE method to oversample the fault data until the ratio of fault data to normal data is not less than the preset threshold. S15. Extract fault data and use the min() function to find the minimum value in the fault data; S16. Divide the processed dataset into a training set and a test set; S2. Construct the BO-XGBoost and feature combination model, including the following three sub-steps: S21. Use the BO algorithm to find the optimal combination of hyperparameters, including the number of weak learners n_estimators, the maximum depth of the weak learner decision tree max_depth, the weight reduction coefficient learning_rate, and the number of iterations. S22. Constructing the BO-XGBoost model: Substitute the optimal hyperparameter combination into the XGBoost algorithm to form the BO-XGBoost model; S23. Construct a line graph model of sealing gas flow rate characteristics: Call the matplotlib module, read the test set data, use the dependent variable data determined in S12 as the horizontal axis and the sealing gas flow rate as the vertical axis to create a line graph, and draw a straight line parallel to the horizontal axis as the reference line with the minimum value of the fault data as the benchmark. The collected sealing gas flow rate data is imported by calling the clear_output function in the IPython.display module to form a monitoring value curve. If any point on the monitoring value curve is below the reference line, an early warning is issued, and the reference line and the monitoring value curve are displayed through the display function. S3. Train the BO-XGBoost model, including the following sub-steps: S31. Input the training set data into the BO-XGBoost model, train the model until the number of iterations is reached, and select the optimal model from them; S32. Import the test set data into the trained BO-XGBoost model, predict the dependent variable, and output the predicted value. S33. Calculate the coefficient of determination and mean square error between the predicted and actual values, and calculate the model running time. Compare the coefficient of determination, mean square error, and model running time with the expected values respectively. If the coefficient of determination is less than the expected value, or the mean squared error is greater than the expected value, or the model running time is greater than the expected value, then Bayesian optimization is used to optimize the hyperparameters again, and the optimal combination is substituted into XGBoost to rebuild the model for training and prediction until the coefficient of determination, mean squared error, and model running time all reach the expected values. Then the model is output as the final BO-XGBoost prediction model. S4. Input the bearing operation data to be predicted into the BO-XGBoost prediction model and the sealing gas flow characteristic line graph model respectively. If the predicted value output by the BO-XGBoost prediction model exceeds the set reference value, an early warning will be issued. If any point on the monitoring value curve in the sealing gas flow characteristic line graph model is above the reference line, an early warning will be issued. When both models output early warnings, the combined model will output a fault alarm.
2. The bearing fault diagnosis method based on XGBoost and feature combination according to claim 1, characterized in that, The specific implementation method of step S21 is as follows: First, set the parameter value range and the number of iterations; then use the BO algorithm to calculate and select the parameter combination that makes the acquisition function obtain the maximum value as the optimal hyperparameter combination. The BO algorithm uses Gaussian regression; Gaussian process regression is a probability model based on Gaussian distribution, used to model the objective function. It consists of the mean function m:x→R and the covariance function k:x×x→R, representing the uncertainty estimate of the objective function at different input values. The model of this process is: f(x)=gp(m(x),k(x,x)), where g represents the Gaussian function; The specific optimization process for Gaussian regression is as follows: S211. Determine whether the model is initialized. If so, use the set of maximum collection function value points selected in the previous round as training data. Otherwise, randomly generate initialization points as training data. S212. Perform Gaussian regression: Obtain the mean μ of the Gaussian regression using the training data. s and variance σ s 2 The expression is as follows: m s (x)=μ0(x)+k(x) T (k+σ 2 I) -1 (y) (1) Where y represents the observed value; s represents the number of evaluations; and k(x) represents the number of evaluations. T Let μ0(x) be the transpose of k(x,x), and let μ0(x) be the initial mean of the Gaussian regression. 2 Let I be the initial noise variance, and let I be the identity matrix. S213. Calculate the acquisition function: The acquisition function uses the PI acquisition function. The calculation method is as follows: Among them, D 1:s Indicates the observed dataset; v * ξ represents the current optimal function value; φ represents the equilibrium parameter; φ represents the cumulative density function of the standard normal distribution; p() represents the PI acquisition function; S214. Calculate the value of the maximum acquisition function and determine whether the value is greater than the preset target value. If so, output the parameters corresponding to the maximum acquisition function as the dataset for the next round of training and return to step S211 until the set number of iterations is reached; otherwise, return to step S212. S215. Select the optimal model and obtain the optimal parameters.
3. The bearing fault diagnosis method based on XGBoost and feature combination according to claim 1, characterized in that, In step S22, a model is first trained using a CART tree. Each time a new tree is added, a bias value is generated for each sample. The sample bias value is then used as a new training set and denoted as Model 1 bias. The CART tree is then used to train a new model, resulting in Model 2 bias. This process is repeated until the set exit condition is met. All models are then superimposed to obtain the optimal model. The overall expression for the XGBoost objective function is as follows: The first part of the formula is the loss function, which is the sum of the errors between the true value and the predicted value; the second part is the regularization term, which sums up the complexity of t trees and is used to prevent overfitting. The expression for the regularization term is as follows: In the formula, γ and λ represent coefficients controlling the penalty intensity; T represents the number of leaf nodes in the current tree; ω j This represents the weight of the j-th leaf node; The objective function is simplified using a second-order Taylor expansion, and the regularization term is substituted into the objective function expression to obtain: g i h represents the first gradient of the loss function. j I represents the second gradient of the loss function; j Let represent the set of leaf node samples; simplifying equation (6), we obtain the following expression: In the formula, G j express H j express Transforming the objective function into a quadratic function, the optimal solution is expressed as follows: Substituting the optimal solution into the objective function, we obtain the optimal objective function: After calculating the optimal objective function, the gradient of the error with respect to the parameters is calculated using the backpropagation algorithm. Then, the model parameters are updated using the gradient descent algorithm until the set number of training iterations is reached. Finally, the model with the best performance is selected as the final prediction model.
Citation Information
Patent Citations
Bearing fault diagnosis method based on random search and convolutional neural network
CN112686366A
Bearing fault diagnosis method based on random forest and fusion features
CN113255591A
Wind turbine generator main shaft bearing fault prediction method
CN110674842A
Intelligent early warning and online diagnosis method and system for equipment fault of air and smoke system
CN113390641A