Non-point source pollutant emission flux prediction and coastal risk identification method and system

Through the CCM causal analysis model and the Trans-GRU coupling model, key surface-shaped driving factors are extracted and the flux prediction of surface-source pollutants is carried out, which solves the accuracy and continuity of surface-source pollution emission flux estimation and risk identification in the existing technology, and realizes high-precision surface-source pollutant emission flux estimation and accurate identification of coastal high-risk areas.

CN119886845AActive Publication Date: 2025-04-25SHANDONG UNIV

Patent Information

Application Number
CN202510386516.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-04-25
Estimated Expiration
2045-03-31

AI Technical Summary

Technical Problem

The prior art is difficult to achieve high-precision and continuous field source pollution emission flux estimation and accurate identification of high emission risk areas, especially when processing long-term data and complex spatiotemporal interactions.

Method used

CCM causal analysis model was used to extract key surface driving elements, combine the Trans-GRU coupling model to predict the flux of polynomial pollutants, and identify high-risk areas along the coast through density clustering and trend testing.

Benefits of technology

It has achieved high-frequency and high-precision estimation of emission flux of surface source pollutants, as well as accurate identification and early warning of high-risk areas along the coast, and improved the ability of water safety risk assessment and water pollution prevention and control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886845A_ABST
    Figure CN119886845A_ABST
Patent Text Reader

Abstract

The invention provides a non-point source pollutant emission flux prediction and coastal risk identification method and system, and belongs to the technical field of water environment pollution big data estimation and risk early warning. The method comprises the following steps: acquiring water quality pollution data and space-time auxiliary characteristic data of a research area, and constructing a database; analyzing a causal relationship of the candidate planar driving elements to water quality pollution by using a CCM causal analysis model; extracting features of the key planar driving elements, and converting and generating feature vectors by utilizing supervised learning; performing layer-by-layer calculation on the feature vectors based on a Transs-GRU coupling model, outputting Transform branch features and GRU branch features, performing weighted coupling, and outputting a non-point source pollution flux prediction value through a prediction layer; and obtaining the emission intensity and the emission trend of the pollutants according to the predicted value, and further dividing risk grades to realize coastal risk identification and early warning. The method effectively improves the prediction precision of the emission flux of non-point source pollutants and the precise recognition of the position and time period of a coastal risk region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of water environment pollution big data estimation and risk early warning, and in particular relates to a method and system for predicting non-point source pollutant emission flux and identifying coastal risks. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Non-point source pollution has become an important source that affects the health of the water ecological environment. Compared with point source pollution, it has the characteristics of randomness, diffusion, and hysteresis, and is affected by multiple driving factors such as climate change and land use, making the identification and control of non-point source pollution risks more complicated. Therefore, real-time capture of the spatiotemporal dynamic characteristics of non-point source pollution, estimation of pollutant emission fluxes and risk identification of coastal emission areas are of great significance for water safety risk assessment and water pollution prevention and control.

[0004] In the past, the methods for estimating the emission flux and identifying risks of non-point source pollution mainly relied on site monitoring and model simulation methods: site monitoring can provide accurate water quality point source pollution data, but it can only reflect local and non-continuous water quality conditions, and the pollution risk identification and analysis based on a single local area data lacks global dynamic monitoring capabilities; model simulation often uses empirical formulas and watershed models, but often expands the source of pollution and is difficult to adapt to the global dynamic changes of complex pollution sources. In addition, the diversity and uncertainty of pollution sources make it impossible for traditional models to effectively capture the main driving factors. The above problems make traditional methods unable to meet the needs of high-precision and continuous non-point source pollution emission flux estimation and accurate identification of high emission risk areas.

[0005] With the vigorous development of big data technology and deep learning, non-point source pollution research has gained new technical support. Deep learning has good spatiotemporal data fusion processing capabilities and nonlinear relationship capture capabilities. By using multi-source spatiotemporal auxiliary data, it can effectively expand site monitoring data to spatiotemporal continuous non-point source pollution monitoring. At the same time, deep learning's time series data dynamic analysis capabilities are good at handling emergencies or dynamic changes in abnormal pollution sources, which is crucial for risk identification. However, traditional deep learning methods are easily limited by gradient vanishing or explosion problems when processing long time series data, have insufficient ability to capture long time series dynamic changes, and lack a unified framework to handle complex spatiotemporal interactions. The estimation accuracy in different scenarios varies greatly. Summary of the invention

[0006] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a method and system for predicting non-point source pollutant emission flux and identifying coastal risks, which can achieve high-frequency and high-precision estimation of pollutant emission flux, as well as accurate identification of the distribution location and time period of high-risk coastal areas.

[0007] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: The first aspect of the present invention provides a method for predicting the emission flux of non-point source pollutants and identifying coastal risks; A method for predicting the emission flux of non-point source pollutants and identifying coastal risks, comprising: Acquire water quality pollution data and spatiotemporal auxiliary feature data of the study area, preprocess the data, and build a water quality pollution database and a spatiotemporal auxiliary feature database; Based on the spatiotemporal auxiliary feature database, candidate areal driving factors are extracted, and the causal relationship between candidate areal driving factors and water pollution is analyzed using the CCM causal analysis model to screen out key areal driving factors with high contribution. Extract the time information features of key surface driving elements as well as explicit spatial features and implicit spatial features, integrate the explicit spatial features and implicit spatial features using supervised learning transformation, and generate feature vectors; The feature vector is input into the trained Trans-GRU coupling model, and the predicted value of the non-point source pollutant flux is output; wherein the trained Trans-GRU coupling model respectively uses the Transformer Encode branch and the GRU gating unit branch to calculate the feature vector layer by layer, and outputs the Transformer branch features and the GRU branch features; the Transformer branch features and the GRU branch features are weightedly coupled, and the predicted value of the non-point source pollution flux is output through the prediction layer; Density clustering and trend testing are performed on the predicted values ​​to obtain the emission intensity and emission trend of pollutants, and risk levels are divided according to the emission intensity and emission trend of pollutants to achieve coastal risk identification and early warning.

