A multi-risk phase coupling small watershed risk hidden danger grade evaluation method

By constructing a depth-time two-dimensional matrix and a multi-branch attention mechanism, combined with a long short-term memory network, the problem of risk assessment lagging behind the vertical migration of pollutants in existing technologies is solved, realizing dynamic assessment of soil seepage risk in small watersheds. The assessment results reflect the true physical state of soil pollutants.

CN122388948APending Publication Date: 2026-07-14GUANGXI ZHUANG AUTONOMOUS REGION WATER CONSERVANCY & ELECTRIC POWER SURVEY DESIGN & RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGXI ZHUANG AUTONOMOUS REGION WATER CONSERVANCY & ELECTRIC POWER SURVEY DESIGN & RES INST CO LTD
Filing Date
2026-06-01
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In the control of soil pollution in small watersheds, the existing technology cannot reflect the real physical process of vertical migration of pollutants by assessing the risk level based on a single deep static physicochemical index, resulting in the assessment results lagging behind the actual changes in the state.

Method used

By constructing a depth-time two-dimensional matrix, the asynchronous change features and cross-depth interaction features between shallow topsoil and deep barrier layers are extracted using a multi-branch attention mechanism. Combined with a long short-term memory network to process temporal dependencies, the leakage risk level is output.

Benefits of technology

It enables dynamic assessment of the risk of soil-to-groundwater leakage in small watersheds, eliminates the interference of shallow instantaneous fluctuations on the risk level of deep leakage, and the assessment results closely match the real physical process of vertical migration of soil pollutants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122388948A_ABST
    Figure CN122388948A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of soil pollution control and treatment, and particularly relates to a small watershed risk hidden danger grade evaluation method based on multi-risk coupling. Time series data of soil pore water conductivity, pH value and water content at different depths of the same spatial coordinates of the small watershed are obtained, and a depth-time two-dimensional matrix is constructed. The matrix is input into an encoder containing multiple parallel attention branches, each branch calculates shallow autocorrelation coefficients, deep autocorrelation coefficients and cross-depth cross-correlation coefficients through a learnable weight matrix. The coefficients are weighted and fused to generate a vertical coupling feature vector. The physical resistance process between soil layers at different depths is converted into cross-depth time series correlation features, which eliminates the direct interference of shallow surface soil instantaneous fluctuations on the risk grade of deep seepage, overcomes the evaluation lag defect caused by single-depth static indicators, and realizes the risk hidden danger grade division according to the real physical evolution state of the deep soil.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of soil pollution control and remediation technology, specifically to a method for assessing the risk level of small watersheds with multiple coupled risks. Background Technology

[0002] In the field of soil pollution control and remediation in small watersheds, assessing the risk level of vertical seepage of soil pollutants into groundwater is a prerequisite for implementing containment projects. Existing conventional assessment methods typically employ single-point sampling and static index analysis. In practice, operators excavate soil profiles at designated monitoring points, extract soil samples at a single depth or topsoil layer, and obtain static values ​​such as soil pore water conductivity, pH, and moisture content at that depth through laboratory physicochemical analysis. These static values ​​are then compared with preset fixed thresholds, or the physicochemical indicators obtained in a single instance are input into a conventional static classification model. Based on the data characteristics of a single soil layer at a specific time point, the risk level corresponding to that monitoring point is directly output. This approach treats each monitoring point in the small watershed as an independent static assessment object, relying solely on isolated time points and the physicochemical state at a single depth for judgment.

[0003] The core technical problem with the aforementioned existing solutions lies in the fact that the risk hazard classification based on static physicochemical indicators at a single depth lags significantly behind the actual physical processes of pollutant migration in the soil profile. In real unsaturated soil profiles, the vertical migration of pollutants from the shallow surface to deep groundwater is not instantaneous, but rather is subject to alternating obstruction by different soil textures, pore structures, and geochemical environments. This results in a significant temporal asynchrony between changes in the physicochemical indicators of the shallow topsoil and those of the deep soil. Existing solutions ignore this dynamic physicochemical obstruction process across depths. When shallow data fluctuates instantaneously due to rainfall or surface disturbance, the static model directly outputs the corresponding risk level, while the actual pollution state of the deep soil does not change synchronously. When deep pollutants, after a long period of obstruction and accumulation, actually break through downwards, the shallow data may have already stabilized, causing the assessment model to fail to perceive the abrupt changes in the deep physical state. This static assessment logic, which severs the physical connections between different depths, results in the output risk hazard level failing to reflect the true evolution of vertical seepage. Summary of the Invention

[0004] The purpose of this invention is to provide a method for assessing the risk level of small watersheds with multiple coupled risks, which can effectively solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for assessing the risk level of a small watershed with multiple coupled risks includes: acquiring time-series data of soil pore water conductivity, pH value and water content at different depths under the same spatial coordinates in the small watershed, and constructing the time-series data at different depths under the same spatial coordinates into a depth-time two-dimensional matrix; The depth-time two-dimensional matrix is ​​input into an encoder containing multiple parallel attention branches. The multiple parallel attention branches include a shallow topsoil feature sequence autocorrelation branch, a deep blockage feature sequence autocorrelation branch, and a cross-depth cross-correlation branch of shallow feature sequences to deep feature sequences. Each attention branch calculates its corresponding correlation coefficient through a learnable weight matrix. The correlation coefficients of the outputs of each branch are weighted and fused to generate a vertically coupled feature vector; The vertically coupled feature vector is input into a long short-term memory network to extract temporal dependencies; Input the hidden state vector output by the Long Short-Term Memory Network into the classifier to output the leakage risk level of soil to groundwater in the small watershed.

