Research of BP Neural Network Based on GA-WOA Algorithm Optimization in MBR Membrane Pollution Simulation

: For the membrane fouling problem faced by the MBR (Membrane Bio-Reactor) system, an intelligent model is constructed to predict the membrane fouling. The BP neural network has strong self-learning, self-adaptive and generalization capabilities and is widely used in the prediction of MBR membrane pollution, but membrane fouling is a complex dynamic process, which is difficult to simulate accurately by classical mathematical models. Aiming at this problem, the GA-WOA hybrid algorithm was introduced to optimize the BP neural network, and the MBR membrane fouling prediction model was constructed. The simulation results show that the BP neural network model optimized by GA-WOA hybrid algorithm is more suitable and accurate than that optimized by whale optimization algorithm in predicting MBR membrane fouling.


Introduction
With the increase of urban population and social economic development, the social problem of water scarcity has become increasingly prominent. Based on the traditional biological treatment system, combined with membrane separation technology, membrane bio-reactor has the advantages of small floor area and good effluent quality [1]. The MBR system is also widely used in daily sewage treatment process and the sewage industrial production and treatment process.
The MBR system is mainly composed of membrane biological system and membrane modules [2]. When the MBR system is running, the wastewater flows to each membrane module, and the membrane modules will filter out macro molecular particles to achieve the purpose of filtering sewage [3]. But in this process, membrane fouling causes membrane filtration. Due to the serious attenuation of membrane flux, the main obstacle to the application of membrane bio-reactor is membrane pollution, which seriously affects the sewage treatment efficiency of membrane bio-reactor system [4]. The BP neural network is used as the main body of the algorithm, and genetic and whale optimization algorithms are introduced to optimize the initial weights and thresholds of BP neural network [5]. The results show that the training efficiency and accuracy of the model are significantly improved.

Genetic algorithm
The Genetic Algorithm (GA) is a computational model of the biological evolution process imitating the natural selection theory and genetic principles in Darwin's theory of biological evolution. The algorithm has excellent global optimization ability and adaptive search direction selection ability, and finds the way to ask the optimal prediction solution by imitating the natural evolution process.
The basic operation process is: (1) Using random methods or other methods to generate an initial population; (2) Construct the fitness function according to the objective function of the problem. The fitness function is used to characterize the adaptability of each individual of the population to its living environment; (3) According to the fitness value, it continuously selects and reproduces, and genes are updated through crossover and mutation; (4) The individual with the best fitness value after several generations is the optimal solution.
The algorithm flow is shown in Figure 1.

Optimization algorithm
Whale Optimization Algorithm (WOA) is proposed based on the behavior of whales to hunt prey. During the hunting period, whales use mutual cooperation to drive and round up their prey. The whale optimization algorithm divides the algorithm into three stages: the surrounding predation stage, the spiral renewal stage, and the hunting stage. The algorithm has the advantages of less adjustment parameters and simple operation [6].

Surrounding predation stage
During the search for prey, whales constantly approach the next prey through continuous communication of the whole group and then try to approach the closer prey by random selection. The mathematical model surrounding the predation stage is: We measure the size of the fish population as N, ddimension is the search space, Xi=(x i 1 , x i 2 , …, x i d ), i-1, 2,…, N , is the position of the whale in d-dimension space, and the global optimal solution to the problem is the position of the corresponding prey. Where, t is the current number of iterations; X(t) is ta single position vector; X p (t) is the position vector of prey (current optimal solution); A and D are coefficient vectors respectively, and: Where r 1 and r 2 are random numbers of [0,1] respectively; a is the control parameter, which decreases linearly from 2 to 0 with the increase of iteration times, that is:

Spiral renewal stage
At this stage, the whale uses a spiral approach to approach the prey, in order to achieve the purpose of capturing the prey. Before the individual whale approaches the prey in a spiral manner, it first estimates the distance to the prey. The mathematical model is: b is the constant that specifies the shape of the logarithmic helix; 1 is a random number of [-1, 1].
Among them, p is used to determine the probability of which position update method the whale individual performs. The purpose is to realize the synchronization of contraction enclosure and spiral update. Its model is as follows: X(t+1)=D·e bl ·cos(2πl)+X p (t)(p≥0.5) (8)

Hunting stage
Whales use the value of |A| to control whether to hunt for prey or surround prey. The model is as follows: D=|C·X rand (t)-X(t)| (9) X(t+1)=X rand (t)-A·D (10)

GA-WOA hybrid algorithm to optimize BP neural network
As a feed-forward neural network, BP neural network is mainly characterized by forward transmission of signals while reverse transmission of error information. BP neural network has the ability of self-learning and generalization, so it is widely used, but it also has disadvantages such as slow self-learning speed and high possibility of training failure.
The basic idea of GA-WOA hybrid algorithm to optimize the BP neural network is to optimize the initial weights and thresholds of the BP neural network through the GA and the WOA, thereby reducing the training error, improve the training rate and accuracy, and finally improve the network detection rate and network recognition rate, so as to achieve the ultimate goal of optimizing the network [7].
The process is: (1) The neural BP network is initialized to determine the input-output structure, initial connection weight and threshold of the network; (2) Initialize the GA-WOA hybrid algorithm and encode the initial value of GA according to the initial value and threshold; (3) Taking the training error of the neural BP network as fitness value, selection and other operations are performed until the conditions are met; (4) Obtain the optimal weights and thresholds; (5) Calculate the error update weight and threshold; (6) Output the error result. The algorithm flow chart is shown in Figure 2.

Simulation experiment results and analysis
This experiment selects the actual MBR system operating data of Shijiazhuang sewage treatment plant. The filtration membrane is a polyvinylidene fluoride micro filtration membrane with a pore size of 0.2μm. 35 sets of experimental data are used as training samples, and 12 sets of experimental data are used as verification samples. The comparison line between the prediction result of the model and the real value is shown in Figure 3. The comparison of the two models from the broken line diagram shows that the change trend and accuracy of the BP neural networks model optimized by the GA-WOA hybrid algorithm are significantly better than those of BP neural networks optimized by the WOA.  Figure 4 shows the prediction error of WOA-BP neural network model and GA-WOA hybrid algorithm to optimize BP neural network model. Comparing the prediction errors of the two groups of models, it can be seen that the neural network model optimized by GA-WOA hybrid algorithm and the prediction data accuracy are more than 0.95. The broken line diagram shows that the model has high accuracy and achieves the expected goal of accurately predicting membrane flow.
As shown in Figure 5, the adaptive convergence curve results of WOA and GA-WOA hybrid algorithm. Compared with WOA, GA-WOA hybrid algorithm can be the optimal solution with the least number of iterations. Compared with GA-WOA hybrid algorithm, WOA has higher convergence speed, but it has the defect of exiting the local optimal resolution. The results show that GA-WOA hybrid algorithm is more suitable for thin film flow prediction. The experimental results show that the BP neural network model, optimized by the GA-WOA hybrid algorithm, is significantly improved in terms of predictive value and error value compared to the original method.

Conclusion
MBR treatment of sewage is a complex dynamic process with multi-process, time-varying, uncertain and other characteristics, and it is difficult to model directly with mathematical models. The genetic algorithm and the whale algorithm have the advantages of stronger search ability and the ability to jump out of the local optimal solution. Therefore, this paper proposes to use the GA-WOA hybrid algorithm to optimize the BP neural network, and builds a membrane fouling prediction model. The network has a positive effect on improving the accuracy and fitness, and is obviously effective for model optimization. The research of this work has a certain theoretical value and practical significance and provides a certain basis for the related research in the field of membrane fouling in the MBR in the future.