Drainage basin water environment influence factor evaluation method, device, equipment and medium

Through multi-perceptual deep neural network and game theory analysis, an evaluation model for influencing factors of the basin water environment was established, and the problem of difficulty in mapping the relationship between the quality of the basin water environment and the driver factors in the existing technology was solved, quantitative evaluation and high explanatory nature were achieved, and scientific management was supported.

CN119539377APending Publication Date: 2025-02-28SICHUAN ENVIRONMENTAL POLICY RES & PLANNING INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411595144.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

It is difficult for the prior art to establish an accurate mapping relationship between the water environment quality and the driving factors of the basin, and it is difficult to refine the specific impact of different driving factors on the water environment quality.

Method used

By obtaining water environment data in the basin, establishing a training data set, and training an influencing factor evaluation model based on multi-perceptron deep neural network, combining game theory analysis and Shapley value calculation, the model performance is optimized to improve explanatory.

Benefits of technology

The influencing factors of the water environment quality in the basin have been quantitatively evaluated, the generalization ability and interpretability of the model have been improved, and scientific water environment management and decision-making have been supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119539377A_ABST
    Figure CN119539377A_ABST
Patent Text Reader

Abstract

The invention provides a drainage basin water environment influence factor evaluation method, device, equipment and medium, the evaluation method comprises the following steps: S1, obtaining drainage basin water environment data and establishing a training data set, the drainage basin water environment data at least comprising water quality data, meteorological data and environmental pollution load data; s2, the influence factor evaluation model is obtained through training according to the training data set, the network structure of the influence factor evaluation model comprises a plurality of sensors, and the number of the sensors is determined according to the type number of the drainage basin water environment data; and S3, using the influence factor evaluation model to confirm driving factors of the influence factors of the basin water environment. The model constructed by the method has high generalization ability and interpretability, can quantitatively evaluate influence factors of the basin water environment quality, has high practicability, and can realize scientific management of the basin water environment quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of water environment of a river basin, and in particular, to a method for evaluating factors affecting water environment of a river basin, an apparatus for evaluating factors affecting water environment of a river basin, and equipment and a computer-readable storage medium for implementing the method for evaluating factors affecting water environment of a river basin. Background Art

[0002] The water environment quality of a river basin is jointly affected by human activities and meteorological and hydrological natural factors. Human activities include industrial, agricultural, and domestic pollution emissions, pollution prevention and control, and water environment governance projects. Meteorological and hydrological conditions include climate change, meteorological conditions, extreme meteorological events, hydrological processes, and water conservancy project regulation. These factors jointly determine the water environment quality of a river basin and are of great significance to the supervision and management of the water environment. The water environment system of a river basin is a complex system with many influencing factors and nonlinear influencing relationships. Traditional statistical analysis methods are difficult to establish a mapping relationship between driving factors and water environment quality. Therefore, it is necessary to use more advanced tools, such as neural networks and mechanism models, to establish such a mapping relationship. However, mechanism models require multiple types of data for modeling, and it is difficult to collect these data in actual work. In addition, it is also necessary to consider how to further evaluate the impact of different driving factors on water environment governance after confirming the mapping relationship. At present, methods such as parameter sensitivity analysis can qualitatively or semi-quantitatively evaluate the importance of driving factors, but it is difficult to refine their specific impact on water environment quality. Therefore, a new method for evaluating the factors affecting the water environment of a river basin is needed. Summary of the invention

[0003] The purpose of the present invention is to solve at least one of the above-mentioned deficiencies in the prior art. For example, one of the purposes of the present invention is to provide an evaluation method for factors affecting water environment in a river basin that can be used for quantitative evaluation and has high interpretability.

[0004] In order to achieve the above objectives, the present invention provides, on the one hand, a method for evaluating factors affecting the water environment of a river basin.

[0005] The evaluation method of the watershed water environment influencing factors comprises the following steps:

[0006] S1. Acquire water environment data of a river basin and establish a training data set, wherein the water environment data of the river basin at least includes water quality data, meteorological data and environmental pollution load data.

[0007] S2. The influencing factor evaluation model is obtained by training according to the training data set. The network structure of the influencing factor evaluation model includes a plurality of perceptrons, and the number of the perceptrons is determined according to the number of types of the water environment data in the river basin.

[0008] S3. Using the influencing factor evaluation model, confirm the driving factors of the influencing factors of the water environment of the basin.

