[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Next Article in Journal
Projected Drought Prevalence in Malawi’s Lufilya Catchment: A Study Using Regional Climate Models and the SPI Method
Previous Article in Journal
Comparison and Integrated Application for Runoff Simulation Models in Small and Medium-Sized River Basins of Southeast China Coastal Area
You seem to have javascript disabled. Please note that many of the page functionalities won't work as expected without javascript enabled.
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Prediction of the Dissolved Oxygen Content in Aquaculture Based on the CNN-GRU Hybrid Neural Network

School of Electronic and Electrical Physics, Fujian University of Technology, Fuzhou 350014, China
*
Author to whom correspondence should be addressed.
Water 2024, 16(24), 3547; https://doi.org/10.3390/w16243547
Submission received: 13 November 2024 / Revised: 2 December 2024 / Accepted: 9 December 2024 / Published: 10 December 2024
(This article belongs to the Section Water, Agriculture and Aquaculture)

Abstract

:
The dissolved oxygen (DO) content is one of the important water quality parameters; it is crucial for assessing water body quality and ensuring the healthy growth of aquatic organisms. To enhance the prediction accuracy of DO in aquaculture, we propose a fused neural network model integrating a convolutional neural network (CNN) and a gated recurrent unit (GRU). This model initially employs a CNN to extract primary features from water quality parameters. Subsequently, the GRU captures temporal information and long-term dependencies, while a temporal attention mechanism (TAM) is introduced to further pinpoint crucial information. By optimizing model parameters through an improved particle swarm optimization (IPSO) algorithm, we develop a comprehensive IPSO-CNN-GRU-TAM prediction model. Experiments conducted using water quality datasets collected from Eagle Mountain Lake demonstrate that our model achieves a root mean square error (RMSE) of 0.0249 and a coefficient of determination (R2) of 0.9682, outperforming other prediction models with high precision. The model exhibits stable performance across fivefold cross-validation and datasets of varying depths, showcasing robust generalization capabilities. In summary, this model allows aquaculturists to precisely regulate the DO content, ensuring fish health and growth while achieving energy conservation and carbon reduction, aligning with the practical demands of modern aquaculture.

1. Introduction

Aquaculture, as a crucial economic industry globally, provides an abundance of food resources for humanity. China is the world’s largest aquaculture producer, accounting for more than 60% of the total [1]. In recent years, the discharge of contaminated water from Japanese nuclear facilities has led to severe marine pollution, sparking deep concerns among consumers about the safety of seafood. Against this backdrop, consumers have actively sought out seafood from reliable sources with guaranteed quality, which has promoted the development of freshwater aquaculture markets. Compared to marine aquaculture, freshwater aquaculture offers higher control and regulatory capabilities, thus better ensuring the safety of the aquaculture environment and the quality of aquatic products. Meanwhile, the “land-based seafood farming” model in Xinjiang, China, has gradually garnered attention. This model shifts seafood farming to land, utilizing saline/alkali soil to simulate a marine environment for stable farming. It not only enriches the seafood market but also alleviates the resource and environmental pressures on marine aquaculture. Furthermore, by leveraging Xinjiang’s geographical advantages and scientific farming techniques, this model provides a new avenue for food safety and the sustainable development of aquaculture [2].
Dissolved oxygen (DO) is one of the crucial water quality parameters used for assessing water body quality, whether in freshwater aquaculture or land-based marine aquaculture [3,4]. An appropriate DO content (above 5.0 mg/L) can ensure the growth and development of aquatic organisms, while a low DO content (below 3.0 mg/L) might hinder biological growth, resulting in considerable economic losses and even mortality [5]. Therefore, maintaining DO content above the minimum value is essential. Currently, most aquaculture farms regulate the DO content with periodic oxygenation. This approach not only results in a low DO content in cases of untimely oxygenation but also increases the zero-output energy consumption in cases of failure to halt oxygenation in a timely way following DO saturation.
Accurate prediction of the DO content provides a basis for water quality monitoring and control, achieving early warning and scientific water quality management objectives [6], reducing fish disease outbreaks, and improving aquaculture efficiency, all of which have significant economic value. Simultaneously, by anticipating the DO content, accurately regulating the operation time of oxygenation equipment can prevent continued oxygenation after DO saturation, thus conserving energy and reducing carbon emissions. This is critical for sustainable development and environmental protection, especially given the current societal emphasis on ecological balance and resource conservation, and it has significant academic and practical value.
However, DO exhibits nonlinearity, strong coupling, and temporal variability, making simple modeling challenging [7]. Scholars around the world have used various methods to predict DO concentrations. Traditional prediction models such as linear regression, autoregressive integrated moving averages (ARIMAs), and the Markov model are widely used. For example, Li et al. used a discrete hidden Markov model and K-means clustering to predict DO turbidity and saturation [8]. The results showed that the model possessed a simple structure and strong interpretability, and it achieved satisfactory predictive accuracy. However, statistical models have inherent limitations, while water quality parameters are often jointly influenced by various nonlinear factors such as temperature, pH levels, and organic matter content. Therefore, traditional statistical models have inherent limitations in predicting and analyzing these water quality parameters [9].
Machine learning models such as support vector machine (SVM), extreme learning machine (ELM), and random forest (RF) have been extensively utilized for DO prediction in different environments. For example, Feng et al. proposed a hybrid model, WTD-GWO-SVR, that combines wavelet threshold denoising (WTD), grey wolf optimization (GWO), and support vector regression (SVR) to accurately predict the DO content in aquaculture environments [10]. Nong et al. proposed an SVR model that combines multiple intelligent technologies to accurately predict DO in complex environments [11]. Shi et al. used an optimized regularized extreme learning machine (RELM) model, factor extraction, and K-medoids clustering to accurately predict DO in black bass culture ponds. They improved the prediction accuracy of DO variations under different weather conditions by using day/night cycle segmentation and clustering mechanisms [12]. Although machine learning models have been successfully applied in DO prediction, they have some limitations. The SVM model is efficient but challenging to train with large-scale samples and sensitive to kernel function selection [13]. The ELM model is limited in its ability to handle nonlinear data, while the RF model is susceptible to overfitting [14].
In recent years, deep learning has gained significant popularity in various fields as a widely applied method. Neural network models effectively correlate previous information with current tasks by mimicking the memory function of the human brain. Thus, they have received extensive attention and application in dealing with complex temporal problems. Huan et al. utilized a combination of GBDT and LSTM to establish a DO prediction model for ponds, which exhibited high prediction accuracy and generalization ability [15]. However, we need to modify the model parameters based on subjective experience, which introduces a certain degree of uncertainty into the process. Guo et al. proposed a PCA-PFA-GRU hybrid prediction model for DO prediction in black bass aquaculture water bodies [16]. This model reduced prediction error fluctuations and improved prediction accuracy by extracting key factors through principal component analysis (PCA) and optimizing critical parameters of GRU through a pathfinding algorithm (PFA). However, PCA-PFA requires the pre-determination of parameters such as the number of principal components, which limits its ability to deal with nonlinear data.
Barzegar et al. established LSTM and CNN models as well as their hybrid model CNN-LSTM to predict DO concentration. The experimental findings showed that the hybrid model, combining the advantages of LSTM and CNN, effectively captured water quality variables and performed well in prediction [17]. Similarly, Hu et al. also developed a CNN-LSTM hybrid model to predict the daily minimum DO concentration in rivers, which showed greater stability than using only the LSTM model [18]. However, despite the superior performance of the CNN-LSTM model in DO prediction, it still faces challenges such as difficulty in hyperparameter tuning and long training times.
In recent years, besides the integration of neural network models, attention mechanisms have also been increasingly incorporated into time series forecasting. For instance, Liu et al. developed an attention-based recurrent neural network (RNN) for both short-term and long-term predictions of dissolved oxygen levels. The experimental findings demonstrate that integrating attention mechanisms with RNNs enhances the model’s prediction accuracy [19]. Wang et al. integrated spatial and temporal attention with LSTM to develop the STA-LSTM hybrid model. Specifically, the temporal attention mechanism emphasizes relevant information within the temporal dimension by assigning weights to information extracted at each time step, thereby enhancing prediction accuracy and improving model interpretability [20]. However, the spatio-temporal attention mechanism is relatively complex, and there may be issues with timeliness when applied to dissolved oxygen prediction.
Liu et al. optimized the parameters of the BP neural network prediction model using an improved whale optimization algorithm (IWOA), thereby establishing a hybrid prediction model known as CEEMDAN-IWOA-BP. Their research findings indicate that the IWOA outperforms the standard WOA, genetic algorithm (GA), and PSO in optimizing BP neural network parameters for water quality characteristic prediction [21]. However, the study failed to compare IWOA with IPSO, making it impossible to determine the advantages and disadvantages of the two. Ji et al. proposed a hybrid model combining an IPSO algorithm with an LSTM network for stock price prediction. By introducing an adaptive mutation factor and adopting a nonlinear inertia weight adjustment strategy, the study effectively optimized the hyperparameters of the LSTM network, significantly boosting the model’s prediction performance [22]. Sun et al. constructed a predictive model integrating fish behavior and aquatic environmental factors, based on a BP neural network enhanced with an IPSO algorithm incorporating an inverse sine decreasing inertia weight strategy (IPSO-BPNN), to accurately predict the number of carp suffering from hypoxia [23]. IPSO demonstrates superior parameter selection performance and strong adaptability across various domains, yet its application in dissolved oxygen prediction is still inadequate.
To address the above issues, this study proposes the IPSO-CNN-GRU-TAM model, which integrates improved particle swarm optimization, the temporal attention mechanism, the convolutional neural network, and the gated recurrent unit to model and predict the DO content in aquaculture. The aim is to increase prediction accuracy, verify the reliability and accuracy of the model, and provide a decision-making basis for DO regulation.

2. Materials and Methods

2.1. Experimental Data Collection

This study’s dataset consists of vertical profile water quality data collected from Eagle Mountain Lake, TX, USA. Dr. J. Thad Scott, and team members Durell, Nychka, and Hering collected the data with support from the Tarrant Regional Water District. The dataset is available on Kaggle at https://www.kaggle.com/datasets/visalakshiiyer/forecasting-lake-do (accessed on 16 April 2024).
The dataset contains 47,292 entries that cover measurements from 5 April 2019 to 29 October 2019, with data collected at 2-h intervals. The parameters are the depth from the lake surface, temperature, DO, DO saturation, conductivity, and pH.
In aquaculture, pond farming is the most commonly applied method. Typically, the water depth in pond farming ranges from 1 to 3 m. This study used data at a 3-m depth for model training because this depth, as the upper limit of the range, comprehensively reflects the complexity of deeper water environments and provides reliable predictions for the scientific management of pond farming. Among them, there are a total of 2252 data points at each depth, with 1802 data points used as the training set and 450 data points used as the test set for training.
The histogram of DO distribution in Figure 1 exhibits asymmetry, indicating a skewed distribution of DO data. Additionally, we conducted the Kolmogorov–Smirnov (K-S) test for normality. In the K-S test, a larger statistic value suggests a greater discrepancy between the data distribution and the normal distribution. A p-value smaller than the significance level (typically 0.05) implies rejection of the null hypothesis, i.e., the data do not follow a normal distribution. The test results showed a K-S statistic of 0.8796 and a p-value of 0, far less than 0.05, further confirming the non-normality of the DO data. However, statistical methods such as Gaussian mixture models, ARMA, and ARIMA are all based on the normal distribution assumption. Therefore, these models are not suitable for predicting DO data.

2.2. Data Preprocessing

2.2.1. Handling Missing Values

In the process of data collection, disturbances such as human error, network transmission failures, or equipment malfunctions can lead to missing data points in time series datasets. Maintaining data continuity over time requires effective handling of these gaps. Despite the richness of research in data restoration, its complexity, high computational costs, and lengthy processing times make direct application challenging for short-term forecasting in aquatic environments. Practical environmental management algorithms prioritize stability, simplicity, and real-time capability to swiftly process and respond to live data.
In the aquaculture field, data usually do not exhibit drastic variations. Therefore, based on the principle of cubic spline interpolation [24], for this experiment, a piecewise linear interpolation method is proposed to restore the missing data at adjacent time points. The fundamental idea of this method is to approximate the function within each subinterval as a linear function, maintaining the smoothness and continuity of the data by ensuring the continuity of function values and first-order derivatives at the boundaries of each subinterval. Compared with the traditional linear interpolation method, the piecewise linear interpolation method has higher accuracy and better continuity while maintaining a relatively small computational load. The formula for piecewise linear interpolation is presented as follows.
For a given set of data points ( x i , y i ), we can construct piecewise linear functions to approximate the original function, as follows:
y ( x ) = a i x + b i                 x i x < x i + 1 a i + 1 x + b i + 1       x i + 1 x < x i + 2
where a i and b i are the coefficients to be determined. To obtain these coefficients, we need to satisfy the following conditions:
At each data point, the following function values are equal: y(xi) = yi;
At the boundaries of each small interval, the function values and first derivatives are continuous: y i ( x i + 1 ) = y i + 1 ( x i + 1 ) , y i ( x i + 1 ) = y i + 1 ( x i + 1 ).
By resolving these equations, we can obtain all the coefficients, thus obtaining the expression of the piecewise function and enabling interpolation. At this point, for any given value of x, we can predict the value of y(x) by taking the weighted average of a i and b i within the corresponding small interval.
In cases where there are numerous missing data points, mean smoothing is used to fill the gaps. The formula is
x t = x t 1 + x t + 1 2
where x t represents the missing data at time t , x t 1 represents the data at time t 1 , and x t + 1 represents the data at time t + 1 .

2.2.2. Data Normalization

In the experiment, we measured a total of 5 sets of water quality data: temperature, DO concentration, DO saturation, conductivity, and pH. Owing to the different dimensions and wide numerical distributions of these water quality parameters, if the data are not uniformly processed, problems such as dimension inconsistency and slow model convergence may occur during subsequent model training, seriously affecting the predictive performance of the model. Additionally, data normalization can effectively reduce the convergence time of neural network training, and enhancing the model’s generalization capability allows for better adaptation to new data [25].
Z-score normalization assumes that the data follow a normal distribution. Robust scaling is sensitive to outliers. The DO dataset is uniform and has no obvious outliers. Therefore, we chose min–max normalization. Min–max normalization scales the feature values to a fixed interval, with the chosen interval being [0, 1]. The formula is as follows:
X = X X m i n X m a x X m i n
where X represents the original feature data, and X m i n , X m a x represent the minimum and maximum values of the feature data, respectively.

2.2.3. Data Correlation Analysis

Since the aquaculture online monitoring system collects diverse types of data, directly using all data as inputs to the model would lead to oversized models and increased computation time [26]. To address this issue, we first applied the partial autocorrelation function (PACF) to examine the autocorrelation in the time series data. The results indicate that the variables exhibit truncation at lag 1. Although some variables show a certain degree of autocorrelation at specific lag orders, this autocorrelation is generally insignificant overall and unlikely to substantially influence the results of Pearson correlation analysis. Therefore, the Pearson correlation coefficient formula was used to select the key influencing factors of DO to reduce input dimensions and address information redundancy.
In statistics, the correlation coefficient (denoted as r) ranges from −1 to 1. When |r| ≥ 0.8, it indicates a high degree of linear correlation between two variables. When 0.6 ≤ |r| < 0.8, it indicates a strong correlation. When 0.4 ≤ |r| < 0.6, it indicates a moderate correlation. If 0.2 ≤ |r| < 0.4, it suggests a weak correlation. When |r| < 0.2, it implies no linear correlation [27].
According to the calculated results, the feature importance ranking of each factor is as follows: DO saturation, pH value, temperature, and conductivity, as shown in Table 1. This study selected environmental factors with elevated and significant linear correlations, namely, the DO content with DO saturation, pH, and temperature, as input samples for the DO prediction model to reduce data dimensionality and complexity, thereby improving model prediction performance.
Table 1 indicates a high degree of linear correlation between DOsat and the DO content. However, other parameters also provide additional information related to the DO content. Therefore, this study introduces alternative models to explore diverse data characteristics, enhancing model prediction accuracy and generalization capability.

3. Data Modeling Methodology

Deep learning models, in contrast to traditional statistical methods, exhibit automatic feature extraction and autonomous learning characteristics. They are not influenced by the assumption of data normality. Therefore, deep learning models have been widely applied in dealing with nonlinear and non-stationary data. In this section, we introduce the deep learning methods employed in this study, including CNN, GRU, TAM, IPSO, and the comprehensive prediction model (IPSO-CNN-GRU-TAM).

3.1. Convolutional Neural Network (CNN)

Due to the multitude of factors affecting DO and the intricate coupling relationships between them, this study employs a one-dimensional convolutional neural network (1D-CNN) for feature extraction. Compared to a 2D convolutional neural network (2D-CNN) or traditional RNN, the 1D-CNN offers higher efficiency and better performance when dealing with low-dimensional data with temporal characteristics. They are more suitable for uncovering potential information among input variables. This method explores the intrinsic connections of the data through local perception and weight sharing, effectively extracting deep features from the data [28]. The feature extraction formula is as follows:
Y = σ(W·X + b)
where Y is the result after feature extraction; σ is the activation function; W is the weight; X is the input sequence; and b is the bias term.
The CNN mainly consists of convolutional layers and pooling layers. The convolutional layer is responsible for extracting parameter features of the input sequence, which are then passed to the pooling layer, and finally, the results are obtained through the fully connected layer. Figure 2 illustrates the structure of the CNN.

3.2. Gated Recurrent Unit (GRU)

The GRU, first introduced by Chung et al. in 2014, is an optimized model based on LSTM and is a variant of the RNN [29]. It addresses the problems of gradient explosion and vanishing gradients when dealing with long-term dependencies by introducing gate structures. Compared to LSTM, the GRU network has only two gate structures: the reset gate and the update gate. The reset gate combines the current input information with past information, while the update gate retains memory information by setting time steps. Its structure is illustrated in Figure 3.
Although LSTM and GRU exhibit similar prediction accuracy, the GRU model demonstrates faster convergence and lower computational costs. The computational formulas are as follows:
z t = σ ( W ( z ) x t + U ( z ) h t 1 )
r t = σ ( W ( r ) x t + U ( r ) h t 1 )
h t ~ = t a n h ( r t U h t 1 + W x t )
h t = ( ( 1 z t ) h t ~ + z t h t 1 )
where z t is the update gate, r t is the reset gate, h t is the input to the hidden layer, h t 1 represents the aggregation of input x t and past hidden layer states h t 1 , U ( z ) ,   W ( z ) , U ( r ) , W ( r ) , U , and W are trainable parameter matrices, and σ and t a n h represent the sigmoid activation function and the tanh activation function, respectively.

3.3. Temporal Attention Mechanism (TAM)

Attention mechanisms are crucial tools in neural networks, playing a pivotal role in handling sequential data. They mimic the human process of allocating attention during information processing, enabling networks to dynamically focus on different parts of the input, thereby enhancing the model’s expressive and generalization capabilities [30]. Traditional neural networks treat all inputs uniformly and are unable to distinguish the importance of different elements within a sequence, whereas attention mechanisms can dynamically assign weight to inputs. By learning these allocation patterns, networks can focus on task-relevant information while ignoring irrelevant data.
In constructing predictive models, since the variation in the target variable is influenced by historical states and the impact of water environment data at different time points vary in prediction outcomes, we introduce the TAM combined with CNN to enhance its performance, as illustrated in Figure 4. This mechanism adaptively captures critical information from historical states and strengthens the influence of relevant temporal state information on current prediction outcomes. Initially, the model applies convolutional operations to input features, followed by dimension reduction through average and max pooling layers, generating two new sets of features. Subsequently, these two sets of features are concatenated and further compressed via convolution to produce a single-channel feature. Next, a sigmoid activation function is used to generate and normalize temporal attention weights. Finally, these weights are multiplied by the corresponding elements of the input features to produce weighted temporal features. The operational process of TAM is formulated as follows:
F T = C o n v ( F )
F a v g T = A V G ( F T )
F m a x T = M A X ( F T )
F a t t T = C o n v ( C o n c a t ( F a v g T + F m a x T ) )
W T = σ ( F a t t T )
T = F T W T
where F represents the output from the previous time step; C o n v denotes convolutional operations; A V G and M A X are global average pooling and global max pooling operations on features in the channel dimension; C o n c a t denotes feature concatenation; σ is the sigmoid function; W T is the weight vector of TAM; T denotes the output of TAM; and represents element-wise multiplication.
TAM performance relies heavily on the training data and model parameter selection. Insufficient training data or inappropriate parameter settings can lead to overfitting or underfitting. This affects the model’s generalization ability and stability.

3.4. Improved Particle Swarm Optimization (IPSO)

The final prediction results are directly influenced by the CNN-GRU-AM model’s various parameters, including the number of hidden layer neurons, learning rate, and training epochs. Typically, it requires a considerable amount of experimentation to find suitable parameter settings, which can involve a high degree of subjectivity and uncertainty. To solve this problem, we introduce the PSO algorithm for parameter optimization. Kennedy and Eberhart first proposed the PSO algorithm in their research [31]. PSO is a heuristic optimization algorithm inspired by observations of collective behavior in natural groups, such as birds or fish. Its basic procedure involves the following steps:
(1)
Population initialization (with a population size of N), including random positions and velocities;
(2)
Computing the fitness of each particle;
(3)
Comparing the fitness of each particle with its individual best position (pbest). If the fitness is improved, the particle’s best position (pbest) is updated to the current position;
(4)
Comparing the fitness of each particle with the swarm’s best position (gbest). If the fitness is improved, the swarm’s best position (gbest) is updated to the current position;
(5)
Adjusting the velocity and position of each particle according to Formulas (15) and (16);
(6)
Iterating from step (2) until the termination condition is met.
v i d k + 1 = ω v i d k + c 1 r 1 ( p i d k y i d k ) + c 2 r 2 ( p g d k y g d k )
x i d k + 1 = x i d k + v i d k
In these formulas, k denotes the current iteration, ω represents the inertia weight, c 1 and c 2 are learning factors, r 1 and r 2 are random constants within the range [0, 1], P i = ( p i 1 , , p i n ) T represents the individual best position, and P g = ( p g 1 , , p g n ) T denotes the swarm’s best position.
The termination condition is typically set as the maximum number of iterations or achieving the desired prediction accuracy.
In researching complex optimization problems, the PSO algorithm shows significant effects. However, it often lacks effective parameter control, leading to slow convergence, a tendency to become stuck in local optima, and low precision in later iterations [32]. To address these issues, we adjust the inertia weight and learning factors to balance exploration and exploitation. Exploration helps the algorithm find new solutions in the search space. Exploitation focuses on optimizing the already discovered high-quality solutions. This approach improves the overall performance of the algorithm.

3.4.1. Improved Inertia Weight

Based on previous research findings, the inertia weight is considered one of the most critical adjustable parameters in the PSO model [33]. Proper selection of the inertia weight helps balance local and global search, reduce iteration numbers, and enhance the performance of the particle swarm optimization algorithm. As the number of iterations increases, the inertia weight exhibits a nonlinear decreasing trend, which significantly enhances particle convergence. Therefore, to achieve a better balance between local and global search, an improved inertia weight can be adjusted using a nonlinear hyperbolic tangent function, as shown in the following expression:
ω T = ω m a x ( ω m a x ω m i n ) · t a n h ( π 4 · T T m a x )
where ω T is the improved inertia weight for each particle, ω m i n is the minimum inertia weight, ω m a x is the maximum inertia weight, T is the current iteration, and T m a x is the maximum number of iterations. We replace ω in Equation (15) with ω T . Each particle’s inertia weight ( ω T ) is independently updated according to the above equation.

3.4.2. Improved Learning Factor

In the particle swarm optimization algorithm, the learning factors c 1 and c 2 are used to adjust the step size of particles moving between individual best positions and global best positions. As the iteration progresses, it is typically necessary to adjust the values of c 1 and c 2 to achieve better search performance at different stages. In general, larger values are needed in the initial stage to accelerate the search speed and enhance the global search capability, whereas larger values are needed in the later iterations for the local refinement search to improve accuracy [34]. However, in the standard particle swarm optimization algorithm, setting ( c 1 = c 2 = 2) often fails to meet practical application requirements. Therefore, to improve the computation of the learning factors, a sine function is introduced to adjust the values of c 1 and c 2 . The improved formula for computing the acceleration coefficients is as follows:
c 1 = 2 1 s i n ( π 2 · T T m a x )
c 2 = 2 s i n ( π 2 · T T m a x )

3.5. Evaluation Indicators

The quality of prediction results for different models can be difficult to determine with the naked eye alone, so it is necessary to use specific parameter indicators to measure their performance. This study selects root mean square error (RMSE), mean square error (MSE), mean absolute error (MAE), and coefficient of determination (R2) to analyze and evaluate the prediction accuracy and generalization ability of various models [35]. These metrics can objectively reflect the performance of models in prediction tasks and are closely related to the field of time series prediction.

3.6. IPSO-CNN-GRU-AM Model

3.6.1. The Structure of the Model

In time series prediction, CNNs can effectively extract local features from sequential data and uncover latent information. However, due to their local attention characteristics, they may overlook global information, limiting their effectiveness in capturing long-term dependencies. In contrast, the recurrent neural network structure of GRU is appropriate for detecting long-term dependencies in time series data, but it may not be as effective in feature extraction as the CNN.
This study overcomes their respective limitations by combining the CNN and GRU, fully leveraging the CNN’s sensitivity to local features and the GRU’s sequence modeling capabilities. First, the CNN receives various parameters influencing the DO content in water quality and extracts high-level features of input sequence data using convolutional layers. Then, through pooling layers, the main data features are filtered to reduce computational complexity. Subsequently, the GRU receives the important data features processed by the CNN in chronological order and utilizes their gate structures to capture the temporal information and long-term dependencies of sequential data. Thus, the advantages of the CNN and GRU complement each other, improving the accuracy and generalization ability of time series prediction.
On the basis of the CNN-GRU structure, attention mechanisms are introduced to further extract key information. The temporal attention mechanism updates the weight parameter matrix by assigning weights to different feature vectors, improving the model’s prediction accuracy. To address potential overfitting, we added a dropout layer before the fully connected layer. This reduces the model’s excessive reliance on training data. It improves the model’s generalization ability. Finally, the IPSO algorithm is employed to optimize the critical parameters of the model, further improving its performance and robustness. The overall structure of the IPSO-CNN-GRU-TAM model is illustrated in Figure 5.

3.6.2. Algorithm Flow of the Model

The model algorithm flow is depicted in Figure 6 and is described in detail as follows:
Step 1: Data preprocessing (cleaning, normalization) and division into training and testing sets at a ratio of 8:2;
Step 2: Initialize model parameters. Set the number of population particles, maximum iteration count T, and basic parameters such as fitness function threshold and initialize the basic parameters of the CNN-GRU-TAM model;
Step 3: Particle initialization, randomly assign initial velocities and positions to each particle;
Step 4: Map particle parameters (number of hidden layers, learning rate, iteration count) to the CNN-GRU-TAM model and perform training;
Step 5: Compute the fitness of particles using the RMSE function as the fitness function;
Step 6: Select individual and global best particles;
Step 7: Update the current velocities and positions of particles;
Step 8: Check if the maximum iteration count is reached. If the condition is met, stop iteration; otherwise, return to Step 5;
Step 9: Convert the best solution of particles into the optimal parameters of the model;
Step 10: Construct the CNN-GRU-TAM model using the computed optimal parameters and predict the output results.

3.7. Model Parameter Initialization

In this experiment, to simulate scenarios of application control on an embedded system (Raspberry Pi 5) in subsequent work, all models were built and trained using the Keras framework. The environment used Python 3.9 and TensorFlow 2.10.0. The hardware is an AMD Ryzen 7 7735HS processor with Radeon Graphics CPU @ 3.20 GHz, 16 GB RAM, and a 64-bit operating system. We used the CPU for the experiment to make the performance closer to that of actual embedded systems. To ensure fairness, except for the IPSO-CNN-GRU-TAM and Transformer model, the common hyperparameters for all models were set as follows: 128 neurons in hidden layers, a learning rate of 0.01, 1200 iterations, and the loss function is MAE. For the Transformer model, its hyperparameters were set based on previous research findings, specifically, a batch size of 32, 100 iterations, a learning rate of 0.002, 2 attention heads, 1 encoder layer, and the loss function is MAE [36].
The initialization parameters for IPSO were as follows: population size P = 50, inertia weight ω m a x = 0.95, ω m i n = 0.3, maximum iteration count T = 200, and a fitness function threshold of 0.005 for particles in the population. The root mean square error (RMSE) was selected as the fitness function to evaluate the performance of the CNN-GRU-TAM model. The selection of IPSO parameters is based on extensive experiments and references [37], achieving minimal error and optimal computational efficiency on the training dataset. The search ranges for the parameters were set as follows: hidden layer neuron count (hidden_size) in the range [16, 256], learning rate (learning_rate) in the range [0.001, 0.2], and number of epochs (num_epochs) in the range [200, 1500]. Through the IPSO algorithm optimization, the optimal parameter combination for the CNN-GRU-TAM model was determined as hidden_size = 17, learning_rate = 0.001, and num_epochs = 1493.

4. Results and Discussion

4.1. Analysis of the Ablation Experiment

To validate the effectiveness of the CNN, TAM, and IPSO components in the model proposed in this study, four comparative models were designed:
(1)
GRU: A baseline model that excludes the CNN, TAM, and IPSO components;
(2)
CNN-GRU: A model that excludes TAM and IPSO;
(3)
CNN-GRU-TAM: A model that excludes IPSO;
(4)
IPSO-CNN-GRU-TAM: The comprehensive model proposed in this study.
Experiments were conducted using these four models, with the results presented in Figure 7, Figure 8 and Figure 9 and Table 2.
Figure 7 and Figure 8 demonstrate that the model presented in this study surpasses the GRU, CNN-GRU, and CNN-GRU-TAM models in terms of prediction accuracy and curve tracking, with notably lower prediction errors. Additionally, it is evident that the CNN and TAM significantly influence the model’s predictive performance; their removal results in a substantial shift in the model’s prediction curve away from the actual values.
From Table 2 and Figure 9, it is evident that the RMSE of the CNN-GRU model, compared to the GRU model, decreased significantly by 32.36% and the R2 increased markedly by 19.77%. This significant improvement mainly results from the introduction of the CNN architecture. Through convolution operations, CNNs efficiently extract key features from input data. This enhancement strengthens the model’s ability to capture local patterns in time series, leading to a substantial increase in prediction accuracy. Compared to the CNN-GRU model, the CNN-GRU-TAM model demonstrated a 34.09% reduction in RMSE and a 7.83% increase in R2, indicating that the inclusion of TAM effectively captures intricate temporal dynamics and extracts dependency structures. Compared to the CNN-GRU-TAM model, the IPSO-CNN-GRU-TAM model reduced RMSE by 22.43%, enhanced R2 by 2.22%, and decreased the running time by 93 s. This demonstrates that the IPSO algorithm precisely optimizes model parameters to better align with data characteristics, thus enhancing the model’s prediction accuracy, generalization capacity, and convergence speed while significantly reducing the running time. In conclusion, the integration of CNN, TAM, and IPSO significantly enhances the model’s predictive performance.

4.2. Comparative Analysis of Different Models in DO Prediction Performance

To validate the predictive performance of the proposed model, this study employed traditional models (RNN, LSTM), hybrid neural network models (BiLSTM, CNN-LSTM), an RNN and LSTM integrated with attention mechanisms (RNN-AM, LSTM-AM), the Transformer model, and a model combining IWOA with a CNN, GRU, and TAM (IWOA-CNN-GRU-TAM) to forecast sequences for the same time period. Through the IPSO algorithm optimization, the optimal parameter combination for the CNN-GRU-TAM model was determined as hidden_size = 46, learning_rate = 0.01, and num_epochs = 1258.
The DO content prediction results are depicted in Figure 10. The RNN, LSTM, and Transformer models exhibit relatively large prediction errors. In contrast, the prediction curves for the BiLSTM, CNN-LSTM, RNN-AM, LSTM-AM, IWOA-CNN-GRU-TAM, and IPSO-CNN-GRU-TAM models are relatively similar. Upon closer inspection of the curve details, it is evident that the fitting curves of other models exhibit significant deviations at peak and valley points, whereas the fitting curve of the IPSO-CNN-GRU-TAM model more closely aligns with the true values, demonstrating superior accuracy and tracking performance in predicting the DO content.
However, curve fitting can only macroscopically assess the direct proximity between actual and predicted values, failing to provide a quantitative mathematical analysis. Table 3 consolidates the performance metrics for the other models mentioned above and the IPSO-CNN-GRU-TAM model introduced in this study, while Figure 11 presents visual representations of these metrics, namely, MAE, MAPE, RMSE, and R2. The comparison of these evaluation metrics clearly shows that the IPSO-CNN-GRU-TAM model significantly outperforms the other models in all evaluation metrics, with MAE, RMSE, MSE, and R2 at 0.0158, 0.0249, 0.0006, and 0.9682, respectively.
Compared to the other eight models, the MAE of this model was reduced by 78.91%, 77.23%, 74.56%, 65.87%, 62.56%, 62.20%, 59.38%, and 21%; the R2 increased by 74.99%, 46.25%, 38.95%, 19.37%, 15.41%, 12.03%, 11.99%, and 2.21%. Although the model takes slightly longer to run than the RNN, LSTM, BiLSTM, LSTM-AM, and IWOA-CNN-GRU-TAM models, it significantly enhances prediction accuracy, a crucial metric. Furthermore, its operational time of 30 s fully satisfies efficiency demands in practical applications. By comparing the IWOA-CNN-GRU-TAM and IPSO-CNN-GRU-TAM models, it is evident that both significantly reduce the runtime of the CNN-GRU-TAM model. However, IWOA does not enhance the prediction accuracy of the CNN-GRU-TAM model. Therefore, the IPSO algorithm proposed in this paper outperforms the IWOA algorithm.
Figure 12 illustrates the prediction errors of various models in dissolved oxygen prediction. The IPSO-CNN-GRU-TAM model proposed in this study exhibits the smallest fluctuations in its error curve, consistently hovering near 0. This demonstrates that the model, through deep exploration of the dataset, effectively captures hidden information that might be overlooked in correlation statistical analyses due to their relatively low correlation coefficients. Examples include the potential indirect or nonlinear impacts of temperature on dissolved oxygen dynamics. Consequently, the model offers more precise predictions of dissolved oxygen content in aquaculture environments. It provides a more reliable basis for the subsequent application in aquaculture.

4.3. Study on Model Generalization Ability

4.3.1. Cross-Validation Experiments

To validate the model’s applicability to different datasets, this study employed a fivefold cross-validation method. In this cross-validation, the dataset was randomly divided into five equal subsets. Each time, one subset served as the test set, and the remaining four subsets served as the training set, with five independent training and testing rounds. The final evaluation of the model’s performance relied on the average of the five test results. This method not only provided a comprehensive and objective assessment of the model’s performance but also helped detect whether the model overfitted or underfitted specific types of data, thereby validating the model’s stability and generalization ability.
Table 4 shows the cross-validation results. According to the results in Table 4, the model’s performance across different subsets is observable. The model achieved an average MAE of 0.0200, an average RMSE of 0.0287, an average MSE of 0.0008, and an average R2 of 0.9607 in the fivefold cross-validation. These metrics indicate that the model performed consistently across different data subsets, demonstrating good generalization ability.

4.3.2. Validation on Datasets of Varying Depths

To further validate the model’s generalization ability, we predicted dissolved oxygen content at different depths. In aquaculture, lake enclosure farming is another common method, with water depths typically ranging from 1 to 6 m. Therefore, we selected 4-m and 6-m depths for dissolved oxygen content prediction to verify the model’s accuracy. The prediction method remained consistent with the previous sections. Figure 13 and Figure 14 show the prediction results.
Figure 13 and Figure 14 demonstrate that the IPSO-CNN-GRU-TAM model’s prediction curves closely match the actual measurement curves, indicating good prediction accuracy and tracking capability.
According to Figure 15 and Table 5 and Table 6, the IPSO-CNN-GRU-TAM model performs excellently on datasets at 4-m and 6-m depths. Specifically, on the 4-m depth dataset, compared to the CNN-GRU and CNN-GRU-TAM models, the RMSE of the IPSO-CNN-GRU-TAM model decreased by 44.04% and 21.02%, respectively. On the 6-m depth dataset, the RMSE decreased by 55.05% and 35.51%, respectively. Additionally, the R2 value of the IPSO-CNN-GRU-TAM model improved.
In summary, the IPSO-CNN-GRU-TAM model not only excels on datasets at different depths but also outperforms other models in terms of error and fit. This fully demonstrates the model’s strong generalization ability, effectively addressing challenges from various farming modes and maintaining stable prediction performance under different water depths. The model is suitable for dissolved oxygen content prediction in multiple aquaculture scenarios.
For more complex datasets, the model constructs a sophisticated framework to deeply mine hidden information within the data, demonstrating robust capabilities when handling intricate datasets. Furthermore, the model adopts the IPSO algorithm, leading to significant improvements in model parameter optimization and strong adaptability. The experimental results show that the model exhibits exceptional generalization across different sections of the same dataset and across datasets of varying depths. Therefore, it is reasonable to anticipate that the model will maintain good predictive performance over longer training periods and with even more complex datasets.

4.4. Future Work

The IPSO algorithm employed in this study only optimized three hyperparameters of the neural network. In future research, to enhance model performance, we intend to investigate a wider range of hyperparameters, such as the dropout rate and the choice of activation functions, and explore more efficient optimization strategies.
In future applications, we aim to conduct an in-depth exploration of the practical application effect of the model in aquaculture. We intend to deploy water quality sensors for real-time data collection and transmission to a Raspberry Pi 5 system. Utilizing the IPSO-CNN-GRU-TAM model, we will predict the DO content on the Raspberry Pi 5. If the predictions indicate that the content falls below 5 mg/L, the system will automatically activate the oxygenator; when saturation (DOsat) is achieved, it will close the oxygenator. This strategy enables precise regulation of DO, optimizing the aquaculture environment, enhancing cultivation efficiency, and effectively addressing the issue of energy wastage associated with the current periodic oxygenation practices in the aquaculture industry, thereby achieving energy conservation and carbon emission reduction.
Furthermore, we plan to apply this established embedded system and data acquisition platform to local aquaculture ponds for extensive data collection and DO prediction. Our objective is to further validate the model’s practicality and generalization capabilities, ensuring its excellent performance across various aquaculture environments and conditions. Through practical verification, we aim to comprehensively demonstrate the application value and extensive development potential of this model in aquaculture, contributing to the advancement of intelligent and efficient aquaculture industry development.

5. Conclusions

To address the issues of fish mortality, diminished aquaculture efficiency, and increased energy consumption stemming from the inability to precisely regulate dissolved oxygen levels in aquaculture, this study introduces the IPSO-CNN-GRU-TAM prediction model. The research findings are as follows:
(1)
This study employed the Pearson correlation coefficient formula to conduct feature selection on the original dataset, selecting features highly correlated with DO as model inputs. This approach effectively reduced algorithm runtime and enhanced model efficiency;
(2)
Utilizing an IPSO algorithm, we achieved precise optimization of model hyperparameters, overcoming the randomness and blindness of traditional subjective parameter selection. This further improved model performance while reducing the algorithm runtime. IPSO demonstrates excellent adaptability, being capable of accommodating various types of problems and data;
(3)
A temporal attention mechanism is integrated with CNNs to process input features through weighting, enabling adaptive capture of critical information from historical states. This not only improved the prediction accuracy but also met temporal requirements. The overall model ran on a CPU in just 30 s, demonstrating high efficiency and practicality;
(4)
Through ablation experiments and comparisons with eight other common prediction models, the IPSO-CNN-GRU-TAM model established in this study demonstrated effective prediction performance and accuracy for the dissolved oxygen content dataset. The model’s performance metrics included an RMSE of 0.0249, an MAE of 0.0158, an MSE of 0.0006, and an R2 of 0.9682.

Author Contributions

Conceptualization, Y.M.; data curation, Q.F.; methodology, Q.F.; software, Q.F.; validation, Q.F. and S.X.; formal analysis, Q.F.; investigation, Q.F., Y.Z., and Y.M.; resources, Y.M.; writing—original draft preparation, Q.F.; writing—review and editing, Y.M. and Q.F.; visualization, S.X.; supervision, Y.M., S.X., and Y.Z.; project administration, Y.M.; funding acquisition: Y.M. All authors have read and agreed to the published version of the manuscript.

Funding

This study was funded by the Fujian Provincial Department of Science and Technology, project number 2021N5004. Research and application of complete sets of equipment for industrial cultivation of predatory mites in pollution-free agriculture.

Data Availability Statement

The data presented in this study are openly available on Kaggle at https://www.kaggle.com/datasets/visalakshiiyer/forecasting-lake-do (accessed on 16 April 2024).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Hu, F.; Zhong, H.; Wu, C.; Wang, S.; Guo, Z.; Tao, M.; Zhang, C.; Gong, D.; Gao, X.; Tang, C.; et al. Development of fisheries in China. Reprod. Breed. 2021, 1, 64–79. [Google Scholar] [CrossRef]
  2. Wang, X. Making a Splash with Seafood in Landlocked Xinjiang. China Brand 2023, 11, 78–81. Available online: https://kns.cnki.net/kcms2/article/abstract?v=YMwpULBJqz5ICzFlnpj8t6ctuxgpXRMubY-EmEbmepeEZqRgAyFEOAdLxQZME4sh1TOKHWnWiaiI06ccVBQGp_mcUXimA53VBwe7hjXMEkBo6mAeKCGr7tPp8Bj65f0u2bwvGL-4soVci8H4Y4U9g4BhodjPe92xbQ7djpAKQTWDcIoxd3dOejXktIsuiZxTwydixQOuUtk=&uniplatform=NZKPT&language=CHS (accessed on 26 November 2024).
  3. Saber, A.; James, D.E.; Hayes, D.F. Long-term forecast of water temperature and dissolved oxygen profiles in deep lakes using artificial neural networks conjugated with wavelet transform. Limnol. Oceanogr. 2019, 65, 1297–1317. [Google Scholar] [CrossRef]
  4. Cao, X.; Ren, N.; Tian, G.; Fan, Y.; Duan, Q. A three-dimensional prediction method of dissolved oxygen in pond culture based on Attention-GRU-GBRT. Comput. Electron. Agric. 2021, 181, 105955. [Google Scholar] [CrossRef]
  5. Rahman, A.; Dabrowski, J.; McCulloch, J. Dissolved oxygen prediction in prawn ponds from a group of one step predictors. Inf. Process. Agric. 2020, 7, 307–317. [Google Scholar] [CrossRef]
  6. Huang, J.; Liu, S.; Hassan, S.G.; Xu, L.; Huang, C. A hybrid model for short-term dissolved oxygen content prediction. Comput. Electron. Agric. 2021, 186, 106216. [Google Scholar] [CrossRef]
  7. Yin, L.; Fu, L.; Wu, H.; Xia, Q.; Jiang, Y.; Tan, J.; Guo, Y. Modeling dissolved oxygen in a crab pond. Ecol. Model. 2021, 440, 109385. [Google Scholar] [CrossRef]
  8. Li, D.; Sun, Y.; Sun, J.; Wang, X.; Zhang, X. An advanced approach for the precise prediction of water quality using a discrete hidden markov model. J. Hydrol. 2022, 609, 127659. [Google Scholar] [CrossRef]
  9. Rajaee, T.; Khani, S.; Ravansalar, M. Artificial intelligence-based single and hybrid models for prediction of water quality in rivers: A review. Chemom. Intell. Lab. Syst. 2020, 200, 103978. [Google Scholar] [CrossRef]
  10. Feng, D.; Han, Q.; Xu, L.; Sohel, F.; Hassan, S.G.; Liu, S. An ensembled method for predicting dissolved oxygen level in aquaculture environment. Eco. Inform. 2024, 80, 102501. [Google Scholar] [CrossRef]
  11. Nong, X.; Lai, C.; Chen, L.; Shao, D.; Zhang, C.; Liang, J. Prediction modelling framework comparative analysis of dissolved oxygen concentration variations using support vector regression coupled with multiple feature engineering and optimization methods: A case study in China. Ecol. Indic. 2023, 146, 109845. [Google Scholar] [CrossRef]
  12. Shi, P.; Kuang, L.; Yuan, L.; Wang, Q.; Li, G.; Yuan, Y.; Zhang, Y.; Huang, G. Dissolved oxygen prediction using regularized extreme learning machine with clustering mechanism in a black bass aquaculture pond. Aquac. Eng. 2024, 105, 102408. [Google Scholar] [CrossRef]
  13. Li, T.; Lu, J.; Wu, J.; Zhang, Z.; Chen, L. Predicting Aquaculture Water Quality Using Machine Learning Approaches. Water 2022, 14, 2836. [Google Scholar] [CrossRef]
  14. Li, L.; Rong, S.; Wang, R.; Yu, S. Recent advances in artificial intelligence and machine learning for nonlinear relationship analysis and process control in drinking water treatment: A review. Chem. Eng. J. 2021, 405, 126673. [Google Scholar] [CrossRef]
  15. Huan, J.; Li, H.; Li, M.; Chen, B. Prediction of dissolved oxygen in aquaculture based on gradient boosting decision tree and long short-term memory network: A study of Chang Zhou fishery demonstration base, China. Comput. Electron. Agric. 2020, 175, 105530. [Google Scholar] [CrossRef]
  16. Guo, J.; Dong, J.; Zhou, B.; Zhao, X.; Liu, S.; Han, Q.; Wu, H.; Xu, L.; Gul, H.S. A hybrid model for the prediction of dissolved oxygen in seabass farming. Comput. Electron. Agric. 2022, 198, 106971. [Google Scholar] [CrossRef]
  17. Barzegar, R.; Aalami, M.T.; Adamowski, J. Short-term water quality variable prediction using a hybrid CNN–LSTM deep learning model. Stoch. Environ. Res. Risk Assess. 2020, 34, 415–433. [Google Scholar] [CrossRef]
  18. Hu, Y.; Liu, C.; Wollheim, W.M. Prediction of riverine daily minimum dissolved oxygen concentrations using hybrid deep learning and routine hydrometeorological data. Sci. Total Environ. 2024, 918, 170383. [Google Scholar] [CrossRef]
  19. Liu, Y.; Zhang, Q.; Song, L.; Chen, Y. Attention-based recurrent neural networks for accurate short-term and long-term dissolved oxygen prediction. Comput. Electron. Agric. 2019, 165, 104964. [Google Scholar] [CrossRef]
  20. Wang, Y.; Huang, Y.; Xiao, M.; Zhou, S.; Xiong, B.; Jin, Z. Medium-long-term prediction of water level based on an improved spatio-temporal attention mechanism for long short-term memory networks. J. Hydrol. 2023, 618, 129163. [Google Scholar] [CrossRef]
  21. Liu, F.; Liu, Y.; Yang, C.; Lai, R. A New Precipitation Prediction Method Based on CEEMDAN-IWOA-BP Coupling. Water Resour. Manag. 2022, 36, 4785–4797. [Google Scholar] [CrossRef]
  22. Ji, Y.; Liew, A.W.-C.; Yang, L. A Novel Improved Particle Swarm Optimization with Long-Short Term Memory Hybrid Model for Stock Indices Forecast. IEEE Access 2021, 9, 23660–23671. [Google Scholar] [CrossRef]
  23. Sun, L.; Wu, Y.; Li, D.; Wang, B.; Sun, X.; Luo, B. Prediction model for the number of crucian carp hypoxia based on the fusion of fish behavior and water environment factors. Comput. Electron. Agric. 2021, 189, 106386. [Google Scholar] [CrossRef]
  24. Yuan, Y.; Li, J.; Yu, Q.; Liu, J.; Li, Z.; Li, Q.; Liu, N. A Two-Stage Facial Kinematic Control Strategy for Humanoid Robots Based on Keyframe Detection and Keypoint Cubic Spline Interpolation. Mathematics 2024, 12, 3278. [Google Scholar] [CrossRef]
  25. Li, Y.; Tong, Z.; Tong, S. A data-driven interval forecasting model for building energy prediction using attention-based LSTM and fuzzy information granulation. Sustain. Cities Soc. 2022, 76, 103481. [Google Scholar] [CrossRef]
  26. Shi, P.; Li, G.; Yuan, Y.; Huang, G.; Kuang, L. Prediction of dissolved oxygen content in aquaculture using Clustering-based Softplus Extreme Learning Machine. Comput. Electron. Agric. 2019, 157, 329–338. [Google Scholar] [CrossRef]
  27. He, X.; Huang, B.; Peng, L.; Chen, J. Studies on Submersible Short-Circuit Blowing Based on Orthogonal Experiments, Back Propagation Neural Network Prediction, and Pearson Correlation Analysis. Appl. Sci. 2024, 14, 10321. [Google Scholar] [CrossRef]
  28. Varshney, R.P.; Sharma, D.K. Optimizing Time-Series forecasting using stacked deep learning framework with enhanced adaptive moment estimation and error correction. Expert Syst. Appl. 2024, 249, 123487. [Google Scholar] [CrossRef]
  29. Chung, J.; Gülçehre, Ç.; Cho, K.; Bengio, Y. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. arXiv 2014, arXiv:1412.3555. [Google Scholar] [CrossRef]
  30. Wang, Z.; Wang, Q.; Liu, Z.; Wu, T. A deep learning interpretable model for river dissolved oxygen multi-step and interval prediction based on multi-source data fusion. J. Hydrol. 2024, 629, 130637. [Google Scholar] [CrossRef]
  31. Kennedy, J.; Eberhart, R. Particle Swarm Optmization. IEEE Access 1995, 4, 1942–1948. [Google Scholar] [CrossRef]
  32. Li, Y.; Li, X.; Xu, C.; Tang, X. Dissolved Oxygen Prediction Model for the Yangtze River Estuary Basin Using IPSO-LSSVM. Water 2023, 15, 2206. [Google Scholar] [CrossRef]
  33. Liang, Y.; Zhu, L.; Wang, Y.; Wu, H.; Zhang, J.; Guan, J.; Wang, J. Fouling Prediction of a Heat Exchanger Based on Wavelet Neural Network Optimized by Improved Particle Swarm Optimization Algorithm. Processes 2024, 12, 2412. [Google Scholar] [CrossRef]
  34. Shao, B.; Li, M.; Zhao, Y.; Bian, G. Nickel Price Forecast Based on the LSTM Neural Network Optimized by the Improved PSO Algorithm. Math. Probl. Eng. 2019, 2019, 1934796. [Google Scholar] [CrossRef]
  35. Uddin, M.G.; Nash, S.; Rahman, A.; Olbert, A.I. Performance analysis of the water quality index model for predicting water state using machine learning techniques. Process Saf. Environ. Prot. 2023, 169, 808–828. [Google Scholar] [CrossRef]
  36. Zhang, X.; Hou, D.; Mao, Q.; Wang, Z. Predicting Microseismic Sensitive Feature Data Using Variational Mode Decomposition and Transformer. J. Seismol. 2024, 28, 229–250. [Google Scholar] [CrossRef]
  37. Wu, Q.; Law, R. Cauchy mutation based on objective variable of Gaussian particle swarm optimization for parameters selection of SVM. Expert Syst. Appl. 2011, 38, 6405–6411. [Google Scholar] [CrossRef]
Figure 1. Data distribution.
Figure 1. Data distribution.
Water 16 03547 g001
Figure 2. Structure of CNN.
Figure 2. Structure of CNN.
Water 16 03547 g002
Figure 3. Structure of GRU.
Figure 3. Structure of GRU.
Water 16 03547 g003
Figure 4. Structure of TAM.
Figure 4. Structure of TAM.
Water 16 03547 g004
Figure 5. Structure of the IPSO-CNN-GRU-TAM model.
Figure 5. Structure of the IPSO-CNN-GRU-TAM model.
Water 16 03547 g005
Figure 6. Algorithm flow of the IPSO-CNN-GRU-TAM model.
Figure 6. Algorithm flow of the IPSO-CNN-GRU-TAM model.
Water 16 03547 g006
Figure 7. Comparison of 4 models.
Figure 7. Comparison of 4 models.
Water 16 03547 g007
Figure 8. Prediction error of different models.
Figure 8. Prediction error of different models.
Water 16 03547 g008
Figure 9. Comparison of 4 models with different evaluation indicators.
Figure 9. Comparison of 4 models with different evaluation indicators.
Water 16 03547 g009
Figure 10. Comparison of 9 models.
Figure 10. Comparison of 9 models.
Water 16 03547 g010
Figure 11. Comparison of 9 models with different evaluation indicators.
Figure 11. Comparison of 9 models with different evaluation indicators.
Water 16 03547 g011
Figure 12. Prediction error of different models.
Figure 12. Prediction error of different models.
Water 16 03547 g012
Figure 13. Prediction curve results of the IPSO-CNN-GRU-TAM model (4 m).
Figure 13. Prediction curve results of the IPSO-CNN-GRU-TAM model (4 m).
Water 16 03547 g013
Figure 14. Prediction curve results of the IPSO-CNN-GRU-TAM model (6 m).
Figure 14. Prediction curve results of the IPSO-CNN-GRU-TAM model (6 m).
Water 16 03547 g014
Figure 15. Comparison of 3 models with different evaluation indicators.
Figure 15. Comparison of 3 models with different evaluation indicators.
Water 16 03547 g015
Table 1. Pearson correlation coefficients between DO content and various parameters.
Table 1. Pearson correlation coefficients between DO content and various parameters.
DepthTemppH ValueDOsatCond
3 m−0.33250.84550.98640.2281
Table 2. Error evaluation indicators of 4 models.
Table 2. Error evaluation indicators of 4 models.
ModelMAERMSEMSER2Time
GRU0.05560.07200.00520.733413 s
CNN-GRU0.03930.04870.00240.878490 s
CNN-GRU-TAM0.02230.03210.00100.9472123 s
IPSO-CNN-GRU-TAM0.01580.02490.00060.968230 s
Table 3. Error evaluation indicators of 9 models.
Table 3. Error evaluation indicators of 9 models.
ModelMAERMSEMSER2Time
Transformer0.07490.09320.00870.5533663 s
RNN0.06940.08110.00660.662011 s
LSTM0.06210.07680.00590.696812 s
BiLSTM0.04630.06060.00370.811118 s
CNN-LSTM0.04220.05600.00310.838957 s
RNN-AM0.04180.05140.00260.864273 s
LSTM-AM0.03890.05140.00260.864516 s
IWOA-CNN-GRU-TAM0.02000.03200.00100.947337 s
IPSO-CNN-GRU-TAM0.01580.02490.00060.968230 s
Table 4. Fivefold cross-validation results of IPSO-CNN-GRU-TAM.
Table 4. Fivefold cross-validation results of IPSO-CNN-GRU-TAM.
Evaluation IndicatorFold 1Fold 2Fold 3Fold 4Fold 5Average
MAE0.01790.01980.02390.02270.01570.0200
RMSE0.02560.02910.03280.03140.02470.0287
MSE0.00060.00080.00110.00100.00060.0008
R20.94740.95840.96980.95910.96900.9607
Table 5. Model evaluation metrics (4 m).
Table 5. Model evaluation metrics (4 m).
ModelMAERMSEMSER2
CNN-GRU0.03460.04700.00220.9233
CNN-GRU-TAM0.02450.03330.00110.9616
IPSO-CNN-GRU-TAM0.01730.02630.00070.9751
Table 6. Model evaluation metrics (6 m).
Table 6. Model evaluation metrics (6 m).
ModelMAERMSEMSER2
CNN-GRU0.03780.05050.00260.9082
CNN-GRU-TAM0.02450.03520.00120.9554
IPSO-CNN-GRU-TAM0.01550.02270.00050.9821
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ma, Y.; Fang, Q.; Xia, S.; Zhou, Y. Prediction of the Dissolved Oxygen Content in Aquaculture Based on the CNN-GRU Hybrid Neural Network. Water 2024, 16, 3547. https://doi.org/10.3390/w16243547

AMA Style

Ma Y, Fang Q, Xia S, Zhou Y. Prediction of the Dissolved Oxygen Content in Aquaculture Based on the CNN-GRU Hybrid Neural Network. Water. 2024; 16(24):3547. https://doi.org/10.3390/w16243547

Chicago/Turabian Style

Ma, Ying, Qiwei Fang, Shengwei Xia, and Yu Zhou. 2024. "Prediction of the Dissolved Oxygen Content in Aquaculture Based on the CNN-GRU Hybrid Neural Network" Water 16, no. 24: 3547. https://doi.org/10.3390/w16243547

APA Style

Ma, Y., Fang, Q., Xia, S., & Zhou, Y. (2024). Prediction of the Dissolved Oxygen Content in Aquaculture Based on the CNN-GRU Hybrid Neural Network. Water, 16(24), 3547. https://doi.org/10.3390/w16243547

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop