Water pollution tracing and early warning method and system based on deep learning

CN122473684BActive Publication Date: 2026-10-30ZHONGXIN HANCHUANG BEIJING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610619894.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-08
Publication Date
2026-10-30
Estimated Expiration
2046-05-08

AI Technical Summary

Technical Problem

[0004]本发明针对现有水质污染监测技术中多源数据融合不足、模型物理可解释性差、污染扩散预测能力缺失以及边缘端部署困难等问题,提供一种基于深度学习的水质污染溯源与预警方法及系统

Benefits of technology

[0024]与现有技术相比,本发明具有以下有益效果:通过融合无人机可见光影像与增强拉曼光谱数据,并采用自适应复数小波变换进行频域特征重构,有效解决了单一数据源特征不足的问题,提升了污染物识别的准确性。通过嵌入多分支统计池化注意力机制的倒残差轻量网络和联合学习范式,在保持轻量化的同时实现了污染物类别、浓度和源方位的多任务协同输出,适合边缘端实时部署。通过构建物理信息神经网络与流体动力学混合校验框架,采用三阶段递进训练策略和反馈修正机制,将物理规律嵌入深度学习模型,显著提升了模型的可解释性和预测可信度。通过构建水动力速度场驱动的动态时空图卷积模型,实现了污染扩散轨迹的动态预测,从瞬时定位跨越到未来时段预测,为主动式预警提供了技术支撑。通过贝叶斯自适应报警机制和三级差异化报警阈值,实现了基于概率置信度和扩散态势的自适应分级预警,并支持跨季节、跨流域的在线学习能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122473684B_ABST
    Figure CN122473684B_ABST
Patent Text Reader

Abstract

The application discloses a water quality pollution tracing and early warning method and system based on deep learning, which comprises the following steps: fusing unmanned aerial vehicle visible light images and enhanced Raman spectrum data to construct a heterogeneous data set; inputting the data set into an embedded multi-branch statistical pooling attention residual light network, extracting pollution distribution, peak value and heterogeneity characteristics through three kinds of pooling, outputting pollutant categories, concentration estimation and source direction by joint learning, and generating a present pollution area marking map; inputting the marking map into a physical information neural network and a fluid dynamics hybrid verification framework trained in three stages to perform consistency verification and correction; inputting the corrected marking map and the aircraft attitude coordinates into a dynamic space-time graph convolution model driven by a velocity field to predict future diffusion range and concentration distribution; and finally triggering a three-level alarm signal through a Bayesian adaptive mechanism. The application realizes high-precision, interpretable pollution tracing and dynamic early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of water quality monitoring and deep learning technology, specifically relating to a method and system for tracing and early warning of water pollution based on complex wavelet transform and physical information neural network. Background Technology

[0002] In recent years, with the acceleration of industrialization and urbanization, sudden water pollution incidents have occurred frequently, posing a serious threat to the ecological environment and public health. During small watershed river remediation projects, the illegal discharge of construction wastewater, domestic sewage, and pollutants such as polycyclic aromatic hydrocarbons (PAHs) and organophosphorus pesticides can easily lead to pollution phenomena such as algal blooms and sewage plumes in river bodies. These pollution incidents are characterized by their suddenness, high degree of concealment, and rapid spread. Traditional on-site manual inspections and water sampling methods suffer from low efficiency, limited visibility, and insufficient digitalization, making it difficult to meet the needs of real-time management and control.

[0003] Currently, existing research uses drone aerial photography combined with deep learning for the identification of floating objects on the water surface. However, the identification and localization of amorphous, large-area pollution such as sewage and algal blooms still faces challenges. Meanwhile, while surface-enhanced Raman spectroscopy can provide molecular fingerprint information of pollutants, on-site detection relies on spectral database matching, which is limited by equipment computing power and database capacity. Existing technologies still have significant shortcomings in multi-source data fusion, pollutant spatial localization, pollution diffusion prediction, and model physical interpretability. There is a lack of an intelligent water pollution source tracing and early warning solution that can integrate visual and spectral data, possess physical consistency verification capabilities, and is suitable for real-time deployment at the edge. Summary of the Invention

[0004] This invention addresses the problems of insufficient multi-source data fusion, poor physical interpretability of models, lack of pollution diffusion prediction capabilities, and difficulties in edge deployment in existing water pollution monitoring technologies. It provides a water pollution source tracing and early warning method and system based on deep learning.

[0005] In a first aspect, embodiments of this application provide a method for tracing and early warning of water pollution based on deep learning, the method comprising:

[0006] The data combines visible light images collected by unmanned aerial vehicles with enhanced Raman scattering spectral data collected by a portable Raman spectrometer.

[0007] An adaptive complex wavelet transform based on analytic signal theory is used to extract spectral phase information. The optimal wavelet scale is selected based on maximizing the phase spectral entropy to reconstruct two-dimensional frequency domain features, thus constructing a heterogeneous dataset.

[0008] The dataset is input into a lightweight inverted residual network with multi-branch statistical pooling attention. The overall pollution distribution, concentration peaks and spatial heterogeneity features are extracted through global averaging, maximum and standard deviation pooling. Joint learning is used to output pollutant categories, concentration estimates and source locations simultaneously, producing a current pollution area map.

[0009] The marked map is input into a hybrid verification framework of physical information neural network and fluid dynamics with three-stage progressive training. Consistency verification and correction are performed sequentially through data-driven, physical constraint fine-tuning and simulation verification, and the corrected pollution area marked map is output.

[0010] The corrected label map and the aircraft attitude coordinates are input into a velocity field-driven dynamic spatiotemporal graph convolution model. Spatial distance, velocity field intensity and concentration difference are used as dynamic evolution factors of the adjacency matrix. The pollution location is calculated through gating and the future diffusion range and concentration distribution are predicted.

[0011] The prediction results are input into the Bayesian adaptive alarm mechanism, which calculates the posterior probability based on historical priors and real-time observations. The prior distribution is adjusted through online learning, triggering a three-level alarm signal based on probability threshold, rate of change, and predicted diffusion speed.

[0012] Secondly, embodiments of this application provide a deep learning-based water pollution source tracing and early warning system, applied to the deep learning-based water pollution source tracing and early warning method described in the first aspect, the system comprising:

[0013] The data acquisition module is used to fuse visible light images acquired by unmanned aerial vehicles with enhanced Raman scattering spectral data acquired by a portable Raman spectrometer;

[0014] The feature reconstruction module is used to extract spectral phase information using adaptive complex wavelet transform based on analytic signal theory, and to perform two-dimensional frequency domain feature reconstruction by selecting the optimal wavelet scale based on maximizing phase spectral entropy, thereby constructing a heterogeneous dataset.

[0015] The multi-task recognition module embeds a lightweight inverted residual network with multi-branch statistical pooling attention. It is used to extract the overall distribution features of pollution, the concentration peak area and spatial heterogeneity features through global average pooling, max pooling and standard deviation pooling, respectively. It adopts joint learning to output pollutant category, concentration estimate and relative location of pollution source, and generates a pollution area map at the current stage.

[0016] The physical verification module incorporates a hybrid verification framework that combines a physical information neural network and computational fluid dynamics with a three-stage progressive training method. It is used to perform consistency verification and correction of the pollution diffusion path through data-driven training, physical constraint fine-tuning, and simulation verification in sequence, and outputs a corrected pollution area marking map.

