# Real-Coded Quantum-Inspired Genetic Algorithm-Based BP Neural Network Algorithm

Authors: Jianyong Liu; Huaixiao Wang; Yangyang Sun; Chengqun Fu; Jie Guo
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

The method that the real-coded quantum-inspired genetic algorithm (RQGA) used to optimize the weights and threshold of BP neural network is proposed to overcome the defect that the gradient descent method makes the algorithm easily fall into local optimal value in the learning process. Quantum genetic algorithm (QGA) is with good directional global optimization ability, but the conventional QGA is based on binary coding; the speed of calculation is reduced by the coding and decoding processes. So, RQGA is introduced to explore the search space, and the improved varied learning rate is adopted to train the BP neural network. Simulation test shows that the proposed algorithm is effective to rapidly converge to the solution conformed to constraint conditions.


---

## Body

## 1. Introduction

Artificial neural networks (ANNs) are put forward to solve the nonlinear problem by simulating the operational process of nervous system. ANNs are powerful tools for prediction of nonlinearities [1] and with excellent nonlinear mapping ability, generalization, self-organization, and self-learning. ANNs have been widely applied in engineering and are steadily advancing into new areas [2].The “feed-forward, back propagation” neural network (BPNN) is currently the most popular network architecture in use [3]. BPNN can be applied in a variety of fields according to the characteristics of the model. Sun et al. establish a prediction model based on improved BP neural network and adopt it to investigate quantitative evolution laws of equiaxed α in near-β forging of TA15 Ti-alloy [4]. Xiao et al. propose an approach of back propagation neural network with rough set for complicated short-term load forecasting with dynamic and nonlinear factors to develop the accuracy of predictions [5]. Wang et al. apply improved variable learning rate back propagation (IVL-BP) to short-term power load forecasting [6]. Yu et al. propose a dynamic all parameters adaptive BP neural networks model through fusion of genetic algorithm, simulated annealing algorithm, and the BP neural network and apply it to oil reservoir prediction [2].Although system based on BPNN is with good performance, the BPNN lacks stability in some cases. The main faults of BPNN include the following. (1) Fixed learning rate leads to the slow convergence speed of network and long training time. (2) The gradient descent algorithm used to optimize the objective function in BPNN makes the computation overflow or swing between optimal values and does not make it converge to global optimal value [7]. (3) Structure and scale have much influence on the performance of BPNN. Different nodes in hidden layer and conversion functions acting on the same data will cause different results. (4) The convergence of BPNN is influenced by the choice of initial weights. Improper selection of the initial set of weights will make the algorithm trapped in local optimal solution. (5) The adjustment of weight and threshold values follows certain rule. It is impossible to adaptively adjust the structure in a fixed layout. (6) The learning algorithm of BPNN is based on back propagation of error, which leads to the slow learning convergence and easily falls into local minimum.To overcome the abovementioned problems, many scholars have put forward some improved algorithm. Although the disadvantages are not ultimately overcome, the study level of BPNN is gradually increased. Different methods can be classified as follows.(1) The Optimization of Network Structure. Experiential or statistical method is applied to determine the structure of BPNN, which is the optimal combination of the number of hidden layers, the number of hidden neurons, the choice of input factors, and parameters of the training algorithm [8]. The most systematic and general method is to utilize the principle of design experiment of Taguchi [9]. Use grey correlation analysis to determine the number of hidden nodes of the optimal network to improve the performance of the network [10]. Apply the network growth/removal algorithm to add/remove neurons from the initial structure according to the predetermined standard to represent the effect of changes on the performance of the ANNs. The basic rule is to increase neurons when the training process is slow or the mean square deviation is greater than the specified value. Decrease the number of neurons when the change of the number of neurons cannot change the response of the network accordingly or neuron weights remain unchanged for a long time. Growth/removal algorithm is the basic gradient descent method which cannot guarantee convergence to the global minimum; therefore, the algorithm may fall into local optimal solution near to the initial point. The structure can be changed by the application of genetic operators and evaluation of object function [11].(2) The Improved Training Method of BPNN. Some new methods can be introduced to train the neural network; for example, the Online Gradient Method with changing scale can be used to train BPNN to achieve better convergence [12]. The real-coded chaotic quantum genetic algorithm is applied for training the fuzzy neural network to accelerate the convergence speed [13]. The transfer function, parameter, the accuracy of the assessment, and gradient descent coefficient can be improved properly in the process of training.(3) The Combination of BPNN with Other Optimization Algorithms to Optimize the Weights and Thresholds. Zhuo et al. propose a simulated annealing- (SA-) genetic algorithm-BPNN-based color correction algorithm for traditional Chinese medicine tongue images [14]. Liu et al. apply GA-BP to predict bitterness intensity [15]. The GA-BP is compared with multiple linear regression, partial derivative least square regression, and BP method to prove the superiority of BP-GA model. Wang et al. improve BPNN by introducing cuckoo search algorithm to forecast lightning occurrence from sounding-derived indices over Nanjing [16].Through the analysis, we can see that most optimization methods of the weights and thresholds of BPNN are based on the combination with GA or SA [14] or the combination of the three kinds of algorithms. There are some major disadvantages of GA and SA. When solving some complex optimization problems, the convergence speed of GA is slow, the convergence may be premature stagnation, and the numbers of species and individuals are large. SA utilizes the principle of crystallization process to minimum energy of metal to search for the minimum in general system. SA is first proposed in the literature of Kirkpatrick to be used to find the balanced combination of atoms set at a given temperature [17]. Compared with other methods, the main advantage of the SA is the ability to avoid falling into local optimal value. SA is a random search algorithm, and better values and worse values can be obtained at a certain probability. However, the calculation amount of SA is large, especially for complex problems.RQGA is a global optimization algorithm which can find the global optimal solution in the complex, multiple-extreme, and nondifferentiable vector space when the number of parameters is small. RQGA is with fast convergence speed and strong optimization ability and does not easily converge to the local optimal solution. Introducing RQGA to optimize the weights and thresholds of BPNN can guarantee getting better solution with higher probability.


## 2. BP Neural Network

