# Unsupervised Scalable Representation Learning for Multivariate Time Series

Jean-Yves Franceschi, Aymeric Dieuleveut, Martin Jaggi

► To cite this version:

Jean-Yves Franceschi, Aymeric Dieuleveut, Martin Jaggi. Unsupervised Scalable Representation Learning for Multivariate Time Series. Thirty-third Conference on Neural Information Processing Systems, Neural Information Processing Systems Foundation, Dec 2019, Vancouver, Canada. pp.4650–4661. hal-01998101v4

HAL Id: hal-01998101

https://hal.science/hal-01998101v4

Submitted on 18 Dec 2019

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Unsupervised Scalable Representation Learning
for Multivariate Time Series

**Jean-Yves Franceschi***

Sorbonne Université, CNRS, LIP6, F-75005 Paris, France

jean-yves.franceschi@lip6.fr

**Aymeric Dieuleveut**

MLO, EPFL, Lausanne CH-1015, Switzerland

CMAP, Ecole Polytechnique, Palaiseau, France

aymeric.dieuleveut@polytechnique.edu

**Martin Jaggi**

MLO, EPFL, Lausanne CH-1015, Switzerland

martin.jaggi@epfl.ch

**Abstract**

Time series constitute a challenging data type for machine learning algorithms, due to their highly variable lengths and sparse labeling in practice. In this paper, we tackle this challenge by proposing an unsupervised method to learn universal embeddings of time series. Unlike previous works, it is scalable with respect to their length and we demonstrate the quality, transferability and practicability of the learned representations with thorough experiments and comparisons. To this end, we combine an encoder based on causal dilated convolutions with a novel triplet loss employing time-based negative sampling, obtaining general-purpose representations for variable length and multivariate time series.

# 1 Introduction

We investigate in this work the topic of unsupervised general-purpose representation learning for time series. In spite of the increasing amount of work about representation learning in fields like natural language processing (Young et al., 2018) or videos (Denton & Birodkar, 2017), few articles explicitly deal with general-purpose representation learning for time series without structural assumption on non-temporal data.

This problem is indeed challenging for various reasons. First, real-life time series are rarely or sparsely labeled. Therefore, *unsupervised* representation learning would be strongly preferred. Second, methods need to deliver compatible representations while allowing the input time series to have unequal lengths. Third, scalability and efficiency both at training and inference time is crucial, in the sense that the techniques must work for both short and long time series encountered in practice.

Hence, we propose in the following an *unsupervised* method to learn *general-purpose representations* for *multivariate* time series that comply with the issues of *varying and potentially high lengths* of the studied time series. To this end, we introduce a novel unsupervised loss training a scalable encoder, shaped as a deep convolutional neural network with dilated convolutions (Oord et al., 2016) and outputing fixed-length vector representations regardless of the length of its output. This loss is built

<footnote>*Work partially done while studying at ENS de Lyon and MLO, EPFL.</footnote>
as a triplet loss employing time-based negative sampling, taking advantage of the encoder resilience to time series of unequal lengths. To our knowledge, it is the first fully unsupervised triplet loss in the literature of time series.

We assess the quality of the learned representations on various datasets to ensure their universality. In particular, we test how our representations can be used for classification tasks on the standard datasets in the time series literature, compiled in the UCR repository (Dau et al., 2018). We show that our representations are general and transferable, and that our method outperforms concurrent unsupervised methods and even matches the state of the art of non-ensemble supervised classification techniques. Moreover, since UCR time series are exclusively univariate and mostly short, we also evaluate our representations on the recent UEA multivariate time series repository (Bagnall et al., 2018), as well as on a real-life dataset including very long time series, on which we demonstrate scalability, performance and generalization ability across different tasks beyond classification.

This paper is organized as follows. Section 2 outlines previous works on unsupervised representation learning, triplet losses and deep architectures for time series in the literature. Section 3 describes the unsupervised training of the encoder, while Section 4 details the architecture of the latter. Finally, Section 5 provides results of the experiments that we conducted to evaluate our method.

## 2 Related Work

**Unsupervised learning for time series.** To our knowledge, apart from those dealing with videos or high-dimensional data (Srivastava et al., 2015; Denton & Birodkar, 2017; Villegas et al., 2017; Oord et al., 2018), few recent works tackle unsupervised representation learning for time series. Fortuin et al. (2019) deal with a related but different problem to this work, by learning temporal representations of time series that represent well their evolution. Hyvarinen & Morioka (2016) learn representations on evenly sized subdivisions of time series by learning to discriminate between those subdivisions from these representations. Lei et al. (2017) expose an unsupervised method designed so that the distances between learned representations mimic a standard distance (Dynamic Time Warping, DTW) between time series. Malhotra et al. (2017) design an encoder as a recurrent neural network, jointly trained with a decoder as a sequence-to-sequence model to reconstruct the input time series from its learned representation. Finally, Wu et al. (2018a) compute feature embeddings generated in the approximation of a carefully designed and efficient kernel.

However, these methods either are not scalable nor suited to long time series (due to the sequential nature of a recurrent network, or to the use of DTW with a quadratic complexity with respect to the input length), are tested on no or very few standard datasets and with no publicly available code, or do not provide sufficient comparison to assess the quality of the learned representations. Our scalable model and extensive analysis aim at overcoming these issues, besides outperforming these methods.

**Triplet losses.** Triplet losses have recently been widely used in various forms for representation learning in different domains (Mikolov et al., 2013; Schroff et al., 2015; Wu et al., 2018b) and have also been theoretically studied (Arora et al., 2019), but have not found much use for time series apart from audio (Bredin, 2017; Lu et al., 2017; Jansen et al., 2018), and never, to our knowledge, in a fully unsupervised setting, as existing works assume the existence of class labels or annotations in the training data. Closer to our work even though focusing on a different, more specific task, Turpault et al. (2019) learn audio embeddings in a semi-supervised setting, while partially relying on specific transformations of the training data to sample positive samples in the triplet loss; Logeswaran & Lee (2018) train a sentence encoder to recognize, among randomly chosen sentences, the true context of another sentence, which is a difficult method to adapt to time series. Our method instead relies on a more natural choice of positive samples, learning similarities using subsampling.

**Convolutional networks for time series.** Deep convolutional neural networks have recently been successfully applied to time series classification tasks (Cui et al., 2016; Wang et al., 2017), showing competitive performance. Dilated convolutions, popularized by WaveNet (Oord et al., 2016) for audio generation, have been used to improve their performance and were shown to perform well as sequence-to-sequence models for time series forecasting (Bai et al., 2018) using an architecture that inspired ours. These works particularly show that dilated convolutions help to build networks for sequential tasks outperforming recurrent neural networks in terms of both efficiency and prediction performance.
## 3 Unsupervised Training

We seek to train an encoder-only architecture, avoiding the need to jointly train with a decoder as in autoencoder-based standard representation learning methods as done by Malhotra et al. (2017), since those would induce a larger computational cost. To this end, we introduce a novel triplet loss for time series, inspired by the successful and by now classic word representation learning method known as word2vec (Mikolov et al., 2013). The proposed triplet loss uses original time-based sampling strategies to overcome the challenge of learning on unlabeled data. As far as we know, this work is the first in the time series literature to rely on a triplet loss in a fully unsupervised setting.

The objective is to ensure that similar time series obtain similar representations, with no supervision to learn such similarity. Triplet losses help to achieve the former (Schroff et al., 2015), but require to provide pairs of similar inputs, thus challenging the latter. While previous supervised works for time series using triplet losses assume that data is annotated, we introduce an unsupervised time-based criterion to select pairs of similar time series and taking into account

time series of varying lengths, by following word2vec's intuition. The assumption made in the CBOW model of word2vec is twofold. The representation of the *context* of a word should probably be, on one hand, close to the one of this word (Goldberg & Levy, 2014), and, on the other hand, distant from the one of randomly chosen words, since they are probably unrelated to the original word's context. The corresponding loss then pushes pairs of (context, word) and (context, random word) to be linearly separable. This is called *negative sampling*.

To adapt this principle to time series, we consider (see Figure 1 for an illustration) a random subseries<fnref n="2" /> $x^{\text{ref}}$ of a given time series $y_i$. Then, on one hand, the representation of $x^{\text{ref}}$ should be close to the one of any of its subseries $x^{\text{pos}}$ (a *positive* example). On the other hand, if we consider another subseries $x^{\text{neg}}$ (a *negative* example) chosen at random (in a different random time series $y_j$ if several series are available, or in the same time series if it is long enough and not stationary), then its representation should be distant from the one of $x^{\text{ref}}$. Following the analogy with word2vec, $x^{\text{pos}}$ corresponds to a word, $x^{\text{ref}}$ to its context, and $x^{\text{neg}}$ to a random word. To improve the stability and convergence of the training procedure as well as the experimental results of our learned representations, we introduce, as in word2vec, several negative samples $(x_k^{\text{neg}})_{k \in [1, K]}$, chosen independently at random.

The objective corresponding to these choices to minimize during training can be thought of the one of word2vec with its shallow network replaced by a deep network $f(\cdot, \theta)$ with parameters $\theta$, or formally

<figure><img src="image_2.png" /><figcaption>Figure 1: Choices of $x^{\text{ref}}$, $x^{\text{pos}}$ and $x^{\text{neg}}$.</figcaption></figure>

$$ - \log \left( \sigma \left( f(x^{\text{ref}}, \theta)^{\top} f(x^{\text{pos}}, \theta) \right) \right) - \sum_{k=1}^{K} \log \left( \sigma \left( -f(x^{\text{ref}}, \theta)^{\top} f(x_k^{\text{neg}}, \theta) \right) \right), \quad (1) $$

where $\sigma$ is the sigmoid function. This loss pushes the computed representations to distinguish between $x^{\text{ref}}$ and $x^{\text{neg}}$, and to assimilate $x^{\text{ref}}$ and $x^{\text{pos}}$. Overall, the training procedure consists in traveling through the training dataset for several epochs (possibly using mini-batches), picking tuples $(x^{\text{ref}}, x^{\text{pos}}, (x_k^{\text{neg}})_k)$ at random as detailed in Algorithm 1, and performing a minimization step on the corresponding loss for each pair, until training ends. The overall computational and memory cost is $O(K \cdot c(f))$, where $c(f)$ is the cost of evaluating and backpropagating through $f$ on a time series; thus this unsupervised training is scalable as long as the encoder architecture is scalable as well.

The length of the negative examples is chosen at random in Algorithm 1 for the most general case; however, their length can also be the same for all samples and equal to size($x^{\text{pos}}$). The latter case is suitable when all time series in the dataset have equal lengths, and speeds up the training procedure thanks to computation factorizations; the former case is only used when time series in the dataset do not have the same lengths, as we experimentally saw no other difference than time efficiency between the two cases. In our experiments, we do not cap the lengths of $x^{\text{ref}}$, $x^{\text{pos}}$ and $x^{\text{neg}}$ since they are already limited by the length of the train time series, which corresponds to scales of lengths on which our representations are tested.

<footnote n="2">²I.e., a subsequence of a time series composed by consecutive time steps of this time series.</footnote>
**Algorithm 1:** Choices of $\boldsymbol{x}^{\text{ref}}$, $\boldsymbol{x}^{\text{pos}}$ and $(\boldsymbol{x}_k^{\text{neg}})_{k \in [1, K]}$ for an epoch over the set $(\boldsymbol{y}_i)_{i \in [1, N]}$.

1 **for** $i \in [1, N]$ **with** $s_i = \text{size}(\boldsymbol{y}_i)$ **do**
2 &nbsp;&nbsp;&nbsp;pick $s_i^{\text{pos}} = \text{size}(\boldsymbol{x}^{\text{pos}})$ in $[1, s_i]$ and $s_i^{\text{ref}} = \text{size}(\boldsymbol{x}^{\text{ref}})$ in $[s_i^{\text{pos}}, s_i]$ uniformly at random;
3 &nbsp;&nbsp;&nbsp;pick $\boldsymbol{x}^{\text{ref}}$ uniformly at random among subseries of $\boldsymbol{y}_i$ of length $s_i^{\text{ref}}$;
4 &nbsp;&nbsp;&nbsp;pick $\boldsymbol{x}^{\text{pos}}$ uniformly at random among subseries of $\boldsymbol{x}^{\text{ref}}$ of length $s_i^{\text{pos}}$;
5 &nbsp;&nbsp;&nbsp;pick uniformly at random $i_k \in [1, N]$, then $s_k^{\text{neg}} = \text{size}(\boldsymbol{x}_k^{\text{neg}})$ in $[1, \text{size}(\boldsymbol{y}_k)]$ and finally
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(\boldsymbol{x}_k^{\text{neg}})$ among subseries of $\boldsymbol{y}_k$ of length $s_k^{\text{neg}}$, for $k \in [1, K]$.

We highlight that this time-based triplet loss leverages the ability of the chosen encoder to take as input time series of different lengths. By training the encoder on a range of input lengths going from one to the length of the longest time series in the train set, it becomes able to output meaningful and transferable representations regardless of the input length, as shown in Section 5.

This training procedure is interesting in that it is efficient enough to be run over long time series (see Section 5) with a scalable encoder (see Section 4), thanks to its decoder-less design and the separability of the loss, on which a backpropagation per term can be performed to save memory.<fnref n="3" />

# 4 Encoder Architecture

We explain and present in this section our choice of architecture for the encoder, which is motivated by three requirements: it must extract relevant information from time series; it needs to be time- and memory-efficient, both for training and testing; and it has to allow variable-length inputs. We choose to use deep neural networks with *exponentially dilated causal convolutions* to handle time series. While they have been popularized in the context of sequence generation (Oord et al., 2016), they have never been used for unsupervised time series representation learning. They offer several advantages.

Compared to recurrent neural networks, which are inherently designed for sequence-modeling tasks and thus sequential, these networks are scalable as they allow efficient parallelization on modern hardware such as GPUs. Besides this demonstrated efficiency, exponentially dilated convolutions have also been introduced to better capture, compared to full convolutions, long-range dependencies at constant depth by exponentially increasing the receptive field of the network (Oord et al., 2016; Yu & Koltun, 2016; Bai et al., 2018).