[0017] The dynamic prediction module has a built-in dynamic spatiotemporal graph convolution model driven by the hydrodynamic velocity field. It uses spatial distance, velocity field intensity and concentration difference as dynamic evolution factors of the adjacency matrix, and solves the spatial location of pollution through a gating mechanism to predict the pollution diffusion range and concentration distribution in future periods.

[0018] The adaptive alarm module has a built-in Bayesian adaptive alarm mechanism, which is used to calculate the posterior probability based on the prior probability of historical pollution events and real-time observation data. It dynamically adjusts the prior distribution through online learning and triggers a three-level alarm signal based on the probability threshold, the probability change rate, and the predicted diffusion speed.

[0019] Thirdly, embodiments of this application provide an electronic device, including:

[0020] processor;

[0021] Memory used to store processor-executable instructions;

[0022] The processor is configured to implement the deep learning-based water pollution tracing and early warning method as described in the first aspect when executing the instructions.

[0023] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program that instructs a device to execute the deep learning-based water pollution tracing and early warning method as described in the first aspect.

[0024] Compared with existing technologies, this invention has the following advantages: By fusing UAV visible light imagery and enhanced Raman spectral data, and employing adaptive complex wavelet transform for frequency domain feature reconstruction, it effectively solves the problem of insufficient features from a single data source, thus improving the accuracy of pollutant identification. Through a lightweight inverse residual network embedding a multi-branch statistical pooling attention mechanism and a joint learning paradigm, it achieves multi-task collaborative output of pollutant category, concentration, and source location while maintaining lightweight design, making it suitable for real-time deployment at edge environments. By constructing a hybrid verification framework combining physical information neural networks and fluid dynamics, and employing a three-stage progressive training strategy and feedback correction mechanism, it embeds physical laws into the deep learning model, significantly improving the model's interpretability and prediction reliability. By constructing a dynamic spatiotemporal graph convolutional model driven by a hydrodynamic velocity field, it achieves dynamic prediction of pollution diffusion trajectories, moving from instantaneous location to future time-period prediction, providing technical support for proactive early warning. Through a Bayesian adaptive alarm mechanism and three-level differentiated alarm thresholds, it achieves adaptive hierarchical early warning based on probability confidence and diffusion trends, and supports online learning capabilities across seasons and watersheds. Attached Figure Description

[0025] Figure 1This is a schematic diagram of a deep learning-based water pollution source tracing and early warning method provided in an embodiment of this application.

[0026] Figure 2 This is a diagram illustrating the architecture of a deep learning-based water pollution tracing and early warning system provided in one embodiment of this application.

[0027] Figure 3 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.

[0029] It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.

[0030] Based on the embodiments described in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] Example 1

[0032] Figure 1 This is a schematic diagram of a deep learning-based method for tracing and early warning of water pollution, provided as an embodiment of this application. Figure 1 As shown, a deep learning-based method for tracing and early warning of water pollution sources includes:

[0033] S1. Fusion of visible light images collected by unmanned aerial vehicles (UAVs) and enhanced Raman scattering spectral data collected by a portable Raman spectrometer. Acquiring raw information from both sources: on-site photos of the water surface taken by the UAV, and characteristic signals of pollutants in the water detected by the spectrometer.

[0034] Specifically, the drone is equipped with a visible light camera and flies along a preset route along the target water area, capturing real-time images of the water surface. The images are then transmitted to a ground control station or edge computing terminal via a wireless image transmission module. The portable Raman spectrometer is equipped with a silver nanoparticle-enhanced substrate. After collecting water samples on-site, it uses near-infrared laser excitation to obtain the enhanced Raman scattering spectral signal of the water samples. The spectral data is transmitted to the same terminal via Bluetooth or a data cable. The terminal aligns and matches the drone images and spectral data according to the acquisition timestamp and spatial coordinates. For data with misaligned timestamps, the nearest neighbor matching principle is adopted: based on the sampling time of the Raman spectrometer, the drone image frame with the smallest time difference is selected for pairing, with a maximum allowable time difference of no more than 0.5 seconds, forming original data pairs with "same time, same water area location" as the association key for subsequent processing steps.

[0035] S2. Spectral phase information is extracted using adaptive complex wavelet transform based on analytic signal theory. The optimal wavelet scale is selected based on maximizing phase spectral entropy for two-dimensional frequency domain feature reconstruction, constructing a heterogeneous dataset. The spectral signal is converted into a two-dimensional map containing phase information, and the key frequency scales that best reflect pollution characteristics are automatically selected. This data, along with aerial photographs, is then organized into a standardized dataset with a unified format.

[0036] This invention proposes a complex adaptive entropy-weighted wavelet transform, which introduces an entropy weight adjustment factor based on the traditional wavelet transform:

[0037] ,

[0038] in, These are complex adaptive entropy weighted wavelet coefficients. The scaling parameter controls the wavelet scaling; Here is the displacement parameter, representing the position along the Raman displacement axis; To analyze the signal, ; The original one-dimensional Raman spectral signal is represented by enhanced Raman scattering spectral data acquired by a portable Raman spectrometer, indicating the intensity of scattered light at different Raman shifts. This represents the Raman shift (wavenumber). The imaginary unit; The complex conjugate of the mother wavelet function Morlet; The entropy weight adjustment factor is dynamically calculated based on the phase spectrum entropy, and the calculation formula is as follows: The output range of this function is 0.5 to 1.5, when the phase spectral entropy... When the phase spectrum entropy is large (rich in information), the weight approaches 1.5; when the phase spectrum entropy is small (dominated by noise), the weight approaches 0.5, thus achieving adaptive enhancement or suppression. For scale The phase spectrum entropy below.

[0039] Specifically, Hilbert transform is the real part of the analytic signal. right Perform Hilbert transform to generate the imaginary part, then perform wavelet transform. As the input signal for wavelet transform. Let... This is the preprocessed raw Raman spectrum signal, where This is the Raman shift. Its Hilbert transform is the real part. As the imaginary part, construct the analytic signal First, construct the analytical signal. For each scale and displacement Calculate the fundamental wavelet coefficients and simultaneously calculate the phase spectral entropy at this scale. Entropy weight adjustment factor The higher the entropy value, the higher the weight (maximum 1.5), and the lower the entropy value, the lower the weight (minimum 0.5). The entropy weight factor is multiplied into the wavelet transform kernel, so that the transform process adaptively enhances the information-rich frequency bands and suppresses the noise-dominant frequency bands.

[0040] Specifically, the construction of the heterogeneous dataset includes: First, converting the one-dimensional Raman spectral signal acquired by the spectrometer into an analytic signal in complex form, i.e., retaining the original signal as the real part, while generating the corresponding imaginary part through Hilbert transform; the two form a conjugate relationship, ensuring the complete preservation of the signal's phase information. Second, performing a complex wavelet transform on the analytic signal to extract the phase information of the spectrum at different scales, and calculating the phase spectral entropy corresponding to each scale. The phase spectral entropy reflects the richness of information in the signal at that scale; a larger entropy value indicates more significant contamination features at that scale. Then, comparing the phase spectral entropy values ​​at all scales, selecting the scale with the largest entropy value as the optimal wavelet scale, and converting the one-dimensional spectral signal into a two-dimensional frequency domain feature map at this scale, achieving a dimensionality upgrade from "a curve" to "an image." Finally, aligning the generated two-dimensional frequency domain feature map with the visible light image captured by the UAV according to spatial location, and storing them together in the dataset, forming a heterogeneous data set containing visual texture information and spectral frequency domain information for subsequent model use.

