Water quality anomaly detection and pollution source tracing system based on artificial intelligence

By constructing an AI-based water quality anomaly detection and pollution source tracing system, and utilizing spatiotemporal graph neural networks and knowledge graphs, the system addresses the shortcomings of existing water quality monitoring systems in intelligent processing for anomaly detection and pollution source tracing, achieving efficient and accurate pollution source location and tracing.

CN122020490AActive Publication Date: 2026-05-12SHUIFA PLANNING & DESIGN CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHUIFA PLANNING & DESIGN CO LTD
Filing Date
2026-04-10
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing water quality monitoring systems lack intelligent processing capabilities in anomaly detection and pollution source tracing. They struggle to identify multi-parameter coupled anomalies and cross-regional progressive pollution, and their pollution source tracing efficiency is low and coverage is limited. Furthermore, they lack effective integration of water system topology and prior knowledge of pollution sources.

Method used

An AI-based water quality anomaly detection and pollution source tracing system is constructed, including a spatiotemporal graph neural network anomaly detection module and an intelligent tracing module that integrates knowledge graphs. The spatiotemporal graph neural network is used to extract the spatial and temporal features of water quality parameters, and probabilistic reasoning is performed by combining hydrodynamic inverse model and pollution source knowledge graph to achieve rapid and accurate pollution source location.

Benefits of technology

It significantly improves the detection accuracy of complex pollution events, reduces the false alarm rate, shortens the response time for abnormal early warnings, and improves the accuracy and interpretability of pollution source tracing, thus meeting the rapid emergency response needs of environmental supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122020490A_ABST
    Figure CN122020490A_ABST
Patent Text Reader

Abstract

The invention discloses a water quality anomaly detection and pollution source tracing system based on artificial intelligence, and belongs to the technical field of environment monitoring. The system aims at solving the problems that in the prior art, the water quality anomaly detection false alarm rate is high, and the pollution tracing efficiency is low. According to the technical scheme, the method comprises the steps of obtaining multi-dimensional environment data through a data acquisition module; a space-time diagram neural network anomaly detection module is utilized to extract space-time features based on a water system topological structure to identify anomaly; a pollution source is positioned by utilizing an intelligent traceability module fused with a knowledge graph and combining a hydrodynamic reverse model and Bayesian reasoning; and finally, early warning is carried out through a visual module. The method is mainly used for real-time supervision of the drainage basin water environment, high-precision anomaly recognition and minute-level automatic tracing can be achieved, and a scientific basis is provided for precise pollution control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of environmental monitoring technology, and in particular to an artificial intelligence-based system for detecting water quality anomalies and tracing pollution sources. Background Technology

[0002] With the acceleration of industrialization, water environment safety issues are becoming increasingly prominent, making the establishment of an efficient water quality monitoring and management system crucial. While existing water quality monitoring systems have widely deployed sensor networks, they still have significant shortcomings in intelligent processing of anomaly detection and pollution source tracing, mainly in the following two aspects: First, existing water quality anomaly detection technologies mostly employ single-point, single-parameter threshold judgment methods, which are difficult to effectively identify multi-parameter coupled anomalies and cross-regional progressive pollution. Furthermore, existing machine learning methods often fail to fully consider the constraints of water system topology on pollutant propagation and lack refined modeling of the spatiotemporal dependencies between different monitoring stations. This results in a lag in the detection of upstream-downstream related pollution events and is prone to generating numerous false alarms due to normal fluctuations in environmental background values.

[0003] Secondly, existing pollution source tracing technologies mainly rely on manual on-site investigations or simple upstream and downstream concentration comparisons, which are inefficient and have limited coverage. Although some studies have introduced model-based tracing methods, it is difficult to effectively integrate the physical propagation laws of hydrodynamics with prior knowledge of regional pollution sources (such as enterprise discharge characteristics and location relationships), and there is a lack of a probabilistic comprehensive assessment mechanism for multiple potential pollution sources. This results in insufficient interpretability and confidence of the tracing results, making it difficult to meet the needs of regulatory authorities for rapid and accurate emergency response. Summary of the Invention

