Photoelastic Stress Field Recovery Using Deep Convolutional Neural Network

Recent work has shown that deep convolutional neural network is capable of solving inverse problems in computational imaging, and recovering the stress field of the loaded object from the photoelastic fringe pattern can also be regarded as an inverse problem solving process. However, the formation of the fringe pattern is affected by the geometry of the specimen and experimental configuration. When the loaded object produces complex fringe distribution, the traditional stress analysis methods still face difficulty in unwrapping. In this study, a deep convolutional neural network based on the encoder–decoder structure is proposed, which can accurately decode stress distribution information from complex photoelastic fringe images generated under different experimental configurations. The proposed method is validated on a synthetic dataset, and the quality of stress distribution images generated by the network model is evaluated using mean squared error (MSE), structural similarity index measure (SSIM), peak signal-to-noise ratio (PSNR), and other evaluation indexes. The results show that the proposed stress recovery network can achieve an average performance of more than 0.99 on the SSIM.


INTRODUCTION
Inspired by the human nervous system, Rosenblatt (1958) proposed the perceptron model, which became the basis of the early artificial neural network (ANN). In recent years, the ANN, especially deep neural network (DNN), has become one of the fastest developing and most widely used artificial intelligence technologies (Sun et al., 2020a;Sun et al., 2020c;Li et al., 2020;Tan et al., 2020;Chen et al., 2021a). Classical research work has proved the excellent performance of DNNs in image classification (He et al., 2016), medical image segmentation (Ronneberger et al., 2015;Xiu Li et al., 2019;Jiang et al., 2021a), image generation (Isola et al., 2017), and depth estimation (Godard et al., 2017;Jiang et al., 2019a). The deep convolutional neural network is widely used in feature extraction of image data (Jiang et al., 2019b;Hao et al., 2021). As an extremely powerful tool, the deep convolutional neural network can provide a new perspective for the application of digital photoelasticity. That is, the deep convolutional neural network can directly learn the corresponding relationship between isochromatic pattern and principal stress difference pattern.
In digital photoelasticity, the fringe patterns that contain the whole field stress information in terms of the difference of principal stresses (isochromatics) and their orientation (isoclinics) are captured as a digital image, which is processed for quantitative evaluation (Ramesh and Sasikumar, 2020). Frequency-domain and spatial-domain analysis methods, such as Fourier transform (Ramesh et al., 2011), phase-shift , step-loading method (Ng, 1997;Zhao et al., 2022) and multiwavelength technology (Dong et al., 2018), are usually used to process the data of isochromatics and isoclinics. However, in the actual industrial scene, the traditional pattern demodulation will face challenges, such as the color difference in the color matching method of the calibration table; the complex geometry of the sample, which makes the pattern complex and difficult to demodulate; and the fringes with different experimental configuration need special analysis, all of which make photoelasticity research a complex process extending to industrial applications.
In recent years, deep learning has shown increasing interest in solving traditional mechanics problems (Chen et al., 2021b;Jiang et al., 2021b;Duan et al., 2021;Tao et al., 2021;Zhang et al., 2022), which is due to deep learning's powerful ability of data feature extraction and representation of complex relationships. In general, deep learning is committed to mining implicit rules of data from a large number of data sets and then using the learned rules to predict the results and hoping that the learned models have good generalization ability Huang et al., 2021;Yang et al., 2021;Chen et al., 2022). Works in optical image processing, such as phase imaging (Gongfa Li et al., 2019;Xin Liu et al., 2021;Sun et al., 2022), phase unwrapping (Wang et al., 2019), and fringe pattern analysis (Feng et al., 2019), have also demonstrated the applicability of deep learning. Recovering the full-field principal stress difference of the loaded object from the photoelastic fringe pattern can be regarded as an inverse problem solving process of deep learning. A large number of datasets are collected and trained to find the complex correspondence between the fringe pattern and stress difference pattern, which is then used to recover the stress field of the real loaded object from a single fringe pattern. When many conditions such as specimen shape, material properties, and the setting of polarized light field need to be considered, it is difficult for traditional mathematical methods to deal with this complicated and changeable situation. However, with sufficient data collected under different experimental conditions, deep learning can directly learn the complex correspondence between the input fringe pattern and output principal stress difference.
In this study, a deep convolutional neural network model is designed for inferring the stress field from the photoelastic fringe pattern. The overall framework of the network is in the form of encoder-decoder structure. The encoder completes the feature extraction process of the input fringe pattern, and the decoder completes the process of feature fusion to stress distribution pattern inference, thus realizing the transformation from the single photoelastic fringe pattern to stress distribution pattern. The main contributions of our study can be summarized as follows: (1) A simple and efficient stress recovery neural network is designed to realize the process of stress field recovery of the loaded object from a single fringe pattern.
(2) A multiloss function weighted objective optimization function is proposed to accelerate the convergence of neural networks and improve the robustness of model prediction.
(3) The superior performance of the proposed method is verified on a public dataset.
The remainder of this article is structured as follows. Some of the work closely related to this study will be discussed in Section 2. The combination of the photoelastic method and convolutional neural network and the design of the neural network model and objective optimization function is presented in Section 3. In Section 4, the details of the experiment implementation are introduced, the method proposed in this study is compared with that of other studies in detail, and then the experimental results are further analyzed. Finally, the conclusion and limitations of the proposed method are given in Section 5. traditional methods are limited by different experimental conditions and calculation methods when dealing with complex fringe patterns. Recently reported methods based on deep learning provide new ideas to solve these shortcomings. Feng et al. (2019) proposed a fringe pattern analysis method based on deep learning. They collected phase-shifted fringe patterns in different scenes to generate training data and then trained neural networks to predict some intermediate results.
Finally, combining these intermediate results, the high-precision phase image is recovered by using arc tangent function. The results show that this method can significantly improve the quality of phase recovery. Sergazinov and Kramar (2021) use the CNN to solve the problem of force reconstruction of photoelastic materials. They use the synthetic dataset obtained by theoretical calculation for training and then use the transfer learning to fine-tune a small amount of real experimental data, which shows good force reconstruction results.
For the estimation of the photoelastic stress field under a single experimental condition, a dynamic photoelastic experimental method based on pattern recognition was proposed (Briñez-de León et al., 2020a). The ANN was used to process the color fringe patterns that changed with time so as to classify the stress of different sizes, isotropic points, and inconsistent information. In order to make the deep learning method suitable for a wider range of experimental conditions, Briñez-de León et al. (2020b) reported a powerful synthetic dataset which covered photoelastic fringe patterns and the corresponding stress field distribution patterns under various experimental conditions with highly diversified spatial fringe distribution. At the same time, a neural network structure based on VGG16 (Simonyan and Zisserman, 2014) is proposed to recover the stress field from the isochromatic pattern. However, the prediction results of this network model are somewhat different from the real maximum stress difference, and the prediction results of the stress on the rounded surfaces are not very accurate. In their reports in the other literature (Briñez-de León et al., 2020c), an image translation problem directly related to spatial transformation based on the generative adversarial network (GAN) model was proposed. This method showed good performance in the SSIM, but there is a supersaturation phenomenon of stress recovery in some specimens. In addition, GAN is not an easy training model for the convergence of the network Ying Liu et al., 2021;Wu et al., 2022). Recently, they proposed a new neural network model to evaluate the stress field and named it PhotoelastNet (Briñez-de León et al., 2022). Considering the influence of noise and complex stress distribution patterns, the scale of synthetic data was further expanded, and a lighter network structure was designed, which achieved better performance in synthetic images and experimental images. However, there is still a certain gap between the accuracy of stress distribution estimation and ground truth. Our study improves on these methods by proposing a simpler and reasonable network structure and designing more effective loss functions to solve these problems.

