<!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>CLAIMED, a visual and scalable component library for Trusted AI</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Romeo Kienzler</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ivan Nesic</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>IBM, Center for Open Source Data and AI Technologies</institution>
          ,
          <addr-line>CODAIT</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University Hospital of Basel, Department of Radiology and Nuclear Medicine</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Deep Learning models are getting more and more popular but constraints on explainability, adversarial robustness and fairness are often major concerns for production deployment. Although the open source ecosystem is abundant on addressing those concerns, fully integrated, end to end systems are lacking in open source. Therefore we provide an entirely open source, reusable component framework, visual editor and execution engine for production grade machine learning on top of Kubernetes, a joint effort between IBM and the University Hospital Basel. It uses Kubeflow Pipelines, the AI Explainability360 toolkit, the AI Fairness360 toolkit and the Adversarial Robustness Toolkit on top of Elyra, Kubeflow, Kubernetes and JupyterLab. Using the Elyra pipeline editor, AI pipelines can be developed visually with a set of jupyter notebooks. We explain how we've created a COVID-19 deep learning classification pipeline based on CT scans. We use the toolkit to highlight parts of the images which have been crucial for the models decisions. We detect bias against age and gender and finally, show how to deploy the model to KFServing to share it across different hospital data centers of the Swiss Personalized Health Network.</p>
      </abstract>
      <kwd-group>
        <kwd>1 Kubernetes</kwd>
        <kwd>Kubeflow</kwd>
        <kwd>JupyterLab</kwd>
        <kwd>Elyra</kwd>
        <kwd>KFServing</kwd>
        <kwd>TrustedAI</kwd>
        <kwd>Explainable AI</kwd>
        <kwd>XAI</kwd>
        <kwd>AI Fairness</kwd>
        <kwd>AI Adversarial Robustness</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Open source software for performing individual AI pipeline tasks are abundant, but the community
lacks a fully integrated, trusted and scalable visual tool. Therefore we have built CLAIMED, the
visual Component Library for AI, Machine Learning, ETL and Data Science which runs on top of
Elyra capable of pushing AI pipelines of any kind to Kubernetes. Any containerized application can
become a component of the library. CLAIMED has been released under the Apache v2 open source
license. In the following we introduce the open source components we are integrating in our current
release, followed by an overview of different component categories paired with a description of
exemplary components used in health care. This pipeline is also available in open source.
1.1.</p>
    </sec>
    <sec id="sec-2">
      <title>Containerization and Kubernetes</title>
      <p>Virtualization opened up a lot of potential for managing the infrastructure, mainly the ability to run
different operating systems on the same hardware at the same time. Next step of isolation can be
performed for each of the microservices running on the server, but instead of managing access rights
and resources on the host operating system, we can containerize these in separate packages with their
own environments. Practical effect of this is that we are running each of the microservices as if they
have their own dedicated virtual machine, but without the overhead of such endeavour. This is
accomplished by running containers on top of the host operating system. An example of the
containerization platform is Docker.</p>
      <p>Containerization made it possible to run a large number of containers, which introduced the need of
their orchestration. This means something, and hopefully not someone, needs to constantly take care
that the system is in the desired state, it needs to scale up or down, manage communication between
containers, schedule them, manage authentications, balance the load etc. Although there are other
options like Docker Swarm, Kubernetes is the market leader in this domain. It was donated to CNCF
by Google, which means a lot of Google’s know-how and years of experience went into it. The system
can run on public, on-prem or on hybrid clouds. On-prem installation is very important for institutions
dealing with sensitive data. For IBM, Kubernetes is also strategic, joining CNCF, having moved all
Watson Services to Kubernetes and aquired RedHat, IBM is now 3rd largest comitter to Kubernetes.
1.1.</p>
    </sec>
    <sec id="sec-3">
      <title>DeepLearning with TensorFlow</title>
      <p>
        It is the second incarnation of the Google Brain project’s scalable distributed training and inference
