An Encoder-Decoder Based Approach for Anomaly Detection with Application in Additive Manufacturing
Baihong Jin Yingshui Tan Alexander Nettekoven Yuxin Chen Ufuk Topcu Yisong Yue Alberto Sangiovanni Vincentelli
cs.LG stat.ML






An Encoder-Decoder Based Approach for
 Anomaly Detection with Application in Additive Manufacturing

This work is supported in part by the National Research Foundation of Singapore through a grant to the Berkeley Education Alliance for Research in Singapore (BEARS) for the Singapore-Berkeley Building Efficiency and Sustainability in the Tropics (SinBerBEST) program, and by the National Science Foundation under Grant No. 1645964. BEARS has been established by the University of California, Berkeley as a center for intellectual excellence in research and education in Singapore.
^†Baihong Jin and Yingshui Tan contributed equally to this paper.
^*Alexander Nettekoven prepared and processed the experimental data. Dr. Yuxin Chen contributed to the theoretical aspects of this paper.

    Baihong Jin^†1  Yingshui Tan^†1,2  Alexander Nettekoven^*3  Yuxin Chen^*4  Ufuk Topcu^3
  Yisong Yue^4  Alberto Sangiovanni-Vincentelli^1

^1Department of EECS, University of California, Berkeley, USA

^2RWTH Aachen University, Germany

^3University of Texas at Austin, USA

^4California Institute of Technology, USA

    
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================




We present a novel unsupervised deep learning approach that utilizes the encoder-decoder architecture for detecting anomalies in sequential sensor data collected during industrial manufacturing. Our approach is designed not only to detect whether there exists an anomaly at a given time step, but also to predict what will happen next in the (sequential)  process. We demonstrate our approach on a dataset collected from a real-world AM testbed. The dataset contains IR images collected under both normal conditions and synthetic anomalies. We show that the encoder-decoder model is able to identify the injected anomalies in a modern AM manufacturing process in an unsupervised fashion. In addition, it also gives hints about the temperature non-uniformity of the testbed during manufacturing, which is what we are not aware of before doing the experiment.  



additive manufacturing, anomaly detection, fault detection




§ INTRODUCTION


Anomaly detection is an important technique that serves as the basis of applications across a diverse variety of domains, such as fault detection, intrusion and fraud detection <cit.>, and process control. The goal of anomaly detection is to identify patterns in data that do not conform to a well-defined notion of normal behavior <cit.>. Early detection of anomalies and faults allows us planning preventive maintenance for model manufacturing, and thus it is crucial for process control.
 
The availability of massive amount of data due to the introduction of pervasive sensing techniques has brought plenty of opportunities for data-driven anomaly detection applications; however, an unresolved challenge is how to make use of these data for anomaly detection, especially when there is no label information that can be used to differentiate between normal and anomalous working conditions.



 §.§ Learning-Based Anomaly Detection

Depending on the availability of labeled anomalous data, learning-based anomaly detection approaches can generally be categorized into supervised and unsupervised methods. Supervised methods utilize label information for both normal and anomalous data to train classification models. The trained classification models from supervised learning can not only tell the existence of faults but also indicate the likelihood of an input belonging to a particular type of fault.

A review of the literature reveals that data-driven approaches relying on supervised learning have demonstrated promising results in various applications, e.g. FDD in air conditioning systems <cit.>. 

To train a well-performing model using supervised learning, a good amount of labeled data from both normal and anomalous conditions are needed, which is not always easy to obtain in practice. 

In addition, supervised models typically lack the ability to identify an unseen example that does not belong to any of the classes that appear in the training set. In the context of anomaly detection, models trained with supervised learning are likely to give incorrect predictions on out-of-distribution data instances. This is a limitation of supervised methods because it is almost impossible to obtain every possible type of anomaly that could happen on a system. To address this problem, Jin et al. recently proposed a FDD method that uses Monte-Carlo dropout <cit.> to estimate the prediction uncertainty of deep neural networks. The method was applied to the identification of incipient faults that are not represented in the training data that only consists of labeled data of normal and severe faults.