Photoelasticity
Photoelastic fringes are visualized patterns obtained by a polarized optical system, which display the invisible stress response of each point in the model related to the birefringence effect through the related optical system. In this research, photoelastic fringes are visualized by a circular polariscope. The schematic diagram of the circular polariscope  is shown in Figure 1. The circular polariscope comprises a light source, polarizer, quarter wave plate I (QW-I), specimen which is made of photoelastic material, quarter wave plate II (QW-II), and an analyzer. In Figure 1, F represents the fast axis of the QW-I and QW-II. The orientations of the fast axis of the QW-I and QW-II are set to 45°and 135°, respectively. The orientation of the polarizer is set to 90°. The orientation of the analyzer is set to 0°. The light carried with the specimen's stress information is emitted from the analyzer, and the light intensity can be expressed as follows: where I b is the background light intensity. I 0 is the intensity of the light source. δ is the isochromatic angle of the photoelastic model, which contains the stress field information.
According to the law of stress optics, the principal stress difference in photoelastic models is proportional to the refractive index in the principal stress direction, as shown in Eq. 2. The optical path difference produced when polarized light passes through the photoelastic model can be expressed as Eq. 3.
where σ i is the ith principal stress, n i is the refractive index in the direction of σ i , C = C 1 − C 2 , C i is the optical coefficient of the stress of the model material, δ is the phase delay, h is the thickness of the photoelastic model, z is the optical path difference, and λ is the wavelength of the incident light source.
In two-dimensional photoelasticity, the relationship between phase delay caused by principal stress difference and the properties of the optical material is shown in Eq. 4. The main influencing factors of phase delay are light wavelength, optical coefficient of photoelastic material, model thickness, and stress condition.
where f σ = λ/C is the material fringe value. The photoelastic fringe patterns collected by the camera are interference intensity images of light. These fringe patterns generated by phase delay wrap the stress field information of the stressed object. In general, the stress field can be understood as the mechanical effect caused by the force distributed inside the object (Markides and Kourkoulis, 2012), which can be expressed by the principal stress difference σ 1 − σ 2 . Briñez-de León et al. (2020b) reported that the intensity of the emitted light is related to the spectral content of the light source, optical elements in the polarized light system, spatial stress distribution, and relative spectral response in the camera sensor. Based on the circular polariscope shown in Figure 1, the relationship between the intensity and phase delay of the emitted light (Ajovalasit et al., 2015) in different color channels is shown in Eq. (5).
where I is the emergent light intensity; RGB is the red, green, and blue color channels; and S R,G,B (λ) is the relative spectral response of the camera. According to the causal relationship between the photoelastic fringe pattern and stress field, the process from the stress field to fringe pattern can be regarded as a forward problem, while solving the stress field according to the single fringe pattern is a challenging inverse problem, that is, unwrapping stress information in the fringe pattern. We propose a stress field recovering method based on the CNN to solve this problem.