[0004] The main objective of this invention is to provide an artificial intelligence-based system for detecting water quality anomalies and tracing pollution sources, in order to solve the problems raised in related technologies.

[0005] To achieve the above objectives, according to one aspect of the present invention, an artificial intelligence-based water quality anomaly detection and pollution source tracing system is provided, including a data acquisition module for real-time acquisition of water quality parameters, hydrological parameters and meteorological parameters within the monitoring area, and for preprocessing thereof; The spatiotemporal graph neural network anomaly detection module is connected to the data acquisition module and is used to construct a spatiotemporal graph neural network model based on the water system topology, extract and fuse spatial and temporal features of the preprocessed data, and output anomaly judgment results and anomaly feature vectors. The intelligent source tracing module, which integrates knowledge graphs, is connected to the spatiotemporal graph neural network anomaly detection module. After receiving the anomaly judgment result, it combines the hydrodynamic inverse model and the pollution source knowledge graph to calculate the posterior probability of potential pollution sources through probabilistic reasoning and output the source tracing result. The visualization early warning module is connected to the spatiotemporal graph neural network anomaly detection module and the intelligent tracing module that integrates knowledge graphs, respectively, and is used to display the monitoring status, anomaly information and tracing path, and send early warning information.

[0006] Furthermore, the spatiotemporal graph neural network anomaly detection module includes: The water system topology graph construction unit is used to model monitoring stations as graph nodes based on the physical water system structure, and to construct directed edges according to the water flow direction, generating graph structure data containing node features and edge weights. The graph attention convolutional network unit is used to receive the graph structure data, calculate the dynamic attention coefficients between nodes using the graph attention mechanism, and aggregate neighbor node information to extract spatial features. The multi-scale temporal coding unit is used to perform multi-scale convolution and positional coding on the feature sequence of the node's historical time step, and extract temporal features through the Transformer encoder. The spatiotemporal feature fusion anomaly detection unit is used to fuse the spatial features and the temporal features through a gating mechanism, calculate the anomaly probability score and reconstruction error based on the fused features, and comprehensively determine whether an anomaly has occurred.

[0007] Furthermore, in the water system topology graph construction unit, the edge weights The calculation formula is: in, For the site and The hydraulic distance between them and For site traffic, The lag time of pollutant propagation theory, The time decay constant, These are learnable weight parameters.

[0008] Furthermore, the graph attention convolutional network unit employs a multi-head attention mechanism, for any node... and its neighboring nodes When calculating the dynamic attention coefficient, edge feature vectors containing hydraulic distance and propagation delay are introduced, and spatial features are extracted by stacking multi-layer graph convolutional networks.

[0009] Furthermore, the multi-scale temporal coding unit uses convolution kernels of different sizes to perform convolution operations on the input feature sequence to obtain features of different temporal receptive fields, which are then concatenated and input into the Transformer encoder containing a multi-layer self-attention mechanism.

[0010] Furthermore, the anomaly determination formula of the spatiotemporal feature fusion anomaly detection unit is as follows: in, For classification anomaly probability scores, For data reconstruction error, To average reconstruction error, and For balance coefficient, This is the abnormal threshold. This is an indicator function.

[0011] Furthermore, the intelligent tracing module integrating knowledge graphs includes: A hydrodynamic backpropagation engine is used for the back-propagation technique based on the one-dimensional convection-diffusion equation to infer the emission intensity sequence of each candidate point upstream from the downstream abnormal concentration sequence. The pollution source knowledge graph library is used to store domain knowledge graphs containing pollution source entities, pollutant type entities, and water system node entities, and provides semantic relationships and vector embeddings between entities; A Bayesian probabilistic inference decision network is used to combine physical inversion results, prior information from knowledge graphs, and monitoring data features to calculate the posterior probability of each candidate pollution source. The source tracing result interpreter is used to output the candidate pollution source with the highest posterior probability and its inference explanation report.

