A new pollutant tracing prediction method and related devices

By constructing a heterogeneous graph structure and a nearest neighbor graph, and combining SHAP weights and Euclidean distance, the problem of insufficient accuracy and interpretability of graph neural network models in tracing the source of new pollutants is solved, and efficient analysis and prediction of the source of new pollutants in water bodies are realized.

CN122290761APending Publication Date: 2026-06-26XIANGJIANG LAB

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIANGJIANG LAB
Filing Date
2026-04-13
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing graph neural network models cannot effectively utilize feature importance priors and SHAP weights in tracing the sources of new pollutants, resulting in a disconnect between the graph structure and the tracing mechanism, and insufficient accuracy and interpretability, especially in water environments with multi-source emissions and significant spatiotemporal variations.

Method used

By constructing heterogeneous graph structures and nearest neighbor graphs, and combining SHAP weights and Euclidean distance, the flow relationships and similarity associations between new pollutant sites are explored. The fusion prediction is performed using prior knowledge view embedding and data similarity view embedding to improve the accuracy and interpretability of source tracing.

Benefits of technology

It enables a thorough analysis of new pollutant sources in target water bodies, improves the accuracy and interpretability of source prediction, and effectively distinguishes different source pathways and highlights key cross-section-outlet combinations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122290761A_ABST
    Figure CN122290761A_ABST
Patent Text Reader

Abstract

This application relates to the field of new pollutant source tracing technology in water bodies, and provides a method and related equipment for predicting new pollutant sources. The method includes: acquiring mass spectrometry data from multiple locations in a target water body area; constructing a material screening matrix for each location based on all mass spectrometry data; constructing a heterogeneous graph structure based on the material screening matrix, and constructing a nearest neighbor graph for the target water body locations; calculating the prior knowledge view embedding corresponding to the target water body area based on the heterogeneous graph structure, and calculating the data similarity view embedding corresponding to the target water body area based on the nearest neighbor graph; and performing a fusion prediction on the target water body area based on the prior knowledge view embedding and the data similarity view embedding to obtain the new pollutant source tracing prediction result for the target water body area. The method of this application can improve the accuracy and interpretability of new pollutant source tracing prediction in water bodies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of water pollution technology, and in particular to a new method for predicting pollutant sources and related equipment. Background Technology

[0002] In the scenario of tracing the source of new pollutants in water bodies driven by non-targeted screening mass spectrometry data, existing graph neural network models rely solely on the statistical correlation between features or the geometric proximity between samples when constructing the graph structure. They cannot utilize the prior importance of features and the weights of Shapley Additive exPlanations (SHAP) provided by the machine learning model to automatically construct "heterogeneous edges that truly contribute to the source tracing task." This leads to a disconnect between the graph structure and the source mechanism of new pollutants, resulting in insufficient accuracy, robustness, and interpretability of source tracing predictions. Specifically, on the one hand, traditional methods typically construct graphs from a single-sided perspective, making it difficult to explicitly extract semantically different relationship types such as "cross-section-cross-section" and "outlet-cross-section" from high-dimensional features such as non-targeted mass spectrometry. On the other hand, even when graph neural networks are introduced, they mostly construct homogeneous edges based on statistical quantities such as mutual information and Pearson correlation coefficients, failing to answer the question of "which features are connected, or which features point to which cross-sections," and which edges are truly driven by the source tracing contribution of new pollutants. Therefore, existing technologies suffer from the following prominent problems: 1. Lack of prior-driven heterogeneous edge construction mechanism: It cannot automatically filter and weight heterogeneous relationships such as D-D (section-to-section) and W-D (outlet-to-section) from non-targeted mass spectrometry data based on feature importance and SHAP weight, resulting in a single edge type in the graph and insensitivity to the task. 2. The graph structure and the source tracing mechanism are disconnected: the existence and weight of edges mainly reflect "statistical correlation" rather than "contribution to the identification of new pollutant sources", which makes it difficult to reflect the role of "key relationship subgraphs automatically induced by the prior SHAP matrix"; 3. Insufficient generalization and interpretability for complex pollution: In aquatic environments with multi-source emissions and significant changes in spatiotemporal conditions, single correlation diagrams are easily misled by noise and accidental correlations, and cannot distinguish different source paths or highlight key cross-section-outlet combinations through heterogeneous edge types and weights.

[0003] This shows that there are currently problems with the low accuracy and interpretability of new pollutant source tracing and prediction. Summary of the Invention

[0004] This application provides a new method and related equipment for predicting the source of pollutants, which can solve the problems of low accuracy and interpretability in predicting the source of new pollutants.

[0005] In a first aspect, embodiments of this application provide a novel pollutant source tracing and prediction method, which includes: Acquire mass spectrometry data from multiple points in the target water body area; the points are either cross-sectional points or outlet points; cross-sectional points are the cross-sectional locations within the target water body area, and outlet points are the locations where new pollutants are discharged within the target water body area; A material screening matrix is ​​constructed for each site based on all mass spectrometry data; the material screening matrix is ​​used to describe the status of new pollutants present at the site. Based on the material screening matrix, a heterogeneous graph structure is constructed, and a nearest neighbor graph of the target water body region is constructed. In the heterogeneous graph structure, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the new pollutant flow relationship between the corresponding two points. In the nearest neighbor graph, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the similarity association of samples in the potential feature space. Calculate the prior knowledge view embedding corresponding to the target water body region based on the heterogeneous graph structure, and calculate the data similarity view embedding corresponding to the target water body region based on the nearest neighbor graph; Based on prior knowledge view embedding and data similarity view embedding, the target water body area is fused and predicted to obtain the new pollutant source prediction results for the target water body area.