[0008] As a further technical solution, the pretreatment process includes: Remove outliers from water pollution data and spatiotemporal auxiliary feature data, and use interpolation or neighboring values ​​to fill in missing values ​​in the data; Align water pollution data and spatiotemporal auxiliary feature data in time and space to unify time granularity and spatial resolution; Water pollution data and spatiotemporal auxiliary characteristic data are standardized to ensure the consistency of dimensions of different data.

[0009] As a further technical solution, the process of using the CCM causal analysis model to analyze the causal relationship between candidate surface driving factors and water pollution and screen out key surface driving factors with high contribution is as follows: The time series variables of water pollution flux in the water pollution database and the time series variables of candidate area driving elements in the spatiotemporal auxiliary feature database are extracted respectively, and normalized; According to the delayed embedding principle, the attractor manifolds of water pollution flux and candidate surface driving elements are reconstructed respectively, and the time series manifolds of water pollution flux and candidate surface driving elements are generated; According to the time series manifold of water pollution flux, find the nearest neighbor points and calculate the Euclidean distance, and use weights to measure the similarity between state vectors; Based on the temporal manifold of the candidate planar driving element and the weight, the predicted value of the candidate planar driving element is calculated, and the causal contribution of the candidate planar driving element to the pollutant flux is determined by calculating the convergence cross-mapping capability value; Through two-way causal test, key surface driving factors with high contribution to pollutant flux are screened out.

[0010] As a further technical solution, the explicit spatial features include point longitude and latitude features and water body type features; the implicit spatial features include water quality pollution flux features, key driving factor features, and time information features.

[0011] As a further technical solution, the trained Trans-GRU coupling model uses the TransformerEncode branch to calculate the feature vector layer by layer, and the process of outputting the Transformer branch features is: A linear transformation is used to map the feature vector from the original dimension to a new spatial dimension, representing the input features in a higher-dimensional space; Add position encoding to the feature vector of each time step in the time series so that the attention mechanism can use position information equivalent to time order; The encoder computes the query matrix, key matrix, and value matrix of the feature vector at each time step; Calculate the attention weights between the current time step and other time steps; The query, key and value matrices are mapped to different subspaces through a multi-head attention mechanism to obtain feature representations based on long-term relationship information; residual links and layer normalization are performed on the obtained features based on long-term relationship information; The temporal and spatial dependencies of water quality non-point source pollution are captured through a feedforward network, and Transformer branch features are output.

[0012] As a further technical solution, the trained Trans-GRU coupling model uses the GRU gated unit branch to calculate the feature vector layer by layer, and the process of outputting the GRU branch feature is: Dividing the feature vector into feature vectors at different time steps; The update gate is used to control the weight distribution between the input features at the current moment and the hidden state at the previous moment; the reset gate is used to control the influence of the hidden state at the previous moment on the calculation of the candidate hidden state at the current moment; The candidate hidden state is updated based on the divided feature vector and the reset gate output, and the GRU branch feature is obtained by calculating the weighted combination of the hidden state at the previous moment and the candidate hidden state at the current moment.

[0013] As a further technical solution, the predicted values ​​are subjected to spatial clustering and trend testing to obtain the emission intensity and emission trend of pollutants as follows: The pollutant emission flux value of each data point in the predicted value is combined with the spatial coordinate information as the input of clustering. According to the neighborhood distance and minimum point number parameters, density clustering is performed to identify high-density areas of pollutant emission. The pollution level of each area is presented based on quantitative indicators, forming a density map of pollution sources and achieving preliminary identification of high-emission pollution areas along the coast; Extract the pollutant emission flux values ​​of each pollution area at different time steps as the input of trend test; For each region, the slopes between all pairs of time points are calculated and the median is taken. The trend of pollution emissions is determined based on the median slope.

[0014] A second aspect of the present invention provides a system for predicting non-point source pollutant emission flux and identifying coastal risks.

[0015] A non-point source pollutant emission flux prediction and coastal risk identification system, comprising: The database construction module is configured to: obtain water quality pollution data and spatiotemporal auxiliary feature data of the study area, and pre-process the data to construct a water quality pollution database and a spatiotemporal auxiliary feature database; The causal analysis module is configured to: extract candidate areal driving factors based on the spatiotemporal auxiliary feature database, analyze the causal relationship between the candidate areal driving factors and water pollution using the CCM causal analysis model, and screen out key areal driving factors with high contribution; The supervised learning module is configured to: extract time information features, explicit spatial features and implicit spatial features of key surface driving elements, integrate the explicit spatial features and implicit spatial features using supervised learning transformation, and generate feature vectors; The non-point source pollutant flux prediction module is configured to: input the feature vector into a trained Trans-GRU coupling model, and output a predicted value of the non-point source pollutant flux; wherein the trained Trans-GRU coupling model uses the Transformer Encode branch and the GRU gating unit branch to calculate the feature vector layer by layer, and outputs the Transformer branch feature and the GRU branch feature; and outputs the non-point source pollution flux prediction value through the prediction layer by weighted coupling of the Transformer branch feature and the GRU branch feature; The coastal risk identification module is configured to: perform density clustering and trend testing on the predicted values ​​to obtain the emission intensity and emission trend of pollutants, divide the risk level according to the emission intensity and emission trend of the pollutants, and realize coastal risk identification and early warning.

[0016] The third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in a method for predicting non-point source pollutant emission flux and identifying coastal risks as described in the first aspect of the present invention.

[0017] The fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for predicting non-point source pollutant emission flux and identifying coastal risks as described in the first aspect of the present invention are implemented.