Photoelastic Image Dataset
It is expensive to obtain enough photoelastic fringe patterns and corresponding stress field images through the photoelastic experiment, which is due to the complicated experimental environment configuration and tedious post-data processing. Briñez-de León et al. (2020d) propose a hybrid scheme that includes real experimental data and computational simulation.

Network Model
We propose a stress field recovery model based on the encoder-decoder structure. The input of the network is a single photoelastic color fringe pattern, and the output is the gray image of the stress field recovered from the fringe pattern. The overall structure of the neural network model is shown in Figure 2.
The whole network consists of an encoder and a decoder. The encoder receives the input photoelastic fringe pattern and then uses a series of sub-sampling convolution, batch normalization (BN) (Ioffe and Szegedy, 2015), activation, and other operations to complete feature extraction from the input images. The feature information extracted by the encoder will be used as an intermediate representation of the input fringe pattern. Concretely, the whole coding process is divided into five stages by using the structure of the cascaded convolutional neural network (Sun et al., 2020b;Weng et al., 2021), and each stage comprises a different number of RepVGGBlock (Ding et al., 2021), as shown in Figure 3. The number of blocks can be freely adjusted to change the encoder's representation ability of the input image. Considering the trade-off between the accuracy and speed of the model, we set the number of blocks in each stage as {1,2,4,8,1}, and the image resolution of the first stage is 224 × 224. Experiments show that under the large image size, using only one block is helpful to speed up the training and reasoning of the model. The input and output dimensional parameters of each stage are shown in Table 1.
RepVGGBlock is a convolutional block with multibranch topology, including convolution with 3 × 3 kernel branch, convolution with 1 × 1 kernel branch, and identity branch. Each branch performs BN operation, then concatenates them together, and finally outputs after being activated by ReLu. The schematic diagram of RepVGGBlock is shown in Figure 3.
In order to recover the stress field distribution quickly and accurately, we designed a convolutional decoding structure which maps the features extracted by the encoder to the stress distribution map corresponding to the fringe pattern. The feature decoding process is also divided into five stages, each of which is stacked with blocks with the same structure. The number of blocks is also adjustable, and its structure comprises an up-sampling layer, a convolution layer, a BN layer, and an active layer. The schematic diagram is shown in Figure 4. The upsampling layer uses bicubic interpolation (Huang and Cao, 2020), the convolution layer uses 3 × 3 conv, and the activation layer uses ReLu. Table 2 shows the parameters of each stage of the decoder.

