<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Explaining your Neighbourhood: A CBR Approach for Explaining Black-Box Models</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Betül</forename><surname>Bayrak</surname></persName>
							<email>betul.bayrak@ntnu.no</email>
							<affiliation key="aff0">
								<orgName type="institution">Norwegian University of Science and Technology (NTNU)</orgName>
								<address>
									<addrLine>Høgskoleringen 1</addrLine>
									<postCode>7034</postCode>
									<settlement>Trondheim</settlement>
									<country key="NO">Norway</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Paola</forename><surname>Marin-Veites</surname></persName>
							<email>paola.m.veites@ntnu.no</email>
							<affiliation key="aff0">
								<orgName type="institution">Norwegian University of Science and Technology (NTNU)</orgName>
								<address>
									<addrLine>Høgskoleringen 1</addrLine>
									<postCode>7034</postCode>
									<settlement>Trondheim</settlement>
									<country key="NO">Norway</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Kerstin</forename><surname>Bach</surname></persName>
							<email>kerstin.bach@ntnu.no</email>
							<affiliation key="aff0">
								<orgName type="institution">Norwegian University of Science and Technology (NTNU)</orgName>
								<address>
									<addrLine>Høgskoleringen 1</addrLine>
									<postCode>7034</postCode>
									<settlement>Trondheim</settlement>
									<country key="NO">Norway</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Explaining your Neighbourhood: A CBR Approach for Explaining Black-Box Models</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">A08990E045967F13C8C060028EEB4817</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-06-19T14:46+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>In this work, we propose a multi-agent Case-Based Reasoning system (MA-CBR system) approach for explaining a Black-box model that provides a 3-class depression classification. We show how to develop a CBR system that can accompany a Black-box model to provide similar supportive or contrastive cases and how domain knowledge influences the performance of a CBR system. Eventually we provide a concept and showcase for a MA-CBR system that can help to explain the results of a Black-box model.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>As part of the International Conference on Case-Based Reasoning of 2022 (ICCBR-2022), a set of XCBR Challenges were proposed. In this paper, we chose to work with the Psychology prediction dataset. The task is to provide an explanation for a Blackbox model that provides a 3-class depression classification, with class 1 being low risk of depression score and class 3 being high risk. The provided data, derived from <ref type="bibr" target="#b0">[1]</ref>, consists of a dataset with 104 answered questionnaires as well as expected answers questionnaire designed by a medical health professional that assess if the patient is at risk of depression.</p><p>In our proposed solution, we developed a multiagent CBR system (MA-CBR system) to create explanations for a Black-box model's classification. We suggest the MA-CBR system that supports or contrasts the classification of the Black-box model. To develop the CBR system we use Shapley values to obtain relevant questions to define the weights of our global similarity measure. We also extend the CBR case representation with an attribute representing domain knowledge. The core idea can be compared to a Twin CBR system as introduced by <ref type="bibr" target="#b1">[2]</ref>.</p><p>To test our hypothesis, we conduct three experiements. In the first experiment, we compare the classification results for the CBR system and Black-box model. In the second experiment, we add domain knowledge to the case representation and assess its influence in the CBR system. And in the third experiment, we show how the CBR system can provide supportive explanations on the class classification from the Black-box model or contrast it providing the differences explanation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Explanation Methodology</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.">Pre-Processing</head><p>We used the black-box classification model, a multi-layer-perceptron provided by the organizers of the challenge, to calculate Shapley values. To work with stable Shapley values we used the training data (83 examples) and calculated the Shapley value for each fold. Based on these folds, we calculated the mean for each attribute in the respective 3 classes. The resulting mean Shapley values are the weights of our global similarity functions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.">CBR System for Explaining Black-box models</head><p>The concept of how we created the CBR system is shown in Figure <ref type="figure" target="#fig_0">1</ref>. We modeled the attributes in the myCBR workbench. All questions were included as integer attributes with a value range of [0, 1]. Every attribute has the same, binary local similairy measure where a matching answer is 1 and a mismatch is 0. In this dataset we only had binary attributes, but for more complex attributes the local similarity measures can be modeled as introduced by <ref type="bibr" target="#b2">[3]</ref>. The weights for the global similarity measure are based on the Shapley values derived from the Black-box model.</p><p>Further, we introduced a new attibute called Matched as an integer with a value range from [0, 103]. That attribute describes the number of matches between a user's answer and an experts evaluation on how questions from a depressed person would be answered. The similarity measure was created using the methods described by <ref type="bibr" target="#b2">[3,</ref><ref type="bibr" target="#b3">4]</ref>. In our approach we will use the Matched attribute to show how domain knowledge can be incorporated in the CBR system. The myCBR project file contains three casebases and three amalgamation functions, each representing one class of the Black-box model prediction range. Each of these configuration is referred to as a CBR agent. Once the MA-CBR system is created, we use it to explain the results of the Black-box model as shown in Figure <ref type="figure" target="#fig_2">2</ref>. First a query is created from the incoming data. This query is sent to the Black-box model which provides the classification for the dataset. Next, the query is extended with the Matched attrtibute and sent to the MA-CBR system. The MA-CBR system will retrieve the most similar cases from each CBR agent and provide them as  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3.">Implementation</head><p>The presented work is implemented using the myCBR workbench for modeling the skeleton CBR system. Further we use the mcbr Rest API to deploy the global similarity measure, cases and deploy the CBR agents. All interaction with the CBR system is implemented in Python using the requests librabry.</p><p>While working on developing the CBR system we extended the myCBR Rest API allowing us to add Integer attributes through the API, changing the amalgamation functions, and adding and deleting instances from a concept. These extensions allow us to deploy a skeleton CBR system and change the system as needed for experimentation through the myCBR Rest API via Python. The updated API has been made available on GitHub<ref type="foot" target="#foot_0">1</ref> .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Experiements and Results</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>ICCBR'22 Workshop Proceedings</head><p>we made to develop the CBR explainer.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.">Experiment I</head><p>The goal of the first experiment is to test the CBR system's and the blackbox model's performance using the given dataset. Therefore we build each system using the raw and oversampled data. The reason for exploring both approaches is that in the given Black-box model oversampling is used to increase the quality of the model, while for a CBR system, we prefer real-world rather than simulated cases.</p><p>In this experiements we ran a set of experiments that do 100 different 80/20 splits of the training and test data. The dataset is very small and provides huge variation in the performance of the Black-box model and CBR systems depending on the splits. To have comparable results, we used this experiment to find the most suitable setup for experiment II and III.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.1.">Results</head><p>Based on Figure <ref type="figure" target="#fig_3">3</ref> we decided that a Black-box model using oversampled data performs best, while oversampling has little influence on the CBR system. To select a combination, we picked a split where the CBR system and BB system performed best (see the plot over all runs in the right hand plot of Figure <ref type="figure" target="#fig_3">3</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">Experiment II</head><p>In this set of experiments, we aim at improving the performance of the CBR system. From Figure <ref type="figure" target="#fig_3">3</ref>, we see that the overall accuracy is lower that the Black-box model's one. To provide good similar cases to support or contrast the Black-box model's classification, we suggest to incorporate domain knowledge into the CBR system. Given the nature of the challenge, no domain expert was available. Therefore we used the expected answer file from the provided documents and included an attribute, Matched, that represents the number of questions in which the query case matches the expert's opinion on whether a test subject has depression.</p><p>We integrated the Matched in the case representation. For the next experiments, we compared the similarity scores of the CBR system with and without the Matched attribute. To find the best weight in the global similarity measure, we picked the maximum shap-based weight and then "boosted" the weight to increase it's importance in the classification. During the experiments we tested different "boosters" to find the best weight for the global similarity measure. We used the overall accuracy of the CBR system to decide on the booster.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.1.">Results</head><p>The accuracy of both CBR systems differs greatly with the added domain knowledge indicating the importance of such information that is not included in the pure dataset. The CBR system can easily include such knowledge from experts. In Figure <ref type="figure" target="#fig_4">4</ref>, we show the confusion matrix for three systems. The first matrix are the results of the Black-box model and the second of the CBR system developed in this experiment. Comparing the Black-box model and the CBR system that includes domain knowledge, we can see that two classes (class 0 and class 1) the CBR system performs better while for class 2 it performs worse. We assume that such information would be available to the CBR Explainer and can therefore be included when decisions are explained.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3.">Experimental Setup III</head><p>In the final experiment we show how the MA-CBR system can be used in conjunction with the Black-box model. We therefore implemented the concept described in Figure <ref type="figure" target="#fig_2">2</ref> to provide supportive and contrastive cases to explain a decision by the Black-box model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3.1.">Results</head><p>In our implementation, we use the test data and provide the information whether the comparsion leads to a supportive or a contrastive page. Further we show the matching and differing attributes ICCBR'22 Workshop Proceedings along with the case ids of the most similar cases. We believe this information can be used to explain results to the user.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Conclusion</head><p>With our work, we show that a CBR system or a MA-CBR system can be developed using the meta information coming from a Black-box model. In particular, we use Shapley values and add domain knowledge to create a CBR explainer that provides similar cases to the query to either support or contrast a Black-box model's decision.</p><p>We hope to show that the myCBR Rest API is a useful tool to develop such application and promote CBR as methodology for building model-agnostic explainers.</p><p>The provided dataset, however, has some limitations, first and foremost are relativly small datapoints for the large number of features available. Further, the creation of the dataset and concept behind is not provided, which makes it hard to find suitable domain knowledge to include. During our work we aimed at reducing the number of features using feature importance and shap methods. However, none of them provided a smaller set of features without losing model performance.</p><p>Having no access to experts made it challenging for us to understand what should be explained. We showed how nearest neighbor cases can be found. To create an XAI system, we would now need to work with users of a system to understand the needs of an explanation before a user interface can be developed.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: Modeling approach for the CBR Explainer</figDesc><graphic coords="2,130.96,393.60,333.35,153.18" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>explanation candidates. We propose that the retrieval results for the CBR agent that matches the Black-box model class prediction are handeled as Supportive examples while the others are Contrastive examples.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Figure 2 :</head><label>2</label><figDesc>Figure 2: Explanation system using the CBR system</figDesc><graphic coords="3,110.13,136.75,375.00,225.85" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Figure 3 :</head><label>3</label><figDesc>Figure 3: Experiement 1 results: Boxplot of the accuracy (y-axis) over 100 different splits for the Black-box model and the CBR system for raw and oversampled (os) data.</figDesc><graphic coords="4,89.29,330.58,416.68,146.45" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Figure 4 :</head><label>4</label><figDesc>Figure 4: Experiement 2 results: Confusion Matrices for the Black-box model and the two CBR systems. The CBR incl matched in the results of the experiment II optimization and the CBR raw shows the performance of the CBR system on the raw data only.</figDesc><graphic coords="5,89.29,280.93,416.66,127.69" type="bitmap" /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">https://github.com/ntnu-ai-lab/mycbr-rest</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">An artificial neural network for depression screening and questionnaire refinement in undergraduate students</title>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">G</forename><surname>Orozco-Del Castillo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><forename type="middle">C</forename><surname>Orozco-Del Castillo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Brito-Borges</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Bermejo-Sabbagh</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Cuevas-Cuevas</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Telematics and Computing</title>
				<editor>
			<persName><forename type="first">M</forename><forename type="middle">F</forename><surname>Mata-Rivera</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">R</forename><surname>Zagal-Flores</surname></persName>
		</editor>
		<meeting><address><addrLine>Cham</addrLine></address></meeting>
		<imprint>
			<publisher>Springer International Publishing</publisher>
			<date type="published" when="2021">2021</date>
			<biblScope unit="page" from="1" to="13" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">T</forename><surname>Keane</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><forename type="middle">M</forename><surname>Kenny</surname></persName>
		</author>
		<idno type="arXiv">arXiv:1905.08069</idno>
		<title level="m">The twin-system approach as one generic solution for xai: An overview of ann-cbr twins for explaining deep learning</title>
				<imprint>
			<date type="published" when="2019">2019</date>
		</imprint>
	</monogr>
	<note type="report_type">arXiv preprint</note>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Similarity measure development for case-based reasoning-a data-driven approach</title>
		<author>
			<persName><forename type="first">D</forename><surname>Verma</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Bach</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">J</forename><surname>Mork</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Symposium of the Norwegian AI Society</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2019">2019</date>
			<biblScope unit="page" from="143" to="148" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Explaining cbr systems through retrieval and similarity measure visualizations: A case study</title>
		<author>
			<persName><forename type="first">P</forename><surname>Marín-Veites</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Bach</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Case-Based Reasoning Research and Development</title>
				<editor>
			<persName><forename type="first">M</forename><forename type="middle">T</forename><surname>Keane</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">N</forename><surname>Wiratunga</surname></persName>
		</editor>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2022">2022</date>
			<biblScope unit="page" from="111" to="124" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