BPNN is a kind of multilayer feed-forward network according to training of the error back propagation algorithm proposed by Rumelhart and McCelland in 1986. The mean of “back propagation” is that the adjustment way of the weights of network is back propagation of error. As a result of the simple structure of BPNN, many adjustable parameters, and good maneuverability, the BPNN is one of the most widely used artificial neural network algorithms.BPNN is a kind of typical forward network [18]. The training function is used reversely to change weights and thresholds through the positive transfer method of network structure. The samples to be measured are handled by the training model after training structure model of sample is established. The following formula is operating formula of BP where x is the input matrix, w is the weight matrix, and b is the threshold matrix:
(1)fx=wT·x+b.The specific process of BPNN is as shown in Figure1.Figure 1
Flowchart of training of BPNN.(1) Initialization: determine weightswij, vjt and thresholds θj, γt randomly.(2) Select a group of input and output dataPk=(a1k,a2k,…,ank), Tk=(s1k,s2k,…,spk). Calculate the input of hidden layer sj with the input sample Pk=(a1k,a2k,…,ank), weight value wij, and threshold θj. Then, calculate the output of hidden layer bj with the translation function sj, where sj=∑i=1nwijai-θj, j=1,2,…,p, bj=f(sj), j=1,2,…,p. Calculate the output of the output layer Lt with bj, vjt, and γt. Then calculate the response output of output layer with Lt by the translation function. Consider Lt=∑j=1pvjtbj-γt, t=1,2,…,q, and Ct=f(Lt), t=1,2,…,q.(3) Calculate the total error of every output neurondtk with the objective matrix of network Tk=(y1k,y2k,…,yqk) and corresponding response output Ct. Consider dtk=(ytk-Ct)Ct(1-Ct), t=1,2,…,q. Then calculate the total error ejk with vjt, dt, and bj. Consider ejk=∑t=1qdtvjtbj(1-bj).(4) If the error in (3) is smaller than the default error, end the training process; if not, correctvjt and γt with dtk and bj and correct wij and θj with ejk and Pk=(a1,a2,…,an) at the same time.(5) Select another group of input and output data randomly from the sample and return to step (2). Continue this process until the end condition is satisfied.The learning rate of the conventional BP network is invariable. If the learning rate is too small, though the convergence can be guaranteed, the learning speed is slow; if the learning rate is large, it is easy to cause large fluctuation or deviation from the optimal solution. So the learning rate needs to be adjusted in the process of training.The basic idea of variable learning rate is that if the average variance increases and exceeds the preset value after weights update, decrease the learning rate; if the average variance is less than the preset value, the learning rate stays unchanged; if the average variance is reduced, increase the learning rate.


## 3. Real-Coded Quantum-Inspired Genetic Algorithm

Conventional QGA is based on binary coding and can be used to solve the problem of combinatorial optimization well, such as the traveling salesman problem [19], knapsack problem [20, 21], and the filter design [22]. Using binary numbers to represent the parameters forces a trade-off between accuracy of representation and string lengths. RQGA is better in optimizing the real-valued problems with multiple-extremum. Optimization of weights and thresholds of BPNN is a typical optimization problem of real number. When the real number problem needs to be optimized, real encoding is considered better than binary and gray coding in solving the multiparameter optimization problem [23, 24]. RQGA has the inherent advantage of QGA. The search performance and quantum operators make RQGA have the characteristics of effectiveness, flexibility, robustness, and so on. The RQGA can solve the problem with real parameters well, so the RQGA is applied to optimize the BPNN.


### 3.1. Coding Method of RQGA

Initial chromosome includes string of real value and string of quantum bit value and is expressed as(2)P1tP2t⋯PNpt,where,Pit=xi1txi2t⋯xiNgtθi1tθi2t⋯θiNgt,i=1,…,Np,xijt  (j=1,…,Ng) is the value of real number coding, and θijt  (j=1,…,Ng) denotes phase angle of quantum bit. So each chromosome contains information of real number space and phase space at the same time.The characteristics of RQGA are as follows. (1) Quantum bit coding makes population obtain better diversity to reduce the calculation. (2) RQGA utilizes special quantum evolutionary operators to generate candidate solutions containing real parameters, which is different with the candidate solutions generated by quantum observation in QGA. (3) RQGA applies quantum rotation gate to realize the evolution of quantum bit, which is the same with QGA. (4) Migration of different quantum bits realizes the migration of population of different solution, so the convergence degree and the quality of the solution are improved.The following method is utilized to generate real number candidate solution strings. There is a group ofNp quantum bit strings, Qit(i=1,2,…,Np), which is the ith quantum bit string in the tth generation. Correspondingly, there is the other group of Np strings, Pit(i=1,2,…,Np); each string contains Ng real number. There are Ng quantum bits in each Qi representing the probability amplitude of αi. The probability to generate the real number which is larger (smaller) than present number is determined by αi2 (βi2). All the probabilities are equal at the beginning of search; αi and βi are initialized to 0.707. Every element of Pi  (i=1,2,…,Np) is initialized to a random number in the allowable range. Each pair of Qi and Pi constitutes the ith family in the tth generation.N
c solution strings pijt(j=1,2,…,Nc) of the ith family are generated by Qit, Pit, and Pbestt (the best solution found present). Fitness pijt is calculated under the constraint condition. The process to generate Pbestt is shown in Figure 2.Figure 2
Diagrammatic sketch of generating newPbest.


### 3.2. Evolutionary Method of RQGA

Two kinds of neighbor operators are adopted to generate new strings.Nc neighbor solution strings are generated by Neighbor Operator 1 (NO1) and Neighbor Operator 2 (NO2) where the ith family is determined by the best neighbor solution Cit. If Cit is better than Pit, Cit replaces Pit to be Pit+1. If the optimal value of Pit+1 is better than Pbestt, Pbestt is replaced by the optimal value of Pit+1 to be Pbestt+1.The basic principle of the two operators is as follows: NO1 has better search performance to generate solution strings which are very different from the given string. NO2 has better exploitation performance to makePj converge to Pbestj in the process of algorithm. So, this algorithm can keep a balance between exploration and exploitation. The evolution of quantum bit represents the evolution of the superposition state, and change of α2 and β2 is translated to the change of real number generated by the two neighbor operators. The role of the two neighbor operators is that NO1 is used to search the solution space and NO2 is used to converge to extreme value.Neighbor Operator 1: in thetth generation, there are Np quantum bit strings Qi; there are Ng elements in each quantum bit. NO1 generates solution string pijt(j=1,2,…,Nc); there are Ng elements in each string.Generate an arrayRij with Ng elements; the value of elements of Rij is +1 or −1 randomly. ρijk is the kth element of Rij; then
(3)θijkt=θijkt-1+ρijkδ,
where δ is the variety of angle, θijkt is the rotation angle, and θijkt=arctan(βijk/αijk). If ρijk=-1, δ is a random number in the range 0,π/2+θijkt-1; if ρijk=+1, δ is a random number in the range 0,π/2-θijkt-1.The new formula of probability amplitude isαijktβijkt=cos⁡δsinδ-sinδcos⁡δαijkt-1βijkt-1.The formula of individual elements is(4)Pijkt=αijkt2Pkmax⁡-Pkmin⁡+Pkmin⁡,
where Pkmax⁡ and Pkmin⁡ are the maximum and minimum values in the allowable range. The flowchart of using NO1 to calculate the kth element of the jth individual of the ith population in the tth generation is shown in Figure 3.Figure 3
Flowchart of using NO1 to calculate elements of individual.Neighbor Operator 2: most of the mechanism of NO2 is the same with NO1. In addition, the value point generated by NO2 is betweenPb and Pbest, and the generated point is used for exploring the search space. Formula (4) is applied to calculate Pijkt in NO2 where Pkmax⁡=max⁡(Pbestik,Cit), Pkmin⁡=min⁡(Pbestik,Cit), and Cit is the best individual of the ith family in the tth generation.NO1 is better in exploration; NO2 is better in exploitation. Exploration is important in the early evolution; exploitation is important in the late evolution. So NO1 is carried out with a greater frequency in the early evolution, and NO2 is carried out with a greater frequency in the late evolution. The specific frequency is defined by formula (9). Consider
(5)FNO1=(90-80t/T)100,FNO2=(10+80t/T)100,
where FNO1 is the use frequency of NO1, FNO2 is the use frequency of NO2, t is the current evolutionary generation, and T is the total evolutionary generation of every circle.


