arXiv:2608.23164cs.LGAug 2026

Manuscript Offprint

arXiv:2608.23164

Counterfactual Transition Graphs: Evaluating Cross-Class Transition Quality

Syed Muhammad Hamza Zaidi, Szymon Bobek, Grzegorz J. Nalepa, Myra Spiliopoulou

Syed Muhammad Hamza Zaidi 1^{1} (✉), Szymon Bobek 2^{2}, Grzegorz J. Nalepa 2,3^{2,3}, and Myra Spiliopoulou 1^{1}

1^{1} Otto-von-Guericke University Magdeburg, Magdeburg, Germany

syed.zaidi@ovgu.de

2^{2} Jagiellonian University, Krakow, Poland

3^{3} Center for Applied Intelligence Systems Research, School of ITE, Halmstad University, Halmstad 30118, Sweden

Abstract. Counterfactual (CF) explanations for time-series classifiers are usually evaluated one example at a time: what minimal edit flips this single window's prediction? We argue that the more informative question for diagnostic interpretability is structural: how does the classifier connect its own classes to each other?

We propose a counterfactual transition graph (CGT) in which each node is a class and each edge weight is the CF reliability of the transition from one prototype to another under a proximity aware retrieval sweep. On a six-class hand-movement task, we induce a CGT that reveals a non-trivial topology, which is not predicted by the binary confusion matrix: it shows that counterfactual reachability does not align with classifier accuracy and even runs counter to it (Spearman ρ=−0.37\rho = -0.37 over the 15 pairs), i.e. the boundaries the classifier separates most confidently are among those an in-distribution edit can least often cross.

Our framework is method agnostic, i.e. any CF-explainers can be used. Presently, we use it to juxtapose replacement-based CFs with gradient-based CFs; gradient-based methods reach almost any class by stepping off the data manifold, while replacement-based methods stay on it and fail on precisely the rigid boundaries.

Keywords: Counterfactual explanations · Time series classification · Temporal graph neural networks · Class topology · Explainable AI

1 Introduction

A counterfactual (CF) explanation asks a local question: what is the smallest change to an input that flips a classifier's prediction to a chosen class? [6]. The edit should keep the instance plausible, so a bird flipped from 'crested auklet' to 'red-faced cormorant' [5] still looks like a bird, and a hand-movement window edited toward another gesture still looks like real motion. Instead of studying one instance and its CF at a time, we ask a global question: what does the whole set of class-to-class edits reveal about the (im)plausibility of counterfactuals?

S. M. H. Zaidi et al.

Figure 1 shows a challenging case from our data: each subfigure shows the edits on the finger joints of a hand to reach the counterfactual (orange) from the original instance (blue). We explain Figure 1 later. For now, we would like to point to the two rightmost subfigures: while the lower one depicts smooth movements, the upper one shows jumps that no human finger joint can perform.

Figure

Fig. 1: Transitions of a hand’s joints from the class Fingertip-Touch ( T2T_{2}) to the class Clothes-Peg ( T1T_{1}): each block shows four representative joints (original: blue, counterfactual: orange) and the class probabilities before and after the edit. The replacement-based generators (gacp, gacp_context) do not flip the prediction, while gacp_context produces physiologically implausible oscillations; the gradient-based generators (nepo, residual) flip the label with a small but off-manifold edit.

Inspired by this example, we formulate following research questions:

RQ1: How can we capture the (im)plausibility of a counterfactual?

RQ2: How can we link it to the (dis)similarity between the class of the instance and the class of the counterfactual?

RQ3: How can we validate counterfactual (im)plausibility in a controlled way?

For RQ1 and RQ2 we represent each class by a number of prototypes, defined as recordings chosen as the most typical instances of that class (Section 4), and we record for every class pair how reliably a prototype-anchored counterfactual carries one class to the other, aggregated over folds, prototype pairs and retrieval strategies. The resulting Counterfactual Transition Graph (CFTG) has one edge weight per pair. For RQ3, we work with predefined classes and study how the

(dis)similarity among the prototypes is reflected in counterfactual quality. We report on our results for a finger gestures dataset, where we found that the most strange counterfactuals are between classes separated with high confidence.

Our contributions are as follows. (1) We define the counterfactual transition graph, a class-level structure built by aggregating prototype-to-prototype counterfactuals under a prototype-anchored retrieval scheme that makes the aggregation well-posed (Section 4). (2) On a temporal graph classifier we show that counterfactual reachability does not track accuracy, and if anything the two run counter: the instances the classifier separates most confidently are among the hardest to reach by an in-distribution counterfactual (Section 6). (3) Because the construction is generator-agnostic, the same graph exposes method dependence: gradient-based and replacement-based generators disagree exactly where one of them edits the data manifold, which separates conclusions about the classifier from artefacts of the explainer (Section 6).

This study is grounded in the SenseGlove hand-movement use case, which we treat as a challenging reference setting. It combines multimodal joint readings, temporal dependencies, and several movement classes with different kinematic characteristics, making it suitable for studying whether counterfactual transitions reveal structure beyond single-instance explanations and classification accuracy. We therefore propose the CFTG as a general diagnostic idea, but evaluate it here as a solution motivated by this concrete use case; testing its transfer to other domains remains future work.

Our paper is designed as follows. In Section 2 we discuss related work. In Section 3 we present our materials: the SenseGlove hand-movement dataset, our temporal graph classifier for it, and the four counterfactual generators we use. Section 4 contains our approach: the prototypical class representation, the notion of class proximity, the per-pair transition operation, and their aggregation into the CFTG. In Section 5 we describe the experimental setup and in Section 6 our results. Section 7 closes the paper with summary and outlook.

References (20)