In scenarios where labeled anomalous data are scarce or unavailable, unsupervised and semi-supervised anomaly detection approaches are usually applied, because only normal data are required to train a detection model. The two approaches differ in their assumptions about the labels of training data. In semi-supervised learning, it is assumed that the training set is comprised of only data instances from the normal class[Note that semi-supervised anomaly detection differs from the traditional notion of “semi-supervised learning” in machine learning, where both label and unlabeled data are used simultaneously for training.], while in an unsupervised setting, it is often implicitly assumed that few anomalous instances can exist in the training data <cit.>. We note that the approach we introduce in this paper can apply to both settings. We choose to use the term “unsupervised learning” throughout this paper to refer to both situations where normal data account for the majority or the entirety of the training data.  Although unsupervised approaches usually lack the discriminative ability to assign labels to anomalous data, it is still considered an appealing complement to supervised approaches in many real-world applications.

Recently, neural network approaches, especially deep neural networks, have attracted much attention from the machine learning community, 
due to their ability to process natural data in their raw form and learn internal representations that can be used for detecting or classifying patterns <cit.>. Yet, as the authors of the recent review paper <cit.> also pointed out, supervised learning accounted for the majority of the recent success of deep learning, while unsupervised learning is expected to be far more important in the longer term. This paper aims at taking advantage of the recent development of deep learning and provide a methodology for developing unsupervised anomaly detection algorithms for handling sequential sensing data in industrial applications.



 §.§ Our Contributions


In particular, we investigate the applicability of an encoder-decoder approach on sequential image sensing data collected in a real industrial setting. The contributions of this paper are two-fold:

    
  * We propose using an encoder-decoder architecture for detecting anomalies in sequential image sensing data collected from AM process. The learning process is unsupervised, meaning that no anomalous data are needed a priori to train the detection model. 
    
  * We design a CNN-based encoder-decoder network to monitor the manufacturing process of the LAMPS testbed, a platform that uses SLS technology for AM. In our experiment, the network can not only detect the artificially injected laser anomalies with high accuracy, but also can indicate regions of the manufacturing testbed where the temperature is higher than usual. Our results demonstrate the effectiveness of the proposed algorithm in detecting anomalous phenomena.




 §.§ Paper Organization


The remainder of this paper is organized as follows. In Sec. <ref>, we will give the background about LAMPS, the encoder-decoder architecture and deep-learning-based anomaly detection approaches. We will define the anomaly detection problem for sequential data in Sec. <ref>. We will describe our anomaly detection methodology for sequential image data in Sec <ref>. In Sec. <ref>, we will describe in details our anomaly detection algorithm when applied to a real-world AM dataset with injected faults. Experimental results will be demonstrated and evaluated in Sec. <ref>. We will discuss future work and conclude the paper in Sec. <ref>. 


§ BACKGROUND




 §.§ LAMPS


AM technologies have transformed the manufacturing landscape. <cit.> In contrast to traditional manufacturing technologies, 
AM technology is capable of printing 3D parts with highly complex geometries in a single process step. 
Due to its versatility, AM technology are used in a wide variety of applications such as medical devices and aircraft manufacturing <cit.>. One of the prominent AM technologies is Selective Laser Sintering (SLS) that uses a laser to form solid parts out of powdered material. Building parts with consistent high-quality is a key challenge for the SLS process today <cit.>.
Therefore, having an algorithm that can monitor the SLS printing process and can indicate potential anomalies will significantly improve SLS process control. This, in turn, will lead to improved part quality and ensure repeatability.

We now briefly introduce the SLS printing process and the testbed we used for data collection and testing purposes. SLS utilizes a laser to fuse powder geometries layer-by-layer and hereby generates a solid 3D structure. At the beginning of each layer, a roller spreads a new powder layer across the powder bed. Once the powder has been spread, the laser melts the cross-section of the desired part according to the digital 3D model. After the laser has finished scanning for the current layer, a new powder layer is spread and the scanning process is repeated. Over time the melted powder locations on each layer will cool down and will solidify to one.