[0009] In an exemplary embodiment of the method for evaluating factors affecting the water environment of a river basin of the present invention, the step S2 may also include: confirming the contribution of each feature in the influencing factor evaluation model based on game theory analysis, and performing feature selection or optimizing the influencing factor evaluation model according to the contribution of each feature.

[0010] In an exemplary embodiment of the method for evaluating factors affecting water environment in a river basin of the present invention, the game theory analysis may include: calculating the SHAP value of the evaluation model of the influencing factors.

[0011] In an exemplary embodiment of the method for evaluating factors affecting water environment in a river basin of the present invention, determining the number of types of water environment data in the river basin may include: classifying the water environment data according to its temporal resolution, and confirming the number of types of water environment data in the river basin according to the classification.

[0012] In an exemplary embodiment of the method for evaluating factors affecting the water environment of a river basin of the present invention, the driving factors may include one or more of human activity factors and climate and meteorological factors.

[0013] In an exemplary embodiment of the method for evaluating factors affecting the water environment of a river basin of the present invention, the network structure of the influencing factor evaluation model may include the multiple connected perceptrons, connection layers, LSTM layers, connection layers and output layers, wherein each of the perceptrons includes a connected input layer, a CNN layer, a pooling layer and a flattening layer.

[0014] In an exemplary embodiment of the method for evaluating factors affecting water environment in a river basin of the present invention, the step S1 may further include: classifying the water environment data of the river basin, and performing data preprocessing respectively according to the classification.

[0015] Another aspect of the present invention provides an evaluation device for factors affecting water environment in a river basin, which includes a training data set establishment module, an influence factor evaluation model establishment module and a river basin water environment driving factor confirmation module which are connected in sequence.

[0016] Wherein, the training data set establishment module is configured to obtain water quality data, meteorological data and environmental pollution load data of the water environment of the river basin and establish a training data set.

[0017] The influencing factor evaluation model establishment module is configured to obtain the influencing factor evaluation model through training according to the training data set, wherein the network structure of the influencing factor evaluation model includes multiple perceptrons, and the number of the perceptrons is determined according to the number of types of the training data set.

[0018] The module for confirming driving factors of the water environment of the watershed is configured to confirm driving factors of the influencing factors of the water environment of the watershed by using the influencing factor evaluation model.

[0019] In another aspect, the present invention provides a computer device, the computer device comprising:

[0020] A processor; a memory storing a computer program, which, when executed by the processor, implements the method for evaluating factors affecting the water environment of a river basin as described above.

[0021] In another aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for evaluating factors affecting the water environment of a river basin as described above.

[0022] Compared with the prior art, the beneficial effects of the present invention include at least one of the following:

[0023] (1) The present invention sets the number of perceptrons by the number of types of training data sets, and uses this to construct an evaluation model for factors affecting water environment quality in a river basin. This can effectively utilize the differences between multiple perceptrons to improve the generalization ability and interpretability of the model.

[0024] (2) The present invention combines a deep network of multiple sensors with game theory to provide an innovative method for evaluating factors affecting water environment quality in a river basin. This method can quantitatively evaluate factors affecting water environment quality in a river basin and has high practicality, so as to achieve scientific management of water environment quality in a river basin.

[0025] (3) The present invention further optimizes the model performance by analyzing the Shapley value to improve the interpretability of the model, thereby providing decision support for the scientific management of the water environment quality in the basin.

[0026] (4) The present invention has broad application prospects, including but not limited to feature selection, model tuning and explaining the decision process of the model.

[0027] (5) The present invention uses a time series neural network for training, which requires fewer types of parameters and is more suitable for establishing a mapping relationship between watershed water environment indicators (i.e., influencing factors) and driving factors. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and other objects and / or features of the present invention will become more apparent through the following description in conjunction with the accompanying drawings, in which:

[0029] Figure 1 A flow chart showing an exemplary embodiment of a method for evaluating factors affecting a watershed water environment according to the present invention.

[0030] Figure 2 A schematic diagram of an apparatus showing an exemplary embodiment of a method for evaluating factors affecting a watershed water environment according to the present invention.

[0031] Figure 3 A schematic diagram of the network structure of an embodiment of the method for evaluating factors affecting the water environment of a river basin of the present invention is shown.