[0041] To avoid overfitting caused by excessive decomposition, this invention introduces a scale penalty term in the entropy maximization objective:

[0042] ,

[0043] in, To achieve the optimal wavelet scale, For a pre-defined set of candidate scales; For scale The global phase spectrum entropy under displacement (for displacement) (Take the average). This is the scale penalty coefficient, which controls the degree of suppression on large scales; The geometric mean of the candidate scale set; This is the logarithmic term of the scale; the larger the scale, the larger this value.

[0044] Traverse the candidate scale set For each scale Calculate its average phase spectral entropy Simultaneously calculate penalty items The scale corresponding to the maximum value after subtracting the penalty term from the entropy value is taken. This design avoids excessive subdivision in the frequency domain caused by indiscriminately choosing the maximum scale, thus balancing feature resolution and computational efficiency.

[0045] S3. Input the dataset into a lightweight inverted residual network embedded with multi-branch statistical pooling attention. Extract the overall pollution distribution, concentration peaks, and spatial heterogeneity features through global averaging, maximum, and standard deviation pooling. Employ joint learning to simultaneously output pollutant categories, concentration estimates, and source locations, generating a current pollution area map. Analyze the dataset using a lightweight intelligent model to determine the type, concentration, and approximate source direction of pollutants, and generate a heat map indicating the initial extent of the pollution area.

[0046] Specifically, the multi-branch statistical pooling attention is implemented as follows:

[0047] First, for the input feature map (3D data containing multiple channels), three different pooling branches are processed in parallel: Global Average Pooling Branch: Calculates the average value of all pixels in each channel, reflecting the overall distribution of pollution in that channel, such as the pollution coverage area of ​​an entire body of water. Max Pooling Branch: Extracts the pixel with the highest value in each channel, capturing the region with the highest pollution concentration, such as the peak location of a sewage outlet. Standard Deviation Pooling Branch: Calculates the dispersion of values ​​within each channel, characterizing the spatial non-uniformity of pollution, such as whether the concentration distribution is uniformly diffused or locally concentrated.

[0048] This invention designs a three-branch nonlinear interactive attention mechanism, where the outputs of each branch are fused after nonlinear transformation:

[0049] ,

[0050] in, For the final generated channel attention weights, This is the output of global average pooling; This is for max-pooling output; ⊙ represents the standard deviation pooling output; ⊙ represents element-wise multiplication (Hadamard product). Given the hyperbolic tangent activation function, the output is (-1, 1); It is a linear rectified function, with an output [0,∞). This is a one-dimensional convolution with a kernel size of 3, 3 input channels (corresponding to the outputs of the global average pooling, max pooling, and standard deviation pooling branches respectively), 1 output channel, a stride of 1, and padding of "same" to maintain the same length as the input. This design fuses the statistical information from the three branches across channels, enabling the network to automatically learn the optimal combination weights of the three pooling features. Using the Sigmoid activation function, the output is (0,1). Global average pooling output. With the process Activated max pooling output Element-wise multiplication produces the interactive feature A; standard deviation pooling output. With ReLU activated Element-wise multiplication produces interactive feature B. Feature A and feature B are then added together and fed into a one-dimensional convolutional layer for cross-channel fusion. Finally, sigmoid activation is applied to obtain channel attention weights. This design enables non-linear interaction among the three pooling features, avoiding information redundancy caused by simple stacking.

[0051] Then, the vectors output from the three branches (each channel corresponding to three values) are stacked together and fed into a one-dimensional convolutional layer for fusion, allowing the network to automatically learn the combination relationship between the three statistical information types. Next, an activation function maps the fusion result to channel weights, with larger weight values ​​indicating more important channel information. Finally, the original feature map is multiplied channel-by-channel by the calculated channel weights to recalibrate the feature map: important channels are enhanced, and unimportant channels are suppressed, outputting an enhanced feature map for subsequent network use.

[0052] The specific method for employing joint learning to simultaneously output pollutant categories, concentration estimates, and source locations, and to generate a map indicating the current pollution area, is as follows:

[0053] The lightweight inverse residual network extracts low-level features and branches into three independent task branches at the top. The first task branch uses a Softmax classifier to output the probability distribution of pollutant categories. The second task branch uses a linear regressor to output the estimated pollution concentration. The third task branch uses a spatial coordinate regressor to output the azimuth and distance of the pollution source relative to the UAV. Specifically, the lightweight inverse residual network extracts features from the input data, and the features output from the convolutional layers at the bottom of the network are shared by all tasks, avoiding redundant computation. Three independent task branches are set at the top of the network for parallel processing: Branch 1 (Classification): Uses a Softmax classifier to output the probability of pollutants belonging to each category, such as "algal bloom probability 0.7, wastewater probability 0.2, no pollution probability 0.1". Branch 2 (Concentration Estimation): Uses a linear regressor to directly output the numerical estimate of pollution concentration. Branch 3 (Source Location Inference): Uses a spatial coordinate regressor to output the azimuth and straight-line distance of the pollution source relative to the UAV.

[0054] Simultaneously, feature maps from the intermediate layers of the network are extracted and converted into activation heatmaps using gradient-weighted activation mapping. These heatmaps are then fused with the network output. The fusion method involves multiplying the heatmap matrix element-wise with the network output feature map and then summing it with the original feature map at a weighted ratio of 7:3, where the heatmap has a weight of 0.7 and the original feature map has a weight of 0.3. This ensures that the final labeling map retains the network's original judgment while highlighting the high-interest areas indicated by the heatmap, producing a current-stage contaminated area labeling map. Specifically, feature maps are extracted from the intermediate layers of the network and generated using gradient-weighted activation mapping. Areas with higher brightness in the heatmap indicate areas of greater network interest. This heatmap is then superimposed and fused with the outputs of the three branches mentioned above to form a labeling map that visually displays the current location and extent of the contaminated area.

[0055] The loss functions of the three task branches are weighted and summed to form the total loss for joint optimization. The weight coefficients are adaptively adjusted based on the convergence speed of each task. Specifically, during training, the loss functions of the three branches (classification error, concentration estimation error, and orientation inference error) are summed with different weights to form the total loss. The weight coefficients are not fixed but are adaptively adjusted according to the convergence speed of each task: tasks with slower convergence receive higher weights to balance the learning progress of each task.

[0056] This invention proposes an adaptive weight adjustment strategy based on the gradient magnitude ratio:

[0057] , ,

[0058] in, For the first The task in the first Weight coefficients for training cycles; For the first The gradient vector of the task loss function with respect to the network parameters; The L2 magnitude of the gradient vector reflects the convergence speed of the task; For the first Loss values ​​for each task (classification / regression / localization); This is the weighted total loss.

[0059] After each training cycle, the gradient magnitudes of the three task branches are calculated. , , A larger modulus indicates a faster decrease in loss for that task (faster convergence), thus assigning it a lower weight; conversely, a smaller modulus (slower convergence) assigns it a higher weight. The weights are normalized using Softmax to ensure their sum equals 1. This mechanism enables the network to automatically balance the learning progress of multiple tasks, preventing some tasks from converging too early and suppressing the learning of others.

