An AI-driven water quality pollution event intelligent detection method

By using edge computing and hydrodynamic constraints of intelligent sensors, the problems of sensor drift and noise interference in water quality monitoring have been solved, enabling efficient detection and source tracing of pollution events and improving the robustness and response time of the water quality monitoring system.

CN122133465APending Publication Date: 2026-06-02NANJING HUATIAN SCI & TECH DEV CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING HUATIAN SCI & TECH DEV CO LTD
Filing Date
2026-02-10
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies are insufficient for real-time early warning of sudden pollution events in water quality monitoring. Smart sensors are susceptible to environmental factors, leading to false alarms. Furthermore, they cannot effectively filter out abnormal noise and lack the ability to correct errors in real time.

Method used

By combining edge computing with smart sensors, and utilizing graph convolutional networks, hydrodynamic convection-diffusion equations, and physical constraint deviation terms, drift compensation and abnormal signal filtering are achieved. A water pollution characteristic tensor is constructed and source tracing is performed to generate early warning instructions.

Benefits of technology

This improved the robustness and data reliability of the water quality monitoring system, reduced the false alarm rate, and enabled high-confidence pollution source location and rapid emergency response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133465A_ABST
    Figure CN122133465A_ABST
Patent Text Reader

Abstract

This invention relates to the field of water quality monitoring technology, specifically to an AI-driven intelligent detection method for water pollution events. The method includes: acquiring pipeline geometric parameters, numerical water quality indicators, and visual images of the water body using intelligent sensors, and extracting multi-dimensional water quality monitoring indicators to generate a water pollution feature tensor; generating a physical constraint deviation term in the loss function using the hydrodynamic convection-diffusion equation, and performing drift compensation on the measured values ​​of the intelligent sensors based on this physical constraint deviation term to construct a water quality evolution prediction model; inputting the water pollution feature tensor into the water quality evolution prediction model to output a three-dimensional dynamic diffusion field of water pollutants; and performing source tracing using a spatiotemporal field inversion operator to calculate the coordinate probability distribution of potential pollution sources and generate early warning commands. This invention improves the robustness and source tracing confidence of complex pipeline monitoring systems through physical consistency constraints and drift compensation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality monitoring technology, specifically to an AI-driven intelligent detection method for water pollution events. Background Technology

[0002] Against the backdrop of accelerated global industrialization and increasingly severe water quality safety challenges, traditional methods relying on manual sampling and fixed threshold monitoring are no longer sufficient to meet the real-time early warning needs for sudden and covert pollution events, prompting a shift towards intelligent monitoring models.

[0003] While existing technologies utilize neural networks for remote wastewater prediction or introduce IoT-based neural network early warning architectures, and attempt to optimize outlier detection speed through prior knowledge, these methods still face serious "black box" challenges, data cold start problems, and early warning delays caused by centralized computing in practical applications. Especially in complex underwater environments, smart sensors are highly susceptible to nonlinear dynamic drift caused by environmental factors such as biological adhesion, temperature fluctuations, and chemical interference. Existing technologies often assume accurate input data and lack real-time correction capabilities at the sensing end, leading to numerous false alarms when encountering environmental interference and an inability to effectively filter out noise anomalies from massive amounts of raw signals in real time.

[0004] Therefore, this invention aims to overcome the above-mentioned defects and focuses on how to combine the edge computing capabilities of smart sensors to achieve real-time compensation for smart sensor drift and instant filtering of abnormal signals, thereby improving the overall robustness, data reliability and response time of the water quality monitoring system.

[0005] To address this, an AI-driven intelligent detection method for water pollution incidents is proposed. Summary of the Invention

[0006] The purpose of this invention is to provide an AI-driven intelligent detection method for water pollution events, which improves the overall robustness, data reliability, and response time of the water quality monitoring system through physical consistency constraints and drift compensation.

[0007] To achieve the above objectives, the present invention provides the following technical solution: An AI-driven intelligent detection method for water pollution incidents includes: Intelligent sensors are used to acquire pipeline geometric parameters, water quality numerical indicators and water body visual images. Multidimensional water quality monitoring indicators are extracted from pipeline geometric parameters, water quality numerical indicators and water body visual images through a water quality multidimensional feature extraction operator. The multidimensional water quality monitoring indicators are mapped to a unified coordinate system through a spatiotemporal alignment operator to generate a water pollution feature tensor. A physical constraint deviation term is generated in the loss function using the hydrodynamic convection-diffusion equation. The distribution and evolution of spatial concentration are restricted by the physical constraint deviation term. The drift compensation of the measured values ​​of the smart sensor is performed based on the physical constraint deviation term. A water quality evolution inference model is constructed that maps the water pollution feature tensor to a three-dimensional spatial concentration field. The water pollution characteristic tensor is input into the water quality evolution inference model, and the three-dimensional dynamic diffusion field of water pollutants is output. Based on the three-dimensional dynamic diffusion field of the water pollutants, a source tracing inference is performed using a spatiotemporal field inversion operator to obtain the inversion results. The inversion results are then mapped to the geometric parameters of the pipeline network to calculate the coordinate probability distribution of potential pollution sources in the geometric parameters of the pipeline network, and an early warning instruction containing the source tracing results is generated.

[0008] Preferably, the extraction of multidimensional water quality monitoring indicators includes: the water quality multidimensional feature extraction operator using graph convolutional network branches to extract features from the geometric parameters of the pipeline network and outputting topological features; using one-dimensional convolutional network branches to extract features from the numerical water quality indicators and outputting a water quality temporal feature vector; and using two-dimensional convolutional network branches to extract features from the visual image of the water body and outputting a water body spatial feature matrix; the topological features, the water quality temporal feature vector, and the water body spatial feature matrix constitute multidimensional water quality monitoring indicators.

[0009] Preferably, the method of generating a water pollution feature tensor using a spatiotemporal alignment operator includes: the spatiotemporal alignment operator calculating the correlation weights of the topological features, water quality time feature vector, and water body spatial feature matrix in the multidimensional water quality monitoring indicators using a dynamic weight optimization algorithm; weighting and fusing the multidimensional water quality monitoring indicators based on the correlation weights; resampling the fused features; inputting them into the spatiotemporal dimension corresponding to a unified coordinate system; and outputting the water pollution feature tensor.

[0010] Preferably, generating physical constraint deviation terms includes: performing spatiotemporal sampling based on the geometric scale of the pipeline network geometric structure parameters and a preset detection time step to generate spatiotemporal sampling points containing spatial location coordinates and time dimensions; obtaining the predicted concentration values ​​generated at the spatiotemporal sampling points by the initial water quality evolution model; calculating the time and spatial rate of change of the predicted concentration values ​​relative to the coordinates of the spatiotemporal sampling points using an automatic differential operator; substituting the time and spatial rate of change into the partial differential equation of the hydrodynamic convection-diffusion equation; calculating the physical consistency residual of the partial differential equation; and outputting the physical constraint deviation terms.

[0011] Preferably, regularization restricts the distribution and evolution of spatial concentration and constructs a water quality evolution prediction model, including: establishing a mapping function between the water pollution feature tensor and the spatial concentration distribution; obtaining the water quality numerical indicators collected by the smart sensor at the spatiotemporal sampling points as the measured values ​​of the smart sensor; weighting and summing the physical constraint deviation term and the mean square error term of the predicted concentration value relative to the measured value to construct a loss function; in the optimization stage, using the physical constraint deviation term as a constraint penalty term, and performing physical consistency correction on the gradient update step size of the mapping function through the Lagrange multiplier method; iteratively optimizing the weight parameters of the water quality multilayer sensor network architecture through the loss function to obtain the optimized water quality evolution prediction model.