[0032] Figure 4 A schematic diagram of model results of an embodiment of the method for evaluating factors affecting watershed water environment of the present invention is shown.

[0033] Description of reference numerals:

[0034] 100-Training data set establishment module; 110-Influencing factor evaluation model establishment module; 120-Watershed water environment driving factor confirmation module. DETAILED DESCRIPTION

[0035] Hereinafter, the method, device, equipment and medium for evaluating factors affecting the water environment of a river basin of the present invention will be described in detail in conjunction with exemplary embodiments.

[0036] It should be noted that the terms "first", "second", "third" ... and "S1", "S2", "S3" ... etc. used in the present invention are only for the convenience of description and distinction and cannot be understood as indicating or implying relative importance or used to describe a specific order or sequence.

[0037] The water environment quality of a river basin involves multiple dimensions, which are interrelated and influence each other. At the same time, it is also affected by natural factors (such as precipitation, evaporation, surface runoff, etc.) and human factors (such as industrial emissions, agricultural activities, urban expansion, etc.). Therefore, it leads to fluctuations and uncertainties in the water environment quality of the river basin, increasing the difficulty of evaluation.

[0038] In response to the above problems, the inventors proposed an evaluation method for factors affecting the water environment of a river basin. Based on the number of types of water environment data in the river basin, multiple sensors were set up to establish an evaluation model for factors affecting the water environment of the river basin, so that the model can adapt to the characteristics of complex systems, cope with uncertainties and support decision-making, and provide a scientific basis and decision-making support for water environment management in the river basin.

[0039] In order to achieve the above objectives, the present invention provides, on the one hand, a method for evaluating factors affecting the water environment of a river basin.

[0040] Exemplary Embodiment 1

[0041] The evaluation method of the watershed water environment influencing factors of this exemplary embodiment is as follows: Figure 1 As shown, the following steps are included:

[0042] S1. Obtain water environment data of the river basin and establish a training data set. The water environment data of the river basin at least includes water quality data, meteorological data and environmental pollution load data.

[0043] S11. Classify the water environment data of the river basin and perform data preprocessing according to the classification.

[0044] Optionally, the data may be classified according to the time resolution. For example, for the first time resolution data, data filling or interpolation methods may be used to handle the time step difference; for the second time resolution data, upsampling is performed to align the time steps.

[0045] More specifically, water quality data and meteorological data may be classified as first time resolution data, and environmental pollution load data may be classified as second time resolution data.

[0046] Optionally, data preprocessing may include: data cleaning of the water environment data of the basin, including identifying and processing abnormal data and interpolating missing values. Data cleaning is used to process abnormal values ​​and invalid data in the water environment data of the basin. The water environment data of the basin may be normalized or standardized to improve the generalization ability of the model.

[0047] S2. Train the influencing factor evaluation model according to the training data set. The network structure of the influencing factor evaluation model includes multiple perceptrons, and the number of perceptrons is determined according to the number of types of water environment data in the watershed.

[0048] Optionally, the basin water environment data can be classified and the number of types can be confirmed according to the time resolution. For example, water quality data and meteorological data can be classified as first time resolution data, environmental pollution load data can be classified as second time resolution data, and the number of sensors can be two.

[0049] Optionally, the contribution of each feature in the influencing factor evaluation model can be confirmed based on game theory analysis, and feature selection or optimization of the influencing factor evaluation model can be performed according to the contribution of each feature.

[0050] Optionally, the game theory analysis may include: calculating the SHAP (Shapley) value of the influencing factor evaluation model. Shapley analysis, based on the cooperative game theory in game theory, provides a method for fairly distributing resources or benefits. In terms of evaluating the degree of influence of input factors in neural networks, Shapley analysis helps to improve the interpretability of the model. By calculating the Shapley value of each input feature, the contribution of each feature to the model prediction results can be quantified. The advantage of Shapley analysis also lies in its solid theoretical foundation, strong interpretability, support for visual analysis, and can be used for feature selection. The SHAP library can provide a method for efficiently calculating and interpreting Shapley values, support a variety of machine learning frameworks, and provide rich visualization tools.

[0051] Optionally, the network structure of the influencing factor evaluation model may include multiple connected perceptrons, a connection layer, an LSTM layer, a connection layer and an output layer, wherein each perceptron includes a connected input layer, a CNN layer, a pooling layer and a flattening layer.

