CXAD: Contrastive Explanations for Anomaly Detection: Algorithms, Complexity Results and Experiments
Authors: Ian Davidson
Nicolás Kennedy
S. S. Ravi
Venue: Accepted by TMLR ()

Abstract: Anomaly/Outlier detection (AD/OD) is often used in controversial applications to detect unusual behavior which is then further investigated or policed. This means an explanation of why something was predicted as an anomaly is desirable not only for individuals but also for the general population and policy-makers. However, existing explainable AI (XAI) methods are not well suited for Explainable Anomaly detection (XAD). In particular, most XAI methods provide instance-level explanations, whereas a model/global-level explanation is desirable for a complete understanding of the definition of normality or abnormality used by an AD algorithm. Further, existing XAI methods try to explain an algorithm’s behavior by finding an explanation of why an instance belongs to a category. However, by definition, anomalies/outliers are chosen because they are different from the normal instances. We propose a new style of model agnostic explanation, called contrastive explanation, that is designed specifically for AD algorithms. It addresses the novel challenge of providing a model-agnostic and global-level explanation by finding contrasts between the outlier group of instances and the normal group. We propose three formulations: (i) Contrastive Explanation, (ii) Strongly Contrastive Explanation, and (iii) Multiple Strong Contrastive Explanations. The last formulation is specifically for the case where a given dataset is believed to have many types of anomalies. For the first two formulations, we show the underlying problem is in the computational class P by presenting linear and polynomial time exact algorithms. We show that the last formulation is computationally intractable, and we use an integer linear program for that version to generate experimental results. We demonstrate our work on several data sets such as the CelebA image data set, the HateXplain language data set, and the COMPAS dataset on fairness. These data sets are chosen as their ground truth explanations are clear or well-known.

Published in Transactions on Machine Learning Research (06/2025)
CXAD: Contrastive Explanations for Anomaly Detection: Algorithms, Complexity Results and Experiments
Ian Davidson
indavidson@huadaviisell
Deportment of Computer Science University of California Dovis
Nicolás Kennedy
rbkeemedyy@hrdtavii.co edu
Department of Computer Science University of Colifornia Dovis
S. S. Ravi
ssraei0@@gaail.cmm
Biocomplerity Institute University of Verginia and Department of Computer Science University at Albany SUNY
Reviewed on OpenReview: hillp:/ openreoicw..ell forum id= Tnwnc22nnnnnnneeiinn sorl- date- desc
Abstract
Anomaly/Outlier detection (AD/OD) is often used in controversial applications to detect unusual behavior which is then further investigated policed. This means an explanation of why something was predicted as an anomaly is desirable not only for individuals but also for the general population and policy-makers However, existing explainable AI (XAI) methods are not well suited for Explainable Anomaly detection (XAD). In particular, most XAI methods provide instance-level explanations, whereas model/global globaallveell explanation desirable for a complete understanding of the definition normality or abnormality used by an AD algorithm. Further, existing XAI methods try to explain an algorithm's behavior by finding an explanation of why an instance belongs a category. However, by definition, anomalies coatnallie/ouulierrr /outliers are chosen because they are different from the normal instances. We propose new style of model agnostic explanation, called contrastive explanation, that is designed specifically for AD algorithms which use semanttcc tags to create explanations. It addresses the novel challenge of providing a model-agnostic and global-level explanation by finding contrasts between the outlier group of instances and the normal group. We propose (i) Contrastive Explanation, (ii) Strongly Contrastive Explanation, and (iii) Multiple Strong Contrastive Explanations. The last formulation specifically for the case where a given dataset is believed to have many types of anomalies. For the show the underlying problem is in the computational class P by
three formulations:
first two formulations, presenting linear and polynomial time exact algorithms. We show that the last formulation is computationally intractable, and we use an integer linear program for that version to generate experimental results. We demonstrate our work on several data, sets such as the CelebA image data set, the HatcXplain language data set, and the COMPAS datasct on fairness. These data sets are chosen as their ground truth explanations are clear or well-known.
1 Introduction
Anomaly detection (AD) involves identifying unusual instances a datasct. It is central part of artificial intelligence (AI) and perhaps the most controversial given that it is employed in high-impact applications that
We the anomaly and outlier interchangeably though there nuanced differences.

---

