Prediction method of pH value in aquaculture water quality based on the integration of LSTM and XGBoost
To ensure equilibrium of aquaculture ecosystem and health of aquatic animals,a pH prediction method for aquaculture water quality,designated as PCA-ES-LSTM-BSO-XGBoost(PELBX),was established.In the PELBX,principal component analysis(PCA)was firstly applied to reduce the dimensionality of water quality da-ta,simplifying parameter complexity and enhancing the efficiency and accuracy of model training.Subsequently,the Long Short-Term Memory(LSTM)network was utilized to capture the dynamic changes in water quality param-eters over time,employing early stopping to prevent overfitting and to ensure high prediction accuracy for unseen data.Moreover,the parameters of the XGBoost model in parallel were optimized by the BSO algorithm to improve the precision of pH predictions.Finally,the predictions from the LSTM and XGBoost models were weighted and combined,effectively integrating the advantages of time series analysis and nonlinear learning,significantly enhan-cing prediction accuracy.Experimental results showed that the PELBX model outperformed in pH prediction with a root mean square error of 0.115,mean absolute error of 0.088,mean absolute percentage error of 1.066%,and a coefficient of determination of 0.747.Compared to the best-performing PCA-LSTM-BSO-XGBoost model in ablation studies,the performance parameters above were improved by 8.73%,8.33%,8.26%,and 7.64%respectively;and relative to the best model in the field,BiLSTM-GRU,performances were improved by 10.16%,1.12%,0.56%,and 8.73%respectively.The finding demonstrates that the PELBX model significantly enhances the accuracy and stabil-ity of water pH value prediction,validating the effectiveness and feasibility of the proposed method.