[0012] Furthermore, the Bayesian probabilistic inference decision network calculates candidate pollution sources. When calculating the posterior probability, the likelihood function is composed of the product of hydrodynamic evidence, pollutant feature matching evidence, time window matching evidence, and spatial accessibility evidence.

[0013] Furthermore, the Bayesian probabilistic reasoning decision network also includes a graph neural network enhancement structure, which is used to concatenate the embedding vector of the knowledge graph with the abnormal feature vector output by the spatiotemporal graph neural network anomaly detection module, and output a correction factor to adjust the probability distribution.

[0014] Furthermore, the confirmed tracing results output by the intelligent tracing module that integrates the knowledge graph are fed back as positive samples to the spatiotemporal graph neural network anomaly detection module and the pollution source knowledge graph library for incremental updates of model parameters.

[0015] This invention provides an artificial intelligence-based water quality anomaly detection and pollution source tracing system, which has the following beneficial effects: This invention constructs a spatiotemporal graph neural network anomaly detection module based on water system topology, which can simultaneously capture the spatial propagation correlation and temporal evolution law of water quality parameters in the water system network. Compared with traditional technology, this application can significantly improve the detection accuracy of complex pollution events such as multi-source superposition and gradual pollution, greatly reduce the false alarm rate caused by environmental fluctuations, and effectively shorten the response time of anomaly warning.

[0016] This invention constructs a Bayesian source tracing engine that integrates a hydrodynamic inverse model and a pollution source knowledge graph. After detecting an anomaly, it can automatically infer the most likely location, type, and emission time of the pollution source by combining physical diffusion laws and prior knowledge. The system reduces the time required for traditional manual investigation from several days to minutes, and the output source tracing results have clear probability confidence and interpretability of reasoning paths, providing a scientific basis for environmental regulation. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the overall architecture of an artificial intelligence-based water quality anomaly detection and pollution source tracing system provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the spatiotemporal graph neural network anomaly detection module provided in an embodiment of the present invention; Figure 3 The internal logic diagram of the intelligent tracing module that integrates knowledge graphs provided in this embodiment of the invention.

[0018] Figure labeling: 100, Data acquisition module; 200, Spatiotemporal graph neural network anomaly detection module; 210, Water system topology graph construction unit; 220, Graph attention convolutional network unit; 230, Multi-scale temporal coding unit; 240, Spatiotemporal feature fusion anomaly detection unit; 300, Intelligent source tracing module with knowledge graph fusion; 310, Hydrodynamic backpropagation engine; 320, Pollution source knowledge graph library; 330, Bayesian probabilistic inference decision network; 340, Source tracing result interpreter; 400, Visualization and early warning module. Detailed Implementation

[0019] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0020] See Figure 1 , Figure 1 This is a schematic diagram of the overall architecture of an artificial intelligence-based water quality anomaly detection and pollution source tracing system provided by the present invention. Figure 1 As shown, the system mainly includes a data acquisition module 100, a spatiotemporal graph neural network anomaly detection module 200, an intelligent source tracing module 300 integrating knowledge graphs, and a visualization early warning module 400. Each module interacts with the other via a central data bus, which uses a publish-subscribe model and supports millisecond-level message transmission latency, collaboratively completing the entire intelligent processing from water quality monitoring and anomaly identification to pollution source location.

[0021] The data acquisition module 100 is the system's sensing front end, responsible for acquiring multi-dimensional environmental data within the monitoring area in real time. This module includes a multi-source sensor array, meteorological monitoring stations, and hydrological monitoring stations distributed at different locations within the monitoring area. Specifically, the data acquired by the data acquisition module 100 includes, but is not limited to: water quality parameters, such as pH value, dissolved oxygen (DO), ammonia nitrogen (NH3-N), total phosphorus (TP), turbidity, conductivity, and chemical oxygen demand (COD); hydrological parameters, including flow velocity, water level, water temperature, and flow rate; and meteorological parameters, covering rainfall, air temperature, and wind speed.