[0012] Preferably, the drift compensation of the measured values ​​of the smart sensor using the physical constraint deviation term includes: using the physical constraint deviation term to perform real-time reliability assessment of the measured values; when the magnitude of the physical constraint deviation term exceeds a preset residual threshold, determining that the measured value is an abnormal signal containing at least one of the interference components, namely drift component and noise interference; dynamically adjusting the weight coefficient of the mean square error term in the loss function according to the magnitude of the physical constraint deviation term, and forcibly guiding the parameter update direction of the water quality evolution inference model through the physical constraint deviation term, implicitly filtering the interference components in the measured values, thereby achieving drift compensation of the measured values ​​of the smart sensor.

[0013] Preferably, the output of the three-dimensional dynamic diffusion field of water pollutants includes: inputting the water pollution feature tensor into the optimized water quality evolution model, using the weight parameters of the mapping function to perform migration evolution simulation on the spatiotemporal grid corresponding to the pipeline geometric parameters, and outputting the three-dimensional dynamic diffusion field of water pollutants composed of three-dimensional spatial grid concentration values.

[0014] Preferably, source tracing is performed using a spatiotemporal field inversion operator, including: constructing an inversion reconstruction kernel based on the three-dimensional dynamic diffusion field of the water pollutants using the spatiotemporal field inversion operator; performing convolution matching between the inversion reconstruction kernel and the three-dimensional dynamic diffusion field of the water pollutants; calculating the residual gradient between the current diffusion state value and the preset monitoring index; updating the spatiotemporal parameters of the pollution source term along the negative direction of the residual gradient; and outputting the inversion result.

[0015] Preferably, generating an early warning command includes: mapping the inversion result to the node coordinate space of the pipeline network geometric parameters; calculating the confidence level of each node within the search radius using a spatial weighting function; outputting a coordinate probability distribution; extracting the concentration peak and its corresponding spatiotemporal index coordinates from the three-dimensional dynamic diffusion field of water pollutants using a peak retrieval operator; extracting nodes whose values ​​exceed a preset water quality threshold from the coordinate probability distribution as source tracing results; encapsulating the source tracing results, the concentration peak, and the geographical locations corresponding to the spatiotemporal index coordinates into a monitoring and early warning data packet; and outputting an early warning command.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By using graph convolutional network branches, one-dimensional convolutional network branches, and two-dimensional convolutional network branches to process pipeline geometric parameters, water quality numerical indicators, and water body visual images in parallel, and using dynamic weight optimization algorithm for spatiotemporal alignment, the problem of traditional monitoring methods being single-dimensional and unable to effectively integrate multi-source information is solved, providing a richer spatial topology and visual representation basis for the determination of pollution events.

[0017] 2. By incorporating the hydrodynamic convection-diffusion equation into the loss function of the water quality evolution model, the water quality evolution model is forced to follow physical laws during the optimization process. This effectively solves the defects of pure data-driven models, such as uninterpretable results and poor physical consistency when water quality fluctuates drastically, and ensures the scientificity and accuracy of pollutant concentration field projection.

[0018] 3. The reliability of the measured values ​​of the smart sensor is evaluated in real time by using the deviation term of physical constraints, and the loss weight is dynamically adjusted according to the residual value. This mechanism breaks the assumption of absolute accuracy of input data in traditional technology. Without human intervention, it realizes implicit filtering and real-time compensation for nonlinear drift caused by biological attachment or environmental interference to the sensor, thereby reducing the false alarm rate.

[0019] 4. Through the deep coupling of the aforementioned multidimensional perception, physical correction and spatiotemporal field inversion operators, this invention solves the pain points of sensors being susceptible to hardware drift interference, lack of physical constraints on monitoring logic and inaccurate pollution source tracing in complex pipe network environments. It not only realizes the dynamic simulation of pollutant diffusion, but also achieves high-confidence pollution source location through source tracing and inference, shortens the decision-making chain from event occurrence to emergency response, and improves the inherent safety level of urban pipe network water quality. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating an AI-driven intelligent detection method for water pollution events according to the present invention. Figure 2 This is a schematic diagram of the intelligent sensor drift compensation process of the present invention; Figure 3 This is a flowchart illustrating the generation of a three-dimensional dynamic diffusion field for water pollutants according to the present invention. Detailed Implementation

[0021] The technical solution of the present invention will be described with reference to the accompanying drawings. The embodiments listed below are only some preferred examples of the present invention, and not all embodiments. All other embodiments derived by those skilled in the art based on the content of the present invention without inventive effort are protected by the patent rights of the present invention.

[0022] Please see Figures 1 to 3 This invention provides an AI-driven intelligent detection method for water pollution events, the technical solution of which is as follows: An AI-driven intelligent detection method for water pollution incidents, the specific process of which is as follows: Figure 1 As shown, it includes: Intelligent sensors are used to acquire pipeline geometric parameters, water quality numerical indicators and water body visual images. Multidimensional water quality monitoring indicators are extracted from pipeline geometric parameters, water quality numerical indicators and water body visual images through a water quality multidimensional feature extraction operator. The multidimensional water quality monitoring indicators are mapped to a unified coordinate system through a spatiotemporal alignment operator to generate a water pollution feature tensor. A physical constraint deviation term is generated in the loss function using the hydrodynamic convection-diffusion equation. The distribution and evolution of spatial concentration are restricted by the physical constraint deviation term. The drift compensation of the measured values ​​of the smart sensor is performed based on the physical constraint deviation term. A water quality evolution inference model is constructed that maps the water pollution feature tensor to a three-dimensional spatial concentration field. The water pollution characteristic tensor is input into the water quality evolution inference model, and the three-dimensional dynamic diffusion field of water pollutants is output. Based on the three-dimensional dynamic diffusion field of the water pollutants, a source tracing inference is performed using a spatiotemporal field inversion operator to obtain the inversion results. The inversion results are then mapped to the geometric parameters of the pipeline network to calculate the coordinate probability distribution of potential pollution sources in the geometric parameters of the pipeline network, and an early warning instruction containing the source tracing results is generated.

[0023] Example 1: This embodiment uses a real-time monitoring system for a water supply network in the central urban area of ​​a city as an example. In this scenario, the network environment is complex and subject to various external interferences, including drastic temperature changes and sensor drift caused by biofouling. This embodiment achieves intelligent detection of water pollution events through the following steps: First, multidimensional water quality monitoring indicators are extracted, including: the multidimensional water quality feature extraction operator uses graph convolutional network branches to extract features from the geometric parameters of the pipeline network and outputs topological features; it uses one-dimensional convolutional network branches to extract features from the numerical water quality indicators and outputs a water quality temporal feature vector; and it uses two-dimensional convolutional network branches to extract features from the visual image of the water body and outputs a water body spatial feature matrix; the topological features, the water quality temporal feature vector, and the water body spatial feature matrix constitute multidimensional water quality monitoring indicators.