[0006] Preferably, the step of acquiring time-series data of soil pore water conductivity, pH value and water content at different depths under the same spatial coordinates in a small watershed, and constructing the time-series data of different depths under the same spatial coordinates into a depth-time two-dimensional matrix, includes: at the soil profile of the same spatial coordinates in the small watershed, multiple sets of sensor probes are deployed from the ground surface to above the groundwater level according to a preset depth interval, and each set of sensor probes synchronously collects soil pore water conductivity, pH value and water content at the same time stamp; The three physicochemical index data collected by sensor probes at different depths within a continuous time window are arranged as row vectors in the depth direction and as column vectors in the time direction, and combined to generate the depth-time two-dimensional matrix.

[0007] Preferably, the calculation of the correlation coefficients between the autocorrelation branches of the shallow topsoil feature sequence and the autocorrelation branches of the deep stagnant feature sequence includes: dividing the depth-time two-dimensional matrix into shallow topsoil feature sequences and deep stagnant feature sequences according to a preset depth threshold. In the autocorrelation branch of the shallow topsoil feature sequence, the shallow topsoil feature sequence is subjected to cubic linear mapping to generate a query matrix, a key matrix and a value matrix. The query matrix and the key matrix are multiplied by matrix and then processed by the softmax function to generate a shallow autocorrelation attention weight matrix. In the deep stagnant feature sequence autocorrelation branch, the same mapping and matrix multiplication operations as those in the shallow topsoil feature sequence autocorrelation branch are used to process the deep stagnant feature sequence to generate a deep autocorrelation attention weight matrix.

[0008] Preferably, the calculation of the correlation coefficients of the cross-depth cross-correlation branches of the shallow feature sequence and the deep feature sequence includes: in the cross-depth cross-correlation branches, generating a source query matrix by linear mapping of the shallow topsoil feature sequence, and generating a target key matrix and a target value matrix by linear mapping of the deep blocking feature sequence; Calculate the product of the source query matrix and the transpose of the target key matrix, divide the product by a scaling factor, and input the product into the softmax function to generate a cross-depth cross-correlation attention weight matrix; Multiply the cross-depth cross-correlation attention weight matrix with the target value matrix to output the cross-depth feature interaction matrix as the output of the cross-depth cross-correlation branch.

[0009] Preferably, the step of weightedly fusing the correlation coefficients of the outputs of each branch to generate a vertically coupled feature vector includes: performing global average pooling along the time dimension on the shallow autocorrelation attention weight matrix, the deep autocorrelation attention weight matrix, and the cross-depth cross-correlation attention weight matrix respectively to generate shallow pooling vector, deep pooling vector, and cross-depth pooling vector. The shallow pooling vector, the deep pooling vector, and the cross-depth pooling vector are concatenated along the feature channel dimension. The concatenated vector is then input into a fully connected layer. The shallow pooling vector, the deep pooling vector, and the cross-depth pooling vector are linearly combined using the weight parameters in the fully connected layer to output the vertically coupled feature vector.

[0010] Preferably, the step of inputting the vertically coupled feature vector into a long short-term memory network to extract temporal dependencies, inputting the hidden state vector output by the long short-term memory network into a classifier, and outputting the leakage risk level of soil to groundwater in a small watershed includes: expanding the vertically coupled feature vector according to time steps and inputting it into the input gate, forget gate and output gate of the long short-term memory network; At the last time step, the final hidden state vector of the Long Short-Term Memory network is extracted as the hidden state vector; The hidden state vector is input into the classifier containing two fully connected layers. The first fully connected layer maps the hidden state vector to an intermediate vector of a preset dimension, and the second fully connected layer maps the intermediate vector to the number of output nodes corresponding to the risk level. The leakage risk level is then output through the output nodes.

[0011] Preferably, before generating the depth-time two-dimensional matrix, the method further includes: performing a sliding window truncation on the time-series data of soil pore water conductivity, pH value and water content collected by each group of sensor probes, calculating the interquartile range for the data in each sliding window, removing values ​​outside the upper and lower limits of the interquartile range and supplementing missing values ​​using linear interpolation. The time series data after removing outliers and filling in missing values ​​are normalized by maximum and minimum values. The normalized data are then arranged into row vectors by depth and column vectors by time.

[0012] Preferably, before generating the query matrix, key matrix and value matrix by performing cubic linear mapping on the shallow topsoil feature sequence, the method further includes: obtaining the actual burial depth value of the sensor probe corresponding to each time step in the shallow topsoil feature sequence, and converting the actual burial depth value into a fixed-dimensional depth position encoding vector through sine and cosine functions. The depth location encoding vector is added element-wise to the shallow topsoil feature sequence, and the added feature sequence is input into a linear mapping layer used to generate the query matrix, the key matrix, and the value matrix.

[0013] Preferably, before performing a linear combination of the shallow pooling vector, the deep pooling vector, and the cross-depth pooling vector using the weight parameters in the fully connected layer, the method further includes: inputting the concatenated vector into a sigmoid activation function to generate a gated weight vector with the same dimension as the concatenated vector. The gated weight vector is multiplied element-wise with the concatenated vector, and the element-wise multiplied vector is input into the fully connected layer. The element-wise multiplied vector is linearly combined using the weight parameters in the fully connected layer to output the vertically coupled feature vector.

