D EEP S ELF -O RGANIZATION :
I NTERPRETABLE D
ISCRETE
R EPRESENTATION L EARNING ON T IME S ERIES
Anonymous authors
Paper under double-blind review
A BSTRACT
High-dimensional time series are common in many domains.
Since human cognition isnot optimized to work well in high-dimensional spaces, these areas could beneﬁt frominterpretable low-dimensional representations.
However, most representation learningalgorithms for time series data are difﬁcult to interpret.
This is due to non-intuitive mappingsfrom data features to salient properties of the representation and non-smoothness over time.
To address this problem, we propose a new representation learning framework building onideas from interpretable discrete dimensionality reduction and deep generative modeling.
This framework allows us to learn discrete representations of time series, which give rise tosmooth and interpretable embeddings with superior clustering performance.
We introducea new way to overcome the non-differentiability in discrete representation learning andpresent a gradient-based version of the traditional self-organizing map algorithm that ismore performant than the original.
Furthermore, to allow for a probabilistic interpretation ofour method, we integrate a Markov model in the representation space.
This model uncoversthe temporal transition structure, improves clustering performance even further and providesadditional explanatory insights as well as a natural representation of uncertainty.
We evaluate our model in terms of clustering performance and interpretability on static(Fashion-)MNIST data, a time series of linearly interpolated (Fashion-)MNIST images, achaotic Lorenz attractor system with two macro states, as well as on a challenging real worldmedical time series application on the eICU data set.
Our learned representations comparefavorably with competitor methods and facilitate downstream tasks on the real world data.
I NTRODUCTION
Interpretable representation learning on time series is a seminal problem for uncovering the latent structurein complex systems, such as chaotic dynamical systems or medical time series.
In areas where humanshave to make decisions based on large amounts of data, interpretability is fundamental to ease the humantask.
Especially when decisions have to be made in a timely manner and rely on observing some chaoticexternal process over time, such as in ﬁnance or medicine, the need for intuitive interpretations is even stronger.
However, many unsupervised methods, such as clustering, make misleading i.i.d.
assumptions about the data,neglecting their rich temporal structure and smooth behaviour over time.
This poses the need for a methodof clustering, where the clusters assume a topological structure in a lower dimensional space, such that therepresentations of the time series retain their smoothness in that space.
In this work, we present a method withthese properties.
We choose to employ deep neural networks, because they have a very successful tradition in representationlearning (Bengio et al., 2012).
In recent years, they have increasingly been combined with generative modelingthrough the advent of generative adversarial networks (GANs) (Goodfellow et al., 2014) and variationalautoencoders (VAEs) (Kingma and Welling, 2013).
However, the representations learned by these models areoften considered cryptic and do not offer the necessary interpretability (Chen et al., 2016).
A lot of work hasbeen done to improve them in this regard, in GANs (Chen et al., 2016) as well as VAEs (Higgins et al., 2017;
Esmaeili et al., 2018).
Alas, these works have focused entirely on continuous representations, while discreteones are still underexplored.
In order to deﬁne temporal smoothness in a discrete representation space, the space has to be equipped witha topological neighborhood relationship.
One type of representation space with such a structure is inducedby the self-organizing map (SOM) (Kohonen, 1998).
The SOM allows to map states from an uninterpretablecontinuous space to a lower-dimensional space with a predeﬁned topologically interpretable structure, such as an easily visualizable two-dimensional grid.
However, while yielding promising results in visualizing staticstate spaces, such as static patient states (Tirunagari et al., 2015), the classical SOM formulation does notoffer a notion of time.
The time component can be incorporated using a probabilistic transition model, e.g. a
Markov model, such that the representations of a single time point are enriched with information from theadjacent time points in the series.
It is therefore potentially fruitful to apply the approaches of probabilisticmodeling alongside representation learning and discrete dimensionality reduction in an end-to-end model.
In this work, we propose a novel deep architecture that learns topologically interpretable discrete representations in a probabilistic fashion.
Moreover, we introduce a new method to overcome the non-differentiabilityin discrete representation learning architectures and develop a gradient-based version of the classical selforganizing map algorithm with improved performance.
We present extensive empirical evidence for themodel’s performance on synthetic and real world time series from benchmark data sets, a synthetic dynamicalsystem with chaotic behavior and real world medical data.
Our main contributions are to
• Devise a novel framework for interpretable discrete representation learning on time series.
• Show that the latent probabilistic model in the representation learning architecture improves clustering
and interpretability of the representations on time series.
• Show superior clustering performance of the model on benchmark data and a real world medical data
set, on which it also facilitates downstream tasks.
P ROBABILISTIC SOM-VAE
Our proposed model combines ideas from self-organizing maps (Kohonen, 1998), variational autoencoders(Kingma and Welling, 2013) and probabilistic models.
In the following, we will lay out the differentcomponents of the model and their interactions.
2. I NTRODUCING T OPOLOGICAL S TRUCTURE IN THE L ATENT S PACE
A schematic overview of our proposed model is depicted in Figure 1.
An input x ∈ R d is mapped to a latentencoding z e ∈ R m (usually m < d ) by computing z e = f θ ( x ) , where f θ ( · ) is parameterized by the encoderneural network.
The encoding is then assigned to an embedding z q ∈ R m in the dictionary of embeddings
E = { e 1 , . .
, e k | e i ∈
R m } by sampling z q ∼ p ( z q | z e ) .
The form of this distribution is ﬂexible and can be adesign choice.
In order for the model to behave similarly to the original SOM algorithm (see below), in ourexperiments we choose the distribution to be categorical with probability mass 1 on the closest embedding toz e , i.e. p ( z q | z e ) = 1 [ z q = arg min e ∈ E (cid:107)
z e − e (cid:107) 2 ] , where 1 [ · ] is the indicator function.
A reconstruction ˆ x ofthe input can then be computed as ˆ x = g φ
( z ) , where g φ ( · ) is parameterized by the decoder neural network.
Since the encodings and embeddings live in the same space, one can compute two different reconstructions,namely ˆ x e = g φ ( z e ) and ˆ x q = g φ ( z q ) .
[Figure]
To achieve a topologically interpretable neighborhood structure, the embeddings are connected to forma self-organizing map.
A self-organizing map consists of k nodes V = { v 1 , . .
, v k } , where every nodecorresponds to an embedding in the data space e v ∈ R d and a representation in a lower-dimensional discretespace m v ∈ M , where usually M ⊂ N 2 .
During training on a data set D = { x 1 , . . .
, x n } , a winner node˜ v is chosen for every point x i according to ˜ v = arg min v ∈ V (cid:107) e v − x i (cid:107) 2 .
The embedding vector for everynode u ∈ V is then updated according to e u ← e u + N ( m u , m ˜ v ) η
( x i − e u ) , where η is the learning rate and
N ( m u , m ˜ v ) is a neighborhood function between the nodes deﬁned on the representation space M .
There canbe different design choices for N ( m u , m ˜ v ) .
A more thorough review of the self-organizing map algorithm isdeferred to the appendix (Sec. A).
We choose to use a two-dimensional SOM because it facilitates visualization similar to Tirunagari et al.
Since we want the architecture to be trainable end-to-end, we cannot use the standard SOM training algorithmdescribed above.
Instead, we devise a loss function term whose gradient corresponds to a weighted version ofthe original SOM update rule (see below).
We implement it in such a way that any time an embedding e i,jat position ( i, j ) in the map gets updated, it also updates all the embeddings in its immediate neighborhood
N ( e i,j ) .
The neighborhood is deﬁned as N ( e i,j ) =
{ e i − 1 ,j , e i +1 ,j , e i,j − 1 , e i,j +1 } for a two-dimensional 91 map.
The loss function for a single input x looks like
[Equation]
where x , z e , z q , ˆ x e and ˆ x q are deﬁned as above and α and β are weighting hyperparameters.
Every term in this function is speciﬁcally designed to optimize a different model component.
The ﬁrst term isthe reconstruction loss L reconstruction ( x, ˆ x q , ˆ x e ) = (cid:107) x − ˆ x q (cid:107) 2 + (cid:107) x − ˆ x e (cid:107) 2 .
The ﬁrst subterm of this is the discretereconstruction loss, which encourages the assigned SOM node z q ( x ) to be an informative representation ofthe input.
The second subterm encourages the encoding z e ( x ) to also be an informative representation.
Thisensures that all parts of the model have a fully differentiable credit assignment path to the loss function, whichfacilitates training.
Note that the reconstruction loss corresponds to the evidence lower bound (ELBO) of the
VAE part of our model (Kingma and Welling, 2013).
Since we assume a uniform prior over z q , the KL-term inthe ELBO is constant w.r.t.
the parameters and can be ignored during optimization.
The term L commitment encourages the encodings and assigned SOM nodes to be close to each other and isdeﬁned as L commitment ( x ) = (cid:107)
z e ( x ) − z q ( x ) (cid:107) 2 .
Closeness of encodings and embeddings should be expectedto already follow from the L reconstruction term in a fully differentiable architecture.
However, due to the nondifferentiability of the embedding assignment in our model, the L commitment term has to be explicitly added tothe objective in order for the encoder to get gradient information about z q .
The SOM loss L SOM is deﬁned as L SOM
[Equation]
=
[Equation]
)] (cid:107) 2 , where N ( · ) is the set ofneighbors in the discrete space as deﬁned above and sg [ · ] is the gradient stopping operator that does notchange the outputs during the forward pass, but sets the gradients to 0 during the backward pass.
It encouragesthe neighbors of the assigned SOM node z q to also be close to z e , thus enabling the embeddings to exhibita self-organizing map property, while stopping the gradients on z e such that the encoding is not pulled inthe direction of the neighbors.
This term enforces a neighborhood relation between the discrete codes andencourages all SOM nodes to ultimately receive gradient information from the data.
The gradient stopping inthis term is motivated by the observation that the data points themselves do not get moved in the direction oftheir assigned SOM node’s neighbors in the original SOM algorithm either (see above).
We want to optimizethe embeddings based on their neighbors, but not the respective encodings, since any single encoding should beas close as possible to its assigned embedding and not receive gradient information from any other embeddingsthat it is not assigned to.
Note that the gradient update of a speciﬁc SOM node in this formulation depends onits distance to the encoding, while the step size in the original SOM algorithm is constant.
It will be seen thatthis offers some beneﬁts in terms of optimization and convergence (see Sec. 4.1).
2. O VERCOMING THE N ON -D IFFERENTIABILITY
The main challenge in optimizing our architecture is the non-differentiability of the discrete cluster assignmentstep.
Due to this, the gradients from the reconstruction loss cannot ﬂow back into the encoder.
A model with asimilar problem is the recently proposed vector-quantized VAE (VQ-VAE) (van den Oord et al., 2017).
It canbe seen as being similar to a special case of our SOM-VAE model, where one sets β = 0 , i.e. disables the
SOM structure.
In order to mitigate the non-differentiability, the authors of the VQ-VAE propose to copy the gradients fromz q to z e .
They acknowledge that this is an ad hoc approximation, but observed that it works well in theirexperiments.
Due to our smaller number of embeddings compared to the VQ-VAE setup, the average distancebetween an encoding and its closest embedding is much larger in our case.
The gradient copying (see above)thus ceases to be a feasible approximation, because the true gradients at points in the latent space which arefarther apart will likely be very different.
In order to still overcome the non-differentiability issue, we propose to add the second reconstruction subtermto L reconstruction , where the reconstruction ˆ x e is decoded directly from the encoding z e .
This adds a fullydifferentiable credit assignment path from the loss to the encoder and encourages z e to also be an informativerepresentation of the input, which is a desirable model feature.
Most importantly, it works well in practice (see
Sec. 4.1).
Note that since z e is continuous and therefore much less constrained than z q , this term is optimized easily andbecomes small early in training.
After that, mostly the z q -term contributes to L reconstruction .
One could thereforeview the z e -term as an initial encouragement to place the data encodings at sensible positions in the latentspace, after which the actual clustering task dominates the training objective.
2. E NCOURAGING S MOOTHNESS OVER T IME
Our ultimate goal is to predict the development of time series in an interpretable way.
This means that not onlythe state representations should be interpretable, but so should be the prediction as well.
To this end, we use atemporal probabilistic model.
Learning a probabilistic model in a high-dimensional continuous space can be challenging.
Thus, we exploitthe low-dimensional discrete space induced by our SOM to learn a temporal model.
For that, we deﬁne asystem state as the assigned node in the SOM and then learn a Markov model for the transitions between thosestates.
The model is learned jointly with the SOM-VAE, where the loss function becomes
L (
[Equation]
with weighting hyperparameters γ and τ .
The term L transitions encourages the probabilities of actually observed transitions to be high.
It is deﬁned as
L transitions ( x t − 1 , x t ) =
− log P M ( z q ( x t − 1 )
→
z q ( x t )) , with P M ( z q ( x t − 1 ) → z q ( x t )) being the probabilityof a transition from state
z q ( x t − 1 ) to state z q ( x t ) in the Markov model.
The term L smoothness encourages the probabilities for transitions to nodes that are far away from the currentdata point to be low or respectively the nodes with high transition probabilities to be proximal.
It achieves thisby taking large values only for transitions to far away nodes that have a high probability under the model.
It isdeﬁned as L smoothness ( x t − 1 , x t ) =
E P M ( z q ( x t − 1 ) → ˜ e ) (cid:2) (cid:107) ˜
e − z e ( x t ) (cid:107) 2 (cid:3) .
The probabilistic model can inform theevolution of the SOM through this term which encodes our prior belief that transitions in natural data happensmoothly and that future time points will therefore mostly be found in the neighborhood of previous ones.
In asetting where the data measurements are noisy, this improves the clustering by acting as a temporal smoother.
R ELATED W ORK
From the early inception of the k-means algorithm for clustering (Lloyd, 1982), there has been much methodological improvement on this unsupervised task.
This includes methods that perform clustering in the latentspace of (variational) autoencoders (Aljalbout et al., 2018) or use a mixture of autoencoders for the clustering(Zhang et al., 2017; Locatello et al., 2018).
The method most related to our work is the VQ-VAE (van den
Oord et al., 2017), which can be seen as a special case of our framework (see above).
Its authors have puta stronger focus on the discrete representation as a form of compression instead of clustering.
Hence, ourmodel and theirs differ in certain implementation considerations (see Sec. 2.2).
All these methods have incommon that they only yield a single number as a cluster assignment and provide no interpretable structure ofrelationships between clusters.
The self-organizing map (SOM) (Kohonen, 1998), however, is an algorithm that provides such an interpretablestructure.
It maps the data manifold to a lower-dimensional discrete space, which can be easily visualized inthe 2D case.
It has been extended to model dynamical systems (Barreto and Araújo, 2004) and combined withprobabilistic models for time series (Sang et al., 2008), although without using learned representations.
Thereare approaches to turn the SOM into a “deeper” model (Dittenbach et al., 2000), combine it with multi-layer perceptrons (Furukawa et al., 2005) or with metric learning (Pło´nski and Zaremba, 2014).
However, it has (tothe best of our knowledge) not been proposed to use SOMs in the latent space of (variational) autoencoders orany other form of unsupervised deep learning model.
Interpretable models for clustering and temporal predictions are especially crucial in ﬁelds where humanshave to take responsibility for the model’s predictions, such as in health care.
The prediction of a patient’sfuture state is an important problem, particularly on the intensive care unit (ICU) (Harutyunyan et al., 2017;
Badawi et al., 2018).
Probabilistic models, such as Gaussian processes, have been successfully applied in thisdomain (Colopy et al., 2016; Schulam and Arora, 2016).
Recently, deep generative models have been proposed(Esteban et al., 2017), sometimes even in combination with probabilistic modeling (Lim and van der Schaar,2018).
To the best of our knowledge, SOMs have only been used to learn interpretable static representations ofpatients (Tirunagari et al., 2015), but not dynamic ones.
E XPERIMENTS
We performed experiments on MNIST handwritten digits (LeCun et al., 1998), Fashion-MNIST images ofclothing (Xiao et al., 2017), synthetic time series of linear interpolations of those images, time series froma chaotic dynamical system and real world medical data from the eICU Collaborative Research Database(Goldberger et al., 2000).
If not otherwise noted, we use the same architecture for all experiments, sometimesincluding the latent probabilistic model ( SOM-VAE_prob ) and sometimes excluding it ( SOM-VAE ).
For modelimplementation details, we refer to the appendix (Sec. B).
We found that our method achieves a superior clustering performance compared to other methods.
We alsoshow that we can learn a temporal probabilistic model concurrently with the clustering, which is on parwith the maximum likelihood solution, while improving the clustering performance.
Moreover, we can learninterpretable state representations of a chaotic dynamical system and discover patterns in real medical data.
4. C LUSTERING ON MNIST AND F ASHION -MNIST
In order to test the clustering component of the SOM-VAE, we performed experiments on MNIST and FashionMNIST.
We compare our model (including different adjustments to the loss function) against k-means (Lloyd,1982) ( sklearn -package (Pedregosa et al., 2011)), the VQ-VAE (van den Oord et al., 2017), a standardimplementation of a SOM ( minisom -package (Vettigli, 2017)) and our version of a GB-SOM (gradient-based
SOM), which is a SOM-VAE where the encoder and decoder are set to be identity functions.
The k-meansalgorithm was initialized using k-means++ (Arthur and Vassilvitskii, 2007).
To ensure comparability of theperformance measures, we used the same number of clusters (i.e. the same k ) for all the methods.
The results of the experiment in terms of purity and normalized mutual information (NMI) are shown in
Table 1.
The SOM-VAE outperforms the other methods w.r.t.
the clustering performance measures.
It shouldbe noted here that while k-means is a strong baseline, it is not density matching, i.e. the density of clustercenters is not proportional to the density of data points.
Hence, the representation of data in a space inducedby the k-means clusters can be misleading.
As argued in the appendix (Sec. C), NMI is a more balanced measure for clustering performance than purity.
If one uses 512 embeddings in the SOM, one gets a lower NMI due to the penalty term for the number ofclusters, but it yields an interpretable two-dimensional representation of the manifolds of MNIST (Fig. 2,
Supp.
Fig.
S4) and Fashion-MNIST (Supp.
Fig.
S5).
The experiment shows that the SOM in our architecture improves the clustering (SOM-VAE vs. VQ-VAE)and that the VAE does so as well (SOM-VAE vs. GB-SOM).
Both parts of the model therefore seem to be
[Table]
beneﬁcial for our task.
It also becomes apparent that our reconstruction loss term on z e works better in practicethan the gradient copying trick from the VQ-VAE (SOM-VAE vs. gradcopy), due to the reasons described in
Section 2.2.
If one removes the z e reconstruction loss and does not copy the gradients, the encoder networkdoes not receive any gradient information any more and the learning fails completely (no_grads).
Anotherinteresting observation is that stochastically optimizing our SOM loss using Adam (Kingma and Ba, 2015)seems to discover a more performant solution than the classical SOM algorithm (GB-SOM vs. minisom).
This could be due to the dependency of the step size on the distance between embeddings and encodings,as described in Section 2.1.
Since k-means seems to be the strongest competitor, we are including it as areference baseline in the following experiments as well.
4. M ARKOV TRANSITION MODEL ON THE DISCRETE REPRESENTATIONS
In order to test the probabilistic model in our architecture and its effect on the clustering, we generatedsynthetic time series data sets of (Fashion-)MNIST images being linearly interpolated into each other.
Eachtime series consists of 64 frames, starting with one image from (Fashion-)MNIST and smoothly changingsequentially into four other images over the length of the time course.
After training the model on these data, we constructed the maximum likelihood estimate (MLE) for the Markovmodel’s transition matrix by ﬁxing all the weights in the SOM-VAE and making another pass over the trainingset, counting all the observed transitions.
This MLE transition matrix reaches a negative log likelihood of 0 .
24 ,while our transition matrix, which is learned concurrently with the architecture, yields 0 .
Our model istherefore on par with the MLE solution.
Comparing these results with the clustering performance on the standard MNIST and Fashion-MNIST test sets,we observe that the performance in terms of NMI is not impaired by the inclusion of the probabilistic modelinto the architecture (Tab. 2).
On the contrary, the probabilistic model even slightly increases the performanceon Fashion-MNIST.
Note that we are using 64 embeddings in this experiment instead of 16, leading to ahigher clustering performance in terms of purity, but a slightly lower performance in terms of NMI comparedto Table 1.
This shows again that the measure of purity has to be interpreted with care when comparingdifferent experimental setups and that therefore the normalized mutual information should be preferred tomake quantitative arguments.
This experiment shows that we can indeed ﬁt a valid probabilistic transition model concurrently with the
SOM-VAE training, while at the same time not hurting the clustering performance.
It also shows that forcertain types of data the clustering performance can even be improved by the probabilistic model (see Sec. 2.3).
4. I NTERPRETABLE REPRESENTATIONS OF CHAOTIC TIME SERIES
In order to assess whether our model can learn an interpretable representation of more realistic chaotic timeseries, we train it on synthetic trajectories simulated from the famous Lorenz system (Lorenz, 1963).
The
Lorenz system is a good example for this assessment, since it offers two well deﬁned macro-states (given bythe attractor basins) which are occluded by some chaotic noise in the form of periodic ﬂuctuations around theattractors.
A good interpretable representation should therefore learn to largely ignore the noise and model the
[Table]
changes between attractor basins.
For a review of the Lorenz system and details about the simulations and the performance measure, we refer to the appendix
Sec
In order to compare the interpretability of the learned representations, we computed entropy distributions oversimulated subtrajectories in the real system space, the attractor assignment space and the representation spacesfor k-means and our model.
The computed entropy distributions over all subtrajectories in the test set aredepicted in Figure 3.
[Table]
[Figure]
[Table]
d) SOM-VAE 0.0 0.5 1.0 1.5 2.0 2.5 3.0 0.0 0.
(e) k-means 0.0 0.5 1.0 1.5 2.0 0.
(f) Simulated tra- jectories
The experiment shows that the SOM-VAE representations (Fig. 3d) are much closer in entropy to the groundtruth attractor basin assignments (Fig. 3c) than the k-means representations (Fig. 3e).
For most of thesubtrajectories without attractor basin change they assign a very low entropy, effectively ignoring the noise,while the k-means representations partially assign very high entropies to those trajectories.
In total, thek-means representations’ entropy distribution is similar to the entropy distribution in the noisy system space(Fig.
3b).
The representations learned by the SOM-VAE are therefore more interpretable than the k-meansrepresentations with regard to this interpretability measure.
As could be expected from these ﬁgures, the
SOM-VAE representation is also superior to the k-means one in terms of purity with respect to the attractorassignment ( 0 . 979 vs. 0 .
956 ) as well as NMI ( 0 . 577 vs. 0 .
Finally, we use the learned probabilistic model on our SOM-VAE representations to sample new latent systemtrajectories and compute their entropies.
The distribution looks qualitatively similar to the one over realtrajectories (Fig. 3), but our model slightly overestimates the attractor basin change probabilities, leading to aheavier tail of the distribution.
4. L EARNING REPRESENTATIONS OF REAL MEDICAL TIME SERIES
In order to demonstrate interpretable representation learning on a complex real world task, we trained ourmodel on vital sign time series measurements of intensive care unit (ICU) patients.
We analyze the performanceof the resulting clustering w.r.t.
the patients’ future physiology states in Table 3.
This can be seen as a way toassess the representations’ informativeness for a downstream prediction task.
For details regarding the dataselection and processing, we refer to the appendix (Sec. D.3).
Our full model (including the latent Markov model) performs best on the given tasks, i.e. better than k-meansand also better than the SOM-VAE without probabilistic model.
This could be due to the noisiness of themedical data and the probabilistic model’s smoothing tendency (see Sec. 2.3).
[Table]
[Figure]
[Table]
[Figure]
In order to qualitatively assess the interpretability of the probabilistic SOM-VAE we analyzed the averagefuture physiology score per cluster (Fig. 4).
Our model exhibits clusters where higher scores are enriched compared to the background level.
Moreover, these clusters form compact structures, facilitating interpretability.
We do not observe such interpretable structures in the other methods.
For full results on acute physiologyscores, an analogue experiment showing the future mortality risk associated with different regions of the map,and an analysis of enrichment for particular physiological abnormalities, we refer to the appendix (Sec. D.4).
As an illustrative example for data visualization using our method, we show the trajectories of two patientsthat start in the same state (Fig. 4d).
The trajectories are plotted in the representation space of the probabilistic
SOM-VAE and should thus be compared to the visualization in Figure 4c.
One patient ( green ) stays inthe regions of the map with low average physiology score and eventually gets discharged from the hospitalhealthily.
The other one ( red ) moves into map regions with high average physiology score and ultimatelydies.
Such knowledge could be helpful for doctors, who could determine the risk of a patient for certaindeterioration scenarios from a glance at their trajectory in the SOM-VAE representation.
C ONCLUSION
The SOM-VAE can recover topologically interpretable state representations on time series and static data.
Itprovides an improvement to standard methods in terms of clustering performance and offers a way to learndiscrete two-dimensional representations of the data manifold in concurrence with the reconstruction task.
It introduces a new way of overcoming the non-differentiability of the discrete representation assignmentand contains a gradient-based variant of the traditional self-organizing map that is more performant than theoriginal one.
On a challenging real world medical data set, our model learns more informative representationswith respect to medically relevant prediction targets than competitor methods.
The learned representations canbe visualized in an interpretable way and could be helpful for clinicians to understand patients’ health statesand trajectories more intuitively.
It will be interesting to see in future work whether the probabilistic component can be extended to notjust improve the clustering and interpretability of the whole model, but also enable us to make predictions.
Promising avenues in that direction could be to increase the complexity by applying a higher order Markov
Model, a Hidden Markov Model or a Gaussian Process.
Another fruitful avenue of research could be toﬁnd more theoretically principled ways to overcome the non-differentiability and compare them with theempirically motivated ones.
Lastly, one could explore deviating from the original SOM idea of ﬁxing a latentspace structure, such as a 2D grid and learn the neighborhood structure as a graph directly from data
A PPENDIX
A S ELF - ORGANIZING MAPS
The general idea of a self-organizing map (SOM) is to approximate a data manifold in a high-dimensionalcontinuous space with a lower dimensional discrete one (Kohonen, 1998).
It can therefore be seen as anonlinear discrete dimensionality reduction.
The mapping is achieved by a procedure in which this discreterepresentation (the map ) is randomly embedded into the data space and then iteratively optimized to approachthe data manifold more closely.
The map consists of k nodes V = { v 1 , . .
, v k } , where every node corresponds to an embedding in thedata space e v ∈ R d and a representation in the lower-dimensional discrete space m v ∈ M , where usually
M ⊂ N 2 .
There are two different geometrical measures that have to be considered during training: theneighborhood function N ( m u , m ˜ v ) that is deﬁned on the low-dimensional map space and the Euclideandistance D ( e u , e ˜ v )
= (cid:107) e
u − e
˜ v (cid:107) 2 in the high-dimensional data space.
The SOM optimization tries to induce acoupling between these two properties, such that the topological structure of the representation reﬂects thegeometrical structure of the data.
Algorithm 1 Self-organizing map training
Require: data set D = { x 1 , . . .
, x n | x i ∈ R d } , number of nodes k , neighborhood function N ( · ) , step size η initialize set of k nodes V = { v 1 , . .
. , v k } initialize embeddings e v ∈ R d ∀ v ∈ V while not converged do for all x i ∈ D do ﬁnd the closest SOM node ˜ v :=
arg min v ∈ V (cid:107) x
i − e v (cid:107)update node embedding e ˜ v ← e ˜ v + η ( x i − e ˜ v ) for all u ∈ V \ ˜ v do update neighbor embedding e u ← e u + η N ( m ˜ v , m u
The SOM training procedure is described in Algorithm 1.
During training on a data set D , a winner node ˜ v ischosen for every point x i according to the Euclidean distance of the point and the node’s embedding in thedata space.
The embedding vector for the winner node is then updated by pulling it into the direction of thedata point with some step size η .
The embedding vectors of the other nodes are also updated – potentially witha smaller step size – depending on whether they are neighbors of the winner node in the map space M .
The neighborhood is deﬁned by the neighborhood function N ( m u , m ˜ v ) .
There can be different design choicesfor the neighborhood function, e.g. rectangular grids, hexagonal grids or Gaussian neighborhoods.
Forsimplicity and ease of visualization, we usually choose a two-dimensional rectangular grid neighborhood inthis paper.
In this original formulation of the SOM training, the nodes are updated one by one with a ﬁxed step size.
Inour model, however, we use a gradient-based optimization of their distances to the data points and updatethem in minibatches.
This leads to larger step sizes when they are farther away from the data and smaller stepsizes when they are close.
Overall, our gradient-based SOM training seems to perform better than the originalformulation (see Tab. 1).
It also becomes evident from this procedure that it will be very hard for the map to ﬁt disjoint manifolds inthe data space.
Since the nodes of the SOM form a fully connected graph, they do not possess the abilityto model spatial gaps in the data.
We overcome this problem in our work by mapping the data manifoldwith a variational autoencoder into a lower-dimensional latent space.
The VAE can then learn to close theaforementioned gaps and map the data onto a compact latent manifold, which can be more easily modeledwith the SOM.
B I MPLEMENTATION DETAILS
The hyperparameters of our model were optimized using Robust Bayesian Optimization with the packagessacred and labwatch (Greff et al., 2017) for the parameter handling and RoBo (Klein et al., 2017) forthe optimization, using the mean squared reconstruction error as the optimization criterion.
Especially theweighting hyperparameters α, β, γ and τ (see Eq.
(1) and Eq.
(2)) have to be tuned carefully, such thatthe different parts of the model converge at roughly the same rate.
We found that 2000 steps of Bayesianoptimization sufﬁced to yield a performant hyperparameter assignment.
Since our model deﬁnes a general framework, some competitor models can be seen as special cases of ourmodel, where certain parts of the loss function are set to zero or parts of the architecture are omitted.
We usedthe same hyperparameters for those models.
For external competitor methods, we used the hyperparametersfrom the respective publications where applicable and otherwise the default parameters from their packages.
The models were implemented in TensorFlow (Abadi et al., 2016) and optimized using Adam (Kingma and
Ba, 2015).
C C LUSTERING PERFORMANCE MEASURES
Given that one of our most interesting tasks at hand is the clustering of data, we need some performancemeasures to objectively compare the quality of this clustering with other methods.
The measures thatwe decided to use and that have been used extensively in the literature are purity and normalized mutualinformation (NMI) (Manning et al., 2008).
We brieﬂy review them in the following.
Let the set of ground truth classes in the data be C
= { c 1 , c 2 , . . .
, c J } and the set of clusters that result fromthe algorithm Ω
= { ω 1 , ω 2 , . . .
, ω K } .
The purity π is then deﬁned as π ( C, Ω) = 1 N (cid:80)
Kk =1 max j | ω k ∩ c j |where N is the total number of data points.
Intuitively, the purity is the accuracy of the classiﬁer that assignsthe most prominent class label in each cluster to all of its respective data points.
While the purity has a very simple interpretation, it also has some shortcomings.
One can for instance easilyobserve that a clustering with K = N , i.e. one cluster for every single data point, will yield a purity of 1 .
0but still probably not be very informative for most tasks.
It would therefore be more sensible to have anothermeasure that penalizes the number of clusters.
The normalized mutual information is one such measure.
The NMI is deﬁned as NMI ( C, Ω)
=
2 I ( C, Ω) H ( C )
+ H (Ω) where I ( C, Ω) is the mutual information between C and Ωand H ( · ) is the Shannon information entropy.
While the entropy of the classes is a data-dependent constant,the entropy of the clustering increases with the number of clusters.
It can therefore be seen as a penalty termto regularize the trade-off between low intra-cluster variance and a small number of clusters.
Both NMI andpurity are normalized, i.e. take values in [0 , 1] .
D E XPERIMENTAL DETAILSD. C LUSTERING ON MNIST AND F ASHION -MNIST
Additionally to the results in Table 1, we performed experiments to assess the inﬂuence of the number ofclusters k on the clustering performance of our method.
We chose different values for k between 4 and 64 andtested the clustering performance on MNIST and Fashion-MNIST (Tab. S1).
It can be seen that the purity increases monotonically with k , since it does not penalize larger numbers ofclusters (see Sec. C).
The NMI, however, includes an automatic penalty for misspecifying the model with toomany clusters.
It therefore increases ﬁrst, but then decreases again for too large values of k .
The optimal kaccording to the NMI seems to lie between 16 and 36.
D. I NTERPRETABLE REPRESENTATIONS OF CHAOTIC TIME SERIES
The Lorenz system is the system of coupled ordinary differential equations deﬁned by
[Equation]
[Table]
with tuning parameters a , b and c .
For parameter choices a = 10 , b = 28 and c = 83 , the system showschaotic behavior by forming a strange attractor (Tucker, 1999) with the two attractor points being given byp 1 , 2 = [ ± (cid:112) c ( b − 1) , ± (cid:112) c ( b − 1) , b − 1] T .
We simulated 100 trajectories of 10,000 time steps each from the chaotic system and trained the SOM-VAE aswell as k-means on it with 64 clusters/embeddings respectively.
The system chaotically switches back andforth between the two attractor basins.
By computing the Euclidian distance between the current system stateand each of the attractor points p 1 , 2 , we can identify the current attractor basin at each time point.
In order to assess the interpretability of the learned representations, we have to deﬁne an objective measure ofinterpretability.
We deﬁne interpretability as the similarity between the representation and the system’s groundtruth macro-state.
Since representations at single time points are meaningless with respect to this measure, wecompare the evolution of representations and system state over time in terms of their entropy.
We divided the simulated trajectories from our test set into spans of 100 time steps each.
For every subtrajectory,we computed the entropies of those subtrajectories in the real system space (macro-state and noise), the assignedattractor basin space (noise-free ground-truth macro-state), the SOM-VAE representation and the k-meansrepresentation.
We also observed for every subtrajectory whether or not a change between attractor basins hastaken place.
Note that the attractor assignments and representations are discrete, while the real system space iscontinuous.
In order to make the entropies comparable, we discretize the system space into unit hypercubesfor the entropy computation.
For a representation R with assignments R t at time t and starting time t start ofthe subtrajectory, the entropies are deﬁned as
[Equation]
with H ( · ) being the Shannon information entropy of a discrete set.
D. L EARNING REPRESENTATIONS OF ACUTE PHYSIOLOGICAL STATES IN THE ICU
All experiments were performed on dynamic data extracted from the eICU Collaborative Research Database(Goldberger et al., 2000).
Irregularly sampled time series data were extracted from the raw tables and thenresampled to a regular time grid using a combination of forward ﬁlling and missing value imputation usingglobal population statistics.
We chose a grid interval of one hour to capture the rapid dynamics of patients inthe ICU.
Each sample in the time-grid was then labeled using a dynamic variant of the APACHE score (Knaus et al.,1985), which is a proxy for the instantaneous physiological state of a patient in the ICU.
Speciﬁcally, thevariables MAP , Temperature , Respiratory rate , HCO3 , Sodium , Potassium , and Creatininewere selected from the score deﬁnition, because they could be easily deﬁned for each sample in the eICUtime series.
The value range of each variable was binned into ranges of normal and abnormal values, in linewith the deﬁnition of the APACHE score, where a higher score for a variable is obtained for abnormally highor low values.
The scores were then summed up, and we deﬁne the predictive score as the worst (highest)score in the next t hours, for t ∈ { 6 , 12 , 24 } .
Patients are thus stratiﬁed by their expected pathology in thenear future, which corresponds closely to how a physician would perceive the state of a patient.
The trainingset consisted of 7000 unique patient stays, while the test set contained 3600 unique stays.
D. D ETAILED ANALYSIS OF SOMVAE PROB PATIENT STATES
As mentioned in the main text (see Fig 4c) the SOMVAEProb is able to uncover compact and interpretablestructures in the latent space with respect to future physiology scores.
In this section we show results for acutephysiology scores in greater detail, analyze enrichment for future mortality risk, arguably the most importantseverity indicator in the ICU, and explore phenotypes for particular physiological abnormalities.
F ULL RESULTS FOR FUTURE ACUTE PHYSIOLOGY SCORES
[Figure]
Figure S1: (a) shows the difference in distribution of the acute physiology score in the next 24 hours, between time-points assigned to the most abnormal cell in the SOMVAEprob map with coordinates [2,0] vs. a normal cell chosen from the middle of the map with coordinates [4,3].
It is apparent that the distributions are largely disjoint, which means that the representation induced by SOMVAEprob clearly distinguishes these risk proﬁles.
Statistical tests for difference in distribution and location parameter are highly signiﬁcant at p-values of p ≤ 10 − 3 , as we have validated using a 2-sample t -test and Kolmogorov-Smirnov test.
In (b-c) the enrichment of the map for the mean acute physiology score in the next 6 and 12 hours is shown, for completeness.
The enrichment patterns on the 3 maps, for the future horizons { 6 , 12 , 24 } , are almost identical, which provides empirical evidence for the temporal stability of the SOMVAEProb embedding.
D YNAMIC MORTALITY RISK OF PATIENTS ON THE SOMVAE PROB MAP
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
We observe that the left-edge and right-edge regions of the SOMVAEprob map which are enriched for higher acute physiology scores (see Fig 4c) also exhibit elevated mortality rates over the baseline.
Interestingly, according to future mortality risk, which is an important severity indicator, patients on the left-edge are signiﬁcantly more sick on average than those on the right edge, which is less visible from the enrichment for acute physiology scores.
(a) Low Sodium 0 1 2 3 4 5 602460.
[Figure]
Potassium 0 1 2 3 4 5 602460.
[Figure] [Figure]