<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Teaching AI to Explain its Decisions Can A ect Class Balance</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kevin Volkert</string-name>
          <email>volkert@stud.uni-bamberg.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Cognitive Systems Group, University of Bamberg https://</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>TED has been proposed as a simple framework for using any supervised classi cation approach to create Explainable AI models [3]. It requires manual annotation of training data with explanations. The authors of TED report that it yields results as good or better than conventional supervised learning. This paper shows that one possible reason for this is that the extension of training data can introduce bias by changing the class distribution. Experiments on the Iris dataset and a synthetic dataset show that TED performs signi cantly worse than initially reported when using class weights during training to o set class imbalance in training data.</p>
      </abstract>
      <kwd-group>
        <kwd>Explainable AI</kwd>
        <kwd>Supervised classi cation</kwd>
        <kwd>Machine learning</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Explainable Arti cial Intelligence as a eld of research is becoming more popular.
While black-box approaches like deep learning have been very successful, good
performance alone is not always enough. As AI becomes more widely used it also
becomes more important to understand what it is actually doing. A decision may
be good if it is correct, but it is better if it is correct and understandable.</p>
      <p>
        There are good, old-fashioned AI approaches, like Inductive Logic
Programming (ILP), which are inherently white-box and thus interpretable. This can,
for example, be used to generate human-readable representations of the
decision making of a system. Dare2Del [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] is an ILP-based companion system which
learns rules that are directly interpretable and can be presented to end users as
explanations for suggested actions.
      </p>
      <p>
        LIME [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is a technique proposed with the goal of adding explainability to
arbitrary classi ers. This has become a popular idea (Google Scholar lists over
2,400 citations at the time of this writing). For example, this can be used to gain
insight into black-box approaches like deep neural networks.
      </p>
      <p>Copyright © 2020 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).</p>
      <p>
        Another approach has a similar goal, but a very di erent design: TED
