A method for predicting and controlling residual chlorine in secondary water supply based on cascade LSTM deep learning model

By applying a cascade LSTM deep learning model in the secondary water supply tank, the periodicity and volatility characteristics of residual chlorine are extracted, and the problem of difficult to predict and control residual chlorine in the existing technology is solved, and the high-accurate residual chlorine prediction is achieved and intelligent control ensure the safety of water quality.

CN118228596BActive Publication Date: 2025-02-14CHANGZHOU GENERAL TAP WATER CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410413842.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2025-02-14
Estimated Expiration
2044-04-08

AI Technical Summary

Technical Problem

The prior art is difficult to effectively predict and control residual chlorine in secondary water supply tanks, resulting in water quality safety risks. Traditional automatic control methods cannot predict the effect of chlorine replenishment in advance.

Method used

Using prediction and control methods based on cascade LSTM deep learning model, the periodicity and volatility characteristics of residual chlorine are extracted through data preprocessing and training of multi-layer LSTM networks, and the residual chlorine trends are accurately predicted in the future period and formed corresponding control strategy.

Benefits of technology

It significantly improves the accuracy of residual chlorine prediction, provides intelligent guarantee for the water tank chlorine replenishment device, and ensures the safety and stability of water quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118228596B_ABST
    Figure CN118228596B_ABST
Patent Text Reader

Abstract

The present invention discloses a secondary water supply residual chlorine prediction and control method based on a cascade LSTM deep learning model, analyzes the fluctuation characteristics of the residual chlorine sensor monitoring data, and explores the response mechanism of the monitoring data and the chlorine replenishment unit. The artificial neural network of the deep learning model is used to process the residual chlorine data, analyze its potential operating rules, and gradually explore the residual chlorine control strategy. The residual chlorine control is guided by the residual chlorine prediction method. The LSTM neural network of the artificial intelligence time series is used to analyze the historical data of the residual chlorine in the secondary water supply tank, automatically obtain the control parameters of the chlorine replenishment device, and optimize the operation of the chlorine replenishment device. The performance of the residual chlorine sensor is monitored in real time, which plays a role in supervising and optimizing the control operation. The automatic control driven by the residual chlorine sensor detection data is converted into intelligent control based on the LSTM neural network prediction data, and a framework of intelligent analysis methods for the historical data of the residual chlorine sensor is proposed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a secondary water supply residual chlorine control technology, and in particular to a secondary water supply residual chlorine prediction and control method based on a cascade LSTM deep learning model. Background Art

[0002] With the increasing number of secondary water supply pump houses in urban high-rise residential buildings, the water quality of secondary water supply is closely related to the lives of residents, and the water quality of secondary water supply has attracted widespread attention. At present, secondary pollution of water quality in secondary water supply tanks is a common problem, and the problem of water tank disinfection has not been well solved. Residual chlorine refers to the part of tap water that remains after disinfection, and is an important indicator for detecting the disinfection effect of secondary water supply. Low residual chlorine in the secondary water supply tank may lead to water quality safety risks. The tap water stays in the tank for a long time, and the residual chlorine concentration will gradually decrease. If the residual chlorine content in the tank is too low, it may not be able to effectively inhibit the growth of bacteria, viruses and other microorganisms, thereby increasing the risk of water pollution and bacterial growth. In order to effectively protect the water quality of urban secondary water supply users, according to the health department and the actual secondary water supply situation, the secondary water supply pump house needs to be equipped with online water quality monitoring and automatic disinfection equipment. In actual use, the automatic chlorine replenishment device for secondary water supply requires people to consider its safety more. Water supply companies must continuously strengthen the monitoring of the operating status of the chlorine replenishment device to reduce the occurrence of various potential operating problems, so as to ensure the water quality of urban secondary water supply more safely.

[0003] Some secondary water supply community water tanks are equipped with automatic chlorine replenishment devices. The basic principle is to control the chlorine replenishment unit to form a closed-loop control based on the configured residual chlorine sensor. However, traditional automatic control theories and methods are generally insufficient in the application of long-delay nonlinear systems such as secondary water supply chlorination replenishment. The operating status monitoring method can only achieve real-time detection and control, and cannot make advance predictions on the chlorine replenishment effect. Excessive residual chlorine content may have adverse effects on human health. How to ensure the safe operation of automatic chlorine replenishment devices has become a problem that needs to be solved in the secondary water supply industry.

[0004] Deep learning is an important branch of machine learning. It is a concept proposed by Hinton et al. in 2006

