COD (Chemical Oxygen Demand) prediction method based on two-channel convolution time sequence mechanism

By applying the combination of dual-channel convolution and dual attention memory network in wastewater treatment, the problem of insufficient prediction accuracy of existing models when processing large-scale, nonlinear, and high-dimensional data is solved, and more efficient feature extraction and COD prediction effects are achieved.

CN119557631AInactive Publication Date: 2025-03-04JIANGXI NORMAL UNIV +1

Patent Information

Application Number
CN202510125398.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-27
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the COD prediction model in existing wastewater treatment faces large-scale, nonlinear, and high-dimensional data, the prediction accuracy is not high, and it is difficult to effectively capture the long-term dependencies in time series data.

Method used

A new structure based on dual-channel convolution and dual attention memory network is adopted, and COD influence factors are further divided through dual-channel convolution, feature extraction capabilities are enhanced, and long-term dependencies in time series data are captured through dual attention memory network.

Benefits of technology

It significantly improves the feature extraction ability and prediction accuracy of the model, can more accurately capture the changes in COD values ​​in wastewater treatment, and enhances the generalization ability and calculation efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557631A_ABST
    Figure CN119557631A_ABST
Patent Text Reader

Abstract

The invention discloses a COD (Chemical Oxygen Demand) prediction method based on a two-channel convolution time sequence mechanism, which comprises the following steps of: acquiring COD original data for preprocessing to obtain COD input characteristics; constructing a prediction model, and importing data into a dual-channel convolution module; importing the first double-channel convolution output feature vector and the second double-channel convolution output feature vector into a double attention memory network to obtain a time sequence dependence feature; the time sequence dependence characteristics are imported into an output module, and predicted COD output is obtained; training the model, and in the training process, optimizing hyper-parameters of the model based on an improved pelican algorithm; and importing real-time COD original data into the trained model, and obtaining real-time COD output. According to the method, a high-efficiency effluent COD content prediction model of the sewage treatment plant is constructed by creatively fusing the two-channel convolution and the double-attention memory network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of data processing, and in particular is a COD prediction method based on a dual-channel convolution timing mechanism. Background Art

[0002] With the accelerated advancement of industrialization and urbanization, sewage treatment has become an urgent task in the field of environmental protection. As a core indicator for assessing the degree of organic pollution in water bodies, the accurate prediction of chemical oxygen demand (COD) is crucial for the operation and management of sewage treatment plants and water quality control. However, traditional COD detection methods have many shortcomings, such as long detection cycle, high cost, complex operation, and difficulty in meeting the needs of real-time monitoring. At the same time, the dynamic changes of water quality in the sewage treatment process are highly nonlinear, time-varying and complex. These characteristics make it difficult for traditional prediction models to accurately capture them, resulting in unsatisfactory prediction accuracy. In recent years, artificial intelligence technology has been increasingly used in the field of sewage treatment, especially deep learning models have made significant progress in water quality prediction. Artificial neural networks (ANN) have been widely used in the prediction of effluent COD and biochemical oxygen demand (BOD) due to their powerful nonlinear modeling capabilities. Models such as long short-term memory networks (LSTM) and gated recurrent units (GRU) have effectively improved the performance of water quality prediction models by introducing time series information. The quantum weighted minimum threshold unit (QWMGU) model takes into account both prediction accuracy and computational efficiency while maintaining high stability, providing a new solution for the prediction of key water quality parameters in the sewage treatment process.

[0003] Nevertheless, existing technologies mainly rely on traditional machine learning methods, such as support vector machines (SVM) and random forests, which perform well when dealing with small-scale, linear problems, but their performance is limited when faced with large-scale, nonlinear, and high-dimensional sewage treatment data. In addition, these models usually lack effective capture of long-term dependencies in time series data, resulting in low prediction accuracy. Deep learning methods, especially convolutional neural networks (CNN) and recurrent neural networks (RNN), have demonstrated powerful feature extraction capabilities in image and sequence data processing, but in sewage treatment COD prediction, due to the complexity and nonlinearity of the data, a single model is difficult to meet the needs of high-precision prediction. Summary of the invention

[0004] In response to these challenges, this paper proposes a new dual-channel convolutional neural network structure by innovatively integrating dual-channel convolution and dual-attention memory network, aiming to significantly enhance the feature extraction capability of the model. This structure not only improves the efficiency of feature extraction, but also provides richer information for subsequent time series analysis. In addition, the dual-attention memory network effectively captures the long-term dependencies and key features in the time series data, solves the limitations of traditional time series analysis methods in dealing with nonlinear and high-dimensional data, and provides a smarter and more accurate solution for COD prediction in sewage treatment.