LAMPS is a SLS testbed that was designed and built for process control research. LAMPS is capable of building 3D parts out of high-performance plastics (melting temperatures as high as 350 °C) and is equipped with a variety of sensors, such as IR and visual cameras, that provide in-situ measurement access. Fig. <ref> shows the general architecture of the LAMPS testbed.



In the context of this paper, we focus on the high-speed mid-wave infrared (IR) camera which is bore-sighted with the laser optics to record the laser focus and its immediate surrounding. The camera has a resolution of 64×64 pixels and has a maximum recording frame rate of 2.24 kHz. Fig. <ref> shows an exemplary IR image of the bore-sighted camera. The recorded IR information is translated to gray-scale (single-channel) temperature images, where the intensity value of each pixel represents the measured temperature value at that pixel.



 §.§ Encoder-decoder architecture


The encoder-decoder architecture has proven to be a useful approach for learning (deep) representations, 
and is widely used in various application domains of deep learning, including machine translation <cit.>, and image denoising <cit.>. An encoder-decoder model generally consists of three parts: the encoder, the latent space representation, and the decoder. The purpose of the encoder network Enc is to transform the input data into a latent space representation z that is often a vector; the decoder network Dec then produces the output by decoding z. During training, the encoder and the decoder are trained together to minimize the empirical risk. 

Proper design of the latent space representation z is crucial to the successful application of the encoder-decoder approach. Let us take the basic autoencoder model as an example. An autoencoder is a neural network model that is trained to reconstruct its input. In other words, an autoencoder is trained to learn an identity function for the data distribution. By constraining z to be a low dimensional vector, the training process encourages the model to learn the most useful information for reconstructing the input.




 §.§ Unsupervised anomaly detection with deep learning


Supervised deep learning has been extensively studied in various applications domains. 

In fault/anomaly detection tasks, we often do not have access to the entire spectrum of off-nominal data, as well as the labels that come along with it. As a result, unsupervised approaches that do not require labeled anomaly data are more suitable in such scenarios.

In this paper, we aim to explore unsupervised anomaly detection using a deep learning approach. Specifically, we will adopt the encoder-decoder scheme described earlier in Sec. <ref>.

The general idea behind unsupervised anomaly detection approaches is to find an approximate model that can capture the normal behavior of complex systems. The approximate model can then be used to flag anomalies if the deviation of the predicted behaviors of the trained model from the actual observation exceeds some certain threshold. Examples that share this general idea include  OC-SVM <cit.>, PCA <cit.> and autoencoders <cit.>.

The encoder-decoder schemes for anomaly detection that appeared in literature in general fall into three categories, which differ in their prediction outputs: 1) autoencoder models <cit.>, 2) prediction models, and 3) composite models <cit.> that performs both reconstruction and regression. We denote our observation at time instant τ by S_τ. The observations we observe in time then forms as a sequence {S_τ}. Let g be a function that maps an input sequence of length p to an output sequence of length q. These encoder-decoder schemes are therefore summarized below:

    (S_τ_-p+1,…,S_τ_0)
         
            (S_τ_-p+1,…,S_τ_0), reconstruction model,
    
            (S_τ_1,…,S_τ_q), regression model,
    
            (S_τ_-p+1,…,S_τ_q), composite model.


As previously described, reconstruction models (a.k.a. autoencoders) aim to find a compact representation for input data distribution. Depending on the format of the input data, different neural network architectures or their combinations are used to design encoders and decoders. Autoencoders are first trained on data that are normal or almost fault-free. The reconstruction errors given by autoencoder models are often used as anomaly scores to indicate potential anomalies. This approach is seen in previous literature for anomaly detection in multivariate timeseries <cit.>.  

Similarly, we can also use the encoder-decoder architecture for prediction tasks. In the case of time series data, a neural network prediction model can be trained to predict the future from past observations. Taking the past p observations as input (S_τ_-p+1,…,S_τ_0), the model is trained to predict the next q observations (S_τ_1,…,S_τ_q). During training, the encoder will look for information needed for the decoder to predict the future, and encode the information as latent space representations. In this case, the prediction errors are used to indicate potential anomalies. 

