Quality prediction of internal thread cold extrusion based on genetic algorithm optimized BP neural network

The extrusion process parameters have a great impact on the quality of the extrusion thread. In order to ensure the extrusion quality and the smooth progress of the extrusion process, a prediction model based on BP-GA neural network is established. The model takes the diameter of the bottom hole, extrusion speed, and friction coefficient as the input layer, and the extrusion torque, extrusion temperature, and tooth height as the output layer. After training the model with sample data, the extrusion internal thread quality prediction is carried out. The results show that the BP-GA neural network prediction model has a high accuracy in predicting the extrusion torque, extrusion temperature and tooth height rate during the cold extrusion of internal threads. The error between the experimental value and the predicted value of the extrusion torque is between 10% and 15%, the experimental value of the extrusion temperature is consistent with the predicted value, and the error between the experimental value and the predicted value of the tooth height rate is less than 5%. The BP-GA neural network prediction model can accurately predict the extrusion temperature, extrusion torque, and tooth height rate, providing a new way for the re-search of internal thread cold extrusion technology.


Introduction
With the development of modern manufacturing, precision machinery is increasingly used in high-precision, high-speed, and high-load-carrying working environments. As the most commonly used connector, threaded parts have higher and higher performance requirements. The cold extrusion process of internal thread without chip processing has gradually become the development trend of internal thread processing. The reason is that the internal thread extruded by the principle of metal plastic forming has good surface quality, high hardness, and strength, so that it has strong fatigue resistance. 1,2 In the process of cold extrusion of internal threads, the extrusion tap needs to bear a large extrusion torque because it overcomes the resistance of metal plastic deformation. In addition, the large amount of frictional heat generated in the contact part between the workpiece and the extrusion tap will cause the extrusion temperature to rise sharply. Both have a great influence on the service life of extrusion taps and the quality of thread forming. 3,4 When processing different types of threads, the process parameters are different, and the extrusion torque and the resulting extrusion temperature are also different. In order to ensure the extrusion quality and the smooth implementation of the extrusion process, it is important to predict the relationship between process parameters and extrusion quality in advance. This paper uses neural network method to predict the quality of internal thread cold extrusion by obtaining the characteristics of multi-sensor signals in the extrusion process, so as to provide an effective way for the selection of internal thread extrusion process parameters and rapid quality detection.
With the development of computer technology, artificial neural networks are increasingly used in mechanical processing fields such as process optimization, structural optimization design, and processing quality prediction. The traditional optimization algorithm has the advantages of being theoretically perfect and fast convergence. It can be used to solve some optimization problems in the fields of engineering. In the last decade, evolutionary algorithm research has emerged, yielding many successful algorithms, such as particle swarm optimization (PSO), the genetic algorithm (GA), 5 the ant colony algorithm (ACO), and others. Zhang et al. 6 established a BP neural network based on principal component analysis to predict the forming quality of internal threads. Although this method simplifies the structure of the traditional BP neural network, it has not been tested and verified. Zhi et al. 7 proposed a fuzzy optimization design method based on multi-layer response surface to optimize the bogie structure. Compared with the traditional method, the calculation efficiency and accuracy of this method are improved by 56.7% and 5.3% respectively. However, the operation of this method is complicated. When the optimal solution obtained in each layer of the multi-layer response surface method is transferred to the last layer, errors will accumulate, which affects the improvement of convergence accuracy. Li et al. 8 realized the multi-objective optimization design of the rocker stabilizer based on the improved non-dominated genetic algorithm III (MNSGA-III). Compared with the traditional NSGA-III, the improved algorithm has faster convergence speed and better optimization performance. Li et al. 9 improved on the standard bat algorithm (BA) and proposed the chaotic cloud quantum bats algorithm (CCQBA). The convergence accuracy and speed of this algorithm are significantly better than other algorithms, and it can better solve complex engineering problems. In summary, no matter how the artificial neural network is improved, its purpose is always to improve the convergence speed and convergence accuracy, and ultimately it must be applied to solve practical engineering problems.
For internal thread cold extrusion processing, under certain technological conditions, the extrusion temperature and extrusion torque have a greater impact on the thread forming quality and the service life of the tap. In this paper, numerical simulation is used to extract the parameters of extrusion torque, extrusion temperature, and thread forming quality in the process of cold extrusion of internal threads. The artificial neural network method is adopted, and the BP-GA neural network prediction model optimized based on genetic algorithm is established to accurately predict the extrusion torque, extrusion temperature, and internal thread tooth height rate. It provides a new method for the research of internal thread cold extrusion process.
The paper is organized as follows: a brief outline of the advantages of extrusion internal threads and the gaps in extrusion quality prediction technology is discussed in Section 1; followed by a brief the basic principles of prediction targets, BP neural networks, and genetic algorithms in Section 2; the structure, principle, and verification of BP-GA neural network are presented in Section 3; the experimental verification results discussed in Section 4; finally, the findings of this paper is evaluated in Section 5.