[0018] One or more of the above technical solutions have the following beneficial effects: (1) This paper introduces the CCM causal analysis model and utilizes the convergence of causal cross-mapping to analyze the asymmetric driving of pollution by factors such as meteorology and land use through a two-way causal test (one-way driving by rainfall, mutual feedback between land use and pollution), and quantifies their cross-temporal and spatial contributions (agricultural activities dominate long-term trends, rainfall triggers short-term fluctuations), thereby extracting the key driving factors related to pollution flux. (2) The present invention takes the water pollution time series data and the surface driving factor data with significant causal relationship as input, and the water quality surface source pollution flux as output, to construct a Trans-GRU model, which effectively solves the gradient vanishing and gradient exploding problems existing in traditional time series deep learning models.

[0019] (3) By using density-based spatial clustering of applications with noise (DBSCAN) and Theil-Sen median slope estimator (Theil-Sen) to test the predicted values ​​of non-point source pollutant flux output by the Trans-GRU model, the location and time period of high emission areas along the coast were accurately identified, which is of great significance for water safety risk assessment and water pollution prevention and control.

[0020] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0022] Figure 1 This is a flow chart of the method of the first embodiment.

[0023] Figure 2 It is a system structure diagram of the second embodiment. DETAILED DESCRIPTION

[0024] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0025] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.

[0026] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0027] Based on high-precision, daily-scale water quality monitoring data, combined with characteristic data such as hydrological conditions, meteorological conditions, land use types and human activities, the present invention uses causal analysis CCM to determine the contribution of each feature, and builds a pollutant emission flux estimation model and its application based on a deep learning algorithm that integrates Transformer and GRU. Based on density clustering and Theil-Sen median slope estimation method, the location and time period of high-emission areas along the coast can be accurately identified.

[0028] Embodiment 1 This embodiment discloses a method for predicting the emission flux of non-point source pollutants and identifying coastal risks; like Figure 1 As shown, a method for predicting the emission flux of non-point source pollutants and identifying coastal risks includes: Step S1, obtaining water quality pollution data and spatiotemporal auxiliary feature data of the study area, and preprocessing the data to construct a water quality pollution database and a spatiotemporal auxiliary feature database; Collect water pollution concentration and flux data of rivers, lakes, reservoirs and drinking water sources in the study area. Among them, the pollutant flux is the total amount of pollutants passing through a certain section of a river, lake or drinking water source per unit time, reflecting the intensity of pollutant transfer. The calculation formula is as follows: ; In the formula, is the daily area-normalized flux of pollutants; is the daily pollutant concentration in the section; is the daily river flow; For the regional area, the pollutants may be ammonia nitrogen, total phosphorus, potassium permanganate index, etc.

[0029] At the same time, spatiotemporal auxiliary characteristic data such as hydrology (flow, flow velocity, water level, etc.), meteorology (precipitation, temperature, sunshine hours, etc.), and land use in the study area are collected, and human activity data are used as timestamps and set as latent variables, which are also used as time series inputs into the coupling model.

[0030] The acquired water pollution data and spatiotemporal auxiliary feature data are preprocessed to build a water pollution database and a spatiotemporal auxiliary feature database. The preprocessing process includes: Remove outliers from the data to ensure data quality. Use interpolation or adjacent values ​​to fill in missing values ​​in the data.

[0031] The water pollution data and spatiotemporal auxiliary feature data are aligned in time and space, and the time granularity of each data is unified to the daily scale, and the spatial resolution matches the river basin.

[0032] Water pollution data and spatiotemporal auxiliary feature data are standardized to ensure that the dimensions of different data are consistent. For example, Min-Max normalization can be used to ensure that the dimensions of different variables are consistent. The formula is as follows: ; In the formula, is the time series data to be standardized, that is ; is the result after normalization; is the minimum value in the time series data; is the maximum value in the time series data.

[0033] Step S2, extracting candidate areal driving factors based on the spatiotemporal auxiliary feature database, analyzing the causal relationship between the candidate areal driving factors and water pollution using the CCM causal analysis model, and screening out key areal driving factors with high contribution; The causal relationship between candidate areal driving factors and water pollution is analyzed through the CCM causal analysis model, and then the key driving factors and their contribution are identified. Among them, the target variable (result) is the water pollution data X obtained from the monitoring station, that is, the emission flux or concentration of pollutants such as ammonia nitrogen and total phosphorus. The candidate areal driving factors (causes) are the extracted surface characteristics such as meteorology (rainfall, temperature, etc.), land use, and agricultural activities, which constitute the candidate areal driving factors Y.

[0034] Step S21, respectively extracting the time series variables of the water pollution flux in the water pollution database and the time series variables of the candidate planar driving elements in the spatiotemporal auxiliary feature database, and performing normalization processing; The time series variable of water pollution flux is taken as , the time series variables of the candidate surface driving elements are taken as , determine the time window and normalize it according to the following rules: ; ; In the formula, are the maximum and minimum values ​​of the water pollution flux X in this time window; It is the maximum and minimum value of the candidate surface driving element Y in this time window.

[0035] Step S22, according to the delayed embedding principle, the attractor manifolds of the water pollution flux and the candidate planar driving element are reconstructed respectively to generate the time series manifold of the water pollution flux and the time series manifold of the candidate planar driving element. The generation process is as follows: ; ; In the formula, is the time series manifold of water pollution flux X; It is the temporal manifold of the candidate planar driving element Y. , is a certain moment in the time series variable, C is the length of the time window, and E is the number of data points at different times used to reconstruct the manifold. It is the time interval between two adjacent moments in the X and Y time series data. That is, the manifold at each moment and The current observation value , and the subsequent delayed observations.