[0060] S4. The marked map is input into a hybrid verification framework combining a physical information neural network and fluid dynamics, trained in a three-stage progressive manner. Consistency verification and correction are performed sequentially through data-driven processes, physical constraint fine-tuning, and simulation verification, outputting a corrected contaminated area marked map. The initially located thermal marked map is then fed into a correction system that integrates fluid dynamics laws. Data learning, physical rule constraints, and high-precision simulation comparison are performed in stages to correct unreasonable or ambiguous areas in the prediction results, outputting a more accurate contaminated area marked map.

[0061] Table 1 shows the three-stage progression. The first stage is pure data-driven training. The mean squared error between the current contaminated area map output in the previous steps and the actual measured contamination distribution is used as the loss function. An adaptive moment estimation optimizer is used to update the network parameters. When the loss on the validation set decreases by less than 2% for ten consecutive training epochs, the first stage switching condition is triggered. This threshold can be adjusted within the range of 1% to 5% depending on the model size. The model learns solely from labeled real data, without introducing any physical rules. The loss function uses the error between the model's output contaminated area map and the actual contamination distribution. The adaptive moment estimation optimizer automatically adjusts the learning rate to allow the model to converge quickly. When the error on the validation set no longer decreases significantly for ten consecutive training epochs, it indicates that pure data learning has reached its limit, triggering a switch to the second stage.

[0062] The second stage involves fine-tuning physical constraints. Based on the data-driven loss, the Navier-Stokes equation residuals are introduced as physical constraints. The weight of these physical constraints gradually increases from zero to a preset maximum value based on the ratio of the current training epoch to the total number of epochs in the first stage. This enhances the model's adherence to the physical laws of pollution diffusion. When the physical residuals drop below 0.01, the second stage switching condition is triggered. This threshold represents the average deviation of the predicted velocity and concentration fields from the Navier-Stokes equations. In practical applications, it can be adjusted within the range of 0.001 to 0.1 according to the monitoring accuracy requirements. In addition to the first-stage loss, the Navier-Stokes equation residuals from fluid dynamics are added as physical constraints. This constraint penalizes predictions that do not conform to the laws of fluid motion, forcing the model to learn the physical consistency of pollution diffusion. The weight of the constraint is not fixed but gradually increases from zero to a preset maximum value during the training process, preventing physical rules from prematurely dominating and suppressing data features. When the physical residuals decrease to an acceptable range, the switch to the third stage is triggered.

[0063] This invention designs dynamically evolving physical constraint weights, which adaptively adjust as the training process progresses.

[0064] ,

[0065] in, The total loss due to physical constraints. The squared Frobenius norm of the predicted distribution and the true value; Let L1 be the L1 norm of the residuals of the continuity equation; This represents the velocity field vector predicted by the network. For the pollutant concentration field predicted by the network; The molecular diffusion coefficient; These are the dynamic weights for continuity constraints and the dynamic weights for convection-diffusion constraints, respectively. This represents the ratio of the current training epoch to the total number of epochs; where the dynamic weights follow the pre-training annealing strategy:

[0066] , ,

[0067] in, To maximize the weight of the continuity constraint, To maximize the weight of the convection-diffusion constraint, The current training round ratio (starting from 0 after the first phase is completed).

[0068] At the start of the second phase, the data item weights remain at 1, while the physical constraint weights start at 0. (Continuity constraint weights) An S-shaped growth curve is adopted, reaching half-peak value in the middle of training (t=0.5) and approaching maximum value in the later stage; convection-diffusion constrained weights. A quadratic growth model is employed, with slow initial growth (to avoid interference from complex fluid terms in early training) and accelerated growth in later stages. Two physical constraint terms penalize predictions that violate mass conservation and matter transport laws, respectively.

[0069] The third stage is simulation verification and correction. The pollution diffusion distribution predicted by the network is compared pixel-by-pixel with the high-precision computational fluid dynamics simulation results. Before comparison, the two images are unified to the same resolution using bilinear interpolation. In this embodiment, the resolution of the network prediction results is used as the benchmark, and the CFD simulation results are upsampled or downsampled to that resolution. The average absolute error between the two is used as the consistency loss. If the consistency loss is lower than a preset threshold, training is complete and the corrected pollution area map is output. The pollution diffusion distribution predicted by the model is compared pixel-by-pixel with the high-precision computational fluid dynamics simulation results, and the average absolute error between the two is calculated as the consistency loss. If the consistency loss is lower than a preset threshold, it indicates that the model has sufficient physical consistency, training is complete, and the corrected pollution area map is output.

[0070] Table 1. Three-stage progressive relationship table

[0071] stage Core mission Loss function composition Switching conditions Phase 1 Pure data learning Data error only The validation set error did not decrease for ten consecutive cycles. Phase Two Physical rules are incorporated Data error + progressively weighted physical residuals Physical residuals drop below the threshold Phase Three Simulation benchmarking correction Consistency error with CFD simulation Consistency error is below the threshold

[0072] After the third stage of simulation verification is completed, the system checks whether the consistency loss is lower than a preset threshold: Case 1 (Verification passed): The consistency loss is lower than the threshold, training is complete, and the corrected contaminated area labeling map is directly output. Case 2 (Verification failed): The consistency loss exceeds the threshold, indicating that there is a significant deviation between the model's prediction results and the high-precision fluid dynamics simulation. In this case, the feedback correction mechanism is triggered.

[0073] The specific feedback correction process is as follows: First, the consistency loss calculated in the third stage is used as an additional penalty term and backpropagated to the second stage to forcibly increase the weight coefficient of the physical constraint term, making the model more in line with the laws of fluid dynamics in subsequent training. Then, the second stage (physical constraint fine-tuning) and the third stage (simulation verification correction) are re-executed, forming a closed-loop iteration of "training-verification-feedback-retraining". After each round of feedback iteration, the feedback counter is automatically incremented. When the counter accumulates to more than a preset number of times, the system determines that the current network architecture cannot effectively fit the complex laws of the pollution scenario. At this point, it stops the invalid iteration and outputs an alarm signal, prompting the operator to re-collect field data or adjust the network structure design.

[0074] Loss propagation in the feedback correction mechanism follows the following recursive relationship:

[0075] ,

[0076] ,

[0077] in, For the first Physical constraint weights in the next feedback iteration To provide feedback on the learning rate and control the increment of weights in each iteration, No. CFD consistency loss in subsequent feedback iterations; This represents the total number of nodes in the graph. For the first Nodes in the next iteration The predicted concentration; For nodes The true value of the CFD simulation concentration at the location.

[0078] The termination condition of the feedback iteration is determined by both the consistency loss and the number of iterations:

[0079] ,

[0080] in, A Boolean flag indicating whether to stop the feedback iteration, such as 0 or 1; This is an indicator function that takes the value 1 when the condition is true. The threshold for CFD consistency loss. This represents the maximum number of feedback iterations. When the third-phase CFD verification fails, the current consistency loss will be... Multiply by the feedback learning rate Then accumulated into physical constraint weights This allows the model to more strictly adhere to physical laws during retraining. After re-executing the second and third phases of training, the consistency loss is recalculated. If it still exceeds the threshold, iteration continues until the consistency loss is lower than the threshold. Or the number of iterations reaches .

