Drainage basin surface water pollution tracing method based on multi-source data

By constructing a standardized grid data matrix and an improved convolutional neural network, the problems of data heterogeneity and spatiotemporal misalignment in traditional watershed pollution source tracing methods have been solved, enabling precise location of pollution sources and efficient output of source tracing results, thus meeting the rapid governance needs of environmental protection departments.

CN121579900APending Publication Date: 2026-02-27BAOTOU ECOLOGICAL SECURITY BARRIER RESEARCH CENTER (BAOTOU ECOLOGICAL ENVIRONMENT MONITORING CENTER)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511711843.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Traditional watershed pollution source tracing methods struggle to integrate multi-source data simultaneously, adapt to irregular boundaries, and ignore the temporal dynamics of pollution diffusion. This results in insufficient accuracy in locating pollution sources and long tracing cycles, failing to meet the environmental protection departments' needs for rapid source identification and efficient treatment.

Method used

By collecting and preprocessing multi-source data, a standardized grid data matrix and binary mask matrix are constructed. Spatial and temporal features are extracted using an improved convolutional neural network. Combined with adaptive convolutional kernels and attention mechanisms, the spatiotemporal integrated feature matrix is ​​fused and trained to accurately locate pollution sources.

Benefits of technology

It enables precise location of pollution sources, reduces pollution control costs for environmental protection departments, and the output source tracing results can accurately locate pollution sources and identify pollution periods, providing a basis for subsequent long-term monitoring and improving the accuracy and efficiency of source tracing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579900A_ABST
    Figure CN121579900A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of drainage basin surface water pollution tracing, in particular to a drainage basin surface water pollution tracing method based on multi-source data. According to the method, historical multi-source data is collected and preprocessed; obtaining a binary mask matrix and a standardized grid data matrix; obtaining a spatial feature tensor matrix through an improved convolutional neural network; extracting a dynamic time sequence data submatrix, and obtaining three groups of time sequence pooling feature tensors through an improved convolutional neural network; performing channel splicing on the spatial feature tensor matrix and the three groups of time sequence pooling feature tensors to obtain a space-time integrated feature matrix; acquiring historical pollution labeling data and training the improved convolutional neural network in combination with the space-time integrated feature matrix; and obtaining current multi-source data of the target drainage basin, and inputting the current multi-source data into the trained improved convolutional neural network to obtain a traceability result. According to the invention, through standardized integration of multi-source data, the problems of data isomerism and space-time dislocation in traditional traceability can be solved, and accurate positioning of a pollution source is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of watershed surface water pollution source tracing technology, specifically to a watershed surface water pollution source tracing method based on multi-source data. Background Technology

[0002] As a vital water resource carrier in the region, the river basin is frequently affected by surface water pollution from multiple sources, including industrial wastewater discharge, agricultural non-point source pollution, and domestic sewage discharge, seriously threatening water ecological security and the guarantee of drinking water for people's livelihoods. However, traditional methods for tracing pollution sources in river basins have significant limitations. They rely on manual sampling and analysis, which is inefficient, and it is difficult to simultaneously integrate multi-source data such as water quality, geography, and hydrology. Furthermore, they are poorly adaptable to irregular river basin boundaries and ignore the temporal dynamics of pollution diffusion, resulting in insufficient accuracy in locating pollution sources and long tracing cycles. These methods cannot meet the practical needs of environmental protection departments to quickly pinpoint sources and efficiently carry out pollution control.

[0003] Existing technical solutions have improved upon traditional source tracing methods. For example, they simulate pollutant diffusion paths by constructing hydrodynamic equations (such as QUAL2K and SWAT models); or they use forward matrix factorization (PMF) models combined with random forests to analyze the chemical composition of pollutants; and they use CNN-RNN joint modeling or spatiotemporal graph convolutional networks (ST-GCN) to extract spatiotemporal features, and combine satellite remote sensing and ground sensor data to predict pollutant concentrations for the next 72 hours. However, these technologies have not designed adaptation schemes for irregular watershed boundaries, resulting in distorted feature extraction of complex areas such as riverbanks and tributaries. The LSTM method for processing time-series data does not distinguish the multi-timescale characteristics of pollution diffusion, making it difficult to capture different dynamic processes such as instantaneous surges and stable diffusion. These methods suffer from poor adaptability to irregular watershed boundaries and ignore the dynamic diffusion patterns of pollution. Summary of the Invention

[0004] To address the problems existing in current technologies, this invention provides a method for tracing the source of surface water pollution in watersheds based on multi-source data. This method involves: collecting and preprocessing historical multi-source data; obtaining a binary mask matrix and a standardized grid data matrix; acquiring a spatial feature tensor matrix using an improved convolutional neural network; extracting dynamic temporal data sub-matrices and obtaining three sets of temporal pooling feature tensors using the improved convolutional neural network; concatenating the spatial feature tensor matrix and the three sets of temporal pooling feature tensors to obtain a spatiotemporal integrated feature matrix; training the improved convolutional neural network with historical pollution-labeled data combined with the spatiotemporal integrated feature matrix; and inputting current multi-source data from the target watershed into the trained improved convolutional neural network to obtain the source tracing results. This invention, through standardized integration of multi-source data, can solve the problems of data heterogeneity and spatiotemporal misalignment in traditional source tracing, achieving precise location of pollution sources.

