A finite element-convolutional neural network model (FE-CNN) for stress field analysis around arbitrary inclusions

This study presents a data-driven finite element-machine learning surrogate model for predicting the end-to-end full-field stress distribution and stress concentration around an arbitrary-shaped inclusion. This is important because the model’s capacity to handle large datasets, consider variations in size and shape, and accurately replicate stress fields makes it a valuable tool for studying how inclusion characteristics affect material performance. An automatized dataset generation method using finite element simulation is proposed, validated, and used for attaining a dataset with one thousand inclusion shapes motivated by experimental observations and their corresponding spatially-varying stress distributions. A U-Net-based convolutional neural network (CNN) is trained using the dataset, and its performance is evaluated through quantitative and qualitative comparisons. The dataset, consisting of these stress data arrays, is directly fed into the CNN model for training and evaluation. This approach bypasses the need for converting the stress data into image format, allowing for a more direct and efficient input representation for the CNN. The model was evaluated through a series of sensitivity analyses, focusing on the impact of dataset size and model resolution on accuracy and performance. The results demonstrated that increasing the dataset size significantly improved the model’s prediction accuracy, as indicated by the correlation values. Additionally, the investigation into the effect of model resolution revealed that higher resolutions led to better stress field predictions and reduced error. Overall, the surrogate model proved effective in accurately predicting the effective stress concentration in inclusions, showcasing its potential in practical applications requiring stress analysis such as structural engineering, material design, failure analysis, and multi-scale modeling.