### 3.3. Update of Quantum Bit String

The individual states of all quantum bits inQ are changing during the process of update so that the probability of the generated solution similar to the current optimal solution increases gradually. The change of probability is determined by the learning rate Δθ. The value of Δθ under different conditions is shown in Table 1.Table 1
The method to determine the value ofΔθ in the tth generation.
Fitness
Element value
Δ
θ
X
C
i
j
=
P
BEST
j
0
F
(
P
)
>
F
(
P
BEST
)
C
i
j
>
P
BEST
j
θ
t
C
i
j
<
P
BEST
j
-
θ
t
F
(
P
)
<
F
(
P
BEST
)
C
i
j
>
P
BEST
j
-
θ
t
C
i
j
<
P
BEST
j
θ
t
F
(
P
)
=
F
(
P
BEST
)
C
i
j
>
P
BEST
j
0
C
i
j
<
P
BEST
j
0
θ
t is the size of the rotation angle in the tth generation, θt=θmax⁡⋅exp⁡(-t/T), θmax⁡ is the maximal rotation angle, T is the total evolutionary generation, and t is the current evolutionary generation. This method to determine θt is helpful to the search in early stage and convergence precision in late stage.Δ
θ determines the speed of the quantum bit changing from 0.707 to the final value of 0 or 1. Δθ needs to be small enough to ensure that the number of generation that  α changes from 0.707 to 0 (or 1) is large enough. So, the probability to generate the solution similar to the current best solution is larger when most of the quantum bits converge to 0 or 1.Two kinds of migration (global and local) take effect together.Pt is selected randomly to update some Qit in local migration; Pbest is used to update Qit in the global migration. It also needs to consider the particularity of the application object when RQGA is applied to specific problem. The flowchart of RQGA is shown in Figure 4.Figure 4
Flowchart of RQGA.RQGA is with good global search ability. RQGA is usually not restricted by the constraint conditions such as the property of the problem and the structure of the model of the problem and can converge to global optimal solution with a larger probability. Robustness of RQGA makes it capable of being combined with BP algorithm to improve the generalization ability and learning ability of neural network. And the encoding manner based on real number avoids encoding and decoding in binary encoding manner to improve the computational efficiency.


## 3.1. Coding Method of RQGA

Initial chromosome includes string of real value and string of quantum bit value and is expressed as(2)P1tP2t⋯PNpt,where,Pit=xi1txi2t⋯xiNgtθi1tθi2t⋯θiNgt,i=1,…,Np,xijt  (j=1,…,Ng) is the value of real number coding, and θijt  (j=1,…,Ng) denotes phase angle of quantum bit. So each chromosome contains information of real number space and phase space at the same time.The characteristics of RQGA are as follows. (1) Quantum bit coding makes population obtain better diversity to reduce the calculation. (2) RQGA utilizes special quantum evolutionary operators to generate candidate solutions containing real parameters, which is different with the candidate solutions generated by quantum observation in QGA. (3) RQGA applies quantum rotation gate to realize the evolution of quantum bit, which is the same with QGA. (4) Migration of different quantum bits realizes the migration of population of different solution, so the convergence degree and the quality of the solution are improved.The following method is utilized to generate real number candidate solution strings. There is a group ofNp quantum bit strings, Qit(i=1,2,…,Np), which is the ith quantum bit string in the tth generation. Correspondingly, there is the other group of Np strings, Pit(i=1,2,…,Np); each string contains Ng real number. There are Ng quantum bits in each Qi representing the probability amplitude of αi. The probability to generate the real number which is larger (smaller) than present number is determined by αi2 (βi2). All the probabilities are equal at the beginning of search; αi and βi are initialized to 0.707. Every element of Pi  (i=1,2,…,Np) is initialized to a random number in the allowable range. Each pair of Qi and Pi constitutes the ith family in the tth generation.N
c solution strings pijt(j=1,2,…,Nc) of the ith family are generated by Qit, Pit, and Pbestt (the best solution found present). Fitness pijt is calculated under the constraint condition. The process to generate Pbestt is shown in Figure 2.Figure 2
Diagrammatic sketch of generating newPbest.


## 3.2. Evolutionary Method of RQGA

