Abstract

Multiparameter water quality trend prediction technique is one of the important tools for water environment management and regulation. This study proposes a new water quality prediction model with better prediction performance, which is combined with improved sparrow search algorithm (ISSA) and support vector regression (SVR) machine. For the problems of low population diversity and easily falling into local optimum of sparrow search algorithm (SSA), ISSA is proposed to increase the initial population diversity by introducing Skew-Tent mapping and to help the algorithm jump out of local optimum by using the adaptive elimination mechanism. The optimal values of the penalty factor C and kernel function parameter of the SVR model are selected using ISSA to make the model have better prediction accuracy and generalization performance. The performance of the ISSA-SVR water quality prediction model is compared with BP neural network, SVR model, and other hybrid models by conducting water quality prediction experiments with actual breeding-water quality data. The experimental results showed that the prediction accuracy of the ISSA-SVR model was significantly higher than that of other models, reaching 99.2%; the mean square deviation (MSE) was 0.013, which was 79.37% lower than that of the SVR model and 75% lower than that of SSA-SVR model, and the coefficient of determination was 0.98, which was 5.38% higher than that of the SVR model and 7.57% higher than that of the SSA-SVR model, indicating that the ISSA-SVR water quality prediction model has some engineering application value in the field of water body management.

1. Introduction

High-grade water environment quality is a necessary condition for improving the living environment and humanistic connotation of urban and rural residents, and with the increasing severity of global pollution, improving water environment quality is receiving much attention [1]. Water quality prediction technology uses the existing measured data to establish a water quality model to predict the future water environment conditions, which helps to understand the change pattern and development of the water environment and can provide technical support for water environment management and water pollution prevention [2]. In this case, the establishment of a suitable water quality prediction model to predict and assess water quality categories is a vital hydroenvironmental issue [3].

Traditional research on water quality prediction models has focused on linear methods [4], such as autoregression [5], autoregressive integrated moving average (ARIMA) [6] and other models in statistics [7], and neuron models [8]. However, the actual water quality factors are complex, diverse, and nonlinear, and traditional water quality prediction models cannot easily obtain the desired results for nonlinear data fusion problems [9].

In the past few decades, artificial intelligence (AI) in the form of machine learning models has been increasingly applied to solve various environmental engineering problems [10, 11], including river water quality modeling [3, 12]. AI models can fit nonlinear data well without detailed physical information, resulting in more accurate prediction results [13, 14]. Artificial neural networks (ANNs) [15], fuzzy logic-based models [16], support vector machines (SVMs) [17], and support vector regression (SVR) machines [18] have been widely used to predict and assess water quality.

Despite such broad usage of ANN models and fuzzy logic-based models, the models provided unsatisfactory results in some engineering problems. In previous studies, the combined form of AI models, known as hybrid AI models, has been extensively employed to solve such problems. Li et al. [19] proposed a novel model combining particle swarm optimization (PSO), chaos theory, self-adaptive strategy, and backpropagation artificial neural network (BP-ANN) to evaluate water quality. They found that the hybrid model is more effective than the BP-ANN. Penghui et al. [20] proposed a model (ANFIS-mSG) that hybridizes an adaptive neuro-fuzzy inference system with an optimization method using mutation salp swarm algorithm and grasshopper optimization algorithm. The modeling results evidenced the capability of optimization algorithms for building ANFIS models for simulating soil temperature.

In addition to hybrid fuzzy logic and ANN models, SVM have demonstrated an excellent predictive model for diverse engineering. SVR is an important application branch of support vector machine. The SVR method structure is more straightforward than fuzzy and ANN models that enhance the predicting model [2123]. Therefore, the SVR method has more advantages in solving small samples, is nonlinear, and uses high-dimensional pattern recognition [24, 25]. These advantages of SVR make this method a popular choice for water quality prediction.

Although the SVR application has various advantages, it has some unknown parameters in its structure, which drastically affect the prediction accuracy and generalization performance. Therefore, optimization of the model parameters is required to obtain a prediction model with good performance. Many scholars have used metaheuristic algorithms for model parameter optimization due to their simple structure, fast efficiency, and few adjustment parameters [26, 27]. Doroudi et al. [28] used the observer-teacher-learner-based optimization (OTLBO) method to optimize the model parameters of the SVR model. The results indicate that the SVR-OTLBO model offers a higher prediction performance than other models employed in the current study. Haghbin et al. [29] used SVR combined with invasive weed optimization (IWO), standalone SVR, and Radial Basis Function neural networks to estimate channel sinuosity in perennial rivers. The results indicate that the sinuosity set predicted by the SVR-IWO model is the closest to the observed set. Tang et al. [30] optimized the model parameters based on multiagent particle swarm algorithm and proposed a new MAPSO-SVR predictive algorithm for the control prediction model of nonlinear systems with good performance.