Theoretical basis
The extrusion torque has a great influence on the service life of the tap. The extrusion temperature and the tooth height rate determine the surface quality of the internal thread and whether it meets the requirements of use. Predicting them before processing can save production costs and improve processing quality. BP neural network is one of the commonly used prediction models, and genetic algorithm is a more classic optimization method. Combining the two can improve the convergence accuracy of the BP neural network.

Forecast goals
Extrusion torque. In the process of cold extrusion of internal threads, in order to make the metal on the inner wall of the bottom hole produce sufficient plastic deformation, the extrusion tap needs to overcome the deformation resistance of the metal and the friction with the workpiece. Therefore, the extrusion tap carries a large extrusion torque when it is working, and when the extrusion torque exceeds the load limit of the tap, the tap is prone to breakage and chipping, which seriously affects the processing efficiency and the service life of the tap.
Extrusion temperature. When the workpiece undergoes plastic deformation, the metal in the deformation zone will generate a lot of deformation heat. At the same time, the contact area between the extrusion tap and the inner wall of the bottom hole of the workpiece will generate a lot of frictional heat under pressure, and the temperature in the working area will rise sharply. Excessively high extrusion temperature will cause adhesion between the processed surface of the internal thread and the tap extrusion prismatic teeth, destroying the thread surface accuracy and processing quality, and high temperature will accelerate the oxidation of the extrusion tap surface and reduce the service life of the extrusion tap.
Tooth height rate. The tooth height rate of the internal thread directly affects its connection strength, and the relationship between the two is shown in Figure 1. When the internal thread tooth height rate reaches 80%, the thread strength is 100%. The tooth height rate continues to increase, and the thread strength no longer increases, but the extrusion torque will rise sharply, increasing the processing difficulty, and seriously affecting the service life of the extrusion tap. 10 Therefore, in engineering practice, controlling the range of the tooth height rate according to the requirements of the use scene is an important way to extend the durability of the tap.

BP neural network
BP (Back propagation) neural network is a supervised learning algorithm, and it is also one of the commonly used methods to deal with nonlinear problems. It is composed of two parts: the forward propagation of information and the backward propagation of errors, and its structure is shown in Figure 2. When information is propagating forward, the input layer data passes through the hidden layer to the output layer, and the state of each layer of neurons only affects the neurons of the next layer. If the error of the data obtained by the output layer is large and does not reach the expected value, the error of the output data is calculated and propagated back. The weights and thresholds of neurons in each layer are modified through the error signal until the data of the output layer reaches the desired value. 11 The output formula of the hidden layer node is as follows: The output formula of the output layer node is as follows: Where f represents a non-linear function,q is the threshold of the neuron, W ij is the hidden layer weight matrix, and T jk is the output layer weight matrix. Then according to the gradient descent criterion of the BP neural network, the weights are updated until the error converges to the expectation and the training ends.
The most prominent advantage of BP neural network is its nonlinear mapping ability and flexible network structure. But the BP neural network also has the following shortcomings: slow learning speed, easy to fall into a local minimum, no specific guiding theory for the number of network layers and the number of neurons, etc. 12 In order to improve the prediction accuracy and convergence speed of the BP neural network, other optimization algorithms or analysis methods are usually needed to assist in obtaining the optimal solution, such as principal component analysis and genetic  algorithms. 13 This paper intends to use genetic algorithm to further optimize the BP neural network to achieve higher prediction accuracy.

