Source-linked AI summary

Selective Inference for Deep Clustering in Latent Spaces

Eina Mizui, Tomohiro Shiraishi, Shunichi Nishino, Ichiro Takeuchi

arXiv:2609.28756v1stat.MLcs.LG

TL;DR

Testing data-discovered clusters on the same observations induces selection bias, while existing clustering selective-inference methods mainly address clustering on observed features. This paper develops selective inference for deep clustering with a fixed pretrained encoder and uses computational aggregation to limit over-conditioning. Synthetic experiments report Type I error control and higher power than valid conservative alternatives, with RNA-seq applications illustrating its use for cluster differences.

  • Problem

    Testing clusters on the data used to discover them induces selection bias, and existing clustering selective-inference methods primarily address clustering directly on observed features.

    Source: §2.3 · p. 12
  • Method

    The framework characterizes the selection event jointly induced by a fixed encoder and clustering procedure, with parametric programming aggregating compatible selection regions.

    Source: §1 · pp. 7–8
  • Results

    Synthetic experiments show Type I error control where naive inference fails and higher power than valid conservative alternatives, while RNA-seq applications illustrate feature-difference inference.

    Source: §1 · p. 5, §5 · p. 33
  • Takeaways & Limitations

    The framework enables valid feature-wise inference for differences between clusters discovered in a learned latent space.

    Source: §5 · p. 33

    The development focuses on fixed piecewise-affine encoders and k-means; training the encoder on inference data, relaxing Gaussian and known-covariance assumptions, and simultaneous inference remain future directions.

    Source: §5 · p. 33

Abstract

from arXiv · show

Deep clustering is a powerful approach for discovering meaningful structures in high-dimensional data by learning a low-dimensional latent representation prior to clustering. Despite its empirical success, assessing the statistical reliability of the resulting clusters remains challenging. Testing discovered clusters on the same data induces selection bias and invalidates classical $p$-values. Selective inference (SI) provides a principled framework for correcting this bias, but existing methods focus on clustering performed directly on the observed features. In this work, we develop an SI framework for deep clustering with a fixed pretrained encoder. The key challenge is that cluster assignments are determined through a nonlinear transformation from the original data space to the latent space, resulting in a substantially more complex selection process than in conventional clustering. Our method provides a computationally tractable way to account for this process and enables valid statistical testing of differences between clusters identified in the latent space. Synthetic experiments demonstrate that the proposed method controls the Type I error rate while achieving higher power than valid but conservative baselines, and genomic applications show that it can identify significant cluster differences while appropriately accounting for selection bias. Our framework provides a principled approach to quantifying the statistical reliability of structures discovered by deep clustering.

1 Introduction

The section motivates inference for clusters discovered from high-dimensional data and identifies the gap: existing clustering SI primarily addresses clustering directly on observed features, not deep latent-space pipelines. It presents a framework that characterizes selection across a fixed encoder and clustering procedure, with a computational strategy to avoid excessive conditioning.

1 Introduction

  • Single-cell RNA-seq motivates feature-wise comparisons because researchers seek genes that differ between discovered cell populations.Apparent cluster-specific signals from sampling variation may mislead biological interpretations and prompt unnecessary follow-up experiments.Source: §1 · pp. 3–4
  • Testing clusters on the same data used to discover them induces selection bias and invalidates classical p-values, while a data split may not preserve corresponding clusters.The identified partition in one subset need not define the same clusters in another subset.Source: §1 · pp. 4, 6
  • Deep clustering adds a nonlinear encoder to the clustering procedure, making its selection event more complex than selection from clustering observed features directly.Latent assignment constraints hold within encoder activation regions and must be combined across those regions.Source: §1 · pp. 4–5
  • Synthetic experiments show Type I error control where naive inference fails and higher power than valid conservative alternatives; RNA-seq applications illustrate feature-difference testing.The applications include bulk and single-cell RNA-seq data.Source: §1 · pp. 5, 8
  • The framework characterizes the selection event across a piecewise-affine encoder and clustering procedure, enabling valid feature-wise inference for latent-space clusters.The concrete development uses ReLU encoders and k-means (Lloyd’s algorithm).Source: §1 · pp. 5, 7
  • Aggregating internal-state regions with the same clustering output avoids conditioning on a single algorithmic path and yields higher power than conservative single-region conditioning.The procedure is designed to mitigate power loss from over-conditioning while preserving selective validity.Source: §1 · p. 8

