Asim Munawar

Phongtharin Vinayavekhin

Giovanni De Magistris

Spatio-Temporal Anomaly Detection for Industrial Robots through Prediction in Unsupervised Feature Space

Spatio-temporal anomaly detection by unsupervised learning have applications in a wide range of practical settings. In this paper we present a surveillance system for industrial robots using a monocular camera. We propose a new unsupervised learning method to train a deep feature extractor from unlabeled images. Without any data augmentation, the algorithm co-learns the network parameters on different pseudo-classes simultaneously to create unbiased feature representation. Combining the learned features with a prediction system, we can detect irregularities in high dimensional data feed (e.g. video of a robot performing pick and place task). The results show how the proposed approach can detect previously unseen anomalies in the robot surveillance video. Although the technique is not designed for classification, we show the use of the learned features in a more traditional classification application for CIFAR-10 dataset.

Introduction

Reliable working of an industrial pipeline is important to ensure the high performance of the system. As the sensors installed in the robot are not sufficient to reveal all kind of irregularities in the system, it is common for the technicians to have visual inspections of the machines and robots. This involves significant human labor and have a risk of human error and a delay in fault detection. To assist the human operator in this task, we present a video surveillance system for industrial robots and machinery using a monocular camera. The proposed system learns to perform spatiotemporal anomaly detection by using unlabeled surveillance video and warns the human operator in case of an unusual event.

The anomaly detection system we use is inspired by the prediction mechanism of human neural system. As shown in Figure 1, in human brain, anomalies are detected by comparing the expectation with the actual observation [START_REF] Egner | Expectation and surprise determine neural population responses in the ventral visual stream[END_REF]. In- stead of comparing the expectation and observation in image space the brain makes the comparison in an encoded feature space down the visual cortex.

In this paper, we create a feature representation of the images by training a deep convolutional neural network (CNN).Deep convolutional neural networks trained in a fully supervised manner have shown impressive results on datasets containing millions of images and thousands of classes [START_REF] Krizhevsky | Imagenet classification with deep convolutional neural networks[END_REF]. The state-of-the-art results produced by such networks [START_REF] Krizhevsky | Imagenet classification with deep convolutional neural networks[END_REF][START_REF] Szegedy | Going deeper with convolutions[END_REF] were only possible due to the availability of large labeled datasets. Creating these datasets is an expensive process and the amount of labeled data grows rapidly with the increasing number of model parameters. For many applications, like anomaly detection, the labeling of the data might be impossible. For these reasons, unsupervised learning -although underperforming in some applications -remains an appealing paradigm. Most of these unsupervised methods use data augmentation by exploiting both color space and geometric transforms. For our application of robotics surveillance, the data augmentation cannot be used. For example, applying geometric transformations (e.g. flip, scale, rotate etc.) have no advantage for surveillance of industrial robots from a fixed surveillance camera.

For the previous reasons, we develop a new unsupervised learning method of unlabeled data to train a deep con- volutional neural network based feature extraction system without data augmentation. The proposed method co-learns multiple classification objectives to generate unbiased feature vectors. The feature representation learned by the network is neutral and does not favor a single classification task. To detect anomalies in high dimensional input sequence (e.g. video), we train a deep prediction network in the feature domain and any event that cannot be predicted is treated as an anomaly. Although we demonstrate the proposed method on convolutional network, it is equally applicable to other kind of deep network configurations.

The rest of the paper is organized as follows: Section 2 explains the core idea of this research. Related work is described in Section 3. Details of the proposed method is described in Section 4. Quantitative analysis of the method is presented in Section 5. Finally, conclusion and future directions are given in Section 6.

Core Idea

The core idea behind this research is to convert the images in a sequence to a lower dimensional feature space; performing a prediction in this feature domain and comparing it with the actual observation can reveal both spatial and temporal anomalies. A good feature representation should effectively represent the input data. In supervised learning the features are learned to help perform a desired classification. As the network is trained to perform a single task the feature vectors may get biased towards that task [START_REF] Dosovitskiy | Discriminative unsupervised feature learning with convolutional neural networks[END_REF]. In this paper we present a new method to generate unbiased features by unsupervised learning.

An assumption for unbiased features is that, if we can divide the input data in some clusters we should be able to divide the feature vectors into similar classes. As the data is not labeled, different image cues are used for clustering the images to generate pseudo-class labels. Instead of training on one set of pseudo-classes, we propose simultaneous training of the network on different pseudo-class labels. Figure 2 elaborates this process of co-learning. Co-learning on different labels at the same time forces the features to stay neutral and not get biased towards a single problem. The process is repeated many times with different clusters to generate more versatile features.