[0006] Optionally, mass spectrometry data may include retention times and mass-to-charge ratios of various novel pollutants at the site; A material screening matrix was constructed for each site based on all mass spectrometry data, including: For each new pollutant, based on all retention times and mass-to-charge ratios corresponding to the new pollutant, determine the number of times the new pollutant satisfies the same material condition at all locations; For each location, perform the following steps: For each new pollutant substance in the mass spectrometry data of the traversal site, if the number of times the new pollutant substance satisfies the condition is greater than or equal to the threshold, an element with a value of 1 is generated; if the number of times the new pollutant substance satisfies the condition is less than the threshold, an element with a value of 0 is generated. By integrating all elements into a matrix, we obtain the material screening matrix for the points.

[0007] Optionally, the same material conditions are: the difference in retention time between the new pollutants at the two sites is less than or equal to the time tolerance threshold, and the difference in their mass-to-charge ratio is less than or equal to the mass-to-charge ratio tolerance threshold.

[0008] Optionally, a heterogeneous graph structure is constructed based on the material screening matrix, including: Identify the upstream cross-section point for each cross-section point from all cross-section points; For each cross-section point, based on the material screening matrix of the upstream cross-section point and the material screening matrix of all discharge points, calculate the new pollutant flow relationship between the cross-section point and the upstream cross-section point, as well as between each discharge point, and calculate the SHAP weight corresponding to each new pollutant flow relationship. For each location, a corresponding node is generated. Based on the flow relationships of all new pollutants, edges are generated between the nodes, and the SHAP weights corresponding to the edges are used as edge attributes to obtain a heterogeneous graph structure.

[0009] Optionally, a nearest neighbor map of the target water body region can be constructed, including: Feature learning and aggregation are performed on the mass spectrometry data of each location to obtain the global feature representation of each location; Calculate the Euclidean distance between the feature representations of every two points, and determine the similarity association between the two points based on the Euclidean distance; Each point is treated as a node in the nearest neighbor graph, and edges between nodes are generated based on the similarity association to construct a point nearest neighbor graph that reflects the distribution structure of the data domain.

[0010] Optionally, the similarity association between two corresponding points can be determined based on Euclidean distance, including: For each point, calculate the Euclidean distance between its feature embedding vectors and other samples from the batch data, select the K samples with the smallest distance as the nearest neighbors of the current sample, and set topological connections between them to construct a sample nearest neighbor graph based on the data distribution manifold structure.

[0011] Optionally, the prior knowledge view embedding corresponding to the target water body region is calculated based on the heterogeneous graph structure, including: Feature extraction and residual normalization updates are performed on the heterogeneous graph structure to obtain heterogeneous graph features. Global normalization is then performed on the heterogeneous graph features to obtain the prior knowledge view embedding corresponding to the target water body region.

[0012] Optionally, the embedding of data similarity views corresponding to the target water body region is calculated based on the nearest neighbor map, including: By performing graph convolution and normalization on the nearest neighbor graph, we obtain the data similarity view embedding corresponding to the target water body region.

[0013] Secondly, embodiments of this application provide a novel pollutant source tracing and prediction device, comprising: The acquisition module is used to acquire mass spectrometry data from multiple points in the target water body area; the points are cross-sectional points or discharge outlet points; cross-sectional points are the cross-sectional locations in the target water body area, and discharge outlet points are the locations in the target water body area where new pollutants are discharged; The first construction module is used to build a material screening matrix for each site based on all mass spectrometry data; the material screening matrix is ​​used to describe the status of new pollutants present at the site. The second construction module constructs a heterogeneous graph structure based on the material screening matrix and a nearest neighbor graph for the target water body area. In the heterogeneous graph structure, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the flow relationship of new pollutants between two corresponding points. In the nearest neighbor graph, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the similarity association of samples in the potential feature space. The calculation module is used to calculate the prior knowledge view embedding corresponding to the target water body region based on the heterogeneous graph structure, and to calculate the data similarity view embedding corresponding to the target water body region based on the nearest neighbor graph. The prediction module is used to perform fusion prediction on the target water body area based on prior knowledge view embedding and data similarity view embedding to obtain the new pollutant source prediction results for the target water body area.

[0014] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the novel pollutant source tracing and prediction method described above.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned novel pollutant source tracing and prediction method.

[0016] The above-mentioned solution in this application has the following beneficial effects: In the embodiments of this application, mass spectrometry data from multiple points in the target water body area are acquired. Then, a material screening matrix is ​​constructed for each point based on all mass spectrometry data. Next, a heterogeneous graph structure is constructed based on the material screening matrix, and a nearest neighbor graph for the target water body area is also constructed. Then, the prior knowledge view embedding corresponding to the target water body area is calculated based on the heterogeneous graph structure, and the data similarity view embedding corresponding to the target water body area is calculated based on the nearest neighbor graph. Finally, the target water body area is fused and predicted based on the prior knowledge view embedding and the data similarity view embedding to obtain the prediction result of new pollutant source tracing for the target water body area. The construction of the heterogeneous graph structure and the nearest neighbor graph enables the mining and analysis of the correlation between points in terms of both the flow of new pollutants and the similarity associations between points. This allows for a thorough analysis of the source tracing of new pollutants in the target water body area. Water pollution prediction based on the heterogeneous graph and the nearest neighbor graph effectively improves the accuracy and interpretability of the prediction of new pollutant source tracing for water bodies.

