# Prediction of Short-Shot Defects in Injection Molding by Transfer Learning
## 3 Methodology
### Transfer Learning of CAE Pre-trained Model  
This study employs a transfer approach involving both virtual analysis and real-world molding. Initially, a neural network model is trained using CAE simulation data for the LT60 long flat plate model. Subsequently, transfer learning of the network model is conducted using data obtained from actual injection molding experiments. This ensures that the transferred neural network model is suitable for real-world machine predictions. During the transfer learning process, because the same model is used for secondary training, the data from actual injection molding experiments should closely resemble or match the simulated data. A significant disparity in data may result in suboptimal transfer learning outcomes and potentially impact the accuracy of the final predictive model applied to actual scenarios. The process flow is illustrated in Figure 8.  
In the analysis software Moldex3D's simulation data, the main varying parameters are injection speed, holding pressure, holding time, material temperature, and mold temperature. When adjusting the parameters, the default values provided by Moldex3D are primarily used as reference. Analyzing different parameter combinations, a total of 3366 simulation data points were generated, with a ratio of 4:6 between short-shots and non-short-shots. After data preprocessing and correlation analysis, the input for the pre-trained model consisted of 20 feature parameters, and the output was used to indicate whether a short-shot occurred. The data were split into 80% training data and 20% testing data, with an additional 20% taken from the training data for validation. The model architecture consisted of 2 hidden layers, with 36 neurons in the first layer and 20 neurons in the second layer. To prevent overfitting during model training, dropout regularization was applied after both hidden layers, with a dropout rate of 0.2 for each layer. The model architecture is illustrated in Figure 9. Regarding hyperparameter settings, the learning rate was set to 0.002, ReLU and Sigmoid activation functions were used for respective layers, the optimizer was Adam, the batch size was set to 33, and the number of epochs was set to 340. The hyperparameter settings are summarized in Table 2.  
Figure 8: Process flowchart for transfer learning of the CAE pretrained model. In the selection of hidden layers for the transfer learning model, five different transfer methods were employed to train the transfer learning model, and the results of each method were compared. The methods were as follows:  
* Transfer and freeze the two hidden layers of the pre-trained model, training only the third hidden layer of the new model;
* Transfer the two hidden layers of the pre-trained model, and freeze the weight values of the first hidden layer, training only the second and third hidden layers of the new model;
* Transfer the two hidden layers of the pre-trained model and freeze the weight values of the second hidden layer, training only the first and third hidden layers of the new model;
* Transfer and freeze the first hidden layer of the pre-trained model, training only the second and third hidden layers of the new model;
* Transfer and freeze the second hidden layer of the pre-trained model, training only the first and third hidden layers of the new model. As shown in Figure 10, during the training process of the first, second, third, and fourth transfer learning methods, the model's loss exhibited a clear decreasing trend in the training set (blue line). However, there was a simultaneous increase in the validation set (green line), indicating the occurrence of overfitting during the training process. In contrast, for the fifth transfer learning method, the model's loss showed a noticeable decrease in both the training and the validation set, with minimal differences between them. This suggests that the model possessed good generalization capabilities. Therefore, this study employed the fifth method for transfer learning.