Convolutional networks have also been demonstrated to be performant on various aspects for sequential data. For instance, recurrent networks are known to be subject to the issue of exploding and vanishing gradients, due to their recurrent nature (Goodfellow et al., 2016, Chapter 10.9). While significant work has been done to tackle this issue and improve their ability to capture long-term dependencies, such as the LSTM (Hochreiter & Schmidhuber, 1997), recurrent networks are still outperformed by convolutional networks on this aspect (Bai et al., 2018). On the specific domains of time series classification, which is an essential part of our experimental evaluation, and forecasting, deep neural networks have recently been successfully used (Bai et al., 2018; Ismail Fawaz et al., 2019).

Our model is particularly based on stacks of dilated *causal* convolutions (see Figure 2a), which map a sequence to a sequence of the same length, such that the *i*-th element of the output sequence is computed using only values up until the *i*-th element of the input sequence, for all *i*. It is thus called *causal*, since the output value corresponding to a given time step is not computed using future input values. Causal convolutions allow alleviating the disadvantage of not using recurrent networks at testing time. Indeed, recurrent networks can be used in an online fashion, thus saving memory and computation time during testing. In our case, causal convolutions organize the computational graph so that, in order to update its output when an element is added at the end of the input time series, one only has to evaluate the highlighted graph shown in Figure 2a rather than the full graph.

Inspired by Bai et al. (2018), we build each layer of our network as a combination of causal convolutions, weight normalizations (Salimans & Kingma, 2016), leaky ReLUs and residual connections (see Figure 2b). Each of these layers is given an exponentially increasing dilation parameter ($2^i$ for the

<footnote n="3">³ We used this optimization for multivariate or long (with length higher than 10 000) time series.</footnote>
<figure><img src="image_3.png" /><figcaption>Figure 2: (a) Illustration of three stacked dilated causal convolutions. Lines between each sequence represent their computational graph. Red solid lines highlight the dependency graph for the computation of the last value of the output sequence, showing that no future value of the input time series is used to compute it. (b) Composition of the *i*-th layer of the chosen architecture.</figcaption></figure>

*i*-th layer). The output of this causal network is then given to a global max pooling layer squeezing the temporal dimension and aggregating all temporal information in a fixed-size vector (as proposed by Wang et al. (2017) in a supervised setting with full convolutions). A linear transformation of this vector is then the output of the encoder, with a fixed, independent from the input length, size.

# 5 Experimental Results

We review in this section experiments conducted to investigate the relevance of the learned representations. The code corresponding to these experiments is attached in the supplementary material and is publicly available.<fnref n="4" /> The full training process and hyperparameter choices are detailed in the supplementary material, Sections S1 and S2. We used Python 3 for implementation, with PyTorch 0.4.1 (Paszke et al., 2017) for neural networks and scikit-learn (Pedregosa et al., 2011) for SVMs. Each encoder was trained using the Adam optimizer (Kingma & Ba, 2015) on a single Nvidia Titan Xp GPU with CUDA 9.0, unless stated otherwise.

Selecting hyperparameters for an unsupervised method is challenging since the plurality of downstream tasks is usually supervised. Therefore, as Wu et al. (2018a), we choose for each considered dataset archive a single set of hyperparameters regardless of the downstream task. Moreover, we highlight that we perform *no hyperparameter optimization* of the unsupervised encoder architecture and training parameters for any task, unlike other unsupervised works such as TimeNet (Malhotra et al., 2017). Particularly, for classification tasks, *no label* was used during the encoder training.

## 5.1 Classification

We first assess the *quality* of our learned representations on supervised tasks in a standard manner (Xu et al., 2003; Dosovitskiy et al., 2014) by using them for time series classification. In this setting, we show that (1) our method outperforms state-of-the-art unsupervised methods, and notably achieves performance close to the supervised state of the art, (2) strongly outperforms supervised deep learning methods when data is only sparsely labeled, (3) produces transferable representations.

For each considered dataset with a train / test split, we unsupervisedly train an encoder using its train set. We then train an SVM with radial basis function kernel on top of the learned features using the train labels of the dataset, and output the corresponding classification score on the test set. As our

<footnote n="4">⁴https://github.com/White-Link/UnsupervisedScalableRepresentationLearningTimeSeries.</footnote>
<figure><img src="image_4.png" /><figcaption>Figure 3: Boxplot of the ratio of the accuracy versus maximum achieved accuracy (higher is better) for compared methods on the first 85 UCR datasets.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Figure 4: Accuracy of ResNet and our method with respect to the ratio of labeled data on TwoPatterns. Error bars correspond to the standard deviation over five runs per point for each method.</figcaption></figure>

training procedure encourages representations of different time series to be separable, observing the classification performance of a simple SVM on these features allows to check their quality (Wu et al., 2018a). Using SVMs also allows, when the encoder is trained, an *efficient* training both in terms of time (training is a matter of minutes in most cases) and space.

As *K* has a significant impact on the performance, we present a *combined* version of our method, where representations computed by encoders trained with different values of *K* (see Section S2 for more details) are concatenated. This enables our learned representations with different parameters to complement each other, and to remove some noise in the classification scores.

### 5.1.1 Univariate Time Series

We present accuracy scores for all 128 datasets of the new iteration of the UCR archive (Dau et al., 2018), which is a standard set of varied univariate datasets. We report in Table 1 scores for only some UCR datasets, while scores for all datasets are reported in the supplementary material, Section S3.

We first compare our scores to the two concurrent methods of this work, TimeNet (Malhotra et al., 2017) and RWS (Wu et al., 2018a), which are two unsupervised methods also training a simple classifier on top of the learned representations, and reporting their results on a few UCR datasets. We also compare on the first 85 datasets of the archive<fnref n="5" /> to the four best classifiers of the supervised state of the art studied by Bagnall et al. (2017): COTE – replaced by its improved version HIVE-COTE (Lines et al., 2018) –, ST (Bostrom & Bagnall, 2015), BOSS (Schäfer, 2015) and EE (Lines & Bagnall, 2015). HIVE-COTE is a powerful ensemble method using many classifiers in a hierarchical voting structure; EE is a simpler ensemble method; ST is based on shapelets and BOSS is a dictionary-based classifier.⁶ We also add DTW (one-nearest-neighbor classifier with DTW as measure) as a baseline. HIVE-COTE includes ST, BOSS, EE and DTW in its ensemble, and is thus expected to outperform them. Additionally, we compare our method to the ResNet method of Wang et al. (2017), which is the best supervised neural network method studied in the review of Ismail Fawaz et al. (2019).

**Performance.** Comparison with the unsupervised state of the art (Section S3, Table S3 of the supplementary material), indicates that our method *consistently matches or outperforms both unsupervised methods* TimeNet and RWS (on 11 out of 12 and 10 out of 11 UCR datasets), showing its

<footnote n="5">⁵The new UCR archive includes 43 new datasets on which no reproducible results of state-of-the-art methods have been produced yet. Still, we provide complete results for our method on these datasets in the supplementary material, Section S3, Table S4, along with those of DTW, the only other method for which they were available.

⁶While ST and BOSS are also ensembles of classifiers, we chose not to qualify both of them as ensembles since their ensemble only includes variations of the same novel classification method.</footnote>
<table><caption>Table 1: Accuracy scores of variants of our method compared with other supervised and unsupervised methods, on some UCR datasets. Results for the whole archive are available in the supplementary material, Section S3, Tables S1, S2 and S4. Bold and underlined scores respectively indicate the best and second-best (when there is no tie for first place) performing methods.</caption><thead><tr><th rowspan="3">Dataset</th><th colspan="4">Unsupervised</th><th colspan="4">Supervised</th></tr><tr><th colspan="4">Ours</th><th rowspan="2">DTW</th><th rowspan="2">ST</th><th rowspan="2">BOSS</th><th colspan="2">Ensemble</th></tr><tr><th>K = 5</th><th>K = 10</th><th>Combined</th><th>FordA</th><th>HIVE-COTE</th><th>EE</th></tr></thead><tbody><tr><td>DiatomSizeReduction</td><td><strong>0.993</strong></td><td>0.984</td><td><strong>0.993</strong></td><td>0.974</td><td>0.967</td><td>0.925</td><td>0.931</td><td>0.941</td><td>0.944</td></tr><tr><td>ECGFiveDays</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.984</td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.82</td></tr><tr><td>FordB</td><td>0.781</td><td>0.793</td><td><u>0.81</u></td><td>0.798</td><td>0.62</td><td>0.807</td><td>0.711</td><td><strong>0.823</strong></td><td>0.662</td></tr><tr><td>Ham</td><td>0.657</td><td><strong>0.724</strong></td><td><u>0.695</u></td><td>0.533</td><td>0.467</td><td>0.686</td><td>0.667</td><td>0.667</td><td>0.571</td></tr><tr><td>Phoneme</td><td>0.249</td><td>0.276</td><td>0.289</td><td>0.196</td><td>0.228</td><td><u>0.321</u></td><td>0.265</td><td><strong>0.382</strong></td><td>0.305</td></tr><tr><td>SwedishLeaf</td><td>0.925</td><td>0.914</td><td><u>0.931</u></td><td>0.925</td><td>0.792</td><td>0.928</td><td>0.922</td><td><strong>0.954</strong></td><td>0.915</td></tr></tbody></table>

performance. Unlike our work, code and full results on the UCR archive are not provided for these methods, hence the incomplete results.

When comparing to the supervised non-neural-network state of the art, we observe (see Figures S2 and S3 in the supplementary material) that our method is globally the second-best one (with average rank 2.92), only beaten by HIVE-COTE (1.71) and equivalent to ST (2.95). Thus, our unsupervised method beats several recognized supervised classifier, and is only preceded by a powerful ensemble method, which was expected since the latter takes advantage of numerous classifiers and data representations. Additionally, Figure 3 shows that our method has the second-best median for the ratio of accuracy over maximum achieved accuracy, behind HIVE-COTE and above ST. Finally, results reported from the study of Ismail Fawaz et al. (2019) for the fully supervised ResNet (Section S3, Table S3 of the supplementary material) show that it expectedly outperforms our method on 63% out of 71 UCR datasets.<fnref n="7" /> Overall, our method achieves remarkable performance as it is close to the best supervised neural network, matches the second-best studied non-neural-network supervised method, and, in particular, is at the level of the best performing method included in HIVE-COTE.<fnref n="8" />

**Sparse labeling.** Taking advantage of their unsupervised training, we show that our representations can be successfully used on sparsely labeled datasets compared to supervised methods, since only the SVM is restricted to be learned on the small portion of labeled data. Figure 4 shows that an SVM trained on our representations of a randomly chosen labeled set consistently outperforms the supervised neural network ResNet trained on a labeled set of the same size, especially when the percentage of labeled data is small. For example, with only 1.5% of labeled data, we achieve an accuracy of 81%, against only 26% for ResNet, equivalent to a random classifier. Moreover, we exceed 99% of accuracy starting from 11% of labeled data, while ResNet only achieves this level of accuracy with more than 50% of labeled data. This shows the relevance of our method in semi-supervised settings, compared to fully supervised methods.

**Representations metric space.** Besides being suitable for classification purposes, the learned representations may also be used to define a meaningful measure between time series. Indeed, we train, instead of an SVM, a one-nearest-neighbor classifier with respect to the $l_2$ distance on the same representations, and compare it to DTW, which uses the same classifier on the raw time series. As shown in S3, this version of our method outperforms DTW on 66% of the UCR datasets, showing the advantage of the learned representations even in a non-parametric classification setting. We also include quantitative experiments to assess the usefulness of comparing time series using the $l_2$ distance between their representations with dimensionality reduction (Figure 5) and clustering (Section 5.2 and Figure 6) visualizations.

**Transferability.** We include in the comparisons the classification accuracy for each dataset of an SVM trained on this dataset using the representations computed by an encoder, which was trained on another dataset (FordA, with $K = 5$), to test the transferability of our representations. We observe

<footnote n="7">⁷Those results are incomplete as Ismail Fawaz et al. (2019) performed their experiments on the old version of the archive, whereas ours are performed on its most recent release where some datasets were changed.</footnote>

<footnote n="8">⁸Our method could be included in HIVE-COTE, which could improve its performance, but this is beyond the scope of this work and requires technical work, as HIVE-COTE is implemented in Java and ours in Python.</footnote>
<figure><img src="image_6.png" /><figcaption>Figure 5: Two-dimensional t-SNE (Maaten & Hinton, 2008) with perplexity 30 of the learned representations of three UCR test sets. Elements classes are distinguishable using their respective marker shapes and colors.</figcaption></figure>

that the scores achieved by this SVM trained on transferred representations are close to the scores reported when the encoder is trained on the same dataset as the SVM, showing the *transferability* of our representations from a dataset to another, and from time series to other time series *with different lengths*. More generally, this transferability and the performance of simple classifiers on the representations we learn indicate that they are *universal* and *easy to make use of*.

### 5.1.2 Multivariate Time Series

To complement our evaluation on the UCR archive which exclusively contains univariate series, we evaluate our method on multivariate time series. This can be done by simply changing the number of input filters of the first convolutional layer of the proposed encoder. We test our method on all 30 datasets of the newly released UEA archive (Bagnall et al., 2018). Full accuracy scores are presented in the supplementary material, Section S4, Table S5.

The UEA archive has been designed as a first attempt to provide a standard archive for multivariate time series classification such as the UCR one for univariate series. As it has only been released recently, we could not compare our method to state-of-the-art classifiers for multivariate time series. However, we provide a comparison with DTW<sub>D</sub> as baseline using results provided by Bagnall et al. (2018). DTW<sub>D</sub> (dimension-Dependent DTW) is a possible extension of DTW in the multivariate setting, and is the best baseline studied by Bagnall et al. (2018). Overall, our method matches or outperforms DTW<sub>D</sub> on 69% of the UEA datasets, which indicates good performance. As this archive is destined to grow and evolve in the future, and without further comparisons, no additional conclusion can be drawn.