[0017] Other beneficial effects of this application will be described in detail in the following detailed description section. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a novel pollutant source tracing and prediction method provided in an embodiment of this application; Figure 2 This is a schematic diagram of model performance results provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the importance of features in an embodiment of this application; Figure 4 This application provides a schematic diagram of SHAP results and a demonstration of actual verification. Figure 5 A schematic diagram of SHAP before and after the update provided for an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a novel pollutant source tracing and prediction device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0021] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0022] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0023] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0024] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0026] To address the issues of low accuracy and interpretability in existing methods for predicting the source of new pollutants in water bodies, this application provides a method for predicting the source of new pollutants. This method acquires mass spectrometry data from multiple locations within a target water body area, constructs a material screening matrix for each location based on all mass spectrometry data, builds a heterogeneous graph structure based on the material screening matrix, and constructs a nearest neighbor graph for the target water body area. Then, it calculates the prior knowledge view embedding corresponding to the target water body area based on the heterogeneous graph structure and the data similarity view embedding corresponding to the target water body area based on the nearest neighbor graph. Finally, it performs a fusion prediction on the target water body area based on the prior knowledge view embedding and the data similarity view embedding to obtain the predicted source of new pollutants in the target water body area. The construction of the heterogeneous graph structure and the nearest neighbor graph enables the mining and analysis of the relationships between locations in terms of both the flow of new pollutants and the similarity associations between locations, achieving a comprehensive analysis of the source of new pollutants in the target water body area. Water pollution prediction based on the heterogeneous graph and the nearest neighbor graph effectively improves the accuracy and interpretability of predicting the source of new pollutants in water bodies.

[0027] The following is an exemplary description of the new pollutant source tracing and prediction method provided in this application.

[0028] like Figure 1 As shown, the novel pollutant source tracing and prediction method provided in this application includes the following steps: Step 11: Obtain mass spectrometry data from multiple points in the target water body area.

[0029] The target water bodies mentioned above are those requiring source tracing of new pollutants, such as rivers, river networks, lakes, reservoirs, or watersheds. The locations mentioned include cross-sectional locations D and discharge points W. Cross-sectional location D is the cross-sectional position of a river or waterway within the target water body area; discharge point W is the location where new pollutants may be discharged within the target water body area, including but not limited to industrial enterprise discharge outlets, park discharge outlets, or other discharge outlet locations. The mass spectrometry data mentioned above are data obtained from mass spectrometry detection of samples at each location, and their characteristics may include: the chromatographic retention time RT (chromatographic retention time of ions or characteristic peaks related to the new pollutant). In mass spectrometry analysis, the time from the injection of a target compound or its characteristic ion peak to its separation on the chromatographic column and the appearance of a peak signal on the detector, and the ion mass-to-charge ratio m / z (the ratio of the mass of an ion to the number of charges it carries, i.e., the mass-to-charge ratio of an ion; where m represents the ion mass, z represents the charge number, and m / z is a parameter used in mass spectrometry detection to characterize the position of ions); new pollutants include, but are not limited to, per- and polyfluoroalkyl substances (PFAS), new organic pollutants, inorganic ions, and heavy metals.

[0030] In some embodiments of this application, mass spectrometry data of the site can be obtained using devices such as ion chromatographs and flow meters.

[0031] Step 12: Construct a material screening matrix for each site based on all mass spectrometry data.

[0032] The above material screening matrix is ​​used to describe the status of new pollutants present at the site.

[0033] In some embodiments of this application, the step of constructing a material screening matrix for each site based on all mass spectrometry data includes: The first step is to determine, for each new pollutant, the number of times the new pollutant satisfies the same material condition at all locations, based on all retention times and mass-to-charge ratios corresponding to the new pollutant.

[0034] It should be noted that the above-mentioned identical material conditions are: the difference in retention time between the new pollutants at the two sites is less than or equal to the time tolerance threshold, and the difference in their mass-to-charge ratio is less than or equal to the mass-to-charge ratio tolerance threshold.

[0035] For example, the time tolerance threshold is 0.2 min and the mass-to-charge ratio tolerance threshold is 0.015 Da. Calculate the difference in residence time and mass-to-charge ratio between new pollutants in the mass spectrometry data of every two points. If the difference in residence time is less than or equal to 0.2 min and the mass-to-charge ratio difference is less than or equal to 0.015 Da, then increment the number of times the new pollutant is satisfied by 1. The initial value of the number of times the pollutant is 0.

[0036] The second step involves performing the following steps for each location: For each new pollutant in the mass spectrometry data of the traversal site, if the number of times the new pollutant satisfies the condition is greater than or equal to the threshold, an element with a value of 1 is generated; if the number of times the new pollutant satisfies the condition is less than the threshold, an element with a value of 0 is generated.

[0037] By integrating all elements into a matrix, we obtain the material screening matrix for the points.

[0038] For example, the number of times threshold can be 2.

[0039] Step 13: Based on the material screening matrix, construct a heterogeneous graph structure and construct a nearest neighbor graph for the target water body region.

[0040] In the above heterogeneous graph structure, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the new pollutant flow relationship between two corresponding points. In the nearest neighbor graph, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the similarity association of samples in the latent feature space.

[0041] In some embodiments of this application, the steps of constructing a heterogeneous graph structure and constructing a nearest neighbor graph of the target water body region based on the material screening matrix include: The first step is to identify the upstream cross-section point of each cross-section point from all cross-section points.

[0042] For example, the flow direction of water in the target water body area is analyzed, and other cross-sections upstream of the cross-section point are taken as the upstream cross-section points of this cross-section point.