[0036] Step S23, according to the time series manifold of water pollution flux, find the nearest neighbor points and calculate the Euclidean distance, and use weights to measure the similarity between state vectors; specifically: According to the time series manifold of water pollution flux at a certain moment , find E+1 neighboring points from near to far, that is, time points close to this moment in the same time window , and then calculate the neighboring points By that time The Euclidean distance is obtained by summing the squares of the differences in all corresponding dimensions of the two vectors and taking the square root. The weight is used to measure the similarity between the two state vectors. The weight calculation is as follows: ; In the formula, yes and The Euclidean distance between That means the neighbor point to the target time The contribution ratio of the predicted value, the larger the weight, the higher the similarity.

[0037] Step S24, based on the temporal manifold of the candidate planar driving element and the weight, the predicted value of the candidate planar driving element is calculated, and the causal contribution of the candidate planar driving element to the pollutant flux is determined by calculating the convergence cross-mapping capability value.

[0038] Temporal Manifold Based on Candidate Area Driving Element Data , find and The corresponding E+1 neighboring points from near to far , using these neighboring points and the above weights , calculate the time Corresponding candidate surface driving element Y prediction value : ; In the formula, It is the predicted value of Y of the candidate surface driving element.

[0039] By calculating the Convergent Cross Mapping Skill (CMS), the causal effect of the candidate surface driving factor Y on the pollutant flux X is determined, that is: ; In the formula, is the covariance between the true value and the predicted value, and are their variances respectively. Extend the time window and observe Whether it tends to increase steadily with the increase of data volume; if its value increases significantly and converges to a higher level, it indicates that the candidate planar driving factor Y has an obvious causal effect on the water quality pollutant flux X.

[0040] Step S25, screening out key surface driving factors with high contribution to pollutant flux through bidirectional causal test.

[0041] Furthermore, if the causal direction (X→Y or Y→X) of the pollutant flux X and the candidate element Y is to be determined, the pollutant flux X is predicted on the manifold of the candidate planar driving element Y, and the candidate planar driving element Y is predicted on the manifold of the pollutant flux X, and the respective CMS values ​​are calculated. If the CMS value of "Y→X" is higher and converges well, it means that the candidate planar driving element Y drives the pollutant flux X in a unidirectional manner; if both are high, there may be a "mutual feedback" relationship.

[0042] In the scenario of multiple candidate areal driving factors, the above process is repeated for each candidate factor, and the size of CMS is used to measure its causal contribution to the pollutant flux X; the key areal driving factors with higher contribution are screened out as the main input for non-point source pollution flux estimation and coastal risk identification.

[0043] Step S3, extracting time information features, explicit spatial features and implicit spatial features of key planar driving elements, integrating the explicit spatial features and implicit spatial features using supervised learning transformation, and generating feature vectors; Step S31, time information feature , using sine and cosine functions to process periodic features and capture seasonal and periodic changes, The code is as follows: ; ; In the formula, It is the time information in the time series data, which is converted into a periodic numerical representation, and the two-dimensional vector It can also reflect the transitional changes between seasons and capture the dynamic process of how climate change and hydrological changes affect surface source pollution of water quality.

[0044] Explicit spatial features directly represent spatial distribution through clear spatial features. For example, point latitude and longitude features (spatial location of point source pollution) and water body type features. The encoding is as follows: Point longitude and latitude characteristics , using sine and cosine position coding to convert the latitude and longitude information of water quality point source pollution data into high-order feature representation, coding: ; In the formula, , It is the standardized longitude and latitude; is the dimension index in the encoded vector, and d is the total dimension of the encoding (such as 64 or 128), that is, The value range of is [0, d-1].

[0045] Water body type characteristics , according to the water body type, different water body types are converted into four-dimensional vectors using unique encoding. The encoding is as follows: [1, 0, 0, 0] (river), [0, 1, 0, 0] (lake), [0, 0, 1, 0] (reservoir), [0, 0, 0, 1] (drinking water source).

[0046] Implicit spatial features indirectly represent spatial regularities with features such as deeply correlated planar driving factors, such as water pollution flux, key driving factors, and time information. The self-attention mechanism is used to learn the relationship between different time steps and positions, thereby capturing the spatial diffusion law of pollutants. Step S32: The time series is essentially a continuous data stream that changes over time and needs to be reorganized into a form that includes input and output. Through supervised learning, explicit spatial features (such as longitude and latitude) and implicit spatial features (such as meteorological data) are integrated to construct a multi-dimensional supervisory signal.

[0047] By adding the latitude and longitude features of the point , water body type characteristics , water pollution flux characteristics , Key driving factor characteristics Features with time information The temporal characteristics (such as water quality, hydrology, and meteorology) are aligned in time order, and the non-time series characteristics (such as land use) are regarded as static characteristics and repeatedly added to each time step. Based on, the input and output vectors are constructed using time sliding windows respectively: Input Vector , M∈[B, T, F], B is the batch size, that is, the number of time series samples input into the model at one time; T is the time series length, that is, the number of past time steps (i.e., time step length) used by each input sample; F is the feature dimension of each time step, that is, the number of features used for each sample, including water pollution flux and driving factors.

[0048] Output vector , if it is a single-point prediction, the target is the data at a certain point in the future, then , is the feature dimension (number) of the prediction; if it is a multi-step prediction, the target is a sequence for a period of time in the future, then , is the prediction time step.

[0049] Step S4, inputting the feature vector into the trained Trans-GRU coupling model, and outputting the predicted value of the non-point source pollutant flux; wherein the trained Trans-GRU coupling model respectively uses the Transformer Encode branch and the GRU gating unit branch to calculate the feature vector layer by layer, and outputs the Transformer branch features and the GRU branch features; by weighted coupling the Transformer branch features and the GRU branch features, the predicted value of the non-point source pollution flux is output through the prediction layer.

[0050] Among them, in the construction process of the Trans-GRU coupling model, the feature vector M containing water quality, hydrology, meteorology and other information is first used as input, and the water quality non-point source pollution flux data is used as output to build an initialized pollutant emission estimation model. The mean square error is used as the loss function, and the loss function is optimized through back propagation and gradient descent to update the model parameters; among them, the loss function is used to measure the error between the estimated value and the measured value, and the model parameters are optimized to make the model estimated value as close to the measured value as possible. Therefore, the mean square error (MSE) is used as the loss function: ; In the formula, is the estimated value of water pollution flux of the ith sample, is the measured value of the water pollution flux of the i-th sample. The key to the optimization process is to calculate the gradient of the loss function for each layer through back propagation and update the model parameters using gradient descent.

[0051] Secondly, all hyperparameters are traversed through the grid search algorithm to select the optimal hyperparameter combination. The hyperparameters that need to be calibrated for the coupled model include: the number of stacked layers, the number of GRU gated units, the number of attention heads, the number of hidden units, and the learning rate. Based on the grid search algorithm, all hyperparameters are traversed and reasonable ranges or discrete values ​​are set, such as learning rate (1e-3, 1e-4, 1e-5), number of layers (2, 3, 4), number of hidden units (64, 128, 256), etc. For each set of hyperparameters, the average performance index (such as average MSE or NSE) of each cross-validation is calculated; select the hyperparameter combination that performs best in cross-validation.

[0052] Thirdly, the constructed Trans-GRU coupling model is back-propagated and gradient updated. In this case, back-propagation calculates the gradient of the loss function to the weight parameters of each layer through the chain rule, that is, the gradient is passed from the prediction layer to each layer, and the parameters of the model are gradually updated. Therefore, the mean square error gradient is calculated: ; In the formula, is the gradient of the loss function L with respect to the parameter θ; It is the derivative of the output water quality non-point source pollution flux estimate with respect to the parameter θ. Transformer Encode branch: Calculates the gradients of the self-attention mechanism and the feedforward network, and updates the corresponding weights. GRU branch: Calculates the gradients of the update gate, reset gate, and candidate hidden state, and updates the corresponding weights.

[0053] When updating the model weights, we use gradient descent to update the parameters: ; In the formula, It represents the model parameters after the λth iteration update. is the learning rate, which controls the step size of each update and is usually adopted During the iteration, the model parameters are updated along the negative gradient direction of the loss function, gradually approaching the minimum point, thereby minimizing the loss function.

[0054] Finally, we set the training termination condition to prevent overfitting and ensure that the model does not lose its generalization ability due to long training time. The specific steps are: (1) Set the Nash-Sutcliffe Efficiency (NSE) as the monitoring indicator, which is used to measure the difference between the model prediction value and the measured value. The value of NSE is between -∞ and 1. The closer the value is to 1, the better the prediction performance of the model. The calculation formula is: ; In the formula, B is the number of samples, It is The measured value of water pollution flux of samples, is the corresponding estimated water quality non-point source pollution flux, is the average of the measured values. NSE>0.8 means that the model has good fitting performance.

[0055] (2) After each epoch, check the NSE indicator on the validation set. If the performance on the validation set does not improve significantly after several consecutive rounds (for example, 10 rounds), stop training and record the model parameters with the highest NSE as the final weight parameters.

[0056] Furthermore, the K-Fold Cross-Validation method is used to comprehensively evaluate the prediction performance and generalization ability of the constructed Trans-GRU coupling model. The specific steps are as follows: divide the dataset into K subsets, and then in each round, select one of the subsets as the validation set and the remaining K-1 subsets as the training set. The model is trained on the training set and evaluated on the validation set, repeated K times, each time using a different subset as the validation set, and finally the average of the K evaluation results is used as the performance evaluation of the model. Assuming that the mean square error (MSE) is used as the evaluation indicator, the results of multiple validations are , ,… , that is, the average MSE is: ; This method can reduce the accidental impact caused by data division and ensure the reliability of the evaluation results. In addition, appropriate evaluation indicators (such as R² determination coefficient, MAE mean absolute error, RMSE root mean square error, MAPE mean absolute error percentage, etc.) can also be used to evaluate the performance of the model in the task of non-point source pollution flux estimation. The specific indicators are as follows: ; ; ; ; In the formula, B represents the number of samples, , represent the measured and estimated values ​​of pollution flux, respectively. is the average value of the measured pollution flux. Applicable to linear regression models, measuring the model's fitting ability. The closer it is to 1, the better the effect. MAE is insensitive to outliers and is suitable for tasks that require robustness. These indicators take into account the variance explanation power ( ), residual magnitude (MAE and RMSE), and proportional accuracy (MAPE), thereby comprehensively evaluating the performance of the model.

[0057] Step S41, the trained Trans-GRU coupling model uses the Transformer Encode branch to calculate the feature vector layer by layer and output the Transformer branch feature.

[0058] Input feature vector M, and map M from the original dimension F to a new spatial dimension through linear transformation , represents the input features in a higher dimensional space. The encoding is as follows:

[0059] In the formula, is a trainable weight matrix with dimension F× .

[0060] The feature vector of each time step (i.e., daily, monthly) in the time series is encoded with a position code, so that the attention mechanism can use the position information equivalent to the time sequence. The encoding is as follows: ; ; ; In the formula, is the position code at time t, i is the dimension index, that is, the relative order of the spatial dimensions in the vector, yes Dimension.

[0061] For each time step, the water pollution flux, rainfall and other characteristics will be obtained through the weight matrix obtained through training ( , , ), calculate the query (Q), key (K), and value (V) matrices for all time steps: , , ; In the formula, Q represents the query of the current time step on other time steps; K represents the influence of other time steps on the current time step; V represents the actual feature information corresponding to the time step, that is, each row vector of the V matrix contains the actual feature information of the corresponding time step after linear transformation, that is, the measured value or state of the time step after mapping.