Introduction
Inhomogeneous distribution of stress around discontinuity, holes, or defects [1], which can ultimately result in component failure, is commonly observed in engineering structures and experimental specimens [2], and over decades, the study of stress distribution in two-dimensional elastic media containing holes or defects has captivated researchers due to its practical applications and intricate mathematical aspects [3,4].In engineering structures, holes are incorporated to provide maintenance access, functionality, thermal management, weight reduction, or fulfill specific service requirements [5][6][7].In addition, with the rapid advancements in the field of additive manufacturing, engineering designs have become increasingly intricate, opening up possibilities for the incorporation of a wide range of holes or inclusions with precise control over placement, shape, and size, and this results in more intelligent designs to enhance functionality, improve performance, or achieve weight reduction objectives [8,9].Meanwhile, the presence of these inclusions also introduces weaknesses in the structure, leading to stress concentration and potential structural failure [10].
Therefore, stress analysis is of utmost importance during the design process to ensure the safety and reliability of these structures.
The significance of stress concentration analysis extends to many engineering disciplines such as automotive [11], aerospace [12], construction [13], biomechanics [14], etc. Significant effort has been made within the scope of manufacturing to identify the impact of pores or defects on the performance of printed parts [15].Smith et al [16] studied the effects of large lack of fusion defects in additively manufactured 304 l stainless steel which proved to significantly reduce the tensile strength, ductility, and fatigue life of the material.Biswal et al [17] reported that porosity decreases fatigue strength and presented a mechanistic approach to quantifying the influence of gas pore characteristics on fatigue strength in additively manufactured Ti-6Al-4V.Finite element (FE) analysis revealed stress concentration factors for different pore geometries, with subsurface pores near the free surface identified as the most critical.Nicoletto et al [18] investigated the effect of pores introduced during the casting process on the fatigue performance of Al-Si alloys.They discussed that metallography alone does not provide accurate estimates of defect size, thus additional analysis techniques such as x-ray computed tomography were employed to characterize the size and morphology of casting pores.Cao et al [19] studied the stress concentration mechanism of pores, where larger pore radii result in higher stress values at the pore perimeter.They showed that the presence of large-size or concentrated pore distributions reduces the strength of the metal due to increased stress concentrations.
Due to the far-reaching implications across various engineering disciplines, considerable effort has been dedicated to analyzing stress concentration around defects and holes using a combination of analytical and computational approaches [20,21].Sharma [22] utilized Muskhelishvili's complex variable method [23] to derive general solutions for stress distribution around polygonal holes in an infinite plate subjected to arbitrary biaxial in-plane loadings.The impact of hole geometry (limited only to polygonal cut-outs with 3-7 vertices) and loading patterns on stress concentration factors were examined, and comparisons with FE analysis demonstrated the validity of their approach.Rezaeepazhand and Jafari [24] studied stress distribution in plates with central cutouts.The analytical investigation emphasizes the load-bearing capacity and stress concentration effects of variously shaped cutouts in infinite plates under uniaxial tension.They demonstrated the accuracy of the analytical solution by comparing the results with FE methods, which highlighted the importance of parameters such as cutout shape, bluntness, and orientation in altering the stress concentration factor of perforated plates.Jafari and Ardalani [25] studied the stress distribution around holes in finite metallic plates under a plane stress state and uniaxial loading condition using the same theorem [23].By validating with numerical simulations, they showed that analyzing stress distributions in finite plates using the theory of infinite plates can lead to significant errors.More recently, Zhu and Wu [26] presented a generalized procedure for obtaining analytical approximations of stress fields in planes containing multiple complex-shaped holes.They applied virtual tractions are the hole boundaries to obtain the final stress solution through the superposition of individual problems.The accuracy and precision of their proposed method were established with good agreement with FE results and high precision near hole corners.
Existing research has extensively employed analytical and computational methods to predict the stress field surrounding discontinuities.However, it is evident that data-driven approaches and machine learning (ML) models hold significant potential in this area but have received comparatively less attention.Artificial intelligence, particularly ML, provides the ability to search for optimized solutions and validate anticipated results [27] by leveraging training and test data to generate results that closely align with ground truth [28].Accordingly, deep learning neural network algorithms have found applications in various fields, including robotics [29], structural health monitoring [30], and material sciences [31].Within this context, convolutional neural networks (CNNs) [32] have emerged as a groundbreaking approach in the field of deep learning and have proven transformative in numerous engineering domains [33,34].With their ability to automatically learn and extract intricate features from images, CNNs have revolutionized tasks such as image recognition, object detection, and image classification [32].
In recent years, researchers have employed CNNs to predict the mechanical response of materials [35][36][37].Hoq et al [38] predicted full-field stress responses in random heterogeneous materials using different data-driven methods, including classical ML techniques (artificial neural networks, random forest, and K-nearest neighbors), CNNs, and a modified conditional generative adversarial network (cGAN) [39].Their results show that the deep learning approaches (CNN/cGAN) provide highly accurate predictions with significantly reduced mean squared error and high correlation values compared to classical ML methods.Shargh and Abdolrahim [40] developed a CNN network used for predicting the strength of nanoporous silicon nitride membranes based on their microstructures.Sepasdar et al [41] used CNN for the development of an image-based deep learning framework for predicting the nonlinear stress distribution and failure pattern in microstructural representations of composite materials.Wang et al [42] proposed a deep learning model utilizing a Temporal Independent CNN and a Bidirectional Long Short-term Memory Network to accurately predict the sequence of maximum internal stress in brittle materials, aiming to improve fracture resistance and reliability.Their model achieved high accuracy with an average mean absolute percentage error of 2% relative to test data and a prediction time of approximately 20 s.Khorrami et al [43] developed a U-Net-based CNN as a surrogate model to predict the von Mises stress field in elasto-viscoplastic grain microstructures under uniaxial extension.Their model provided an efficient tool for predicting stress fields in microstructures with varying morphologies and boundary conditions.U-Net architectures have been demonstrated to be prominent encoding-decoding networks, for various mapping tasks.For instance, methodologies have been proposed to reconstruct intricate material maps and decode crystallographic orientations using ultrasonic data [44,45].Further enhancements in the domain introduced tailored deep learning models, such as the Conditional U-Net, to rapidly generate ultrasonic images and bridging physics [46].Moreover, the integration of specialized geometric regularization techniques, like non-uniform rational B-splines with convolutional autoencoders, showcases the versatility of such architectures in predicting scattered geometries [47,48].This paper seeks to build upon these foundational studies, diving deeper into the capabilities and applications of U-Net-like structures in the specified domain.
The reviewed papers demonstrate the potential of ML in accurately predicting various field parameters.However, despite significant progress made in the analysis of defects and inclusions using analytical and computational approaches, further research is needed to explore the potential of ML in characterizing microstructural features, defects, and inclusions.In this paper, we propose a finite element-convolutional neural network (FE-CNN) surrogate model for predicting the end-to-end full-field stress distribution and stress concentration around an arbitrary-shaped inclusion.We train a U-Net-based CNN model using the dataset generated by FE simulations and evaluate the performance of the model through quantitative and qualitative comparisons.In addition, we conduct a series of sensitivity analysis, focusing on the impact of dataset size and resolution of prediction capability of the presented FE-CNN surrogate model.The findings lead to significant implications for applications such as structural reliability prediction, failure prediction, design of structures, and multi-scale modeling approaches.Furthermore, this study bridges the gap between traditional computational methods and ML and provides a fast and reliable tool for studying microstructural features in bulk.Therefore, it finds relevance in emerging fields such as additive manufacturing and non-destructive testing, where the understanding of stress distributions plays a crucial role in ensuring material integrity and product quality.

Methodology
The methodology involved in this study consists of two main steps: dataset generation using FE simulations and the development, training, and evaluation of a deep-learning CNN surrogate model.In the first step, Abaqus/Standard FE software [49] is used to generate a dataset of finite plates with arbitrary polygonal inclusions subjected to uniaxial load.Multiple instances of these simulations are conducted to generate a diverse dataset that captures various configurations of polygonal inclusions.Following this, a data reconstruction process is performed to generate inputs suitable for training the ML model.Next, a deep learning CNN model is developed to analyze and predict the stress distribution using paired images of inclusion shapes and stress distribution around inclusions. Figure 1 Shows the workflow of the presented method in comparison with a typical FE simulation of the same problem.The FE-CNN surrogate model, if provided with accurate training data, provides fast and reliable predictions of this complex computational problem without the need to do complex and time-consuming FE simulations [50][51][52].