[0043] The second step involves calculating the new pollutant flow relationships between each cross-section point and its upstream cross-section points, as well as between each discharge point, based on the material screening matrix of the upstream cross-section points and the material screening matrix of all discharge points. The SHAP weight corresponding to each new pollutant flow relationship is then calculated.

[0044] For example, the extreme gradient boosting (XGBoost) model can be used to calculate the new pollutant flow relationships between cross-section points and their upstream counterparts, as well as between each discharge point, based on the material screening matrices of the upstream cross-section points and all discharge points. The aforementioned XGBoost model can be trained using sample data (actual new pollutant flow relationship data for the sample water body area) through particle swarm optimization (PSO). XGBoost outputs the 0 / 1 states between points; an output of 1 indicates a new pollutant flow relationship between the two points, while an output of 0 indicates no new pollutant flow relationship exists.

[0045] GNN-SHAP (a method for interpreting the prediction results of graph neural networks (GNNs) that combines graph neural networks with SHAP) can be used to substitute the mass spectrometry data of two points with new pollutant flow relationships, calculate the SHAP weights, and thus quantify the influence weights of different monitoring locations on the water quality of the target section, thereby realizing the closed-loop link from numerical feature modeling to pollution source analysis.

[0046] During model training, a two-step splitting strategy was designed: the first step is to independently split 10% of the data as an independent validation set (ensuring that the model has never seen this validation data before) for early stopping and generalization ability evaluation; the second step is to further split the remaining data into a training set (80%) and a test set (20%).

[0047] In the model parameter optimization section, the PSO algorithm is used to jointly search for the optimal XGBoost parameters on all cross-sectional models applying non-targeted data, achieving globally consistent hyperparameter tuning. This PSO algorithm simultaneously explores approximately 200 candidate parameter combinations, rapidly approximating the optimal XGBoost parameter combination through information sharing and co-evolution among particles, making the parameter search both efficient and global.

[0048] The third step is to generate a corresponding node for each location, generate edges between nodes based on the flow relationships of all new pollutants, and use the SHAP weights of the edges as edge attributes to obtain a heterogeneous graph structure.

[0049] Specifically, if there is a new pollutant flow relationship between two points, then an edge is generated between the corresponding two nodes.

[0050] The fourth step is to perform feature learning and aggregation on the mass spectrometry data of each location to obtain the global feature representation of each location.

[0051] For example, a graph neural network (GNN) can be used to encode mass spectrometry data to obtain a data embedding.

[0052] The fifth step is to calculate the Euclidean distance between the feature representations of every two points, and determine the similarity association between the two points based on the Euclidean distance.

[0053] Specifically, for each point, the K points with the smallest Euclidean distance from other points are selected as the nearest neighbor samples of the point, and similarity connections are established between the point and each nearest neighbor sample, thereby determining the nearest neighbor graph structure that reflects the distribution pattern among the points.

[0054] The sixth step is to treat each point as a node in the nearest neighbor graph and generate edges between nodes based on the similarity association to construct a point nearest neighbor graph that reflects the data domain distribution structure.

[0055] For example, if there is a similarity association between two points, a similarity connection is established between the point and each of its nearest neighbor samples; otherwise, no connection is established.

[0056] In some embodiments of this application, the importance of each feature is first smoothed and amplified / suppressed using an existing prior SHAP matrix (which can be pre-calculated by models such as XGBoost combined with the SHAP algorithm). The code reads the prior SHAP matrix shap_df using the function ensure_shap_loaded(), and then calculates the feature importance vector in compute_shap_vectors(). For each feature f_i, the column-wise average of the prior SHAP matrix is ​​taken to obtain the original importance vector s_raw=(s_raw,1,…,s_raw,F), which is then Gaussian smoothed and adaptively scaled by the median to obtain the enhanced vector s_boost=(s_boost,1,…,s_boost,F). Then, softmax normalization is used to obtain the prior feature weight vector s_norm. s_raw,i=mean_j(SHAP_{j,i}); s_boost,i={1.9×s_raw,i, if s_raw,i>median(s_raw); 0.07×s_raw,i, if s_raw,i≤median(s_raw)}; s_norm,i=exp(s_boost,i) / Σ_{k=1}^Fexp(s_boost,k).

[0057] Where SHAP_{j,i} represents the value of the j-th row and i-th column in the SHAP matrix, and median(s_raw) is the median of s_raw.

[0058] The above calculation process is completed in the script by the function compute_shap_vectors(), which returns (shap_vals_raw, shap_vals_boost, shap_values_norm), where shap_values_norm is s_norm.

[0059] After obtaining the prior SHAP matrix, this embodiment uses the function `build_hetero_edges_from_shap_df(shap_df_in)` to automatically induce the construction of two types of heterogeneous edges: D–D (section-to-section) and W–D (outlet-to-section). Specifically, the SHAP matrix is ​​first filtered by row and column intersection to ensure that the row and column indices correspond to the same set of named features, and the prior matrix `SHAP_local` in square matrix form is obtained accordingly. SHAP_local = SHAP[common_rows, common_cols]; Here, `common_rows` and `common_cols` are the intersection of row and column names. Let the feature naming set be denoted as `Names={name_1,…,name_M}`, and construct a mapping from names to indices: name_to_idx(name_k)=k,k=1,…,M; This embodiment distinguishes between cross-section type nodes (D) and outlet type nodes (W) using feature naming rules. For example, nodes starting with "D" are considered cross-section nodes, and nodes starting with "W" are considered outlet nodes. For any two feature nodes name_i and name_j, their prior SHAP relation value is denoted as: v_{i,j}=SHAP_local[name_i,name_j]; If v_{i,j} is less than or equal to 0, then there is no valid positive contribution relationship between the two nodes, and no edge is generated; if v_{i,j} > 0, then a D-D or W-D heterogeneous edge is generated according to the node type. If name_i∈D and name_j∈D, then generate a D–D type edge e_{i→j}, and denote the relation type as edge_type=0; If name_i∈W and name_j∈D, then generate an edge of type W–D, e_{i→j}, and denote the relation type as edge_type=1; Other combinations (such as D–W, W–W) do not generate edges.