2 Preliminaries

The preliminaries introduce sequential deep clustering and feature-wise testing, then explain why ordinary tests are not valid when clusters and hypotheses are selected from the same data.

2.1 Deep Clustering

  • A fixed encoder maps high-dimensional observations into a compact latent space before a clustering algorithm partitions them.The theory assumes an encoder trained independently of the target data, or otherwise supplied as a fixed external map.Source: §2.1 · p. 9

2.2 Feature-wise Hypothesis Testing

  • For feature j and clusters Ca and Cb, the test compares their empirical means using a linear-contrast statistic.The hypotheses are framed as feature-wise differences between the estimated clusters.Source: §2.2 · p. 11

2.3 Selection Bias

  • Because cluster assignments determine the tested hypotheses from the same data, ordinary inference induces selection bias and fails to control Type I error.This dual use of the data is described as double dipping.Source: §2.3 · p. 12

3 Selective Inference for Deep Clustering

The framework extends selective inference to deep clustering by conditioning on the observed clustering and reducing feature-wise testing to a one-dimensional search line. Its central computational task is identifying all points on that line that reproduce the observed clustering.

3.1 Conditional Distribution and Selective p-value

  • Theorem 3.1 gives the conditional distribution underlying selective p-values after conditioning on the clustering outcome and a sufficient statistic.The theorem is unchanged from prior clustering inference; the deep-clustering contribution is computing its truncation region.Source: §3.1 · pp. 13–14

3.2 Selection Region Identification and Problem Decomposition

  • The selection region consists of search-line coordinates where deep clustering reproduces the observed clustering, and its computation is decomposed into encoder and k-means constraints.The encoder activation pattern and the k-means assignment history define the internal state used to express these constraints algebraically.Source: §3.2 · p. 15

3.3 Problem A: Neural Networks

  • Within a fixed activation region, the piecewise-affine encoder maps the search line to an affine latent representation on which k-means operates.The encoder’s activation pattern remains fixed over a connected interval along the line.Source: §3.3.2 · pp. 16–17, §3.3.1 · p. 16

3.3.3 Implementation via Auto-Conditioning

  • Auto-Conditioning traces the encoder along the search line and propagates linear constraints to find the maximal interval preserving its activation pattern.At the observed realization, this interval preserves the activation pattern at the observed data.Source: §3.3.3 · p. 17

3.4 Problem B: Piecewise Quadratic Constraints in k-means

  • With the encoder’s affine map fixed, k-means centroid distances are quadratic in the candidate coordinate, so preserving its assignment decisions yields quadratic constraints.Because their solution sets may be disconnected, the method retains the connected component containing the current point while accumulating constraints across samples and iterations.Source: §3.4 · p. 18

3.5 Combining Problems A and B

  • Intersecting the encoder and k-means intervals gives a local interval with unchanged internal state, while the full selection region is a finite union of intervals.The finite-union property follows from the linear encoder constraints and quadratic k-means constraints.Source: §3.5 · pp. 18–19

3.6 Parametric Programming

  • Using only the local interval at the observed point would over-condition and reduce power, so the method aggregates intervals whose clustering output matches the observed result.The parametric search stitches local intervals into the global truncation set.Source: §3.6 · p. 19
  • The search dynamically identifies local intervals for a fixed deep-clustering procedure and merges those whose clustering matches the observation.The implementation traverses the specified search range using a small boundary-crossing offset, and computes the truncation region to numerical precision over an effective support.Source: §3.6 · pp. 20–21

4 Numerical Experiments

The experiments assess selective validity and power on synthetic data, then compare feature-wise testing procedures on SEQC and PBMC gene-expression data. The synthetic results favor the proposed method over valid but conservative baselines, while real-data rejection counts illustrate procedure differences rather than establish error rates or power.

