# COD Optimization Prediction Model Based on CAWOA-ELM in Water Ecological Environment

Authors: Lili Jiang; Liu Yang; Yang Huang; Yi Wu; Huixian Li; XiYan Shen; Meng Bi; Lin Hong; Yiting Yang; Zuping Ding; Wenjie Chen
Journal: Journal of Chemistry
 (2021)

---

## Abstract

The change of water quality can reflect the important indicators of ecological environment measurement. Sewage discharge is an important factor causing environmental pollution. Establishing an effective water ecological prediction model can detect changes in the ecological environment system quickly and effectively. In order to detect high error rate and poor convergence of the water ecological chemical oxygen demand (COD) prediction model, combining the limit learning machine (ELM) model and whale optimization algorithm, CAWOA is improved by the sin chaos search strategy, while the ELM optimizes the parameters of the algorithm to improve convergence speed, thus improving the generalization performance of the ELM. In the CAWOA, the global optimization results of the WOA are promoted by introducing a sin chaotic search strategy and adaptive inertia weights. On this basis, the COD prediction model of CAWOA-ELM is established and compared with similar algorithms by using the optimized ELM to predict the water ecological COD in a region. Finally, from the experimental results of the CAWOA-ELM algorithm, it has excellent prediction effect and practical application value.


---

## Body

## 1. Introduction

With the acceleration of economic development and industrialization, the situation of China’s water pollution ecological environment is becoming more and more serious, and industrial and urban water discharge have become the main pollution source [1]. Therefore, the establishment of an effective water quality ecological prediction model can not only optimize urban water ecological detection but also is essential for reducing ecological water pollution. However, the formation of the water ecological environment is a complex physical and chemical process, which is influenced by many factors such as factory emissions, domestic water use, and human factors [2]. These variables are coupled with each other, making it difficult to describe these complex processes with mechanism models. The emergence of learning technology provides an effective way to establish a water ecological detection optimization model [3, 4].A multiobjective problem proposed in the literature [5] is applied in the activated sludge process. Through the genetic algorithm, it is used to process under the conditions of 14 optimized parameters, and the wastewater COD concentration is reduced by 2.22 mg/L after optimization. The effect of multiobjective problem optimization is obvious, and the parameter optimization combination is the best. Dong et al. [6] proposed a system optimization plan to adjust sewage discharge and predicted COD concentration to adjust the sewage discharge model. The optimized model can improve the water quality of the river and optimize the drainage system more effectively. An et al. [7] proposed to optimize the low dissolved oxygen-oxygen-anoxia process, which can solve the problem of low-cost wastewater treatment, thereby providing a new method for low-cost treatment of COD. Nazrifar et al. [8] optimized the influence of COD, pH, H2O2, FeSO4,·and 7H2O content on the overall target. When the value reaches 4, 8 ml/L, 2.33 g/L, the model is optimal, and the effect of COD is 83.51. In the CO2 emissions, Lim and Kim [9] proposed dynamic optimization to evaluate the production of concrete components. Reuse kinetics to optimize related parameters, and as a result, CO2 emission costs can be saved. In the NOx and CO emission model, the dynamic optimization algorithm proposed in [10] greatly reduces the NOx and CO emissions. In terms of performance, the proposed dynamic optimization model can reduce emissions.ELM is a new and effective machine learning technology based on the Moore–Penrose (MP) generalized inverse matrix theory [11]. Weights and thresholds in the neuron weights are given randomly, and then the output weights are calculated by the regularization principle. The ELM network can still approximate any continuous system. Compared with the ANN and SVM, ELM has an advantage of greatly improving learning speed relatively, which has attracted more and more scholars’ attention [12, 13]. Therefore, the prediction model of boiler water ecological COD is adopted by the ELM.However, ELM regression method is given at random. Without any prior experience, it is easy to cause problems such as the generalization ability and stability of the regression model. In practice, in order to achieve the desired error precision, the ELM usually needs to adjust the weight and threshold. Therefore, a sin chaos AWOA is proposed to accelerate the convergence of ELM parameters to improve the stability and the ELM prediction model and further propose a water ecological optimization prediction model of CAWOA-ELM. It is applied to the prediction of river surface water, domestic sewage, and industrial wastewater in a city. The results show that CAWOA-ELM can accurately predict COD, accurately predict water ecology, and provide an effective means for the promotion of relevant emission optimization.


## 2. Chaos Adaptive Whale Optimization Algorithm

### 2.1. WOA

WOA [14] is an optimization algorithm that simulates the natural world and was put forward in 2016 to simulate the predation behavior of whale populations. This algorithm is simple to set up and has few parameters. When optimizing the benchmark function, it has the advantages of the traditional imitation algorithm (such as particle swarm optimization algorithm (PSO) [15] and gravity search algorithm (GSA) [16]). However, compared with other swarm intelligence algorithms, traditional WOA also have problems of slow convergence, premature convergence, and global optimal value is not available. Based on this, in recent years, many scholars have implemented many effective improved WOA, such as Kaur and Arora [17] used the chaotic map to optimize the update probability p in WOA, proposed a CWOA, and verified the algorithm with higher convergence speed through the test of benchmark function; Mafarja and Mirjalili [18] combined the annealing algorithm and WOA for the optimization precision of the algorithm, improved the global search ability, and obtained good results in the experiment of publicly testing 18 datasets in the UCI library.


#### 2.1.1. Shrinkage Surrounding Mechanism

In the WOA, assuming that the size of the whale population is expressed asN and d is to represent the dimensionality, the i-th position whale in the d-th dimension can be expressed as Xi=xi1,…,xid,i=1,…,N. The position keeps changing as the problem is solved, and the most optimal solution is described by the optimal position. The whales are all surrounded by optimal solutions. The mathematical model is described as follows:(1)Xi=xi1,…,xid,i=1,…,N,where t is the number of iterations. A and C are coefficient vectors, which are defined as follows:(2)A=2a×r1−a,(3)C=2×r2,where r1 and r2 are the random numbers [0, 1] in the formula. The control parameters are defined as follows:(4)a=2−2×tTmax,where Tmax is the maximum iteration number. The contraction bounding mechanism is realized through the reduction of parameter α by means of (1) and (4).


#### 2.1.2. Bubble Network Attack