[0022] In this embodiment, the water quality sensor is sampled every 5 minutes, and the hydrological and meteorological parameters are sampled every 15 minutes to achieve a balance between data accuracy and transmission load. The collected raw data is cleaned, denoised, and standardized by an edge preprocessor before being transmitted to the subsequent processing module via an IoT communication gateway. The edge preprocessor uses a sliding window midpoint filtering algorithm to remove sensor noise, with a window length of 5 sampling points, and utilizes... The criteria are used to remove obvious outliers before Z-score standardization. Specifically, the preprocessing of the raw data collected by the data acquisition module 100 includes the following steps: First, missing value imputation: for missing data points caused by sensor failure or communication interruption, a linear interpolation method based on adjacent time steps is used for imputation. If more than 3 consecutive sampling points are missing, the mean of the historical data from the same station at the same time period is used for replacement. Second, noise filtering: a sliding window midpoint filtering algorithm with a window length of 5 sampling points is used to smooth the time series parameter by parameter to eliminate random noise interference from the sensor. Third, outlier removal, based on... The criterion is to calculate the mean μ and standard deviation σ of each parameter within the sliding window, which will exceed... The data points within the range are marked as outliers and replaced with window values; the fourth step is standardization, which involves performing Z-score standardization on each parameter data after the above cleaning, that is, calculating the mean and standard deviation of each parameter on the training set, and converting the data into a standard normal distribution with a mean of 0 and a standard deviation of 1, so as to eliminate the differences in the units and numerical ranges between different parameters and make it suitable for the input requirements of subsequent neural network models.

[0023] The spatiotemporal graph neural network anomaly detection module 200 is one of the core components of this invention, aiming to solve the problem that traditional methods struggle to capture multi-parameter coupling anomalies and cross-regional spatiotemporal dependencies. (See also...) Figure 2 The spatiotemporal graph neural network anomaly detection module 200 mainly consists of a water system topology graph construction unit 210, a graph attention convolutional network unit 220, a multi-scale temporal coding unit 230, and a spatiotemporal feature fusion anomaly detection unit 240. The data preprocessed by the data acquisition module 100 first enters the water system topology graph construction unit 210, which is used to dynamically update the node features and edge weights in the graph structure.

[0024] Based on the actual physical water system structure, the water system topology construction unit 210 models the monitoring area as a directed weighted graph. Among them, the node set Each water quality monitoring station is defined as a node in the graph. The feature vector of each node It not only includes the dynamic water quality parameters collected by the aforementioned data acquisition module 100, but also integrates the station's static metadata, such as latitude and longitude coordinates, riverbed cross-section water depth, and riverbed roughness coefficient. (Boundary set) Construct directed edges based on the natural flow direction of the water system. The direction is from the upstream station Pointing to downstream sites This represents the physical path of material flow. Adjacency weight matrix. To accurately quantify the correlation strength between sites, this embodiment employs a dynamic weighting calculation method that integrates hydraulic distance, flow rate ratio, and propagation delay, with edge weights... The calculation formula is as follows: in, Indicates site and The actual hydraulic distance between them; and These are the real-time traffic figures for the respective sites; For pollutants from the site Distributed to sites The theoretical hydraulic lag time is calculated based on the hydraulic distance and average flow velocity between the two stations. The time decay constant is set to 2 hours in this embodiment based on the characteristics of the watershed. These are learnable weight parameters that are automatically optimized during model training, with initial values ​​set to 0.4, 0.3, and 0.3, respectively. This mapping method allows the model to incorporate hydrodynamic physical constraints, ensuring that the information propagation path is consistent with the actual water flow direction.

[0025] After processing by the water system topology graph construction unit 210, the graph structure data is passed to the graph attention convolutional network unit 220 for spatial feature extraction. The graph attention convolutional network unit 220 is mainly responsible for extracting correlation features in the spatial dimension. Considering the non-uniformity of water quality influence in space, this embodiment adopts an improved graph attention mechanism. For any node... and its neighboring nodes The graph attention convolutional network unit 220 first calculates the dynamic attention coefficients between nodes. : In the formula, For the first Layer nodes The hidden state; The edge feature vector explicitly includes two dimensions: hydraulic distance and propagation delay. and The learnable parameter matrix; The vector concatenation operation is represented by the LeakyReLU activation function, with a negative slope parameter set to 0.2. This formula allows the model to focus on the upstream sites that have the greatest impact on the current site.