Objective Optimization Function
Mean squared error (MSE) (choi et al., 2009;Ma et al., 2020) is the most commonly used loss function in image reconstruction, which has fast convergence speed. But for regression tasks, the MSE is prone to interference by outliers during training. Most importantly, it usually leads to blurred images (Gondal et al., 2018) because minimizing MSE is equivalent to minimizing the cross-entropy of the empirical distribution and Gaussian distribution on the training set. We followed the method proposed by Zhao et al. (2016) and used L1 (Liao et al., 2021), L2, and SSIM (Wang et al., 2004) to construct our stress recovery loss function. First, the L1 loss of the two images is defined as follows: L L1 I r , I g 1 N p∈I I r p − I g p , where p is the index of the pixel; I r (p) and I g (p) are the values of the pixels in the recovered stress map and the ground truth, respectively; and N is the number of pixels p in the image I. Similarly, L2 loss is defined as follows: L L2 I r , I g 1 N p∈I I r p − I g p 2 .
( 7 ) The SSIM has been widely used as a metric to evaluate image processing algorithms. It is a full reference image quality evaluation index which measures the image similarity from three aspects: brightness, contrast, and structure. The SSIM for pixel p is defined as follows: where x and y are two image patches extracted from the same spatial position of the two images, respectively; μ x and μ y are the average brightness of patches x and y, respectively; σ x and σ y are the standard deviation of x and y, respectively; σ xy is the covariance of x and y; and C 1 and C 2 are very small constants to avoid having a zero denominator. In order to solve the problem of edge noise in the process of image generation, multiscale SSIM (MS-SSIM) is added to the loss function (Wang et al., 2003), which can effectively improve the impact of edge noise. MS-SSIM is defined as Eq. 7. M scale images were obtained by down-sampling. These images were evaluated by the SSIM, and the MS-SSIM value was obtained by fusion calculation.
where l M and cs j are the terms defined in Eq. 8 at scales M and j.
According to the convolutional nature of the network, the loss function of MS-SSIM can be written as follows: wherep is the center pixel of patch P and P is the image patch sampled from image I r and I g .
Finally, the objective optimization function is formulated in Eq. (11): L αL MS SSIM I r , I g + βL L1 I r , I g + 1 − α − β L L2 I r , I g , where I r and I g are the recovered stress map and the ground truth, respectively. Through the comparative experiments of different loss functions, we set α 0.5 and β 0.25 so that the different components of the loss function achieve roughly similar contributions.

EXPERIMENT AND ANALYSIS
By comparing the performance of the proposed network structure with the multiloss function fusion method on a synthetic dataset and comparing with the previous work, it is proved that the proposed method can accurately recover the stress field distribution from the photoelastic fringe pattern.