## 5.2 Evaluation on Long Time Series

We show the *applicability* and *scalability* of our method on *long* time series without labeling for regression tasks, which could correspond to an industrial application and complements the performed tests on the UCR and UEA archives, whose datasets mostly contain short time series.

The Individual Household Electric Power Consumption (IHEPC) dataset from the UCI Machine Learning Repository (Dheeru & Karra Taniskidou, 2017) is a single time series of length 2 075 259 monitoring the minute-averaged electricity consumption of one French household for four years. We split this time series into train (first 5 × 10⁵ measurements, approximately a year) and test (remaining measurements). The encoder is trained over the train time series on a single Nvidia Tesla P100 GPU in no more than a few hours, showing that our training procedure is *scalable* to long time series.

We consider the learned encoder on two regression tasks involving two different input scales. We compute, for each time step of the time series, the representations of the last window corresponding to a day (1 440 measurements) and a quarter (12 · 7 · 1 440 measurements) using the same encoder. An example of application of the day-long representations is shown in Figure 6. The considered tasks consist in, for each time step, predicting the discrepancy between the mean value of the series
<figure><img src="image_7.png" /><figcaption>Figure 6: Minute-averaged electricity consumption for a single day, with respect to the hour of the day. Vertical lines and colors divide the day into six clusters, obtained with *k*-means clustering based on representations computed on a day-long sliding window. The clustering divides the day in meaningful portions (night, morning, afternoon, evening).</figcaption></figure>

for the next period (either a day or quarter) and the one for the previous period. We compare linear regressors, trained using gradient descent, to minimize the mean squared error between the prediction and the target, applied either on the raw time series or the previously computed representations.

Results and execution times on an Nvidia Titan Xp GPU are presented in Table 2.<fnref n="9" /> On both scales of inputs, our representations induce only a slightly degraded performance but provide a large efficiency improvement, due to their small size compared to the raw time series. This shows that a single encoder trained to minimize our time-based loss is able to output representations for different scales of input lengths that are also helpful for other tasks than classification, corroborating their universality.

<table><caption>Table 2: Results obtained on the IHEPC dataset.</caption><thead><tr><th>Task</th><th>Metric</th><th>Representations</th><th>Raw values</th></tr></thead><tbody><tr><td>Day</td><td>Test MSE<br>Wall time</td><td>8.92 × 10<sup>-2</sup><br>12s</td><td>8.92 × 10<sup>-2</sup><br>3min 1s</td></tr><tr><td>Quarter</td><td>Test MSE<br>Wall time</td><td>7.26 × 10<sup>-2</sup><br>9s</td><td>6.26 × 10<sup>-2</sup><br>1h 40min 15s</td></tr></tbody></table>

# 6 Conclusion

We present an unsupervised representation learning method for time series that is scalable and produces high-quality and easy-to-use embeddings. They are generated by an encoder formed by dilated convolutions that admits variable-length inputs, and trained with an efficient triplet loss using novel time-based negative sampling for time series. Conducted experiments show that these representations are universal and can easily and efficiently be used for diverse tasks such as classification, for which we achieve state-of-the-art performance, and regression.

## Acknowledgements

We would like to acknowledge Patrick Gallinari, Sylvain Lamprier, Mehdi Lamrayah, Etienne Simon, Valentin Guiguet, Clara Gainon de Forsan de Gabriac, Eloi Zablocki, Antoine Saporta, Edouard Delasalles, Sidak Pal Singh, Andreas Hug, Jean-Baptiste Cordonnier, Andreas Loukas and François Fleuret for helpful comments and discussions. We thank as well our anonymous reviewers for their constructive suggestions, Liljefors et al. (2019) for their extensive and positive reproducibility report on our work, and all contributors to the datasets and archives we used for this project (Dau et al., 2018; Bagnall et al., 2018; Dheeru & Karra Taniskidou, 2017). We acknowledge financial support from the SFA-AM ETH Board initiative, the LOCUST ANR project (ANR-15-CE23-0027) and CLEAR (Center for LEArning and data Retrieval, joint laboratory with Thales<fnref n="10" />).

<footnote n="9">⁹While acting on representations of the same size, the quarterly linear regressor is slightly faster than the daily one because the number of quarters in the considered time series is smaller than the number of days.</footnote>

<footnote n="10">¹⁰https://www.thalesgroup.com.</footnote>
References

Arora, S., Khandeparkar, H., Khodak, M., Plevrakis, O., and Saunshi, N. A theoretical analysis of contrastive unsupervised representation learning. *arXiv preprint arXiv:1902.09229*, 2019.

Bagnall, A., Lines, J., Bostrom, A., Large, J., and Keogh, E. The great time series classification bake off: a review and experimental evaluation of recent algorithmic advances. *Data Mining and Knowledge Discovery*, 31(3):606–660, May 2017.

Bagnall, A., Dau, H. A., Lines, J., Flynn, M., Large, J., Bostrom, A., Southam, P., and Keogh, E. The UEA multivariate time series classification archive, 2018. *arXiv preprint arXiv:1811.00075*, 2018.

Bai, S., Kolter, J. Z., and Koltun, V. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. *arXiv preprint arXiv:1803.01271*, 2018.

Bostrom, A. and Bagnall, A. Binary shapelet transform for multiclass time series classification. In *Big Data Analytics and Knowledge Discovery*, pp. 257–269, Cham, 2015. Springer International Publishing.

Bredin, H. Tristounet: Triplet loss for speaker turn embedding. In *2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)*, pp. 5430–5434, March 2017.

Cui, Z., Chen, W., and Chen, Y. Multi-scale convolutional neural networks for time series classification. *arXiv preprint arXiv:1603.06995*, 2016.

Dau, H. A., Keogh, E., Kamgar, K., Yeh, C.-C. M., Zhu, Y., Gharghabi, S., Ratanamahatana, C. A., Yanping, Hu, B., Begum, N., Bagnall, A., Mueen, A., and Batista, G. The UCR time series classification archive, October 2018.

Demšar, J., Curk, T., Erjavec, A., Črt Gorup, Hočevar, T., Milutinovič, M., Možina, M., Polajnar, M., Toplak, M., Starič, A., Štajdohar, M., Umek, L., Žagar, L., Žbontar, J., Žitnik, M., and Zupan, B. Orange: Data mining toolbox in Python. *Journal of Machine Learning Research*, 14:2349–2353, 2013.

Denton, E. L. and Birodkar, V. Unsupervised learning of disentangled representations from video. In *Advances in Neural Information Processing Systems 30*, pp. 4414–4423. Curran Associates, Inc., 2017.

Dheeru, D. and Karra Taniskidou, E. UCI machine learning repository, 2017.

Dosovitskiy, A., Springenberg, J. T., Riedmiller, M., and Brox, T. Discriminative unsupervised feature learning with convolutional neural networks. In *Advances in Neural Information Processing Systems 27*, pp. 766–774. Curran Associates, Inc., 2014.

Fortuin, V., Hüser, M., Locatello, F., Strathmann, H., and Rätsch, G. SOM-VAE: Interpretable discrete representation learning on time series. In *International Conference on Learning Representations*, 2019.

Goldberg, Y. and Levy, O. word2vec explained: deriving Mikolov et al.'s negative-sampling word-embedding method. *arXiv preprint arXiv:1402.3722*, 2014.

Goodfellow, I., Bengio, Y., and Courville, A. *Deep Learning*. MIT Press, 2016. http://www.deeplearningbook.org.

Hochreiter, S. and Schmidhuber, J. Long short-term memory. *Neural computation*, 9(8):1735–1780, 1997.

Hyvarinen, A. and Morioka, H. Unsupervised feature extraction by time-contrastive learning and nonlinear ICA. In *Advances in Neural Information Processing Systems 29*, pp. 3765–3773. Curran Associates, Inc., 2016.

Ismail Fawaz, H., Forestier, G., Weber, J., Idoumghar, L., and Muller, P.-A. Deep learning for time series classification: a review. *Data Mining and Knowledge Discovery*, March 2019.
Jansen, A., Plakal, M., Pandya, R., Ellis, D. P. W., Hershey, S., Liu, J., Moore, R. C., and Saurous, R. A. Unsupervised learning of semantic audio representations. In *2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)*, pp. 126–130, April 2018.

Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In *International Conference on Learning Representations*, 2015.

Lei, Q., Yi, J., Vaculin, R., Wu, L., and Dhillon, I. S. Similarity preserving representation learning for time series analysis. *arXiv preprint arXiv:1702.03584*, 2017.

Liljefors, F., Sorkhei, M. M., and Broome, S. [Re] Unsupervised scalable representation learning for multivariate time series. 2019. URL https://openreview.net/forum?id=HyxQr65z6S.

Lines, J. and Bagnall, A. Time series classification with ensembles of elastic distance measures. *Data Mining and Knowledge Discovery*, 29(3):565–592, May 2015.

Lines, J., Taylor, S., and Bagnall, A. Time series classification with HIVE-COTE: The hierarchical vote collective of transformation-based ensembles. *ACM Transactions on Knowledge Discovery from Data*, 12(5):52:1–52:35, July 2018.

Logeswaran, L. and Lee, H. An efficient framework for learning sentence representations. In *International Conference on Learning Representations*, 2018.

Lu, R., Wu, K., Duan, Z., and Zhang, C. Deep ranking: Triplet MatchNet for music metric learning. In *2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)*, pp. 121–125, March 2017.

Maaten, L. v. d. and Hinton, G. Visualizing data using t-SNE. *Journal of Machine Learning Research*, 9:2579–2605, November 2008.

Malhotra, P., TV, V., Vig, L., Agarwal, P., and Shroff, G. TimeNet: Pre-trained deep recurrent neural network for time series classification. *arXiv preprint arXiv:1706.08838*, 2017.

Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., and Dean, J. Distributed representations of words and phrases and their compositionality. In *Advances in Neural Information Processing Systems 26*, pp. 3111–3119. Curran Associates, Inc., 2013.

Oord, A. v. d., Dieleman, S., Zen, H., Simonyan, K., Vinyals, O., Graves, A., Kalchbrenner, N., Senior, A., and Kavukcuoglu, K. WaveNet: A generative model for raw audio. *arXiv preprint arXiv:1609.03499*, 2016.

Oord, A. v. d., Li, Y., and Vinyals, O. Representation learning with contrastive predictive coding. *arXiv preprint arXiv:1807.03748*, 2018.

Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., and Lerer, A. Automatic differentiation in PyTorch. 2017.

Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E. Scikit-learn: Machine learning in Python. *Journal of Machine Learning Research*, 12:2825–2830, October 2011.

Salimans, T. and Kingma, D. P. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In *Advances in Neural Information Processing Systems 29*, pp. 901–909. Curran Associates, Inc., 2016.

Schäfer, P. The BOSS is concerned with time series classification in the presence of noise. *Data Mining and Knowledge Discovery*, 29(6):1505–1530, November 2015.

Schroff, F., Kalenichenko, D., and Philbin, J. Facenet: A unified embedding for face recognition and clustering. In *2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR)*, pp. 815–823, June 2015.
Srivastava, N., Mansimov, E., and Salakhudinov, R. Unsupervised learning of video representations using LSTMs. In *Proceedings of the 32nd International Conference on Machine Learning*, volume 37 of *Proceedings of Machine Learning Research*, pp. 843–852, Lille, France, July 2015. PMLR.

Turpault, N., Serizel, R., and Vincent, E. Semi-supervised triplet loss based learning of ambient audio embeddings. In *2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)*, pp. 760–764, May 2019.

Villegas, R., Yang, J., Hong, S., Lin, X., and Lee, H. Decomposing motion and content for natural video sequence prediction. *International Conference on Learning Representations*, 2017.

Wang, Z., Yan, W., and Oates, T. Time series classification from scratch with deep neural networks: A strong baseline. In *2017 International Joint Conference on Neural Networks (IJCNN)*, pp. 1578–1585, May 2017.

Wu, L., Yen, I. E.-H., Yi, J., Xu, F., Lei, Q., and Witbrock, M. Random Warping Series: A random features method for time-series embedding. In *Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics*, volume 84 of *Proceedings of Machine Learning Research*, pp. 793–802. PMLR, April 2018a.

Wu, L. Y., Fisch, A., Chopra, S., Adams, K., Bordes, A., and Weston, J. Starspace: Embed all the things! In *Thirty-Second AAAI Conference on Artificial Intelligence*, 2018b.

Xu, W., Liu, X., and Gong, Y. Document clustering based on non-negative matrix factorization. In *Proceedings of the 26th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval*, SIGIR '03, pp. 267–273, New York, NY, USA, 2003. ACM.

Young, T., Hazarika, D., Poria, S., and Cambria, E. Recent trends in deep learning based natural language processing. *IEEE Computational Intelligence Magazine*, 13(3):55–75, August 2018.

Yu, F. and Koltun, V. Multi-scale context aggregation by dilated convolutions. In *International Conference on Learning Representations*, 2016.
# Appendices

In these appendices, we provide our detailed training procedure for classification tasks, choices of hyperparameters, as well as the full experimental results of our method, compared to those of concurrent methods. Section S1 explains and discusses the exact training process for classification tasks. Section S2 details the choices of hyperparameters in all presented experiments. Section S3 reports accuracy scores of all variants of our method on the whole UCR archive (Dau et al., 2018), as well as comparisons with concurrent methods, when available. Section S4 provides accuracy scores for our method on the whole UEA archive (Bagnall et al., 2018). Finally, Section S5 discusses the importance of the choice of encoder by providing results obtained with our training procedure using an LSTM as encoder.

## S1 Training Details

### S1.1 Input Preprocessing

We preprocess datasets of the UCR archive that were not already normalized, as well as the IHEPC dataset, so that the set of time series values for each dataset has zero mean and unit variance. For each UEA dataset, each dimension of the time series was preprocessed independently from the other dimensions by normalizing in the same way its mean and variance.

### S1.2 SVM Training