[0005] This invention employs the following technical solution: a method for tracing the source of surface water pollution in watersheds based on multi-source data, comprising: Historical multi-source data of the target watershed are collected and preprocessed; the historical multi-source data includes water quality data, geographic data, hydrological data, and watershed boundary data. The target watershed is divided into multiple grids to obtain the binary mask matrix of the target watershed; Spatiotemporal alignment is performed on the preprocessed historical multi-source data to construct a standardized grid data matrix; The standardized grid data matrix and the binary mask matrix are input into the improved convolutional neural network, and processed by the spatial feature extraction module and adaptive convolution kernel in the improved convolutional neural network to obtain the spatial feature tensor matrix. Based on the standardized grid data matrix, a dynamic temporal data sub-matrix is ​​extracted. The dynamic temporal data sub-matrix is ​​then input into an improved convolutional neural network. The temporal feature extraction module in the improved convolutional neural network processes the data to obtain three sets of temporal pooling feature tensors. The spatiotemporal integrated feature matrix is ​​obtained by concatenating channels based on the spatial feature tensor matrix and the three sets of temporal pooling feature tensors. Historical pollution labeling data of the target watershed is obtained as label data, and the improved convolutional neural network is trained based on the spatiotemporal integrated feature matrix and the label data; The current multi-source data of the target watershed is obtained as the source-tracing data. The source-tracing data is then input into a trained and improved convolutional neural network to obtain the source-tracing results.

[0006] Furthermore, historical multi-source data of the target watershed are collected and preprocessed, specifically including: Water quality data and hydrological data are adopted Outlier removal should be performed in accordance with the principle. Geographic data is numerically encoded to obtain quantified geographic data; Missing values ​​were filled in for the watershed boundary data.

[0007] Furthermore, the spatial feature tensor matrix is ​​obtained by processing the spatial feature extraction module and adaptive convolution kernel in the improved convolutional neural network, specifically: Preliminary feature extraction is performed on the standardized grid data matrix using the two-dimensional convolutional layer in the spatial feature extraction module to obtain a preliminary spatial feature tensor. The preliminary spatial feature tensor is masked according to the binary mask matrix to obtain the masked spatial feature tensor. Obtain hydrological data from the standardized grid data matrix, and calculate the hydrological flow direction index based on the hydrological data; The weights of the adaptive convolution kernel are adjusted according to the hydrological flow direction index; The spatial feature tensor matrix is ​​obtained by performing convolution operation on the masked spatial feature tensor using an adaptive convolution kernel with adjusted weights.

[0008] Furthermore, a dynamic time-series data sub-matrix is ​​extracted based on the standardized grid data matrix, specifically as follows: Extract hydrological and water quality data from the standardized grid data matrix; The hydrological data includes: flow rate, flow velocity, and flow direction; The water quality data includes chemical oxygen demand, ammonia nitrogen content, and total phosphorus content; A dynamic time-series data submatrix is ​​constructed based on the hydrological data and the water quality data.

[0009] Furthermore, the temporal feature extraction module in the improved convolutional neural network is used for processing to obtain three sets of temporal pooling feature tensors, specifically: The temporal feature extraction module includes three sets of parallel one-dimensional convolutional kernels; The hydrological data and water quality data in the dynamic time series data submatrix are pre-processed using three sets of parallel one-dimensional convolutional kernels to obtain three sets of corresponding preliminary time series feature tensors. The three sets of preliminary temporal feature tensors are compressed using a one-dimensional max pooling layer to obtain three sets of temporal pooling feature tensors.

[0010] Furthermore, channel concatenation is performed based on the spatial feature tensor matrix and the three sets of temporal pooling feature tensors to obtain a spatiotemporal integrated feature matrix, including: The spatial feature tensor matrix is ​​compressed in both spatial and temporal dimensions through pooling layers to obtain a space-temporal dual-pooling feature matrix. The three sets of temporal pooling feature tensors are compressed in time dimension through pooling layers, and the attention weight of each time step in the three sets of temporal pooling feature tensors is calculated through a temporal attention mechanism. Three sets of key temporal pooling feature tensors are obtained by filtering the attention weights at each time step in the three sets of temporal pooling feature tensors; The spatial-temporal dual-pooling feature matrix and the three sets of key temporal pooling feature tensors are respectively subjected to spatial dimension alignment and temporal dimension alignment. Based on the three sets of key temporal pooling feature tensors aligned in the spatial dimension, they are concatenated in the channel dimension to obtain a unified key temporal feature matrix. Based on the spatial-temporal dual-pooling feature matrix aligned in the time dimension and the unified key temporal feature matrix, they are concatenated in the channel dimension to obtain the spatiotemporal integrated feature matrix.

[0011] Furthermore, the target watershed is divided into multiple grids to obtain the binary mask matrix of the target watershed, specifically: Geographic Information System (GIS) software is used to divide the target watershed into multiple grid cells according to a preset size. Determine whether each grid cell is located within the target watershed based on the watershed boundary data; When a grid cell is located within the target watershed, the grid cell is assigned a value of 1; otherwise, it is assigned a value of 0. After assigning values ​​to all grid cells, the binary mask matrix of the target watershed is obtained.