[24] . Its introduction has ushered in a new era of neural networks, bringing machine learning closer to its goal - artificial intelligence. Deep learning is a multi-layer neural network. Although a single-layer neural network can achieve approximate predictions, the addition of hidden layers can help optimize and improve accuracy. Like other machine learning, deep learning is also a "fitting" mechanism that builds an unsupervised network model by imitating the learning mechanism of the brain. It learns and summarizes available methods and rules from a large amount of data analysis, enabling the system to cluster data and make predictions.

[0005] Recurrent Neural Network (RNN) refers to a fully connected neural network that adds a temporal relationship between the previous and next sequences, which can better handle time-related problems such as machine translation. RNN is called a recurrent neural network because the current output of a sequence is also related to the previous output. It is based on the view that "human cognition is based on past experience and memory". It not only considers the input of the previous moment, but also gives the network a "memory" function for the previous content. In theory, RNN can process sequence data of any length. However, in practice, RNN can only have short-term memory due to the disappearance of gradients. The earliest input may cause gradient explosion or gradient disappearance during the back propagation of the neural network, resulting in RNN being unable to recall too long memories, which will reduce the accuracy of prediction. Therefore, the long short-term memory neural network LSTM was born. The long short-term memory (LSTM) neural network structure has memory ability and can capture dynamic patterns and dependencies in time series data. Time series prediction can be used to judge the development trend of things, and efficient prediction models can provide a strong basis for application decision-making.

[0006] The main reason why LSTM can be used for prediction is that it performs well in processing sequence data. Compared with other traditional machine learning methods or artificial neural networks, LSTM can better capture the long-term dependencies of sequence data. By introducing a gating mechanism, LSTM can better handle long sequence data and avoid the gradient vanishing problem, so that the network can better remember and utilize the long-term dependencies in the sequence, which makes LSTM suitable for many tasks that need to consider time order and long-term relationships. For example, time series prediction, stock price prediction, weather prediction, semantic analysis and sentiment analysis in natural language processing, etc. LSTM neural network has strong nonlinearity, mapping and adaptability, which can effectively improve the prediction accuracy. Summary of the invention

[0007] In response to the problems existing in the prior art, the present invention provides a method for accurately predicting the residual chlorine trend in the future and forming a corresponding control strategy, which can improve the accuracy of the prediction and provide an effective intelligent guarantee for the water tank chlorine replenishment device. It has a high practical value and a secondary water supply residual chlorine prediction and control method based on the cascade LSTM deep learning model.

[0008] The purpose of the present invention is achieved through the following technical solutions.

[0009] A secondary water supply residual chlorine prediction and control method based on a cascade LSTM deep learning model comprises: data preprocessing, periodic model training, data processing, volatility model training, testing and output control stages, wherein the data processing comprises fitting data and sequence slicing, the LSTM network for periodic model training and data fitting comprises a network model consisting of 5 hidden layers, each layer of which comprises 64 LSTM neurons, and a fully connected layer, wherein the low-frequency characteristics of input data are analyzed in a lower LSTM model, and periodic laws in a larger time domain are learned; the LSTM network for volatility model training and data prediction comprises a network model consisting of 5 hidden layers, each layer of which comprises 68 LSTM neurons, and a fully connected layer, wherein the local characteristics of input data are analyzed in the LSTM model, and a predetermined number of prediction data and corresponding time axis are output; the test and output prediction control parameter stage statistically analyzes the prediction data, finds the residual chlorine value at the lowest point of the predicted residual chlorine, i.e., the time when the residual chlorine decays to the lowest point, and finds the residual chlorine value at the highest point of the predicted residual chlorine, i.e., the time when the residual chlorine rises to a set highest point after chlorine supplementation, and the subtraction of the two prediction times is the predicted chlorine supplementation time.

[0010] The data preprocessing is to normalize the input residual chlorine data.

[0011] The LSTM network for periodic model training and data fitting has the function of filtering and de-jittering, which shapes the original data, removes most of the high-frequency jitters of the residual chlorine signal, and outputs processed data representing the residual chlorine signal.

[0012] The LSTM network for volatility model training and data prediction adopts AdamW's optimization function with L2 regularization and weight decay. L2 regularization adds a penalty term consisting of the sum of squares of all model weights to the loss function and multiplies it by a specific hyperparameter to control the severity of the penalty.