[0005] In view of the shortcomings of the prior art, the present invention proposes a COD prediction method based on a dual-channel convolution timing mechanism, comprising the following steps: Step S1: Collect COD raw data for preprocessing, obtain COD input features, and construct a data set based on them; Step S2: construct a prediction model, which includes a dual-channel convolution module, a dual-attention memory network and an output module, import the data in the data set in step S1 into the dual-channel convolution module, and obtain the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector in parallel; Step S3: importing the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector in step S2 into the dual attention memory network to obtain temporal dependency features; Step S5: training the model. During the training process, the hyperparameters of the model are optimized based on the improved Pelican algorithm. The hyperparameters include: the hidden layer dimension of the dual-channel convolution module, the number of hidden units of the dual attention memory network, the learning rate, and the batch size. Step S6: importing the real-time acquired COD raw data for preprocessing to obtain the corresponding COD input features; importing the real-time COD input features into the prediction model to obtain the real-time predicted COD output; The optimization of the model's hyperparameters based on the improved Pelican algorithm in step S5 includes: Step S51: Initialize the population; Step S52: exploration and development phase; Step S53: social learning stage; Step S54: Evaluate the fitness of each individual pelican position according to the fitness function, and obtain the individual pelican position corresponding to the optimal fitness value; Repeat S51 to S54 until the optimal individual pelican position is obtained as output; In step S52 and step S53, the Levy flight strategy is used to increase the randomness and globality of the search.

[0006] Furthermore, step S1 is specifically as follows:

[0007] Step S11: Real-time collection of COD raw data from the water plant , COD raw data Including: effluent COD, urban sewage section influent COD, urban sewage section influent total nitrogen, urban sewage section influent ammonia nitrogen, urban sewage section oxidation ditch anoxic section DO, urban sewage section oxidation ditch aerobic section MLSS, industrial sewage section influent COD, industrial sewage section influent total nitrogen, industrial sewage section influent ammonia nitrogen, industrial sewage section oxidation ditch aerobic section DO and industrial sewage section oxidation ditch aerobic section MLSS, formalized as: ; in, They represent the effluent COD, the influent COD of the urban sewage section, the influent total nitrogen of the urban sewage section, the influent ammonia nitrogen of the urban sewage section, the DO of the anoxic section of the urban sewage section oxidation ditch, the MLSS of the aerobic section of the urban sewage section oxidation ditch, the influent COD of the industrial sewage section, the influent total nitrogen of the industrial sewage section, the influent ammonia nitrogen of the industrial sewage section, the DO of the aerobic section of the industrial sewage section oxidation ditch, and the MLSS of the aerobic section of the industrial sewage section oxidation ditch; Step S12: Preprocess the raw data. The preprocessing process includes removing outliers and filling missing values, obtaining COD input features and constructing a data set based on them.

[0008] Furthermore, in step S2, the data in the data set in step S1 is imported into the dual-channel convolution module, and the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector are obtained in parallel; specifically: Step S21: Classify the COD input feature into urban sewage segment and industrial sewage segment, expressed as: ; ; in, Represents the COD input characteristics of the urban sewage section, Represents the COD input characteristics of the industrial wastewater section; and As parallel input to a two-channel convolutional neural network; Step S22: normalize the parallel inputs to achieve standardization, which is expressed as: ; ; in, represents the standardized COD input characteristics of the urban sewage section, Represents the standardized COD input characteristics of the industrial wastewater section; express The minimum value in express The maximum value in express The minimum value in express The maximum value in ; Step S23: The two sets of data are passed in parallel to the one-dimensional convolution layer to extract local features, and the input data is scanned through the filter; it is expressed as: ; ; in, represents the convolution kernel, represents the weight of the convolution kernel, and Indicates that the input data is at position The value of , * indicates the convolution operation; Step S24: Use the ReLU activation function to introduce nonlinearity, enhance the model's ability to capture complex relationships, and obtain multidimensional feature maps T1 and T2, expressed as: ; ; In the formula, is the input value, ReLU activation function. Step S25: Flatten the multidimensional feature maps T1 and T2 obtained in step S24 into corresponding one-dimensional array vectors using the Flatten function and , expressed as: ; ; in, represents the continuous product, Represents an index; Step S26: Fully connected layer for one-dimensional array vector and Further combination, through the weight matrix W and bias b to combine the features, obtain the corresponding output feature vector, expressed as: ; ; In the formula, , Represents the output feature vector, that is, the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector.