In the WOA, two methods are designed to describe the predation behavior of whales: shrinkage surrounding mechanism and spiral renewal position.(a)
Shrinkage enveloping mechanism: it is achieved by reducing the convergence factorα in equations (2) and (4).(b)
Spiral update position: first, the distance between the whale individual and the current optimal position is calculated, and then the whale is simulated to capture food in a spiral manner. The mathematical model can be expressed as(5)Xt+1=Xpt+D˙⋅ebl⋅cos2πl,in which D′=Xpt−Xt denotes the distance between whales and the prey, b is a constant that defines the shape of a logarithmic spiral, and L is a random number [−1, 1] in the middle.The whale’s contraction and envelopment mechanism and spiral updating position’s mode are synchronized. The new mode of updatingPi is usually chosen according to the probability value: if p<Pi, Xt+1 is updated in formula (5); otherwise, formula (6) is used to update:(6)Xt+1=Xt−A⋅CXpt−Xt,p<Pi,Xpt+D˙⋅ebl⋅cos2πl,p≥Pi.When |A| ≥ 1, the whales are randomly selected to force them away from the reference whales to find a better prey in order to enhance the global exploration ability of the algorithm. The mathematical model is expressed as follows:(7)Xt+1=Xr−A⋅C⋅Xr−Xt,in which Xr indicates the position vector of the whale randomly selected.


### 2.2. CAWOA

The shortcomings of the WOA algorithm in dealing with complex optimization problems are low convergence accuracy and easy to fall into local optimum. In view of the above deficiencies, the CAWOA is proposed to improve the global optimization capability of the algorithm. On the basis of WOA, logistic chaotic search strategy is introduced to enhance the ability of the algorithm to jump out of the local optimum. In addition, adaptive inertia weights are introduced into position updating to solve the problem of low convergence accuracy by balancing the development and exploration capabilities.


#### 2.2.1. Sin Chaotic Search Strategy

Chaotic mapping is a stochastic motion state obtained by the deterministic equation, which has periodicity and inherent randomness in the phase space, realizing global optimization by optimizing the search ability. Yang and Jiaqiang [19] verified that sin chaos has more obvious chaotic characteristics than logistic chaos does. In order to overcome the shortcomings of the local optimum when WOA deals with complex function optimization problems, sin chaotic search is used to search the optimal individuals (elite individuals) of each generation of the WOA for M times of chaotic search. If better individuals are found, they are replaced. It can avoid the local optimum and effectively avoid the WOA falling into the local optimum. The sin chaotic mapping model is defined as follows:(8)Zn+1=sin2Zn,n=0,1,…,N,−1≤Zn≤1,Zn≠0,in which Z0=Z10,Z20,…,ZD0 is a randomly generated initial vector whose dimension cannot be zero, thus avoiding producing fixed points and zeros in [−1, 1], and its dimension is the same as that of the optimization problem. The iteration counter of the chaotic map is represented by t, and the output of the system traverses the whole solution space by M chaotic iterations.Assuming that the optimal individuals in the WOA population areXi, the chaos optimization process in the feasible region is(9)Vit+1=Xi+αZt+1,Vit+1∈Vmin,Vmax,α=1,γ≥0.5,−1,otherwise.Among them,Vit represents a new individual searched by the algorithm; α is the adaptive parameter that controls the chaotic search direction; γ∈0,1; and Vmin,Vmax is the chaotic search space. Assuming that the elitist solution of the i generation of the WOA is Xi=xi1,xi2,…,xiD, the sin chaotic search steps are as follows:Step 1: normalization ofXi by using the following formula:(10)xij=xij−XminjXmaxj−Xminji=1,2,…,n;j=1,2,…,D.Step 2: generating chaotic sequences. Random generation vectorZ0=Z10,Z20,…,ZD0 based on formula (8) iterative generation of M chaotic sequences.Step 3: generatingM chaotic sequences by substituting formula (9), and generating M chaotic variable sequences Vik=vi1k,vi2k,…,viDk,k=1,2,…,M.Step 4: using formula (10) to reverse the normalization of Vik and generate a new solution Uk in the field of the original solution space, where (k = 1, 2,…,M):(11)uij=xij+Xmaxj−Xminj2×2vij−1.The fitness valuefUk of Uk is calculated and compared with the fitness value fXi of Xi, retaining the best solution.


#### 2.2.2. Adaptive Inertia Weight

Inertia weight is an important parameter in WOA. The inertia weight of formulas (1) and (5) is larger than that of formula (1). Constant invariant inertia weight will reduce the efficiency of the algorithm, which is not conducive to the global optimization of the algorithm. Zhang et al. [20] pointed out that, as the inertia weight increases, the global optimal value is easier to obtain, while a smaller inertia weight can easily achieve local optimization [21, 22]. On this basis, an adaptive inertial weight algorithm based on the fitness value is proposed to ensure that Algorithm 1 has a large nonlinear weight at the beginning of the iteration, with different adaptive values, and a small nonlinear weight strategy at the end of the iteration.Algorithm 1: CAWOA algorithm flow.
Using the dynamic nonlinear characteristics to improve the convergence accuracy and speed of the WOA, the flowchart of the CAWOA is as follows:The maximum iteration isTmax, the population number is N, and N initial whale populations {Xi, i = 1, 2,…,N} are generated.The fitness value {f (Xi), i = 1, 2,…,N } of each whale individual is calculated, and the best individuals are recorded.While (t < Tmax) dofori = 1 to N doAccording to formula (10), the value of adaptive inertia weight W is calculated.According to formula (4), the value of control parameter alpha is calculated.Updating the values of other parametersA, C, l, and P.If (p<0.05) doAccording to formula (11), updating the current whale individual position;Else if (p<0.05) doAccording to formula (11), updating the current whale individual position;End ifEnd forCalculating the fitness values of individuals in groups {f (Xi), i = 1, 2,…,N}, and preserving and recording elite individuals.Using sin chaotic search strategy to update elite individuals;T = t + 1;end whilet = t + 1;The following adaptive inertia weights are introduced in formulas (1) and (6):(12)ω=0.2+10.4+exp−ffitx/uiter.In the formula,ffitx represents the individual fitness value, u represents the best fitness value, and u represents the iteration number.The updated formula is as follows:(13)Xt+1=wX∗t−A⋅D,p<Pi,wX∗t+Dp⋅ebl⋅cos2πl,p≥Pi.


## 2.1. WOA

WOA [14] is an optimization algorithm that simulates the natural world and was put forward in 2016 to simulate the predation behavior of whale populations. This algorithm is simple to set up and has few parameters. When optimizing the benchmark function, it has the advantages of the traditional imitation algorithm (such as particle swarm optimization algorithm (PSO) [15] and gravity search algorithm (GSA) [16]). However, compared with other swarm intelligence algorithms, traditional WOA also have problems of slow convergence, premature convergence, and global optimal value is not available. Based on this, in recent years, many scholars have implemented many effective improved WOA, such as Kaur and Arora [17] used the chaotic map to optimize the update probability p in WOA, proposed a CWOA, and verified the algorithm with higher convergence speed through the test of benchmark function; Mafarja and Mirjalili [18] combined the annealing algorithm and WOA for the optimization precision of the algorithm, improved the global search ability, and obtained good results in the experiment of publicly testing 18 datasets in the UCI library.