Two kinds of neighbor operators are adopted to generate new strings.Nc neighbor solution strings are generated by Neighbor Operator 1 (NO1) and Neighbor Operator 2 (NO2) where the ith family is determined by the best neighbor solution Cit. If Cit is better than Pit, Cit replaces Pit to be Pit+1. If the optimal value of Pit+1 is better than Pbestt, Pbestt is replaced by the optimal value of Pit+1 to be Pbestt+1.The basic principle of the two operators is as follows: NO1 has better search performance to generate solution strings which are very different from the given string. NO2 has better exploitation performance to makePj converge to Pbestj in the process of algorithm. So, this algorithm can keep a balance between exploration and exploitation. The evolution of quantum bit represents the evolution of the superposition state, and change of α2 and β2 is translated to the change of real number generated by the two neighbor operators. The role of the two neighbor operators is that NO1 is used to search the solution space and NO2 is used to converge to extreme value.Neighbor Operator 1: in thetth generation, there are Np quantum bit strings Qi; there are Ng elements in each quantum bit. NO1 generates solution string pijt(j=1,2,…,Nc); there are Ng elements in each string.Generate an arrayRij with Ng elements; the value of elements of Rij is +1 or −1 randomly. ρijk is the kth element of Rij; then
(3)θijkt=θijkt-1+ρijkδ,
where δ is the variety of angle, θijkt is the rotation angle, and θijkt=arctan(βijk/αijk). If ρijk=-1, δ is a random number in the range 0,π/2+θijkt-1; if ρijk=+1, δ is a random number in the range 0,π/2-θijkt-1.The new formula of probability amplitude isαijktβijkt=cos⁡δsinδ-sinδcos⁡δαijkt-1βijkt-1.The formula of individual elements is(4)Pijkt=αijkt2Pkmax⁡-Pkmin⁡+Pkmin⁡,
where Pkmax⁡ and Pkmin⁡ are the maximum and minimum values in the allowable range. The flowchart of using NO1 to calculate the kth element of the jth individual of the ith population in the tth generation is shown in Figure 3.Figure 3
Flowchart of using NO1 to calculate elements of individual.Neighbor Operator 2: most of the mechanism of NO2 is the same with NO1. In addition, the value point generated by NO2 is betweenPb and Pbest, and the generated point is used for exploring the search space. Formula (4) is applied to calculate Pijkt in NO2 where Pkmax⁡=max⁡(Pbestik,Cit), Pkmin⁡=min⁡(Pbestik,Cit), and Cit is the best individual of the ith family in the tth generation.NO1 is better in exploration; NO2 is better in exploitation. Exploration is important in the early evolution; exploitation is important in the late evolution. So NO1 is carried out with a greater frequency in the early evolution, and NO2 is carried out with a greater frequency in the late evolution. The specific frequency is defined by formula (9). Consider
(5)FNO1=(90-80t/T)100,FNO2=(10+80t/T)100,
where FNO1 is the use frequency of NO1, FNO2 is the use frequency of NO2, t is the current evolutionary generation, and T is the total evolutionary generation of every circle.


## 3.3. Update of Quantum Bit String

The individual states of all quantum bits inQ are changing during the process of update so that the probability of the generated solution similar to the current optimal solution increases gradually. The change of probability is determined by the learning rate Δθ. The value of Δθ under different conditions is shown in Table 1.Table 1
The method to determine the value ofΔθ in the tth generation.
Fitness
Element value
Δ
θ
X
C
i
j
=
P
BEST
j
0
F
(
P
)
>
F
(
P
BEST
)
C
i
j
>
P
BEST
j
θ
t
C
i
j
<
P
BEST
j
-
θ
t
F
(
P
)
<
F
(
P
BEST
)
C
i
j
>
P
BEST
j
-
θ
t
C
i
j
<
P
BEST
j
θ
t
F
(
P
)
=
F
(
P
BEST
)
C
i
j
>
P
BEST
j
0
C
i
j
<
P
BEST
j
0
θ
t is the size of the rotation angle in the tth generation, θt=θmax⁡⋅exp⁡(-t/T), θmax⁡ is the maximal rotation angle, T is the total evolutionary generation, and t is the current evolutionary generation. This method to determine θt is helpful to the search in early stage and convergence precision in late stage.Δ
θ determines the speed of the quantum bit changing from 0.707 to the final value of 0 or 1. Δθ needs to be small enough to ensure that the number of generation that  α changes from 0.707 to 0 (or 1) is large enough. So, the probability to generate the solution similar to the current best solution is larger when most of the quantum bits converge to 0 or 1.Two kinds of migration (global and local) take effect together.Pt is selected randomly to update some Qit in local migration; Pbest is used to update Qit in the global migration. It also needs to consider the particularity of the application object when RQGA is applied to specific problem. The flowchart of RQGA is shown in Figure 4.Figure 4
Flowchart of RQGA.RQGA is with good global search ability. RQGA is usually not restricted by the constraint conditions such as the property of the problem and the structure of the model of the problem and can converge to global optimal solution with a larger probability. Robustness of RQGA makes it capable of being combined with BP algorithm to improve the generalization ability and learning ability of neural network. And the encoding manner based on real number avoids encoding and decoding in binary encoding manner to improve the computational efficiency.


## 4. The BPNN Based on RQGA

The convergence speed of BPNN is slow, so the RQGA is introduced to optimize the parameters of network, speed up the convergence, and obtain the global optimal solution. RQGA is a global search process, which searches from one population to another. The parameter space is sampled unceasingly and the direction of the search is toward the area of the current optimal solution. The BPNN based on RQGA (RQGA-BP) combines advantages of RQGA and BPNN. RQGA is applied to optimize the weights and thresholds of input layer and hidden layer to avoid BP algorithm trapped in local minima.The process of RQGA optimizing BPNN is divided into three parts: structure determination of BPNN, RQGA optimization, and BPNN optimization. Structure determination of BPNN needs to specify the number of parameters of input and output. RQGA optimization optimizes the weights and thresholds of BPNN. Each individual of the population contains all the weights and thresholds of network. Flowchart of RQGA-BP is shown in Figure5.Figure 5
Flowchart of BPNN optimized by RQGA.The specific steps of RQGA-BP are as follows. (1) Code parameters. Set the weights and thresholds as genes. Each weight and threshold is expressed by a real number. So the evolution is based on some weights and thresholds. (2) Generate initial population. The range of gene is (−0.5, 0.5) because the weights are small in good network. (3) Calculate fitness. The goal of BPNN is to make the residual error between forecast value and expected value as small as possible, so the norm of error matrix between expected value and forecast value is set to be the output of the objective function. Adopt sort of fitness assignment function with the manner of linear ranking and differential pressure 2 to estimate the fitness. (4) Evolve the population with RQGA and calculate the fitness of new individual. (5) The gene of best individual is the optimal solution of the weights and thresholds and is used to predict neural network.


## 5. Case Analysis

Two cases are used to justify the performance of RQGA-BP.


### 5.1. Case One