system named DistBelief [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. It supports myriad of hardware platforms, from mobile phones to
GPU/TPU clusters, for both training and inference. It can even run in browser on the client’s side,
without the data ever leaving the machine. Apart from being a valuable tool in research, it is also
being used in demanding production environments. On a development side, representing machine
learning algorithms in a tree-like structures makes it a very good expression interface. Lastly, on the
performance vs usability side, both eager and graph modes are supported. Meaning debugging is
much simpler in the first case, and if there is the need for speed, one can use the latter.
1.2.
      </p>
    </sec>
    <sec id="sec-4">
      <title>Kubeflow 1.3.</title>
    </sec>
    <sec id="sec-5">
      <title>Elyra</title>
      <p>Kubeflow is a machine learning pipeline management and execution system running as first class
citizen on top of Kubernetes. Besides making use of Kubernetes scalability it allows for reproducible
work as machine learning pipelines and the results and intermediate artifacts of their executions are
stored in a meta data repository.</p>
      <p>Elyra started as a set of extensions for the JupyterLab ecosystem. Here we concentrate on the pipeline
editor of Elyra which allows for expression of machine learning workflows using a drag’n’drop editor
and send them for execution on top of different engines like Kubeflow or Airflow. This allows for
non-programmers to read and understand but also create machine learning workflows. Elyra also
supports visualizing such pipelines in the browser (e.g. from a github repository). Kubeflow is a
machine learning pipeline management and execution system running as first class citizen on top of
Kubernetes. Besides making use of Kubernetes scalability it allows for reproducible work as machine
learning pipelines and the results and intermediate artifacts of their executions are stored in a meta
data repository.
1.4.</p>
    </sec>
    <sec id="sec-6">
      <title>JupyterLab 1.5.</title>
    </sec>
    <sec id="sec-7">
      <title>AI Explainability</title>
      <p>JupyterLab is one of the most popular development environments for data science. Therefore we
started to support JupyterLab first. But the pipeline editor of Elyra will be supported in other
environments as well, VSCode being next on the list.</p>
      <p>
        Besides their stunning performance, deep learning models face a lot of resistance for production usage
because they are considered to be a black box. Technically (and mathematically) deep learning models
are a series of non-linear feature space transformations - sounds scary, but in other words, per
definition it is very hard to understand the individual processing steps a deep learning network
performs. But techniques exist to look over a deep learning model’s shoulder. The one we are using
here is called LIME[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. LIME takes the existing classification model and permutes images taken from
the validation set (therefore the real class label is known) as long as a misclassification is happening.
That way LIME can be used to create heat maps as image overlays to indicate regions of images
which are most relevant for the classifier to perform best. In other words, we identify regions of the
image the classifier is looking at. As Fig. 1). illustrates, the most relevant areas in an image for
classifying for COVID-19 are areas containing bones over lung tissue which indicates a problem with
that particular classifier.
1.6.
      </p>
    </sec>
    <sec id="sec-8">
      <title>AI Fairness and Bias</title>
      <p>
        So what is bias? Wikipedia says: ”Bias is a disproportionate weight in favor of or against an idea or
thing, usually in a way that is closed-minded, prejudicial, or unfair.”[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] So here we have it. We want
our model to be fair and unbiased towards protected attributes like gender, race, age, socioeconomic
status, religion and so on. So wouldn’t it be easy to just not ”give” the model those data during
training? It turns out that it isn’t that simple. Protected attributes are often encoded in other attributes.
For example, race, religion and socioeconomic status are latently encoded in attributes like zip code,
contact method or types of products purchased. Fairness assessment and bias detection is an art on it’s
own. Luckily a huge number of single number metrics exist to assess bias in data and models. Here,
we are using the AIF360[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] library which IBM donated to the Linux Foundation AI and therefore is
under open governance.
1.7.
      </p>
    </sec>
    <sec id="sec-9">
      <title>AI Adversarial Robustness</title>
      <p>
        Another pillar of Trusted AI is adversarial robustness. As researchers found out, adversarial noise can
be introduced in data (data poisoning) or models (model poisoning) to influence models decisions in
favor of the adversarial. Libraries like the Adversarial Robustness Toolbox ART[
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] support all
stateof-the-art attacks and defenses.
      </p>
    </sec>
    <sec id="sec-10">
      <title>2. System Implementation and Demo Use Case 2.1.</title>
    </sec>
    <sec id="sec-11">
      <title>A TrustedAI image classification pipeline</title>
      <p>As already mentioned previously, pipelines are a great way to introduce reproducibility, scaling,
auditability and collaboration in machine learning. Pipelines are often a central part of a ML-Ops
strategy. This especially holds for TrustedAI pipelines since reproducibility and auditability are even
more important there. Figure 2 illustrates the exemplary TrustedAI pipeline we have built using the
component library and Figure 3 is a screenshot taken from Kubeflow displaying the pipeline after
finishing its run.
In the following different categories of pipeline components are exemplified using components used
in the Trusted AI image classification pipeline.</p>
      <p>Input Components: In this particular case, we’re pulling data directly from a GitHub repository via a
public and permanent link. We just pull the metadata.csv and images folder. The component library
will contain a component for each different type of data source like files and databases.
Transform Components: Sometimes, transformations on the metadata (or any other structured
dataset) are necessary. Therefore, we provide a generic transformation component - in this case we
just used it to change to format of the categories as the original file contained forward slashes which
made it hard to use on the file system. We just need to specify the column name and function to be
applied on that column.</p>
      <p>Filter Components: Similar to changing content of rows in a data set also removing rows is a
common task in data engineering - therefore the filter stage allows for exactly that. It is enough to
provide a predicate - in this case the predicate ~metadata.filename.str.contains(’.gz’) removes invalid
images.</p>
      <p>
        Image Transformer Components: The de facto standard for labeled image data is putting images
into one folder per class/category. But in this particular case, the raw data isn’t in the required format.
It’s just a folder full of images and their properties are described in a separate CSV file. In addition to
the class (or label) - finding in this case - this CSV file also contains information on the gender and
age. So first, we just use the information on the finding label given in the CSV file and arrange the
images in the appropriate folder structure, as illustrated in Figure 4.
Training Components: Understanding, defining and training deep learning models is an art on it’s
own. Training a deep learning image classification model requires a properly designed neural network
architecture. Luckily, the community trends towards predefined model architectures, which are
parameterized through hyper-parameters. At this stage, we are using the MobileNetV2, a small deep
learning neural network architecture with the set of the most common parameters. It ships with the
TensorFlow distribution - ready to use, without any further definition of neurons or layers. As shown
in Figure 5, only a couple of parameters need to be specified. Although possible, hyper-parameter
search is not considered in this processing stage as we want to make use of KubeFlow’s
hyperparameter search capabilities leveraged through Katib[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] in the future.
Evaluation Components: Besides define, compile and fit, a model needs to be evaluated before it
goes into production. Evaluating classification performance against the target labels has been
state-ofthe-art since the beginning of machine learning, therefore we have added components like confusion
matrix. But taking TrustedAI measures into account is a newly emerging practice. Therefore,
components for AI Fairness, AI Explainability and AI Adversarial Robustness have been added to the
component library.
      </p>
      <p>Blessing Components: In Trusted AI it is important to obtain a blessing of assets like generated data,
model or report to be published and used by other subsystems or humans. Therefore, a blessing
component uses the results of the evaluation components to decide if the assets are ready for
publishing.</p>
      <p>Publishing Components: Depending on the asset type, publishing means either persisting a data set
to a data store, deploying a machine learning model for consumption of other subsystems or
publishing a report to be consumed by humans. Here, we exemplify this category by a KFServing
component which publishes the trained TensorFlow deep learning model to Kubernetes. KFServing,
on top of KNative, is particular interesting as it draws from Kubernetes capabilites like canary
deployment and scalability (including scale to zero) in addition to built-in Trusted AI functionality.</p>
    </sec>
    <sec id="sec-12">
      <title>3. Future Work</title>
      <p>As of now, at least one representative component for each category has been released. Components
are added to the library on a daily basis. The next components to be published are: Parallel Tensorflow
Training with TFJob, Parallel Hyperparameter Tuning with Katib and Parallel Data Processing with
Apache Spark. In addition, the next release of Elyra (v.2.3.0) will improve component’s configuration
options rendering capabilities, e.g. support for check-boxes and drop down menus and facilitated
integration of exiting, containerized applications into the library without needing to wrap them in
jupyter notebooks or python scripts.</p>
    </sec>
    <sec id="sec-13">
      <title>4. Conclusion</title>
      <p>We’ve build and proposed a trustable, low-code, scalable and open source visual AI pipeline system
on top of many de facto standard components used by the machine learning community. Using
KubeFlow Pipelines provides reproducability and auditability. Using Kubernetes provides scalability
and standardization. Using Elyra for visual development provides ease of use, such that all internal
and external stakeholders are empowered to audit the system in all dimensions.
5. References</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Wikipedia</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://en.wikipedia.org/wiki/Bias
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>AI</given-names>
            <surname>Fairness</surname>
          </string-name>
          360 Toolkit,
          <year>2021</year>
          . URL: https://github.com/Trusted-AI/AIF360
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>AI</given-names>
            <surname>Explainability</surname>
          </string-name>
          360 Toolkit,
          <year>2021</year>
          . URL: https://github.com/Trusted-AI/AIX360
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Elyra</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://github.com/elyra-ai
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Kubernetes</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://kubernetes.io/
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>JupyterLab</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://jupyter.org/
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>KFServing</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://www.kubeflow.org/docs/components/serving/kfserving/
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Marco</given-names>
            <surname>Tulio</surname>
          </string-name>
          <article-title>Ribeiro and Sameer Singh and Carlos Guestrin: ”Why Should I Trust You?”: Explaining the Predictions of Any Classifier</article-title>
          .
          <source>Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</source>
          , San Francisco, CA, USA, pp.
          <fpage>1135</fpage>
          -
          <lpage>1144</lpage>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Katib</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://github.com/kubeflow/katib
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Martín</surname>
            <given-names>Abadi</given-names>
          </string-name>
          , Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis,
          <string-name>
            <given-names>Jeffrey</given-names>
            <surname>Dean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Matthieu</given-names>
            <surname>Devin</surname>
          </string-name>
          , Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, Xiaoqiang Zheng “
          <source>TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems”</source>
          ,
          <year>2016</year>
          . URL: https://arxiv.org/abs/1603.04467
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Adversarial</given-names>
            <surname>Robustness Toolbox</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://github.com/Trusted-AI/adversarialRobustness-toolbox
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>BM joining</surname>
            <given-names>CNCF</given-names>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://developer.ibm.com/technologies/containers/blogs/ibmsdedication-to
          <article-title>-open-source-and-its-involvement-with-the-cncf/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>Cloud</given-names>
            <surname>Native Computing Foundation</surname>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://www.cncf.io
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>