### 2.1.1. Shrinkage Surrounding Mechanism

In the WOA, assuming that the size of the whale population is expressed asN and d is to represent the dimensionality, the i-th position whale in the d-th dimension can be expressed as Xi=xi1,…,xid,i=1,…,N. The position keeps changing as the problem is solved, and the most optimal solution is described by the optimal position. The whales are all surrounded by optimal solutions. The mathematical model is described as follows:(1)Xi=xi1,…,xid,i=1,…,N,where t is the number of iterations. A and C are coefficient vectors, which are defined as follows:(2)A=2a×r1−a,(3)C=2×r2,where r1 and r2 are the random numbers [0, 1] in the formula. The control parameters are defined as follows:(4)a=2−2×tTmax,where Tmax is the maximum iteration number. The contraction bounding mechanism is realized through the reduction of parameter α by means of (1) and (4).


### 2.1.2. Bubble Network Attack

In the WOA, two methods are designed to describe the predation behavior of whales: shrinkage surrounding mechanism and spiral renewal position.(a)
Shrinkage enveloping mechanism: it is achieved by reducing the convergence factorα in equations (2) and (4).(b)
Spiral update position: first, the distance between the whale individual and the current optimal position is calculated, and then the whale is simulated to capture food in a spiral manner. The mathematical model can be expressed as(5)Xt+1=Xpt+D˙⋅ebl⋅cos2πl,in which D′=Xpt−Xt denotes the distance between whales and the prey, b is a constant that defines the shape of a logarithmic spiral, and L is a random number [−1, 1] in the middle.The whale’s contraction and envelopment mechanism and spiral updating position’s mode are synchronized. The new mode of updatingPi is usually chosen according to the probability value: if p<Pi, Xt+1 is updated in formula (5); otherwise, formula (6) is used to update:(6)Xt+1=Xt−A⋅CXpt−Xt,p<Pi,Xpt+D˙⋅ebl⋅cos2πl,p≥Pi.When |A| ≥ 1, the whales are randomly selected to force them away from the reference whales to find a better prey in order to enhance the global exploration ability of the algorithm. The mathematical model is expressed as follows:(7)Xt+1=Xr−A⋅C⋅Xr−Xt,in which Xr indicates the position vector of the whale randomly selected.


## 2.1.1. Shrinkage Surrounding Mechanism

In the WOA, assuming that the size of the whale population is expressed asN and d is to represent the dimensionality, the i-th position whale in the d-th dimension can be expressed as Xi=xi1,…,xid,i=1,…,N. The position keeps changing as the problem is solved, and the most optimal solution is described by the optimal position. The whales are all surrounded by optimal solutions. The mathematical model is described as follows:(1)Xi=xi1,…,xid,i=1,…,N,where t is the number of iterations. A and C are coefficient vectors, which are defined as follows:(2)A=2a×r1−a,(3)C=2×r2,where r1 and r2 are the random numbers [0, 1] in the formula. The control parameters are defined as follows:(4)a=2−2×tTmax,where Tmax is the maximum iteration number. The contraction bounding mechanism is realized through the reduction of parameter α by means of (1) and (4).


## 2.1.2. Bubble Network Attack

In the WOA, two methods are designed to describe the predation behavior of whales: shrinkage surrounding mechanism and spiral renewal position.(a)
Shrinkage enveloping mechanism: it is achieved by reducing the convergence factorα in equations (2) and (4).(b)
Spiral update position: first, the distance between the whale individual and the current optimal position is calculated, and then the whale is simulated to capture food in a spiral manner. The mathematical model can be expressed as(5)Xt+1=Xpt+D˙⋅ebl⋅cos2πl,in which D′=Xpt−Xt denotes the distance between whales and the prey, b is a constant that defines the shape of a logarithmic spiral, and L is a random number [−1, 1] in the middle.The whale’s contraction and envelopment mechanism and spiral updating position’s mode are synchronized. The new mode of updatingPi is usually chosen according to the probability value: if p<Pi, Xt+1 is updated in formula (5); otherwise, formula (6) is used to update:(6)Xt+1=Xt−A⋅CXpt−Xt,p<Pi,Xpt+D˙⋅ebl⋅cos2πl,p≥Pi.When |A| ≥ 1, the whales are randomly selected to force them away from the reference whales to find a better prey in order to enhance the global exploration ability of the algorithm. The mathematical model is expressed as follows:(7)Xt+1=Xr−A⋅C⋅Xr−Xt,in which Xr indicates the position vector of the whale randomly selected.


## 2.2. CAWOA

The shortcomings of the WOA algorithm in dealing with complex optimization problems are low convergence accuracy and easy to fall into local optimum. In view of the above deficiencies, the CAWOA is proposed to improve the global optimization capability of the algorithm. On the basis of WOA, logistic chaotic search strategy is introduced to enhance the ability of the algorithm to jump out of the local optimum. In addition, adaptive inertia weights are introduced into position updating to solve the problem of low convergence accuracy by balancing the development and exploration capabilities.


### 2.2.1. Sin Chaotic Search Strategy

Chaotic mapping is a stochastic motion state obtained by the deterministic equation, which has periodicity and inherent randomness in the phase space, realizing global optimization by optimizing the search ability. Yang and Jiaqiang [19] verified that sin chaos has more obvious chaotic characteristics than logistic chaos does. In order to overcome the shortcomings of the local optimum when WOA deals with complex function optimization problems, sin chaotic search is used to search the optimal individuals (elite individuals) of each generation of the WOA for M times of chaotic search. If better individuals are found, they are replaced. It can avoid the local optimum and effectively avoid the WOA falling into the local optimum. The sin chaotic mapping model is defined as follows:(8)Zn+1=sin2Zn,n=0,1,…,N,−1≤Zn≤1,Zn≠0,in which Z0=Z10,Z20,…,ZD0 is a randomly generated initial vector whose dimension cannot be zero, thus avoiding producing fixed points and zeros in [−1, 1], and its dimension is the same as that of the optimization problem. The iteration counter of the chaotic map is represented by t, and the output of the system traverses the whole solution space by M chaotic iterations.Assuming that the optimal individuals in the WOA population areXi, the chaos optimization process in the feasible region is(9)Vit+1=Xi+αZt+1,Vit+1∈Vmin,Vmax,α=1,γ≥0.5,−1,otherwise.Among them,Vit represents a new individual searched by the algorithm; α is the adaptive parameter that controls the chaotic search direction; γ∈0,1; and Vmin,Vmax is the chaotic search space. Assuming that the elitist solution of the i generation of the WOA is Xi=xi1,xi2,…,xiD, the sin chaotic search steps are as follows:Step 1: normalization ofXi by using the following formula:(10)xij=xij−XminjXmaxj−Xminji=1,2,…,n;j=1,2,…,D.Step 2: generating chaotic sequences. Random generation vectorZ0=Z10,Z20,…,ZD0 based on formula (8) iterative generation of M chaotic sequences.Step 3: generatingM chaotic sequences by substituting formula (9), and generating M chaotic variable sequences Vik=vi1k,vi2k,…,viDk,k=1,2,…,M.Step 4: using formula (10) to reverse the normalization of Vik and generate a new solution Uk in the field of the original solution space, where (k = 1, 2,…,M):(11)uij=xij+Xmaxj−Xminj2×2vij−1.The fitness valuefUk of Uk is calculated and compared with the fitness value fXi of Xi, retaining the best solution.