[0026] Subsequently, feature aggregation and updating are performed: To enhance the robustness of the model, this embodiment preferably employs a multi-head attention mechanism, setting up K=4 parallel attention heads, and concatenating the calculation results of each head to obtain the final spatial features. The graph attention convolutional network consists of three stacked layers, with each layer having a hidden dimension of 64. Dropout regularization is used between layers, and the dropout rate is set to 0.3 to prevent overfitting.

[0027] In parallel with spatial feature extraction, a multi-scale temporal coding unit 230 is used to capture the patterns of water quality parameter evolution over time. To simultaneously identify both sudden pollution (short-term, such as illegal discharges within hours) and gradual pollution (long-term, such as non-point source pollution accumulation over several days), this embodiment designs a hierarchical Transformer structure. The input is the feature sequence of node i over the past T time steps, where T is set to 48 time steps in this embodiment, corresponding to a 4-hour historical window. First, it is processed through multi-scale convolutional embedding layers. To ensure consistency in the temporal dimension of the convolutional outputs at different scales, this embodiment employs a "Same Padding" strategy for zero-padding: in, Representing convolution kernels of different sizes (e.g.) The time receptive fields are 15 minutes, 35 minutes, and 75 minutes, respectively, and the number of output channels of the convolution kernel at each scale is set to 32.

[0028] Subsequently, positional encoding is introduced and input into the Transformer encoder for self-attention temporal modeling: The Transformer encoder consists of two encoding layers, each with four attention heads, and the hidden dimension of the feedforward network is set to 128. This process outputs a temporal feature vector containing rich historical pattern information.

[0029] Spatial features With time series characteristics It is then transmitted to the spatiotemporal feature fusion anomaly detection unit 240 for fusion and judgment.

[0030] The spatiotemporal feature fusion anomaly detection unit 240 adaptively fuses spatial features and temporal features through a gating mechanism: in, It is the Sigmoid activation function. Represents element-wise multiplication. Features after fusion. On the one hand, anomaly probability scores are output through a multilayer perceptron (MLP). This MLP contains two fully connected layers, with a hidden layer dimension of 32 and an output layer dimension of 1. The output is normalized to the [0,1] interval using the Sigmoid function. Meanwhile, the data is input to the decoder to reconstruct the original data, and the reconstruction error is calculated. The final anomaly determination combines the classification score and reconstruction error: in, This is an indicator function; it outputs 1 when the condition inside the parentheses is true, and 0 otherwise. The average reconstruction error obtained statistically from the training set is used for normalization. and As balance coefficients, they are set to 0.6 and 0.4 respectively in this embodiment. The anomaly threshold is determined by optimization based on the F1 score on the validation set, with a typical value range of 0.5 to 0.7.

[0031] When an anomaly is detected, the system generates an anomaly feature vector. (Including abnormal node ID, time, parameter type and) And, it triggers the subsequent tracing module through the data bus.

[0032] like Figure 3 As shown, the intelligent source tracing module 300, which integrates knowledge graphs, is activated upon receiving an abnormal trigger signal, with a response delay of no more than 500 milliseconds. This module mainly consists of a hydrodynamic backpropagation engine 310, a pollution source knowledge graph database 320, a Bayesian probabilistic reasoning decision network 330, and a source tracing result interpreter 340. These four components execute sequentially in a pipeline manner, jointly completing the precise location of the pollution source and the construction of the evidence chain.