Sparrow search algorithm (SSA) is a new metaheuristic algorithm proposed by Xue and Shen [31] in 2020. Sparrow search algorithm, particle swarm optimization (PSO) [32], and grey wolf optimizer (GWO) [33] are all swarm intelligent algorithms, which build models by simulating biological behavior. Sparrow search algorithm has been a wide concern because of its high efficiency, high convergence accuracy, and strong stability. Liu [34] established a prediction model based on sparrow search algorithm-optimized support vector machine regression (SSA-SVR) to predict the settlement of coal gangue roadbed of An Shao Expressway in Hunan Province and compared the prediction results with PSO-SVR and GA-SVR models. The results show that the SSA-SVR prediction model has high accuracy and good generalization ability. Xu et al. [35] proposed to use the sparrow search algorithm (SSA)-optimized SVR model for training to obtain a soft measurement model capable of identifying the dynamic viscosity of the target fluid. The results show that the SSA-SVR soft measurement model-based liquid viscosity identification method can quickly and effectively identify the dynamic viscosity of liquids and the detection accuracy in the studied viscosity range is better than that of traditional measurement methods.

However, SSA, like other population intelligence optimization algorithms, still suffers from the problems of decreasing population diversity and easily falling into local optimality when its search is close to the global optimum [31]. In order to overcome the shortcomings of traditional SSA, many scholars have improved SSA by increasing the initial population diversity and escaping from the local optimum. Lv et al. [36] use Tent chaotic mapping to initialize the population so that the initial individuals are distributed as evenly as possible, while introducing Gaussian variation and chaotic perturbation to help individuals jump out of the local optimum, thus overcoming the drawback that SSA is prone to fall into the local optimum. Mao et al. [37] integrated the idea of sine-cosine algorithm to balance the local and global searchability in the discoverer position update method of SSA and introduced Levy flight strategy in the follower position update method to perturb the variation of the current optimal solution and strengthen the local escape ability, which obviously improved the efficiency of SSA solution. Tang et al. [38] used cubic mapping to initialize the population to obtain an improved chaotic sparrow search algorithm, while using the Gaussian wandering strategy to help the algorithm jump out of stagnation. Simulation results show that the algorithm outperforms the particle swarm algorithm (PSO), the beetle swarm optimization algorithm (BSO), the whale optimization algorithm (WOA), the grey wolf optimization algorithm (GWO), and the sparrow search algorithm (SSA) in finding the optimal performance.

The improvement of SSA in the above literature can avoid the algorithm from falling into local optimum and improve the searchability to a certain extent, but there are still defects such as insufficient search accuracy and weak pioneering ability of the algorithm. For the improved population intelligence optimization algorithm, the chaotic variables generated by Skew-Tent mapping have better traversal uniformity, which can effectively shorten the search time and better reduce the sensitivity dependence of initial values. Li and Xu [39] used Skew-Tent mapping to permute the pixels in an image, which greatly improved the encryption performance and security of digital image encryption algorithm. Meng et al. [40] proposed a new image encryption algorithm using Skew-Tent mapping for pixel permutation to improve the security of the system, and the results showed that the algorithm outperformed several advanced image encryption algorithms. For adding an optimization strategy to help the algorithm jump out of the local optimum, the adaptive search strategy dynamically adjusts the number of elements in the candidate set for the centralized search and the diversity search, respectively, through the cooperation of the neighborhood and the candidate set, which better solves the conflict problem of centralization and diversity. Kong et al. [41] introduced the adaptive adjustment weight method and search strategy to improve the ability of the WOA algorithm to jump out of the local optimum. Liu et al. [42] introduced an adaptive boundary mechanism in the process of ants wandering around the ant-lion to increase the ant population activity and prevent the basic ant-lion optimization algorithm (ALO) from falling into local extremes. The test results show that the proposed algorithm has significantly improved optimization-seeking accuracy and convergence speed, is little affected by dimensional changes, and has stronger and more stable high-dimensional solving ability.

Considering the traversal uniformity and fast convergence of the Skew-Tent mapping and the better local searchability of the adaptive search strategy, this study proposes an improved sparrow search algorithm (ISSA). ISSA first introduces the Skew-Tent mapping to initialize the population to increase the population diversity and then uses the adaptive elimination mechanism to improve the population position update strategy of the algorithm, which improves the global searchability of the algorithm. Then, the ISSA-SVR model was established by combining the ISSA with the support vector regression machine, which is to optimize the penalty factor C and kernel function parameter of support vector regression using ISSA, so as to obtain a water quality prediction model with better prediction accuracy and generalization performance. Finally, water quality category prediction experiments were conducted with actual aquaculture water quality data to verify the reliability and stability of the model.