### 2.2.2. Adaptive Inertia Weight

Inertia weight is an important parameter in WOA. The inertia weight of formulas (1) and (5) is larger than that of formula (1). Constant invariant inertia weight will reduce the efficiency of the algorithm, which is not conducive to the global optimization of the algorithm. Zhang et al. [20] pointed out that, as the inertia weight increases, the global optimal value is easier to obtain, while a smaller inertia weight can easily achieve local optimization [21, 22]. On this basis, an adaptive inertial weight algorithm based on the fitness value is proposed to ensure that Algorithm 1 has a large nonlinear weight at the beginning of the iteration, with different adaptive values, and a small nonlinear weight strategy at the end of the iteration.Algorithm 1: CAWOA algorithm flow.
Using the dynamic nonlinear characteristics to improve the convergence accuracy and speed of the WOA, the flowchart of the CAWOA is as follows:The maximum iteration isTmax, the population number is N, and N initial whale populations {Xi, i = 1, 2,…,N} are generated.The fitness value {f (Xi), i = 1, 2,…,N } of each whale individual is calculated, and the best individuals are recorded.While (t < Tmax) dofori = 1 to N doAccording to formula (10), the value of adaptive inertia weight W is calculated.According to formula (4), the value of control parameter alpha is calculated.Updating the values of other parametersA, C, l, and P.If (p<0.05) doAccording to formula (11), updating the current whale individual position;Else if (p<0.05) doAccording to formula (11), updating the current whale individual position;End ifEnd forCalculating the fitness values of individuals in groups {f (Xi), i = 1, 2,…,N}, and preserving and recording elite individuals.Using sin chaotic search strategy to update elite individuals;T = t + 1;end whilet = t + 1;The following adaptive inertia weights are introduced in formulas (1) and (6):(12)ω=0.2+10.4+exp−ffitx/uiter.In the formula,ffitx represents the individual fitness value, u represents the best fitness value, and u represents the iteration number.The updated formula is as follows:(13)Xt+1=wX∗t−A⋅D,p<Pi,wX∗t+Dp⋅ebl⋅cos2πl,p≥Pi.


## 2.2.1. Sin Chaotic Search Strategy

Chaotic mapping is a stochastic motion state obtained by the deterministic equation, which has periodicity and inherent randomness in the phase space, realizing global optimization by optimizing the search ability. Yang and Jiaqiang [19] verified that sin chaos has more obvious chaotic characteristics than logistic chaos does. In order to overcome the shortcomings of the local optimum when WOA deals with complex function optimization problems, sin chaotic search is used to search the optimal individuals (elite individuals) of each generation of the WOA for M times of chaotic search. If better individuals are found, they are replaced. It can avoid the local optimum and effectively avoid the WOA falling into the local optimum. The sin chaotic mapping model is defined as follows:(8)Zn+1=sin2Zn,n=0,1,…,N,−1≤Zn≤1,Zn≠0,in which Z0=Z10,Z20,…,ZD0 is a randomly generated initial vector whose dimension cannot be zero, thus avoiding producing fixed points and zeros in [−1, 1], and its dimension is the same as that of the optimization problem. The iteration counter of the chaotic map is represented by t, and the output of the system traverses the whole solution space by M chaotic iterations.Assuming that the optimal individuals in the WOA population areXi, the chaos optimization process in the feasible region is(9)Vit+1=Xi+αZt+1,Vit+1∈Vmin,Vmax,α=1,γ≥0.5,−1,otherwise.Among them,Vit represents a new individual searched by the algorithm; α is the adaptive parameter that controls the chaotic search direction; γ∈0,1; and Vmin,Vmax is the chaotic search space. Assuming that the elitist solution of the i generation of the WOA is Xi=xi1,xi2,…,xiD, the sin chaotic search steps are as follows:Step 1: normalization ofXi by using the following formula:(10)xij=xij−XminjXmaxj−Xminji=1,2,…,n;j=1,2,…,D.Step 2: generating chaotic sequences. Random generation vectorZ0=Z10,Z20,…,ZD0 based on formula (8) iterative generation of M chaotic sequences.Step 3: generatingM chaotic sequences by substituting formula (9), and generating M chaotic variable sequences Vik=vi1k,vi2k,…,viDk,k=1,2,…,M.Step 4: using formula (10) to reverse the normalization of Vik and generate a new solution Uk in the field of the original solution space, where (k = 1, 2,…,M):(11)uij=xij+Xmaxj−Xminj2×2vij−1.The fitness valuefUk of Uk is calculated and compared with the fitness value fXi of Xi, retaining the best solution.


## 2.2.2. Adaptive Inertia Weight

Inertia weight is an important parameter in WOA. The inertia weight of formulas (1) and (5) is larger than that of formula (1). Constant invariant inertia weight will reduce the efficiency of the algorithm, which is not conducive to the global optimization of the algorithm. Zhang et al. [20] pointed out that, as the inertia weight increases, the global optimal value is easier to obtain, while a smaller inertia weight can easily achieve local optimization [21, 22]. On this basis, an adaptive inertial weight algorithm based on the fitness value is proposed to ensure that Algorithm 1 has a large nonlinear weight at the beginning of the iteration, with different adaptive values, and a small nonlinear weight strategy at the end of the iteration.Algorithm 1: CAWOA algorithm flow.
Using the dynamic nonlinear characteristics to improve the convergence accuracy and speed of the WOA, the flowchart of the CAWOA is as follows:The maximum iteration isTmax, the population number is N, and N initial whale populations {Xi, i = 1, 2,…,N} are generated.The fitness value {f (Xi), i = 1, 2,…,N } of each whale individual is calculated, and the best individuals are recorded.While (t < Tmax) dofori = 1 to N doAccording to formula (10), the value of adaptive inertia weight W is calculated.According to formula (4), the value of control parameter alpha is calculated.Updating the values of other parametersA, C, l, and P.If (p<0.05) doAccording to formula (11), updating the current whale individual position;Else if (p<0.05) doAccording to formula (11), updating the current whale individual position;End ifEnd forCalculating the fitness values of individuals in groups {f (Xi), i = 1, 2,…,N}, and preserving and recording elite individuals.Using sin chaotic search strategy to update elite individuals;T = t + 1;end whilet = t + 1;The following adaptive inertia weights are introduced in formulas (1) and (6):(12)ω=0.2+10.4+exp−ffitx/uiter.In the formula,ffitx represents the individual fitness value, u represents the best fitness value, and u represents the iteration number.The updated formula is as follows:(13)Xt+1=wX∗t−A⋅D,p<Pi,wX∗t+Dp⋅ebl⋅cos2πl,p≥Pi.