[0033] The hydrodynamic reverse propagation engine 310 utilizes the reverse solution technique of the one-dimensional convection-diffusion equation to deduce the source of pollutants from a physical perspective. The forward propagation model, as prior knowledge, is described as follows: In the application scenario of this embodiment, the diffusion coefficient The typical value range is 1 to 50m. 2 / s, degradation coefficient The pollutant type is determined based on its type. The method for determining the pollutant type is as follows: the system identifies the abnormal parameter types marked in the abnormal feature vector output by the spatiotemporal graph neural network anomaly detection module 200. Specifically, when the abnormal probability score of a certain water quality parameter (such as ammonia nitrogen, COD, total phosphorus, etc.) exceeds a threshold θ, the system takes the pollutant category corresponding to that parameter as the pollutant type of the current event. If multiple parameters are abnormal simultaneously, they are sorted according to their abnormal probability scores, and the pollutant category corresponding to the parameter with the highest score is selected as the primary pollutant type. The remaining abnormal parameters are used as auxiliary features for subsequent pollution source matching. Degradation coefficient. The method for determining the pollutant type and degradation coefficient is as follows: A pre-set pollutant type-degradation coefficient comparison table based on empirical data and literature from the field of environmental engineering is used within the system. This table records reference values ​​for the first-order degradation rate constants of various common water pollutants at standard water temperature (20°C), such as ammonia nitrogen. The value is approximately 0.1 to 0.3 d. -1 The K value for COD is approximately 0.05 to 0.2 d. -1 Total phosphorus is a conservative pollutant. The value is approximately 0; in actual calculations, the system looks up the corresponding standard degradation coefficient from a table based on the identified pollutant type. Then, temperature correction is performed by combining the real-time collected water temperature T. The correction formula is as follows: ,in The temperature correction factor ranges from 1.02 to 1.08, thus yielding a degradation coefficient applicable to current aquatic environmental conditions. During source tracing, given the abnormal concentration sequence detected downstream. The engine discretizes the upstream into One potential source location candidate point ,in Typically, 10 to 30 candidate points are selected based on the complexity of the monitoring area. The emission intensity sequence for each candidate point is estimated using a deconvolution algorithm. in Let be the unit impulse response function, representing the hypothetical candidate point. The concentration response curve observed at the downstream detection point when a unit pulse emission occurs. This is a regularization parameter used to prevent numerical instability caused by the denominator approaching zero; a typical value is 10. -6 The output includes the candidate source locations and their estimated emission intensity matrix. .

[0034] While acquiring the physical inversion results, the system calls the pollution source knowledge graph library 320 to obtain prior knowledge within the candidate region. The pollution source knowledge graph library 320 pre-constructs a domain knowledge graph containing "pollution source-pollutant-water system nodes". Entities include specific factories, farms (attributes include location coordinates, typical pollutant types, average daily discharge volume, and historical violation records), pollutant types (attributes include attenuation characteristics and water solubility parameters), and water system nodes. Relationships include semantic relationships such as "discharge to" (connecting pollution source and water system), "can generate" (connecting pollution source and pollutant type), and "upstream from". In this embodiment, the knowledge graph library pre-sets approximately 500 pollution source entities, 20 types of pollutant entities, and approximately 3000 corresponding relation triples covering the monitoring area. The vector embeddings of entities and relationships are trained using the TransE model, with the embedding dimension set to 100 dimensions, used to calculate the semantic similarity between entities.

[0035] The Bayesian probabilistic inference decision network 330 is the core of the source tracing decision, integrating physical inversion results, monitoring data characteristics, and prior information from the knowledge graph. The network calculates the source of pollution for each candidate pollution source. posterior probability : in, The prior probability is determined based on the knowledge graph. This prior probability takes into account factors such as the number of historical violations of the pollution source, the size of the enterprise, and the hydraulic distance from the detection point. It is obtained by weighted scoring normalization.

[0036] Likelihood function It is decomposed into the product of multiple independent pieces of evidence: Specifically, hydrodynamic evidence Measuring the intensity of emissions calculated backward With respect to the expected production capacity or scale of the pollution source The matching degree was modeled using a Gaussian kernel function, and the standard deviation was set based on the historical emission fluctuation range of the enterprise. Pollutant characteristic matching. Calculate the detected abnormal feature vector Typical emission characteristics of this source in the knowledge graph The cosine similarity is calculated, and the cosine similarity value is converted into a probability using the Softmax function. Time window matching. Estimated emission time Whether the activity period of the pollution source falls within the expected timeframe (e.g., some factories only operate during the day). A higher likelihood value is assigned if the overlap between the estimated timeframe and the known operating period exceeds 80%. Spatial accessibility. The reachability of physical paths is confirmed based on the connection relationships in the knowledge graph. If there is a valid hydraulic connection path between the candidate source and the detection point, the value is 1; otherwise, the value is 0.