[0013] Compared with the prior art, the advantages of the present invention are: the present invention proposes a cascade long short-term memory model, which divides the residual chlorine prediction into two stages: the first stage extracts the periodic characteristics of the residual chlorine to obtain the overall trend of change; the second stage extracts the volatility characteristics of the residual chlorine, learns the correlation characteristics of the residual chlorine in the previous and next time periods, and further improves the accuracy of the prediction. A cascade long short-term memory neural network of time series is established to automatically analyze the historical data of residual chlorine in the water tank, which can accurately predict the trend of residual chlorine in the future and form a corresponding control strategy. After the experimental water tank and the actual community secondary water supply tank operation test, the results show that the deep learning model provides an effective intelligent guarantee for the water tank chlorine replenishment device and has a high practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a flow chart of the cascade LSTM model of the present invention.

[0015] Figure 2 This is a schematic diagram of the cascade LSTM structure of the present invention.

[0016] Figure 3 This is the residual chlorine monitoring data of a secondary water supply tank in a community within one day in an embodiment of the present invention.

[0017] Figure 4 This is the loss curve of the training set.

[0018] Figure 5 This is the test set loss curve.

[0019] Figure 6 The present invention is a curve diagram comparing the predicted value and the true value. DETAILED DESCRIPTION

[0020] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0021] Starting from the basic principle of a large amount of data records of the actual operation of the chlorine replenishment device in the secondary water supply pump room and the diffusion attenuation of residual chlorine, the present invention analyzes the fluctuation characteristics of the monitoring data of the residual chlorine sensor, and explores the response mechanism of the monitoring data and the chlorine replenishment unit. The artificial neural network of the deep learning model is used to process the residual chlorine data, analyze its potential operating rules, and gradually explore the residual chlorine control strategy. The residual chlorine control is guided by the method of residual chlorine prediction, which is more and more necessary for the safety of chlorine replenishment in the secondary water supply tank. The present invention uses the LSTM neural network of artificial intelligence time series to analyze the historical data of residual chlorine in the secondary water supply tank, automatically obtains the control parameters of the chlorine replenishment device, and optimizes the operation of the chlorine replenishment device. The performance of the residual chlorine sensor is monitored in real time, which plays a role in supervising and optimizing the control operation. The automatic control driven by the residual chlorine sensor detection data is converted into intelligent control based on the LSTM neural network prediction data, and a framework of intelligent analysis methods for the historical data of the residual chlorine sensor is proposed. The framework includes four stages: data cleaning, data model construction, data training, and control parameter prediction. It provides a standardized data analysis and mining process and can be applied to the development of various time series prediction control systems.

[0022] The results show that the residual chlorine monitoring data of the secondary water supply tank and the operation of the chlorine replenishment device have the correlation characteristics of periodic changes in the time dimension and coordinated changes in the space dimension, and the LSTM neural network model has significant advantages in the prediction of residual chlorine in the secondary water supply. The long short-term memory network (LSTM) framework based on deep learning combines the advantages of the multi-layer long short-term memory model in many aspects, improves the accuracy of neural network prediction, and provides a strong safety guarantee for the realization of residual chlorine control. This paper innovatively builds a new combined framework based on the cascade LSTM data model, LSTM data preprocessing algorithm and LSTM data prediction algorithm, that is, first establish a front-end LSTM model to process the residual chlorine time series data, quickly extract features, analyze the periodic laws of the data, learn the long-term change trend of residual chlorine, and obtain the change law of each period; then establish a back-end LSTM model to extract the volatility characteristics of the residual chlorine value from the processed data, learn the correlation characteristics of the residual chlorine value before and after the period, correct the overall trend, and further improve the accuracy of the prediction. Compared with the prediction results of other models, the overall error is small, the stability is good, and the network training speed is fast, which is more conducive to the on-site deployment and operation of the edge computing unit. Residual chlorine prediction can be used for real-time monitoring and anomaly detection of sensors, and the prediction results are used as the basis for data drift and failure judgment. Practice has proved that the secondary water supply residual chlorine prediction method based on the cascade LSTM deep learning model is used for the intelligent supervision mechanism of the secondary water supply chlorine replenishment device, which has practical application value in ensuring the safety of residual chlorine in the water tank.

[0023] This paper deeply explores the core concepts, structures and mathematical principles of long short-term memory (LSTM) networks, explains the working principle of LSTM through logical analysis, and conducts an error comparison analysis between LSTM predictions and actual detection values. The article also demonstrates in detail how to use the deep learning framework Pytorch to build and train LSTM models and predict future data, reflecting the advantages of LSTM in practical applications.

[0024] Long Short-Term Memory Network LSTM Structure