2. Improved Sparrow Search Algorithm

Although SSA has the advantages of fast convergence, high stability, few adjustment parameters, and simple computation, it also has the disadvantage of easily falling into the local optimum, just like other intelligent search algorithms. For this reason, this paper makes improvements to SSA.

2.1. Standard Sparrow Search Algorithm

Sparrow search algorithm (SSA) is a novel intelligent search algorithm that simulates sparrow foraging and antipredation behaviors, proposed by Xue and Shen [31] in 2020. Sparrows are flock birds in nature, with a clear division of labor within the population. There are three behavioral groups of sparrows in the foraging process: the discoverer searches for food; the joiner follows the discoverer to find food; and the warner alerts to avoid danger. The roles of the discoverer and the joiner are dynamically interchanged, but the proportion of the discoverer and the joiner in the population remains the same and the warner is randomly generated in the population.

Assuming that the entire population of sparrows is N, the position of the i-th sparrow in the D-dimensional search space is .

Generally, the discoverer accounts for 10% to 20% of the total population, and the position update formula of the discoverer in each iteration is as follows:where is a random number; T is the maximum number of iterations; t is the current number of iterations; is the position information of the i-th sparrow at the t-th iteration; Q is a random number that obeys a normal distribution; L is a -dimensional matrix whose elements are all 1, is the warning value; is the safety value; and is the warning value. When , it means that the environment is safe and the discoverer can search extensively at this time; when , it means that some individuals in the population find environmental dangers and give an early warning; at this time, all individuals fly to the safe area to search.

All remaining in the population except the discoverer are the joiner. The formula for updating the position of the joiner is as follows:where is the current global worst position; is the current optimal position of the discoverer; and , where A is a -dimensional matrix with each element randomly assigned a value of 1 or −1. When , the i-th individual with lower fitness has a poor search position and needs to fly to other places to search.

The warner in the sparrow population generally accounts for 10% to 20% of the total population, and the initial position of the warner is randomly generated at the initial stage of the population formation. The formula for updating the position of the warner is as follows:where is the current global optimal position; is a random number that obeys a normal distribution with a mean of 0 and a variance of 1, representing the step-length control parameter; is a random number; is the fitness value of the i-th individual; is the current global optimal fitness value; is the current global worst fitness value; and is the smallest constant. When , it means that the i-th individual is at the edge of the population and is easily attacked; when , it means that the individual in the center of the population is aware of the danger and needs to approach other individuals to avoid danger.

2.2. Skew-Tent Map

SSA usually uses random initialization of populations when solving optimal problems, which can easily cause uneven distribution of populations and lead to the reduction of population diversity [31]. It has been shown that the goodness of population initialization in the intelligent search algorithm affects the accuracy and convergence speed of the algorithm and the initial population with better diversity is also more helpful to the final performance improvement of the algorithm. In solving the global optimal problem, since there is no more a priori knowledge to draw from, increasing the population diversity as much as possible can improve the search efficiency of the algorithm and lay the foundation for the global search of the algorithm.

A chaotic phenomenon occurs in nonlinear systems, which is a deterministic, stochastic-like process, but the process is nonconvergent, nonperiodic, and bounded. Skew-Tent mapping [43] is a widely used and studied chaotic mapping formula due to its simple structure and iterative process that removes rounding errors. In this paper, the Skew-Tent mapping is used to generate chaotic variables with ergodicity, randomness, and regularity to initialize the population of the SSA to produce an initial population with high diversity. Assuming that the number of populations is N and the optimization problem is D-dimensional, a chaotic sequence matrix is generated in the D-dimensional Euclidean space using the Skew-Tent mapping:

The Skew-Tent map expression is as follows:where is a random number, , and .

The sparrow population is a -dimensional matrix. This paper uses Skew-Tent map to generate the chaotic series matrix to initialize the sparrow population. The formula is as follows:where are the upper and lower limits of the i-th individual on the d-th dimension and is the actual value of the i-th individual on the d-th dimension.

2.3. Adaptive Elimination Mechanism

SSA is prone to fall into local optimal solutions when the population search is close to the optimal solution. In order to improve the global searchability and convergence speed of SSA, this paper introduces an adaptive elimination mechanism. Assuming that the number of populations is N and the maximum number of iterations of SSA is T, an elimination rate is introduced, which is calculated as follows:where is the current iteration number.

At each iteration, the fitness of the entire population is calculated and individuals are eliminated in the descending order of fitness. To ensure that the population size remains constant, new individuals must be added to the population. To improve the utilization of prior knowledge, the location information of eliminated individuals is updated by randomly selecting individuals from the current number of iterations, and the formula for updating the location of new population individuals is as follows:where is the scaling factor; represent the positions of two randomly selected individuals in the t-th iteration; and are the new and old position information of the currently eliminated individual, respectively.