[0014] Preferably, the step of expanding the vertically coupled feature vector according to time steps and inputting it into the input gate, forget gate and output gate of the long short-term memory network includes: at the current time step, calculating the concatenation vector of the vertically coupled feature vector and the hidden layer state vector of the previous time step, and inputting the concatenation vector into the forget gate for linear transformation and sigmoid activation function processing; During the linear transformation of the forget gate, based on the depth row index value of the data corresponding to the vertical coupling feature vector at the current time step in the depth-time two-dimensional matrix, an adjustment factor that decreases with the depth row index value is superimposed on the bias term of the forget gate. The bias term after superimposing the adjustment factor is substituted into the linear transformation formula of the forget gate to calculate the forget gate output.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention extracts the asynchronous change characteristics and cross-depth interaction characteristics between shallow topsoil and deep stabilizing layers by constructing a depth-time two-dimensional matrix and introducing a multi-branch attention mechanism, thus solving the problem that the risk hazard classification lags behind the actual vertical migration physical process. By deploying sensors at different depths to synchronously collect time-series data and constructing a two-dimensional matrix according to the depth and time dimensions, the continuous change trajectory of soil profile physicochemical indicators in space and time is preserved. Parallel attention branches are used to calculate the shallow layer autocorrelation coefficient, the deep layer autocorrelation coefficient, and the cross-depth cross-correlation coefficient between shallow and deep layers, transforming the physical stabilization process between soil layers at different depths into a mathematically asynchronous correlation. The vertically coupled feature vector generated by weighted fusion contains cross-depth temporal dependency information. Combined with long short-term memory network processing, the final output leakage risk hazard level is based on the actual physical evolution state of deep soil, eliminating the direct interference of instantaneous fluctuations in shallow topsoil on the deep leakage risk level.

[0016] 2. This invention improves the model's adaptability to the actual vertical physical state of soil by introducing depth location encoding and bias adjustment factors into data preprocessing and network structure. Sliding window truncation and interquartile range outlier removal are applied to time-series data to eliminate invalid physical fluctuations caused by environmental interference with the sensor. The actual burial depth of the sensor is converted into a depth location encoding vector using sine and cosine functions and added to the shallow feature sequence, forcing the model to distinguish the physical spatial attributes of different depth levels when calculating attention weights. A gated weight vector is introduced before the fully connected layer for element-wise multiplication, filtering out redundant features from non-critical depths. An adjustment factor that decreases with depth row index is superimposed on the forgetting gate bias term of the Long Short-Term Memory network, reducing the degree of forgetting of the current input and increasing the retention rate of historical time-series states when processing deep soil data, which aligns with the real physical law that deep soil physicochemical indicators change slowly. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the overall process of the multi-risk coupled small watershed risk hazard level assessment method of the present invention. Figure 2 This is a flowchart of the depth-time two-dimensional matrix construction and preprocessing process of the present invention; Figure 3 This is a flowchart of the parallel attention branch correlation coefficient calculation of the present invention; Figure 4 Add a flowchart for the depth location encoding of this invention; Figure 5 This is a flowchart of the vertical coupling feature vector fusion and gating process of the present invention; Figure 6 This is a flowchart of the long short-term memory network feature processing and classification output of the present invention. Detailed Implementation

[0018] 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 some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] Please refer to Figure 1 This embodiment provides a method for assessing the risk level of multiple coupled risks in a small watershed. It focuses on assessing the vertical seepage risk from unsaturated soil to groundwater in a small watershed, acquiring time-series data on soil pore water conductivity, pH value, and moisture content at different depths within the target watershed at the same spatial coordinate. The same spatial coordinate corresponds to a pre-defined single monitoring point within the target watershed. The soil profile at this monitoring point covers the complete unsaturated zone from the surface to above the groundwater level. The time step and continuous acquisition duration of the time-series data are pre-defined based on the rainfall cycle and soil texture type of the target watershed. The time-series data at different depths within the same spatial coordinate are constructed into a depth-time two-dimensional matrix. The row dimension of the depth-time two-dimensional matrix corresponds to different depth levels of the soil profile, and the column dimension corresponds to the continuous acquisition time step of the time-series data. Each element in the matrix corresponds to a combined characteristic value of soil pore water conductivity, pH value, and moisture content collected at a specified depth level and a specified time step.

[0020] The depth-time two-dimensional matrix is ​​input into an encoder containing multiple parallel attention branches. These parallel attention branches include a shallow topsoil feature sequence autocorrelation branch, a deep blocking feature sequence autocorrelation branch, and a cross-depth cross-correlation branch between shallow and deep feature sequences. Each attention branch has an independent learnable weight matrix. Each branch calculates the correlation coefficient corresponding to the input feature sequence using its corresponding learnable weight matrix. The correlation coefficient is output in the form of an attention weight matrix. The input to each branch comes from the depth-time two-dimensional matrix, and the calculation process of each branch is executed independently and in parallel.

[0021] Specifically, the autocorrelation branch of the shallow topsoil feature sequence calculates the autocorrelation relationship of the temporal characteristics of physicochemical indicators in the shallow region of the soil profile, and extracts the feature dependencies between different time steps within the shallow topsoil region; the autocorrelation branch of the deep stagnant feature sequence calculates the autocorrelation relationship of the temporal characteristics of physicochemical indicators in the deep region of the soil profile, and extracts the feature dependencies between different time steps within the deep stagnant region; the cross-depth cross-correlation branch of the shallow feature sequence on the deep feature sequence calculates the cross-depth feature interaction relationship between the shallow topsoil feature sequence and the deep stagnant feature sequence, and extracts the temporal influence of changes in shallow physicochemical indicators on changes in deep physicochemical indicators.

[0022] The correlation coefficients of the outputs of each branch are weighted and fused to generate a vertically coupled feature vector. The weighted fusion process first unifies the dimensions of the attention weight matrices of each branch output, and then linearly combines the dimensions-unified features of each branch using learnable fusion weights to generate a vertically coupled feature vector that simultaneously contains shallow autocorrelation features, deep autocorrelation features, and cross-depth cross-correlation features. The dimension of the vertically coupled feature vector matches the preset input dimension of the temporal processing network.