[0060] Collect all positive weighted edges that meet the conditions, and denote their original weights as w_raw,k. Then, normalize the maximum value of all edge weights: w_k=w_raw,k / (max_{ w_raw, +1e-12).

[0061] Finally, we obtain the set of directed edges of the heterogeneous graph, along with their weights and types: edge_index∈N^{2×E}; Among them, edge_index[0,k]=name_to_idx(name_src_k), edge_index[1,k]=name_to_idx(name_dst_k); edge_weight∈R^{E}, the weight of the kth edge is w_k; edge_type∈{0,1}^{E}, where 0 represents a D–D edge and 1 represents a W–D edge; The above graph construction process is implemented in the code by the function `build_hetero_edges_from_shap_df`, which returns (edge_index, edge_weight, edge_type, names). This embodiment automatically constructs D–D / W–D heterogeneous edges from the prior SHAP matrix, directly solidifying the prior importance of features obtained from traditional machine learning into the graph structure, thereby biasing and strengthening the information propagation of key new pollutant features and their hydrodynamic control factors in the graph neural network.

[0062] To further utilize prior SHAP weights along the node feature dimension, this embodiment sets up a feature attention module, AdversarialSHAPAttention, in the input layer. Its core is a set of trainable feature weight vectors w_feat∈R^{F}. In the code, AdversarialSHAPAttention holds the parameter self.feature_weights, whose initial value is obtained through the following method in train_single_hetero(): init_len=min(model.sparse_attn.feature_weights.data.numel(),shap_values_norm.shape[0]); model.sparse_attn.feature_weights.data[:init_len]=torch.tensor(shap_values_norm[:init_len],dtype=torch.float32).

[0063] The aforementioned prior vector s_norm is written into the first F dimensions to achieve SHAP prior initialization. During forward propagation, for the input feature matrix X∈R^{N×F}, the feature attention module first performs softmax normalization on w_feat to obtain the feature attention distribution α∈R^{F}: α_i=exp(w_feat,i) / Σ_{k=1}^Fexp(w_feat,k); Then, the original features are weighted dimension by dimension, and the weighted feature matrix X_attn∈R^{N×F} is output: X_attn[n,i]=X[n,i]×α_i.

[0064] The above process is implemented in the code by AdversarialSHAPAttention.forward(), which returns (x*attn_weights.unsqueeze(0),attn_weights). In the subsequent network, the forward function of EpicHeteroGNN first calls self.sparse_attn(raw_features) to obtain the feature attention vector, and then maps it to the graph node values ​​through _apply_node_attention.

[0065] For example, the performance of the XGBoost model optimized using PSO employed in this application is studied, and the performance results are as follows: Figure 2 As shown, Figure 2 a and Figure 2 Figure b presents the performance evaluation results of the PSO-XGBoost model optimized with a prior SHAP matrix on two different datasets: antibiotics and PFAS. As shown in the figure, the model consistently achieves all core metrics (accuracy, precision, recall, F1 score, and AUC) above 0.93 in both prediction tasks, with particularly outstanding F1 scores of 0.9373 (antibiotics) and 0.964 (PFAS). This highly consistent and excellent performance demonstrates the model's strong generalization ability.

[0066] Therefore, this result strongly validates that the prior SHAP matrix constructed by PSO-XGBoost has good universality and effectiveness, and can be successfully transferred and applied as a reliable optimization strategy to the predictive modeling of different types of new pollutants. The horizontal axis represents different evaluation indicators, and the vertical axis represents the score. From the model performance results, the test set accuracy of almost all sections is above 0.90, the F1 score is 0.92~0.96, and the AUC value is 0.95~0.99, indicating that the overall classification performance is very good. The validation set performance is very close to that of the test set, with a small difference (e.g., D1: test F1 score 0.952 vs. validation F1 score 0.9373, difference 0.0147), indicating low overfitting. A few sections (such as D7) are slightly lower than other sections overall, which may be due to data distribution or sample size. This reflects the first characteristic of this code: after global PSO parameter tuning, a set of parameters performs highly consistently across all sections, ensuring overall robustness.

[0067] The feature importance of each point calculated using the PSO-optimized XGBoost model is as follows: Figure 3 As shown, Figure 3 The horizontal axis represents the feature importance value, and the vertical axis represents the feature importance ranking of each target cross-section point for its upstream river cross-section points and potential pollution outlets W. Figure 3 a is a schematic diagram illustrating the characteristic importance of point D1. Figure 3 b is a schematic diagram illustrating the characteristic importance of point D2. Figure 3 c is a schematic diagram illustrating the feature importance of point D3. Figure 3 d is a schematic diagram illustrating the characteristic importance of point D4. Figure 3 e is a schematic diagram illustrating the characteristic importance of point D7. Figure 3 f is a schematic diagram illustrating the feature importance of point D9. Figure 3 g is a schematic diagram illustrating the feature importance of point D10.

[0068] The SHAP results for each section and the SHAP prior weight matrix are as follows: Figure 4 As shown, Figure 4 D1-D11 are the cross-sectional point numbers, and W1-W11 are the outlet point numbers.

[0069] The original SHAP value and the updated SHAP value according to the above method are compared and verified as follows: Figure 5 a, Figure 5 b、 Figure 5 As shown in c. Figure 5 a, Figure 5 In diagram b, the vertical axis represents the point number, and the horizontal axis represents the SHAP value. Prior SHAP is the original prior input SHAP, and Learned attention is the SHAP value updated by the model. Figure 5 a, Figure 5 b shows a comparison between the prior SHAP weight contribution and the SHAP weight contribution obtained after learning and updating through a heterogeneous graph neural network (taking the D1 section analysis result as an example). Figure 5 c corresponds to Figure 5 a comparison Figure 5 The locations of points with significantly increased weight values ​​in section b are shown on the actual map (arrows indicate confirmation via Google Maps real-world survey), including the direct emission outlets (W1, W2) of point D1 and adjacent upstream cross-section points (D2, D3). In actual watershed relationships, these confirmed strongly correlated points have significant weight contributions to the source tracing of new pollutants at cross-section D1. The SHAP weight contribution values ​​obtained through analytical learning using a heterogeneous graph neural network incorporating prior knowledge (…) Figure 5 (as shown in b) Compared to the prior SHAP weight contribution ( Figure 5 As shown in a), it can better reflect the contribution of new pollutants at section D1 in the actual watershed relationship, thus verifying the effectiveness and reliability of the model's analytical results.

[0070] Step 14: Calculate the prior knowledge view embedding corresponding to the target water body region based on the heterogeneous graph structure, and calculate the data similarity view embedding corresponding to the target water body region based on the nearest neighbor graph.

[0071] In some embodiments of this application, step 14 specifically includes: The first step is to extract features and update the residuals of the heterogeneous graph structure to obtain heterogeneous graph features, and then perform global normalization on the heterogeneous graph features to obtain the prior knowledge view embedding corresponding to the target water body region.

[0072] Specifically, features are extracted from the heterogeneous graph structure, and the features of the heterogeneous graph nodes are obtained through residual connections and normalization updates. Then, the features of the heterogeneous graph nodes are globally read out (e.g., global average pooling) to obtain the prior knowledge view embedding corresponding to the target water body region.

[0073] Prior knowledge view embedding is used to characterize the features of the target water body region at the level of structural information based on prior association / influence relationships (determined by the material screening matrix).

[0074] The aforementioned prior knowledge view embedding is used to describe the characteristics of the target water body area at the level of new pollutant flow.

[0075] For example, features of heterogeneous graph structures can be extracted using multi-layer relative SHAP-guided graph attention convolution (RelSHAPGATConv), residual normalization updates can be performed using residual connections and normalization layers, and global pooling layers and normalization layers can be used to globally normalize the features of heterogeneous graphs to obtain the prior knowledge view embedding.

[0076] In some embodiments of this application, a relation-aware attention map convolutional layer, RelSHAPGATConv, is used to distinguish and model different relation types, D–D and W–D. For each relational attention convolutional layer, the input is the node feature matrix H∈R^{M×d_in}, and the output is the updated feature H'∈R^{M×d_out}. RelSHAPGATConv first projects the node features to the multi-head space through a linear transformation: Z=H×W_lin, Z∈R^{M×(heads×d_out)}; Where W_lin is the weight of the linear layer self.lin, and heads is the number of attention heads. Z is rearranged as Z∈R^{M×heads×d_out}. For any edge e_{i→j}, when the relation type is r, the corresponding relation attention parameter tensor a_r∈R^{heads×(2d_out)} (self.att_rel[edge_type] in the code) is taken, and the features of the source node and the target node are concatenated: z_cat=concat(z_i,z_j)∈R^{heads×(2d_out)}; Attention score is calculated as follows: score=Σ_{h=1}^{heads}Σ_{t=1}^{2d_out}(z_cat[h,t]×a_r[h,t]); And it undergoes a LeakyReLU nonlinear transformation. To inject the prior SHAP importance bias of the relation, this embodiment reads the prior SHAP values ​​of nodes i and j from the pre-registered self.shap in the message function, and calculates the prior bias term b_{i,j,r} by combining it with the relation scaling factor λ_r (self.rel_scale[edge_type] in the code): b_{i,j,r}=(SHAP_i+SHAP_j)×λ_r; This bias is then added to the attention score: score'=LeakyReLU(score)+b_{i,j,r}; Then, softmax normalization is performed on all incoming edges of the same target node j to obtain the attention coefficient α_{i,j,r}: α_{i,j,r}=exp(score'{i,j,r}) / Σ{k∈N(j)}exp(score'_{k,j,r}); The final message passing is a weighted sum of neighbor features: m_j=Σ_{i∈N(j)}α_{i,j,r}×z_i; The above operations are implemented in RelSHAPGATConv.message() and RelSHAPGATConv.update(), and are superimposed in multiple layers in the forward loop of EpicHeteroGNN to complete the deep modeling of the new pollutant characteristic relationship and the outlet-characteristic control relationship carried by the D–D and W–D heterogeneous edges.

[0077] The second step is to perform graph convolution and normalization on the nearest neighbor graph to obtain the data similarity view embedding corresponding to the target water body region.

[0078] After obtaining the initial graph-level representation for each sample, a nearest neighbor graph is constructed from this initial graph-level representation: first, the pairwise distances are calculated for the initial embedding vectors of each sample, and then the nearest neighbor graph is constructed by "top"... The "K-nearest neighbor rule" selects K nearest neighbor samples for each sample, thereby generating the edge set (nearest neighbor relationship / similarity relationship) of the nearest neighbor graph.

[0079] Based on the nearest neighbor graph, graph convolution propagation is performed on the initial embedding vectors of each sample to obtain the sample embeddings under the data similarity view; then residual connection and normalization update are performed on the propagation results (that is, the propagation results are added to the initial embeddings and then normalized), and then nonlinear activation is performed to obtain the data similarity view embeddings.

[0080] The aforementioned data similarity view embedding is used to describe the topological characteristics of the target water body region.

[0081] For example, a graph convolutional network can be used to perform graph convolution on the nearest neighbor graph, and a normalization layer can be used to normalize it to obtain a data similarity view embedding.

[0082] Step 15: Based on prior knowledge view embedding and data similarity view embedding, perform fusion prediction on the target water body area to obtain the new pollutant source prediction results for the target water body area.

[0083] The above-mentioned new pollutant source prediction results are used to describe the source of new pollutants at each point in the target water body area (e.g., the new pollutant of D1 comes from outlet W1), outlet category (used to describe the category of outlet, such as industrial outlet, sewage treatment outlet), etc.

[0084] Specifically, the prior knowledge view embedding and the data similarity view embedding are combined to obtain the final fused embedding. The final fused embedding is then input into the fully connected classification head to obtain the new pollutant source prediction results for the target water body area.

[0085] For example, the combined expression is:

[0086] in, Indicates the final fusion embedding, Indicates the gating coefficient. , As weight, For bias, This is a concatenation embedding of prior knowledge view embedding and data similarity view embedding. This indicates the embedding of prior knowledge views. Indicates data similarity view embedding, This indicates element-wise multiplication.

[0087] It is worth mentioning that constructing heterogeneous graph structures and nearest neighbor graphs can mine and analyze the correlation between points in terms of both new pollutant flow and topological structure, enabling a full analysis of new pollutant source tracing in target water bodies. Water pollution prediction based on heterogeneous structure graphs and nearest neighbor graphs effectively improves the accuracy and interpretability of new pollutant source tracing prediction in water bodies.

[0088] The method of this application will be illustrated below with a specific example.

[0089] For the method of this application, a comparative experiment was conducted using a method that only uses SHAP and does not use heterogeneous graph structures as a comparative model. The evaluation results of the method of this application are shown in Table 1: Table 1

[0090] Where Seed represents the random seed for model training, Best_F1 is the best F1 score achieved by the model during training, Final_Val_F1 is the final F1 score on the validation set after training, Best_Epoch is the number of training epochs corresponding to when the model achieves the best F1 score, Hidden_Dim is the dimension of the model's hidden layers, Dropout is the proportion of dropout regularization in the model (to prevent overfitting), Rel_Layers is the number of relevant layers in the model, Batch_Size is the amount of data input in each batch during training, and LR is the learning rate of the model training (controlling the step size of parameter updates).

[0091] The evaluation results of the comparative model are shown in Table 2: Table 2

[0092] As can be seen, the method in this application has superior model performance, and its specific advantages include: D–D / W–D heterogeneous edges are automatically constructed from the prior SHAP matrix, directly injecting the feature importance prior of traditional machine learning models into the graph structure; A SHAP-driven attention mechanism is used simultaneously in the feature and relational dimensions to bias-enhance the control relationships between cross-sections and their outlets in rivers where key new pollutants exist. By using a dual-view gating fusion of prior knowledge view and data similarity view, the accuracy and robustness of source tracing prediction can be improved by taking into account both prior knowledge and data similarity. By combining SHAP-Attention contrast visualization and dual-view gating coefficient distribution, the model's decision path can be explained, meeting the interpretability requirements in environmental regulation and scientific tracing scenarios.

[0093] The following is an exemplary description of the new pollutant source tracing and prediction device provided in this application.

[0094] like Figure 6 As shown, this application provides a novel pollutant source tracing and prediction device 600, which includes: The acquisition module 601 is used to acquire mass spectrometry data from multiple points in the target water body area; the points are cross-sectional points or outlet points; the cross-sectional points are the cross-sectional locations in the target water body area, and the outlet points are the locations in the target water body area where new pollutants are discharged; The first construction module 602 is used to construct a material screening matrix for each site based on all mass spectrometry data; the material screening matrix is ​​used to describe the status of new pollutants present at the site. The second construction module 603 is used to construct a heterogeneous graph structure based on the material screening matrix and to construct a nearest neighbor graph of the target water body area. In the heterogeneous graph structure, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the new pollutant flow relationship between two corresponding points. In the nearest neighbor graph, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the similarity association of samples in the potential feature space. The calculation module 604 is used to calculate the prior knowledge view embedding corresponding to the target water body region based on the heterogeneous graph structure, and to calculate the data similarity view embedding corresponding to the target water body region based on the nearest neighbor graph. The prediction module 605 is used to perform fusion prediction on the target water body area based on prior knowledge view embedding and data similarity view embedding to obtain the new pollutant source prediction results for the target water body area.

[0095] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0096] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0097] like Figure 7 As shown, an embodiment of this application provides a terminal device, wherein the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 7 The diagram shows only one processor, a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 executes the computer program D102 to implement the steps in any of the above method embodiments.