FE simulation and dataset generation 2.1.1. FE model development and validation
FE models of a finite plate with a central inclusion were created using the Python scripting tool in Abaqus software [49], which enabled automation, parameter variation, and information extraction within the simulation framework without the need for performing repetitive tasks by the user.Here we focused on an isotropic plate containing an irregular inclusion and the simulations were conducted under the assumptions of a plane stress state and the absence of body forces.The choice of this geometry for the study is due to its fundamental significance in the literature, as it serves as a benchmark case [53].In addition, the material behavior of the plate was assumed to be linear elastic.The plate geometry, material properties, and displacement-controlled boundary conditions were defined using the Python script, and STRI65 elements (6-node triangular thin shell, using five degrees of freedom per node) were selected to mesh the models.comparison of the FE results of models with different hole diameter to plate width ratios with the analytical solution [53], also providing mesh sensitivity analysis results for models with different element length to plate width ratios.
Prior to the generation of the dataset, the FE modeling approach was validated by comparing the stress concentration factor of a circular central hole with the analytical solution (see equations ( 1) and ( 2) where d is the hole diameter, W is the width of the plate, and K t is the stress concentration factor) [53].The analytical solution provided a benchmark against which the FE model's results were compared and mesh size sensitivity analysis was performed.Figure 2(a) shows the geometry and discretization of a model (d/W = 0.3) that was used for validation of the numerical approach, and figure 2(b) shows the comparison of the FE and analytical stress ratio of ten models with different hole diameter-to-width ratios that were considered for assessing the validity of the FE model By comparing the predictions of the effective stress concentration (σ max /σ ∞ ) by the FE model with the analytical solution, the accuracy and reliability of the model were assessed.Moreover, a mesh sensitivity analysis was performed to investigate the influence of different mesh densities on the results [54].The models were run with varying mesh sizes, and figure 2(b) shows the comparison of the FE simulations with different element sizes to plane width ratios (El/W) of 0.010, 0.015, and 0.020.The results showed that for small inclusion sizes, the element size can affect the accurate representation of effective stress concentration, therefore, El/W = 0.010 was chosen to ensure the accuracy of all the FE models.

Random polygon generator
In the next step, we implemented a random polygon generator function using Python scripting tool in Abaqus to represent the arbitrary inclusion at the center of the plate following methods in [55,56].The algorithm starts from a circle and samples points along its circumference, and to introduce randomness and irregularity, we apply angular perturbations (here named irregularity and is controlled with β 1 between 0 and 1) at each step, resulting in unevenly spaced vertices.This randomness is further enhanced by allowing variations in the radial distances of the points from the circle's center (here named spikiness and is controlled with β 2 between 0 and 1).Equation ( 3) can be used to formulate the process: ) where n represents the number of vertices, k = ∑ △ θ i /π , θ i is the angle and r i is the radius between the center of the circle and the ith point.The random perturbation of angular space between points is presented by ∆θ i which follows a uniform distribution that has an upper and lower limit of 2π n − β 1 , and 2π n + β 1 , respectively.In addition, a Gaussian distribution is used for r i with a mean diameter of d * and variance of β 2 [57].The size of the generated polygon can be controlled with d * .By setting the irregularity and spikiness parameters to zero it is possible to generate regular polygons, while higher values produce increasingly irregular shapes resulting in the creation of polygons with varying angles and edge lengths.Some examples of the generated polygons with different numbers of vertices, sizes, irregularity, and spikiness are shown in figure 3.

Dataset generation
The automatic modeling process in Abaqus, implemented using Python scripting, enabled the creation of the dataset consisting of pairs of plate geometries with random inclusion and their corresponding stress distributions.The process involves several steps to generate each data pair as depicted in figure 4. For each new model, first, the solver generates the plate geometry and material properties including elastic modulus and Poisson's ratio.Next, a random polygon is cut from the plate at the center that has a random number of vertices (between 3 to 20), size (0.05 < d * /W < 0.4), irregularity (0.0 < β 1 < 0.5), and spikiness (0.0 < β 2 < 0.5).Once the plate geometry and inclusion are defined, the script specifies the boundary conditions and proceeds to mesh the plate.
Next, the job is submitted for analysis, and post-processing steps are then carried out to extract the stress data out of Abaqus output files and to perform data reconstruction to combine the inclusion characteristics and corresponding stress distribution into a pair within the dataset.This process is repeated for each data pair, resulting in a dataset consisting of one thousand pairs of inclusion geometry and their associated stress distributions.The input data (inclusion geometry) was in binary format where '1' represented material and '0' represented voids.As for the targets, they were normalized to the range of 0-1, based on the minimum and maximum values of the entire target dataset.It the stress fields of the target dataset, the points inside the inclusion had a value of −1 assigned to them.This made it easier for the model to detect the inclusion edge and identify the area inside the inclusion due to the distinct difference between actual dimensionless stress values and values assigned to the inclusion region.
The dataset, consisting of these stress data arrays, is directly fed into the CNN model for training and evaluation.This approach bypasses the need for converting the stress data into image format, allowing for a more direct and efficient input representation for the CNN. Figure 5 summarizes the FE results of the effective stress concentration (σ max /σ ∞ ) for the whole dataset of inclusion with different sizes (d * /W) compared to the analytical model of equations ( 1) and ( 2).This figure reveals that the FE results exhibit a high degree of scattering, indicating variations in the stress concentration among different inclusion geometries.Moreover, it is observed that the stress concentration tends to increase with the size of the inclusion and, the presence of spikiness and irregularities in the inclusion shapes leads to significantly higher stress concentration values compared to the predictions of the analytical model.This suggests that the complex and irregular features of the inclusion geometries have a pronounced impact on the stress concentration behavior and emphasizes the need for an accurate surrogate model for the prediction of the stress field and concentration of inclusions with varying geometrical irregularities.