[0024] Specifically, during the execution of the water quality multidimensional feature extraction operator, the collected pipe network geometric parameters, water quality numerical indicators, and water body visual images are synchronized with each other in terms of sampling timestamps. The initial node features of the graph convolutional network branch are constructed by superimposing static geometric information and real-time hydraulic state information from the pipe network geometric parameters. The static geometric information includes the three-dimensional geographic coordinates of the node and the rated pipe diameter of the connected pipe. The real-time hydraulic state information includes the real-time pressure value and local flow value at the node, thereby constructing a multidimensional feature extraction network. The initial feature matrix of the nodes, where The total number of nodes. The total number of feature components includes coordinates, pipe diameter, pressure, and flow rate. The graph convolutional network branch extracts spatial structure information from the pipeline network geometry parameters by reading the adjacency matrix containing pipe connection relationships and node coordinates, transforming the physical arrangement of pipes into a high-dimensional tensor, and outputting the topological features. The pipeline network geometry parameters include pipe segment length, pipe diameter, roughness coefficient, and node coordinate system coordinates and type identifiers, and are expressed as... Adjacency matrix of dimension and The attribute feature matrix is ​​stored in dimensional form. The graph convolutional network branch adopts a 3-layer graph convolutional neural network architecture, with 128, 256, and 512 hidden units in each layer, respectively. The activation function is a linear rectified function, and the adjacency matrix is ​​normalized by the Laplacian matrix to achieve feature aggregation. The one-dimensional convolutional network branch uses multiple one-dimensional convolutional kernels with different receptive fields to perform sliding window scanning on the water quality numerical indicators (such as pH sequence, conductivity sequence, residual chlorine concentration sequence, etc.) arranged in chronological order to extract features, capture the variational information of the numerical signal on the time axis, and output the water quality time feature vector. The sampling period of the water quality numerical indicators is preset to 5-15 minutes, and is mapped to a minimum-maximum normalized value before input. The interval; the one-dimensional convolutional network branch contains 3 sets of parallel convolutional layers, with kernel sizes preset to 3, 5 and 7 respectively to cover different receptive fields, each layer having 64 channels, a convolution stride of 1, and zero padding to maintain consistent sequence length; the two-dimensional convolutional network branch receives the visual image of the water body captured by the camera module, extracts the pixel distribution, chromaticity components and texture features of the image through multiple convolutional layers, and outputs the spatial feature matrix of the water body that can characterize the macroscopic state of the water surface; the two-dimensional convolutional network branch adopts a lightweight structure consisting of 4 convolutional layers, each with a kernel size of 3×3, and the number of channels doubles layer by layer (32-64-128-256), with 2×2 max pooling layers embedded between each layer for downsampling; the visual image of the water body adopts A pixel-level red, green, and blue three-channel color image is used, with a sampling frame rate of no less than 15 frames per second. A global average pooling layer is employed, combined with a fully connected layer for dimensional alignment, to uniformly map the topological features, the water quality temporal feature vector, and the water body spatial feature matrix to a preset 512-dimensional semantic vector space for dimensional alignment. The fully connected layer consists of two linear transformation layers: the first layer reduces the dimensionality of the cascaded feature vector to 1024 dimensions, and the second layer ultimately maps it to the preset 512-dimensional semantic vector space. A dropout layer with a dropout rate of 0.3 is set between the fully connected layers to prevent overfitting. Feature-level concatenation operators are used to cascade the features according to channel dimensions, thereby enabling the topological features, the water quality temporal feature vector, and the water body spatial feature matrix to constitute a multi-dimensional water quality monitoring index through multi-feature fusion.

[0025] By deploying graph convolutional networks, one-dimensional convolutional networks, and two-dimensional convolutional network branches in parallel, high-dimensional features of the pipeline network's physical geometry, time-series water quality numerical indicators, and macroscopic water body visual images are deeply coupled, solving the problems of single monitoring dimensions and fragmented perception information in traditional methods. By using global average pooling and fully connected layers to perform cross-modal dimensional alignment and feature-level cascading, accurate mapping and standardized representation of multi-dimensional water quality monitoring indicators in a unified semantic vector space are achieved, ensuring logical self-consistency of different modal features. Comprehensive and three-dimensional capture of pollution characteristics in complex pipeline network environments is realized.

[0026] Furthermore, a water pollution feature tensor is generated using a spatiotemporal alignment operator, including: the spatiotemporal alignment operator calculates the correlation weights of the topological features, water quality time feature vector, and water body spatial feature matrix in the multidimensional water quality monitoring indicators through a dynamic weight optimization algorithm; the multidimensional water quality monitoring indicators are weighted and fused based on the correlation weights, the fused features are resampled, input to the spatiotemporal dimension corresponding to a unified coordinate system, and the water pollution feature tensor is output.