2.4. Implementation

The pseudo-code of the improved sparrow search algorithm is expressed in Algorithm 1.

Initialization:
 Initialize the population to by using (6);
 Give the population size N;
 Give the number of iterations T;
 Give the search space dimension D;
 Give the proportion of the discoverer DP
 Give the proportion of the warner WP
 Calculate the fitness of individuals in the population, and record the global optimal position , the global optimal fitness value , the global worst position , and the global worst fitness value .
Iteration: While(t<T)
(1)Calculate the warning value ;
(2)for each :
(3)Update the position of the discoverer with top DP fitness by using (1);
(4)Update the position of the joiner with the rest fitness by using (2);
(5)Update the position of the watcher by randomly selecting WP of the individuals by using (3);
(6)end for;
(7)Calculate the fitness of the population individuals after the location update and sort them, and calculate formula (7) to eliminate the last individuals in the sort;
(8)Use (8) to add new individuals to the population to form a new population, and calculate the fitness again;
(9)If the new position is better than the old position, the old position is updated;
(10);
(11)return, .
2.5. Taguchi-Grey Relation Method

Obtaining the optimum parameters of the optimization algorithms is a major concern in the current study [44]. The Taguchi method [45] aims to select the optimal combination of parameters by calculating the signal-to-noise (SN) ratio through orthogonal tests, which has the advantages of fewer tests, reliable test results, good reproducibility, and simple analysis and calculation, and has been widely used. However, the traditional Taguchi method can only solve single-objective optimization problems at a time, while the problems we encounter in practice mostly require simultaneous consideration of multiple objectives. The Taguchi-grey relation method combines Taguchi method and grey relational analysis [46] to effectively solve multiobjective design optimization problems. Therefore, the Taguchi-grey relation method is used to obtain the parameter combination of ISSA with the minimum number of iterations and the best robustness.

2.5.1. Orthogonal Experiment

According to the implementation of ISSA, three control factors that have three levels each (see Table 1) were selected as the control factors of the Taguchi method. Since the experiment had three control factors with three levels per factor, the experimental protocol was set at 9 according to the general principles of orthogonal table design and experience, so the orthogonal array can be expressed as ; the specific experimental protocol is shown in Table 2.

According to the basic evaluation index of the optimization algorithm [47, 48], the global convergence probability (GP), volatility, and average execution time are selected as the optimization objectives.

The global convergence probability is an optimization performance indicator, which reflects the global convergence performance of the algorithm and is denoted as :where is the number of convergence times and is the total number of runs.

Volatility is a robust indicator, which can measure how close the algorithm is to the optimal solution under random initial values, and is denoted as :where is the optimal value of the objective function and is the mean value of the objective function in runs.

Average execution time is a time performance indicator, which can measure the speed of the algorithm’s search for the solution of the problem, denoted as :where is the CPU execution time spent in each run of the algorithm.

By using SN ratio processing, the change trends of optimization objectives with different characteristics can converge to the same direction, all the larger the better, which is convenient for subsequent analysis and calculation.

Among them, the global convergence probability belongs to the bigger-the-better characteristic and its SN ratio is calculated as follows:where is the value of the i-th experiment of the optimization objective and is the number of tests under the same test parameters, and this paper takes .

Volatility and average execution time belong to the smaller-the-better characteristic, and the formula for calculating the SN ratio is

According to the given orthogonal table, the signal-to-noise ratios of the three indicators are calculated, and the results are shown in Table 2.

The average SN ratio of the three optimization objectives at each factor and each level can be calculated based on the SN ratio in Table 2, and the results are shown in Tables 35 and Figure 1. The max-min indicated the level of most influencing nature among the control factors. Therefore, it can be seen from Tables 35 that population size has the greatest impact on GP, the proportion of the warner has the greatest impact on V, and the proportion of the discoverer has the greatest impact on . Figure 1 shows that the optimal parameter combinations for each optimization objective are different, i.e., the optimal parameter combination for GP is A3B1C2, the optimal parameter combination for V is A1B1C2, and the optimal parameter combination for t is A1B1C3, so the grey correlation analysis is performed subsequently to select a unique optimal parameter combination.

2.5.2. Grey Relational Analysis

The grey relational analysis is used to solve the interrelationship among multiple responses. This analysis includes the following steps.

Step 1. The weight coefficients of the three performance evaluation indicators are determined according to AHP [49]. First, we establish the corresponding judgment matrix according to experience and then obtain the eigenvector and the eigenvalue . After the consistency test, the judgment matrix meets the consistency requirements. Therefore, the weight vector of the three performance evaluation indicators is .