Figure 3 shows how the extracted features can be used to perform anomaly detection. We use a biologically plausible system for anomaly detection. According to T. Egner et al. [START_REF] Egner | Expectation and surprise determine neural population responses in the ventral visual stream[END_REF], expectation and surprise determine the anomaly in human neural system. As it is not feasible to make prediction in a very high-dimensional space (e.g. videos), we use the compressed feature space to make a prediction. By predicting the next feature vector that should be observed and comparing it with the actual observation can find anomalies both in time and space.

Related Work

One of the main challenge in anomaly detection is that usually very few anomalous data is available. An intuitive solution is to learn to model or represent what is normal, and then detect any irregularities as anomalies. In a spatial domain, B. Saleh et al. [START_REF] Saleh | Object-centric anomaly detection by attribute-based reasoning[END_REF] use visual attributes [START_REF] Farhadi | Describing objects by their attributes[END_REF] based on the image appearance, i.e. color, texture and shape to model a normality of a particular class of object. The anomalous data is then detected by reasoning about the abnormalities using a generative model.

Anomaly detection in spatial-temporal domain becomes more complicated due to the temporal component in the data. Traditional approaches model the normalities by explicitly tracking object trajectories. Objects with unusual trajectories are identified as anomalies. A. Basharat et al. [START_REF] Basharat | Learning object motion patterns for anomaly detection and improved object detection[END_REF] has provided an in-depth review on these approaches. W. Lawson et al. [START_REF] Lawson | Detecting anomalous objects on mobile platforms[END_REF] define normalities of the different scenes using a dictionary of deep visual features obtained from AlexNet [START_REF] Krizhevsky | Imagenet classification with deep convolutional neural networks[END_REF]. A context of each scene is learned and used to indicate which objects (deep visual feature clusters) should appear in the scene. Any image patches whose visual feature is matched to the cluster not associated to the current scene is detected as anomalies. D. Xu et al. [START_REF] Xu | Learning deep representations of appearance and motion for anomalous event detection[END_REF] treated an anomaly detection as one-class classification problem. Autoencoders are used to unsurprisingly learn the feature for appearance and motion in the scene. Then a multiple one-class SVM classifiers are trained to separate between normalities and anomalies. This paper proposed a novel method to model normalities through prediction. Without explicitly detect objects or their motion, the method is capable of detecting anomalies by comparing the future prediction and the next scene appearance in the feature space.

Literature regarding an unsupervised feature learning are briefly given here as a reference to our novel feature learning method. Unsupervised feature learning has gained popularity in recent years due to the ease in data preparation. One category of an approach is based on using auto-encoders. Auto-encoder was originally considered as a dimensional reduction technique [START_REF] Hinton | Reducing the dimensionality of data with neural networks[END_REF] similar to Principal Component Analysis (PCA). It soon became a technique to perform feature learning [START_REF] Ranzato | Efficient learning of sparse representations with an energy-based model[END_REF][START_REF] Vincent | Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion[END_REF] for various tasks. The main drawback is that it is hard to train the auto-encoder to learn the input distribution. A lot of research has been proposed to counter this issue [START_REF] Le | Building high-level features using large scale unsupervised learning[END_REF][START_REF] Paine | An analysis of unsupervised pre-training in light of recent advances[END_REF].

Another category of an approach is based on a K-mean clustering. Coates et al. [START_REF] Coates | An analysis of single-layer networks in unsupervised feature learning[END_REF][START_REF] Coates | Learning Feature Representations with K-Means[END_REF] proposed a unsupervised framework to extract features from K-mean. The proposed method is similar in to a single-layered feature mapping in a convolutional neural network. Input image is divided into a small patches and transformed into feature space using a provided encoding method based on K-mean. Dundar et al. [START_REF] Dundar | Convolutional clustering for unsupervised learning[END_REF] recently improved the method so that the learned filters are less redundant. They also extended the idea to allow K-mean to be trained in a deeper architecture with the intention to extract a higher-level representation.

A recent research from Dosovitskiy et al. [START_REF] Dosovitskiy | Discriminative unsupervised feature learning with convolutional neural networks[END_REF] proposed a unsupervised feature learning method that is novel and does not belong the above categories. It is based on training a convolutional neural networks with a pseudo training data. Image patches are randomly sampled from input images and pseudo classes are created for each patch. To allow the networks to effectively learn discriminative features, a considerable amount of data in each class is required. This is achieved by applying a set of transformations to each patch and considering them as the data of the same class. The authors referred to the method as Exemplar-CNN.

Although Exemplar-CNN and the proposed method have some similarities, they use different techniques for creat-

Details

In this section we separately discuss different parts of the proposed unsupervised feature learning and anomaly detection approach. 9 ---END---

Unsupervised Feature Learning

The proposed unsupervised algorithm for training feature extractor depends on generating a set of pseudo-labels for training the network. Algorithm 1 elaborates the process of creating pseudo-labels. These pseudo-labels, when co-learned simultaneously, generate feature representation that is not biased towards single classification task.