[0009] Furthermore, step S3 is specifically as follows: Step S31: Output feature vector of the first dual-channel convolution And the second two-channel convolution output feature vector Integrate into feature sequences ,in, represents the feature vector at the nth time step; Step S32: Cut the feature sequence F to construct a subsequence for input ; Each subsequence contains 9 consecutive time steps, expressed as: Where j is the starting index of the subsequence, and the value range of j is [1, n−8]; Formalize the prediction task of the dual attention memory network, specifically: input the first 8 time steps To predict the 9th time step COD value; Step S32: Subsequence The input embedding layer is converted into a subsequence containing 8 time steps. As labels for training, the embedded subsequence features are represented as: ; Where E is the weight matrix of the embedding layer, represents a subsequence containing 8 time steps, is the embedded subsequence feature; Step S33: Input the subsequence features into the dual-channel BiLSTM layer to capture the long-term dependencies in the time series data and obtain the predicted time series dependency features.

[0010] Furthermore, the BiLSTM layer in step S33 includes two LSTMs connected in series, one for processing the forward sequence and the other for processing the reverse sequence; specifically: the forward LSTM processes data in the original order of the subsequence features, and the reverse LSTM processes data in the reverse order of the subsequence features; Its forward LSTM processing flow is: Step S33A1: Forget gate: At each time step t, the forward LSTM is based on the hidden state of the previous time step and the subsequence features of the current input Calculating the forget gate , determine the slave unit status How much information is retained in ; expressed as: in, represents the sigmoid function, is the bias of the forget gate, is the hidden state at the previous time step, represents the subsequence features of the input, Represents the weight matrix of the forget gate; Step S33A2: Input gate and candidate cell states: Input gate and candidate cell status Determines how much new information will be added to the cell state In; expressed as: ; ; in, is the input gate, is the candidate cell state, and are the weight matrices of the input gate and candidate unit states, respectively. and Bias representing the input gate and candidate cell states; Step S33A3: Unit status: Unit status Combine the update results of the forget gate and the input gate to capture long-term dependencies; expressed as: ; in, is the cell state at the current time step, is the cell state at the previous time step; Step S33A4: Output gate and hidden state: Output gate and hidden state based on and Calculate and determine the information output to the next time step, expressed as: ; ; in, represents the output gate, represents the hidden state of the current time step, represents the weight of the output gate, is the bias term of the output gate; The reverse order of the subsequence features of the input processed by the reverse LSTM; for time step t, the input to the reverse LSTM is , where T is the total length of the sequence, T=8; The reverse LSTM obtains the hidden state of the current time step of the reverse LSTM in the same processing flow as steps S33A1 to S33A4. ; Concatenate the hidden states of the forward LSTM and reverse LSTM outputs to obtain Output of the layer , that is, the time series dependency feature, expressed as: .

[0011] Furthermore, the output module in step S4 uses a fully connected layer; Step S4 is specifically as follows: Step S42: Obtain the time-dependent features and process them through a fully connected layer to obtain the prediction output, which is expressed as: ; In the formula, is the predicted COD output, is the weight matrix of the fully connected layer, is the bias term of the fully connected layer; is the hyperbolic tangent activation function.

[0012] Furthermore, step S5 is specifically as follows: Step S51: Initialize the population, expressed as: ; Where C represents the pelican population matrix, represents the position of the i-th pelican individual, represents the position of the Nth pelican individual, m is the preset total number of hyperparameters, represents the total number of individual pelican positions, represents the eigenvalue corresponding to the jth hyperparameter in the position of the i-th pelican individual; initialization , expressed as: ; in, and denote the lower and upper bounds of the jth hyperparameter, respectively. Represents a random number in the interval [0,1]; Step S52: Exploration and development phase: expressed as: ; in, represents the updated individual pelican position, , are all random numbers between [0,1]; p is the exploration probability, which is used to control the ratio of exploration and development. , are the upper and lower bounds of the hyperparameters respectively; Represents a random number in the interval [0,1], used to decide whether to explore or develop; is the historical best value of the current hyperparameter; Step S53: social learning stage; expressed as: ; in, represents a random number between [0,1], is another randomly selected pelican individual; Step S54: Evaluate the fitness of each individual pelican position according to the fitness function, and obtain the particle individual position corresponding to the optimal fitness value; Steps S51 to S54 are repeatedly executed until the optimal individual pelican position is obtained as output.

[0013] Furthermore, in step S52 and step S53, the Levy flight strategy is used to increase the randomness and globality of the search, which is expressed as: During the exploration phase: ; ; During the development phase: ; in, represents the weight of controlling the step size, is the value of the current optimal solution hyperparameter; is a random number that follows a Levy distribution, Indicates the preset parameters; is the historical best value of the current hyperparameter; represents another weight that controls the step size.

[0014] Compared with the prior art, the present invention has the following beneficial effects:

[0015] The present invention constructs an efficient COD content prediction model for sewage treatment plant effluent by innovatively integrating dual-channel convolution and dual-attention memory network. The model further divides the COD influencing factors through dual-channel convolution, aiming to greatly enhance the feature extraction ability of the model. In view of the actual operation of the water plant, the sources of its purified sewage include urban sewage and industrial sewage. This diversity poses a special challenge to the influencing factors of COD. In order to deal with this feature more effectively, the dual-channel convolutional neural network is designed to process the COD characteristics of urban sewage and industrial sewage separately. By separating the characteristics of these two types of sewage and then processing the data in parallel, the model can extract features more accurately. This method not only improves the efficiency of feature extraction, but also enhances the model's ability to understand the COD characteristics in sewage from different sources.

