<!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>Interactive xAI-dashboard for Semantic Segmentation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Finn Schürmann</string-name>
          <email>finn.schuermann@kasel.ch</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sibylle D. Sager-Müller</string-name>
          <email>sibylle.sager@hslu.ch</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Late-breaking work</institution>
          ,
          <addr-line>Demos and Doctoral Consortium, colocated with The 2nd World Conference on eXplainable Artificial Intelligence:</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Lucerne University of Applied Sciences and Arts</institution>
          ,
          <addr-line>Suurstoffi 1, CH-6343 Rotkreuz</addr-line>
          ,
          <country country="CH">Switzerland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This article proposes an interactive dashboard for analyzing semantic image segmentation models using eXplainable AI (xAI) methods. It integrates open-source xAI packages with segmentation models from PyTorch and TensorFlow Keras, focusing on road traffic images. Through model-based and post hoc explanation methods, users gain insights into model perceptions. The dashboard facilitates user interaction by allowing selection of model, label, and xAI method, with visualizations displaying segmented images and explanations. The implementation uses Python's Dash library, complemented by PyTorch and external xAI libraries. A demo app showcases model comparisons and xAI method outputs, enhancing transparency and trust in AI systems for safety-critical applications like autonomous driving.</p>
      </abstract>
      <kwd-group>
        <kwd>Computer vision</kwd>
        <kwd>Semantic segmentation</kwd>
        <kwd>explainable AI</kwd>
        <kwd>Human-Machine interaction 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        xAI is a set of methods and procedures which help humans to understand and trust results