[0012] The beneficial effects of this invention are as follows: By collecting and standardizing multi-source data, this invention constructs a standardized watershed grid data matrix and binary mask matrix, providing a unified and standardized spatiotemporal data foundation for subsequent analysis; by utilizing the adaptive spatial feature extraction capability of an improved convolutional neural network, it effectively matches the irregular boundaries and hydrodynamic laws of the watershed, thereby accurately depicting the spatial diffusion path of pollutants; through multi-scale temporal convolution and attention filtering mechanisms, it deeply captures the spatial correlation and temporal nodes of pollution diffusion, significantly improving the accuracy of source tracing; finally, through efficient spatiotemporal feature fusion, it achieves accurate location of pollution sources, avoiding the blindness and high cost of traditional investigations. The output source tracing results can accurately locate pollution sources and clarify the pollution period, and can also provide a basis for subsequent long-term monitoring, reducing the pollution control costs of ecological and environmental departments and helping the rapid recovery and sustainable management of watershed water quality. Attached Figure Description

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

[0014] Figure 1 This is a schematic diagram of the watershed surface water pollution source tracing method based on multi-source data according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an improved convolutional neural network structure according to an embodiment of the present invention. Detailed Implementation

[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] A schematic diagram of the watershed surface water pollution source tracing method based on multi-source data according to an embodiment of the present invention is shown below. Figure 1 As shown, it includes: Historical multi-source data of the target watershed were collected and preprocessed. The historical multi-source data collected in this embodiment of the invention includes water quality data, geographic data, hydrological data, and watershed boundary data. Specifically, water quality data can include key pollution indicators such as chemical oxygen demand (COD), ammonia nitrogen, and total phosphorus. This data can be collected through automatic monitoring stations with minute-level real-time monitoring, and the data can be uploaded and updated every 15 minutes. Alternatively, it can be obtained through periodic manual sampling, with a sampling frequency of once a month. Geographic data can specifically include the slope and land use type (such as industrial land, cultivated land, green space, etc.) of various areas within the target watershed. This data can be obtained through a geographic information platform, such as GIS, to obtain SHP vector files or Ge... oTIFF format imagery is acquired and updated annually. Temporary data collection and updates are initiated when significant land use changes occur within the target watershed, such as the construction of new industrial parks or large-scale land development. Hydrological data specifically includes real-time water flow, velocity, and direction for each grid unit within the target watershed. These grid units are further subdivided in subsequent steps. Data can be collected regionally, and after grid unit division, the data from each region is assigned corresponding grid unit values. This data is acquired through hydrological station observation records, using an hourly monitoring frequency, with data uploaded every hour on the hour. Watershed boundary data includes detailed vector boundary files of tributaries and lakes within the target watershed. This data can be retrieved from the water resources department's database and is reviewed and updated quarterly, with a focus on verifying changes that may affect the watershed boundary, such as water conservancy project construction or river diversion, ensuring that the watershed boundary data covers the entire spatial range and influencing factors involved in pollution diffusion.

[0017] In this embodiment of the invention, the method for preprocessing historical multi-source data includes: preprocessing water quality data and hydrological data using... Outlier removal is performed according to the principles; geographic data is numerically encoded to obtain quantified geographic data; and missing values ​​are filled in for watershed boundary data.

[0018] In a specific embodiment of the present invention, the geographic data is numerically encoded in order to transform non-numerical geographic data such as land use type into quantitative data that can be used for calculation. The present invention provides a numerical encoding method as follows: if the land use type is industrial land, its encoding value is 3; if the land use type is cultivated land, its encoding value is 2; and if the land use type is green space, its encoding value is 1.

[0019] After performing corresponding preprocessing on the historical multi-source data, all data are further normalized to compress the values ​​of each type into the [0,1] interval, thereby eliminating the impact of differences in data volume on subsequent feature extraction.

[0020] The target watershed is divided into multiple grids to obtain the binary mask matrix of the target watershed; In this embodiment of the invention, geographic information system (GIS) software is used to divide the target watershed into multiple grid units according to a preset size. ArcGIS software is used to divide the entire watershed into multiple regular grid units of a fixed size of 1km × 1km. Each grid unit is assigned a unique ID number, thus forming a gridded spatial unit system covering the target watershed. Simultaneously, watershed boundary data from historical multi-source data is used to determine the attributes of each grid unit, i.e., whether each grid unit is located within the target watershed based on the watershed boundary data. When a grid unit is located within the target watershed, it is assigned a value of 1; otherwise, it is assigned a value of 0. Based on this, a binary mask matrix of the target watershed is obtained after assigning values ​​to all grid units. This matrix has dimensions of N × N, with valid areas represented by 1s and invalid areas represented by 0s.

[0021] Spatiotemporal alignment is performed on the preprocessed historical multi-source data to construct a standardized grid data matrix; In this embodiment of the invention, with a fixed time step of 1 hour, water quality data, geographic data, and hydrological data from historical multi-source data are integrated according to the correspondence between grid unit ID and time step to construct an initial data matrix. Among them, geographic data usually does not change significantly in the short term, so it remains stable at each time step after being associated with each grid unit ID. Water quality data and hydrological data need to be updated according to the corresponding time step to ensure that each grid unit can contain complete multi-source data information at each time step, achieving spatiotemporal alignment. Finally, a standardized grid data matrix is ​​output. The dimension of this matrix is ​​the number of grids N × time step T (72h) × number of features K (containing a total of 8 items, including 3 water quality data indicators such as chemical oxygen demand, ammonia nitrogen content, and total phosphorus content; 2 geographic data indicators such as slope and land use type; and 3 hydrological data indicators such as flow rate, velocity, and direction). Together with the watershed binary mask matrix, it constitutes the structured data foundation for the input of the subsequent improved convolutional neural network.

