arXiv

Counterfactual Explanations for Deep Two-Sample Testing

Title: Generating Counterfactual Explanations for Deep Two-Sample Testing

Abstract: While two-sample testing serves as a cornerstone for identifying distributional shifts across various scientific fields, traditional methods—such as those relying on kernels—often struggle with high-dimensional, structured data like images. Although recent advancements in deep two-sample testing have enhanced sensitivity by leveraging learned representations, these approaches offer little visibility into the specific data features responsible for rejecting the null hypothesis $H_0$. To bridge this gap, we introduce a counterfactual explanation framework designed for deep two-sample testing. This approach produces sample-level modifications that shift observations from a source group toward a target group, while explicitly minimizing the discrepancy quantified by the test. By integrating a diffusion autoencoder with a pretrained deep two-sample test model, our method optimizes a maximum mean discrepancy (MMD) objective within the test model’s representation space to generate plausible counterfactuals. We assess the impact of these transformations on the distribution level by examining shifts in the test statistic and the associated two-sample p-values. Our evaluation spans synthetic 2D shape datasets and two distinct MRI cohorts. In both scenarios, the counterfactual transformations consistently result in higher p-values compared to the original samples, demonstrating that the edited source set aligns more closely with the target distribution according to the test. To guarantee that counterfactuals remain minimal and faithful to the original inputs, we utilize LPIPS for measurement. Ultimately, these edits yield interpretable evidence highlighting the features linked to the observed group disparities. Notably, in the MRI analysis, the localized modifications align with established anatomical distinctions between the cohorts.


Source: arXiv Generated at: 2026-06-04 00:00:00 UTC

Related Articles

Who is Elon Musk and what is his net worth?
BBC News

Who is Elon Musk and what is his net worth?

Elon Musk, CEO of Tesla and SpaceX, became the first person to surpass a $500 billion net worth in October 2025. His wea...

AI Bubble 'Something to Look At,' BNP's Huynh Says (Video)
Bloomberg

AI Bubble 'Something to Look At,' BNP's Huynh Says (Video)

BNP Paribas’ Huynh describes the AI bubble as “something to look at,” signaling cautious interest in the sector’s potent...

Goldman Sachs CEO David Solomon on Running a Bank in the Age of AI | Odd Lots
Bloomberg

Goldman Sachs CEO David Solomon on Running a Bank in the Age of AI | Odd Lots

Goldman Sachs CEO David Solomon discusses integrating AI into banking operations. He explores how artificial intelligenc...

AI Concentration Risk Is the Problem: 3-Minutes MLIV
Bloomberg

AI Concentration Risk Is the Problem: 3-Minutes MLIV

The article argues that AI concentration risk, rather than the technology itself, is the primary concern. It highlights ...

Reuters

Foxconn announces strategic collaboration with Intel on next-gen AI infrastructure

Foxconn and Intel announced a strategic partnership to develop next-generation AI infrastructure. This collaboration aim...

SpaceX Seeks to Raise $75 Billion in Record IPO (Video)
Bloomberg

SpaceX Seeks to Raise $75 Billion in Record IPO (Video)

SpaceX aims for a record $75 billion valuation through an initial public offering. This historic IPO marks a significant...