1 Introduction

Optimization of the injection molding process is a multi-objective, non-linear process. In recent years, many researchers use the combination of back propagation (BP) and genetic algorithm (GA) to optimize the injection molding process parameters and reduce the warpage or other defects of plastic parts [1,2,3,4]. Since then, many algorithms in the field of machine learning have been applied in the process of injection molding process optimization. Chen proposed a self-organizing competitive-back propagation neural network (SOM-BPNN) mathematical model to create a dynamic quality prediction model, and Taguchi’s experimental parameter design method was used to enhance the performance of the network. The experimental results show that BPNN enhanced by the SOM can accurately predict the weight of plastic products [5]. Yildiz et al. used the Taguchi experiment and analysis of variance to determine the combination of parameters that meet the small shrinkage of polypropylene (PP) and polystyrene (PS) materials and further established an artificial neural network model to predict the shrinkage. The errors of the prediction results of PP and PS are 8.6% and 0.48% [6]. In 2008, Shi et al. proposed an adaptive optimization method based on an artificial neural network model. The artificial neural network and the experimental design (DOE) method established an approximate functional relationship to optimize warpage and process parameters. After production experiments, it is verified that this method can effectively reduce the warpage of the mobile phone case [7]. In 2013, Shi et al. introduced an artificial neural network (ANN) replacement model based on sequential optimization design methods and proposed a parameter sampling evaluation (PSE) strategy. The ANN model can establish an approximate function to represent the non-linear relationship between design variables and quality indicators; PSE completes the process of optimization evaluation, and the results show that the sequential optimization method standard based on PSE sampling can converge faster and more effectively approach the global optimization scheme [8]. Xu et al. introduced the grey correlation analysis and particle swarm optimization into the optimization model and established a multi-objective mathematical model particle swarm optimization (PSO)-GCANN. Practice results show that the model can help engineers determine the best process parameters [9, 10]. Gao established a Kriging model for the problem of excessive warpage of injection-molded parts. The Kriging model can establish an approximate functional relationship between warpages, replacing the finite element software in the process of optimizing the analysis of warpage, saving a lot of calculating costs [11]. Wang et al. used BP neural network to construct a plastic injection cost estimation model to reduce the complexity of traditional cost estimation procedures, and used the PSO algorithm BP structural parameters to optimize and relatively improve the prediction accuracy of BPNN [12]. Zhao et al. take into account that most injection-molded parts have a sheet-like geometry, can use strip analysis models to approximate computer simulation software for predictive injection molding, and use the PSO algorithm to find process parameters in feasible spaces. Practice results show that the model provides engineers with process parameters that meet quality requirements without relying on experience [13]. In 2015, Zhao et al. developed a framework to solve the multi-objective optimization part of the Pareto optimal plastic quality for injection molding process parameters and proposed a two-stage optimization system. In the first stage, the efficient global optimization (IEGO) algorithm was used to approximate the non-linear relationship between the machining parameters and measures of part quality. In the second stage, the non-dominant use of genetic algorithm based on ordering II (NSGA-II) to find a better design solution, with better convergence near the Pareto optimal front [14]. Jin et al. integrated a variable complexity method (VCM), constrained non-control ordering genetic algorithm (CNS-GA), back propagation neural network (BPNN), and MoldFlow analysis to propose a method for locating the Pareto optimal solutions. Among them, the variable accuracy prediction model is used in different optimization stages in the formability evaluation stage. The two BPNNs serve as approximate models for effective formability evaluation with low accuracy and are connected to the CNS-GA to intelligently constrain the Pareto optimal solution to constrain multiple targets. Case studies show that the proposed method has obvious advantages to obtain the best parameters over existing parameters and is suitable for the scheme of injection molding practice [15]. Chen and others used the Taguchi orthogonal arrays to perform experimental work. According to the results of the Taguchi experiment, the best combination setting of product quality is calculated by analyzing the signal-to-noise ratio, then using the analysis of variance (ANOVA) to determine the important factors of control, and using a genetic algorithm (PSO-GA) to find the optimal parameter combination [16]. In 2014, Kitayama et al. used short-shot defects as constraints for simulation analysis and used a radial basis function (RBF) neural network and a sequential approximation optimization (SAO) method to optimize the amount of warpage of plastic parts. The results of numerical stimulation show that variable pressure curves are one of the effective methods of warpage. In 2015, Kitayama still used the SAO-RBF algorithm to identify the boundary between cycle time and warping, and to optimize the structural parameters of the conformal cooling channel. Numerical simulation results show that the optimized cooling water channel has better cooling performance than before [17, 18]. Xu et al. proposed an algorithm combining artificial neural network and PSO to optimize the injection molding process. A back propagation neural network model was established to map the complex non-linear relationship between process parameters and product mechanical properties (Fig. 1). The PSO algorithm interfaces with this prediction model to optimize process parameters, taking polycarbonate (PC) windows as an example; the mechanical response value of thin-shell polymer products manufactured by optimizing the injection molding process becomes larger [19].