## 3. ELM Optimization Model

### 3.1. Basic ELM

ELM solves the problem of long time consumption of the BP neural network. However, because the common limit learning machine only contains one hidden layer, the characterization ability of the network is very limited. Compared with the BP neural network which uses the gradient descent method to update weights, ELM has two characteristics:(1)
The weights are randomly set and do not need to be adjusted after setting(2)
The weights are generated by solving the least squares without iterative updatingTo solve the output weight of the hidden layer, a standard model can be expressed as follows.The ELM model is defined as(14)∑i=1Mβigωi⋅xi+bi=oj,j=1,2,…,N,where o is the actual model output, the training purpose of SLFNs is to minimize the output error, and the cost function E of the limit learning machine can be seen as follows:(15)ES,β=∑j=1Noj−yj,where y is the actual data tag, in the limit case, the output of the network is close to the zero error of the actual data tag, and minES,β can be seen:(16)minE=minHω,b,xβ−T,where H,β,andT are, respectively, expressed by the following formula:(17)Hω,b,x=gω1x1+b1⋯gωMx1+bM⋮⋮gω1xN+b1⋯gωMxN+bMN×M,β=β1T⋮βMTM×n,T=t1T⋮tNTN×n.ELM uses this above model to obtain the output weight of the hidden layer. The above model can be expressed as follows:(18)Y=Hβ.Then, the solution model of the hidden layer output weight can be expressed as(19)minHβ−Y2.The least squares solution is defined as(20)β=H†T,where H† is the generalized inverse matrix of H, which can be obtained by singular value decomposition.As can be seen from the above introduction, the learning process of the whole network of the limit learning machine only needs to be solved once. Relative to the BP network, the training time of the network is very short. At the same time, because the hidden layer input weights of the limit learning machine are randomly generated and do not need iterative updating, ELM solves the local minimum problem existing in the BP neural network.


### 3.2. ELM Work Flow

Because ELM has a good performance in function regression without prior knowledge, CAWOA is used in combination with the ELM model. The ELM model trains the input sample data, and CAWOA optimization is used to obtain the optimal parameter value.Step 1: initialization of WOA:N is the population number, and the random input value of each individual is set to xj=ω11,…,ω1M,ω21,ω22,…,ωm1,…,ωmM,b1,b2,…,bM.Step 2: variable selection and data acquisition: to verify good performance of the algorithm proposed, a variety of functions are applied for comparative analysis. Unimodal function and multimodal function are used.Step 3: determining fitness functionJ:(21)J=11+∑j=1Noj−tj22/nN,in whichti=ti1,ti2,…,tinT is the output, and oi=oi1,oi2,…,oinT represents the predicted output.Step 4: model selection: generating the initial population ω11,…,ω1M,ω21,ω22,…,ωm1,…,ωmM,b1,b2,…,bM by the random initialization method, randomly generating the sample data prediction model according to the initial population, optimizing parameters in this model until satisfactory results are obtained, and establishing the CAWOA-ELM model.Step 5: model validation: verifying the performance of the CAWOA-ELM model using test data.


## 3.1. Basic ELM

ELM solves the problem of long time consumption of the BP neural network. However, because the common limit learning machine only contains one hidden layer, the characterization ability of the network is very limited. Compared with the BP neural network which uses the gradient descent method to update weights, ELM has two characteristics:(1)
The weights are randomly set and do not need to be adjusted after setting(2)
The weights are generated by solving the least squares without iterative updatingTo solve the output weight of the hidden layer, a standard model can be expressed as follows.The ELM model is defined as(14)∑i=1Mβigωi⋅xi+bi=oj,j=1,2,…,N,where o is the actual model output, the training purpose of SLFNs is to minimize the output error, and the cost function E of the limit learning machine can be seen as follows:(15)ES,β=∑j=1Noj−yj,where y is the actual data tag, in the limit case, the output of the network is close to the zero error of the actual data tag, and minES,β can be seen:(16)minE=minHω,b,xβ−T,where H,β,andT are, respectively, expressed by the following formula:(17)Hω,b,x=gω1x1+b1⋯gωMx1+bM⋮⋮gω1xN+b1⋯gωMxN+bMN×M,β=β1T⋮βMTM×n,T=t1T⋮tNTN×n.ELM uses this above model to obtain the output weight of the hidden layer. The above model can be expressed as follows:(18)Y=Hβ.Then, the solution model of the hidden layer output weight can be expressed as(19)minHβ−Y2.The least squares solution is defined as(20)β=H†T,where H† is the generalized inverse matrix of H, which can be obtained by singular value decomposition.As can be seen from the above introduction, the learning process of the whole network of the limit learning machine only needs to be solved once. Relative to the BP network, the training time of the network is very short. At the same time, because the hidden layer input weights of the limit learning machine are randomly generated and do not need iterative updating, ELM solves the local minimum problem existing in the BP neural network.


## 3.2. ELM Work Flow

Because ELM has a good performance in function regression without prior knowledge, CAWOA is used in combination with the ELM model. The ELM model trains the input sample data, and CAWOA optimization is used to obtain the optimal parameter value.Step 1: initialization of WOA:N is the population number, and the random input value of each individual is set to xj=ω11,…,ω1M,ω21,ω22,…,ωm1,…,ωmM,b1,b2,…,bM.Step 2: variable selection and data acquisition: to verify good performance of the algorithm proposed, a variety of functions are applied for comparative analysis. Unimodal function and multimodal function are used.Step 3: determining fitness functionJ:(21)J=11+∑j=1Noj−tj22/nN,in whichti=ti1,ti2,…,tinT is the output, and oi=oi1,oi2,…,oinT represents the predicted output.Step 4: model selection: generating the initial population ω11,…,ω1M,ω21,ω22,…,ωm1,…,ωmM,b1,b2,…,bM by the random initialization method, randomly generating the sample data prediction model according to the initial population, optimizing parameters in this model until satisfactory results are obtained, and establishing the CAWOA-ELM model.Step 5: model validation: verifying the performance of the CAWOA-ELM model using test data.


## 4. CAWOA-ELM Test Comparison

### 4.1. Test Function Selection

