A gate group joint control method integrating SHAP method and gene expression programming
By integrating the SHAP method and gene expression programming, the irrigation area canal system data is filtered and processed to achieve accurate prediction of gate flow and opening, solving the problems of labor consumption and poor accuracy in traditional methods, and providing a more intuitive and real-time The relationship between gates is expressed.
Patent Information
- Application Number
- CN202311684491.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-08
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-12-08
AI Technical Summary
The traditional gate group joint control method in irrigation areas has the problems of being labor-intensive, having poor measurement and adjustment accuracy, and being difficult to observe in real time. In particular, it is difficult to efficiently predict gate flow and opening in complex canal systems.
The gate group joint control method that combines the SHAP method and gene expression programming is used to collect the gate flow and water level data of the irrigation area canal system, filter the characteristic variables, perform standardized processing, and use the gene expression programming algorithm to adjust the parameters to obtain the gate flow function and The prediction results of the opening function are analyzed combined with the evaluation indicators.
It achieves more accurate and real-time prediction of gate flow and opening, saves manpower, improves adjustment accuracy, intuitively represents the influence relationship between gates, and solves the shortcomings of traditional methods.
Smart Images

Figure CN117473876B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of joint regulation of canal sluice groups, and in particular to a sluice group joint control method integrating a SHAP method and gene expression programming. Background Art
[0002] Irrigation districts are a key area for agricultural water conservation, and rational use of water resources is crucial for developing water-efficient agriculture. Irrigation districts feature complex and widespread canal distribution, resulting in low water resource management efficiency during peak water use periods and requiring significant manpower. In the development of modern irrigation districts, the coordinated regulation and scheduling prediction of sluice gates within canal systems has become a key research focus for digital twin projects. How to efficiently and real-timely predict gate flow and openings across multiple sluice gates is a pressing challenge.
[0003] Traditional sluice group joint control is based on experience or calculation methods based on traditional hydraulic formulas. However, when faced with the complex canal systems in irrigation areas, existing methods have the problems of being labor-intensive, having poor measurement and adjustment accuracy, and being difficult to observe in real time. Summary of the Invention
[0004] In response to the above-mentioned deficiencies in the prior art, the present invention provides a gate group joint control method that integrates the SHAP method and gene expression programming to solve the problems of the prior art methods such as high labor consumption, poor measurement and adjustment accuracy, and difficulty in real-time observation.
[0005] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is: a gate group joint control method integrating the SHAP method and gene expression programming, comprising the following steps:
[0006] S1: Collect the gate flow and water level data of the irrigation canal system, and use the SHAP method to screen the characteristic variables of the gate flow and water level data of the irrigation canal system;
[0007] S2: The selected characteristic variable combinations are used as input factors, and the input factors are standardized using the range method;
[0008] S3: The processed data is run through the genetic expression programming algorithm to adjust the parameters and obtain the prediction results of the gate flow function and opening function;
[0009] S4: Use evaluation indicators to evaluate and analyze the prediction results of the gate flow function and opening function, and complete the gate group joint control that integrates the SHAP method and gene expression programming.
[0010] The beneficial effect of the above scheme is: the present invention considers the mathematical expression of a certain flow rate through the gate and the gate opening from the relationship between the gates of the entire canal system. The prediction is not based on traditional hydraulic formulas, but is data-driven as the core, which is more real-time and accurate, saves manpower, and more intuitively shows the influence relationship between the gates, solving the problems of existing methods such as labor-intensive, poor measurement and adjustment accuracy, and difficulty in real-time observation.
[0011] Furthermore, the SHAP method is used in S1 to screen the characteristic variables of the irrigation canal gate flow and water level data. The specific method is: the irrigation canal gate flow and water level data are transmitted to the interpreter in SHAP, and the importance ranking of each feature for the prediction results is obtained, and the influencing factors with an importance score of 0.04 or above are used as characteristic variables.
[0012] The beneficial effect of the above further solution is: through the above technical solution, the SHAP method is used to obtain the importance score value of the prediction result, and the importance of 0.04 and above is selected as the feature variable for the input of the model.
[0013] Furthermore, the normalization formula in S2 is:
[0014]
[0015] Among them, z' is the input data after normalization, z is the input data before transformation, is the mean and σ is the standard deviation.
[0016] The beneficial effect of the above further solution is that: through the above technical solution, the range method is used to standardize the data, which facilitates calculation and model construction.
[0017] Furthermore, random short-term numerical constants are used to process digital constants in the S3 gene expression programming algorithm. The parameters adjusted in the gene expression programming algorithm include the number of chromosomes, the number of genes, the function set, the connection function, the fitness function, the individual mutation probability, the gene mutation probability, the inversion probability, the single-point crossover probability, the double-point crossover probability, the gene crossover probability, the gene transposition probability and the random constant RNC.
[0018] The beneficial effect of the above further solution is that: through the above technical solution, relevant parameters in the gene expression programming algorithm are set for iterative training to obtain the best numerical function.
[0019] Furthermore, the gene expression programming algorithm in S3 includes the following sub-steps:
[0020] S3-1: Initialize parameters and population, and calculate fitness value;
[0021] S3-2: Determine whether the termination condition is met based on the fitness value. If yes, end the algorithm; if not, proceed to step S3-3;
[0022] S3-3: Save the best individuals and obtain a new population through selection, replication, mutation, recombination and transposition operations, evolution generation +1, and return to step S3-2.
[0023] The beneficial effect of the above further solution is: through the above technical solution, based on the gene expression programming algorithm, the parameters are adjusted and run to obtain the prediction results of the gate flow function and the opening function.
[0024] Furthermore, the evaluation index in S4 includes the coefficient of determination R 2 , mean absolute error MAE and mean square error MSE, the formula is:
[0025]
[0026]
[0027]
[0028] Among them, Y is the measured value, is the average value of the measured values, Y i is the predicted value, is the average value of the predicted value, i is the selected comparison variable, and n is the number of comparison variables.
[0029] The beneficial effect of the above further solution is that: through the above technical solution, the gate flow and opening function obtained are evaluated using the determination coefficient, mean absolute error and mean square error, thereby improving the calculation accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Flowchart of a gate group joint control method that integrates the SHAP method and gene expression programming.
[0031] Figure 2 This is a logic diagram of a gate group joint control method that integrates the SHAP method and gene expression programming.
[0032] Figure 3 This is the canal distribution map of the study area.
[0033] Figure 4 This is a distribution diagram of the importance ranking of factors affecting the flow rate through the gate.
[0034] Figure 5 This is a distribution diagram of the importance ranking of factors affecting gate opening. DETAILED DESCRIPTION
[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0036] like Figure 1 and Figure 2 As shown, a gate group joint control method integrating SHAP method and gene expression programming includes the following steps:
[0037] S1: Collect the gate flow and water level data of the irrigation canal system, and use the SHAP method to screen the characteristic variables of the gate flow and water level data of the irrigation canal system;
[0038] S2: The selected characteristic variable combinations are used as input factors, and the input factors are standardized using the range method;
[0039] S3: The processed data is run through the genetic expression programming algorithm to adjust the parameters and obtain the prediction results of the gate flow function and opening function;
[0040] S4: Use evaluation indicators to evaluate and analyze the prediction results of the gate flow function and opening function, and complete the gate group joint control that integrates the SHAP method and gene expression programming.
[0041] In S1, the SHAP method is used to screen the characteristic variables of the irrigation canal gate flow and water level data. The specific method is: the irrigation canal gate flow and water level data are transmitted to the interpreter in SHAP, the importance ranking of each feature for the prediction results is obtained, and the influencing factors with an importance score of 0.04 or above are used as characteristic variables.
[0042] The standardization formula in S2 is:
[0043]
[0044] Among them, z' is the input data after normalization, z is the input data before transformation, is the mean and σ is the standard deviation.
[0045] The S3 gene expression programming algorithm uses random short-term numerical constants to process digital constants. The parameters adjusted in the gene expression programming algorithm include the number of chromosomes, the number of genes, the function set, the connection function, the fitness function, the individual mutation probability, the gene mutation probability, the inversion probability, the single-point crossover probability, the double-point crossover probability, the gene crossover probability, the gene transposition probability and the random constant RNC.
[0046] The gene expression programming algorithm in S3 consists of the following steps:
[0047] S3-1: Initialize parameters and population, and calculate fitness value;
[0048] S3-2: Determine whether the termination condition is met based on the fitness value. If yes, end the algorithm; if not, proceed to step S3-3;
[0049] S3-3: Save the best individuals and obtain a new population through selection, replication, mutation, recombination and transposition operations, evolution generation +1, and return to step S3-2.
[0050] The fitness calculation of the Gene Expression Programming (GEP) algorithm is divided into two main parts: decoding and fitness calculation. Decoding is the process of converting genotypes into phenotypes, while fitness calculation is the process of calculating individual fitness based on phenotypes. The decoding process of the GEP algorithm includes the following steps:
[0051] The genotype is divided into a head and a tail, where the head contains the function set and the terminator, and the tail contains the terminator and the stop codon;
[0052] Decode the genotype in the tail into an expression tree based on the function set and terminator in the head;
[0053] Traverse the expression tree and replace variable nodes with actual variable values.
[0054] The fitness function is used to calculate individual fitness. Fitness serves as the basis for selection during evolution and is the driving force behind population evolution. Therefore, the design of the fitness function is crucial to the success of an evolutionary algorithm. This solution uses a fitness function based on maximizing the mean absolute error (MAE) of the fitness function.
[0055] The evaluation indicators in S4 include the coefficient of determination R 2 , mean absolute error MAE and mean square error MSE. The smaller the MAE and MSE values are, the better the prediction effect of the model is. 2 The closer it is to 1, the better the prediction effect of the model. The formula is:
[0056]
[0057]
[0058]
[0059] Among them, Y is the measured value, is the average value of the measured values, Y i is the predicted value, is the average value of the predicted value, i is the selected comparison variable, and n is the number of comparison variables.
[0060] In one embodiment of the present invention, the canal system from 9.6 Station to Xingfu Station in the Santun River Irrigation District in Xinjiang is the main research area. The canal system includes one main canal section and five branch (diversion) diversion outlets. The research object is the flow rate and gate opening of the Yushugou Gate. The water level and flow status of the other 10 diversion outlets in the canal system during the same time period are considered to obtain the flow rate and gate opening function. The canal system distribution map of the study area is shown in Figure 1. Figure 3 shown.
[0061] The water level and flow before and after the gate of the 9.6 gate-Yushugou section of the Santun River irrigation area canal data are used as influencing factors. The 20 influencing factors are numbered as features 0 to 19 respectively. The input data is passed to the interpreter and a SHAP value is returned to explain the model test results. The importance of each feature for the prediction result is ranked as follows: Figure 4 As shown. Taking the flow rate after the gate as the output target, the importance ranking of the corresponding influencing factors is obtained from the SHAP value in the figure. Among them, there are 14 groups of factors that affect the flow rate through the gate with a contribution degree of 0.01 or above, and the importance ranking is: flow rate after the Erqi Canal Gate>water level after the 9.6 Inlet Gate>water level after the Xingfu Sixth Team>water level before the 9.6 Control Gate>flow rate after the Qianjin 15th Team>flow rate after the Guangming 1st Team>water level after the Erqi Canal Gate>flow rate after the Guangming Grand Canal>9.6 flow rate before the control gate>water level after the Xingfu Three Team>water level after the Guangming Grand Canal>water level after the Guangming 1st Team>water level after the 9.6 Control Gate>water level after the Qianjin 1st and 5th Teams. Take the first four influencing factors as preprocessing data. Figure 5 As shown in the figure, with gate opening as the output target, the importance ranking of the corresponding influencing factors is obtained from the SHAP values in the figure. Among them, there are 14 groups of factors that affect the flow rate at the gate with a contribution of 0.01 or above. The importance ranking is: Erqi Canal Flow Rate > Xingfu Third Team Flow Rate > Xingfu Third Team Flow Rate > 9.6 Inlet Gate Flow Rate > 9.6 Control Gate Flow Rate > Guangming Grand Canal Flow Rate > Guangming First Team Flow Rate > Xingfu Sixth Team Flow Rate > 9.6 Control Gate Water Level > Qianjin 15th Team Flow Rate > Guangming First Team Flow Rate > 9.6 Discharge Gate Water Level > Guangming Grand Canal Flow Rate > Yushugou Flow Rate. The first four influencing factors are used as preprocessed data.
[0062] Data preprocessing was performed on the influencing factors in the obtained importance ranking. According to the correlation analysis results and the characteristics of the gene expression programming (GEP) algorithm, influencing factors with an importance of 0.04 or above were selected as input factors. In order to facilitate calculation and model construction, the range method was used to standardize the data.
[0063] Import the standardized data into the GET model and adjust the parameters. The parameter table is shown in Table 1:
[0064] Table 1 GEP algorithm parameter settings
[0065]
[0066]
[0067] The best numerical function was obtained through iterative training of the GEP algorithm, and the function was evaluated. The formula for the flow rate q through the Yushugou sluice is:
[0068]
[0069] Among them, x1 is the flow rate behind the Erqi Canal Gate, x2 is the water level behind the 9.6 water inlet gate, and x3 is the water level in front of the 9.6 regulating gate.
[0070] The evaluation results of the flow function of Yushugou sluice gate are shown in Table 2:
[0071] Table 2 Evaluation results of flow function
[0072]
[0073] The formula for the Yushugou gate opening m is:
[0074]
[0075] Among them, n1 is the water level behind the Xingfu Third Team gate, n2 is the flow behind the Xingfu Third Team gate, and n3 is the water level behind the 9.6 water inlet gate.
[0076] The evaluation results of the Yushugou gate opening function are shown in Table 3:
[0077] Table 3 Evaluation results of opening function
[0078]
[0079] The constructed irrigation canal gate control model is generalizable and can be used in various tree-like canals and analyze the relationship between gates in the canal. From the function evaluation results, it can be seen that the prediction effect of the gate flow function and the gate opening function is good. The training group and the test group R 2 All are above 0.9, with high accuracy.
[0080] The Gene Expression Programming algorithm in the model of the present invention can automatically train and adjust the model structure as the sample data is updated. The GEP algorithm is different from the calculation method of traditional hydraulic formulas, which can achieve better calculation capabilities and save manpower and financial resources for hydraulic parameter calibration.
[0081] This model more intuitively represents the influence of various gates, performing well in the joint regulation and prediction of canal system gates, with real-time and accurate results. The method can also be applied to gate calculations in other tree-like canal sections, demonstrating a degree of generalization.
[0082] The gate flow rate and gate opening estimated by the present invention based on the constructed flow and opening model are consistent with the flow rate obtained by actual measurement in the irrigation area (R 2 are all higher than 0.9), indicating that the model constructed by the present invention considering multiple gate water level and flow data has high accuracy and can provide a reliable idea for water measurement and gate regulation in irrigation canals.
[0083] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific descriptions and embodiments. Those skilled in the art can make various other specific variations and combinations based on the technical teachings disclosed in the present invention without departing from the essence of the present invention, and such variations and combinations are still within the scope of protection of the invention.
Claims
1. A gate group joint control method integrating SHAP method and gene expression programming, characterized in that: The following steps are involved: S1: Collect the gate flow and water level data of irrigation canal system, and use the SHAP method to screen the characteristic variables of the gate flow and water level data of irrigation canal system; S2: The selected characteristic variable combination is used as the input factor, and the input factor is standardized using the range method; S3: The processed data is adjusted and run through the genetic expression programming algorithm to obtain the prediction results of the gate flow function and the opening function; S4: Use evaluation indicators to evaluate and analyze the prediction results of gate flow function and opening function, and complete the gate group joint control integrating SHAP method and gene expression programming; In S1, the SHAP method is used to screen the characteristic variables of the irrigation canal gate flow and water level data. The specific method is: the irrigation canal gate flow and water level data are transmitted to the interpreter in SHAP, the importance ranking of each feature for the prediction result is obtained, and the influencing factors with importance scores of 0.04 and above are used as characteristic variables; The gate flow function q is: Among them, x1 is the flow after the first gate, x2 is the water level after the first gate, and x3 is the water level before the gate; The opening function m is: Among them, n1 is the water level after the second gate, n2 is the flow after the second gate, and n3 is the water level after the third gate; The evaluation index in S4 includes the determination coefficient R 2 , mean absolute error MAE and mean square error MSE, the formula is: Among them, Y is the measured value, is the average value of the measured values, Y i is the predicted value, is the average of the predicted values, i is the selected comparison variable, and n is the number of comparison variables.
2. The gate group joint control method integrating SHAP method and gene expression programming according to claim 1, characterized in that: The standardization processing formula in S2 is: Among them, z' is the input data after standardization, and z is the input data before transformation. is the mean and σ is the standard deviation.
3. The gate group joint control method integrating SHAP method and gene expression programming according to claim 1, characterized in that: The S3 gene expression programming algorithm uses random short-term numerical constants to process digital constants. The parameters adjusted in the gene expression programming algorithm include the number of chromosomes, the number of genes, the function set, the connection function, the fitness function, the individual mutation probability, the gene mutation probability, the inversion probability, the single-point crossover probability, the double-point crossover probability, the gene crossover probability, the gene transposition probability and the random constant RNC.
4. The gate group joint control method integrating SHAP method and gene expression programming according to claim 1, characterized in that: The gene expression programming algorithm in S3 includes the following steps: S3-1: Initialize parameters and population, and calculate fitness value; S3-2: Determine whether the termination condition is met according to the fitness value. If yes, end the algorithm. If not, proceed to step S3-3. S3-3: Save the best individuals, and obtain a new population through selection, replication, mutation, recombination and transposition operations, the evolutionary generation +1, and return to step S3-2.