[0016] The dual-channel convolution structure is not only suitable for predicting COD in water plants. In the field of sewage treatment, the COD value in sewage is affected by many factors, and single-channel convolutional neural networks (CNNs) and dual-channel convolutional neural networks exhibit different processing characteristics. When processing complex sewage data, single-channel CNNs may have difficulty capturing complex features in the data from multiple angles due to limited feature extraction capabilities, which limits the model's ability to capture richer information. At the same time, when faced with a large number of influencing factors, single-channel CNNs may find it difficult to effectively integrate this information, resulting in limited prediction accuracy and generalization capabilities. In addition, when processing large-scale data sets, single-channel CNNs cannot fully utilize the advantages of parallel computing, so the training and inference process is slow and more prone to overfitting.

[0017] In contrast, dual-channel convolutional neural networks show significant advantages in predicting COD values ​​in sewage treatment. Dual-channel convolution learns the features of input data from different angles through two parallel channels, which helps to capture more comprehensive feature information, thereby improving the model's feature representation ability and enhancing the model's ability to capture local features. The parallel processing capability of dual-channel convolution makes it more effective in processing a large number of influencing factors, and can better understand and predict the changes in COD values ​​in sewage. In addition, dual-channel convolution effectively reduces the risk of overfitting by increasing the complexity of the network structure, and fully utilizes the advantages of parallel computing to accelerate the training and reasoning process of the network and improve computational efficiency. Under the premise of keeping the computational complexity basically unchanged, dual-channel CNN increases the depth and width of the network, which is conducive to improving the generalization ability of the model. Especially in time series analysis tasks such as COD prediction in sewage treatment, dual-channel CNN can more accurately capture difficult-to-detect parameters and reduce resource waste. This new structure not only improves the efficiency of extracting features from data, but also provides a richer and more multi-level information representation for subsequent time series analysis.

[0018] Furthermore, the dual attention memory network of the present invention can effectively capture long-term dependencies and key features in time series data, thereby solving the limitations of traditional time series analysis methods when faced with nonlinear and high-dimensional data.

[0019] Compared with the ordinary LSTM and LSTM-SelfAttention models, the dual attention memory network shows significant advantages in predicting COD. Although the ordinary LSTM network is good at processing long sequence data and realizes long-term dependency modeling of sequence information through forget gate, input gate and output gate, its one-way data flow limits the model's ability to capture complex features in the data when facing the complex COD prediction problem in sewage treatment, because it ignores the potential connection from the end to the beginning of the sequence. In addition, LSTM is more prone to overfitting when processing high-dimensional data, which affects the generalization ability of the model.

[0020] Furthermore, an improved Pelican Optimization Algorithm (POA) is introduced to optimize the CNN hyperparameters, which significantly improves the generalization ability and prediction accuracy of the model. POA enables the model to automatically adjust the network structure and quickly converge to the optimal solution by simulating the intelligent search strategy of the pelican's predation behavior. In order to further improve the performance of the POA algorithm, the present invention introduces the Levy flight mechanism. Levy flight is an optimization strategy based on random walks. It simulates the random movement behavior of organisms when looking for food, uses Levy distribution to generate random steps with heavy-tail characteristics, and allows large displacements in a short time, thereby improving search efficiency. This mechanism enables POA to jump out of the local optimum in later searches, expand the search radius, increase population diversity, avoid falling into the local optimum, and enhance global exploration capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 The figure is a flow chart of the steps of a COD prediction method based on a dual-channel convolution timing mechanism. DETAILED DESCRIPTION

[0022] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, in the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate the orientation or position relationship based on the orientation or position relationship shown in the accompanying drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "No. 1", "No. 2" and "No. 3" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The present invention is further explained below in conjunction with specific embodiments.

