| Water quality prediction is an important foundation for water environment management and pollution prevention.Using historical water quality monitoring data to establish a high-precision water quality prediction model can be helpful to find out the water environment problems in advance,and avoid large-scale pollution incidents.With the rapid development of science and technology,water quality monitoring data has gradually changed from manual collection to automatic acquisition by sensors,which has the characteristics of large quantity and high frequency.However,massive data not only brings more usable information for water quality prediction,but also creates new problems.On one hand,because of the bad conditions of field work,the water quality data obtained by the sensor is generally abnormal and missing,so it is difficult to use visual exploration or conventional data cleaning methods to process.On the other hand,traditional water quality prediction methods are difficult to mine and use the deep information in large-capacity data,and do not make full use of the complex correlation between multiple water quality factors,so the prediction effect in practice is not ideal.In response to the above problems,the work of this article and the results achieved are as follows:(1)A cleaning method for online water quality monitoring data was proposed,which mainly includes Seasonal trend decomposition using loess-Generalized extreme studentized deviation(STL-GESD)identification of abnormal values,multiple interpolation method to fill missing values,and moving average method to reduce noise.This method was used to clean the original water quality data,and the original data and the cleaned data were used to construct permanganate index(CODMn),ammonia(NH3-N),total nitrogen(TN)and total phosphorus(TP)prediction models based on Long short term memory nerual network(LSTM).The results show that the mean absolute error(MAE)and the root mean squared error(RMSE)of the LSTM model constructed by the cleaned water quality data are significantly lower,and the coefficient of determination(R2)are greater than 80%.(2)A high-precision water quality prediction model based on the coupling of feature selection and deep learning was proposed.First,the RF algorithm was used to screen out the key feature combinations that affect the concentration changes of the target water quality factors,then merge them with the target water quality factors,and pass them into the LSTM model as input features,and finally output the prediction results.(1)In order to verify the effectiveness of the RF algorithm,the prediction results of the CODMn,NH3-N,TN and TP concentrations were compared between the RF-LSTM model and the single LSTM model.The results show that the MAE and RMSE of the RF-LSTM model were lower than the single LSTM model.This shows that using RF algorithm for feature selection before modeling can effectively filter out key features and improve model prediction accuracy.(2)In order to verify the performance of the RF-LSTM model,a comparative experiment was set up between the RF-LSTM model,the RF-BP model and the RF-RNN model.The results show that the prediction effect of the RF-LSTM model is better than the other models.The R2 for predicting the concentrations of CODMn,NH3-N,TN and TP are 97.03%,99.23%,99.66%and 98.99%,respectively.In addition,the model also showes good prediction effects in multi-step prediction experiments.In summary,the data cleaning method proposed in this article can effectively improve data quality and help improve the prediction accuracy of the model.In addition,with high prediction accuracy and strong generalization ability,the RF-LSTM model proposed in this article can provide a reference for realizing high-precision water quality prediction.In practical applications,the research in this article can be used to establish a surface water quality prediction and early warning platform,to perceive potential pollution risks of reservoir water quality in advance,improve the ability of relevant departments to predict water environment risks,and upgrade passive water environment risk emergency treatment to automated forecast and early warn to active prevent and control,which effectively guarantee the safety of the water environment. |