Optimal Transport Meets t-SNE: Integrated Visualization without Batch Effects in OT-tSNE

Azhar Akhmetova, Edward Eichhorn, Boris Landa, Dmitry Kobak, Sebastian DamricharXiv 2026

TL;DR

When you combine datasets collected under different conditions, annoying systematic quirks—"batch effects"—can completely ruin your 2D scatter plots, splitting identical groups apart just because they came from different labs. Most correction tools try to stitch datasets back together locally using nearest neighbors, which often creates awkward, half-merged blobs. This paper introduces OT-tSNE, a visualization tool that swaps greedy local neighbor-matching for the global diplomacy of Optimal Transport, giving you cleanly integrated, accurate visualizations in one direct step.

What Problem Does This Paper Address?

Modern science runs on massive datasets, which are usually cobbled together from smaller batches recorded across different days, machines, or donors. These differences introduce batch effects—structural noise that has nothing to do with the actual signal you care about. If you feed batched data into a standard visualization algorithm like t-SNE, it won’t group data by true underlying types; it will just group Batch A on the left and Batch B on the right.

Existing fixes usually take a two-step detour (aligning data in 50D space first, then running t-SNE) or try to connect batches directly using $k$-nearest neighbors (kNN). The catch? Nearest-neighbor matching is inherently short-sighted. Every point selfishly grabs its closest cross-batch neighbor, creating "hubs" on the fringes of clusters while leaving interior points disconnected. Instead of truly mixing, the clusters just press up against each other at the edges—a notorious failure mode charmingly known in the field as the "kissing problem."

Unintegrated t-SNE vs OT-tSNE and the kissing problem on toy data

Methods

The authors’ solution, OT-tSNE, keeps the standard optimization engine of t-SNE completely intact, modifying only the high-dimensional similarity graph fed into it.

Instead of building a standard kNN graph, OT-tSNE constructs a four-block joint affinity matrix across two batches:

  1. Cross-batch affinities (The New Stuff): For the off-diagonal blocks connecting Batch 0 and Batch 1, they compute an Entropic Optimal Transport (EOT) plan. Think of Optimal Transport as finding the cheapest way to move a pile of dirt to fill a hole, with a strict rule: every single point must contribute and receive an equal share of mass. Because it is globally coupled, fringe points can't hog all the connections, completely solving the kissing problem.
  2. Within-batch affinities: Rather than using standard kNN inside each batch, the diagonal blocks are filled mathematically using the Singular Value Decomposition (SVD) of the cross-batch transport plan (inspired by EOT eigenmaps). This ensures within-batch and cross-batch similarities speak the exact same geometric language.
  3. Sparsification & Layout: Because transport plans are dense and t-SNE prefers sparse graphs, OT-tSNE keeps only the top $k=15$ strongest connections per point (split proportionally by batch size), initializes the 2D coordinates using EOT eigenmaps, and lets standard t-SNE optimization do the rest.
Figure 2: OT-tSNE method overview. a. Toy dataset with batch effect and selected optimal transport cross-batch affinities shown as edges (left), with the full plan shown as matrix P (right). b. Con- struction of the four-block joint affinity matrix for the t-SNE backend. The plans P, P ⊤form the off-diagonal blocks. c. Completing the on-diagonal blocks S0 and S1 to reflect similarity of points in the same batch. d. Batch-size-aware sparsification of the dense joint affinities to make them suitable for t-SNE optimization. e. Integrated OT-tSNE embedding obtained via t-SNE optimization.

Datasets

To test their method, the authors used:

  • A new synthetic MNIST benchmark: Two disjoint batches of handwritten digits corrupted with class-dependent orthogonal noise—meaning each digit class gets pushed in a different noise direction perpendicular to the actual image signal.
  • Seven real-world single-cell RNA-sequencing (scRNA-seq) datasets: Ranging from ~4,000 to ~30,000 cells (including Lupus, Human brain, Mouse cortex, PBMC, nCoV, Hematopoietic, and a subset of the Mouse brain atlas). These cover everything from simple technical replicates to different sequencing technologies and unbalanced cell populations.