Generating Pseudo-Classes

Pseudo-classes can be generated by clustering algorithms. In this paper, we have used commonly used k-means clustering algorithm [START_REF] Macqueen | Some methods for classification and analysis of multivariate observations[END_REF] with randomly initialized centroids. For a set of data points (x 1 , x 2 , . . . , x n ), where each observation has d-dimensions, k-means clustering algorithm aims to partition the n observations into k(≤ n) sets S = S 1 , S 2 , . . . , S k . It does so by minimizing the sum of squares within each cluster. The objective of the k-means can be written as: where, µ i is the mean of points in set S i . arg min

S k i=1 x∈Si x -µ i 2 (1)
where µ i is the mean of points in set S i .

k-means is an iterative algorithm but it converges quickly to a local optimum. Although k-means works well for low dimensional data, it makes little sense to apply the algorithm directly to a high dimension data like images. Due to the curse of dimensionality the Euclidean distance looses its meaning in very high dimensional spaces [START_REF] Aggarwal | High-Dimensional Outlier Detection: The Subspace Method[END_REF][START_REF] Xie | Unsupervised deep embedding for clustering analysis[END_REF].

In order to make useful clusters dimensionality reduction is applied based on simple image cues before clustering. In this paper we use two important features namely color and gradients. For clustering based on color information we create a 3D color histogram of the images in the dataset with different number of bins. The number of bins determine the ratio of dimensionality reduction. To cluster based on the edge information in the images, we have used histogram of oriented gradients (HOG) [START_REF] Dalal | Histograms of oriented gradients for human detection[END_REF]. The dimensions of the reduced space depend on the image size, HOG cell size, number of orientation bins and the stride.

It is common to introduce variations in the input images by data augmentation. Data augmentation can involve both color space modifications and geometric transforms. Some techniques use extreme data augmentation of images to create pseudo classes for unsupervised learning [START_REF] Dosovitskiy | Discriminative unsupervised feature learning with convolutional neural networks[END_REF]. Instead of using extreme data augmentation we introduce these variations by co-learning and changing the set of pseudo-classes that are learned simultaneously. Some kinds of data augmentation while heavily used in both supervised and unsupervised classification problems, does not help at all in other applications. For example, applying geometric transformations (e.g. horizontal flip, scale, rotate etc.) to increase training data have no advantage for surveillance of industrial robots from a fixed surveillance camera. Even though we don't use any data augmentation at all for the evaluation of the proposed approach, depending on the application some kind of augmentation might have a positive effect on the performance.

Co-Learning

The abstract concept of co-learning is shown in Figure 2. The idea behind co-learning is that learning to classify many pseudo-classes at the same time will help to generate more neutral feature representation. The feature extractor part of the deep network is followed by more then one softmax for different pseudo-labels that are co-learned. Each softmax is represented as:

P (y = j|x) = e x T wj K k=1 e x T w k (2)
where, x is the input and W is the weight matrix. We use cross-entropy loss as the cost function for each softmax layer. Given, p ∈ {y, 1 -y} and q ∈ {ŷ, 1 -ŷ}, cross entropy defines the similarity between p and q as:

L(w) = 1 N N n=1 H(p n , q n ) = - 1 N N n=1 [y n logŷ n + (1 -y n )log(1 -ŷn )] (3)
As the network have more than one softmax layers we use the sum of all the cross-entropy loss functions as our final cost function for back propagation.

Algorithm 2 shows the training method in detail. The process of co-learning is repeated with different set of pseudo-classes until the termination criteria is reached. As the features are not learned on a single class of labels and therefore, they are expected to be more general and unbiased. The parameters of the optimizer (e.g. learning rate etc.) may or may not be updated at the time of changing the set of pseudo-labels.

Spatio-temporal anomaly detection

It is difficult if not impossible to make a system that can predict the next expected input in the high dimensional image space. Instead of applying prediction directly to the images, we use a deep long short term memory (LSTM) [START_REF] Hochreiter | Long short-term memory[END_REF] based recurrent neural network (RNN) to predict the next video frame in the learned feature space (Figure 3). As the feature space is an encoding of the original image space, the difference between the prediction and actual observation can reveal anomalies. The LSTM prediction network can encode the feature vectors in a video sequence both in space and time. Therefore, the proposed system is capable of detection spatial anomalies as well as temporal anomalies. Note that the prediction happens in feature space and not the original image space, as a consequence the proposed technique can generate a warning but cannot localize the position of anomaly.

Results

In this section we show the use of the proposed technique for the surveillance of an industrial robot. We also show how the extracted features can be used in a more common classification task by using the well-known CIFAR-10 dataset [START_REF] Krizhevsky | Learning Multiple Layers of Features from Tiny Images[END_REF].

