Prediction of polishing roughness of aluminum alloy hard anodized film based on BP and GA-BP neural network

. In order to obtain better-polished surface quality of hard anodic oxide film, two deep learning models of the BP neural network and GA-BP neural network were used to establish a roughness prediction model for aluminum alloy hard anodic oxide film polishing. The experimental data was divided into two groups, one group of data was used for model training, and the other group of data was used for model testing. The results showed that the mean square error between the polishing roughness predicted by the BP neural network model and the experimental results was 1.33E-2, the maximum relative error was 18.84 %, the minimum relative error was 0.77 %, and the average relative error was 10.46 %. The error is relatively large, and the degree of variation of the error is relatively large; the mean square error of the polishing roughness predicted by the GA-BP neural network model and the test results is 0.58E-2, the maximum relative error is 14.28 %, the minimum relative error is 0.51%, the average relative error is 6.61 %, the error is smaller, and the degree of error change is smaller; the prediction accuracy of the GA-BP model is the highest, and the generalization ability strongest.


Introduction
Surface roughness is an important indicator for judging the processing quality of workpieces, and the prediction of surface roughness has always been a concern by academia and industry.There are many influencing factors in the process of part processing, which make the machining trajectory between the processing tool and the workpiece very complicated, resulting in a complex nonlinear logic between these influencing factors and the obtained processed surface roughness, which is very complicated.It is difficult to predict the surface roughness after machining.In order to realize the prediction of processing roughness, the deep learning method is a relatively common method at present [1][2][3][4][5].
Deep neural network (Deep neural network, DNN) has been able to solve a variety of industrial problems [6], especially in processing roughness prediction.Lei Yong et al. established a surface roughness prediction model for low-temperature milling of titanium alloys based on BP neural network, and compared it with the surface roughness empirical model established by regression analysis, the results showed that the prediction accuracy and generalization ability of the neural network was stronger [7].Chen Lin et al. used deep convolutional neural network modeling to identify the roughness of various machining methods [8].Duan Pengfei used the GA-BP neural network to predict the surface roughness of robot polishing [9].
As a light metal, aluminum alloy has the characteristics of low density, high specific strength, and excellent corrosion resistance, and is widely used in aerospace and other fields [10].To avoid the unfavorable characteristics of low hardness and easy wear of aluminum alloys, hard anodic oxidation is often used on the working surface to improve surface hardness and wear resistance, but some hard anodic oxide films require  0.1 roughness, which is no longer possible.Due to the limitation of the hardness and thickness of the oxide film layer, the polishing process is also a complicated process, and it is very easy to have out-of-tolerance and poor roughness, which will lead to scrapping of parts.
In order to obtain better surface quality of hard anodic oxide film, it is particularly important to study the polishing roughness of aluminum alloy hard anodic oxide film and establish a prediction model.The establishment of an accurate surface roughness prediction model can realize the optimal control of the surface roughness of aluminum alloy hard anodized film, which is helpful to predict the surface roughness before actual production and processing, so as to ensure the processing quality and efficiency and reduce scrap and other production costs.BP neural network and GABP neural network, are used to establish a prediction model to realize surface Intelligent prediction of roughness.

Test device
The aluminum alloy hard oxide film polishing test was carried out on a CM6140A precision ordinary lathe.The spindle can realize 24-level speed regulation between 10 and 1400 r/min, the power of the spindle motor is 7.5 kW, and the maximum processing diameter×length: is Φ210×900 mm.The polishing test system is shown in Fig. 1.One end of the aluminum alloy hard oxide film polishing test piece is clamped on the chuck of the ordinary lathe through the mandrel, and the other end is clamped by the tip of the tailstock of the ordinary lathe.Mounted on a lathe tool holder.During the test, the rotation of the lathe spindle drives the workpiece to rotate, and the adjustment of the tool holder drives the relative position of the polishing tool and the test piece.The polishing force measurement system includes a hand-held digital liquid crystal meter MCK-HY instrument sensor and a JLBM pull rod capsule-type tension pressure sensor to realize the measurement of polishing force.The size of the aluminum alloy hard oxide film polishing test piece used in the test is: Φ40 mm×350 mm, the substrate is 2D70 aluminum alloy, the surface layer is a hard anodic oxide film, the thickness is (60-70) μm, and its physical and mechanical properties are shown in Table 1.

Experimental design
The experimental variables are polishing force , polishing times , feed rate , and sandpaper particle size , and the polishing speed  has little influence on the polishing roughness of the hard anodized film in other previous studies, so No longer used as a test factor.
The surface roughness of the polished aluminum alloy hard oxide film was measured by the SJ5730 large-scale roughness profiler produced by Shenzhen Zhongtu Instrument Co., Ltd.The measurement accuracy of the  value was 0.001 μm, and the polished area was randomly measured 8 times.Take the average value after the maximum and minimum values as the measurement result.After the aluminum alloy parts were hard anodized, 92 test pieces with a surface initial roughness  of around 0.366±0.01were selected.