Key Insights and Ideas

  • Orthogonal noise breaks nearest neighbors, but OT doesn't blink: Many integration tools assume batch effects are harmless if they act perpendicular (orthogonal) to the biological signal. The authors prove mathematically—and show on MNIST—that when orthogonal noise varies in magnitude across classes, it scrambles pairwise distances and ruins kNN graphs. Balanced OT, however, is provably invariant to these shifts because row- and column-wise distance offsets cancel out under marginal constraints.
  • Direct 2D visualization beats squashing general-purpose models: Forcing heavy-duty integration models (like Seurat or Harmony) to output 2D embeddings directly destroys fine-grained cluster structure. Going straight from an OT-augmented graph to t-SNE is both simpler and sharper.
  • How you connect points within a batch matters for mixing: Surprisingly, swapping the SVD-based within-batch blocks for standard kNN graphs didn't hurt biological structure, but it significantly worsened batch mixing. Harmonizing the math across all four blocks of the matrix is key.
Figure 3: a. Construction of class-dependent orthogonal batch effects. b. Cross-batch graph purity for OT, shared kNN, and mutual kNN affinities. c. Example embeddings at λ = 10, colored by batch (top) and digit class (bottom). d–e. Embedding purity and batch mixing for the select integrated visualization methods across corruption strengths.

Key Results

  • Synthetic stress-test: As synthetic batch noise cranked up from $\lambda=0$ to $20$, reciprocal edges in mutual-kNN plummeted from 98% to 11%, and Scanorama's batch mixing fell apart. OT-tSNE’s cross-batch purity and batch mixing (kBET $\approx 1.0$) remained virtually flat across the entire noise range.
  • Real-world benchmark champion: Evaluated against 22 other method configurations across the 7 single-cell datasets (measuring batch mixing via kBET/iLISI and biological conservation via silhouette/purity), OT-tSNE took 1st place overall with an aggregate rank of 2.0 (beating MultiMAP at 4.4 and Seurat-50D+tSNE at 5.4). It also racked up 7 top-3 finishes across datasets and metric categories—more than any competitor.
  • Resilience to imbalance: Even on the Mouse Atlas dataset—where B cells made up 29% of one batch and just 8% of the other—OT-tSNE delivered the best overall trade-off between mixing batches and preserving cell types.

Limitations and Future Work

  • Extreme compositional mismatch: Because balanced OT forces every point to match somewhere, it struggles when a cell type exists in Batch A but is completely missing in Batch B (seen on the Hematopoietic dataset). Adopting unbalanced optimal transport—which relaxes strict mass conservation—is a natural next step.
  • Two-batch limit: Right now, OT-tSNE only handles pairs of batches, though it could be extended to $N$ batches by filling a larger block matrix with pairwise transport plans.
  • Compute scaling: Computing exact SVDs on dense transport matrices gets slow around 30,000 points on CPU. However, a quick test using truncated randomized SVD (200 components) dramatically sped things up while keeping OT-tSNE in 1st place; GPU Sinkhorn iterations could make it faster still.
  • Visualization only: OT-tSNE outputs 2D plots, not reusable high-dimensional embeddings for downstream clustering—though its OT affinities could potentially supervise contrastive representation learning in the future.

Summary updated

Abstract

Visual exploration is an integral step in understanding the structure of datasets. However, systematic variation between datasets collected under different conditions, known as batch effects, can obscure shared structure and complicate their joint visualization. Existing methods often rely on cross-batch nearest-neighbor relations to integrate the batches. Yet, these local correspondences can be unreliable for challenging cross-batch geometries. We propose optimal-transport t-SNE (OT-tSNE), which replaces nearest-neighbor-based matching with globally coupled affinities derived from entropic optimal transport. Controlled synthetic experiments demonstrated that nearest-neighbor-based methods can deteriorate, while optimal-transport affinities and OT-tSNE embeddings remain robust. Across seven real single-cell datasets, we benchmarked OT-tSNE against a broad range of integration and visualization methods and found that it achieves a Pareto-efficient trade-off between batch mixing and biological conservation, and integrates batches particularly well.
BibTeX
@misc{akhmetova2026optimal,
  author = {Azhar Akhmetova and Edward Eichhorn and Boris Landa and Dmitry Kobak and Sebastian Damrich},
  title = {{Optimal Transport Meets t-SNE: Integrated Visualization without Batch Effects in OT-tSNE}},
  year = {2026},
  eprint = {2611.32402},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32402},
}
Figure