Genetic algorithm
Genetic Algorithm (GA) is a computational model that simulates the natural selection and genetic mechanism of biological evolution, and is a method to search for the optimal solution by simulating the natural evolution process of organisms. 14 The process of genetic algorithm optimization is as follows: First, the population is initialized, and after the first generation population is generated, more and more accurate approximate solutions are evolved according to the principle of survival of the fittest. Each generation selects individuals according to their fitness, and uses genetic operators to cross and mutate to produce new populations, until the optimal individuals evolved in the last generation population, which can be decoded as the optimal solution to the problem.

Construction and verification of GA-BP neural network
This chapter obtains the training set data of the neural network through the simulation of internal thread cold extrusion forming, including input (process parameters) and output (prediction target). The traditional BP neural network is optimized based on genetic algorithm, and the accuracy of the BP-GA neural network is verified using the existing simulation data.

Obtain training data
The main factors affecting the cold extrusion process of the internal thread are the diameter of the workpiece prefabricated bottom hole, the extrusion speed, and the friction coefficient between the workpiece and the extrusion tap. Take four values for each of the above three influencing factors, and a total of 64 process parameter combinations, as shown in Table 1.
The geometric model of the six-sided conical arrangement of extrusion taps is established by SolidWorks, and the finite element model of the internal thread cold extrusion is established in the rigid-plastic finite element analysis software DEFORM-3D. The workpiece material is 45# steel, and its performance parameters are shown in Table 2. The workpiece is divided by tetrahedral mesh, and the mesh is refined around the bottom hole. The number of meshes is 100,000. In order to prevent the relative position of the workpiece and the tap from changing during the simulation process, set the speed of the workpiece in the X, Y, and Z directions to 0. The rotation speed and feed speed of the extrusion tap are set according to the combination, and the extrusion tap is kept rotating for one revolution and one lead. The numerical simulation form is Lagrangian increment, which is solved directly by the conjugate gradient method. The finite element model of internal thread extrusion is shown in Figure 3(a), the change trend of torque and temperature during the extrusion process is shown in Figure 3(b), and the simulation result of internal thread profile is shown in Figure 3(c). Through numerical simulation under 64 process parameters, the extrusion temperature, torque, and final thread forming quality (tooth height rate) in the process of cold extrusion of internal threads under each set of process parameters are obtained.

Constructing a neural network model
The BP neural network model is built based on MATLAB to realize the real-time prediction of the extrusion torque, temperature, and tooth height rate in the cold extrusion process of internal threads. The input layer parameters are the diameter of the bottom hole of the workpiece, the extrusion speed, and the friction coefficient, and the output layer parameters are the extrusion torque, the extrusion temperature, and the tooth height rate. That is, the number of neurons in the input layer of the BP neural network is 3, and the number of nodes in the output layer is also 3. The number of neurons in the hidden layer N is generally calculated according to formula (1): In the formula: a is the number of neurons in the input layer, b is the number of neurons in the output layer, and c is a constant between 1 and 10. According to Kolmogorov's principle, the number of neurons in the hidden layer is more appropriate. 15 When the simulation test sample size is small and the number of hidden layer neurons is large, the network training has higher effectiveness, and the number of hidden layer neurons N is taken as 10. Finally, it is determined that the structure of the BP neural network prediction model is 3 3 10 3 3, the trainlm function is selected as the training function, the Tan-Sigmoid function is selected for the hidden layer, and the linear function is selected for the output layer. Among the 64 sets of simulation results, 56 sets of simulation results are randomly selected as training sample data, and the remaining eight sets are comparison and verification data, that is, the true value of the sample. In order to improve the accuracy of the BP neural network prediction model, it needs to be further optimized.
The genetic algorithm is used to optimize the weights and thresholds in the BP neural network, and the real number coding method is used to genetically code the individuals in the initial population. The elite retention strategy is selected to prevent the better individuals from being eliminated, the crossover probability is 0.2, and the mutation probability is 0.02. After evolution, the optimal individual is obtained, and the optimal individual is decoded and assigned to the BP neural network, and the new weights and thresholds generated by the optimal solution are used for training, and the final prediction result is obtained. The process of optimizing BP neural network using genetic algorithm is shown in Figure 4.