In order to train an SVM on the computed representations of the elements of the train set, we perform a hyperparameter optimization for the penalty $C$ of the error term of the SVM by cross-validating it over the representations of the train set, thus only using the train labels. Note that if the train set or the number of training samples per class are too small, we choose a penalty $C = \infty$ for the SVM (which corresponds to no regularization).

### S1.3 Behavior of the Learned Representations through Training

**Classification accuracy evolution during training.** As shown in Figure S1, our unsupervised training clearly makes the classification accuracy of the trained SVM increase with the number of optimization steps.

**Numerical stability.** The Risk $R$ is defined as the expectation (taken over the random selection of the sequences $(x^{\text{ref}}, x^{\text{pos}}, x^{\text{neg}})$) of the loss defined in Equation (1). This risk may decrease if all the representations $f(\cdot, \theta)$ are scaled by a positive large number. For example, if for some $\theta_0$, for (almost surely) any sequences $(x^{\text{ref}}, x^{\text{pos}}, x^{\text{neg}})$, $f(x^{\text{ref}}, \theta_0)^{\top} f(x^{\text{pos}}, \theta_0) \ge 0$ and $f(x^{\text{ref}}, \theta_0)^{\top} f(x^{\text{neg}}, \theta_0) \le 0$, then

$$R(\lambda, \theta_0) := \mathbb{E}_{x^{\text{ref}}, x^{\text{pos}}, x^{\text{neg}}} \left[ -\log \left( \sigma \left( \lambda^2 f(x^{\text{ref}}, \theta_0)^{\top} f(x^{\text{pos}}, \theta_0) \right) \right) \right. \\ \left. - \log \left( \sigma \left( -\lambda^2 f(x^{\text{ref}}, \theta_0)^{\top} f(x^{\text{neg}}, \theta_0) \right) \right) \right] \quad (2)$$

is a decreasing function of $\lambda$, thus $\lambda$ could diverge to infinity in order to minimize the loss. In other words, the parameters in $\theta_0$ corresponding to the last linear layer could be linearly scaled up, and representations would “ explode” (their norm would always increase through training). Such a phenomenon is not observed in practice, as the mean representation Euclidean norm lies around 20. There are two possible explanations for that: either the condition above is not satisfied (more generally, the loss is not reduced by increasing the representations) or the use of the sigmoid function, that has vanishing gradients, results in an increase of the representations that is too slow to be observed, or negligible with respect to other weight updates during optimization.
<figure><img src="image_8.png" /><figcaption>Figure S1: Evolution of the test accuracy during the training of the encoder on the CricketX dataset from the UCR archive (with *K* = 10), with respect to the number of completed epochs. The test labels were only used for monitoring purposes and the test accuracy was computed after each mini-batch optimization. The vertical line marks the epoch at which 2000 optimization steps were performed, at which point training is stopped in our tests. Test accuracy clearly increases during training.</figcaption></figure>

# S2 Hyperparameters

## S2.1 Influence of *K*

As mentioned in Section 5, *K* can have a significant impact on the performance of the encoder. We notably observed that *K* = 1 leads to statistically significantly lower scores compared to scores obtained when trained with *K* > 1 on the UCR datasets, justifying the use of several negative examples during training. We did not observe any clear statistical difference between other values of *K* on the whole archive; however, we noticed important differences between different values of *K* when studying individual datasets. Therefore, we chose to combine several encoders trained with different values of *K* in order to avoid selecting it as a fixed hyperparameter.

## S2.2 Detailed Choices of Hyperparameters

We train our models with the following parameters for time series classification. Note that *no hyperparameter optimization* was performed on the encoder hyperparameters.

* Optimizer: Adam (Kingma & Ba, 2015) with learning rate $\alpha$ = 0.001 and decay rates $\beta$ = (0.9, 0.999).

* SVM: penalty $C \in \{10^i \mid i \in [-4, 4]\} \cup \{\infty\}$.

* Encoder training:

- number of negative samples: $K \in \{1, 2, 5, 10\}$ for univariate time series, $K \in \{5, 10, 20\}$ for multivariate ones;

- batch size: 10;

- number of optimizations steps: 2000 for $K \ge 10$ (i.e., 20 epochs for a dataset of size 1000), 1500 otherwise.

* Architecture:

- number of channels in the intermediary layers of the causal network: 40;

- number of layers (depth of the causal network): 10;

- kernel size of all convolutions: 3;

- negative slope of the leaky ReLU activation: 0.01;

- number of output channels of the causal network (before max pooling): 320;

- dimension of the representations: 160.
<figure><img src="image_9.png" /><figcaption>Figure S2: Critical difference diagram of the average ranks of the compared classifiers for the Nemenyi test, obtained with Orange (Demšar et al., 2013).</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Figure S3: Distribution of ranks of compared methods for the first 85 UCR datasets.</figcaption></figure>

For the Individual Household Electric Power Consumption dataset, changes are the following:

* number of negative samples: $K = 10$;

* batch size: 1;

* number of optimization steps: 400;

* number of channels in the intermediary layers of the causal network: 30;

* number of output channels of the causal network (before max pooling): 160;

* dimension of the representations: 80.

## S3 Univariate Time Series

Full results corresponding to the first 85 UCR datasets for our method are presented in Table S1, while comparisons with DTW, ST, BOSS, HIVE-COTE and EE are shown in Figures S2 and S3 and Table S2,<fnref n="51" /> and comparisons with ResNet,<fnref n="52" /> TimeNet and RWS are shown in Table S3. Table S4 compiles the results of our method and of DTW<fnref n="53" /> for the newest 43 UCR datasets (except DodgerLoopDay, DodgerLoopGame and DodgerLoopWeekend which contain missing values).

<footnote n="51">⁵¹Scores taken from http://www.timeseriesclassification.com/singleTrainTest.csv.</footnote>

<footnote n="52">⁵²Scores taken from https://github.com/hfawaz/dl-4-tsc/blob/master/results/results-uea.csv (first iteration).</footnote>

<footnote n="53">⁵³Scores taken from https://www.cs.ucr.edu/~eamonn/time_series_data_2018/.</footnote>
**Standard deviation.** All UCR datasets are provided with a unique train / test split that we used in our experiments. Compared techniques (DTW, ST, BOSS, HIVE-COTE and EE) were also tested on 100 random train / test splits of these datasets by Bagnall et al. (2017) to produce a strong state-of-the-art evaluation, but we did not perform similar resamples as this is beyond the scope of this work and would require much more computations. Note that the scores for these methods used in this article are the ones corresponding to the original train / test split of the datasets.