Fig. 1
figure 1

Optimization road map

The above research shows that the experimental design DOE combined with the intelligent algorithm ANN can contribute to improving the quality of plastic products. This paper presents a prediction model based on support vector machine (SVM)-BP-GA to reduce warpage and volume shrinkage during plastic injection molding (PIM). The data used is for two parts; the training data comes from the response surface method, and the prediction data comes from the orthogonal experiment. This paper uses the response surface method to design the experiment. The mold temperature, melt temperature, holding time, holding pressure, cooling time, and injection time were taken as input variables, and warpage and volume shrinkage were taken as optimization targets. All optimization algorithms in this paper are implemented using Matlab toolbox combined with code. The optimization process is divided into three stages. In the first stage, the same design variable range is used. The orthogonal method and the response surface method are used to generate 25 and 69 sets of experimental data. The response surface method is used to find parameter values that meet the minimum volume shrinkage and warpage. In the second stage, based on the data generated by the response surface test, a double hidden-layer BP neural network is designed on the software Matlab, and the GA global optimization algorithm is used to optimize the weight and threshold of the BP neural network to further optimize the warpage and volume shrinkage. In the third stage, in order to improve the prediction accuracy of the model, an SVM-GA-BP prediction model was established, and a SVM was used to optimize the GA-BP prediction error to minimize the error.

2 Response surface experiments and MoldFlow simulations

2.1 Model information

The length, width, and height of the harness protection frame are 346, 87, 142 mm. In this paper, the Moldflow software was used to generate a double-layer surface mesh (Fig. 2). The mesh division is to make the model into a finite element. After meshing, the displacement increment of the element node is a basically unknown quantity in the finite element iteration process. Finite element meshing is a crucial step in the numerical simulation analysis of finite elements, which directly affects the accuracy of subsequent numerical calculation and analysis result.

Fig. 2
figure 2

3D model diagram. a 3D model in UG. b Finite element model in MoldFlow

The number of triangular elements is 160436, the maximum aspect ratio is 9.54, and the cell mesh matching rate is 92.7%. The material is PP, the grade is BJ530, and the manufacturer of the material is Tonen Chemicals.

2.2 Design of response surface experiments

Because the response surface method can process variables in continuous space, it can accurately express the non-linear relationship between design variables and optimization goals. The selected design variables are mold temperature (A), melt temperature (B), holding time (C), holding pressure (D), injection time (E), and cooling time (F). The upper and lower limits of design variables are selected based on past production experience. The central composite design method is used to establish a 6-factor and 3-level test plan for the injection molding optimization process. The corresponding response targets are warpage and volume shrinkage. Table 1 shows the design variables and corresponding selections. The value range will be tested and analyzed based on the numerical simulation software Moldflow, and a response surface model will be established based on the simulation results, which will provide a reference for subsequent neural network models (Table 2).

Table 1 Parameter level table
Table 2 Test plan and numerical simulation results

2.3 ANOVA of warpage

ANOVA can determine the impact of various design variables on the response target during the experiment.

The statistical significance of the P value is shown in Table 3, and Table 3 shows the analysis result of the variance of the warpage. According to the significant evaluation criteria, it can be known that the P value of the mathematical model is far less than 0.0001, which indicates that the regression model response to the effect of (warpage) is very significant. In addition, according to the table, the correction coefficient R2 of the model is 0.8123, which indicates that 81.23% of the response value (warpage) for different parameters can be explained by the regression model. The correlation coefficient R2 of the model is 0.9294, which shows that the true value of the response surface model fits well with the predicted value, and the error is small; the signal-to-noise ratio r = 16.02 of the model is much larger than 4, which indicates that the model has sufficient discrimination ability.