Apply RQGA-BP to fault detection for parts of machinery. Due to invisibility of the fault of mechanical parts, the possible states can be concluded by measuring the related characteristic parameters. Select 15 characteristic parameters of parts and normalize the data. The training sample data and the test sample data are shown in Tables2 and 3, respectively.Table 2
The training sample data.
Sample order
Characteristic value of sample
State
1
0.2286, 0.1292, 0.072, 0.1592, 0.1335, 0.0733, 0.1159, 0.094, 0.0522, 0.1345, 0.009, 0.126, 0.3619, 0.069, 0.1828
Normal
2
0.209, 0.0947, 0.1393, 0.1387, 0.2558, 0.09, 0.0771, 0.0882, 0.0393, 0.143, 0.0126, 0.167, 0.245, 0.0508, 0.1328
Normal
3
0.0442, 0.088, 0.1147, 0.0563, 0.3347, 0.115, 0.1453, 0.0429, 0.1818, 0.0378, 0.0092, 0.2251, 0.1516, 0.0858, 0.067
Normal
4
0.2603, 0.1715, 0.0702, 0.2711, 0.1491, 0.133, 0.0968, 0.1911, 0.2545, 0.0871, 0.006, 0.1793, 0.1002, 0.0789, 0.0909
Crack
5
0.369, 0.2222, 0.0562, 0.5157, 0.1872, 0.1614, 0.1425, 0.1506, 0.131, 0.05, 0.0078, 0.0348, 0.0451, 0.0707, 0.088
Crack
6
0.0359, 0.1149, 0.123, 0.546, 0.1977, 0.1248, 0.0624, 0.0832, 0.164, 0.1002, 0.0059, 0.1503, 0.1837, 0.1295, 0.07
Crack
7
0.1759, 0.2347, 0.1829, 0.1811, 0.2922, 0.0655, 0.0774, 0.02273, 0.2056, 0.0925, 0.0078, 0.1852, 0.3501, 0.168, 0.2668
Defect
8
0.0724, 0.1909, 0.134, 0.2409, 0.2842, 0.045, 0.0824, 0.1064, 0.1909, 0.1586, 0.0116, 0.1698, 0.3644, 0.2718, 0.2494
Defect
9
0.2634, 0.2258, 0.1165, 0.1154, 0.1074, 0.0657, 0.061, 0.2623, 0.2588, 0.1155, 0.005, 0.0978, 0.1511, 0.2273, 0.322
DefectTable 3
The test sample data.
Sample order
Characteristic value of sample
State
1
0.2101, 0.095, 0.1298, 0.1359, 0.2601, 0.1001, 0.0753, 0.089, 0.0389, 0.1451, 0.0128, 0.159, 0.2452, 0.0512, 0.1319
Normal
2
0.2593, 0.18, 0.0711, 0.2801, 0.1501, 0.1298, 0.1001, 0.1891, 0.2531, 0.0875, 0.0058, 0.1803, 0.0992, 0.0802, 0.1002
Crack
3
0.2599, 0.2235, 0.1201, 0.0071, 0.1102, 0.0683, 0.0621, 0.2597, 0.2602, 0.1167, 0.0048, 0.1002, 0.1521, 0.2281, 0.3205
DefectThe formulan2=2×n1+1 is adopted to calculate the number of neurons in hidden layer. The transfer function of the neurons in hidden layer is S-shaped tangent function. The transfer function of the neurons in output layer is S-shaped logarithmic function. The states of parts are divided into three kinds of situation and the output form of the three situations is as follows:Normal:(1,0,0); Crack: (0,1,0); Defect: (0,0,1).The nodes number of input layer is 15, nodes number of output layer is 3, and nodes number of hidden layer is 31. So the number of weights is 558, the number of thresholds is 34, and the number of total parameters that needs to be optimized is 592. The training frequency of network is 1000, the training goal is 0.01, and the learning rate is 0.1. The norm of test error of test sample is set as the quota to measure the generalization capability of network. The fitness value of individual is calculated based on the norm of error. The smaller the error is, the larger the fitness of individual is.The initial code of RQGA-BP is as follows:(6)P1tP2t⋯Pit⋯P40t,wherePit=xi1xi2⋯xij⋯xi592θi1θi2⋯θij⋯θi592,xij is a random number in the range [-0.5,0.5] and θij=π/4.Apply BP, GA-BP, and RQGA-BP to process the data. The size of population is 40, and the maximal evolution generation is 50. Table4 shows the results of the experiment by performing each algorithm 10 times, where Error 1 stands for the training error and Error 2 stands for the test error. We can get the conclusion that the test result of training and prediction data of RQGA-BP is better than GA-BP and the test result of training and prediction data of GA-BP is better than BP.Table 4
The experiment results of the three algorithms.
Algorithm
Error
1
2
3
4
5
6
7
8
9
10
Average value
BP
Error 1
0.9445
1.0242
1.1473
1.0338
0.8463
0.9731
1.0185
1.0937
0.9765
1.0355
1.0093
Error 2
1.9459
1.9504
2.0456
1.9521
1.8376
1.9582
1.9483
2.0647
1.9539
1.9568
1.9614
GA-BP
Error 1
0.8928
0.3193
0.53883
0.6493
0.9478
0.7485
0.3847
0.4838
0.5235
0.8384
0.6327
Error 2
1.6035
1.321
1.3559
1.4857
1.9434
1.6683
1.3641
1.4759
1.4937
1.7758
1.5487
RQGA-BP
Error 1
0.5463
0.3027
0.4394
0.3859
0.5673
0.4375
0.5375
0.6473
0.3532
0.3391
0.4556
Error 2
1.5274
1.3267
1.4589
1.3845
1.4838
1.3423
1.5384
1.4873
1.3839
1.3868
1.432Apply the test method of mean difference of two normal populations (t-test) to analyze the error of BP, GA-BP, and RQGA-BP.The data of error of the three methods can be considered to be samples from normal populationN(μ,σ2). The means of the sample of the three methods are X1¯, X2¯, and X3¯, respectively, and the variances are S12, S22, and S32. The t-statistic is introduced to be the test statistic:
(7)t=Xi¯-Xj¯-δSw1/ni+1/nj,
where δ=μi-μj, Sw2=(ni-1)Si2+(nj-1)Sj2/ni+nj-2, and Sw=Sw2.The form of rejection region is(xi¯-xj¯)-δ/sw1/ni+1/nj≥k.{RejectH0 when H0 is true}=Pμi-μj=δ(xi¯-xj¯)-δ/sw1/ni+1/nj≥k=α; then k=tα/2(ni+nj-2).So the rejection region ist=(xi¯-xj¯)-δ/sw1/ni+1/nj≥tα/2(ni+nj-2).The hypothesesH0: μi-μj<0 and H1: μ1-μ2≥0 need to be tested.The mean and variance of Error 1 of BP, GA-BP, and RQGA-BP are as follows:n1=10, x1¯=1.0093, s12=0.0068; n2=10, x2¯=0.6327, s22=0.0473; x3¯=0.4556, s32=0.0130. Then, sw12=0.02705, sw22=0.0302.Considert1=5.1201>t0.005(18)=2.8784. So reject H0; that is, Error 1 of BP is larger than the GA-BP with probability of more than 99.5%.Considert2=2.2788>t0.025(18)=2.1009. So reject H0; that is, Error 1 of GA-BP is larger than the RQGA-BP with probability of more than 97.5%.The mean and variance of Error 2 of BP, GA-BP, and RQGA-BP are as follows:n1=10, x1¯=1.9614, s12=0.0038; n2=10, x2¯=1.5487, s22=0.0400; x3¯=1.432, s32=0.0058. Then, sw12=0.0219, sw22=0.0239.Considert1=6.2358>t0.005(18)=2.8784. So reject H0; that is, Error 2 of BP is larger than the GA-BP with probability of more than 99.5%.Considert2=1.6879>t0.10(18)=1.3304. So reject H0; that is, Error 2 of GA-BP is larger than the RQGA-BP with probability of more than 90%.Select one evolution of GA-BP and RQGA-BP randomly; the change process of error is shown in Figure6. The x-axis represents the evolutionary generation; the y-axis represents the error. The active line represents the evolutionary process of GA-BP. The dotted line represents the evolutionary process of RQGA-BP. It can be concluded from the figure that the final error of RQGA-BP is smaller, and the evolution of RQGA-BP is faster.Figure 6
The evolutionary process of GA-BP and RQGA-BP.


