## 3 Model-Solving Algorithm
### GA-BP Neural Network Algorithm  
There are hidden units in the BP neural network. Although the gradient descent function is adopted on the surface of the weight and threshold vector, the global minimum of error cannot be guaranteed, so the optimal weight and threshold of the network cannot be guaranteed. Even though the BP neural network model has a certain prediction ability of matte grade, in order to predict matte grade more accurately, this paper uses GA to optimize the weights and thresholds of the BP neural network model and employs population search to optimize the weights and thresholds of the neural network, which can solve the problem of excessive dependence on gradient function of the neural network, and finally achieves the goal of global minimum error. GA-optimization BP neural network is divided into three parts: BP neural network structure determination, GA optimization, and BP neural network prediction. Among them, the design of the BP neural network structure has been discussed previously: According to the available network, the node number of each neural layer was used to determine the length of the genetic algorithm individually. When using a GA to optimize the weights and thresholds of a BP neural network, each individual in the population contains all the weights and thresholds of a network, and the individual calculates the individual fitness value by the fitness function, and the genetic algorithm finds the individual corresponding to the optimal fitness value by selection, crossover and variation operations. BP neural network prediction uses the optimal individual obtained by genetic algorithm to assign the initial weight and threshold of the network. Then the data are used to train the network, and the result is the output of the prediction model. The specific algorithm flow chart is as follows (Figure 4):Figure 4: GA-BP algorithm flow chart. Figure 3: GA-BP neural network ISA smelting matte-grade optimization and prediction model solution flow chart. Chromosome coding  
According to the previously established BP neural network for the matte grade, all its weights and thresholds were used as genes to construct chromosomes, and segmented real numbers were used to encode chromosomes, each of which was a real number string. All genes form a chromosome vector \(H=[h_{1},h_{2},\cdots h_{\text{k}},\cdots h_{\text{n}}]\), where \([h_{1},h_{2},\cdots h_{\text{k}}]\) are the weight genes in the chromosome and \([h_{\text{k+1}},\cdots h_{\text{n}}]\) are the threshold genes in the chromosome. Population initialization  
L chromosomes are randomly generated by BP neural network weight threshold initialization, and the initial population size is set as S.  
Adaptation function  
The chromosomes in the genetic algorithm population were used as the weights and thresholds of the BP neural network, the trained BP neural network was used for model prediction, and the absolute value of the error between the predicted and desired outputs was taken as the individual fitness value \(F\). The formula was calculated as follows:  
\[F=/y_{i}-o_{i}/ \tag{5}\]  
In this formula, \(y_{i}\) is the expected output value of matte grade for the \(i\)th input sample of the BP neural network; \(o_{i}\) is the predicted output value of matte grade for the \(i\)th input sample. The genetic algorithm optimizes the matte-grade BP neural network weights and thresholds, and the goal is to obtain the network weights and thresholds with the smallest \(F\) in the evolutionary process. Select Operation  
Genetic algorithm selection operation has various methods, such as the roulette method and tournament method [24]. In this paper, we choose the roulette wheel method, namely, the selection strategy based on the proportion of adaptation, and the selection probability \(p_{i}\) for each individual \(i\) is as follows:  
\[f_{i}=1/F_{i} \tag{6}\]  
\[p_{i}=\frac{f_{i}}{\sum_{i=1}^{N}f_{i}} \tag{7}\]  
In this formula, \(F_{i}\) is the fitness value of individual \(i\).