Test results
Some test results are shown in Table 3.

Prediction model of polished surface roughness of hard anodized film based on BP neural network
The prediction model of polished surface roughness of hard anodized film based on the BP neural network adopts a three-layer network structure, including input layer, hidden layer and output layer.The four parameters of polishing force , polishing times , feed rate , and sandpaper particle size  are used as input samples, so the input layer node is 4, and the hard anodized film polishing surface roughness is used as the output sample, so the output layer node is 1, according to the empirical Eq. ( 1) and error calculation results, the number of hidden layer nodes is finally determined to be 12, that is, the structure of the BP neural network is 4-12-1: Fig. 2,  is the weight between the input layer and the hidden layer nodes of the BP neural network structure,  is the weight between the input layer and the hidden layer nodes, and the transfer function of the hidden layer of the BP neural network structure uses the tanh function  The BP neural network prediction model was established using Pycharm software, the training target error was set to 0.001, and the training times were set to 1000.Through the 92 groups of data samples of the aluminum alloy hard oxide film polishing test, 76 groups were selected as training samples, and the remaining 16 groups were used as verification samples, which were normalized according to Eq. ( 2): Among them,  is the normalized value,  is the initial test data,  is the maximum value in the initial test data, and  is the minimum value in the initial test data.

Prediction model of polished surface roughness of hard anodized film based on GA-BP neural network
The GA-BP neural network is composed of three parts.Firstly, the topology structure of the neural network is determined through the polishing parameters of the aluminum alloy hard anodic oxide film; then, the individual is selected through the cross mutation in the genetic algorithm, and the optimized individual is selected; finally Decode the selected individuals to obtain their respective parameters, and use the data to train the BP neural network to obtain a prediction model, as shown in the Fig. 3.
Use Pycharm software to build a GA-BP neural network prediction model, use the newff function to build a GA-BP neural network, initialize the population, and decode to get the initial weight and threshold.The genetic algorithm parameters are set, the individual crossover probability is 0.1, the mutation probability is 0.1, the evolution algebra is 50 generations, and the population size is 150.Use the code function to encode variables to initialize the population, use the test function to determine whether the threshold and weight are out of range, and then use the fun function to calculate the population fitness to obtain the population initialization information.The Select function is used to select, and the optimal individual is obtained through crossmutation.The optimal individual decoding operation is obtained to obtain the optimal parameters of the aluminum alloy hard anodized film polishing roughness prediction model.The BP network is trained through these parameter data, and finally a relatively accurate prediction result is obtained.

Prediction results and discussion
Table 4 shows the comparison of prediction partial results, and Fig. 4 shows the comparison of the predicted values and real values of the two algorithm models.It can be analyzed from Table 4 that the mean square error between the polishing roughness predicted by the BP neural network model and the test results is 1.33E-2, the maximum relative error is 18.84 %, the minimum relative error is 0.77 %, and the average relative error is 10.46 %.The error is large, and the degree of change of the error is also relatively large; the mean square error between the polishing roughness predicted by the GA-BP neural network model and the test result is 0.58E-2, the maximum relative error is 14.28 %, and the minimum relative error is 0.51 %.The average relative error is 6.61 %, the error is small, and the degree of variation of the error is small.
The results show that when predicting the polishing roughness of aluminum alloy hard anodic oxide layer, the prediction accuracy of the GA-BP model is higher and the generalization ability is stronger.In the actual processing process, the application of the GA-BP model to predict the polishing roughness of the oxide layer can better guide the actual production.

Conclusions
Based on the BP neural network and GA-BP neural network, the prediction model of polishing roughness of the hard anodized layer was established.Analysis and comparison of the prediction results of the two models showed that the prediction accuracy of the GA-BP model was the highest and the generalization ability was the strongest.Therefore, the prediction model of polishing roughness of aluminum alloy hard anodized layer based on 1D-CNN can better reflect the quantitative relationship between surface roughness and various parameters in the polishing process.

𝑓 𝑥 = 1 .
The linear function Pureline is used as the transfer function of the output layer   = .The trainlm function is used as the training function.The sigmoid function is used as the hidden layer activation function   = .

4 .
a) Predicted value and real value of BP neural network model b) Predicted value and real value of GA-BP neural network model Fig.Comparison of predicted value and true value

Table 1 .
Material properties

Table 2 .
Level table of surface polishing factors of the hard anodized layer

Table 4 .
Comparison of forecast results