### 5.2. Case Two

Apply RQGA-BP to forecast the gasoline octane number. There are some disadvantages in traditional experimental method to measure the octane number, for example, the large dosage of sample, long experimental period, and high cost. Near infrared spectroscopy (NIR) is with the advantages of lower cost, no pollution, nondestructive testing, and online analysis. Use Fourier transform near infrared transform spectrometer to scan 60 groups of gasoline sample. The scanning range is 900–1700 nm, scanning interval is 2 nm, and each sample contains 401 wavelength points. Diagram of NIR of samples is as shown in Figure7.Figure 7
Diagram of NIR of samples.Utilize the laboratory testing method to test the octane number of sample. Apply GA-BPNN and RQGA-BPNN to set up the mathematical model between the near infrared spectrum and the octane number, respectively. Number of neurons of input layer is 401; number of neurons of output layer is 1. Since the number of neurons of input layer is large, adopt formulan2=log2n1 to calculate the number of neurons of hidden layer to 9. The number of training times is 1000, training target is 0.001, and learning rate is 0.01.Apply randomly select method to generate training set and test set from 60 samples. The number of training sets is 50, and the number of test sets is 10. Since the training set and testing set are randomly generated each time, the results of each run may be different from each other.After the test, evaluate the generalization ability of the network by calculating deviation between predicted value and true value. Choose relative error and the coefficient of decision to evaluate the generalization ability. The calculation formulas are shown in formula (8) and formula (9), respectively:
(8)Ei=yi^-yiyi,i=1,2,…,n,(9)R2=l∑i=1lyi^yi-∑i=1lyi^∑i=1lyi2l∑i=1lyi^2-∑i=1lyi^2l∑i=1lyi2-∑i=1lyi2,(10)Ez=∑i=1nEi,
where yi^  (i=1,2,…,n) is the prediction value of the ith sample; yi  (i=1,2,…,n) is the true value of the ith sample; n is the number of samples. The smaller the sum Ez of relative error Ei the better, and the larger the decision coefficient R2∈[0,1] the better. Run GA-BPNN and RQGA-BPNN 10 times, respectively; the result is shown in Table 5.Table 5
Result of GA-BPNN and RQGA-BPNN.
Number of times
Parameters
E
z (GA-BP)
E
z (RQGA-BP)
R
2 (GA-BP)
R
2 (RQGA-BP)
1
0.0344
0.0326
0.9603
0.9782
2
0.0364
0.0245
0.9425
0.9760
3
0.0326
0.0275
0.9311
0.9728
4
0.0225
0.0295
0.9788
0.9859
5
0.0538
0.0284
0.9031
0.9785
6
0.0447
0.0299
0.9188
0.9745
7
0.0216
0.0283
0.9704
0.9518
8
0.0325
0.0323
0.8515
0.9488
9
0.0529
0.0298
0.8912
0.9496
10
0.0319
0.0218
0.9325
0.9680Apply thet-test method in Case One to compare the performance of Ez and R2 of GA-BP and RQGA-BP.The mean and variance ofEz of GA-BP and RQGA-BP are as follows: n1=10, x1¯=0.0363, s12=0.00012; n2=10, x2¯=0.0285, s22=0.0000109. Then, sw2=0.00006545.Considert=2.1559>t0.025(18)=2.1009. So reject H0; that is, Ez of GA-BP is larger than the RQGA-BP with probability of more than 97.5%.The mean and variance ofR2 of GA-BP and RQGA-BP are as follows: n1=10, x1¯=0.9280, s12=0.0015; n2=10, x2¯=0.9684, s22=0.0002. Then, sw2=0.00085.Considert=-3.098≤-t0.005(18)=-2.8784. So accept H0; that is, R2 of GA-BP is smaller than the RQGA-BP with probability of more than 99.5%.As can be seen from the data in the table, the seventh result of GA-BP is better than RQGA-BP; the remaining results of RQGA-BP are better than GA-BP.Set the fourth result as the example; the specific calculation results are as shown in Table6.Table 6
Result of the fourth experiment.
Order number
Parameters
Value of laboratory testing method
Prediction value of GA-BP
Prediction value of RQGA-BP
Error value of GA-BP
Error value of RQGA-BP
1
88.6500
88.1141
88.8022
0.0060
0.0017
2
88.8500
88.9801
89.1007
0.0015
0.0028
3
87.6000
87.4219
87.7384
0.0020
0.0016
4
85.2500
85.1432
85.1895
0.0013
0.0007
5
85.1000
85.4010
85.3730
0.0035
0.0032
6
88.1000
88.2361
88.6818
0.0015
0.0066
7
88.5500
88.4808
88.5914
0.0008
0.0005
8
88.9000
88.7857
89.2359
0.0013
0.0038
9
88.2000
88.0418
88.7898
0.0018
0.0067
10
85.3000
85.0685
85.4639
0.0027
0.0019The contrast of prediction results of two methods with true value of the fourth experiment is as shown in Figure8.Figure 8
Result of the fourth experiment.It can be seen that both GA-BP and RQGA-BP can predict the octane content and the result of RQGA-BP is better.


## 5.1. Case One

