Introduction
In unsupervised learning, identifying meaningful structure in complex datasets is often hindered by "nuisance" variation—shared patterns like sensor noise, age, or sex that obscure the specific signal of interest. While deterministic methods like contrastive PCA (cPCA) attempt to address this by comparing target and background datasets, they are often sensitive to outliers and struggle with missing values.
This paper introduces Contrastive Latent Variable Models (cLVMs), a probabilistic framework that formally decomposes data into shared and target-specific latent spaces. By filtering out background noise, cLVMs isolate patterns unique to a "target" dataset. This approach naturally handles missing data and high-dimensional feature selection, while extending into deep learning via the Contrastive Variational Autoencoder (cVAE).
Methodology
The cLVM framework models target data $x_i$ as a combination of shared structure $S$ and target-specific structure $W$: $x_i = S z_i + W t_i + \mu_x + \epsilon_i$
Background data $y_j$ is modeled using only the shared component: $y_j = S z_j + \mu_y + \epsilon_j$
By performing inference on this generative model, the latent variable $t_i$ provides a "cleaned" representation of the target data. This probabilistic formulation offers several key advantages:
- Robustness: Replacing Gaussian distributions with Student’s t-distributions prevents outliers from skewing results.
- Automatic Relevance: Using Automatic Relevance Determination (ARD) priors allows the model to automatically determine the complexity of the latent space by "shutting off" unnecessary dimensions.
- Missing Data Handling: Missing values are treated as latent variables to be marginalized, avoiding the need for ad-hoc imputation.
- Non-linearity: The framework extends to deep learning via the cVAE, which uses neural networks to handle complex data like images.
Experimental Results
The authors validated cLVMs across diverse domains, including proteomics, genomics, and mobile health (mHealth).
Subgroup Discovery and Missing Data
On a mice protein expression dataset, cLVM demonstrated significant robustness compared to cPCA. As illustrated in Figure 1, the proposed method maintains clear separation between biological subgroups even when 75% of the data is missing, a scenario where cPCA fails to provide meaningful structure.
Feature Selection and Model Selection
In the mHealth task, which involved 23 measurements of motion and vital signs, Sparse cLVM was used to distinguish between activities like cycling and squatting. The model utilized ARD to automatically select the number of relevant latent dimensions (Figure 2b). Furthermore, the model performed automatic feature selection; as shown in Figure 2d, it correctly identified that magnetometer readings (Mag) were irrelevant for distinguishing these activities, setting their corresponding weights to zero.
Image De-noising
Using the cVAE on a synthetic dataset of MNIST digits overlaid on ImageNet textures, the model successfully disentangled the "digit" signal from the "background" texture. This allowed for unsupervised de-noising by generating samples exclusively from the target-specific latent space, effectively producing clean digits from noisy inputs.
Discussion
cLVMs provide a flexible, probabilistic alternative to deterministic contrastive methods. While the use of Variational Inference for the cVAE increases computational cost, the benefits in robustness, missing data handling, and automatic parameter tuning are substantial. Future work includes applying this framework to longitudinal data and exploring ways to incorporate partially paired datasets to further improve performance.
Summary updated