## 3 Results
### Residual Stress Prediction Based on UNet Architecture  
The U-Net architecture accepts images as its input and output. The length and width of the images (in pixels) are equal to the number of elements along the horizontal and vertical directions of the finite element model, respectively. Each pixel in the image represents the element temperature or stresses at the integration point position of the finite element. Different from the classification problems, the regression U-Net architecture established in this paper needed to output the stress components of each element. For the model in Figure 3, the numbers of input and output variables were 1024 (element temperature \(T\)) and 3072 (stress components \(\sigma_{x}\), \(\sigma_{y}\) and \(\tau_{xy}\)), respectively. Owing to the multitude of variables, successful training of the neural network was a challenge. However, to improve the prediction accuracy, this large-scale prediction task was decomposed into multiple sub-tasks. Task decomposition was divided into two steps. In the first step, the whole image was divided into four sub-images labelled as 1-4, that is, the four black bold line boxes as shown in Figure 4, with each sub-image containing 16 \(\times\) 16 pixels. However, edges were produced between sub-images after image segmentation and large errors were caused when the neural network learned the image features due to the lack of pixels near these edges. Consequently, to diminish this edge effect, three more sub-images with the same size (16 \(\times\) 16 pixels), that is, the red dash line boxes labelled as 3-2 in Figure 4, were created in the second step. Moreover, the edges generated in the first step should be located in the middle of the red sub-images as far as possible. Following this processing, seven networks were to be trained. Further, when the model needed to be restored to its original size after the neural network learning for each sub-image, the pixel values on the segmentation edges of sub-images 1-4 were overwritten by those at the same positions of sub-images 5-7. Figure 3: Fourpoint bending model and simulated residual stress field: (**a**) four-point bending model; (**b**) simulated residual stress field (\(\sigma_{x}\)). According to the four-point bending simulation results shown in Figure 3b, the range of residual stress was from \(-\)200 to 200 MPa. For an assumed coefficient of thermal expansion (1.5 \(\times\) 10\({}^{-5}\)/\({}^{\circ}\)C), the temperature range of elements was determined to be from \(-\)130 \({}^{\circ}\)C to 130 \({}^{\circ}\)C via the trial and error method. In this work, the dataset was obtained by providing different temperature fields in the finite element model and extracting the corresponding stress fields. In total, 80% of the dataset was used to train the CNN model and the remaining 20% was used for model verification. However, the size of the dataset has an important effect on the prediction accuracy of a model. Too small a dataset results in insufficient model feature learning, while too large a dataset causes very long model training time. Therefore, to determine the appropriate size of dataset, three analyses were performed with dataset sizes equal to 8260, 10,260 and 12,260, respectively. Figure 5 shows the root-mean-square errors (RMSE) for model verification of the three analyses. The RMSE was defined as  
\[F=\sqrt{Q} \tag{3}\]  
where \(Q\) is calculated using Equation (1). It is evident, from Figure 5, that the dataset size used in this paper had a slight effect on the prediction accuracy of the model, indicating that the amount of data required for neural network learning was reached. In contrast, the RMSE was the smallest when the dataset size was 10,260; thus, the subsequent study will be conducted based on this dataset. Only the residual stresses at a finite number of points can be measured by experimental testing and it is very important to inversely determine the full-field residual stress according to the measured results at these points [27].