<?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">Explainable Weather Forecasts Through an LSTM-CBR Twin System</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Craig</forename><surname>Pirie</surname></persName>
							<email>c.pirie11@rgu.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="department">School of Computing</orgName>
								<orgName type="institution">The Sir Ian Wood Building</orgName>
								<address>
									<addrLine>Garthdee Road</addrLine>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">Robert Gordon University</orgName>
								<address>
									<postCode>AB10 7GJ</postCode>
									<settlement>Aberdeen</settlement>
									<region>Scotland</region>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Malavika</forename><surname>Suresh</surname></persName>
							<email>m.suresh@rgu.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="department">School of Computing</orgName>
								<orgName type="institution">The Sir Ian Wood Building</orgName>
								<address>
									<addrLine>Garthdee Road</addrLine>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">Robert Gordon University</orgName>
								<address>
									<postCode>AB10 7GJ</postCode>
									<settlement>Aberdeen</settlement>
									<region>Scotland</region>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Pedram</forename><surname>Salimi</surname></persName>
							<email>p.salimi@rgu.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="department">School of Computing</orgName>
								<orgName type="institution">The Sir Ian Wood Building</orgName>
								<address>
									<addrLine>Garthdee Road</addrLine>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">Robert Gordon University</orgName>
								<address>
									<postCode>AB10 7GJ</postCode>
									<settlement>Aberdeen</settlement>
									<region>Scotland</region>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Chamath</forename><surname>Palihawadana</surname></persName>
							<email>c.palihawadana1@rgu.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="department">School of Computing</orgName>
								<orgName type="institution">The Sir Ian Wood Building</orgName>
								<address>
									<addrLine>Garthdee Road</addrLine>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">Robert Gordon University</orgName>
								<address>
									<postCode>AB10 7GJ</postCode>
									<settlement>Aberdeen</settlement>
									<region>Scotland</region>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Gayani</forename><surname>Nanayakkara</surname></persName>
							<email>g.nanayakkara@rgu.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="department">School of Computing</orgName>
								<orgName type="institution">The Sir Ian Wood Building</orgName>
								<address>
									<addrLine>Garthdee Road</addrLine>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">Robert Gordon University</orgName>
								<address>
									<postCode>AB10 7GJ</postCode>
									<settlement>Aberdeen</settlement>
									<region>Scotland</region>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Explainable Weather Forecasts Through an LSTM-CBR Twin System</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">4EE48F779965115904A588E6A467F781</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>
			<textClass>
				<keywords>
					<term>LSTM, XCBR, NLG, Integrated Gradients, Forecasting, Visualisation Orcid 0000-0002-6799-0497 (C. Pirie)</term>
					<term>0000-0002-6572-8516 (P. Salimi)</term>
					<term>0000-0002-9594-8683 (C. Palihawadana)</term>
					<term>0000-0002-0017-6589 (G. Nanayakkara)</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>In this paper, we explore two methods for explaining LSTM-based temperature forecasts using previous 14 day progressions of humidity and pressure. First, we propose and evaluate an LSTM-CBR twin system that generates nearest-neighbors that can be visualised as explanations. Second, we use feature attributions from Integrated Gradients to generate textual explanations that summarise the key progressions in the past 14 days that led to the predicted value.</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>Inaccurate weather forecasting can have a serious impact to life, property and businesses. For instance, farmers rely on weather forecasting to plan activities such as ploughing, harvesting and cultivation <ref type="bibr" target="#b0">[1]</ref>. In 2018, the inability of weather forecasts to detect an early monsoon indirectly trapped 12 Thai children and their football coach in a cave for 18 days -and caused the death of two of their rescuers 1 . Efficiently predicting weather can help to minimise these losses in the future <ref type="bibr" target="#b1">[2]</ref>. Howbeit, weather is stochastic and its patterns are non-linear, making it a challenge to obtain precise predictions. The problem lends itself well to neural networks for their ability to model non-linearity. Particularly, weather forecasting suits sequential methods such as the Long Short-Term Memory (LSTM) <ref type="bibr" target="#b2">[3]</ref>, to allow for the utilisation of time-series data in the prediction process <ref type="bibr" target="#b1">[2]</ref>. By making use of the recurrent nature of the LSTM, information can be fed back through different steps along a time-series, capturing trends, seasonality and more, which all help increase predictive power.</p><p>Although weather forecasts are common in everyday life, we seldom seek for deeper insights to explain how a prediction was made. On the contrary -if we did ask for further explanation -we could pass better judgement on the validity of predictions. Explainable AI (XAI) has become increasingly prevalent in recent times. This is because despite deep learning methods now excelling in performance in a variety of domains, they often remain as black-boxes; we are unable to 'look inside' to understand why a prediction was made. Methods such as Integrated Gradients <ref type="bibr" target="#b3">[4]</ref> have been useful for producing saliency maps in images to highlight the important pixels that weigh heavily on the outcome of a classification. They have also been applied in a time-series setting but are often unsophisticated and can be difficult to interpretpresenting a need for dedicated time-series solutions <ref type="bibr" target="#b4">[5,</ref><ref type="bibr" target="#b5">6]</ref>. Literature shows that some (albeit few) attempts have been made to explain weather forecasts in a time-series setting such as by score-maximisation and occlusion analysis visualisations <ref type="bibr" target="#b6">[7]</ref>, or applying LIME <ref type="bibr" target="#b7">[8]</ref>. However, none of these methods propose the use of case-based reasoning (CBR) to provide explanations. Using an approach grounded in similarity, such as CBR, a posteriori knowledge can be drawn upon to help both prediction and explanation. Past experiences can be drawn upon to make arguments for why a decision was made. We propose an approach that takes the learned LSTM embeddings from the prediction stage and uses these to build a case-base to provide explanations that can be visualised. We will also use Integrated Gradients and NLG to provide further explanation by means of a report.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Methodology</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.">Predicting Temperature with LSTM</head><p>We use the default prediction model provided for the challenge which consists of two bidirectional LSTM layers.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.">Building the Twin LSTM-CBR System</head><p>We use the Clood CBR<ref type="foot" target="#foot_0">2</ref> system as the twin. Clood CBR is a distributed CBR system which supports high scalability. The system has a micro-service architecture which splits an application into a set of smaller and interconnected services that scale to meet varying demands <ref type="bibr" target="#b8">[9]</ref>. The output embeddings from the final LSTM layer are extracted for each input row and are fed into the Clood CBR system to form the case base. For a given row and LSTM prediction that we want to explain, we query the Clood system using the nearest-neighbors approach. This gives us the top three similar rows based on the embedding similarity. To establish the quality of the twin, we compare our approach to a baseline twin system that uses the raw features instead of the embeddings.</p><p>We use Mean Absolute Error (MAE) as the evaluation metric to compare the two twin systems as it is one of the common measures of forecasting error in time-series analysis. MAE measures the absolute difference |𝑦 𝑖 − 𝑥 𝑖 | between a prediction 𝑦 𝑖 and an actual observation 𝑥 𝑖 where the individual differences share the equal weight. The 3 nearest neighbours for a prediction are retrieved from the case-base and the mean MAE is calculated between their predicted values. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Results</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.">LSTM-CBR Twin Evaluation</head><p>The results in Table <ref type="table" target="#tab_0">1</ref> prove that the twin LSTM-CBR system based on embeddings performs better than a twin modelled around raw features. The embedded approach achieved an MAE of 0.066 degrees whereas the raw features approach achieved an MAE of 0.133 degrees. This means that using embeddings, the twin system is able to find better nearest-neighbours, therefore can produce better explanations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">Nearest Neighbors Explanations Using LSTM-CBR Twin</head><p>In Figures <ref type="figure">2 and 3</ref>, we visualize the progression of the average humidity and pressure, respectively, over the previous 14 days for a sample query row, top 3 nearest neighbors and 3 randomly selected rows. As can be seen, the query and the nearest neighbors have a similar progression of the predictor variables as well as close predictions for the subsequent day temperature.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Conclusion</head><p>In this paper we explore two methods for explaining LSTM predictions of weather forecast. We first propose an LSTM-CBR twin system that explains a prediction using nearest-neighbors and then visualises the explanations through parallel coordinate plots. We show that using the LSTM embeddings can result in better twinning compared to raw features. As a second explanation method, we make use of feature attributions from Integrated Gradients in text ICCBR'22 Workshop Proceedings templates to generate text explanations. We note that a current limitation of the twin system is that it considers all days as equally important when retrieving the nearest-neighbors. Therefore, future work could explore different weighting strategies (such as weights derived from feature attributions) for strengthening the twin system. A second limitation lies with the need to provide a template for the NLG-based explanation, which would differ between domains. Further work could explore the application of more advanced NLG techniques that allow the inference of templates in a new domain.</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: An example weather report showing the prediction, an explanation of the most important features over two-week, one-week and 3-day periods. A thermometer with a high reading, a hot-faced emoji and red-text are included to help visualise the results.</figDesc><graphic coords="3,89.29,287.05,416.69,97.71" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Figure 2 :Figure 3 :</head><label>23</label><figDesc>Figure 2: Nearest Neighbors Explanation (Average Humidity): Relation=1 depicts the query, Relation=2 depicts the 3 nearest neighbors from the lstm-cbr twin, Relation=3 depicts 3 randomly chosen data points (best viewed in colour)</figDesc><graphic coords="4,154.66,165.44,283.46,142.82" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head>Table 1</head><label>1</label><figDesc>LSTM-CBR MAEs (Embedded &amp; Raw) compared with the original LSTM predictions.</figDesc><table><row><cell cols="2">Embedded Features Raw Features</cell></row><row><cell>0.066</cell><cell>0.133</cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_0">https://github.com/rgu-computing/clood</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Acknowledgments</head><p>We would like to thank Professor Nirmalie Wiratunga for motivating us to take part in this challenge and for her advise throughout the competition.</p></div>
			</div>

			<div type="annex">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>ICCBR'22 Workshop Proceedings</head><p>Comparing the mean gives an indication of whether the cases are better aligned through the use of embeddings -or not.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3.">Generating Explanations</head><p>A template-based Natural Language Generation approach to generate explanations was taken.</p><p>Based on Integrated Gradients, we extracted feature importance attributions for each day over three different time frames. These were as follows: the entire two-week period; the final week; and the final three days. The prediction, feature attributions and general information from the dataset were then slotted into the template to produce a weather forecast report (as seen in Figure <ref type="figure">1</ref>). Furthermore, to aid interpretability, we add visualisations (emojis, graphics and colour) to our textual explanation to indicate the weather prediction.</p></div>			</div>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Temporal convolutional neural (tcn) network for an effective weather forecasting using time-series data from the local weather station</title>
		<author>
			<persName><forename type="first">P</forename><surname>Hewage</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Behera</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Trovati</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Pereira</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Ghahremani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Palmieri</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Liu</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Soft Computing</title>
		<imprint>
			<biblScope unit="volume">24</biblScope>
			<biblScope unit="page" from="16453" to="16482" />
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Weather forecasting using artificial neural network</title>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">N</forename><surname>Fente</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">Kumar</forename><surname>Singh</surname></persName>
		</author>
		<idno type="DOI">10.1109/ICICCT.2018.8473167</idno>
	</analytic>
	<monogr>
		<title level="m">Second International Conference on Inventive Communication and Computational Technologies (ICICCT)</title>
				<imprint>
			<date type="published" when="2018">2018. 2018</date>
			<biblScope unit="page" from="1757" to="1761" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Long short-term memory</title>
		<author>
			<persName><forename type="first">S</forename><surname>Hochreiter</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Schmidhuber</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Neural computation</title>
		<imprint>
			<biblScope unit="volume">9</biblScope>
			<biblScope unit="page" from="1735" to="1780" />
			<date type="published" when="1997">1997</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title level="m" type="main">Axiomatic attribution for deep networks</title>
		<author>
			<persName><forename type="first">M</forename><surname>Sundararajan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Taly</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Q</forename><surname>Yan</surname></persName>
		</author>
		<idno>CoRR abs/1703.01365</idno>
		<ptr target="http://arxiv.org/abs/1703.01365.arXiv:1703.01365" />
		<imprint>
			<date type="published" when="2017">2017</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<monogr>
		<author>
			<persName><forename type="first">T</forename><surname>Rojat</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Puget</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Filliat</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Del</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Ser</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Gelin</surname></persName>
		</author>
		<author>
			<persName><surname>Díaz-Rodríguez</surname></persName>
		</author>
		<idno type="arXiv">arXiv:2104.00950</idno>
		<title level="m">Explainable artificial intelligence (xai) on timeseries data: A survey</title>
				<imprint>
			<date type="published" when="2021">2021</date>
		</imprint>
	</monogr>
	<note type="report_type">arXiv preprint</note>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Towards a rigorous evaluation of xai methods on time series</title>
		<author>
			<persName><forename type="first">U</forename><surname>Schlegel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><surname>Arnout</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>El-Assady</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Oelke</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">A</forename><surname>Keim</surname></persName>
		</author>
		<idno type="DOI">10.1109/ICCVW.2019.00516</idno>
	</analytic>
	<monogr>
		<title level="m">IEEE/CVF International Conference on Computer Vision Workshop (ICCVW)</title>
				<imprint>
			<date type="published" when="2019">2019. 2019</date>
			<biblScope unit="page" from="4197" to="4201" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<title level="m" type="main">Deep multi-stations weather forecasting: explainable recurrent convolutional neural networks</title>
		<author>
			<persName><forename type="first">I</forename><forename type="middle">A</forename><surname>Abdellaoui</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Mehrkanoon</surname></persName>
		</author>
		<idno type="DOI">10.48550/ARXIV.2009.11239</idno>
		<ptr target="https://arxiv.org/abs/2009.11239.doi:10.48550/ARXIV.2009.11239" />
		<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Explainable heat demand forecasting for the novel control strategies of district heating systems</title>
		<author>
			<persName><forename type="first">M</forename><surname>Zdravković</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Ćirić</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Ignjatović</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Annual Reviews in Control</title>
		<imprint>
			<date type="published" when="2022">2022</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Clood cbr: Towards microservices oriented case-based reasoning</title>
		<author>
			<persName><forename type="first">I</forename><surname>Nkisi-Orji</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Wiratunga</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Palihawadana</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">A</forename><surname>Recio-García</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Corsar</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Case-Based Reasoning Research and Development</title>
				<editor>
			<persName><forename type="first">I</forename><surname>Watson</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">R</forename><surname>Weber</surname></persName>
		</editor>
		<meeting><address><addrLine>Cham</addrLine></address></meeting>
		<imprint>
			<publisher>Springer International Publishing</publisher>
			<date type="published" when="2020">2020</date>
			<biblScope unit="page" from="129" to="143" />
		</imprint>
	</monogr>
</biblStruct>

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