[0023] Reference Figure 1 , a COD prediction method based on dual-channel convolution timing mechanism, comprising the following steps: Step S1: Collect COD raw data for preprocessing, obtain COD input features, and construct a data set based on them; Step S2: construct a prediction model, which includes a dual-channel convolution module, a dual-attention memory network and an output module, import the data in the data set in step S1 into the dual-channel convolution module, and obtain the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector in parallel; Step S3: importing the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector in step S2 into the dual attention memory network to obtain temporal dependency features; Step S5: training the model. During the training process, the hyperparameters of the model are optimized based on the improved Pelican algorithm. The hyperparameters include: the hidden layer dimension of the dual-channel convolution module, the number of hidden units of the dual attention memory network, the learning rate, and the batch size. Step S6: importing the real-time acquired COD raw data for preprocessing to obtain the corresponding COD input features; importing the real-time COD input features into the prediction model to obtain the real-time predicted COD output; The optimization of the model's hyperparameters based on the improved Pelican algorithm in step S5 includes: Step S51: Initialize the population; Step S52: exploration and development phase; Step S53: social learning stage; Step S54: Evaluate the fitness of each individual pelican position according to the fitness function, and obtain the individual pelican position corresponding to the optimal fitness value; Repeat S51 to S54 until the optimal individual pelican position is obtained as output; In step S52 and step S53, the Levy flight strategy is used to increase the randomness and globality of the search.

[0024] Furthermore, step S1 is specifically as follows:

[0025] Step S11: Real-time collection of COD raw data from the water plant , COD raw data Including: effluent COD, urban sewage section influent COD, urban sewage section influent total nitrogen, urban sewage section influent ammonia nitrogen, urban sewage section oxidation ditch anoxic section DO, urban sewage section oxidation ditch aerobic section MLSS, industrial sewage section influent COD, industrial sewage section influent total nitrogen, industrial sewage section influent ammonia nitrogen, industrial sewage section oxidation ditch aerobic section DO and industrial sewage section oxidation ditch aerobic section MLSS, formalized as: ; in, They represent the effluent COD, the influent COD of the urban sewage section, the influent total nitrogen of the urban sewage section, the influent ammonia nitrogen of the urban sewage section, the DO of the anoxic section of the urban sewage section oxidation ditch, the MLSS of the aerobic section of the urban sewage section oxidation ditch, the influent COD of the industrial sewage section, the influent total nitrogen of the industrial sewage section, the influent ammonia nitrogen of the industrial sewage section, the DO of the aerobic section of the industrial sewage section oxidation ditch, and the MLSS of the aerobic section of the industrial sewage section oxidation ditch; Step S12: Preprocess the raw data. The preprocessing process includes removing outliers and filling missing values, obtaining COD input features and constructing a data set based on them.

[0026] Furthermore, in step S2, the data in the data set in step S1 is imported into the dual-channel convolution module, and the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector are obtained in parallel; specifically: Step S21: Classify the COD input feature into urban sewage segment and industrial sewage segment, expressed as: ; ; in, Represents the COD input characteristics of the urban sewage section, Represents the COD input characteristics of the industrial wastewater section; and As parallel input to a two-channel convolutional neural network; Step S22: normalize the parallel inputs to achieve standardization, which is expressed as: ; ; in, represents the standardized COD input characteristics of the urban sewage section, Represents the standardized COD input characteristics of the industrial wastewater section; express The minimum value in express The maximum value in express The minimum value in express The maximum value in ; Step S23: The two sets of data are passed in parallel to the one-dimensional convolution layer to extract local features, and the input data is scanned through the filter; it is expressed as: ; ; in, represents the convolution kernel, represents the weight of the convolution kernel, and Indicates that the input data is at position The value of , * indicates the convolution operation; Step S24: Use the ReLU activation function to introduce nonlinearity, enhance the model's ability to capture complex relationships, and obtain multidimensional feature maps T1 and T2, expressed as: ; ; In the formula, is the input value, ReLU activation function. Step S25: Flatten the multidimensional feature maps T1 and T2 obtained in step S24 into corresponding one-dimensional array vectors using the Flatten function and , expressed as: ; ; in, represents the continuous product, Represents an index; Step S26: Fully connected layer for one-dimensional array vector and Further combination, through the weight matrix W and bias b to combine the features, obtain the corresponding output feature vector, expressed as: ; ; In the formula, , Represents the output feature vector, that is, the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector.

[0027] Furthermore, step S3 is specifically as follows: Step S31: Output feature vector of the first dual-channel convolution And the second two-channel convolution output feature vector Integrate into feature sequences ,in, represents the feature vector at the nth time step; Step S32: Cut the feature sequence F to construct a subsequence for input ; Each subsequence contains 9 consecutive time steps, expressed as: Where j is the starting index of the subsequence, and the value range of j is [1, n−8]; Formalize the prediction task of the dual attention memory network, specifically: input the first 8 time steps To predict the 9th time step COD value; Step S32: Subsequence The input embedding layer is converted into a subsequence containing 8 time steps. As labels for training, the embedded subsequence features are represented as: ; Where E is the weight matrix of the embedding layer, represents a subsequence containing 8 time steps, is the embedded subsequence feature; Step S33: Input the subsequence features into the dual-channel BiLSTM layer to capture the long-term dependencies in the time series data and obtain the predicted time series dependency features.