4.1.1 Methods for Comparison

  • The comparison includes naive unadjusted tests, Bonferroni correction over KN assignments, and w/o-pp single-interval conditioning without parametric programming.The w/o-pp ablation isolates the power gain from integrating multiple compatible intervals.Source: §4.1.1 · p. 22

4.1.2 Experimental Setup

  • Synthetic experiments use Gaussian data with a fixed pretrained ReLU MLP encoder to assess null error control and power under three-cluster alternatives.The null experiments vary sample size or dimension, while power experiments examine separated clusters.Source: §4.1.2 · pp. 22–24

4.1.3 Results

  • The proposed method controls Type I error across tested N and D settings and has the highest power among methods that control error.Bonferroni and w/o-pp also keep error below α, but are more conservative; Figure 3 compares power and Figure 2 reports Type I error experiments.Source: §4.1.3 · p. 24, Figure 2 · p. 25, Figure 3 · p. 25

4.2 Real Data Experiments

  • Real-data rejection counts are descriptive: unknown gene-level nulls and possible departures from Gaussian assumptions prevent them from establishing Type I error, power, or across-gene error control.The reported feature-wise p-values do not by themselves control family-wise error or false discovery rate across genes, cluster pairs, or choices of K.Source: §4.2 · p. 26

4.2.1 Analysis on the SEQC (Neuroblastoma) Dataset

  • In SEQC, the proposed method detects more genes than w/o-pp and no more than naive across settings; for K = 2 Risk-mixed, it identifies 47 genes, matching naive.Naive rejection counts remain high across K, consistent with artificial differences introduced by clustering.Source: §4.2.1 · p. 28, Table 2 · p. 29

4.2.2 Analysis on the PBMC (Immune Cells) Dataset

  • In PBMC, naive rejects more than half the genes in most single-type cluster pairs, while Proposed detects 639 genes versus 436 for w/o-pp in the multi-type 0–1 pair.The multi-type clusters broadly align with cell-type annotations, which do not establish gene-level hypotheses.Source: §4.2.2 · p. 31, Table 3 · p. 32

5 Conclusions and Future Work

The framework enables feature-wise inference for differences between clusters selected in a learned latent space by accounting for selection induced jointly by a fixed encoder and clustering. Synthetic experiments show Type I error control and improved power over conservative alternatives, while RNA-seq applications illustrate its practical utility.

5 Conclusions and Future Work

  • The framework accounts for selection induced jointly by a fixed encoder and clustering, enabling valid feature-wise inference for differences between selected latent-space clusters.Its computational strategy aggregates compatible selection regions through parametric programming to avoid unnecessary over-conditioning.Source: §5 · p. 33
  • Synthetic experiments demonstrated Type I error control and improved power over conservative alternatives, while bulk and single-cell RNA-seq applications identified features characterizing data-driven subgroups.Source: §5 · p. 33
  • The current development focuses on piecewise-affine encoders and k-means; extending theory to same-data-trained encoders requires incorporating training into the selection event.Other future directions include relaxing Gaussian and known-covariance assumptions, simultaneous inference, and improved scalability.Source: §5 · p. 33

A Proofs

The appendix reproduces proofs for results established in prior work and explains why their arguments transfer to clustering in a learned latent space. Theorem 3.1 obtains selective inference by restricting a Gaussian search coordinate to the selection truncation region.

A Proofs

  • The appendix reproduces Theorems 3.1 and 3.2 from Chen and Witten [2023] and Chen and Gao [2025], showing their arguments depend on the selection event through truncation region Z.The proofs make explicit why these results transfer from clustering in the original space to clustering in a learned latent space.Source: A Proofs · p. 35

A.1 Proof of Theorem 3.1

  • Conditioning on Q(X) = Q(x) restricts X to an affine line, and conditioning further on the clustering event restricts its coordinate z to Z.Along the line, T_j(X(z)) = z; the resulting conditional law is a truncated Gaussian under the stated null setup.Source: §A.1 · p. 35