[0025] The full name of the LSTM model is the Long Short-Term Memory Model (LSTM). The network structure of LSTM is similar to that of RNN, both of which are chain structures. It is an improvement on the Recurrent Neural Network (RNN). The LSTM model successfully solves the problems of gradient disappearance in training and medium- and long-term dependence in applications by introducing storage units and forget gates. LSTM can converge to the optimal solution faster in predicting time series, making it very suitable for solving time series prediction problems.

[0026] The LSTM model mainly avoids the problems of gradient explosion and gradient vanishing in the standard RNN network structure. On its basis, it introduces the concept of gating mechanism, which controls the flow of data information through input gate, forget gate and output gate, so the training speed will be faster, which solves the problem of gradient vanishing to a certain extent. LSTM can remember information for a long time, and all recursive neural networks have chain repetitive modules of neural networks.

[0027] LSTM has three gates to protect and control the cell state: forget gate, update gate, and output gate. The cell state is similar to a conveyor belt. It is easy for information to flow unchanged on it directly running through the entire chain with only a few linear interactions. The main structure of the LSTM model is the input gate, forget gate, output gate, and memory unit. They interact with each other in a special way, just like in the gated recurrent unit. The input of the current time step and the hidden state of the previous time step are fed into the gate of the long short-term memory network as data. They are processed by three fully connected layers with sigmoid activation functions to calculate the values ​​of the input gate, forget gate, and output gate. Therefore, the values ​​of these three gates are all in the range of (0,1).

[0028] The design idea of ​​LSTM comes from the logic circuit gate of electronic computers. LSTM introduces memory cells, or cells for short. Some literature considers memory cells to be a special type of hidden state. They have the same shape as hidden states and are designed to record additional information. To control memory cells, we need many gates. One of the gates is used to output entries from the cell, which we call the output gate. Another gate is used to decide when to read data into the cell, which we call the input gate. We also need a mechanism to reset the content of the cell, which is managed by the forget gate. The motivation of this design is the same as that of the gated recurrent unit, which can decide when to remember or ignore the input in the hidden state through a dedicated mechanism. It is possible to effectively remember valuable things in past information and then form a neural network structure model. LSTM is an extension of recurrent neural network (RNN), which is particularly suitable for sequence modeling and time series analysis. The design of LSTM is ingenious, and the logical structure of LSTM makes it very useful in many practical applications, especially in tasks that need to capture long-term dependencies in time series.

[0029] Cascade LSTM model

[0030] The study found that the time series of residual chlorine data in the water tank showed a certain hierarchical regularity. For example, each time chlorine was supplemented, the residual chlorine increased and then decayed; the number of chlorine supplements per day was very regular. This periodicity makes the residual chlorine in each time period of the day have a similar trend of change. On the other hand, the residual chlorine value has a strong volatility. The residual chlorine at the current moment will be affected by the residual chlorine situation in the previous time period and fluctuate, and at the same time have a strong correlation. If such internal hierarchical regularities contained in the data can be utilized, it will inevitably improve the analysis effect. Therefore, the present invention introduces a cascade network structure of a two-layer LSTM model, such as Figure 1 and 2 As shown, learning is performed on historical time series data from two different scales.

[0031] The LSTM module first denoises the original time series data, then extracts features from the denoised data and uses them as the input of the LSTM network to generate prediction results. The cascade LSTM model is composed of two basic LSTM network modules. The core idea is to establish preliminary feature processing of input data in the lower LSTM layer, analyze the periodicity of the data, learn the long-term trend of residual chlorine, and obtain the change law of each time period; extract the volatility characteristics of residual chlorine in the higher LSTM layer, learn the correlation characteristics of residual chlorine in the previous and next time periods, correct the overall trend, and further improve the accuracy of the prediction.

[0032] The cascade LSTM deep neural network enhances the expressiveness of the model by establishing an additional hierarchical relationship between two LSTM networks. The traditional LSTM network consists of a series of LSTM units, each of which contains key gating units such as input gate, forget gate and output gate to control the flow of input data and the update of state information. Each LSTM unit calculates sequentially on the time series, and the output result is passed to the next LSTM unit. The cascade LSTM network builds a structure of multiple LSTM unit hierarchies by adding additional LSTM layers to the LSTM network, so that information can be transmitted and interacted between multiple LSTM layers. The output result of each LSTM layer is used as the input of the next LSTM layer, which can introduce more nonlinear mapping and abstraction capabilities, and improve the generalization and expressiveness of the model. In the cascade LSTM network, each LSTM layer usually has a different number of hidden units and different parameters, so as to capture different features and patterns at different levels. At the same time, by increasing the depth of the network, the cascade LSTM network can model and learn more complex time series patterns and has stronger learning ability. The following introduces the cascade LSTM network model processing flow, which is divided into: data preprocessing, periodic model training, data processing, volatility model training, testing and output control stages.

