Thermal tomography (TT) is a computational method for the reconstruction of depth profile of the internal material defects from Pulsed Infrared Thermography (PIT) nondestructive evaluation. The PIT method consists of recording material surface temperature transients with a fast frame infrared camera, following thermal pulse deposition on the material surface with a flashlamp and heat diffusion into material bulk. TT algorithm obtains depth reconstructions of thermal effusivity, which has been shown to provide visualization of the subsurface internal defects in metals. In many applications, one needs to determine the defect shape and orientation from reconstructed effusivity images. Interpretation of TT images is non-trivial because of blurring, which increases with depth due to the heat diffusion-based nature of image formation. We have developed a deep learning convolutional neural network (CNN) to classify the size and orientation of subsurface material defects in TT images. CNN was trained with TT images produced with computer simulations of 2D metallic structures (thin plates) containing elliptical subsurface voids. The performance of CNN was investigated using test TT images developed with computer simulations of plates containing elliptical defects, and defects with shapes imported from scanning electron microscopy images. CNN demonstrated the ability to classify radii and angular orientation of elliptical defects in previously unseen test TT images. We have also demonstrated that CNN trained on the TT images of elliptical defects is capable of classifying the shape and orientation of irregular defects.

## I. INTRODUCTION

Thermal tomography (TT) is a computationally lightweight method for material depth reconstructions from pulsed infrared thermography (PIT) nondestructive evaluation (NDE) measurements.^{1–4} Pulsed or flash thermography is an active thermography method, in which a thermal pulse is deposited on a material surface with a flashlamp, and as heat diffuses into the material bulk, surface temperature transients are recorded with a fast frame infrared camera.^{5–8} Internal defects have thermal diffusivity that differs from the surrounding material matrix. As a result, their presence in a material results in relatively slower local surface temperature decay. Thus, information about internal defects can be obtained from measurements of a material's surface temperature transients. Although resolution in PIT is limited due to diffusion-based imaging, PIT offers several potential advantages as measurements are one-sided, non-contact, and scalable to arbitrary size structures.^{9} While there exist other approaches to active thermography, such as lock-in thermography or flying spot thermography, PIT has the advantage of relative simplicity of experimental measurements.^{10–13} Using PIT data, the TT algorithm obtains a depth profile of the material by constructing a spatial thermal effusivity matrix (function of spatial coordinates only) from the data cube of sequentially recorded surface temperatures (function of spatial and time coordinates).

The need to image and quantify defects (size, shape, and orientation) arises in a number of applications. In prior work, quantitative imaging of delamination defects in layered ceramic and metal composite structures used TT.^{3,4} More recently, TT was used to image subsurface defects in additively manufactured (AM) metals.^{1,2} The challenge of quantitative NDE in AM of metals is the detection and characterization of internal pores (air voids), which appear due to intrinsic features of the laser powder-bed fusion (LPBF) process.^{14–18} lPBF is the primary method for AM of high-strength, corrosion-resistant high melting temperature alloys, such as stainless-steel 316L (SS316L) and Inconel 718 (IN718).^{19,20} Typical porosity defects observed in LPBF manufacturing consist of microscopic spheroidal-shape keyhole pores caused by excessive laser power, irregular-shape lack of fusion (LOF) pores caused by insufficient laser power, and spherical gas pores caused by gas trapped in the solidifying melt pool. In prior studies, we demonstrated the capability of TT to image calibrated defects in stainless-steel 316L (SS316L) and Inconel 718 (IN718).^{1,2} The defects consisted of hemispherical regions containing un-sintered powder imprinted into metallic specimens during LPBF manufacturing and flat bottom hole (FBH) indentations in metallic specimens. The likelihood of fatigue crack initiation in AM metals depends on factors such as the size and shapes of pores, proximity to the surface, and orientation relative to the surface plane.^{21,22} While TT provides the capability of visualizing defects, the interpretation of TT images of thermal effusivity is non-trivial because of blurring, which increases with depth.

In this work, we develop a machine learning capability to automatically extract features from the TT images of thermal effusivity.^{23} Our approach is based on supervised learning with a deep learning convolutional neural network (CNN). The performance of CNN is investigated in the classification of simulated thermal effusivity images, which are generated with computer simulations of PIT, using heat transfer calculations in the 2D structures and TT algorithm reconstructions. The CNN is trained on a database of simulated thermal effusivity images of metallic plates containing elliptical subsurface air voids, which are characterized by semi-major and semi-minor radii and angular orientation. We demonstrate the CNN's capability to extract radii and angular orientation of the elliptical defects by testing the CNN with thermal effusivity images which are different from the CNN training data. In addition, we show that a CNN trained on elliptical defects is capable of classifying irregular-shaped defects that actually occur in LPBF metals. Thermal effusivity images of irregular defects are generated using TT reconstructions of simulated PIT data for 2D structures with defect shapes extracted from scanning electron microscopy (SEM) images of stainless-steel sections printed with LPBF. To show that the CNN is capable of classifying these irregular defects, we compare CNN results to the radii and angular orientation of the irregular defect's equivalent ellipse. The ability of our CNN to classify irregular defects is advantageous for future applications of this method, as training the CNN on irregular defects would require an excessively large database of measurements.