The authors of <cit.> argue that a composite model, by performing the reconstruction and the regression tasks simultaneously, can overcome the drawbacks of each one when performed alone, and thus achieving better performance at learning useful representations in the data. Previous literature reports on schemes for detecting anomalies in videos <cit.> and multivariate time series. In our case study to be later discussed, we designed our encoder-decoder model as a composite model to leverage the advantages of both reconstruction and regression models.




§ THE ANOMALY DETECTION PROBLEM

Assume that we are given a series of observation data, 
S_τ_0,S_τ_1,…,S_τ_i,…, where each S_τ_i∈𝒮 (𝒮 being the input domain) 
denotes the representation of the ith data point in the sequential data. In the anomaly detection setting, we assume that all data points from the training set are in the normal state. 

Let ℱ be a model class, where each f ∈ℱ: 𝒮→ℝ_≥ 0 denotes a score/fitness function that characterizes how close a data point is to an abnormal state, i.e., larger f implies higher chance of a data point being abnormal.

For a given threshold value ϵ > 0, we define the detection precision of f as

    prec(f,ϵ) = SS is abnormal|f(S)>ϵ

where the expectation is taken over the distribution of the test data, and the recall of f as

    recall(f,ϵ) = Sf(S)>ϵ| S  is abnormal

Our goal is to learn a score function ∈ℱ and a corresponding threshold ϵ, such that (,ϵ) achieves the best detection accuracy and recall of anomalies on the (unseen) test data.



§ METHODOLOGY

 
We utilize the encoder-decoder architecture described in Sec. <ref> to design a neural network that can be used to detect possible anomalies in AM process. Since we are dealing with image data in LAMPS application, we choose to use CNN <cit.> as the main building blocks for our encoder-decoder model. Our approach uses the composite prediction model described earlier in Sec. <ref> – the designed model will not only attempt to reproduce the input but also predict what will happen next.



 §.§ CNN-based encoder-decoder model


In our unsupervised learning setting, we only have access to data points collected under normal condition. The learning goal is to use a neural network to model the normal behaviors of the system under study. Outliers to the learned distribution will be identified as potential anomalies.

Let us suppose that each observation S_τ in the sequential data is a single-channel 2D image of dimension m× n, i.e. S_τ∈ℝ^m× n. To capture the temporal correlations among the observations, a sliding window approach can be used to divide the original image sequence into snippets, where each snippet 𝐙_k∈ℝ^m× n× (p+q) comprise of p+q consecutive frames, and k is the index of the snippet.

When a regression or composite prediction scheme is used to train an encoder-decoder model, the frames in a snippet constitute the input and the output. For training a regression model, the first p frames in a snippet 𝐗_k∈ℝ^m× n× p constitute the model input, and the rest q frames are the output to be predicted. In the case of a composite model, the input is still the 𝐗_k, and the output is the entire p+q frames. If we view the frames in a snippet as channels in an image, the learning problem can be cast as an image-to-image translation task. To be more specific, we will train the encoder-decoder network ℳ to learn a mapping g: ℝ^m× n× p→ℝ^m× n× (p+q) that transforms a p-channel image input 𝐗_k to an output 𝐙̂_k with (p+q) channels. 
The prediction output 𝐙̂_k can be seen as the combination two parts, 𝐗̂_k and 𝐘̂_k. 𝐗̂_k is the reconstruction of the p input frames, and 𝐘̂_k is a prediction of the q frames following the input frames. 

When training the encoder-decoder model, we aim to minimize the errors on both the reconstruction part and the regression part. Since the model input and output are both images, the following pixel-wise MSE can be used as the error metric on frame S_τ.

    ℓ_mse(S_τ, Ŝ_τ) = ‖S_τ-Ŝ_τ‖_F,

where ‖·‖_F is the Frobenius norm of a matrix.

Let us suppose the frames in snippet k are taken at time instants τ_k^0, τ_k^1, …, τ_k^p+q-1. By choosing (<ref>) as the error metric, we can define the reconstruction error e_k^rec and regression error e_k^reg on snippet k as follows 

    e_k^rec   ≐∑_0 ≤ i < pℓ_mse(S_τ_k^i, Ŝ_τ_k^i),
    
        e_k^reg   ≐∑_0 ≤ i < p+qℓ_mse(S_τ_k^i, Ŝ_τ_k^i).