Published in Transactions on Machine Learning Research (06/2025)
typically require intervention, policing, and investigation. For example, it is used in social networks (Savage et al. 2014) to identify fake accounts and hate speech, by financial companies to identify fraudulent credit card transactions (Ahmed et al.) 2016) and by the government to identify fraudulent benefit claims (van Capelleveen et al.) 2016). Being typically unsupervised, the need for explanation is even more necessary than for supervised learning for a multitude of reasons including fairness (e.g., is a certain ethnic group being excluded from social networks?), transparency to the individual (e.g., why were certain credit card transactions declined?) and elucidation to policymakers (e.g., how are people committing fraudulent benefit. claims?).
Previous XAI Work and its Limitations. Though Explainable AI (XAI) (sec e.g., Adadi & Berrada
(2018); Proc. XAI-2017 Workshop Proc. XA1-2018 Workshop Gunning (0177) ; Dosilovic et al. (2018);
Zhang & Chen (0188]; Ming (2017): Zheng et al. (2018)) methods have made tremendous strides, they are
not particularly suitable for Explainable Anomaly Detection (XAD) for several reasons we now describe.
Existing two-class XAI methods for supervised learning such as LIME (Bodria et al., 2023) identify which parts of an instance are responsible for its classification ("Why did you do that?"). That is, these are inclusive and Instance-evve explanations that state what properties an instance has to belong to class. However,
these styles of explanations are not entircly suitable for AD as a definition of an anomaly is that it deviates from the population; hence, this requires the normal (non-outlier) points to be part of the explanatory mechanism. Thus, our focus is on contrastive explanations that differentiate anomalies form normal instances and vere-versa.
Further, a natural higher-level question for policy designers and the general public is: how does an algorithm define normality and anomalousness? As model-level explanations in terms of the feature space are challenging for deep learners and are data modality-specific, we formulate model agnostic approach using human interpretable tags. These tags can be created by humans or automatically for a variety of sources as shown in Table [ Our method can also be employed when the features used to carry out AD are interpretable as the features can also serve as the tags; we demonstrate this in our experiments on the COMPAS data set. Model/gl /global style explanations are not well studied for supervised or unsupervised learning, for example there just a few papers for clustering (Davidson et al.) 2018 [Sanbaturu et al. 2020). However, these works are not suitable for XAD as they generate explanations in terms of the properties of the instances within each dclsstc and we wish to understand better why the group of outliers is identified in terms of not only what they share in common with each other, but also what they do not share in common with the normal points. The work on XAD is relatively new but an excellent survey article recently was published (Li ct al. 2024). We compare our work with existing XAD work in Section 6 after we present our methods and experimental results.
Contributions.
We tackle the understudied problem of XAD which requires different style of explanation compared to existing XAI methods in classification and clustering. We study XAD using a contrastive mechanism
which is consistent with how humans explain to cach other (Miller 2021 ) see the discussion in Section 6
("Related XAD Work").
We formulate a model agnostic contrastive form of goade//global-eeelll XAD through a variety of optimization problems by interpreting them as computations on an appropriate bipartite graph. By drawing connections to the literature in theoretical computer science, we show that XAD can be viewed as a Knapsack style problem. Model agnosticism is particularly important for XAD there are many popular but different. styles of algorithms such as those that measure properties rather than optimizing function.
We show that for two of our formulations, polynomial time exact algorithms (including a simple to implement dynamic programming a algorithm) can be developed allowing them to scale to very large data sets. For more complex multi-pare explanations, we prove that the corresponding problem is NP-hard but construct an integer linear program (ILP) that is readily solvable with large-scale solvers such as Gurobi. Finally, we demonstrate the effectiveness of our methods on multiple modalities of data where ground truth explanations are known to exist: Images (Celebrity A Faces), Text (HateXPlain). and Databases (COMPAS for Fairness).
2

---

Published in Transactions on Machine Learning Research (06/2025)
Organization. We begin with overview of our method and then formalize our problem definitions. Next, present efficient algorithus for the first two formulations and complexity result for the third. Finally, we discuss our experimental results and related work. We close with a summary and some concluding remarks.
2 Overview of Our Approach
Core Idea for Constrastive Explanation. We can explain our contrastive explanation approach by visualizing a bipartite graph but with three types of nodes shown in Figure [ outlier nodes representing outlier instances, normal nodes representing inlicrs and tag nodes, cach representing semantic property. Note this is not strictly a tri-partite graph as there can be no edges between the nodes representing the outlier (left) and normal (right) instances. Instead, outlier and normal instance nodes can only have edges to the tag nodes. For example, normal and outlier nodes for facial image data are connected to only to the tags describing the image (e.g., race, hair color, gender). As mentioned in the introduction, the tags can part of the features used to perform anomaly detection as we have done our experiments with the COMPAS (fairness) database.
Vo
VT
VN
0
Tag 1
N
0
Tag 2
N₂
O3
Tag 3
N3
04
Tag 4
N
Edge set
Edge set EN
Eo
Figure 1: The underlying graph on which computations are performed to find explanations. Node sets Vo, Vn and VT denote the sets of outliers, normal instances and the set of all tags respectively. An edge between a tag and an instance indicates that the instance has that tag. The symbols Es and Eg represent respectively the set of edges between outliers and lags and that between the normal instances and lags. Note that solutions to our problem formulations
more subsets (denoted by Y) of V1.
The underlying computation is to choose a subset of tags that together form an ioolanation/oovereee for many outliers but not explain/cove the normal points. This is so as create contrastive explanation. Explanation quality can be measured in several ways and choose measurement. based the number of edges it can give rise to efficient computations. Computations based coverage typically computationally intractable as they can model versions of the minimum set cover problem; see (Garcy & Johnson 1979 for a definition of this problem.
The outlier and normal instances can be switched and the computation repeated to generate an explanation for normal points; for the remainder of this scction, we focus on explaining outliers for simplicity. We formalize these styles of computation by borrowing analogies from packing problems in theoretical computer science. We present informal definitions and formulations below to provide an overview of our approach. Formal definitions and precise problem formulations appear in Section 3
Definition 2.1. Profit and Weight of Tags. Each tag considered an item to pack into an outlier explanation and its profit is determined by the number of edges incident from the oullier instances,
3

---

Published in Transactions on Machine Learning Research (06/2025)
whilst its weight is determined by the edges incident on it from the normal instances. (As mentioned earlier, we con switch the role of the outlier and normal instances to get an explanation for normal instances.)
For example, in Figure 1 Tag 1 has a profit of 3 and weight of O and would be a good tag to describe outliers, where as Tag2 (profit of 0 and weight 3) would not.
In our first formulation, we wish to choose a subset of tags to maximize the mumber of edges covered by these tags for outlier points less the number of edges covered by normal points. (In Section 3 we will formally define this difference as the utility of the subset of tags.) That is, the objective of this formulation is to optimize profit minus weight. Each tag then naturally has a measure of utility which is simply the number of tags incident on the outlier points less the number of tags incident on the normal points. In Figure [ to explain the outlier instances shown, one would choose the subset (Tag 1, 3) of tags as all other tags have a non-positive utility when explaining the outlier set. This idea leads to a simple linear time algorithm and we also consider a variation that maximizes the utility under a budget constraint on the number of tags chosen for the explanation. Formally, using the terminology in Figure [ our first formulation is as follows. Let Eý and EN be the subset of edges incident on the outlier and normal instances (respectively) when Y is the chosen subset of lags for the explanation.
Formulation #1: Contrastive Explanation. Here we select a subset of tags to optimize the quantity profit- - weight: argmaxygu FX - EM I. A variant will explore limiting the explanation complexity to k tags. We formalize these Description of Maximum Utility (DMU) and Budgeted Description of Maximum Utility (BDMU) problems in Section 3.2 and develop an exact linear time algorithm for them (see Algorithm and Theorem 4.1
The explanation provided by the above formulation for the problem in Figure is {Tag 1, Tag 3} which does explain the outlier points, but it is not strongly contrastive as it explains several normal points as well. In some cireumstances we wish to generate strongly contrastive explanations. Our second formulation addresses this by extending our packing analogy to the Knapsack problem (Garcy & Johnson| 1979) with the knapsack of chosen lags representing the tags that are most explanatory. This allows us choose a subset of tags to maximize profit (i.e., the number of edges incident on outlier points) whilst upper bounding (8) the weight (i.e., the number of edges incident the most contrastive tags between the two groups. In Figure | to explain the outlier instances with B = 1, one would choose just Tag1. 1. In general, the Knapsack problem is computationally intractable (Garey & Johnson 1979h. However, the version of Knapsack arising in the context of contrastive explanation involves numbers whose values are bounded by polynomial functions of the problem size. This restriction lcads to an efficient exact algorithm for the explanation problem through dynamic programming. Formally, our second formulation is as follows.
normal points). This effectively changes the computation to choosing
Formulation #2: Strongly Contrastive Explanation. Here we select tags to maximize utility whilst upper bounding weight: argmaxyçu |Eğ| s.t. |E B. In Section 3.2 we formalize this as a the Description of Maximum Profit under a Weight Constraint (DMP-WC) problem, which is a Knapsack problem where the items are tags and the profit is the number of edges incident on O and the weight is the number of edges incident on N. We present an exact dynamic programming-bant based polynomial time algorithm for this problem (see Algorithm 2 and Theorem 4.2).
Finally, our third formulation removes the limitation of generating just one explanation; instead, it allows many explanations by formulating the problem as a multi-knapsack problem, with each knapsack being an explanation. This naturally allows not only the generation of more complex (multi-cause) explanations but also allows addressing challenging settings. One such setting we shall study is to compare different OD algorithms understand how they are different from each other in terms of results. Though the problem resulting from this formulation is NP-hard as we shall prove, it serves the purposes of exploring complex explanations. A definition of this formulation is follows.
Formulation #3: Multiple Strongly Contrastive Explanations.
Here we extend the we allow multiple knap-
previous formulation, but rather than just one cxplanation/Knapsaa sacks: argmaxy,gu..... Yu E s.t. EX S 3, S i S a and ny,, = 9, Vi.j i # j. The previous formulations assume one explanation for all instances in group. However, as there may be different.
4

---

Published in Transactions on Machine Learning Research (06/2025)
types of outliers, we formulate multi-knapsack version. We call this version the Multiple Descriptions of Maximum Profit Under Weight Constraint (MDMP-WC) problem in Section 3.2 and show that it is
computationally intractable; see Theorem 4.3 For our experiments, we use an integer linear program (ILP) to obtain an exact solution to this version.
Typical Instances
[
3
4
5 1
8
9
Typical Outlier Instances
0
\
2
3
4
5
7
8
9
Explanation - Formulation #1
Explanation Formulation
Figure An illustrative application of our first two formulations to explain the outliers in the MNIST dataset. For each of the ten digit classes created separate outlier detection problem (shown columns) using a basic autoencoder. For each outlier detection problem, we show typical normal and outlier instance and the explanations found by our first two methods. Our first formulation finds all contrastive pixcls which occur more oflen in the outlier group than in the normal group. Our second formulations finds the most. contrastive pixels.
Illustrative Example Using MNIST. We provide an illustrative example of the first two formulations on the MNIST digit data set. For each of the ten digits, created different outlier detection problem and generated explanation for each. In this data set, the tags are the pixels of the digits themselves; hence, we are explaining outliers using the features. Our third explanatory approach is for more complex explanations which do not occur in this simple data set. We apply a basic auto-encoder to determine outliers based on their reconstruction error for each digit class soparately. We then apply our method scparately to the top 5% most anomalous instances for each digit type. The remaining digit's instances are deemed normal which means some instances deemed normal are still quite unusual. Some typical normal points are shown in the first row of Figure 2 and typical outliers are in the second row. A brief description of the explanations found by our formulations are provided in the caption of Figure]
Tag Generation, Assumptions and Limitations. Our three formulations represent successive relaxations in that they naturally trade-off explaining all instances with explanation complexity. As such, they do not have any strong assumptions beyond requiring tags that are typically representative of the instances. A legitimate question is how to determine if this assumption violated and more generally measure explanation quality. Contrastive explanation can naturally identify the tags are not corrclated well with the outcomes of an AD algorithm; that is, there does not exist strongly contrastive explanation. For example, in Table 2 (Section 5]. if the two percentages reported for each tag found in the explanation were approximately the same (or not significantly different), that would indicate non-constrastive (and poor) explanation. Our method requires the existence of tags which could of course be generated by humans, however, Table D indicates other automated sources of tags.
Finally, we note that like just about all XAI methods (to our knowlodge), our method does not explain the thought process of the deep learner, topic known as meta-cognition in the cognitive science literature LLai 2011) which is gaining attention in AT (Walker et al. 2025 Caro al. 2014).

---

Published in Transactions on Machine Learning Research (06/2025)
Table 1: Some sources of tags for different instance modalities.
Modality
Tag Creation Methods
People Images
Commercial software such as Google Photos can tag images with the names of people within them. The associated files can be downloaded for analysis. For example, EXIF files list the Tags/ Dalss/DaeeTinnn Trmeiiinal used in Google Photos and IPTC files list the Tags/ (Caption-Abbtraae used for the Description in Google Photos.
Objects in Images
Many image laggers exist (e.g., blip2, kohya, wd14-swinv2-22) Further, there are tag editors. The creation of StableDiffusion methods for auto-captioning of images also provides methods to generate tags.
Emails, articles,
LLMs in principle have allowed the possibility of (agging documents with keywords but the concern was how useful these tags would be for specific domains. However, recent work has shown how take general LLMs and make them task specific laggers of documents, emails elc. (Shen et al. 2024).
documents
Graphs
The ability tag social network users has been in practice for well over a decade and much meta-data on users is available (Gupta et al. 2010).
3
Formal Problem Definitions
Here, we provide more rigorous versions of our previous problem formulations. The rigorous definitions enable us to develop efficiont algorithms for some versions and prove computational intractability results for other versions.
3.1 Basic Definitions
We assume that the dataset S has been partitioned into two blocks, namely the normal set N and the outlier set O. We are also given (finite) universal lag set U. For each instance 8; S, we have an associated subset
T C U of tags. Fach tag 7 Tū is considered explanation of instance 8;; formally, we say that each tag T; covers the instance 84.
To formulate problems and develop algorithmic results, we use an undirected bipartite graph G(Vs+o. Vr, E) to represent the instances, tags and the covering relationship between the tags and instances. The node set Vs+0 of this graph consists two (disjoint) subsets, namely Vss and Vg, Each node in Vy represents normal instance while each node in Vo represents an outlier instance. Each node in V/ represents a tag. Each edge {a,y) of G, where represented by y. Even though G is bipartite graph, it will be convenient to visualize it using three pairwise disjoint node sets as in Figurel so that one can readily recognize the sets of normal and outlier instances covered by each tag.
VN+0 and y e VI, indicates that the instance represented by is covered by the tag
We partition the edge set E into two subsets, namely Eg and Eg. Here, Ey denotes the set of edges between V/ and 1/T while Eg denotes the set of edges between Vo and Vr. The bipartite graph G representation is sufficient for formulating our optimization problems and for developing our analytical results. So, we will refer the nodes in VN themselves as the normal instances, the ones in Vo as the outlier instances and those in Vr the tags.
For a subset Y V4 of tags, let N(Y) and O(Y) denote respectively the subset of Vs and Vo covered by Y. Thus, in the bipartite graph G, each node in N(Y) has an edge to at least one node in Y. For notational simplicity, when Y consists of a single node, say b, we will use N(b) and (b) (instead of N((b)) and (()))) For subset. of tags Y, let F. denote the set of edges between the nodes in Y and VN; further, let Ey denote the set of edges between the nodes in and Vg. Here again, when Y consists of single node b, we will use the simpler notation F and EB-
Optimization Objectives. For simplicity, our problem definitions assume that we are focusing on an explanation for the outlier points. These definitions can readily flipped to explain normal instances as we have done in our experiments. For any tag node y, the profit of y, denoted by p(y), is the number of outlier
6

---

Published in Transactions on Machine Learning Research (06/2025)
instances covered by y; that is, p(y) |0(v)) The weight of any tag y, denoted by w(y), is the number of normal instances covered by y; that is, w(y) = [N()]- For any tag node y, the utility of y, denoted by ply), is given by p(y) w(y); thus, the utility of a tag is the number of outlier instances covered by minus the number of normal instances covered by y. In our first set of formulations, it is desirable to choose tags with positive utility since each such lag explains more outlier instances than normal instances.
We can extend the definitions of utility, weight and profit to subsets of tags as follows, For any subset Y of tags, (i) the profit p(Y) is given by Eger ply), (ii) the weight w(Y) of Y is given by Σyer w(y), and (ifi) the utility paY) of Y is given by Σyer ply). The following simple observation relates these extensions to edge subsets of the graph G.
Observation 3.1. For any subset Y of tags, the following equations hold: (1) p(Y) -18 1. (8) w(Y) LEV and (tii) μ(Y)= E E
This observation is useful in pointing out that the rigorous specifications of the combinatorial problems presented bclow equivalent to the formulations mentioned in Section 2
3.2 Main Problem Formulations
We can now formally specify the optimization problems considered in this paper. Problems (a) and (b) formulated below correspond to versions of Formulation # in Section The problem names have been chosen to explicitly indicate the optimization objective.
(a) Description of Maximum Utility (DMU) and (b) Budgeted Description of Maximum Utility (BDMU)
Given: Bipartite graph G(VN+o, Vr, E) that represents normal instances, outlier instances, tags and the covering relationship between tags and instances.
Required: (a) For the DMU problem, the goal is to find a subset Y* of tags such that the utility ,(Y*) of Y is a maximum among all subsets of tags. (b) For the BDMU problem, the input also includes an integer budget k < [Vr], and the goal is to find a subset Y* C VT such that |Y*| < k and the utility p(Y*) of Y is a maximum among all subsets of tags of size at most k.
Using Observation 3.1 it is easy to see that the goal of the DMU problem is to find a subset Y* of tags to maximize the quantity 1 optimization goal of the BDMU problem is also the same that of DMU except that Y needs to satisfy an additional budget constraint, namely |Y k.
|FX This version was given Formulation #1 in Section 2 The
Our next problem corresponds to Formulation #2 of Section 2
(c) Description of Maximum Profit Under a Weight Constraint (DMP-WC)
Given: Bipartite graph G(VN+o, Vr, E) that represents normal instances, outlier instances, tags and the covering relationship between tags and instances; a positive integer W.
Required: A subset y* C Vr such that the weight w(Y") is at most W and the profit p(Y*) is a maximum among all subsets of tags satisfying the weight constraint.
Using Observation 3.1 it is seen that the goal of the DMP-WC problem is to find a subset Y of tags maximize the quantity By subject to the constraint |al W. This version was given Formulation #2
in Section 2
Our final problem corresponds to Formulation #3 of Section
2
(d) Multiple Descriptions of Maximum Profit Under a Weight Constraint (MDMP-WC)
Bipartite graph G(VN+o, Vz, E) that represents normal instances, outlier instances, tags and the covering relationship between tags and instances; positive integers and W.
Given:
7

---

Published in Transactions on Machine Learning Research (06/2025)
Required: Pairwise disjoint subsets Y1, Y2, Yo of V/ such that for 1 1 i 0, the weight w(Y;) is at most W and the total profit Σj=1 is maximum among all collections of a pairwise disjoint subsets of tags that satisfy the weight constraint.
Using the relationship between the profit and weight of a set Y of tags and the edges in G, it is seen that the goal of the DMP-WC problem to find pairwise disjoint subsets Y1, Y2, ..., Y, of VT to maximize the quantity E L 1, subject to the constraint E S W, 1 Asisoo a. This is Formulation #3 in Section 2
This completes the formal definitions of the problems considered in paper. In the next section, show that Problems (a), (b) and (c) formulated above can be solved efficiently while Problem (d) is computationally intractable.
A note about experiments. In presenting experimental results, we normalize values of parameters by constants to make the computational results more meaningful and comparable across datasets of different sizes. For example, the experiments for the DMU problem (Formulation #1) choose a subset of tags Y to maximize the quantity T [xd where Fol represents the total number of edges between O and V1 and EN| represents the total number of edges between O and Vr. The objectives in Formulations #2 and #3 are scaled in a similar fashion.
| F
4 Analytical Results
4.1 Algorithms for Maximizing Utility
Here, we present efficient algorithms for the first two versions of Formulation#1, namely DMU and BDMU, formulated in Section 3. In both cases, the goal is find a subset of tags to maximize the utility. The correctness of our algorithms due to the following lemma.
Lemma 4.1. An optimal solution to the DMU problem consists of all tags whose utility values are > 0.
Proof: Let Y be an optimal solution to the the given DMU problem. By definition, the optimal utility p(Y") is given by x = - p(y). We may assume without loss of generality that Y doesn't 't contain any tag y with p(y) = since deleting such a tag doesn't 't change the total utility. Tf Y doesn't 't contain a tag y with p(y) > 0, then adding that tag to Y* incrcases the total utility, contradicting the optimality of Y*. Thus, Y must contain all lags whose utility values are 0. Further, if Y* includes any lag y with ply) < O, then deleting y from Y increases the total utility, again contradicting the optimality of Y*. Therefore, the set Y containing each tag with strictly positive utility is an optimal solution.
The above lemma suggests the simple algorithm for the DMU problem shown in Algorithm I The following simple extension of this algorithm also solves the BDMU problem, where the goal is to choose a subset Y of at most tags with maximum utility. Once we have computed the utilities of all the tags, we only need to choose the top k tags when tags are listed in non-increasing order of utilities. (If the resulting subset includes tags whose utility values are < 0, they can be discarded.) As will be pointed out in the proof of Theorem 4.1 below, choosing the top k tags can be done without sorting the tags in the order of their utilities.
Theorem 4.1. Problems DMU and BDMU can be solved in time O(VV+oo + V+l + [F]), which is linear in the size of the graph G.
The correctness of our algorithms for DMU and BDMU follows from Lemma 4.1 and the discussion following our proof of the lemma. To estimate their running times, we first consider Algorithm [ for the DMU problem. The time to read the graph G is O(VV+ol + IV + |E)). For any tag y, let degree(y) denote the degree of in G. The utility μ(y) of can be computed in (ddgreee(v) time by counting the number of edges between y and the nodes in Vi+0. The time used to check whether y is added to Y is O(1). Thus, the total time used in the for loop of the algorithm is O (EneVi Vz degree(u)) = O(EE) since by a well known graph theoretic fact, the total degree of all the nodes in 1/r is simply twice the number of edges in G (West
Proof:
2001 Therefore, the running time of Algorithm [O + [VEl + [F]).
8

---

Published in Transactions on Machine Learning Research (06/2025)
Algorithm 1: An Algorithm for the Description of Maximum Utility (DMU) problem
Input A bipartite graph G(Vu+0, Vr, E) representing the normal instances, outlier instances and tags as discussed in Section B
Output: A subset Y S VT of tags with maximum utility.
Initialize Y to the emply set.
for each tag y E Vr do
Compute the utility p(v) of y. if ply) > 0 then Add to Y end
5
end
Output Y
Now, consider the extended algorithm for the BDMU problem. We need to choose the top-k tags with the largest utility. As before, we can compute the utilities of all the |V tags in O(VV++ol |V + [E]) time. It is well known that given array of n values and integer & s n. the 4th largest value in the array can be found in (nn) time, without sorting the array (Cormen et al. 2009). Thus, we can find the lop-k lags with respect to utility in O(VV=) time. In other words, the running time of our algorithm for BDMU problem is also O(Vi+=o + |Vrl + [E)).
4.2 Maximizing Profit Under Weight Constraint
In this section, we consider the DMP-WC problem, where the goal is to find subset Y of tags to maximize the total profit under a budget constraint on the total weight. We present polynomial time algorithm for the problem by observing that this is a restricted version of the Knapsack problem (Cormen et al. 2009). We begin with a definition of the Knapsack problem.
Knapsack Problem
Given: A set A = {ai,, .., of objects, where each object a; is associated with two positive integers, namely a value g(as) and a weight w(a;), 1 < i S n; an integer W (representing knapsack capacity).
Required: A subset A' C A such that the total weight of the objects in A' is at most W and the total value of the objects in A' is a maximum among all subsets satisfying the weight constraint.
Lemma 4.2. The DMP-WC WC problem an instance of the Knapsack problem.
To see the correspondence between the DMP-WC problem and the Knapsack problem, we think of the tags as objects. The weight and profit of each tag correspond to weight and profit each object in the Knapsack problem. The constraint on the total weight of the tags chosen corresponds to the constraint on the capacity of the Knapsack. The objective of the two problems is also the same (i.e., choosing a subset of items that maximize the total profit under the weight constraint).. Thus, the DMP-WC problem can be solved as Knapsack problem.
Proof:
In general, the Knapsack problem is NP-hard. However, this computational intractability is due to large integers appearing profits and weights (Garey & Johnson, 1979). It is known that the problem can be solved in pscudo-polynos programming algorithn is a polynomial function of the number of objects (n) and the value of the largest integer appearing in the input (Garey & Johnson 1979). In the case the DMP-We WC problem, the largest possible weight is the number of normal instances and the largest possible profit is the number of outlier instances. Since these values are bounded by the size of the DMP-WG problem, any pseudo-polynomia time dynamic programming algorithm for the problem (Commen al.) 2009) is indeed polynomial time
time using dynamic programming; that is, the running time of the dynamic

---

Published in Transactions on Machine Learning Research (06/2025)
algorithm for the problem. For the sake of completeness and since this is one of the algorithms that we studied experimentally, provide the details of the dynamic programming algorithm for DMP-WC below.
Algorithm 2: Dynamic Programming Algorithm for DMP-WC.
Input: Tags {ui, U2...... ] for each tag us its profit p(u,) and weight w(u)); budget W on total weight.
Output: A subset Y* of U with the maximum profit under the constraint that the total weight of the lags in Y* is at most W.
Let P be (n+ + x (W 1) array. (See the text. for the interpretation of the values stored in the P array. (The row and column indices of P vary from 0 to and 0 to W respectively.)
// Compute the optimal profit value.
for -= 1..,,...,,kk W do P|o,j] end for
i= 1......; do
for 0,0,1, 1...... W do P(i.]] max(P] 11,1,
7
1, Pli - 1.j - w(pi)] + p(u))
end
end
// Optimal profit is Pín, W]. Find optimal solution Y*.
10
Let y = 0, temp- P(n, W), i n and = W
while i 2 do
if temp Pli 1. then
13
Add u; to Y
14
temp = Pli - 1,j w(u)l
15
j=j - w(u)
16
end
17
i=i-1
18
end
19
Return Pin, W] (optimal profit) and Y (optimal solution).
A dynamic programming algorithm for DMP-WC: Let U = = u.,.., un denote the set of n tags. Recall that for each tag u4 its profit and weight are given by p(u,) and w(u) respectively. Let W denote the maximum total weight of the tags chosen. Without loss of generality, we assume that for each tag uis the weight of u; that is, w(4) is most W. (Tags whose weights are larger than W cannot be used in the solution.) The dynamic programming algorithm uses two dimensional table P with n + 1 rows and W columns. For each i and j, where 0 < S and 0 S j < W, the entry PÍi,]] stores the maximum profit that can be realized using the subset of tags {w1, .2. }²} under the constraint that the total weight of the chosen tags is at most j. Now, the equations to compute the entries of this table are as follows.
Pl = 0, OSiSW.
P[i,j] max mnax(Plii 1,5). Pli.j w(w))] p(u:),, 0 OSiSW.
Once all the entries of the P matrix are available, the optimal solution value is given by P(n, W).
In the above computation, we employ the common convention that if the second index of the P matrix is less than 0 (i.e., it represents an infeasible weight), the corresponding profit value is The above equations can be used compute the optimal profit for the DMP-WG problem. Using the values in the matrix, an optimal subset U* of tags can be found. Psendocode for the dynamic programming method is shown A Aggorithm 2
10