A.2 Proof of Theorem 3.2

The proofs establish conditional validity by marginalizing over nuisance information while conditioning on the clustering event, rather than on the algorithm’s internal path. The appendix details how affine latent representations and quadratic assignment constraints construct the intervals used to characterize that event.

A.2 Proof of Theorem 3.2

  • Under the null, the selective pivot is uniform conditional on the clustering event and Q(X), and marginalization preserves the selective p-value property without conditioning on internal state.The proof uses the tower property while holding the clustering event fixed.Source: §A.2 · pp. 35–36

A.3 Internal states and parametric programming

  • Internal states yield fixed-state truncation sets that can be unions of intervals; aggregating compatible local intervals constructs the union truncation for the clustering event and avoids over-conditioning on one path.The validity argument targets the clustering event, not a finer partition by internal state.Source: §A.3 · p. 36

cluster assignments

  • The appendix constructs a local interval around the search point on which the k-means assignment path remains unchanged.Source: cluster assignments · p. 38

B.1 Linear representation of the latent features and centroid dependence on the line coordinate

  • Within the encoder activation region containing the anchor, latent representations vary affinely along the search line; the affine extension is valid as encoder output only within that region.Candidate centroids also have affine form when anchor assignments are held fixed.Source: §B.1 · p. 38

B.2 Expanding distance inequalities into quadratic forms

  • Matching anchor assignments requires each point’s squared distance to its assigned centroid to be no greater than its distance to competing centroids at every iteration.Source: §B.2 · p. 39

B.3 Combining invariance constraints over the full k-means run

  • Intersecting the quadratic assignment constraints across points, competing clusters, and iterations gives the feasible set for the complete anchor path, generally a finite union of intervals.The local interval is the connected component containing the anchor coordinate.Source: §B.3 · p. 40

C Additional experiments: robustness of Type I

Additional null experiments assess Type I error control under estimated variance and non-Gaussian noise, departures from the ideal known-covariance Gaussian setup. A separate construction embeds cluster centers in higher dimensions while preserving their pairwise distances.

error control

  • The robustness experiments test whether Type I error control persists beyond independent Gaussian noise with known covariance.Source: error control · p. 41

C.1 Estimated variance

  • Empirical Type I error rates remained near nominal levels across tested sample-size and dimension settings with plug-in variance estimates, but this is not an exact guarantee for estimated covariance.Figure 4 summarizes the rates as N and D vary.Source: Figure 4 · p. 41, §C.1 · p. 41

C.2 Non-Gaussian noise

  • Under non-Gaussian noise, occasional Type I error excursions above α occurred; tested conditions suggest empirical robustness but do not extend the validity guarantee beyond Gaussian errors.Figure 5 reports Type I error rates under non-Gaussian noise families.Source: §C.2 · p. 42, Figure 5 · p. 42

ments

  • The power-experiment construction embeds two-dimensional cluster centers into a subspace of R^D while preserving their pairwise separation.Source: ments · p. 43

E Supplementary biological discussion for real-

The appendix contextualizes SEQC neuroblastoma clusters as summaries of data-driven variation, not definitive biological subtypes. The clustering also separates structure within the low-risk group that clinical risk labels do not fully explain.

data experiments

  • The appendix provides extended biological context and gene-level interpretation for the real-data experiments.Source: data experiments · p. 44

E.1 SEQC (neuroblastoma): context and interpretation

  • Because SEQC measures bulk tissue rather than single cells, clusters summarize data-driven variation rather than definitive biological subtypes.Tumor purity and admixture of normal neural tissue can jointly affect expression signals.Source: §E.1 · p. 44
  • K = 2 roughly tracks the main risk-label separation, while K = 3 and K = 4 further split the region occupied by low-risk samples.These subdivisions may reflect tumor heterogeneity, specimen purity, or normal-tissue contamination; the data do not identify the cause.Source: §E.1 · p. 44

E.1.1 Risk-group composition by cluster (SEQC)

In the Risk-mixed setting, clusters differ in their clinical risk-group composition, indicating that the learned partition reflects major risk-related variation to some extent.