Step 2. We normalize the S/N ratio to distribute the data evenly and scale it into acceptable range for further analysis by using equations. Then, the following formulas are used to calculate the grey relational coefficient (GC) of the three performance evaluation indicators:where is the grey relational coefficient for the k-th performance characteristics in the i-th experiment, is the reference sequence in the analysis, is the sequence to be compared in the analysis, and is the resolution coefficient; , and usually, is taken as 0.5.

Step 3. The grey relational degree is calculated according to the weight vector in Step 1, as shown in Table 6.

Step 4. We utilize the response graph method to select optimal levels of the control factors based on the maximum average grey relational grade. Table 7 shows the average of grade scale for all the levels of control factors, and the proportion of the warner has the greatest impact on the grey relational grade. Figure 2 shows the response graph of the average grey relational grade. It has been observed that the better optimal value of parameters is A3B1C2, which means the proportion of the discoverer is 20%, the proportion of the warner is 10%, and the population size is 30.

3. ISSA Simulation Experiments

The purpose of the simulation experiment is to validate the numerical efficiency of ISSA in comparison with other popular optimization algorithms. The experiment is to test ISSA with other optimization algorithms over a series of benchmark functions [50]. These benchmark functions provide patterns of search spaces of different optimization challenges, usually filled with many local optima.

3.1. Benchmark Functions

Unimodal functions have only one extreme point, which can be used to verify the algorithm’s convergence speed, optimization accuracy, and local development ability. Multimodal functions have multiple local extremum points, which makes the algorithm extremely easy to fall into the local extremum and can be used to verify the algorithm’s ability to escape from the local extremum and global exploration ability. Fixed-dimension multimodal functions can further verify the convergence speed, stability, and convergence accuracy of the algorithm. Therefore, seven unimodal functions (F1–F7), six multimodal functions (F8–F13), and four fixed-dimension multimodal functions (F14–F17) were selected for experiments in this paper. Tables 810 summarize the test problems reporting the cost function, the range of variation of optimization variables, and the optimal value quoted in the literature.

3.2. Parameter Settings

ISSA was compared with SSA, TLBO, SOA, GWO, PSO, and WOA, and the experimental parameter settings of each algorithm are shown in Table 11. Note that the experimental parameter settings of the comparative algorithms are taken from [32, 33, 51, 52]. For fairness, the population size of each algorithm is set to 30 and the maximum number of iterations is 500.

3.3. Results and Analysis

The simulation experiments in this paper are carried out using MATLAB 2018b software. The parameter settings of the seven algorithms are shown in Table 11. The performance of the algorithm is verified using the test functions shown in Tables 810. To avoid the result bias caused by chance, the seven algorithms are run 30 times on each test function separately. Its optimal value, mean value, and standard deviation are recorded in Table 12. To better reflect the optimization effect of the algorithm, this paper provides the convergence curve of ISSA, SSA, TLBO, SOA, GWO, PSO, and WOA for the above sixteen test functions, as shown in Figure 3.

3.3.1. Unimodal Functions (Functions F1–F7)

(1)Convergence Accuracy Analysis. As shown in Table 12, ISSA finds the optimal values for F1, F3, and F4. Although the optimal values are not found for F2, F5, and F6, they are also significantly better than those of the other algorithms. For F7, both ISSA and SSA are significantly better than other algorithms, and ISSA is slightly better than SSA in terms of the average and optimal values obtained.(2)Stability Analysis. From the STD test data in Table 12, it can be seen that ISSA has significantly better standard deviation than other algorithms for F1, F3, and F6 and slightly better standard deviation than SSA for F2, F5, and F7. The ISSA is significantly better than other algorithms. In processing F4, ISSA is less stable than TLBO but better than other algorithms. In conclusion, the simulation experiments show that the sparrow search algorithm has certain stability in the unimodal test function and also has certain advantages compared with other three algorithms.(3)Convergence Speed Analysis. From Figures 3(a)3(f), we can see that ISSA has absolute advantage in convergence speed on F1, F3, and F4 and converges to the optimal value faster than other algorithms on F2, F5, and F6. On F7, although ISSA converges slower than SSA, the convergence to the value is better than SSA.

In summary, we can conclude that our proposed ISSA can find the ideal value quickly and has strong optimization and exploitation capabilities when dealing with unimodal test functions.

3.3.2. Multimodal Functions (Functions F8–F13)