[0098] Specifically, when the processor D100 executes the computer program D102, it acquires mass spectrometry data from multiple points in the target water body region. Then, based on all the mass spectrometry data, it constructs a material screening matrix for each point. Next, based on the material screening matrix, it constructs a heterogeneous graph structure and a nearest neighbor graph for the target water body region. Then, based on the heterogeneous graph structure, it calculates the prior knowledge view embedding corresponding to the target water body region, and based on the nearest neighbor graph, it calculates the data similarity view embedding corresponding to the target water body region. Finally, based on the prior knowledge view embedding and the data similarity view embedding, it performs a fusion prediction of the target water body region to obtain the prediction result of new pollutant source tracing for the target water body region. The construction of the heterogeneous graph structure and the nearest neighbor graph enables the mining and analysis of the correlation between points in terms of both new pollutant flow and topological structure, achieving a comprehensive analysis of new pollutant source tracing in the target water body region. Water pollution prediction based on the heterogeneous graph and the nearest neighbor graph effectively improves the accuracy and interpretability of new pollutant source tracing prediction for water bodies.

[0099] The processor D100 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0100] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may be an external storage device of the terminal device D10, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the terminal device D10. Furthermore, the memory D101 may include both internal and external storage units of the terminal device D10. The memory D101 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory D101 can also be used to temporarily store data that has been output or will be output.