[0033] 1. Pre-stage periodic model training and data fitting

[0034] This level of LSTM network is composed of 5 hidden layers, each layer has 64 LSTM neurons, and a fully connected (FC) layer. The core idea is to analyze the low-frequency characteristics of the input data in the lower LSTM model, and learn the periodic laws in a larger time domain as the main work. Therefore, the training time of the front-level LSTM network should not be too long, and overfitting should be avoided. This layer also has the function of filtering and de-jittering, which reshapes the original data, removes most of the high-frequency jitter of the residual chlorine signal, and outputs the processed data representing the residual chlorine signal.

[0035] 2. Post-stage volatility model training and data prediction

[0036] This level of LSTM network is a network model composed of 5 hidden layers, each layer has 68 LSTM neurons, and a fully connected (FC) layer. It analyzes the local features of the input data in a higher LSTM model. Thanks to the previous stage's organization of the original data, this level uses a lower learning rate to improve the accuracy of the prediction. This level of LSTM network uses AdamW's optimization function with L2 regularization and weight decay. L2 regularization is a classic method to reduce overfitting. It adds a penalty term consisting of the sum of the squares of all the weights of the model to the loss function, and multiplies it by a specific hyperparameter to control the penalty intensity, effectively avoiding overfitting. Output a predetermined number of predicted data and the corresponding timeline

[0037] 3. Testing and outputting predictive control parameters

[0038] By statistically analyzing the predicted data, we can easily find the predicted residual chlorine value at the lowest point, that is, the time it takes for the residual chlorine to decay to the lowest point, and the predicted residual chlorine value at the highest point, that is, the time it takes for the residual chlorine to rise to the set highest point after chlorine supplementation. The difference between the two predicted times is the predicted chlorine supplementation time.

[0039] Example

[0040] Correlation between residual chlorine change curve and time

[0041] The residual chlorine data of the water tank is a typical time series, and the data is arranged in the order of the time of collection. Since the composition of users in each community and their daily water use behavior are relatively fixed, the residual chlorine time series of the water tank presents obvious periodicity. In the present invention, the water use time series in a complete cycle from 0:00 to 24:00 every day is called the residual chlorine change curve. Figure 3 The data shows the residual chlorine monitoring data of a secondary water supply tank in a community within one day, and the data interval of this group of data is 1 minute.

[0042] This time, a neural network framework based on Pytorch was used, Python 3.9 was used as the programming language, PyCharm Community Edition 2023.2.5 was used as the editor, and the on-site edge computing unit used a mini host CPU: N95, memory: 16G+512G configuration, and the database used MySQL. The data obtained in this article comes from the automatic chlorine replenishment device of the secondary water supply tank in a community in Changzhou, and communicates through the on-site industrial Ethernet. The data and control parameters are uploaded to the remote data monitoring cloud platform through 4G_DTU, and the data collection frequency is 30.

[0043] LSTM network data model preprocessing

[0044] The system automatically obtains the original residual chlorine data from the database, and the data shape is datay.shape:(5250,1). Define a function named split_data. Get the divided data dataX.shape:(5186,64,1) and datay.shape:(5186,1), a total of 5186 records. Divide the data set into a training set and a test set, 90% of which is a training set and 10% is a test set. The previous LSTM algorithm will be trained on the training set and then used on the test set to detect the effect of network training. The predicted results will be compared with the actual values ​​in the test set to evaluate the performance of the trained model.

[0045] LSTM model parameter adjustment description: Neural networks have many parameters. Under the same network model, different parameter settings will affect the overall operating efficiency and speed of the network model. The previous LSTM network was iteratively trained 2000 times, with a learning rate of 0.0001 and a time of 2.03127 minutes. After fitting, 5186 residual chlorine data were obtained. Compared with the original data, the mean square error MSE: 0.00010094, MAE: 0.00614, MAPE: 0.020552, R2: 0.8875; the subsequent LSTM network was iteratively trained 800 times, with a learning rate of 0.00005 and a time of 67.51 minutes. The mean square error MSE of the training set was 0.00179; the mean square error MSE of the test set was 0.00134. Figure 4 and 5 shown.