Industrial robots surveillance

We used the proposed unsupervised feature learning for surveillance of industrial robots and machinery. As the industrial robots usually perform same task over and over again any irregularity in the normal operation can be detected as an anomaly. As shown in Figure 4, we perform anomaly detection using a Baxter robot [22] that is performing a pick and place operation repeatedly. Gazebo [START_REF] Koenig | Design and use paradigms for gazebo, an open-source multi-robot simulator[END_REF] was used to generate the surveillance video of the task at 10 frames per second. The object is placed at different locations and the task of the robot is to pick the object from that location and put it at another random location. Every 10th frame of a normal pick and place operation is shown in Figure 5(a). Figure 5(b) shows a failed pick and place operation with object rolling off the table as a result of hitting the gripper. The proposed system informs the human operator if the operation is running normally or not. This is shown by the colored outline of the frame in Figure 5.

Green suggests a normal operation, while red indicates an anomaly.

To verify the proposed anomaly detection technique, we have introduced some anomalies by simulation and synthetically. A list of the anomalies that we have introduced for testing our system is given in Table 1.

The training data consisted of 10, 000 image frames of the region of interest extracted from the video at the rate of 10 fps. Each image was of size 3x256x256. Instead of applying clustering directly to the images, HOG was used in different configurations to create cluster based on the edge information. In the first configuration the cell size was 16x16, gradients were discretized into 16 bins, and a stride of 16 was used to create 4096 dimension vectors for each image. In another configuration HOG was used with cell size 32x32, and a stride of 32 to make 1024 dimension output. Raw images were used for HOG based dimensionality reduction for clustering. K-means clustering with random initialization of centroids was done on the training data in the reduced dimension space. We created clusters of size k = 10, 20, 30, 40, 50, 100, 150 clusters for each configura-tion of HOG resulting in a set of 14 pseudo-labels.

The feature extraction network we use is a CNN with 3 convolutional layers and 1 fully connected layer in the end. To train the CNN we have used the raw images of the region of interest (shown in Figure 4) with size 3x256x256. First convolutional layer has 10 filters of size 11×11 with a stride of 2. The convolutional layer is followed by a max-pooling layer of size 3 × 3 and stride of 2. Second convolutional layer has 20 filters of size 7 × 7 with a stride of 2. Last convolutional layer has 40 filters of size 5 × 5 with a stride of 2. The last fully connected layer is of size 512. All the neurons in the convolutional and fully connected layer are rectified linear units (ReLUs). 50% dropout is applied to the output of last convolutional layer and the fully connected layer during training.

The co-learning was performed by randomly choosing any 2 of the generated pseudo-labels. They were trained using stochastic gradient descent (SGD) with initial learning rate of 0.01 and batch size was 64 for 5 epochs. After that a different set of 2 pseudo-labels was selected for learn. This process was repeated 10 times bringing the total number of epochs performed for co-learning on different labels to 50. Learning rate of SGD was decreased to 0.001 after first 10 epochs.

After converting our testing data to 512 dimensional feature space an LSTM based prediction system was used to learn the prediction of the next frame based on the past observations. To create testing data, we randomly created 700 sequences of 100 frames each from the long sequence of the 10, 000 feature vector frames. The prediction system consisted of a two layer LSTM of size 512 -256 -256 -512. The LSTM network is trained to predict the next 512 dimensional feature vector in the sequence. Adam [START_REF] Kingma | A method for stochastic optimization[END_REF] was used as optimizer algorithm for training. Mean square error was used as a cost function. The network was trained for 50 epochs with batches of size 50. LSTM cell state was reset after each training batch.

After training the prediction system we can input the current image in feature domain and generate a prediction for the next observation. This prediction is then compared with the actual observation. Instead of using means square error, we take the absolute difference of the two feature vectors and then compute mean of top 5% values in the difference vector. The reason for using the top 5% values is that if we use mean square error the values that are more or less similar will suppress the values that are significantly different. Therefore, we only consider the predicted values that are very different from the actual observation. This assumption is also consistent with the biological systems where we usually ignore small anomalies and just concentrate only on the strong anomalies.

The mean of the top 5% values give us a quantitative measure for the quality of our prediction. The results we Figure 6. Anomaly detection results for the 6 test cases mentioned in Table 1. Red dotted line shows the threshold to decide anomaly. Green dotted lines define the boundaries of the frame containing anomaly.

achieve for the test cases presented in Table 1 are given in Figure 6. We can see that by deciding a threshold (shown by red dotted line), we can differentiate between a normal operation and anomaly. We selected a threshold such that no normal frames are detected as anomaly. As the threshold defines the tradeoff between false positive and false negatives, choosing an appropriate threshold is problem and data dependent.

We are using GTX TITAN equipped Intel Xeon 8 core 3.16GHz 10GB machine running Ubuntu 14.04. Training time includes the time taken by:

• Clustering -on CPU: 2694.2 s • Feature extractor -on GPU: 1706.5 s • Anomaly detector -on GPU: 182.3 s At inference time, we can run the system at over 20fps on the CPU.

Using learned features for classification

Even though the proposed technique is not designed for classification task, we show how it can be used images to learn feature representation for CIFAR-10. The learned features were tested using the ground truth labels of the dataset. CIFAR images have 3x32x32 dimensions. We applied k-mean clustering to color and edge based image cues. 3D color histogram with 8, 8, 8 bins for red, green and blue color was used to produce 512 dimension vector for each image. HOG was also used in different configurations to cluster based on the edge information. In the first configuration the cell size was 16x16, gradients were discretized into 16 bins, and a stride of 16 was used to create 64 dimension vectors for each CIFAR image. In another configuration HOG was used with cell size 8x8, and a stride of 8 to make 256 dimension output. The dimensionality reduction was applied to both the training and the testing images of in raw form.

K-means clustering with random initialization of centroids was done only on the training data in the reduced dimension space. The testing data was assigned to the closest clusters. We created clusters of size k = 5, 10, 20, 30, 40, 50, 100, 150, 200, 250 clusters for each dimensionality reduction method resulting in 30 sets of pseudo-labels. The result of clustering by color histogram and HOG is shown in Figure 7. It is clearly visible that the clusters group the images based on color and edge orientation respectively.

The feature extractor network had three convolutional layers followed by a single fully connected layer. The first convolutional layer has 64 filters of size 5×5 with a padding of 2 and a stride of 1. This is followed by a max-pooling layer of filter size 3 × 3 and stride of 2. The next convo- lutional layer had same stride and padding with 128 filters. The third layer again was similar to the previous layers with 256 filters. Both layer 2 and 3 of the network were followed by a max-pooling layer of size 3 × 3 and stride of 2. This is followed by a 50% dropout. The fully connected layer is 4096 × 2048. So our learned features will be of 2048 dimensions. The feature layer is fed to a 50% dropout before connecting them to the different softmax layers that are co-learned. All the neurons in the convolutional and fully connected layer are rectified linear units (ReLUs).

The co-learning was performed by randomly choosing any 5 of the generated pseudo-labels. They were trained using stochastic gradient descent (SGD) with initial learning rate of 0.01 and batch size was 128 for 5 epochs. After that a different set of 5 pseudo-labels was selected to learn. This process was repeated 10 times bringing the total number of epochs performed for co-learning on different labels to 50. The learning rate of SGD was changed to 0.001 after first 10 epochs. Even though the clustering was done on raw CIFAR-10 images, we used the normalized image (subtract mean and divide by standard deviation for each image independently) for training.

After the training is completed all the training and the testing data was passed through the deep CNN network to obtain the feature vectors. The feature vectors were used to train a 10-way linear SVM using the actual CIFAR-10 dataset labels. The classification accuracy reveals the effectiveness of the technique.

Without any data augmentation we can achieve 68.8% classification accuracy. The state of the art is 84.3% presented by Dosovitskiy et al. [START_REF] Dosovitskiy | Discriminative unsupervised feature learning with exemplar convolutional neural networks[END_REF]. However, as discuss above our goal is not classification and while Dosovitskiy et al. rely on extreme data augmentation we do none at all. The filters learned by the first layer of convolutional neural network are shown in Figure 8.

Conclusions

In this paper we propose a new technique to detect anomalies in the operation of industrial robots. We do this by training a deep feature extractor in a fully unsuper-vised manner and combining it with a prediction system. In contrast to recent unsupervised learning techniques the proposed approach does not rely on data augmentation for learning. Due to the independence from data augmentation, the proposed technique can be used to solve the anomaly detection for industrial robots by unsupervised learning.

The proposed technique co-learns the parameters on multiple pseudo-classes at once to create unbiased feature vectors. Pseudo-classes are generated by simple clustering based on some image cues. We show how the feature extractor can be effectively combined with a prediction system for spatio-temporal anomaly detection. We demonstrated the use of such a system as an unsupervised anomaly detector for the industrial pipeline. Although not designed for classification task, we show the proposed approach can achieve reasonable performance for classification of CIFAR-10 dataset.

Looking for better image cue based clustering techniques for generation of pseudo-classes is one of the areas we want to explore in future. Furthermore, we would like to do theoretical analysis of the co-learning in unsupervised learning.

Figure 1 .

 1 Figure 1. Expectation and surprise determine anomaly in human neural system.

Figure 2 .

 2 Figure 2. Co-learning on multiple pseudo-classes to learn unbiased feature representation.

Figure 3 .

 3 Figure 3. Anomaly detection by comparing the prediction and observation in feature domain.