Validation of GA-BP neural network prediction model
In order to verify the accuracy of the constructed GA-BP neural network prediction model, the relative error between the predicted value of the target and the true value of the prediction model is calculated according to formula (2): Relative error = Predictive value À Sample true value j j Sample true value 3 100%  samples and the true values of the samples. It can be seen from the figure that the prediction results of extrusion torque, temperature, and tooth height using the GA-BP neural network prediction model constructed in this paper are basically consistent with the true values of the samples. According to formula (2), the relative errors of the three predictive indicators are calculated as shown in Figure 5(b).
It can be seen from Figure 5(b) that the prediction relative error range of extrusion torque is 0.4%-2.7%, the prediction relative error of extrusion temperature is within 8%, and the prediction relative error range of tooth height rate is 0.9%-3.4%. It shows that the GA-BP neural network prediction model constructed in this paper has high accuracy in the prediction of extrusion torque and tooth height, but it has a slightly worse prediction of temperature. The prediction model can be used to optimize the process parameters and predict the extrusion quality in the cold extrusion process of internal threads.

Test verification
In order to verify the prediction accuracy of BP-GA neural network for extrusion torque, extrusion temperature, and tooth height rate, the process parameters that are different from those in Table 1 are selected for numerical simulation and experiments. By comparing the results obtained by the above three methods, the difference between the extrusion torque, the extrusion temperature, and the tooth height rate is obtained. Finally, the surface hardness of the internal thread was measured, and the hardness of the metal after being extruded was obtained.

Test process
In order to verify the prediction accuracy of the GA-BP neural network prediction model for the extrusion torque, temperature, and tooth height rate during the cold extrusion of internal threads, a test was designed to verify it. The diameter of the bottom hole of the workpiece has the greatest impact on the extrusion torque and extrusion quality, followed by the impact on the extrusion temperature. Therefore, test pieces with different bottom hole diameters were prepared, and the cold extrusion test of internal threads was carried out at the same extrusion speed and lubricating fluid (corresponding to the friction coefficient in the simulation).
When the training set data is obtained, the size of the bottom hole diameter of the workpiece in Table 1 has been used as the training sample. In order to avoid the interference of the same processing parameters to the prediction results, the bottom hole diameter and extrusion speed are different from those in Table 1 to verify the prediction results.
A rough specimen with a thickness of 10 mm was cut from a 45# steel bar with a diameter of 30 mm. Using the combined processing method of twist drill and reamer, six prefabricated bottom holes of 7.20, 7.26, 7.32, 7.38, 7.44, 7.50 mm were machined in the center of the blank of the test piece. The finished test piece is shown in Figure 6(a). The MP-3 extreme pressure lithium grease is selected for lubrication, and the test is carried out on the DMG MORI-DMU50 fiveaxis machining center at an extrusion speed of 45 r/ min. During the test, the three-way dynamometer is fixed on the workbench, the special fixture is fixed on the Kistler-9257B three-way measuring instrument, and the workpiece is clamped on the fixture. The extrusion torque and extrusion temperature during the processing are input to the computer through the data acquisition card. Because the temperature sensor cannot be placed inside the metal deformation zone of the workpiece, it is placed under the inner wall of the prefabricated bottom hole of the workpiece to measure the surface temperature of the inner wall of the bottom hole. The obtained test value is theoretically lower than the actual extrusion temperature of the metal deformation zone. The test method is shown in Figure 6(b).
After the extrusion and tapping, the wire cutting machine was used to cut the test piece to obtain the normal section of the internal thread, and the cross section of the internal thread after extrusion was observed on the FOIC-JVC300T automatic video measuring instrument as shown in Figure 7.