Implementation Details
Our network model is implemented by PyTorch. During the training process, 20,000 image pairs are randomly selected from the complete dataset, with 80% as the training set and the remaining 20% as the validation set. The batch size is set to 32, and Adam optimizer is used to train 100 epochs. The initial learning rate is 0.0001. The size of the input and output images is 224 × 224, in which the input is the RGB channel color fringe  pattern and the output is the single channel stress gray pattern. We train the stress recovery network from scratch on a single NVIDIA GTX 1080Ti, save several models with low loss values on the verification set, and then select the one with the best performance on the validation set as the final model. Another 20,000 pairs of images are randomly selected as the test set, and these images did not appear in the previous training and validation sets. This test set will be used to evaluate the performance of the final model.

Comparison With Different Methods
We test the trained models on different number of test sets, and the test images are randomly selected from the data sets that have never participated in the training. The distribution map of the stress field recovered by the network is compared with the real distribution map. MSE, peak signal-to-noise ratio (PSNR) (Gupta et al., 2011), and SSIM are used to measure the quality of the generated stress field images and then compare with the previous work. The PSNR is an image quality reference value for measuring maximum signal and background noise, as shown in Eq. (12).   ) and (e) represent the results of processing the photoelastic fringes in Figure 6. MSE is calculated after image normalization.

Method
where MAX I is the maximum possible pixel value of the image, and MSE is the mean square error. For MSE, the value is close to 0 and the smaller the better. For the PSNR, high values indicate better performance; on the contrary, low values indicate low performance. For the SSIM, the value close to 1 indicates high similarity and the value close to 0 indicates low similarity.  Table 3. The experimental results show that the proposed network model has good feature extraction ability and better image space mapping ability. The large standard deviation of the PSNR and MSE may be due to the noise in randomly selected data, which leads to a certain deviation from the mean value. Generally speaking, the results obtained by our proposed stress recovery network are better than those of the previous work.
We selected the two examples in StressNet to obtain specific instructions. The results in Figure 5 and Table 4 show that our proposed method has a high structural similarity index, and the bright area in the Figure 5 shows the degree of stress concentration. In order to measure the difference of the maximum stress difference between the recovery stress map and ground truth in the stress concentration area, the ratio of the maximum stress difference (RMSD) was proposed, as shown in Eq. 13. For the RMSD, the value close to 1 represents a small error. According to the RMSD value in Table 4, the stress recovery error of our method is smaller.   where MSD r and MSD g are the maximum stress difference of the recovery stress map and ground truth, respectively. Similarly, we also make a further comparison with the methods proposed in GAN (Briñez de León et al., 2020c), as shown in Figure 6. The experimental results show that our method solves the local over-saturation phenomenon in GAN (i.e., the predicted value of the stress concentration area tends to be larger).

Comparison With Different Loss Functions
In order to construct the most effective loss function to accurately recover the stress map, we compare the image recovery effect of the models trained under different loss functions. 20,000 images were used to evaluate each indicator to avoid accidental errors. The experimental conditions were the same except for different loss functions. The experimental results of each evaluation index are shown in Tables 5, 6. The results show that compared with using MSE and MS-SSIM as loss functions alone, the fusion of multiple loss function mix as shown in Eq. 11 can achieve better image recovery quality. Figure 7 shows a concrete example of stress map recovery under different loss functions. When L1, L2, and L1+L2 are used as loss functions, as shown in Figures 7C-E, local details are lost in the stress map recovery, leading to inaccurate results. When MS-SSIM is used as a loss function, as shown in Figure 7F, complete local details are preserved, but the maximum stress difference in the stress concentration area is less than the true value. Using the fusion loss function mix, as shown in Figure 7G, the best effect is achieved in all evaluation indicators, which is almost consistent with the ground truth.