(1)Convergence Accuracy Analysis. As shown in Table 12, ISSA finds the optimum for F8, F9, and F11 and is the only algorithm that finds the optimum for F8. ISSA, SSA, and WOA have almost the same searchability on F10.(2)Stability Analysis. In the F8 test function, although ISSA outperforms the other algorithms in terms of solution accuracy, its stability is relatively poor. For the remaining test functions F9–F13, ISSA has better stability. In conclusion, from these results, we can clearly see that the ISSA has good stability and strong adaptability in dealing with multimodal test functions, also reflecting that the algorithm has the ability to mine the optimal solution.(3)Convergence Speed Analysis. From the convergence curves in Figures 3(g)3(l), we can see that ISSA can converge to the optimal value within 50 iterations on F8–F11, which is obviously better than other algorithms. The convergence speed on F12 and F13 is also significantly better than the other algorithms, although it is only slightly better than SSA. From the figure, it can be seen that SSA has faster convergence speed and better ability to explore unknown regions when dealing with high-dimensional and complex problems.

In summary, by processing multimodal test functions, we further conclude that ISSA has a strong global search capability and is adaptable to a variety of different test functions. The Skew-Tent mapping makes a great contribution to the global search.

3.3.3. Fixed-Dimension Multimodal Functions (Functions F14–F17)
(1)Convergence Accuracy Analysis. Based on the analysis of the results in Table 12, it is concluded that for F15, all four algorithms are able to search for the optimal value quickly and efficiently. This result also proves that the optimization of these algorithms on this test function is very successful. For F16 and F17, ISSA, SSA, TLBO, GWO, and PSO can find the optimal values, but the analysis of the average value shows that ISSA outperforms the other algorithms. For F14, the optimal values of ISSA, SSA, and TLBO can be found and SSA is slightly better than ISSA according to the average value of the analysis.(2)Stability Analysis. From the standard deviations obtained in Table 12 for the optimization of F14, we can see that the standard deviations of TLBO, SOA, GWO, PSO, and WOA are larger, which means that the stability is relatively poor, while the standard deviation of ISSA is obviously much smaller, which means that the data distribution is more concentrated and the stability is better. For the F15 test function, the stability of ISSA, SSA, TLBO, and PSO is better than that of SOA, GWO, and WOA. For the F16 test function, the stability of ISSA, SSA, TLBO, GWO, and PSO is better and that of SOA and WOA is worse. For F17, the stability of ISSA is slightly better than that of other six algorithms.(3)Convergence Speed Analysis. The convergence curves are shown in Figures 3(m)3(p), and these four fixed-dimension multimodal test functions have a strong convergence speed on F15. For F14, the convergence curve shows that the convergence speed of ISSA is faster than that of the other algorithms, which is because ISSA converges quickly to a stable value at the beginning of the iteration. For F17, the convergence trends of ISSA, SSA, TLBO, and WOA are consistent throughout the optimization process, the convergence curves of ISSA and SSA basically overlap, and the convergence rates are close. For F16, the convergence trends of ISSA, SSA, and TLBO are consistent throughout the optimization process and the convergence speed of TLBO is slightly faster than that of ISSA.

The simulation results show that ISSA has strong optimization ability for unimodal test function, multimodal test function, and fixed-dimension multimodal test function. In particular, ISSA has a more obvious competitive advantage than other algorithms in solving the multimodal test function. Through comparison, we find that ISSA can still give very competitive results compared with other state-of-the-art algorithms, and ISSA has improved accuracy, stability, and convergence speed compared with SSA. It can be concluded that ISSA has good robustness and convergence speed and is an effective tool for solving optimization problems.

4. ISSA-SVR Water Quality Regression Prediction Model

Based on the actual aquaculture water quality data, this paper uses the improved sparrow search algorithm to optimize the parameters of the SVR model, optimizes the penalty factor C and kernel function parameter , so as to obtain the appropriate model parameters, and constructs the SVR water quality regression prediction model with the best prediction accuracy.

4.1. Support Vector Regression

Support vector regression (SVR) is an application of SVM in the field of regression prediction. SVR finds a linear regression equation, which can calculate a hyperplane to minimize the total variance of the sample points from the hyperplane to fit all sample points. SVR has usually been used to deal with nonlinear regression problems through a kernel function mapping low-dimensional sample space to high-dimensional feature space.

Let be a training sample set with a given capacity of m, where is the input space with n-dimension and is the output space. For nonlinear problems, SVR fitting function can be expressed aswhere is the mapping function, which can map low-dimensional nonlinear samples to high-dimensional feature space; is the regression coefficient; and is the intercept term.

Considering that there may be some errors in solving practical problems, two slack variables are introduced within the allowable range of errors. Therefore, the regression fitting problem can be expressed aswhere is the penalty factor; is the deviation between the predicted value and the true value; and are the slack variables of the upper and lower bounds, respectively.

By introducing the kernel function , the input samples are mapped to the high-dimensional feature space, and according to the Lagrange duality, the nonlinear problem is converted to the following convex quadratic programming problem:where are the Lagrange multipliers.