Figure 4 .

 4 Figure 4. Robot surveillance view with the region of interest (ROI).

Figure 5 .

 5 Figure 5. Robot surveillance video sequence (we show only 1 frame in 1 second). Outline color of each frames shows if the systems recognized it as an anomaly or not. (a) Normal pick and place operation with no anomaly. (b) Failed operation results in the ball rolling off the table.

Figure 7 .

 7 Figure 7. CIFAR-10 clusters used as pseudo-labels (Each row in an represent a different class). All clusters were generated on raw CIFAR-10 images by applying k-means with initial centroids randomly selected. For images in top row k = 10 and for the bottom row k = 100. Different algorithms were used for dimensionality reduction. (a) 3D color histogram with 8, 8, 8 bins for red, green and blue (512 dimensions). (b) HOG is with cell size 16x16, 16 gradient bins, stride of 16 (64 dimensions). (c) HOG is with cell size 8x8, 16 gradient bins, stride of 8 (256 dimensions).

Figure 8 .

 8 Figure 8. Filters of first convolutional layer. Different algorithms were used for dimensionality reduction. (a) Supervised learning. (b) Proposed unsupervised learning.

Algorithm 1 :

 1 Algorithm for creating pseudo-classes.

		training
		data and the testing data
	1 ---START---
		/ * Loop until N C generated	* /
	2 while Total number of generated clusters > N C do
		/ * Select algorithm from R	* /
	3	r = RANDSELECTFROM(R)
		/ * Compute reduced dimensional
		components for D train	* /

Data: D train ; Unlabeled training data Data: D test ; Unlabeled testing data Data: N train ; Size of training data Data: N dimension ; Problem dimension Input: R; Dimensionality reduction algorithms Input: C; List of clustering algorithms Input: N c ; Number of one type of clusters Input: N C ; Number of clusters to generate Result: N C labels are generated for both the 4 d train = r.FIT(RANDINT(1,N dimension ), D train ) / * Reduce D test dimensions * / 5 d test = r.TRANSFORM(D test ) / * Select algorithm from C * / 6 c = RANDSELECTFROM(C) 7 while Number of generated clusters >= N c do / * Create clusters for d train * / 8 C train = c.FIT(RANDINT(1,N train ), d train ) / * Create clusters for d test * / 9 C test = c.TRANSFORM(d test ) 10 ---END--ing/utilizing the pseudo-classes and training the network.

Exemplar-CNN relies on data augmentation on each image to create pseudo-classes. We generate pseudo-classes based on various image cues (e.g. edge, color), without creating new image data (data augmentation). Data augmentation is suitable for learning the feature distribution for classification task, but not for the surveillance task where there are only a few variations in the appearance of the scenes. Moreover, Exemplar-CNN uses one set of pseudo-classes to train a network, while we use multiple sets of pseudo-classes to co-learn the network parameters using a single cost function.

Algorithm 2 :

 2 Proposed co-learning algorithm. Data: D train ; Unlabeled training data Data: D test ; Unlabeled testing data Input: N C ; Total number of clusters (pseudo-classes) available for training Result: Trained deep feature extractor that is not biased towards a single kind of problem

	1 ---START---
		/ * Create and initialize a deep feature extractor (FE) with random weights.	* /
	2 F network =Init()
		/ * Loop until the overall termination criteria is satisfied.	* /
	3 while Not Satisfying the Overall Termination Criteria do
		/ * Randomly select some clusters from N C set of available pseudo-labels	* /
	4	N =RANDINT(1,N C )
	5	C train , C test = RANDOMLYSELECTNCLUSTERS(N )
		/ * Join feature extractor with N RBMs each terminating with a softmax	* /
	6	T network =JOIN(F network , N RBM)
	7	while Not Satisfying the Termination Criteria do
		/ * Update the network by sum of softmax cross entropy as cost function	* /

8

UPDATENETWORK(T network )

Table 1 .

 1 List of anomalies for quantitative analysis of spatiotemporal anomaly detection. Anomalies that can be detected from a single frame are listed as spatial anomalies. The anomalies that require at least two observations are listed as temporal anomalies.

	No.	Anomaly type	Category	Frames
	0.	No anomaly	-	-
	1.	Failed pick/Object fall	Spatial	26-62
	2.	Person entering the view	Spatial	60-65
	3.	Sudden changes in light condition Spatial	20-22
	4.	Sudden change in motion	Temporal	35-100
	5.	Sudden stop	Temporal	96-100


I Alfaro

F Gagliardi

J Olivera

E Cueto

L Filice

F Chinesta

SIMULATION OF THE EXTRUSION OF HOLLOW PROFILES BY NATURAL ELEMENT METHODS

Keywords: Extrusion, welding line, hollow profile, meshless methods, NEM