Deep CNN model
The ML model of this study follows a U-Net CNN [58] structure that is a class of deep learning architectures specifically designed for image-to-image tasks and is commonly used in the field of image segmentation [59].The U-Net architecture features a U-shaped network structure with a contracting path for capturing context and a symmetric expanding path for precise localization [58].This architecture leverages skip connections to  combine high-resolution features from the contracting path with upsampled features from the expanding path, enabling accurate pixel-level predictions [60].U-Net CNN models have proven to be highly effective in a wide range of applications, including image analysis and medical diagnostics [59,61].While they are often associated with medical imaging tasks, U-Net models can also be applied to field data for field prediction tasks.By leveraging the architecture's ability to capture both local and global context information, U-Net models can excel in predicting various field outputs based on training input data.The proposed model follows an encoding-decoding structure (see figure 6) that involves a change of the spatial dimension of the data that allows the network to capture and abstract high-level features in the encoding phase and then reconstruct the output with increased spatial resolution in the decoding phase.
The U-Net model was implemented using TensorFlow [62]. Figure 7 shows the detailed structure of the U-Net model that includes encoder, bottleneck layers, and decoders, and skip connections are made at various points between encode-decoder layers.Six blocks are defined in the encoder part, and each block performs a 2 × 2 max pooling operation with a stride of 2 for downsampling.Subsequently, in the bottleneck, two consecutive 3 × 3 2D convolutions are applied.Likewise, the decoder part consists of six repeating blocks with each block including a 3 × 3 2D convolution, followed by an activation function, and a transpose convolution operation for upsampling.The last decoder block features a convolution-tanh layer to map the 32-channel output of the decoder to a single-channel output.Commonly, U-Net architectures use 3-channel RGB images as input [63] while this model uses only one layer of stress data directly obtained from FE simulation.In addition, figure 7 shows that the network includes three skip layers, which allow the model to capture and utilize context information from earlier layers.The hyperparameters included the use of LeakyReLU activations functions with an alpha of 0.2.The model employed the Adam optimizer for training, with a learning rate of 0.001, beta_1 of 0.9, beta_2 of 0.999, and epsilon of 1e-07.For downsampling, MaxPooling2D with a stride of (2, 2) was used, while UpSampling2D layers are utilized for upsampling in the The dataset was split into training and testing sets, with 900 samples in the training set and 100 samples in the testing set.The model was trained for 200 epochs using the Adam optimizer [62] and the mean squared error loss function was used aiming to minimize the discrepancy between the predicted output and the ground truth values during the training process following equation ( 4) where Y i is ground truth values and Ŷi is the predicted value.After training the performance of the model was assessed through quantitative and qualitative comparisons.Quantitative assessments involve measuring various metrics such as mean squared error, accuracy, and correlation coefficient.Also, stress concentration factors were measured for ground truth and predicted stress fields and compared.