[0023] Furthermore, the vertically coupled feature vector is input into a Long Short-Term Memory (LSTM) network to extract temporal dependencies. The LSM network processes the vertically coupled feature vector sequentially in units of time steps, retaining long-term temporal dependency features related to leakage risk through a built-in gating structure, filtering out redundant temporal fluctuation features unrelated to leakage risk, and outputting the hidden state vector corresponding to each time step after processing for consecutive time steps.

[0024] The hidden state vector output by the Long Short-Term Memory network is input into a classifier to output the leakage risk level from soil to groundwater in the small watershed. The classifier performs dimensionality mapping on the input hidden state vector, mapping the high-dimensional temporal hidden state features to the output dimension corresponding to the number of risk levels. It outputs the corresponding leakage risk level according to a preset classification rule. The number of leakage risk levels is preset according to the graded treatment requirements of the pollution prevention project in the small watershed.

[0025] Table 1. Dimensional Definitions and Element Composition of a Depth-Time Two-Dimensional Matrix ; In this embodiment, the dimension of the depth-time two-dimensional matrix is ​​represented as follows: Where D is the total number of depth levels, T is the total number of acquisition time steps within a continuous time window, and F is the number of physicochemical index features per time step. Based on the dimensional definitions in Table 1, the temporal variations of physicochemical indexes at different depths of the soil profile are transformed into structured two-dimensional matrix data, fully preserving the distribution trajectory of soil physicochemical features in vertical space and continuous time, providing a structured input foundation for subsequent cross-depth feature extraction.

[0026] In this embodiment, a depth-time two-dimensional matrix is ​​constructed to integrate time-series physicochemical data at different depths. Multiple parallel attention branches are used to extract shallow autocorrelation, deep autocorrelation, and cross-depth cross-correlation features, respectively. After weighted fusion to generate vertical coupling features, a long short-term memory network is used to extract time-series dependencies. Finally, a classifier is used to output the leakage risk level, thus realizing a complete dynamic assessment of the vertical leakage risk of soil in a small watershed. The physical hindrance process between soil layers at different depths is transformed into a quantifiable feature correlation, making the risk assessment results consistent with the real physical process of vertical migration of soil pollutants.

[0027] In a preferred embodiment, reference Figure 2 Multiple sets of sensor probes were deployed at preset depth intervals along a soil profile with the same spatial coordinates within the small watershed, extending from the surface to above the groundwater level. These preset depth intervals were set based on the soil texture stratification results, with smaller intervals in layers showing significant soil texture variations and larger intervals in layers with uniform soil texture. All sensor probes were positioned on the same vertical axis to ensure consistent spatial coordinates and eliminate interference from horizontal soil heterogeneity on the collected data. Each set of sensor probes synchronously collected soil pore water conductivity, pH value, and moisture content at the same time stamp, ensuring strict time synchronization of data collected at different depths and eliminating time offset errors between data at different depths.

[0028] The three physicochemical index data collected by sensor probes at different depths within a continuous time window are arranged as row vectors along the depth direction and as column vectors along the time direction, and combined to generate the depth-time two-dimensional matrix. The row vector corresponding to each depth is generated by concatenating the three physicochemical index data collected by the depth sensor probe at each time step within the continuous time window. The length of the row vector is consistent with the product of the total number of time steps within the continuous time window and the number of features in a single time step. The column vector corresponding to each time step is generated by concatenating the three physicochemical index data collected by all depth sensor probes at that timestamp. The length of the column vector is consistent with the product of the total number of depth levels and the number of features in a single time step.

[0029] Furthermore, before generating the depth-time two-dimensional matrix, a sliding window is used to extract the time-series data of soil pore water conductivity, pH value, and moisture content collected by each set of sensor probes. The window length and sliding step size of the sliding window are preset according to the data fluctuation period. The sliding window continuously extracts the time-series data along the time axis, generating multiple time-series data segments of equal length. For the data within each sliding window, the interquartile range (ICM) is calculated. The ICM is the difference between the upper and lower quartiles of the data within the window. The upper ICM plus a preset multiple is used as the upper threshold, and the lower ICM minus a preset multiple is used as the lower threshold. Values ​​outside the upper and lower ICM limits are identified as outliers and removed. Missing values ​​resulting from the removal of outliers are supplemented using linear interpolation. The linear interpolation uses the two most recent valid values ​​before and after the missing value as endpoints, and calculates the supplemented value according to the time position of the missing value between the two endpoints, ensuring the temporal continuity of the time-series data.

[0030] After removing outliers and filling in missing values, the time-series data undergoes maximum-minimum normalization. For each physicochemical indicator, the maximum and minimum values ​​within a complete continuous time window are obtained. Each value is then linearly mapped according to a predefined normalization interval, ensuring all physicochemical indicator values ​​fall within the same range and eliminating the impact of dimensional differences between indicators on subsequent feature extraction. The normalized data is then arranged as row vectors along the depth direction and as column vectors along the time direction, combining them to generate a depth-time two-dimensional matrix.

[0031] Table 2. Parameter settings and execution rules for time series data preprocessing ; In this embodiment, the collected raw time-series data is systematically processed using the preprocessing parameters and execution rules specified in Table 2. This process removes abnormal fluctuations caused by environmental disturbances, supplements time-series breaks caused by missing data, unifies the numerical ranges of different physicochemical indicators, ensures that the data quality of the generated depth-time two-dimensional matrix meets the requirements of subsequent feature extraction, and avoids interference from invalid data with the risk assessment results.