In this paper, the Natural Element Method (NEM) together with the alpha shapes and some extra numerical procedures are used in the simulation of hollow profiles, emphasizing on the simulation of the welding lines. Numerical results are compared with experimental ones, checking the accuracy of the method.

INTRODUCTION

Extrusion is one of the most utilized processes among the bulk metal forming ones. The introduction of the Finite Element modeling and, in particular, the development of high efficient mesh management procedures, allowed the simulation of very complex processes characterized by large surfaces generation, high strains and strain rate. Extrusion of hollow profiles is a key process as far as lightweight and efficient structures are regarded, without using secondary processes such as bending and welding. Optimization of such processes today is mainly carried out by experiments, using trial and error techniques, mainly due to the unsuitability of the FEM based commercial codes. On the numerical simulation of the hollow components extrusion it is very important to model properly the material joining in the welding chamber after the bridge. As can be seen on figures 1 and 2, slightly differences on the die geometry and extrusion conditions lead to success or fail on the extrusion of a tube. The Natural Element Method (NEM) presents some advantages over Finite Element simulations, such as no remeshing requirements or the accuracy of the approximation even with highly irregular clouds of nodes. The meshless characteristic of NEM is also very adequate to simulate the creation and joining of free surfaces, as occurs during extrusion of hollow profiles. It is also possible to detect and simulate the welding lines formed when the material is joined after the porthole, checking if the resulting profile welds as it was predicted.

α-NEM

NEM

Essentially, the NEM is a Galerkin procedure that relies on natural neighbor interpolation to construct the trial * Corresponding author: iciar@unizar.es +34 976761912 and test functions characteristic of this method. Consider a model composed by a cloud of points N = {n 1 , n 2 , . . . , n m } ⊂ R d , for which there is a unique decomposition of the space into regions such that each point within these regions is closer to the node to which the region is associated than to any other in the cloud. This kind of space decomposition is called a Voronoi diagram of the cloud of points and each Voronoi cell is formally defined as: proposed. The original version of the method [START_REF] Braun | A numerical method for solving partial differential equations on highly irregular evolving grids[END_REF] employed natural neighbour (Sibson) interpolation [START_REF] Sibson | A Vector Identity for the Dirichlet Tesselation[END_REF]. Sibson interpolation is very well-known in the approximation community as a high-quality interpolation scheme with many advantages (see, for instance, [START_REF] Hiyoshi | A numerical comparison of the natural neighbor interpolation and the finite element method[END_REF]). Sukumar [START_REF] Sukumar | Natural Neighbor Galerkin Methods[END_REF] later proposed the use of Laplace (also known as non-Sibsonian) interpolation [START_REF] Hiyoshi | Two generalizations of an interpolant based on Voronoi diagrams[END_REF]. This interpolant, used in this paper, is considerably less costly than the original Sibson interpolant, although somewhat less smooth. If we define the distance h J = d(x, x J ) and the cell intersection m IJ = {x ∈ T I T J , J = I} (see Fig. 3 for an example), we can define the value

T I = {x ∈ R d : d(x, x I ) < d(x, x J ) ∀ J = I},
α J (x) = |m xJ | h J . (2)
The shape function related to node I at point x is then defined as

φ ns I (x) = α I (x) n J=1 α J (x) . (3)

α SHAPES

When dealing with processes involving free surface flows, such as extrusion of hollow profiles, it is very important to accurately track their positions. Since meshless methods only use clouds of nodes, it is necessary to use shape con-structors, which are geometrical entities that give a continuous shape to a discrete cloud of nodes. One of such constructors is the family of α-shapes of the cloud [START_REF] Edelsbrunner | Three dimensional alpha shapes[END_REF]. A cloud of points defines a finite set of shapes that can be parameterized by the level of detail up to which we want to represent the geometry. The idea behind α-shapes is simple: those triangles (or tetrahedra in 3D) of the Delaunay triangulation whose circumradius is greater than the desired level of detail, say α, are eliminated from the shape constructor. Figure 4 show an example of the different α-shapes for a cloud of five nodes and different α values. Constructing the model by taking into account the actual shape of the domain has consequences not only in geometrical aspects of the method, but also in the quality of the approximation. As demonstrated in [START_REF] Cueto | Imposing essential boundary conditions in the Natural Element Method by means of density-scaled α-shapes[END_REF], the use of a proper α-shape for the definition of the domain ensures the linear interpolation of the essential field along the boundary.

a ¥ < a=0

WELDING FLOWS SIMULATION

As stated before, small differences on the die geometry can produce important defects on the extruded profile.An evidence of its importance can be found in several works present in literature which deal about its shape optimization.