A number of different approaches for the analysis of PIT data defects have been proposed in the literature. Some of the recently discussed approaches include the model, virtual wave, and machine learning-based methods. In one model-based approach, an analytical model was developed for the characterization of spheres and cylinders.^{24} However, this method is limited to canonically shaped defects. Another model-based approach proposes the construction of computational finite-difference models to characterize defects.^{25} An additional model is based on thermographic signal reconstruction (TSR). This method involves curve fitting for temperature transient signals based on Newton's law of cooling.^{26} Fitting transient temperature data were accomplished using the Gauss–Newton algorithm and storing the estimated polynomial coefficients for each temperature signal. However, this approach may result in partial loss of information in reconstruction. An approach based on the virtual wave concept has been proposed. In this approach, a local transformation kernel converts “thermal waves” (observed thermographic data) into virtual acoustic waves.^{27,28} Virtual acoustic waves are then analyzed using ultrasound reconstruction algorithms to eliminate the virtual time dimension. One such algorithm is the frequency domain synthetic aperture focusing technique. In practice, the thermal to ultrasonic conversion process increases the algorithm runtime and potentially leads to the loss of information in thermographic images. A recently proposed approach combined virtual waves with machine learning to enhance performance.^{29} A number of supervised and unsupervised machine learning approaches were proposed recently, which are aimed at the detection and sizing of calibrated defects.^{30–32} In our approach, the TT algorithm allows for a near real-time visualization of material defects without *a priori* assumptions about the shape of these defects. Using a CNN to analyze the reconstructed thermal effusivity images applies for recent advances in deep learning^{33} and image processing to the classification of internal material defects.

## II. DEVELOPMENT OF CONVOLUTIONAL NEURAL NETWORK (CNN) FOR CLASSIFICATION OF DEFECTS IN IMAGES

### A. Thermal tomography reconstruction of thermal effusivity

In the experimental PIT system, we acquire data with a laboratory setup consisting of a megapixel fast frame infrared (IR) camera and flashlamp as shown in the schematic depiction in Fig. 1. A pulse trigger signals a capacitor to discharge in a circuit containing a white light flashlamp. The flashlamp source delivers a pulse of thermal energy to the material surface. Heat transfer takes place from the heated surface to the interior of the sample, resulting in a continuous decline in surface temperature. A megapixel fast frame IR camera records blackbody radiation to obtain time-resolved images of surface temperature distribution *T*(*y,z*,*t*). The acquired thermal-imaging data cube, therefore, consists of a series of 2D images of the sample's surface temperature at consecutive times. As shown in Fig. 1, *x* is the depth coordinate, and *y* and *z* are coordinates in the transverse plane. The reconstruction algorithm of TT obtains thermal effusivity *e*(*x*,*y*,*z*) from time-dependent surface temperature *T*(*y*,z,*t*) measurements. The reconstructed *e*(*x*) at the location (*y*,*z*) in the plane is obtained only from the surface temperature transient *T*(*t*) measured at the location (*y*,*z*).

The TT algorithm assumes that the material is a thermally insulated deep slab, for which heat propagation can be approximated as one-dimensional along the spatial *x*-coordinate. The analytic solution for semi-infinite slabs is given as^{1}

where *Q* is the instantaneously deposited surface thermal energy density, and *α* is the thermal diffusivity defined as

Here, *k* is the thermal conductivity, *ρ* is the density, and *c* is the specific heat. Thermal effusivity which is a measure of how material exchanges heat with its surroundings is defined as

Following instantaneous deposition of energy on the material surface, heat diffuses into the material bulk. One can obtain the relationship between thermal wavefront depth inside the material *x* and time *t* after heat deposition as^{1}

Using the analytic solution of Eq. (1) for semi-infinite slabs, one can obtain the apparent effusivity as function time *e*(*t*),