[0081] S5. The corrected pollution map and the aircraft attitude coordinates are input into a velocity field-driven dynamic spatiotemporal graph convolution model. Spatial distance, velocity field intensity, and concentration difference are used as dynamic evolution factors of the adjacency matrix. The pollution location is calculated and the future diffusion range and concentration distribution are predicted through the reset and update gates in the gated recurrent unit. Combining the corrected pollution area map and the UAV's flight coordinates, a graph network model that can dynamically change over time is used to calculate the specific location of the pollution source and simulate the diffusion range and concentration change trend of the pollution over a future period.

[0082] Specifically, the implementation of the graph structure construction and adjacency matrix dynamic evolution factor of the dynamic spatiotemporal graph convolution model is as follows:

[0083] S5.1. Each sampling point within the coverage area of ​​the UAV aerial photography is used as a graph node. The node characteristics include pollution concentration, spatial coordinates, and water flow velocity vector. The number of nodes is dynamically determined based on the connected domain analysis results of continuous pollution areas in the corrected pollution area labeling map, and an upper limit threshold for the number of nodes is set. If the threshold is exceeded, a grid downsampling strategy is adopted for simplification. Specifically, the UAV aerial photography coverage area is divided into a uniform grid of M×M, where M is the square root of the upper limit of the number of nodes, rounded up. If there are multiple sampling points in each grid, only the point closest to the center of the grid is retained as the representative node. If there are no sampling points in the grid, they are skipped.

[0084] Specifically, sampling points within the coverage area of ​​drone aerial photography are used as nodes in the graph structure. Each node carries three types of information: the pollution concentration at that point, its spatial coordinates, and a water flow velocity vector (i.e., a vector representation of the direction and magnitude of the water flow). The total number of nodes is not fixed but dynamically determined based on the connected component analysis results of continuous polluted areas in the corrected pollution area labeling map. An upper limit is also set for the number of nodes. When the actual number of nodes exceeds this limit, a grid downsampling strategy is used for simplification, i.e., a subset of representative points is evenly selected across a large area to avoid excessive computation.

[0085] S5.2. Using the negative exponent of the spatial distance between any two nodes as the static edge weight base term, the velocity vector projection intensity between the two nodes along the water flow direction as the dynamic adjustment term, and the absolute value of the difference in pollution concentration between the two nodes as the heterogeneity penalty term, the static edge weight base term, the dynamic adjustment term, and the heterogeneity penalty term are weighted and summed, and then mapped to the zero-to-one interval through an activation function to construct a dynamic adjacency matrix.

[0086] Specifically, the connection strength between any two nodes (i.e., the value in the adjacency matrix) is determined by three factors: The first is the static edge weight, calculated based on the spatial distance between the two nodes; the closer the distance, the larger this value, reflecting the diffusion law of pollution attenuating with distance. The second is the dynamic adjustment term, calculated based on the projected strength of the flow velocity vector between the two nodes along the water flow direction; the connection strength is higher between upstream and downstream nodes in the water flow direction, reflecting the transport effect of water flow on pollutants. The third is the heterogeneity penalty term, calculated based on the absolute value of the difference in pollution concentration between the two nodes; the larger the concentration difference, the smaller this value, reflecting the molecular diffusion effect driven by the concentration gradient. The three factors are weighted and summed according to their respective weights, and then the result is mapped to the zero-to-one interval through an activation function, serving as the final connection strength between the two nodes.

[0087] This invention proposes a formula for constructing a nonlinear adjacency matrix driven by hydrodynamics, introducing a velocity-concentration cross-coupling term:

[0088] ,

[0089] in, For time node and The adjacency weight; For nodes and Euclidean distance, For distance attenuation scale parameters, For nodes and The projection of the direction onto the velocity field; , For nodes and The pollution concentration; This serves as the concentration normalization baseline value. For the concentration difference scale parameter; These are learnable weights; It is an exponential function.

[0090] Weight The constraint that the sum of the three factors must be a non-negative real number equal to one is achieved by normalizing the original learnable parameters using the Softmax function. At the start of training, the initial values ​​of the three weights are all set to one-third, meaning the initial contributions of the three factors are equal. As training progresses, the network automatically adjusts the weights based on the data: if pollution diffusion in a certain area is primarily driven by water transport... It will increase; if diffusion based on concentration gradient is dominant, It will increase; if static distance attenuation is the dominant factor, This will increase. This design allows the model to adaptively match the dominant diffusion mechanism under different hydrological conditions.

[0091] Three-factor design: static distance term The closer the distance, the larger the value, reflecting the distance decay law. Flow velocity driving term. The higher the flow velocity and the greater the upstream concentration compared to the downstream, the more convective transport is observed. When (upstream is higher than downstream) If positive, strengthen the connection; when A negative value weakens the connection. Concentration heterogeneity term. The larger the concentration difference, the closer the value is to 1 (boundary penalty); the smaller the difference, the closer the value is to 0, strengthening the connection between nodes with similar concentrations. The three-factor weighted sum is mapped to the adjacency weight in the (0,1) interval by the Sigmoid function. This design explicitly embeds the physical laws of fluid dynamics convection-diffusion into the graph structure construction process.

[0092] S5.3 The adjacency matrix is ​​recalculated at each time step based on the real-time updated node concentration and flow velocity field to realize the dynamic evolution of the graph structure. The spatial distance term represents the diffusion law of pollution decay with distance, the flow velocity field intensity term represents the transport effect of water flow on pollutants, and the concentration difference term represents the molecular diffusion effect driven by the concentration gradient.

[0093] The adjacency matrix described above is not fixed at once, but is recalculated at each time step based on the real-time updated node concentration data and flow velocity field data. As pollution spreads and water flow changes, the connection strength between nodes is also dynamically adjusted, thus enabling the graph structure to truly reflect the spatiotemporal evolution of pollution spread.

[0094] Specifically, the spatial distance term characterizes the natural diffusion law of pollution attenuating with increasing distance; the closer two points are, the stronger the correlation. The flow velocity field intensity term characterizes the transport effect of water flow on pollutants; the correlation between upstream and downstream points along the flow direction is stronger. The concentration difference term characterizes the molecular diffusion effect driven by the concentration gradient; the correlation between two points with similar concentrations is stronger, while the correlation between two points with large concentration differences is weaker.

[0095] The specific implementation method for calculating the pollution location and predicting the future diffusion range and concentration distribution through gating is as follows:

[0096] A gated recurrent unit is cascaded after the dynamic spatiotemporal graph convolutional layer. The gated recurrent unit takes the output of the dynamic adjacency matrix convolution of the current time step as input and transmits the contamination spatiotemporal evolution information of the historical time steps in a hidden state.

[0097] Specifically, a gated recurrent unit (ROU) is chained after the dynamic spatiotemporal graph convolutional layer. A Gated ROU is a recurrent neural network structure specifically designed for processing sequential data, adept at capturing temporal dependencies. Taking a river monitoring scenario as an example, the system has completed the dynamic spatiotemporal graph convolution calculation for the first 5 time steps (each step 5 seconds apart), obtaining the pollution feature vectors of each node at each time step. At the end of the 5th second, the Gated ROU receives the output of the dynamic adjacency matrix convolution of the current time step as input, and simultaneously receives the hidden state passed from the previous time step. The hidden state is equivalent to the model's "memory," recording the entire process of pollution diffusion from upstream to downstream within the previous 5 seconds: when emissions began, the diffusion rate, how the concentration peak changed, and other spatiotemporal evolution information.

[0098] The gating loop unit contains a reset gate and an update gate. The reset gate controls the proportion of information ignored in the historical hidden state, and the update gate controls the fusion ratio of the current input and the historical hidden state. The gating mechanism adaptively captures short-term fluctuations and long-term trends in the pollution diffusion process.

