[Paper Review] Revisiting Classifier Two-Sample Tests
This paper introduces Classifier Two-Sample Tests (C2ST), a novel method that repurposes binary classifiers as two-sample hypothesis tests by training them to distinguish between two data samples. By measuring classification accuracy on a held-out set, C2ST provides interpretable test statistics, simple asymptotic distributions, and built-in interpretability through feature importance and uncertainty, achieving state-of-the-art performance in evaluating generative models and enabling new applications like causal discovery with GANs.
The goal of two-sample tests is to assess whether two samples, $S_P \sim P^n$ and $S_Q \sim Q^m$, are drawn from the same distribution. Perhaps intriguingly, one relatively unexplored method to build two-sample tests is the use of binary classifiers. In particular, construct a dataset by pairing the $n$ examples in $S_P$ with a positive label, and by pairing the $m$ examples in $S_Q$ with a negative label. If the null hypothesis "$P = Q$" is true, then the classification accuracy of a binary classifier on a held-out subset of this dataset should remain near chance-level. As we will show, such Classifier Two-Sample Tests (C2ST) learn a suitable representation of the data on the fly, return test statistics in interpretable units, have a simple null distribution, and their predictive uncertainty allow to interpret where $P$ and $Q$ differ. The goal of this paper is to establish the properties, performance, and uses of C2ST. First, we analyze their main theoretical properties. Second, we compare their performance against a variety of state-of-the-art alternatives. Third, we propose their use to evaluate the sample quality of generative models with intractable likelihoods, such as Generative Adversarial Networks (GANs). Fourth, we showcase the novel application of GANs together with C2ST for causal discovery.
Motivation & Objective
- To establish the theoretical and practical properties of Classifier Two-Sample Tests (C2ST) as a robust alternative to traditional two-sample tests.
- To evaluate C2ST's performance against state-of-the-art methods on synthetic and real-world data, including complex, high-dimensional distributions.
- To propose C2ST as a method for assessing sample quality in generative models with intractable likelihoods, such as GANs.
- To introduce a novel application of C2ST combined with Conditional GANs (CGANs) for cause-effect discovery in causal inference.
Proposed method
- Construct a binary classification dataset by labeling n samples from distribution P as positive and m samples from Q as negative.
- Train a binary classifier on this combined dataset and evaluate its accuracy on a held-out test set to form the test statistic.
- Use the classifier's accuracy as a test statistic: under H0 (P = Q), accuracy should be near chance level (~50% for balanced classes).
- Leverage the classifier's learned features and predictive uncertainty to interpret where distributions P and Q differ.
- Apply C2ST to evaluate GAN-generated samples by comparing them to real data via the test statistic.
- Use CGANs to model both causal directions (X→Y and Y→X), then apply C2ST to select the simpler, more plausible causal direction based on lower test statistics.
Experimental results
Research questions
- RQ1Can a binary classifier be effectively repurposed as a two-sample test with favorable theoretical and practical properties?
- RQ2How does C2ST compare in power and interpretability to existing two-sample tests like MMD, HSIC, and IGCI?
- RQ3Can C2ST be used to evaluate the sample quality of GANs, especially when likelihoods are intractable?
- RQ4Can C2ST combined with CGANs enable robust cause-effect discovery without assuming additive noise?
Key findings
- C2ST achieves state-of-the-art performance in two-sample testing, outperforming methods like ANM-HSIC, IGCI, and RCC on the Tübingen cause-effect pairs dataset.
- On the Tübingen dataset, the Ensemble-CGAN-C2ST method achieved 82% accuracy in cause-effect discovery, surpassing RCC (76%) and ANM-HSIC (67%).
- C2ST provides interpretable insights into distributional differences through feature importance and predictive uncertainty, enabling analysis of where P and Q diverge.
- The method demonstrates strong power and robustness, with a simple asymptotic null distribution and low type-I error rates under the null hypothesis.
- C2ST enables effective evaluation of GANs without requiring likelihood computation, making it ideal for models like GANs with intractable likelihoods.
- The combination of CGANs and C2ST enables a novel, non-parametric approach to causal discovery that avoids restrictive additive noise assumptions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.