[0028] Furthermore, the BiLSTM layer in step S33 includes two LSTMs connected in series, one for processing the forward sequence and the other for processing the reverse sequence; specifically: the forward LSTM processes data in the original order of the subsequence features, and the reverse LSTM processes data in the reverse order of the subsequence features; Its forward LSTM processing flow is: Step S33A1: Forget gate: At each time step t, the forward LSTM is based on the hidden state of the previous time step and the subsequence features of the current input Calculating the forget gate , determine the slave unit status How much information is retained in ; expressed as: in, represents the sigmoid function, is the bias of the forget gate, is the hidden state at the previous time step, represents the subsequence features of the input, Represents the weight matrix of the forget gate; Step S33A2: Input gate and candidate cell states: Input gate and candidate cell status Determines how much new information will be added to the cell state In; expressed as: ; ; in, is the input gate, is the candidate cell state, and are the weight matrices of the input gate and candidate unit states, respectively. and Bias representing the input gate and candidate cell states; Step S33A3: Unit status: Unit status Combine the update results of the forget gate and the input gate to capture long-term dependencies; expressed as: ; in, is the cell state at the current time step, is the cell state at the previous time step; Step S33A4: Output gate and hidden state: Output gate and hidden state based on and Calculate and determine the information output to the next time step, expressed as: ; ; in, represents the output gate, represents the hidden state of the current time step, represents the weight of the output gate, is the bias term of the output gate; The reverse order of the subsequence features of the input processed by the reverse LSTM; for time step t, the input to the reverse LSTM is , where T is the total length of the sequence, T=8; The reverse LSTM obtains the hidden state of the current time step of the reverse LSTM in the same processing flow as steps S33A1 to S33A4. ; Concatenate the hidden states of the forward LSTM and reverse LSTM outputs to obtain Output of the layer , that is, the time series dependency feature, expressed as: .

[0029] Furthermore, the output module in step S4 uses a fully connected layer; Step S4 is specifically as follows: Step S42: Obtain the time-dependent features and process them through a fully connected layer to obtain the prediction output, which is expressed as: ; In the formula, is the predicted COD output, is the weight matrix of the fully connected layer, is the bias term of the fully connected layer; is the hyperbolic tangent activation function.

[0030] Furthermore, step S5 is specifically as follows: Step S51: Initialize the population, expressed as: ; Where C represents the pelican population matrix, represents the position of the i-th pelican individual, represents the position of the Nth pelican individual, m is the preset total number of hyperparameters, represents the total number of individual pelican positions, represents the eigenvalue corresponding to the jth hyperparameter in the position of the i-th pelican individual; initialization , expressed as: ; in, and denote the lower and upper bounds of the jth hyperparameter, respectively. represents a random number in the interval [0,1]; Step S52: Exploration and development phase: expressed as: ; in, represents the updated individual pelican position, , are all random numbers between [0,1]; p is the exploration probability, which is used to control the ratio of exploration and development. , are the upper and lower bounds of the hyperparameters, respectively; Represents a random number in the interval [0,1], used to decide whether to explore or develop; is the historical best value of the current hyperparameter; Step S53: social learning stage; expressed as: ; in, represents a random number between [0,1], is another randomly selected pelican individual; Step S54: Evaluate the fitness of each individual pelican position according to the fitness function, and obtain the particle individual position corresponding to the optimal fitness value; Steps S51 to S54 are repeatedly executed until the optimal individual pelican position is obtained as output.

[0031] Furthermore, in step S52 and step S53, the Levy flight strategy is used to increase the randomness and globality of the search, which is expressed as: During the exploration phase: ; ; During the development phase: ; in, represents the weight of controlling the step size, is the value of the current optimal solution hyperparameter; is a random number that follows a Levy distribution, Indicates the preset parameters; is the historical best value of the current hyperparameter; represents another weight that controls the step size.

[0032] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A COD prediction method based on a dual-channel convolution timing mechanism, characterized in that: The following steps are involved: Step S1: Collect COD raw data for preprocessing, obtain COD input features, and construct a data set based on them; Step S2: construct a prediction model, which includes a dual-channel convolution module, a dual-attention memory network and an output module, import the data in the data set in step S1 into the dual-channel convolution module, and obtain the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector in parallel; Step S3: importing the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector in step S2 into the dual attention memory network to obtain temporal dependency features; Step S4: import the time-dependent features of step S3 into the output module to obtain the predicted COD output; Step S5: training the model. During the training process, the hyperparameters of the model are optimized based on the improved Pelican algorithm. The hyperparameters include: the hidden layer dimension of the dual-channel convolution module, the number of hidden units of the dual attention memory network, the learning rate, and the batch size. Step S6: importing the real-time acquired COD raw data for preprocessing to obtain the corresponding COD input features; importing the real-time COD input features into the prediction model to obtain the real-time predicted COD output; The optimization of the model's hyperparameters based on the improved Pelican algorithm in step S5 includes: Step S51: Initialize the population; Step S52: exploration and development phase; Step S53: social learning stage; Step S54: Evaluate the fitness of each individual pelican position according to the fitness function, and obtain the individual pelican position corresponding to the optimal fitness value; Repeat steps S51 to S54 until the optimal individual pelican position is obtained as output; In step S52 and step S53, the Levy flight strategy is used to increase the randomness and globality of the search.

