Abstract
In irrigation agriculture, predicting groundwater level (GWL) using deep learning models can help decision-makers coordinate surface water and groundwater usage, thus aiding in the sustainable development and utilization of groundwater. However, when making a long sequence prediction, prediction sequences often have severe delays affecting the availability of prediction results. In this paper, a new loss function is proposed to minimize the lag and oversmoothing on the prediction of GWLs. GWL, meteorology, and pumping data are collected via an irrigation Internet of Things system in Hutubi County, Xinjiang. Through Pearson's correlation analysis, historical potential evapotranspiration (ET0), groundwater extraction, and GWL were chosen to predict GWLs. Datasets were constructed through the proposed spatiotemporal data fusion method; then, the best model from the six deep learning models was selected by comparing the prediction capability of the datasets. Finally, the mean-squared error (MSE) loss function is replaced by the proposed loss function. Compared to the mean absolute error, MSE, and predicted sequence graphs, the new loss function significantly depresses the time delay with similar prediction accuracy.
HIGHLIGHTS
An integrated loss function considering the Euclidean error, time warping, and time delay is proposed to depress the time-delay problem of the predicted sequences.
A novel data fusion approach was introduced by incorporating the groundwater extraction data from motive pumping wells into the prediction of groundwater levels.
INTRODUCTION
To ensure regular access to quality food, natural resources such as land, air, and water must be sustainably managed and utilized (FAO et al. 2022). Agriculture is the industry with the largest water consumption and water intake. In China, the largest irrigated country in the world, agriculture accounts for 61.56% of the total water consumption, with irrigated lands accounting for 51.62% of the total area and irrigated grain output accounting for 75% of the total grain production (Ministry of Water Resources, PRC 2022). However, the effective utilization coefficient of farmland irrigation water in China is only 0.568, which is far lower than the level of 0.7–0.8 in developed countries (Ministry of Water Resources, PRC 2022). A large amount of groundwater consumed by the evapotranspiration of crops leads to a continuous decline in groundwater levels (GWLs). Strengthening irrigation groundwater resource management is both urgent and necessary.
With the development of Internet of Things (IoT) technologies, agricultural irrigation is gradually becoming data-driven. Through the use of soil humidity, soil temperature, and weather forecast data to predict the irrigation demand of farmland, accurate automatic irrigation can be achieved (Goap et al. 2018). The use of a deep convolutional neural network (DCNN) to accurately predict soil moisture, temperature, and humidity is able to support intelligent irrigation in crop production with high yields and low amounts of water (Kumar et al. 2022). Calibrating intelligent near-infrared spectral data using a DCNN architecture is expected to provide intelligent technical support to address the water cycle and conservation problems of agricultural farming (Cambra Baseca et al. 2019). Automated irrigation has been achieved with the support of soil moisture sensors and intelligent irrigation systems (Benedict 1988). The agricultural industry of today is data-centric, precise, and more intelligent than ever before (Ayaz et al. 2019). As one of the main sources of irrigation, the GWL needs to be predicted for sustainable use.
Data acquisition and parameter selection are key to predicting the GWL. Monitoring the dynamic GWL data can elucidate the current situation of groundwater utilization, enabling decision-makers to realize the sustainable use of groundwater and plan accordingly (He et al. 2021). Time-series predictions based on historical GWLs and rainfall are reliable methods for predicting future GWLs (Bloomfield et al. 2003). Human activities also have an obvious impact on GWLs. For example, groundwater extraction significantly affects the GWL (Marco & Mathieu 2017). In contrast, the GWLs in western and northwest China have decreased significantly. In addition to human activities, temperature also has a high correlation with GWLs (Zhao et al. 2019). China has built large-scale GWL monitoring and meteorological monitoring stations, which can effectively predict GWLs by considering a variety of data sources.
Besides the data, the model is crucial for the prediction as well. Many machine learning methods have been successfully used by researchers for data-driven GWL prediction based on a variety of data sources. For example, rainfall and aquifer depths can be well predicted by multiple linear regression models (Mogaji et al. 2015). Researchers have also used support vector machines and wavelet transforms to predict GWLs (Zhou et al. 2017a, 2017b). Annual and seasonal GWL trend studies have been performed using the Mann–Kendall (MK) method, and fitting and prediction analyses have been carried out using autoregressive integrated moving average (ARIMA) modeling (Satish Kumar & Venkata Rathnam 2019). In recent years, deep learning models for GWL prediction have also been highlighted. Combining empirical model decomposition (Zhang et al. 2022), principal component analysis (Kim et al. 2021), wavelet, and other pretreatment methods with deep learning models such as gated recurrent unit (GRU) (Gharehbaghi et al. 2022), and long short-term memory (LSTM) (Shin et al. 2020; Kim et al. 2021; Zhang et al. 2022) networks has achieved reliable results in accurately predicting GWLs. Despite the lack of research, a transformer has shown a strong potentiality in predicting GWL because it could capture long-distance dependence (Vaswani et al. 2017) and can adapt to time-series prediction tasks. In New York City, transformers have shown excellent performance in short-term power load forecasting (Ran et al. 2023), network data prediction (Kong et al. 2022), photovoltaic power generation forecasting (Tian et al. 2022), and financial time-series prediction (Preeti & Singh 2022). The high calculation time complexity of self-attention, the large memory footprint caused by high numbers of parameters, and the slow prediction speed of the step-by-step mechanism have led to the difficult large-scale generalization of transformer-based models (Zhou et al. 2021). The Informer, with its prob-attention mechanism, was therefore proposed, effectively solving the shortcomings of the transformer and achieving results beyond those of LSTM, ARIMA, and other models on power load prediction datasets (Zhou et al. 2021).
The accuracy of groundwater depth prediction modeling is of great significance to the rational utilization of groundwater resources, the sustainable development of regional social economies, and the evaluation of ecological environments (Zhang et al. 2019). The integrated response of GWLs to several factors including climate, topography, groundwater extraction, and hydrogeology and their interactions makes GWL simulation a challenging task (Hai et al. 2022). Although there are areas where monitoring data are lacking, distribution estimates of groundwater extraction based on groundwater balance models, land use, statistical information, and qualitative surveys can be used to predict underground water levels (Vu et al. 2020a). However, most studies have focused on prediction accuracy, and the time-delay problem of prediction series makes it difficult to apply these models in the actual project. We need effective methods to reduce the delay in prediction when predicting GWL, in addition to selecting the appropriate parameters and models.
In this study, groundwater extraction and meteorological data were obtained, along with GWL monitoring data from electromechanical wells, through a regional irrigation IoT system. The obtained data were preprocessed, including outlier correction, linear interpolation, and wavelet filtering. The most suitable prediction parameters were selected by performing the correlation analysis. Comparing the multiple time-scale prediction results of LSTM, GRU, multi-layer perceptron (MLP), one-dimensional convolutional neural network (1DCNN), the Transformer and the informer select the most suitable model. A new loss function is presented and its effectiveness in reducing the delay in predicted sequences is verified.
Study area and data
Hutubi County, belonging to the Changji Hui Autonomous Prefecture of Xinjiang Uygur Autonomous Region, is located in the central and northern parts of Xinjiang, with a total population of 220,000, geographical coordinates spanning from east longitude 86°5′ to 87°8′ and north latitude 43°7′ to 45°20′, and a total area of 9,518 km2. Hutubi County has a temperate continental arid and semi-arid climate. The average temperature in the plain area is 6.7 °C, the annual precipitation is 167 mm, the average frost-free period is 180 days, and the annual total sunshine duration is 3,090 h; the annual effective accumulated temperature, which is stable at more than 10 °C, is 3,553 °C. Cotton, corn, and wheat are the main crops in the county. From May to August, crops grow in the plain areas; the average sunshine hours are more than 10 h/d in the season of vigorous growth and more than 11 h in July. The combination of high evaporation rates and low rainfall has promoted the development of irrigated agriculture. However, due to the extensive exploitation of groundwater, the GWL in the county continues to decline. To ensure the safety and sustainable development of groundwater resources, the government has established a dual control monitoring system for well electricity to monitor and control the development of local groundwater resources.
Method
Deep learning models
This study used the six models for the long time-series prediction of GWLs. They can be divided into four categories. Both LSTM and GRU are recurrent neural networks. The LSTM consists of three gate units (namely, a forgetting gate, an input gate, an output gate), and a memory unit (Zheng et al. 2017). The GRU is improved from the LSTM, combining the cell state and the hidden state into one state, and is controlled using the update gate and the reset gate (Cho et al. 2014). MLP is the most classic deep learning model, whose structure involves the full connection of multiple monolayers that are composed of a group of neurons (Benedict 1988). 1DCNN uses multiple convolution kernels to extract features by convolution calculation, and the output serves as the input to the next layer of convolution operations (Zhou et al. 2017a, 2017b).
The Transformer and the Informer connect encoders and decoders through a self-attention mechanism, which is a new deep learning structure.
Error measure and model evaluation
Loss function
Deep neural networks can become a real-time tool to predict GWL for a certain period, just requiring input of historical data after iterative supervised learning. Supervised learning relies on the back-propagation mechanism, the most critical of which is to calculate the bias of the predicted and supervised values, and the function used to measure the bias is called the loss function.
Customarily, MSE is taken as the loss function when predicting GWL. However, when there are serious delay phenomena and shape errors in time-series prediction, it renders the prediction meaningless. Time delay refers to the delay of the predicted sequence compared to the real sequence. To address the delay phenomenon predicted by the model, a new loss function is designed to penalize Euclidean distance errors and time delays simultaneously, and the corresponding coefficients, α, β, and γ, can be determined according to the specific dataset.
Data fusion method
All GWLMSs share the same sequence of meteorological data.
RESULTS
Parameter selection and data preprocessing
A correlation analysis was performed on the alternative parameters to determine the input parameters of the model. The results of the correlation analysis are shown in Table 1, where ET0 and daily water volume were associated with GWL, while other parameters showed little correlation with GWL.
. | GWL . | ET0 . | Daily pumping volume . | Daily rainfall . | Temperature . | Humidity . | Atmospheric pressure . |
---|---|---|---|---|---|---|---|
GWL | 1 | ||||||
ET0 | 0.243 | 1 | |||||
Daily pumping volume | 0.26 | 0.661 | 1 | ||||
Daily rainfall | 0.051 | 0.058 | −0.032 | 1 | |||
Temperature | 0.084 | 0.761 | 0.488 | −0.225 | 1 | ||
Humidity | 0.044 | −0.132 | −0.214 | 0.662 | −0.109 | 1 | |
Atmospheric pressure | 0.026 | 0.105 | 0.038 | 0.373 | 0.083 | −0.026 | 1 |
. | GWL . | ET0 . | Daily pumping volume . | Daily rainfall . | Temperature . | Humidity . | Atmospheric pressure . |
---|---|---|---|---|---|---|---|
GWL | 1 | ||||||
ET0 | 0.243 | 1 | |||||
Daily pumping volume | 0.26 | 0.661 | 1 | ||||
Daily rainfall | 0.051 | 0.058 | −0.032 | 1 | |||
Temperature | 0.084 | 0.761 | 0.488 | −0.225 | 1 | ||
Humidity | 0.044 | −0.132 | −0.214 | 0.662 | −0.109 | 1 | |
Atmospheric pressure | 0.026 | 0.105 | 0.038 | 0.373 | 0.083 | −0.026 | 1 |
Bolding indicates that the corresponding parameter on the right has a high correlation with the groundwater level.
Selection of the deep learning model
Depress time delay
Meanwhile, we compared the MAE and MSE of the prediction results when using two loss functions, MSE and Lintegrated. Table 2 shows the results. Of the 18 group results, Lintegrated outperformed MSE on 11. In the remaining seven groups, the mean MAE using Lintegrated was only 0.037 m higher than that using MSE, and the mean MSE was 0.06 higher. This demonstrates that the Lintegrated loss function can achieve comparable or even superior results to MSE, further confirming the above conclusion.
Pre_days . | Loss . | Metric . | GWLMS . | |||||
---|---|---|---|---|---|---|---|---|
1 . | 2 . | 4 . | 5 . | 6 . | 7 . | |||
12 | Lintegrated | MAE | 0.154 | 0.165 | 0.190 | 0.162 | 0.310 | 0.206 |
MSE | 0.108 | 0.121 | 0.347 | 0.117 | 0.486 | 0.160 | ||
MSE | MAE | 0.216 | 0.105 | 0.248 | 0.168 | 0.385 | 0.200 | |
MSE | 0.278 | 0.152 | 0.489 | 0.178 | 0.551 | 0.148 | ||
24 | Lintegrated | MAE | 0.295 | 0.119 | 0.295 | 0.268 | 0.502 | 0.356 |
MSE | 0.276 | 0.389 | 0.425 | 0.371 | 0.816 | 0.185 | ||
MSE | MAE | 0.371 | 0.220 | 0.300 | 0.290 | 0.532 | 0.352 | |
MSE | 0.462 | 0.374 | 0.541 | 0.411 | 0.845 | 0.184 | ||
36 | Lintegrated | MAE | 0.327 | 0.185 | 0.633 | 0.420 | 0.640 | 0.316 |
MSE | 0.499 | 0.669 | 0.831 | 0.645 | 0.959 | 0.454 | ||
MSE | MAE | 0.865 | 0.105 | 0.542 | 0.413 | 0.611 | 0.307 | |
MSE | 0.960 | 0.491 | 0.756 | 0.562 | 0.982 | 0.442 |
Pre_days . | Loss . | Metric . | GWLMS . | |||||
---|---|---|---|---|---|---|---|---|
1 . | 2 . | 4 . | 5 . | 6 . | 7 . | |||
12 | Lintegrated | MAE | 0.154 | 0.165 | 0.190 | 0.162 | 0.310 | 0.206 |
MSE | 0.108 | 0.121 | 0.347 | 0.117 | 0.486 | 0.160 | ||
MSE | MAE | 0.216 | 0.105 | 0.248 | 0.168 | 0.385 | 0.200 | |
MSE | 0.278 | 0.152 | 0.489 | 0.178 | 0.551 | 0.148 | ||
24 | Lintegrated | MAE | 0.295 | 0.119 | 0.295 | 0.268 | 0.502 | 0.356 |
MSE | 0.276 | 0.389 | 0.425 | 0.371 | 0.816 | 0.185 | ||
MSE | MAE | 0.371 | 0.220 | 0.300 | 0.290 | 0.532 | 0.352 | |
MSE | 0.462 | 0.374 | 0.541 | 0.411 | 0.845 | 0.184 | ||
36 | Lintegrated | MAE | 0.327 | 0.185 | 0.633 | 0.420 | 0.640 | 0.316 |
MSE | 0.499 | 0.669 | 0.831 | 0.645 | 0.959 | 0.454 | ||
MSE | MAE | 0.865 | 0.105 | 0.542 | 0.413 | 0.611 | 0.307 | |
MSE | 0.960 | 0.491 | 0.756 | 0.562 | 0.982 | 0.442 |
Bolding indicates that the corresponding parameter on the right has a high correlation with the groundwater level.
CONCLUSIONS
In this study, groundwater extraction data, meteorological data, and GWL monitoring data were collected through an IoT system for irrigation. ET0, groundwater extraction, and GWL were selected to predict the underground water table based on the Pearson correlation analysis. The correlation of the rainfall with the water table is low due to very little rainfall in the study area. After the data were preprocessed, a novel data fusion approach was introduced by incorporating the groundwater extraction data from MPWs into the prediction of GWLs, constructing the GWLMS1–7 datasets.
Informer, was selected from seven models including LSTM, GRU, MLP, 1 DCNN, Transformer, and Informer, performing the best on six datasets. To address the time-delay problem of the predicted sequences, an integrated loss function considering the Euclidean error, time warping, and time delay is proposed. On six datasets, smaller MSE and MAE were achieved using the integrated loss function compared to the MSE loss function.
In the end, this paper summarizes the GWL prediction models selected in previous studies, as well as prediction time granularities and model performances. It is easy to deduce from Table 3 that our prediction error is acceptable compared to previous studies; results of MSE and MAE are comparable and even better.
Research studies . | Method . | Time scale . | Delay and shape error . | Evaluation index . | |
---|---|---|---|---|---|
. | . | . | . | MAE . | MSE . |
Pham et al. (2022) | Random tree | Quarterly | Normal | 0.40 | 0.36 |
Zhang et al. (2021) | RBF | Monthly | Obvious | / | 0.02 |
Amin et al. (2022) | GRU | Monthly | Little | 0.01 | / |
Liang et al. (2021) | KNN-LSTM | Monthly | Obvious | ≈0.16 | ≈0.05 |
Vu et al. (2020b) | LSTM | Monthly | Obvious | 0.84 | 0.02 |
Bum et al. (2021) | PCA-LSTM | Daily | Normal | / | 0.04 |
He et al. (2021) | 1DCNN | Daily | Normal | / | 0.04 |
MunJu et al. (2020) | LSTM | Daily | / | / | 0.11 |
Ours | Improved Informer | Daily | Little | 0.24 | 0.11 |
Research studies . | Method . | Time scale . | Delay and shape error . | Evaluation index . | |
---|---|---|---|---|---|
. | . | . | . | MAE . | MSE . |
Pham et al. (2022) | Random tree | Quarterly | Normal | 0.40 | 0.36 |
Zhang et al. (2021) | RBF | Monthly | Obvious | / | 0.02 |
Amin et al. (2022) | GRU | Monthly | Little | 0.01 | / |
Liang et al. (2021) | KNN-LSTM | Monthly | Obvious | ≈0.16 | ≈0.05 |
Vu et al. (2020b) | LSTM | Monthly | Obvious | 0.84 | 0.02 |
Bum et al. (2021) | PCA-LSTM | Daily | Normal | / | 0.04 |
He et al. (2021) | 1DCNN | Daily | Normal | / | 0.04 |
MunJu et al. (2020) | LSTM | Daily | / | / | 0.11 |
Ours | Improved Informer | Daily | Little | 0.24 | 0.11 |
RBF, radial basis function; KNN, K-nearest neighbor; PCA, principal component analysis.
ACKNOWLEDGEMENTS
Thanks to Beijing Lianchuang Siyuan Measurement and Control Technology Co., Ltd. for providing the pumping data.
DATA AVAILABILITY STATEMENT
Data cannot be made publicly available; readers should contact the corresponding author for details.
CONFLICT OF INTEREST
The authors declare there is no conflict.