Results
This section presents the results of the model and discusses its accuracy and the corresponding hyperparameters, aiming to assess its performance.The focus lies on evaluating the accuracy of the predictions by quantitively and quantitatively comparing them to the ground truth values.Additionally, a discussion section is presented in section 4 that focuses on the effects of database size and resolutions on the model's performance aiming to gain a comprehensive understanding of the model's capabilities and limitations.As mentioned before, the model's resolution was set to 256 × 256, and the dataset consisted of 900 samples for training and 100 samples for testing.The input data for the model was normalized prior to being used as inputs.This normalization process improved the model's performance and convergence during training.However, when plotting the results, the normalized data was reversed or transformed back to its original scale allowing for a more intuitive understanding of the predictions and their relationship to the original input values.Figures 8(a) and (c) show the comparison between the predicted and ground truth effective stress concentration (σ max /σ ∞ ) for the train and test datasets, respectively.The prediction time of the FE-CNN surrogate model for the entire test data consisting of 100 samples was 1.2 s indicating a higher level of efficiency in comparison to FE simulations.The calculated MSE and correlation for the effective stress concentrations of the training were 0.086 and 0.9740 for the test set was 0.171 and 0.9527.The absolute and relative errors associated with the predicted and ground truth effective stress concentrations of figures 8(a) and (c) for train and test data are presented in figures 8(b) and (d), respectively.In the error figures, the red lines represent the absolute errors, and the blue line represents the relative errors.The presence of low values for both the absolute and relative errors indicates that the model's accuracy is significantly high, and it suggests that the model's predictions closely align with the ground truth values, also demonstrating its effectiveness in capturing and reproducing the patterns present in the data.The training history of the proposed U-Net model is depicted in figure 9.The performance of the model during the training process is evaluated in terms of mean squared error as the loss function.After 200 epochs of training, an MSE of 9.3 × 10 −5 and 5.4 × 10 −5 was achieved for the test and training data as depicted in figure 9.A comparison between ground truth results from FE simulations and FE-CNN surrogate model predictions for four randomly selected inclusion geometries from test data is shown in figure 10.The geometry of these inclusions is shown in figure 10(a) in which the blue color represents the polygon-shaped inclusion.Figures 10(b) and (c) show the ground truth results and FE-CNN surrogate model predictions, respectively.The stress field contours of this study are normalized with respect to the remote stress value (σ ∞ ) taken from an equivalently loaded defect-free medium, and this means that the maximum value in each contour represents the effective stress concentration due to the inclusion.In addition, the absolute error between these two stress fields is shown in figure 10(d).This figure shows that the FE-CNN surrogate model is successful in reconstructing complex stress fields, accurately capturing the complex and irregular shapes of inclusions in all cases.The error contours show that in regions far away from the inclusion boundaries the error is close to zero and higher error values were observed at inclusion boundaries which correspond to the regions where stress concentration is presumed to happen, making such a problem more challenging.This is similar to the previous works in which microstructure features contributed to high error [64,65].Also, in [38] elevated error around similar locations was reported and discussed.It can also be observed that qualitatively, the FE-CNN surrogate model performed better in predicting the stress field of inclusion with fewer complexities (fewer vertices, and lower irregularity and spikiness).Figure 11 shows a visual representation of the middle channel of the output feature map after each max pooling and downsampling layer of the U-Net model during the encoding and decoding process.The encoder-decoder module employed in the model plays a vital role in recovering multiscale features from the previous step [37].As the image passes through the max pooling and downsampling layers, the resolution decreases while capturing important filters such as inclusion shape.This process aids in reducing computational complexity and extracting higher-level representations from the input image.
Another important aspect in the verification of deep learning models is the evaluation of activation sparsity [66,67] which is defined as the proportion of inactive or minimally active neurons within a layer of a neural network.Activation sparsity is used to quantify the percentage of neurons that have low or close to zero activation values compared to the total number of units in the layer, and higher activation sparsity indicates that a significant portion of the neurons within a layer is inactive or minimally contributing to the computation, leading to more efficient and compact representations of the input data also increases the efficiency and interpretability of the training process [68].Figure 12(a) shows an analysis of activation sparsity for different layers as well as the average activation sparsity value in the model.The ununiform sparsity of the model's activations in different layers of the U-Net model is favorable, aligning with the suggestions in the literature [66].Also, an average activation sparsity close to 50% is suggested in the literature [66], and by comparison with figure 12(a), our FE-CNN surrogate model showed acceptable results.Figure 12(b) shows the number of trainable parameters associated with each layer of the U-Net model.Trainable parameters are the learnable weights and biases of the network that are adjusted during the training process [69] and provide an indication of the complexity and capacity of each layer of the network to capture the underlying patterns in the data.The model of this study was characterized by a total of 1335 394 trainable parameters.Notably, these trainable parameters displayed a dense concentration in the regions surrounding the bottleneck due to the larger spatial dimensions of the convolutional layers in those regions, necessitating a higher number of parameters for intricate information processing allowing for a more effective feature extraction process.

Discussion
In this section, we discuss the effect of dataset size and model resolution on the prediction capability and accuracy of the FE-CNN surrogate model.Accordingly, section 4.1 explores the impact of dataset size and section 4.2 focuses on the significance of model resolution in achieving high levels of prediction accuracy.