[0052] Optionally, the number of filters of the convolution layer of the CNN layer may be 2 to the power of n, where n may be 3 to 8. The number of pool_size of the pooling layer may be 2 to the power of n, where n may be 3 to 8, and the number of units of the LSTM may be 2 to the power of n, where n may be 3 to 8.

[0053] Optionally, the activation function for the regression task of the influencing factor evaluation model can be a linear activation function, and the classification task of the influencing factor evaluation model can be a softmax activation function.

[0054] S3. Use the influencing factor evaluation model to confirm the driving factors of the influencing factors of the basin water environment.

[0055] Optionally, the influencing factor evaluation model can also be used to confirm the driving factors of the influencing factors of the water environment of the basin and the degree of influence of the driving factors.

[0056] Optionally, the influencing factors may include one or more of a permanganate index, a trend permanganate index and a cyclical permanganate index.

[0057] Optionally, the driving factors of the water environment in a watershed may include human activities and / or climate and meteorology.

[0058] Optionally, human activities may include one or more of agriculture, industry and life, and the climate and meteorology may include one or more of rainfall, temperature, wind speed, humidity and light intensity.

[0059] Exemplary Embodiment 2

[0060] In this exemplary embodiment, the evaluation method of the factors affecting the water environment of a river basin can be implemented by the following steps:

[0061] S1. Data preparation: First, data collection and processing are carried out. The collected data include automatically monitored water quality data, meteorological data and environmental pollution load data.

[0062] Among them, water quality data may include: one or more water quality indicator data such as total phosphorus, COD, total nitrogen and ammonia nitrogen, and environmental statistical data may include: one or more of industrial source pollution load data, agricultural source pollution load data and domestic source pollution load data.

[0063] S11. Data preprocessing: The data may contain outliers and invalid data, so data cleaning is required to improve the generalization ability of the model.

[0064] More specifically, it may include identifying and processing abnormal data, including processing missing values ​​by filling, deleting or interpolating methods. In addition, it may also include identifying and correcting abnormal values ​​or erroneous data. Specifically, one of the following methods may be selected for processing, which may include: 1) Feature scaling: Normalization: scaling the data to the interval [0,1]; Standardization: changing the mean of the data to 0 and the standard deviation to 1; Min-Max Scaling: scaling the data to between the specified minimum and maximum values. 2) Data segmentation: dividing the data set into training set, validation set and test set. 3) Missing value processing: filling missing values ​​by mean, median, mode or prediction model. 4) Outlier detection and processing: identifying outliers and deciding whether to delete, correct or retain.

[0065] Optionally, the data may be classified and processed according to the type or characteristics of the data.

[0066] Optionally, the data can be processed in different ways according to the temporal resolution. For example, for high temporal resolution data, data filling or interpolation methods are used to handle the time step difference; for low temporal resolution data, upsampling is performed to align the time steps.

[0067] S2. Multi-perceptron neural network training: The number of perceptrons in a multi-perceptron deep neural network takes into account the number of types and / or features of the data.

[0068] Optionally, the number of sensors may be determined based on the number of types classified according to the time resolution of the data. For example, water quality data and meteorological data may be classified as first time resolution data, and environmental pollution load data may be classified as second time resolution data. Thus, two sensors may be constructed.

[0069] More specifically, the multi-perceptron deep neural network structure may include

[0070] 1) Several perceptrons: The number of perceptrons is determined by the number of types of input data. For example, if there are n types of input data with different formats, n perceptrons can be used.

[0071] Each perceptron includes at least one connected input layer, a CNN layer, a pooling layer and a flattening layer, which may specifically include: a) Input layer: different input layers correspond to different types of data and features.

[0072] 2) CNN layer: Convolutional neural network (CNN) is used to extract local features in time series, including multiple convolutional layers and pooling layers.

[0073] Among them, the filter of the convolution layer can be 2 to the power of n, n can be 3 to 8, and the pool_size of the pooling layer can be 2 to the power of n, n can be 3 to 8. The actual effect is determined according to the parameter adjustment results.

[0074] 3) LSTM layer: Long short-term memory network (LSTM) processes long-term dependencies in time series data, and multiple LSTM layers can be designed.

[0075] The units of the LSTM layer can be 2 to the power of n, where n can be 3 to 8. The actual effect is determined based on the parameter adjustment results, and a dropout layer may be added after each LSTM layer to prevent overfitting.