As our method is based on random sampling, the reported scores may vary depending on the random seed. While we do not report standard deviation, the large number of tested datasets prevents large statistical error in the global evaluation of our method. The order of magnitude of accuracy variation between different runs of the combined version of our method is below 0.01 (for instance, on four different runs, the corresponding standard variations for, respectively, datasets DiatomSizeReduction, CricketX and UWaveGestureLibraryX are 0.0056, 0.0091 and 0.0053).
<table><caption>Table S1: Accuracy scores of variants of our method on the first 85 UCR datasets. “Combined (1-NN)” corresponds to learning a one-nearest-neighbor classifier, instead of an SVM, on the combined representations. Bold scores indicate the best performing method.</caption><thead><tr><th rowspan="3">Dataset</th><th colspan="8">Unsupervised</th></tr><tr><th colspan="7">Ours</th><th rowspan="2">FordA</th></tr><tr><th>K = 1</th><th>K = 2</th><th>K = 5</th><th>K = 10</th><th>Combined</th><th>Combined (1-NN)</th></tr></thead><tbody><tr><td>Adiac</td><td>0.734</td><td>0.711</td><td>0.703</td><td>0.675</td><td>0.716</td><td>0.645</td><td><strong>0.76</strong></td></tr><tr><td>ArrowHead</td><td><strong>0.869</strong></td><td>0.829</td><td>0.754</td><td>0.766</td><td>0.829</td><td>0.817</td><td>0.817</td></tr><tr><td>Beef</td><td><strong>0.733</strong></td><td>0.567</td><td>0.7</td><td>0.667</td><td>0.7</td><td>0.6</td><td>0.667</td></tr><tr><td>BeetleFly</td><td><strong>0.9</strong></td><td>0.8</td><td><strong>0.9</strong></td><td>0.8</td><td><strong>0.9</strong></td><td>0.8</td><td>0.8</td></tr><tr><td>BirdChicken</td><td>0.7</td><td>0.8</td><td><strong>0.9</strong></td><td>0.85</td><td>0.8</td><td>0.75</td><td><strong>0.9</strong></td></tr><tr><td>Car</td><td>0.75</td><td>0.767</td><td>0.633</td><td>0.833</td><td>0.817</td><td>0.8</td><td><strong>0.85</strong></td></tr><tr><td>CBF</td><td>0.982</td><td>0.991</td><td>0.99</td><td>0.983</td><td><strong>0.994</strong></td><td>0.978</td><td>0.988</td></tr><tr><td>ChlorineConcentration</td><td>0.719</td><td>0.747</td><td>0.739</td><td>0.749</td><td><strong>0.782</strong></td><td>0.588</td><td>0.688</td></tr><tr><td>CinCECGTorso</td><td>0.702</td><td><strong>0.747</strong></td><td>0.682</td><td>0.713</td><td>0.74</td><td>0.693</td><td>0.638</td></tr><tr><td>Coffee</td><td>0.964</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td></tr><tr><td>Computers</td><td><strong>0.688</strong></td><td>0.644</td><td>0.676</td><td>0.664</td><td>0.628</td><td>0.604</td><td>0.648</td></tr><tr><td>CricketX</td><td>0.736</td><td>0.71</td><td>0.7</td><td>0.713</td><td><strong>0.777</strong></td><td>0.741</td><td>0.682</td></tr><tr><td>CricketY</td><td>0.682</td><td>0.664</td><td>0.695</td><td>0.728</td><td><strong>0.767</strong></td><td>0.664</td><td>0.667</td></tr><tr><td>CricketZ</td><td>0.721</td><td>0.71</td><td>0.726</td><td>0.708</td><td><strong>0.764</strong></td><td>0.723</td><td>0.656</td></tr><tr><td>DiatomSizeReduction</td><td>0.99</td><td>0.987</td><td><strong>0.993</strong></td><td>0.984</td><td><strong>0.993</strong></td><td>0.967</td><td>0.974</td></tr><tr><td>DistalPhalanxOutlineCorrect</td><td>0.761</td><td>0.746</td><td><strong>0.775</strong></td><td><strong>0.775</strong></td><td>0.768</td><td>0.757</td><td>0.764</td></tr><tr><td>DistalPhalanxOutlineAgeGroup</td><td>0.719</td><td><strong>0.748</strong></td><td>0.719</td><td>0.727</td><td>0.734</td><td>0.683</td><td>0.727</td></tr><tr><td>DistalPhalanxTW</td><td><strong>0.698</strong></td><td>0.676</td><td>0.662</td><td>0.676</td><td>0.676</td><td>0.669</td><td>0.669</td></tr><tr><td>Earthquakes</td><td><strong>0.748</strong></td><td><strong>0.748</strong></td><td><strong>0.748</strong></td><td><strong>0.748</strong></td><td><strong>0.748</strong></td><td>0.64</td><td><strong>0.748</strong></td></tr><tr><td>ECG200</td><td>0.87</td><td>0.9</td><td>0.86</td><td><strong>0.94</strong></td><td>0.9</td><td>0.85</td><td>0.83</td></tr><tr><td>ECG5000</td><td>0.939</td><td>0.939</td><td>0.937</td><td>0.933</td><td>0.936</td><td>0.925</td><td><strong>0.94</strong></td></tr><tr><td>ECGFiveDays</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.999</td><td><strong>1</strong></td></tr><tr><td>ElectricDevices</td><td>0.709</td><td>0.7</td><td>0.712</td><td>0.707</td><td><strong>0.732</strong></td><td>0.646</td><td>0.676</td></tr><tr><td>FaceAll</td><td>0.764</td><td><strong>0.81</strong></td><td>0.733</td><td>0.786</td><td>0.802</td><td>0.75</td><td>0.734</td></tr><tr><td>FaceFour</td><td>0.807</td><td>0.864</td><td>0.795</td><td><strong>0.92</strong></td><td>0.875</td><td>0.864</td><td>0.83</td></tr><tr><td>FacesUCR</td><td>0.885</td><td>0.871</td><td>0.886</td><td>0.884</td><td><strong>0.918</strong></td><td>0.86</td><td>0.835</td></tr><tr><td>FiftyWords</td><td>0.763</td><td>0.734</td><td>0.727</td><td>0.732</td><td><strong>0.78</strong></td><td>0.716</td><td>0.745</td></tr><tr><td>Fish</td><td>0.903</td><td>0.909</td><td>0.891</td><td>0.891</td><td>0.88</td><td>0.823</td><td><strong>0.96</strong></td></tr><tr><td>FordA</td><td>0.923</td><td>0.922</td><td>0.927</td><td>0.928</td><td><strong>0.935</strong></td><td>0.863</td><td>0.927</td></tr><tr><td>FordB</td><td>0.786</td><td>0.788</td><td>0.781</td><td>0.793</td><td><strong>0.81</strong></td><td>0.748</td><td>0.798</td></tr><tr><td>GunPoint</td><td>0.953</td><td>0.987</td><td>0.987</td><td>0.98</td><td><strong>0.993</strong></td><td>0.833</td><td>0.987</td></tr><tr><td>Ham</td><td>0.648</td><td>0.686</td><td>0.657</td><td><strong>0.724</strong></td><td>0.695</td><td>0.533</td><td>0.533</td></tr><tr><td>HandOutlines</td><td><strong>0.922</strong></td><td>0.919</td><td>0.908</td><td><strong>0.922</strong></td><td><strong>0.922</strong></td><td>0.832</td><td>0.919</td></tr><tr><td>Haptics</td><td>0.445</td><td>0.435</td><td>0.432</td><td><strong>0.49</strong></td><td>0.455</td><td>0.354</td><td>0.474</td></tr><tr><td>Herring</td><td><strong>0.609</strong></td><td>0.594</td><td>0.578</td><td>0.594</td><td>0.578</td><td>0.563</td><td>0.578</td></tr><tr><td>InlineSkate</td><td>0.425</td><td>0.429</td><td>0.42</td><td>0.371</td><td><strong>0.447</strong></td><td>0.4</td><td>0.444</td></tr><tr><td>InsectWingbeatSound</td><td>0.61</td><td>0.592</td><td>0.617</td><td>0.597</td><td><strong>0.623</strong></td><td>0.506</td><td>0.599</td></tr><tr><td>ItalyPowerDemand</td><td>0.94</td><td>0.927</td><td>0.928</td><td><strong>0.954</strong></td><td>0.925</td><td>0.942</td><td>0.929</td></tr><tr><td>LargeKitchenAppliances</td><td>0.797</td><td>0.827</td><td>0.843</td><td>0.789</td><td><strong>0.848</strong></td><td>0.757</td><td>0.765</td></tr><tr><td>Lightning2</td><td>0.869</td><td>0.836</td><td>0.852</td><td>0.869</td><td><strong>0.918</strong></td><td>0.885</td><td>0.787</td></tr><tr><td>Lightning7</td><td>0.795</td><td><strong>0.822</strong></td><td><strong>0.822</strong></td><td>0.795</td><td>0.795</td><td>0.795</td><td>0.74</td></tr><tr><td>Mallat</td><td>0.962</td><td>0.931</td><td>0.947</td><td>0.951</td><td><strong>0.964</strong></td><td>0.944</td><td>0.916</td></tr><tr><td>Meat</td><td>0.917</td><td>0.867</td><td>0.867</td><td><strong>0.95</strong></td><td><strong>0.95</strong></td><td>0.9</td><td>0.867</td></tr><tr><td>MedicalImages</td><td>0.738</td><td>0.768</td><td>0.77</td><td>0.75</td><td><strong>0.784</strong></td><td>0.693</td><td>0.725</td></tr><tr><td>MiddlePhalanxOutlineCorrect</td><td>0.749</td><td>0.818</td><td>0.777</td><td><strong>0.825</strong></td><td>0.814</td><td>0.722</td><td>0.787</td></tr><tr><td>MiddlePhalanxOutlineAgeGroup</td><td>0.617</td><td><strong>0.662</strong></td><td>0.656</td><td>0.656</td><td>0.656</td><td>0.506</td><td>0.623</td></tr><tr><td>MiddlePhalanxTW</td><td>0.604</td><td><strong>0.61</strong></td><td><strong>0.61</strong></td><td>0.591</td><td><strong>0.61</strong></td><td>0.513</td><td>0.584</td></tr><tr><td>MoteStrain</td><td><strong>0.875</strong></td><td>0.854</td><td>0.867</td><td>0.851</td><td>0.871</td><td>0.853</td><td>0.823</td></tr><tr><td>NonInvasiveFetalECGThorax1</td><td>0.912</td><td>0.911</td><td>0.904</td><td>0.878</td><td>0.91</td><td>0.798</td><td><strong>0.925</strong></td></tr><tr><td>NonInvasiveFetalECGThorax2</td><td>0.925</td><td>0.925</td><td>0.918</td><td>0.919</td><td>0.927</td><td>0.82</td><td><strong>0.93</strong></td></tr><tr><td>OliveOil</td><td>0.867</td><td>0.833</td><td>0.867</td><td>0.867</td><td><strong>0.9</strong></td><td>0.833</td><td><strong>0.9</strong></td></tr><tr><td>OSULeaf</td><td>0.719</td><td>0.694</td><td>0.793</td><td>0.76</td><td><strong>0.831</strong></td><td>0.636</td><td>0.736</td></tr><tr><td>PhalangesOutlinesCorrect</td><td><strong>0.807</strong></td><td>0.796</td><td>0.795</td><td>0.784</td><td>0.801</td><td>0.752</td><td>0.784</td></tr><tr><td>Phoneme</td><td>0.264</td><td>0.265</td><td>0.249</td><td>0.276</td><td><strong>0.289</strong></td><td>0.197</td><td>0.196</td></tr><tr><td>Plane</td><td>0.99</td><td><strong>1</strong></td><td>0.99</td><td>0.99</td><td>0.99</td><td><strong>1</strong></td><td>0.981</td></tr><tr><td>ProximalPhalanxOutlineCorrect</td><td><strong>0.869</strong></td><td>0.863</td><td>0.856</td><td>0.859</td><td>0.859</td><td>0.801</td><td><strong>0.869</strong></td></tr><tr><td>ProximalPhalanxOutlineAgeGroup</td><td>0.849</td><td><strong>0.859</strong></td><td>0.844</td><td>0.844</td><td>0.854</td><td>0.805</td><td>0.839</td></tr><tr><td>ProximalPhalanxTW</td><td><strong>0.824</strong></td><td>0.815</td><td>0.761</td><td>0.771</td><td><strong>0.824</strong></td><td>0.717</td><td>0.785</td></tr><tr><td>RefrigerationDevices</td><td>0.531</td><td>0.507</td><td>0.547</td><td>0.515</td><td>0.517</td><td>0.475</td><td><strong>0.555</strong></td></tr><tr><td>ScreenType</td><td>0.408</td><td>0.411</td><td><strong>0.427</strong></td><td>0.416</td><td>0.413</td><td>0.389</td><td>0.384</td></tr><tr><td>ShapeletSim</td><td><strong>0.894</strong></td><td>0.5</td><td>0.628</td><td>0.672</td><td>0.817</td><td>0.772</td><td>0.517</td></tr><tr><td>ShapesAll</td><td>0.847</td><td>0.84</td><td>0.857</td><td>0.848</td><td><strong>0.875</strong></td><td>0.823</td><td>0.837</td></tr><tr><td>SmallKitchenAppliances</td><td>0.68</td><td>0.667</td><td>0.715</td><td>0.677</td><td>0.715</td><td>0.619</td><td><strong>0.731</strong></td></tr><tr><td>SonyAIBORobotSurface1</td><td><strong>0.93</strong></td><td>0.89</td><td>0.85</td><td>0.902</td><td>0.897</td><td>0.825</td><td>0.84</td></tr><tr><td>SonyAIBORobotSurface2</td><td>0.885</td><td>0.933</td><td>0.928</td><td>0.889</td><td><strong>0.934</strong></td><td>0.885</td><td>0.832</td></tr><tr><td>StarLightCurves</td><td>0.96</td><td>0.966</td><td>0.958</td><td>0.964</td><td>0.965</td><td>0.893</td><td><strong>0.968</strong></td></tr><tr><td>Strawberry</td><td>0.951</td><td>0.946</td><td><strong>0.954</strong></td><td><strong>0.954</strong></td><td>0.946</td><td>0.903</td><td>0.946</td></tr><tr><td>SwedishLeaf</td><td>0.907</td><td>0.925</td><td>0.925</td><td>0.914</td><td><strong>0.931</strong></td><td>0.891</td><td>0.925</td></tr><tr><td>Symbols</td><td>0.937</td><td>0.931</td><td><strong>0.965</strong></td><td>0.963</td><td><strong>0.965</strong></td><td>0.933</td><td>0.945</td></tr><tr><td>SyntheticControl</td><td>0.98</td><td>0.983</td><td><strong>0.987</strong></td><td><strong>0.987</strong></td><td>0.983</td><td>0.977</td><td>0.977</td></tr></tbody></table>
<table><caption>Table S1: Accuracy scores of variants of our method on the first 85 UCR datasets. “Combined (1-NN)” corresponds to learning a one-nearest-neighbor classifier, instead of an SVM, on the combined representations. Bold scores indicate the best performing method.</caption><thead><tr><th rowspan="3">Dataset</th><th colspan="7">Unsupervised</th></tr><tr><th colspan="7">Ours</th></tr><tr><th>K = 1</th><th>K = 2</th><th>K = 5</th><th>K = 10</th><th>Combined</th><th>Combined (1-NN)</th><th>FordA</th></tr></thead><tbody><tr><td>ToeSegmentation1</td><td>0.868</td><td><strong>0.961</strong></td><td>0.93</td><td>0.939</td><td>0.952</td><td>0.851</td><td>0.899</td></tr><tr><td>ToeSegmentation2</td><td>0.869</td><td>0.892</td><td>0.838</td><td><strong>0.9</strong></td><td>0.885</td><td><strong>0.9</strong></td><td><strong>0.9</strong></td></tr><tr><td>Trace</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.99</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td></tr><tr><td>TwoLeadECG</td><td>0.996</td><td>0.991</td><td>0.996</td><td><strong>0.999</strong></td><td>0.997</td><td>0.988</td><td>0.993</td></tr><tr><td>TwoPatterns</td><td>0.998</td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.999</td><td><strong>1</strong></td><td>0.998</td><td>0.992</td></tr><tr><td>UWaveGestureLibraryX</td><td>0.795</td><td>0.791</td><td>0.806</td><td>0.785</td><td><strong>0.811</strong></td><td>0.762</td><td>0.784</td></tr><tr><td>UWaveGestureLibraryY</td><td>0.716</td><td>0.717</td><td>0.702</td><td>0.71</td><td><strong>0.735</strong></td><td>0.666</td><td>0.697</td></tr><tr><td>UWaveGestureLibraryZ</td><td>0.738</td><td>0.735</td><td>0.741</td><td>0.757</td><td><strong>0.759</strong></td><td>0.679</td><td>0.729</td></tr><tr><td>UWaveGestureLibraryAll</td><td>0.893</td><td>0.887</td><td>0.903</td><td>0.896</td><td><strong>0.941</strong></td><td>0.838</td><td>0.865</td></tr><tr><td>Wafer</td><td>0.991</td><td><strong>0.995</strong></td><td>0.993</td><td>0.992</td><td>0.993</td><td>0.987</td><td><strong>0.995</strong></td></tr><tr><td>Wine</td><td>0.704</td><td>0.815</td><td>0.852</td><td>0.815</td><td><strong>0.87</strong></td><td>0.5</td><td>0.685</td></tr><tr><td>WordSynonyms</td><td>0.63</td><td>0.646</td><td>0.676</td><td>0.691</td><td><strong>0.704</strong></td><td>0.633</td><td>0.641</td></tr><tr><td>Worms</td><td>0.662</td><td><strong>0.74</strong></td><td>0.688</td><td>0.727</td><td>0.714</td><td>0.597</td><td>0.688</td></tr><tr><td>WormsTwoClass</td><td>0.753</td><td>0.766</td><td>0.74</td><td>0.792</td><td><strong>0.818</strong></td><td>0.805</td><td>0.753</td></tr><tr><td>Yoga</td><td>0.824</td><td>0.854</td><td>0.831</td><td>0.837</td><td><strong>0.878</strong></td><td>0.837</td><td>0.828</td></tr></tbody></table>
<table><caption>Table S2: Accuracy scores of the combined version of our method compared with those of DTW (unsupervised), ST and BOSS (supervised) and HIVE-COTE and EE (supervised ensemble methods), on the first 85 UCR datasets (results on the full archive were not available for comparisons). Bold scores indicate the best performing method.</caption><thead><tr><th rowspan="3">Dataset</th><th colspan="2">Unsupervised</th><th colspan="4">Supervised</th></tr><tr><th>Ours</th><th>DTW</th><th rowspan="2">ST</th><th rowspan="2">BOSS</th><th colspan="2">Ensemble</th></tr><tr><th>Combined</th><th></th><th>HIVE-COTE</th><th>EE</th></tr></thead><tbody><tr><td>Adiac</td><td>0.716</td><td>0.604</td><td>0.783</td><td>0.765</td><td><strong>0.811</strong></td><td>0.665</td></tr><tr><td>ArrowHead</td><td>0.829</td><td>0.703</td><td>0.737</td><td>0.834</td><td><strong>0.863</strong></td><td>0.811</td></tr><tr><td>Beef</td><td>0.7</td><td>0.633</td><td>0.9</td><td>0.8</td><td><strong>0.933</strong></td><td>0.633</td></tr><tr><td>BeetleFly</td><td>0.9</td><td>0.7</td><td>0.9</td><td>0.9</td><td><strong>0.95</strong></td><td>0.75</td></tr><tr><td>BirdChicken</td><td>0.8</td><td>0.75</td><td>0.8</td><td><strong>0.95</strong></td><td>0.85</td><td>0.8</td></tr><tr><td>Car</td><td>0.817</td><td>0.733</td><td><strong>0.917</strong></td><td>0.833</td><td>0.867</td><td>0.833</td></tr><tr><td>CBF</td><td>0.994</td><td>0.997</td><td>0.974</td><td>0.998</td><td><strong>0.999</strong></td><td>0.998</td></tr><tr><td>ChlorineConcentration</td><td><strong>0.782</strong></td><td>0.648</td><td>0.7</td><td>0.661</td><td>0.712</td><td>0.656</td></tr><tr><td>CinCECGTorso</td><td>0.74</td><td>0.651</td><td>0.954</td><td>0.887</td><td><strong>0.996</strong></td><td>0.942</td></tr><tr><td>Coffee</td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.964</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td></tr><tr><td>Computers</td><td>0.628</td><td>0.7</td><td>0.736</td><td>0.756</td><td><strong>0.76</strong></td><td>0.708</td></tr><tr><td>CricketX</td><td>0.777</td><td>0.754</td><td>0.772</td><td>0.736</td><td><strong>0.823</strong></td><td>0.813</td></tr><tr><td>CricketY</td><td>0.767</td><td>0.744</td><td>0.779</td><td>0.754</td><td><strong>0.849</strong></td><td>0.805</td></tr><tr><td>CricketZ</td><td>0.764</td><td>0.754</td><td>0.787</td><td>0.746</td><td><strong>0.831</strong></td><td>0.782</td></tr><tr><td>DiatomSizeReduction</td><td><strong>0.993</strong></td><td>0.967</td><td>0.925</td><td>0.931</td><td>0.941</td><td>0.944</td></tr><tr><td>DistalPhalanxOutlineCorrect</td><td>0.768</td><td>0.717</td><td><strong>0.775</strong></td><td>0.728</td><td>0.772</td><td>0.728</td></tr><tr><td>DistalPhalanxOutlineAgeGroup</td><td>0.734</td><td><strong>0.77</strong></td><td><strong>0.77</strong></td><td>0.748</td><td>0.763</td><td>0.691</td></tr><tr><td>DistalPhalanxTW</td><td>0.676</td><td>0.59</td><td>0.662</td><td>0.676</td><td><strong>0.683</strong></td><td>0.647</td></tr><tr><td>Earthquakes</td><td><strong>0.748</strong></td><td>0.719</td><td>0.741</td><td><strong>0.748</strong></td><td><strong>0.748</strong></td><td>0.741</td></tr><tr><td>ECG200</td><td><strong>0.9</strong></td><td>0.77</td><td>0.83</td><td>0.87</td><td>0.85</td><td>0.88</td></tr><tr><td>ECG5000</td><td>0.936</td><td>0.924</td><td>0.944</td><td>0.941</td><td><strong>0.946</strong></td><td>0.939</td></tr><tr><td>ECGFiveDays</td><td><strong>1</strong></td><td>0.768</td><td>0.984</td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.82</td></tr><tr><td>ElectricDevices</td><td>0.732</td><td>0.602</td><td>0.747</td><td><strong>0.799</strong></td><td>0.77</td><td>0.663</td></tr><tr><td>FaceAll</td><td>0.802</td><td>0.808</td><td>0.779</td><td>0.782</td><td>0.803</td><td><strong>0.849</strong></td></tr><tr><td>FaceFour</td><td>0.875</td><td>0.83</td><td>0.852</td><td><strong>1</strong></td><td>0.955</td><td>0.909</td></tr><tr><td>FacesUCR</td><td>0.918</td><td>0.905</td><td>0.906</td><td>0.957</td><td><strong>0.963</strong></td><td>0.945</td></tr><tr><td>FiftyWords</td><td>0.78</td><td>0.69</td><td>0.705</td><td>0.705</td><td>0.809</td><td><strong>0.82</strong></td></tr><tr><td>Fish</td><td>0.88</td><td>0.823</td><td><strong>0.989</strong></td><td><strong>0.989</strong></td><td><strong>0.989</strong></td><td>0.966</td></tr><tr><td>FordA</td><td>0.935</td><td>0.555</td><td>0.971</td><td>0.93</td><td><strong>0.964</strong></td><td>0.738</td></tr><tr><td>FordB</td><td>0.81</td><td>0.62</td><td>0.807</td><td>0.711</td><td><strong>0.823</strong></td><td>0.662</td></tr><tr><td>GunPoint</td><td>0.993</td><td>0.907</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.993</td></tr><tr><td>Ham</td><td><strong>0.695</strong></td><td>0.467</td><td>0.686</td><td>0.667</td><td>0.667</td><td>0.571</td></tr><tr><td>HandOutlines</td><td>0.922</td><td>0.881</td><td><strong>0.932</strong></td><td>0.903</td><td><strong>0.932</strong></td><td>0.889</td></tr><tr><td>Haptics</td><td>0.455</td><td>0.377</td><td><strong>0.523</strong></td><td>0.461</td><td>0.519</td><td>0.393</td></tr><tr><td>Herring</td><td>0.578</td><td>0.531</td><td>0.672</td><td>0.547</td><td><strong>0.688</strong></td><td>0.578</td></tr><tr><td>InlineSkate</td><td>0.447</td><td>0.384</td><td>0.373</td><td><strong>0.516</strong></td><td>0.5</td><td>0.46</td></tr><tr><td>InsectWingbeatSound</td><td>0.623</td><td>0.355</td><td>0.627</td><td>0.523</td><td><strong>0.655</strong></td><td>0.595</td></tr><tr><td>ItalyPowerDemand</td><td>0.925</td><td>0.95</td><td>0.948</td><td>0.909</td><td><strong>0.963</strong></td><td>0.962</td></tr><tr><td>LargeKitchenAppliances</td><td>0.848</td><td>0.795</td><td>0.859</td><td>0.765</td><td><strong>0.864</strong></td><td>0.811</td></tr><tr><td>Lightning2</td><td><strong>0.918</strong></td><td>0.869</td><td>0.738</td><td>0.836</td><td>0.82</td><td>0.885</td></tr><tr><td>Lightning7</td><td><strong>0.795</strong></td><td>0.726</td><td>0.726</td><td>0.685</td><td>0.74</td><td>0.767</td></tr><tr><td>Mallat</td><td><strong>0.964</strong></td><td>0.934</td><td><strong>0.964</strong></td><td>0.938</td><td>0.962</td><td>0.94</td></tr><tr><td>Meat</td><td><strong>0.95</strong></td><td>0.933</td><td>0.85</td><td>0.9</td><td>0.933</td><td>0.933</td></tr><tr><td>MedicalImages</td><td><strong>0.784</strong></td><td>0.737</td><td>0.67</td><td>0.718</td><td>0.778</td><td>0.742</td></tr><tr><td>MiddlePhalanxOutlineCorrect</td><td>0.814</td><td>0.698</td><td>0.794</td><td>0.78</td><td><strong>0.832</strong></td><td>0.784</td></tr><tr><td>MiddlePhalanxOutlineAgeGroup</td><td><strong>0.656</strong></td><td>0.5</td><td>0.643</td><td>0.545</td><td>0.597</td><td>0.558</td></tr><tr><td>MiddlePhalanxTW</td><td><strong>0.61</strong></td><td>0.506</td><td>0.519</td><td>0.545</td><td>0.571</td><td>0.513</td></tr><tr><td>MoteStrain</td><td>0.871</td><td>0.835</td><td>0.897</td><td>0.879</td><td><strong>0.933</strong></td><td>0.883</td></tr><tr><td>NonInvasiveFetalECGThorax1</td><td>0.91</td><td>0.79</td><td><strong>0.95</strong></td><td>0.838</td><td>0.93</td><td>0.846</td></tr><tr><td>NonInvasiveFetalECGThorax2</td><td>0.927</td><td>0.865</td><td><strong>0.951</strong></td><td>0.901</td><td>0.945</td><td>0.913</td></tr><tr><td>OliveOil</td><td><strong>0.9</strong></td><td>0.833</td><td><strong>0.9</strong></td><td>0.867</td><td><strong>0.9</strong></td><td>0.867</td></tr><tr><td>OSULeaf</td><td>0.831</td><td>0.591</td><td>0.967</td><td>0.955</td><td><strong>0.979</strong></td><td>0.806</td></tr><tr><td>PhalangesOutlinesCorrect</td><td>0.801</td><td>0.728</td><td>0.763</td><td>0.772</td><td><strong>0.807</strong></td><td>0.773</td></tr><tr><td>Phoneme</td><td>0.289</td><td>0.228</td><td>0.321</td><td>0.265</td><td><strong>0.382</strong></td><td>0.305</td></tr><tr><td>Plane</td><td>0.99</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td></tr><tr><td>ProximalPhalanxOutlineCorrect</td><td>0.859</td><td>0.784</td><td><strong>0.883</strong></td><td>0.849</td><td>0.88</td><td>0.808</td></tr><tr><td>ProximalPhalanxOutlineAgeGroup</td><td>0.854</td><td>0.805</td><td>0.844</td><td>0.834</td><td><strong>0.859</strong></td><td>0.805</td></tr><tr><td>ProximalPhalanxTW</td><td><strong>0.824</strong></td><td>0.761</td><td>0.805</td><td>0.8</td><td>0.815</td><td>0.766</td></tr><tr><td>RefrigerationDevices</td><td>0.517</td><td>0.464</td><td><strong>0.581</strong></td><td>0.499</td><td>0.557</td><td>0.437</td></tr><tr><td>ScreenType</td><td>0.413</td><td>0.397</td><td>0.52</td><td>0.464</td><td><strong>0.589</strong></td><td>0.445</td></tr><tr><td>ShapeletSim</td><td>0.817</td><td>0.65</td><td>0.956</td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.817</td></tr><tr><td>ShapesAll</td><td>0.875</td><td>0.768</td><td>0.842</td><td><strong>0.908</strong></td><td>0.905</td><td>0.867</td></tr><tr><td>SmallKitchenAppliances</td><td>0.715</td><td>0.643</td><td>0.792</td><td>0.725</td><td><strong>0.853</strong></td><td>0.696</td></tr><tr><td>SonyAIBORobotSurface1</td><td><strong>0.897</strong></td><td>0.725</td><td>0.844</td><td>0.632</td><td>0.765</td><td>0.704</td></tr><tr><td>SonyAIBORobotSurface2</td><td><strong>0.934</strong></td><td>0.831</td><td><strong>0.934</strong></td><td>0.859</td><td>0.928</td><td>0.878</td></tr><tr><td>StarLightCurves</td><td>0.965</td><td>0.907</td><td>0.979</td><td>0.978</td><td><strong>0.982</strong></td><td>0.926</td></tr><tr><td>Strawberry</td><td>0.946</td><td>0.941</td><td>0.962</td><td><strong>0.976</strong></td><td>0.97</td><td>0.946</td></tr><tr><td>SwedishLeaf</td><td>0.931</td><td>0.792</td><td>0.928</td><td>0.922</td><td><strong>0.954</strong></td><td>0.915</td></tr></tbody></table>
<table><caption>Table S2: Accuracy scores of the combined version of our method compared with those of DTW (unsupervised), ST and BOSS (supervised) and HIVE-COTE and EE (supervised ensemble methods), on the first 85 UCR datasets (results on the full archive were not available for comparisons). Bold scores indicate the best performing method.</caption><thead><tr><th rowspan="3">Dataset</th><th colspan="2">Unsupervised</th><th colspan="4">Supervised</th></tr><tr><th>Ours</th><th>DTW</th><th rowspan="2">ST</th><th rowspan="2">BOSS</th><th colspan="2">Ensemble</th></tr><tr><th>Combined</th><th></th><th>HIVE-COTE</th><th>EE</th></tr></thead><tbody><tr><td>Symbols</td><td>0.965</td><td>0.95</td><td>0.882</td><td>0.967</td><td><strong>0.974</strong></td><td>0.96</td></tr><tr><td>SyntheticControl</td><td>0.983</td><td>0.993</td><td>0.983</td><td>0.967</td><td><strong>0.997</strong></td><td>0.99</td></tr><tr><td>ToeSegmentation1</td><td>0.952</td><td>0.772</td><td>0.965</td><td>0.939</td><td><strong>0.982</strong></td><td>0.829</td></tr><tr><td>ToeSegmentation2</td><td>0.885</td><td>0.838</td><td>0.908</td><td><strong>0.962</strong></td><td>0.954</td><td>0.892</td></tr><tr><td>Trace</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.99</td></tr><tr><td>TwoLeadECG</td><td><strong>0.997</strong></td><td>0.905</td><td><strong>0.997</strong></td><td>0.981</td><td>0.996</td><td>0.971</td></tr><tr><td>TwoPatterns</td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.955</td><td>0.993</td><td><strong>1</strong></td><td><strong>1</strong></td></tr><tr><td>UWaveGestureLibraryX</td><td>0.811</td><td>0.728</td><td>0.803</td><td>0.762</td><td><strong>0.84</strong></td><td>0.805</td></tr><tr><td>UWaveGestureLibraryY</td><td>0.735</td><td>0.634</td><td>0.73</td><td>0.685</td><td><strong>0.765</strong></td><td>0.726</td></tr><tr><td>UWaveGestureLibraryZ</td><td>0.759</td><td>0.658</td><td>0.748</td><td>0.695</td><td><strong>0.783</strong></td><td>0.724</td></tr><tr><td>UWaveGestureLibraryAll</td><td>0.941</td><td>0.892</td><td>0.942</td><td>0.939</td><td><strong>0.968</strong></td><td><strong>0.968</strong></td></tr><tr><td>Wafer</td><td>0.993</td><td>0.98</td><td><strong>1</strong></td><td>0.995</td><td>0.999</td><td>0.997</td></tr><tr><td>Wine</td><td><strong>0.87</strong></td><td>0.574</td><td>0.796</td><td>0.741</td><td>0.778</td><td>0.574</td></tr><tr><td>WordSynonyms</td><td>0.704</td><td>0.649</td><td>0.571</td><td>0.638</td><td>0.738</td><td><strong>0.779</strong></td></tr><tr><td>Worms</td><td>0.714</td><td>0.584</td><td><strong>0.74</strong></td><td>0.558</td><td>0.558</td><td>0.662</td></tr><tr><td>WormsTwoClass</td><td>0.818</td><td>0.623</td><td><strong>0.831</strong></td><td><strong>0.831</strong></td><td>0.779</td><td>0.688</td></tr><tr><td>Yoga</td><td>0.878</td><td>0.837</td><td>0.818</td><td><strong>0.918</strong></td><td><strong>0.918</strong></td><td>0.879</td></tr></tbody></table>
<table><caption>Table S3: Accuracy scores of the combined version of our method compared with those of ResNet (supervised), TimeNet and RWS (unsupervised), when available. Bold scores indicate the best performing method. “X” indicate that a score was reported in the original paper, but was either obtained using transferability or on a reversed train / test split of the dataset, thus not comparable to other results for this dataset.</caption><thead><tr><th rowspan="3">Dataset</th><th>Unsupervised</th><th>Supervised</th><th colspan="2">Unsupervised</th></tr><tr><th>Ours</th><th>ResNet</th><th>TimeNet</th><th>RWS</th></tr><tr><th>Combined</th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Adiac</td><td>0.716</td><td><strong>0.831</strong></td><td>0.565</td><td>-</td></tr><tr><td>ArrowHead</td><td>0.829</td><td><strong>0.84</strong></td><td>-</td><td>-</td></tr><tr><td>Beef</td><td>0.7</td><td><strong>0.767</strong></td><td>-</td><td>0.733</td></tr><tr><td>BeetleFly</td><td><strong>0.9</strong></td><td>0.85</td><td>-</td><td>-</td></tr><tr><td>BirdChicken</td><td>0.8</td><td><strong>0.95</strong></td><td>-</td><td>-</td></tr><tr><td>Car</td><td>0.817</td><td><strong>0.917</strong></td><td>-</td><td>-</td></tr><tr><td>CBF</td><td><strong>0.994</strong></td><td>0.989</td><td>-</td><td>-</td></tr><tr><td>ChlorineConcentration</td><td>0.782</td><td><strong>0.835</strong></td><td>0.723</td><td>0.572</td></tr><tr><td>CinCECGTorso</td><td>0.74</td><td><strong>0.838</strong></td><td>-</td><td>-</td></tr><tr><td>Coffee</td><td><strong>1</strong></td><td><strong>1</strong></td><td>-</td><td>-</td></tr><tr><td>Computers</td><td>0.628</td><td><strong>0.816</strong></td><td>-</td><td>-</td></tr><tr><td>CricketX</td><td>0.777</td><td><strong>0.79</strong></td><td>0.659</td><td>-</td></tr><tr><td>CricketY</td><td>0.767</td><td><strong>0.805</strong></td><td>X</td><td>-</td></tr><tr><td>CricketZ</td><td>0.764</td><td><strong>0.831</strong></td><td>X</td><td>-</td></tr><tr><td>DiatomSizeReduction</td><td><strong>0.993</strong></td><td>0.301</td><td>-</td><td>-</td></tr><tr><td>DistalPhalanxOutlineCorrect</td><td><strong>0.768</strong></td><td>X</td><td>X</td><td>-</td></tr><tr><td>DistalPhalanxOutlineAgeGroup</td><td><strong>0.734</strong></td><td>X</td><td>X</td><td>-</td></tr><tr><td>DistalPhalanxTW</td><td><strong>0.676</strong></td><td>X</td><td>X</td><td>X</td></tr><tr><td>Earthquakes</td><td><strong>0.748</strong></td><td>X</td><td>-</td><td>-</td></tr><tr><td>ECG200</td><td><strong>0.9</strong></td><td>0.87</td><td>-</td><td>-</td></tr><tr><td>ECG5000</td><td><strong>0.936</strong></td><td>0.935</td><td>0.934</td><td>0.933</td></tr><tr><td>ECGFiveDays</td><td><strong>1</strong></td><td>0.99</td><td>X</td><td>-</td></tr><tr><td>ElectricDevices</td><td>0.732</td><td><strong>0.735</strong></td><td>0.665</td><td>-</td></tr><tr><td>FaceAll</td><td>0.802</td><td><strong>0.855</strong></td><td>-</td><td>-</td></tr><tr><td>FaceFour</td><td>0.875</td><td><strong>0.955</strong></td><td>-</td><td>-</td></tr><tr><td>FacesUCR</td><td>0.918</td><td><strong>0.955</strong></td><td>-</td><td>-</td></tr><tr><td>FiftyWords</td><td><strong>0.78</strong></td><td>0.732</td><td>-</td><td>-</td></tr><tr><td>Fish</td><td>0.88</td><td><strong>0.977</strong></td><td>-</td><td>-</td></tr><tr><td>FordA</td><td><strong>0.935</strong></td><td>X</td><td>X</td><td>-</td></tr><tr><td>FordB</td><td><strong>0.81</strong></td><td>X</td><td>X</td><td>X</td></tr><tr><td>GunPoint</td><td><strong>0.993</strong></td><td><strong>0.993</strong></td><td>-</td><td>-</td></tr><tr><td>Ham</td><td>0.695</td><td><strong>0.8</strong></td><td>-</td><td>-</td></tr><tr><td>HandOutlines</td><td><strong>0.922</strong></td><td>X</td><td>-</td><td>X</td></tr><tr><td>Haptics</td><td>0.455</td><td><strong>0.516</strong></td><td>-</td><td>-</td></tr><tr><td>Herring</td><td>0.578</td><td><strong>0.641</strong></td><td>-</td><td>-</td></tr><tr><td>InlineSkate</td><td><strong>0.447</strong></td><td>0.378</td><td>-</td><td>-</td></tr><tr><td>InsectWingbeatSound</td><td><strong>0.623</strong></td><td>0.506</td><td>-</td><td>0.619</td></tr><tr><td>ItalyPowerDemand</td><td>0.925</td><td>0.959</td><td>-</td><td><strong>0.969</strong></td></tr><tr><td>LargeKitchenAppliances</td><td>0.848</td><td><strong>0.904</strong></td><td>-</td><td>0.792</td></tr><tr><td>Lightning2</td><td><strong>0.918</strong></td><td>0.77</td><td>-</td><td>-</td></tr><tr><td>Lightning7</td><td>0.795</td><td><strong>0.863</strong></td><td>-</td><td>-</td></tr><tr><td>Mallat</td><td>0.964</td><td><strong>0.966</strong></td><td>-</td><td>0.937</td></tr><tr><td>Meat</td><td>0.95</td><td><strong>0.983</strong></td><td>-</td><td>-</td></tr><tr><td>MedicalImages</td><td><strong>0.784</strong></td><td>0.762</td><td>0.753</td><td>-</td></tr><tr><td>MiddlePhalanxOutlineCorrect</td><td><strong>0.814</strong></td><td>X</td><td>X</td><td>X</td></tr><tr><td>MiddlePhalanxOutlineAgeGroup</td><td><strong>0.656</strong></td><td>X</td><td>X</td><td>-</td></tr><tr><td>MiddlePhalanxTW</td><td><strong>0.61</strong></td><td>X</td><td>X</td><td>-</td></tr><tr><td>MoteStrain</td><td>0.871</td><td><strong>0.924</strong></td><td>-</td><td>-</td></tr><tr><td>NonInvasiveFetalECGThorax1</td><td>0.91</td><td><strong>0.946</strong></td><td>-</td><td>0.907</td></tr><tr><td>NonInvasiveFetalECGThorax2</td><td>0.927</td><td><strong>0.944</strong></td><td>-</td><td>-</td></tr><tr><td>OliveOil</td><td><strong>0.9</strong></td><td>0.867</td><td>-</td><td>-</td></tr><tr><td>OSULeaf</td><td>0.831</td><td><strong>0.979</strong></td><td>-</td><td>-</td></tr><tr><td>PhalangesOutlinesCorrect</td><td>0.801</td><td><strong>0.857</strong></td><td>0.772</td><td>-</td></tr><tr><td>Phoneme</td><td>0.289</td><td><strong>0.333</strong></td><td>-</td><td>-</td></tr><tr><td>Plane</td><td>0.99</td><td><strong>1</strong></td><td>-</td><td>-</td></tr><tr><td>ProximalPhalanxOutlineCorrect</td><td>0.859</td><td><strong>0.914</strong></td><td>X</td><td>0.711</td></tr><tr><td>ProximalPhalanxOutlineAgeGroup</td><td><strong>0.854</strong></td><td>0.839</td><td>X</td><td>X</td></tr><tr><td>ProximalPhalanxTW</td><td><strong>0.824</strong></td><td>X</td><td>X</td><td>-</td></tr><tr><td>RefrigerationDevices</td><td><strong>0.517</strong></td><td><strong>0.517</strong></td><td>-</td><td>-</td></tr><tr><td>ScreenType</td><td>0.413</td><td><strong>0.632</strong></td><td>-</td><td>-</td></tr><tr><td>ShapeletSim</td><td>0.817</td><td><strong>1</strong></td><td>-</td><td>-</td></tr><tr><td>ShapesAll</td><td>0.875</td><td><strong>0.917</strong></td><td>-</td><td>-</td></tr><tr><td>SmallKitchenAppliances</td><td>0.715</td><td><strong>0.789</strong></td><td>-</td><td>-</td></tr><tr><td>SonyAIBORobotSurface1</td><td>0.897</td><td><strong>0.968</strong></td><td>-</td><td>-</td></tr><tr><td>SonyAIBORobotSurface2</td><td>0.934</td><td><strong>0.986</strong></td><td>-</td><td>-</td></tr><tr><td>StarLightCurves</td><td>0.965</td><td><strong>0.972</strong></td><td>-</td><td>-</td></tr><tr><td>Strawberry</td><td><strong>0.946</strong></td><td>X</td><td>X</td><td>-</td></tr></tbody></table>
<table><caption>Table S3: Accuracy scores of the combined version of our method compared with those of ResNet (supervised), TimeNet and RWS (unsupervised), when available. Bold scores indicate the best performing method. “X”s indicate that a score was reported in the original paper, but was either obtained using transferability or on a reversed train / test split of the dataset, thus not comparable to other results for this dataset.</caption><thead><tr><th rowspan="3">Dataset</th><th>Unsupervised</th><th>Supervised</th><th colspan="2">Unsupervised</th></tr><tr><th>Ours</th><th rowspan="2">ResNet</th><th rowspan="2">TimeNet</th><th rowspan="2">RWS</th></tr><tr><th>Combined</th></tr></thead><tbody><tr><td>SwedishLeaf</td><td>0.931</td><td><strong>0.955</strong></td><td>0.901</td><td>-</td></tr><tr><td>Symbols</td><td><strong>0.965</strong></td><td>0.927</td><td>-</td><td>-</td></tr><tr><td>SyntheticControl</td><td>0.983</td><td><strong>1</strong></td><td>0.983</td><td>-</td></tr><tr><td>ToeSegmentation1</td><td>0.952</td><td><strong>0.969</strong></td><td>-</td><td>-</td></tr><tr><td>ToeSegmentation2</td><td>0.885</td><td><strong>0.915</strong></td><td>-</td><td>-</td></tr><tr><td>Trace</td><td><strong>1</strong></td><td><strong>1</strong></td><td>-</td><td>-</td></tr><tr><td>TwoLeadECG</td><td>0.997</td><td><strong>1</strong></td><td>-</td><td>-</td></tr><tr><td>TwoPatterns</td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.999</td><td>0.999</td></tr><tr><td>UWaveGestureLibraryX</td><td><strong>0.811</strong></td><td>0.78</td><td>-</td><td>-</td></tr><tr><td>UWaveGestureLibraryY</td><td><strong>0.735</strong></td><td>0.675</td><td>-</td><td>-</td></tr><tr><td>UWaveGestureLibraryZ</td><td><strong>0.759</strong></td><td>0.75</td><td>-</td><td>-</td></tr><tr><td>UWaveGestureLibraryAll</td><td><strong>0.941</strong></td><td>0.862</td><td>-</td><td>-</td></tr><tr><td>Wafer</td><td>0.993</td><td><strong>0.998</strong></td><td>0.994</td><td>0.993</td></tr><tr><td>Wine</td><td><strong>0.87</strong></td><td>0.611</td><td>-</td><td>-</td></tr><tr><td>WordSynonyms</td><td><strong>0.704</strong></td><td>0.625</td><td>-</td><td>-</td></tr><tr><td>Worms</td><td><strong>0.714</strong></td><td>X</td><td>-</td><td>-</td></tr><tr><td>WormsTwoClass</td><td><strong>0.818</strong></td><td>X</td><td>-</td><td>-</td></tr><tr><td>Yoga</td><td><strong>0.878</strong></td><td>0.857</td><td>0.866</td><td>-</td></tr></tbody></table>
<table><caption>Table S4: Accuracy scores of variants of our method and of DTW on the remaining 43 UCR datasets, except DodgerLoopDay, DodgerLoopGame and DodgerLoopWeekend which contain missing values. Bold scores indicate the best performing method.</caption><thead><tr><th rowspan="3">Dataset</th><th colspan="7">Unsupervised</th><th rowspan="3">DTW</th></tr><tr><th colspan="7">Ours</th></tr><tr><th>K = 1</th><th>K = 2</th><th>K = 5</th><th>K = 10</th><th>Combined</th><th>Combined (1-NN)</th><th>FordA</th></tr></thead><tbody><tr><td>ACSF1</td><td><strong>0.91</strong></td><td>0.87</td><td>0.86</td><td>0.9</td><td>0.81</td><td>0.85</td><td>0.73</td><td>0.64</td></tr><tr><td>AllGestureWiimoteX</td><td>0.721</td><td>0.746</td><td>0.747</td><td>0.763</td><td><strong>0.779</strong></td><td>0.736</td><td>0.693</td><td>0.716</td></tr><tr><td>AllGestureWiimoteY</td><td>0.741</td><td>0.744</td><td>0.759</td><td>0.726</td><td><strong>0.793</strong></td><td>0.756</td><td>0.713</td><td>0.729</td></tr><tr><td>AllGestureWiimoteZ</td><td>0.687</td><td>0.697</td><td>0.691</td><td>0.723</td><td><strong>0.763</strong></td><td>0.716</td><td>0.71</td><td>0.643</td></tr><tr><td>BME</td><td><strong>0.993</strong></td><td><strong>0.993</strong></td><td>0.987</td><td><strong>0.993</strong></td><td><strong>0.993</strong></td><td>0.947</td><td>0.96</td><td>0.9</td></tr><tr><td>Chinatown</td><td>0.951</td><td>0.951</td><td>0.942</td><td>0.951</td><td><strong>0.962</strong></td><td>0.936</td><td><strong>0.962</strong></td><td>0.957</td></tr><tr><td>Crop</td><td>0.728</td><td>0.726</td><td>0.728</td><td>0.722</td><td><strong>0.746</strong></td><td>0.695</td><td>0.727</td><td>0.665</td></tr><tr><td>EOGHorizontalSignal</td><td>0.552</td><td>0.566</td><td>0.536</td><td><strong>0.605</strong></td><td>0.588</td><td>0.522</td><td>0.47</td><td>0.503</td></tr><tr><td>EOGVerticalSignal</td><td>0.398</td><td>0.414</td><td>0.431</td><td>0.434</td><td><strong>0.489</strong></td><td>0.431</td><td>0.439</td><td>0.448</td></tr><tr><td>EthanolLevel</td><td>0.418</td><td>0.34</td><td>0.316</td><td>0.382</td><td>0.392</td><td>0.274</td><td><strong>0.558</strong></td><td>0.276</td></tr><tr><td>FreezerRegularTrain</td><td>0.986</td><td>0.988</td><td>0.979</td><td>0.956</td><td>0.955</td><td>0.963</td><td><strong>0.992</strong></td><td>0.899</td></tr><tr><td>FreezerSmallTrain</td><td>0.967</td><td>0.956</td><td>0.906</td><td><strong>0.933</strong></td><td>0.928</td><td>0.872</td><td>0.862</td><td>0.753</td></tr><tr><td>Fungi</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.925</td><td>0.839</td></tr><tr><td>GestureMidAirD1</td><td><strong>0.638</strong></td><td>0.577</td><td>0.592</td><td>0.608</td><td>0.615</td><td>0.546</td><td>0.608</td><td>0.569</td></tr><tr><td>GestureMidAirD2</td><td>0.508</td><td>0.515</td><td>0.523</td><td><strong>0.546</strong></td><td>0.508</td><td>0.415</td><td>0.538</td><td>0.608</td></tr><tr><td>GestureMidAirD3</td><td>0.269</td><td><strong>0.331</strong></td><td>0.308</td><td>0.285</td><td><strong>0.331</strong></td><td>0.246</td><td>0.292</td><td>0.323</td></tr><tr><td>GesturePebbleZ1</td><td>0.826</td><td>0.843</td><td>0.913</td><td>0.919</td><td><strong>0.936</strong></td><td>0.814</td><td>0.547</td><td>0.791</td></tr><tr><td>GesturePebbleZ2</td><td>0.861</td><td>0.873</td><td>0.88</td><td><strong>0.899</strong></td><td>0.88</td><td>0.791</td><td>0.538</td><td>0.671</td></tr><tr><td>GunPointAgeSpan</td><td>0.984</td><td>0.984</td><td><strong>0.994</strong></td><td><strong>0.994</strong></td><td>0.987</td><td>0.991</td><td>0.987</td><td>0.918</td></tr><tr><td>GunPointMaleVersusFemale</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.997</td><td><strong>1</strong></td><td>0.994</td><td><strong>1</strong></td><td>0.997</td></tr><tr><td>GunPointOldVersusYoung</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.838</td></tr><tr><td>HouseTwenty</td><td><strong>0.95</strong></td><td>0.933</td><td>0.916</td><td>0.933</td><td><strong>0.95</strong></td><td>0.924</td><td>0.882</td><td>0.924</td></tr><tr><td>InsectEPGRegularTrain</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.872</td></tr><tr><td>InsectEPGSmallTrain</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.735</td></tr><tr><td>MelbournePedestrian</td><td>0.949</td><td>0.946</td><td>0.943</td><td>0.944</td><td><strong>0.951</strong></td><td>0.914</td><td>0.947</td><td>0.791</td></tr><tr><td>MixedShapesRegularTrain</td><td>0.916</td><td>0.906</td><td>0.904</td><td>0.905</td><td><strong>0.927</strong></td><td>0.898</td><td>0.898</td><td>0.842</td></tr><tr><td>MixedShapesSmallTrain</td><td>0.864</td><td>0.857</td><td>0.871</td><td>0.86</td><td><strong>0.877</strong></td><td>0.829</td><td>0.861</td><td>0.78</td></tr><tr><td>PickupGestureWiimoteZ</td><td>0.72</td><td><strong>0.8</strong></td><td>0.78</td><td>0.74</td><td>0.78</td><td>0.72</td><td>0.74</td><td>0.66</td></tr><tr><td>PigAirwayPressure</td><td>0.385</td><td>0.452</td><td><strong>0.51</strong></td><td><strong>0.51</strong></td><td>0.486</td><td>0.332</td><td>0.317</td><td>0.106</td></tr><tr><td>PigArtPressure</td><td>0.88</td><td>0.933</td><td><strong>0.942</strong></td><td>0.928</td><td>0.933</td><td>0.861</td><td>0.591</td><td>0.245</td></tr><tr><td>PigCVP</td><td>0.404</td><td>0.548</td><td>0.62</td><td><strong>0.788</strong></td><td>0.712</td><td>0.385</td><td>0.534</td><td>0.154</td></tr><tr><td>PLAID</td><td>0.533</td><td>0.549</td><td>0.574</td><td>0.555</td><td>0.559</td><td>0.696</td><td>0.493</td><td><strong>0.84</strong></td></tr><tr><td>PowerCons</td><td><strong>0.961</strong></td><td>0.939</td><td>0.9</td><td>0.9</td><td>0.928</td><td>0.894</td><td>0.933</td><td>0.878</td></tr><tr><td>Rock</td><td>0.62</td><td>0.62</td><td>0.58</td><td>0.58</td><td><strong>0.68</strong></td><td>0.5</td><td>0.54</td><td>0.6</td></tr><tr><td>SemgHandGenderCh2</td><td>0.845</td><td>0.852</td><td>0.873</td><td>0.89</td><td><strong>0.902</strong></td><td>0.863</td><td>0.84</td><td>0.802</td></tr><tr><td>SemgHandMovementCh2</td><td>0.711</td><td>0.649</td><td>0.7</td><td><strong>0.789</strong></td><td>0.784</td><td>0.709</td><td>0.516</td><td>0.584</td></tr><tr><td>SemgHandSubjectCh2</td><td>0.767</td><td>0.816</td><td>0.851</td><td>0.853</td><td><strong>0.876</strong></td><td>0.72</td><td>0.591</td><td>0.727</td></tr><tr><td>ShakeGestureWiimoteZ</td><td>0.92</td><td>0.92</td><td><strong>0.94</strong></td><td>0.92</td><td><strong>0.94</strong></td><td>0.86</td><td>0.9</td><td>0.86</td></tr><tr><td>SmoothSubspace</td><td>0.933</td><td><strong>0.96</strong></td><td>0.94</td><td><strong>0.96</strong></td><td>0.953</td><td>0.833</td><td>0.94</td><td>0.827</td></tr><tr><td>UMD</td><td>0.979</td><td>0.986</td><td><strong>0.993</strong></td><td><strong>0.993</strong></td><td><strong>0.993</strong></td><td>0.958</td><td>0.986</td><td><strong>0.993</strong></td></tr></tbody></table>
## S4 Multivariate Time Series