Table 3 ANOVA of warpage

2.3.1 ANOVA volume shrinkage

Table 4 shows the results of the ANOVA of warpage. According to the significance criterion, the P value of the mathematical model is far less than 0.0001, which indicates that the influence of the regression model on the response (warpage) is extremely significant. In addition, according to the table, the model’s correction coefficient R2 is 0.8923, which indicates that the response value (volume shrinkage) of 89.23% for different parameters can be explained by the regression model. The correlation coefficient R2 of the model is 0.9189, which indicates that the true value of the response surface model fits well with the predicted value, and the error is small; the signal-to-noise ratio r = 21.448 of the model is much larger than 4, which indicates that the model has sufficient discrimination ability. According to the size of the P value provided by the model, various design variables are evaluated and sorted, that is, B melt temperature > E injection time > C holding time > A mold temperature > F cooling time > D holding pressure. Among them, the P values of B, C, and E are all far less than 0.05, indicating that the effects of melt temperature, dwell time, and cooling time on volume shrinkage are extremely significant, to provide a reference for the training and prediction of neural networks in the second and third stages (Fig. 3).

Table 4 Volume shrinkage
Fig. 3
figure 3

Schematic diagram of neural network structures

The first stage of the work is to obtain design variables that have a significant effect on warpage and volume shrinkage through the response surface test design. Melt temperature, holding time, and cooling time have a greater effect on volume shrinkage; melt temperature, holding time, and cooling time have significant effects on warpage.

3 Neural network design

ANN is a parallel computing model similar to biological neural mechanisms, that is, computer computing is used to simulate the human neural network. It uses computer computing to simulate the neural network of the human brain. BPNN is one of the most representative networks, which can be combined with other algorithms to solve specific engineering problems. It uses a non-linear relationship-supervised learning method to handle the non-linear relationship between input variables and optimization goals. In this study, a three-layer BPNN with two hidden layers is used to construct a prediction model that simultaneously reduces warpage and volume shrinkage. Based on all connected nodes in the previous layer plus an offset value; this value is input into the activation function to obtain forecast result.

3.1 Design of neural networks

3.1.1 Design of input layer and output layer

The content of the first stage shows that the effects of melt temperature, dwell time, and cooling time on the amount of warpage are significant; the effects of melt temperature, dwell time, and injection time on the amount of warpage are significant. Therefore, the input layer nodes of the BP neural network are four, which are the melt temperature, the holding time, the cooling time, and the injection time. The number of output nodes is 2, which represents the amount of warpage and the volume shrinkage.

3.1.2 Hidden layer design

This paper uses a double hidden-layer BP neural network. The generalization ability of the double hidden-layer network is stronger than the single hidden-layer networks. The number of nodes is determined according to the following formula:

$$ h=\sqrt{w+f}+b $$
(1)

The number of hidden nodes in the first layer is 4, and the number of nodes in the second layer is 6. Among them, w and f represent the values of the input layer and output layer nodes, respectively. b is a value between 0 and 10, and h is the number of nodes in the hidden layer.

3.1.3 Selection of functions

“Tansig” function connects input layer with hidden layer, “Purelin” function connects output layer with hidden layer, and the training function is the adaptive learning rate (lr) momentum gradient descent function “Traingdx.”

3.2 Genetic algorithm

Although the traditional BP neural network has good approximation performance, when training the network, it uses the gradient descent algorithm, which is very easy to fall into a local optimum, resulting in poor prediction results. Therefore, consider using genetic algorithm to optimize the weight and threshold of BP neural network, which can suppress the emergence of local optimum, and then get a better BP neural network that can approximate the true law of the data. This algorithm is called GA-BP neural network.

3.2.1 Encoding process

The encoding process mainly encodes the BP neural network weights and thresholds, and the encoding length is n:

$$ n=\mathrm{hidden}\ \mathrm{number}1\times \mathrm{input}\ \mathrm{number}+\mathrm{hidden}\ \mathrm{number}1\times \mathrm{hidden}\ \mathrm{number}\ 2+\mathrm{output}\ \mathrm{number}\times \mathrm{hidden}\ \mathrm{number}\ 2+\mathrm{hidden}\ \mathrm{number}\ 1\times 1+\mathrm{hidden}\ \mathrm{number}\ 2\times 1+\mathrm{output}\ \mathrm{number}\times 1 $$
(2)

3.2.2 Determine moderation function

The fitness value is used to evaluate the individual’s pros and cons. The smaller the fitness value, the better the individual, and the larger the fitness value, the worse the individual; this paper uses the relative error (MAPE) between the true value and the predicted value as a moderate function, as follows:

$$ \mathrm{MAPE}=\mathrm{sum}\left(\mathrm{abs}\left(y1-y\right)\times 100/y\right)/n $$
(3)

Among them, y1 is the predicted value, y is the actual value, and n is the actual number of individuals.

3.2.3 Select operation

Individuals are selected according to the size of the fitness to ensure that individuals with good adaptive performance have more opportunities to reproduce offspring, so that good characteristics can be inherited. The probability of selecting individuals is calculated according to the following formula:

$$ pi=\frac{f(xi)}{\sum \limits_{j=1}^nf(xj)} $$
(4)

3.2.4 Cross operation

The crossover operation refers to the exchange of chromosome fragments to generate two new offspring. This article uses a single-point crossover method: randomly select two individuals to crossover and generate new offspring according to Fig. 4.

Fig. 4
figure 4

Chromosome crossover

3.2.5 Mutation operation

The purpose of the mutation operation is to change the gene value on the chromosome. This article mutates the j gene of the i individual. The operation method is as follows:

$$ {a}_{ij}=\left\{\begin{array}{c}{a}_{ij}+\left(\mathrm{upperbound}-{a}_{ij}\right)\times \mathrm{MutShrink}\times f(g)\ r>0.5\\ {}{a}_{ij}-\left({a}_{ij}-\mathrm{lowerbound}\right)\times \mathrm{MutShrink}\times f(g)\ r\le 0.5\end{array}\right. $$
(5)
$$ f(g)={r}^{\prime }{\left(1-\frac{g}{G_{\mathrm{max}}}\right)}^2 $$
(6)

where upperbound is the upper bound of the gene; lowerbound is the lower bound of the gene; g is the number of previous iterations; Gmax is the maximum number of evolutions; r , r’ is the random number in between 0 and 1.

4 Optimization process

This paper uses the BP-GA algorithm to optimize the warpage and volume shrinkage of the injection process.

4.1 The optional process of BP-GA

The study use the same input variables as shown in the figure, uses the GA algorithm to optimize the weight and threshold of BP, and returns the design parameters corresponding to the optimal target. As can be seen from Fig. 5, after 120 iterations of optimization, the warpage and volume shrinkage were 1.017 mm and 16.353%, respectively. The parameters of the optimized input variables are shown in Table 5.

Fig. 5
figure 5

The process of GA optimizing BP. a Genetic algorithm iterative curve. b Relative error of GA-BP neural network prediction (warpage). c Relative error of GA-BP neural network prediction (volume shrinkage)

Table 5 Comparison of optimization results

4.2 Finite element simulation verification

After the analysis of variance, the response surface method recommended a set of variable parameters. The BP-GA algorithm also recommends a set of variable parameters, as shown in Table 5. By comparing the two methods, the results predicted by the BP-GA algorithm are closer to the results of finite element simulation. As shown in Fig. 6 a and b, after the optimization of the response surface method, the warpage and volume shrinkage were 1.92 mm and 19.95%, respectively. As shown in Fig. 6 c and d, optimized by the GA-BP algorithm, warpage value and volume shrinkage are 1.05 mm and 16.07%, respectively.

Fig. 6
figure 6

Comparison of optimization results. a Warping deformation distribution. b Volume shrinkage distribution. c Warping deformation distribution. d Volume shrinkage distribution

5 Prediction process

5.1 Support vector machine introduction

SVM is a machine learning method based on statistics. It improves the ability of learning machine by seeking the minimum structural risk and achieves the minimization of confidence range. In the case of a small statistical sample size, it can find its internal statistical law. As shown in Table 6, we designed an orthogonal experiment with 6 factors and 5 levels using the same design variable range of the response surface; the purpose is to provide more training data for the algorithm in order to improve the prediction accuracy of the algorithm.

Table 6 Experiments of orthogonal matrix and simulation results

5.2 Prediction steps

This paper uses orthogonal experiments to generate data for prediction and uses the difference between the predicted result and the true value as the output results. The first step is to use a simple BP neural network for prediction and obtain the preliminary error (Fig. 7).

Fig. 7
figure 7

Comparison between the true value and the predicted value of BP. a Prediction of BP (warping). b Prediction of BP (volume shrinkage). c Relative error of warping. d Relative error of volume shrinkage

The second step uses the BP algorithm enhanced by the GA algorithm to make predictions, and the error is reduced compared with the previous one (Fig. 8).

Fig. 8
figure 8

GA-BP prediction result. a Prediction of GA-BP (warping). b Prediction of GA-BP (volume shrinkage). c Relative error of GA-BP (warping). d Relative error of GA-BP (volume shrinkage)

In the third step, the error between the predicted value of the GA-BP and the actual value is used as the output of the SVM, and the original data is used as the input of the SVM (Fig. 9).

Fig. 9
figure 9

SVM-BP-GA prediction results. a Prediction of GA-BP-SVM (warping). b prediction of GA-BP-SVM (volume shrinkage). c Prediction of GA-BP-SVM (warping). d Prediction of GA-BP-SVM (volume shrinkage)

5.3 Comparison results

By using the Matlab software, the prediction results of the three algorithms for errors are integrated into the same window, and the error optimization results of the three algorithms are compared, as shown in Fig. 10. As can be seen from the figure, the BP prediction error < BP-GA prediction error < SVM-BP-GA prediction error, and after SVM corrects the error, the predicted value is closer to the data provided by the orthogonal experiment and tends to be stable. The results show that the SVM-BP-GA algorithm is more accurate in predicting the warpage and volume shrinkage of automobile wire harness protection frames and can provide a reference for similar injection products.

Fig. 10
figure 10

Comparison of prediction results of the three algorithms. a Comparison of predicted results (warping). b Comparison of predicted results (volume shrinkage). c Comparison of relative (warping). d Comparison of relative (volume shrinkage)

6 Conclusion

In this study, the design parameters in the multi-objective optimization injection process are divided into three stages. The relationship between the output target and the input target is obtained by using the response surface method and the BP-GA algorithm. This article can draw the following results:

  1. (1)

    Based on the response surface method and MoldFlow simulation, using the analysis of variance method, the design variables that significantly affect the amount of warpage and volume shrinkage are melt temperature, holding time, injection time, and cooling time. The response surface method gives the values corresponding to the recommended parameters, which are the mold temperature of 37.503 °C, the melt temperature of 234.639 °C, the holding time of 4.982 s, the holding pressure of 96.972 Mpa, the injection time of 1.965 s, and the cooling time of 20.632 s.

  2. (2)

    By using the GA-BP algorithm, the same input variables are taken. The warpage and volume shrinkage are optimized to obtain the design parameters corresponding to the smallest and smaller warpage and volume shrinkage. The mold temperature was 21.427 °C, the melt temperature was 201.355 °C, the holding time was 6.184 s, the holding pressure was 190.001 Mpa, the injection time was 1.965 s, and the cooling time was 23.603 s. By using the GA-BP algorithm, the same input variables are taken. The warpage and volume shrinkage are optimized to obtain the design parameters corresponding to the smallest and smaller warpage and volume shrinkage. The mold temperature was 21.427 °C, the melt temperature was 201.355 °C, the dwell time was 6.184 s, the dwell pressure was 190.001 Mpa, the injection time was 1.965 s, and the cooling time was 23.603 s. After the MoldFlow analysis, the GA-BP algorithm is better than the response surface method in optimizing warpage and volume shrinkage.

  3. (3)

    In order to make a more accurate prediction of the injection molding process, the SVM-BP-GA prediction model was established, that is, SVM was used to improve the BP-GA algorithm to further reduce the error between the true value and the predicted value. The calculation results show that the maximum prediction errors of the SVM-BP-GA algorithm for warpage and volume shrinkage are 0.93% and 1.9%, respectively.