[0032] In this embodiment, the spatial consistency and temporal synchronization of data collected at different depths are ensured by synchronously deploying multiple depth sensors on the same vertical axis. The quality of the original time series data is improved by the preprocessing process of outlier removal through sliding window, missing value supplementation through linear interpolation, and normalization of maximum and minimum values. This provides a reliable data foundation for the construction of the depth-time two-dimensional matrix, enabling the subsequent feature extraction process to focus on the real change patterns of soil physicochemical indicators.

[0033] In another embodiment, reference Figures 3 to 5The depth-time two-dimensional matrix is ​​divided into shallow topsoil feature sequences and deep blocking feature sequences according to a preset depth threshold. The preset depth threshold is set based on the plow pan depth of the soil profile of the target small watershed. The plow pan is the layer in the soil profile where the soil porosity is significantly lower than that of the topsoil. The depth corresponding to the plow pan is the preset depth threshold. The feature sequences corresponding to soil layers above the depth threshold are shallow topsoil feature sequences, and the feature sequences corresponding to soil layers below the depth threshold up to the groundwater level are deep blocking feature sequences. Both the shallow topsoil feature sequences and the deep blocking feature sequences retain their original time and feature dimensions, with the division only occurring in the depth dimension, ensuring that the time axes of the two feature sequences are perfectly aligned.

[0034] In the autocorrelation branch of the shallow topsoil feature sequence, the shallow topsoil feature sequence is subjected to cubic linear mapping to generate a query matrix, a key matrix, and a value matrix. Specifically, the actual burial depth value of the sensor probe corresponding to each time step in the shallow topsoil feature sequence is obtained, and the actual burial depth value is converted into a fixed-dimensional depth location encoding vector using sine and cosine functions. The dimension of the depth location encoding vector is consistent with the feature dimension of a single time step in the shallow topsoil feature sequence, and the calculation formula for the depth location encoding is:

[0035] in, This refers to the actual burial depth of the sensor probe. The dimension index for the depth location encoding vector; The fixed dimension of the depth location encoding vector is consistent with the feature dimension of a single time step of the shallow topsoil feature sequence; This represents the value at the even-numbered index position in the depth location encoding vector; This is the value at the odd-indexed position in the depth location encoding vector.

[0036] The depth location encoding vector is element-wise added to the shallow topsoil feature sequence, and the resulting feature sequence is input into a linear mapping layer used to generate the query matrix, the key matrix, and the value matrix. The linear mapping layer contains three independent learnable weight matrices, corresponding to the mapping calculations of the query matrix, key matrix, and value matrix, respectively. The formula for calculating the linear mapping is:

[0037] in, This is a shallow topsoil feature sequence after overlaying depth location encoding; , , These are the learnable weight matrices corresponding to the query matrix, key matrix, and value matrix, respectively. This is the query matrix corresponding to the shallow topsoil feature sequence; This is the bond matrix corresponding to the shallow topsoil feature sequence; This is the value matrix corresponding to the characteristic sequence of shallow topsoil.

[0038] The query matrix and the key matrix are multiplied together, and then processed by the softmax function to generate a shallow autocorrelation attention weight matrix. The calculation formula is as follows:

[0039] in, Key matrix The dimension; Key matrix The transpose of the matrix; This is a scaling factor used to prevent the gradient of the softmax function from vanishing due to excessively large values ​​after matrix multiplication. This is the shallow autocorrelation attention weight matrix, where each element corresponds to the autocorrelation coefficient between two different time steps in the shallow topsoil feature sequence.

[0040] In the deep-seated stagnant feature sequence autocorrelation branch, the same mapping and matrix multiplication operations as in the shallow topsoil feature sequence autocorrelation branch are used to process the deep-seated stagnant feature sequence, generating a deep-seated autocorrelation attention weight matrix. The deep-seated stagnant feature sequence autocorrelation branch has a built-in independent learnable weight matrix. The calculation formulas for the linear mapping and attention weights are as follows:

[0041] in, This is a deep-seated blockage characteristic sequence; , , These are the learnable weight matrices for the query matrix, key matrix, and value matrix corresponding to the deep branches, respectively. , , These are the query matrix, key matrix, and value matrix corresponding to the deep-seated blockage feature sequence, respectively. Deep branching key matrix The dimension; This is the deep autocorrelation attention weight matrix, where each element corresponds to the autocorrelation coefficient between two different time steps in the deep blocking feature sequence.

[0042] In the cross-depth cross-correlation branch, the shallow topsoil feature sequence is linearly mapped to generate the source query matrix, and the deep blocking feature sequence is linearly mapped to generate the target key matrix and the target value matrix. The calculation formula is as follows:

[0043] in, , , These are the learnable weight matrices for the source query matrix, target key matrix, and target value matrix corresponding to the cross-depth cross-correlation branches, respectively. Source query matrix generated for shallow topsoil feature sequences; The target key matrix generated for deep blockage feature sequences; The target value matrix generated for the deep blockage feature sequence.

[0044] Calculate the product of the source query matrix and the transpose of the target key matrix, divide the product by a scaling factor, and input it into the softmax function to generate a cross-depth cross-correlation attention weight matrix. The calculation formula is as follows:

[0045] in, For the target key matrix The dimension; For the target key matrix The transpose of the matrix; The scaling factor for cross-depth cross-correlation calculation; The attention weight matrix is ​​a cross-depth cross-correlation matrix, where each element corresponds to the cross-correlation coefficient between a certain time step of the shallow topsoil feature sequence and a certain time step of the deep retardation feature sequence.

[0046] Multiplying the cross-depth cross-correlation attention weight matrix by the target value matrix, the output cross-depth feature interaction matrix is ​​used as the output of the cross-depth cross-correlation branch. The calculation formula is as follows:

[0047] in, This is the cross-depth feature interaction matrix, i.e., the output of the cross-depth cross-correlation branch.