Apply RQGA-BP to fault detection for parts of machinery. Due to invisibility of the fault of mechanical parts, the possible states can be concluded by measuring the related characteristic parameters. Select 15 characteristic parameters of parts and normalize the data. The training sample data and the test sample data are shown in Tables2 and 3, respectively.Table 2
The training sample data.
Sample order
Characteristic value of sample
State
1
0.2286, 0.1292, 0.072, 0.1592, 0.1335, 0.0733, 0.1159, 0.094, 0.0522, 0.1345, 0.009, 0.126, 0.3619, 0.069, 0.1828
Normal
2
0.209, 0.0947, 0.1393, 0.1387, 0.2558, 0.09, 0.0771, 0.0882, 0.0393, 0.143, 0.0126, 0.167, 0.245, 0.0508, 0.1328
Normal
3
0.0442, 0.088, 0.1147, 0.0563, 0.3347, 0.115, 0.1453, 0.0429, 0.1818, 0.0378, 0.0092, 0.2251, 0.1516, 0.0858, 0.067
Normal
4
0.2603, 0.1715, 0.0702, 0.2711, 0.1491, 0.133, 0.0968, 0.1911, 0.2545, 0.0871, 0.006, 0.1793, 0.1002, 0.0789, 0.0909
Crack
5
0.369, 0.2222, 0.0562, 0.5157, 0.1872, 0.1614, 0.1425, 0.1506, 0.131, 0.05, 0.0078, 0.0348, 0.0451, 0.0707, 0.088
Crack
6
0.0359, 0.1149, 0.123, 0.546, 0.1977, 0.1248, 0.0624, 0.0832, 0.164, 0.1002, 0.0059, 0.1503, 0.1837, 0.1295, 0.07
Crack
7
0.1759, 0.2347, 0.1829, 0.1811, 0.2922, 0.0655, 0.0774, 0.02273, 0.2056, 0.0925, 0.0078, 0.1852, 0.3501, 0.168, 0.2668
Defect
8
0.0724, 0.1909, 0.134, 0.2409, 0.2842, 0.045, 0.0824, 0.1064, 0.1909, 0.1586, 0.0116, 0.1698, 0.3644, 0.2718, 0.2494
Defect
9
0.2634, 0.2258, 0.1165, 0.1154, 0.1074, 0.0657, 0.061, 0.2623, 0.2588, 0.1155, 0.005, 0.0978, 0.1511, 0.2273, 0.322
DefectTable 3
The test sample data.
Sample order
Characteristic value of sample
State
1
0.2101, 0.095, 0.1298, 0.1359, 0.2601, 0.1001, 0.0753, 0.089, 0.0389, 0.1451, 0.0128, 0.159, 0.2452, 0.0512, 0.1319
Normal
2
0.2593, 0.18, 0.0711, 0.2801, 0.1501, 0.1298, 0.1001, 0.1891, 0.2531, 0.0875, 0.0058, 0.1803, 0.0992, 0.0802, 0.1002
Crack
3
0.2599, 0.2235, 0.1201, 0.0071, 0.1102, 0.0683, 0.0621, 0.2597, 0.2602, 0.1167, 0.0048, 0.1002, 0.1521, 0.2281, 0.3205
DefectThe formulan2=2×n1+1 is adopted to calculate the number of neurons in hidden layer. The transfer function of the neurons in hidden layer is S-shaped tangent function. The transfer function of the neurons in output layer is S-shaped logarithmic function. The states of parts are divided into three kinds of situation and the output form of the three situations is as follows:Normal:(1,0,0); Crack: (0,1,0); Defect: (0,0,1).The nodes number of input layer is 15, nodes number of output layer is 3, and nodes number of hidden layer is 31. So the number of weights is 558, the number of thresholds is 34, and the number of total parameters that needs to be optimized is 592. The training frequency of network is 1000, the training goal is 0.01, and the learning rate is 0.1. The norm of test error of test sample is set as the quota to measure the generalization capability of network. The fitness value of individual is calculated based on the norm of error. The smaller the error is, the larger the fitness of individual is.The initial code of RQGA-BP is as follows:(6)P1tP2t⋯Pit⋯P40t,wherePit=xi1xi2⋯xij⋯xi592θi1θi2⋯θij⋯θi592,xij is a random number in the range [-0.5,0.5] and θij=π/4.Apply BP, GA-BP, and RQGA-BP to process the data. The size of population is 40, and the maximal evolution generation is 50. Table4 shows the results of the experiment by performing each algorithm 10 times, where Error 1 stands for the training error and Error 2 stands for the test error. We can get the conclusion that the test result of training and prediction data of RQGA-BP is better than GA-BP and the test result of training and prediction data of GA-BP is better than BP.Table 4
The experiment results of the three algorithms.
Algorithm
Error
1
2
3
4
5
6
7
8
9
10
Average value
BP
Error 1
0.9445
1.0242
1.1473
1.0338
0.8463
0.9731
1.0185
1.0937
0.9765
1.0355
1.0093
Error 2
1.9459
1.9504
2.0456
1.9521
1.8376
1.9582
1.9483
2.0647
1.9539
1.9568
1.9614
GA-BP
Error 1
0.8928
0.3193
0.53883
0.6493
0.9478
0.7485
0.3847
0.4838
0.5235
0.8384
0.6327
Error 2
1.6035
1.321
1.3559
1.4857
1.9434
1.6683
1.3641
1.4759
1.4937
1.7758
1.5487
RQGA-BP
Error 1
0.5463
0.3027
0.4394
0.3859
0.5673
0.4375
0.5375
0.6473
0.3532
0.3391
0.4556
Error 2
1.5274
1.3267
1.4589
1.3845
1.4838
1.3423
1.5384
1.4873
1.3839
1.3868
1.432Apply the test method of mean difference of two normal populations (t-test) to analyze the error of BP, GA-BP, and RQGA-BP.The data of error of the three methods can be considered to be samples from normal populationN(μ,σ2). The means of the sample of the three methods are X1¯, X2¯, and X3¯, respectively, and the variances are S12, S22, and S32. The t-statistic is introduced to be the test statistic:
(7)t=Xi¯-Xj¯-δSw1/ni+1/nj,
where δ=μi-μj, Sw2=(ni-1)Si2+(nj-1)Sj2/ni+nj-2, and Sw=Sw2.The form of rejection region is(xi¯-xj¯)-δ/sw1/ni+1/nj≥k.{RejectH0 when H0 is true}=Pμi-μj=δ(xi¯-xj¯)-δ/sw1/ni+1/nj≥k=α; then k=tα/2(ni+nj-2).So the rejection region ist=(xi¯-xj¯)-δ/sw1/ni+1/nj≥tα/2(ni+nj-2).The hypothesesH0: μi-μj<0 and H1: μ1-μ2≥0 need to be tested.The mean and variance of Error 1 of BP, GA-BP, and RQGA-BP are as follows:n1=10, x1¯=1.0093, s12=0.0068; n2=10, x2¯=0.6327, s22=0.0473; x3¯=0.4556, s32=0.0130. Then, sw12=0.02705, sw22=0.0302.Considert1=5.1201>t0.005(18)=2.8784. So reject H0; that is, Error 1 of BP is larger than the GA-BP with probability of more than 99.5%.Considert2=2.2788>t0.025(18)=2.1009. So reject H0; that is, Error 1 of GA-BP is larger than the RQGA-BP with probability of more than 97.5%.The mean and variance of Error 2 of BP, GA-BP, and RQGA-BP are as follows:n1=10, x1¯=1.9614, s12=0.0038; n2=10, x2¯=1.5487, s22=0.0400; x3¯=1.432, s32=0.0058. Then, sw12=0.0219, sw22=0.0239.Considert1=6.2358>t0.005(18)=2.8784. So reject H0; that is, Error 2 of BP is larger than the GA-BP with probability of more than 99.5%.Considert2=1.6879>t0.10(18)=1.3304. So reject H0; that is, Error 2 of GA-BP is larger than the RQGA-BP with probability of more than 90%.Select one evolution of GA-BP and RQGA-BP randomly; the change process of error is shown in Figure6. The x-axis represents the evolutionary generation; the y-axis represents the error. The active line represents the evolutionary process of GA-BP. The dotted line represents the evolutionary process of RQGA-BP. It can be concluded from the figure that the final error of RQGA-BP is smaller, and the evolution of RQGA-BP is faster.Figure 6
The evolutionary process of GA-BP and RQGA-BP.


