Deep two-way matrix reordering for relational data analysis

Chihiro Watanabe, Taiji Suzuki · DOI

TL;DR

DeepTMR (Deep Two-way Matrix Reordering) is a novel neural network approach that automatically learns to sort the rows and columns of a data matrix to reveal hidden structural patterns. By using an autoencoder-like architecture with a 1D bottleneck, it bypasses complex combinatorial optimization to find optimal orderings, while simultaneously generating a clean, denoised version of the original matrix for easier visualization.

What Problem Does This Paper Address?

Matrix reordering (or seriation) is a visualization technique used to permute the rows and columns of a matrix so that hidden, meaningful structures—like blocks, stripes, or gradients—become visible. Traditional methods usually rely on predefined feature extraction techniques (like Singular Value Decomposition or Multidimensional Scaling) or assume a specific structural pattern beforehand (like biclustering).

However, in real-world exploratory data analysis, we rarely know the underlying structure of a matrix in advance. If you guess the wrong structure or use the wrong feature extractor, you might miss the pattern entirely. The authors tackle the need for a flexible, automated feature extraction method that adapts to the specific data matrix without requiring prior structural knowledge or predefined distance metrics.

Methods

The authors propose DeepTMR, which frames the combinatorial sorting problem as a representation learning task using an autoencoder-like neural network.

Here is how it works:

  1. Inputs: To predict a single matrix entry $A_{ij}$, the network takes the entire $i$-th row vector and the entire $j$-th column vector as inputs.
  2. Encoders: Two separate neural networks (ROWENC and COLUMNENC) compress these high-dimensional vectors into single 1D scalar values. These scalars represent the "features" of that specific row and column.
  3. Decoder: A decoder network takes these two 1D scalars and attempts to reconstruct the original matrix entry $A_{ij}$.
  4. Reordering: The network is trained end-to-end using Mean Squared Error. Once trained, the rows and columns of the original matrix are simply sorted based on the learned 1D scalar values.

What's new: Unlike traditional spectral methods that rely on linear assumptions, DeepTMR learns a non-linear mapping tailored specifically to the data. Furthermore, the output of the decoder serves as a "denoised" mean matrix, smoothing out the noise of the raw data and making the global structure highly visible.

Datasets

The authors evaluated DeepTMR on both synthetic and real-world datasets:

  • Synthetic Datasets: Custom-generated matrices designed to test specific patterns, including the Latent Block Model (LBM), Striped Pattern Model (SPM), Gradation Block Model (GBM), and Diagonal Gradation Model.
  • Divorce Predictors Dataset (UCI): A real-world dataset containing 170 respondents and 54 questionnaire attributes regarding marriage and divorce risk.
  • Metropolis Traffic Census Dataset (e-Stat, Japan): A relational dataset tracking the number of commuters traveling between 249 locations in the Tokyo metropolitan area.

Key Insights and Ideas

  • Bypassing Combinatorial Optimization: Finding the exact optimal row/column order for a matrix is often an NP-hard problem. DeepTMR elegantly sidesteps this by projecting rows and columns into a continuous 1D latent space, where sorting becomes trivial.
  • The Power of the Bottleneck: Forcing the network to reconstruct the entire matrix from just two 1D scalars ensures that these scalars capture the most dominant, global ordering of the data.
  • Free Denoising: Because the network learns a generalized low-dimensional representation, the reconstructed output matrix naturally smooths out noise. This provides a highly readable "clean" version of the data's underlying structure alongside the reordered raw data.
  • Structural Agnosticism: DeepTMR doesn't care if the hidden pattern is a checkerboard, a stripe, or a smooth gradient. The non-linear encoders adapt to whatever structure minimizes the reconstruction error.

Key Results

  • Synthetic Superiority: DeepTMR successfully recovered complex latent structures (blocks, stripes, gradations) on synthetic data. On the Diagonal Gradation Model, it achieved a lower matrix reordering error compared to baseline methods (SVD-Rank-One, SVD-Angle, and MDS), proving particularly robust as noise variance increased.
  • Divorce Dataset: The model successfully grouped respondents by divorce risk and clustered related questionnaire attributes. Interestingly, the denoised matrix highlighted that both married and divorced groups struggle with specific communication issues, while diverging sharply on others.
  • Traffic Dataset: DeepTMR revealed a clear, continuous gradient of commuter flow, automatically sorting locations to show the massive migration from suburban areas (e.g., Saitama, Gunma) into central Tokyo wards (Minato, Chiyoda, Shinjuku) for work and school.

Limitations and Future Work

  • Fixed Input Dimensions: The model requires the entire row/column vector as input. This makes it difficult to apply to streaming or time-series data where new rows/columns are added over time without retraining the network from scratch.
  • Memory Constraints: The input layer is $(n+p)$-dimensional. For massive matrices, this scales poorly. The authors suggest a future approach using a random subset of $k$ rows and $h$ columns to reduce memory overhead.
  • Training Instability: Like many deep learning models, DeepTMR is sensitive to random initialization and hyperparameter choices. In the experiments, the authors had to run the model multiple times and pick the one with the lowest training loss.
  • Future Work: The authors suggest integrating side information (like geographical coordinates for the traffic dataset or demographic data for the divorce dataset) to guide the structural pattern discovery.

Summary updated

BibTeX
@article{watanabe2022deep,
  author = {Chihiro Watanabe and Taiji Suzuki},
  title = {{Deep two-way matrix reordering for relational data analysis}},
  journal = {Neural Networks},
  year = {2022},
  doi = {10.1016/j.neunet.2021.11.028},
}
Figure