[0027] Specifically, the spatiotemporal alignment operator utilizes a dynamic weight optimization algorithm, through three pre-defined learnable projection matrices. Linear transformations are performed on the topological features, water quality time feature vector, and water body spatial feature matrix respectively to map the topological features in the multidimensional water quality monitoring indicators into query vectors. ), mapping the water quality time feature vector to a key vector ( The spatial feature matrix of water bodies is mapped to a value vector. The three learnable projection matrices The dimensions are all preset as And all of them adopt Initialization (also known as The parameters are initialized using an initialization method to maintain consistent variance in the output of each network layer. The dynamic weight optimization algorithm employs an 8-head multi-head attention mechanism, with each attention head having a 64-dimensional dimension. By parallel computation and concatenation of the association weights of different subspaces, the expressive power of spatiotemporal feature fusion is enhanced. The projection matrix is ​​updated using an adaptive moment estimation optimizer with a preset initial learning rate of 0.0001, a batch size of 32, and 100 training epochs. The total loss function composed of the physical constraint deviation term and the measured residual is used as the optimization objective, and the adaptive adjustment of the projection matrix is ​​achieved through the backpropagation algorithm.

[0028] The correlation weight is calculated according to the following formula: ; in This represents the weighted feature representation computed through the attention mechanism. This represents the normalization exponential function, used to map the score matrix to the (0,1) interval and sum to 1, used to assign weights to different modal features. Indicates by query vector ( ) and key vector ( Perform a dot product operation on the transpose of the matrix. is the feature dimension scaling factor.

[0029] By calculating the query vector ( ) and key vector ( The matrix multiplication score is used to obtain the correlation weights of the topological features, water quality time feature vector, and water body spatial feature matrix in the multidimensional water quality monitoring indicators. The correlation weights characterize the contribution of a specific topological node to the visual state of the water body at a specific time. The spatiotemporal alignment operator performs weighted fusion of the multidimensional water quality monitoring indicators based on the correlation weights, merging feature information from different modalities according to weight values ​​through matrix multiplication. After initial fusion, due to the difference between image acquisition frequency and sensor numerical sampling period, the fused features are resampled. The nearest neighbor interpolation method is used to align the feature data to a preset time step, and the data is input into the spatiotemporal dimension corresponding to a unified coordinate system based on pipeline geographic information, enabling the features to be physically located on a three-dimensional spatial grid and time axis with geographic reference. Tensor reconstruction is performed according to the spatiotemporal dimension and feature channel dimension, outputting a water pollution feature tensor composed of time, space, and feature dimensions. The specific dimensional structure of the water pollution feature tensor is represented as follows: ,in For batch size, The preset number of time steps, the number of time steps Based on the monitoring and early warning requirements, the time steps are preset to 12 to 24 consecutive time steps, with each time step corresponding to a 5-minute sampling interval. These represent the three-dimensional spatial raster resolution of the pipeline network mapped in the geographic coordinate system. The feature channel number (i.e., the 512-dimensional semantic vector space); in terms of spatial dimension division, based on the coverage of the pipeline network, the preset resolution of the three-dimensional spatial grid is [resolution to be filled in]. Meters (i.e., the actual geographic spatial volume represented by each raster cell) are used to map topological features with physical coordinates and semantic vectors to the corresponding raster index using a linear interpolation algorithm. middle.

[0030] By introducing a dynamic weight optimization algorithm to dynamically calculate the correlation weights between multidimensional water quality monitoring indicators, deep semantic coupling of pipeline geometry, water quality values, and visual information was achieved, effectively identifying the contribution of specific topological nodes to pollution characterization at critical moments. By performing resampling processing and mapping to a unified coordinate system based on geographic information, precise alignment of asynchronous multimodal data streams on the time axis and three-dimensional spatial grid was achieved, eliminating spatiotemporal sampling asynchronous errors between multi-source sensors. The reconstruction of a standardized water pollution feature tensor composed of time, space, and feature dimensions was realized, providing logically consistent and highly geographically relevant input for subsequent water quality evolution inference models, improving the sensitivity and response time of capturing sudden pollution events.

[0031] Further, generating physical constraint deviation terms includes: performing spatiotemporal sampling based on the geometric scale of the pipeline network geometric structure parameters and a preset detection time step to generate spatiotemporal sampling points containing spatial location coordinates and time dimensions; obtaining the predicted concentration values ​​generated at the spatiotemporal sampling points by the initial water quality evolution model; using an automatic differential operator to calculate the time and spatial rate of change of the predicted concentration values ​​relative to the coordinates of the spatiotemporal sampling points; substituting the time and spatial rate of change into the partial differential equation of the hydrodynamic convection-diffusion equation, calculating the physical consistency residual of the partial differential equation, and outputting the physical constraint deviation terms.

[0032] Specifically, in the process of constructing physical information constraints, the geographic information system data of the pipeline network is read, and spatiotemporal sampling is performed based on the geometric scale of the pipeline network's geometric structure parameters and the preset detection time step. In this step, the algorithm uses the Latin hypercube sampling algorithm to perform high-density sampling within the internal space of the pipeline's three-dimensional geometric entity and within the preset detection time span, thereby generating spatiotemporal sampling points containing spatial location coordinates and time dimensions.

[0033] Preferably, in order to solve the mapping problem between discrete hydraulic data and continuous spatial coordinates, a preset hydraulic simulation model (such as...) is run simultaneously. The model outputs the velocity vector field of each pipe segment at discrete time steps. When configuring the hydraulic simulation model, the pipe roughness coefficient (Hessen-Williams coefficient) is set to 110-140 based on the pipe material. A pattern curve of node water demand variation is set based on historical water supply data, and the current pump station operating frequency and valve opening degree are loaded as boundary conditions to ensure the real-time performance and accuracy of the velocity vector field. For each spatiotemporal sampling point, coordinate mapping and retrieval logic are executed: first, based on the spatial coordinates of the sampling point… The pipe segment number to which the sample belongs is determined, and then the velocity vector of that pipe segment at the corresponding time step is retrieved from the hydraulic simulation model as the convection velocity parameter for that sampling point. The Reynolds number is calculated based on the pipe diameter, real-time flow velocity, and water viscosity to determine the flow regime. When the Reynolds number is less than 2300, it is determined to be laminar flow and the parabolic velocity correction formula is applied; when the Reynolds number is greater than 4000, it is determined to be turbulent flow and the Prandtl mixing length model is applied. For non-circular cross-section pipes, the radial distance is determined using the hydraulic radius equivalence method. During the correction process, the direction of the velocity vector is kept consistent with the pipe segment axis direction, and the vector magnitude is corrected only according to the cross-sectional velocity distribution law to obtain the real-time point velocity that conforms to the physical flow field law; in order to accurately characterize the non-uniform velocity distribution on the pipe cross-section, after obtaining the velocity vector, the spatial position coordinates are used as the basis for the correction. radial distance from the axis of the pipe section The velocity vector is weighted and compensated using the Prandtl mixed length model or the parabolic velocity correction formula to calculate the real-time point velocity at the sampling point. At the same time, for sampling points located near pipeline nodes (such as tees or elbows), a distance-weighted trilinear interpolation operator is used to perform spatiotemporal smoothing on the velocity vectors of adjacent pipe segments to ensure the physical consistency of the flow field in a continuous spatial coordinate system.

[0034] Input the coordinates of the sampling points into the water quality evolution simulation model to be optimized, and obtain the predicted concentration values ​​generated by the initial water quality evolution simulation model at the spatiotemporal sampling points; calculate the predicted concentration values ​​using an automatic differential operator. The time and spatial rates of change relative to the coordinates of the spatiotemporal sampling points are substituted into the partial differential equations of the hydrodynamic convection-diffusion equations: ; in, This is the first-order time partial derivative term (corresponding to the aforementioned rate of change over time). This is the spatial gradient term (corresponding to the spatial rate of change). For second-order Laplace operator terms, To predict concentration values, For the retrieved flow velocity vector, The molecular diffusion coefficient is preset. The pollutant attenuation coefficient, This is the source term adjustment coefficient, preset during the calculation of physical constraint deviation terms. To characterize the matter conservation constraint in the absence of a source.

[0035] In this partial differential equation, the velocity vector, as the convection coefficient, is multiplied by the spatial gradient term formed by the first-order spatial partial derivative to calculate the convection contribution. The second-order Laplace operator term is multiplied by the molecular diffusion coefficient to calculate the diffusion contribution, together forming the conservation law criterion. The diffusion coefficient is preset according to the target pollutant type. The range of values ​​is attenuation coefficient The range of values ​​is to The specific values ​​of the diffusion coefficient and attenuation coefficient can be determined based on the physicochemical properties of the target pollutant, referring to the recommended range given by relevant standards; and during the generation of physical constraint deviation terms, a source term adjustment coefficient is preset. for (That is, assuming there are no new sources within the pipeline network); while in the source tracing and deduction phase, The parameterized function to be optimized is defined as the source term location coordinates and release intensity. The spatial centroid and intensity amplitude in the parameterized function to be optimized are dynamically corrected by gradient descent. The physical consistency residual of the partial differential equation is calculated by measuring whether the combination of the rate of change of the neural network output satisfies the zero residual condition of the partial differential equation. The physical constraint deviation term is output by calculating the algebraic sum of squares of the residuals of all sampling points in the spatiotemporal domain, which serves as the physical loss part of the water quality evolution inference model optimization.

[0036] This embodiment relates to a method for generating physical constraint deviation terms. By deeply coupling discrete hydraulic simulation data with continuous partial differential equation constraint logic, it provides an optimized constraint signal with physical consistency for water quality evolution inference models.

[0037] The system reads the geographical information of the pipeline network and uses the Latin hypercube sampling algorithm to generate high-density spatiotemporal sampling point coordinates within the three-dimensional geometric entity of the pipeline and the detection time span. Simultaneously, a hydraulic simulation model is run, and the pipe segment to which the sampling point belongs is determined through coordinate mapping logic. The velocity vector corresponding to the time step is retrieved from the discrete velocity field as the convection velocity parameter. The sampling points are input into the model to be optimized to obtain predicted concentration values. The first-order partial derivative of the concentration with respect to time, as well as the first-order diffusion gradient and second-order Laplace operator terms with respect to spatial coordinates, are extracted using the underlying automatic differential operator of the deep learning framework. The derivative terms and velocity parameters are substituted into the hydrodynamic convection-diffusion equation for consistency verification. The degree to which the zero residual of the above equation is satisfied is measured. By calculating the algebraic sum of squares of the residuals of all sampling points, the physical constraint deviation term is output.

[0038] By introducing coordinate mapping and flow field retrieval mechanisms, the technical gap between discrete hydraulic simulation data and continuous neural network deduction logic is resolved, ensuring the reliability and spatiotemporal alignment of key velocity parameters in the convection-diffusion equation. Utilizing higher-order derivative information obtained from automatic differential operators, the model captures subtle gradient changes in the concentration field at dead zones, bends, or pipe bifurcations more accurately than traditional finite difference methods, enhancing the model's detailed representation of pollution cloud evolution. Hydrodynamic conservation laws are transformed into physically consistent residuals and used as hard penalty terms, forcing the model to adhere to the principle of material conservation during optimization. This alleviates the data loss problem caused by sparse sensor deployment, ensuring that model deductions in unknown regions are no longer blind black-box fittings but possess rigorous physical rationality, providing a highly confident scientific basis for pollution source localization.

[0039] Furthermore, regularization restricts the distribution and evolution of spatial concentration and constructs a water quality evolution prediction model, including: establishing a mapping function between the water pollution feature tensor and the spatial concentration distribution; obtaining the water quality numerical indicators collected by the smart sensor at the spatiotemporal sampling points as the measured values ​​of the smart sensor; weighting and summing the physical constraint deviation term and the mean square error term of the predicted concentration value relative to the measured value to construct a loss function; in the optimization stage, using the physical constraint deviation term as a constraint penalty term, the gradient update step size of the mapping function is physically consistent and corrected using the Lagrange multiplier method; iteratively optimizing the weight parameters of the water quality multilayer sensor network architecture through the loss function to obtain the optimized water quality evolution prediction model.

[0040] Specifically, a water quality multilayer perceptron network architecture with 6 hidden layers and 128 neurons per layer is initialized. A hyperbolic tangent activation function is used to establish a mapping function between the water pollution feature tensor and the spatial concentration distribution. The water quality multilayer perceptron network receives the flattened water pollution feature tensor as input, and its input dimension is determined by the product of the number of spatiotemporal grids and the number of channels. The output layer adopts a single-neuron structure to map the spatial concentration scalar, and batch normalization layers are embedded between each hidden layer to accelerate convergence, realizing the mapping from a high-dimensional feature space to a physical concentration scalar. The nonlinear transformation of the quantity field; obtaining the water quality numerical indicators collected by the intelligent sensor at the spatiotemporal sampling point, and mapping the sensor's measured data to the coordinates of nearby sampling points using the distance-weighted average method as the measured value of the intelligent sensor; in order to balance data fitting and physical rationality in model optimization, a composite objective function is configured, and the physical constraint deviation term and the mean square error term of the predicted concentration value relative to the measured value are weighted and summed, with the weight ratio of the physical constraint deviation term and the mean square error term preset to 1:0.5, and a loss function is constructed.

[0041] During the optimization phase, the physical constraint deviation term is used as a penalty term to prevent the model from making non-physical predictions in spatiotemporal regions lacking data. An adaptive optimization strategy is introduced, which dynamically adjusts the proportion of physical loss in the total gradient using Lagrange multipliers based on the magnitude of the residual term in each iteration. This is achieved by calculating the correction value of the Lagrange multipliers to the gradient of the mapping function, and adjusting the Lagrange multipliers after each iteration. The formula is updated (where For physical residuals, Using the learning rate, an augmented gradient vector is constructed to forcibly correct the direction of gradient descent. Finally, the weight parameters of the water quality multilayer perceptron network architecture are iteratively optimized through the loss function. When the decrease in the total loss function within five consecutive training epochs is less than [a certain value], the algorithm is optimized. When the model has converged, training is stopped, and the optimized water quality evolution prediction model is obtained.

[0042] By constructing a multilayer water quality sensor architecture and introducing distance-weighted spatial mapping logic, precise alignment of discrete sensor measurements with continuous spatiotemporal sampling points in the coordinate system was achieved, providing spatially continuous monitoring signals for the model. By constructing a composite loss function by weighting physical constraint residuals and mean square errors, and using the Lagrange multiplier method to dynamically correct the gradient update direction, forced physical constraints on the evolution of the concentration field in sparse sensor deployment or monitoring blind zones were realized. This effectively eliminated the "black box" limitations of traditional deep learning models, realizing an essential leap from single data fitting to self-consistent physical laws in the monitoring system. It ensured that the reconstructed concentration field had extremely high numerical fitting accuracy while satisfying the law of conservation of matter, significantly improving the scientificity and high confidence of pollution extrapolation in complex pipe network environments.

[0043] Furthermore, the drift compensation of the measured values ​​of the smart sensor is performed using the physical constraint deviation term, including: real-time reliability assessment of the measured values ​​using the physical constraint deviation term; when the magnitude of the physical constraint deviation term exceeds a preset residual threshold, the measured value is determined to be an abnormal signal containing at least one of the interference components, namely drift component and noise interference; the weight coefficient of the mean square error term in the loss function is dynamically reduced according to the magnitude of the physical constraint deviation term, and the parameter update direction of the water quality evolution inference model is forcibly guided by the physical constraint deviation term, implicitly filtering the interference components in the measured values, thereby achieving drift compensation of the measured values ​​of the smart sensor. The specific process is as follows: Figure 2 As shown.

[0044] Specifically, in the collaborative process of water quality evolution model optimization and online monitoring, the physical prediction values ​​and sensor measured values ​​of each monitoring node are acquired in real time. By calculating the algebraic deviation between the two, the measured values ​​are evaluated in real time using the physical constraint deviation term. Cross-validation is performed by combining the evolution trend of adjacent monitoring nodes in the pipeline network geometry parameters. If the numerical fluctuation of a point cannot be reasonably explained by upstream input or hydraulic boundary conditions, and the value of the physical constraint deviation term exceeds the preset residual threshold in three consecutive sampling periods, the preset residual threshold is determined by statistically analyzing the numerical distribution of the physical constraint deviation term under the historical normal operating conditions of the pipeline network, preferably using the 95th quantile of the absolute value distribution of the residual under normal operating conditions as the threshold. Furthermore, at this time, the concentration change of the node does not have spatiotemporal correlation with the evolution trend of the upstream adjacent monitoring nodes, indicating that the current observation data violates the conservation law of the hydrodynamic convection-diffusion equation. Based on this, the measured value is determined to be an abnormal signal containing at least one of the drift component and noise interference. Using an inverse proportional function, the physical... The magnitude of the physical constraint deviation term is mapped to the weight coefficient of the mean square error term in the loss function, so that the contribution of the measured value at the larger residual is lower in the loss function. The physical constraint deviation term forces the parameter update direction of the water quality evolution inference model, so that the model no longer blindly approaches the abnormal measured value, but turns to the physical reasonable space that conforms to the definition of the partial differential equation. By redistributing the weights within the model, the interference components in the measured value are implicitly filtered, so that the prediction result returns to the physical truth value. The physical mechanism of the implicit filtering is: using the hydrodynamic convection and diffusion equation to construct a physical consistency space, which is composed of the solution vector set that satisfies the partial differential constraint of the hydrodynamic convection and diffusion equation; by projecting the measured data containing noise or drift onto the physical consistency space, the interference components that deviate from the physical conservation law are canceled by the physical constraint term during the gradient update process, and the physical prediction value output by the model replaces the original abnormal observation value as the reconstructed truth value, thereby achieving drift compensation for the measured value of the smart sensor.

[0045] Preferably, to distinguish between real pollution events and sensor drift, the logic for determining abnormal signals further includes: synchronously searching the numerical change rate of upstream adjacent sensors; if the upstream value remains stable while the physical constraint deviation term at the current point surges, it is confirmed as a sensor abnormality; if the upstream and downstream exhibit correlation fluctuations consistent with water flow time consumption, it is determined as real pollution and the weighting coefficient is maintained. Unchanged; in addition, when dynamically adjusting the weights using the weighting coefficients, set The lower limit threshold is 0.1 to ensure that the model can still retain basic supervision signals and maintain training stability in the case of multiple anomalies.

[0046] The weighting coefficient The calculation formula is: ; in The value of the physical constraint deviation term. This is the sensitivity coefficient. In this embodiment, 0.5 is preferred.

[0047] This embodiment relates to an intelligent sensor drift compensation method based on physical constraint residuals. It performs real-time online verification of the sensing data through physical conservation laws and utilizes the implicit regularization mechanism of deep learning models to achieve automatic software compensation for hardware errors.

[0048] A preset residual threshold is set. When the value of the physical constraint deviation term exceeds the threshold for three consecutive sampling periods, the measured signal is determined to contain drift components or noise interference. The residual is mapped to the weight coefficient of the mean square error term in the loss function using an inverse proportional function. The loss weight of abnormal sampling points is reduced according to the residual magnitude. The physical constraint deviation term is used to forcefully guide the parameter update direction of the water quality evolution inference model. Through the redistribution of weights within the model, the prediction results are corrected to the true value space that conforms to physical laws, thus achieving drift compensation at the software level.

[0049] The solution eliminates the need for tedious manual data cleaning or offline hardware calibration; the model can utilize the physical correlation logic of surrounding normal nodes to perform "physical alignment" correction on the concentration distribution of abnormal points; this not only achieves high-precision real-time compensation for sensor hardware drift, but also significantly enhances the robustness of the monitoring system under conditions of sudden sensor failure or accuracy degradation, ensuring that the final output water pollution feature tensor has extremely high physical consistency and prediction confidence.

[0050] Furthermore, outputting a three-dimensional dynamic diffusion field of water pollutants includes: inputting the water pollution feature tensor into the optimized water quality evolution model; using the weight parameters of the mapping function to simulate the migration and evolution of the spatiotemporal grid corresponding to the pipeline network geometric parameters; and outputting a three-dimensional dynamic diffusion field of water pollutants composed of three-dimensional spatial grid concentration values. The specific process is as follows: Figure 3 As shown.

[0051] Specifically, after entering the real-time inference stage, the pre-stored three-dimensional geometric boundary and geographic information of the pipeline network are retrieved first, and then divided into three-dimensional spatial coordinates. With timestamp A standardized spatiotemporal sampling grid is constructed; the water pollution feature tensor is input into the optimized water quality evolution model, making it the initial state of the global environmental feature anchoring model; during inference calculation, the model loads the solidified hidden layer weights, and uses the water quality evolution model loaded with the mapping function weight parameters to perform migration evolution simulation on the spatiotemporal grid corresponding to the pipeline geometric structure parameters. In this process, the coordinate index of each grid point is input into the forward computation path of the water quality multilayer sensor. Through nonlinear mapping of weights, a corresponding physical concentration prediction value is assigned to each subdivided coordinate point. This migration evolution simulation process utilizes the high parallelism of neural networks, which can simultaneously process tens of thousands of grid nodes in the entire pipe network, restoring the diffusion features captured by the hidden layer into intuitive concentration scalars. Vectorization processing operators are used to reconstruct the discrete concentration values ​​obtained from the inference using tensors, which are then arranged and encapsulated according to the spatiotemporal index order, outputting a three-dimensional dynamic diffusion field of water pollutants composed of three-dimensional spatial grid concentration values. This diffusion field records the evolution trajectory of the pollution cloud under the physical constraints of the pipe network in the form of a high-dimensional tensor, generating a real-time, continuous, and geographically referenced dynamic water quality view.

[0052] By standardizing the spatiotemporal sampling grid subdivision of the three-dimensional geometric boundary of the pipeline network and performing highly parallel migration evolution simulation using the optimized water quality evolution extrapolation model, millisecond-level reconstruction of pollutant concentrations at all pipeline network nodes was achieved, effectively solving the bottleneck of low computational efficiency in traditional numerical simulation methods when dealing with large-scale complex topologies. Through nonlinear mapping and vectorized tensor reconstruction of the weights of the water quality multilayer sensor, the view transformation from discrete monitoring sites to a continuous, global three-dimensional dynamic diffusion field was realized, effectively filling the perception blind spots in the gaps between sensor deployments. Finally, accurate visualization of the evolution trajectory, diffusion gradient, and attenuation trend of pollution clouds was achieved, providing decision support with strong geographical correlation for emergency analysis of sudden water quality events, rapid identification of affected areas, and high-precision source tracing.

[0053] Furthermore, source tracing is performed using a spatiotemporal field inversion operator, including: constructing an inversion reconstruction kernel based on the three-dimensional dynamic diffusion field of the water pollutants using the spatiotemporal field inversion operator; performing convolution matching between the inversion reconstruction kernel and the three-dimensional dynamic diffusion field of the water pollutants; calculating the residual gradient between the current diffusion state value and the preset monitoring index; updating the spatiotemporal parameters of the pollution source term along the negative direction of the residual gradient; and outputting the inversion result.

[0054] Specifically, the spatiotemporal field inversion operator constructs an inversion reconstruction kernel based on the three-dimensional dynamic diffusion field of the water pollutants. The weight distribution of the inversion reconstruction kernel is consistent with the analytical solution of the aforementioned hydrodynamic convection-diffusion equation under time inversion. That is, the inversion reconstruction kernel is constructed using a three-dimensional Gaussian kernel function centered on the coordinates of the pollution source to be determined. Its kernel radius expands in a square root proportion as the number of time inversion steps increases, in order to compensate for energy dissipation during the diffusion process.

[0055] The inversion reconstruction kernel is constructed using a spatiotemporal decay matrix based on a Gaussian kernel function, and its mathematical expression satisfies: ; in, The spatiotemporal offset of the inversion reconstruction kernel The weight score at the point, and These are the spatiotemporal offsets relative to the center of the kernel. It is a natural exponential function. For flow velocity vectors, The diffusion coefficient is used. During the construction process, the analytical solution is discretized and sampled at a preset spatiotemporal grid step size. The calculated analytical values ​​are then filled into the weight matrix of the four-dimensional convolution kernel to generate the inversion reconstruction kernel. The preset spatiotemporal grid step size is in the spatial dimension. The upper limit is set to 5-10 meters, in the time dimension. The time limit is set to 1-5 minutes; the kernel size of the four-dimensional convolution kernel is preset to [value missing]. (Corresponding to time step length and spatial three-dimensional span, respectively); During the discretization sampling process, the function value of the analytical solution is calculated at the center point of each grid cell, and the generated weight matrix is ​​then... Regularization is applied to ensure energy conservation and numerical stability during the convolution matching process.

[0056] The inversion reconstruction kernel is convolved with the three-dimensional dynamic diffusion field of water pollutants. By sliding the inversion reconstruction kernel on a four-dimensional spatiotemporal tensor, the matching degree between each region of the diffusion field and the physical evolution law is calculated, and the candidate centroid with the highest signal intensity or characteristic response value is located as a potential pollution initiation location. During convolution matching, the sliding path of the convolution kernel is subject to a unidirectional constraint of the adjacency matrix in the pipeline network geometry parameters, and matching is only performed in the upstream branch of the currently detected concentration node. The convolution matching transforms the complex inverse diffusion problem into a search problem for maximizing the matching score by calculating the cross-correlation score between the inversion reconstruction kernel and the local diffusion field. The unidirectional constraint of the pipeline network topology plays a spatial regularization role to ensure the uniqueness of the source tracing solution and suppress numerical noise in the diffusion back-inference. The residual gradient between the current diffusion state value and the preset monitoring index is calculated. The deviation between the currently inferred source terms and the actual physical evolution law is quantitatively characterized. Using the automatic differential chain rule of the neural network, the spatiotemporal parameters of the pollution source terms are updated along the negative direction of the residual gradient, i.e., dynamically correcting the emission start time, three-dimensional spatial coordinates, and release intensity scalar of pollutants. During the source tracing inference process, the velocity vector in the hydrodynamic convection-diffusion equation is set to a fixed background physical constraint pre-calculated by the hydraulic simulation model and does not participate in the backpropagation gradient update. The gradient only acts on the spatiotemporal coordinates and release intensity parameters of the pollution source terms through the automatic differential chain rule, thereby solving the gradient backpropagation breakage problem caused by the non-differentiability of the external simulation model by finding the optimal source term configuration in a fixed physical flow field. Through multiple rounds of negative gradient updates, the source term parameters are driven to converge towards the global optimal solution until the residual is reduced to within an acceptable threshold, and the final inversion result is output.

[0057] This embodiment relates to a pipeline pollution source tracing method based on a spatiotemporal field inversion operator. By constructing a reconstruction operator with physical inverse evolution characteristics and combining it with a gradient search algorithm under topological constraints, the method achieves accurate inversion and quantitative reconstruction of the starting location and emission intensity of pollution sources.

[0058] An inversion reconstruction kernel is constructed based on the diffusion field, and its weight distribution is positively correlated with the analytical solution of the hydrodynamic convection-diffusion equation under time inversion. Convolution matching is performed on the sliding reconstruction kernel on the four-dimensional spatiotemporal tensor, and the sliding path is constrained by the pipeline adjacency matrix, searching only in the upstream branch to locate the candidate centroid. The residual gradient between the current inference state and the preset monitoring indicators is calculated to quantitatively characterize the deviation of the inferred source term from the physical law. The automatic differential chain rule of the neural network is used to correct the pollutant's start time, spatial coordinates, and release intensity along the negative direction of the residual gradient. The parameters are driven to converge to the global optimal solution through multiple rounds of negative gradient updates, and the final inversion result is output.

[0059] This embodiment significantly improves the accuracy and reliability of pollution source tracing in complex pipeline network environments through a physics-driven inverse gradient search mechanism. First, a reconstruction kernel positively correlated with the time-reversed analytical solution of the convection-diffusion equation is constructed, achieving deep embedding of physical laws into the source tracing logic. This convolutional matching based on the "time reversal" characteristic efficiently captures the original "fingerprint" information of the pollution plume, ensuring from the bottom layer that the source tracing process conforms to the laws of fluid mechanics and effectively filters false interference from sensor noise. Second, the sliding path of the convolutional kernel is unidirectionally constrained by the adjacency matrix of the pipeline network's geometric parameters, searching only upstream branches. This feature significantly reduces the search space and eliminates computational interference from irrelevant branches. The perturbation significantly improves the speed and accuracy of locating the centroid of the source term in complex topological backgrounds. Furthermore, updating parameters along the negative direction of the residual gradient enables high-precision quantitative inversion of the source term. By utilizing the automatic differentiation technique of neural networks, the three-dimensional diffusion field constraint is back-projected back to the moment of discharge, which can accurately restore the discharge duration, start time, and release intensity, avoiding the inefficiency of traditional random search. Finally, closed-loop optimization based on negative gradient correction significantly enhances the robustness of the results. Through multiple iterations, the parameters converge to the global optimum, reducing the dependence on human experience and ensuring that the inversion results have rigorous mathematical convergence, providing high-confidence decision support for the determination and handling of water quality accidents.

[0060] Further, generating an early warning command includes: mapping the inversion result to the node coordinate space of the pipeline network geometric parameters; calculating the confidence level of each node within the search radius using a spatial weighting function; outputting the coordinate probability distribution; extracting the concentration peak and its corresponding spatiotemporal index coordinates from the three-dimensional dynamic diffusion field of water pollutants using a peak retrieval operator; extracting nodes whose values ​​exceed a preset water quality threshold from the coordinate probability distribution as source tracing results; encapsulating the source tracing results, the concentration peak, and the geographical locations corresponding to the spatiotemporal index coordinates into a monitoring and early warning data package; and outputting the early warning command.

[0061] Specifically, the coordinates of the inverted centroid in continuous three-dimensional space are spatially correlated with nodes (such as manholes, discharge outlets, or connection wells) in a discrete pipeline geographic information system using coordinate transformation operators. The inversion results are mapped to the node coordinate space of the pipeline geometric parameters. The confidence of each node within the search radius is calculated using a spatial weighting function based on the Dijkstra algorithm to assess the likelihood of each node being a pollution initiation point. A search radius reflecting the positioning accuracy range is set with the obtained center coordinates as the center, and spatial weighting functions such as Gaussian weighting are called to perform smoothing based on the Euclidean distance between the node and the center point. Within this search radius, nodes closer to the inversion center receive higher weight scores, thus obtaining higher confidence scores. The confidence values ​​of all nodes are summarized and normalized to output a coordinate probability distribution. The coordinate probability distribution is presented as a heatmap in the visualization interface, and the color depth intuitively reflects the likelihood of each area in the pipeline becoming a potential pollution source.

[0062] Preferably, the spatial weighting function can also be calculated based on the path distance along the pipeline network geometric parameters to eliminate interference caused by overlapping geographical spaces but distant hydraulic connections.

[0063] Specifically, the early warning module calls a built-in peak retrieval operator to extract the concentration peak and its corresponding spatiotemporal index coordinates from the three-dimensional dynamic diffusion field of the water pollutants. This operator performs a global search on the high-dimensional diffusion tensor to accurately locate the most dangerous points in the spatial distribution of pollutants within the pipeline network and the specific time when the concentration peak occurs, in order to assess the severity of water quality damage. The node with the highest probability score is associated with the specific street name, pipe section number, and physical attributes of the discharge outlet in the pipeline network's geometric structure parameters to determine the physical source of the pollution input. The matching mechanism extracts nodes whose coordinate probability distribution values ​​exceed a preset water quality threshold as the source tracing results. The preset water quality threshold is set with reference to drinking water hygiene standards. The identified source tracing results, the concentration peak, and the geographical location corresponding to the spatiotemporal index coordinates are encapsulated into a monitoring and early warning data packet. This monitoring and early warning data packet uses an encrypted standardized data format and fully covers decision-making factors such as the pollution source, diffusion range, and severity of harm. This monitoring and early warning data packet is instantly pushed to the mobile management terminal via a wireless communication link, outputting an early warning command.

[0064] By employing coordinate transformation and spatial weighting, probabilistic modeling of pollution sources was achieved, eliminating data fluctuation interference and improving positioning accuracy. The Dijkstra algorithm was introduced to calculate distance weights along the pipeline route, accurately capturing the hydraulic topology characteristics of the pipe network and eliminating false source interference caused by complex geographic spaces. By linking normalized heat maps with physical attributes such as street and pipe segment numbers, precise mapping of inversion results to geographic entities was achieved, transforming abstract numerical values ​​into intuitive investigation guidelines and significantly reducing the blindness of emergency response. Simultaneously, peak retrieval captured extreme concentration values ​​and key spatiotemporal points, providing real-time quantitative evidence for damage assessment. Finally, standardized early warning encapsulation achieved a fully digital decision-making closed loop, significantly enhancing the timeliness and practical value of water quality treatment in complex environments.

[0065] This embodiment achieves three-dimensional perception of complex pipeline network environmental information and high-dimensional deep fusion of multi-source data by deeply coupling multimodal and multi-dimensional water quality monitoring index extraction and cross-attention spatiotemporal alignment operators. By introducing hydrodynamic convection-diffusion equations to construct physical consistency residuals and performing adaptive drift compensation, online calibration of perception layer deviations is achieved without hardware calibration, effectively solving the "black box" limitations and data fitting uncertainties of traditional AI models. Through migration evolution simulation of water quality evolution inference models and source tracing inference based on topological constraints, accurate reconstruction of the three-dimensional dynamic evolution of pollutants and high-confidence inversion and location of pollution sources are achieved. Through the instant encapsulation and push of standardized early warning commands, a digital decision-making closed loop from perception and monitoring to source tracing and early warning is realized, significantly improving the scientific nature, robustness, and response timeliness of water quality safety assurance in complex pipeline network environments.

[0066] Example 2: This embodiment uses the collaborative monitoring of water supply and drainage networks in a large chemical industrial park as an application background. In this scenario, water quality fluctuates frequently and has a complex composition, requiring higher real-time monitoring and source tracing accuracy. This embodiment achieves intelligent detection and source tracing of water pollution events through the following steps: To address the complex pipeline geometry parameters and frequently monitored water quality indicators within the park, parallel graph convolution is used to extract physical connectivity features. One-dimensional convolution is used to capture variational information of values ​​such as heavy metals and chemical oxygen demand, and two-dimensional convolution is combined to analyze the color features of the drainage outlet water. The outputs of each branch are aligned to the semantic vector space through a fully connected layer to complete the feature-level stitching of multimodal data.

[0067] The dynamic weight optimization algorithm is used to dynamically allocate weights and identify the contribution of specific key nodes in the industrial zone to the pollution characterization during peak sewage discharge periods. The resampling technology is used to solve the problem of inconsistent sampling frequencies of different sensors, and the fused features are uniformly mapped to the spatiotemporal coordinate system of the pipeline network with geographical reference, outputting the water pollution feature tensor.

[0068] Latin hypercube sampling is performed in the three-dimensional space of the pipeline network and correlated with the real-time flow velocity field obtained from hydraulic simulation. Automatic differentiation is used to calculate the rate of change of the concentration prediction values ​​with respect to various orders of time and space. The values ​​are then substituted into the hydrodynamic convection-diffusion equation. The physical consistency residual generated by the hydrodynamic convection-diffusion equation is used as a penalty term. The weights are dynamically adjusted with Lagrange multipliers to complete the iterative optimization of the water quality evolution model and ensure that the simulation results conform to the law of conservation of mass.

[0069] The system monitors the magnitude of deviations from physical constraints in real time. When it detects that a sensor at an industrial node is abnormally drifting due to chemical corrosion, the system automatically reduces the weight of that node in the loss function through an inverse proportional function. It then uses physical laws to forcefully correct the predicted trajectory, achieving non-contact software compensation.

[0070] The optimized model weights are loaded to perform high-parallel inference on the four-dimensional spatiotemporal grid of the entire park's pipe network; the discrete monitoring point data are restored into a continuous three-dimensional dynamic diffusion field, which intuitively presents the migration path, concentration gradient and diffusion trend of the pollution plume in the pipe network, filling the perception blind spot in sensorless areas.

[0071] Based on the generated diffusion field, a backward search is performed along the negative direction of the residual gradient using a spatiotemporal field inversion operator. Under the unidirectional constraint of the topological adjacency matrix, matching is performed only for the first- and second-level upstream branches of the affected nodes. Finally, the spatiotemporal coordinates and release intensity of pollution emissions are locked, the confidence probability distribution of each node is calculated, and a standardized encrypted early warning data packet containing the source location, impact range, and suggested disposal plan is encapsulated and pushed to the management terminal in real time.

[0072] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Those skilled in the art should understand that any modifications, equivalent substitutions, or improvements made to the above embodiments without departing from the technical essence and concept of the present invention should be covered within the protection scope of the present invention, and the protection boundary is defined by the appended claims and their equivalents.

Claims

1. An AI-driven intelligent detection method for water pollution events, characterized in that, include: Intelligent sensors are used to acquire pipeline geometric parameters, water quality numerical indicators and water body visual images. Multidimensional water quality monitoring indicators are extracted from pipeline geometric parameters, water quality numerical indicators and water body visual images through a water quality multidimensional feature extraction operator. The multidimensional water quality monitoring indicators are mapped to a unified coordinate system through a spatiotemporal alignment operator to generate a water pollution feature tensor. A physical constraint deviation term is generated in the loss function using the hydrodynamic convection-diffusion equation. The distribution and evolution of spatial concentration are restricted by the physical constraint deviation term. The drift compensation of the measured values ​​of the smart sensor is performed based on the physical constraint deviation term. A water quality evolution inference model is constructed that maps the water pollution feature tensor to a three-dimensional spatial concentration field. The water pollution characteristic tensor is input into the water quality evolution inference model, and the three-dimensional dynamic diffusion field of water pollutants is output. Based on the three-dimensional dynamic diffusion field of the water pollutants, a source tracing simulation is performed using a spatiotemporal field inversion operator to obtain the inversion results; the inversion results are mapped to the geometric parameters of the pipeline network to generate an early warning command containing the source tracing results.

2. The AI-driven intelligent detection method for water pollution events according to claim 1, characterized in that, Extracting multidimensional water quality monitoring indicators includes: the water quality multidimensional feature extraction operator uses graph convolutional network branches to extract features from the geometric parameters of the pipeline network and outputs topological features; it uses one-dimensional convolutional network branches to extract features from the numerical water quality indicators and outputs a water quality temporal feature vector; and it uses two-dimensional convolutional network branches to extract features from the visual image of the water body and outputs a water body spatial feature matrix; the topological features, the water quality temporal feature vector, and the water body spatial feature matrix constitute multidimensional water quality monitoring indicators.

3. The AI-driven intelligent detection method for water pollution events according to claim 1, characterized in that, The method of generating a water pollution feature tensor using a spatiotemporal alignment operator includes: calculating the correlation weights of the topological features, water quality time feature vector, and water body spatial feature matrix in the multidimensional water quality monitoring indicators using a dynamic weight optimization algorithm; performing weighted fusion of the multidimensional water quality monitoring indicators based on the correlation weights; resampling the fused features; inputting them into the spatiotemporal dimension corresponding to a unified coordinate system; and outputting the water pollution feature tensor.

4. The AI-driven intelligent detection method for water pollution events according to claim 1, characterized in that, Generating physical constraint deviation terms includes: performing spatiotemporal sampling based on the geometric scale of the pipeline network geometric structure parameters and a preset detection time step to generate spatiotemporal sampling points containing spatial location coordinates and time dimensions; obtaining the predicted concentration values ​​generated at the spatiotemporal sampling points by the initial water quality evolution model; calculating the time and spatial rate of change of the predicted concentration values ​​relative to the coordinates of the spatiotemporal sampling points using an automatic differential operator; substituting the time and spatial rate of change into the partial differential equation of the hydrodynamic convection-diffusion equation to calculate the physical consistency residual of the partial differential equation and outputting the physical constraint deviation terms.

5. The AI-driven intelligent detection method for water pollution events according to claim 4, characterized in that, Regularization constrains the spatial concentration distribution and evolution, and constructs a water quality evolution prediction model, including: establishing a mapping function between the water pollution feature tensor and the spatial concentration distribution; obtaining the water quality numerical indicators collected by the smart sensor at the spatiotemporal sampling points as the measured values ​​of the smart sensor; constructing a loss function by weighted summation of the physical constraint deviation term and the mean square error term of the predicted concentration value relative to the measured value; in the optimization stage, using the physical constraint deviation term as a constraint penalty term, and performing physical consistency correction on the gradient update step size of the mapping function through the Lagrange multiplier method; iteratively optimizing the weight parameters of the water quality multilayer sensor network architecture through the loss function to obtain the optimized water quality evolution prediction model.

6. The AI-driven intelligent detection method for water pollution events according to claim 5, characterized in that, The method of using physical constraint deviation terms to compensate for drift in the measured values ​​of a smart sensor includes: using the physical constraint deviation terms to perform real-time reliability assessment of the measured values; when the magnitude of the physical constraint deviation terms exceeds a preset residual threshold, determining that the measured values ​​are abnormal signals containing at least one of the interference components, namely drift components and noise interference; dynamically adjusting the weight coefficient of the mean square error term in the loss function according to the magnitude of the physical constraint deviation terms, and forcibly guiding the parameter update direction of the water quality evolution inference model through the physical constraint deviation terms, implicitly filtering the interference components in the measured values, thereby achieving drift compensation for the measured values ​​of the smart sensor.

7. The AI-driven intelligent detection method for water pollution events according to claim 5, characterized in that, The process of outputting a three-dimensional dynamic diffusion field of water pollutants includes: inputting the water pollution feature tensor into an optimized water quality evolution model, using the weight parameters of the mapping function to perform migration and evolution simulation on the spatiotemporal grid corresponding to the pipeline geometric parameters, and outputting a three-dimensional dynamic diffusion field of water pollutants composed of three-dimensional spatial grid concentration values.

8. The AI-driven intelligent detection method for water pollution events according to claim 1, characterized in that, The source tracing and inference are performed using a spatiotemporal field inversion operator, including: constructing an inversion reconstruction kernel based on the three-dimensional dynamic diffusion field of the water pollutants using the spatiotemporal field inversion operator; performing convolution matching between the inversion reconstruction kernel and the three-dimensional dynamic diffusion field of the water pollutants; calculating the residual gradient between the current diffusion state value and the preset monitoring index; updating the spatiotemporal parameters of the pollution source term along the negative direction of the residual gradient; and outputting the inversion result.

9. The AI-driven intelligent detection method for water pollution events according to claim 7, characterized in that, Generating an early warning command includes: mapping the inversion result to the node coordinate space of the pipeline network geometric parameters; calculating the confidence level of each node within the search radius using a spatial weighting function; outputting the coordinate probability distribution; extracting the concentration peak and its corresponding spatiotemporal index coordinates from the three-dimensional dynamic diffusion field of water pollutants using a peak retrieval operator; extracting nodes whose values ​​exceed a preset water quality threshold from the coordinate probability distribution as source tracing results; encapsulating the source tracing results, the concentration peak, and the geographical locations corresponding to the spatiotemporal index coordinates into a monitoring and early warning data package; and outputting the early warning command.