[0022] The standardized grid data matrix and binary mask matrix are input into the improved convolutional neural network, and processed by the spatial feature extraction module and adaptive convolution kernel in the improved convolutional neural network to obtain the spatial feature tensor matrix. In this embodiment of the invention, the structural schematic diagram of the improved convolutional neural network is as follows: Figure 2 As shown, its conventional structure includes an input layer, a convolutional layer, a pooling layer, a fusion layer, a fully connected layer, and an output layer. The improvement of this invention lies in introducing a spatial feature extraction module and an adaptive convolutional kernel in a cascaded spatial feature extraction structure in the convolutional layer, as well as a temporal feature extraction module connected in parallel with it. Then, after max pooling in the pooling layer, spatiotemporal feature fusion is performed in the fusion layer.

[0023] In this embodiment of the invention, the cascaded spatial feature extraction structure of the spatial feature extraction module and the adaptive convolutional kernel is first described. After the standardized grid data matrix and the binary mask matrix are input into the improved convolutional neural network, the spatial feature extraction module of the convolutional layer first processes the standardized grid data matrix. Based on the two-dimensional convolutional layer in the spatial feature extraction module, the standardized grid data matrix is ​​initially extracted to obtain the preliminary spatial feature tensor.

[0024] In one specific embodiment of the present invention, the spatial feature extraction module extracts N×K dimension slices from the grid cell data at each time step in the standardized grid data matrix, thereby preserving the integrity of the 72-hour time series. Then, it performs convolution processing using 3×3 two-dimensional convolution kernels (with the number set to 32). For example, by combining the spatial distribution of water quality data indicators such as chemical oxygen demand and ammonia nitrogen, it captures the pollution diffusion trend of upstream grids to downstream grids. At the same time, it incorporates geographical features such as slope and land use type to strengthen the influence weight of different terrains (such as steep slope areas) on pollution propagation. Finally, after processing with the ReLU activation function, a preliminary spatial feature tensor is generated with a dimension of N×T×32, where each channel corresponds to a spatial association mode, laying the foundation for subsequent refined processing.

[0025] In this embodiment of the invention, the preliminary spatial feature tensor is further masked according to the binary mask matrix to obtain the masked spatial feature tensor. Specifically, the binary mask matrix and the preliminary spatial feature tensor are multiplied element by element to make the mask matrix correspond to the spatial feature tensor matrix in spatial dimension, thereby directly shielding the feature signals of invalid areas and retaining only the feature calculation of water areas or effective monitoring areas.

[0026] The embodiments of the present invention further obtain hydrological data in a standardized grid data matrix, and extract a quantitative index reflecting the water flow connectivity between grids, namely the hydrological flow direction index, from the hydrological data to adjust the weight of the adaptive convolution kernel. The specific calculation method of the hydrological flow direction index can refer to any one of the prior art, and the embodiments of the present invention are not limited thereto. In one specific embodiment of the present invention, the weights of the adaptive convolution kernel are adjusted by the hydrological flow direction index, according to the formula... , base weight Adjusted to To enhance the feature weight of pollution diffusion along water flow, the weight adjustment coefficient was determined through extensive experiments and parameter optimization. Specifically, based on historical hydrological data and pollution diffusion monitoring data, multiple sets of weight adjustment coefficients ranging from 0.1 to 0.5 were set for comparative experiments. During the experiments, the accuracy, recall, and fit with actual monitoring data of pollution diffusion feature extraction were used as evaluation indicators. When the model captured the pollution diffusion features in the direction of water flow most accurately and the extracted features had the highest degree of fit with actual hydrological patterns, that value was selected as the weight adjustment coefficient.

[0027] After completing matrix processing and dynamic adjustment of convolution kernel weights, the masked spatial feature tensor is convolved using the adjusted adaptive convolution kernel. In this embodiment of the invention, 32 3×3 two-dimensional convolution kernels are used, and the nonlinear transformation is completed through the ReLU activation function. Finally, a spatial feature tensor matrix focusing on the actual pollution diffusion in the watershed is generated. This matrix not only adapts to the boundary features of irregular watersheds, but also strengthens the directional attributes of pollution propagation through hydrological connectivity weights, providing accurate spatial dimension support for subsequent temporal feature fusion and source tracing inference.

[0028] Dynamic temporal data sub-matrices are extracted from the standardized grid data matrix. These sub-matrices are then input into an improved convolutional neural network. The network is processed by the temporal feature extraction module to obtain three sets of temporal pooling feature tensors. In this embodiment of the invention, the first step is to extract time-related features from the standardized grid data matrix as input. Specifically, from the standardized grid data matrix with N grids × T time steps × K features, three water quality indicators (chemical oxygen demand, ammonia nitrogen, and total phosphorus) and three hydrological indicators (flow rate, velocity, and direction) are extracted to form a dynamic time-series data submatrix with dimensions N × T × 6. This submatrix is ​​then input into the time-series feature extraction module of the improved convolutional neural network for processing.