The loss function L to minimize during model training can then be defined as as the weighted sum of reconstruction error e_k^rec and regression error e_k^reg on all training samples k∈𝒦.

    L = ∑_k e_k^rec + λ e_k^reg

where λ is a weighting factor that adjusts the relative importance between the reconstruction error and the regression error.




 §.§ Using the trained model for anomaly detection


Assuming the trained encoder-decoder model has learned a good representation of the normal behavior of the system, the differences between the predicted images and their corresponding ground truth can be used to indicate possible anomalies. By comparing the images, we are essentially getting a large number of pixel-wise errors, and thus a method is needed to process this information in order to detect and locate the anomalies.

One simple idea is to use the original loss function (<ref>) that we used for training the network. These loss values can be derived directly from the prediction results, and can be used as good indicators for evaluating the network's prediction quality; however, this approach also suffers from two drawbacks. First, if the anomaly is only localized to a small area, it is likely that the prediction errors are only significant in a small part of the image. When we calculate the pixel-wise MSE over the entire image, useful indications of anomalies may be buried in noise and averaged out. In addition, even if a significant loss is observed on an image, this approach only indicates a potential anomaly on the image level, but it does not give further hint about the occurrence of this anomaly. It is unknown whether the anomaly is local to only a small area or affects the entire image.



To address the above mentioned challenge when using for evaluating image-to-image differences, we propose a “spatial scoping” approach: we aim to find a a× b window from the m× n error matrix E_τ=S_τ-Ŝ_τ that has the maximum Frobenius norm. The new error metric ℓ_ss is thus defined as:

    ℓ_ss(S_τ, Ŝ_τ) = max_0≤ i ≤ m-a 
     0≤ j ≤ m-b‖E_τ^i:i+a,j:j+b‖_F,

where the superscript in E_τ^i:i+a,j:j+b indicates the position of the window in the original error matrix E_τ.

Next we define two anomaly scores, the reconstruction anomaly score ^rec(τ) and the regression anomaly score ^reg(τ), as the metrics for evaluating the “degree of anomaly” of an observation S_τ. Note that there is more than one snippet that encompasses S_τ because we used a sliding window approach to generate the snippets. To get a single anomaly score taking into account the prediction errors from all relevant snippets, we define the anomaly score as the average prediction errors from all these snippets. 

Suppose K_τ^rec is the index set of snippets whose reconstruction window covers S_τ, and K_τ^rec is the index set of snippets whose reconstruction or regression window covers S_τ. The reconstruction and regression anomaly scores on S_τ can be defined by as follows


    ^rec(τ)    = 1/|K_τ^rec|∑_k_∈ K_τ^rece_k^rec, reconstruction
    ^reg(τ)    = 1/|K_τ^reg|∑_k∈ K_τ^rege_k^reg, regression


where |K_τ^rec| and |K_τ^reg| are the cardinalities of sets K_τ^rec and K_τ^reg respectively. A notable difference between K_τ^rec and K_τ^reg is their sizes. In the reconstruction case, all snippets whose regression windows (of length p) cover S_τ are included in K_τ^rec. As a result, |K_τ^rec| = p, except at the start or end of sequence {S_τ} because at the boundaries there are be fewer snippets covering an observation. In the regression case, as long as an anomaly is seen in either the reconstruction window (of length p) or the regression window (of length q), the anomaly would (probably) be caught in the regression error. Therefore, |K_τ^reg| = p+q except at the start or end of sequence {S_τ}.  

The anomaly scores introduced above can be used to evaluate how likely an observation S_τ will correspond to an anomalous state of the system under study. Later in Sec. <ref> and Sec. <ref>, we will present a case study on LAMPS to illustrate our proposed approach.
  



§ ALGORITHMIC DETAILS FOR LAMPS




 §.§ Benchmark dataset with synthetic faults