[0099] The gated loop unit contains two gating structures: a reset gate and an update gate. The reset gate determines how much historical information should be ignored. For example, when pollution diffusion suddenly encounters a tributary confluence, causing a sudden change in water flow velocity, the reset gate increases its closure ratio, allowing the model to "forget" the diffusion patterns established based on the old flow velocity and adapt to the new flow conditions. Numerically, the reset gate output value ranges from 0 to 1, with 0 indicating complete ignoring of historical information and 1 indicating complete retention. The update gate determines the fusion ratio between current observations and historical memory. When pollution diffusion shows a stable trend (e.g., moving downstream at a constant speed), the update gate tends to retain more historical information, maintaining the continuity of prediction results; when abnormal fluctuations occur (e.g., a sudden increase in discharge from a sewage outlet), the update gate tends to adopt more current observations, allowing the model to respond quickly to changes.

[0100] By coordinating the reset and update gates, the model can adaptively capture both short-term fluctuations (such as a brief exceedance of emission limits) and long-term trends (such as the overall migration pattern of the entire pollution plume) during pollution diffusion. For example, in a monitoring session, the system detected an upstream concentration that plummeted from 120 mg / L to 40 mg / L within 10 seconds (short-term fluctuation), while the downstream concentration gradually increased from 5 mg / L to 60 mg / L (long-term trend). The gating loop unit adjusted the gating parameters, thus retaining both the memory of the long-term diffusion trend and the response to short-term emission changes.

[0101] The node features of multiple future time steps output by the gated recurrent unit are input into the fully connected layer to calculate the future pollution concentration value of each sampling point. The discrete node prediction results are then extended into a continuous spatial distribution map through inverse distance weighted interpolation, outputting the pollution diffusion range and concentration distribution for future periods.

[0102] Specifically, the node features output by the gated recurrent unit for multiple future time steps (e.g., 30 seconds, 60 seconds, 90 seconds) are fed into the fully connected layer. The fully connected layer maps the feature vector of each node to a single concentration prediction value, obtaining the pollution concentration of each sampling point at various future time points. At this time, the prediction result is still a value of discrete nodes (e.g., 95 nodes each correspond to a single concentration value). To obtain a complete spatial distribution map, the system uses an inverse distance weighted interpolation method for expansion: for any spatial location to be predicted, the system finds the K nearest nodes to that point. In this embodiment, K is set to 8. If the value of K is too large, it will introduce interference from distant nodes; if the value of K is too small, it will lead to discontinuous interpolation results. Therefore, the value of K can be adjusted in the range of 4 to 12 according to the node density, and weights are assigned according to distance (the closer the distance, the greater the weight). The concentration prediction values ​​of these nodes are weighted and averaged to obtain the concentration estimate value for that location. Through the interpolation calculations described above, the system expands the prediction results of 95 discrete nodes into a continuous spatial distribution map covering the entire drone aerial photography range. Different shades of color represent varying pollution concentrations, and contour lines mark the pollution diffusion boundaries. Finally, the system outputs predicted pollution diffusion range and concentration distribution maps for the next 30, 60, and 90 seconds, for use by subsequent alarm mechanisms.

[0103] S6. Input the prediction results into the Bayesian adaptive alarm mechanism. Calculate the posterior probability based on historical priors and real-time observations. Adjust the prior distribution through online learning to trigger a three-level alarm signal based on probability threshold, rate of change, and predicted diffusion speed. Compare historical pollution patterns with current prediction results to calculate the probability of pollution occurrence. Then, based on the probability level, rate of change, and predicted diffusion speed, automatically determine the urgency and issue alarm signals of different levels.

[0104] Specifically, in this embodiment, the Bayesian adaptive multi-level alarm mechanism is implemented as follows:

[0105] Establish historical prior probability distributions for three types of pollution events. Each prior distribution is stored in beta distribution form, with shape parameters... Indicates the historical number of such pollution events, shape parameter This indicates the number of times this type of pollution event has not occurred in the past (i.e., the number of times other types of pollution events occurred or pollution was not detected). Initially, and This data is based on statistical analysis of historical monitoring data from the past three years. After each alarm event, if manual verification confirms the pollution type as... Then Add one; if the alarm is denied by manual review, then... First, the initial prior knowledge is obtained based on statistical analysis of historical monitoring data of the target water area over the past three years;

[0106] When the output data on the pollution diffusion range and concentration distribution for the future period arrives, this data is used as the real-time observation value to calculate the posterior probability of the three types of pollution events. The posterior probability is proportional to the product of the prior probability and the likelihood function, which is constructed based on the degree of deviation between the observed concentration and the typical concentration threshold of each type of pollution.

[0107] The differentiated triggering conditions for the three-level alarm signals are as follows: A Level 1 alarm is triggered when the maximum posterior probability exceeds 0.5 and the standard deviation of the pollution event category corresponding to this maximum posterior probability in the posterior probability distribution of each category is less than 0.2, meaning the concentration of posterior probabilities for each category is high and there are no multiple categories with similar probabilities. At this time, a prompt-level alarm is output and the suspected pollution area is marked. A Level 2 alarm is triggered when the maximum posterior probability exceeds 0.8 and the time change rate of the posterior probability exceeds 0.1 per hour. At this time, a warning-level alarm is output and encrypted monitoring is initiated. A Level 3 alarm is triggered when the maximum posterior probability exceeds 0.95 and the predicted diffusion rate exceeds the critical diffusion rate threshold. This critical diffusion rate threshold is determined based on historical hydrological data of the target water area. In this embodiment, the value is set to 0.5 m / s. For rivers with faster flow, it can be appropriately increased to 1.0 m / s, and for lakes with slower flow, it can be decreased to 0.2 m / s. At this time, an emergency-level alarm is output and pollution source tracing results and emergency response suggestions are automatically pushed. The specific method of dynamically adjusting the prior distribution through online learning is as follows: after each alarm event, the real-time observation data and manual review results are used as new samples. The prior distribution parameters of the corresponding pollution type are corrected using the incremental Bayesian update principle. To prevent catastrophic amnesia, the update amount of historical prior parameters and the contribution of new samples is weighted and fused according to a preset ratio. The historical prior weight decays exponentially over time, with a decay half-life of three months, to adapt to the seasonal variation characteristics of different watersheds.

[0108] Example 2

[0109] like Figure 2 As shown, this application provides a deep learning-based water pollution source tracing and early warning system architecture diagram, applied to the deep learning-based water pollution source tracing and early warning method as described in Embodiment 1, including:

[0110] The data acquisition module 210 is used to fuse visible light images acquired by the unmanned aerial vehicle with enhanced Raman scattering spectral data acquired by the portable Raman spectrometer.

[0111] The feature reconstruction module 220 is used to extract spectral phase information using adaptive complex wavelet transform based on analytic signal theory, and to perform two-dimensional frequency domain feature reconstruction by selecting the optimal wavelet scale based on maximizing phase spectral entropy, thereby constructing a heterogeneous dataset.

[0112] The multi-task recognition module 230 embeds a lightweight inverted residual network with multi-branch statistical pooling attention. It is used to extract the overall distribution features of pollution, the concentration peak region and the spatial heterogeneity features through global average pooling, max pooling and standard deviation pooling, respectively. It adopts joint learning to output pollutant category, concentration estimate and relative location of pollution source, and generates a pollution area marking map at the current stage.