Full results corresponding to the UEA archive datasets for our method as well as the ones of DTW<sub>D</sub> as reported by Bagnall et al. (2018) are presented in Table S5, for the unique train / test split provided in the archive.

<table><caption>Table S5: Accuracy scores of variants of our method on all UEA datasets, compared to DTW<sub>D</sub>. Bold scores indicate the best performing method.</caption><thead><tr><th rowspan="3">Dataset</th><th colspan="5">Unsupervised</th></tr><tr><th colspan="4">Ours</th><th rowspan="2">DTW<sub>D</sub></th></tr><tr><th>K = 5</th><th>K = 10</th><th>K = 20</th><th>Combined</th></tr></thead><tbody><tr><td>ArticularyWordRecognition</td><td>0.967</td><td>0.973</td><td>0.943</td><td><strong>0.987</strong></td><td><strong>0.987</strong></td></tr><tr><td>AtrialFibrillation</td><td><strong>0.2</strong></td><td>0.067</td><td>0.133</td><td>0.133</td><td><strong>0.2</strong></td></tr><tr><td>BasicMotions</td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td><strong>1</strong></td><td>0.975</td></tr><tr><td>CharacterTrajectories</td><td>0.986</td><td>0.99</td><td>0.993</td><td><strong>0.994</strong></td><td>0.989</td></tr><tr><td>Cricket</td><td>0.958</td><td>0.972</td><td>0.972</td><td>0.986</td><td><strong>1</strong></td></tr><tr><td>DuckDuckGeese</td><td>0.6</td><td><strong>0.675</strong></td><td>0.65</td><td><strong>0.675</strong></td><td>0.6</td></tr><tr><td>EigenWorms</td><td>0.87</td><td>0.802</td><td>0.84</td><td><strong>0.878</strong></td><td>0.618</td></tr><tr><td>Epilepsy</td><td><strong>0.971</strong></td><td><strong>0.971</strong></td><td><strong>0.971</strong></td><td>0.957</td><td>0.964</td></tr><tr><td>Ering</td><td><strong>0.133</strong></td><td><strong>0.133</strong></td><td><strong>0.133</strong></td><td><strong>0.133</strong></td><td><strong>0.133</strong></td></tr><tr><td>EthanolConcentration</td><td>0.289</td><td>0.251</td><td>0.205</td><td>0.236</td><td><strong>0.323</strong></td></tr><tr><td>FaceDetection</td><td>0.522</td><td>0.525</td><td>0.513</td><td>0.528</td><td><strong>0.529</strong></td></tr><tr><td>FingerMovements</td><td>0.55</td><td>0.49</td><td><strong>0.58</strong></td><td>0.54</td><td>0.53</td></tr><tr><td>HandMovementDirection</td><td>0.311</td><td>0.297</td><td><strong>0.351</strong></td><td>0.27</td><td>0.231</td></tr><tr><td>Handwriting</td><td>0.447</td><td>0.464</td><td>0.451</td><td><strong>0.533</strong></td><td>0.286</td></tr><tr><td>Heartbeat</td><td><strong>0.756</strong></td><td>0.732</td><td>0.741</td><td>0.737</td><td>0.717</td></tr><tr><td>InsectWingbeat</td><td>0.159</td><td>0.158</td><td>0.156</td><td><strong>0.16</strong></td><td>-</td></tr><tr><td>JapaneseVowels</td><td>0.984</td><td>0.986</td><td><strong>0.989</strong></td><td><strong>0.989</strong></td><td>0.949</td></tr><tr><td>Libras</td><td>0.878</td><td><strong>0.883</strong></td><td><strong>0.883</strong></td><td>0.867</td><td>0.87</td></tr><tr><td>LSST</td><td>0.535</td><td>0.552</td><td>0.509</td><td><strong>0.558</strong></td><td>0.551</td></tr><tr><td>MotorImagery</td><td>0.53</td><td>0.54</td><td><strong>0.58</strong></td><td>0.54</td><td>0.5</td></tr><tr><td>NATOPS</td><td>0.933</td><td>0.917</td><td>0.917</td><td><strong>0.944</strong></td><td>0.883</td></tr><tr><td>PEMS-SF</td><td>0.636</td><td>0.671</td><td>0.676</td><td><strong>0.688</strong></td><td>0.711</td></tr><tr><td>PenDigits</td><td><strong>0.985</strong></td><td>0.979</td><td>0.981</td><td>0.983</td><td>0.977</td></tr><tr><td>Phoneme</td><td>0.216</td><td>0.214</td><td>0.222</td><td><strong>0.246</strong></td><td>0.151</td></tr><tr><td>RacketSports</td><td>0.776</td><td>0.836</td><td>0.855</td><td><strong>0.862</strong></td><td>0.803</td></tr><tr><td>SelfRegulationSCP1</td><td>0.795</td><td>0.826</td><td>0.843</td><td><strong>0.846</strong></td><td>0.775</td></tr><tr><td>SelfRegulationSCP2</td><td>0.55</td><td>0.539</td><td>0.539</td><td><strong>0.556</strong></td><td>0.539</td></tr><tr><td>SpokenArabicDigits</td><td>0.908</td><td>0.894</td><td>0.905</td><td>0.956</td><td><strong>0.963</strong></td></tr><tr><td>StandWalkJump</td><td>0.333</td><td><strong>0.4</strong></td><td>0.333</td><td><strong>0.4</strong></td><td>0.2</td></tr><tr><td>UWaveGestureLibrary</td><td>0.884</td><td>0.869</td><td>0.875</td><td>0.884</td><td><strong>0.903</strong></td></tr></tbody></table>
## S5 Discussion of the Choice of Encoder