In order to test the CAWOA-ELM performance, a comprehensive and reasonable experiment is provided. Simulation experiments (including unimodal function and multimodal function) are carried out on 4 benchmark tests, and the corresponding functions are selected as follows:(22)f1=∑i=1nxi+∏i=1nxiD=30,lb=−10,ub=10,fmin=0,(23)f2=∑i=1n−1100xi+1−xi22+xi+12D=30,lb=−30,ub=30,fmin=0,(24)f3=20exp−0.21n∑i=1nxi2−exp1n∑i=1ncos2πxi+20+eD=30,lb=−32,ub=32,fmin=0,(25)f4=1400∑i=1nxi2−∏i=1ncosxii+1D=30,lb=−600,ub=600,fmin=0,where D is the dimension, ub and lb are the min and max bounds of decision variables, respectively, and fmin represents the global optimal value.Among the above four functions, formulas (22) and (23) are unimodal test functions, and formulas (25) and (26) are bimodal test functions.


### 4.2. Algorithm Parameter Setting

When simulating the algorithm, the population sizeN = 30, the dimension D = 30, and the maximum iteration tmax = 1000. The running environment of the algorithm is “Windows 7 (64-bit),” “CPU E3-1230 with 32 GB,” and “MATLAB 2016b.” For the statistical analysis of the algorithm, each algorithm runs M = 20 times independently for each benchmark test function and counts its results. All function experiment parameter settings are consistent, and the initial population of all algorithms is consistent.In order to accurately analyze the CAWOA-ELM effect, the following five indexes are selected:(26)Best=minbest1,best2,…,bestn,Worst=maxbest1,best2,…,bestn,Mean=1n∑n1besti,STD=1m∑i=1mbesti−Mean2,SR=km∗100%.In the formula,k represents the number of successes in m repeated experiments (i.e., the results calculated by the algorithm in this experiment are better than the set standard).


### 4.3. Algorithm Test Comparison

In order to test the performance of CAWOA-ELM algorithm and the correlation test function to obtain the correlation output value when different input values are used, CAWOA-ELM is compared with whale optimization algorithm (WOA), particle swarm optimization (POS), and biogeography-based optimization (BBO).Table1 displays the simulation value of 4 algorithms on 4 benchmark test functions. The best value (BV), worst value (WV), mean value (MV), standard deviation (SD), and success rate (SR) obtained by running all algorithms for 30 times are given. Table 1 shows that, under the condition of test level α=0.5, taking CAWOA-ELM algorithm as the benchmark, and comparing the other three algorithms, it is found that the proposed algorithm can have high experimental results.Table 1
Simulation results.
FunctionIndicatorsWOAPSOBBOCAWOA-ELMf1BV1.391E − 655.352E −551.127 ×E −451.987E −167WV4.117E −494.961E −395.238 ×E −342.343E −89MV2.106E −559.871E −472.921 ×E −394.782 ×E −107SD9.109E −576.431E −499.302 ×E −411.412 ×E −124SR10%10%16.67%3.33%f2BV3.345E −753.522E −653.342 ×E −420WV5.727E −621.719E −517.231 ×E −310MV8.234E −683.371E −588.823 ×E −350SD6.349E −708.569E −627.467 ×E −360SR13.33%10%13.33%0f3BV8.881E −185.169E −371.122 ×E −317.387E −197WV7.991E −165.387E −273.378 ×E −232.343E −78MV5.442E −179.871E −302.278 ×E −284.78 ×E −116SD2.833E −176.431E −329.976 ×E −291.42 ×E −135SR13.33%13.33%16.67%3.33%f4BV3.764E −237.654E −392.138 ×E −370WV7.761E −178.659E −263.891 ×E −280MV5.581E −209.871E −475.892 ×E −320SD8.874E −216.431E −497.319 ×E −350SR13.33%13.33%10%0The WOA, PSO algorithm, BBO algorithm, and CAWOA-ELM algorithm in Table1 verify the good value and analyze the performance under the above four functions. When the variable dimension is 30, it can be seen from Table 1 that CAWOA-ELM algorithm obtains the optimal value in more aspects of sex.After comparing the data obtained from 30 simulation experiments, the functionsf2 and f4 can be optimized, all of which are 0. However, CAWOA-ELM is better than WOA, PSO, and BBO algorithms in the average and SD of functions. In CAWOA-ELM, the mean value and standard deviation of optimal values are obviously better than those of PSO algorithm. For test functions, GA, BBO algorithm, and CAWOA-ELM algorithm are obviously superior to the PSO algorithm in terms of MV and SD optimal values.The convergence of CAWOA-ELM algorithm is further verified. By iterating through four algorithms, the convergence of the algorithm at different times is verified. The SD value decreases continuously with the increase of iteration times. The algorithm convergence analysis is shown in Figure1.Figure 1
The algorithm convergence analysis (Dim = 30).
(a)(b)(c)(d)The convergence analysis of the overall algorithm shows that CAWOA-ELM algorithm has better convergence than other algorithms in the overall performance. When the number of iterations is 500, the convergence of the CAWOA-ELM model tends to be stable, and the overall fitness value is better than that of other algorithms.


## 4.1. Test Function Selection

In order to test the CAWOA-ELM performance, a comprehensive and reasonable experiment is provided. Simulation experiments (including unimodal function and multimodal function) are carried out on 4 benchmark tests, and the corresponding functions are selected as follows:(22)f1=∑i=1nxi+∏i=1nxiD=30,lb=−10,ub=10,fmin=0,(23)f2=∑i=1n−1100xi+1−xi22+xi+12D=30,lb=−30,ub=30,fmin=0,(24)f3=20exp−0.21n∑i=1nxi2−exp1n∑i=1ncos2πxi+20+eD=30,lb=−32,ub=32,fmin=0,(25)f4=1400∑i=1nxi2−∏i=1ncosxii+1D=30,lb=−600,ub=600,fmin=0,where D is the dimension, ub and lb are the min and max bounds of decision variables, respectively, and fmin represents the global optimal value.Among the above four functions, formulas (22) and (23) are unimodal test functions, and formulas (25) and (26) are bimodal test functions.


## 4.2. Algorithm Parameter Setting

When simulating the algorithm, the population sizeN = 30, the dimension D = 30, and the maximum iteration tmax = 1000. The running environment of the algorithm is “Windows 7 (64-bit),” “CPU E3-1230 with 32 GB,” and “MATLAB 2016b.” For the statistical analysis of the algorithm, each algorithm runs M = 20 times independently for each benchmark test function and counts its results. All function experiment parameter settings are consistent, and the initial population of all algorithms is consistent.In order to accurately analyze the CAWOA-ELM effect, the following five indexes are selected:(26)Best=minbest1,best2,…,bestn,Worst=maxbest1,best2,…,bestn,Mean=1n∑n1besti,STD=1m∑i=1mbesti−Mean2,SR=km∗100%.In the formula,k represents the number of successes in m repeated experiments (i.e., the results calculated by the algorithm in this experiment are better than the set standard).