[0101] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0102] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.

[0103] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to the new pollutant source tracing and prediction method device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0104] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0105] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0106] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention.

Claims

1. A novel method for predicting the source of pollutants, characterized in that, include: Mass spectrometry data of multiple points in a target water body area are obtained; the points are cross-sectional points or outlet points; the cross-sectional points are cross-sectional locations in the target water body area, and the outlet points are locations in the target water body area where new pollutants are discharged; A substance screening matrix is ​​constructed for each site based on all mass spectrometry data; the substance screening matrix is ​​used to describe the status of new pollutants present at the site. Based on the material screening matrix, a heterogeneous graph structure is constructed, and a nearest neighbor graph of the target water body region is constructed. In the heterogeneous graph structure, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the new pollutant flow relationship between two corresponding points. In the nearest neighbor graph, multiple nodes correspond one-to-one with multiple points, and the edges between nodes represent the similarity association of points in the potential feature space. Calculate the prior knowledge view embedding corresponding to the target water body region based on the heterogeneous graph structure, and calculate the data similarity view embedding corresponding to the target water body region based on the nearest neighbor graph; Based on the prior knowledge view embedding and the data similarity view embedding, the target water body area is fused and predicted to obtain the new pollutant source prediction results for the target water body area.

2. The method for predicting the source of new pollutants according to claim 1, characterized in that, The mass spectrometry data includes the retention time and mass-to-charge ratio of various novel pollutants at the sites; The process of constructing a material screening matrix for each site based on all mass spectrometry data includes: For each new pollutant, based on all retention times and mass-to-charge ratios corresponding to the new pollutant, determine the number of times the new pollutant satisfies the same material condition at all locations; For each of the aforementioned points, the following steps are performed: For each new pollutant substance in the mass spectrometry data of the aforementioned points, if the number of times the new pollutant substance satisfies the condition is greater than or equal to the threshold, an element with a value of 1 is generated; if the number of times the new pollutant substance satisfies the condition is less than the threshold, an element with a value of 0 is generated. By integrating all elements into a matrix, the material screening matrix for the specified location is obtained.