[0048] Furthermore, global average pooling is performed along the time dimension on the shallow autocorrelation attention weight matrix, the deep autocorrelation attention weight matrix, and the cross-depth cross-correlation attention weight matrix, respectively, to generate shallow pooling vectors, deep pooling vectors, and cross-depth pooling vectors. The formula for calculating global average pooling is:

[0049] in, This represents the total number of time steps. This is the column vector corresponding to the t-th time step in the shallow autocorrelation attention weight matrix; This is the shallow pooling vector; This is a deep pooling vector; This is a cross-depth pooling vector.

[0050] The shallow pooling vector, the deep pooling vector, and the cross-depth pooling vector are concatenated along the feature channel dimension. The concatenated vector is then input into the sigmoid activation function to generate a gated weight vector with the same dimension as the concatenated vector. The calculation formula is as follows:

[0051] in, This is a concatenation operation of three pooling vectors along the feature channel dimension; This is the learnable weight matrix corresponding to the gate weights; This refers to the bias term corresponding to the gating weights; This is the gating weight vector.

[0052] The gated weight vector is element-wise multiplied with the concatenated vector. The resulting vector is then input into a fully connected layer. The weight parameters in the fully connected layer are used to linearly combine the element-wise multiplied vectors to output the vertically coupled feature vector. The calculation formula is as follows:

[0053] in, This is an element-wise multiplication operation; The learnable weight matrix for the fully connected layer; For bias terms of fully connected layers; This is the vertical coupling feature vector.

[0054] Table 3. Network Structure Parameters and Input / Output Correspondence for Multiple Parallel Attention Branches ; In this embodiment, by defining the input-output correspondence and core parameter settings of the three parallel attention branches as specified in Table 3, parallel extraction of shallow autocorrelation features, deep autocorrelation features, and cross-depth cross-correlation features is achieved. Each branch adopts an independent learnable weight matrix, which can adapt to the physicochemical feature variation patterns of soil layers at different depths. The model is forced to distinguish spatial attributes at different depths by depth location encoding, and redundant features are filtered by gating weight vectors. The final vertically coupled feature vector fully contains the feature interaction information of the vertical space of the soil profile.

[0055] In this embodiment, shallow and deep feature sequences are divided by a preset depth threshold. Depth location encoding is introduced into the autocorrelation branch to enhance the spatial attributes of the features. Parallel autocorrelation and cross-correlation attention branches are used to quantify the temporal dependence and cross-depth feature interaction relationships within different depths. Weighted fusion of multi-branch features is achieved through global average pooling, gating screening, and linear combination of fully connected layers. The generated vertically coupled feature vector fully covers the shallow changes, deep accumulation, and cross-depth blocking effects in the vertical migration process of soil pollutants, providing a core feature foundation for subsequent temporal dependence extraction.

[0056] In a further embodiment, reference is made to... Figure 6 The vertically coupled feature vector is expanded according to time steps and input into the input gate, forget gate, and output gate of the Long Short-Term Memory (LSTM) network. The input of the LSM network at each time step is the vertically coupled feature vector of the corresponding time step and the hidden layer state vector of the previous time step. Through the synergistic effect of the forget gate, input gate, and output gate, the LSM network achieves the retention of long-term time-dependent features and the filtering of redundant features.

[0057] At the current time step, calculate the concatenated vector of the vertically coupled feature vector and the hidden layer state vector from the previous time step. Input this concatenated vector into the forget gate for linear transformation and sigmoid activation function processing. The formula for calculating the forget gate is:

[0058] in, Index for the current time step; The vertically coupled feature vector input at the current time step; This is the hidden layer state vector from the previous time step; This is an operation that concatenates the input of the current time step with the hidden layer state of the previous time step. Here is the learnable weight matrix for the forget gate; This is the basic bias term for the forget gate; This is the output of the forget gate at the current time step, with a value range of [0,1], used to control the proportion of historical information forgotten in the cell state.

[0059] During the linear transformation of the forget gate, based on the depth row index value of the data corresponding to the vertical coupling feature vector at the current time step in the depth-time two-dimensional matrix, an adjustment factor that decreases with the depth row index value is superimposed on the bias term of the forget gate. The bias term with the superimposed adjustment factor is then substituted into the linear transformation formula of the forget gate to calculate the forget gate output. The formula for calculating the adjustment factor is:

[0060] in, This is the depth row index value of the data corresponding to the current time step in the depth-time two-dimensional matrix. The row index value increases with the depth. This represents the row index of the maximum depth in the depth-time two-dimensional matrix; The preset amplitude coefficient for the adjustment factor; This is the bias adjustment factor corresponding to the depth row index value. The value of the adjustment factor decreases as the depth row index value increases.

[0061] The formula for calculating the forgetting gate after adding the adjustment factor is updated as follows:

[0062] By superimposing an adjustment factor that decreases with the depth row index value, the data corresponding to the deeper soil with a larger depth row index value obtains a larger bias term when inputting into the forget gate, making the output of the forget gate closer to 1, reducing the degree of forgetting the current input, increasing the retention ratio of historical time series states, and adapting to the physical law that the physicochemical indicators of deep soil change slowly and are more affected by historical cumulative states.

[0063] Furthermore, the formulas for calculating the input gate and cell state update of the Long Short-Term Memory (LSTM) network are as follows:

[0064] in, The output of the input gate at the current time step; , These are the learnable weight matrix and bias term of the input gate, respectively; The candidate cell states at the current time step; , These are the learnable weight matrix and bias term corresponding to the candidate cell state, respectively; This represents the cell state at the previous time step; This represents the cell state updated at the current time step.

[0065] The formulas for calculating the output gate and hidden layer state updates of a Long Short-Term Memory (LSTM) network are as follows:

[0066] in, Output the gate at the current time step; , These are the learnable weight matrix and bias term of the output gate, respectively; This is the hidden layer state vector at the current time step.

[0067] In the last time step, the final hidden layer state vector of the Long Short-Term Memory network is extracted as the hidden state vector. The final hidden layer state vector contains the temporal dependency features and cross-depth coupling features within the complete time window.

[0068] The hidden state vector is input into the classifier, which contains two fully connected layers. The first fully connected layer maps the hidden state vector to an intermediate vector of a preset dimension, and the second fully connected layer maps the intermediate vector to output nodes corresponding to the number of risk levels. The leakage risk level is then output through these output nodes. During the mapping process, the first fully connected layer introduces a non-linear transformation using the ReLU activation function, and the second fully connected layer maps the output value to the probability value corresponding to each risk level using the softmax function. The risk level with the highest probability value is taken as the final output.

[0069] Table 4. Classification Rules and Output Mapping Table for Seepage Risk Levels in Small Watersheds ; In this embodiment, the risk level classification rules and probability interval mapping relationship of the classifier output nodes, as specified in Table 4, are used to transform the multidimensional probability values ​​output by the classifier into risk hazard levels that can be directly used for engineering treatment. Each level corresponds to a clear treatment strategy, so that the risk assessment results can directly serve the engineering practice of soil pollution prevention and control in small watersheds.

[0070] In this embodiment, a long short-term memory network is used to extract the temporal dependence of the vertically coupled feature vector. An adjustment factor that decreases with the depth row index value is superimposed in the bias term of the forget gate, so that the model can adapt to the real physical law of the slow change of the physicochemical index of deep soil. A classifier containing two fully connected layers maps the temporal hidden state features to the corresponding risk level. The final output risk assessment result can fully reflect the temporal evolution process of the vertical migration of soil pollutants, eliminate the interference of shallow instantaneous fluctuations on the risk level determination, and realize the dynamic classification of leakage risk.

[0071] Preferably, during model training, a time-series dataset of soil profiles from small watersheds labeled with actual leakage risk levels is used as training samples. The training process employs the cross-entropy loss function as the loss calculation standard, and an adaptive moment estimation optimizer iteratively updates the learnable weight matrix and bias terms in the network until the loss function converges to a preset threshold, thus completing model training. The trained model can be directly used for assessing the leakage risk level of the target small watershed without additional parameter adjustments.

[0072] Furthermore, for small watersheds with different soil textures, sample data of the corresponding texture type can be introduced during training for fine-tuning. This allows the model to adapt to the vertical infiltration characteristics and resistance patterns of different soil textures, improving its adaptability in different application scenarios. During fine-tuning, the underlying weight parameters of the encoder and long short-term memory network are fixed, and only the weights and bias terms of the fully connected layers of the classifier are updated. This reduces the computational cost of fine-tuning while preserving the model's learned cross-depth feature extraction and temporal dependency analysis capabilities.

[0073] In a preferred embodiment, multiple monitoring points can be deployed within the same small watershed. Each monitoring point has a corresponding depth-time two-dimensional matrix constructed according to the above-described method, and this matrix is ​​input into the model for risk level assessment. The assessment results from multiple monitoring points are combined with the water catchment path and topographic elevation data of the small watershed for spatial interpolation to generate a spatial distribution map of the leakage risk level for the entire small watershed. This provides a spatial basis for decision-making regarding soil pollution prevention and control and groundwater protection across the entire small watershed. The spatial interpolation process uses the inverse distance weighted interpolation method, using the risk level assessment result of each monitoring point as a sample point and the spatial distance between sample points as the basis for weight calculation, generating continuous risk level spatial distribution raster data.

Claims

1. A method for assessing the risk and hazard levels of small watersheds with multiple coupled risks, characterized in that, include: Time-series data of soil pore water conductivity, pH value and water content at different depths under the same spatial coordinates in a small watershed are obtained, and the time-series data at different depths under the same spatial coordinates are constructed into a depth-time two-dimensional matrix. The depth-time two-dimensional matrix is ​​input into an encoder containing multiple parallel attention branches. The multiple parallel attention branches include a shallow topsoil feature sequence autocorrelation branch, a deep blockage feature sequence autocorrelation branch, and a cross-depth cross-correlation branch of shallow feature sequences to deep feature sequences. Each attention branch calculates its corresponding correlation coefficient through a learnable weight matrix. The correlation coefficients of the outputs of each branch are weighted and fused to generate a vertically coupled feature vector; The vertically coupled feature vector is input into a long short-term memory network to extract temporal dependencies; Input the hidden state vector output by the Long Short-Term Memory Network into the classifier to output the leakage risk level of soil to groundwater in the small watershed.

2. The method for assessing the risk level of a small watershed with multiple coupled risks as described in claim 1, characterized in that, The process involves acquiring time-series data on soil pore water conductivity, pH value, and water content at different depths within the same spatial coordinate system in a small watershed. This time-series data at different depths within the same spatial coordinate system is then constructed into a depth-time two-dimensional matrix, including: At the soil profile with the same spatial coordinates in the small watershed, multiple sets of sensor probes are deployed from the ground surface to above the groundwater level at preset depth intervals. Each set of sensor probes synchronously collects soil pore water conductivity, pH value and water content at the same time stamp. The three physicochemical index data collected by sensor probes at different depths within a continuous time window are arranged as row vectors in the depth direction and as column vectors in the time direction, and combined to generate the depth-time two-dimensional matrix.