2. According to claim 1, a COD prediction method based on a dual-channel convolution timing mechanism is characterized in that: Step S1 is specifically as follows: Step S11: Real-time collection of COD raw data from the water plant , COD raw data Including: effluent COD, urban sewage section influent COD, urban sewage section influent total nitrogen, urban sewage section influent ammonia nitrogen, urban sewage section oxidation ditch anoxic section DO, urban sewage section oxidation ditch aerobic section MLSS, industrial sewage section influent COD, industrial sewage section influent total nitrogen, industrial sewage section influent ammonia nitrogen, industrial sewage section oxidation ditch aerobic section DO and industrial sewage section oxidation ditch aerobic section MLSS, formalized as: ; in, They represent the effluent COD, the influent COD of the urban sewage section, the influent total nitrogen of the urban sewage section, the influent ammonia nitrogen of the urban sewage section, the DO of the anoxic section of the urban sewage section oxidation ditch, the MLSS of the aerobic section of the urban sewage section oxidation ditch, the influent COD of the industrial sewage section, the influent total nitrogen of the industrial sewage section, the influent ammonia nitrogen of the industrial sewage section, the DO of the aerobic section of the industrial sewage section oxidation ditch, and the MLSS of the aerobic section of the industrial sewage section oxidation ditch; Step S12: Preprocess the raw data. The preprocessing process includes removing outliers and filling missing values, obtaining COD input features and constructing a data set based on them.

3. A COD prediction method based on a dual-channel convolution timing mechanism according to claim 2, characterized in that: In step S2, the data in the data set in step S1 is imported into the dual-channel convolution module, and the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector are obtained in parallel; specifically: Step S21: Classify the COD input feature into urban sewage segment and industrial sewage segment, expressed as: ; ; in, Represents the COD input characteristics of the urban sewage section, Represents the COD input characteristics of the industrial wastewater section; and As parallel input to a two-channel convolutional neural network; Step S22: normalize the parallel inputs to achieve standardization, which is expressed as: ; ; in, represents the standardized COD input characteristics of the urban sewage section, Represents the standardized COD input characteristics of the industrial wastewater section; express The minimum value in express The maximum value in express The minimum value in express The maximum value in ; Step S23: The two sets of data are passed in parallel to the one-dimensional convolution layer to extract local features, and the input data is scanned through the filter; it is expressed as: ; ; in, represents the convolution kernel, represents the weight of the convolution kernel, and Indicates that the input data is at position The value of , * indicates the convolution operation; Step S24: Use the ReLU activation function to introduce nonlinearity, enhance the model's ability to capture complex relationships, and obtain multidimensional feature maps T1 and T2, expressed as: ; ; In the formula, is the input value, ReLU activation function. Step S25: Flatten the multidimensional feature maps T1 and T2 obtained in step S24 into corresponding one-dimensional array vectors using the Flatten function and , expressed as: ; ; in, represents the continuous product, Represents an index; Step S26: Fully connected layer for one-dimensional array vector and Further combination, through the weight matrix W and bias b to combine the features, obtain the corresponding output feature vector, expressed as: ; ; In the formula, , Represents the output feature vector, that is, the first dual-channel convolution output feature vector and the second dual-channel convolution output feature vector.

4. A COD prediction method based on a dual-channel convolution timing mechanism according to claim 3, characterized in that: Step S3 is specifically as follows: Step S31: Output feature vector of the first dual-channel convolution And the second two-channel convolution output feature vector Integrate into feature sequences ,in, represents the feature vector at the nth time step; Step S32: Cut the feature sequence F to construct a subsequence for input ; Each subsequence contains 9 consecutive time steps, expressed as: Where j is the starting index of the subsequence, and the value range of j is [1, n−8]; Formalize the prediction task of the dual attention memory network, specifically: input the first 8 time steps To predict the 9th time step COD value; Step S32: Subsequence The input embedding layer is converted into a subsequence containing 8 time steps. As labels for training, the embedded subsequence features are represented as: ; Where E is the weight matrix of the embedding layer, represents a subsequence containing 8 time steps, is the embedded subsequence feature; Step S33: Input the subsequence features into the dual-channel BiLSTM layer to capture the long-term dependencies in the time series data and obtain the predicted time series dependency features.