[0037] To further improve reasoning accuracy, this embodiment also introduces graph neural network enhancement, which embeds the knowledge graph's vectors... Spatiotemporal fusion features input from the spatiotemporal graph neural network anomaly detection module 200 The concatenation is processed by a two-layer fully connected network, which outputs a correction factor to adjust the final probability distribution. Experiments show that after introducing graph neural network enhancement, the source tracing accuracy improved from 78.5% to 86.2%.

[0038] The source tracing result interpreter 340 is responsible for converting complex probability calculations into a user-understandable report. It outputs the Top-K candidate pollution sources with the highest posterior probabilities (K is set to 3 in this embodiment) and generates a visual inference path. For example, the report might read: "Source A is determined based on: 1. Located 5km upstream (spatial consistency); 2. Detected characteristic pollutant is ammonia nitrogen (composition consistency); 3. Estimated emission time matches the plant's schedule (time consistency)." The report also outputs a confidence score: a score exceeding 0.7 is marked as "high confidence," between 0.4 and 0.7 as "medium confidence," and below 0.4 as "requires further verification." Furthermore, the confirmed source tracing results are fed back to the system as positive samples to update the parameters of the spatiotemporal graph neural network anomaly detection module 200 and update the prior distribution in the pollution source knowledge graph 320, achieving closed-loop self-evolution of the system. The feedback update employs an incremental learning strategy, performing model fine-tuning after every 10 confirmed samples to avoid model instability caused by frequent updates.

[0039] The Visual Early Warning Module 400 uses a GIS map display interface to render real-time heatmaps of monitoring station status, anomaly propagation paths, and source tracing results, assisting regulatory authorities in making rapid decisions. This module supports multi-level early warnings, categorized into four levels—blue, yellow, orange, and red—based on the severity of the anomaly, and can send warning information to relevant responsible persons through multiple channels such as SMS and app push notifications.

[0040] The system described in this embodiment achieves significant solutions to the technical challenges of high false alarm rates, low traceability efficiency, and lack of interpretability in existing technologies by deeply collaborating the spatiotemporal graph neural network anomaly detection module 200 and the intelligent traceability module 300 that integrates knowledge graphs. Specifically, the high-dimensional spatiotemporal features extracted by the spatiotemporal graph neural network anomaly detection module 200 constrain the search space of the intelligent traceability module 300, while the feedback from the intelligent traceability module 300 optimizes the discrimination boundary of the spatiotemporal graph neural network anomaly detection module 200. In a watershed monitoring system deployed in practice, compared to traditional threshold-based anomaly detection methods, this invention reduces the false alarm rate by approximately 62%, improves the traceability accuracy by approximately 35%, and shortens the average traceability time from 4 to 6 hours of manual investigation to less than 15 minutes.

[0041] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A water quality anomaly detection and pollution source tracing system based on artificial intelligence, characterized in that, include: The data acquisition module (100) is used to collect water quality parameters, hydrological parameters and meteorological parameters in the monitoring area in real time, and to perform preprocessing. The spatiotemporal graph neural network anomaly detection module (200) is connected to the data acquisition module (100) and is used to construct a spatiotemporal graph neural network model based on the water system topology, extract and fuse spatial and temporal features of the preprocessed data, and output anomaly judgment results and anomaly feature vectors. The intelligent source tracing module (300) integrating knowledge graph is connected to the spatiotemporal graph neural network anomaly detection module (200). After receiving the anomaly judgment result, it combines the hydrodynamic inverse model and the pollution source knowledge graph to calculate the posterior probability of the potential pollution source through probabilistic reasoning and output the source tracing result. The visualization early warning module (400) is connected to the spatiotemporal graph neural network anomaly detection module (200) and the intelligent tracing module (300) that integrates knowledge graphs, respectively, and is used to display the monitoring status, anomaly information and tracing path, and send early warning information.

2. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 1, characterized in that, The spatiotemporal graph neural network anomaly detection module (200) includes: The water system topology graph construction unit (210) is used to model the monitoring stations as graph nodes according to the physical water system structure, and construct directed edges according to the water flow direction to generate graph structure data containing node features and edge weights. Graph attention convolutional network unit (220) is used to receive the graph structure data, calculate the dynamic attention coefficients between nodes using the graph attention mechanism, and aggregate neighbor node information to extract spatial features; A multi-scale temporal coding unit (230) is used to perform multi-scale convolution and positional coding on the feature sequence of the node's historical time step, and extract temporal features through a Transformer encoder; The spatiotemporal feature fusion anomaly detection unit (240) is used to fuse the spatial features and the temporal features through a gating mechanism, calculate the anomaly probability score and reconstruction error based on the fused features, and comprehensively determine whether an anomaly has occurred.

3. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 2, characterized in that, In the water system topology graph construction unit (210), the edge weights The calculation formula is: in, For the site and The hydraulic distance between them and For site traffic, The lag time of pollutant propagation theory, The time decay constant, These are learnable weight parameters.

4. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 2, characterized in that, The graph attention convolutional network unit (220) employs a multi-head attention mechanism, for any node and its neighboring nodes When calculating the dynamic attention coefficient, edge feature vectors containing hydraulic distance and propagation delay are introduced, and spatial features are extracted by stacking multi-layer graph convolutional networks.

5. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 2, characterized in that, The multi-scale temporal coding unit (230) uses convolution kernels of different sizes to perform convolution operations on the input feature sequence to obtain features of different temporal receptive fields, which are then concatenated and input into the Transformer encoder containing a multi-layer self-attention mechanism.

6. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 2, characterized in that, The anomaly determination formula of the spatiotemporal feature fusion anomaly detection unit (240) is as follows: in, For classification anomaly probability scores, For data reconstruction error, To average reconstruction error, and For balance coefficient, This is the abnormal threshold. This is an indicator function.

7. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 1, characterized in that, The intelligent tracing module (300) integrating knowledge graphs includes: Hydrodynamic backpropagation engine (310) is used for backpropagation techniques based on one-dimensional convection-diffusion equations to infer the emission intensity sequence of each candidate point upstream based on the downstream abnormal concentration sequence; The pollution source knowledge graph library (320) is used to store a domain knowledge graph containing pollution source entities, pollutant type entities and water system node entities, and provides semantic relationships and vector embedding between entities; A Bayesian probabilistic inference decision network (330) is used to combine physical inversion results, prior information from knowledge graphs, and monitoring data features to calculate the posterior probability of each candidate pollution source. The source tracing result interpreter (340) is used to output the candidate pollution source with the highest posterior probability and its inference explanation report.

8. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 7, characterized in that, The Bayesian probabilistic reasoning decision network (330) calculates candidate pollution sources. When calculating the posterior probability, the likelihood function is composed of the product of hydrodynamic evidence, pollutant feature matching evidence, time window matching evidence, and spatial accessibility evidence.

9. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 8, characterized in that, The Bayesian probabilistic reasoning decision network (330) also includes a graph neural network enhancement structure, which is used to concatenate the embedding vector of the knowledge graph with the abnormal feature vector output by the spatiotemporal graph neural network anomaly detection module (200) and output a correction factor to adjust the probability distribution.

10. The artificial intelligence-based water quality anomaly detection and pollution source tracing system as described in claim 1, characterized in that, The confirmed tracing results output by the intelligent tracing module (300) that integrates the knowledge graph are fed back as positive samples to the spatiotemporal graph neural network anomaly detection module (200) and the pollution source knowledge graph library (320) for incremental updates of model parameters.