[0029] In this embodiment of the invention, the temporal feature extraction module includes three sets of parallel one-dimensional convolutional kernels; the kernel sizes are 3, 5, and 7, corresponding to time windows of 1-3h, 1-5h, and 1-7h, respectively; the hydrological data and water quality data in the dynamic temporal data submatrix are preliminarily processed according to the three sets of parallel one-dimensional convolutional kernels to obtain three sets of preliminary temporal feature tensors, specifically: for the three water quality data indicators, the concentration change rate, mean, and cumulative value within different application windows are extracted through one-dimensional convolution; for the three hydrological data indicators, the focus is on the temporal patterns such as flow fluctuation amplitude, flow velocity change trend, and flow direction stability. Each set of convolutional kernels is set with 16 channels. After activation by the ReLU function, three sets of preliminary temporal feature tensors are generated. Then, the three sets of preliminary temporal feature tensors are compressed through a one-dimensional max pooling layer to obtain three sets of temporal pooling feature tensors.

[0030] The spatiotemporal integrated feature matrix is ​​obtained by concatenating channels based on the spatial feature tensor matrix and three sets of temporal pooling feature tensors. In this embodiment of the invention, for the spatial feature tensor matrix, a 2×2 two-dimensional max pooling is first used to compress the spatial dimension, reducing the number of grids N to N / 2 to retain the core region of spatial correlation. This core region refers to the grid of the main path of pollution diffusion, thus obtaining a spatial pooling feature tensor matrix (dimension N / 2×T×32). Then, a one-dimensional temporal max pooling is performed on this tensor matrix to compress the time step from 72h to 36h, filtering out redundant fluctuations in the time dimension, and finally outputting a spatial-temporal dual-pooling feature matrix, at which point the matrix dimension is N / 2×36×32.

[0031] In this embodiment of the invention, for three sets of temporal pooling feature tensors, a one-dimensional max pooling layer is applied to each set of temporal feature tensor matrices along the time dimension. The size of the pooling kernel is set to 2 and the step size to 1. For each channel of each grid cell, the maximum value of the time dimension is extracted window by window. For example, for a certain grid cell in the "concentration change rate" channel, the feature value of time step 1-2 is [0.8, 1.5], then the output of this window after pooling is 1.5; the feature value of time step 2-3 is [1.5, 1.1], and the output is 1.5, and so on. Through this peak preservation operation, the time dimension of each set of temporal feature tensor matrices is compressed from 66h to 66−2+1=65h (i.e. T−7), while the spatial dimension N and the number of channels 16 remain unchanged. Finally, three sets of temporal pooling feature tensors are generated, each with a dimension of N×(T−7)×16.

[0032] After pooling, the data enters the fusion layer of the improved convolutional neural network for further processing. First, a temporal attention mechanism is selected, which calculates attention weights by extracting data sequences from the standardized grid data matrix that spatiotemporally match the three sets of temporal pooling feature tensors. In this embodiment, water quality data indicators and hydrological data indicators are selected. Specifically, the water quality data indicators refer to the peak water concentration sequence, and the hydrological data indicators refer to the average hydrological flow velocity sequence. Attention weights are then applied. The expression for calculation is: in, The average flow velocity is t. A higher flow velocity indicates a stronger time-sensitive diffusion of pollution, which requires close monitoring. The peak water quality concentration at time step t represents the maximum concentration. A higher concentration indicates greater reference value for source tracing at that time step, and thus a higher weighting. For normalization operations, Let be the weight of the i-th grid at time step t.

[0033] In the above formula, and This can be achieved based on multiple sets of experimental comparisons and prior knowledge of the domain. For example, the model can be trained and validated by setting different combinations of weighting coefficients (such as 0.5-0.5, 0.7-0.3, etc.), with water quality prediction accuracy and pollution event capture sensitivity as evaluation indicators. At the same time, combined with knowledge of the hydrological domain, considering that flow velocity directly affects the diffusion range and speed of pollutants, while peak water quality concentration directly reflects the degree of pollution, the two have different impacts on the importance of features. After multiple rounds of experimental iterations and performance analysis, the model performs best in comprehensive evaluation indicators and can effectively capture key pollution moments and water flow change characteristics, thereby finally determining the coefficient combination.

[0034] After calculating the attention weights, the weight matrix (dimension N×(T−7)) is multiplied element-wise with the three sets of temporal pooling feature tensor matrices respectively, so that the features of high-weight time steps are enhanced, such as the moment when the pollution concentration suddenly increases or the period of high flow rate. The redundant features of low-weight time steps are suppressed, such as the period when the concentration is stable and there is no fluctuation and the flow rate is close to 0. Three sets of weighted temporal feature tensor matrices are generated.

[0035] In this embodiment of the invention, key temporal features are further screened from the three sets of weighted temporal feature tensor matrices. Specifically, each set of weighted temporal feature tensors is sorted in descending order according to the weight of the time step, and the top 20 time steps with the highest weights are selected. The number of selections can be set according to the source tracing accuracy requirements. In this embodiment of the invention, it is believed that 20 time steps can cover key pollution nodes within 72 hours, while avoiding information loss due to excessive compression of the time dimension. The feature data corresponding to these time steps are extracted. At this time, the time dimension of the three sets of temporal feature tensor matrices is compressed from 65 hours to 20 hours, while the spatial dimension N and the number of channels remain unchanged. Finally, three sets of key temporal feature tensor matrices are generated, each with a dimension of N×20×16. These three sets of key temporal feature tensor matrices not only retain the core temporal patterns at different scales, but also focus on the most valuable time nodes for pollution source tracing through an attention mechanism, laying the foundation for subsequent alignment and splicing with the spatial feature matrix to generate a spatiotemporal integrated feature matrix.

