<!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>Explainable AI Beer Style Classi er</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jose M. Alonso</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A. Ramos-Soto</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>C. Castiello</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>C. Mencar</string-name>
          <email>corrado.mencarg@uniba.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centro Singular de Investigacion en Tecnolox as da Informacion (CiTIUS), Universidade de Santiago de Compostela</institution>
          ,
          <addr-line>Santiago de Compostela</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Computing Science, University of Aberdeen</institution>
          ,
          <country country="UK">United Kingdom</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Department of Informatics, University of Bari \Aldo Moro"</institution>
          ,
          <addr-line>Bari</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper describes how to build an eXplainable Arti cial Intelligent (XAI) classi er for a real use case related to beer style classi cation. It combines an opaque machine learning algorithm (Random Forest) with an interpretable machine learning algorithm (Decision Tree). The result is a XAI classi er which provides users with a good interpretability-accuracy trade-o but also with explanation capabilities. First, the opaque algorithm acts as an \oracle" which nds out the most plausible output. Then, we generate a textual explanation of the given output which emerges as an automatic interpretation of the inference process carried out by the related decision tree, if the outputs from both classi ers coincide. We apply a Natural Language Generation Approach to generate the textual explanations.</p>
      </abstract>
      <kwd-group>
        <kwd>Explainable Arti cial Intelligence</kwd>
        <kwd>Classi cation Task</kwd>
        <kwd>Natural Language Generation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Ethical and legal issues become essential to guarantee the success of (arti cial
intelligence) AI applications which interact with humans into real-world usage [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
Accordingly, a new European General Data Protection Regulation (GDPR) just
took e ect in May 2018. Among other issues, the new GDPR is somehow related
to a \right to explanation" [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ].
      </p>
      <p>
        Researchers have tackled how to model explainability since the pioneer expert
systems [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. More recent studies refer to the structure and function of
explanations [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Moreover, the generation of explanations is also a hot topic in the eld
of decision-support and recommendation systems [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We observe that machine
learning (ML) researchers, in the broad sense, are more and more aware of the
need to consider explainability while designing ML algorithms [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>The rest of the manuscript is organized as follows. Section 2 introduces the
architecture of the XAI classi er. Section 3 describes how our proposal was
evaluated by humans in an on-line survey. Finally, Section 4 concludes this paper
and pinpoints future work.</p>
    </sec>
    <sec id="sec-2">
      <title>The Design of the XAI Classi er</title>
      <p>
        First of all, we gather all the available information (data and expert knowledge)
related to the classi cation problem under consideration. Then, we build the
components of our XAI classi er in an o -line stage as follows:
1. We build an accurate yet non-interpretable ML-based classi er. It acts as an
\oracle" to guide the classi cation procedure. In this paper, we consider the
Random Forest (RF) algorithm [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. It produces an ensemble of decision trees
(C4.5), each one depending on the values of a random vector sampled
independently. Notice that C4.5 [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] is known for its ability to generate classi ers
allowing easy interpretation by humans, no matter their background. Given
a data sample, the inference procedure starts from the root of the tree and
follows a branch by evaluating conditions on attributes for each intermediate
node; eventually, the class corresponding to the leaf node is returned. Even
though the single classi ers in RF are deemed interpretable, their random
combination is hardly interpretable.
2. We build one interpretable ML-based classi er: J48 is the Weka method
implementing C4.5 [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>Then, given a data example to be classi ed (on-line stage), the system
decision is computed as follows. If the class selected by the \oracle" (ML class)
is supported by the interpretable classi er, then this class is considered as the
output class. The related explanation is based on the automatic interpretation
of the related branches in the tree. Otherwise, the system informs the user that
it is not able to provide him/her with an explanation of the given decision.</p>
      <p>
        A Natural Language Generation (NLG) module produces the textual
explanation associated to the output class. Notice that NLG is a well-known area
inside the computational linguistics eld [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In Data-to-Text applications, NLG
plays a key role for generating text that is readable and understandable by
humans [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Many NLG systems have been developed on the basis of the generic
methodology and the architectural framework proposed in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>
        We have already shown the bene ts of using Natural Language for explaining
classi cation tasks [
        <xref ref-type="bibr" rid="ref14 ref15">14, 15</xref>
        ]. Here, we use the open source software rLDCP [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ],
which is an R package based on the Computational Theory of Perceptions [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ].
      </p>
      <p>We design the granular linguistic model (GLMP) which describes how to
interpret in natural language the classi cation procedure carried out by a
decision tree previously learnt from data. The GLMP is a hierarchical network of
perception mappings (PMs) and computational perceptions (CPs). Each CP is
de ned as a tuple (A, WA, RA) where A is a vector of linguistic expressions, WA
and RA are, respectively, vectors of validity and relevance degrees associated to
A. Each PM is de ned as a tuple (U , y, g, T ) where U is a vector of inputs
(being numerical values at the lowest level of the hierarchy and CPs in the rest
of levels), y is the output CP, g is the aggregation function which translates
inputs into output, and T is the text generation algorithm (in the simplest case
just a text template).</p>
      <p>Given a decision tree, the GLMP is built bottom-up. In the lowest level of the
hierarchy, there is a PM associated to each input variable. In the second level,
there is a PM associated to each branch in the tree. At the top of the hierarchy,
there is a PM which aggregates all the branches and gives the output class.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Use Case</title>
      <p>
        We design an XAI classi er regarding 8 beer styles (Blanche, Lager, Pilsner,
IPA, Stout, Barleywine, Porter, and Belgian Strong Ale) in terms of 3 attributes
(color, bitterness and strength). The dataset is made up of 400 instances [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ].
      </p>
      <p>We applied 10-fold cross-validation as evaluation methodology (accuracy is
measured in terms of classi cation rate). Table 1 reports the main values related
to all the classi ers considered in our approach. On the one hand, the
performance of classi ers is described in terms of average accuracy. On the other hand,
to describe the performance of the interpretable classi er (J48), the accuracy is
accompanied by a basic interpretability metric (NB) which counts the number
of branches in a tree. Gain is measured as the accuracy improvement provided
by the RF-based XAI approach with respect to RF considered alone. EXP-J48
represents the percentage of examples for which the explanation of the XAI
classi er is based on the tree generated with J48.</p>
      <p>
        As it can be appreciated in Table 1, the XAI classi er increases accuracy
(gain is +1.25) while the percentage of examples without associated explanation
(1.5%) is almost negligible. Notice that the XAI classi er developed in this paper
outperforms the systems developed in [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] from the point of view of accuracy:
an expert system (8 rules with 3 inputs) with 81.25% of classi cation rate; and a
fuzzy rule-based classi er (9 rules with 2 inputs) with 87.5% of classi cation rate.
Moreover, our XAI classi er also o ers to users added-value textual explanations.
      </p>
      <p>We assessed the quality of the generated explanations in an on-line survey
which was announced via email and via social networks. We showed ve di erent
samples in ve consecutive screens to each interviewee. Notice that we rst
presented the decision made by the XAI classi er along with a related picture.
Then, we included the related explanation along with additional details (see
Fig. 1). Afterwards, we asked interviewees to assess each explanation by rating
the following statements on a ve-level Likert scale: (S1) \The information above
helps you understand the system's decision"; (S2) \The explanation is clear and
does not need to be re-written in a clearer way"; and (S3) \Providing decision
along with explanation helps you to trust the system".</p>
      <p>The main targets of our poll were persons with a Bachelor of Science (BSc)
and native in English (we considered people living in English-speaking countries</p>
      <p>RF J48 RF-based XAI classi er
Accuracy Accuracy NB Accuracy Gain EXP-J48</p>
      <p>95 94.75 10.7 96.25 +1.25 98.5
as native persons). We got feedback from 26 anonymous interviewees (84.61%
with a BSc). The average score was: S1=3.61; S2=2.98; S3=4.05. Notice that
average score around 4 for S3 validates our XAI classi er as a useful system for
the target audience. In addition, the lower score associated to S2 suggests that
the system may be further enhanced by re ning the generated text.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions and Future Work</title>
      <p>We have presented a rst pilot of a beer style XAI classi er. Preliminary
experimental results are encouraging. The designed XAI classi er overwhelms
(regarding accuracy) other classi ers reported in the literature for the same dataset,
while providing the added-value of textual explanations. The utility and
operational value of the generated explanations were evaluated in an on-line survey.</p>
      <p>Even though we have shown qualitatively the feasibility of our proposal,
there is room for further research. We plan extending our survey to a wider
audience and exploring ways to enhance the generated explanations. In this
sense, we will analyze deeper the representation possibilities of GLMP and the
overall NLG framework, with the aim of providing users with clearer and more
actionable explanations. Moreover, we will study how to enhance our framework
with further reasoning capabilities and argument technology.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgements</title>
      <p>J.M. Alonso is supported by RYC-2016-19802 (Ramon y Cajal contract) and
A. Ramos-Soto is funded by the \Conseller a de Cultura, Educacion e
Ordenacion Universitaria" (under the Postdoctoral Fellowship accreditation 481B
2017/030).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>US</given-names>
            <surname>Public Policy Council</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <source>Statement on Algorithmic Transparency and Accountability</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Goodman</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Flaxman</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>European union regulations on algorithmic decision-making and a \right to explanation"</article-title>
          .
          <source>In: ICML Workshop on Human Interpretability in Machine Learning (WHI)</source>
          , New York, NY (
          <year>2016</year>
          )
          <article-title>1{9 https://arxiv</article-title>
          .org/abs/1606.08813.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Wachter</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mittelstadt</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Floridi</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Why a right to explanation of automated decision-making does not exist in the general data protection regulation</article-title>
          .
          <source>International Data Privacy Law</source>
          <volume>7</volume>
          (
          <issue>2</issue>
          ) (
          <year>2017</year>
          )
          <volume>76</volume>
          {
          <fpage>99</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Buchanan</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shortli</surname>
            <given-names>e</given-names>
          </string-name>
          , E.:
          <article-title>Rule-based expert systems: the MYCIN experiments of the Stanford Heuristic Programming Project</article-title>
          .
          <string-name>
            <surname>Addison-Wesley</surname>
          </string-name>
          (
          <year>1984</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Lombrozo</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>The structure and function of explanations</article-title>
          .
          <source>TRENDS in Cognitive Science</source>
          <volume>10</volume>
          (
          <issue>10</issue>
          ) (
          <year>2006</year>
          )
          <volume>464</volume>
          {
          <fpage>470</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Tintarev</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mastho</surname>
          </string-name>
          , J.:
          <article-title>Explaining recommendations: Design and evaluation</article-title>
          . In
          <string-name>
            <surname>Ricci</surname>
          </string-name>
          , F.,
          <string-name>
            <surname>Rokach</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shapira</surname>
          </string-name>
          , B., eds.
          <source>: Recommender Systems Handbook</source>
          . Springer, Boston, MA (
          <year>2015</year>
          )
          <volume>353</volume>
          {
          <fpage>382</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Biran</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cotton</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Explanation and justi cation in machine learning: A survey</article-title>
          .
          <source>In: Proceedings of the IJCAI-17 Workshop on Explainable AI (XAI)</source>
          , Melbourne, Australia (
          <year>2017</year>
          )
          <volume>8</volume>
          {
          <fpage>13</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Ho</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>The random subspace method for constructing decision forests</article-title>
          .
          <source>IEEE Transactions on Pattern Analysis and Machine Intelligence</source>
          <volume>20</volume>
          (
          <issue>8</issue>
          ) (
          <year>1998</year>
          )
          <volume>832</volume>
          {
          <fpage>844</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Quinlan</surname>
            ,
            <given-names>J.R.</given-names>
          </string-name>
          :
          <source>C4</source>
          .
          <article-title>5: Programs for Machine Learning</article-title>
          . Morgan Kaufmann Publishers, San Mateo, CA (
          <year>1993</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Hall</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Frank</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Holmes</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfahringer</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reutemann</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Witten</surname>
            ,
            <given-names>I.H.</given-names>
          </string-name>
          :
          <article-title>The weka data mining software: an update</article-title>
          .
          <source>ACM SIGKDD explorations newsletter 11(1)</source>
          (
          <year>2009</year>
          )
          <volume>10</volume>
          {
          <fpage>18</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Gatt</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krahmer</surname>
          </string-name>
          , E.:
          <article-title>Survey of the state of the art in natural language generation: Core tasks, applications and evaluation</article-title>
          .
          <source>Journal of Arti cial Intelligence Research</source>
          <volume>61</volume>
          (
          <year>2018</year>
          )
          <volume>65</volume>
          {
          <fpage>170</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Ramos-Soto</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bugarin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barro</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>On the role of linguistic descriptions of data in the building of natural language generation systems</article-title>
          .
          <source>Fuzzy Sets and Systems</source>
          <volume>285</volume>
          (
          <year>2016</year>
          )
          <volume>31</volume>
          {
          <fpage>51</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Reiter</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dale</surname>
          </string-name>
          , R.:
          <article-title>Building natural language generation systems</article-title>
          . Cambridge University Press (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Alonso</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ramos-Soto</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reiter</surname>
            , E., van Deemter,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>An exploratory study on the bene ts of using natural language for explaining fuzzy rule-based systems</article-title>
          .
          <source>In: IEEE International Conference on Fuzzy Systems (FUZZ-IEEE)</source>
          .
          <article-title>(</article-title>
          <year>2017</year>
          ) 1{
          <fpage>6</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Alonso</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mencar</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Building cognitive cities with explainable arti cial intelligent systems</article-title>
          .
          <source>In: Proceedings of the Workshop on Comprehensibility and Explanation in AI and ML, 16th International Conference of the Italian Association for Arti cial Intelligence</source>
          , Bari, Italy (
          <year>2017</year>
          )
          <volume>1</volume>
          {
          <fpage>10</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Conde-Clemente</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alonso</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Trivino</surname>
          </string-name>
          , G.:
          <article-title>rLDCP: R package for text generation from data</article-title>
          .
          <source>In: Proceedings of the IEEE International Conference on Fuzzy Systems (FUZZ-IEEE)</source>
          , Naples, Italy (
          <year>2017</year>
          ) 1{
          <fpage>6</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Zadeh</surname>
            ,
            <given-names>L.A.:</given-names>
          </string-name>
          <article-title>A new direction in AI: Toward a computational theory of perceptions</article-title>
          .
          <source>Arti cial Intelligent Magazine</source>
          <volume>22</volume>
          (
          <issue>1</issue>
          ) (
          <year>2001</year>
          )
          <volume>73</volume>
          {
          <fpage>84</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Castellano</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Castiello</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fanelli</surname>
            ,
            <given-names>A.M.:</given-names>
          </string-name>
          <article-title>The FISDeT software: Application to beer style classi cation</article-title>
          .
          <source>In: Proceedings of the IEEE International Conference on Fuzzy Systems (FUZZ-IEEE)</source>
          , Naples, Italy (
          <year>2017</year>
          ) 1{
          <fpage>6</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>