Soil and water pollution remediation result prediction model training method and device, equipment and medium
Patent Information
- Application Number
- CN202610883505.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2046-06-18
AI Technical Summary
[0004]有鉴于此,本发明的目的在于提供一种水土污染修复结果预测模型训练方法、装置、设备和介质,通过多尺度时序特征提取,解决了单一尺度分析难以兼顾不同时间尺度变化规律的技术问题
本发明实施例提供了一种水土污染修复结果预测模型训练方法,通过多尺度特征提取,模型能同时捕捉修复过程中的长期衰减趋势和短期波动;通过多特征交互增强,模型能自动识别重金属与环境指标之间的复杂非线性耦合关系,评估结果更全面、真实。通过引入基于工程先验的物理约束损失,使模型预测结果不仅数值准确,而且符合修复工程的物理化学规律(如浓度不会无故反弹、药剂效果与投加量匹配),显著提升了评估结果的工程可信度。通过修复技术类型量化和融合,模型能区分土壤淋洗、植物修复、微生物修复等不同技术的机理差异,并可在损失层面自适应调整优化重点,避免了“一刀切”评估带来的偏差,泛化能力更强。
Smart Images

Figure CN122412966B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, equipment and medium for training a predictive model of water and soil pollution remediation results. Background Technology
[0002] In the field of water and soil pollution remediation, with the acceleration of industrialization and the enhancement of environmental awareness, a large number of contaminated sites urgently need treatment and remediation. However, how to scientifically and quantitatively assess the effectiveness of treatment and remediation has always been a major challenge facing the field of environmental engineering.
[0003] Traditional effectiveness assessment methods often rely on periodic sampling and simple before-and-after concentration comparisons. This approach is not only time-consuming, labor-intensive, and costly, but also fails to capture the dynamic changes in pollutant concentrations during the remediation process, making it impossible to accurately assess the sustainability and stability of the remediation effect. When processing multi-source heterogeneous monitoring data, only simple normalization is typically performed, limiting the accuracy of the assessment results. Furthermore, traditional prediction models often prioritize numerical fitting accuracy while neglecting the physicochemical laws that the remediation project itself should follow. This can lead to predictions with numerical values close to the actual values but lacking reasonable physical meaning. Such assessment results, detached from engineering mechanisms, lack credibility in practical applications. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a training method, apparatus, equipment, and medium for a predictive model of water and soil pollution remediation results. By extracting multi-scale temporal features, it solves the technical problem that single-scale analysis cannot adequately account for changes across different time scales. Through the construction of a feature interaction enhancement mechanism, it deeply explores the synergistic changes and causal relationships between different feature items. By introducing a physical constraint loss function based on prior knowledge of remediation projects, the model training process not only pursues prediction accuracy but also ensures that the model output conforms to the actual physical laws of remediation projects, significantly improving the model's generalization ability and the reliability of prediction results across different technical scenarios.
[0005] In a first aspect, embodiments of the present invention provide a method for training a predictive model for water and soil pollution remediation results, characterized in that it includes: Multiple characteristic items were collected during the construction of water and soil pollution remediation projects to obtain sample data; Multi-scale feature extraction and interactive enhancement are performed on the sample data to obtain an enhanced feature matrix; The types of remediation technologies used in the water and soil pollution remediation projects are quantified and fused with the enhanced feature matrix to obtain an enhanced embedded feature matrix; The loss function is determined based on the pre-set predicted loss terms and the physical constraints determined based on prior knowledge of water and soil pollution remediation projects. Based on the enhanced embedding feature matrix and the loss function, the initial water and soil pollution remediation result prediction model is trained to obtain a trained water and soil pollution remediation result prediction model.
[0006] In a preferred embodiment of the present invention, the above-described multi-scale feature extraction and interactive enhancement of the sample data to obtain an enhanced feature matrix includes: Each column vector in the sample data is decomposed and reconstructed using wavelet decomposition to obtain the multi-scale feature matrix corresponding to each column vector; wherein, in the sample data, a column vector corresponds to the sample time series data obtained by partitioning the time series data of a feature term; The obtained multi-scale feature matrices are stacked according to their feature dimensions to obtain a multi-scale feature tensor; The multi-scale feature tensor is expanded into a two-dimensional feature matrix along the time dimension and input into the multi-head self-attention module to obtain the enhanced feature matrix.
[0007] In a preferred embodiment of the present invention, the above-mentioned quantification of the remediation technology type used in the water and soil pollution remediation project and its fusion with the enhanced feature matrix to obtain an enhanced embedded feature matrix includes: The types of remediation technologies used in the water and soil pollution remediation projects are mapped to embedding vectors using a learnable embedding matrix; The embedding vector is copied and extended along the time dimension to obtain the technology type time series matrix; The enhanced feature matrix is concatenated with the time series matrix of the technology type to obtain the concatenated feature matrix; The concatenated feature matrix is added element by element to the learnable positional encoding matrix to obtain the enhanced embedding feature matrix.
[0008] In a preferred embodiment of the present invention, the determination of the loss function based on the pre-set predicted loss term and the physical constraint term determined based on the prior knowledge of the water and soil pollution remediation project includes: The embedded vector is input into the weight generation model to obtain the original weight vector; The original weight vector is normalized to obtain the loss weight vector; Using the loss weight vector, a weighted sum is performed on the pre-set predicted loss term and the physical constraint term determined based on the prior knowledge of the water and soil pollution remediation project to obtain the loss function.
[0009] In a preferred embodiment of the present invention, the process of training the initial water and soil pollution remediation result prediction model using the enhanced feature matrix includes: The enhanced embedding feature matrix is input into the temporal feature extraction sub-model to obtain the temporal feature matrix; The enhanced embedded feature matrix is input into the feature relation sub-model to obtain the relation feature matrix; Based on the gate weight vectors corresponding to each column vector in the enhanced embedding feature matrix, the temporal feature matrix and the relational feature matrix are weighted and summed channel by channel to obtain the fused feature matrix. The column vector of the last column in the fusion feature matrix is used as the fusion feature vector and input into the output layer to obtain the prediction result of the water and soil pollution remediation result prediction model.
[0010] In a preferred embodiment of the present invention, the above-described input of the enhanced embedding feature matrix into the temporal feature extraction sub-model to obtain the temporal feature matrix includes: The enhanced embedding feature matrix is input into a multi-layer dilated convolutional network to obtain the output features; The output features are input into a bidirectional long short-term memory network, and dependencies are extracted from the forward and reverse time sequences to obtain a temporal feature matrix.
[0011] In a preferred embodiment of the present invention, the above-mentioned inputting the enhanced embedding feature matrix into the feature relation sub-model to obtain the relation feature matrix includes: The enhanced embedding feature matrix is reconstructed according to the feature dimension to obtain a fully connected feature map; The fully connected feature map is input into a graph attention network to obtain graph node features; The graph node features are subjected to global average pooling and mapping to obtain the relation feature matrix.
[0012] Secondly, embodiments of the present invention also provide a training device for a predictive model of water and soil pollution remediation results, comprising: The data construction module is used to collect multiple feature items during the construction of water and soil pollution remediation projects to obtain sample data; The feature extraction module is used to perform multi-scale feature extraction and interactive enhancement on the sample data to obtain an enhanced feature matrix; Specifically, the fusion module is used to quantify the types of remediation technologies used in the water and soil pollution remediation project and fuse them with the enhanced feature matrix to obtain an enhanced embedded feature matrix; The loss function determination module is used to determine the loss function based on the pre-set predicted loss terms and the physical constraint terms determined based on the prior knowledge of water and soil pollution remediation projects. The training module is used to train the initial water and soil pollution remediation result prediction model based on the enhanced embedding feature matrix and the loss function, so as to obtain the trained water and soil pollution remediation result prediction model.
[0013] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the water and soil pollution remediation result prediction model training method of the first aspect.
[0014] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the water and soil pollution remediation result prediction model training method described in the first aspect.
[0015] The embodiments of the present invention bring the following beneficial effects: This invention provides a training method for a predictive model of soil and water pollution remediation results. Through multi-scale feature extraction, the model can simultaneously capture both long-term decay trends and short-term fluctuations during the remediation process. Through multi-feature interaction enhancement, the model can automatically identify the complex nonlinear coupling relationship between heavy metals and environmental indicators, resulting in more comprehensive and realistic assessment results. By introducing physical constraint losses based on engineering priors, the model's prediction results are not only numerically accurate but also conform to the physicochemical laws of remediation projects (e.g., concentrations do not rebound unnecessarily, and the effect of reagents matches the dosage), significantly improving the engineering credibility of the assessment results. Through the quantification and fusion of remediation technology types, the model can distinguish the mechanistic differences between different technologies such as soil washing, phytoremediation, and microbial remediation, and can adaptively adjust the optimization focus at the loss level, avoiding the bias caused by a "one-size-fits-all" assessment and exhibiting stronger generalization ability.
[0016] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1A flowchart illustrating a method for training a water and soil pollution remediation result prediction model, provided in an embodiment of the present invention; Figure 2 A flowchart of another method for training a water and soil pollution remediation result prediction model provided in an embodiment of the present invention; Figure 3 The above are comparison results of predicted and actual values of the test set on day 91 provided in this embodiment of the invention. Among them, a is the comparison results of predicted and actual values of cadmium concentration on day 91 of the test set, b is the comparison results of predicted and actual values of lead concentration on day 91 of the test set, and c is the comparison results of predicted and actual values of arsenic concentration on day 91 of the test set. Figure 4 The normalized weights for various losses corresponding to different remediation technologies provided in the embodiments of the present invention are as follows: a is the normalized weight of various losses corresponding to soil leaching technology, b is the normalized weight of various losses corresponding to chemical oxidation-reduction technology, c is the normalized weight of various losses corresponding to phytoremediation technology, d is the normalized weight of various losses corresponding to electroremediation technology, and e is the normalized weight of various losses corresponding to microbial remediation technology. Figure 5 This is a schematic diagram of a training device for a water and soil pollution remediation result prediction model provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions 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, 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.
[0021] In the field of soil and water pollution remediation, with the acceleration of industrialization and the enhancement of environmental awareness, a large number of contaminated sites urgently need treatment and remediation. In recent years, my country has invested a great deal of resources in soil and groundwater pollution remediation and implemented numerous remediation projects. However, how to scientifically and quantitatively evaluate the effectiveness of these remediation projects has always been a major challenge facing the field of environmental engineering. With the development of monitoring technology, modern remediation projects have generally established long-term continuous monitoring systems, accumulating massive amounts of time-series monitoring data, including multi-source heterogeneous information such as heavy metal concentrations, physicochemical indicators, and engineering parameters. This data contains rich information on the remediation process, providing a valuable foundation for a deeper understanding of the migration and transformation patterns of pollutants and for assessing the effectiveness of remediation.
[0022] Traditional methods for evaluating the effectiveness of water and soil pollution remediation often rely on comparisons of single indicators, such as comparing only the average concentration or compliance rate before and after remediation. This evaluation method ignores the dynamic changes in pollutant concentration over time during the remediation process, making it difficult to capture key information such as short-term fluctuations, periodic rebounds, and long-term trends. Consequently, the evaluation results cannot truly reflect the overall effectiveness of the remediation project.
[0023] Existing technologies typically perform only simple normalization when processing multi-source heterogeneous monitoring data, failing to effectively separate the changing components at different time scales. Furthermore, they lack the ability to model the complex nonlinear coupling relationship between heavy metal concentrations and environmental indicators, making it difficult for models to accurately express the synergistic or antagonistic effects of factors such as pH and redox potential on pollutant migration and transformation, thus limiting the accuracy of the assessment results.
[0024] Traditional prediction models often simply pursue numerical fitting accuracy while ignoring the physicochemical laws that the remediation project itself should follow. This can lead to prediction results that are close to the actual value but have unreasonable physical meaning. For example, the predicted concentration may rebound unexpectedly in the absence of external pollution input, or the predicted degree of decline may be significantly mismatched with the amount of reagent added. Such assessment results that are detached from the engineering mechanism lack credibility in practical applications.
[0025] Existing methods are poorly adaptable to different types of remediation technologies. They often use uniform evaluation standards or model structures to handle all remediation scenarios, failing to fully consider the essential differences in remediation mechanisms, efficacy curves, and key influencing factors among different technologies such as soil washing, phytoremediation, and microbial remediation. This results in limitations on the generalization ability and evaluation effectiveness of the models in specific technology scenarios.
[0026] Based on this, the present invention provides a training method for a predictive model of water and soil pollution remediation results, which can solve the technical problem that single-scale analysis is difficult to take into account the changing patterns of different time scales. It can deeply explore the synergistic changes and causal relationships between different features, so that the model training process not only pursues prediction accuracy, but also ensures that the model output results conform to the actual physical laws of the remediation project, and significantly improves the generalization ability of the model and the credibility of the prediction results under different technical scenarios.
[0027] To facilitate understanding of this embodiment, a detailed introduction will first be given to the training method for a water and soil pollution remediation result prediction model disclosed in this embodiment of the invention.
[0028] Example 1 This invention provides a method for training a predictive model for water and soil pollution remediation results. Figure 1 This is a flowchart illustrating a method for training a predictive model for water and soil pollution remediation results, provided as an embodiment of the present invention. Figure 1As shown, the training method for the water and soil pollution remediation result prediction model may include the following steps: Step S101: Collect multiple characteristic items during the construction of the water and soil pollution remediation project to obtain sample data.
[0029] Characteristic items refer to measurable indicators that reflect the pollution status, environmental conditions, and project progress during the construction of water and soil pollution remediation projects. Common characteristic items include: heavy metal concentration (such as cadmium, lead, and arsenic), pH value, redox potential, conductivity, moisture content, temperature, groundwater level depth, cumulative remediation days, cumulative reagent dosage, soil clay content, and remediation technology type. Sample data refers to data units organized into preset time windows (such as 90 consecutive days) after continuous collection of multiple characteristic items at fixed time intervals (such as daily). Each data unit contains time-series records of all characteristic items within the window, usually represented in matrix form, with rows corresponding to monitoring days and columns corresponding to characteristic items.
[0030] Specifically, in the long-term continuous monitoring process of actual water and soil pollution remediation projects, for each feature item, the monitoring value collected on each monitoring day is obtained to form the time series data of that feature item. The time series data of each feature item are stacked according to the features to form a time series matrix. That is, each column in the time series matrix describes the time series data of a feature item, and each row describes the monitoring values of all feature items collected on the same monitoring day. Through a preset sliding window, the monitoring values of all feature items within a consecutive preset number of days (e.g., 90 monitoring days) are extracted from the time series matrix to form the original time series matrix, and the heavy metal concentration (e.g., cadmium, lead, arsenic content) of the next monitoring day after the window is used as the supervision label. For example, a large amount of sample data can be segmented from the time series matrix through a preset sliding window (the step size is generally 1 monitoring day). After data cleaning (removing outliers and imputing missing values) and reasonable division of training / validation / test sets (avoiding time segments of the same project from crossing sets), a large-scale training dataset for model learning is finally formed.
[0031] For example, in this embodiment of the invention, the monitoring data for water and soil pollution remediation projects comes from long-term continuous monitoring records of multiple actual contaminated site remediation projects. During the construction of each water and soil pollution remediation project, several fixed monitoring points are set up. Soil and groundwater samples are collected daily according to unified operating procedures and sent to the laboratory for analysis and testing, thereby obtaining multiple parameters, including heavy metal concentrations and environmental indicators. The monitoring process strictly follows relevant national standards and industry specifications to ensure the accuracy and comparability of the data. For each water and soil pollution remediation project sample, a time window of 90 consecutive monitoring days is used to sequentially extract the daily monitoring values, forming the original pollution time-series data matrix.
[0032] The time series data of the sample data is defined as X, which is the original time series matrix of a single water and soil pollution remediation project over 90 consecutive monitoring days, with a size of 90×13. Here, 90 represents the number of consecutive monitoring days, i.e., 90 monitoring days, and 13 represents the number of feature items. The 13 feature items are, in order: cadmium concentration (mcg / kg), lead concentration (mcg / kg), arsenic concentration (mcg / kg), pH value (dimensionless), redox potential (mV), conductivity (µSiemens / cm), moisture content (percentage), temperature (degrees Celsius), groundwater depth (meters), remediation technology type (categorical variable, unitless), cumulative remediation days (days), cumulative reagent dosage (kg), and soil clay content (percentage).
[0033] All continuous features retain their original measurement accuracy, while categorical features are coded according to the actual remediation technology used. For example, soil washing, chemical redox, phytoremediation, electrokinetic remediation, and microbial remediation are respectively assigned values of 1 to 5.
[0034] When constructing the sample data, the time series matrix is first cleaned to remove outliers caused by instrument malfunctions or recording errors, and a linear interpolation method is used to fill in a few missing data to ensure the integrity of the time series.
[0035] Then, the time series matrix of each water and soil pollution remediation project was divided into sample data according to a 90-day sliding window, with a window step size of 1 day. That is, the first sample data covers day 1 to day 90, the second sample data covers day 2 to day 91, and so on. The label (i.e., annotation result) corresponding to each sample data is the measured value of cadmium, lead, and arsenic concentrations one day after the sliding window. These three values constitute a three-dimensional vector, which serves as the supervision label for model training. That is, the label (i.e., annotation result) corresponding to the first sample data is the measured value of cadmium, lead, and arsenic concentrations on day 91, the label (i.e., annotation result) corresponding to the second sample data is the measured value of cadmium, lead, and arsenic concentrations on day 92, and so on.
[0036] For cases where the window may not reach 90 days during the sliding process, only sample data covering 90 days will be retained.
[0037] Furthermore, for the category feature of repair technology type, the corresponding encoded value is directly extracted from the time series matrix when constructing sample data, without the need for additional processing.
[0038] All sample data are divided into training, validation, and test sets according to the water and soil pollution remediation projects and monitoring time periods. This ensures that samples from different time windows of the same remediation project are not split into different sets to avoid data leakage. The training set is used for model parameter learning, the validation set is used for hyperparameter tuning and early termination judgment, and the test set is used for final outcome prediction.
[0039] Based on this, a large-scale sample data is generated that can be used for model training. Each sample data is a 90×13 matrix, and the corresponding label is a 3-dimensional vector.
[0040] Step S102: Perform multi-scale feature extraction and interactive enhancement on the sample data to obtain an enhanced feature matrix.
[0041] Water and soil pollution remediation projects are characterized by multi-source heterogeneity, large dimensional differences, and the coexistence of short-term fluctuations and long-term trends. For example, the concentrations of cadmium, lead, and arsenic are affected by factors such as rainfall leaching, groundwater fluctuations, reagent dosage, and the progression of remediation time, exhibiting both local abrupt changes and slow variations. Environmental indicators such as pH, redox potential, conductivity, and moisture content form complex nonlinear coupling relationships with heavy metal concentrations. While conventional normalization can reduce dimensional differences, it is difficult to extract multi-timescale variation patterns or express the synergistic or antagonistic relationships between different pollution indicators and environmental indicators. Considering that different features exhibit different response characteristics at different time scales during the remediation process, this invention performs multi-scale decomposition on each feature to separate long-term trends from short-term disturbances. In other words, multi-scale feature extraction is performed on the sample data. For each column vector in the sample data, the column vector is decomposed into components of different frequencies or time scales, such as long-term trends (low frequency) and short-term fluctuations (high frequency). Commonly used decomposition methods include discrete wavelet transform and empirical mode decomposition. While multi-scale decomposition alone can preserve the changes of each feature across different time scales, it still cannot fully express the physical relationships between features. For example, a decrease in pH value may lead to increased activity of certain heavy metals, changes in redox potential may alter the occurrence form of arsenic, and the cumulative dosage of reagents may have a differentiated correlation with the rate of decrease in cadmium, lead, and arsenic concentrations. This invention employs an interactive enhancement approach, extracting features from the components after different column vector decompositions to automatically learn the nonlinear coupling relationships between multiple feature terms. This allows the new representation of each feature to incorporate information from other related features, thereby enhancing the ability to model the intrinsic relationships within complex systems.
[0042] Specifically, for each sample data, i.e. the original time series matrix (e.g., 90 days × 13 features), firstly, discrete wavelet decomposition is performed on each column vector to obtain multiple feature components. Then, all scale components of all feature terms are expanded along the time dimension and input into the self-attention module, enabling the model to automatically learn the mutual influence relationships between different feature components on different monitoring days, and output an enhanced feature matrix that integrates multi-scale information and inter-feature interactions.
[0043] Furthermore, multi-scale feature extraction and interactive enhancement are performed on the sample data to obtain an enhanced feature matrix, including: performing wavelet decomposition and reconstruction on each column vector in the sample data to obtain a multi-scale feature matrix corresponding to each column vector; wherein, in the sample data, a column vector corresponds to the sample time series data obtained by partitioning the time series data of a feature term; stacking the obtained multiple multi-scale feature matrices according to the feature dimension to obtain a multi-scale feature tensor; expanding the multi-scale feature tensor into a two-dimensional feature matrix according to the time dimension and inputting it into a multi-head self-attention module to obtain the enhanced feature matrix.
[0044] Specifically, the time series of individual feature items are extracted from the time series data X column by column according to the feature dimension, denoted as... ,in, This represents the time series of the j-th feature over 90 consecutive monitoring days, with a length of 90. .
[0045] Furthermore, multi-level discrete wavelet decomposition is performed on each time series to obtain one low-frequency approximation component and multiple high-frequency detail components. The low-frequency approximation component is used to characterize the long-term trend of the feature during the repair process, while the high-frequency detail components are used to characterize rapid fluctuations caused by rainfall, irrigation, local disturbances, short-term rebounds, etc.
[0046] In one implementation, a three-level discrete wavelet decomposition can be used, and the wavelet basis used can be the Daubechies-4 wavelet basis. The reason for using this wavelet basis is that it has good time-frequency localization ability, which can not only preserve the information of temporal abrupt changes, but also reflect the long-term evolution trend relatively smoothly, making it suitable for the decomposition and processing of monitoring data in restoration projects.
[0047] It should be noted that multi-level discrete wavelet decomposition is a technique widely used in signal processing, time series analysis and other fields. Its core idea is to decompose the column vectors in the sample data into components of different frequency bands layer by layer through a set of high-pass and low-pass filters, thereby separating the long-term trend (low frequency) and short-term fluctuations (high frequency). This technique can effectively extract the change patterns of pollutant concentrations at different time scales.
[0048] For each column vector, the scale components (one low-frequency approximation component and multiple high-frequency detail components) obtained from multi-level discrete wavelet decomposition are reconstructed into time-series features of uniform length. This is because multi-level wavelet decomposition is accompanied by downsampling, and the lengths of different scale components are inconsistent, so they cannot directly participate in subsequent fusion. Therefore, it is necessary to unify the length of each scale component.
[0049] In practical implementation, cubic spline interpolation can be used to restore each scale component to a length of 90, so that each scale component corresponds one-to-one with the original monitoring daily sequence. Taking the j-th feature as an example, the j-th feature after this processing can obtain time series features at four scales, corresponding to long-term trend, first-level short-term fluctuation, second-level medium-short-term fluctuation, and third-level medium-long-term fluctuation, respectively.
[0050] Furthermore, still taking the j-th feature term as an example, that is, the column vector of the j-th column of the sample data, the temporal features of the j-th feature term at the four scales are combined according to the scale dimension to form the multi-scale feature matrix of the j-th feature term. , is the feature result of the j-th feature term after multi-scale decomposition and length unification, with a size of 4×90, used to simultaneously characterize the dynamic changes of the feature term at 4 different time scales.
[0051] After performing the above processing on each of the 13 feature items, the multi-scale feature matrices of all feature items are stacked according to the feature dimensions to obtain the multi-scale feature tensor F, which is the multi-scale time-series feature tensor of the entire sample data, with a size of 90×13×4. This means that on each monitoring day, for each monitoring feature, four time-series response values at different scales are saved.
[0052] It should be noted that the changes in pollutant concentration during the remediation process are not changes on a single time scale. Short-term rainfall, long-term chemical effects, seasonal changes, and fluctuations in groundwater conditions all affect the migration and transformation of pollutants. Through multi-scale decomposition, the components of change from different sources can be separated, enabling subsequent models to simultaneously identify two types of information: "slow downward trend" and "local abnormal fluctuations," thereby improving the ability to characterize the dynamic evolution of remediation effectiveness.
[0053] Expanding the multi-scale feature tensor F along the time dimension into a two-dimensional feature matrix yields the temporal feature matrix. The time series feature matrix, which represents a comprehensive feature vector corresponding to each monitoring day, has a size of 90×52. Here, 52 represents the combination result of 13 feature terms and 4 scales, that is, each monitoring day corresponds to 13×4 feature components.
[0054] Furthermore, the time series feature matrix The input multi-head self-attention module performs correlation modeling on the comprehensive feature responses between different monitoring days and automatically learns the importance relationship between different feature components.
[0055] The role of the multi-head self-attention module is not to simply average the features, but to analyze the correlation between features simultaneously from different subspaces through multiple parallel attention heads.
[0056] In one implementation, 13 attention heads can be set. Each attention head performs query mapping, key mapping, and value mapping on the temporal feature matrix. Then, weights are generated based on the degree of matching between the query and the key. The values are then weighted and summarized using these weights. Based on this, the model can automatically identify which feature combinations are more worthy of attention in the current repair stage.
[0057] The outputs of each attention head are concatenated and the enhanced feature matrix A is obtained through the output mapping layer. This matrix represents the temporal feature matrix after fusing nonlinear interaction information between features, and its size is 90×52. Each feature dimension in the enhanced feature matrix A no longer represents a single feature term or a single scale component, but rather the enhanced result after comprehensively considering the influence of other features on a multi-scale basis. In other words, the output of a certain heavy metal concentration feature has implicitly absorbed the information of the effects of related factors such as pH value, redox potential, and dosage of reagents.
[0058] In one implementation, the output mapping layer consists of a fully connected neural network layer that concatenates the features (of dimension 1) output by the multi-head self-attention module. ,in A linear transformation is performed on the output dimension of each attention head to map it back to the original feature dimension 52, thereby obtaining the enhanced feature matrix A, which integrates the different subspace information extracted by multiple attention heads into a unified feature representation.
[0059] It should be noted that water and soil pollution remediation is not a process in which multiple features change independently, but rather a typical multi-factor coupling process. By adopting a multi-head self-attention mechanism, the model can automatically learn this coupling relationship from the data without the need for manually defining a fixed interaction form. This enhances the model's ability to identify the synergistic changes of pollutants, environmental driving mechanisms, and differences in remediation responses.
[0060] Step S103: Quantify the type of remediation technology used in the water and soil pollution remediation project and fuse it with the enhanced feature matrix to obtain the enhanced embedded feature matrix.
[0061] Remediation technology types refer to the different remediation processes used in soil and water pollution remediation projects, such as soil washing, chemical oxidation-reduction, phytoremediation, electrokinetic remediation, and microbial remediation. These categories are discrete labels without inherent numerical relationships. Converting discrete categories into continuous, learnable vector representations typically employs embedding techniques, which map each category to a low-dimensional dense space using a trainable embedding matrix.
[0062] Specifically, the repair technology type (category value) can be extracted from the sample data and converted into a continuous vector (e.g., 8-dimensional) using a trainable embedding matrix. Then, this continuous vector is copied along the time dimension to align with each monitoring day, forming a technology type time-series matrix. Next, the technology type time-series matrix is concatenated with the enhancement feature matrix to obtain the enhancement embedding feature matrix.
[0063] Step S104: Determine the loss function based on the pre-set predicted loss term and the physical constraint term determined based on prior knowledge of water and soil pollution remediation projects.
[0064] The prediction loss term is a quantitative indicator used to measure the difference between the model output value and the actual monitored value. Common examples include mean squared error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE), with the goal of minimizing the prediction error. However, relying solely on minimizing the prediction error can easily lead to results that are numerically close to the true value but physically unreasonable. For example, in the absence of external pollution input and continuous pesticide addition, the model may still predict an unexplained rebound in the concentration of a certain heavy metal, or the predicted concentration decrease may be significantly mismatched with the pesticide dosage and remediation time. To make the model training results more consistent with the laws of remediation engineering, a physical constraint term is further constructed based on the prediction loss term. The physical constraint term is a penalty function designed based on the natural laws and engineering common sense that remediation engineering should follow, without needing to be learned from data. Examples include: monotonicity constraint loss (concentration should not continue to rise abnormally), mass balance constraint loss (increased pesticide dosage should match decreased concentration), and remediation efficiency constraint loss (concentration should show an overall decreasing trend as remediation time progresses), etc.
[0065] Based on the actual laws of water and soil pollution remediation projects, this invention constructs monotonicity constraint loss, mass balance constraint loss, and remediation efficiency constraint loss.
[0066] During the training phase, from the fused feature matrix The fusion feature vectors of all monitoring days are extracted, and the predicted pollutant concentration value for each monitoring day is obtained through an auxiliary prediction head that shares parameters with the final output layer. It can be understood that the fusion feature vector of the monitoring day corresponds to a column of data in the fusion feature matrix.
[0067] definition Indicates the first The monitoring day for the first The predicted concentrations of several heavy metals, among which, , These correspond to cadmium, lead, and arsenic, respectively.
[0068] In practical implementation, the auxiliary prediction head in the initial water and soil pollution remediation result prediction model shares parameters with the final output layer. It consists of a fully connected layer, whose input is the fused feature vector (dimension 128) for each monitoring day, and whose output is the predicted concentrations of cadmium, lead, and arsenic for the corresponding monitoring day (dimension 3). During the training phase, the fused feature matrix... ( Input this auxiliary prediction head to obtain the predicted concentration matrix for all 90 monitoring days. This is used to construct temporal physical constraints. During the inference phase, only the final output layer is used to predict the concentration on day 91, without adding any additional computation.
[0069] The basic idea of monotonicity constraints is that, in the absence of significant secondary pollution input, the overall concentration of pollutants should decrease when remediation is effective, allowing for small-scale short-term fluctuations, but there should be no sustained or significant increase.
[0070] In one implementation, the predicted concentrations of two adjacent monitoring days can be compared daily. When the predicted concentration of the following day exceeds the predicted concentration of the previous day and exceeds the allowable fluctuation tolerance, the excess is penalized. The allowable fluctuation tolerance can be adaptively set according to the fluctuation range of the corresponding heavy metal in the training set, thereby avoiding misjudging normal small fluctuations as abnormal increases. This can be expressed as: ,in, This represents the monotonicity constraint loss. Indicates the first The allowable short-term fluctuation tolerance for each monitoring day is, for example, calculating the absolute value of the concentration difference between adjacent days for each heavy metal in all samples of the training set, and taking the 90th percentile as the global tolerance for that heavy metal. ,but . Represents the predicted concentration matrix The predicted concentration vector for day t in the matrix is the predicted concentration matrix. The t-th column in the array.
[0071] The basic idea of the quality balance constraint is that in water and soil pollution remediation projects, after the cumulative amount of reagents added increases, the concentration of pollutants should usually show a certain degree of decrease, and at least should not show the unreasonable situation of "significant increase in reagent addition but almost no decrease in concentration" for a long period of time.
[0072] In one implementation, a constraint relationship is established between the cumulative dosage and the predicted concentration decrease. When the predicted concentration decrease is significantly less than the theoretical minimum removal effect corresponding to the dosage, a penalty is applied to the difference. It should be noted that a strictly linear relationship is not strictly required here. Instead, a learnable parameter is used to give the response intensity of different heavy metals to the dosage, and the decrease is represented as "initial concentration minus final concentration," which can be expressed as: ,in, This represents the loss due to mass balance constraints. This represents the cumulative dosage of the pesticide, specifically the cumulative dosage on the 90th monitoring day (i.e., the total dosage over the entire remediation cycle). Since the "cumulative dosage" feature in the sample data accumulates over time, the value from the last monitoring day can be directly used. Indicates the first The theoretical removal response coefficients for each heavy metal are set based on prior knowledge. A fixed empirical value is assigned to each heavy metal according to the type of remediation technology and the characteristics of the pollutant. For example, for cadmium, lead, and arsenic, they can be set to [values to be filled in]. , , This indicates the concentration reduction expected per kilogram of drug dosage.
[0073] The basic idea behind the remediation efficiency constraint is that as the number of remediation days increases, the overall concentration of pollutants should tend to decrease, therefore there should be a negative correlation between the number of monitoring days and the predicted concentration.
[0074] In one implementation, rank transformation is first performed on the monitoring day sequence and the predicted concentration sequence of each heavy metal, then the rank correlation between the two is calculated and converted into a loss term. If the predicted concentration of a certain heavy metal decreases overall with the increase of remediation time, the corresponding rank correlation is more in line with expectations and the loss of this term is smaller. If the prediction result does not show a downward trend over time, the loss of this term increases.
[0075] Specifically, for the monitoring daily sequence And the predicted concentration sequence of each heavy metal Perform rank transformations (i.e., sort by numerical value and replace the original value with the rank) to obtain the ordered sequence. and Then use the order column and Calculate the Spearman rank correlation coefficient between the two. The repair efficiency constraint loss is defined as: That is, a penalty is imposed when the predicted concentration is positively correlated with time (concentration increases), and the loss is zero when it is negatively correlated (concentration decreases). Indicates the monitoring daily sequence The rank sequence is obtained by sorting each day by its numerical value and then replacing the original number of days with its rank. Indicates the first Predicted concentration sequences of several heavy metals The rank sequence is obtained by sorting the 90 predicted values in ascending order and replacing each value with its corresponding rank. It is the Spearman rank correlation coefficient, used to measure the monotonic correlation between the number of monitoring days and the predicted concentration.
[0076] Monotonicity constraint loss, mass balance constraint loss, and repair efficiency constraint loss are used as physical consistency constraint losses. The components can be represented as ,in, The weight representing the monotonicity constraint loss controls the model's penalty for abnormal increases in concentration between adjacent days; a value of 0.1 is preferred. The weight representing the loss due to the mass balance constraint, which balances the consistency requirement between the dosage of the reagent and the decrease in concentration, is preferably set to 1. The weight representing the loss due to the constraint of repair efficiency is emphasized, highlighting the trend of concentration decreasing over time, and is preferably set to 0.2.
[0077] It should be noted that the predicted results of the repair project should not only be close to the actual observed values, but also conform to the engineering mechanism and common sense of physics. By introducing physical consistency constraints during the training phase, prior engineering knowledge can be explicitly introduced into the model optimization process, thereby reducing the situation where the predicted results violate the repair law and improving the credibility and interpretability of the model in practical engineering applications.
[0078] Step S105: Based on the enhanced embedding feature matrix and the loss function, train the initial water and soil pollution remediation result prediction model to obtain the trained water and soil pollution remediation result prediction model.
[0079] All sample data can be divided into training, validation, and test sets according to the water and soil pollution remediation project and monitoring time. This ensures that samples from different time windows of the same remediation project are not split into different sets, thus avoiding data leakage. The training set is used for model parameter learning, the validation set is used for hyperparameter tuning and early termination judgment, and the test set is used for final effectiveness evaluation. The initial water and soil pollution remediation result prediction model is trained using the mini-batch stochastic gradient descent method. Each time, a number of sample data are randomly drawn from the training set to form a batch, which is then input into the initial water and soil pollution remediation result prediction model for forward propagation. The function value of the loss function is calculated, and then all trainable parameters are updated through the backpropagation algorithm.
[0080] All parameters are initialized using Xavier or normal distribution randomization to ensure gradient stability in the early stages of training.
[0081] During training, the optimizer uses the Adaptive Moment Estimation (Adam) algorithm with an initial learning rate of 0.001. A cosine annealing strategy is employed to dynamically adjust the learning rate, enabling more refined convergence of the model in the later stages of training. The batch size is set to 32 based on the GPU memory capacity, meaning 32 samples are processed simultaneously each time. After each training epoch, the total loss is calculated using the validation set, and changes in the validation loss are monitored.
[0082] When the validation loss stops decreasing for 20 consecutive epochs, an early stopping mechanism is triggered, halting training and saving the model parameters at the point of minimum validation loss as the final model. All parameter updates are achieved through automatic differentiation via backpropagation. After gradient calculation, gradient clipping is used to limit the L2 norm of the gradient to within 1.0 to avoid gradient explosion.
[0083] The entire training process is iterative until the early stopping condition is met or the preset maximum number of training cycles (e.g., 500 cycles) is reached. After training, the model structure and optimal parameters are saved for subsequent performance evaluation.
[0084] This invention provides a training method for a predictive model of soil and water pollution remediation results. Through multi-scale feature extraction, the model can simultaneously capture both long-term decay trends and short-term fluctuations during the remediation process. Through multi-feature interaction enhancement, the model can automatically identify the complex nonlinear coupling relationship between heavy metals and environmental indicators, resulting in more comprehensive and realistic assessment results. By introducing physical constraint losses based on engineering priors, the model's prediction results are not only numerically accurate but also conform to the physicochemical laws of remediation projects (e.g., concentrations do not rebound unnecessarily, and the effect of reagents matches the dosage), significantly improving the engineering credibility of the assessment results. Through the quantification and fusion of remediation technology types, the model can distinguish the mechanistic differences of different technologies such as soil washing, phytoremediation, and microbial remediation, and can adaptively adjust the optimization focus at the loss level, avoiding the bias caused by a "one-size-fits-all" assessment and exhibiting stronger generalization ability.
[0085] Example 2 This invention also provides another method for training a prediction model for water and soil pollution remediation results. This method is based on the method described in the above embodiments. The method focuses on quantifying the type of remediation technology used in the water and soil pollution remediation project and fusing it with the enhanced feature matrix to obtain an enhanced embedded feature matrix. Based on the pre-set prediction loss term and the physical constraint term determined based on the prior knowledge of the water and soil pollution remediation project, the specific implementation of the loss function is determined.
[0086] Figure 2 A flowchart of another water and soil pollution remediation result prediction model training method provided in this embodiment of the invention is shown below. Figure 2As shown, the training method for the water and soil pollution remediation result prediction model may include the following steps: Step S201: Collect multiple characteristic items during the construction of the water and soil pollution remediation project to obtain sample data.
[0087] Step S202: Perform multi-scale feature extraction and interactive enhancement on the sample data to obtain an enhanced feature matrix.
[0088] Step S203: The remediation technology type used in the water and soil pollution remediation project is mapped to an embedding vector using a learnable embedding matrix.
[0089] A learnable embedding matrix is a parameter matrix that is continuously updated and optimized during model training. Its number of rows equals the total number of repair technique categories (e.g., 5 types), and its number of columns equals the preset embedding dimension (e.g., 8 dimensions). Each element in the embedding matrix is a trainable parameter, initially randomly assigned and gradually adjusted during training. Repair technique types are discrete categorical variables, typically represented by integer codes such as 1, 2, 3, etc. Different repair techniques correspond to different repair mechanisms and different performance curves. If integer codes are directly input into the model, it is easy to artificially introduce spurious size relationships between categories, affecting the model's judgment.
[0090] Specifically, from time series data Extract the repair technology type and define the repair technology type as... The value of c represents the remediation technology category corresponding to the sample data. It can be from 1 to 5, and different values correspond to different remediation technology schemes. In one embodiment, the values of remediation technology type c from 1 to 5 correspond to five schemes: soil washing, chemical oxidation-reduction, phytoremediation, electrokinetic remediation, and microbial remediation.
[0091] Furthermore, the repair technique type is utilized by a learnable embedding matrix. Mapping to a continuous vector yields the repair technique type embedding vector. The embedding vector can have a dimension of 8, used to represent the differences between different repair techniques in the latent feature space. After embedding, different repair techniques are no longer represented by discrete numbers, but by learnable continuous features, enabling the model to learn the differences in the repair mechanisms of different repair techniques more naturally. The embedding vector itself only represents the type of repair technique and does not contain temporal information.
[0092] Step S204: Copy and extend the embedding vector along the time dimension to obtain the technology type time series matrix.
[0093] The time dimension refers to the time axis of the sample data. For example, if a sample data set contains 90 consecutive monitoring days, then the length of the time dimension is 90. Replication expansion refers to repeating the embedding vector multiple times along the time dimension to align it with the number of monitoring days. Each monitoring day corresponds to the same embedding vector. The technology type time series matrix is a two-dimensional matrix obtained by replicating and expanding the embedding vector, with a shape of time length × embedding dimension (e.g., 90 × 8), where each row contains the same embedding vector.
[0094] Specifically, embed the repair technology type into the vector. By copying and extending along the time dimension, we obtain the time series matrix of technology types. The technology type time series matrix is a repair technology embedding matrix corresponding to each of the 90 monitoring days, with a size of [size missing]. Since a single sample of data usually corresponds to the same repair technique, the technique type embedding vectors remain consistent across 90 monitoring days.
[0095] Step S205: Concatenate the enhanced feature matrix with the time series matrix of the technology type to obtain the concatenated feature matrix.
[0096] Enhance the interaction feature matrix Time series matrix of technology type Concatenate the features along their respective dimensions to obtain the concatenated feature matrix. It is an enhanced feature matrix that integrates information about technology types, with a size of The enhanced feature matrix (90×52) contains temporal information and feature interaction relationships after multi-scale decomposition, but does not contain information on remediation technology types. The technology type temporal matrix (90×8) contains information on remediation technology types, but does not contain dynamic features of the monitoring data. These two matrices are concatenated along the feature dimension (column direction) to form a concatenated feature matrix (90×60). This concatenation operation preserves the integrity of both types of information, ensuring that the feature vector for each monitoring day contains both the pollution and environmental status of that day and the remediation technology category to which the entire project belongs.
[0097] Step S206: Add the concatenated feature matrix to the learnable positional encoding matrix element by element to obtain the enhanced embedding feature matrix.
[0098] Constructing and splicing feature matrices Consistent size position encoding matrix ,in, This represents the position encoding matrix, with a size of [missing information]. This is used to represent the temporal sequence relationship between different monitoring days. In one implementation, the location encoding matrix P can be initialized using sine and cosine functions, and then used as a learnable parameter in training and updating. The purpose of this approach is to preserve the general temporal location prior while allowing the model to adaptively adjust the location representation based on the actual distribution of monitoring data. The concatenated feature matrix... With position encoding matrix By adding element by element, we obtain the enhanced embedding feature matrix. The enhanced embedding feature matrix is the final input feature after multi-scale enhancement, feature interaction enhancement, technology type embedding, and temporal position encoding, with a size of [size missing]. .
[0099] It should be noted that different repair technologies have different effectiveness patterns, and the repair process itself has obvious stage characteristics. By embedding technology types, category information can be transformed into a potential representation that the model can learn. At the same time, by using location encoding, the monitoring day sequence can be explicitly injected into the model, thereby enabling the model to distinguish between different repair technologies and different repair stages, thus improving the adaptability of the prediction results to the actual engineering situation.
[0100] Step S207: Input the embedded vector into the weight generation model to obtain the original weight vector.
[0101] Different remediation technologies have different mechanisms of action and efficacy curves; therefore, the importance of various losses should vary depending on the technology type. For example, phytoremediation typically has a slower onset of action, requiring greater attention to long-term decline trends (remediation efficiency constraints); chemical fixation technologies usually show significant short-term responses, requiring greater attention to the consistency between pesticide application and concentration changes (mass balance constraints). Embedding remediation technology types into a vector... The input is fed into the weight generation model to obtain the original weight vector, whose dimension is the same as the number of loss terms (e.g., 5 dimensions). Each component of the original weight vector represents the original weight score of the corresponding loss term under that technique type. In the specific implementation, the weight generation model adopts a two-layer multilayer perceptron structure. The first layer is used to extract the hidden representation, and the second layer is used to output the original weight scores corresponding to each loss term. The input dimension is 8, the hidden layer dimension can be 16, and the output dimension is 5, corresponding to the mean squared error loss, mean absolute percentage error loss, monotonicity constraint loss, quality balance constraint loss, and repair efficiency constraint loss, respectively.
[0102] Step S208: Normalize the original weight vector to obtain the loss weight vector.
[0103] The output of the weight generation model (the original weight scores of each loss) is normalized using Softmax to obtain the loss weight vector w, which represents the normalized weights of each loss under the current repair technique type, and the sum of the five weights is 1.
[0104] Step S209: Using the loss weight vector, a weighted sum is performed on the pre-set predicted loss term and the physical constraint term determined based on the prior knowledge of the water and soil pollution remediation project to obtain the loss function.
[0105] Furthermore, based on the loss weight vector w, the prediction error loss term and the physical constraint term are weighted and summed to obtain the total loss. .
[0106] It should be noted that different repair techniques correspond to different optimal evaluation criteria. It is not advisable to use a fixed loss weight uniformly for all technology types. By using an adaptive weighting strategy that conditions the technology type, the model can automatically adjust its training focus, thereby enabling the model to learn prediction patterns that are more in line with actual engineering laws under different repair technology scenarios, thus improving the model's generalization ability and engineering applicability.
[0107] Step S210: Based on the enhanced embedding feature matrix and the loss function, train the initial water and soil pollution remediation result prediction model to obtain the trained water and soil pollution remediation result prediction model.
[0108] The water and soil pollution remediation result prediction model training method provided in this invention quantifies remediation technology types into learnable embedding vectors and fuses them element-wise with multi-scale enhanced features and learnable positional codes. This allows the model to perceive the mechanistic differences and remediation stage of each technology on each monitoring day, avoiding spurious order relationships introduced by discrete coding. It uses the same technology type embedding to dynamically generate a loss weight vector, adaptively weighting the prediction error term and multiple physical constraints (monotonicity, mass balance, remediation efficiency). This enables the model training objective to automatically adjust the optimization focus according to the remediation characteristics of different technologies (e.g., phytoremediation focuses on long-term trends, while chemical remediation emphasizes agent response). Both parts share the same embedding information, achieving a unity of "feature injection" and "optimization guidance." This significantly enhances the degree to which the prediction results follow the physical laws of remediation projects while ensuring prediction accuracy, and significantly improves the model's generalization ability and the engineering practicality of the evaluation results under various technology types such as soil washing, phytoremediation, and microbial remediation.
[0109] Example 3 This invention also provides another method for training a prediction model for water and soil pollution remediation results; this method is implemented based on the method in the above embodiments; the method focuses on describing the specific implementation of the process of training the initial prediction model for water and soil pollution remediation results through the enhanced feature matrix.
[0110] The training method for the predictive model of water and soil pollution remediation results may include the following steps: Step S301: Collect multiple characteristic items during the construction of the water and soil pollution remediation project to obtain sample data.
[0111] Step S302: Perform multi-scale feature extraction and interactive enhancement on the sample data to obtain an enhanced feature matrix.
[0112] Step S303: Quantify the type of remediation technology used in the water and soil pollution remediation project and fuse it with the enhanced feature matrix to obtain the enhanced embedded feature matrix.
[0113] Step S304: Determine the loss function based on the pre-set predicted loss term and the physical constraint term determined based on prior knowledge of water and soil pollution remediation projects; Step S305: Based on the enhanced embedding feature matrix and the loss function, train the initial water and soil pollution remediation result prediction model to obtain the trained water and soil pollution remediation result prediction model.
[0114] The process of training the initial water and soil pollution remediation result prediction model using the enhanced feature matrix includes: inputting the enhanced embedding feature matrix into a temporal feature extraction sub-model to obtain a temporal feature matrix; inputting the enhanced embedding feature matrix into a feature relation sub-model to obtain a relational feature matrix; performing channel-wise weighted summation on the temporal feature matrix and the relational feature matrix according to the gating weight vectors corresponding to each column vector in the enhanced embedding feature matrix to obtain a fusion feature matrix; and inputting the column vector of the last column in the fusion feature matrix as the fusion feature vector into the output layer to obtain the prediction result of the water and soil pollution remediation result prediction model.
[0115] Traditional single-path temporal networks often emphasize one type of information, such as being only good at extracting time dependencies or processing local patterns, making it difficult to simultaneously express both "temporal evolution patterns" and "interactions between features." This invention constructs a dual-branch deep neural network model as the initial prediction model for soil and water pollution remediation results. In this model, one branch is used to extract temporal evolution features (i.e., the temporal feature extraction branch), and the other branch is used to extract feature relationship features (i.e., the feature relationship branch). These are then fused through an adaptive gating mechanism to output predicted cadmium, lead, and arsenic concentrations for the next monitoring day. The temporal feature extraction branch, completed by the temporal feature extraction sub-model, is used to enhance the embedded feature matrix of the input and extract short-term fluctuations, stage changes, and long-term memory information during the contamination remediation process, thus obtaining the temporal feature matrix. Specifically, the temporal feature extraction sub-model consists of a dilated convolutional network and a recurrent neural network. The dilated convolution can expand the receptive field with different dilation rates, while extracting local mutations and cross-cycle trend information. The recurrent neural network is used to capture long-term dependencies, thereby obtaining the temporal feature matrix.
[0116] The feature relationship branch is completed by the feature relationship sub-model, which is used to model the correlation between heavy metals and between heavy metals and environmental indicators. The feature relationship sub-model is based on a graph structure, treating each feature item as a node and learning the dependency strength between nodes through an attention mechanism. In essence, for the input augmented embedding feature matrix, all feature items (60 dimensions in total) on each monitoring day are treated as nodes in a fully connected graph, ignoring temporal order and purely modeling the structural relationships between features. Through the graph attention network, each feature node can adaptively aggregate information from other related nodes (e.g., the cadmium concentration node automatically absorbs information from the pH value node). After performing the above operations independently for each monitoring day, global average pooling and linear mapping are then applied to the node features to obtain the relationship feature matrix, where each row represents the comprehensive relationship pattern between all feature items on that monitoring day.
[0117] The gated weight vector is a dynamically generated weight vector for each monitoring day. Its dimension is the same as the dimension of each row of the time-series feature matrix (e.g., 128 dimensions), and each element takes a value between 0 and 1, controlling the fusion ratio of time-series features and relational features in that channel. Specifically, the input vector for each monitoring day (e.g., the 60-dimensional vector for day t) is extracted from the enhanced embedding feature matrix, and a small network (e.g., a linear layer + sigmoid) is used to generate the gated weight vector for that day. Then, for each monitoring day, the corresponding rows of the time-series feature matrix and the relational feature matrix are weighted and summed channel-by-channel using the gated weight vector to obtain the fused feature matrix. In this way, the model can adaptively determine the contribution ratio of the two types of features based on the current monitoring day's state.
[0118] The column vector in the last column of the fused feature matrix corresponds to the fused features of the 90th monitoring day. This vector is input into the output layer (fully connected network), and after linear transformation and nonlinear activation, it outputs a three-dimensional vector representing the predicted concentrations of cadmium, lead, and arsenic on the 91st day, thus yielding the prediction results.
[0119] Furthermore, the enhanced embedding feature matrix is input into the temporal feature extraction sub-model to obtain the temporal feature matrix, including: inputting the enhanced embedding feature matrix into a multilayer dilated convolutional network to obtain output features; inputting the output features into a bidirectional long short-term memory network to extract dependencies from the forward temporal order and the reverse temporal order respectively to obtain the temporal feature matrix.
[0120] Specifically, the enhanced embedding feature matrix X_enh is input into a multi-layer dilated convolutional network. The dilated convolutions slide along the time dimension. By setting different dilation rates, the temporal receptive field is expanded without significantly increasing the number of parameters, thus simultaneously focusing on local changes within adjacent days and trend changes over a longer time range. In one implementation, the multi-layer dilated convolutional module sets up three dilated convolutions with dilation rates of 1, 2, and 4 respectively. The kernel size is set to 3 for all layers, and the number of output channels is uniformly set to 128. A padding method that keeps the sequence length constant is used to ensure that the time length of each layer's output is maintained at 90 seconds. This allows the model to identify both sudden fluctuations in a short period of time and repair trends over several weeks or even longer.
[0121] Meanwhile, a non-linear activation process is introduced after each dilated convolution layer to give the convolution output a stronger non-linear expressive capability. Specifically, an adaptive activation function is adopted, whose shape parameters can be dynamically adjusted according to the current input features, thereby adapting to the feature distribution changes under different pollution levels and different remediation stages.
[0122] In one implementation, due to the significant differences in data distribution at different stages of water and soil pollution remediation, for example, in the early stages of remediation, pollutant concentrations fluctuate drastically (affected by short-term disturbances such as rainfall and irrigation), requiring the activation function to maintain high linearity to preserve detailed fluctuation information. In the middle and later stages of remediation, concentration changes tend to stabilize (dominated by long-term degradation and the effects of chemicals), requiring the activation function to enhance nonlinearity and highlight trend changes. At the same time, different features (such as heavy metal concentration vs. pH value) have different requirements for nonlinearity. Therefore, the core idea of adaptive activation functions is that the shape parameters of the activation function (such as slope and smoothing coefficient) are no longer fixed, but dynamically generated according to the comprehensive status of the current monitoring day (including pollution level, remediation stage, feature type, etc.), so that the model can adapt to the nonlinear mapping requirements of different remediation stages.
[0123] Specifically, let the output of the l-th dilated convolution be Z, with dimensions of 90×128, where... This represents the value of the c-th channel on the t-th monitoring day, which is the element in the t-th row and c-th column of Z, with the enhanced embedding features of the current monitoring day (the t-th monitoring day). As input, smoothing coefficients for all channels of the day are generated through a fully connected layer. The dimension is 128, that is ,in The weight matrix of the fully connected layer is 128×60 and consists of trainable parameters used to linearly map the enhanced input features of the t-th monitoring day to a 128-dimensional intermediate representation. This represents the bias term of the fully connected layer, with a dimension of 128. It is a trainable parameter used to adjust the mapped value. This represents the hyperbolic tangent function, restricting the output to the range [-1, 1]. Furthermore, during activation calculation, the Swish function is used as the basic form, with the smoothing coefficient... Integration, meaning , where f( Sig(t,c) represents the adaptive activation function, which outputs the result of applying the adaptive activation function to z_(t,c). ) represents the Sigmoid activation function. This represents the globally learnable scaling factor, used to control the strength of the smoothing coefficient's influence on the activation function; it is a trainable parameter.
[0124] It should be noted that, Driven by the comprehensive characteristics of the current monitoring day, the activation function is automatically adjusted as the remediation process progresses. For example, the smoothing coefficient is small in the early stage to maintain linearity, and the smoothing coefficient is large in the later stage to strengthen the trend. Moreover, the smoothing coefficients of different channels are different, allowing the heavy metal concentration channel and the environmental indicator channel to adopt different degrees of nonlinearity, which is in line with the characteristics of multi-source heterogeneous data.
[0125] In this embodiment of the invention, the recurrent neural network is a bidirectional long short-term memory network. The output features of the last dilated convolution layer are input into the bidirectional long short-term memory network to obtain a bidirectional temporal hidden state sequence. The bidirectional long short-term memory network extracts dependencies from the forward temporal order and the reverse temporal order, respectively. The forward part is used to express the cumulative impact of repair over time, and the reverse part is used to supplement the model of the current state by utilizing the entire sequence context during training.
[0126] In one implementation, the bidirectional long short-term memory (LSTM) network consists of two independent LSTM layers: one processes the sequence in forward chronological order (forward LSTM), and the other processes the sequence in reverse chronological order (backward LSTM). For each time step (taking the t-th time step as an example), the forward LSTM calculates the forward hidden state based on the current input and the hidden state of the previous time step. (The forward LSTM captures long-term dependencies over time), while the backward LSTM calculates the reverse hidden state based on the current input and the hidden state at the next time step. (The backward LSTM uses the context of the entire sequence to supplement the model of the current time step.) Both have the same dimension (set to 64). Combining the two can more comprehensively characterize the dynamic characteristics of the repair process. After splicing, the bidirectional hidden state of that time step is obtained. The dimension is 128.
[0127] The forward and reverse hidden states are concatenated along the feature dimension to obtain the temporal feature matrix. The feature matrix output by the time-series feature extraction branch has a size of 90×128, with each row corresponding to the time-series feature representation of a monitoring day.
[0128] It should be noted that dilated convolution is suitable for extracting multi-scale local patterns, while bidirectional long short-term memory networks are suitable for modeling long-term dependencies. Combining the two can more completely express the dual characteristics of "short-term disturbance + long-term decay" in the repair project, thereby improving the model's ability to identify sudden fluctuations, stage transitions and long-term repair trends.
[0129] Furthermore, the enhanced embedding feature matrix is input into the feature relation sub-model to obtain the relation feature matrix, including: reconstructing the enhanced embedding feature matrix according to the feature dimension to obtain a fully connected feature map; inputting the fully connected feature map into a graph attention network to obtain graph node features; and performing global average pooling and mapping on the graph node features to obtain the relation feature matrix.
[0130] Specifically, the embedded feature matrix will be enhanced. Reorganize along the feature dimensions, treating each feature as a graph node. Let the total number of nodes be 60, corresponding to the enhanced embedding feature matrix. The system comprises 60 feature dimensions. For the f-th node, its time-series values over 90 monitoring days are extracted and defined as... , representing the temporal feature vector corresponding to the f-th feature node, with a length of 90.
[0131] Constructing a fully connected feature map structure means establishing a connection between any two feature nodes. The purpose of this setting is to allow the model to automatically learn which feature pairs have stronger relationships during training, rather than pre-restricting whether features are related.
[0132] Furthermore, all feature nodes are input into the graph attention network. The graph attention network calculates the connection weights through the similarity between nodes, and then uses these weights to weighted aggregate the information of neighboring nodes, so that each node can adaptively absorb the information of other relevant nodes.
[0133] In one implementation, the graph attention network adopts a two-layer network structure, with four attention heads in each layer. Each attention head first performs a linear mapping on the node features, then calculates the attention score based on the concatenated features of the current node and its neighboring nodes, and then obtains the attention coefficient through normalization. Finally, the features of neighboring nodes are aggregated based on the attention coefficient. The graph attention network uses the ELU activation function to activate each layer.
[0134] Furthermore, by concatenating the outputs of multiple attention heads and performing activation processing to obtain updated graph node features, a set of node features after relation modeling can be obtained after passing through a two-layer graph attention network. , is the graph node feature obtained from the feature relation branch.
[0135] Global average pooling is performed on all node features along the node dimension to obtain the relation feature vector. This represents the temporal relationship description vector formed after aggregating all feature relationships, and its length corresponds to the number of monitoring days.
[0136] Furthermore, the relation feature vector Extended into a relational feature matrix through linear mapping It is related to the time series feature matrix. A dimensionally consistent matrix, with a size of 90×128, represents the global feature relationship description corresponding to each monitoring day.
[0137] It should be noted that many indicators in pollution remediation projects do not change in isolation, but rather have complex causal coupling, synergistic changes, and conditional dependencies. Graph attention networks can explicitly model these structural relationships and automatically highlight the connections between key feature pairs, thereby improving the model's ability to identify the synergistic migration of heavy metals, environmental driving relationships, and differences in remediation mechanisms.
[0138] To enable the model to automatically determine the contribution ratio of time-series features and relational features based on the current monitoring stage, an adaptive gating fusion mechanism is adopted, and the predicted heavy metal concentration for the next monitoring day is output after fusion.
[0139] Specifically, for each monitoring day (taking the t-th monitoring day as an example), an enhanced embedding feature matrix is extracted. The enhanced input features for the t-th monitoring day are obtained from the input vector corresponding to that day. The length is 60.
[0140] Furthermore, the enhanced input features of the t-th monitoring day will be... Input the gating coefficient generation layer to obtain the gating vector. , is the gating weight vector corresponding to the t-th monitoring day, with a length of 128 and a value range of 0 to 1, used to control the proportion of time series features and relational features in each channel; In its implementation, the gating coefficient generation layer uses a linear mapping plus Sigmoid compression method to generate the gating vector. That is, it first generates the enhanced input features of the t-th monitoring day. Perform a linear transformation, and then use the Sigmoid function to compress the result to between 0 and 1, so that each channel has an interpretable weighting ratio.
[0141] Using gate vectors For the time series feature matrix and relational feature matrix Perform channel-by-channel weighted fusion to obtain the fusion feature matrix. The size is 90×128, representing the comprehensive repair status after taking into account temporal dynamics and feature relationships.
[0142] Based on this, the fusion feature of the t-th monitoring day is obtained by combining the corresponding time series feature vector and relation feature vector element by element according to the gating ratio. When the gating value of a certain channel is closer to 1, the channel is more dependent on the time series feature. When the gating value of a certain channel is closer to 0, the channel is more dependent on the relation feature.
[0143] Take the fusion feature matrix The fused feature vector corresponding to the last monitoring day, i.e., the fused feature of the 90th monitoring day, is input into the output layer for mapping to obtain the prediction vector. The forecast is for the pollutant concentration on the next monitoring day, the 91st day. It is 3 in length and corresponds to the predicted values for cadmium, lead, and arsenic concentrations, respectively.
[0144] It should be noted that in the early stages of remediation, the effects of short-term disturbances and initial concentrations are usually greater, and the time-series branch is often more important. In the middle and later stages of remediation, pollutant changes depend more on environmental indicators and remediation mechanisms, and the relational branch is often more important. Adaptive gating fusion can dynamically adjust the proportion of the two types of features according to the monitoring stage, thereby improving the flexibility of the fusion results and the stability of the prediction results.
[0145] During training, trainable parameters cover all components of the entire model: the discrete wavelet decomposition in the multi-scale feature enhancement stage does not contain learnable parameters, but the subsequent cubic spline interpolation, the query mapping, key mapping, and value mapping of the multi-head self-attention module, the weights and biases of the fully connected layers, the weights and biases of the output mapping layer, as well as the embedding matrix of the repair technique type and the learnable position encoding matrix, are all parameters to be optimized; the kernel weights and biases of the multi-layer dilated convolution in the temporal feature extraction branch, the globally learnable scaling factor in the adaptive activation function, and the weight matrices and biases involved in the input gate, forget gate, output gate, and cell state update of the bidirectional long short-term memory network are all trainable parameters. The parameters for training include: the linear mapping weights and parameters required for calculating the attention coefficients of each layer of the graph attention network in the feature relation branch, as well as the parameters of the linear mapping layer after global average pooling, which also participate in gradient updates; the weights and biases of the gating coefficient generation layer (linear mapping plus Sigmoid) in adaptive gating fusion, as well as the parameters of the fully connected layers of the final output layer and the auxiliary prediction head, are all included in the optimization scope; in addition, although the theoretical removal response coefficients in the physical constraint loss are based on prior knowledge, they remain fixed and are not updated during training, while the weights and biases of the weight generation network (multilayer perceptron) in the adaptive weighted loss of the repair technique type need to be optimized through training.
[0146] After the model is trained and its optimal parameters are saved, it can be used to quantitatively evaluate the effectiveness of water and soil pollution remediation projects. The evaluation process is primarily based on test set data. Each sample in the test set contains monitoring values of characteristic items for 90 consecutive days. These values are input into a trained dual-branch deep neural network, and the model outputs predicted values for cadmium, lead, and arsenic concentrations on the 91st day (the next day). The predicted values are compared with the corresponding actual monitoring values in the test set, and various evaluation indicators are calculated to measure the prediction accuracy and reliability. Commonly used indicators include root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (COP). These indicators can comprehensively reflect the degree of deviation and goodness of fit of the model in predicting different heavy metal concentrations.
[0147] Meanwhile, in order to evaluate whether the prediction results conform to the actual physical laws of the repair project, we can calculate the components of the physical consistency constraint loss, such as the monotonicity constraint loss, the mass balance constraint loss, and the repair efficiency constraint loss, and observe the values of these losses on the test set to determine whether the model still follows the repair mechanism on data that was not used for training.
[0148] Furthermore, the evaluation process also focuses on the interpretability analysis of the model to reveal the dynamic evolution mechanism of remediation effectiveness. By extracting the gating vectors of the adaptive gating fusion layer, the contribution ratios of temporal and relational features on different monitoring days can be observed, thereby understanding which information dominates the prediction results in the early, middle, and late stages of remediation. For example, if the gating vectors are more biased towards temporal features in the early stages of remediation, it indicates that short-term fluctuations have a greater impact on the current effectiveness; if they are more biased towards relational features in the later stages, it indicates that the coupling relationship between environmental indicators and heavy metal concentrations has become the main driving factor. In addition, the attention weights of the multi-head self-attention module can show the interaction strength between different features, such as the correlation between pH value and cadmium concentration, while the attention coefficients of the graph attention network can reveal the dependencies between feature nodes, helping to identify key control factors in the remediation process. These interpretable outputs can help engineers understand the basis of the model predictions and verify whether they are consistent with prior knowledge.
[0149] Finally, the prediction errors of the model on all test samples are summarized, and the effectiveness indicators under different remediation technology types are statistically analyzed. For example, the average prediction errors of technologies such as soil washing, chemical oxidation-reduction, and phytoremediation are calculated to predict the applicability of the model in different technology scenarios. Simultaneously, time-series comparisons of predicted and actual concentrations can be plotted to visually demonstrate the model's ability to capture concentration change trends. If the model exhibits low error and high physical consistency on the test set, it indicates that this quantitative assessment method can be effectively used for evaluating the effectiveness of water and soil pollution remediation projects, providing reliable data support for project optimization and management decisions.
[0150] In one embodiment, Figure 3 The following are comparison charts showing the predicted and actual values of the test set on day 91, provided in this embodiment of the invention: a) Comparison chart of predicted and actual cadmium concentration on day 91; b) Comparison chart of predicted and actual lead concentration on day 91; c) Comparison chart of predicted and actual arsenic concentration on day 91. Figure 3 As shown, the horizontal axis represents the test sample number, and the vertical axis represents the concentration (mg / kg). The experimental results show that the predicted value and the true value curve are in high agreement with a small error, proving that the trained dual-branch deep neural network model can accurately predict the pollutant concentration for the next day, and verifying the reliability and accuracy of the method of this invention in quantitatively assessing the remediation effectiveness.
[0151] In one embodiment, the adaptive loss weights for different repair techniques are analyzed. Figure 4To illustrate the normalized weights of various losses corresponding to different remediation technologies provided in this invention, a bar chart is presented, showing the normalized weights of various losses (mean square error MSE, mean absolute percentage error MAPE, monotonicity constraint, mass balance constraint, and remediation efficiency constraint) under five remediation technologies. The numbers on each bar represent the weight values. a represents the normalized weights of various losses corresponding to soil leaching technology. b represents the normalized weights of various losses corresponding to chemical redox technology. c represents the normalized weights of various losses corresponding to phytoremediation technology. d represents the normalized weights of various losses corresponding to electroremediation technology. e represents the normalized weights of various losses corresponding to microbial remediation technology. Figure 4 As shown, the horizontal axis represents the prediction loss terms (MSE and MAPE) and the physical constraint terms (monotonicity constraint loss, quality balance constraint loss, and repair efficiency constraint loss, abbreviated as monotonicity, quality balance, and repair efficiency), and the vertical axis represents the weight values. Experimental results show that the model can dynamically adjust the emphasis of the loss function according to the type of repair technology. Adaptive weighting makes the training objectives under different technology scenarios more in line with actual engineering laws, thereby improving the model's generalization ability.
[0152] The water and soil pollution remediation result prediction model training method provided in this invention achieves unified modeling of two types of information in remediation projects: "temporal dynamics" and "feature coupling," by constructing a dual-branch architecture (temporal feature extraction branch and feature relationship branch) and employing adaptive gating fusion. The temporal branch utilizes multi-layer dilated convolution and bidirectional LSTM to simultaneously capture short-term fluctuations, stage changes, and long-term memory; the relationship branch uses graph attention networks to explicitly model the nonlinear dependencies between heavy metals and environmental indicators; and the gating weight vector dynamically generated based on the status of each monitoring day enables the model to adaptively adjust the fusion ratio of the two types of features according to the remediation stage, making the initial stage focus more on temporal fluctuations and the later stage more dependent on feature relationships, significantly improving the model's ability to represent complex remediation processes, and enhancing the interpretability and physical rationality of the results while ensuring prediction accuracy.
[0153] Example 4 Corresponding to the above method embodiments, this invention provides a training device for a predictive model of water and soil pollution remediation results. Figure 5 This is a schematic diagram of a training device for a water and soil pollution remediation result prediction model provided in an embodiment of the present invention, as shown below. Figure 5 As shown, the training device for the water and soil pollution remediation result prediction model may include: The data construction module 401 is used to collect multiple feature items during the construction of water and soil pollution remediation projects to obtain sample data; Feature extraction module 402 is used to perform multi-scale feature extraction and interactive enhancement on the sample data to obtain an enhanced feature matrix; Specifically, the fusion module 403 is used to quantify the type of remediation technology used in the water and soil pollution remediation project and fuse it with the enhanced feature matrix to obtain an enhanced embedded feature matrix; The loss function determination module 404 is used to determine the loss function based on the pre-set predicted loss term and the physical constraint term determined based on the prior knowledge of water and soil pollution remediation projects. The training module 405 is used to train the initial water and soil pollution remediation result prediction model based on the enhanced embedding feature matrix and the loss function, so as to obtain the trained water and soil pollution remediation result prediction model.
[0154] This invention provides a training device for a predictive model of soil and water pollution remediation results. Through multi-scale feature extraction, the model can simultaneously capture long-term decay trends and short-term fluctuations during the remediation process. Through multi-feature interaction enhancement, the model can automatically identify the complex nonlinear coupling relationship between heavy metals and environmental indicators, resulting in more comprehensive and realistic assessment results. By introducing physical constraint losses based on engineering priors, the model's prediction results are not only numerically accurate but also conform to the physicochemical laws of remediation projects (e.g., concentrations do not rebound unnecessarily, and the effect of reagents matches the dosage), significantly improving the engineering credibility of the assessment results. Through the quantification and fusion of remediation technology types, the model can distinguish the mechanistic differences of different technologies such as soil washing, phytoremediation, and microbial remediation, and can adaptively adjust the optimization focus at the loss level, avoiding the bias caused by a "one-size-fits-all" assessment and exhibiting stronger generalization ability.
[0155] In some embodiments, the feature extraction module 402 is further configured to: Each column vector in the sample data is decomposed and reconstructed using wavelet decomposition to obtain the multi-scale feature matrix corresponding to each column vector; wherein, in the sample data, a column vector corresponds to the sample time series data obtained by partitioning the time series data of a feature term; The obtained multi-scale feature matrices are stacked according to their feature dimensions to obtain a multi-scale feature tensor; The multi-scale feature tensor is expanded into a two-dimensional feature matrix along the time dimension and input into the multi-head self-attention module to obtain the enhanced feature matrix.
[0156] In some embodiments, specifically in the fusion module 403, it is further configured to: The types of remediation technologies used in the water and soil pollution remediation projects are mapped to embedding vectors using a learnable embedding matrix; The embedding vector is copied and extended along the time dimension to obtain the technology type time series matrix; The enhanced feature matrix is concatenated with the time series matrix of the technology type to obtain the concatenated feature matrix; The concatenated feature matrix is added element by element to the learnable positional encoding matrix to obtain the enhanced embedding feature matrix.
[0157] In some embodiments, the loss function determination module 404 is further configured to: The embedded vector is input into the weight generation model to obtain the original weight vector; The original weight vector is normalized to obtain the loss weight vector; Using the loss weight vector, a weighted sum is performed on the pre-set predicted loss terms and the physical constraint terms determined based on the prior knowledge of the water and soil pollution remediation project to obtain the loss function.
[0158] In some embodiments, the training module 405 is further configured to: The enhanced embedding feature matrix is input into the temporal feature extraction sub-model to obtain the temporal feature matrix; The enhanced embedded feature matrix is input into the feature relation sub-model to obtain the relation feature matrix; Based on the gate weight vectors corresponding to each column vector in the enhanced embedding feature matrix, the temporal feature matrix and the relational feature matrix are weighted and summed channel by channel to obtain the fused feature matrix. The column vector of the last column in the fusion feature matrix is used as the fusion feature vector and input into the output layer to obtain the prediction result of the water and soil pollution remediation result prediction model.
[0159] In some embodiments, the training module 405 is further configured to: The enhanced embedding feature matrix is input into a multi-layer dilated convolutional network to obtain the output features; The output features are input into a bidirectional long short-term memory network, and dependencies are extracted from the forward and reverse time sequences to obtain a temporal feature matrix.
[0160] In some embodiments, the training module 405 is further configured to: The enhanced embedding feature matrix is reconstructed according to the feature dimension to obtain a fully connected feature map; The fully connected feature map is input into a graph attention network to obtain graph node features; The graph node features are subjected to global average pooling and mapping to obtain the relation feature matrix.
[0161] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0162] Example 5 This invention also provides an electronic device for running the above-described method for training a predictive model of water and soil pollution remediation results; see also Figure 6 The diagram shows the structure of an electronic device, which includes a memory 500 and a processor 501. The memory 500 is used to store one or more computer instructions, which are executed by the processor 501 to implement the above-mentioned method for training a predictive model of water and soil pollution remediation results.
[0163] Furthermore, Figure 6 The electronic device shown also includes a bus 502 and a communication interface 503. The processor 501, the communication interface 503 and the memory 500 are connected via the bus 502.
[0164] The memory 500 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 503 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 502 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0165] Processor 501 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 501 or by instructions in software form. Processor 501 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 500, and processor 501 reads information from memory 500 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0166] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-mentioned water and soil pollution remediation result prediction model training method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0167] The computer program product for training a predictive model for water and soil pollution remediation results provided in this embodiment of the invention includes a computer-readable storage medium storing non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0168] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0169] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0170] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0171] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0172] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0173] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for training a predictive model for water and soil pollution remediation results, characterized in that, include: Multiple characteristic items were collected during the construction of water and soil pollution remediation projects to obtain sample data; Multi-scale feature extraction and interactive enhancement are performed on the sample data to obtain an enhanced feature matrix; The types of remediation technologies used in the water and soil pollution remediation projects are mapped to embedding vectors using a learnable embedding matrix; The embedding vector is copied and extended along the time dimension to obtain the technology type time series matrix; The enhanced feature matrix is concatenated with the time series matrix of the technology type to obtain the concatenated feature matrix; The concatenated feature matrix is added element-wise to the learnable positional encoding matrix to obtain the enhanced embedding feature matrix; The embedded vector is input into the weight generation model to obtain the original weight vector; The original weight vector is normalized to obtain the loss weight vector; Using the loss weight vector, a weighted sum is performed on the pre-set predicted loss terms and the physical constraint terms determined based on the prior knowledge of the water and soil pollution remediation project to obtain the loss function; The physical constraints include: monotonicity constraint loss, mass balance constraint loss, and repair efficiency constraint loss. The monotonic constraint loss refers to the decrease in pollutant concentration that should occur when remediation is effective, in the absence of significant secondary pollution input, and can be expressed as: ; in, This represents the monotonicity constraint loss. Indicates the first The short-term fluctuation tolerance allowed per monitoring day This represents the predicted concentration vector for the t-th monitoring day in the predicted concentration matrix. , These correspond to cadmium, lead, and arsenic, respectively. The mass balance constraint loss refers to the decrease in pollutant concentration that should occur after an increase in the cumulative dosage of the reagent, which can be expressed as: ; in, This represents the loss due to mass balance constraints. This indicates the cumulative dosage of the drug. Indicates the first The theoretical removal response coefficients for each heavy metal; The aforementioned remediation efficiency constraint loss refers to the overall decrease that the pollutant concentration should experience as the number of remediation days increases, which can be expressed as: ; in, For monitoring daily sequences And the predicted concentration sequence of each heavy metal Perform rank transformations on each item, that is, sort them by numerical value and replace the original value with the rank to obtain the ordered list. and , using the order sequence and The Spearman rank correlation coefficient between the two was calculated. This indicates the loss due to repair efficiency constraints; Based on the enhanced embedding feature matrix and the loss function, the initial water and soil pollution remediation result prediction model is trained to obtain the trained water and soil pollution remediation result prediction model. The process of training the initial water and soil pollution remediation result prediction model using the enhanced feature matrix includes: The enhanced embedding feature matrix is input into the temporal feature extraction sub-model to obtain the temporal feature matrix; The enhanced embedded feature matrix is input into the feature relation sub-model to obtain the relation feature matrix; Based on the gate weight vectors corresponding to each column vector in the enhanced embedding feature matrix, the temporal feature matrix and the relational feature matrix are weighted and summed channel by channel to obtain the fused feature matrix. The column vector of the last column in the fusion feature matrix is used as the fusion feature vector and input into the output layer to obtain the prediction result of the water and soil pollution remediation result prediction model.
2. The method according to claim 1, characterized in that, Multi-scale feature extraction and interactive enhancement are performed on the sample data to obtain an enhanced feature matrix, including: Each column vector in the sample data is decomposed and reconstructed using wavelet decomposition to obtain the multi-scale feature matrix corresponding to each column vector; wherein, in the sample data, a column vector corresponds to the sample time series data obtained by partitioning the time series data of a feature term; The obtained multi-scale feature matrices are stacked according to their feature dimensions to obtain a multi-scale feature tensor; The multi-scale feature tensor is expanded into a two-dimensional feature matrix along the time dimension and input into the multi-head self-attention module to obtain the enhanced feature matrix.
3. The method according to claim 1, characterized in that, The enhanced embedding feature matrix is input into the temporal feature extraction sub-model to obtain the temporal feature matrix, including: The enhanced embedding feature matrix is input into a multi-layer dilated convolutional network to obtain the output features; The output features are input into a bidirectional long short-term memory network, and dependencies are extracted from the forward and reverse time sequences to obtain a temporal feature matrix.
4. The method according to claim 1, characterized in that, The enhanced embedding feature matrix is input into the feature relation sub-model to obtain the relation feature matrix, including: The enhanced embedding feature matrix is reconstructed according to the feature dimension to obtain a fully connected feature map; The fully connected feature map is input into a graph attention network to obtain graph node features; The graph node features are subjected to global average pooling and mapping to obtain the relation feature matrix.
5. A training device for a predictive model of water and soil pollution remediation results, characterized in that, include: The data construction module is used to collect multiple feature items during the construction of water and soil pollution remediation projects to obtain sample data; The feature extraction module is used to perform multi-scale feature extraction and interactive enhancement on the sample data to obtain an enhanced feature matrix; Specifically, the fusion module is used to map the type of remediation technology used in the water and soil pollution remediation project into an embedding vector using a learnable embedding matrix; The embedding vector is copied and extended along the time dimension to obtain the technology type time series matrix; the enhanced feature matrix is concatenated with the technology type time series matrix to obtain the concatenated feature matrix. The concatenated feature matrix is added element-wise to the learnable positional encoding matrix to obtain the enhanced embedding feature matrix; The loss function determination module is used to input the embedding vector into the weight generation model to obtain the original weight vector; normalize the original weight vector to obtain the loss weight vector; and use the loss weight vector to perform a weighted summation of the pre-set predicted loss term and the physical constraint term determined based on the prior knowledge of the water and soil pollution remediation project to obtain the loss function; wherein, the physical constraint term includes: monotonicity constraint loss, mass balance constraint loss, and remediation efficiency constraint loss; the monotonicity constraint loss refers to the pollutant concentration that should decrease when remediation is effective in the absence of significant secondary pollution input, which can be expressed as: ;in, This represents the monotonicity constraint loss. Indicates the first The short-term fluctuation tolerance allowed per monitoring day This represents the predicted concentration vector for the t-th monitoring day in the predicted concentration matrix. , These correspond to cadmium, lead, and arsenic, respectively; the aforementioned mass balance constraint loss refers to the expected decrease in pollutant concentration after an increase in the cumulative dosage of the reagent, which can be expressed as: ;in, This represents the loss due to mass balance constraints. This indicates the cumulative dosage of the drug. Indicates the first The theoretical removal response coefficients for each heavy metal; the remediation efficiency constraint loss refers to the overall decrease in pollutant concentration that should occur as the number of remediation days increases, which can be expressed as: ;in, For monitoring daily sequences And the predicted concentration sequence of each heavy metal Perform rank transformations on each item, that is, sort them by numerical value and replace the original value with the rank to obtain the ordered list. and , using the order sequence and The Spearman rank correlation coefficient between the two was calculated. This indicates the loss due to repair efficiency constraints; The training module is used to train the initial water and soil pollution remediation result prediction model based on the enhanced embedding feature matrix and the loss function, so as to obtain the trained water and soil pollution remediation result prediction model. The training module is further configured to: input the enhanced embedding feature matrix into the temporal feature extraction sub-model to obtain a temporal feature matrix; input the enhanced embedding feature matrix into the feature relation sub-model to obtain a relational feature matrix; perform channel-wise weighted summation on the temporal feature matrix and the relational feature matrix according to the gating weight vectors corresponding to each column vector in the enhanced embedding feature matrix to obtain a fused feature matrix; and input the column vector of the last column in the fused feature matrix as the fused feature vector into the output layer to obtain the prediction result of the water and soil pollution remediation result prediction model.
6. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the water and soil pollution remediation result prediction model training method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the water and soil pollution remediation result prediction model training method according to any one of claims 1 to 4.
Citation Information
Patent Citations
DGA gas production content prediction method with embedded physical information constraint
CN120412782A
Method for large-scale prediction on water requirement of crop based on spatiotemporal fusion model under physical constraint
US20260105538A1