[0076] 4) Connection layer: The connection layer is designed to combine the outputs of different LSTM layers, which is achieved through the connection layer.

[0077] 5) Output layer: Select the appropriate activation function according to the task requirements. For example, for regression fitting tasks, a linear activation function can be used to maintain the continuity of the output.

[0078] S3. Model training and evaluation: A multi-perceptron deep neural network is used as the network structure of the model.

[0079] During the model training phase, select the appropriate loss function and optimizer, for example, the optional mean squared error (MSE) is used for regression tasks, and the optional cross entropy loss is used for classification tasks. You can use optimizers such as Adam or SGD for training. During the training process, you can also divide the data set into training set, validation set, and test set, and use the validation set to adjust the model parameters and prevent overfitting.

[0080] In the model evaluation phase, the model performance is evaluated on the test set using evaluation indicators such as accuracy, recall, and F1 score.

[0081] S4. Using the model trained in step S3, obtain the driving factors of the factors affecting the water environment of the basin or the driving factors of the factors affecting the water environment of the basin and the degree of influence of the driving factors.

[0082] Optionally, the influencing factors may include one or more of a permanganate index, a trend permanganate index and a cyclical permanganate index.

[0083] Optionally, the driving factors of the water environment in a watershed may include human activities and / or climate and meteorology.

[0084] Optionally, human activities may include one or more of agriculture, industry and life, and the climate and meteorology may include one or more of rainfall, temperature, wind speed, humidity and light intensity.

[0085] Exemplary Embodiment 3

[0086] The evaluation method of the watershed water environment influencing factors of this exemplary embodiment may include:

[0087] The same steps S1 , S2 and S4 as in Exemplary Embodiment 2.

[0088] And step S3 may also include: using the Shapley analysis method to quantify the contribution of each input feature to the model prediction result by calculating the Shapley value of each input feature. The specific implementation steps of the Shapley analysis method may include:

[0089] Select an interpreter. For example, you can use DeepExplainer from the SHAP library as an interpreter.

[0090] Initialize the explainer using the trained model and background dataset.

[0091] And calculate the SHAP value for the entire dataset or a specific sample.

[0092] The model can then be analyzed and interpreted through visualization tools.

[0093] Interpret the results: Determine the importance of features to the model’s predictions.

[0094] Example 4

[0095] This exemplary embodiment also provides a device for evaluating factors affecting the water environment of a river basin. Figure 2 As shown, the evaluation device for factors affecting water environment in a river basin includes a training data set establishment module 100, an influence factor evaluation model establishment module 110 and a river basin water environment driving factor confirmation module 120 which are connected in sequence.

[0096] The training data set establishment module 100 is configured to obtain water quality data, meteorological data and environmental pollution load data of the water environment of the river basin and establish a training data set.

[0097] The influencing factor evaluation model building module 110 is configured to obtain an influencing factor evaluation model by training according to the training data set, wherein the network structure of the influencing factor evaluation model includes a plurality of perceptrons, and the number of perceptrons is determined according to the number of types of the training data set.

[0098] The module 120 for confirming driving factors of the water environment of the watershed is configured to evaluate the influencing factors of the water environment of the watershed using the influencing factor evaluation model.

[0099] Exemplary Embodiment 5

[0100] This exemplary embodiment provides a computer device. The computer device includes a processor and a memory. The memory is used to store a computer program. The computer program is executed by the processor so that the processor executes the computer program according to any of the evaluation methods of the watershed water environment influencing factors in exemplary embodiments 1 to 3.

[0101] Exemplary Embodiment 6

[0102] The present exemplary embodiment provides a computer-readable storage medium storing a computer program. The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform an evaluation method for watershed water environment influencing factors according to any of exemplary embodiments 1 to 3. The computer-readable recording medium is any data storage device that can store data read out by a computer system. Examples of computer-readable recording media include: read-only memory, random access memory, read-only optical disk, magnetic tape, floppy disk, optical data storage device, and carrier wave (such as data transmission through the Internet via a wired or wireless transmission path).

[0103] In order to better understand the above exemplary embodiments of the present invention, they are further described below in conjunction with specific embodiments and drawings, but the examples given are not intended to limit the present invention.

[0104] Example 1

[0105] The evaluation method of the watershed water environment influencing factors of this embodiment can be implemented by the following technical solutions, including:

[0106] S1. Data preparation:

[0107] S11. Data collection: Collect data from automatic water quality monitoring stations, meteorological data from weather stations, and environmental pollution load data within the basin. These data are the basis for evaluating the water environment quality of the basin.

[0108] S13, data preprocessing: For water quality and meteorological data of the first time resolution, zero filling or interpolation method is used to process the difference in time steps. For environmental pollution load data of the second time resolution, upsampling is performed to match the time step of the high time resolution data.

[0109] S12. Data cleaning: Preprocess the collected data, including identifying and eliminating abnormal data, processing invalid data, and interpolating missing values.

[0110] S13. Data normalization: Normalize or standardize the data to eliminate the impact of different dimensions and magnitudes and improve the efficiency and effectiveness of model training.

[0111] S2. Construction of neural network model: Figure 3 As shown, according to the time resolution of the data, two perceptrons are constructed, each of which includes at least one connected input layer, CNN layer, pooling layer and flattening layer, which may specifically include the following steps:

[0112] S21. Construct input layer: According to the time resolution of the data, two input layers are designed. The first input layer is used to input water quality data and meteorological data, and the second input layer is used to input environmental pollution load data.

[0113] S3. Construct a convolutional neural network (CNN) layer: Use CNN to extract local features in water quality and meteorological data. Each sensor can be designed with multiple convolutional layers and pooling layers, where the number of convolution kernels is set to the power of 2, n = 2 to 6, and the size of the convolution kernel is set to an integer between 3 and 5; the size of the pooling window of the pooling layer is set to an integer between 2 and 4 to extract effective information from time series data.

[0114] S4. Build a long short-term memory (LSTM) layer: Use the output of the CNN layer (i.e., CNN convolution, pooling, flattening, and concatenation of data) as the input of the LSTM layer, and use LSTM to process long-term dependencies in time series data.

[0115] Optionally, two LSTM layers may be constructed, the first LSTM layer may be set to 32 nodes, and the second LSTM layer may be set to 6 nodes.

[0116] S5. Build connection layer: realize feature fusion.

[0117] S6. Build the output layer: Design the output layer according to the specific requirements of the task.

[0118] For example, the output layer should have 10 neurons for a 10-class classification problem:

[0119] The construction of the output layer during regression tasks: The number of neurons in the output layer is determined according to the number of indicators that need to be output. For example, if only one indicator needs to be output, only one neuron is needed, and if two indicators need to be output, two neurons are needed.

[0120] Among them, for regression tasks, a linear activation function can be used; for classification tasks, a softmax activation function can be used.

[0121] S7. Model compilation: Select the appropriate loss function and optimizer, such as mean square error (MSE) and Adam optimizer, to compile the model.

[0122] The code framework (TensorFlow / Keras) of the neural network model can be as follows:

[0123] 2. ```python

[0124] 3. import tensorflow as tf

[0125] 4. from tensorflow.keras.models import Model

[0126] 5. from tensorflow.keras.layers import Input,Conv1D,MaxPooling1D,LSTM,Dense,Dropout,concatenate

[0127] 6. #Define the input layer

[0128] 7. input_water_quality=Input(shape=(None,num_features_water_quality))

[0129] 8. input_meteo=Input(shape=(None,num_features_meteo))

[0130] 9. input_env_stats=Input(shape=(None,num_features_env_stats))

[0131] 10. #CNN layer

[0132] 11. cnn_water_quality=Conv1D(filters=64, kernel_size=3, activation='relu')(input_water_quality)

[0133] 12. cnn_water_quality=MaxPooling1D(pool_size=2)(cnn_water_quality)

[0134] 13. #...You can add more CNN layers...

[0135] 14. #CNN layer

[0136] 15. cnn_meteo=Conv1D(filters=64, kernel_size=3, activation='relu')(input_meteo)

[0137] 16. cnn_meteo=MaxPooling1D(pool_size=2)(cnn_meteo)

[0138] 17. #...You can add more CNN layers...

[0139] 18. #LSTM layer

[0140] 19. lstm_out=LSTM(50, return_sequences=True)(cnn_water_quality)

[0141] 20. lstm_out=LSTM(50)(lstm_out)

[0142] 21. #...you can add more LSTM layers...

[0143] 22. #Coupling layer

[0144] 23. coupling=concatenate([lstm_out,input_env_stats])

[0145] 24. #Fully connected layer

[0146] 25. dense_out=Dense(100, activation='relu')(coupling)

[0147] 26. dense_out=Dropout(0.5)(dense_out)

[0148] 27. #...You can add more fully connected layers...

[0149] 28. Output layer

[0150] 29. output=Dense(num_output_neurons, activation='softmax')(dense_out)

[0151] 30. #Build the model

[0152] 31. model=Model(inputs=[input_water_quality, input_meteo, input_env_stats], outputs=output)

[0153] 32. #Compile model

[0154] 33. model.compile(optimizer='adam',loss='categorical_crossentropy',metrics=['accuracy'])

[0155] 34. #Training the model

[0156] 35. model.fit([x_water_quality,x_meteo,x_env_stats],y,epochs=10,validation_data=(val_x,val_y))

[0157] 36. Evaluating the Model

[0158] 37. model.evaluate(test_x,test_y)

[0159] S8. Model training and evaluation:

[0160] S81. Dataset division: Divide the dataset into training set, validation set and test set.

[0161] S82. Model training: Use the training set to train the model, and use the validation set to adjust the model parameters to prevent overfitting.

[0162] S83. Model evaluation: Evaluate the performance of the model on the test set, using evaluation indicators such as accuracy, recall, and F1 score.

[0163] S9. Calculation and analysis of Shapley value:

[0164] S91. Select the interpreter: Select DeepExplainer in the SHAP library as the interpreter, which is suitable for deep neural networks.

[0165] More specifically, selecting an interpreter class may include: Since `basin_model` is a deep learning model based on TensorFlow, `DeepExplainer` in the SHAP library can be used. `DeepExplainer` is suitable for deep neural networks and can use the gradient information of the model to estimate the SHAP value.

[0166] S92. Initialize the explainer: pass the trained model and background dataset to DeepExplainer for initialization.

[0167] More specifically, initializing the explainer may include passing the trained model and a portion of the data (as a background dataset) to `DeepExplainer` to initialize it. The background dataset is used to estimate the baseline value of the model output. The code may include:

[0168] import shap

[0169] explainer=shap.DeepExplainer(basin_model,background_data)

[0170] ```

[0171] S93. Calculate SHAP value: Use DeepExplainer to calculate the SHAP value of the entire dataset or a specific sample.

[0172] More specifically, calculating the SHAP value may include: using an interpreter to calculate the SHAP value of the entire data set or a specific sample. The code may include:

[0173] shap_values=explainer.shap_values(data)

[0174] S94. Analysis and Visualization: Use the visualization tools provided by the SHAP library, such as summary_plot and force_plot, to analyze and interpret the model's prediction results.

[0175] More specifically, analysis and visualization may include: Use the various visualization tools provided by the SHAP library to analyze and interpret the model. For example, `summary_plot` can show the average impact of features on model output, and `force_plot` can show detailed explanations of individual predictions. The code may include:

[0176] shap.summary_plot(shap_values,data)

[0177] shap.force_plot(explainer.expected_value[0],

[0178] shap_values[0][0],data.iloc[0])

[0179] S95. Explain the results: Through the SHAP value, you can intuitively understand the contribution of each input feature to the model prediction results, so as to perform feature selection and model tuning.

[0180] More specifically, interpreting the results may include: SHAP values ​​will show the contribution of each input feature to the model output. Positive values ​​indicate that the feature increases the output, and negative values ​​indicate that the feature decreases the output. By analyzing these values, you can determine which features are most important to the model prediction.

[0181] Further application: Based on the analysis results of the SHAP value, feature selection, model tuning, or explanation of the model's decision-making process can be performed.

[0182] S10. Further application of the model:

[0183] S101. Feature selection: Based on the SHAP value analysis results, select features that contribute greatly to model prediction and remove unimportant features.

[0184] S102, Model tuning: Use SHAP value analysis results to adjust the model structure or parameters to improve model performance.

[0185] S103. Decision support: The present invention is applied to the scientific management and decision support of water environment quality in river basins to provide a scientific basis for relevant management departments.