Compromises among different needs have to be considered; Valberg [START_REF] Valberg | Extrusion welding in aluminium extrusion[END_REF], for example, stated that the size of the welding chamber has to be designed as a trade-off between an optimum die strength and pressure conditions. In fact, for the first greatness, the chamber should be narrow while, on the other hand, the ideal pressure and, consequently, a complete die filling are achieved with wider dimensions. The height of the welding chamber is another parameter that has to be carefully analyzed to improve the quality of the final extruded component. Donati et al. [START_REF] Donati | Characterization of seam weld quality in AA6082 extruded profiles[END_REF], tested different chamber heights obtaining the best weld qualities for the largest value. Moreover, it has to be said that welding pressure is influenced by many other process variables, such as the extrusion ratio, the punch speed, billet and die temperature [START_REF] Jo | Prediction of welding pressure in the non-steady state porthole die extrusion of Al7003 tubes[END_REF].

The defect studied in this paper is the lack of welding of the extruded flows due to an insufficient pressure on the welding chamber. The method proposed here modifies the creation algorithm of the α-shape to include the effect of the pressure on it. During the simulation pressure of the nodes is tracked and saved. Every time a new α-shape has to be done, pressure of the nodes of every triangle whose nodes belongs to two different flows is checked. If nodes of this triangle have ever had a pressure higher than a cer-2 tain value, called required welding pressure, then this triangle is considered as definitely welded. Otherwise, the weld is not fully created. When a triangle with a good welding has a negative pressure, meaning that the weld tries to open, the triangle is kept in the α-shape. When the welding tries to open through a not well welded triangle, this triangle is deleted and the crack is open. The following figures show two test examples. On the first case a very low required welding pressure is defined, thus the weld is created. Figure 5 presents in blue color the welded area. On the second case a very high required welding pressure is defined, so the welding is not created and the tube is not correctly extruded (see Figure 6).

SIMULATION OF TUBE EXTRUSION

In order to check the accuracy and robustness of the method, a simulation of a real extrusion tube of 11mm external diameter and 2mm thickness has been done, and the results are compared with the experimental ones. The tube is made of lead, since this material behaves as viscoplastic at low temperature, so extrusion can be done at room temperature. Before performing the extrusion experiment, a complete series of material tests have been done in order to characterize its properties. On the simulation, the viscoplastic behavior has been modeled with the equation σ = 60d 0.1 , where d is the equivalent strain rate defined as d = 2 3 ε : ε. In a previous paper [START_REF] Filice | A laboratory scale equipment to relieve force and pressure in cold extrusion of lead hollow components[END_REF], the pressure inside the extrusion zone was measured experimentally using a proper equipment. Then, this measure was used to calibrate a commercial FE code in order to rebuild the pressure distribution all over the extruded material. In this way, it was shown that the required welding pressure threshold is about 150 MPa for the investigated case. On the welding simulation, the modified α-NEM code has been used, imposing the welding pressure of 150MPa. Due to symmetry, only one quarter of the profile has been simulated using a cloud of 2580 nodes to create the initial α-shape. Figure 7 shows the pressure value on the welding chamber area. It can be seen that only one region, far from the exit area, has a pressure higher than 150MPa. Since material in this area doesn't flow through the exit, this weld is not propagated and the welding won't take place. Figure 8 shows how the weld is not created and a crack appears. Results are in agreement with experimental ones, shown in figure 9.

CONCLUSIONS

Up to now the FE codes have been used to simulate the process but the unavailability to model the welding line evolution is one of the main drawbacks of this approach. Although the Natural Element Method together with the α-shapes has been already used to simulate extrusion processes and many other processes with free surfaces, it is the first time it is used to study the welding lines formed in the extrusion of hollow profiles. Taking into account the history of the nodes and thanks to the meshless characteristic of the method, it is possible to modify the α-shapes to detect when the welding line is well created. Both the academical example and the simulation corresponding to the real experimental test, confirm that the objective of simulating the behavior of the welding line is fulfilled.

Figure 1 :

 1 Figure 1: Extrusion of a tube

( 1 )

 1 where d(•, •) is the Euclidean distance function. Two nodes sharing a facet of their Voronoi cell are called natural neighbours and hence the name of the technique. The dual structure of the Voronoi diagram is the Delaunay triangulation. Natural neighbours of a given node are those nodes that share with it an edge of a Delaunay triangle or tetrahedron In the NEM framework, different interpolants have been 1

Figure 2 :

 2 Figure 2: Faulty tube extrusion

Figure 3 :

 3 Figure 3: Definition of non-Sibsonian coordinates.

Figure 4 :

 4 Figure 4: α-shapes.

Figure 5 :

 5 Figure 5: Welding is created. Welded area.

Figure 6 :

 6 Figure 6: Welding is not created.

Figure 7 :

 7 Figure 7: Simulated pressure.

Figure 8 :

 8 Figure 8: Simulated α-shape.

Figure 9 :

 9 Figure 9: Experimental results.