[0036] For the three sets of key temporal feature tensor matrices, their spatial dimensions need to be aligned with the dimensions of the spatial-temporal dual-pooling feature matrices. Therefore, this embodiment of the invention uses 2×2 two-dimensional max pooling to compress the spatial dimensions of each set of key temporal feature tensor matrices, and filters the core temporal feature matrices within each 2×2 grid window, thereby reducing the number of grids in the key temporal feature tensor matrices from N to N / 2, generating three sets of spatially adapted key temporal feature tensor matrices. At the same time, for the time dimension 36h of the spatial-temporal dual-pooling feature matrices, combined with the 20 key time steps of the three sets of key temporal feature tensor matrices, time intervals that completely match the 20 key time steps are cropped from 36h to obtain time-adapted spatial-temporal dual-pooling feature matrices. At this time, the spatial dimensions and time dimensions of the two types of feature matrices are completely unified, satisfying the basic conditions for splicing.

[0037] In this embodiment of the invention, channel splicing and integration of the feature matrix are performed. First, the three sets of spatially adapted key temporal feature tensor matrices are spliced ​​along the channel dimension, merging the 16 channels of the three sets of tensor matrices into 16×3=48 channels to form a unified key temporal feature matrix. Different channels correspond to multi-scale temporal features with kernel sizes of 3, 5, and 7 respectively (e.g., the 3-channel group retains short-term concentration mutations, and the 7-channel group retains long-term pollution trends), thereby ensuring the integrity of the temporal features. Subsequently, the temporally adapted spatial-temporal dual-pooling feature matrix and the unified key temporal feature matrix are finally spliced ​​along the channel dimension. The number of channels after merging is 32+48=80, finally generating a spatiotemporally integrated feature matrix with a dimension of N / 2×20×80.

[0038] Historical pollution annotation data of the target watershed is obtained as label data, and the improved convolutional neural network is trained based on the spatiotemporal integrated feature matrix and the label data; In this embodiment of the invention, after processing historical multi-source data, the final step is to train an improved convolutional neural network. The spatiotemporal integrated feature matrix is ​​used as the core input, and the labeled data of historical pollution events in the target watershed is used as the tag data. This tag data includes the grid ID of known pollution sources, the precise time period of pollution occurrence, and the contribution rate percentage of each pollution source. During training, the spatiotemporal integrated feature matrix is ​​first input into the subsequent fully connected layer, and two hidden layers are set with 128 and 64 neurons respectively. Both layers use the ReLU activation function to enhance the nonlinear feature mapping. Then, a multi-task loss function is executed. For the task of locating pollution source grid IDs and occurrence times, cross-entropy loss is used to calculate the difference between the predicted category and the true label. For the contribution rate prediction task, mean squared error (MSE) is used to measure the deviation between the predicted value and the actual contribution rate. The two types of losses are weighted and summed at a ratio of 1:1.2 to obtain the total loss.

[0039] The optimizer used is Adam, with an initial learning rate of 0.001, which is decayed to 0.8 every 10 iterations to balance convergence speed and accuracy. The dataset is divided into training and validation sets in a 7:3 ratio, and iterative training is conducted for 50-80 rounds. During this period, hyperparameters such as the number of convolutional kernels and pooling stride are dynamically adjusted based on the source tracing metrics of the validation set. The source tracing metrics can be localization error ≤ 1 grid and contribution rate error ≤ 10%. The training continues until the loss of the improved convolutional neural network on the validation set is stable and the source tracing accuracy meets the target, thus completing the training of the improved convolutional neural network.

[0040] The current multi-source data of the target watershed is obtained as the source data to be traced. The source data to be traced is then input into a trained and improved convolutional neural network to obtain the source tracing results.

[0041] In this embodiment of the invention, the current multivariate data of the target watershed is obtained as the source tracing data. Then, the preprocessed source tracing data is input into the trained improved convolutional neural network. Through the spatial feature extraction module, adaptive convolutional kernel, and temporal feature extraction module of the convolutional layer, the data passes through the pooling layer and fusion layer, and then through the fully connected layer for inference. Finally, the output layer outputs the preliminary source tracing results, including the grid IDs of the top three suspected pollution sources, the key time period of pollution occurrence, and the contribution rate of each pollution source, and the confidence level of the results is labeled.