Effect of the dataset size
Three different models (M-SD, M-MD, and M-LD) with varying training dataset sizes of 100, 500, and 900 inclusions were utilized to study the sensitivity of the surrogate model to the size of the dataset.While having varying train dataset sizes, these models have the same 100 data in the testing set and the same resolution.A detailed summary of these models is provided in table 1 which includes resolution, dataset size, loss of model, correlation of effective stress concentration, and computational time.The correlation values for the M-LD model were 0.974 and 0.953 for the training and test data, respectively, which showed significant improvement in comparison to the 0.938 and 0.859 from the M-SD model.A decrease in the dataset size resulted in a higher susceptibility of the loss test data to fluctuations, which was consistent with previous literature [70].The test and train correlation results presented in table 1 reveal a positive relationship between the train dataset size and the correlation, confirming the expected trend.The observed increase in correlation with larger dataset sizes highlights the significant impact of dataset size on the model's predictive performance [71].The model was trained on a system equipped with dual Quadro RTX 5000 GPUs and 128 GB of RAM.Table 1 shows that the change of database size significantly influenced the computational time needed for training with a 655.5% increase when the train database size changed from 100 to 900 data.Figures 13(a)-(c) presents the results of the analysis of the effective stress concentration predicted by M-SD, M-MD, and M-LD models.These figures compare the predicted effective stress concentration with ground truth value from FE simulations for both train and test data, and points closer to the equality line (X = Y) in the graphs indicate a higher prediction accuracy.Similar to observation for correlations, increasing the dataset size has significantly improved the accuracy of the stress concentration predictions for both test and training data.The larger dataset sizes have allowed the models to capture more diverse patterns in the stress field, resulting in a more precise estimation of the maximum stress at the inclusion boundaries.Particularly, significant improvement is evident for the stress concentration predictions for the same test data in models trained with the 100 and 900 data points (see results of the test data in figures 13(a) and (c).To provide a quantitative analysis, the absolute error histograms for the train and test data reported in figures 13(a)-(c) are presented in figures 13(d)-(f).The histograms reveal that as the dataset size increases, the absolute errors tend to decrease.Notably, the histograms reveal that as the dataset size increases, there are fewer cases in the test results with significantly high values of absolute error.This is shown in figure 13(f) for the M-LD model in which there were no instances with an error higher than two, indicating a high level of accuracy and precision in the model's predictions compared to the results of the M-SD and M-MD models.In addition, shifting to the left trend with an increase in database size can be observed in the histograms, and a significantly higher portion of cases (88% of training data and 77% of test data) show an error near zero in the model with the biggest database size indicating a higher accuracy compared to similar studies from the literature [35][36][37].
The stress field prediction capability of modes with different database sizes (i.e.M-SD, M-MD, and M-LD) are compared in figure 14 for one of the inclusion shapes from test dataset (previously discussed in figure 10).Similar to figure 10, ground truth and prediction stress field, and contour plots of absolute error are presented in figure 14.As the dataset size increases, the predicted stress field aligns more closely with the ground truth, resulting in reduced field prediction error.It is worth mentioning that for the regions far away from the inclusion boundary, all three models provide acceptable field predictions with errors close to zero and elevated error regions happening at inclusion boundaries.Meanwhile, the increase in the database size has contributed majorly to the prediction of the stress values around the inclusion boundary with significantly lower error, indicating that estimating the stress concentration factor may be the most challenging feature of this problem.

Effect of model resolution
Three models were employed to assess the sensitivity to resolution, specifically using array sizes of 64 × 64 (M-SR), 128 × 128 (M-MR), and 256 × 256 (M-LD).These models had the same database size, and their detailed information can be found in table 1.The results showed that increasing the resolution led to improved prediction accuracy, as indicated by the correlation values presented in table 1.This agrees with similar models from the literature [72,73] in which higher resolution led to increased accuracy.Figure 15 shows the training and testing loss of the three models trained with different resolutions.The curves indicate that the training process is consistent across all models, with higher test loss compared to train loss.Additionally, a discernible trend is observed between loss and resolution, suggesting a potential relationship between resolution and prediction accuracy.
Figure 16 presents a comparative analysis of the effective stress concentration ratio predicted by the M-SR and M-MR models with resolutions of 64 × 64 and 128 × 128, respectively.In figures 16(a)    improved prediction accuracy, particularly for the test data where correlation increased from 0.8256 for the M-SR model to 0.9527 for the M-LD model.
Figure 17 shows a detailed examination of the stress field in a zoomed region around the inclusion from test data to assess the impact of resolution on prediction accuracy (see figure A1 in appendix A. 1 for full field estimations of stress field for several inclusions by models with different resolutions).It is evident that higher resolutions result in improved stress field predictions, as indicated by the closer resemblance between the predicted stress fields and the ground truth stress field in figure 17.Furthermore, the absolute error map reveals that higher resolutions exhibit lower error values and smaller erroneous regions round inclusion boundary, highlighting the enhanced accuracy achieved with increased resolution.A comparison between the ground truth stress ratios and the corresponding predicted stress ratios for all data points within the zoomed regions of figure 17

Effect of skip connections
The integration of skip connections in U-Net architecture enhanced the model's ability to capture clear edges of the inclusion.By utilizing skip connections, we aimed to reduce noise and improve the model's capacity to effectively describe inclusion boundaries.Consequently, this made it easier for the model to avoid generating artifacts inside the inclusion region.To provide a more comprehensive understanding of the impact of skip connections on the results, an additional model (the same model as M-SR in table 1 but without the use of skip connections) was trained and the corresponding comparison of the results for the model with skip connections and without the skip connections are presented in figure 19.This comparison clarifies the role of skip connections in achieving the improved edge detection and artifact reduction.Without the use of skip connections, the model struggles to provide accurate predictions.The errors are noticeably higher, and the predicted inclusion boundaries lack sharpness and clarity.In addition, a comparison of predicted effective stress concentration ratios for the entire dataset with ground truth data has been conducted in figure 20 for models with and without skip connections.This comparison also shows a significant reduction in accuracy when skip connections are omitted, further highlighting their importance in achieving accurate predictions.