## 5.2. Case Two

Apply RQGA-BP to forecast the gasoline octane number. There are some disadvantages in traditional experimental method to measure the octane number, for example, the large dosage of sample, long experimental period, and high cost. Near infrared spectroscopy (NIR) is with the advantages of lower cost, no pollution, nondestructive testing, and online analysis. Use Fourier transform near infrared transform spectrometer to scan 60 groups of gasoline sample. The scanning range is 900–1700 nm, scanning interval is 2 nm, and each sample contains 401 wavelength points. Diagram of NIR of samples is as shown in Figure7.Figure 7
Diagram of NIR of samples.Utilize the laboratory testing method to test the octane number of sample. Apply GA-BPNN and RQGA-BPNN to set up the mathematical model between the near infrared spectrum and the octane number, respectively. Number of neurons of input layer is 401; number of neurons of output layer is 1. Since the number of neurons of input layer is large, adopt formulan2=log2n1 to calculate the number of neurons of hidden layer to 9. The number of training times is 1000, training target is 0.001, and learning rate is 0.01.Apply randomly select method to generate training set and test set from 60 samples. The number of training sets is 50, and the number of test sets is 10. Since the training set and testing set are randomly generated each time, the results of each run may be different from each other.After the test, evaluate the generalization ability of the network by calculating deviation between predicted value and true value. Choose relative error and the coefficient of decision to evaluate the generalization ability. The calculation formulas are shown in formula (8) and formula (9), respectively:
(8)Ei=yi^-yiyi,i=1,2,…,n,(9)R2=l∑i=1lyi^yi-∑i=1lyi^∑i=1lyi2l∑i=1lyi^2-∑i=1lyi^2l∑i=1lyi2-∑i=1lyi2,(10)Ez=∑i=1nEi,
where yi^  (i=1,2,…,n) is the prediction value of the ith sample; yi  (i=1,2,…,n) is the true value of the ith sample; n is the number of samples. The smaller the sum Ez of relative error Ei the better, and the larger the decision coefficient R2∈[0,1] the better. Run GA-BPNN and RQGA-BPNN 10 times, respectively; the result is shown in Table 5.Table 5
Result of GA-BPNN and RQGA-BPNN.
Number of times
Parameters
E
z (GA-BP)
E
z (RQGA-BP)
R
2 (GA-BP)
R
2 (RQGA-BP)
1
0.0344
0.0326
0.9603
0.9782
2
0.0364
0.0245
0.9425
0.9760
3
0.0326
0.0275
0.9311
0.9728
4
0.0225
0.0295
0.9788
0.9859
5
0.0538
0.0284
0.9031
0.9785
6
0.0447
0.0299
0.9188
0.9745
7
0.0216
0.0283
0.9704
0.9518
8
0.0325
0.0323
0.8515
0.9488
9
0.0529
0.0298
0.8912
0.9496
10
0.0319
0.0218
0.9325
0.9680Apply thet-test method in Case One to compare the performance of Ez and R2 of GA-BP and RQGA-BP.The mean and variance ofEz of GA-BP and RQGA-BP are as follows: n1=10, x1¯=0.0363, s12=0.00012; n2=10, x2¯=0.0285, s22=0.0000109. Then, sw2=0.00006545.Considert=2.1559>t0.025(18)=2.1009. So reject H0; that is, Ez of GA-BP is larger than the RQGA-BP with probability of more than 97.5%.The mean and variance ofR2 of GA-BP and RQGA-BP are as follows: n1=10, x1¯=0.9280, s12=0.0015; n2=10, x2¯=0.9684, s22=0.0002. Then, sw2=0.00085.Considert=-3.098≤-t0.005(18)=-2.8784. So accept H0; that is, R2 of GA-BP is smaller than the RQGA-BP with probability of more than 99.5%.As can be seen from the data in the table, the seventh result of GA-BP is better than RQGA-BP; the remaining results of RQGA-BP are better than GA-BP.Set the fourth result as the example; the specific calculation results are as shown in Table6.Table 6
Result of the fourth experiment.
Order number
Parameters
Value of laboratory testing method
Prediction value of GA-BP
Prediction value of RQGA-BP
Error value of GA-BP
Error value of RQGA-BP
1
88.6500
88.1141
88.8022
0.0060
0.0017
2
88.8500
88.9801
89.1007
0.0015
0.0028
3
87.6000
87.4219
87.7384
0.0020
0.0016
4
85.2500
85.1432
85.1895
0.0013
0.0007
5
85.1000
85.4010
85.3730
0.0035
0.0032
6
88.1000
88.2361
88.6818
0.0015
0.0066
7
88.5500
88.4808
88.5914
0.0008
0.0005
8
88.9000
88.7857
89.2359
0.0013
0.0038
9
88.2000
88.0418
88.7898
0.0018
0.0067
10
85.3000
85.0685
85.4639
0.0027
0.0019The contrast of prediction results of two methods with true value of the fourth experiment is as shown in Figure8.Figure 8
Result of the fourth experiment.It can be seen that both GA-BP and RQGA-BP can predict the octane content and the result of RQGA-BP is better.


## 6. Conclusions

The optimization of weights and thresholds of BPNN is a numerical optimization problem. The purpose of RQGA optimizing BPNN is to obtain better initial weights and thresholds through RQGA. The individual in RQGA represents the initial weights and thresholds of network, and the norm of test error of the prediction sample is the output of objective function. Compared with conventional BPNN, the RQGA-BP is with higher convergence rate.



---

*Source: 571295-2015-01-20.xml*