[0062] The similarity between Q and K is calculated through the self-attention mechanism, and the influence weight of each time step is determined by the dot product, that is, the output of each time step is derived from the weighted sum of other time steps, thereby capturing the global dependencies in the input sequence: ; In the formula, Represents the similarity between different time steps; It is the dimension of the key, which is used for scaling to prevent gradient explosion; It is used to convert the similarity into a probability distribution, ensuring that the sum of the attention weights is 1.

[0063] The multi-head attention layer of the encoder maps the query, key, and value matrices to H subspaces (attention heads) for parallel calculations, understanding the dynamic changes of pollutant emissions from multiple perspectives. That is, one attention head can focus on the relationship between meteorological characteristics and water quality non-point source pollution flux, and another head can focus on the relationship between land use type and water quality non-point source pollution flux. Each head captures these relationships independently and finally fuses them together: ; ; In the formula, Represents the relationship between different characteristics and water quality non-point source pollution flux, is the output linear weight matrix, and H is the number of attention heads. Each head calculates an independent attention weight, and the results of all heads are combined, and the feature representation based on long-term relationship information is initially obtained through linear transformation. .

[0064] The output of the multi-head attention layer is connected to the input with a residual connection to alleviate the gradient vanishing problem during training, and is standardized through layer normalization to improve the stability of model training: ; In the formula, represents the position-encoded input vector, Represents the output of the multi-head attention layer. Normalization helps ensure the stability of the mean and variance of the output and promotes the convergence of the model.

[0065] The feedforward network FFN is used to help the model learn complex spatiotemporal dependencies, especially how different temporal and spatial factors affect non-point source pollution of water quality. It usually consists of two fully connected layers and an activation function: ; ; In the formula, , , , is the weight matrix and bias term of the first and second fully connected layers, max() is the activation function, which converts the output value of the first layer after full connection ( ) for nonlinear mapping (preserving positive values). After residual connection and layer normalization, the stability of the training process is ensured.

[0066] Therefore, the output feature of the Transformer Encode branch is the Transformer branch feature output by the input vector M after L encoder layers are iterated. .

[0067] Step S42, the trained Trans-GRU coupling model uses the GRU gated unit branch to calculate the feature vector layer by layer, and the process of outputting the GRU branch feature is: Divide the input feature M into feature vectors at different time steps , where t = 1, 2, …, T represents the time step. Each Contains the water pollution flux characteristics and driving factor characteristics at the current moment.

[0068] Control the input features at the current time t through the update gate and the hidden state at the previous moment t-1 The weight distribution between them. That is, according to the water quality pollution flux characteristics and driving factor characteristics at the current moment, as well as the water quality pollution flux characteristics and driving factor characteristics at the past moment, it is decided whether to retain the information at time t -1. The structure is as follows: ; In the formula, It is the update gate output, and the output value range is between [0,1], where 0 means completely forgetting the data information of the past moment, and 1 means completely retaining the data information of the past moment; It is the Sigmoid activation function, which determines the degree of information update. is the input feature The weight matrix of is the weight matrix of the hidden state at time t-1, is the update gate bias term.

[0069] The reset gate is used to control the influence of the hidden state at time t-1 on the calculation of the candidate hidden state at the current time t. That is, it is used to determine whether some surface driving factors at time t-1 are still meaningful for the water pollution flux prediction at time t. The structure is as follows: ; In the formula, It is the output of the reset gate, and the output value range is between [0,1]. 0 means completely forgetting the feature influence at time t-1, and 1 means completely retaining the feature influence at time t-1.

[0070] Based on the current input features AND RESET GATE OUTPUT Update the candidate hidden state, which reflects the potential change of water quality pollution flux at the current time t, and adjust the estimated value of water quality non-point source pollution flux in combination with the surface driving factors: ; In the formula is the candidate hidden state at the current time t, is element-wise multiplication, is the hyperbolic tangent function, which ensures that the output is in the range [-1,1].

[0071] Through the hidden state at time t-1 and the candidate hidden state at the current time t The weighted combination of gets the final hidden state: ; In the formula, It is the final hidden state and will be used as the input for the next time step, which integrates the changes in the current water pollution flux, historical pollution data, and the impact of surface driving factors.

[0072] Therefore, the GRU branch output features are different time steps , the GRU branch features output by G gating units iteratively .

[0073] Step S43, by weighted coupling of Transformer branch features and GRU branch features, outputting the surface source pollution flux prediction value through the prediction layer.

[0074] Transformer branch features With GRU branch features Fusion and weighted concatenation are performed to generate a unified feature representation: ; In the formula, It is a hyperparameter used to dynamically adjust the weights of the two features. The fusion feature contains both global context information and local temporal dynamic information.

[0075] The model prediction layer uses the fusion features output by the splicing layer For the final prediction task, the predicted value is calculated through a fully connected layer, where the number of output nodes is set to k, and each node corresponds to an estimated value of a future time step: ; In the formula, It is a nonlinear activation function that takes into account non-negativity, smoothness and derivability. In this way, the estimated value of water quality non-point source pollution flux in the corresponding area can be preliminarily obtained. .

[0076] Step S5, performing density clustering and trend testing on the predicted values ​​to obtain the emission intensity and emission trend of pollutants, dividing the risk level according to the emission intensity and emission trend of the pollutants, and realizing coastal risk identification and early warning.

[0077] Water quality non-point source pollution flux estimation data based on the output of the Trans-GRU coupling model Carry out spatial clustering, that is, identify high emission areas based on spatial density, where each data point corresponds to the non-point source pollution emission flux value at the kth time step in the future.

[0078] The pollutant emission flux value of each data point is combined with the spatial coordinate information (such as longitude and latitude) as the input of clustering. According to the neighborhood distance (Eps) and the minimum number of points (Min-Pts) parameters, density clustering is performed, and the clustering results will identify high-density areas of pollutant emissions. At the same time, the pollution level of each area is presented based on quantitative indicators to form a density map of pollution sources, which can be used as a preliminary identification of high-emission pollution areas along the coast.