## 4.3. Algorithm Test Comparison

In order to test the performance of CAWOA-ELM algorithm and the correlation test function to obtain the correlation output value when different input values are used, CAWOA-ELM is compared with whale optimization algorithm (WOA), particle swarm optimization (POS), and biogeography-based optimization (BBO).Table1 displays the simulation value of 4 algorithms on 4 benchmark test functions. The best value (BV), worst value (WV), mean value (MV), standard deviation (SD), and success rate (SR) obtained by running all algorithms for 30 times are given. Table 1 shows that, under the condition of test level α=0.5, taking CAWOA-ELM algorithm as the benchmark, and comparing the other three algorithms, it is found that the proposed algorithm can have high experimental results.Table 1
Simulation results.
FunctionIndicatorsWOAPSOBBOCAWOA-ELMf1BV1.391E − 655.352E −551.127 ×E −451.987E −167WV4.117E −494.961E −395.238 ×E −342.343E −89MV2.106E −559.871E −472.921 ×E −394.782 ×E −107SD9.109E −576.431E −499.302 ×E −411.412 ×E −124SR10%10%16.67%3.33%f2BV3.345E −753.522E −653.342 ×E −420WV5.727E −621.719E −517.231 ×E −310MV8.234E −683.371E −588.823 ×E −350SD6.349E −708.569E −627.467 ×E −360SR13.33%10%13.33%0f3BV8.881E −185.169E −371.122 ×E −317.387E −197WV7.991E −165.387E −273.378 ×E −232.343E −78MV5.442E −179.871E −302.278 ×E −284.78 ×E −116SD2.833E −176.431E −329.976 ×E −291.42 ×E −135SR13.33%13.33%16.67%3.33%f4BV3.764E −237.654E −392.138 ×E −370WV7.761E −178.659E −263.891 ×E −280MV5.581E −209.871E −475.892 ×E −320SD8.874E −216.431E −497.319 ×E −350SR13.33%13.33%10%0The WOA, PSO algorithm, BBO algorithm, and CAWOA-ELM algorithm in Table1 verify the good value and analyze the performance under the above four functions. When the variable dimension is 30, it can be seen from Table 1 that CAWOA-ELM algorithm obtains the optimal value in more aspects of sex.After comparing the data obtained from 30 simulation experiments, the functionsf2 and f4 can be optimized, all of which are 0. However, CAWOA-ELM is better than WOA, PSO, and BBO algorithms in the average and SD of functions. In CAWOA-ELM, the mean value and standard deviation of optimal values are obviously better than those of PSO algorithm. For test functions, GA, BBO algorithm, and CAWOA-ELM algorithm are obviously superior to the PSO algorithm in terms of MV and SD optimal values.The convergence of CAWOA-ELM algorithm is further verified. By iterating through four algorithms, the convergence of the algorithm at different times is verified. The SD value decreases continuously with the increase of iteration times. The algorithm convergence analysis is shown in Figure1.Figure 1
The algorithm convergence analysis (Dim = 30).
(a)(b)(c)(d)The convergence analysis of the overall algorithm shows that CAWOA-ELM algorithm has better convergence than other algorithms in the overall performance. When the number of iterations is 500, the convergence of the CAWOA-ELM model tends to be stable, and the overall fitness value is better than that of other algorithms.


## 5. Water Ecological Environment COD Model Simulation Example

### 5.1. Experimental Data

The water environment quality prediction is the creation of a reliable prediction model through the stored water quality monitoring data. It is well known that water quality monitoring data are obtained through real-time monitoring of national or provincial water quality monitoring stations. pH, conductivity, turbidity, dissolved oxygen (DO), CODKMnO4, ammonia nitrogen, total nitrogen, and total phosphorus are proposed in the environmental protection industry standard “Automatic Analyzer Technology for Water Quality Index” (HJ-T100-2003) issued by the Ministry of Environmental Protection. The total organic carbon (TOC) 9 standards are environmental protection industry standards. The revised announcement includes routine monitoring projects such as pH, ammonia nitrogen, total nitrogen, and total phosphorus. At the same time, chemical oxygen demand (COD), biochemical oxygen demand (BOD), and some heavy metal ions are also the water quality parameters that people hope to monitor. Therefore, combined with the national announcement and actual needs, this paper selects five indicators that indicate water environmental quality provided by water quality monitoring stations, namely, COD, pH, dissolved oxygen, ammonia nitrogen, and total phosphorus. COD refers to the mass concentration of oxygen corresponding to an oxidant consumed by a strong oxidant in a chemical process to oxidize a reducing substance in water. COD is a key indicator for indicating the degree of pollutants in water and an important pollution parameter in the operation and management of wastewater treatment plants.The monitoring data of a water plant monitoring station in a city are taken as the research object. The water plant monitoring station records the data of each parameter in the water body every 6 hours. Due to the reasonable interval between data collection, the recorded data can fully reflect the water quality of the water plant. The data of the water plant monitoring station from January 20 to June 18 are selected in the experiment, and the CAWOA model is trained using the data from January to May 2018. Subsequently, the water quality parameter data of June are input into other trained prediction models for testing, and the expected value is compared with the actual value and analyzed.


### 5.2. CAWOA-ELM Simulation Experiment

