Industrial park sewage water quality parameter prediction method based on deep neural network
The wastewater quality parameter prediction method optimized by deep neural networks and genetic algorithms solves the problems of existing models being unable to assess reliability and adapt to changes in operating conditions, and achieves high-accuracy and continuous learning wastewater quality prediction.
Patent Information
- Application Number
- CN202511452818.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-10-13
AI Technical Summary
Existing deep learning-based wastewater quality prediction models cannot assess the reliability of prediction results in real time and cannot adapt to unknown or sudden operating conditions, leading to a decline in prediction performance and uncertainty in decision-making.
A wastewater quality parameter prediction method based on deep neural networks is constructed. Through feature extraction, multimodal fusion and prediction modules, combined with the adaptive multi-objective optimization algorithm of genetic algorithm, the model can achieve self-diagnosis and continuous evolution, and a confidence evaluation mechanism for prediction results is introduced.
It improves the reliability of wastewater quality parameter prediction and decision-making transparency, ensuring high accuracy and robustness during long-term operation and adaptability to changes in operating conditions.
Smart Images

Figure CN120930078B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial park sewage water quality prediction, in particular to an industrial park sewage water quality parameter prediction method based on a deep neural network. BACKGROUND
[0002] Industrial parks, as an important carrier for the development of modern industrial agglomeration, have wastewater discharged in the production process with the characteristics of complex composition, dramatic fluctuations in flow and concentration, and strong coupling between water quality indicators. In order to ensure that the treated water quality meets the standards and optimize the control strategy of the treatment process, it is crucial to accurately and timely predict key water quality parameters. In recent years, artificial intelligence technologies represented by deep learning have been widely used in building prediction models based on multi-source monitoring data, through analyzing historical and real-time data, to realize early warning and trend judgment of future water quality changes, providing key technical support for the fine and intelligent operation of wastewater treatment plants. However, existing water quality prediction technologies still face severe bottlenecks in practical application. On the one hand, current deep learning-based prediction models mostly play a black box role that cannot be examined, and they can only give a prediction result, but the credibility and reliability of the result itself cannot be evaluated, bringing great uncertainty and potential risks to decision-makers. On the other hand, the internal structure and parameters of existing water quality prediction models are fixed after one-time training, which not only cannot effectively deal with new conditions or sudden changes in subsequent production conditions that have not been seen in the training stage, but also inevitably leads to a decline in prediction performance over time, lacking the ability of continuous learning and self-evolution. SUMMARY
[0003] The purpose of the present application is to provide an industrial park sewage water quality parameter prediction method based on a deep neural network, which significantly improves the reliability and decision transparency of industrial park sewage water quality parameter prediction by building a closed-loop mechanism of prediction result confidence evaluation and model adaptive optimization, enabling the industrial park sewage water quality parameter prediction model to realize self-diagnosis and continuous evolution when facing unknown or sudden conditions, thereby maintaining high accuracy in the long run.
[0004] The present application is achieved by the following technical solutions:
[0005] The industrial park sewage water quality parameter prediction method based on a deep neural network comprises the following steps:
[0006] Obtaining multi-modal time series data of the industrial park sewage discharge outlet;
[0007] Building an industrial park sewage water quality parameter prediction model, which comprises a feature extraction module, a multi-modal fusion module, and a prediction module.
[0008] An adaptive multi-objective optimization algorithm based on a genetic algorithm is defined and executed to solve the optimal parameter configuration of the industrial park sewage water quality parameter prediction model, and the adaptive multi-objective optimization algorithm maximizes the value of the preset fitness function for evaluating the comprehensive performance of the model through iterative evolution;
[0009] The industrial park sewage water quality parameter prediction model corresponding to the model parameter configuration with the highest fitness function value is selected as the final prediction model;
[0010] The industrial park sewage water quality parameter prediction model is deployed on the industrial park sewage monitoring terminal to receive real-time sewage data to be monitored and output the prediction results of the industrial park water quality parameters.
[0011] Optionally, after obtaining the multi-modal time series data of the industrial park sewage discharge outlet, preprocessing is further included, which specifically comprises:
[0012] The multi-modal time series data is collected, including water quality indicators, flow, and satellite remote sensing grayscale images;
[0013] Among them, the water quality indicators and flow data are collected at the edge computing node, the variational autoencoder is used to fill in the missing values and repair the outliers of the water quality indicators and flow data, and one-dimensional time series are obtained. The repaired multiple one-dimensional time series are time-aligned according to the set sampling frequency, and are spliced into a two-dimensional time series numerical feature matrix;
[0014] For the satellite remote sensing grayscale images obtained periodically, the pre-trained convolutional neural network is used to extract the texture and spatial distribution feature vectors of the satellite remote sensing grayscale images, and each image is converted into a one-dimensional image feature vector;
[0015] Taking the time axis of the two-dimensional time series numerical feature matrix as the reference, the one-dimensional image feature vector sequence is aligned based on the forward filling strategy, and the aligned image features and numerical features are spliced along the feature dimension to form a two-dimensional fusion feature matrix.
[0016] Optionally, the adaptive weighted fusion algorithm based on mutual information is used to process the multi-modal time series data, which specifically comprises:
[0017] The historical multi-modal time series data and the corresponding real water quality parameter target value sequence are received;
[0018] For each modality, the mutual information scalar value between the time series data of the corresponding modality and the target value time series is calculated;
[0019] The mutual information scalar values of all modalities are normalized by the Softmax function to obtain a static weight vector of each modality;
[0020] obtaining a two-dimensional pre-fusion feature matrix in real time;
[0021] According to the mapping relationship between the predefined feature column and the modality, each weight scalar in the static weight vector of each modality is respectively multiplied with all feature columns belonging to its corresponding modality in the two-dimensional pre-fusion feature matrix to obtain a two-dimensional weighted post-fusion feature matrix.
[0022] Optionally, an industrial park sewage water quality parameter prediction model is constructed, which is specifically:
[0023] a local time sequence feature extraction layer, which receives the two-dimensional weighted post-fusion feature matrix, performs batch processing on the two-dimensional weighted post-fusion feature matrix to obtain a three-dimensional time sequence input tensor, and the three-dimensional time sequence input tensor represents an input sample, and a plurality of one-dimensional convolution kernels are used to perform sliding convolution operation along the time step dimension to extract a three-dimensional local feature tensor;
[0024] a time sequence importance dynamic weighting layer, which receives the three-dimensional local feature tensor, calculates the correlation scores between the internal elements in the time step dimension, and re-aggregates the sequence information based on the correlation scores to obtain a three-dimensional context-aware tensor;
[0025] a long-term dependency relationship modeling layer, which receives the three-dimensional context-aware tensor, sequentially processes the three-dimensional context-aware tensor along the time step dimension through a gated recurrent unit network until the processing of the last time step is completed, and outputs a two-dimensional condensed information matrix;
[0026] a result prediction layer, which receives the two-dimensional condensed information matrix, and performs nonlinear transformation and feature space mapping through a fully connected layer to obtain a two-dimensional prediction result matrix, wherein each row in the two-dimensional prediction result matrix represents a water quality parameter prediction value of the corresponding input sample.
[0027] Optionally, the training process of the industrial park sewage water quality parameter prediction model is:
[0028] Based on historical multi-modal time series data and corresponding real water quality parameter target value sequence, a training set is constructed;
[0029] Initialize all training parameters in the industrial park sewage water quality parameter prediction model, including the local time sequence feature extraction layer, the time sequence importance dynamic weighting layer, the long-term dependency relationship modeling layer and the result prediction layer;
[0030] The training set is input to the local time sequence feature extraction layer in the industrial park sewage water quality parameter prediction model for sliding convolution operation, and the extracted local feature data is sequentially sent to the time sequence importance dynamic weighting layer for information aggregation and the long-term dependency relationship modeling layer for time sequence dependency learning, and the prediction result of the industrial park sewage water quality parameter is obtained through the nonlinear transformation of the result prediction layer.
[0031] The loss value of the prediction result relative to the true label of the training set is calculated, and the gradient is calculated in reverse based on the loss value to update all training parameters of the industrial park wastewater quality parameter prediction model. The process is repeated until the training rounds reach the preset maximum number of iterations, and then the training of the industrial park wastewater quality parameter prediction model is completed.
[0032] Optionally, an adaptive multi-objective optimization algorithm based on genetic algorithms is defined and executed to solve for the optimal parameter configuration of the industrial park wastewater quality parameter prediction model, specifically as follows:
[0033] The hyperparameters of the industrial park wastewater quality parameter prediction model and the preset partially trainable weight matrix are jointly encoded into individual chromosomes, and an initial population is generated in the preset value space of each encoded parameter through Latin hypercube sampling.
[0034] For each individual in the initial population, the fitness function value is calculated based on the parameter configuration of the industrial park wastewater quality parameter prediction model decoded from its chromosome.
[0035] In the current population, based on the elite preservation strategy and crowding comparison, individuals are selected from the current population in descending order of fitness to serve as parents.
[0036] The selected parent individuals are subjected to simulated binary crossover, and the generated offspring individuals are subjected to adaptive mutation to generate a new offspring population.
[0037] Repeat the above steps until the preset maximum number of generations is reached, complete the optimization, and decode the individual with the highest fitness as the optimal parameter configuration for the industrial park wastewater quality parameter prediction model.
[0038] Optional, the fitness function, whose specific calculation formula is as follows:
[0039]
[0040] in, The model parameter configuration representing the current individual includes network structure hyperparameters and weights. To indicate that the parameter is configured as The model fitness function value, This represents the expected robust accuracy of the model. To determine the number of samples in the validation set, For the model to the first The predicted value for each sample, For the first The true value of each sample The standard deviation parameter is preset. For parameters a total number of parameters of the configured model, a parameter a single-inference average latency of the configured model on the target edge device, a number of components of the model complexity, a first a sub-item value of the model complexity, a performance improvement amount, a preset exponential scaling factor, a resource utilization indicator, a number of time series components, an index, a preset time decay constant, respectively, are preset weight coefficients for balancing model robustness, complexity, and data efficiency.
[0041] Optionally, an adaptive mutation operation, which specifically comprises:
[0042] Before each iteration starts, an average fitness value of all individuals in the current population is calculated;
[0043] For each individual in the population, its own fitness value is compared with the average fitness value;
[0044] For the individual whose fitness value is higher than or equal to the average fitness value, a preset first-level mutation probability is given;
[0045] For the individual whose fitness value is lower than the average fitness value, a preset second-level mutation probability is given;
[0046] The second-level mutation probability is greater than the first-level mutation probability.
[0047] Optionally, the industrial park sewage water quality parameter prediction model corresponding to the model parameter configuration with the highest fitness function value is selected as the final prediction model, and the method further comprises:
[0048] All training set samples used to complete the training of the industrial park sewage water quality parameter prediction model are sequentially input into the final prediction model, and a two-dimensional condensed information matrix output after processing by the long-term dependency relationship modeling layer is extracted for each sample;
[0049] All extracted two-dimensional condensed information matrices are stored in a set to construct a historical working condition feature benchmark library;
[0050] New real-time sewage data to be monitored is received, and after corresponding processing, it is input into the final prediction model to obtain its corresponding real-time two-dimensional condensed information matrix, and the vector similarity of the real-time two-dimensional condensed information matrix and each historical matrix in the historical working condition feature benchmark library is calculated, and the highest similarity score is selected based on all calculation results.
[0051] The highest similarity score is represented as a confidence score, and is output synchronously with the predicted result of the water quality parameter of the industrial park.
[0052] Optionally, vector similarity of the real-time two-dimensional concentration information matrix and each historical matrix in the historical working condition feature benchmark library is calculated, and the calculation formula is:
[0053]
[0054] wherein, is the similarity score between the real-time two-dimensional concentration information matrix and the first historical matrix , is a preset feature importance weight coefficient, representing the contribution degree of the first feature element in the vector to the evaluation of working condition similarity, , are one-dimensional feature vectors obtained by flattening the matrix and respectively, is the dimension of the one-dimensional feature vector, , are the first elements of the vectors and . The technical scheme of the present application has at least the following advantages and beneficial effects: The present application innovatively proposes a confidence evaluation mechanism for the predicted result, and by quantitatively comparing the feature matrix formed by the current real-time working condition in the model with the historical experience feature library, a confidence index that can be understood and measured is attached to each prediction, thereby completely solving the problem that the reliability of the predicted result cannot be measured in real time, and significantly improving the transparency and practical value of the system. In addition, the present application constructs an intelligent model self-adaptive optimization closed loop based on the confidence score, which can automatically screen and mark high-value difficult samples that the model feels strange or is not confident about, and in the subsequent use of these samples to perform targeted weighted retraining on the model, finally realizing the continuous learning and self-evolution of the model, and ensuring the high precision and robustness of the prediction system in long-term operation.
[0055] BRIEF DESCRIPTION OF DRAWINGS
[0056] is the flowchart of the industrial park sewage water quality parameter prediction method based on a deep neural network provided by the present application;
[0057] Figure 1 is the flowchart of the industrial park sewage water quality parameter prediction method based on a deep neural network provided by the present application;
[0058] Figure 2 A training logic diagram of the industrial park sewage water quality parameter prediction model provided by the present application is shown. DETAILED DESCRIPTION
[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.
[0060] The embodiments of the present application provide an industrial park sewage water quality parameter prediction method based on a deep neural network. Referring to FIG. 1, the overall steps of the embodiments of the present application are as follows: Figure 1
[0061] The multi-modal time series data of the industrial park sewage discharge outlet is obtained; an industrial park sewage water quality parameter prediction model is constructed, which is composed of a feature extraction module, a multi-modal fusion module, and a prediction module; an adaptive multi-objective optimization algorithm based on a genetic algorithm is defined and executed to solve the optimal parameter configuration of the industrial park sewage water quality parameter prediction model, the adaptive multi-objective optimization algorithm maximizes the value of a preset fitness function for evaluating the comprehensive performance of the model through iterative evolution; the industrial park sewage water quality parameter prediction model corresponding to the model parameter configuration with the highest fitness function value is selected as the final prediction model; and the industrial park sewage water quality parameter prediction model is deployed on an industrial park sewage monitoring terminal for receiving real-time sewage data to be monitored and outputting the prediction result of the industrial park water quality parameter.
[0062] The embodiments of the present application not only can predict the future water quality parameters with high precision, but also solve the fundamental problem that the prediction result of the traditional prediction model as a static black box is unknown in reliability and cannot adapt to the dynamic changes of working conditions. The embodiments can be deployed in the central control room or cloud server of the industrial park sewage treatment plant. The hardware basis includes a database server for data collection and storage, and a computing server equipped with a high-performance graphics processing unit (GPU) to meet the computing power requirements of deep learning model training and inference. On the edge side, an edge computing node is deployed for real-time collection and preliminary processing of water quality and flow data. On the software level, the embodiments are developed and implemented based on a deep learning framework and combined with Python language.
[0063] The embodiments of the present application refer to the application scenario of a specific industrial park sewage treatment plant to explain each step of the industrial park sewage water quality parameter prediction method based on a deep neural network of the embodiments:
[0064] Step S1: Obtain multi-modal time series data of the industrial park sewage discharge outlet and preprocess, the specific steps are as follows:
[0065] The multi-modal time series data includes water quality indicators, flow and satellite remote sensing gray scale; wherein, the water quality indicators and flow data are collected at the edge computing node, the missing value filling and abnormal value repairing are performed on the water quality indicators and flow data through the variational autoencoder, one-dimensional time series are obtained, the repaired multiple one-dimensional time series are time-aligned according to the set sampling frequency, and are spliced into a two-dimensional time sequence numerical feature matrix; the satellite remote sensing gray scale obtained periodically is subjected to texture and spatial distribution feature vector extraction through the pre-trained convolutional neural network, and each image is converted into a one-dimensional image feature vector; the one-dimensional image feature vector sequence is aligned based on the forward filling strategy with the time axis of the two-dimensional time sequence numerical feature matrix as the reference, and the aligned image features and numerical features are spliced along the feature dimension to form a two-dimensional fusion feature matrix.
[0066] The data source of the embodiment of the application is multi-modal, and comprehensively covers various direct and indirect factors affecting the change of sewage water quality. Specifically, it includes water quality indicators, flow data and satellite remote sensing gray scale. Specifically, the water quality indicators and flow data in the embodiment are collected in real time by deploying online analytical instruments and flow meters at nodes such as the total inlet of the sewage treatment plant, the adjusting tank, the anaerobic / aerobic tank, the secondary sedimentation tank, the total outlet, etc., and are collected at the edge computing node, which can effectively reduce the data transmission bandwidth and cloud computing pressure. The water quality indicators include but are not limited to pH value, temperature, dissolved oxygen (DO), chemical oxygen demand, ammonia nitrogen, total nitrogen, total phosphorus and turbidity, etc. The flow data includes the inlet and outlet flow of each processing unit, and the water quality indicators and flow data together constitute high-frequency one-dimensional time series.
[0067] The satellite remote sensing gray scale in the embodiment specifically acquires remote sensing gray scale images covering the river where the industrial park and the discharge outlet are located according to a fixed period. The remote sensing gray scale image can provide macro spatial information, and the color and texture change of the water body near the discharge outlet of the industrial park can indirectly reflect the concentration of suspended solids, the growth of algae or potential abnormal sewage events.
[0068] Due to the inevitable problems of noise, missing, abnormality, different sampling frequencies and data modal heterogeneity in the originally collected data, if the data is directly input into the model without processing, it will seriously affect the training effect and prediction accuracy of the model, therefore, the embodiment defines the following preprocessing process:
[0069] Specifically, for numerical modal data, i.e. water quality indicators and flow data, the embodiment adopts a variational autoencoder VAE for processing. Specifically, VAE is a generative deep learning model that maps input data to a low-dimensional latent space distribution through an encoder, and then samples and reconstructs the original data from the latent space distribution. VAE learns the internal distribution of normal data and the correlation between variables during training. When inputting a data point containing an abnormal value, its projection in the latent space will deviate from the distribution area of normal data, and the decoder will tend to generate normal values that are more consistent with the overall data distribution during reconstruction, thereby achieving abnormal value repair. In addition, for missing values, VAE can generate the most likely and reasonable filling value based on the context information. The embodiment specifically trains the VAE model with the processed historical numerical time series data. During real-time processing, the embodiment inputs the collected new data segment into the pre-trained VAE, and the reconstruction output is the repaired data. Since different sensors have different sampling frequencies, the embodiment sets a unified reference sampling frequency of 5 minutes. For high-frequency data, the embodiment uses the average or median value within the time window for down-sampling; for low-frequency data, the embodiment uses forward filling for up-sampling. After alignment, all repaired one-dimensional time series are concatenated along the feature dimension to form a two-dimensional time series numerical feature matrix. The shape of the matrix is wherein, is the number of time steps, is the number of numerical features.
[0070] Specifically, for image modal data, i.e. satellite remote sensing grayscale images, since the original satellite image is a high-dimensional pixel matrix, it cannot be directly fused with numerical features. The embodiment uses a pre-trained convolutional neural network CNN to extract its deep texture and spatial distribution features. Specifically, the embodiment uses a CNN model pre-trained on a large image dataset, removes its top fully connected classification layer, and retains its convolutional base. A single satellite remote sensing grayscale image is input into the convolutional base, and the output is a high-dimensional feature map that condenses rich information such as edges, corners, textures, shapes, etc. in the image. The feature map is converted into a fixed-length one-dimensional image feature vector which is a compact representation of the original image in the semantic space. In addition, in order to align the low-frequency satellite remote sensing grayscale image with the high-frequency numerical feature matrix, the embodiment uses a forward filling strategy: taking the time axis of the two-dimensional time series numerical feature matrix as the reference, assuming that a new satellite image is obtained at and its feature vector is extracted. Then, from to the time when the next satellite image arrives, all image feature vectors corresponding to the time steps use The filling is performed, so that an image feature sequence with the same time step as the two-dimensional time series numerical feature matrix is obtained , forming an image feature matrix with a shape of , wherein, is the dimension of the one-dimensional image feature vector.
[0071] The aligned image feature matrix and the numerical feature matrix are spliced along the feature dimension, so as to obtain a two-dimensional pre-fusion feature matrix with a shape of .
[0072] Step S2: adaptive weighted fusion based on mutual information, the specific steps are as follows:
[0073] The historical multi-modal time series data and the real water quality parameter target value sequence corresponding thereto are received; for each mode, the mutual information scalar value between the time series data of the corresponding mode and the target value time series is calculated; the mutual information scalar values of all modes are normalized by the Softmax function to obtain a static weight vector of each mode; a two-dimensional pre-fusion feature matrix is obtained in real time; according to a pre-defined mapping relationship between the feature column and the mode, each weight scalar in the static weight vector of each mode is multiplied with all feature columns belonging to the corresponding mode in the two-dimensional pre-fusion feature matrix to obtain a two-dimensional weighted post-fusion feature matrix.
[0074] Specifically, the embodiment receives historical multi-modal time series data, i.e., all historical data used for training the model, and the real water quality parameter target value sequence corresponding thereto , and based on the prediction of water quality parameters in different industrial parks, the historical effluent COD real measurement value sequence can be subdivided. All features are divided into different modes, which are specifically divided into three modes in the embodiment:
[0075] Mode 1: a water quality index set, which comes from part of the columns of the two-dimensional time series numerical feature matrix;
[0076] Mode 2: a flow index set, which comes from the remaining columns of the two-dimensional time series numerical feature matrix;
[0077] Mode 3: a satellite remote sensing feature set, which comes from all columns of the image feature matrix.
[0078] The embodiment calculates the mutual information scalar value between the time series data and the target value time series for each mode. Mutual information measures the degree of reduction in uncertainty of one variable after knowing another variable , and its calculation formula is:
[0079]
[0080] wherein, is and the joint probability distribution, and are the marginal probability distributions. Based on the above calculation, the mutual information values between the water quality modal, the flow modal, the remote sensing modal and the target value are solved to obtain the water quality modal mutual information scalar, the flow modal mutual information scalar and the remote sensing modal mutual information scalar. The greater the mutual information scalar value is, the more prediction information about the target value the corresponding modal contains. Finally, the mutual information scalar values of all the calculated modes are normalized by the Softmax function to obtain the static weight vector of each modal, and the calculation formula is:
[0081]
[0082] wherein, is the weight of the th modal, is the total number of modes.
[0083] In real-time prediction, the real-time two-dimensional pre-fusion feature matrix is obtained through step S1, and the static weight is applied to each column of the two-dimensional pre-fusion feature matrix according to the pre-defined mapping relationship between the feature column and the modal. By traversing each feature column of the two-dimensional pre-fusion feature matrix, if a column belongs to the water quality modal, all elements of the column are multiplied by the water quality modal weight; if it belongs to the remote sensing modal, it is multiplied by the remote sensing modal weight, and so on. After the above weighting, the two-dimensional weighted post-fusion feature matrix is obtained.
[0084] Step S3: constructing a four-layer deep neural network prediction model, which specifically includes:
[0085] a local time sequence feature extraction layer, which receives the two-dimensional weighted post-fusion feature matrix, performs batch processing on the two-dimensional weighted post-fusion feature matrix, and obtains a three-dimensional time sequence input tensor. The three-dimensional time sequence input tensor is characterized as an input sample, and a sliding convolution operation is performed along the time step dimension by multiple one-dimensional convolution kernels to extract a three-dimensional local feature tensor.
[0086] In this embodiment, the local time sequence feature extraction layer is composed of a one-dimensional convolutional neural network (1D-CNN). When working, multiple convolution kernels in the 1D-CNN perform sliding convolution operation along the time step dimension of the input three-dimensional time sequence tensor. After this operation is performed, a three-dimensional local feature tensor containing multiple local mode information is directly obtained, and is transmitted to the next layer as output.
[0087] a temporal importance dynamic weighting layer, which receives the three-dimensional local feature tensor, calculates a correlation score between each element inside the tensor in the time step dimension, and re-aggregates the sequence information based on the correlation score to obtain a three-dimensional context-aware tensor.
[0088] In this embodiment, the temporal importance dynamic weighting layer is composed of a temporal self-attention mechanism. The temporal self-attention mechanism receives the three-dimensional local feature tensor transmitted from the previous layer, generates query, key and value matrices through internal calculation, and calculates attention weights for each time step in the sequence based on the matrices. The three-dimensional context-aware tensor is obtained by weighted summation of the value matrix through the weights.
[0089] a long-term dependency modeling layer, which receives the three-dimensional context-aware tensor, sequentially processes the three-dimensional context-aware tensor along the time step dimension through a gated recurrent unit network, and outputs a two-dimensional condensed information matrix after completing the processing of the last time step.
[0090] In this embodiment, the long-term dependency modeling layer is composed of a gated recurrent unit (GRU) network. The GRU network receives the three-dimensional context-aware tensor in time sequence. At each time step, the GRU unit processes the current input and updates its hidden state according to its internal update gate and reset gate, and collects all the hidden states of the time steps when the sequence processing is completed, thereby constituting the two-dimensional condensed information matrix.
[0091] a result prediction layer, which receives the two-dimensional condensed information matrix, and performs nonlinear transformation and feature space mapping through a fully connected layer to obtain a two-dimensional prediction result matrix, wherein each row in the two-dimensional prediction result matrix represents a predicted value of a water quality parameter of a corresponding input sample.
[0092] In this embodiment, the result prediction layer is composed of a fully connected network. The fully connected network receives the two-dimensional condensed information matrix output by the previous layer, and maps it to the preset output dimension, i.e., the number of water quality parameters to be predicted, through linear transformation and nonlinear activation function. The two-dimensional prediction result matrix output by the fully connected network is the predicted value of the water quality parameter of an input sample.
[0093] Step S4: model training and hyperparameter optimization, which includes the following specific steps:
[0094] Based on historical multi-modal time series data and corresponding real water quality parameter target value sequence, a training set is constructed; all training parameters in the industrial park sewage water quality parameter prediction model, including local time series feature extraction layer, time series importance dynamic weighting layer, long-term dependence modeling layer and result prediction layer, are initialized; the training set is input to the local time series feature extraction layer in the industrial park sewage water quality parameter prediction model for sliding convolution operation, and the extracted local feature data is sequentially sent to the time series importance dynamic weighting layer for information aggregation and the long-term dependence modeling layer for time series dependence learning, and the prediction result of the industrial park sewage water quality parameter is obtained through the nonlinear transformation of the result prediction layer; the loss value of the prediction result relative to the real label of the training set is calculated, and the gradient is calculated in reverse according to the loss value to update all training parameters of the industrial park sewage water quality parameter prediction model, and the training is completed after the training round reaches the preset maximum iteration number.
[0095] As shown in Figure 2 In this embodiment, a batch of training samples, i.e. data processed by step S2, is input into the deep neural network prediction model constructed in step S3, and after layer-by-layer calculation, a two-dimensional prediction result matrix is finally obtained in the result prediction layer. The prediction result of the model is compared with the real water quality parameter value corresponding to the batch of samples, and the difference between the two, i.e. the loss value, is calculated by the preset loss function. It can be understood that the preset loss function can adopt mean square error, etc., and the embodiment will not be described in detail. According to the calculated loss value, the gradient of the loss to each trainable parameter in the model is calculated by using the back propagation algorithm. Then, the optimizer updates all trainable parameters of the model according to the gradient, so that the loss value produced by the model in the next prediction tends to be smaller. This process is repeatedly performed until the preset training termination condition is reached.
[0096] In the specific application of this embodiment, the hyperparameter optimization of the industrial park sewage water quality parameter prediction model based on the self-adaptive multi-objective genetic algorithm is as follows:
[0097] The hyperparameters of the industrial park wastewater quality parameter prediction model and the preset partially trainable weight matrix are jointly encoded into individual chromosomes, and an initial population is generated in the preset value space of each encoded parameter through Latin hypercube sampling. For each individual in the initial population, the fitness function value is calculated according to the parameter configuration of the industrial park wastewater quality parameter prediction model decoded from its chromosome. In the current population, based on the elite retention strategy and crowding comparison, individuals are selected from the current population in descending order of fitness as parents. The selected parent individuals are subjected to simulated binary crossover, and the generated offspring individuals are subjected to adaptive mutation to generate a new offspring population. The above steps are repeated until the preset maximum number of generations is reached to complete the optimization, and the individual with the highest fitness is decoded as the optimal parameter configuration of the industrial park wastewater quality parameter prediction model.
[0098] In this implementation, two optimization objects are jointly encoded to form individual chromosomes in the genetic algorithm. The two objects are: hyperparameters of the deep neural network prediction model, such as learning rate, batch size, number of neurons or convolutional kernels in each network layer, etc. A pre-set trainable weight matrix, such as the initial weight values of the model, is used to guide model training to avoid undesirable local optima. To ensure the diversity of the initial population and avoid the search getting trapped in local optima too early, this embodiment uses Latin hypercube sampling to uniformly generate the initial population within the pre-set value space of each encoding parameter. The quality of each individual in the population is evaluated using a comprehensive fitness function defined in this embodiment, the specific calculation formula of which is:
[0099]
[0100] in, The model parameter configuration representing the current individual includes network structure hyperparameters and weights. To indicate that the parameter is configured as The model fitness function value, This represents the expected robust accuracy of the model. To determine the number of samples in the validation set, For the model to the first The predicted value for each sample, For the first The true value of each sample The standard deviation parameter is preset. For parameters The total number of parameters in the configured model. For parameters The average latency of a single inference attempt for the configured model on the target edge device. The number of components representing the model complexity. For the first Sub-item values of model complexity is a performance improvement amount, is a preset exponential scaling factor, is a resource utilization indicator, is a number of time series components, is an index, is a preset time decay constant, are preset weight coefficients for balancing model robustness, complexity, and data efficiency, respectively. The fitness function calculation of the embodiment is divided into two steps, and the final product of the two steps is the final fitness value of the individual. Specifically: first, calculate the basic fitness of the model through a quotient value to achieve the trade-off between performance and cost. The numerator of the quotient value is the robust accuracy of the model, which is quantified by applying a Gaussian kernel transformation to the prediction error and summing it up, and then multiplying it by a robustness gain coefficient. The higher the score represents the more accurate and stable the model prediction. The denominator of the quotient value is the comprehensive complexity of the model, which adds the punishment of the total number of model parameters, the punishment of single inference delay, and the punishment of key structural unit complexity as a comprehensive cost indicator. Second, multiply the calculated basic fitness by a dynamic balance adjustment factor to achieve adaptive optimization of the algorithm. The adjustment factor is dynamically calculated according to the current evolution generation, population diversity, and the number of Pareto frontier solutions. Its role is to increase the fitness value in the early evolution to encourage extensive exploration, and to weaken the effect in the later evolution to promote deep convergence to good solutions.
[0101] The embodiment finds the optimal solution through iterative evolution, and each generation of evolution performs the following operations:
[0102] Evaluation and selection: for each individual in the current population, decode its chromosome, build and train a temporary model, and then calculate its fitness value according to the above fitness function F(Θ). According to the height of the fitness value, adopt strategies such as roulette selection or elite reservation to select good individuals into the next generation.
[0103] Crossover: perform crossover operations (e.g., simulated binary crossover) on the selected parent individuals to generate new offspring individuals, thereby combining the excellent genes of the parents.
[0104] Adaptive mutation: perform adaptive mutation operations on the offspring individuals, which is one of the key innovations of the algorithm. Its specific working principle is as follows:
[0105] Before each mutation operation, first calculate the average fitness value of the current population.
[0106] For individuals with a fitness value higher than or equal to the average fitness value, assign them a lower mutation probability corresponding to the first level mutation probability, which aims to protect their excellent gene structure from being easily destroyed.
[0107] For individuals with fitness values lower than the average fitness value, a higher mutation probability corresponding to the second level mutation probability is assigned to them. This is intended to encourage them to explore a wider range of random exploration to help the population jump out of the local optimum.
[0108] By repeatedly executing the cycle of "evaluation, selection, crossover, adaptive mutation", until the maximum evolution generation is reached or the fitness is no longer significantly improved, the algorithm terminates. Finally, the individual with the highest fitness in the entire evolution process is decoded, and its corresponding hyperparameters and initial weights are confirmed as the best parameter configuration, which is used to build the final deep neural network prediction model.
[0109] Step S5: Model deployment and online prediction based on confidence score, the specific steps are:
[0110] All training set samples used to complete the training of the industrial park sewage water quality parameter prediction model are sequentially input into the final prediction model, and the two-dimensional condensed information matrix output after each sample is processed by the long-term dependence relationship modeling layer is extracted; all extracted two-dimensional condensed information matrices are stored to build a historical working condition feature benchmark library; receive new real-time monitoring sewage data, and after corresponding processing, input it into the final prediction model to obtain its corresponding real-time two-dimensional condensed information matrix, and calculate the vector similarity between the real-time two-dimensional condensed information matrix and each historical matrix in the historical working condition feature benchmark library:
[0111]
[0112] Among them, is the similarity score between the real-time two-dimensional condensed information matrix and the first historical matrix , is a preset feature importance weight coefficient, representing the contribution of the first feature element in the vector to the evaluation of working condition similarity, , are one-dimensional feature vectors obtained by flattening the matrices and respectively, is the dimension of the one-dimensional feature vector, , are the first elements of vectors and respectively.
[0113] Select the highest similarity score based on all calculation results; represent the highest similarity score as a confidence score, and output it synchronously with the prediction result of the industrial park water quality parameter.
[0114] In implementation, after the adaptive multi-objective optimization algorithm is executed, the individual with the highest fitness function value is selected, and the parameters decoded from the individual are configured to construct the final industrial park sewage water quality parameter prediction model. To establish the confidence evaluation mechanism of the prediction results of the model, a historical working condition feature benchmark library needs to be first constructed, and the construction logic is as follows: all training set samples are input into the final prediction model in turn, and the two-dimensional condensed information matrix output after each sample is processed by the long-term dependence relationship modeling layer is extracted, and then all extracted matrices are stored. In the model deployment and application stage, when receiving new real-time sewage data to be monitored, the system inputs the data into the final prediction model to obtain the corresponding real-time two-dimensional condensed information matrix, and calculates the vector similarity between the real-time matrix and each historical matrix in the historical working condition feature benchmark library. The calculation logic of the similarity is as follows: the real-time matrix and the historical matrix are first flattened into one-dimensional feature vectors, and then the weighted similarity between the two vectors is calculated according to the preset feature importance weight coefficient, wherein the weight coefficient represents the contribution degree of each feature element to the evaluation of the working condition similarity. Finally, the highest similarity score is selected from all calculation results, which is represented as the confidence score of this prediction, and is output synchronously with the water quality parameter prediction result output by the model.
[0115] Through the above steps, the embodiment of the present application not only provides prediction, but also quantifies the reliability of the prediction, providing unprecedented decision transparency and risk basis for decision makers. In addition, the appearance of the low confidence score also provides an explicit trigger signal and a high-value learning sample for subsequent adaptive optimization of the model, constituting the basis for the continuous evolution of the model.
[0116] The above is only the preferred embodiment of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting wastewater quality parameters in industrial parks based on deep neural networks, characterized in that, The steps of this method include: Acquire multimodal time series data of wastewater discharge outlets in industrial parks. The multimodal time series data includes water quality indicators, flow rate, and satellite remote sensing grayscale images. A prediction model for wastewater quality parameters in industrial parks is constructed. The prediction model for wastewater quality parameters in industrial parks consists of a local time series feature extraction layer, a time series importance dynamic weighting layer, a long-term dependency modeling layer, and a result prediction layer. Define and execute an adaptive multi-objective optimization algorithm based on genetic algorithm to solve the optimal parameter configuration of the industrial park wastewater quality parameter prediction model. The adaptive multi-objective optimization algorithm maximizes the value of the preset fitness function used to evaluate the overall performance of the model through iterative evolution. The model with the highest fitness function value is selected as the final prediction model for the industrial park wastewater quality parameters. The wastewater quality parameter prediction model of the industrial park is deployed on the wastewater monitoring terminal of the industrial park to receive real-time wastewater data to be monitored and output the prediction results of the wastewater quality parameters of the industrial park. The fitness function, and its specific calculation formula is as follows: in, The model parameter configuration representing the current individual includes network structure hyperparameters and weights. To indicate that the parameter is configured as The model fitness function value, This represents the expected robust accuracy of the model. To determine the number of samples in the validation set, For the model to the first The predicted value for each sample, For the first The true value of each sample The standard deviation parameter is preset. For parameters The total number of parameters in the configured model. For parameters The average latency of a single inference attempt for the configured model on the target edge device. The number of components representing the model complexity. For the first Sub-item values of model complexity For performance improvement, This is the preset exponential scaling factor. As a resource utilization rate indicator, The number of time series components. For indexing, The preset time decay constant, These are preset weighting coefficients used to balance model robustness, complexity, and data efficiency.
2. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 1, characterized in that, After acquiring the multimodal time series data of the industrial park's wastewater discharge outlets, preprocessing is also included, specifically: Collect multimodal time series data; Among them, water quality indicators and flow data are collected at edge computing nodes, and missing values are filled and outliers are repaired by variational autoencoders to obtain a one-dimensional time series. The repaired one-dimensional time series are time-aligned according to the set sampling frequency and spliced into a two-dimensional time series numerical feature matrix. For satellite remote sensing grayscale images acquired periodically, a pre-trained convolutional neural network is used to extract texture and spatial distribution feature vectors from the satellite remote sensing grayscale images, and each image is converted into a one-dimensional image feature vector. Using the time axis of the two-dimensional time-series numerical feature matrix as a reference, the one-dimensional image feature vector sequence is aligned based on the forward padding strategy. The aligned image features and numerical features are then concatenated along the feature dimension to form a two-dimensional pre-fusion feature matrix.
3. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 2, characterized in that, An adaptive weighted fusion algorithm based on mutual information is used to process multimodal time series data, specifically as follows: Receive historical multimodal time series data and the corresponding sequence of target values for real water quality parameters; For each mode, calculate the mutual information scalar value between the time series data of the corresponding mode and the time series of the target value; The mutual information scalar values of all modes are normalized using the Softmax function to obtain the static weight vector of each mode. Real-time acquisition of the feature matrix before 2D fusion; Based on the predefined mapping relationship between feature columns and modes, each weight scalar in the static weight vector of each mode is multiplied element-wise with all feature columns belonging to its corresponding mode in the feature matrix before two-dimensional fusion, to obtain the feature matrix after two-dimensional weighted fusion.
4. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 3, characterized in that, A wastewater quality parameter prediction model for industrial parks is constructed, specifically as follows: The local temporal feature extraction layer receives a two-dimensional weighted fused feature matrix, performs batch processing on the two-dimensional weighted fused feature matrix to obtain a three-dimensional time series input tensor. The three-dimensional time series input tensor is represented as an input sample. Multiple one-dimensional convolution kernels are used to perform sliding convolution operations along the time step dimension to extract the three-dimensional local feature tensor. The temporal importance dynamic weighting layer receives a three-dimensional local feature tensor, calculates the correlation score between each element within the time step dimension, and re-aggregates sequence information based on the correlation score to obtain a three-dimensional context-aware tensor. The long-term dependency modeling layer receives a three-dimensional context-aware tensor and processes it sequentially along the time step dimension through a gated recurrent unit network until the processing of the last time step is completed, and then outputs a two-dimensional condensed information matrix. The result prediction layer receives a two-dimensional condensed information matrix and performs nonlinear transformation and feature space mapping through a fully connected layer to obtain a two-dimensional prediction result matrix. Each row in the two-dimensional prediction result matrix represents the predicted value of the water quality parameters of the corresponding input sample.
5. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 4, characterized in that, The training process for the wastewater quality parameter prediction model in industrial parks is as follows: A training set is constructed based on historical multimodal time series data and the corresponding real water quality parameter target value sequences; The initialization model for predicting wastewater quality parameters in industrial parks includes all training parameters, including the local time-series feature extraction layer, the time-series importance dynamic weighting layer, the long-term dependency modeling layer, and the result prediction layer. The training set is input into the local temporal feature extraction layer of the industrial park wastewater quality parameter prediction model and a sliding convolution operation is performed. The extracted local feature data is then sequentially fed into the temporal importance dynamic weighting layer for information aggregation and long-term dependency modeling layer for temporal dependency learning. The prediction results of industrial park wastewater quality parameters are obtained through the nonlinear transformation of the result prediction layer. The loss value of the prediction result relative to the true label of the training set is calculated, and the gradient is calculated in reverse based on the loss value to update all training parameters of the industrial park wastewater quality parameter prediction model. The process is repeated until the training rounds reach the preset maximum number of iterations, and then the training of the industrial park wastewater quality parameter prediction model is completed.
6. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 5, characterized in that, An adaptive multi-objective optimization algorithm based on genetic algorithm is defined and executed to solve for the optimal parameter configuration of the industrial park wastewater quality parameter prediction model. Specifically: The hyperparameters of the industrial park wastewater quality parameter prediction model and the preset partially trainable weight matrix are jointly encoded into individual chromosomes, and an initial population is generated in the preset value space of each encoded parameter through Latin hypercube sampling. For each individual in the initial population, the fitness function value is calculated based on the parameter configuration of the industrial park wastewater quality parameter prediction model decoded from its chromosome. In the current population, based on the elite preservation strategy and crowding comparison, individuals are selected from the current population in descending order of fitness to serve as parents. The selected parent individuals are subjected to simulated binary crossover, and the generated offspring individuals are subjected to adaptive mutation to generate a new offspring population. Repeat the above steps until the preset maximum number of generations is reached, complete the optimization, and decode the individual with the highest fitness as the optimal parameter configuration for the industrial park wastewater quality parameter prediction model.
7. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 6, characterized in that, The adaptive mutation operation is as follows: Before each iteration begins, calculate the average fitness value of all individuals in the current population. For each individual in the population, its own fitness value is compared with the average fitness value; For individuals with fitness values higher than or equal to the average fitness value, a preset first-level mutation probability is assigned; For individuals with fitness values lower than the average fitness value, a preset second-level mutation probability is assigned; The mutation probability of the second level is greater than that of the first level.
8. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 7, characterized in that, The model with the highest fitness function value is selected as the final prediction model for the industrial park wastewater quality parameters. This also includes: All training set samples used to complete the prediction model of wastewater quality parameters in industrial parks are sequentially input into the final prediction model, and the two-dimensional condensed information matrix output by each sample after processing by the long-term dependency modeling layer is extracted. The system collects and stores all extracted two-dimensional condensed information matrices to construct a historical operating condition feature benchmark library. New real-time wastewater data to be monitored is received, processed accordingly, and then input into the final prediction model to obtain its corresponding real-time two-dimensional concentrated information matrix. The vector similarity between the real-time two-dimensional concentrated information matrix and each historical matrix in the historical operating condition feature benchmark library is calculated, and the highest similarity score is selected based on all calculation results. The highest similarity score is represented as a confidence score and is output synchronously with the prediction results of water quality parameters in the industrial park.
9. The method for predicting wastewater quality parameters in industrial parks based on deep neural networks according to claim 8, characterized in that, The vector similarity between the real-time two-dimensional condensed information matrix and each historical matrix in the historical operating condition feature benchmark library is calculated using the following formula: in, For real-time two-dimensional condensed information matrix With the Historical Matrix Similarity score between them The preset feature importance weight coefficients represent the weights of the first feature in the vector. The contribution of each feature element to the assessment of working condition similarity , Each by matrix and The one-dimensional feature vector obtained after flattening The dimension of a one-dimensional feature vector. , They are vectors and The Each element.
Citation Information
Patent Citations
Transformer fault diagnosis method based on principal component analysis and twin support vector machine
CN111639722A
Water quality prediction method for optimizing LSTM neural network based on improved genetic algorithm
CN111915097A