Overview
Contrastive dimension reduction (CDR) is a powerful technique designed to isolate patterns unique to a target dataset (such as a treatment group) when compared to a background dataset (such as a control group). Historically, researchers have had to rely on guesswork to determine if unique patterns actually exist and how many dimensions they span. This paper addresses these fundamental gaps by introducing a statistical hypothesis test to confirm the presence of unique information, alongside a Contrastive Dimension Estimator (CDE) to calculate exactly how many dimensions should be used.
The Problem with Standard Dimension Reduction
Standard dimension reduction (DR) techniques, like PCA or UMAP, excel at finding general patterns within a single dataset. However, in many scientific fields, data naturally occurs in pairs: a foreground group (e.g., mice given a new drug, or patients with a disease) and a background group (e.g., healthy control mice).
To isolate the specific effects of the drug or disease, researchers use Contrastive DR (CDR) methods to find variations that exist only in the foreground. Despite the popularity of CDR, two massive blind spots have persisted in the field:
- When to use it: How can we statistically prove that the foreground actually contains unique information before we begin modeling?
- How to use it: CDR algorithms require the number of unique dimensions (the "contrastive dimension") as an input hyperparameter. Currently, researchers rely on trial-and-error or educated guesses.
This paper provides a rigorous mathematical framework to answer both questions, eliminating the guesswork from contrastive analysis.
Methodology
The authors model the foreground and background data as lying on low-dimensional linear subspaces. They define the "contrastive subspace" as the portion of the foreground space that is completely orthogonal (perpendicular) to the background space.
To operationalize this, they introduce two main tools based on the concept of principal angles—a metric used to measure the geometric "difference" or overlap between two subspaces:
- Contrastive Bootstrap Hypothesis Test: A resampling-based test designed to evaluate the null hypothesis that the foreground space is entirely contained within the background space ($d_{xy} = 0$). A low p-value confirms the presence of unique foreground information.
- Contrastive Dimension Estimator (CDE): An algorithm that calculates the sample covariance matrices of both groups, extracts their top eigenvectors, and computes the singular values of their inner product. Singular values close to 1 indicate overlapping spaces, while singular values below a certain threshold (e.g., 0.9) indicate directions unique to the foreground. The algorithm counts these unique directions to output the contrastive dimension ($d_{xy}$).
The authors provide robust theoretical backing, proving that their CDE is mathematically consistent and establishing finite-sample error bounds.
Datasets and Experimental Setup
The authors evaluated their methods across a diverse array of simulated, semi-synthetic, and real-world datasets:
- Simulations & Semi-Synthetic Images: Purely synthetic matrices and modified images. For example, drawing a white line on an image of a disk to create a foreground signal, and adding grassy noise to create background/foreground splits.
- Corrupted MNIST: Handwritten digits superimposed on grassy backgrounds (foreground) versus just grass (background).
- Biomedical Data: Mouse protein expression (Down syndrome/shock therapy studies), single-cell RNA sequencing of leukemia patients pre/post-transplant, and various pathogen and perturbation datasets.
- Sensor/Image Data: Wearable sensor data for physical activities (mHealth) and celebrity faces with or without specific attributes (CelebA).
Key Insights and Results
- Formalizing the "Contrastive Subspace": Historically, CDR methods simply tried to maximize foreground variance while minimizing background variance. This paper rigorously defines the contrastive dimension as the projection of the foreground onto the orthogonal complement of the background, providing a concrete mathematical target.
- Flawless Synthetic Performance: In simulations where the true contrastive dimension was known (e.g., adding a single varying line to an MNIST digit, making $d_{xy} = 1$), the CDE perfectly estimated the dimension as 1.
- Alignment with Empirical Science: On the mHealth wearable sensor dataset, the CDE estimated $d_{xy}=1$. This perfectly matches previous empirical studies, which found that a single principal component was sufficient to separate foreground activities (like squatting vs. cycling).
- Downstream Task Improvement: The authors ran Contrastive PCA on the Corrupted MNIST dataset using their estimated dimension of $d=5$. This yielded a 94.5% classification accuracy, proving that the CDE successfully finds the "sweet spot" for downstream machine learning tasks without manual tuning.
Limitations and Future Work
While highly effective, the proposed methods have a few limitations that pave the way for future research:
- Conservative Hypothesis Test: The bootstrap hypothesis test is quite conservative. It has a very low false-positive rate but might miss subtle unique signals, resulting in high p-values even when unique information exists.
- Linearity Assumption: The method assumes the data lies on linear subspaces. If the data lives on a highly non-linear manifold, linear principal angles might not capture the true contrastive dimension. Future work will explore non-parametric and non-linear extensions.
- Dependency on Intrinsic Dimension: The CDE requires the user to first estimate the overall intrinsic dimensions of the individual foreground and background datasets using existing third-party tools, which can sometimes be sensitive or difficult to tune.
Summary updated