arXiv:2610.31594cs.LGOct 2026

Manuscript Offprint

arXiv:2610.31594

CRANE: Post-Hoc Counterfactual Retrieval for Multimodal Classifiers

Franco Rugolon, Ioanna Miliou, Panagiotis Papapetrou

1 st^{st} Franco Rugolon

Dept. of Computer and Systems Sciences Dept. of Computer and Systems Sciences Dept. of Computer and Systems Sciences

Stockholm University

Stockholm, Sweden

franco.rugolon@dsv.su.se

2 nd^{nd} Ioanna Miliou

Stockholm University

Stockholm, Sweden

ioanna.miliou@dsv.su.se

3 rd^{rd} Panagiotis Papapetrou

Stockholm University

Stockholm, Sweden

panagiotis@dsv.su.se

Abstract—Counterfactual explanation methods have been introduced for unimodal settings, with dedicated frameworks for tabular, timeseries, text, and image data, yet no post-hoc method has been designed for classifiers that learn from multimodal inputs. Existing explainability methods for multimodal classifiers apply modality-specific attribution independently to each input, which fails to yield coherent explanations and does not transfer to arbitrary pre-trained multimodal architectures. To address these shortcomings, we present CRANE (Counterfactual Retrieval via Agnostic Nearest-neighbour Explanations), the first post-hoc, model-agnostic framework for nearest-neighbour multimodal counterfactual generation that retrieves real training examples from the target class as candidate explanations, ensuring plausibility by construction. Across four heterogeneous datasets and three fusion strategies, we show that Multimodal Consensus Retrieval (MC-R), which intersects per-modality neighbour sets to identify instances jointly close to the query in every modality, emerges as the strongest multimodal strategy, achieving the best or joint-best outcome on three of four datasets while grounding every explanation in the joint training distribution. Unimodal strategies remain competitive when a single modality dominates the decision boundary.

Index Terms—Explainable artificial intelligence, Counterfactual explanations, Multimodal learning, Post-hoc explanation

I. INTRODUCTION

Data science pipelines increasingly operate on heterogeneous inputs, combining structured records, free text, time-series, and images within a single predictive model. Clinical decision support systems fuse vital signs with structured patient demographics to predict outcomes, such as sepsis mortality [1] and cancer metastasis [2]–[4]; content-moderation systems pair images and their captions to detect hateful memes [5]; and fraud detectors combine free-text job postings with structured posting metadata to flag deceptive listings [6]. As these multimodal architectures become standard practice, the need to explain their predictions grows. This need has driven a substantial body of work on explainable Artificial Intelligence (XAI) [7], [8].

Counterfactual explanations are among the most natural and actionable forms of post-hoc justification: a counterfactual x' reconfigures a sample x so as to flip its prediction while staying close to x and consistent with the data manifold. Falling within the example-based XAI methods, they answer the intuitive, often directly actionable question “what would need to change in x for the model to decide otherwise?”.

Figure

Fig. 1. Independently generated per-modality counterfactuals can produce a chimeric explanation whose static features and timeseries trajectories are incoherent. Arrows denote rising (↑) or falling (↓) biomarkers.

Well-performing counterfactual generators exist for individual modalities: tabular [9], [10], timeseries [11], [12], text [13], and image [14]. These generators, however, assume a single, homogeneous input space. When a classifier consumes several modalities at once, applying these generators independently per modality fails to yield coherent explanations, as illustrated in Fig. 1. For a multimodal mortality classifier over static demographics and laboratory timeseries, a tabular counterfactual generator may return a female survivor of the same age, while a timeseries generator may return signals that reflect decreasing N-terminal pro-B-type natriuretic peptide (NT-proBNP), a cardiac stress marker, but might not change the increasing trend in Prostate Specific Antigen (PSA), which is a clinical impossibility, as biological females do not produce PSA. This process would result in a chimeric counterfactual that would be locally plausible within each modality, yet globally incoherent and clinically meaningless when considered as a whole.

Retrieval-based methods avoid this problem by construction: rather than synthesising a new sample, they return a real training example from the target class. The nearest-unlike-neighbour (NUN) literature exploits this in unimodal settings [11], [12], [15], but it has not been extended to the multimodal case.

In addition, when using a retrieval-based approach, different choices regarding the search space itself deserve consideration. One could search within a single modality’s feature space, concatenate all modality embeddings and search jointly, or search in the multimodal model's latent representation. Each choice encodes a different notion of similarity, and how their relative merits compare in terms of the standard counterfactual quality objectives (prediction-flip rate, proximity, sparsity, and plausibility) [16], and of the diversity of the generated set [10] remains to be explored.

We address these open questions with CRANE (Counterfactual Retrieval via Agnostic Nearest-neighbour Explanations), a post-hoc, model-agnostic framework for nearest-neighbour counterfactual generation for multimodal classifiers. CRANE 1^{1} supports arbitrary combinations of tabular, timeseries, text, and image modalities through retrieval strategies spanning from unimodal search to multimodal fusion, and extends the standard counterfactual quality objectives (i.e., outcome, proximity, sparsity, and plausibility) to heterogeneous input spaces. Among the different strategies, Multimodal Consensus Retrieval (MC-R), which retrieves training instances jointly close to the query in each modality, emerges as the strongest multimodal strategy in four datasets spanning social media, recruitment, content moderation, and clinical prediction, while unimodal retrieval remains competitive when a single modality dominates the decision boundary.

References (26)