Limitations
The FE-CNN surrogate model, despite its promising results and accuracy, has limitations, particularly in terms of extrapolation ability.When tested on data with different inclusion features than those used in training, the prediction accuracy of the model significantly decreased.Figure 21 shows several examples of inclusions outside of the training dataset indicating reduced accuracy for predictions on unseen inputs.For instance, figure 21(a) shows the stress field prediction of an inclusion from the test dataset that predicted the effective stress concentration with an error of 4.7%.Meanwhile, figures 21(b)-(d) show the predictions of out-of-center inclusions outside of the dataset that gave an estimation of effective stress concentration with errors of −33.1%, −59.8%, and −64.7%, respectively.While the FE-CNN was accurate in representing the geometry of the inclusion in the output field, a significantly reduced accuracy was observed for the inputs outside the training range of the model.In addition, when the model trained with one inclusion feature was  applied to data with two inclusions (figure 21(d)), accuracy notably dropped with an error of −20.6% in predicting the effective stress concentration.This limitation indicates that the model's generalization is confined to the specific examples and structures within the training set, limiting its efficacy for extrapolating to novel structures.Caution must be exercised when applying the model to scenarios beyond the scope of its training data, and further research is required to enhance its capability for diverse and more complex structural problems.

Conclusions
In this study, we presented a FE-CNN surrogate model for predicting the effective stress concentration around an arbitrary inclusion.The inclusion geometries, along with their corresponding stress distributions, were generated using Python scripting in Abaqus and were used to train a U-Net CNN model.The results of this study demonstrate the accuracy and effectiveness of the FE-CNN surrogate model in predicting the effective stress concentration and stress field around an arbitrary inclusion.The correlation values between the predicted and ground truth stress concentrations were also significant, indicating a strong alignment between the model's predictions and the actual values.
Moreover, the model's efficiency was highlighted by its shorter prediction time compared to traditional FE simulations, making it a valuable tool for efficient stress analysis.The analysis of the model's performance with varying dataset sizes revealed the importance of dataset size in achieving higher accuracy.Increasing the dataset size led to improved predictions and lower errors, particularly for the test data.The investigation into the effect of model resolution highlighted its impact on prediction accuracy.Higher resolutions led to improved predictions and reduced errors, demonstrating the importance of capturing finer details and intricate features of the inclusion geometries.The analysis showed that increasing the model resolution enhanced the alignment between the predicted stress fields and the ground truth, providing more accurate estimations of stress concentration.
Overall, this study holds significant value across various disciplines, particularly in structural reliability prediction, failure prediction, design of structures, and multiscale modeling.The FE-CNN surrogate model offers a reliable and efficient approach for predicting stress concentration, enabling researchers to gain insights into the behavior of materials with complex and irregular inclusion geometries.Moreover, the advancement of additive manufacturing technology has brought irregular inclusion geometries to greater attention, as they pose unique challenges and opportunities for material structure-property relationship and analysis and the proposed methodology, at greater extent, would be useful for the fabrication of complex and customized components with irregular shapes and sizes.In addition, the model's ability to handle large datasets, account for variations in size and shape and accurately reproduce stress fields makes it a valuable tool for studying the effects of inclusion characteristics on material performance.

Figure 1 .
Figure 1.The workflow of the presented method (machine learning-finite element surrogate modeling) for the prediction of stress field and stress concentration on an arbitrary defect in comparison to a typical finite element solution of the same problem.The developed surrogate model of this study focuses on replacing the finite element modeling routines such as defining physics.

Figure 2 .
Figure 2. (a): The geometry and discretization of the developed finite element model for validation purposes, and (b):comparison of the FE results of models with different hole diameter to plate width ratios with the analytical solution[53], also providing mesh sensitivity analysis results for models with different element length to plate width ratios.

Figure 4 .
Figure 4. Schematic of parametric modeling process for generation of the dataset.

Figure 5 .
Figure 5.Comparison of effective stress concentration of all the inclusions in the dataset from FE simulation and analytical model (black line) predictions of equations (1) and (2).

Figure 6 .
Figure 6.Schematic of the CNN network with an encoder-decoder structure that is used in this study as the basis for the FE-CNN surrogate model.

Figure 8 .
Figure 8. Performance evaluation of the model for the training and test data, (a): Comparison between the predicted and ground truth value of effective stress concentration for training data, (b): Absolute and relative errors corresponding to .Figure 8(a), (c): comparison between the predicted and ground truth value of effective stress concentration for test data, (b): absolute and relative errors corresponding to figure 8(c).

