## 2 Improved BP Neural Network Model Based on GA
### Construction of the GA-BP Neural Network Model  
As a random search algorithm, the genetic algorithm has a strong global merit ability and robustness, which can optimize the weights and thresholds of BP neural networks, which are mainly divided into three parts: the determination of the structure of the BP neural network, the optimization of weights and thresholds of genetic Algorithms, and the training and prediction of BP neural networks. In this paper, the genetic algorithm is used to optimize the initial weights and thresholds of the BP neural network. The optimal weights and thresholds are obtained, and the optimal weights and thresholds are then applied to the BP neural network for training, which can prevent the network from falling into local optimization and improve the training performance. For most problems, the BP neural network with a three-layer structure is sufficient, so a three-layer neural network is selected in this paper, including the input layer, the hidden layer, and the output layer. In the following example, the number of engineering characteristic factors of property reduction in the vector of the rough set is the input layer, per square meter cost of the project is the output layer node, and the hidden layer node \(N\) is determined according to the empirical formula, where N is the number of hidden layer nodes, m is the number of neuron nodes of the input layer, and n is the number of output layer neuron nodes, which is \(N=\sqrt{m+n}+\alpha\), \(\alpha\), a constant between them [1, 10]. Based on the above theory, the steps of genetic algorithm to optimize BP neural network are as follows.  
(1) After determining the topology of the neural network, initial weights and thresholds are generated. They are expressed in the BP neural network in the form of vectors, including the vectors composed of the connection weights \(W_{1j}\),..., \(W_{ij}\) between the input layer and the hidden layer, the vectors composed of hidden layer threshold \(\theta_{1}\),..., \(\theta_{i}\), the vectors composed of the connection weights \(W_{2j}\),..., \(W_{kj}\) between the hidden layer and the output layer, and the vectors composed of the threshold of the output layer \(a1\),..., \(ak\).  
(2) Determine the fitness function. The selection of the fitness function is determined by the minimum mean square error between the obtained test set and the training set by the BP neural network on the data, and the smaller the error, the higher the accuracy.  
(3) Determine the global search operator of the algorithm. The roulette method is used to select individuals with good fitness from the population. Two chromosomes are randomly selected from the population, a cross point is randomly generated at the same time, the other half of the two chromosomes is exchanged to obtain the two newly generated individuals, and their feasibility is tested. For the mutation operation, one individual is randomly selected and a mutation point is randomly selected, and the mutation is carried out according to a certain probability, so as to produce a new individual [20].  
(4) If the obtained neural network weights and thresholds do not meet the convergence conditions, return to step (1) and iterate again.  
(5) After obtaining the optimal weights and thresholds of the BP neural network, they are assigned to the BP neural network for optimized training and prediction to obtain the final results.  
Figure 3 shows the process.