3. The method for predicting the source of new pollutants according to claim 2, characterized in that, The same material conditions are: the difference in retention time between the new pollutants at the two sites is less than or equal to the time tolerance threshold, and the difference in their mass-to-charge ratio is less than or equal to the mass-to-charge ratio tolerance threshold.

4. The method for predicting the source of new pollutants according to claim 1, characterized in that, The step of constructing a heterogeneous graph structure based on the material screening matrix includes: Identify the upstream cross-section point of each cross-section point from all cross-section points; For each cross-sectional point, based on the material screening matrix of the upstream cross-sectional point and the material screening matrix of all discharge points, calculate the new pollutant flow relationship between the cross-sectional point and the upstream cross-sectional point, as well as between each discharge point, and calculate the SHAP weight corresponding to each new pollutant flow relationship. For each location, a corresponding node is generated. Based on the flow relationships of all new pollutants, edges are generated between the nodes, and the SHAP weights corresponding to the edges are used as edge attributes to obtain a heterogeneous graph structure.

5. The method for predicting the source of new pollutants according to claim 1, characterized in that, The construction of the nearest neighbor map of the target water body region includes: Feature learning and aggregation are performed on the mass spectrometry data of each location to obtain the global feature representation of each location; Calculate the Euclidean distance between the feature representations of every two points, and determine the similarity association between the two points based on the Euclidean distance; Each point is treated as a node in the nearest neighbor graph, and edges between nodes are generated based on the similarity association to construct a point nearest neighbor graph that reflects the distribution structure of the data domain.

6. The method for predicting the source of new pollutants according to claim 5, characterized in that, The method of determining the similarity association between two corresponding points based on Euclidean distance includes: For each point, the K points with the smallest Euclidean distance from other points are selected as the nearest neighbor samples of the point. Similarity connections are established between the point and each nearest neighbor sample, thereby determining the nearest neighbor graph structure that reflects the distribution pattern among points.

7. The method for predicting the source of new pollutants according to claim 1, characterized in that, The step of calculating the prior knowledge view embedding corresponding to the target water body region based on the heterogeneous graph structure includes: Feature extraction and residual normalization updates are performed on the heterogeneous graph structure to obtain heterogeneous graph features. Global normalization is then performed on the heterogeneous graph features to obtain the prior knowledge view embedding corresponding to the target water body region.

8. The method for predicting the source of new pollutants according to claim 1, characterized in that, The step of calculating the data similarity view embedding corresponding to the target water body region based on the nearest neighbor graph includes: The nearest neighbor graph is convolved and normalized to obtain the data similarity view embedding corresponding to the target water body region.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the new pollutant source tracing and prediction method as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the new pollutant source tracing and prediction method as described in any one of claims 1 to 8.