According to KKT condition, the decision function of the SVR model under the nonlinear problem can be obtained after the final solution is

This paper uses Gaussian Radial Basis Function (RBF), and the expression is as follows:where is the bandwidth of the Gaussian kernel and the kernel function parameter. From the above derivation, it can be seen that the key parameters affecting SVR are the penalty factor C and the kernel function parameter .

4.2. ISSA-SVR Water Quality Prediction Model

The performance of the SVR prediction model is mainly determined by the penalty factor C and the kernel function broadband . Blind parameter selection is likely to cause the problem of low accuracy and low efficiency of the SVR prediction model. ISSA has the advantages of high convergence accuracy, fast optimization speed, and good stability. In this paper, an ISSA-SVR prediction model is constructed by using ISSA for parameter search optimization of the SVR prediction model, which means the combination of penalty factor C and kernel function parameter is optimized and its flow chart is shown in Figure 4.

5. Water Quality Prediction Experiment

5.1. Water Quality Data Collection

According to the water quality standard for aquaculture, five kinds of parameters, such as temperature, pH value, dissolved oxygen, salt content, and ammonia nitrogen content, are usually used to reflect the quality of water. In this paper, the water quality prediction of swimming crab aquaculture is taken as the application object and these five kinds of water quality parameters are selected as the monitoring objects to predict the overall quality of water by time series. The water quality is divided into I, II, III, IV, and V categories from good to poor. The detailed indicators are shown in Table 13.

In this paper, a distributed water quality monitoring platform is built in an aquaculture farm in Xiangshan, Ningbo, China. The high-precision cluster water quality sensor is used to collect water quality data, and the collected water quality data are stored in the SQL Server database of PC. The field equipment diagram is shown in Figure 5.

In this experiment, 3000 groups of data were obtained continuously from the database according to the time series. Each group of data includes five kinds of parameters: temperature, pH value, salinity, ammonia nitrogen, and dissolved oxygen. 210 groups of abnormal data were eliminated. The remaining 2790 groups of effective data were divided into two groups, of which 2290 groups were used as the training set samples of the new algorithm and the remaining 500 groups were used as the test set samples.

5.2. Performance Metrics

Two performance measures (PMs) including the mean squared error (MSE) and the coefficient of determination () are used to evaluate the proposed predictive models [10]. These PMs were calculated as follows:where denotes the output values, denotes the real values, and is the total number of items.where is the mean value of the values.

5.3. Results and Analysis

To compare the performance of the ISSA-SVR prediction model with other prediction models, BP neural network, SVR, SSA-SVR, TLBO-SVR, SOA-SVR, GWO-SVR, PSO-SVR, and WOA-SVR models are established in the same way. Then, the same data set is used for water quality grade prediction. Finally, MSE, , and running time are compared, that is, the prediction accuracy and convergence speed are compared to evaluate the performance of the prediction model.

This test is carried out by MATLAB 2018b software. Before the test, the data set is normalized by [0,1]. In the test, the range of penalty factor C and kernel function parameter is [0.1, 100], the population size is 30, the maximum number of iterations is 100, the fitness function is the mean square error MSE of the distance between the training sample and the optimal hyperplane, and the minimum MSE is the optimal value. The unified parameter population size is set to 30, and the maximum number of iterations is set to 100. In the BP neural network, there are seven single hidden layer nodes, the transfer function is Tansig, the training function is Trainlm, and the SVR kernel function is set as RBF kernel function. The relevant parameters of other algorithms are shown in Table 11.

To compare the predictive performance of the models used in this study (BP neural network, SVR, ISSA-SVR, SSA-SVR, TLBO-SVR, SOA-SVR, GWO-SVR, PSO-SVR, and WOA-SVR models), their metric indices (MSE and ) and running time obtained during the testing phase are presented in Table 14. The test results and confusion matrix are shown in Figure 6.

As can be seen in Table 14, the ISSA-SVR model provides better performance ( and ) than the BP neural network and the conventional SVR model, where especially the MSE is reduced by 90.07% and 79.37%. In terms of running time, the ISSA-SVR model shows increase compared to BP neural network and traditional SVR models, which is the time cost necessary to obtain the optimal parameters using the optimization algorithm. In practical engineering applications, the prediction model can be pretrained and used by simply bringing the optimal parameters into the model, so it is more cost-effective to spend a certain amount of modeling training time to obtain a smaller MSE and a larger .

Comparing the traditional SVR model with ISSA-SVR, SSA-SVR, TLBO-SVR, SOA-SVR, GWO-SVR, PSO-SVR, and WOA-SVR models, it can be found that the hybrid model performs better, indicating that adding the intelligent search algorithm can effectively improve the performance of the SVR model.