5. A COD prediction method based on a dual-channel convolution timing mechanism according to claim 4, characterized in that: The BiLSTM layer in step S33 includes two LSTMs connected in series, one for processing the forward sequence and the other for processing the reverse sequence; specifically: the forward LSTM processes data in the original order of subsequence features, and the reverse LSTM processes data in the reverse order of subsequence features; Its forward LSTM processing flow is: Step S33A1: Forget gate: At each time step t, the forward LSTM is based on the hidden state of the previous time step and the subsequence features of the current input Calculating the forget gate , determine the slave unit status How much information is retained in ; expressed as: in, represents the sigmoid function, is the bias of the forget gate, is the hidden state at the previous time step, represents the subsequence features of the input, Represents the weight matrix of the forget gate; Step S33A2: Input gate and candidate cell states: Input gate and candidate cell status Determines how much new information will be added to the cell state In; expressed as: ; ; in, is the input gate, is the candidate cell state, and are the weight matrices of the input gate and candidate unit states, respectively. and Bias representing the input gate and candidate cell states; Step S33A3: Unit status: Unit status Combine the update results of the forget gate and the input gate to capture long-term dependencies; expressed as: ; in, is the cell state at the current time step, is the cell state at the previous time step; Step S33A4: Output gate and hidden state: Output gate and hidden state based on and Calculate and determine the information output to the next time step, expressed as: ; ; in, represents the output gate, represents the hidden state of the current time step, represents the weight of the output gate, is the bias term of the output gate; The reverse order of the subsequence features of the input processed by the reverse LSTM; for time step t, the input to the reverse LSTM is , where T is the total length of the sequence, T=8; The reverse LSTM obtains the hidden state of the current time step of the reverse LSTM in the same processing flow as steps S33A1 to S33A4. ; Concatenate the hidden states of the forward LSTM and reverse LSTM outputs to obtain Output of the layer , that is, the time series dependency feature, expressed as: 。 6. The COD prediction method based on dual-channel convolution timing mechanism according to claim 1 is characterized in that: The output module in step S4 uses a fully connected layer; Step S4 is specifically as follows: Step S42: Obtain the time-dependent features and process them through a fully connected layer to obtain the prediction output, which is expressed as: ; In the formula, is the predicted COD output, is the weight matrix of the fully connected layer, is the bias term of the fully connected layer; is the hyperbolic tangent activation function.

7. The COD prediction method based on dual-channel convolution timing mechanism according to claim 1 is characterized in that: Step S5 is specifically as follows: Step S51: Initialize the population, expressed as: ; Where C represents the pelican population matrix, represents the position of the i-th pelican individual, represents the position of the Nth pelican individual, m is the preset total number of hyperparameters, represents the total number of individual positions, represents the eigenvalue corresponding to the jth hyperparameter in the position of the i-th pelican individual; initialization , expressed as: ; in, and denote the lower and upper bounds of the jth hyperparameter, respectively. Represents a random number in the interval [0,1]; Step S52: Exploration and development phase: expressed as: ; in, represents the updated individual pelican position, , are all random numbers between [0,1]; p is the exploration probability, which is used to control the ratio of exploration and development. , are the upper and lower bounds of the hyperparameters, respectively; Represents a random number in the interval [0,1], used to decide whether to explore or develop; is the historical best value of the current hyperparameter; Step S53: social learning stage; expressed as: ; in, represents a random number between [0,1], is another randomly selected pelican individual; Step S54: Evaluate the fitness of each individual pelican position according to the fitness function, and obtain the particle individual position corresponding to the optimal fitness value; Steps S51 to S54 are repeatedly executed until the optimal individual pelican position is obtained as output.

8. The COD prediction method based on dual-channel convolution timing mechanism according to claim 1 is characterized in that: In step S52 and step S53, the Levy flight strategy is used to increase the randomness and globality of the search, which is expressed as: During the exploration phase: ; ; During the development phase: ; in, represents the weight of controlling the step size, is the value of the current optimal solution hyperparameter; is a random number that follows a Levy distribution, Indicates the preset parameters; is the historical best value of the current hyperparameter; represents another weight that controls the step size.

Citation Information

Patent Citations

  • Method for realizing multi-channel convolutional-recurrent neural network electroencephalogram emotion recognition model by using transfer learning

    CN113627518A

  • Intelligent sewage monitoring method based on adaptive optimization algorithm and deep learning

    CN116484747A

  • Modeling method for optimizing thermal error of main shaft of long short-term memory network by pelican algorithm

    CN116861793A

  • Gravity wave instrument fault prediction model and method based on multi-task fusion network

    CN118260547A

  • Wind power plant power generation prediction method and device and readable storage medium

    CN118676899A

Cited By

  • Method for predicting effluent total phosphorus index in sewage treatment process

    CN122455144A

  • A method for predicting total phosphorus index of effluent in sewage treatment process

    CN122455144B