[0079] Trend testing is carried out based on the estimated data of water quality non-point source pollution flux in high-emission areas identified by DBSCAN clustering, that is, identification of high-risk areas based on temporal change trends.

[0080] Extract the pollutant emission flux values ​​of k time steps in each region as the input of trend test. For each region, calculate the slope of all possible point pairs, that is, the slope between any two time points, and then take the median of these slopes to get β : ; Where i and j are any two time points that satisfy The pollution emission trend is determined based on the slope β: β>0 indicates an upward trend in pollution emissions, β<0 indicates a downward trend, and β ≈ 0 indicates no significant change. Thresholds can also be set to more precisely quantify the changes in pollution emissions in each area, providing a trend basis for risk assessment.

[0081] Risk identification and early warning are carried out based on the intensity of pollution emissions (DBSCAN clustering results) and change trends (Theil-Sen trend test results). The regions are divided into the following risk levels: red warning, indicating high risk: high emission areas and areas with strong rising pollution emissions; orange warning, indicating medium-to-high risk: high emission areas but fluctuating trends; yellow concern, indicating potential risk: low emission areas but areas with potential rising pollution emissions.

[0082] Based on real-time or predicted pollutant emission flux data, threshold alarms are triggered for high-risk areas, thereby achieving accurate identification of high-emission risk areas along the coast. Embodiment 2 This embodiment discloses a non-point source pollutant emission flux prediction and coastal risk identification system; like Figure 2As shown, a non-point source pollutant emission flux prediction and coastal risk identification system includes: The database construction module is configured to: obtain water quality pollution data and spatiotemporal auxiliary feature data of the study area, and pre-process the data to construct a water quality pollution database and a spatiotemporal auxiliary feature database; The causal analysis module is configured to: extract candidate areal driving factors based on the spatiotemporal auxiliary feature database, analyze the causal relationship between the candidate areal driving factors and water pollution using the CCM causal analysis model, and screen out key areal driving factors with high contribution; The supervised learning module is configured to: extract the time information features of the key surface driving elements and the explicit spatial features and the implicit spatial features, integrate the explicit spatial features and the implicit spatial features using the supervised learning transformation, and generate a feature vector; The non-point source pollutant flux prediction module is configured to: input the feature vector into a trained Trans-GRU coupling model, and output a predicted value of the non-point source pollutant flux; wherein the trained Trans-GRU coupling model uses the Transformer Encode branch and the GRU gating unit branch to calculate the feature vector layer by layer, and outputs the Transformer branch feature and the GRU branch feature; and outputs the non-point source pollution flux prediction value through the prediction layer by weighted coupling of the Transformer branch feature and the GRU branch feature; The coastal risk identification module is configured to: perform density clustering and trend testing on the predicted values ​​to obtain the emission intensity and emission trend of pollutants, divide the risk level according to the emission intensity and emission trend of the pollutants, and realize coastal risk identification and early warning.

[0083] Embodiment 3 The purpose of this embodiment is to provide a computer-readable storage medium.

[0084] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in a method for predicting non-point source pollutant emission flux and identifying coastal risks as described in Example 1.

[0085] Embodiment 4 The purpose of this embodiment is to provide an electronic device.

[0086] An electronic device comprises a memory, a processor and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in a method for predicting emission flux of non-point source pollutants and identifying coastal risks as described in Example 1 are implemented.

[0087] The steps involved in the apparatuses of the above embodiments 2, 3 and 4 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.

[0088] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.

[0089] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A method for predicting the emission flux of non-point source pollutants and identifying coastal risks, characterized in that: include: Acquire water quality pollution data and spatiotemporal auxiliary feature data of the study area, preprocess the data, and build a water quality pollution database and a spatiotemporal auxiliary feature database; Based on the spatiotemporal auxiliary feature database, candidate areal driving factors are extracted, and the causal relationship between candidate areal driving factors and water pollution is analyzed using the CCM causal analysis model to screen out key areal driving factors with high contribution. Extract the time information features of key surface driving elements as well as explicit spatial features and implicit spatial features, integrate the explicit spatial features and implicit spatial features using supervised learning transformation, and generate feature vectors; The feature vector is input into the trained Trans-GRU coupling model, and the predicted value of the non-point source pollutant flux is output; wherein the trained Trans-GRU coupling model respectively uses the Transformer Encode branch and the GRU gating unit branch to calculate the feature vector layer by layer, and outputs the Transformer branch features and the GRU branch features; the Transformer branch features and the GRU branch features are weightedly coupled, and the predicted value of the non-point source pollution flux is output through the prediction layer; Density clustering and trend testing are performed on the predicted values ​​to obtain the emission intensity and emission trend of pollutants, and risk levels are divided according to the emission intensity and emission trend of pollutants to achieve coastal risk identification and early warning.

2. A method for predicting non-point source pollutant emission flux and identifying coastal risks according to claim 1, characterized in that: The pretreatment process includes: Remove outliers from water pollution data and spatiotemporal auxiliary feature data, and use interpolation or neighboring values ​​to fill in missing values ​​in the data; Align water pollution data and spatiotemporal auxiliary feature data in time and space to unify time granularity and spatial resolution; Water pollution data and spatiotemporal auxiliary characteristic data are standardized to ensure the consistency of dimensions of different data.