[0042] Specifically, in the pollution source grid localization stage, the fully connected layer outputs the pollution source attribution probability of all grids through Softmax activation, taking the highest probability value of the first three suspected pollution source grids. For example, the attribution probability of grid A is 0.85, and the attribution probability of grid B is 0.78. In the pollution period determination stage, the time-series prediction probability corresponding to the key period is extracted. For example, the period matching probability of 12-14 is 0.91. At the same time, the variance of the probability distribution output by the contribution rate regression is combined. The smaller the variance, the more stable the prediction, and the higher the corresponding probability weight. For example, the variance of a contribution rate of 65% is 0.02, corresponding to a probability coefficient of 0.95. Subsequently, the probability is weighted and summed according to the ratio of "grid probability (weight 0.4) + period probability (weight 0.3) + contribution rate stability coefficient (weight 0.3)," and then multiplied by the average source tracing accuracy of the model validation set for correction. Finally, the result is normalized to the 0%~100% range to obtain the confidence level. For example, the confidence level of grid A in the 12-14 period is: (0.85×0.4 + (0.91×0.3 + 0.95×0.3)×92%≈ 92%.

[0043] In another specific embodiment of the present invention, after the source tracing results are output through the improved convolutional neural network, they can be transformed into intuitive charts through a visualization module, including: a pollution diffusion heat map (overlaid on a watershed GIS map, with color depth indicating the pollution concentration propagation path), a time-series trend map (showing the water quality index changes and contribution rate curves of suspected pollution source grids within 72 hours), and a hydrological correlation map (combining flow velocity and direction to indicate the time-distance relationship of pollution diffusion). This allows on-site personnel to conduct on-site verification based on the visualization results, collect supplementary monitoring data for suspected pollution source grids, and simultaneously feed the feedback information into the improved convolutional neural network. This allows for fine-tuning of the weight coefficients of the time-series attention mechanism screening stage and the weight coefficients of the adaptive convolution calculation, iteratively correcting the source tracing results until the deviation between the source tracing results and the on-site situation is ≤1 grid and the contribution rate error is ≤8%.

[0044] Finally, all information is integrated to form a source tracing report, which contains four core parts: basic data description, which may include statistical characteristics of water quality and hydrological data for the period to be traced, and an overview of the watershed grid and mask matrix; improved convolutional neural network source tracing results, specifically the location, time period, contribution rate of the top three pollution sources, and visualization charts; on-site verification records and remediation recommendations, which are control measures proposed based on the characteristics of the pollution sources, such as strengthening nighttime sewage discharge monitoring of enterprises around grid C or increasing the frequency of downstream water quality sampling during high flow rate periods, thereby providing environmental protection departments with a feasible basis for pollution control decisions.

[0045] In one specific embodiment of the present invention, the Qingchuan River basin is taken as the implementation object, with a total area of ​​approximately 100 km². 2The river flows through three townships, with the main pollution sources being industrial parks along the river and agricultural non-point source pollution. During a 72-hour monitoring period from June 10th to 13th, 2025, downstream monitoring stations detected persistently excessive COD concentrations. The method proposed in this invention was used to trace the source, and the specific implementation process is as follows: First, data collection and preprocessing were performed, collecting minute-level data (COD, ammonia nitrogen, total phosphorus, uploaded every 15 minutes) from 5 automatic water quality monitoring stations within the basin; hourly data (flow rate, velocity, direction, recorded on the hour) from 3 hydrological stations; the latest 2025 geographic data (slope, land use type, with the riverside industrial park coded as industrial land, code 3; surrounding cultivated land coded as 2; riverbank green space coded as 1) was obtained through ArcGIS; and a basin boundary vector file (containing the two tributaries flowing into the main channel) was generated. Then, the following methods were employed: One outlier in the water quality monitoring was removed as a rule. Two missing hydrological data points were filled with the mean of adjacent grids within the same time period. Finally, all data were compressed to the [0, 1] interval using Min-Max normalization. The watershed was divided into 100 grids (N=100) with a 1km×1km grid size. A 100×100 binary mask matrix was generated, in which 42 grids covered by the main channel and tributaries were marked as valid area 1, and the remaining land grids were marked as 0. The final standardized grid data matrix was formed with a dimension of 100×72×8, in which 8 features included 3 water quality data, 2 geographic data, and 3 hydrological data.

[0046] Furthermore, the improved convolutional neural network was trained and the source data was processed. The improved convolutional neural network was trained based on historical pollution event data of the Qingchuan River Basin in 2024. Then, the improved convolutional neural network was used to conduct source tracing and result optimization. The standardized grid data from June 10 to 13, 2025 was input into the trained model, and the preliminary output results showed that the top three suspected pollution source grids were grid 28 (north bank of the main river, industrial land), grid 35 (confluence of tributaries, farmland), and grid 41 (east side of the riverbank, industrial land). The critical period of pollution occurrence was from 14:00 to 16:00 on June 11 (the peak period of COD concentration), with contribution rates of 62%, 23%, and 15%, respectively, and confidence levels of 94%, 88%, and 85%, respectively.

[0047] The visualization module was then used to generate a pollution diffusion heat map. The heat map showed that the COD concentration in grid 28 diffused southward along the main river channel, covering 15 downstream grids within 12 hours. The time-series trend chart showed that the COD concentration in grid 28 suddenly increased to 180 mg / L at 14:00 on June 11, which was consistent with the sewage discharge pattern during the off-hours of the industrial park. The on-site inspection team went to grid 28 and found that the valve of the sewage outlet of a chemical enterprise along the river was not closed tightly, indicating illegal discharge. The COD concentration of the water sample collected from the sewage outlet was 280 mg / L. At the same time, it was confirmed that there was no centralized sewage discharge in the farmland of grid 35. This situation was judged to be an overestimation of the contribution of agricultural non-point source pollution. This feedback information was input into the model, and the attention weights were fine-tuned. The corrected results were that the contribution rate of grid 28 was 75% (confidence 96%), the contribution rate of grid 41 was 20% (confidence 87%), and the contribution rate of grid 35 was 5% (confidence 82%), which perfectly matched the on-site situation.

[0048] Finally, a source tracing report was generated: The report included basic data (72-hour average COD of 85 mg / L, with 42 out of 100 grids in the watershed being effective areas), model results (with heat maps and time series diagrams, clearly identifying grid 28 as the main pollution source, and 14:00-16:00 on June 11 as the critical discharge period), on-site verification records (evidence of illegal discharge by chemical enterprises, water sample test reports), and treatment recommendations (ordering enterprises to rectify their discharge outlets, implementing 24-hour online monitoring of enterprises around grid 28, and adding 2 water quality early warning stations downstream of the main river). After the report was submitted to the local ecological and environmental bureau, the enterprises completed rectification in just 3 days, and the COD concentration in the watershed dropped back to 35 mg / L, achieving precise pollution control.

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

Claims

1. A method for tracing the source of surface water pollution in a river basin based on multi-source data, characterized in that, The method comprises the following steps: Collecting historical multi-source data of a target basin and preprocessing the data; The historical multi-source data includes water quality data, geographical data, hydrological data, and basin boundary data; Dividing the target basin into multiple grids to obtain a binary mask matrix of the target basin; Performing spatio-temporal alignment on the preprocessed historical multi-source data to construct a standardized grid data matrix; Inputting the standardized grid data matrix and the binary mask matrix into an improved convolutional neural network, processing them through a spatial feature extraction module and an adaptive convolution kernel in the improved convolutional neural network, and obtaining a spatial feature tensor matrix; Extracting a dynamic time series data sub-matrix from the standardized grid data matrix, inputting the dynamic time series data sub-matrix into the improved convolutional neural network, and processing it through a time series feature extraction module in the improved convolutional neural network to obtain three groups of time series pooling feature tensors; Performing channel splicing on the spatial feature tensor matrix and the three groups of time series pooling feature tensors to obtain a spatio-temporal integrated feature matrix; Obtaining historical pollution labeling data of the target basin as label data, training the improved convolutional neural network according to the spatio-temporal integrated feature matrix and the label data; Obtaining current multi-source data of the target basin as to-be-traced data, inputting the to-be-traced data into the trained improved convolutional neural network, and obtaining a tracing result.

2. The method of claim 1, wherein: The method for collecting historical multi-source data of a target basin and preprocessing the data comprises the following steps: The water quality data and hydrological data are subjected to outlier rejection processing according to the following principles: Principle 1: The data of the same type of the same day of the same year are subjected to outlier rejection processing. Performing numerical encoding processing on the geographical data to obtain quantized geographical data; Performing missing value supplement processing on the basin boundary data.

3. The method of claim 1, wherein: Processing through the spatial feature extraction module and the adaptive convolution kernel in the improved convolutional neural network to obtain a spatial feature tensor matrix, specifically: Performing preliminary feature extraction on the standardized grid data matrix through a two-dimensional convolution layer in the spatial feature extraction module to obtain a preliminary spatial feature tensor; Performing mask processing on the preliminary spatial feature tensor according to the binary mask matrix to obtain a masked spatial feature tensor; Obtaining hydrological data in the standardized grid data matrix, calculating a hydrological flow direction index according to the hydrological data; Adjusting the weight of the adaptive convolution kernel according to the hydrological flow direction index; Performing convolution operation on the masked spatial feature tensor by using the adaptive convolution kernel with adjusted weight to obtain a spatial feature tensor matrix.

4. The method of claim 1, wherein: Extracting a dynamic time series data sub-matrix from the standardized grid data matrix, specifically: Extracting hydrological data and water quality data in the standardized grid data matrix; The hydrological data includes flow rate, flow velocity, and flow direction; The water quality data includes chemical oxygen demand, ammonia nitrogen content, and total phosphorus content; Constructing a dynamic time series data sub-matrix according to the hydrological data and the water quality data.

5. The method of claim 4, wherein: Processing through the time series feature extraction module in the improved convolutional neural network to obtain three groups of time series pooling feature tensors, specifically: The time series feature extraction module includes three groups of parallel one-dimensional convolution kernels; Respectively processing the hydrological data and the water quality data in the dynamic time series data sub-matrix through the three groups of parallel one-dimensional convolution kernels to obtain corresponding three groups of preliminary time series feature tensors; The three groups of preliminary time sequence feature tensors are compressed in feature by a one-dimensional maximum pooling layer to obtain three groups of time sequence pooling feature tensors.

6. The method of claim 1, wherein: According to the spatial feature tensor matrix and the three groups of time sequence pooling feature tensors, channel splicing is performed to obtain a space-time integrated feature matrix, including: The spatial feature tensor matrix is compressed in spatial dimension and time dimension by a pooling layer in sequence to obtain a spatial-time double-pooling feature matrix. The three groups of time sequence pooling feature tensors are compressed in time dimension by a pooling layer, and the attention weight of each time step in the three groups of time sequence pooling feature tensors is calculated by a time sequence attention mechanism. According to the attention weight of each time step in the three groups of time sequence pooling feature tensors, three groups of key time sequence pooling feature tensors are screened. The spatial-time double-pooling feature matrix and the three groups of key time sequence pooling feature tensors are respectively processed in spatial dimension alignment and time dimension alignment. According to the three groups of key time sequence pooling feature tensors after spatial dimension alignment, splicing is performed in channel dimension to obtain a unified key time sequence feature matrix. According to the spatial-time double-pooling feature matrix after time dimension alignment and the unified key time sequence feature matrix, splicing is performed in channel dimension to obtain a space-time integrated feature matrix.

7. The method of claim 1, wherein: The target basin is divided into a plurality of grids to obtain a binary mask matrix of the target basin, specifically: The target basin is divided into a plurality of grid units according to a preset size by using geographic information system software; It is judged whether each grid unit is located in the target basin according to the basin boundary data; When the grid unit is located in the target basin, the grid unit is assigned a value of 1, otherwise a value of 0; After assigning values to all grid units, a binary mask matrix of the target basin is obtained.