[0186] In this embodiment, the training results of the model can be as follows: Figure 4 As shown, in Figure 4In the figure, point a is the real data, curve b is the predicted data, the horizontal axis is time, and the vertical axis is the permanganate index. Applying it to the water environment of the A basin, the evaluation results of the factors affecting the water environment quality of the A basin can include: a) The driving factors of the permanganate index at the outlet of the A basin may include: 18.32% agriculture, 9.57% industry and 7.98% life (i.e. 35.87% human activities) and 21.99% rainfall and 42.14% temperature (i.e. 64.13% climate and meteorology); b) The driving factors of the trend of the permanganate index at the outlet of the A basin may include: 3 2.00% agriculture, 48.9% industry and 17.45% life (i.e. 98.38% human activities) with 0.96% rainfall and 0.67% temperature (i.e. 1.62% climate and meteorology); c) Driving factors The driving factors of the periodic permanganate index at the outlet of Basin A may include: 9.74% agriculture, 7.73% industry and 13.64% life (i.e. 31.11% human activities) with 25.41% rainfall and 43.49% temperature (i.e. 68.89% climate and meteorology).

[0187] This embodiment uses a multi-sensor deep neural network to achieve accurate prediction of water quality indicators, effectively supporting the calculation of subsequent quantitative evaluation influencing factors.

[0188] Although the present invention has been described above in conjunction with the exemplary embodiments and the accompanying drawings, it should be apparent to those skilled in the art that various modifications may be made to the above-described embodiments without departing from the spirit and scope of the claims.

Claims

1. A method for evaluating factors affecting water environment in a river basin, characterized in that: The evaluation method of the watershed water environment influencing factors comprises the following steps: S1. Acquire water environment data of the river basin and establish a training data set, wherein the water environment data of the river basin at least includes water quality data, meteorological data and environmental pollution load data; S2. training the influencing factor evaluation model according to the training data set, wherein the network structure of the influencing factor evaluation model includes a plurality of perceptrons, and the number of the perceptrons is determined according to the number of types of the water environment data in the river basin; and S3. Using the influencing factor evaluation model, confirm the driving factors of the influencing factors of the water environment of the basin.

2. The method for evaluating factors affecting the water environment of a river basin according to claim 1, characterized in that: The step S2 also includes: confirming the contribution of each feature in the influencing factor evaluation model based on game theory analysis, and performing feature selection or optimizing the influencing factor evaluation model according to the contribution of each feature.

3. The method for evaluating factors affecting the water environment of a river basin according to claim 2, characterized in that: The game theory analysis includes: calculating the SHAP value of the influencing factor evaluation model.

4. The method for evaluating factors affecting the water environment of a river basin according to claim 1, characterized in that: Determining the number of types of the water environment data of the river basin includes: classifying the water environment data of the river basin according to the time resolution of the water environment data of the river basin, and confirming the number of types of the water environment data of the river basin according to the classification.

5. The method for evaluating factors affecting the water environment of a river basin according to claim 1, characterized in that: The driving factors include one or more of human activity factors and climate and meteorological factors.

6. The method for evaluating factors affecting water environment in a river basin according to claim 1, characterized in that: The network structure of the influencing factor evaluation model includes the multiple connected perceptrons, a connection layer, an LSTM layer, a connection layer and an output layer, wherein each of the perceptrons includes a connected input layer, a CNN layer, a pooling layer and a flattening layer.

7. The method for evaluating factors affecting the water environment of a river basin according to claim 4, characterized in that: The step S1 also includes: classifying the water environment data of the river basin, and performing data preprocessing according to the classification.

8. An evaluation device for factors affecting water environment in a river basin, characterized in that: The evaluation device for the influencing factors of the watershed water environment comprises a training data set establishment module, an influencing factor evaluation model establishment module and a watershed water environment driving factor confirmation module which are connected in sequence, wherein: The training data set establishment module is configured to obtain water quality data, meteorological data and environmental pollution load data of the water environment in the river basin and establish a training data set; The influencing factor evaluation model establishment module is configured to obtain the influencing factor evaluation model through training according to the training data set, wherein the network structure of the influencing factor evaluation model includes a plurality of perceptrons, and the number of the perceptrons is determined according to the number of types of the water environment data of the river basin, and The watershed water environment driving factor confirmation module is configured to use the influencing factor evaluation model to confirm the driving factors of the influencing factors of the watershed water environment.

9. A computer device, characterized in that: The computer device comprises: at least one processor; and A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method for evaluating factors affecting water environment in a river basin according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method for evaluating the factors affecting the water environment of a river basin as described in any one of claims 1 to 7 is implemented.