The CAWOA is combined with the ELM model to optimize the parameters of the water ecosystem to reduce the COD emission concentration of water pollution. Firstly, the CAWOA is applied to optimize the ELM model parameters, and then the test samples are used to verify the accuracy and generalization ability of the CAWOA-ELM model. Taking the ecological environment of a certain water area as the research object, the data of COD emissions are tested in multiple groups, and various operational parameters such as pH, DO, NH3-N, TP, and COD that affect the water quality characteristics are predicted and selected. 30 groups of data are compared experimentally, 20 groups of samples are selected for training optimization modeling, and the remaining 10 groups are used as test samples to verify the accuracy and generalization ability of the model. The selected 20 sets of training data and the other 10 sets of predicted data are subjected to regression prediction, and the predicted values are as shown in Figure2. In order to verify the superiority of this algorithm in modeling, this algorithm is compared with four models of BBO-ELM, PSO-ELM, WOA-ELM, and standard ELM. The absolute value of the prediction error of each method is shown in Figure 2.Figure 2
COD prediction model and comparison.
(a)(b)As can be seen from Figure2(a), the CAWOA-ELM model can better predict training and test samples, and there are some errors in predicting samples. As can be seen from Figure 2(b), the data in samples 17, 18, and 19 do not participate in the training of the model, and compared with other participating training samples, the error is relatively large, which is in line with the principle of system modeling. It can be further found that the predicted performance of BBO-ELM is comparable to that of PSO-ELM, while the predictive performance of WOA-ELM is poor, especially for the three future samples that are not involved in training. The performance of the ELWO model optimized by CAWOA has been greatly improved compared with the WOA-ELM model.To further describe the superiority of the CAWOA-ELM, the predictive value (PV) and relative error (RE) of training samples 17, 18, and 19 are shown in Table2. From Table 2, we can see that the predicted value of CAWOA-ELM works very well, and the error values are 0.07, 0.11, and 0.21, respectively. The error values of 0.07, 0.11, and 0.21 are the smallest of the five models, especially for WOA-ELM and standard ELM models. It shows that the CAWOA-ELM model has good accuracy and generalization ability. The CAWOA-ELM prediction model provides an effective means for accurate prediction calculation of COD.Table 2
Performance comparison of 4 algorithms.
SampleTrue dataCAWOA-ELMPSO-ELMBBO-ELMWOA-ELMPVERRE (%)PVERRE (%)PVERRE (%)PVERRE (%)11.7661.840.073.962.020.2514.161.850.084.532.050.2815.8621.8952.010.115.802.130.2312.142.110.2111.082.190.2915.3031.5431.750.2113.611.920.3824.631.810.2717.501.810.2717.50


## 5.1. Experimental Data

The water environment quality prediction is the creation of a reliable prediction model through the stored water quality monitoring data. It is well known that water quality monitoring data are obtained through real-time monitoring of national or provincial water quality monitoring stations. pH, conductivity, turbidity, dissolved oxygen (DO), CODKMnO4, ammonia nitrogen, total nitrogen, and total phosphorus are proposed in the environmental protection industry standard “Automatic Analyzer Technology for Water Quality Index” (HJ-T100-2003) issued by the Ministry of Environmental Protection. The total organic carbon (TOC) 9 standards are environmental protection industry standards. The revised announcement includes routine monitoring projects such as pH, ammonia nitrogen, total nitrogen, and total phosphorus. At the same time, chemical oxygen demand (COD), biochemical oxygen demand (BOD), and some heavy metal ions are also the water quality parameters that people hope to monitor. Therefore, combined with the national announcement and actual needs, this paper selects five indicators that indicate water environmental quality provided by water quality monitoring stations, namely, COD, pH, dissolved oxygen, ammonia nitrogen, and total phosphorus. COD refers to the mass concentration of oxygen corresponding to an oxidant consumed by a strong oxidant in a chemical process to oxidize a reducing substance in water. COD is a key indicator for indicating the degree of pollutants in water and an important pollution parameter in the operation and management of wastewater treatment plants.The monitoring data of a water plant monitoring station in a city are taken as the research object. The water plant monitoring station records the data of each parameter in the water body every 6 hours. Due to the reasonable interval between data collection, the recorded data can fully reflect the water quality of the water plant. The data of the water plant monitoring station from January 20 to June 18 are selected in the experiment, and the CAWOA model is trained using the data from January to May 2018. Subsequently, the water quality parameter data of June are input into other trained prediction models for testing, and the expected value is compared with the actual value and analyzed.


## 5.2. CAWOA-ELM Simulation Experiment

The CAWOA is combined with the ELM model to optimize the parameters of the water ecosystem to reduce the COD emission concentration of water pollution. Firstly, the CAWOA is applied to optimize the ELM model parameters, and then the test samples are used to verify the accuracy and generalization ability of the CAWOA-ELM model. Taking the ecological environment of a certain water area as the research object, the data of COD emissions are tested in multiple groups, and various operational parameters such as pH, DO, NH3-N, TP, and COD that affect the water quality characteristics are predicted and selected. 30 groups of data are compared experimentally, 20 groups of samples are selected for training optimization modeling, and the remaining 10 groups are used as test samples to verify the accuracy and generalization ability of the model. The selected 20 sets of training data and the other 10 sets of predicted data are subjected to regression prediction, and the predicted values are as shown in Figure2. In order to verify the superiority of this algorithm in modeling, this algorithm is compared with four models of BBO-ELM, PSO-ELM, WOA-ELM, and standard ELM. The absolute value of the prediction error of each method is shown in Figure 2.Figure 2
COD prediction model and comparison.
(a)(b)As can be seen from Figure2(a), the CAWOA-ELM model can better predict training and test samples, and there are some errors in predicting samples. As can be seen from Figure 2(b), the data in samples 17, 18, and 19 do not participate in the training of the model, and compared with other participating training samples, the error is relatively large, which is in line with the principle of system modeling. It can be further found that the predicted performance of BBO-ELM is comparable to that of PSO-ELM, while the predictive performance of WOA-ELM is poor, especially for the three future samples that are not involved in training. The performance of the ELWO model optimized by CAWOA has been greatly improved compared with the WOA-ELM model.To further describe the superiority of the CAWOA-ELM, the predictive value (PV) and relative error (RE) of training samples 17, 18, and 19 are shown in Table2. From Table 2, we can see that the predicted value of CAWOA-ELM works very well, and the error values are 0.07, 0.11, and 0.21, respectively. The error values of 0.07, 0.11, and 0.21 are the smallest of the five models, especially for WOA-ELM and standard ELM models. It shows that the CAWOA-ELM model has good accuracy and generalization ability. The CAWOA-ELM prediction model provides an effective means for accurate prediction calculation of COD.Table 2
Performance comparison of 4 algorithms.
SampleTrue dataCAWOA-ELMPSO-ELMBBO-ELMWOA-ELMPVERRE (%)PVERRE (%)PVERRE (%)PVERRE (%)11.7661.840.073.962.020.2514.161.850.084.532.050.2815.8621.8952.010.115.802.130.2312.142.110.2111.082.190.2915.3031.5431.750.2113.611.920.3824.631.810.2717.501.810.2717.50


## 6. Conclusion

Water ecological environment discharge has multidimensional characteristics, many factors lead to the prediction effect, and the multidimensional characteristic relationship is relatively complex, which makes the prediction difficult. It can effectively predict the COD value of water ecological discharge. A combined prediction model based on the CAWOA-ELM algorithm is proposed. In order to test the advantages of the algorithm, CAWOA-ELM algorithm is compared with WOA, PSO, and BBO algorithms. The convergence proves that the CAWOA-ELM algorithm has faster convergence effect. A CAWOA-ELM model for predicting COD is set up, in which 30% of the samples are used as test samples and 70% as training sets. The model is used to train and test datasets. The COD values detected by the CAWOA-ELM model have good accuracy, and the differences between the other models can be used as an application model for predicting COD values.



---

*Source: 6611777-2021-03-19.xml*