T IME A UTO ML: A UTONOMOUS R EPRESENTATION L EARNING FOR M ULTIVARIATE I RREGULARLY S AMPLED T IME S ERIES
Anonymous authors
Paper under double-blind review
A BSTRACT
Multivariate time series (MTS) data are becoming increasingly ubiquitous in diverse domains, e.g., IoT systems, health informatics, and 5G networks.
To obtain an effective representation of MTS data, it is not only essential to consider unpredictable dynamics and highly variable lengths of these data but also important to address the irregularities in the sampling rates of MTS.
Existing parametric approaches rely on manual hyperparameter tuning and may cost a huge amount of labor effort.
Therefore, it is desirable to learn the representation automatically and efﬁciently.
To this end, we propose an autonomous representation learning approach for multivariate time series (TimeAutoML) with irregular sampling rates and variable lengths.
As opposed to previous works, we ﬁrst present a representation learning pipeline in which the conﬁguration and hyperparameter optimization are fully automatic and can be tailored for various tasks, e.g., anomaly detection, clustering, etc.
Next, a negative sample generation approach and an auxiliary classiﬁcation task are developed and integrated within TimeAutoML to enhance its representation capability.
Extensive empirical studies on real-world datasets demonstrate that the proposed TimeAutoML outperforms competing approaches on various tasks by a large margin.
In fact, it achieves the best anomaly detection performance among all comparison algorithms on 78 out of all 85 UCR datasets, acquiring up to 20% performance improvement in terms of AUC score.
I NTRODUCTION
The past decade has witnessed a rising proliferation in Multivariate Time Series (MTS) data, along with a plethora of applications in domains as diverse as IoT data analysis, medical informatics, and network security.
Given the huge amount of MTS data, it is crucial to learn their representations effectively so as to facilitate underlying applications such as clustering and anomaly detection.
For this purpose, different types of methods have been developed to represent time series data.
Traditional time series representation techniques, e.g., Discrete Fourier Transform (DCT) (Faloutsos et al., 1994), Discrete Wavelet Transform (DWT)(Chan & Fu, 1999), Piecewise Aggregate Approximation (PAA)(Keogh et al., 2001), etc., represent raw time series data based on speciﬁc domain knowledge/data properties and hence could be suboptimal for subsequent tasks given the fact that their objectives and feature extraction are decoupled.
More recent time series representation approaches, e.g., Deep Temporal Clustering Representation (DTCR) (Ma et al., 2019), Self-Organizing Map based Variational Auto Encoder (SOM-VAE)
(Fortuin et al., 2018), etc., optimize the representation and the underlying task such as clustering in an end-to-end manner.
These methods usually assume that time series under investigation are uniformly sampled with a ﬁxed interval.
This assumption, however, does not always hold in many applications.
For example, within a multimodal IoT system, the sampling rates could vary for different types of sensors.
Unsupervised representation learning for irregularly sampled multivariate time series is a challenging task and there are several major hurdles preventing us from building effective models: i) the design of neural network architecture often employs a trial and error procedure which is time consuming and could cost a substantial amount of labor effort; ii) the irregularity in the sampling rates constitutes a major challenge against effective learning of time series representations and render most existing methods not directly applicable; iii) traditional unsupervised time series representation learning approach does not consider contrastive loss functions and consequently only can achieve suboptimal performance.
To tackle the aforementioned challenges, we propose an autonomous unsupervised representation learning approach for multivariate time series to represent irregularly sampled multivariate time series.
TimeAutoML differs from traditional time series representation approaches in three aspects.
First, the representation learning pipeline conﬁguration and hyperparameter optimization are carried out automatically.
Second, a negative sample generation approach is proposed to generate negative samples for contrastive learning.
Finally, an auxiliary classiﬁcation task is developed to distinguish normal time series from negative samples.
In this way, the representation capability of TimeAutoML is greatly enhanced.
We conduct extensive experiments on UCR time series datasets and
UEA multivariate time series datasets.
Our experiments demonstrate that the proposed TimeAutoML outperforms comparison algorithms on both clustering and anomaly detection tasks by a large margin, especially when time series data is irregularly sampled.
R ELATED W ORK
Unsupervised Time Series Representation Learning Time series representation learning plays an essential role in a multitude of downstream analysis such as classiﬁcation, clustering, anomaly detection.
There is a growing interest in unsupervised time series representation learning, partially because no labels are required in the learning process, which suits very well many practical applications.
Unsupervised time series representation learning can be broadly divided into two categories, namely 1) multi-stage methods and 2) end-to-end methods.
Multi-stage methods ﬁrst learn a distance metric from a set of time series, or extract the features from the time series, and then perform downstream machine learning tasks based on the learned or the extracted features.
Euclidean distance (ED) and Dynamic Time Warping (DTW) are the most commonly used traditional time series distance metrics.
Although the ED is competitive, it is very sensitive to outliers in the time series.
The main drawback of DTW is its heavy computational burden.
Traditional time series feature extraction methods include Singular Value Decomposition (SVD), Symbolic Aggregate Approximation (SAX), Discrete Wavelet Transform (DWT)(Chan & Fu, 1999), Piecewise Aggregate
Approximation (PAA)(Keogh et al., 2001), etc.
Nevertheless, most of these traditional methods are for regularly sampled time series, so they may not perform well on irregularly sampled time series.
In recent years, many new feature extraction methods and distance metrics are proposed to overcome the drawbacks mentioned above.
For instance, Paparrizos & Gravano (2015); Petitjean et al.
(2011) combine the proposed distance metrics and K-Means algorithm to achieve clustering.
Lei et al.
ﬁrst extracts sparse features of time series, which is not sensitive to outliers and irregular sampling rate, and then carries out the K-Means clustering.
In contrast, end-to-end approaches learn the representation of the time series in an end-to-end manner without explicit feature extraction or distance learning (Fortuin et al., 2018; Ma et al., 2019).
However, the aforementioned methods need to manually design the network architecture based on human experience which is time-consuming and costly.
Instead, we propose in this paper a representation learning method which optimizes an
AutoML pipeline and their hyperparameters in a fully autonomous manner.
Furthermore, we consider negative sampling and contrastive learning in the proposed framework to effectively enhance the representation ability of the proposed neural network architecture.
Irregularly Sampled Time Series Learning There exist two main groups of works regarding machine learning for irregularly sampled time series data.
The ﬁrst type of methods impute the missing values before conducting the subsequent machine learning tasks (Shukla & Marlin, 2019; Luo et al., 2018; 2019; Kim & Chi, 2018).
The second type directly learns from the irregularly sampled time series.
For instance, Che et al.
; Cao et al.
(2018) propose a memory decay mechanism, which replaces the memory cell of RNN by the memory of the previous timestamp multiplied by a learnable decay coefﬁcient when there are no sampling value at this timestamp.
Rubanova et al.
(2019) combines RNN with ordinary differential equation to model the dynamic of irregularly sampled time series.
Different from the previous works, TimeAutoML makes use of the special characteristics of RNN (Abid & Zou, 2018) and automatically conﬁgure a representation learning pipeline to model the temporal dynamics of time series.
It is worthy mentioning that there are many types of irregularly sampled time series, which may be caused by sensor failure or sampling time error.
And what we put emphasis on analyzing in this paper is a special type of irregularly sampled time series, which have many missing timestamps compared to regularly sampled time series.
AutoML Automatic Machine Learning (AutoML) aims to automate the time-consuming model development process and has received signiﬁcant amount of research interests recently.
Previous works about AutoML mostly emphasize on the domains of computer vision and natural language processing, including object detection (Ghiasi et al., 2019; Xu et al., 2019; Chen et al.),
semantic segmentation (Weng et al., 2019; Nekrasov et al., 2019; Bae et al., 2019), translation (Fan et al., 2020) and sequence labeling (Chen et al., 2018a).
However, AutoML for time series learning is an underappreciated topic so far and the existing works mainly focus on supervised learning tasks, e.g., time series classiﬁcation.
Ukil & Bandyopadhyay propose an AutoML pipeline for automatic feature extraction and feature selection for time series classiﬁcation.
Van Kuppevelt et al.
(2020) develops an AutoML framework for supervised time series classiﬁcation, which involves both neural architecture search and hyperparameter optimization.
Olsavszky et al.
(2020) proposes a framework called AutoTS, which performs time series forecasting of multiple diseases.
Nevertheless, to our best knowledge, no previous work has addressed unsupervised time series learning based on AutoML.
Summary of comparisons with related work We next provide a comprehensive comparison between the proposed framework and other state-of-the-art methods, including (WaRTEm (Mathew et al., 2019), DTCR (Ma et al., 2019), USRLT (Franceschi et al., 2019) and
BeatGAN (Zhou et al., 2019)), as shown in Table 1.
In particular, we emphasize on a total of seven features in the comparison, including data augmentation, negative sample generation, contrastive learning, selection of autoencoders, similarity metric selection, attention mechanism selection, and automatic hyperparameter search.
TimeAutoML is the only method that has all the desired properties.
[Table]
T IME A UTO ML F RAMEWORK 3. P ROPOSED A UTO ML F RAMEWORK
Let X = { x 1 , x 2 , · · · x N } denote a set of N time series in which x i ∈ R T i , where T i is the length of the i th time series x i .
We aim to build an automated time series representation learning framework to generate task-aware representations that can support a variety of downstream machine learning tasks.
In addition, we consider negative sample generation and contrastive self-supervised learning.
The contrastive loss function focuses on building time series representations by learning to encode what makes two time series similar or different.
The proposed TimeAutoML framework can automatically conﬁgure an representation learning pipeline with an array of functional modules, each of these modules is associated with a set of hyperparameters.
We assume there are a total of M modules and there are Q i options for the i th functional module.
Let k i ∈ { 0 , 1 } Q i denote an indicating vector for i th module, with the constraint 1 (cid:62) k
i = (cid:80) Q i j =1 k i,j = 1 ensuring that only a single option is chosen for each module.
Let θ i,j be the hyperparameters of j th option in i th module, where θ Ci,j and θ Di,j are respectively the continuous and discrete hyperparameters.
Let Θ and K denote the set of variables to optimize, i.e., Θ = { θ i,j ,
∀ i ∈
[ M ] , j ∈ [ Q i ] } and K = { k 1 , . . .
, k M } .
We further let f (K , Θ) denote the corresponding objective function value.
Please note that the objective function differs for different tasks.
For anomaly detection, we use Area Under the Receiver Operating Curve (AUC) as objective function while we use the Normalized Mutual Information (NMI) as objective function for clustering.
The optimization problem of automatic pipeline conﬁguration is shown below.
[Equation]
subject to
[Equation]
We solve problem (1) by alternatively leveraging Thompson sampling and Bayesian optimization, which will be discussed as follows.
负责活动前期准备以及后期扫尾工作 d e f pos [ ; ] i i i
y h
z = p o s i
h e n f
Attention c l a s f n e g i x n e g i
h p
o s i
o neg i o
[Figure]
rec i x
( ) i E y rec ( , ) i
i D x x s e l f ( ) i
L x i x
B C E f
[Figure]
i z
e s t
f
i x s i m f
E M f
3.1. P IPELINE C ONFIGURATION
We ﬁrst assume that the hyperparameters Θ are ﬁxed during the pipeline conﬁguration.
We aim at selecting the better module option K to optimize objective function f (K , Θ) , we can delineate it as a K − max problem:
[Equation]
where K is the feasible set,
i.e., K = { K : K = { k i } , k i ∈ { 0 , 1 } Q i , 1 (cid:62) k
i = 1 , ∀ i ∈
[ M ] } and χ K (K) is a penalty term that makes sure K fall in the feasible region.
Thompson sampling is utilized to tackle problem (2).
In every iteration, Thompson sampling assumes the sampling probability of every option in each module follows Beta distribution, and the one corresponding to the maximum sampling value in each module will be chosen to construct the pipeline.
After that, Beta distribution of the chosen options will be updated according to the performance of the conﬁgured pipeline.
Due to space limitation, more details about Thompson sampling and the search space for pipeline conﬁguration are shown in Appendix B and Appendix C, respectively.
The representation learning pipeline consists of eight modules, namely data augmentation, auxiliary classiﬁcation network, encoder, attention, decoder, similarity selection, estimation network and EM estimator, as elucidated in Figure 1.
The goal of data augmentation is to increase the diversity of samples.
The auxiliary classiﬁcation network aims at distinguishing the positive samples from generated negative samples, which will be discussed in detail in Section 3.2.
And we combine encoder, attention, decoder and similarity selection together to generate the low-dimensional representation of the input time series.
Given an input time series x i , we can generate the latent space representation y i , which is an concatenation of the output of h i and reconstruction error z i , as shown below:
[Equation]
where f en and f de refer to an encoder and a decoder, respectively.
There are three options for the encoder and decoder, namely, Recurrent Neural Network (RNN), Long Short Term Memory (LSTM),
Gated Recurrent Unit (GRU).
f sim is a similarity function that characterizes the level of similarity between the original time series and the reconstructed one.
Three possible similarity functions are considered in this paper, i.e., relative Euclidean distance, Cosine similarity, or concatenation of both.
After obtaining the latent space representation of the input time series, EM algorithm is then invoked to estimate the mean and convariance of GMM.
Assuming there are H mixture components in the
GMM model, the mixture probability, mean, covariance for component h in the GMM module can be expressed as φ h , µ h , (cid:80)(cid:80)(cid:80) h , respectively.
Assuming there are a total of N samples, the key parameters of GMM can be calculated as follows:
[Equation]
where f est is the estimation network which is a multi-layer neural network, and
γ i ∈ R H is the mixture-component membership prediction vector.
f EM is the EM estimator which can estimate the mean and convariance of GMM via the EM algorithm.
The h th entry of this vector represents the probability that y i belongs to the h th mixture component.
The sample energy E ( y i ) is given by,
[Equation]
The sample energy can be used to characterize the level of anomaly of an input time series, that is, the sample with high energy will be deemed as an unusual time series.
It is worth noticing that TimeAutoML may suffer from the singularity problem as in GMM.
In this case, the training algorithm may converge to a trivial solution if the covariance matrix is singular.
We prevent this singularity problem by adding 1 e − 6 to the diagonal entries of the covariance matrices.
3.1. H YPERPARAMETERS O PTIMIZATION
Once the representation learning pipeline is constructed, we then emphasize on optimizing the hyperparameters for the given pipeline.
Here we make use of the Bayesian Optimization (BO) (Shahriari et al., 2015) to tackle this Θ − max task, as given below,
[Equation]
where the set C and D denote respectively feasible region of the hyperparameters, and f ( · ) is the objective function given in problem (1).
χ C (Θ C ) and χ D (Θ D ) are penalty terms that make sure the hyperparameters fall in the feasible region.
Unlike random search (Bergstra & Bengio, 2012) and grid search (Syarif et al., 2016), BO is able to optimize hyperparameters more efﬁciently.
More details about BO are discussed in Appendix A. Algorithm 1 depicts the main steps in TimeAutoML and more details are given in Appendix B.
Input: Maximum iterations L and Bayesian Optimization iterations B .
for t = 1 , 2 , · · · , L do
Conﬁguring a complete AutoML pipeline accoding to Thompson Sampling
for b = 1 , 2 , · · · , B do
Hyperparameters optimization: Update hyperparameters according to Bayesian Optimization and obtain the objective function value.
endUpdate parameters of Thompson Sampling in each module according to the obtained objective function values.
end
3. C ONTRASTIVE S ELF - SUPERVISED L OSS
According to Zhou et al.
; Kieu et al.
; Yoon et al.
(2019), the structure of the encoder has a direct impact on the representation learning performance.
Take anomaly detection as an example, the semi-supervised anomaly detection methods (Pang et al., 2019; Ruff et al., 2019) assume that there are a few labeled anomaly samples in the training dataset, which is more effective in representation learning than unsupervised methods.
Instead, the proposed contrastive self-supervised loss does not require any labeled anomaly samples.
It uses generated negative samples as anomalies for model building.
The goal is to allow the encoder to distinguish the positive samples from generated negative samples.
Given a normal time series x i ∈ R T , which is deemed as a positive sample.
We then generate the negative sample x negi by adding noise randomly over a few selected timestamps of x i , that is, x negi =
g ( x i ) , where g ( · ) is the negative sample generation trick.
In the experiment, the noise amplitude is randomly selected within the interval [min( x i ) , max( x i )] .
In the experiment, we generate one negative sample x neg i for each positive sample x i .
The proposed contrastive self-supervised loss L self aims to distinguish the positive time series sample from the negative ones, which can be given as:
[Equation]
where h pos i ∈ R S and h neg i ∈ R S are respectively the latent space representations of positive samples and negative samples, S represents the length of latent space representation.
f clas is the auxiliary classiﬁcation network, o pos
i
[Equation]
and o neg i ∈ R 1 are the outputs of the classiﬁer.
f BCE represents binary cross entropy and we label the positive time series and negative time series asand 1, respectively.
More details about the proposed self-supervised loss L self are shown in Figure 1, we can see that minimizing L self allows the encoder to distinguish the positive samples from the negative samples in the latent space, and consequently entails better latent space representations.
3. O VERALL L OSS F UNCTION AND J OINT O PTIMIZATION
Given a dataset with N time series, for ﬁxed pipeline conﬁguration and hyperparameters, the neural network is trained by minimizing an overall loss function containing three parts:
[Equation]
where D ( x i , x rec i ) represents reconstruction error.
E ( y i ) is the sample energy function which represents the level of abnormality for a given sample.
L self ( x i ) is the proposed contrastive selfsupervised loss.
λ
and λ 2 are two weighting factors governing the trade-off among these three parts.
E XPERIMENT
The performance of the proposed time series representation learning framework has been assessed via two machine learning tasks, i.e., anomaly detection and clustering.
The primary goal is to answer the following two questions in the experiment, 1) Effectiveness : can the proposed representation learning framework effectively model and capture the temporal dynamics of a time series? 2)
Robustness : can TimeAutoML remain effective in the presence of irregularities in sampling rates and contaminated training data?
Dataset We ﬁrst conduct experiments on a total of 85 UCR univariate time series datasets (Chen et al., 2015) to assess the anomaly detection performance.
Next, we also assess the performance of the proposed TimeAutoML on a multitude of UEA multivariate time series datasets (Bagnall et al., 2018).
We follow the method proposed in Chandola et al.
(2008) to create the training, validation, and testing dataset.
AUC (Area under the Receiver Operating Curve) is employed to evaluate the anomaly detection performance.
For clustering, we carry out experiments on a total of 3 UCR univariate datasets and 2 UEA multivariate datasets.
NMI (Normalized Mutual Information) is used to evaluate the clustering results.
Baselines For anomaly detection, the proposed TimeAutoML is compared with a set of state-ofthe-art methods including latent ODE (Rubanova et al., 2019), Local Outlier Factor (LoF) (Breunig et al., 2000), Isolation Forest (IF)
(Liu et al., 2008), One-Class SVM (OCSVM) (Sch¨olkopf et al., 2001), GRU-AE (Malhotra et al., 2016), DAGMM (Zong et al., 2018) and
BeatGAN (Zhou et al., 2019).
For clustering, the baseline algorithms for comparison include K-means, GMM, Kmeans+DTW, K-means+EDR (Chen et al., 2005), K-shape (Paparrizos & Gravano, 2015), SPIRAL (Lei et al., 2017), DEC (Xie et al., 2016), IDEC (Guo et al., 2017), DTC (Madiraju et al., 2018),
DTCR (Ma et al., 2019).
4. A NOMALY DETECTION
We present the AUC scores of the proposed TimeAutoML and other state-of-the-art anomaly detection methods for the 85 univariate time series datasets of UCR archive (Chen et al., 2015).
Due to the space limitation, we choose a portion of the time series datasets and the corresponding anomaly detection results are summarized in Table 2.
The anomaly detection results for the remaining datasets are summarized in Appendix D, Table A2, A3.
It is seen that TimeAutoML achieves best anomaly detection performance over the majority > 90% of the UCR datasets no matter the time series are regularly or irregularly sampled.
In addition, we evaluate the performance of TimeAutoML on a multitude of multivariate time series datasets from UEA archive (Bagnall et al., 2018).
Effectiveness We assess the anomaly detection performance when time series are irregularly sampled ( β = 0 . 5 ) and regularly sampled ( β = 0 ), where β is the irregular sampling rate representing the ratio of missing timestamps to all timestamps (Chen et al., 2018b). Note that we put emphasis on analyzing time series with missing timestamps, which is a special type of irregular sampling time series.
Table 2 presents the AUC scores of the proposed TimeAutoML and state-of-the-art anomaly detection methods on a selected group of UCR datasets and UEA datasets.
We observe that the performance of BeatGAN severely degrades in the presence of irregularities in sampling rates since it is designed for ﬁxed-length input vectors.
We also notice that the proposed TimeAutoML exhibits superior performance over existing state-of-the-art anomaly detection methods in almost all cases for irregularly sampled time series.
In addition, the negative sampling combined with the contrastive loss function can further boost the anomaly detection performance
[Table]
[Table]
Robustness We investigate how the proposed TimeAutoML responds to contaminated training data when time series are irregularly sampled with the rate β = 0 .
AUC scores of the proposed
TimeAutoML when training on contaminated data are presented in Appendix D, Table A4, A5.
We observe that the anomaly detection performance of TimeAutoML slightly degrades when training data are contaminated.
Next, we investigate how TimeAutoML responds to different irregular sampling rate, i.e., when β varies from 0 to 0.7.
The AUC scores of TimeAutoML and state-of-the-art anomaly detection methods on ECGFiveDays dataset are presented in Fig 2 and the results on other datasets are presented in Appendix D, Fig A1, A2.
We notice that TimeAutoML performs well robustly across multiple irregular sampling rates.
4. V ISUALIZATION
In this section [Figure] we use a synthetic dataset to elucidate the underlying mechanism of TimeAutoML model for detecting time series anomalies.
Figure 3 shows the latent space representation learned via TimeAutoML model from a synthetic dataset.
In this dataset, smooth Sine curves are normal time series.
The anomaly time series is created by adding noise to the normal time series over a short interval.
It is evident from Figure 3 that the latent space representations of normal time series lie in a high density area that can be well characterized by a GMM; while the abnormal time series appears to deviate from the majority of the observations in the latent space.
In short, the proposed encoder-decoder structure allows us to project the time series data in the original space onto vector representations in the latent space.
In doing so, we can detect anomalies via clustering-based methods, e [Figure] g., GMM
[Figure]
and easily visualize as well as interpret the detected time series anomalies.
[Figure]
Apart from anomaly detection, TimeAutoML can be tailored for other machine learning tasks as well, e.g., multi-class clustering.
In particular, the clustering process is carried out in the latent space via the GMM model, along with other modules in the pipeline.
We evaluate the effectiveness of TimeAutoML on three univariate time series datasets as well as two multivariate time series datasets.
The NMI of TimeAutoML and state-of-the-art clustering methods are shown in Table 3.
We observe that TimeAutoML generally achieves superior performance compared to baseline algorithms.
This is because: i) it can automatically select the best module and hyperparameters; ii) the auxiliary classiﬁcation task can enhance its representation capability.
[Table]
C ONCLUSION
Representation learning on irregularly sampled time series is an under-explored topic.
In this paper we propose a TimeAutoML framework to carry out unsupervised autonomous representation learning for irregularly sampled multivariate time series.
In addition, we propose a self-supervised loss function to get labels directly from the unlabeled data.
Strong empirical performance has been observed for TimeAutoML on a plurality of real-world datasets.
While tremendous efforts have been undertaken for time series learning in general, AutoML for time series representation learning is still in its infancy and we hope the ﬁndings in this paper will open up new venues along this direction and spur further research efforts
A A PPENDIX A: B AYESIAN O PTIMIZATION
Let f ( θ ) denote the objective function.
Given function values during the preceding T iterations v =
[ f ( θ 1 ) , f ( θ 2 ) , · · · , f ( θ T )] , we pick up the variable for sampling in the next iteration via solving the maxmization problem that involves the acquisition function i.e., expected improvement (EI) based on the postetior GP model.
Speciﬁcally, the objective function is assumed to follow a GP model (Shahriari et al., 2015) and can be expressed as f ( θ ) ∼ GP ( m ( θ ) , K ) , where m ( θ ) represents the mean function.
And K represents the covariance matrix of { θ i } Ti =0 , namely, K ij = κ ( θ i , θ j ) , where κ ( · , · ) is the kernel function.
In particular, the poster probability of f ( θ ) at iteration T + 1 is assumed to follow a
Gaussian distribution with mean µ ( θ ∗ ) and covariance σ 2 ( θ ∗ ) , given the observation function values v :
[Equation]
where κ is a vector of covariance terms between θ ∗ and { θ i } Ti =0 , and σ 2 n denotes the noise variance.
We choose the kenel function as ARD Mat´ern 5/2 kernel (Shahriari et al., 2015) in this paper:
[Equation]
(10) where p and p (cid:48) are input vectors, r 2 = (cid:80) di
=1 ( p i − p (cid:48) i ) 2 /τ 2 i , and ψ = {{ τ i } di =0 , σ 2 n } are the GP hyperparameters which are determined by minimizing the negative log marginal likelihood log( y | ψ ) :
[Equation]
Given the mean µ ( θ ∗ ) and covariance σ 2 ( θ ∗ ) in (9), θ T +1 can be obtained via solving the following optimization problem:
[Equation]
where y + =max[ f ( θ 1 ) , f ( θ 2 ) , · · · , f ( θ T )] represents the maximum observation value in the previous T iterations.
Φ is normal cumulative distribution function and φ is normal probability density function.
Through maximizing the EI acquisition function, we seek to improve f ( θ T +1 ) monotonically after each iteration.
B A PPENDIX B: D ETAILED V ERSION OF T IME A UTO ML
Set: α i ( t ) ∈
R Q i , β i ( t ) ∈ R Q i : the cumulative reward and punishment for i th module for the t th iteration, speciﬁcally, α i (1) =
α
and β i (1) =
β 0 .
for t = 1 , 2 , · · · , L do for i = 1 , 2 , · · · , M do
Sample
[Equation] endObtain the TimeAutoML pipeline conﬁguration by solving the following optimization problem:
[Equation]
subject to k i ∈ { 0 , 1 } Q i , 1 (cid:62) k
i = 1 , ∀ i ∈
[ M ] , for b = 1 , 2 , · · · , B do Hyperparameters optimization: Update hyperparameters according to Bayesian optimization framework given in Appendix A and the obtained objective function value is denoted as f (K( t ) , Θ b ( t )) , where K( t ) denote the module options in t th iteration and Θ b ( t ) denote the hyperparameters in b th Bayesian optimization iteration in t th iteration.
endUpdate Beta distribution of the options in the conﬁgured pipeline:
Let f ( t ) =
max { f (K( t ) , Θ b ( t )) , b = 1 , · · · , B } denote the performance of TimeAutoML model at the t th iteration.
Compute the continuous reward ∼ r :
[Equation]
[Equation] the binary reward r ∼ Bernoulli( ∼ r )
It is seen that TimeAutoML consists of two main stages, i.e., pipeline conﬁguration and hyperparameter optimization.
In every iteration of TimeAutoML, Thompson sampling is utilized to reﬁne the pipeline conﬁguration at ﬁrst.
After that, Bayesian optimization is invoked to optimize the hyperparameters of the model.
Finally, the Beta distribution of the chosen options will be updated according to the performance of the conﬁgured pipeline.
In the experiment, the upper limit to number of entire TimeAutoML iterations, BO iterations are set as 40 and 25 respectively.
The Beta distribution priors are set respectively as α 0 = 10 and β 0 = 10 .
C A PPENDIX C: S EARCH S PACE : O PTIONS AND H YPERPARAMETERS
[Table]
C. D ATA AUGMENTATION
• Scaling: increasing or decreasing the amplitude of the time series.
There are two hyperparametes, the number of data augmentation samples N aug ∈ [0 , 100] and the scaling size h amp ∈ [0 . 5 , 1 . 8] .
Shifting: cyclically shifting the time series to the left or right.
There are two hyperparametes, the number of data augmentation samples N aug ∈ [0 , 100] and the shift size h shift ∈ [ − 10 , 10] .
• Time-warping: randomly “slowing down” some timestamps and “speeding up” some timestamps.
For each timestamp to “speed up”, we delete the data value at that timestamp.
For each timestamp to “slow down”, we insert a new data value just before that timestamp.
There are two hyperparametes, the number of data augmentation samples N aug ∈ [0 , 100] and the number of time-warping timestamps h tm ∈ [ T/ 10 , T/ 4] .
C.
For all encoders, i.e. RNN, LSTM, and GRU, there is only one hyperparameter, i.e., the size of the encoder hidden state.
And we assume it is no larger than 32, i.e., h enc ∈ [1 , 32] .
C. A TTENTION
Self-attention mechanism has been considered in this framework.
C. D ECODER
For all decoders, i.e. RNN, LSTM, and GRU, there is only one hyperparameter, i.e., the size of decoder hidden state h dec .
For univariate time series, we assume it is no larger than 32, i.e., h dec ∈ [1 , 32] .
And we assume h dec ∈ [ n feat , 4 ∗ n feat ] for multivariate time series, where n feat represents the dimension of the multivariate time series.
C. EM E STIMATOR
In this module, we provide a statistical model GMM to carry out latent space representation distribution estimation.
There is one hyperparameter, the number of mixture-component of GMM.
EM algorithm is used to estimate the key parameters of GMM.
C. S IMILARITY SELECTION
We offer three similarity functions for selection, including relative Euclidean distance, cosine similarity, or the concatenation of both.
C. E STIMATION N ETWORK
We utilize a multi-layer neural network as the estimation network in our pipeline.
There are two hyperparameters to be optimized, i.e., the number of layers e layer ∈ [1 , 5] and the number of nodes in each layer e node i ∈ [8 , 128] , ∀ 1 ≤ i ≤ e layer .
C. A UXILIARY C LASSIFICATION N ETWORK
We utilize a multi-layer neural network as the auxiliary classiﬁcation network in our pipeline.
There are two hyperparameters to be optimized, i.e., the number of layers c layer ∈ [1 , 5] and the number of nodes in each layer c node i ∈ [8 , 128] , ∀ 1 ≤ i ≤ c layer .
D A PPENDIX D: R ESULT D. A NOMALY D ETECTION P ERFORMANCE FOR U NIVARIATE T IME S ERIES
[Table]
UWaveGestureLibraryX
[Table]
UWaveGestureLibraryY
[Table]
WormsTwoClass
[Table] [Table]
D. A NOMALY D ETECTION P ERFORMANCE FOR U NIVARIATE T IME S ERIES (C ONTAMINATED T RAINING D ATASET )
[Table]
[Figure]
D.
[Table]
A NOMALY D ETECTION P ERFORMANCE FOR M ULTIVARIATE T IME S ERIES
ATASET
[Table]
[Figure]
E A PPENDIX E: I LLUSTRATION OF IRREGULAR SAMPLING
We provides an illustrative example to demonstrate how TimeAutoML remain robust against the irregularities in the sampling rates.
Both regularly and irregularly sampled time series ( β = 0 . 5 ) are presented in Figure A3.
And for the purpose of illustration we assume the normal time series is
a
Sine curve.
The anomalous time series is obtained via adding noise to the normal time series over a short time interval.
The irregularly sampling rate is set as 0.5 in this example.
As evident from the ﬁgure, the unusual pattern of the anomalous time series preserves after the irregular sampling.
And such unusual pattern appears to be different from the distortion caused by irregular sampling.
Due to the special characteristics of TimeAutoML, e.g., embedded LSTM encoder and attention mechanism, it is capable of learning both the short term and long term correlations among the training time series and therefore can detect such unusual pattern even in the presence of irregularity in the sampling.
[Figure]
F A PPENDIX F: R ESULTS OF TIME SERIES CLASSIFICATION
The representation generated by TimeAutoML can be used to carry out time series classiﬁcation.
We combine the representation generated by TimeAutoML with Gradient Boost Decision Tree (GBDT) to carry out time series classiﬁcation.
Followed Franceschi et al.
(2019), we compared our method with four best supervised state-of-the-art model, HIVE-COTE (Lines et al., 2018), ST (Bostrom &
Bagnall, 2017), EE (Lines & Bagnall, 2015), BOSS (Sch¨afer, 2015), which are shown in Table A6.
It is worthy mentioning that both of TimeAutoML and Franceschi et al.
(2019) are unsupervised time series representation learning models.
Accuracy score is used as the metric to evaluate the classiﬁcation performance.
Besides, the results of DTW (Lei et al., 2017), which is an unsupervised model, and the results of GBDT on original input have also been posted in Table A6.
For easier comparison, we compute the average ranks of TimeAutoML and the benchmarks, which are shown in Figure A4.
It is seen that our method is globally the second-best one (with average rank 2.57), only beaten by HIVE-COTE (2.42), which is a powerful ensemble method using many classiﬁers in a hierarchical voting structure.
And we can observe that, GBDT (6.63) on original input has a poor performance, while combined with representation generated by TimeAutoML can improve the classiﬁcation performance signiﬁcantly, which indicating the important role of TimeAutoML.
[Table]
HIVE-COTE
Our+GBDT
Franceschi
ST
GBDT
DTW
EE
BOSS 2.
G A PPENDIX G: P ARAMETER S ENSITIVITY
In our experiment, λ 1 and λ 2 are two weighting factors governing the trade-off among three parts in our objective in (8).
We analyzed the sensitivity of λ 1 and λ 2 in ECG200 dataset (average overtrials) on anomaly detection task, which is shown in Figure A5.
It is seen that, our approach is not very sensitive to the choice of λ 1 and λ 2 .
Nevertheless, a too large λ 1 or a too small λ 2 may not be friendly to the optimization of our model.
Based on this observation, we set the λ 1 = 0 .
{+0001 and λ 
+}
= 1 in our experiment.
[Figure]
1 = 0.
1 = 0.
1 = 0.
1 = 0.
1 =
We also analyzed the sensitivity of Beta distribution priors α 0 and β 0 in our AutoML framework, which is tested in ECG200 dataset (average over 10 trials) on anomaly detection task and the results are shown in Figure A6.
It is seen that, the choice of Beta distribution priors α 0 and β 0 will not have a signiﬁcant impact on performance, indicating that the our model is not very sensitive to the choice of Beta distribution priors.
[Figure]
H A PPENDIX H: M OTIVATION OF INVOLVING G AUSSIAN M IXTURE M ODEL
The idea of TimeAutoML is to map the original time series into the latent space representation and the generated representation can be used to carry out many downstream machine learning tasks, such as anomaly detection, clustering, classiﬁcation and so on.
We employ the GMM model to characterize the latent space representation distribution of the input data for two reasons.
First, GMM is a ﬂexible and powerful model that has been proved to be capable of approximating any continuous distribution arbitrarily well under mild assumptions.
Second, once we obtain a GMM model using the training data, we can calculate the distances between an input time series and the centroids of GMM in the latent space, which are proportional to the sample energy function.
Therefore, the GMM model, in combination with the sample energy function, help to characterize the level of abnormality of an input time series.
The time series that is far away from the centroids of the GMM in the latent space will be deemed as an anomaly.