(Teaching Explanations for Decisions ) is a simple, high-level framework . The basic idea
is to use any supervised classi cation approach to learn not only labels, but also
explanations. This approach depends heavily on the quality of the training data.
The authors explicitly state the importance of good explanations provided by
domain experts [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        Its high-level, semi-manual nature makes this approach very exible. The
explanations are part of the training data, therefore they can be adapted to a
variety of domains and target groups. The authors argue that the requirement
to manually create training data with explanations can also help reduce bias,
since adding a biased example would be hard to justify [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>However, bias is not always obvious when considering single examples. Class
imbalance is one type of bias that can occur in training data. When classes are
not equally distributed, trained classi ers may inadvertently favor more frequent
classes when making predictions.</p>
      <p>
        This paper investigates this problem in the context of TED. In section 2 the
design of the TED framework is described and the original evaluation by [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is
summarized. Section 3 shortly explains how class imbalance can become an issue
when using TED. Section 4 presents experiments that make the issue apparent.
Finally, section 5 provides a conclusion.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        TED, unlike traditional classi cation approaches, learns class labels and
explanations from examples [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Any supervised classi cation approach can be used
with TED. The training data consists of:
      </p>
      <sec id="sec-2-1">
        <title>X a set of features</title>
        <p>Y a class label for X
E an explanation for Y
The form and content of explanations are not speci ed and may contain arbitrary
values. The only constraint is that they must be enumerable.</p>
        <p>
          Because explanations are meant to be provided as part of the training data,
the application of TED is extremely simple. Instead of learning only labels from
examples (X ! Y ), TED learns labels and explanations (X ! Y E). The
Cartesian product instantiation described in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] simply encodes labels and explanations
as Y E before training. Then the trained model predicts Y E which is decoded
into a separate label and explanation.
        </p>
        <p>The Cartesian product instantiation of TED has been evaluated on two
datasets. The Tic-Tac-Toe example is based on the game of tic-tac-toe. The
legal non-terminal board positions are labeled with the optimal move to make
and an explanation based on a small set of rules for playing the game. For any
move, the explanation can be (in order of preference):</p>
      </sec>
      <sec id="sec-2-2">
        <title>1. win (if the game is won with the move)</title>
        <p>2. block (if the move prevents the other player from winning)
3. threat (if the game could be won with the following move)
4. empty (otherwise).</p>
        <p>This results in a dataset of 4,520 examples. There are 36 possible combinations
of label and explanation, since each rule can apply to 9 di erent moves.</p>
        <p>
          The Loan Repayment example contains 10,000 applications for credit with
two labels (good or bad payment performance). Explanations are not included in
the original dataset. In [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] explanations were generated by applying a small rule
set on the data. Two rules consisting of three literals each were used to classify
the data. The labels of examples that were not consistent with these rules were
changed. For positive examples, the rule itself was used as the explanation.
For negative examples, the explanation was determined by the rule whose rst
literal matched, combined with which of the other literals that did not match.
This resulted in 8 explanations.
        </p>
        <p>
          Table 1 shows the accuracy in the Tic-Tac-Toe and Loan Repayment
examples reported in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. The results appear promising, though they are unexpected.
The performance for label prediction is reported to be as good or better than
that of the equivalent models without the TED framework. In the evaluation of
the Tic-Tac-Toe example in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] the authors point out that, \[g]iven the increase
in number of classes, one might expect the accuracy to decrease." They also
admit that the accuracy in the Loan Repayment example \may be arti cially
high due to the data generation method" [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
Adding explanations to the training data and learning the explanations in
addition to the labels results in a larger output space. Each class may have multiple
possible explanations. The authors of TED describe this as an implicit 2-level
hierarchy in the data that could potentially be exploited [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
        </p>
        <p>In the Cartesian product instantiation the result is simply a larger number
of classes and therefore a smaller number of examples per class compared to
the same dataset without added explanations. This means that the underlying
classi er in a simple TED instance has to learn more from less. Intuitively there
should be a decrease in performance.</p>
        <p>The addition of explanations to an existing dataset can change the e ective
class balance. Even if the original class labels are left untouched, it is possible to
have a di erent number of explanations for each class. In that case the combined
Y E learned by the classi er will not have the same distribution of classes as the
original dataset without explanations. This can introduce or change existing bias
in the training data.</p>
        <p>It seems plausible that the improved performance which TED shows (in
comparison to an equivalent classi er trained without explanations) is at least
partially due to this altered class balance. Section 4 attempts to test this idea.
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Experiments</title>
      <p>
        In this section TED is evaluated on two additional datasets: the well-known Iris
ower dataset [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] (included in scikit-learn) and the Proactive Retention dataset
(included in the TED source code). The performance of di erent classi ers is
compared in di erent con gurations:
{ with/without TED (i. e. with/without explanations)
{ with/without balanced class weights for the underlying classi ers
      </p>
      <p>
        TED is included in IBM AIX360 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] which is implemented using
scikitlearn [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. scikit-learn provides a parameter class weight which can be used to
balance classes. When this parameter is set to \balanced", each sample is given
a weight that is inversely proportional to the class frequency in the training data.
This prevents the classi er from being biased toward a certain class simply
because it has the most examples.
      </p>
      <p>Three classi ers were chosen for these experiments: a Support Vector
Machine (SVM) classi er, a Decision Tree classi er, and a DummyClassi er. The
DummyClassi er is used with the strategy parameter set to \strati ed". It makes
predictions by choosing a label randomly, considering the class distribution of
the training data. This makes bias through class imbalance obvious, since the
DummyClassi er does not have any other biases.</p>
      <p>All experiments in this section were executed using AIX360 version 0.2 and
scikit-learn version 0.21.
4.1</p>
      <sec id="sec-3-1">
        <title>Iris Dataset</title>
        <p>The Iris ower dataset consists of 150 examples of 3 types of owers (iris
setosa, iris versicolor, iris viginica ). The 3 classes are equally distributed, i. e.
there are 50 examples per class. There are 4 real-valued features for petal/sepal
length/width.</p>
        <p>Proper manual annotation would require domain knowledge. Since this
requirement could not be ful lled for this paper, a decision tree (standard
parameters, no maximum depth) was trained on the full dataset. This over tted decision
tree perfectly predicts every example in the dataset. The leaves (identi ed by
the node number) of this tree were used as explanations (see gure 1).</p>
        <p>This results in a total of 9 explanations:
{ 1 for iris setosa
{ 3 for iris versicolor
{ 5 for iris virginia
These are also all possible Y E combinations.</p>
        <p>
          node #4
petal width (cm) &lt;= 1.65
samples = 48
value = [
          <xref ref-type="bibr" rid="ref1">0, 47, 1</xref>
          ]
class = versicolor
        </p>
        <p>node #0
petal width (cm) &lt;= 0.8</p>
        <p>samples = 150
value = [50, 50, 50]</p>
        <p>class = setosa
True</p>
        <p>False
node #1
samples = 50
value = [50, 0, 0]
class = setosa
setosa, versicolor, and virginica samples in the sub-tree.</p>
        <p>Unlike the labels, the combined labels and explanations are not equally
distributed (see table 2).</p>
        <p>
          An SVM classi er (default parameters), a decision tree (maximum depth of
2 to prevent over tting), and a DummyClassi er were trained using a 33% test
data split (i. e. 100 training examples). The results of the classi ers without
balanced class weights can be seen in table 3. The accuracy of the SVM and decision
tree are consistent with the evaluation in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. Performance on label prediction
is either as good (SVM) or even better (a 4 percentage point increase for
decision tree) when explanations are included in the training data. The prediction
accuracy on explanations is also quite high.
        </p>
        <p>The DummyClassi er shows a surprising increase in accuracy. Without
explanations, labels are predicted with 34% accuracy, which is to be expected
from a classi er that chooses randomly from 3 equally distributed labels. With
explanations, however, the performance increases by over 10 percentage points.
With balanced class weights, the SVM and decision tree yield noticably
different results (see table 4). Accuracy without explanations is the same. With
explanations the prediction performance for both labels and explanations
decreases signi cantly. Label accuracy drops by 12{30 percentage points, and the
prediction of explanations is only about two-thirds as good.</p>
        <p>The Iris dataset is admittedly quite small. The next section repeats the same
experiments on a larger, synthetic dataset.
4.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Proactive Retention Dataset</title>
        <p>The TED source code in the IBM AIX360 repository (https://github.com/IBM
/AIX360/) includes a synthetic dataset that is used in the Proactive Retention
tutorial. The intended use case is nding employees who are at risk of leaving a
company.</p>
        <p>The data is generated according to distribution functions. There are 8
features:
Each feature has a non-uniform distribution from which the values are randomly
sampled.</p>
        <p>There are two labels, Yes and No, expressing whether proactive retention is
necessary for a given employee or not. Explanations are generated by applying
25 rules based on the features. If any of these rules applies to an example, it is
labeled Yes with the rule number as explanation. If no rule applies, the example
is labeled No. The dataset in the TED source code contains 10,000 examples of
which 33.8% are labeled Yes.</p>
        <p>The SVM classi er was trained with default parameters. The decision tree
was trained with a maximum depth of 5.</p>
        <p>The results are similar to the ones in section 4.1 with regard to class
balance (see table 5), but more in line with the expectation stated in section 3.
Without balanced class weights, the TED-augmented versions of the classi ers
perform worse than their counterparts without explanations by about 6
percentage points. The DummyClassi er improves very slightly in label prediction. The
accuracy for explanations is at roughly the same level as for labels.</p>
        <p>
          With balanced class weights, however, both the SVM and the decision tree
again perform much worse. Label prediction performance decreases by 18{40
percentage points.
This paper performs additional experiments based on the work by [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] and
attempts to investigate the unexpected performance gains that arise from making
a machine learning problem harder.
        </p>
        <p>The experiments show that class imbalance can be a problem. If training data,
especially small datasets, is not carefully created or extended, the distribution of
classes can become an issue. The simple Cartesian product instantiation of TED
can be very sensitive to training data. Especially when augmenting existing data
with explanations to make it compatible with TED, it can be easy to overlook
the introduced or changed bias.</p>
        <p>Using balanced class weights to counteract the bias in the class distribution of
the training data results in a large decrease in performance in both experiments
(see section 4). This shows that at least some of the accuracy increases in label
prediction that TED achieves compared to equivalent classi ers trained without
explanations may be based on the aforementioned bias.</p>
        <p>
          Since manual work on datasets is time-consuming, methods that
automatically generate explanations for existing datasets or create synthetic datasets
from scratch are very appealing. Such methods have been used in the original
work by [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] as well as in this paper. It would, however, be more interesting to
see how TED performs on a more realistic, representative dataset.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgments</title>
      <p>Prof. Dr. Ute Schmid, head of Cognitive Systems Group at University of
Bamberg, held a seminar on Explainable AI during the winter semester 2019/2020
out of which this paper emerged.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Arya</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bellamy</surname>
            ,
            <given-names>R.K.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>P.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dhurandhar</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hind</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ho man</surname>
          </string-name>
          , S.C.,
          <string-name>
            <surname>Houde</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liao</surname>
            ,
            <given-names>Q.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luss</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mojsilovic</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mourad</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pedemonte</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Raghavendra</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Richards</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattigeri</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shanmugam</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Singh</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Varshney</surname>
            ,
            <given-names>K.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wei</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , Zhang, Y.:
          <article-title>One Explanation Does Not Fit All: A Toolkit and Taxonomy of AI Explainability Techniques</article-title>
          . arXiv:
          <year>1909</year>
          .03012 [cs, stat] (
          <year>Sep 2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. Fisher, R.A.:
          <article-title>The Use of Multiple Measurements in Taxonomic Problems</article-title>
          .
          <source>Annals of Eugenics</source>
          <volume>7</volume>
          (
          <issue>2</issue>
          ),
          <volume>179</volume>
          {
          <fpage>188</fpage>
          (
          <year>1936</year>
          ). https://doi.org/10.1111/j.1469-
          <fpage>1809</fpage>
          .
          <year>1936</year>
          .tb02137.x
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Hind</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wei</surname>
          </string-name>
          , D.,
          <string-name>
            <surname>Campbell</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Codella</surname>
            ,
            <given-names>N.C.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dhurandhar</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mojsilovic</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Natesan Ramamurthy</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Varshney</surname>
            ,
            <given-names>K.R.:</given-names>
          </string-name>
          <article-title>TED: Teaching AI to Explain its Decisions</article-title>
          .
          <source>In: Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society</source>
          . pp.
          <volume>123</volume>
          {
          <fpage>129</fpage>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (Jan
          <year>2019</year>
          ). https://doi.org/10.1145/3306618.3314273
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Pedregosa</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Varoquaux</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gramfort</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Michel</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thirion</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grisel</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Blondel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prettenhofer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weiss</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dubourg</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vanderplas</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Passos</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cournapeau</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brucher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perrot</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Duchesnay</surname>
          </string-name>
          , E.:
          <article-title>Scikit-learn: Machine learning in Python</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          <volume>12</volume>
          ,
          <volume>2825</volume>
          {
          <fpage>2830</fpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ribeiro</surname>
            ,
            <given-names>M.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Singh</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guestrin</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>"Why Should I Trust You?": Explaining the Predictions of Any Classi er</article-title>
          .
          <source>arXiv:1602</source>
          .04938 [cs, stat] (
          <year>Aug 2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Siebers</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmid</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Please delete that! Why should I?: Explaining learned irrelevance classi cations of digital objects</article-title>
          .
          <source>KI - Kunstliche Intelligenz</source>
          <volume>33</volume>
          (
          <issue>1</issue>
          ),
          <volume>35</volume>
          {44 (Mar
          <year>2019</year>
          ). https://doi.org/10.1007/s13218-018-0565-5
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>