Fig. <ref> shows the laser trajectory in LAMPS machine. It is clear that the laser follows a periodical motion pattern in our experiment. The laser firstly moves rightward till the right boundary of the column and then move leftward to the left boundary. During each period of motion, the laser power will move forward 1 unit in the line axis. There is no laser power in the leftward process which is depicted with dashed lines in Fig. <ref>. We therefore only took the rightward process into consideration in this experiment. 

For testing our anomaly detection algorithm, we created an “off-nominal” build with the LAMPS machine. During this build, the laser power was altered at specific time instances from its nominal power. We will detail the layout of the build below.

The off-nominal build consisted of three columns being built over the course of 250 layers. Each column had the same off-nominal pattern applied in order to create a large dataset. For each layer, the laser scanned the rectangles (the horizontal section of the columns) with straight scan lines that were horizontally aligned. Off-nominal conditions were applied to every fourth layer by scanning specific scan lines with off-nominal laser power instead of nominal laser power. The off-nominal conditions were only applied every fourth layer to ensure that there would be no temperature influences between off-nominal layers.

The horizontal cross-section of each column is of a rectangle shape. 
Fig. <ref> illustrates the off-nominal scan line pattern for one of the three rectangles. Each rectangle consists of 215 horizontal scan lines and the bore-sight camera is able to approximately take 40 frames for each scan line. The off-nominal laser power magnitude stayed the same within every off-nominal layer, but was continuously changed throughout the build. For more comprehensive testing, the anomalies injected have different lasting areas, from 1 line to 4 lines.



 §.§ CNN-based encoder-decoder network design




To create training data for the encoder-decoder model, we divide the dataset into snippets with each consisting p+q frames. As illustrated in Fig. <ref>, each snippet is oriented in the vertical direction and spans p+q scan lines. The frames within a scan line are ordered by the time sequence the images were taken. Let us denote by S_i,j the jth frame taken in the ith scan line; here the indices for column number and layer number are omitted for brevity. The encoder-decoder model is trained to transform each input data point 𝐗_k = (S_i,j, S_i-1,j, …, S_i-p+1,j)∈ℝ^m× n× p into a predicted output 𝐙̂_k = (Ŝ_i,j, Ŝ_i-1,j, …, Ŝ_i-p+1,j)∈ℝ^m× n×(p+q).

We choose a VGG-based <cit.> structure. The convolution kernel size is chosen to be 3×3 and the pooling kernel size is chosen to be 2×2 to build a deeper network instead of using a large kernel size.
As shown in Fig. <ref>, in our network there are four stacked down-sampling layer groups and four stacked up-sampling layer groups to sample the data and reconstruct the data respectively. Each down-sampling group has one or two Convolution layers (depending on the network depth) and a “Maxpooling” layer and correspondingly each up-sampling layer has the same number of “Convolution” layers and a “Up-sampling” layer.
Functionally, when the data is input into the neural network, each down-sampling layer group will down-sample the spatial dimensions (width, height) and double the depth of the data while each up-sampling layer will up-sample the spatial dimensions and halve the depth.
Between the up-sampling groups and down-sampling groups, we set two fully connected layers, from which the latent space representations can be extracted. In addition, in order to prevent the network from over-fitting, we add a “Dropout” layer to each group. To make training more efficient, we add a “BatchNormalization” <cit.> layer to each group between the “Maxpooling” layer and the “Dropout” layer.



§ EXPERIMENTAL EVALUATION
 










 §.§ Data preparation and preprocessing




We choose five nominal layers as our training set and five off-nominal layers with different size of anomalies as our test set; see Table <ref> for details about the off-nominal layers.

In our data preprocessing step, the data was normalized by changing the range (the difference between max and min values) of the data to one. We down-sampled the original 64× 64 image data to a resolution of 32×32, to reduce the complexity of our network. We chose p=q=3 in our experiment for creating the snippets as described in Sec. <ref>. 