Further Result Analysis
The prediction of the stress concentration area is the key point of practical engineering because it has a great influence on the fatigue life of components. We compared the maximum stress difference between the predicted stress map and ground truth and calculated the ratio of the maximum stress difference among 20,000 randomly selected image pairs.
The experimental results show that the average RMSD value of 20,000 predicted and real stress maps is 1.0109, and the standard deviation is 0.0652. This indicates that our network model accurately predicts the maximum stress difference in the stress concentration area with very dense fringes, which is the benefit brought by the fusion of MS-SSIM and L1. Multiloss function fusion not only considers the change of global value but also has a good effect on optimizing the local minimum value in the training process. Figures 8, 9 list some specific examples. The color fringe images in Figure 8 are obtained by using a Sony_IMX250 camera sensor with a constant light source, and its maximum stress value is 72 MPa. Table 7 shows all the metric values of the recovered stress maps in Figure 8. The SSIM values of Figures 8C,F both exceed 0.99, and the maximum stress difference of them are 68.5 and 73.5 MPa, respectively. The results show that the maximum principal stress difference appears in the area with dense fringes, and their maximum stress difference error is less than 5%.
In order to evaluate the performance of the proposed method at image edges, Figure 9 shows that the predicted stress map is very smooth in the edge area of the pattern, and the SSIM between the estimated stress map and ground truth in the edge area can reach 0.99. From the perspective of human vision, the prediction of stress concentration zones and edges is almost consistent with the ground truth. Table 8 shows all the metric values of the recovered stress maps in Figure 9.
When solving the stress field of complex geometric objects under different experimental conditions, there were some problems in the previous study, such as complicated calculation methods and inaccurate calculation results. Figure 10 shows the advantage of our method in solving the stress field of complex geometry. Due to the strong unwrapping ability of the network model, the stress field recovery of the complex fringe pattern performs well in the edge and stress concentration area. The predicted results of the stress map in the first two rows in Figure 10 can reach 0.99 on the SSIM, and the more complex patterns in the last two rows can also exceed 0.97. Table 9 shows all the metric values of the recovered stress maps in Figure 10.

Experimental Cases
The model was also evaluated when dealing with experimental cases. Based on experiments in literature (Restrepo Martínez and Branch Bedoya, 2020), 12 images were selected to fine-tune the network, and the remaining four images were used to test the performance of the network model. In the experiment, an LED was used as the light source, different loads were applied in a circularly polarized light field, and the photoelastic images were captured by the camera sensor DCC3260. The ground truth is generated by simulation. The test results are shown in Figure 11 and Table 10.

CONCLUSION
We propose a deep convolutional neural network based on the encoder-decoder structure and design an objective optimization function weighted with multiple loss functions to recover the stress field distribution from color photoelastic fringe patterns.
Verification results on open data sets show that our stress field recovery model can achieve an average performance of 0.99 on the SSIM. Other indexes also show that the model has the ability to accurately recover the stress map. When testing the photoelastic fringe patterns with complex geometry under different experimental conditions, our model still shows excellent generalization performance and strong unwrapping ability.
However, the proposed method only calculates the difference of principal stress. In practice, we also want to know the specific component of principal stress. In the FIGURE 11 | Stress recovery results of experimental cases. First column: photoelastic color fringe pattern; second column: ground truth generated by simulation; third column: predicted stress map.
Frontiers in Bioengineering and Biotechnology | www.frontiersin.org March 2022 | Volume 10 | Article 818112 12 future, a dataset containing principal stress components will be built, and then the principal stress can be obtained through the deep convolutional neural network.

DATA AVAILABILITY STATEMENT
The original contributions presented in the study are included in the article/Supplementary Material, further inquiries can be directed to the corresponding authors.

AUTHOR CONTRIBUTIONS
BT provided research ideas and plans; YW and FH wrote programs and conducted experiments; XQ proposed suggestions for improving the experimental methods; and XT, BC, WY, and BJC analyzed the results of the experiment and gave suggestions for writing the manuscript. All authors contributed to the writing and editing of the article and approved the submitted version.