One of the aims of this work is to propose a representation learning method for time series that is scalable. For this reason, and as explained in Section 4, we did not consider using an LSTM as encoder *f*. Nonetheless, we experimented with such an encoder on a small set of UCR datasets in order to get an indication of its performance versus the proposed encoder in this paper. We use the same optimization hyperparameters as those used to train the causal CNN encoder and choose a two-layer LSTM with hidden size 256 in order to compare both networks with similar computational time and memory usage. Corresponding results are compiled in Table S6.

We observe on this restricted set of experiments that not only the proposed encoder outperforms the LSTM encoder, but it does so by a large margin. This indicates that the proposed causal CNN encoder is more adapted to the considered task and training method.

<table><caption>Table S6: Results of our training method combined with the proposed causal CNN encoder on one hand, and with an LSTM encoder on the other hand ($K = 5$). Bold scores indicate the best performing method.</caption><thead><tr><td>Dataset</td><td>Causal CNN</td><td>LSTM</td></tr></thead><tbody><tr><td>Adiac</td><td><strong>0.703</strong></td><td>0.269</td></tr><tr><td>Computers</td><td><strong>0.676</strong></td><td>0.492</td></tr><tr><td>CricketX</td><td><strong>0.7</strong></td><td>0.136</td></tr><tr><td>DistalPhalanxTW</td><td><strong>0.662</strong></td><td><strong>0.662</strong></td></tr><tr><td>Earthquakes</td><td><strong>0.748</strong></td><td><strong>0.748</strong></td></tr><tr><td>HandOutlines</td><td><strong>0.908</strong></td><td>0.646</td></tr><tr><td>NonInvasiveFetalECGThorax1</td><td><strong>0.904</strong></td><td>0.169</td></tr><tr><td>PhalangesOutlinesCorrect</td><td><strong>0.795</strong></td><td>0.613</td></tr><tr><td>RefrigerationDevices</td><td><strong>0.547</strong></td><td>0.411</td></tr><tr><td>UWaveGestureLibraryX</td><td><strong>0.806</strong></td><td>0.357</td></tr><tr><td>Wafer</td><td><strong>0.993</strong></td><td>0.896</td></tr></tbody></table>