3. The method for assessing the risk level of a small watershed with multiple coupled risks as described in claim 1, characterized in that, The correlation coefficients of the autocorrelation branches of the shallow topsoil feature sequence and the deep stagnant feature sequence are calculated, including: dividing the depth-time two-dimensional matrix into shallow topsoil feature sequences and deep stagnant feature sequences according to a preset depth threshold. In the autocorrelation branch of the shallow topsoil feature sequence, the shallow topsoil feature sequence is subjected to cubic linear mapping to generate a query matrix, a key matrix and a value matrix. The query matrix and the key matrix are multiplied by matrix and then processed by the softmax function to generate a shallow autocorrelation attention weight matrix. In the deep stagnant feature sequence autocorrelation branch, the same mapping and matrix multiplication operations as those in the shallow topsoil feature sequence autocorrelation branch are used to process the deep stagnant feature sequence to generate a deep autocorrelation attention weight matrix.

4. The method for assessing the risk level of a small watershed with multiple coupled risks as described in claim 1, characterized in that, The calculation of the correlation coefficients of the shallow feature sequence to the deep feature sequence cross-depth cross-correlation branch includes: in the cross-depth cross-correlation branch, the shallow topsoil feature sequence is linearly mapped to generate a source query matrix, and the deep blocking feature sequence is linearly mapped to generate a target key matrix and a target value matrix. Calculate the product of the source query matrix and the transpose of the target key matrix, divide the product by a scaling factor, and input the product into the softmax function to generate a cross-depth cross-correlation attention weight matrix; Multiply the cross-depth cross-correlation attention weight matrix with the target value matrix to output the cross-depth feature interaction matrix as the output of the cross-depth cross-correlation branch.

5. The method for assessing the risk level of a small watershed with multiple coupled risks according to claim 1, characterized in that, The step of weighting and fusing the correlation coefficients of the outputs of each branch to generate a vertically coupled feature vector includes: performing global average pooling along the time dimension on the shallow autocorrelation attention weight matrix, the deep autocorrelation attention weight matrix, and the cross-depth cross-correlation attention weight matrix respectively to generate shallow pooling vector, deep pooling vector, and cross-depth pooling vector. The shallow pooling vector, the deep pooling vector, and the cross-depth pooling vector are concatenated along the feature channel dimension. The concatenated vector is then input into a fully connected layer. The shallow pooling vector, the deep pooling vector, and the cross-depth pooling vector are linearly combined using the weight parameters in the fully connected layer to output the vertically coupled feature vector.

6. The method for assessing the risk level of a small watershed with multiple coupled risks according to claim 1, characterized in that, The process of inputting the vertically coupled feature vector into a long short-term memory network to extract temporal dependencies, and inputting the hidden state vector output by the long short-term memory network into a classifier to output the leakage risk level of soil to groundwater in a small watershed includes: The vertically coupled feature vector is expanded according to time steps and input into the input gate, forget gate and output gate of the long short-term memory network; At the last time step, the final hidden state vector of the Long Short-Term Memory network is extracted as the hidden state vector; The hidden state vector is input into the classifier containing two fully connected layers. The first fully connected layer maps the hidden state vector to an intermediate vector of a preset dimension, and the second fully connected layer maps the intermediate vector to the number of output nodes corresponding to the risk level. The leakage risk level is then output through the output nodes.

7. The method for assessing the risk level of a small watershed with multiple coupled risks according to claim 2, characterized in that, Before generating the depth-time two-dimensional matrix, the method further includes: performing sliding window truncation on the soil pore water conductivity, pH value and water content time series data collected by each group of sensor probes, calculating the interquartile range for the data in each sliding window, removing values ​​outside the upper and lower limits of the interquartile range and supplementing missing values ​​using linear interpolation. The time series data after removing outliers and filling in missing values ​​are normalized by maximum and minimum values. The normalized data are then arranged into row vectors by depth and column vectors by time.

8. The method for assessing the risk level of a small watershed with multiple coupled risks according to claim 3, characterized in that, Before generating the query matrix, key matrix and value matrix by performing cubic linear mapping on the shallow topsoil feature sequence, the method further includes: obtaining the actual burial depth value of the sensor probe corresponding to each time step in the shallow topsoil feature sequence, and converting the actual burial depth value into a fixed-dimensional depth position encoding vector through sine and cosine functions. The depth location encoding vector is added element-wise to the shallow topsoil feature sequence, and the added feature sequence is input into a linear mapping layer used to generate the query matrix, the key matrix, and the value matrix.

9. The method for assessing the risk level of a small watershed with multiple coupled risks as described in claim 5, characterized in that, Before linearly combining the shallow pooling vector, the deep pooling vector, and the cross-depth pooling vector using the weight parameters in the fully connected layer, the method further includes: inputting the concatenated vector into the sigmoid activation function to generate a gated weight vector with the same dimension as the concatenated vector. The gated weight vector is multiplied element-wise with the concatenated vector, and the element-wise multiplied vector is input into the fully connected layer. The element-wise multiplied vector is linearly combined using the weight parameters in the fully connected layer to output the vertically coupled feature vector.

10. The method for assessing the risk level of a small watershed with multiple coupled risks according to claim 6, characterized in that, The step of expanding the vertically coupled feature vector according to time steps and inputting it into the input gate, forget gate and output gate of the long short-term memory network includes: at the current time step, calculating the concatenation vector of the vertically coupled feature vector and the hidden layer state vector of the previous time step, and inputting the concatenation vector into the forget gate for linear transformation and sigmoid activation function processing; During the linear transformation of the forget gate, based on the depth row index value of the data corresponding to the vertical coupling feature vector at the current time step in the depth-time two-dimensional matrix, an adjustment factor that decreases with the depth row index value is superimposed on the bias term of the forget gate. The bias term after superimposing the adjustment factor is substituted into the linear transformation formula of the forget gate to calculate the forget gate output.