Test results
The maximum extrusion torque and extrusion temperature in the extrusion process obtained from the experiment were counted, and the internal thread tooth height ratio corresponding to the diameter of each bottom hole in Figure 7 was measured. The experimental values of extrusion torque, temperature, and tooth  height rate compared with the simulation values obtained by numerical simulation and the predicted values obtained by the BP and BP-GA neural network model, as shown in Figure 8.
It can be seen from Figure 8 that the predicted value, simulation value, and experimental value of the tooth height rate, extrusion torque and extrusion temperature have basically the same changing trends. During the test, it is impossible for the lubricating fluid to completely enter the contact area between the extrusion tap and the workpiece, and the high temperature generated during the extrusion process will affect the characteristics of the lubricating fluid and weaken the lubrication effect, so the test value of the extrusion torque is greater than the simulated value. Because the temperature of the metal deformation center area cannot be measured in real time, the experimental value of the extrusion temperature is lower than the simulated value, but the change trend of the two is the same.
In order to compare the prediction accuracy of the BP neural network and the BP-GA neural network, we calculated the error between the prediction results of the two methods and the simulation value, as shown in Figure 9. The test prediction result of BP-GA neural network model is better than the corresponding result of traditional BP neural network model. It can be seen from the Figure 9 that using the BP-GA neural network model method, the fitting degree of the prediction result curve of the training sample and the test sample is better than that of the traditional BP neural network. That the prediction accuracy of the unoptimized BP neural network is low, the maximum error of the predicted values of tooth height, extrusion torque, and extrusion temperature reached 10.9%, 30.6%,29.7%, respectively. The prediction accuracy of the BP-GA neural network optimized by the genetic algorithm is greatly improved, and the maximum errors of the predicted values of the tooth height rate, extrusion torque, and extrusion temperature are 4.1%, 7%,6.1%, respectively. This shows that the BP-GA neural network has higher accuracy.

Analysis of internal thread forming quality
The profile of the cross-section of the internal thread after extrusion with a bottom hole diameter of 7.38 mm through a metallographic microscope is shown in Figure 10. It can be seen that the thread profile is full and the contour is complete. Although there is a U-shaped groove on the top of the tooth, the tooth height rate has reached 78.4% after measurement and calculation. It can be seen from Figure 1 that the thread connection strength is almost 100% in this case, which satisfies strength requirements.   The surface morphology of the internal thread spiral is complex and it is difficult to measure the hardness. Therefore, the axial section of the internal thread is taken at different positions to measure the surface hardness of the extruded internal thread and the hardness of the original material. 15 The hardness measurement results are shown in Figure 11.
It can be seen from the results that the hardness of the internal thread extrusion surface layer is significantly higher than that of the original material. The farther away from the surface layer, the lower the hardness, the surface hardness of the internal thread after extrusion is 15%-28% higher than that of the original material. This is because when the metal is plastically deformed during the cold extrusion of the internal thread, all the crystal grains are elongated and squashed due to the turning of the slip surface. When large deformation occurs, grain slippage, twinning, and fibrosis of the metal structure will cause work hardening. In the cold extrusion process, the work hardening produced on the surface of the internal thread will greatly increase the strength and hardness of the metal, enhance its fatigue resistance, and increase the service life of the internal thread.
The arrangement density of metal fibers and the degree of plastic deformation of the material have a direct effect on the thickness of the hardened layer, and the degree of work hardening is usually proportional to the two.

Conclusion
(1) A GA-BP neural network prediction model was constructed based on MATLAB, and the extrusion torque, temperature and thread forming quality in the cold extrusion of internal threads were effectively predicted. The relative error of the prediction of extrusion torque was between 0.4% and 2.7%. The relative error of prediction of extrusion temperature is within 10%, and the relative error of prediction of tooth height rate, which characterizes extrusion quality, is between 0.9% and 3.4%. (2) The accuracy of the GA-BP neural network prediction model is further verified through experiments. The results show that the GA-BP neural network prediction model constructed in this paper has high prediction accuracy and can accurately predict extrusion temperature, torque, and internal thread tooth height rate. This provides a way for the effective prediction of the extrusion process and forming quality of the cold-extrusion internal thread. (3) Extruded internal thread has the highest hardness at the bottom of the tooth, followed by the hardness of the flank, and the hardness of the top of the tooth is the smallest. The surface hardness of the internal thread is increased by 15%-28% relative to the original material, and the hardness of the surface metal of the internal thread is proportional to the density of the metal fiber arrangement.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.