[0113] The physical verification module 240 incorporates a hybrid verification framework that combines physical information neural networks and computational fluid dynamics with three-stage progressive training. This framework is used to sequentially verify and correct the consistency of pollution diffusion paths through data-driven training, physical constraint fine-tuning, and simulation verification, and outputs a corrected pollution area labeling map.

[0114] The dynamic prediction module 250 has a built-in dynamic spatiotemporal graph convolution model driven by the hydrodynamic velocity field. It is used to calculate the spatial location of pollution and predict the pollution diffusion range and concentration distribution in the future period through a gating mechanism, using spatial distance, velocity field intensity and concentration difference as dynamic evolution factors of the adjacency matrix.

[0115] The adaptive alarm module 260 has a built-in Bayesian adaptive alarm mechanism, which is used to calculate the posterior probability based on the prior probability of historical pollution events and real-time observation data. It dynamically adjusts the prior distribution through online learning and triggers a three-level alarm signal based on the probability threshold, the probability change rate, and the predicted diffusion speed.

[0116] Figure 3 This is an electronic device provided in one embodiment of this application. For example... Figure 3 As shown, the electronic device includes at least the following components: processor 301 and memory 300, communication interface 303, and bus 302.

[0117] In this embodiment of the application, memory 300 is used to store executable instructions of processor 301, which, when configured to execute instructions, implements the method as described in the first aspect.

[0118] In embodiments of this application, a computer-readable storage medium includes instructions that instruct a device to perform the method as described in the first aspect. For example, the instructions instruct the device to perform... Figure 1 The method is shown in the process steps.

[0119] In one embodiment of this application, the program operating in the electronic device may be a program that controls a central processing unit (CPU) or similar device to achieve the functions of the above-described embodiments of the present invention (a program that enables the computer to function). Information processed by these systems is then temporarily stored in random access memory (RAM) during processing, and subsequently stored in various ROMs such as read-only memory (FlashROM) and hard disk drives (HDDs), and read, corrected, and written by the CPU as needed.

[0120] It should be noted that a portion of the electronic device described above can also be implemented using a computer. In this case, the program for implementing the control function can be recorded on a computer-readable recording medium, and the program recorded on the recording medium can be read into the computer and executed.

[0121] It should be noted that the computer mentioned here refers to a computer built into an electronic device, employing hardware including an operating system and peripheral devices. Furthermore, computer-readable recording media refers to removable media such as floppy disks, magneto-optical disks, ROMs, and CD-ROMs, as well as storage systems such as hard drives built into the computer.

[0122] Furthermore, computer-readable recording media can include: media that dynamically stores programs for short periods of time, such as communication lines used when transmitting programs via networks like the Internet or communication lines like telephone lines; and media that store programs for fixed periods of time, such as volatile memory inside a computer that serves as a server or client in this case. In addition, the aforementioned program can be a program used to implement the above-mentioned functions, or it can be a program that can implement the above-mentioned functions by combining them with programs already recorded in the computer.

[0123] Furthermore, the electronic device in the above embodiments can also be implemented as an assembly (system group) composed of multiple systems. Each system constituting the system group can possess some or all of the functions or functional blocks of the electronic device in the above embodiments. As a system group, it is sufficient to have all the functions or functional blocks of the electronic device.

[0124] Those skilled in the art should recognize that the above embodiments are only used to illustrate this application and are not intended to limit this application. Any appropriate changes and variations made to the above embodiments within the essential spirit and scope of this application fall within the scope of protection claimed in this application.

Claims

1. A method for tracing and early warning of water pollution based on deep learning, characterized in that, Includes the following steps: The imagery is fused from visible light images collected by an unmanned aerial vehicle with enhanced Raman scattering spectral data collected by a portable Raman spectrometer. An adaptive complex wavelet transform based on analytic signal theory is used to extract spectral phase information. The optimal wavelet scale is selected based on maximizing the phase spectral entropy to reconstruct two-dimensional frequency domain features, thus constructing a heterogeneous dataset. The construction of the heterogeneous dataset includes: The enhanced Raman scattering spectral data is constructed into an analytical signal containing the conjugate relationship between the real part and the imaginary part of the Hilbert transform. The spectral phase information at each scale is extracted by complex wavelet transform, the phase spectral entropy corresponding to each scale is calculated, and the wavelet scale corresponding to the maximum value of the phase spectral entropy is selected as the optimal scale. At the optimal scale, the one-dimensional spectral signal is converted into a two-dimensional frequency domain feature map, and together with the UAV visible light image, they form a heterogeneous dataset. The heterogeneous dataset is input into a lightweight inverted residual network with multi-branch statistical pooling attention. The overall distribution, concentration peaks and spatial heterogeneity features of pollution are extracted through global averaging, maximum and standard deviation pooling. Joint learning is used to output pollutant category, pollution concentration estimate and source location at the same time, and a pollution area map of the current stage is generated. The pollution area map is input into a hybrid verification framework of physical information neural network and computational fluid dynamics trained in three stages. Consistency verification and correction are performed sequentially through data-driven, physical constraint fine-tuning and simulation verification, and the corrected pollution area map is output. The specific implementation method of the three-stage progressive training is as follows: The first stage is pure data-driven training. The mean square error between the output current pollution area map and the measured pollution diffusion range and concentration distribution true value is used as the loss function. An adaptive moment estimation optimizer is used to update the network parameters. When the validation set loss decreases below the preset threshold for ten consecutive training cycles, the first stage switching condition is triggered. The second stage is physical constraint fine-tuning. Based on the data-driven loss, the Navier-Stokes equation residual is introduced as a physical constraint term. The weight of the physical constraint term gradually increases from zero to a preset maximum value according to the ratio of the current training round to the total number of rounds in the first stage, so as to enhance the model's compliance with the physical laws of pollution diffusion. When the physical residual drops below the preset threshold, the second stage switching condition is triggered. The third stage is simulation verification and correction, which compares the pollution diffusion range and concentration distribution predicted by the network with the high-precision simulation results of computational fluid dynamics pixel by pixel. The average absolute error between the two is used as the consistency loss. If the consistency loss is lower than the preset threshold, the training is completed and the corrected pollution area labeling map is output. The three-stage progressive training also includes a feedback correction mechanism: When the consistency loss of the computational fluid dynamics simulation verification in the third stage exceeds the preset threshold, it is determined that there is a significant deviation between the network prediction and the physical simulation. At this time, the feedback correction mechanism is triggered, and the consistency loss is propagated back to the second stage as an additional penalty term. The weight coefficient of the physical constraint term is forcibly increased, and the training of the second and third stages is re-executed. After each feedback iteration, the feedback counter is incremented by one. When the cumulative feedback counter exceeds the preset number, it is determined that the current model architecture cannot fit the current pollution scenario, and an alarm signal is output to indicate that data needs to be collected again or the network structure needs to be adjusted. The corrected pollution area map and the aircraft attitude coordinates are input into a velocity field-driven dynamic spatiotemporal graph convolution model. Spatial distance, velocity field intensity and concentration difference are used as dynamic evolution factors of the adjacency matrix. The pollution location is calculated through gating and the future diffusion range and concentration distribution are predicted. The prediction results are input into the Bayesian adaptive alarm mechanism, which calculates the posterior probability based on historical priors and real-time observations. The prior distribution is adjusted through online learning, triggering a three-level alarm signal based on probability threshold, rate of change, and predicted diffusion speed.