created by artificial intelligence (AI) algorithms. Especially in safety-critical applications,
xAI is a key requirement [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. This can be achieved through various validation algorithms.
To obtain an unbiased and comprehensive understanding of the outcomes produced by
existing algorithms for neural networks (NNs) at different depths, this article proposes a
novel interactive dashboard containing a subset of common xAI methods of the most
prominent open source xAI packages. These packages can be used to analyze data and
segmentation models, e.g., from road traffic. The dashboard also allows for a selection of
data and trained segmentation models from common libraries like PyTorch [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>In autonomous driving the perception of environment is an important aspect. Image
segmentation, a frequently used technique in this application, assigns a label to every pixel
in an image so that pixels with the same label share certain characteristics. It is important
that these segmentation models have a high accuracy and efficiency as they are included in
driver assistance systems. xAI enables the user to analyze the performance of the
segmentation models. Thus, it helps the AI developer – in the example of machine vision for
autonomous vehicles – to check if the model evaluates the situation shown in the image
correctly. However, the segmentation models and xAI methods are not yet optimised for
autonomous driving. While they can assist in the resolution of issues, their development in
this field is not yet sufficiently advanced.</p>
      <p>
        From 2015 to 2021, more than 150 xAI related tools have been published [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. In general
the tools are implemented for image classification, because the xAI-methods were initially
developed for image classification [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. For both machine vision tasks, image classification
and semantic segmentation, heatmaps can be employed to help the user to find out if the
model learned what it was expected to learn. During the analysis of the widely used
xAItools, we did not come across a specific tool dedicated solely to image segmentation. The
Neuroscope framework [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] has been one approach towards xAI analysis for image
segmentation (plus image classification). However, it is important to note that its
implementation is platform-dependent and there are currently no plans for further
development [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Therefore, we intend to fill the gap by implementing a novel
platformindependent dashboard for image segmentation specifically. Our goal is to insert the most
common segmentation models and xAI-methods in a dashboard with user-friendly
interaction possibility.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Models and xAI-Methods</title>
      <sec id="sec-2-1">
        <title>2.1. Models</title>
        <p>The right choice of model for computer vision tasks is crucial. The library from PyTorch
specifies which model is preferable for which task. Table 1 shows an overview of the models
for image segmentation used in the dashboard. The models can be categorised in fully
convolutional networks (FCN) and DeepLabV3 networks.</p>
        <p>
          The first model class comprises FCN ResNet models which take inputs of different sizes
and produce outputs of corresponding sizes. Segmentation networks are based on
classification networks with little adaption. ResNet is a deep convolutional neural network
proposed by Microsoft. With residual blocks that help optimise a residual function, this
architecture allows accuracy to be increased by increasing the depths of layers [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. The
number “50”, for example in FCN ResNet 50, represents the number of layers in the network.
All models in Table 1 are pretrained with the PASCAL VOC dataset.
        </p>
        <p>
          The second model class is the DeepLabV3 model, which is based on the Resnet 50, Resnet
101 or MobileNet3 backbone. The difference is that DeepLabV3 uses atrous convolution,
also called dilated convolution. The models based on atrous convolution are actively
researched for in semantic segmentation [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. DeepLabV3 uses the MobileNetV3-Large
model, which is 34% faster than its predecessor at the same accuracy level for cityscape
segmentation. The reason for the speed increase of mobile models is two-fold: First,
MobileNetV3 uses the hard sigmoid function instead of the standard sigmoid function
because the hard sigmoid function has much lower latency costs [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. Second, mobile models
employ atrous convolution meaning that the kernel laid over the input has some holes. The
size of the holes can be controlled by the hyperparameter rate. The default convolution sets
the rate to 1. The more the rate increases, the more it is possible to encode the object with
multi-scale context [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. xAI-Methods</title>
        <p>
          Our dashboard in its current implementation uses Layer GradCAM, LIME, Feature Ablation,
and Saliency as xAI-methods. xAI-methods can be categorized in model-specific and
modelagnostic methods. Model-specific methods calculated the effect of changes in the input
features to the output using the model itself, while model-agnostic methods work by
manipulating input data and analyzing the respective model predictions without knowledge
of the model. Within the subclasses of specific and agnostic, one can further distinguish
between local or global methods. Local methods explain the individual predictions of
models, while global methods explain the behavior of the model averaged over all samples
[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ],[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ],[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
        </p>
        <p>
          Gradient-weighted Class Activation Mapping (GradCAM) [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] is a technique that
analyzes gradient information for any convolutional layer of a model and generates a
heatmap that highlights important regions in the image. This method operates through
forward passes without backpropagation.
        </p>
        <p>
          Local Interpretable Model Agnostic Explanations (LIME) [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] trains an interpretable
surrogate model. The model is evaluated at sampling points around a defined input example
to train a simple surrogate model. It is a model-agnostic, perturbation-based approach.
        </p>
        <p>
          Feature Ablation [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] is perturbation-based and calculates attribution, by replacing each
input feature with some reference, and calculating the difference in output. A set of features
can be turned off together instead of one at a time.
        </p>
        <p>
          Saliency [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] calculates the gradients with respect to inputs.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Implementation</title>
      <p>
        The goal is to deliver a dashboard that allows the user to interactively check an AI model
for semantic segmentation using a variety of xAI methods. This involves finding the
tradeoff between technical depth on one side and comprehensibility by the ordinary user on the
other side. The dashboard is implemented with python using Dash [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Dash is a library
from Plotly to create web apps without need to write code in JavaScript or HTML. Dash in
combination with PyTorch yields good visualization possibilities for segmented models. xAI
methods were implemented using the Captum library [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and the pytorch-grad-cam library
from Jacob Gildenblat [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Function of dashboard</title>
      <p>The dashboard can be used to compare xAI methods for different segmentation models. As
a first step, a demo app has been implemented with the goal to show the user the main
working principles of the dashboard. This will help the user to get accustomed to the tool.
The demo app can be opened with the tab “show demo”. In the dropdown menus as shown
in Figure 1 the segmentation models for comparison can be chosen. If on both images a
model is selected, the difference between the segmented images of the two models gets
visible on the bottom left side. This image is obtained by taking the pixelwise difference of
the arrays of the two segmented images.</p>
      <p>The segmented image is overlaid with the original one so that the user can easily see the
quality of the segmentation. By showing the differences, the model quality can be easily
compared visually. This helps the user to decide for an appropriate model. After selecting
a model, the user chooses a label from the dropdown menu “Label Selection”, as shown in
Figure 2. The labels are, in the preliminary version, predefined since the dashboard only
allows the selection of pre-trained models from PyTorch.</p>
      <p>After the label is selected, up to two xAI methods can be chosen from the dropdown
menu, one on the left-hand side, another on the right-hand side. Then, the upper row shows
the original image overlaid with the heatmap from the corresponding xAI methods. If two
xAI methods are selected, the difference of their corresponding heatmaps is shown in the
lower right section to allow for direct visual comparison. On a technical level, the user has
to make sure to select the same label for both xAI methods to make the comparison
meaningful. The difference of the heatmaps is calculated as soon as the methods are selected
in both filter bars. If a method is not selected in one of the filters, the element will indicate
which filter needs to have a method chosen, as shown in Figure 3.</p>
      <p>This is not the final state of the dashboard: One the lower right section, it is planned to
include metrics to evaluate the xAI methods, e.g., from the library Quantus [17]. Currently,
Quantus is only applicable to image classification, but with a few modifications, it should be
possible to apply it to image segmentation as well. Also, the metrics have to be pre-selected
first. For implementation everything is documented on GitHub*2.
2 https://github.com/fschurma/xAI_dashboard</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>
        The demo app with the functions described above serves as the foundation of the final app
currently under construction. The goal of the final version is to allow the users to import
their own image(s) and segmentation model(s) to test its/their performance. This enables
the user to adjust the models. In the current state, comparison of two models and two
methods is possible only visually. It is planned to display evaluation metrics additionally,
which would be a benefit compared to similar implementations like Neuroscope [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Metrics
could be based on those from Quantus [17]. However, this will require first to study which
of the metrics can be transferred from classification to segmentation tasks. The xAI
methods employed in this demo app are just a small selection which will be extended to a
larger subset like, e.g., in Neuroscope. For a better visualization, it is planned to include a
color scale to illustrate the magnitude of the image differences. As a last step, the app will
be thoroughly tested to make sure it will meet the requirements for user-friendly
humanmachine interaction.
[17] A. Hedström et al., ‘Quantus: An Explainable AI Toolkit for Responsible Evaluation of
Neural Network Explanations and Beyond’. arXiv, Feb. 14, 2022. Accessed: May 13,
2024. [Online]. Available: http://arxiv.org/abs/2202.06861.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>F.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Uszkoreit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Du</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Fan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and J.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <string-name>
            <surname>Explainable</surname>
            <given-names>AI</given-names>
          </string-name>
          : A Brief Survey on History, Research Areas, Approaches and Challenges,
          <source>in Natural Language Processing and Chinese Computing</source>
          , vol.
          <volume>11839</volume>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Tang</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>Y.</given-names>
            <surname>Kan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Li</surname>
          </string-name>
          , and H. Zan, Eds.,
          <source>in Lecture Notes in Computer Science</source>
          , vol.
          <volume>11839</volume>
          , Cham: Springer International Publishing,
          <year>2019</year>
          , pp.
          <fpage>563</fpage>
          -
          <lpage>574</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>030</fpage>
          -32236-6_
          <fpage>51</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <article-title>[2] Models and pre-trained weights - Torchvision 0.16 documentation'</article-title>
          .
          <source>Accessed: Oct. 24</source>
          ,
          <year>2023</year>
          . [Online]. Available: https://pytorch.org/vision/stable/models.html#semanticsegmentation
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>N.</given-names>
            <surname>Uhl</surname>
          </string-name>
          ,
          <article-title>Making It Easier to Compare the Tools for Explainable AI, Partnership on AI</article-title>
          .
          <source>Accessed: Nov. 26</source>
          ,
          <year>2023</year>
          . [Online]. Available: https://partnershiponai.org/making-iteasier
          <article-title>-to-compare-the-tools-for-explainable-ai/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>C.</given-names>
            <surname>Schorr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Goodarzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Chen</surname>
          </string-name>
          , and
          <string-name>
            <given-names>T.</given-names>
            <surname>Dahmen</surname>
          </string-name>
          ,
          <article-title>Neuroscope: An Explainable AI Toolbox for Semantic Segmentation and Image Classification of Convolutional Neural Nets</article-title>
          , Appl. Sci., vol.
          <volume>11</volume>
          , no.
          <issue>5</issue>
          , p.
          <fpage>2199</fpage>
          ,
          <string-name>
            <surname>Mar</surname>
          </string-name>
          .
          <year>2021</year>
          , doi: 10.3390/app11052199.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>C.</given-names>
            <surname>Schorr</surname>
          </string-name>
          , Personal Communication,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>K.</given-names>
            <surname>Le</surname>
          </string-name>
          , '
          <article-title>A quick overview of ResNet models'</article-title>
          ,
          <source>MLearning.ai</source>
          .
          <source>Accessed: Nov. 07</source>
          ,
          <year>2023</year>
          . [Online]. Available: https://medium.com/mlearning-ai/
          <article-title>a-quick-overview-of-resnetmodels-f8ed277ae81e</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>L.-C.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Papandreou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Schroff</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Adam</surname>
          </string-name>
          ,
          <article-title>Rethinking Atrous Convolution for Semantic Image Segmentation</article-title>
          . arXiv, Dec.
          <volume>05</volume>
          ,
          <year>2017</year>
          . Accessed: Nov.
          <volume>12</volume>
          ,
          <year>2023</year>
          . [Online]. Available: http://arxiv.org/abs/1706.05587
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Howard</surname>
          </string-name>
          et al.,
          <article-title>'Searching for MobileNetV3'</article-title>
          . arXiv, Nov.
          <volume>20</volume>
          ,
          <year>2019</year>
          . Accessed: Nov.
          <volume>07</volume>
          ,
          <year>2023</year>
          . [Online]. Available: http://arxiv.org/abs/
          <year>1905</year>
          .02244
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Introduction</surname>
          </string-name>
          · Captum'.
          <source>Accessed: Dec. 02</source>
          ,
          <year>2023</year>
          . [Online]. Available: https://captum.ai/
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>C.</given-names>
            <surname>Molnar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Casalicchi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Bischl</surname>
          </string-name>
          (
          <year>2020</year>
          ).
          <article-title>Interpretable Machine Learning - A Brief History, State-of-the-Art and Challenges</article-title>
          . In: Koprinska,
          <string-name>
            <surname>I.</surname>
          </string-name>
          , et al.
          <source>ECML PKDD 2020 Workshops. ECML PKDD 2020. Communications in Computer and Information Science</source>
          , vol
          <volume>1323</volume>
          . Springer, Cham. https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -65965-3_
          <fpage>28</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Munn</surname>
          </string-name>
          and D. Pitman,
          <article-title>Explainable AI for practitioners: designing and implementing explainable ML solutions</article-title>
          . Beijing, Sebastopol, CA:
          <string-name>
            <given-names>O</given-names>
            <surname>'Reilly</surname>
          </string-name>
          ,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>R.</given-names>
            <surname>Selvaraju</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Cogswell</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. Das</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Vedantam</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Parikh</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Batra</surname>
          </string-name>
          , '
          <article-title>Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization'</article-title>
          ,
          <source>International Journal Computer Vision</source>
          , vol.
          <volume>128</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>336</fpage>
          -
          <lpage>359</lpage>
          , Feb.
          <year>2020</year>
          , doi: 10.1007/s11263- 019-01228-7.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>M. T.</given-names>
            <surname>Ribeiro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Singh</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Guestrin</surname>
          </string-name>
          ,
          <article-title>"Why Should I Trust You?": Explaining the Predictions of Any Classifier</article-title>
          . arXiv, Feb.
          <volume>26</volume>
          ,
          <year>2016</year>
          . Accessed: May 13,
          <year>2024</year>
          . [Online]. Available: http://arxiv.org/abs/1602.04938.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>K.</given-names>
            <surname>Simonyan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Vedaldi</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Zisserman</surname>
          </string-name>
          ,
          <article-title>Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps</article-title>
          . arXiv, Apr.
          <volume>19</volume>
          ,
          <year>2014</year>
          . Accessed: Mar.
          <volume>20</volume>
          ,
          <year>2024</year>
          . [Online]. Available: http://arxiv.org/abs/1312.6034
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <article-title>'Dash Documentation &amp; User Guide | Plotly'</article-title>
          .
          <source>Accessed: Apr. 05</source>
          ,
          <year>2024</year>
          . [Online]. Available: https://dash.plotly.com/
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>J.</given-names>
            <surname>Gildenblat</surname>
          </string-name>
          , '
          <article-title>jacobgil/pytorch-grad-cam'</article-title>
          .
          <source>Apr</source>
          .
          <volume>05</volume>
          ,
          <year>2024</year>
          . Accessed: Apr.
          <volume>05</volume>
          ,
          <year>2024</year>
          . [Online]. Available: https://github.com/jacobgil/pytorch-grad-cam
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>