3. The method for predicting non-point source pollutant emission flux and identifying coastal risks according to claim 1, characterized in that: The process of using the CCM causal analysis model to analyze the causal relationship between candidate surface driving factors and water pollution and screen out key surface driving factors with high contribution is as follows: The time series variables of water pollution flux in the water pollution database and the time series variables of candidate area driving elements in the spatiotemporal auxiliary feature database are extracted respectively, and normalized; According to the delayed embedding principle, the attractor manifolds of water pollution flux and candidate surface driving elements are reconstructed respectively, and the time series manifolds of water pollution flux and candidate surface driving elements are generated; According to the time series manifold of water pollution flux, find the nearest neighbor points and calculate the Euclidean distance, and use weights to measure the similarity between state vectors; Based on the temporal manifold of the candidate areal driving element and the weight, the predicted value of the candidate areal driving element is calculated, and the causal contribution of the candidate areal driving element to the pollutant flux is determined by calculating the convergence cross-mapping capability value; Through two-way causal test, key surface driving factors with high contribution to pollutant flux are screened out.

4. The method for predicting non-point source pollutant emission flux and identifying coastal risks according to claim 1, characterized in that: The explicit spatial features include point longitude and latitude features and water body type features; the implicit spatial features include water pollution flux features, key driving factor features, and time information features.

5. The method for predicting non-point source pollutant emission flux and identifying coastal risks according to claim 1, characterized in that: The trained Trans-GRU coupling model uses the Transformer Encode branch to calculate the feature vector layer by layer, and the process of outputting the Transformer branch features is as follows: A linear transformation is used to map the feature vector from the original dimension to a new spatial dimension, representing the input features in a higher-dimensional space; Add position encoding to the feature vector of each time step in the time series so that the attention mechanism can use position information equivalent to time order; The encoder computes the query matrix, key matrix, and value matrix of the feature vector at each time step; Calculate the attention weights between the current time step and other time steps; The query, key, and value matrices are mapped to different subspaces through a multi-head attention mechanism to obtain feature representation based on long-term temporal relationship information; The feature representation based on long-term temporal relationship information is subjected to residual connection and layer normalization. The temporal and spatial dependencies of water quality non-point source pollution are captured through a feedforward network, and Transformer branch features are output.

6. The method for predicting non-point source pollutant emission flux and identifying coastal risks according to claim 1, characterized in that: The trained Trans-GRU coupling model uses the GRU gated unit branch to calculate the feature vector layer by layer, and the process of outputting the GRU branch features is: Dividing the feature vector into feature vectors at different time steps; The update gate is used to control the weight distribution between the input features at the current moment and the hidden state at the previous moment; the reset gate is used to control the influence of the hidden state at the previous moment on the calculation of the candidate hidden state at the current moment; The candidate hidden state is updated based on the divided feature vector and the reset gate output, and the GRU branch feature is obtained by calculating the weighted combination of the hidden state at the previous moment and the candidate hidden state at the current moment.

7. The method for predicting non-point source pollutant emission flux and identifying coastal risks according to claim 1, characterized in that: The process of performing spatial clustering and trend testing on the predicted values ​​to obtain the emission intensity and emission trend of pollutants is as follows: The pollutant emission flux value of each data point in the predicted value is combined with the spatial coordinate information as the input of clustering. According to the neighborhood distance and minimum point number parameters, density clustering is performed to identify high-density areas of pollutant emission. The pollution level of each area is presented based on quantitative indicators, forming a density map of pollution sources and achieving preliminary identification of high-emission pollution areas along the coast; Extract the pollutant emission flux values ​​of each pollution area at different time steps as the input of trend test; For each region, the slopes between all pairs of time points are calculated and the median is taken. The trend of pollution emissions is determined based on the median slope.

8. A system for predicting the emission flux of non-point source pollutants and identifying coastal risks, characterized by: include: The database construction module is configured to: obtain water quality pollution data and spatiotemporal auxiliary feature data of the study area, and pre-process the data to construct a water quality pollution database and a spatiotemporal auxiliary feature database; The causal analysis module is configured to: extract candidate areal driving factors based on the spatiotemporal auxiliary feature database, analyze the causal relationship between the candidate areal driving factors and water pollution using the CCM causal analysis model, and screen out key areal driving factors with high contribution; The supervised learning module is configured to: extract time information features, explicit spatial features and implicit spatial features of key surface driving elements, integrate the explicit spatial features and implicit spatial features using supervised learning transformation, and generate feature vectors; The non-point source pollutant flux prediction module is configured to: input the feature vector into a trained Trans-GRU coupling model, and output a predicted value of the non-point source pollutant flux; wherein the trained Trans-GRU coupling model uses the Transformer Encode branch and the GRU gating unit branch to calculate the feature vector layer by layer, and outputs the Transformer branch feature and the GRU branch feature; and outputs the non-point source pollution flux prediction value through the prediction layer by weighted coupling of the Transformer branch feature and the GRU branch feature; The coastal risk identification module is configured to: perform density clustering and trend testing on the predicted values ​​to obtain the emission intensity and emission trend of pollutants, divide the risk level according to the emission intensity and emission trend of the pollutants, and realize coastal risk identification and early warning.

9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in a method for predicting non-point source pollutant emission flux and identifying coastal risks as described in any one of claims 1-7 are implemented.

10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the method for predicting non-point source pollutant emission flux and identifying coastal risks as described in any one of claims 1-7 are implemented.

Citation Information

Patent Citations

  • Mobile pollution source emission concentration prediction method based on space-time deep learning

    CN109492830A

  • Spatial interpolation method and device for multi-source heterogeneous air pollutants and computer equipment

    CN113887143A

  • Water quality prediction method based on graph neural network and spatial-temporal feature fusion

    CN119598402A

  • Apparatus and method for diagnosing dysphagia state

    KR1020250014869A

  • Soil cadmium risk prediction method based on spatial-temporal interaction relationship

    WO2023168781A1

Cited By

  • Coastal zone ecological safety early warning method and system based on big data

    CN120783223A

  • Intelligent early warning method for soil and groundwater pollution in industrial gathering area

    CN121258222A

  • Long-term scheduling prediction system based on time sequence analysis

    CN122311569A