Thermal station secondary return water temperature prediction method and device based on XGBoost and neural network
By combining XGBoost, GWO and ANN technologies, an efficient secondary return water temperature prediction model was constructed, which solved the problems of low prediction accuracy and efficiency in the existing technology, and achieved a more accurate secondary return water temperature prediction of thermal stations.
Patent Information
- Application Number
- CN202411978703.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing secondary return water temperature prediction model has low prediction accuracy and efficiency on complex problems.
The secondary return water temperature prediction method of thermal station based on XGBoost and neural network is adopted, and the original feature data is collected through the temperature sensor, and important features are screened using the XGBoost algorithm, and the XGBoost-GWO-ANN secondary return water temperature prediction model is constructed. Combined with Bayesian regularization and GWO gray wolf optimization algorithm, the initial weight and threshold of the ANN model are optimized.
The accuracy and efficiency of secondary return water temperature prediction can be improved, and the secondary return water temperature of the thermal station can be predicted more accurately, thereby helping to optimize the operation of the heating system.
Smart Images

Figure CN119918400A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of temperature processing technology, and in particular to a method and device for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network. Background Art
[0002] In a centralized heating system, the primary network refers to the heat source end of the system, which delivers heat energy to users through the secondary network. The secondary network and the primary network realize heat exchange at the thermal power station, and the pipeline system behind the thermal power station further distributes the heat energy to each user or building. The thermal power station is a system that undertakes the functions of connection, conversion, regulation and monitoring. It is one of the key equipment to ensure the normal operation of the heating system and the comfortable heating of users. The secondary return water temperature of the thermal power station refers to the temperature of the hot water in the secondary network returning to the thermal power station after heating. It can characterize the heating quality, and the temperature control strategy of the thermal power station needs to be adjusted according to the change of the secondary return water temperature. Therefore, it is very important to establish a prediction model for the secondary return water temperature of the thermal power station to ensure the stable operation of the heating system. However, the existing secondary return water temperature prediction model has low prediction accuracy and efficiency for complex problems. Summary of the invention
[0003] The embodiments of the present application provide a method and device for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network to solve the problems of low prediction accuracy and efficiency of the existing secondary return water temperature prediction model for complex problems.
[0004] In a first aspect, an embodiment of the present application provides a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network, the method comprising the following steps:
[0005] Collect original characteristic data through temperature sensor;
[0006] The original feature data set is modeled based on the XGBoost algorithm to obtain the importance weight of each feature, and the first feature data is selected according to the order of the importance weight;
[0007] Processing the first feature data;
[0008] The XGBoost-GWO-ANN secondary return water temperature prediction model was constructed, the first characteristic data was used as the model training data, the ANN artificial neural network model was trained using the Bayesian regularization algorithm, and the GWO grey wolf optimization algorithm was used to find the optimal solution for the initial weights and thresholds of the ANN.
[0009] When the performance indicators of the training set and the test set meet the set requirements, the output results of the secondary return water temperature prediction model are denormalized to obtain the secondary return water temperature prediction results.
[0010] In some embodiments, the modeling of the original feature data set based on the XGBoost algorithm includes:
[0011] By building multiple decision trees and counting the number of times each feature is used in the decision tree to determine the importance score of the feature, the model formula based on the XGBoost algorithm can be expressed as:
[0012]
[0013] Where n is the total number of decision trees in the model; is the predicted value of the i-th input data; f r is the model of the rth decision tree; x i is the i-th input data; G represents the model integrating all decision trees;
[0014] The objective function is minimized by using an additive training method. In each iteration, a decision tree is added to fit the error of the previous model. The iterative process can be expressed as:
[0015]
[0016] The k-th objective function calculation process of the model is:
[0017]
[0018] Where, X obj is the objective function; Used to measure the deviation between the predicted score and the actual score; is the regularization term; T is the number of leaf nodes; θ is the score of the jth leaf node; γ represents the parameter that controls the complexity of the tree; λ is the parameter that limits the score of leaf nodes;
[0019] For each iteration, XGBoost updates the objective function as shown below, and t = 0, use the second-order Taylor expansion to approximate the loss function and seek the solution f that minimizes the objective function t , therefore, its approximate objective function is:
[0020]
[0021] In the process of solving the approximate objective function, the approximate expression of the loss function of all samples and the regularization term are added to obtain a new objective function. The specific calculation process is shown in the following formula:
[0022]
[0023] In the formula, is the first-order derivative; is the second-order derivative; the objective function is ultimately simplified to a univariate quadratic function that is only related to the score of each leaf node. This objective function is minimized by solving the optimal value of the score of each leaf node, as shown in the following formulas:
[0024]
[0025] During the XGBoost training process, the model determines the best split point by calculating the gain of each split candidate point, and enhances the performance of the model by selecting the split point with the largest gain.
[0026] In some embodiments, the constructing of the XGBoost-GWO-ANN secondary return water temperature prediction model includes:
[0027] Performing normalization processing on the input first feature data;
[0028] When configuring the ANN model, set the maximum number of iterations of the ANN model to Max_epochs, the learning rate to η, and the target error to Target_error;
[0029] All parameters of the ANN model are randomly initialized, and the initialized parameters are substituted into the ANN model for preliminary training. According to the predetermined fitness function, the fitness value of each gray wolf is calculated, and these values are sorted, and the three gray wolves with the smallest fitness are selected, which are recorded as α, β, and δ respectively;
[0030] According to the update mechanism of the GWO algorithm, the position of each gray wolf is updated, and the ANN model is rebuilt with the new position parameters and trained again. Finally, the fitness value of each gray wolf is calculated, and the gray wolf with the best fitness is selected to update the position information of the gray wolf.
[0031] Check whether the GWO algorithm has reached the set maximum number of iterations. If not, continue the iterative optimization process; if it has, record the initial weights and thresholds of the ANN model corresponding to the current optimal gray wolf individual α;
[0032] The weights and thresholds obtained by optimizing the GWO algorithm are used to train the ANN model using the Bayesian regularization algorithm. During the continuous iteration of model training, it is determined whether the regularization parameter λ converges. If not, λ is updated continuously. If converged, training is stopped and the optimal model is output.
[0033] The test data is input into the trained ANN model, and the prediction results of the secondary return water temperature of the thermal power station system are output.
[0034] In some embodiments, the constructing of the XGBoost-GWO-ANN secondary return water temperature prediction model includes:
[0035] A three-layer feedforward ANN was used to construct the secondary return water temperature model of the thermal power station, and the Bayesian regularization algorithm was used to train the ANN model;
[0036] First, define the model loss function, which includes the data error term and the regularization term, namely:
[0037] E(w)=E D (w)+λE W (w);
[0038]
[0039] In the formula, E D (w) is the data error term; E W (w) is a regularization term used for weight attenuation; is the kth predicted value of the model; y k is the actual value of secondary return water temperature; N is the total amount of data; M is the number of model weights; w j is the jth weight of the model; λ is the regularization parameter, which is used to control the balance between the data error term and the regularization term;
[0040] Based on the Bayesian regularization loss function, determine whether the regularization parameter converges. If it converges, stop training; if it does not converge, continue to update the regularization parameter;
[0041] The update formula of the regularization parameter is as follows:
[0042]
[0043] Where γ is the number of effective parameters, which is used to measure the complexity of the model; H is the Hessian matrix, J is the Jacobian matrix, and I is the unit matrix;
[0044] Through continuous iteration, the Bayesian regularization algorithm dynamically adjusts the regularization parameters;
[0045] The location information of the gray wolf in the GWO algorithm is used to represent the initial weight threshold of the ANN model, and the initial parameter is optimized;
[0046] The GWO algorithm simulates the social structure and hunting strategy of wolves. The gray wolf group has a clear hierarchical structure, which is divided into four levels: leadership α, auxiliary leadership β, bottom leadership δ, and bottom members ω;
[0047] The GWO algorithm simulates a series of collaborative behaviors of wolves encircling, tracking and attacking prey, gradually narrowing the encirclement and eventually capturing the prey. The behavior of wolves encircling prey is abstracted into a mathematical model, as shown in the following formula:
[0048] A=2a·v1-a;
[0050] C = 2·v2;
[0052] D=|C·X P (t)-X(t)|;
[0053] X(t+1)=X p (t)-A·D;
[0055] In the formula, t represents the number of iterations; X p (t) represents the position vector of the prey; X(t) and X(t+1) both represent the position vectors of the gray wolf in different iteration rounds. The update of the position vector is based on the relative position relationship between the prey and the gray wolf, as well as the cooperation mechanism within the gray wolf group;
[0056] During the update process, three random parameters a, v1 and v2 are introduced and randomly selected in the interval [0, 1];
[0057] Among them, the parameter a is updated as shown in the following formula:
[0058]
[0059] Where l represents the current iteration round, and Max_iteration represents the maximum number of iterations in the update process.
[0060] In the GWO algorithm, every time the position of the gray wolf is updated according to the predetermined search strategy, the fitness value of each gray wolf after the update is calculated; the fitness value reflects the superiority or inferiority of the gray wolf individual in the search space;
[0061] The GWO algorithm refers to the fitness value and selects the three solutions with the smallest fitness value: the best solution X α (t), suboptimal solution X β (t), the third optimal solution X δ (t), and take the three solutions as the leadership positions of the current gray wolf group;
[0062] In subsequent iterations, the GWO algorithm gradually guides the gray wolf group to move to a better area in the search space to find the approximate optimal solution or optimal solution to the problem. The process is shown in the following formula:
[0063] X α (t+1)=X α (t)-A1|C1X α (t)-X(t)|;
[0064] X β (t+1)=X β (t)-A2|C2X β (t)-X(t)|;
[0065] X δ (t+1)=X δ (t)-A3|C1X δ (t)-X(t)|;
[0066]
[0067] Where A represents the relative distance between the gray wolf and its prey, and its value range is [-a, a]. When |A|>1, the gray wolf will move away from the current prey, reflecting the global search ability of the algorithm at this stage, thereby enhancing the exploration effect of the solution space. When |A|<1, the gray wolf will approach the prey for precise pursuit.
[0068] The dimension of the gray wolf population size N in the initial weight optimization algorithm is divided into four main parts, which are: the weight matrix W1 from the input layer to the middle layer, whose dimension depends on the number of nodes in the input layer and the number of nodes in the middle layer; the threshold matrix B1 from the input layer to the middle layer, whose dimension is the same as the number of nodes in the middle layer, representing the threshold of each neuron in the middle layer; the weight matrix W2 from the middle layer to the output layer, whose dimension depends on the number of nodes in the middle layer and the number of nodes in the output layer; the threshold matrix B2 from the middle layer to the output layer, whose dimension is the same as the number of nodes in the output layer, representing the threshold of each neuron in the output layer;
[0069] The fitness function in the GWO algorithm is used to evaluate the quality of each solution and guide the algorithm to search for high-quality solutions. Its construction process is shown in the following formula:
[0070]
[0071] In the formula, M is the number of training samples, b is the number of output layer nodes, is the output of the kth output node under the action of sample s, represents the expected output of the kth output layer node for sample s.
[0072] In some embodiments, the processing of the first feature data includes:
[0073] The three-sigma outlier discrimination method is introduced to identify and correct the abnormal first feature data, as shown in the following formula:
[0074] (μ-3σ,μ+3σ);
[0075] In the formula, μ represents the mean of the characteristic sequence, and σ reflects the degree of dispersion of the sequence, that is, the standard deviation;
[0076] The first characteristic data collected is processed by using a sliding average filtering method. The calculation process of the sliding average filtering method is shown in the following formula:
[0077]
[0078] Where x is the variable that needs to be processed by sliding average filtering; y is the result after filtering; N is the number of data to be averaged, and the value range of N is [3, 14];
[0079] Use Mapminmax function to normalize the first feature data:
[0080]
[0081] In the formula, x is the original input value; x min is the minimum value in the input sample; x max represents the maximum value of the input sample; y represents the normalized value; y max is the minimum value after normalization; y min is the normalized maximum value;
[0082] The feature data set composed of the first feature data is preprocessed and then divided, and the sample data is divided into a training set and a validation set according to a set ratio.
[0083] In some embodiments, it also includes:
[0084] According to the result of XGBoost algorithm sorting the original data feature scores, the secondary circulation water flow F2(k), secondary water supply temperature (T 2,s (k)), secondary return water temperature (T 2,r (k)), outdoor temperature T out (k), instantaneous wind speed WS out (k), relative humidity RH out (k) is the input variable of the secondary return water temperature prediction model.
[0085] In some embodiments, it also includes:
[0086] Filter input features and select root mean square error RMSE and coefficient of determination R 2 As the evaluation index of the secondary return water temperature prediction model, RMSE and R 2 The calculation formulas are:
[0087]
[0088] In the formula, y i is the actual value of the secondary return water temperature data, is the predicted value of the secondary return water temperature data, is the average value of secondary return water temperature data, d is the number of secondary return water temperature data;
[0089] A three-layer feedforward ANN model is constructed based on the screened features. The ANN model includes an input layer, a hidden layer, and an output layer. The number of hidden layer neuron nodes has an important influence on the model performance. The range of the number of hidden layer nodes is obtained through an empirical formula:
[0090]
[0091] Where b, m and l represent the number of nodes in the output layer, hidden layer and input layer of the ANN model respectively.
[0092] In a second aspect, the embodiment of the present application further provides a thermal power station secondary return water temperature prediction device based on XGBoost and neural network, comprising:
[0093] A data acquisition module, used for collecting original characteristic data through a temperature sensor;
[0094] The data screening module is used to model the original feature data set based on the XGBoost algorithm, obtain the importance weight of each feature, and screen out the first feature data according to the order of the importance weight;
[0095] A data processing module, used for processing the first characteristic data;
[0096] The model training module is used to build the XGBoost-GWO-ANN secondary return water temperature prediction model, use the first feature data as the model training data, use the Bayesian regularization algorithm to train the ANN artificial neural network model, and use the GWO Grey Wolf optimization algorithm to find the optimal solution for the initial weights and thresholds of the ANN;
[0097] The result acquisition module is used to perform denormalization processing on the output results of the secondary return water temperature prediction model when the performance indicators of the training set and the test set meet the set requirements, so as to obtain the secondary return water temperature prediction results.
[0098] In a third aspect, an embodiment of the present application further provides a computer device, including: a memory and one or more processors;
[0099] The memory is used to store one or more programs;
[0100] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network.
[0101] In a fourth aspect, an embodiment of the present application further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network as described above.
[0102] The embodiment of the present application collects original feature data through a temperature sensor; models the original feature data set based on the XGBoost algorithm to obtain the importance weight of each feature, and selects the first feature data according to the ranking of the importance weights; processes the first feature data; constructs an XGBoost-GWO-ANN secondary return water temperature prediction model, uses the first feature data as model training data, uses the Bayesian regularization algorithm to train the ANN artificial neural network model, and uses the GWO gray wolf optimization algorithm to find the optimal solution for the initial weights and thresholds of the ANN; when the performance indicators of the training set and the test set meet the set requirements, the output results of the secondary return water temperature prediction model are denormalized to obtain the secondary return water temperature prediction results; and through the combination of XGBoost, GWO and ANN technologies, complex problems are solved together, the prediction performance of the model is improved, and the prediction accuracy and efficiency of the model are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] Figure 1 It is a flow chart of a method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network provided in an embodiment of the present application;
[0104] Figure 2 This is a thermal power station secondary return water temperature prediction model architecture diagram of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0105] Figure 3 It is a rank graph of the gray wolf of a method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network provided in an embodiment of the present application;
[0106] Figure 4 It is an attack prey and search prey diagram of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0107] Figure 5 It is a position update diagram of a gray wolf individual in a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network provided in an embodiment of the present application;
[0108] Figure 6 It is a secondary water supply temperature missing value filling diagram of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0109] Figure 7 It is a graph before and after filtering of secondary water supply temperature sampling values of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0110] Figure 8 It is a data preprocessing flow chart of a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network provided in an embodiment of the present application;
[0111] Fig. 9 This is a feature importance analysis result diagram of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0112] Fig.10 This is a result diagram of an experiment on selecting the number of hidden layer nodes for a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network provided in an embodiment of the present application;
[0113] Fig.11 It is a topological diagram of a secondary return water temperature prediction model of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0114] Fig.12 This is a comparison chart of the prediction results of the ANN model before and after feature screening of a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network provided in an embodiment of the present application;
[0115] Fig.13 This is a RMSE reduction curve before and after feature screening of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0116] Fig.14 It is a prediction performance diagram of an XGBoost-ANN model test set of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0117] Fig.15 It is a relative error graph of an XGBoost-ANN model test set of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0118] Fig.16 It is a prediction performance diagram of an XGBoost-GWO-ANN model test set of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0119] Fig.17It is a relative error diagram of the XGBoost-GWO-ANN model test set of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0120] Fig.18 This is a comparison chart of the prediction values of two prediction models of a thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in an embodiment of the present application;
[0121] Fig.19 This is a relative error comparison diagram of prediction models of a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network provided in an embodiment of the present application;
[0122] Fig. 20 It is a structural schematic diagram of a thermal power station secondary return water temperature prediction device based on XGBoost and neural network provided in an embodiment of the present application;
[0123] Fig.21 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0124] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0125] The method for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network provided in the embodiment can be performed by a device for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network, and the device for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network can be implemented by software and / or hardware, and integrated in a device for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network. The device for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network can be a computer or other equipment.
[0126] Figure 1 This is a flowchart of a method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network provided in an embodiment of the present application. Figure 1 and Figure 2 , the method comprises the following steps:
[0127] 100. Collect original characteristic data through temperature sensor.
[0128] Specifically, the original characteristic data required for secondary return water temperature prediction is collected through sensors at the thermal power station site.
[0129] 200. Model the original feature data set based on the XGBoost algorithm to obtain the importance weight of each feature, and filter out the first feature data according to the order of the importance weight.
[0130] Optionally, the embodiment of the present application uses the XGBoost algorithm to screen the feature set that has a significant impact on the secondary return water temperature. The core idea of XGBoost is to determine the importance score of the feature by constructing multiple decision trees and counting the number of times each feature is used in the decision tree.
[0131] The XGBoost model formula can be expressed as:
[0132]
[0133] Where n is the total number of decision trees in the model; is the predicted value of the i-th input data; f r is the model of the rth decision tree; x i is the i-th input data; G represents the model integrating all decision trees;
[0134] The objective function is minimized by using an additive training method. In each iteration, a decision tree is added to fit the error of the previous model. The iterative process can be expressed as:
[0135]
[0136] The k-th objective function calculation process of the model is:
[0137]
[0138] In the formula, X obj is the objective function; Used to measure the deviation between the predicted score and the actual score; is the regularization term; T is the number of leaf nodes; θ is the score of the jth leaf node; γ represents the parameter that controls the complexity of the tree; λ is the parameter that limits the score of leaf nodes;
[0139] For each iteration, XGBoost updates the objective function as shown below, and t = 0, use the second-order Taylor expansion to approximate the loss function and seek the solution f that minimizes the objective function t , therefore, its approximate objective function is:
[0140]
[0141]
[0142] In the process of solving the approximate objective function, the approximate expression of the loss function of all samples and the regularization term are added to obtain a new objective function. The specific calculation process is shown in the following formula:
[0143]
[0144] In the formula, is the first-order derivative; is the second-order derivative; the objective function is ultimately simplified to a univariate quadratic function that is only related to the score of each leaf node. This objective function is minimized by solving the optimal value of the score of each leaf node, as shown in the following formulas:
[0145]
[0146] During the XGBoost training process, the model determines the best split point by calculating the gain of each split candidate point, and enhances the performance of the model by selecting the split point with the largest gain.
[0147] 300. Process the first feature data.
[0148] Specifically, the filtered data is preprocessed, outliers in the data are identified, data affected by noise is filtered, and finally the data is normalized.
[0149] Optionally, since the data acquisition equipment in the thermal power station system is easily interfered by electromagnetic radiation, environmental noise, etc., there are abnormal data in the operation data. For this reason, the embodiment of the present application introduces a three-sigma outlier discrimination method to identify and correct these abnormal situations, as shown in the following formula:
[0150] (μ-3σ,μ+3σ);
[0151] In the formula, μ represents the mean of the feature sequence, and σ reflects the discreteness of the sequence, that is, the standard deviation; for feature outliers that do not meet the 3-sigma criterion, the average of the adjacent normal values is used to replace them. For the phenomenon of partial data missing due to noise interference and sensor abnormalities, the mean filling method is used as a processing method. By calculating the mean of the feature sequence and using it as a filling replacement for the missing value, the integrity and consistency of the data are ensured. Figure 6 As shown, the method proposed in the embodiment of the present application effectively fills the missing parts of the secondary water supply temperature at 4 locations in the figure.
[0152] The first characteristic data collected is processed by using a sliding average filtering method. The calculation process of the sliding average filtering method is shown in the following formula:
[0153]
[0154] In the formula, x is the variable that needs to be processed by sliding average filtering; y is the result after filtering; N is the number of data to be averaged, and the value range of N is [3, 14]. Here N = 4; the effect after wave processing is as follows Figure 7 As shown, it can be seen that spikes and random noise are effectively suppressed.
[0155] In order to improve the stability of the data and the convergence speed of the model, the Mapminmax function is used to normalize the first feature data:
[0156]
[0157] In the formula, x is the original input value; x min is the minimum value in the input sample; x max represents the maximum value of the input sample; y represents the normalized value; y max is the minimum value after normalization; y min is the maximum value after normalization;
[0158] After data preprocessing, the feature data set composed of the first feature data is divided into a training set and a validation set according to a set ratio (such as a ratio of 7:3). Please refer to Figure 8 .
[0159] 400. Construct an XGBoost-GWO-ANN secondary return water temperature prediction model, use the first feature data as the model training data, use the Bayesian regularization algorithm to train the ANN artificial neural network model, and use the GWO grey wolf optimization algorithm to find the optimal solution for the initial weights and thresholds of the ANN.
[0160] Specifically, the XGBoost-GWO-ANN secondary return water temperature prediction model is constructed, and the filtered feature set is used as the model training data. During the training process, the Bayesian regularization algorithm is used to train the ANN model, and the GWO algorithm is used to find the optimal solution for the initial weights and thresholds of the ANN. When the performance indicators of the training set and the test set meet the requirements, the output results of the model are denormalized to obtain the prediction results of the secondary return water temperature of the thermal power station system.
[0161] Optionally, the first feature data of the input is normalized to speed up the convergence of the algorithm; when configuring the ANN model, the maximum number of iterations of the ANN model is set to Max_epochs, the learning rate is η, and the target error is Target_error; all parameters of the ANN model, including weights and thresholds, are randomly initialized, and the initial range is set to [-1, 1], and the initialized parameters are substituted into the ANN model for preliminary training, and the fitness value of each gray wolf is calculated according to a predetermined fitness function, and these values are sorted, and the three gray wolves with the smallest fitness are selected, which are recorded as α, β, and δ respectively; according to the update mechanism of the GWO algorithm, the position of each gray wolf is updated, and the ANN model is rebuilt with the new position parameters and trained again Training, finally calculating the fitness value of each gray wolf, selecting the gray wolf with the best fitness, and updating the location information of the gray wolf; checking whether the GWO algorithm has reached the set maximum number of iterations Max_iteration, if not, continuing the iterative optimization process; if it has reached, recording the initial weights and thresholds of the ANN model corresponding to the current optimal gray wolf individual α; using the weights and thresholds optimized by the GWO algorithm, using the Bayesian regularization algorithm to train the ANN model for the next step, judging whether the regularization parameter λ converges during the continuous iteration of model training, if not, continue to update λ, if converged, stop training and output the optimal model; input the test data into the trained ANN model, and output the prediction result of the secondary return water temperature of the thermal power station system.
[0162] Exemplarily, the construction of the XGBoost-GWO-ANN secondary return water temperature prediction model includes:
[0163] In order to optimize the network structure of the ANN model and avoid overfitting in the later stage of training, which leads to a decrease in the generalization ability of the model, the embodiment of the present application introduces a Bayesian framework, and introduces a regularization term in the model training to perform explicit probability distribution hypothesis analysis and reasoning on the ANN model parameters to prevent model overfitting, and automatically adjusts the complexity of the network structure through the regularization parameter to improve the generalization ability of the model.
[0164] First, define the model loss function, which includes the data error term and the regularization term, namely:
[0165] E(w)=E D (w)+λE W (w);
[0166]
[0167] In the formula, E D (w) is the data error term; E W (w) is a regularization term used for weight attenuation; is the kth predicted value of the model; y k is the actual value of secondary return water temperature; N is the total amount of data; M is the number of model weights; w j is the jth weight of the model; λ is the regularization parameter, which is used to control the balance between the data error term and the regularization term;
[0168] Based on the Bayesian regularization loss function, determine whether the regularization parameter converges. If it converges, stop training; if it does not converge, continue to update the regularization parameter;
[0169] The update formula of the regularization parameter is as follows:
[0170]
[0171] Where γ is the number of effective parameters, which is used to measure the complexity of the model; H is the Hessian matrix, J is the Jacobian matrix, and I is the unit matrix;
[0172] By continuously iterating the above process, the Bayesian regularization algorithm can dynamically adjust the regularization parameters so that the model can automatically balance data errors and model complexity during training, thereby improving the generalization ability and robustness of the model.
[0173] In order to solve the problem that the random setting of the initial weight threshold of the ANN model can easily cause the prediction model to fall into a local optimal solution, thereby causing the model performance to deteriorate, the embodiment of the present application proposes a GWO-ANN model, in which the position information of the gray wolf in the GWO algorithm represents the initial weight threshold of the ANN model, and optimizes the initial parameters.
[0174] It is understandable that the GWO algorithm is an optimization algorithm inspired by the behavior of gray wolf groups. The algorithm simulates the collaborative behavior between leaders and followers in gray wolf groups and solves the optimization problem by simulating the social structure and hunting strategy of wolf groups. There is a clear hierarchical structure within the gray wolf group, which is divided into four levels: α (leadership), β (auxiliary leadership), δ (bottom-level leadership), and ω (bottom-level members). Figure 3 shown.
[0175] The GWO algorithm simulates a series of collaborative behaviors of wolves encircling, tracking and attacking prey, aiming to solve various complex optimization problems. In order to describe how individual gray wolves adjust their positions according to the location information of prey, gradually narrow the encirclement and finally capture prey, the behavior of wolves encircling prey is abstracted into a mathematical model, as shown in the following formula:
[0176] A=2a·v1-a;
[0178] C = 2·v2;
[0180] D=|C·X P (t)-X(t)|;
[0181] X(t+1)=X p (t)-A·D;
[0183] In the formula, t represents the number of iterations; X p (t) represents the position vector of the prey; X(t) and X(t+1) both represent the position vectors of the gray wolf in different iteration rounds. The update of the position vector is based on the relative position relationship between the prey and the gray wolf, as well as the cooperation mechanism within the gray wolf group;
[0184] During the update process, three random parameters a, v1 and v2 are introduced and randomly selected in the interval [0, 1];
[0185] Among them, the parameter a is updated as shown in the following formula:
[0186]
[0187] Where l represents the current iteration round, and Max_iteration represents the maximum number of iterations in the update process.
[0188] In the GWO algorithm, every time the position of the gray wolf is updated according to the predetermined search strategy, the fitness value of each gray wolf after the update is calculated; the fitness value reflects the superiority or inferiority of the gray wolf individual in the search space;
[0189] The GWO algorithm refers to the fitness value and selects the three solutions with the smallest fitness value: the best solution X α (t), suboptimal solution X β (t), the third optimal solution X δ (t), and take the three solutions as the leadership positions of the current gray wolf group;
[0190] In subsequent iterations, the GWO algorithm gradually guides the gray wolf group to move to a better area in the search space to find the approximate optimal solution or optimal solution to the problem. The process is shown in the following formula:
[0191] X α (t+1)=Xα (t)-A1|C1X α (t)-X(t)|;
[0192] X β (t+1)=X β (t)-A2|C2X β (t)-X(t)|;
[0193] X δ (t+1)=X δ (t)-A3|C1X δ (t)-X(t)|;
[0194]
[0195] In the formula, A represents the relative distance between the gray wolf and its prey, and its value range is [-a, a]. When |A|>1, the gray wolf will move away from the current prey, reflecting the global search ability of the algorithm at this stage, thereby enhancing the exploration effect of the solution space. When |A|<1, the gray wolf will approach the prey for precise pursuit, and the local search ability performs well at this time. In this process, the behavior of the gray wolf simulates its dynamic hunting mechanism in nature, gradually approaching and surrounding the prey. This design enables the algorithm to have a strong global exploration ability in the early stage, enabling the model to avoid falling into the local optimum, and gradually transition to local search in the later stage to improve the accuracy of the solution. The schematic diagram of the position update of the gray wolf hunting process is shown in the figure. Figure 4 and Figure 5 As shown, it can be intuitively demonstrated that the gray wolf gradually approaches and surrounds the prey according to the design of the algorithm, as well as the ability to balance global search and local search at different stages.
[0196] The dimension of the gray wolf population size N in the initial weight (threshold) value optimization algorithm is divided into four main parts, which are: the weight matrix W1 from the input layer to the middle layer, whose dimension depends on the number of nodes in the input layer and the number of nodes in the middle layer; the threshold matrix B1 from the input layer to the middle layer, whose dimension is the same as the number of nodes in the middle layer, representing the threshold of each neuron in the middle layer; the weight matrix W2 from the middle layer to the output layer, whose dimension depends on the number of nodes in the middle layer and the number of nodes in the output layer; the threshold matrix B2 from the middle layer to the output layer, whose dimension is the same as the number of nodes in the output layer, representing the threshold of each neuron in the output layer;
[0197] The fitness function in the GWO algorithm is used to evaluate the quality of each solution and guide the algorithm to search for high-quality solutions. Its construction process is shown in the following formula:
[0198]
[0199] In the formula, M is the number of training samples, b is the number of output layer nodes, is the output of the kth output node under the action of sample s, represents the expected output of the kth output layer node for sample s.
[0200] 500. When the performance indicators of the training set and the test set meet the set requirements, the output results of the secondary return water temperature prediction model are denormalized to obtain the secondary return water temperature prediction results.
[0201] On the basis of the above embodiment, the method of the embodiment of the present application can also be embodied as follows:
[0202] The embodiment of the present application is based on the historical operation data of the thermal power station system and the feature screening model of outdoor meteorological data. The weight and gain of each feature are calculated by the XGBoost algorithm, and the feature data are sorted. The value of weight and gain directly reflects the importance of the feature variable in predicting the secondary return water temperature. The higher the value, the greater the influence of the feature on the prediction result. The priority of each feature variable is as follows: Fig. 9 According to the result of XGBoost algorithm sorting the original data feature scores, the secondary circulation water flow F2(k) and secondary water supply temperature (T 2,s (k)), secondary return water temperature (T 2,r (k)), outdoor temperature T out (k), instantaneous wind speed WS out 9k), relative humidity RH out (k) is the input variable of the secondary return water temperature prediction model.
[0203] On the basis of the above embodiment, the method of the embodiment of the present application can also be embodied as follows:
[0204] Filter input features and select root mean square error RMSE and coefficient of determination R 2 As the evaluation index of the secondary return water temperature prediction model, RMSE and R 2 The calculation formulas are:
[0205]
[0206] In the formula, y i is the actual value of the secondary return water temperature data, is the predicted value of the secondary return water temperature data, is the average value of secondary return water temperature data, d is the number of secondary return water temperature data;
[0207] A three-layer feedforward ANN model is constructed based on the filtered features. The ANN model includes an input layer, a hidden layer, and an output layer. The number of hidden layer neuron nodes has an important influence on the model performance. The number of hidden layer nodes is obtained through an empirical formula in the range of [5, 11]:
[0208]
[0209] Where b, m and l represent the number of nodes in the output layer, hidden layer and input layer of the ANN model respectively.
[0210] For example, Fig.10 The trend of RMSE and R2 changing with the number of hidden layer nodes is shown in Figure 1. With the goal of achieving the lowest RMSE and the highest R2, experiments were conducted on different numbers of hidden layer nodes. The RMSE of the ANN model with 9 hidden layer nodes was 0.30 and R2 was 0.88. Therefore, the number of hidden layer neurons was set to 9.
[0211] After using the XGBoost algorithm for feature screening, the input layer of the prediction model is designed to be 6 neurons, corresponding to different input features. The first 3 neurons (1 to 3) are responsible for receiving the historical operation data of the thermal power station, specifically the secondary water supply temperature, the secondary return water temperature and the secondary circulation water flow; the last 3 neurons (4 to 6) are responsible for receiving outdoor meteorological data, including outdoor temperature, relative humidity and instantaneous wind speed. In order to effectively process these input features and predict the secondary return water temperature at the next moment, the embodiment of the present application sets a hidden layer containing 9 neurons in the model, so that it can learn complex patterns and associated information in multivariate inputs. Finally, the output layer of the model contains 1 neuron, which is used to predict and output the secondary return water temperature value at the next moment.
[0212] The network structure of the secondary return water temperature prediction model established in the embodiment of the present application can be summarized as 6-9-1, that is, the input layer has 6 neurons, the hidden layer has 9 neurons, and the output layer has 1 neuron. The specific topological structure of the model is as follows: Fig.11 As shown, it clearly shows the connection relationship and data flow between neurons in each layer.
[0213] In order to verify the impact of feature screening on model prediction performance, the present embodiment compares the RMSE and R2 of the ANN model before and after feature screening, as well as the model inference time. Fig.12 It can be seen that the ANN model after feature screening has a better fitting effect than the model before screening. Fig.13 It shows that the ANN model after feature screening tends to converge at the 25th iteration, and the final RMSE is 0.30, while the ANN model without feature screening begins to converge at the 56th iteration, and the final RMSE is 0.41.
[0214] After feature screening, the prediction performance of the secondary return water temperature prediction model increased by 11.3% and the RMSE decreased by 26.8%. In terms of time performance, the embodiment of the present application conducted 5 inference time tests, and the model inference time was shortened by 46% compared with that before feature screening. The model prediction experimental results before and after feature screening are shown in Table 4.
[0215] To verify the effectiveness of the proposed method, the present embodiment uses the unoptimized XGBoost-ANN model and the XGBoost-GWO-ANN model optimized by the GWO algorithm for training data, respectively, and performs training under the same conditions and tests on the same test set. The prediction results and relative errors of the XGBoost-ANN model are shown in Figure 2. Fig.14 and Fig.15 As shown; the prediction results and relative errors of the XGBoost-GWO-ANN model are shown in Fig.16 and Fig.17 As shown; the comparison of the predicted values of the two prediction methods is as follows Fig.18 As shown, the relative error is Fig.19 As shown. Fig.18 It can be seen that after using the XGBoost algorithm for feature screening, the XGBoost-GWO-ANN model uses the GWO algorithm to optimize the initial weights and thresholds of the ANN model, and its prediction results are highly consistent with the true values. In contrast, although the XGBoost-ANN model also uses XBoost for feature screening, it has not been optimized by the Gray Wolf algorithm. After testing the 500th sample, there is a large deviation between the predicted value and the true value, resulting in a decrease in model accuracy. Fig.19 It can be seen that the relative error between the predicted value and the true value of the XGBoost-GWO-ANN model is significantly lower than the error of the XGBoost-ANN model. The embodiment of the present application obtains experimental results through multiple experiments and averages the experimental results. The RMSE and R2 comparison of the XGBoost-ANN model and the XGBoost-GWO-ANN model are shown in Table 5. Compared with the unoptimized model, the RMSE of the ANN model optimized by the Gray Wolf algorithm is reduced by 20%, and the R2 is increased by 3.4%, which fully proves that the ANN model XGBoost-GWO-ANN optimized by the GWO algorithm has stronger generalization ability and higher accuracy.
[0216] The embodiment of this application uses data collected by sensors of a central heating system in a residential community in Beijing to conduct a modeling experiment. The experimental results show that the R2 of the ANN prediction model after feature screening is improved by 11.3% and the RMSE is reduced by 26.8% compared with the model before feature screening; the model training time is reduced by 3.4% and the model reasoning time is shortened by 46%. Compared with the unoptimized ANN model, the RMSE of the ANN model optimized by the GWO algorithm is reduced by 20% and the R2 is improved by 3.4%.
[0217] Based on the above examples, please refer to Fig. 20 , an embodiment of the present application provides a thermal power station secondary return water temperature prediction device based on XGBoost and neural network, and the thermal power station secondary return water temperature prediction device based on XGBoost and neural network specifically includes: a data acquisition module 201, a data screening module 202, a data processing module 203, a model training module 204 and a result acquisition module 205.
[0218] Among them, the data acquisition module 201 is used to collect original feature data through the temperature sensor; the data screening module 202 is used to model the original feature data set based on the XGBoost algorithm, obtain the importance weight of each feature, and filter out the first feature data according to the order of the importance weight; the data processing module 203 is used to process the first feature data; the model training module 204 is used to construct the XGBoost-GWO-ANN secondary return water temperature prediction model, use the first feature data as the model training data, use the Bayesian regularization algorithm to train the ANN artificial neural network model, and use the GWO gray wolf optimization algorithm to find the optimal solution for the initial weights and thresholds of the ANN; the result acquisition module 205 is used to perform denormalization processing on the output results of the secondary return water temperature prediction model when the performance indicators of the training set and the test set meet the set requirements, and obtain the secondary return water temperature prediction result.
[0219] As mentioned above, the embodiment of the present application collects original feature data through a temperature sensor; models the original feature data set based on the XGBoost algorithm to obtain the importance weight of each feature, and selects the first feature data according to the ranking of the importance weight; processes the first feature data; constructs an XGBoost-GWO-ANN secondary return water temperature prediction model, uses the first feature data as model training data, uses the Bayesian regularization algorithm to train the ANN artificial neural network model, and uses the GWO gray wolf optimization algorithm to find the optimal solution for the initial weights and thresholds of the ANN; when the performance indicators of the training set and the test set meet the set requirements, the output results of the secondary return water temperature prediction model are denormalized to obtain the secondary return water temperature prediction results; through the combination of XGBoost, GWO and ANN technologies, complex problems are solved together, the prediction performance of the model is improved, and the prediction accuracy and efficiency of the model are improved.
[0220] The thermal power station secondary return water temperature prediction device based on XGBoost and neural network provided in the embodiment of the present application can be used to execute the thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in the above embodiment, and has corresponding functions and beneficial effects.
[0221] The embodiment of the present application also provides a computer device, which can integrate the secondary return water temperature prediction device of the thermal power station based on XGBoost and neural network provided in the embodiment of the present application. Fig.21 Schematic diagram of a computer device provided in an embodiment of the present application. Fig.21 The computer device includes: an input device 33, an output device 34, a memory 32 and one or more processors 31; the memory 32 is used to store one or more programs; when the one or more programs are executed by the one or more processors 31, the one or more processors 31 implement the thermal power station secondary return water temperature prediction method based on XGBoost and neural network as provided in the above embodiment. The input device 33, the output device 34, the memory 32 and the processor 31 can be connected by a bus or other means, Fig.21 The example of connecting through bus is taken in the following.
[0222] The processor 31 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 32, that is, realizes the above-mentioned thermal power station secondary return water temperature prediction method based on XGBoost and neural network.
[0223] The computer device provided above can be used to execute the thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in the above embodiment, and has corresponding functions and beneficial effects.
[0224] An embodiment of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute a method for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network. The method for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network includes: as mentioned above, the embodiment of the present application imports detection standard parameters and trains an OCR optical character recognition model; when it is detected that a label sends a print instruction to a printer, the print stream sent to the printer is intercepted in real time to generate an electronic image; the actual print image is collected; the electronic image and the print image are imported into the OCR model for comparison to identify whether there are defects in the printed label of the print image.
[0225] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape devices; computer device memory or random access memory, such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer device in which the program is executed, or may be located in a different second computer device, which is connected to the first computer device via a network (such as the Internet). The second computer device can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer devices connected via a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0226] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present application is not limited to the above-mentioned method for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network, and can also execute related operations in the method for predicting the secondary return water temperature of a thermal power station based on XGBoost and a neural network provided in any embodiment of the present application.
[0227] The thermal power station secondary return water temperature prediction device, storage medium and computer equipment based on XGBoost and neural network provided in the above embodiments can execute the thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the thermal power station secondary return water temperature prediction method based on XGBoost and neural network provided in any embodiment of the present application.
[0228] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network, characterized in that: The method comprises the following steps: Collect original characteristic data through temperature sensor; The original feature data set is modeled based on the XGBoost algorithm to obtain the importance weight of each feature, and the first feature data is selected according to the order of the importance weight; Processing the first feature data; The XGBoost-GWO-ANN secondary return water temperature prediction model was constructed, the first characteristic data was used as the model training data, the ANN artificial neural network model was trained using the Bayesian regularization algorithm, and the GWO grey wolf optimization algorithm was used to find the optimal solution for the initial weights and thresholds of the ANN. When the performance indicators of the training set and the test set meet the set requirements, the output results of the secondary return water temperature prediction model are denormalized to obtain the secondary return water temperature prediction results.
2. The method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network according to claim 1 is characterized in that: The modeling of the original feature data set based on the XGBoost algorithm includes: By building multiple decision trees and counting the number of times each feature is used in the decision tree to determine the importance score of the feature, the model formula based on the XGBoost algorithm can be expressed as: Where n is the total number of decision trees in the model; is the predicted value of the i-th input data; f r is the model of the rth decision tree; x i is the i-th input data; G represents the model integrating all decision trees; The objective function is minimized by using an additive training method. In each iteration, a decision tree is added to fit the error of the previous model. The iterative process can be expressed as: The k-th objective function calculation process of the model is: Where, X obj is the objective function; Used to measure the deviation between the predicted score and the actual score; is the regularization term; T is the number of leaf nodes; θ is the score of the jth leaf node; γ represents the parameter that controls the complexity of the tree; λ is the parameter that limits the score of leaf nodes; For each iteration, XGBoost updates the objective function as shown below, and t = 0, use the second-order Taylor expansion to approximate the loss function and seek the solution f that minimizes the objective function t , therefore, its approximate objective function is: In the process of solving the approximate objective function, the approximate expression of the loss function of all samples and the regularization term are added to obtain a new objective function. The specific calculation process is shown in the following formula: In the formula, is the first-order derivative; is the second-order derivative; the objective function is ultimately simplified to a univariate quadratic function that is only related to the score of each leaf node. This objective function is minimized by solving the optimal value of the score of each leaf node, as shown in the following formulas: During the XGBoost training process, the model determines the best split point by calculating the gain of each split candidate point, and enhances the performance of the model by selecting the split point with the largest gain.
3. The method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network according to claim 1 is characterized in that: The construction of the XGBoost-GWO-ANN secondary return water temperature prediction model includes: Performing normalization processing on the input first feature data; When configuring the ANN model, set the maximum number of iterations of the ANN model to Max_epochs, the learning rate to η, and the target error to Target_error; All parameters of the ANN model are randomly initialized, and the initialized parameters are substituted into the ANN model for preliminary training. According to the predetermined fitness function, the fitness value of each gray wolf is calculated, and these values are sorted, and the three gray wolves with the smallest fitness are selected, which are recorded as α, β, and δ respectively; According to the update mechanism of the GWO algorithm, the position of each gray wolf is updated, and the ANN model is rebuilt with the new position parameters and trained again. Finally, the fitness value of each gray wolf is calculated, and the gray wolf with the best fitness is selected to update the position information of the gray wolf. Check whether the GWO algorithm has reached the set maximum number of iterations. If not, continue the iterative optimization process; if it has, record the initial weights and thresholds of the ANN model corresponding to the current optimal gray wolf individual α; The weights and thresholds obtained by optimizing the GWO algorithm are used to train the ANN model using the Bayesian regularization algorithm. During the continuous iteration of model training, it is determined whether the regularization parameter λ converges. If not, λ is updated continuously. If converged, training is stopped and the optimal model is output. The test data is input into the trained ANN model, and the prediction results of the secondary return water temperature of the thermal power station system are output.
4. The method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network according to claim 3 is characterized in that: The construction of the XGBoost-GWO-ANN secondary return water temperature prediction model includes: A three-layer feedforward ANN was used to construct the secondary return water temperature model of the thermal power station, and the Bayesian regularization algorithm was used to train the ANN model; First, define the model loss function, which includes the data error term and the regularization term, namely: E(w)=E D (w)+λE W (w); In the formula, E D (w) is the data error term; E W (w) is a regularization term used for weight attenuation; is the kth predicted value of the model; y k is the actual value of secondary return water temperature; N is the total amount of data; M is the number of model weights; w j is the jth weight of the model; λ is the regularization parameter, which is used to control the balance between the data error term and the regularization term; Based on the Bayesian regularization loss function, determine whether the regularization parameter converges. If it converges, stop training; if it does not converge, continue to update the regularization parameter; The update formula of the regularization parameter is as follows: Where γ is the number of effective parameters, which is used to measure the complexity of the model; H is the Hessian matrix, J is the Jacobian matrix, and I is the unit matrix; Through continuous iteration, the Bayesian regularization algorithm dynamically adjusts the regularization parameters; The location information of the gray wolf in the GWO algorithm is used to represent the initial weight threshold of the ANN model, and the initial parameter is optimized; The GWO algorithm simulates the social structure and hunting strategy of wolves. The gray wolf group has a clear hierarchical structure, which is divided into four levels: leadership α, auxiliary leadership β, bottom leadership δ, and bottom members ω; The GWO algorithm simulates a series of collaborative behaviors of wolves encircling, tracking and attacking prey, gradually narrowing the encirclement and eventually capturing the prey. The behavior of wolves encircling prey is abstracted into a mathematical model, as shown in the following formula: A=2a·v1-a; C = 2·v2; D=|C·X P (t)-X(t)|; X(t+1)=X p (t)-A·D; In the formula, t represents the number of iterations; X p (t) represents the position vector of the prey; X(t) and X(t+1) both represent the position vectors of the gray wolf in different iteration rounds. The update of the position vector is based on the relative position relationship between the prey and the gray wolf, as well as the cooperation mechanism within the gray wolf group; During the update process, three random parameters a, v1 and v2 are introduced and randomly selected in the interval [0, 1]; Among them, the parameter a is updated as shown in the following formula: Where l represents the current iteration round, and Max_iteration represents the maximum number of iterations in the update process. In the GWO algorithm, every time the position of the gray wolf is updated according to the predetermined search strategy, the fitness value of each gray wolf after the update is calculated; the fitness value reflects the superiority or inferiority of the gray wolf individual in the search space; The GWO algorithm refers to the fitness value and selects the three solutions with the smallest fitness value: the best solution X α (t), suboptimal solution X β (t), the third optimal solution X δ (t), and take the three solutions as the leadership positions of the current gray wolf group; In subsequent iterations, the GWO algorithm gradually guides the gray wolf group to move to a better area in the search space to find the approximate optimal solution or optimal solution to the problem. The process is shown in the following formula: X α (t+1)=X α (t)-A1|C1X α (t)-X(t)|; X β (t+1)=X β (t)-A2|C2X β (t)-X(t)|; X δ (t+1)=X δ (t)-A3|C1X δ (t)-X(t)|; Where A represents the relative distance between the gray wolf and its prey, and its value range is [-a, a]. When |A|>1, the gray wolf will move away from the current prey, reflecting the global search ability of the algorithm at this stage, thereby enhancing the exploration effect of the solution space. When |A|<1, the gray wolf will approach the prey for precise pursuit. The dimension of the gray wolf population size N in the initial weight optimization algorithm is divided into four main parts, which are: the weight matrix W1 from the input layer to the middle layer, whose dimension depends on the number of nodes in the input layer and the number of nodes in the middle layer; the threshold matrix B1 from the input layer to the middle layer, whose dimension is the same as the number of nodes in the middle layer, representing the threshold of each neuron in the middle layer; the weight matrix W2 from the middle layer to the output layer, whose dimension depends on the number of nodes in the middle layer and the number of nodes in the output layer; the threshold matrix B2 from the middle layer to the output layer, whose dimension is the same as the number of nodes in the output layer, representing the threshold of each neuron in the output layer; The fitness function in the GWO algorithm is used to evaluate the quality of each solution and guide the algorithm to search for high-quality solutions. Its construction process is shown in the following formula: In the formula, M is the number of training samples, b is the number of output layer nodes, is the output of the kth output node under the action of sample s, represents the expected output of the kth output layer node for sample s.
5. The method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network according to claim 1 is characterized in that: The processing of the first characteristic data includes: The three-sigma outlier discrimination method is introduced to identify and correct the abnormal first feature data, as shown in the following formula: (μ-3σ,μ+3σ); In the formula, μ represents the mean of the characteristic sequence, and σ reflects the degree of dispersion of the sequence, that is, the standard deviation; The first characteristic data collected is processed by using a sliding average filtering method. The calculation process of the sliding average filtering method is shown in the following formula: Where x is the variable that needs to be processed by sliding average filtering; y is the result after filtering; N is the number of data to be averaged, and the value range of N is [3, 14]; Use Mapminmax function to normalize the first feature data: In the formula, x is the original input value; x min is the minimum value in the input sample; x max represents the maximum value of the input sample; y represents the normalized value; y max is the minimum value after normalization; y min is the maximum value after normalization; The feature data set composed of the first feature data is preprocessed and then divided, and the sample data is divided into a training set and a verification set according to a set ratio.
6. The method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network according to claim 1 is characterized in that: Also includes: According to the result of XGBoost algorithm sorting the original data feature scores, the secondary circulation water flow F2(k), secondary water supply temperature (T 2,s (k)), secondary return water temperature (T 2,r (k)), outdoor temperature T out (k), instantaneous wind speed WS out (k), relative humidity RH out (k) is the input variable of the secondary return water temperature prediction model.
7. The method for predicting secondary return water temperature of a thermal power station based on XGBoost and neural network according to claim 1 is characterized in that: Also includes: Filter input features and select root mean square error RMSE and determination coefficient R 2 As the evaluation index of the secondary return water temperature prediction model, RMSE and R 2 The calculation formulas are: In the formula, y i is the actual value of the secondary return water temperature data, is the predicted value of the secondary return water temperature data, is the average value of secondary return water temperature data, d is the number of secondary return water temperature data; A three-layer feedforward ANN model is constructed based on the screened features. The ANN model includes an input layer, a hidden layer, and an output layer. The number of hidden layer neuron nodes has an important influence on the model performance. The range of the number of hidden layer nodes is obtained through an empirical formula: Where b, m and l represent the number of nodes in the output layer, hidden layer and input layer of the ANN model respectively.
8. A thermal power station secondary return water temperature prediction device based on XGBoost and neural network, characterized in that: include: A data acquisition module, used for collecting original characteristic data through a temperature sensor; The data screening module is used to model the original feature data set based on the XGBoost algorithm, obtain the importance weight of each feature, and screen out the first feature data according to the order of the importance weight; A data processing module, used for processing the first characteristic data; The model training module is used to build the XGBoost-GWO-ANN secondary return water temperature prediction model, use the first feature data as the model training data, use the Bayesian regularization algorithm to train the ANN artificial neural network model, and use the GWO Grey Wolf optimization algorithm to find the optimal solution for the initial weights and thresholds of the ANN; The result acquisition module is used to perform denormalization processing on the output results of the secondary return water temperature prediction model when the performance indicators of the training set and the test set meet the set requirements, so as to obtain the secondary return water temperature prediction results.
9. A computer device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network as described in any one of claims 1-7.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions, when executed by a computer processor, are used to execute a method for predicting secondary return water temperature of a thermal power station based on XGBoost and a neural network as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for predicting cleanliness based on stacking algorithm
CN117669780A
Building return water temperature prediction method based on artificial neural network
CN117973582A
Method and system for predicting primary side heat load of heating station
CN118798446A
Battery SOC estimation method fusing improved GRU network and Bayesian filtering
CN118914854A
System and method for predicting building thermal loads
US20050192915A1
Cited By
Two-dimensional layout algorithm selection method and system based on machine learning
CN120952220A