Spatial and temporal effusivities *e*(*x*) and *e*(*t*) are related through a convolution integral, where 1/*x* is the transfer function,^{1,3}

Equation (7) shows that the spatial reconstruction of effusivity *e*(*x*) is given as a product of depth function *x* and time derivative of the inverse of surface temperature *T*(*t*) evaluated at time *t*, which corresponds to depth *x* according to Eq. (4). To calculate *e*(*x*) at a particular value of *x*, we first calculate the corresponding time *t* = *x*^{2}/*πα* and then take the time derivative of the inverse of *T*(*t*) at this time *t*.

Information about material internal structure is contained in recorded surface temperature transients *T*(*y*,z,*t*) because thermal resistance of the internal structures affects the local surface temperature decay rate. Reconstructed effusivity *e*(*x*,*y*,*z*) transforms this information into a spatial domain. For example, pores have lower thermal diffusivity compared to the rest of the solid material. This results in slower surface temperature decay in regions above the defects and the appearance of local temperature “hot spots.” TT reconstruction will show regions of lower effusivity, which can be interpreted as material defects.

### B. Development of simulated thermal tomography images of metallic plates with elliptical defects

In this work, we model the TT thermal effusivity reconstructions of 2D stainless-steel structures (thin plates) containing elliptical air voids. We use an elliptical model for the defect because thermal imaging based on heat diffusion theoretically smooths out any rough edges present. Thus, we anticipate that this smoothing effect allows an arbitrarily shaped defect to be described with an equivalent ellipse. The diagram describing the flow of the TT computer simulation procedure and elliptical defect labeling is shown in Fig. 2. The ellipse is characterized by semi-major and semi-minor axes *R*_{x} and *R*_{y}, and angular orientation *θ* is measured for counterclockwise rotation from the *x* axis. The *x* axis is along the depth of the plate, and the *y* axis is along the face of the plate (consistent with the specimen depiction in Fig. 1).

Heat diffusion in a plate containing an elliptical defect is modeled with 2D heat transfer using MATLAB PDE Toolbox. The thermal pulse from the flashlamp is incident on the face of the plate along the transverse *y* axis. In computer simulations, we use the same parameters as was used in the experimental system reported in prior publications, where Balcar ASYM 6400 delivers a pulse of 6400 J/2 ms thermal energy to the material surface.^{1} The model of a metal structure with elliptical air void is first created as a MATLAB polyshape data structure and then turned into a computational mesh. In all computer simulations, the plate has physical dimensions of 5 × 5 mm^{2}, with mesh spatial resolution of Δx = Δy = 10 *μ*m, which corresponds to 500 × 500 elements in the computational grid. The boundary conditions of the mesh are specified as insulating. For modeling of the solid plate, we use SS316L thermophysical parameters *ρ *= 7954 kg/m^{3}, *k *= 13.96 W/mK, and *c* = 499.07 J/kg.^{1,14,15} Thermophysical parameters of elliptical air void are *ρ*=1.225 kg/m^{3}, *k *= 26.24 mW/mK, and *c* = 1.00 kJ/kg.

As heat diffuses into the plate along the *x*-direction, temperature is sampled on the plate boundary along the *y* axis. In the experimental laboratory system reported in prior publications, imaging data were acquired with a FLIR x8501sc camera with 1280 × 1024 pixels and a frame rate of 180 Hz at full frame.^{1,14} The frame rate can be increased at the expense of reducing the imaging frame to maintain the information transfer rate constant (product of the number of pixels and data acquisition rate). In prior experimental work, we have observed that, in general, better performance results are obtained for a frame rate larger than 180 Hz. For the 2D case studied in this work, we assume that the maximum imaging resolution along the edge of the plate is 1024 pixels at a 180 Hz frame rate. For TT reconstructions in this paper, we used the combination scaled by a factor of 3, i.e., 340 pixels at 540 Hz frame rate (approximately 2 ms data acquisition rate). Because the number of sampling points (340 points) is smaller than the number of grid meshes (500 points), we interpolated surface temperature to obtain 340 measurements.

Two examples of TT effusivity reconstruction images with computer simulations of SS316 plates containing elliptical void defects (*R*_{x} = 160 *μ*m, *R*_{y} = 310 *μ*m, and *θ* = 0°) and (*R*_{x} = 60 *μ*m, *R*_{y} = 210 *μ*m, and *θ* = 15°) are shown in Figs. 3(a) and 3(b), respectively. Generation of TT thermal effusivity images implemented in MATLAB takes 60 s runtime, on average, on a 2017 MacBook Pro with MacOS Mojave. Heat transfer and effusivity reconstruction calculations take approximately 45 and 15 s, respectively, to complete. Reconstructed effusivity values are displayed as pseudocolor images of *e*(*x*,*y*) in Fig. 3. Note that according to Eq. (3), the thermal effusivity of SS316 is *e *≈ 7444 J⋅m^{−3/2}⋅(mK s)^{−1/2}, while that of elliptical air void is *e *≈ 5.7 J m^{−3/2}⋅(mK s)^{−1/2}. However, the values of reconstructed effusivity do not match exact material values near sharp boundaries due to blurring caused by heat diffusion. One can observe that the back edge of the plate at x = 2.5 mm plane has an effusivity value of approximately 4000 J m^{−3/2}⋅(mK s)^{−1/2} in both Figs. 3(a) and 3(b). Any defects can be detected by observing relative changes in effusivity within the plate. Regions of lower effusivity give us an indication of the shape and location of such defects, as shown in Fig. 3. The smallest effusivity values in regions corresponding to the defects are approximately 4000 and 5000 J m^{−3/2}⋅(mK s)^{−1/2} in Figs. 3(a) and 3(b), respectively.

### C. Construction of convolutional neural network (CNN)

Using the database of TT reconstructions, we developed a deep learning convolutional neural network (CNN) for the classification of defects in thermal effusivity images. The flow chart of the CNN algorithm is shown in Fig. 4. The CNN takes the effusivity reconstruction image as an input and returns characteristic dimensions *R*_{x}, *R*_{y}, and *θ* of the elliptical defect. To develop the CNN, we used AutoKeras's image classification module. We choose not to incorporate physics-informed machine learning^{32} into the design of the CNN, because in our approach, the main function of CNN is image regression. Since image regression does not rely on the underlying partial differential equations related to the physics of TT image formation, in our approach, we take advantage of the existing AutoKeras framework. AutoKeras is an automated machine learning system based on the open-source software library Keras. Keras is a framework through which users can construct neural networks using Python and the TensorFlow machine learning library. AutoKeras takes the utility of Keras one step further and fully automates the neural network constructions and optimization process. While AutoKeras has a variety of neural network models for users to adapt, we chose to use AutoKeras's AutoModel. This allowed us to define our own inputs and outputs, as well as to specify the use of convolutional layers within the framework of our image regression network. AutoKeras infers any unspecified components of the network structure and fine-tunes the hyperparameters of the network. Thus, a majority of the network development process is completely automated, the result being a functioning CNN.

There are four layers in the CNN. Using AutoKeras language, the input node is ImageInput, which means the CNN is fed images as represented by a Python numpy array. The training and test images in the input layer of CNN are of the same size. Following the input node, the CNN uses two AutoKeras blocks—ConvBlock and DenseBlock. These blocks represent layers of computations in the CNN architecture. The ConvBlock includes convolutional and pooling layers required for the CNN. The DenseBlock encompasses the fully connected network following the convolutional layers. In the CNN process, convolution layers are followed by pooling layers, until a flattening layer compresses the data into a one-dimensional array. Convolution layers consist of identical neurons that are connected to local neurons in the previous layer. As the neuron or filter operates on parts of the input image, its pixel values are multiplied by the filter values. This convolution operation creates a “feature map” from the original image. This allows features of the image to be isolated and identified. More convolution layers allow the CNN to detect lower-level features within the image, which is why convolution layers are usually stacked. Pooling layers—in this case, max pooling layers—are also utilized between convolution layers to keep the feature maps generalized. Max pooling takes the maximum value from each segment of the feature map produced by a given convolutional layer. Thus, pooling is necessary to ensure that the CNN is sensitive to small translations in the input. After flattening, this array is passed through a traditional fully connected (dense) layer to make the final prediction. The CNN has some advantages over a fully connected network, especially in image analysis and classification. The CNN's feature map makes it particularly adept at detecting subtle features in images, which is crucial for image classification. Additionally, the CNN uses copies of the same neuron to process data, which saves both time and memory.

The training set for CNN consisted of 300 simulated thermal effusivity images for plates with elliptical defects with different sizes and angular orientations. By default, AutoKeras uses 20% of training data as validation data. The range of values for both *R*_{x} and *R*_{y} is from 10 to 310 *μ*m, with angular orientations *θ* in the range from 0° to 45°. The training set included circles (*R*_{x }= *R*_{y}) and ellipses (*R*_{x }≠ *R*_{y}). Computer run time for CNN training is approximately 15 min. The code was run on MacBook Pro 13″ 2017, which has i5-7360 U, which has two cores and four threads. During the computation, 80% of the CPU load was occupied by the user, 10% was occupied by the system, and 10% was idle.

## III. CLASSIFICATION OF DEFECTS IN SIMULATED THERMAL EFFUSIVITY IMAGES WITH CNN

### A. CNN classification of elliptical defects

The test set consisted of 12 thermal effusivity images of metallic structures with elliptical defects, which are different from the training set of effusivity images. Parameters of elliptical defects in test images (actual *R*_{x}, *R*_{y}, and *θ*) and CNN predictions for these defects (predicted *R*_{x}, *R*_{y}, and *θ*) are listed for 12 test cases labeled (*a*)–(*l*) in Table I. The test cases are listed in the order of increasing areas of ellipses. In addition, we list the actual and predicted aspect ratios, where an aspect ratio expressed as *x*:*y* is defined as the ratio of the larger radius to the smaller radius of the ellipse,

No. . | Actual . | Predicted . | Metric . | |||||||
---|---|---|---|---|---|---|---|---|---|---|

R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | AE
. | AOE
. | |

A | 40 | 10 | 4:1 | 0 | 32.8 | 27.4 | 1.2:1 | −1.03 | 0.62 | 0.55 |

B | 50 | 30 | 1.67:1 | 0 | 58.7 | 35.5 | 1.65:1 | 0.87 | 0.26 | 0.28 |

C | 30 | 50 | 1.67:1 | 30 | 30.2 | 51.6 | 1.71:1 | 10.8 | 0.04 | 0.2 |

D | 40 | 60 | 1.5:1 | 40 | 42.7 | 60.7 | 1.42:1 | 35.3 | 0.06 | 0.07 |

E | 260 | 60 | 4.33:1 | 20 | 271.4 | 43.8 | 6.2:1 | 26.9 | 0.24 | 0.49 |

F | 260 | 60 | 4.33:1 | 10 | 273.4 | 73.6 | 3.72:1 | 9.5 | 0.29 | 0.19 |

I | 310 | 60 | 5.17:1 | 35 | 284.3 | 60.0 | 4.74:1 | 35.3 | 0.08 | 0.06 |

G | 210 | 160 | 1.31:1 | 30 | 209.3 | 153.3 | 1.33:1 | 32.4 | 0.05 | 0.03 |

J | 310 | 110 | 2.82:1 | 25 | 293.3 | 104.1 | 2.82:1 | 21.1 | 0.11 | 0.11 |

H | 260 | 160 | 1.63:1 | 45 | 257.0 | 153.0 | 1.7:1 | 35.9 | 0.06 | 0.09 |

K | 210 | 310 | 1.48:2 | 20 | 230.7 | 323.4 | 1.4:1 | 25.8 | 0.15 | 0.10 |

L | 260 | 310 | 1.2:1 | 20 | 247 | 320.9 | 1.3:1 | 25.8 | 0.02 | 0.03 |

No. . | Actual . | Predicted . | Metric . | |||||||
---|---|---|---|---|---|---|---|---|---|---|

R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | AE
. | AOE
. | |

A | 40 | 10 | 4:1 | 0 | 32.8 | 27.4 | 1.2:1 | −1.03 | 0.62 | 0.55 |

B | 50 | 30 | 1.67:1 | 0 | 58.7 | 35.5 | 1.65:1 | 0.87 | 0.26 | 0.28 |

C | 30 | 50 | 1.67:1 | 30 | 30.2 | 51.6 | 1.71:1 | 10.8 | 0.04 | 0.2 |

D | 40 | 60 | 1.5:1 | 40 | 42.7 | 60.7 | 1.42:1 | 35.3 | 0.06 | 0.07 |

E | 260 | 60 | 4.33:1 | 20 | 271.4 | 43.8 | 6.2:1 | 26.9 | 0.24 | 0.49 |

F | 260 | 60 | 4.33:1 | 10 | 273.4 | 73.6 | 3.72:1 | 9.5 | 0.29 | 0.19 |

I | 310 | 60 | 5.17:1 | 35 | 284.3 | 60.0 | 4.74:1 | 35.3 | 0.08 | 0.06 |

G | 210 | 160 | 1.31:1 | 30 | 209.3 | 153.3 | 1.33:1 | 32.4 | 0.05 | 0.03 |

J | 310 | 110 | 2.82:1 | 25 | 293.3 | 104.1 | 2.82:1 | 21.1 | 0.11 | 0.11 |

H | 260 | 160 | 1.63:1 | 45 | 257.0 | 153.0 | 1.7:1 | 35.9 | 0.06 | 0.09 |

K | 210 | 310 | 1.48:2 | 20 | 230.7 | 323.4 | 1.4:1 | 25.8 | 0.15 | 0.10 |

L | 260 | 310 | 1.2:1 | 20 | 247 | 320.9 | 1.3:1 | 25.8 | 0.02 | 0.03 |

Note that the definition of rotated ellipse contains an ambiguity. For example, reversing the values of *R*_{x} and *R*_{y} is equivalent to a rotation of the ellipse by an angle—*θ*. Since the ellipse is reproduced after rotation by 180°, the following ellipses are equivalent: (*R*_{x}, *R*_{y}, *θ*)=(*R*_{y}, *R*_{x}, –*θ*)=(*R*_{y}, *R*_{x}, π–*θ*). Thus, instead of a direct comparison of the actual and predicted values of radii and angles, a metric related to 2D space would provide a more accurate representation of CNN performance. We introduce Area Error (AE) and Area Orientation Error (AOE) metrics for evaluating CNN performance. We define *AE* as the absolute value in the difference in areas of predicted and actual ellipses *A* and *P,* normalized by the area of ellipse *A*,

where ||*A*|| = π*R*_{x}*R*_{y} is the area of the actual elliptical defect and ||*P*|| is the area of the predicted ellipse. As defined in Eq. (9), the values of the *AE* metric are non-negative. There is no upper bound on the value of *AE*, and the minimum value of *AE* = 0 indicates no error in prediction. To incorporate angular information into performance metrics, we define AOE as

For the quantity in the numerator, $A\u2229P$ is the intersection of *A* and *P* calculated in the sense of Venn diagrams, $(A\u2229P)c$ is the complement of the intersection in the total space defined by the union $A\u222aP$, and $\Vert (A\u2229P)c\Vert $ is the area of the complement of the intersection. As defined in Eq. (10), the values of the AOE metric are non-negative. There is no upper bound on the value of AOE, and the value of *AOE* = 0 would indicate no error in prediction.

The values of AE and AOE metrics of CNN performance calculated for the test cases (*a*)–(*l*) CNN prediction are listed in the last column of Table I. Computer run time for generating CNN classification results in Table I, which is approximately one minute per test case, when using a 2017 MacBook Pro with MacOS Mojave.

Note that the AE and AOE performance metrics of CNN for each individual test case have been comparable. The values of both AE and AOE metrics are smaller than 0.62 and 0.55, respectively, indicating the good predictive ability of CNN. Larger values of AE and AOE correlated with a larger deviation of prediction aspect ratio from the actual one. The trends are that the error metrics AE and AOE increase as *R*_{x} and *R*_{y} decrease or as the aspect ratio significantly deviates from that of 1:1. The smallest errors are observed for the test case (*l*), which has the largest radii in the test set, and the smallest aspect ratio of 1.2:1. The largest errors are for the test case (*a*), which has some of the smallest radii in the test set and one of the largest aspect ratios of 4:1. The errors AE and AOE decrease when the aspect ratio decreases to 1.5:1, as for the test case (*d*). When the aspect ratio remains close to 4:1, but the actual radii increase, such as for the test cases (*e*) and (*f*), the error decreases relative to the test case (*a*) as well. Selected graphs of actual and predicted ellipses, which are plotted using parameters listed in Table I, are shown in Fig. 5. Figures 5(a) and 5(d) correspond to the numbering of test cases in Table I. In each panel of Fig. 5, actual ellipses are plotted with dashed lines, while CNN predictions are plotted with solid lines.

### B. CNN classification of irregular-shape defects

Although the preceding discussion focused on elliptical defects, pores in AM metals have arbitrary non-elliptical shapes. Our hypothesis is that because thermal imaging smooths out sharp edges, a CNN trained on TT images with elliptical defects is capable of classifying irregular-shape defects. For the test of this hypothesis, we use the SEM (scanning electron microscopy) images of actual defects in sections of LPBF printed SS316 specimens. Two examples of such defects are shown in Fig. 6. We use the gray scale SEM image to obtain the contours of the defect. To characterize this defect, we use the least-squares criterion for estimation of the best fit to an ellipse from a given set of points in the plane. The dimensions of the two equivalent ellipses for the defects in Figs. 6(a) and 6(b) are (*R*_{x} = 10 *μ*m and *R*_{y} = 37 *μ*m) and (*R*_{x} = 43 *μ*m and *R*_{y} = 75 *μ*m). To generate the TT test images, we create a MATLAB polyshape data structure consisting of a plate containing a void with the contours of the defect. As in the case of elliptical defects, the structure consists of a 5 × 5 mm^{2} SS316 plate with an air void in the shape of the contours of the defect from the SEM image. Next, a computational mesh is created to perform 2D heat transfer calculations, as described in Sec. II B. Thermal tomography reconstructions are performed according to the procedures described in Secs. II A and II B. Different test images were generated by rotating the irregular-shaped defects in the plane.

Six test cases, labeled (*a*)–(*f*) in Table II, were generated by extracting the shape of the defect from the first SEM image in Fig. 6(a) and rotating the shape by 20° for each subsequent test case. To classify the defects in thermal effusivity images for plates with irregular defects, the CNN attempts to interpret the defects as ellipses and assign corresponding values of *R*_{x}, *R*_{y}, and *θ*. To evaluate CNN performance, Table II lists the parameters for equivalent ellipses of actual defects (actual *R*_{x}, *R*_{y}, and *θ*) and predictions made with CNN (predicted *R*_{x}, *R*_{y}, and *θ*). Aspect ratios are calculated for equivalent and predicted ellipses using Eq. (8). Values of the AE and AOE metrics for the evaluation of CNN performance for equivalent and predicted ellipses in each of the six test cases in Table II were calculated using Eqs. (9) and (10).

No. . | Actual . | Predicted . | Metric . | |||||||
---|---|---|---|---|---|---|---|---|---|---|

R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | AE
. | AOE
. | |

A | 10.3 | 37.2 | 3.61:1 | 18.7 | 26.6 | 33.7 | 1.27:1 | 17.1 | 1.34 | 0.59 |

B | 10.3 | 37.2 | 3.61:1 | 38.7 | 13.7 | 32.2 | 2.35:1 | 28.5 | 0.15 | 0.34 |

C | 10.3 | 37.2 | 3.61:1 | 58.7 | 6.8 | 33.8 | 5:1 | 51.1 | 0.4 | 0.67 |

D | 10.3 | 37.2 | 3.61:1 | 78.7 | 14.0 | 39.9 | 2.85:1 | 96.2 | 0.46 | 0.47 |

E | 10.3 | 37.2 | 3.61:1 | 98.7 | 17.7 | 62.8 | 3.55:1 | 102.8 | 1.9 | 0.64 |

F | 10.3 | 37.2 | 3.61:1 | 118.7 | 17.1 | 34.7 | 2:1 | 103.1 | 0.58 | 0.49 |

No. . | Actual . | Predicted . | Metric . | |||||||
---|---|---|---|---|---|---|---|---|---|---|

R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | AE
. | AOE
. | |

A | 10.3 | 37.2 | 3.61:1 | 18.7 | 26.6 | 33.7 | 1.27:1 | 17.1 | 1.34 | 0.59 |

B | 10.3 | 37.2 | 3.61:1 | 38.7 | 13.7 | 32.2 | 2.35:1 | 28.5 | 0.15 | 0.34 |

C | 10.3 | 37.2 | 3.61:1 | 58.7 | 6.8 | 33.8 | 5:1 | 51.1 | 0.4 | 0.67 |

D | 10.3 | 37.2 | 3.61:1 | 78.7 | 14.0 | 39.9 | 2.85:1 | 96.2 | 0.46 | 0.47 |

E | 10.3 | 37.2 | 3.61:1 | 98.7 | 17.7 | 62.8 | 3.55:1 | 102.8 | 1.9 | 0.64 |

F | 10.3 | 37.2 | 3.61:1 | 118.7 | 17.1 | 34.7 | 2:1 | 103.1 | 0.58 | 0.49 |

Comparison of the values of AE and AOE in Tables I and II indicates that error metrics are generally higher for the test cases in Table II. Equivalent ellipse values *R*_{x} and *R*_{y} for the irregular defect in Table II, which has an aspect ratio of 3.6:1, correspond closely to the dimensions of the ellipse (*a*) listed in Table I and shown in Fig. 5(a). Notably, the values of AE and AOE for the ellipse in Fig. 5(a) are similar to the values described in Table II. The best result for the irregular-shaped defects, according to both AE and AOE metrics, is obtained for case (*b*) in Table II, while the worst result according to both metrics is test case (*e*).

Visualizations of the actual and predicted defects for the SEM image defect in Fig. 6(a) are displayed in Fig. 7. Figures 7(a)–7(f) correspond to the numbering of test cases in Table II. In each panel of Fig. 7, equivalent ellipses plotted with dashed lines are overlaid with shapes of the actual defects extracted from the SEM images. Ellipses predicted with CNN are plotted with solid lines. One can observe that the largest prediction errors, as measured with the AE metric, are for cases (*a*) and (*e*), in which CNN over-predicts the sizes of the actual defects. As measured with the AOE metric, the largest errors are for the test cases (*c*) and (*e*), for which CNN respectively under-predicts and over-predicts the size of actual defects. The error in prediction is smallest for the test case (*b*), when the equivalent ellipse is oriented at an oblique angle to the front of the plate (*y* axis).

No. . | Actual . | Predicted . | Metric . | |||||||
---|---|---|---|---|---|---|---|---|---|---|

R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | AE
. | AOE
. | |

A | 43.0 | 75.1 | 1.75:1 | 3.14 | 53.9 | 74.7 | 1.4:1 | 1.91 | 0.20 | 0.18 |

B | 43.0 | 75.1 | 1.75:1 | 23.14 | 44.3 | 71.8 | 1.62:1 | 17.46 | 0.19 | 0.20 |

C | 43.0 | 75.1 | 1.75:1 | 43.14 | 44.4 | 83.6 | 1.88:1 | 41.59 | 0.13 | 0.10 |

D | 43.0 | 75.1 | 1.75:1 | 63.14 | 36.5 | 89.5 | 2.45:1 | 59.93 | 0.01 | 0.20 |

E | 43.0 | 75.1 | 1.75:1 | 83.14 | 55.9 | 73.6 | 1.32:1 | 81.70 | 0.01 | 0.02 |

F | 43.0 | 75.1 | 1.75:1 | 103.14 | 42.4 | 75.7 | 1.8:1 | 102.39 | 0.006 | 0.001 |

No. . | Actual . | Predicted . | Metric . | |||||||
---|---|---|---|---|---|---|---|---|---|---|

R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | R_{x} (μm)
. | R_{y} (μm)
. | Aspect ratio . | θ (°)
. | AE
. | AOE
. | |

A | 43.0 | 75.1 | 1.75:1 | 3.14 | 53.9 | 74.7 | 1.4:1 | 1.91 | 0.20 | 0.18 |

B | 43.0 | 75.1 | 1.75:1 | 23.14 | 44.3 | 71.8 | 1.62:1 | 17.46 | 0.19 | 0.20 |

C | 43.0 | 75.1 | 1.75:1 | 43.14 | 44.4 | 83.6 | 1.88:1 | 41.59 | 0.13 | 0.10 |

D | 43.0 | 75.1 | 1.75:1 | 63.14 | 36.5 | 89.5 | 2.45:1 | 59.93 | 0.01 | 0.20 |

E | 43.0 | 75.1 | 1.75:1 | 83.14 | 55.9 | 73.6 | 1.32:1 | 81.70 | 0.01 | 0.02 |

F | 43.0 | 75.1 | 1.75:1 | 103.14 | 42.4 | 75.7 | 1.8:1 | 102.39 | 0.006 | 0.001 |

Six test cases, labeled (*a*)–(*f*) in Table III, were generated by extracting the shape of the defect from the second SEM image in Fig. 6(b) and rotating the shape by 20° for each subsequent test case. Table III lists the parameters for equivalent ellipses of actual defects (actual *R*_{x}, *R*_{y}, and *θ*), and predictions made with CNN (predicted *R _{x}*,

*R*, and

_{y}*θ*). Aspect ratios are calculated for equivalent and predicted ellipses using Eq. (8). Values of the AE and AOE metrics in each of the six test cases were calculated for equivalent and predicted ellipses using Eqs. (9) and (10).

The best performance according to both error metrics is test case (*f*), while the worst performance is for the test case (*a*). Performance metrics AE and AOE for the six test cases in Table III are smaller than those listed in Table II. In addition, predictions for the aspect ratio for the test cases in Table III are more accurate than those in Table II. The difference in CNN performance is likely due to the fact that the second irregular defect is larger than the first one, and the aspect ratio for the second defect is 1.75:1, which is closer to 1:1 than that of 3.6:1 for the first defect. This is consistent with the trends for elliptical defects reported in Table I. Elliptical defects in the test cases (*b*) and (*c*) in Table I have aspect ratios of 1.67:1 and radii size comparable to those in Table III. The errors for the elliptical defects (*b*) and (*c*) in Table I are comparable to those of the defects in Table III. Visualizations of actual and predicted ellipses for the defects in Table III are displayed in Fig. 8. Figures 8(a)–8(f) correspond to the numbering of test cases in Table III. In each panel of Fig. 8, equivalent ellipses plotted with dashed lines are overlaid with the shape of an irregular defect. Ellipses predicted with CNN are plotted with solid lines. One can observe that the larger errors, such as those for test cases (a) and (b), are due to overestimation of the size of the defect. The error is largest when the defect is orientated with the long radius of the equivalent ellipse along the front edge of the plate (*y* axis). This could be potentially attributed to the shape of the irregular defect.

## IV. CONCLUSION

Thermal tomography (TT) is a computational method for material depth profile reconstruction and visualization of internal material defects. TT performance has been demonstrated to be effective in the imaging of calibrated subsurface defects in metals. In many applications, such as in additive manufacturing of metals, a nondestructive evaluation of the subsurface material defects is required to evaluate the likelihood of defects causing fatigue crack initiation. While TT provides visualization of the defects, interpretation of the images is non-trivial as a result of inherent image blurring due to heat diffusion. We described the development of a deep learning convolutional neural network (CNN) to classify the size and orientation of subsurface defects in simulated thermal tomography (TT) images. The CNN is trained on a database of TT images generated based on a set of simulated metallic structures with elliptical subsurface voids. TT images were created with MATLAB PDE Toolbox heat transfer calculations for 2D structures.

Tests of CNN performance demonstrate the ability to classify radii and angular orientation of the subsurface defects in TT images. In addition, we showed that CNN trained on elliptical defects is capable of classifying irregular-shaped defects obtained from scanning electron microscopy (SEM) of stainless-steel sections printed with LPBF. As metrics of CNN performance, we introduced the area error (AE) and the area orientation error (AOE) criteria, which compared the actual ellipses (equivalent ellipses, in the case of irregular defects) with ellipses predicted with CNN. The general trend in errors in CNN-based prediction is that the errors are larger for smaller defects and defects with a higher aspect ratio. The errors observed in the CNN prediction of irregular-shape defects are consistent with the errors in the CNN prediction of elliptical defects.

In this paper, we modeled material defects using elliptical shape model approximation. In future works, we will investigate more realistic models, such as Gaussian circles and Gaussian spheres (in 3D), which can provide a closer fit to the shape of irregular defects.^{34} In addition, our CNN-based classification approach will be extended to the analysis of simulated 3D thermography data and the classification of experimental data.

## ACKNOWLEDGMENTS

This work was supported by the US Department of Energy, Office of Nuclear Energy, Nuclear Energy Enabling Technologies (NEET) Advanced Methods of Manufacturing (AMM) Program under Contract No. DE-AC02-06CH11357.

## AUTHOR DECLARATIONS

### Conflict of Interest

The authors have no conflicts to disclose.

### Author Contributions

**V. Ankel:** Data curation (equal); Formal analysis (equal); Investigation (equal); Methodology (equal); Software (equal); Validation (equal); Visualization (equal); Writing – original draft (supporting); Writing – review & editing (supporting). **D. Shribak:** Conceptualization (equal); Data curation (equal); Formal analysis (equal); Investigation (equal); Methodology (equal); Software (equal); Validation (equal). **W.-Y. Chen:** Data curation (supporting); Resources (supporting); Validation (supporting); Visualization (supporting). **A. Heifetz:** Conceptualization (equal); Data curation (equal); Formal analysis (equal); Funding acquisition (lead); Investigation (equal); Methodology (equal); Project administration (lead); Resources (equal); Software (equal); Supervision (lead); Validation (equal); Visualization (equal); Writing – original draft (lead); Writing – review & editing (lead).

## DATA AVAILABILITY

The data that support the findings of this study are available from the corresponding author upon reasonable request.