To improve the robustness of our model against small perturbation in input data, we augmented our dataset by adding a small Gaussian noise (with zero mean and a standard deviation of 0.01C) to the training data. In addition, we know from physics that the thermodynamics of the powder bed is largely governed by the gradient of the temperature distribution; therefore, we can generate additional synthetic data by adding a constant temperature bias b (in our experiment b∈[-1.8 C, +1.8 C]) to the original data. This helps regularize our network to better capture the underlying thermodynamics.



 §.§ Network implementation and hyperparameter tuning

We used Keras <cit.> as the framework for implementing the encoder-decoder model. λ was set to 1 so that the reconstruction and regression errors were equally weighted. The model was trained for 500 epochs.

In our unsupervised setting, we did not have labeled anomalous data for using the conventional cross-validation technique to tune the hyper-parameters as in supervised learning. To create a validation set that contains both normal and anomalous data points, we used a simple method to create some synthetic anomalies. 20% of the training data was first picked out as the validation data. We tuned the hyper-parameters (e.g., dropout rates and the number of convolution kernels) until the validation loss on normal data had converged.



 §.§ Result analysis and evaluation


To assess the performance of our model, we tested our model using layers that have different degrees of anomaly. We plotted the distributions of the reconstruction anomaly score in Fig. <ref> and the regression anomaly score in Fig. <ref> from a top-down view, with the raw MSE (<ref>) used as the error metric. It can be clearly seen that some of the regions with a high anomaly score are located along certain scan lines. To better visualize and quantify the variation of anomaly scores across different scan lines, we display in Fig. <ref> the average anomaly score along each scan line. From the plot, we can see that scan lines with high anomaly scores appear either as “sharp peaks”, or as “big bumps”, which may indicate different causes of anomalous conditions, and should thereby be treated and analyzed separately. 



Sharp peaks 
To isolate these sharp peaks in Fig. <ref>, a detrend technique can be applied to filter out the slowly varying component; here we use a simple detrend technique by subtracting the signal using a window size of 20. In addition, we also apply the spatial scoping technique (<ref>) as the error metric for calculating the anomaly score. The resulting signal is displayed in Fig. <ref>, where we can see a clear correlation between the large peaks and the injected anomalies.
A simple thresholding method is used to do anomaly detection. We test our model on the entire training sets and choose the maximum line-wise regression score as the threshold, so no false positives can be detected on all these normal layers. Most injected anomalies can now be correctly detected. We also observe that the first anomaly is difficult to detect. Due to the fact that the deviated laser power merely lasts for 1 line, the temperature there has not yet been significantly changed since the energy accumulated is not sufficient to cause temperature variation in case of limited lasting time and these anomalies may sometimes be buried in the noise. Table <ref> shows the performance of our detection model on the five off-nominal layers. The detection model performs better on layers with higher laser power deviation; the precision and recall rates both exceed 90% in layers A1 and A2. In layers A4 and A5, the precision and recall rates drop significantly, which is due to the reduced temperature disturbance due to smaller laser power deviation. It can also be seen in Fig. <ref>, the AUC rate exceeds 0.97 in layer A1 and layer A2 but drops to only 0.776 in layer A5.

For comparison, we also implemented a simple non-learning method that simply used raw temperature measurement for detecting anomalies. The anomaly score for each image S_τ is defined as its root-mean-square intensity (temperature) value over the image, i.e.

    ^temp(τ) = ‖S_τ‖_F.

As an example, we visualize the distribution of the anomaly scores on Layer A2 from the non-learning method in Fig. <ref>. The ROC curves obtained from applying this non-learning method on these anomalous layers are displayed in Fig. <ref>. It can be seen that our encoder-decoder approach gives a much superior performance to the non-learning method.



Big bumps
Having found the cause of sharp peaks, we would like to identify the cause of large bumps in the anomaly scores. By comparing the three top-down views in Fig. <ref>, we observe an obvious correlation among these large bump regions. We conjecture that the elevated anomaly scores are due to the high temperature (generally 2C higher than surroundings) and the steep temperature gradient in these parts of the powder bed.



§ CONCLUSION

In this paper, we proposed an unsupervised deep learning approach for detecting potential anomalies in an AM system. As future work, we plan to apply the proposed technique to other industrial applications. We also plan to conduct a more in-depth theoretical analysis of the proposed technique.   





plain