---

Published in Transactions on Machine Learning Research (06/2025)
Running time analysis: To estimate the running time of Algorithm 2 we first note that the number of entries in the P matrix is O(nW), where [U] is the number of tags and W is the weight budget. The running time of the algorithm is dominated by the time needed to compute all the entries of the P matrix. From Step of the algorithm, it is seen that each entry of the P matrix can be computed in O(1) time. So, the total time to compute all the entries and hence to obtain the optimal solution value is O(nW). Note that the weight of any tag u, is at most [NI, the number of normal instances. Thus, the value of W is at most n| Hence, the overall running time of Algorithm 2 is O(n) which is polynomial in the size of the problem. The following theorem summarizes the above discussion.
Theorem 4.2. An optimal solution to the DMP- WC problem can be found in (n) time, where and N are respectiucly the namber of lags and the number of normal instances.
4.3 A Complexity Result for Multiple Descriptions
In this section, we show that the problem of obtaining multiple descriptions under weight constraints (ie.. the problem MDMP-WC defined in Scction 3.2) is NP-complete. Since the notion of NP-completeness is for decision problems, we will assume that the problem specification also includes an additional integer parameter X. The goal of the decision version of MDMP- WC is to determine whether there are a subsets Y1, Y2, ...... Y, of tags satisfying the constraints of the MDMP-WC problem and the additional condition that the total profit of the descriptions is at least A.
A note about the reduction: As mentioned earlier, the classical Knapsack problem is computationally intractable because the numbers specified as part of the problem (i.e., the profit and weights of given items) can be exponentially large in the number of given items (Garey & Johnson 1979.. Our efficient algorithm for the DMP-WC problem, which requires us to find one subset of tags, was obtained by observing that the problem reduces to a special case of the Knapsack problem where the weight (and profit) values are numbers whose value is bounded by a polynomial function of the size of the problem instance (Section 4.2). As we show below, in the case of the MDMP-WC problem, the computational intractability arises because of the need for multiple knapsacks. For this reason, it is difficult to use a direct reduction from the classical (single) Knapsack problem to prove the NP-hardness of the MDMP-WC problem. Instead, it is more convenient. to use a reduction from a known NP-hard problem which involves partitioning a set of integers into many subsets (which represent multiple knapsacks). One such problem is 3- P-RRTITIOO (Garey & Johnson 1979 defined below.
3- 3-Partition:
Given: Positive integers m and B, where B is bounded by polynomial function of m, a set A =
(2,.2,,..., 23m] } of 3m positive integers such that Σim 2; = mB and for 1 S i < 3m, B/4 < 2 < B/2.
Question: Can A be partitioned into m subsets AI, A2, ... Am such that for each Aj, the sum of the integers in Aj is exactly B?
It is shown in (Garey & Johnson 1979) that 3-PARTITION is NP No-complete. From the constraints on the values of the integers in A, note that whenever there is a solution to a 3-PARITTION instance, each subset Aj must contain ezactly three integers.
Theorem 4.3. The MDMP- WC problem is NP-complete.
Proof: It can be seen that MDMP-WC in NP since given a solution, one can efficiently verify that the subsets are pairwise disjoint, each subset satisfies the weight constraint and the total profit from all the subsets is at least X. We prove the NP- of MDMP-WC through reduction from the 3- 3-PARTITION problem. Given an instance I of the 3-PARTITION problem, we construct an instance I' of MDMP-WC problem as follows. As before, we use G(VN+o, Vr, E) to denote the bipartite graph of the MDMP-W- WC problem.
1. The universe of tags U = {u1, u2 U3m} } has 3m elements, with tag u, corresponding to integer 2, in A, S i < 3m. Thus, the node set Vr of G is of size 3m.
i 2. With each tag u; we associate a unique set of 2; normal instances, denoted by N/, 1 و S a,, and one outlier instance O,, 1 < i 3m. (Thus, each normal and outlier instance is associated with exactly one
11

---

Published in Transactions on Machine Learning Research (06/2025)
tag.) This construction ensures that the weight of tag u, is 2 and its profit is 1, for 1 < 3m. The total numbers of normal and outlier instances created are mB and 3m respectively. In other words, the node set VN+Oo of G has a total of m(B + +3) nodes, with mB nodes in Vi and 3m nodes in Vo.
3. The odge set E of G is constructed as follows. For each tag us there is an odge between 4 and its associated normal instances and outlier instance, 1 S S 3m. (Thus, the degree of each normal and outlier instance in the underlying bipartite graph is exactly 1.)
4. The number a of subsets of tags required is set to m, the budget on the weight of each required subset is set to B and the required profit is set to 3m.
This completes the construction of the instance I' of the MDMP-W- WWC problem. Since the value of B is a polynomial function of m, the construction can be done in polynomial time. We will now show that there is a solution to the instance I' of MDMP-WC iff there is a solution to the 3-PARTITION instance I.
Suppose there is a solution to the 3-PARITTION instance consisting of sets AI, A2, Am- Recall that in this solution, each set A, has exactly three integers. We construct a solution to the MDMP-WC CC instance I' as follows. For each set Aj, we construct a subset Y, consisting of three tags, in the following manner: if A, has the inlegers Fo. Fb and Rer the set Y, has the lags Vay Up and ue. Recall that the weight of each tag u, is z and the profit of each tag is 1. Since the sum of the integers in Aj is B, the total weight of each subset Yj is B. Since there are three tags in Yj and the profit of each tag is the profit of Y, is 3 and the total profit over the m subsets of tags is 3m. We thus have solution to the MDMP-WC instance I'.
Part 1:
Part 2: Suppose there is solution to the MDMP-WP WC instance I'. We have the following claim.
Claim 1: In the solution to the MDMP-WC instance, each set Y, has exactly three tags and their total weight. is equal to B.
Proof of Claim 1: The total weight of all the tags is mB and this is weight is partitioned over the m pairwise disjoint subsets Yi, Y2, ..., Ym- By the weight constraint, the weight of each lag set must be at most B. If a set Y, has a weight less than B, then some other set Y, must have a weight exceeding B, thus violating the weight constraint. Thus, each set Y, must have total weight of exactly B. Also, by the specification of the 3-PARTITION problem, each tag has a weight which is greater than B/4 but less than B/2. Therefore, for the weight of a set Y, to be exactly B, the number of tags in Yj must be exactly three. This completes proof of Claim 1.
In view of Claim 1, we can construct a solution to the 3-PARTITION instance as follows. For cach set Yj, construct a subset A, of A as follows. If Y, has the lags uas un and ues let A, contain the inlegers ža. & and Ze- By Claim 1, the sum of the integers in A, is exactly B. Moreover, since the subsets in the solution to the MDMP-WC instance are pairwise disjoint, the subsets An, A2, .... Am are also pairwise disjoint. Thus, we have solution to the 3-PARTITION instance I, and this completes our proof of Theorem
5 Experiments
From our experiments, we aim to answer the following questions:
What explanations do our three formulations find for a variety of different data modalities (image, text and database)? We address this by comparing our explanations in domains where a strong ground truth is known.
Can we use our method for novel scenarios such as finding contrastive explanations to explain the differences between the predictions of multiple outlier detection algorithms?
We use three data sets, with one for each modality: CclebA (Liu ct al. 2015) (Images), COMPAS (Angwin et al. 2016) (Databases) and HateXPlain (Mathew et al. 2021) (Text). We next discuss these datasets in terms of content, how anomalies are found and the ground truths we will compare our methods against. As will be pointod out in the related work section (i.c., Section 6, existing work for XAD does not simultancously use semantic tags, generate contrastive explanations and provide comparable global level explanation; hence, there are direct comparisons to be made. The closest work to our own is on contrastive pattern
12

---

Published in Transactions on Machine Learning Research (06/2025)
mining (Chen et al. 2022 which returns poor results for explanation there is coverage requirement.
See Section 8 for discussion on contrastive pattern mining.
5.1 Descriptions of Data Sets
This section can be skipped by readers familiar with these data sets.
CelebA (Liu et a 2015) This data set consists of 202,599 images of celebrities, each of which can have up to 40 tags given by a human annotator. We add an additional 14 tags generated by the Deepface (Serengil & Ozpinar 2021 facial analysis framework. An example of typical normal and outlier points found is shown in Figure We generate outliers with this data using both Deep SVDD (Ruff al. 2018) and deep convolutional auto encoder (DCAE) using well known deep learning architecture (Subramanian 2020 In previous work on fairness using Deep SVDD (Zhang & Davidson (021), it was found by visualization of the most and least anomalous instances that the definition of normal celebrities were white females and the outliers were overwhelmingly people of color and male. Our work will generate explanations that contrast outliers and normal images (scc Tables 2 3 and 4 We also explain the differences between the normal
predictions that SVDD and CVAE outlier detection algorithms make (see Table G
COMPAS (Angwin et al., 2016) is a classification system that scores a criminal defendant's chance of recidivism by decile score. The higher the recidivism score, the greater is the belief that the person will reolfend after being released from prison. To this score is added whether the individual did in fact reoffend within a two year period (Angwin et al.) 2016). We consider as being unfairly and harshly treated (outliers) individuals who have a decile score of 10 but who did not reoffend within two years. These are effectively false positives (predicted to reoffend but did not). We generate a contrastive explanation to the group of individuals with a decile score of 1 but who did reoffend within two years (too leniently treated) which are effectively false negatives. We compare our explanations against the findings by ProPublica (Angwin et al., 2016).
HateXPlain (Mathew et al. 2021 is a corpus of 20,148 Twitter and Gab posts. HateXPlain classifies text as "normal speech", "hate speech", or "offensive speech" for specific categories (race, sex, etc.) (Devlin et al. 2018). We take the subset. of "normal speech" for the "African" category as normal text, and the subset of "hate speech" for the " "African" category as outliers.
5.2 CelebA Explaining Deep SVDD Predictions
Here we identify outliers the images of celebrities and then explain the output of the AD algorithm using the tags for each image. We focus on the results produced using the Deep SVDD (Ruff et al. 2018) AD algorithm. Examples of the normal and outlier points found by this algorithm are shown in Figure 3
We applied our first formulation to the AD algorithm's 's output and generated the explanations in Table 2 We report the fraction of instances covered in each collection/groug (center columns) and the fraction of the entire population that have each tag (right column). These explanations match our visual understanding of the outliers and the understanding of others (Zhang & Davidson 2021 Several tags in the explanation are highly rastivetive such as Bace:Black: Black_ hair, Eyeglasses and Wearing_ hat for the outlier group and Blond Blond_Hair Hair and Brown Hair for the normal group. However, some tags in the explanation are not particularly contrastive, such as Male for the outlier group that occurs in 32.5% of the entire population and 40% of the outlier group and 25% in the normal group. Similarly, the tag Race: White in the normal explanation occurs in 55.5% of the population but 75% of the normal group and 36% of the outlier group.
Our second comulatton aims to overcome this limitation to find a strongly contrastive explanation which is shown in Table Interestingly, we see that the not strongly contrastive tag Male found in Formulation #1 has been replaced by a more discriminating surrogate (Mustache) for the outlier group, and the non-contrastive tag Race: White for the normal group found in Formulation #1 replaced by tags Blond Hair, Rosy Cheeks which are typically found in people with fair complexions.
13

---

Published in Transactions on Machine Learning Research (06/2025)
Most Normal Smiling Instances
Most Anomalous Smiling Instances
Figure 3: Top 100 most normal and most anomalous instances found by Deep SVDD based solely on image data. Note that although the normal and outlier points backgrounds are different, there are significant differences in the faces of the two types of people.
Our third formulation allows finding multiple explanations they exist. The number of explanations found is pre-sct as hyperparameter. We see there are three dominant explanations involving (i) Black hair, (ii) Wearing Hat, and (iii) Eyeglasses as shown in Table
5.3 CelebA Explaining Differences Between Deep SVDD and DCAE
Here we test the use of our method for finding the contrasts/ differences Dontrasts/differencee SVDD and a deep convolutional autoencoder (DCAE) on the same data set. We focus on the challenging but important problem of explaining the definitions of normality between the algorithms. The top part of Figure shows Deep SVDD's typical normal images and Figure 4 shows some normal images for DCAE. We find in Table 5 interestingly that there is strong difference between the definitions of normality for both
between the predictions of Deep
14

---

Published in Transactions on Machine Learning Research (06/2025)
AE Most Normal Smiling Instances
Figure 4: Top 100 normal images found using a DCAE. c.f. Figure top.
Table 2: Formulation 1. The explanations of CelebA instances outliers/ points found using Deep SVDD. Compare with Table 3 For each collection (outlier httpoooommmmppaottiiiiioooo we state the fraction of that. collection having the tag.
Instance Coverage
Outlier Explanation
Population Coverage
Outlier Group Normal Group
Black Hair
36.0% 2.0%
19.0%
Eyeglases
22.0% 2.0%
12.0%
Male
40.0% 25.0%
32.5%
Wearing Hat
19.0% 2.0%
10.5%
Race: Black
18.0% 3.0%
10.5%
Instance Coverage Normal Group Outlier Group
Normal Explanation
Population Coverage
Blond Hair
44.0% 2.0%
23.0%
Race: White
75.0% 36.0%
55.5%
Arched Eyebrows
46.0% 16.0%
31.0%
Gender: Woman
68.0% 35.0%
51.5%
Brown Hair
26.0% 4.0%
15.0%
algorithms. The deep SVDD algorithm associates normality with blond individuals and the DCAE algorithm with black haired individuals. However, the remaining tags are not particularly discriminatory. Our second formulation's 's results (see Table 6 ensure strong contrastive results and
that the DCAE and Deep SVDD algorithms quite different in terms of race, gender and hair color. It seems that the AE defines normality as men where as the SVDD algorithm defines normality centered around being woman.
5.4 COMPAS: False Positives against False Negatives
Here we focus on explaining what characterizes individuals who are predicted to reoffend but did not (false positives who are unfairly treated) compared to those who were not predicted to reoffend but did (false negative who are favorably treated). For explanation we use tags for age, sex, race, crime severity (felony
15

---

Published in Transactions on Machine Learning Research (06/2025)
Table 3: Formulation 2. The explanations of CelebA instances outliers/noornn normal points found using Deep SVDD. Compare with Table 2 For each collection coutlier/normal/poee population) we state the fraction of that collection having the tag.
Instance Coverage
Outlier Explanation
Population Coverage
Outlier Group Normal Group
Black Hair
36.0% 2.0%
19.0%
Eyeglases
22.0% 2.0%
12.0%
Wearing Hat
19.0% 2.0%
10.5%
Race: Black
18.0% 3.0%
10.5%
Mustache
10.0% 1.0%
5.5%
Instance Coverage Normal Group Outlier Group
Normal Explanation
Population Coverage
Blond Hair
44.0% 2.0%
23.0%
Brown Hair
26.0% 1.0%
15.0%
Rosy Cheeks
20.0% 2.0%
11.0%
Gray Hair
8.0% 2.0%
5.0%
Pale Skin
2.0% 0.0%
1.0%
Table 4: Formulation Multiple explanations of CelebA instances outliers/normal points found using Deep SVDD. Compare with Table For each collection (outlier/norma//pouuaaiio) we state the fraction of that collection having the tag.
Instance Coverage
Outlier Explanations
Population Coverage
Outlier Group Normal Group
Group #1
Black Hair
36.0% 2.0%
19.0%
Bushy Eyebrows
10.0% 5.0%
7.5%
Blurry
8.0% 3.0%
5.5%
Race: Indian
2.0% 0.0%
1.0%
Emotion: Surprise
1.0% 0.00%
0.5%
Group #2
Wearing Hat
19.0% 2.0%
10.5%
5 o Clock Shadow
9.0% 5.0%
7.0%
Goatee
8.0% 1.0%
4.5%
Emotion: Angry
3.0% 2.0%
2.5%
Group #3
Eyeglasses
22.0% 2.0%
12.0%
Race: Black
18.0% 3.0%
10.5%
Mustache
10.0% 1.0%
5.5%
Emotion: Sad
5.0% 1.0%
3.0%
Sideburns
4.0% 1.0%
2.5%
or misdemeanor), and the specific crime committed. We note that the crime labels are taken directly from the COMPAS dataset and often use many abbreviations. Note our analysis is different from the ProPublica analysis (Angwin et al. 2016) which only focuses on the false positive group and statistics for it. ProPublica found strong racial disparity in COMPAS predictions between white and black defendants in this group.
Using Formulation (sce Table 7) we observe results consistent with ProPublica findings. Our explanation Afriian-Ameriaass
shows that defendants who treated too harshly by COMPAS largely young African-A mericans
16

---

Published in Transactions on Machine Learning Research (06/2025)
Table 5: Formulation 1. The normal group explanations of Deep SVDD versus DCAE. For each collection [AE (4E.Noma//SVDDDNNora//pppop we state the fraction of that collection having the tag.
Instance Coverage
AE Explanation
Population Coverage
AE Group SVDD Croup
Black Hair
32.0% 2.0%
17.0%
Young
90.0% 72.0%
81.0%
Heavy_Makeup
62.0% 46.0%
54.0%
Wearing Lipstick
74.0% 63. 63.0%
68.5%
Attractive
66.0% 57.0%
61.5%
Instance Coverage SVDD Group
SVDD Explanation
Population Coverage
AE Group
Blond Hair
43.0%
1.0%
22.0%
Race: White
78.0%
40.0%
59.0%
Emotion: Happy
75.0%
55.0%
65.0%
Mouth Shipi_SllihhhlSSll Open
73.0%
55.0%
64.0%
Bags Under Eyes
22.0%
11.0%
16.5%
Table 6: Formulation 2. The normal group explanations of Deep SVDD versus DCAE. For each collection (AF-Voral/SYDDD-Nomm//opolu we state the fraction of that collection having the tag.
Instance Coverage
AE Explanation
Population Coverage
AE Group SVDD Group
Black Hair
32.0%
2.0%
17.0%
5 o. Clock Shadow
6.0% 4.0%
5.0%
Pale Skin
5.0%
1.0%
3.0%
Sideburns
2.0%
1.0%
1.5%
Instance Coverage SVDD Group AE Group
SVDD Explanation
Population Coverage
Blond Hair
43.0% 1.0%
22.0%
Chubby
8.0%
2.0%
5.0%
Gray Hair
7.0% 0.0%
3.5%
Emotion: Fear
7.0% 4.0%
5.5%
Double. Chin
6.0% 0.0%
3.0%
who were charged with felonics. Further, consistent with ProPublica findings, our explanation shows that defendants who are treated too leniently by COMPAS are largely older Caucasian defendants charged with misdemeanors.
It is with Formulation 2 (see Table and Formulation 3 (see Table 9) that show insights not previously found. We observe that the results of Formulation 2 emphasize how defendants treated too harshly tended to be young and having been charged for more drug offenses, where as defendants trcated too leniently are older and were found to have been charged with driving offenses. There a strong correlation between race and the types of charges, indicating selection policing bias. Using Formulation 3, we find explanations for defendants treated too harshly, and set the number of explanations = to be consistent with our configuration with CelebA. We see that the three dominant explanations for COMPAS for Formulation 3 Less than 25, Possession of Cocaine, and people arrested but no charges filed.
17

---

Published in Transactions on Machine Learning Research (06/2025)
Table 7: Formulation 1. The explanation of COMPAS False Positives (Harshly Treated) versus False Negatives we state the fraction of
(Leniently Treated). For each collection (False-Pose Saaiiivv//als--Negatiie that collection having the tag.
Instance Coverage
False Positive Explanations
Population Coverage
False Positive Group False Negative Group
Africau-American
68.2% 29.3%
37.8%
Less than 25
23.5% 1.0%
5.9%
Charge Degree: Felony
71.8% 49.8%
51.6%
Age: 25 15
71.8% 51.5%
55.9%
"arrest case no charge"
25.9% 9.4%
13.0%
Instance Coverage False Negative Group False Positive Group
False Negative Explanations
Population Coverage
Age: Greater than 45
47.6% 4.7%
38.3%
Caucasian
46.3% 22.1%
41.4%
Charge Degree: Misdemeanor
50.2% 28.2%
45.1%
Battery
25. 7% 9.4%
22.2%
Hispanic
15.6% 7.1%
13.8%
Table 8: Formulation 2.
The explanation of COMPAS False Positives versus False Negatives. For each
collection (Palse-Possiivve Fals/aaalaeaaaee http:/alleeeaaivve//oolllle we state the fraction of that collection having the tag.
Instance Coverage
False Positive Explanations
Population Coverage
False Positive Group False Negative Group
Less than 25
23.5%
1.0%
5.9%
Grand Theft (Motor Vehicle) "Pos Cannabis W /Inttent Sel/Del" Possession of Alprazolam
3.5%
1.6%
2.0%
2.4%
0.7%
1.0%
2.4%
1.0%
1.3%
"Burglary Conveyance Unoccup"
2.4%
1.0%
1.3%
Instance Coverage False Negative Group False Positive Group
False Negative Explanations
Population Coverage
Age: Greater than 45
17.6%
4.7%
38.3%
"Other"
8.5%
2.4%
7.1%
Driving Under The Influence
5.9%
0.0%
4.6%
"Felony Driving While Lic. Suspd" "Viol Injunct Domestic Violence"
3.3%
0.0%
2.6%
2.0%
0.0%
1.5%
5.5 HateXPlain
The reader warned that the content of this data set is highly offensive but a classic text explanation data set. Here we generate explanations for the words that are most hateful in the HateXPlain dataset. Formulation (See Table 10p we observe many derogatory and hateful words being contrasted against more individually neutral words. Notably, the n-word ending in an 'r' is the strongest form of hate speech found by the explanation. However, the n-word ending in an 'a" is the strongest explanation for texts that are classified as normal speech. This supports generalizations by Mathew et al. (2021) regarding how many texts in the dataset reflect the n- n-word being used within the Formulations 2 and 3 are shown in Tables
community as a pronoun. Results for and 12 respectively.
18

---

Published in Transactions on Machine Learning Research (06/2025)
Table 9: Formulation 3. Multiple explanations of COMPAS false positives when contrasted against false negatives. For each collection (Faake-Positvee/Paeeeeeggggiii /ea.saeeeeeaatiieoooplattai we state the fraction of that collection having the tag.
Instance Coverage
False Positive Explanations
Population Coverage
False Positive Group False Negative Group
Group #1
Less than 25
23.5%
1.0%
5.9%
Grand Theft in the 3rd Degree "Felony Pelit Theft" Felony Battery w w/Prior Convict. Possession of Cannabis $50
9.4%
5.2%
6.1%
2.4%
0.0%
0.5%
1.2%
0.0%
0.3%
1.2%
0.3%
0.5%
Group #2
Possession of Cocaine
7.1%
4.6%
5.1%
Grand Theft (Motor Vehicle) "Pos Cannabis W W/Intent Sel/Del" Possession of Alprazolam "Burglary Couveyance Unoccup"
3.5%
1.6%
2.0%
2.4%
0.7%
1.0%
2.4%
1.0%
1.3%
2.4%
1.0%
1.3%
Group #3
"arrest case no charge"
25.9% 9.4%
13.0%
" "Escape"
1.2%
0.3%
0.5%
Table 10: Formulation 1. Explanations of HateXPlain hate speech and normal speech. For each collection SlateeSpoec//Nooml-SSppeee Poopulaiioo)) we state the fraction of that collection having the tag.
Instance Coverage
Hate Speech Explanation
Population Coverage
Hate Speech Group Normal Speech Group
n "gger
76.2% 24.4%
72.8%
ftck
13.7% 6.8%
13.3%
jew
8.1% 1.8%
7.7%
k*ke
5.7% 0.0%
5.3%
f'ggot
5.1% 0.5%
4.8%
Instance Coverage Normal Speech Group Hate Speech Group
Normal Speech Explanation
Population Coverage
n ggga
29.9% 4.6%
6.2%
black
38.0 38.0%
16.8%
18.2%
< <user>>
31.7%
13.1%
14.3%
white
37.6%
27.9%
28.5%
people
16.3% 7.5%
8.0%
person
6.8% 1.3%
1.7%
19

---

Published in Transactions on Machine Learning Research (06/2025)
Table 11: Formulation 2. Explanations of HateXPlain hate speech and normal speech. For cach collection we state the fraction of that collection having the tag.
Instance Coverage
Hate Speech Explanation
Population Coverage
Hate Speech Croup Normal Speech Group
jew k* ggot
8.1% 1.8%
7.7%
5.7% 0.0%
5.3%
5.1% 0.5%
4.8%
sand
4.5% 0.0%
4.2%
reaard Normal Speech Explanation
3.7%
0.0%
3.4%
Instance Coverage Normal Speech Group Hate Speech Group
Population Coverage
yo
2.7%
0.3%
0.5%
woozy face emoji>
2.7%
0.1%
0.2%
<leading face emoji>
2.3%
0.0%
0.1%
tf
1.8%
0.0%
0.1%
<time>
1.4%
0.0%
0.1%
Table 12: Formulation 3. Multiple explanations of HateXPlain hate speech when contrasted against normal speech. For each collection (Hate-Speech/Nonnn) Sprece-Speechh/////// wwwSSSpppeeecppaireeeeeee Poopllatio) we state the fraction of that collection having the tag.
Instance Coverage
Hate Speech Explanation
Population Coverage
Hate Speech Group Normal Speech Group
Group #1
k ke
5.7% 0.0%
5.3%
sand
4.5% 0.0%
4.2%
re aaadd
3.7% 0.0%
3.4%
back
3.0% 1.4%
2.9%
race
2.9% 0.0%
2.7%
Group #2
f'ggot
5.1% 0.5%
4.8%
look
4.0%
1.8%
3.9%
good
3.4%
1.4%
3.2%
america
2.9%
1.4%
2.8%
little
1.6% 0.5%
1.5%
Group #3
jew
8.1% 1.8%
7.7%
take
3.5%
0.5%
3.3%
rape
3.2% 1.4%
3.1%
anoth
2.3% 0.9%
2.2%
africa
2.2%
0.9%
2.1%
20

---

Published in Transactions on Machine Learning Research (06/2025)
6 Related XAD Work
We begin by overviewing the need for contrastive explanations and then move onto the areas of XAI and XAD that touch upon contrastive explanations.
Contrastive Approaches in Human Explanation. In authoritative survey, Miller (019 explores how humans explain things to each other and makes a core finding that contrast is a critical part of human explanation. This provides a solid motivation for our work as in the end the machine is explaining to a human. Howover, Miller (2019) also finds that very little work in XAI diroctly addresses contrastive explanations. To address this, his later work (Miller 2021 explores a causal model but only for instance-level explanation in the classification setting.
There are several core areas where contrast is used in anomaly detcction and XAI which we discuss below. Contrastive methods have been used to generate outliers and in XAI and XAD. Several authoritative surveys of the both these areas find that the area of model-level explainable anomaly detection is not well studied.
Counterfactual Instance-Level XAD. Counterfactual methods have been used to generate a contrastive normal instance for each outlier. For example in one such method (Sipple & Youssel 2022): for each identified anomaly they use Integrated Gradients (IG) techniques to attribute an anomaly score to each feature and provide a contrastive nearest normal instance as explanation. However, these methods are instance level not model level explanations and are only suitable for settings where the input space is human interpretable the outlier and the counterfactual are compared to generate the explanation. Further, generating realistic counterfactuals is a challenging problem. In comparison, our work is model level and uses semantic tags as a mechanism to generate explanations. As such, it relies on interpretable tags but not on the feature space being interpretable. Hence, our method can be applied to data modalities such as images, graphs and even text (sce Table 1
Survey on XAD. A recent survey on explainable anomaly detection (Li et al. 2024) overviews the field. Here we touch upon the parts of the field relevant to our work. This survey (Li et al. 2024 assesses XAD along six dimensions: (i) When explanation occurs, (ii) what level of granularity is the explanation applied to, (iii) model agnostic or model specific, (iv) feature or sample based, (v) computational technique used, and (vi) applicable to static or streaming data. Our work is an example of a post-hoc, global /model level and agnostic approach to explanation; attempts to explain the entire output of any AD algorithm. Further, like most XAD techniques, it is applicable to static (not streaming) data. However, it is quite different from existing work for several reasons. Firstly, unlike existing methods that use the underlying features to explain the outliers, our work uses semantic tags (which may or may not be derived from the features). This means our work can be applied to the results of deep learning methods relatively easily so long as there are semantic tags for each instance. To our knowledge, no other XAD method takes this approach. Further, the computational technique we use to discover explanation is substantially different from existing work. Most of the known methods attempt to perform some underlying computation on the AD algorithm/funcet /function (such as perturbation to identify an explanation) where as our work formulates the problem as a computation on a bipartite graph that is similar to the knapsack problem. This allows us to use exact and efficient polynomial time algorithms based on dynamic programming. Finally, the ability to explain in contrastive manner both anomalies and normal definitions has not been well studied.
Other Computational Techniques That Could Be Used for Contrastive XAD. Perhaps the most related work to our own is contrastive pattern mining (Chen et al.) 2022) which attempts to find items Trequent in one data set but rare in another. Though this work was not designed for explanation AD it could be used for that purpose. However, that work has no coverage interpretations and experimentally produces poor results for explanation.
7 Conclusions
Anomaly and outlier detection is extensively used in AI and is often applied to policing and anditing arcas of substantial impact. However, XAD (Explainable Anomaly Detection) is a relatively understudied area given the importance of the topic. We propose the novel idea of finding a contrastive explanation, that is,
21

---

Published in Transactions on Machine Learning Research (06/2025)
set of tags that are common in say outliers but rare in normal points. By flipping the problem can find explanations for the normal points as well. Using this idea, we develop three formulations.
We formulate explanation as a computation on a bipartite graph shown in Figure | with the aim of selecting a collection of tags that most explains the outlier points (by covering the edges incident on the outlier points) and minimally explains the normal points (by covering the edges incident on the inlier points). We provide three formulations with efficient algorithms for the first two and proof of computational intractability for the third. Future work will explore designing efficient approximation algorithms for the third formulation. Our first and simplest formulation finds contrastive explanation and we designed simple linear time exact algorithm that finds an optimal explanation in that it selects the most tags incident on outlier points less tags incident on normal points. However, without any strong requirements, though this explanation scheme was useful we found that some tags were superfluons for explanation. Our second formulation addresses this concern by introducing the notion of a strongly contrastive explanation which tightly upper bounds how many of the tags used for explanation for say outliers can explain normal points. This creates much more useful explanation but yields more challenging computation. We formulate this version as form of knapsack and create an exact and polynomial-timg dynamic programming algorithm. Our two previous formulations find just a single explanation; as a novel variation, we create a third formulation that builds upon the second by creating k different explanations. Unfortumately, this problem is computationally intractable; however, it can be formulated as an ILP and solved using large-scale solvers such as Gurobi.
To demonstrate the versatility our approaches, we explored their application on a variety of data modalities: images (Celebrity A dataset), databases (COMPAS dataset) and text (HateXplain data set). For all three datasets, known ground truth explanations are well established and we ascertained that our methods are suitable for reproducing them and finding more nuanced explanations not previously published. Our methods successfully explained that outliers found using Deep SVDD in the Celebrity A dataset were overwhelmingly males and people of color as others have found in the work in fairness (Zhang & Davidson 2021). Our third formulation extended these insights by showing that there exists a number of distinct types of outliers. A ProPublica article (Angwin el al.) 2016) found that the AI tool Compas which predicted inmates' chances of reoffending was biased against minorities. Our first formulation discovered this insight and our strongly contrastive explanations found even more nuanced differences in terms of the crime. For the HateXPlain data set, we found that racial slurs are expected used extensively for hate speech but that even regular speech uses slurs but in different manner. Since no XAD algorithms to our knowledge use semantic tags as a basis of explanation, we do not compare against any known baselines.
Acknowledggentss. We thank the TMLR referees and the Action Editor for providing very helpful feedback. This work was supported in part by NSF Grants IIS- 1908530 and IIS-1910306 entitled "Explaining Unsupervised Learning: Combinatorial Optimization Formulations, Methods and Applications" and IIS- 2310481 titled "Towards Fair Outlier Detection". We thank Google for their gift entitled, "Towards Fair and Explainable Learning".
22

---

Published in Transactions on Machine Learning Research (06/2025)
References
Amina Adadi and Mohammed Berrada. Pecking inside the black-box: survey on explainable Artificial Intelligence (XAI). IEEE Access, 6:52138 52160, 2018.
Mohiuddin Ahmed, Abdun Naser Mahmood, and Md Rafiqui Islam. A survey of anomaly detection techniques in financial domain. Future Generation Computer Systems, 55:278-281 288, 2016.
Julia Angwin, Jeff Larson, Surya Mattu, and Lauren Kirchner. Machine bias. ProPublica, May. 23, 2016. Available https:/ wttps///www.popubicca.ooooo hatpraaarrnrrtttteeemmmiccieeeee mwchine- sisttteee-ii--ree biss-risk- asssssssssssmetss--- in- aasessseeuu----i-iiiiia-aeeeerrr
Francesco Bodria, Fosca Giannotti, Riccardo Guidotti, Francesca Naretto, Dino Pedreschi, and Salvatore Rinzivillo. Benchmarking and survey of explanation methods for black box models. Data Mining and Knowledge Discovery, 37:1719 17771977787 2023.
Manuel F Caro, Darsana Josyula, Michael T Cox, and Jovani A Jiménez. Design and validation of a metamodel for metacognition support in artificial intelligent systems. Biologically Inspired Cognitive Archileclures, 9:82 104, 2014.
Yao Chen, Wensheng Gan, Yongdong Wu, and Philip S. Yu. Contrast pattern mining: A survey. ArXiv preprint, No: arXiv:2209.33556 2022.
Thomas H. Cormen, Charles Fric Leiserson, Ronald I, Rivest, and Clifford Stein. Introduction to Algorithms. MIT Press and McGraw-Hill, Cambridge, MA, Second edition, 2009.
lan Davidson, Antoine Gourru, and S. S. Ravi. The cluster description problem Complexity results, formulations and approximations. In Advances in Neurol Information Processing Systems (NewrIPS), volume 31, pp. 1199-6201, 2018.
Jacob Devlin, Ming- Wei Chang, Kenton Lee, and Kristina N. Toutanova. BERT: Pre-training of deep bidirectional transformers for language undorstanding.
2018.
F. K. Dosilovic, M. Breic, and N. Hupic. Explainable Artificial Intelligence: A Survey. In Proc. 41st MIPRO, pp. 210 215, 2018.
M. R. Garey and D. S. Johnson. Compulers and Intractability:: A Guide to the Theory of NP-complelenees.. W. H. Freeman & Co., San Francisco, 1979.
D. Gumning. Explainable Artificial Intelligence (XAI). DARPA Program Update Document, 2017. Available from
Uaeetaannnpppepppe Update.pdf]
Manish Gupta, Rui Li, Zhijun Yin, and Jiawei Han. Survey on social tagging techniques. ACM SIGKDD Explorations Newslelter, 12(1):58 72, 2010.
Emily R Lai. Melacognition: A literature review. Pearson Research Report, 2011.
Zhong Li, Yuxuan Zhu, and Matthijs Van Leeuwen. A survey on explainable anomaly detection. ACM Transactions on Knowledge Discovery from Data, 18(1):1-55 54, 2024.
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Compuler Vision (ICCV) pp. 3730 3738, Los Vaqueros, CA, December 2015. IEEE Press.
Binny Mathew, Punyajoy Saha, Seid Muhie Yimam, Chris Biemann, Pawan Goyal, and Animesh Mukherjee. HateXplain: A benchmark dataset for explainable hate speech detection. In Proceedings of the AAAT Conference on Artificial Intelligence, volume 35, pp. 14867 14875, Online, 2021. AAAI Press.
Tim Miller. Explanation in Artificial Intelligence: Insights from the social sciences. Artificial intelligence, 267:1 13,, 2019.
23

---

Published in Transactions on Machine Learning Research (06/2025)
Tim Miller. Contrastive explanation: A structural-model approach. The Knowledge Engineering Review, 36: e14, 2021.
Y. Ming. A survey on visualization for explainable classifiers. Tech Report, Hong Kong University of Science and Technology, 2017.
Proc. XAT-2017 Workshop. Proc. IJCAT-17 Workshop on Explainable AT (XAT).
/t2// XAI_
_WS _S___W__PPoee__ Proceedings.ppe 2017.
Proc. XAI-2018 Workshop. Proc. ICCALEECAT-2018 Workshop on Explainable AT (XAT). 2018.
https: www
Lukas Ruff, Robert Vandermeulen, Nico Goernitz, Lucas Deecke, Shoaib Ahmed Siddiqui, Alexander Binder, Emmanuel Müller, and Marius Kloft. Deep one-class classification. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4393 4402, Online, 10-15 15 Jul 2018. PMLR. URL https: wttp:/ddiinn.ml...pee///////////
Prathyush Sambaturu, Aparna Gupta, Ian Davidson, S. S. Ravi, Anil Vullikanti, and Andrew Warren. Efficient algorithms for generating provably near-oplimal cluster descriptors for explainabilily. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 1636-1643, 2020.
David Savage, Xiuzhen Zhang, Xinghuo Yu, Pauline Chou, and Qingmai Wang. Anomaly detection in online social networks. Social Networks, 39:62-70, 2014.
Sefik Ilkin Serengil and Alper Ozpinar. Hyperextended lightface: facial attribute analysis framework. In 2021 International Conference on Engineering and Emerging Technologies (ICEET), pp. 4, Las Vaqueros, CA, 2021. IEEE Press. doi: 10.1109/ICEET334422200 200.EEETT334.2.22199966600 URL https:/ /oo.orr////og/oooooooo (toi..rr/10.1109)) 10.1109/ ICEET53442 2021. 9659697
Shen, Tenenholtz, JB Hall, D Alvarez-Melis, and N Fusi. Tag-LLM: Repurposing general-purpose LLMs for specialized domains. ArXiv preprint arXiv:2402.051 2024.
John Sipple and Abdou Youssef. A general-purpose method for applying explainable AT for anomaly detection. In International Symposium on Methodologies for Intelligent Systems, pp. 162 174. Springer, 2022.
A.K Subramanian. PyTorch-VAF. https:/ggihubb.cmm/Aniik///// Paatniik/KYTTTrh--WW VAE 2020.
Guido van Capelleveen, Mannes Poel, Roland M Mueller, Dallas Thornton, and Jos van Hillegersberg, Outlier detection in healthcare fraud: A case study in the Medicaid dental domain. International Journal of Accounting Information Systems, 21:18-31, 2016.
Peter B Walker, Jonathan J Haasc, Melissa L Mchalick, Christopher T Stecle, Dale W Russell, and Ian N Davidson. Harnessing melacognition for safe and responsible AI. Technologies, 13(3):107, 2025.
D. B. West. Introduction to Graph Theory. Prentico-Hall, Englewood Cliffs, NJ, 2001.
Hongjing Zhang and lan Davidson. Towards fair deep anomaly detection. In Proceedings of the 2021 ACM Conference on Fairness, Accountabilily, and Transparency, pp. 138 148, New York, NY, 2021. ACM.
Y. Zhang and X. Chen. Explainable Recommendation: A Survey and New Perspectives. ArXiv Report: 1804.11 1192v4 [Rs, 2018. 87 pages.
Z. Zheng, C. Miao, C. Leung, and C. J. Jih. Building more explainable Artificial Intelligence. In Proc. SIGAI Doctoral Consortium, pp. 8044 8055, 2018.
24


Reviews:
[{"review_id": "L93awRovhY", "reviewer": "Reviewer_WKkh", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths:\n- original bridge between fields\n- clearly written\n- pedagogic, with a first algo which is trivial, up to the 3rd, quite non trivial\n- experiments on 3 datasets with very different modalities\n\nWeaknesses:\n- a bit lengthy, at times.\n- some claims slightly over-stated / not discussed carefully enough\n- lack of comparison with previous litterature (might not be possible to address). Although the approach is original, one may be able to better discuss link with previous research using features and not tags (see point 2. \"Claim about tags being used for first time ?\" below)\n- some more less important \"details\", mentionned below (see requested changes)", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "As repeated in abstract, introduction and conclusion, this paper:\n- deals with the problem of Explainable Anomaly detection (XAD).\n- introduces an original bridge between tag subset slection and the Knapsack problem\n- it is data-based and not model-based: it deals with tags in the data to explain how some ML model made its decision on classifying which are the normal/anomalous examples.\n- it thus deals with defining what is normal too.\n- provides time complexity proofs and algorithms.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "I divide my list of changes in required vs suggested, sorted more or less by order of importance.\nNote: I was trained as a Physicist, with an applied maths background. I am not too much into formal proofs, more about intuitions. This is my perspective. It may not be representative of the whle community.\n\n\n# Required changes\n\n## 1. Observation 3.1, coverage vs edge count:\n\nVery interestingly, authors state that\n> Computations based on coverage typically are computationally intractable as they can model versions of the minimum set cover problem (Garey & Johnson, 1979).\n\nI think the paragraph preceding Observation 3.1 is confuising. In particular, the part where p(y), w(y) are interpreted as number of instances covered by y :\n> For any tag node y, the profit of y, denoted by π(y), is the number of outlier instances covered by y; that is, p(y) = |O(y)|. The weight of any tag y, denoted by w(y), is the number of normal instances covered by y; that is, w(y) = |N(y)|. For any tag node y, the utility of y, denoted by µ(y), is given by p(y) − w(y); thus, the utility of a tag is the number of outlier instances covered by y minus the number of normal instances covered by y.\n\nThis is correct but somehow suggests that p(Y) and w(Y) also reflect this coverage, when it does not. I initially thought this was a mathematical error, until I read again the paragraph, noticing that it was discussing w(y) and not w(Y). The coverage is equal to the edge count only for single-element set Y={y}.\n\nI think a small remark, right before or right after observation 3.1, about the fact that the edge count is always larger or equal to the number of covered instances, is needed.\nI note that the weight is an upper bound to the number of normal instances covered (fine since we minimize it), but the profit is also an upper bound to the number of anomalies covered (not nice since we try to maximize it). There could be profite-monster-tags (as in utility monster) that are nasty for your algorithms.\n\n\n## 2. Claim about tags being used for first time ?\n\nThere is a strong claim:\n> As will be pointed out in in the related work section (i.e., Section 6), existing work for XAD does not use semantic tags, generate contrastive explanation or provide a comparable global level explanation; hence, there are no direct comparisons to be made.\n\nHowever, it is not very clear why (semantic) tags are that different from features lying in some range. Any method that usees features' values for explanations could readily be used on tags, when available, no ?\n\nPlease discuss that carefully, or, diminish the claim. In any case, the connection and differences need to be made very clear to the reader.\n\nSimilary, for SHAP values, which are entirely absent from the text and the citations' titles. Using them as tags seems pretty straightforward. I believe the connection/distinction with your approach needs to be made clear.\n\nAlong the same line, it is later written:\n> In contrast, our work is model level and uses semantic tags as a mechanism to generate explanations so does not rely on the feature space being interpretable.\n\nBut, if you do not have semantic tags (interpretable features attached to the data or produced by some algorithm, such as CLIP, although they may not be used for the classification/AD), then you cannot apply your algorith ? So in this sense you are not doing better than explability models which need interpretable tags, right ?\nThis sentence is quite misleading.\n\n## 3. A note about experiments.\n\nIn *A note about experiments.*, you normalize Outliers and Normal samples separately.\nI believe this is not a neutral point at all, and that using instead\n$$(E^Y_\\mathbb{O} - E^Y_\\mathbb{N}) / |E_\\mathbb{O}+ E_\\mathbb{N}|$$\nas normalization, would allow to compare various sizes of datasets, but change the result considerably. In practice, anomalies are usually rare, and if in practice, $ (E^Y_\\mathbb{O} - E^Y_\\mathbb{N})$ is often negative, that's an intersting output.\nIn practice your definition corresponds to considering a\n$(E^Y_\\mathbb{O} - \\rho E^Y_\\mathbb{N})/const.$, where $\\rho$ is related to a measure of the class imbalance, namely $E^Y_\\mathbb{O} / E^Y_\\mathbb{N}$.\n\n1. I think it would be worth discussing this.\n\n2. Ideally, discuss some results with the other normalization that I suggest, or some variant of it.\n\n\n## 3. (non)sorting - time complexity\n> Thus, we can find the top-k tags with respect to utility in O(|V T |) time.\n\nI believe a factor $k$  is missing. Altough $k$  may be small, I find it very confusing to not make it appear in the time complexity computation.\nWhen there are many tags, $k$ may actually become rather large.\n\n\n\n\n## 4. Notations\n\n### 1. p and \\pi\nAround *Optimization Objectives.* the notation $p(y), p(Y)$ is introduced for the profit associated to y, Y. Then it becomes $\\pi(y),\\pi(Y)$. This is confusing and inconsistent. Please stick to $\\pi$ (also through algorithms)\n\n### 2. Knapsack problem vs rest of paper:\nHere it may be my education as a Physicist speaking (not caring too much about abuse of notations) but in the section *Knapsack Problem* you introduce $a_i$ as objects (that are then corresponding to tags). Why not denote them as $u_i$ ? Or $y_i$ actually (see next point).\n\n### 3. Tags\n\nTags are initially denoted y (for a single one) or $y_i$ for tage number $i$. Why shift to $u_i$ after (and yet keep using $Y$ to denote a subset of $\\mathbb{U}$). You could use $y_i, Y, \\mathbb{Y}$ and remain consistent. This would made reading even easier.\n\n### 4. Group #1\n\nIn table 3, you write group #1, 2, 3.\nThis kind of implies outlier groups, when actually it's tag groups. (I noticed this because In Table 3, I noticed that Black_hair is 36% pf the outlier group. Same in table 2.)\nMaybe you could write \"Tags Group #1\" ?\nSame in table 8, 11.\n\n\n\n\n## 5. Explanation\n\n> However, the version of Knapsack arising in the context of contrastive explanation involves numbers whose values are bounded by polynomial functions of the problem size.\n\nHere it's better to state briefly why, intuitively, rather than waiting towards the end of the paper.\nIn the end it's simply that the maximum weight or profit for a given tag is at worst/best, the number of instances. It does not take long to say that.\n\n\n\n\n## 6. Illustrative Example Using MNIST\n\nIn the paragraph *Illustrative Example Using MNIST*,\n> For each of the ten digits, we created a different outlier detection problem and generated an explanation for each.\n> (...)\n> We apply a basic auto-encoder to determine outliers based on their reconstruction error for each digit class separately.\n\n1. These sentences were very unclear to me at first, in the sense that I did not understand the experimental setup. I then saw that it is a rather conventional setup for AD, but, it would not take long to extend the sentence into a couple of them to clarify.\n\nAs I understand it:\n- You train an AE to reconstruct images of the train set, and then consider (for the test set?) as anomalies the top 5% least well reconstructed images, and as normal the other 95%. This setup is considered as the AD ML model.\n- Then your XAD tries to explain the decisions of this ML model (or rather, using test data, explain what is the definition of normality/anomaly).\n- And, you repeat this for the 10 digits independently, meaning that you have 10 independent AE models, each trained to reconstruct only one class of digit ? (this is the part where I'm still not clear). Why not use a single AE for all digits?\n\n2. Also, you say *basic autoencoder*. You could be a bit more precise ? 2 layers MLP with a bottleneck, or something with some convolution layers ?\n\n\n## 7. Conclusion of sec 4.3\n\nI am troubled by the conlusion of sec 4.3. Honestly, this is probably the part that is most technically challenging for me, so I may have misunderstood some things.\n\nIt's not clear to me why constructing (like you do in sec 4.3), for ANY 3-parition setup, AN instance of the MDPC-WC problem that matches it, proves that ANY MDPC-WC problem can be mapped to A 3-partition? Or bounded in complexity by another 3-partition problem ? Which would prove the complexity result.\n\nI have not tried to find one, but it feels like there could exist MDPC-WC instance that do not map to any 3-partition problem.\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Suggested changes\n\nHere I list suggestions that are not required.\n\n## 8. Other directions, discussions\n\nIn formulation 3, the requirement that the explanations are non-overlapping (sets of tags are distinct) is a strong one. I can think of cases where distinct groups of outliers would be epxlain by distinct explanations, but, with some overlapping tags. (like, being female: still, many groups are sub-groups of \"females\").\n\n\n## 9. Still on coverage:\n\n> Computations based on coverage typically are computationally intractable as they can model versions of the minimum set cover problem (Garey & Johnson, 1979).\n\nA quick discussion about how using coverage as a metric (which sounds better than edge count to produce good explanations) would be very nice, maybe in the conclusion, as direction for future work ?\n\n## 10. Clarity\n\npage 11, point 2.\n> Thus, each normal and outlier instance is associated with exactly one tag.\n\nI found point 2., around this sentence, not very clear. You could extend to be clearer, maybe.\n\n\n\n\n\n## 11. Repetitions, (lack of) conciseness\n\n### sec 2 and sec 3.\nI enjoyed the overall clarity, and in particular section 2.\nHowever, when reading section 3, it was not adding much to sec 2, w.r.t. the length of sec 3.\nI would either shorten a lot the text of sec. 2 to remain very high level and not defining everything (not my favorite option); or, better, simply merge section 3 into sec 2. My point is that very little new concepts or notations are introduced in sec. 3: when I read sec 2, I consulted figure 1, and then learnt basically nithing reading sec 3.\n\n### Inside sec 3.\n\nBetween each **Required** paragraph and the paragraph right after it, I see no added value, it's just that the meaning of some quantities is recalled in words.\n\n\n### Knapsack problem\n\nIn *Required*, why not use maths notations s.a. $argmax()_{Y\\in \\mathbb{U}, constraint}$ ?\nAlso, again, a good example of useless sentence:\n\n> Our next lemma points out that DMP-WC problem is indeed an instance of the Knapsack problem.\n> Lemma 4.2. The DMP-WC problem is an instance of the Knapsack problem.\n\n-> clearly the 1st line is useless.\n\n\n\n\n\n## 12. Typos:\n- ...are connected to only to the tags...\n- the goal is find a subset  -> the goal is TO find a subset\n- algorithm 2, line 7 : w(p_i) -> w(u_i)  (that I would denote w(y_i) to remain consistent)", "broader_impact_concerns": "AD has impacts, but precisely this paper contributes to providing explanations for AD ML models, so it's a priori positive.\n\nA downside note: having good and well-grouned algorithms to explain the decisions of models seems good but may induce a kind of ``The Mathiness Effect'' (or Formalism Bias or \"Mathematical Seduction\" effects): one would trust the explainer outputs because it is rigorous, but explanations may still be wrong (if e.g. some tags are missing and the ML, decision-making-model used some features that are not covered by the tags).\nMaybe this should be quickly mentionned somewhere (as a limitaiton of the model).", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "pWMif7hAJo", "reviewer": "Reviewer_iVQ3", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "## Strengths\n\n1. The authors provide solid theoretical analysis for their formulations, including proofs of computational complexity and efficient algorithms for two of the three formulations.\n\n2. The approach works with any anomaly detection algorithm without requiring access to internal mechanisms, making it widely applicable across different contexts.\n\n3.  The method was validated across three 3 data modalities (images, text, and tabular data), which demonstrates its versatility\n\n## Weaknesses\n\n1. The method relies on pre-existing tags/features. This is a drawback since majority of the dataset are not available with tags which limits the adoption of the approach.\n\n2. The paper primarily relies on qualitative assessment of explanations by checking alignment with known ground truths. However, it lacks quantitative metrics to objectively measure explanation quality. The authors could have included metrics such as consistency across similar instances. Without such quantitative evaluation, it's difficult to compare this approach with future methods or understand the trade-offs between the three proposed formulations.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The given paper presents an interesting post-hoc explanation technique for Explainable Anomaly Detection. Given a set of outlier data points, normal data points, and an expansive set of feature tags, the technique aims to select feature tags that contrastively explain outlier data points from the normal data points.\n\nThe authors formulate the problem in 3 ways, each of which expands upon the previous one in terms of constraints or explanation diversity.\n\n1. The first formulation \"Contrastive Explanation\" aims to select tags that describe the outlier points such that the number of normal data points described by the tag are less than the number of outlier points. They expanded this formulation by imposing a constraint of selecting only top k tags. This formulation makes sure to select tags/features that identify the points which are more important in describing the outlier points than normal points.\n\n2. The second formulation adds an upper bound on the number of times a feature tag was used by a normal point. This constraint enforces selection of tags that are much more heavily used when explaining outlier points than normal points.\n\n3. The third formulation extends the previous formulation by selecting n different sets of k tags instead of just using 1 set of k tags. This is a nice approach since multiple different outlier groups do occur.\n\n## Analysis of results\n\nThe authors provide theoretical analysis for each formulation, determining computational complexity and proposing algorithms for solutions. They evaluate their approach on three datasets spanning different modalities: CelebA (images), COMPAS (tabular data), and HateXplain (text data). The results show that their method successfully identifies meaningful patterns in each domain. For CelebA, the explanations reveal biases in how deep learning models define normality. In COMPAS, the method confirms known biases while providing additional insights about correlations between race and crime types. For HateXplain, it effectively distinguishes hate speech patterns from normal speech. The model-agnostic nature of the approach allows it to be applied to explain results from any anomaly detection algorithm without requiring access to the algorithm's internal mechanisms.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "1. [Recommendation] The authors should try to add metrics for measuring consistency across similar instances. Reliable explanations should identify similar tag sets for anomalies that share key characteristics. One way is to measure variance in tag importance scores across similar instances.\n\n2. [Recommendation] It will be nice to see the sensitivity of the method to key hyperparameters, such as the weight constraint in the second formulation and the number of explanation sets in the third formulation.", "broader_impact_concerns": "Given that the paper discusses generation of explanations for anomalies in datasets, it should be kept in mind that explanations, if not correct, and if used for real-world applications can be misleading and may result in cascading issues. Incorrect or imprecise explanations could lead practitioners to focus on the wrong features or patterns when investigating anomalies, hence potentially missing the true causes or wrongly flagging normal instances. This is particularly concerning in high-stakes domains like fraud detection, security monitoring, or healthcare, where decisions based on these explanations could have significant consequences.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "uETktqyqSD", "reviewer": "Reviewer_GHZM", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strength:\n\nThe paper introduces a new contrastive approach specifically designed for anomaly detection, an area where explainability is crucial but underexplored.\n\nTheoretical complexity analysis is rigorous, demonstrating that two formulations are solvable efficiently, while the third is NP-hard. The use of bipartite graphs and knapsack-style optimization problems provides a strong computational foundation.\n\nWeakness:\n\nThe proposed definition of contrast explanations is interesting; however, additional clarification and justification would be helpful. Importantly, similar to traditional XAI techniques, the tags need to be physically meaningful and clearly indicative of the anomaly/outlier predictions. One may question the practicality of generating these tags, especially when dealing with high-dimensional data. For example, the paper uses MNIST for illustration, treating pixels as tags. However, pixels may not be good options for tags, since even minor pixel shifts could challenge the feasibility of the proposed approach.\n\nCorrespondingly, a significant concern arises about what the proposed method actually explains. For example, in the experiments, the proposed method seems less focused on directly explaining the behavior of the Deep SVDD algorithm and more centered on highlighting a potential relationship between Deep SVDD and the tags. While exploring such a relationship can indeed offer insights into Deep SVDD's behavior, it relies heavily on the assumption that the tags are strongly correlated with the predictive input features. The authors should explicitly state this assumption and clarify that their method depends on predefined, high-quality tags closely associated with these predictive features.\n\nAnother point of concern is the current formulation, which treats all edges equally. This uniform approach could be limiting since it overlooks the varying degrees of contribution different features or tags might have. Addressing this could lead to a more nuanced and robust explanation model.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The paper addresses the problem of explainable anomaly detection (XAD) and highlights limitations of existing explainable AI (XAI) techniques in this context. The authors propose a contrastive explanation framework for anomaly detection, which aims to differentiate outliers from normal instances using interpretable semantic tags. Three formulations are introduced: (1) Contrastive Explanation – a model-agnostic explanation maximizing contrastive tags; (2) Strongly Contrastive Explanation – a constrained version ensuring stronger separation between normal and anomalous groups; and (3) Multiple Strongly Contrastive Explanations – A multi-explanation formulation that handles datasets with multiple anomaly types. Theoretical complexity analysis is provided, demonstrating that two of the formulations are solvable in polynomial time, while the third is NP-hard. The paper also presents experimental results on datasets across different modalities (images, text, and databases) to validate the approach.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "I suggest that the authors clarify their assumptions regarding the tags and discuss potential practical methods for generating these tags.\n\nAdditionally, please comment on possible future work addressing the varying degrees of contribution from different tags.", "broader_impact_concerns": "None.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Meta-review: This paper presents a contrastive explanation for anomaly detection. I recommend authors to make the code public for reproducibility.
Decision: Accept (poster)