[0046] Predictive control parameter analysis: We can easily find the time axis of the most recent lowest residual chlorine point in the future prediction data, and calculate the time of the next chlorine replenishment. Similarly, we can find the time axis of the most recent highest residual chlorine point, and calculate the time to stop replenishing chlorine. Subtracting the two can calculate how long the next chlorine replenishment process will last. Furthermore, we can also find the time axis of the second most recent lowest residual chlorine point, and easily calculate the time interval between the two metering pump operations, that is, the time for the residual chlorine to decay. Figure 6 Shown is a curve chart comparing the predicted value and the actual value of the present invention (the data and chart are only for illustrative purposes).

[0047] Predicted minimum residual chlorine value 0.256mg / L Predicted maximum residual chlorine value 0.338mg / L Prediction of the lowest residual chlorine time axis 14 Prediction of the time axis of the peak residual chlorine point 22 Predicted minimum residual chlorine time 28 minutes later Predicted maximum residual chlorine time 44 minutes later The predicted dosing time is 16 minutes

[0048] The residual chlorine in the secondary water supply tank is usually non-static, non-linear and unstable. The residual chlorine data has complex characteristics such as instability and irregularity. At the same time, the residual chlorine is also affected by the water consumption, water intake and temperature, daily and weekly user water consumption and the instability of holidays. If the data is analyzed solely based on the analyst's personal experience and intuition, the accuracy will be greatly reduced. Therefore, a scientific, intelligent and highly accurate research method is needed to reduce errors and conduct reasonable prediction and analysis of the residual chlorine data in the water tank as a technical and management measure to ensure the safety of secondary water supply water quality.

[0049] The present invention uses the LSTM network model as the basic model and establishes a secondary water supply residual chlorine prediction model based on the cascade LSTM deep learning model. The prediction process is divided into two stages: extracting the periodic characteristics of the data, predicting the overall change trend and extracting the volatility characteristics of the data, and improving the prediction accuracy. The actual residual chlorine control data of the secondary water supply tank in a community in Changzhou shows that, benefiting from the multi-scale analysis structure of the hierarchical neural network, the network has a good grasp of the temporal change relationship between the data, and can better learn the long-term change trend of the residual chlorine and the short-term volatility characteristics, further improving the accuracy of the residual chlorine prediction. After the stability analysis of the cascade LSTM network model, the prediction accuracy is higher than 0.9, which verifies the feasibility of the model in the field of residual chlorine prediction in secondary water supply tanks. It can be widely used in water tank chlorination replenishment systems, and plays a significant role in optimizing water tank chlorination control to avoid water quality risks.

Claims

1. A secondary water supply residual chlorine prediction and control method based on a cascade LSTM deep learning model, characterized in that include: Data preprocessing, periodic model training, data processing, volatility model training and data prediction, testing and output control stages, the data processing includes fitting data and sequence slicing, the LSTM network for periodic model training and data fitting is composed of 5 hidden layers, each layer is composed of 64 LSTM neurons, and a fully connected layer, the low-frequency features of the input data are analyzed in the lower LSTM model, and the periodic laws in the larger time domain are learned; the LSTM network for volatility model training and data prediction is composed of 5 hidden layers, each layer is composed of 68 LSTM neurons, and a fully connected layer, the local features of the input data are analyzed in the higher LSTM model, and a predetermined number of predicted data and corresponding Time axis; the test and output control stage statistically analyzes the predicted data to find the residual chlorine value at the predicted lowest point, that is, the time when it decays to the lowest point, and the residual chlorine value at the predicted highest point, that is, the time when the residual chlorine rises to the set highest point after chlorine supplementation. The two predicted times are subtracted to get the predicted chlorine supplementation time; the LSTM network for periodic model training and data fitting has the function of filtering and de-jittering, which shapes the original data, removes most of the high-frequency jitter of the residual chlorine signal, and outputs the processed data representing the residual chlorine signal; the LSTM network for volatility model training and data prediction adopts AdamW's optimization function with L2 regularization and weight decay. L2 regularization adds a penalty term consisting of the sum of the squares of all model weights to the loss function, and multiplies it by a specific hyperparameter to control the penalty intensity.

2. A secondary water supply residual chlorine prediction and control method based on a cascade LSTM deep learning model according to claim 1, characterized in that The data preprocessing is to normalize the input residual chlorine data.

Citation Information

Patent Citations

  • Intelligent disinfection system for secondary water supply pump station and use method

    CN115092995A