Further comparing the performance of the seven hybrid models (ISSA-SVR, SSA-SVR, TLBO-SVR, SOA-SVR, GWO-SVR, PSO-SVR, and WOA-SVR), it can be found that the ISSA-SVR model not only has better performance ( and ) but also has less running time (). When the ISSA-SVR model is compared with SSA-SVR, TLBO-SVR, SOA-SVR, GWO-SVR, PSO-SVR, and WOA-SVR models, MSE is reduced by 75%, 76.36%, 77.97%, 76.79%, 76.79%, and 76.79%, is increased by 76.79%, 7.57%, 2.40%, 2.73%, 2.51%, 3.05%, and 2.51%, and running time is reduced by 5.79%, 71.44%, 23.18%, 2.64%, 31.54%, and 2.83%. It shows that ISSA has the best effect on the SVR model parameter search (optimal parameters ).

In particular, when comparing the ISSA-SVR model and SSA-SVR model separately, it is easy to see that the ISSA-SVR model has improved performance and running time, indicating that the introduction of Skew-Tent mapping initialization strategy and adaptive elimination mechanism in the ISSA-SVR model can improve the global searchability and generalization ability of the algorithm, further proving that the proposed ISSA in this paper has better optimization effect compared with the traditional SSA.

In order to further explore the performance of the water quality prediction model, Figure 5 shows the prediction results and confusion matrix of water quality category prediction using the above models, where the darker the color of the confusion matrix represents the more the data predicted correctly. Based on the prediction results in Figure 4, it is clear that the prediction results of the ISSA-SVR model are usually closer to the true value and more accurate than those of other models. From the confusion matrix, we can see that the prediction accuracy of the ISSA-SVR model reaches 99.2%, which is 4.86% higher than that of the SVR model, 0.81% higher than that of the SSA-SVR model, and 6.90% higher than that of the BP model which has the worst prediction effect, and it is the only model which is completely accurate in predicting the water quality of Class I. The prediction effect is obviously better than that of the other models.

Through the previous analysis, it can be fully explained that ISSA-SVR model has better performance than BP neural network, traditional SVR model, and other hybrid models, which can predict the water quality category more accurately and can provide better technical support for water quality management.

6. Conclusion

This paper mainly improves the sparrow search algorithm and applies the improved sparrow search algorithm to the parameter optimization of the SVR model, optimizes the combination of penalty factor C and kernel function , and constructs an ISSA-SVR water quality regression prediction model based on the actual aquaculture water quality data:(1)Aiming at the defects of the standard sparrow search algorithm, one solution is to introduce Skew-Tent map initialization strategy to increase the diversity of the initial population and the second solution is to integrate the adaptive elimination mechanism. With the iterative change of the population, the individuals with lower fitness are eliminated adaptively and new individuals are added to the population by using prior knowledge. The experimental results show that the global optimization ability of the improved SSA is enhanced and it can effectively avoid falling into local optimization. The overall convergence accuracy and speed of the improved SSA are significantly better than those of the comparison algorithms, and the algorithm is relatively more stable and robust.(2)An ISSA-SVR water quality prediction model was established. Based on the actual aquaculture water quality data, the parameters C and of the SVR model were optimized with ISSA and the ISSA-SVR water quality prediction model was established. The test results show that the prediction accuracy of the ISSA-SVR model is better than that of the BP neural network, SVR, SSA-SVR, TLBO-SVR, SOA-SVR, GWO-SVR, PSO-SVR, and WOA-SVR model; MSE is 0.013 and is 0.980, which is close to the actual water quality level and meets the actual needs. Although the running time of BP neural network and SVR models is shorter than that of the ISSA-SVR model, in practical engineering applications, the training models are pretrained and the optimal parameters need to be brought into the model only when used, so it is more cost-effective to spend some modeling training time to obtain smaller MSE and higher . For future research, we can try to analyze the minimum number of iterations to obtain an equivalent training effect, resulting in less training time.(3)In this study, only five water quality classification impact factors were selected from the experimental data and the data correlation between the impact factors was not considered. But, in fact, the factors that affect the water quality judgment are multiple and complex. For the subsequent study with a large number of impact factors, correlation analysis of the factors is needed to select the most important factors that affect water quality and avoid unnecessary calculations. At the same time, the experimental data of this study came from the actual aquaculture plant, and the judging criteria of water quality classification for different farming objects in the plant are different. Future research can try to build a water quality prediction model that meets the water quality requirements of multiple farming objects at the same time.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this article.

Acknowledgments

This work was supported by the Key R&D Project of Zhejiang Science and Technology Department (2019C02055), Public Welfare Technology Project of Zhejiang Province (LGN21C190007), and Natural Science Foundation of Ningbo City (2032003N4074).