2. The method according to claim 1, characterized in that, The implementation method of the multi-branch statistical pooling attention is as follows: The global average pooling branch, the max pooling branch, and the standard deviation pooling branch are deployed in parallel. The global average pooling branch calculates the global mean of each feature channel to characterize the overall distribution characteristics of pollution. The max pooling branch extracts the maximum response value of each feature channel to capture the peak region of pollution concentration. The standard deviation pooling branch calculates the standard deviation of each feature channel to characterize the spatial heterogeneity of pollution. The output vectors of the three branches are stacked and then fed into a one-dimensional convolutional layer for feature fusion. The channel weights are then generated by an activation function, and finally the original feature map is multiplied by the channel weights to output an enhanced feature map.

3. The method according to claim 1, characterized in that, The specific method for generating a current pollution area map by simultaneously outputting pollutant category, pollution concentration estimate, and source location using joint learning is as follows: The low-level features extracted by the shared inverse residual lightweight network are branched into three independent task branches at the top of the network. The first task branch uses a Softmax classifier to output the probability distribution of pollutant categories, the second task branch uses a linear regressor to output the estimated value of pollution concentration, and the third task branch uses a spatial coordinate regressor to output the azimuth and distance of the pollution source relative to the UAV. Simultaneously, the feature maps of the intermediate layers of the network are extracted and generated into a class activation heatmap through gradient weighted class activation mapping. The heatmap is then fused with the network output to produce a current pollution area marker map. The loss functions of the three task branches are weighted and summed to form the total loss for joint optimization, with the weight coefficients adaptively adjusted according to the convergence speed of each task.

4. The method according to claim 1, characterized in that, The specific implementation methods for the graph structure construction and adjacency matrix dynamic evolution factor of the dynamic spatiotemporal graph convolution model are as follows: Each sampling point within the coverage area of ​​the drone aerial photography is used as a graph node. The node features include pollution concentration, spatial coordinates, and water flow velocity vector. The number of nodes is dynamically determined based on the connected domain analysis results of continuous pollution areas in the corrected pollution area labeling map, and an upper limit threshold for the number of nodes is set. If the threshold is exceeded, a grid downsampling strategy is adopted for simplification. The negative exponent of the spatial distance between any two nodes is used as the static edge weight base term, and the projection intensity of the velocity vector along the water flow direction between the two nodes is used as the dynamic adjustment term. The specific calculation method is as follows: any one of the two nodes is node 1, and the other node is node 2; first, obtain the local velocity vector at node 1, and then calculate the projection length of the local velocity vector on the unit direction vector from node 1 to node 2. This projection length is the projection intensity. The absolute value of the difference in pollution concentration between the two nodes is used as the heterogeneity penalty term. The static edge weight base term, the dynamic adjustment term, and the heterogeneity penalty term are weighted and summed, and then mapped to the zero-to-one interval through an activation function to construct a dynamic adjacency matrix. The adjacency matrix is ​​recalculated at each time step based on the real-time updated node concentration and flow velocity field. Each time step is 5 seconds apart, which matches the drone aerial photography frame rate and data acquisition frequency. It can be adjusted within the range of 1 to 30 seconds according to the pollution diffusion speed. The spatial distance term represents the diffusion law of pollution attenuation with distance, the flow velocity field intensity term represents the transport effect of water flow on pollutants, and the concentration difference term represents the molecular diffusion effect driven by the concentration gradient.

5. The method according to claim 4, characterized in that, The specific implementation method for calculating the pollution location and predicting the future diffusion range and concentration distribution through gating is as follows: A gated recurrent unit is cascaded after the dynamic spatiotemporal graph convolutional layer. The gated recurrent unit takes the output of the dynamic adjacency matrix convolution of the current time step as input and transmits the contamination spatiotemporal evolution information of the historical time steps in a hidden state. The gating loop unit contains a reset gate and an update gate. The reset gate controls the proportion of information ignored in the historical hidden state, and the update gate controls the fusion ratio of the current input and the historical hidden state. The gating mechanism adaptively captures the short-term fluctuations and long-term trends in the pollution diffusion process. The node features of multiple future time steps output by the gated recurrent unit are input into the fully connected layer to calculate the future pollution concentration value of each sampling point. The discrete node prediction results are then extended into a continuous spatial distribution map through inverse distance weighted interpolation, outputting the pollution diffusion range and concentration distribution for future periods.

6. The method according to claim 1, characterized in that, The specific implementation method for triggering the three-level alarm signal based on probability threshold, rate of change, and predicted diffusion speed is as follows: Establish historical prior probability distributions for various types of pollution events, and use the output future pollution diffusion range and concentration distribution as real-time observations to calculate posterior probabilities. Three alarm thresholds are set. The first level alarm is triggered when the posterior probability exceeds the first threshold, and a prompt alarm is output. The second level alarm is triggered when the posterior probability exceeds the second threshold and the probability change rate exceeds the change rate threshold, and a warning alarm is output. The third level alarm is triggered when the posterior probability exceeds the third threshold and the predicted diffusion rate exceeds the critical velocity threshold, and an emergency alarm is output. After each alarm, the prior distribution is updated and corrected using incremental Bayesian methods, and the historical prior weights decay exponentially over time.

7. A water pollution source tracing and early warning system based on deep learning, implementing the method as described in any one of claims 1 to 6, characterized in that, The system includes: The data acquisition module is used to fuse visible light images acquired by unmanned aerial vehicles with enhanced Raman scattering spectral data acquired by a portable Raman spectrometer; The feature reconstruction module is used to extract spectral phase information using adaptive complex wavelet transform based on analytic signal theory, and to perform two-dimensional frequency domain feature reconstruction by selecting the optimal wavelet scale based on maximizing phase spectral entropy, thereby constructing a heterogeneous dataset. The multi-task recognition module embeds a lightweight inverted residual network with multi-branch statistical pooling attention. It is used to extract the overall distribution features of pollution, the concentration peak area and spatial heterogeneity features through global average pooling, max pooling and standard deviation pooling, respectively. It adopts joint learning to output pollutant category, concentration estimate and relative location of pollution source, and generates a pollution area map at the current stage. The physical verification module incorporates a hybrid verification framework that combines a physical information neural network and computational fluid dynamics with a three-stage progressive training method. It is used to perform consistency verification and correction of the pollution diffusion path through data-driven training, physical constraint fine-tuning, and simulation verification in sequence, and outputs a corrected pollution area marking map. The dynamic prediction module has a built-in dynamic spatiotemporal graph convolution model driven by the velocity field. It uses spatial distance, velocity field intensity and concentration difference as dynamic evolution factors of the adjacency matrix, and solves the spatial location of pollution through a gating mechanism to predict the pollution diffusion range and concentration distribution in future periods. The adaptive alarm module has a built-in Bayesian adaptive alarm mechanism, which is used to calculate the posterior probability based on the prior probability of historical pollution events and real-time observation data. It dynamically adjusts the prior distribution through online learning and triggers a three-level alarm signal based on the probability threshold, the probability change rate, and the predicted diffusion speed.

Citation Information

Patent Citations

  • Water quality change trend rapid prediction method based on multi-source data fusion and physical constraint

    CN120598102A

  • Water pollution risk early warning and tracing method based on multi-source data fusion

    CN121119701A