Dimension Reduction Approach for Interpretability of Sequence to Sequence Recurrent Neural Networks

Kun Su, Eli Shlizerman

Abstract

Encoder-decoder recurrent neural network models (RNN Seq2Seq) have achieved great success in ubiquitous areas of computation and applications. It was shown to be successful in modeling data with both temporal and spatial dependencies for translation or prediction tasks. In this study, we propose an embedding approach to visualize and interpret the representation of data by these models. Furthermore, we show that the embedding is an effective method for unsupervised learning and can be utilized to estimate the optimality of model training. In particular, we demonstrate that embedding space projections of the decoder states of RNN Seq2Seq model trained on sequences prediction are organized in clusters capturing similarities and differences in the dynamics of these sequences. Such performance corresponds to an unsupervised clustering of any spatio-temporal features and can be employed for time-dependent problems such as temporal segmentation, clustering of dynamic activity, self-supervised classification, action recognition, failure prediction, etc. We test and demonstrate the application of the embedding methodology to time-sequences of 3D human body poses. We show that the methodology provides a high-quality unsupervised categorization of movements.

Introduction

Sequence-to-Sequence (Seq2Seq) Recurrent Neural Networks (RNNs) are powerful tools for modeling sequences, yet they remain notoriously difficult to interpret. While visualization tools exist for Natural Language Processing (NLP), there is a significant gap for general spatiotemporal data—such as 3D human motion or sensor data—where spatial and temporal correlations are non-trivial. This research addresses this by "opening the black box" of Seq2Seq models, using dimensionality reduction to reveal the internal logic of how these networks represent and transform data.

Methodology: Opening the Black Box

The proposed method utilizes Proper Orthogonal Decomposition (POD), applying Singular Value Decomposition (SVD) to the network's internal state matrices.

The standard Seq2Seq architecture consisting of an encoder that processes input sequences and a decoder that generates predictions.

The process involves stacking the hidden states of the encoder ($E$) and decoder ($D$) for all sequences in a dataset into a global state matrix ($S$). By applying SVD, the researchers extract the most dominant "Principal Components" (PCs) of the network's internal activity. Projecting these high-dimensional hidden states onto the first 2 or 3 PCs allows for the visualization of the "trajectories" the network follows as it processes a sequence.

The "Attractor" Phenomenon and Self-Organization

A striking finding of this study is that as the model learns to predict spatiotemporal data, its decoder states naturally self-organize into distinct "attractors" or clusters. These regions represent the unique identity of a motion (e.g., walking vs. sitting).

Overview of the embedding methodology: hidden states are organized into snapshot matrices and projected into low-dimensional spaces where distinct clusters (attractors) emerge.

Crucially, the network is not explicitly told to classify actions; it is only trained to predict the next frame. To predict accurately, the network must internally organize different dynamics into separate clusters. The visualization also reveals the distinct roles of the components: the encoder's job is to "steer" the system from a neutral starting point toward the correct decoder attractor. The full sequence of the encoder matters, not just the final hidden state.

Key Results and Applications

The utility of this internal organization was demonstrated through unsupervised action recognition. On the CMU Motion Capture dataset, the proposed method achieved 94.75% accuracy, significantly outperforming previous state-of-the-art methods like TSSC-LC (86.08%) and ACA (84.50%).

Furthermore, the researchers found that clustering performance (measured by the Adjusted Rand Index) is an excellent proxy for training quality. If clusters begin to merge or become disorganized, it signals overfitting, providing a new metric for determining the optimal stopping point for training. The study also showed that 90-99% of the "energy" in the hidden states is captured by fewer than 20 dominant modes, proving that the internal logic of these massive networks is surprisingly low-dimensional.

Conclusion

By projecting the hidden states of Seq2Seq models into a low-dimensional space, this research provides a powerful tool for both interpretability and unsupervised learning. While currently limited to linear reduction techniques like POD, the success of this approach in high-quality unsupervised categorization of movements suggests broad applications in temporal segmentation, action recognition, and failure prediction.

Summary updated

Abstract

Encoder-decoder recurrent neural network models (RNN Seq2Seq) have achieved great success in ubiquitous areas of computation and applications. It was shown to be successful in modeling data with both temporal and spatial dependencies for translation or prediction tasks. In this study, we propose an embedding approach to visualize and interpret the representation of data by these models. Furthermore, we show that the embedding is an effective method for unsupervised learning and can be utilized to estimate the optimality of model training. In particular, we demonstrate that embedding space projections of the decoder states of RNN Seq2Seq model trained on sequences prediction are organized in clusters capturing similarities and differences in the dynamics of these sequences. Such performance corresponds to an unsupervised clustering of any spatio-temporal features and can be employed for time-dependent problems such as temporal segmentation, clustering of dynamic activity, self-supervised classification, action recognition, failure prediction, etc. We test and demonstrate the application of the embedding methodology to time-sequences of 3D human body poses. We show that the methodology provides a high-quality unsupervised categorization of movements.
BibTeX
@article{su2020dimension,
  author = {Kun Su and Eli Shlizerman},
  title = {{Dimension Reduction Approach for Interpretability of Sequence to Sequence Recurrent Neural Networks}},
  journal = {Frontiers Artif. Intell.},
  year = {2020},
  doi = {10.3389/frai.2020.00070},
}

Loading related content...

Figure