Source-linked AI summary
DMT-Dens: Density-preserving manifold visualization for biological data
Ruizhe Wang, Yixuan Dong, Bolin Yang, Bingo Wing-Kuen Ling, Fuji Yang, Zelin Zang
TL;DR
Low-dimensional biological embeddings can distort the apparent density of processed observations, complicating interpretation of rare, transitional, and continuous cell states. DMT-Dens jointly learns neighborhood structure and processed-input density profiles, achieving strong density preservation while retaining competitive label separability.
Problem
Existing manifold visualizations may distort processed-input sampling density, limiting faithful interpretation of cell-state abundance and continuous populations.
Method
DMT-Dens is a parametric manifold-visualization model that combines rank-based neighborhood alignment and hard-pair aggregation with a k-nearest-neighbor log-radius density-correlation loss.
Results
DMT-Dens achieved the highest density correlation on all four biological datasets and six of nine datasets overall, while ranking among the top two in SVC accuracy on seven datasets.
Takeaways & Limitations
DMT-Dens supports two-dimensional representations that more faithfully reflect processed-input concentration and dispersion while retaining competitive label separability.
Abstract
from arXiv · showhide
Motivation: Low-dimensional embeddings are widely used to explore cell-state heterogeneity in single-cell and other high-dimensional biological data. Although many methods preserve local neighborhoods, they may distort the apparent sampling density of processed observations, altering the visual contrast between dense and sparse regions and complicating the interpretation of rare, transitional, or continuous cell-state populations. Results: We present DMT-Dens, a parametric manifold-visualization method built on a latent-token Transformer encoder. The model integrates rank-based manifold alignment with hard-pair aggregation. To preserve density, it optimizes a loss based on the Pearson correlation between k-nearest-neighbor log-radius estimates in the processed input and two-dimensional embedding spaces. Benchmark evaluations demonstrate strong density preservation, particularly on biological datasets, while retaining competitive label separability. Availability: Source code, data-processing scripts, and resolved experiment configurations are available at https://github.com/Ruizhe-wang/DMT-Dens.
1 Introduction · 2 Material and methods
DMT-Dens is introduced to reduce density distortion in biological manifold visualizations while retaining neighborhood and label structure. It uses a parametric latent-token Transformer with rank-based manifold alignment, hard-pair aggregation, and Pearson correlation of local log-radius profiles, evaluated against six dimensionality-reduction baselines across nine datasets.
- 1 Introduction: t-SNE and UMAP emphasize local structure but can distort cluster area, spread, density, and continuity, complicating interpretation of abundance and transitional states.den-SNE and densMAP add density-preservation terms but remain non-parametric and retain their parent methods’ affinity objectives.
- 1 Introduction · 2.1 Problem definition: DMT-Dens aligns k-nearest-neighbor log-radius profiles between processed input and two-dimensional embedding spaces within a parametric deep manifold-transformation model.Its manifold objective uses rank affinity and emphasizes hard pairs during optimization.
- 2.1 Problem definition: The model maps each observation through a 40-dimensional latent representation to two-dimensional coordinates, optimizing manifold preservation and density preservation jointly.The manifold loss preserves relative neighborhood orderings, while the density loss preserves local-density profiles and is weighted by λd.
- 2.2 Latent-token Transformer encoder: A fixed-token Transformer encoder applies self-attention within each observation’s latent-token set, independent of feature dimension and other observations in the inference batch.The final configuration uses M = 32, r = 16, dt = 224, L = 2, and four attention heads; attention cost does not scale quadratically with D.
- 2.3 Manifold-preservation loss: Manifold preservation uses paired augmented views, bidirectional rank affinities, Student t-kernel embedding affinities, and binary cross-entropy focused on the largest current mismatches.Hard-pair selection retains at least m = min(m0, B) pairs per observation, with ties potentially increasing the retained set.
- 2.4 Density-preservation loss · 2.5 Training objective and optimization: Density preservation compares input- and embedding-space kNN log-density profiles using Pearson correlation, averaged over two neighborhood scales, S = {⌊k/2⌋, k}.The resulting density loss averages one minus the correlation across scales and uses random mini-batch anchor subsets.
- 2.6 Model implementation: Unless otherwise noted, training uses AdamW for 1000 epochs with an initial learning rate of 1 × 10−3, cosine annealing, mixed precision, and batch size 4096.The benchmark configuration uses A0 = 512, λd = 1.8 × 10−3, and k = 12.
- 2.7 Datasets · 2.8 Baselines and evaluation metrics · 2.9 Ablation design: The benchmark comprises nine datasets spanning synthetic, scRNA-seq, image, text, and sensor data, and compares DMT-Dens with t-SNE, UMAP, PaCMAP, PHATE, den-SNE, and densMAP.Evaluation considers density preservation and label separability; density correlation is measured as Spearman correlation between high-dimensional and embedding-space mean kNN radii.
3 Results
Across nine benchmark datasets, DMT-Dens showed strong density preservation and competitive label separability against six baselines. It achieved the highest density correlation on six datasets and ranked first or second in mean SVC accuracy on seven.
- Benchmark comparison: Table 1 compares density correlation and SVC accuracy for DMT-Dens and six baselines across nine datasets using five seeds.den-SNE was out of time on EMNIST because its runtime exceeded 24 hours.
- Density preservation: DMT-Dens had the highest density correlation on ArtificialTree, HCL, GAST10K, EPI, MCA, and EMNIST.den-SNE led on MNIST and ACT, while densMAP led on NG20.
- Label separability: DMT-Dens ranked first or second in mean SVC accuracy on seven datasets and third on MNIST and EMNIST.SVC accuracy is the reported measure of label separability in Table 1.
B. SVC accuracy
DMT-Dens achieved the lowest mean ranks for both density correlation and SVC accuracy across eight datasets and remained on the Pareto frontier. Ablations and the C. elegans case study further examined the tradeoff between density preservation and SVC accuracy.
- Cross-dataset comparison: DMT-Dens had the lowest mean density-correlation and SVC-accuracy ranks across eight datasets and lay on the Pareto frontier among seven methods.EMNIST was excluded because den-SNE required more than 24 hours.
- Embedding structure: DMT-Dens embeddings showed both compact and diffuse local-density regions across annotated populations in GAST10K, HCL, and EPI.These embeddings were compared visually with t-SNE, UMAP, den-SNE, and densMAP.
- Ablation analysis: Removing density regularization produced the lowest density correlation but higher kNN preservation and SVC accuracy than the full model.All-pair averaging produced the highest mean density correlation together with the lowest mean kNN preservation and SVC accuracy.
- Ablation analysis: The full model had the highest mean density-correlation and SVC-accuracy value on EPI, HCL, and MNIST among six ablation settings.No ablation exceeded the full model on all three reported metrics for any dataset.
- C. elegans case study: 0.909 mean density correlation and 0.721 mean SVC accuracy were obtained by DMT-Dens on the C. elegans case study.The highest baseline values were 0.841 for densMAP density correlation and 0.828 for t-SNE SVC accuracy.
4 Discussion
DMT-Dens combines manifold alignment, hard-pair optimization, and density regularization to preserve relative density while maintaining neighborhood structure and label separability. Its density reflects sampled, preprocessed data, so biological interpretation requires accounting for technical and sampling effects.
- Method and overall performance: DMT-Dens integrates rank-affinity manifold alignment, hard-pair optimization, and explicit density-consistency regularization.Across benchmarks, embeddings showed high density correlation, particularly on biological datasets, while remaining competitive in SVC accuracy.
- Ablation findings: Removing density regularization markedly reduced density correlation, whereas all-pair averaging increased density correlation but lowered kNN preservation and SVC accuracy.Unidirectional matching and single-scale density estimation produced dataset-dependent changes, and no ablation improved all three metrics within any dataset.
- Density consistency: The density-consistency term penalizes disagreement between processed-input and embedding density estimates, encouraging corresponding compact and diffuse regions in two dimensions.This information is relevant to rare transition cells and continuous differentiation processes.
- Interpretation and limitations: Retained density should be interpreted as observed sample density rather than calibrated biological abundance because processed input reflects experimental sampling and preprocessing.Tissue dissociation can induce transcriptional changes, making this distinction especially important for rare and transitional states.
- Interpretation and limitations: DMT-Dens retains relative density patterns while balancing neighborhood structure and label separability, but larger-dataset and downstream-task evaluation remains needed.Its embeddings represent sampled and preprocessed data, requiring biological interpretation to account explicitly for technical and sampling effects.
Funding
Funding information is not yet provided and will be added in the final version.
- Funding: Funding information will be added in the final version.
Author contributions statement
The author contributions statement will be completed after the author list is finalized.
- Author contributions will be completed after the author list is finalized.
Supplementary Material
The supplementary material concerns DMT-Dens, a density-preserving method for manifold visualization in biological data.
- DMT-Dens is the method covered in the supplementary material.
- The method targets manifold visualization.
- Its stated focus is preserving density in biological data.
S1 Datasets
The study uses nine benchmark datasets plus a C. elegans case-study dataset, with a separately generated dyngen simulation described in Section S7.1. Table S1 records dataset characteristics and evaluation annotations, while labels are withheld from representation training but used for selection and downstream evaluation.
- Dataset collection: Table S1 covers nine benchmark datasets and one C. elegans case-study dataset.The separately generated dyngen simulation is described in Section S7.1.
- Dataset characteristics: For each dataset, Table S1 reports modality, sample size n, feature dimension D, number of class labels, and evaluation annotation.
- Label usage: Labels are excluded from representation training but used in the combined hyperparameter-selection criterion, downstream evaluation, and visualization.
S2 Derivation of the dimension-free kNN log-density
The section derives a dimension-free kNN log-density measure from k-th-neighbor radii under a locally constant-density assumption. It shows that constants and the dimension-dependent scale can be omitted when using Pearson correlation for density preservation.
- kNN log-density derivation: rk(x) is the distance from query observation x to its k-th nearest neighbor among n reference observations in d dimensions.The query itself is excluded when it belongs to the reference sample, and density is assumed approximately constant within this neighborhood.
- kNN log-density derivation: The kNN density estimator is f̂k(x) = k/(nVdrk(x)^d), with logarithm log f̂k(x) = C − d log rk(x).Here, Vd is the unit d-ball volume and C = log k − log n − log Vd.
- Dimension-free objective: Pearson correlation permits replacing log f̂k(x) with the dimension-free quantity log f̂k(x) ∝ −log rk(x).For fixed n, k, and d, C is constant across points and d is a positive scale factor; positive affine transformations do not change Pearson correlation.
S3 Model setup … S4 Parameter sensitivity
DMT-Dens uses a latent-token Transformer architecture with specified density-preservation training settings and a two-stage baseline-selection procedure. Parameter sensitivity is evaluated one factor at a time for density anchors, neighborhood scale, and density-loss weight.
- S3 Model setup: Input features are BatchNorm1d-normalized and compressed into M = 32 latent tokens with rank r = 16.Each latent is expanded to width dt = 224 and augmented with a learned identity embedding.
- S3 Model setup: Two pre-LayerNorm Transformer blocks use four attention heads and feed-forward width 4dt within the latent-token set.
- S3.1 Training and hyperparameter settings: The main benchmark uses λd = 1.8 × 10−3, k = 12, A0 = 512, η = 0.4, ν = 0.01, and m0 = 100.Numerical-stability constants include εdist = 10−12, εaff = 10−6, εBCE = 10−7, εlog = 10−8, and ερ = 10−8.
- S3.1 Training and hyperparameter settings: Neighborhood augmentation uses Kaug = 200 and Dpca = 64.
- S3.2 Baseline hyperparameter search: Baseline selection evaluates a 5 × 5 = 25-configuration structural grid per method, then varies λ ∈{0.1, 0.25, 0.5, 1, 2, 4} for den-SNE and densMAP.Configurations are ranked by the arithmetic mean of density correlation and SVC accuracy.
- S4 Parameter sensitivity: Sensitivity analysis varies A0, k, and λd one at a time while holding the other two parameters at A0 = 512, k = 12, and λd = 1.8 × 10−3.The central setting uses the same five baseline runs with seeds 42–46 across all three tables.
- S4 Parameter sensitivity: Tables S3–S5 report sensitivity results for A0, k, and λd across GAST10K, MCA, HCL, and NG20, with mean±standard deviation over five seeds.All three reported metrics use higher-is-better directionality.
S5 Runtime, peak GPU memory, and hardware … S7.1 Synthetic trajectories (dyngen)
The supplementary sections document DMT-Dens’s computational requirements, local-structure metrics, and external-reference evaluations. On synthetic dyngen trajectories, DMT-Dens leads density metrics while other methods achieve higher branch separability and topology fidelity.
- S5 Runtime, peak GPU memory, and hardware: Runtime and peak-memory measurements used a workstation with two Intel Xeon Gold 5118 CPUs, 376 GiB system memory, and eight NVIDIA GeForce RTX 2080 Ti GPUs.The software stack included Ubuntu 22.04.5 LTS, Python 3.10.19, PyTorch 2.5.1+cu121, Lightning 2.5.4, and cuDNN 9.1.0.
- S5 Runtime, peak GPU memory, and hardware: Peak GPU memory across nine benchmark datasets did not exceed approximately 6.7 GB during training.Peak usage was defined as the maximum CUDA memory allocated during training.
- S6 Full quantitative metrics: Supplementary local-structure evaluation reports local density correlation, scattered point intrusion rate, continuity, and kNN preservation alongside main-text density correlation and SVC accuracy.These metrics complement the main benchmark summaries in Table 1.
- S6 Full quantitative metrics: Density correlation summarizes whole-dataset dense-to-sparse ordering, whereas local density correlation targets neighborhood-scale variation and SPIR measures spurious embedding intrusions.Lower SPIR indicates fewer intrusions.
- S7 Additional evidence: The additional-evidence section evaluates DMT-Dens using synthetic dyngen trajectories with a known backbone and a C. elegans embryonic time course with developmental-time annotations.These evaluations use external reference information.
- S7.1 Synthetic trajectories (dyngen): Dyngen simulates cells along a prescribed gene-regulatory-network trajectory, providing reference topology, branch assignments, and simulation times for evaluating recovered branching structure.The reported setup uses a tree-structured, multifurcating trajectory backbone.
- S7.1 Synthetic trajectories (dyngen): 0.811 ± 0.011 density correlation and 0.880 ± 0.008 local density correlation were DMT-Dens’s highest values across five seeds, versus densMAP’s 0.754 ± 0.009 and 0.801 ± 0.003.DMT-Dens’s Branch SVC was 0.853 ± 0.043, while t-SNE reached 0.922 ± 0.003; topology fidelity was 0.846 ± 0.038, while den-SNE reached 0.923 ± 0.000.
S7.2 Developmental-time preservation (C. elegans) · S8 Full embedding comparisons
On the C. elegans embryonic time course, DMT-Dens preserves developmental ordering with high graph reach, while full comparisons extend qualitative embedding assessment across biological and non-biological datasets.
- S7.2 Developmental-time preservation (C. elegans): The C. elegans evaluation uses observed binned embryonic-time annotations because no lineage backbone is provided.Assessment is based on the annotation and two-dimensional embedding.
- S7.2 Developmental-time preservation (C. elegans): Pseudotime correlation measures Spearman agreement with observed time, while ordering accuracy measures pairwise order agreement and time continuity measures local temporal similarity.Embedding pseudotime is geodesic distance from earliest-time cells on a k-nearest-neighbor graph with k = 15.
- S7.2 Developmental-time preservation (C. elegans): Reach is the fraction of cells connected to the earliest-time root, and fragmented embeddings require interpreting reachable-subset metrics together with reach.Results are mean±sample standard deviation over five seeds; density-weight conventions differ between default and λ-marked rows.
- S7.2 Developmental-time preservation (C. elegans): 0.997 ± 0.001: DMT-Dens reach; 0.556 ± 0.052: pseudotime correlation; 0.732 ± 0.027: ordering accuracy.The corresponding PaCMAP values are 0.430±0.085, 0.518±0.089, and 0.713±0.042, respectively.
- S7.2 Developmental-time preservation (C. elegans): 0.739±0.005: DMT-Dens time continuity, versus 0.776 ± 0.001 for t-SNE and 0.783 ± 0.003 for PaCMAP.DEMaP is 0.643 ± 0.011 for DMT-Dens and 0.817 ± 0.014 for PHATE.
- S8 Full embedding comparisons: Figures S2 and S3 extend the representative main-text embedding comparison to all seven methods.Figure S2 covers GAST10K, HCL, EPI, and MCA, while Figure S3 covers MNIST, EMNIST, 20 Newsgroups, and ArtificialTree.