E.1.1 Risk-group composition by cluster (SEQC)

  • Approximately 73% of one K = 2 cluster is high-risk, while approximately 79% of the other is low-risk.Table 4 reports clinical risk-group composition ratios for clusters in the Risk-mixed setting.Source: §E.1.1 · pp. 44, 46, Table 4 · p. 46

E.1.2 Gene-level evaluation (SEQC)

The gene-level evaluation contrasts naive and selective-inference results across Low-risk-only and Risk-mixed settings. It highlights plausible biology while cautioning that bulk-tissue signals and low-expression hits can have non-biological explanations.

E.1.2 Gene-level evaluation (SEQC)

  • Tables 5 and 6 report p-values for representative genes in the Low-risk-only and Risk-mixed settings, respectively.Source: §E.1.2 · p. 46, Table 5 · p. 47, Table 6 · p. 48
  • Naive testing flags many low-expression genes with poorly annotated functions, whose hits are plausibly non-biological because technical noise can perturb low-expression bulk RNA-seq genes.Source: §E.1.2 · p. 46
  • The proposed method marks NTRK1 (TrkA) significant in Risk-mixed data, whereas w/o-pp often misses it.NTRK1 is linked to favorable differentiation and prognosis; purity and normal-tissue effects cannot be excluded, though the cluster pattern is consistent with a known low-risk/TrkA-high profile.Source: §E.1.2 · p. 46
  • The proposed method also finds Risk-mixed differences for DLL3, ERBB3, and CAMK2A, which are involved in neural development.These differences may reflect maturity differences between risk groups or varying normal-tissue content; the driver could be intrinsic tumor biology or microenvironment.Source: §E.1.2 · pp. 46–47
  • In Low-risk-only data, the proposed method usually does not call TARP significant when the naive method does, and returns a narrower set of positives.Variation in immune infiltration and stromal fractions means naive hits need not be wrong, but strong prognostic splits are less plausible within one clinical low-risk stratum; some proposed-method hits at α = 0.05 may be Type I errors.Source: §E.1.2 · p. 47

E.2.1 Multi-type clustering visualization and quantitative summary

In the Multi-type setting, deep-clustering partitions align closely with annotated lymphocyte types without label supervision. The visualization compares true cell-type labels with the learned K = 3 clusters.

E.2.1 Multi-type clustering visualization and quantitative summary

  • The Adjusted Rand Index is 0.899, and the learned clusters are highly consistent with established biological categories.Figure 7 shows a two-dimensional t-SNE embedding of 1000-dimensional inputs, with true labels in panel (a) and deep-clustering labels in panel (b).Source: §E.2.1 · pp. 50–52, Figure 7 · p. 51

E.2.2 Gene-level tables and interpretation

The gene-level interpretation contrasts single-type and multi-type settings, with the proposed method suppressing dubious hits while retaining sensitivity to some biologically relevant differences. Some observed patterns remain compatible with transient states rather than stable clusters.

  • In the Single-type setting, the proposed method suppresses dubious low-expression hits while retaining sensitivity to modest state changes, whose stability as clusters remains uncertain.Some detected differences involve cell-cycle or interferon-response programs.Source: §E.2.2 · p. 52
  • In the Multi-type setting, CDK11A is significant for all cluster pairs under the proposed method but not under w/o-pp.The passage relates this result to a functional difference between naive and memory cells.Source: §E.2.2 · p. 52
  • All methods yield very small KIF2C p-values across pairs, consistent with lineage turnover differences and expected proliferation contrasts.Source: §E.2.2 · pp. 52–53
  • Multi-type ISG15 is strongest in comparisons involving Cluster 1 (NK), fitting an innate-versus-adaptive expression pattern.The passage contrasts this interpretation with the Single-type fluctuation account.Source: §E.2.2 · p. 53
  • Overall, the proposed method limits selection-bias-driven noise seen under naive while retaining sensitivity to differentiation- and function-related contrasts that w/o-pp often misses.Source: §E.2.2 · p. 53
Loading 2609.28756v1…