Figure 8 (
Figure 8. Performance evaluation of the model for the training and test data, (a): Comparison between the predicted and ground truth value of effective stress concentration for training data, (b): Absolute and relative errors corresponding to .Figure 8(a), (c): comparison between the predicted and ground truth value of effective stress concentration for test data, (b): absolute and relative errors corresponding to figure 8(c).

Figure 9 .
Figure 9. Training history of the proposed U-Net surrogate model.Results are shown for loss (mean squared error), the solid line represents the test data, and the dashed line represents the training data.

Figure 10 .
Figure 10.Four different inclusions were randomly selected from test data for evaluation of the FE-CNN surrogate model, (a): inclusion shape, (b): ground truth results taken from FE simulation, (c): predictions of the FE-CNN surrogate mode, and (d): contour plots of absolute error between ground truth and prediction.

Figure 11 .
Figure 11.Visualization of recovered output after max pooling and downsampling layers in the U-Net model.

Figure 12 .
Figure 12. (a): Layer-wise activation sparsity and average activation sparsity of the U-Net network, and (b): trainable parameters for different layers of the U-Net network.

Figure 13 .
Figure 13.Comparison of the effective stress concentration ratio predicted by M-SD, M-MD, and M-LD models that have 100, 500, and 900 inclusions in the training set, (a)-(c): Predicted vs ground truth estimation of effective stress concentration for M-SD, M-MD, and M-LD models, respectively, and (d)-(f): Absolute error histograms corresponding to 13(a)-(c) for the training and test data.

Figure 14 .
Figure 14.Ground truth and prediction stress field, and contour plots of absolute error for an inclusion from test dataset predicted by, (a): M-SD, (b): M-MD, and (c): M-LD.
and (b) the predicted vs ground truth estimations of the effective stress concentrations for the M-SR and M-MR models are shown.The corresponding absolute error histograms for the training and test data are depicted in figures 16(c) and (d).It is noteworthy that the same figures for the model with a resolution of 256 × 256 (M-LD) were previously presented in figures 13(c) and (f), providing a comprehensive assessment of the model's performance across different resolutions.It can be observed that increasing model resolution

Figure 15 .
Figure 15.Training and test loss vs epoch for three different models with varying resolutions of 64 × 64 (M-SR), 128 × 128 (M-MR), and 256 × 256 (M-LD).That were used to study the sensitivity of the FE-CNN surrogate model to changes in resolution.

Figure 16 .
Figure 16.Comparison of the train and test effective stress concentration ratio predicted by M-SR and M-MR models that have a resolution of 64 × 64 and 128 × 128, (a) and (b): Predicted vs ground truth estimation of effective stress concentration for M-SR and M-MR models, respectively, and (c) and (d): Absolute error histograms corresponding to 16(a) and (c) for the training and test data.The same figures for the model with a resolution of 256 × 256 (M-LD) are presented in figures 13(c) and (f).

Figure 17 .
Figure 17.Zoomed region of the stress field of inclusion from test data to investigate the effect of resolution on prediction accuracy.The rows of figures show the ground truth and prediction stress field, and absolute error contours, (a): Model with the resolution of 64 × 64 (M-SR), (b): Model with the resolution of 128 × 128 (M-MR), and (c): Model with the resolution of 256 × 256 (M-LD).

Figure 18 .
Figure 18.Comparison of ground truth and predicted stress fields for all data points in the stress field analysis performed for inclusion of figure 17, (a): model with the resolution of 64 × 64 (M-SR), (b): model with the resolution of 128 × 128 (M-MR), and (c): model with the resolution of 256 × 256 (M-LD).
is presented in figures 18(a)-(c) for models with a resolution of 64 × 64 (M-SR), 128 × 128 (M-MR), and 256 × 256 (M-LD), respectively.This figure shows that the FE-CNN surrogate model can give accurate predictions of the stress ratio for most points surrounding inclusion across all different model resolutions.However, for the higher-resolution models, there are fewer points with extremely high values of deviation, confirming the conclusions made in the description of figure 17 that higher resolutions lead to lower prediction error.

Figure 19 .
Figure 19.Stress field predictions and error contours from the model with and without skip connections for four random inclusions from the test data.

Figure 20 .
Figure 20.Comparison of the predicted effective stress concentration ratios with the ground truth for, (a): model with skip connections, and (b): model without skip connections.

Figure 21 .
Figure 21.(a): Stress field prediction for inclusion from test dataset, (b)-(d) stress field prediction for out-of-center inclusion inputs outside of the dataset, and (e) stress field prediction for an outside of the dataset input with two inclusions.

Fig. A1 .
Fig. A1.Ground truth and prediction stress field of four different inclusions from test data.Predictions are made with FE-CNN surrogate models with different resolutions.

Table 1 .
Summary of models used to analyze the sensitivity of the FE-CNN surrogate model to dataset size and resolution.Details include resolution, dataset size, loss of model, correlation of effective stress concentration, and computational time.