Explainable AI XAI Explained
Explainable AI XAI Explained
979-8-3503-0383-4/23/$31.00 ©2023
Authorized licensed use limited IEEE of Toronto. Downloaded on August 06,2024 at 15:06:21 UTC from IEEE Xplore.
to: The University Restrictions apply.
Present
Task
How?
Learning Learned Why?
Dataset Output When?
Process Function
Where?
XAI
Task
Authorized licensed use limited to: The University of Toronto. Downloaded on August 06,2024 at 15:06:21 UTC from IEEE Xplore. Restrictions apply.
There are different methods for generating saliency maps. Algorithm 1 LIME Implementation
One popular approach is to compute the gradients of the Input: Instance to be explained.
network's output with respect to the input image and then use Step 1. Initialize the LIME explainer with specified
these gradients to weigh the importance of different pixels parameters.
[13]. Grad-CAM creates saliency maps through the
Step 2. Generate a set of samples around the instance to be
computation of gradients between the network's output and explained using the specified distance metric
feature maps in a designated layer of the network [15]. (perturbations).
C. Model Interpretation Step 3. Evaluate the model's prediction on the generated
samples and record the results.
In XAI, Model interpretation is a crucial component that
enhances the transparency and interpretability of AI models. Step 4. Train a linear model on the generated samples and
their corresponding machine-learning model
Model-agnostic techniques are a type of model interpretation
predictions using the specified kernel width.
technique that can be applied to any AI model, regardless of
the specific algorithm or architecture used. These techniques Step 5. Calculate the feature importance weights based on the
coefficients of the trained linear model.
help to analyze the relationship between input features and the
model's output without relying on the internal workings of a Step 6. Sort the feature importance weights in descending
order and return them as the list of explanations.
specific model.
LIME (Local Interpretable Model-Agnostic Explanations) Output: Feature explanations, where each explanation provides
and SHAP (SHapley Additive exPlanations) are two popular the name of a feature and its corresponding importance weight.
techniques of model-agnostic techniques that generate local
explanations for individual predictions or global feature 2) SHAP: SHAP is a technique for explaining the output of
importance analysis. LIME creates surrogate models that any AI model by computing the influence of each input
approximate the original model and generate locally faithful feature on the final forecast [17]. This technique is based
explanations of individual predictions, while SHAP on cooperative game theory and the concept of Shapley
decomposes the prediction output into contributions from each values. The Shapley value was proposed by Lloyd Shapley
input feature to generate feature importance values. and named in his honor. It can be defined as the average of
These techniques are particularly useful when dealing with the marginal contributions of each player to all possible
complex models (example: deep neural networks) or when coalitions. This uses a weighted linear regression model to
transparency is required in decision-making processes. They approximate the model's behavior in the local
can be used with feature visualization and saliency mapping to neighborhood of a specific input instance. The weights of
provide a more comprehensive understanding of how a model the linear model are determined by the Shapley values,
works and identify potential biases or errors in the model's which are computed using a recursive formula that
decision-making process. A detailed discussion of LIME and considers all possible combinations of input features. The
SHAP techniques is given below. SHAP technique provides a measure of the importance of
each feature for a specific input instance, as well as a
1) LIME: LIME is an explainability technique that aims to global feature importance ranking based on the average
provide local, interpretable explanations for individual absolute value of the Shapley values across all instances.
predictions. It was introduced in 2016 [16]. LIME This technique provides a unified framework for
generates a set of interpretable features from the original explaining the output of an AI model and provides
input data and trains a simpler, interpretable model on the accurate and intuitive explanations for a wide range of
generated features. The simpler model is then used to applications. Algorithm 2 outlines the procedure for
explain the predictions of the more complex black-box implementing the SHAP.
model.
LIME generates interpretable features by introducing
Algorithm 2 SHAP Implementation
perturbations to the original input data and observing their
impact on the output of the black-box model. For example, Input: Instance to be explained.
if the input is text, LIME might introduce perturbations by Step 1. Initialize the SHAP explainer with the trained AI
randomly replacing words in the text and assessing the model and specified explainer type.
resulting change in the model's output. Similarly, if the Step 2. Generate a set of background samples from the
input is a numerical data, then the LIME might introduce background dataset.
perturbations by adding or subtracting small amounts of Step 3. Calculate the SHAP values for the instance to be
noise to each data point and then evaluating the impact on explained using the generated background samples.
the model's prediction. Step 4. Calculate the feature importance weights based on
By identifying the most relevant features to the model's the absolute values of the SHAP values.
output in a given local region, LIME can help create a Step 5. Sort the feature importance weights in descending
simpler, interpretable model that explains the behavior of order and return them as the list of explanations.
the original model in that region. Algorithm 1 outlines the Output: Feature explanations, where each explanation gives
procedure for implementing the LIME. the name of a feature and its corresponding SHAP value.
Authorized licensed use limited to: The University of Toronto. Downloaded on August 06,2024 at 15:06:21 UTC from IEEE Xplore. Restrictions apply.
III. APPLICATIONS influence on the model's decision, making it easier to identify
XAI finds applications across multiple domains, including potential errors or biases in the model.
healthcare, finance, law, etc., as shown in Fig. 4 [18], [19]. In B. Finance
healthcare, XAI can help interpret medical data, while in XAI has the potential to revolutionize the finance industry
finance, it can detect fraud, evaluate creditworthiness, and by providing a better understanding of how AI models make
assess risk more accurately. In law, XAI can analyze legal
decisions. This understanding can help financial institutions
documents, identify relevant case law, and ensure transparent
make better-informed decisions and mitigate potential risks.
and objective decision-making. The main benefit of XAI lies in
Important applications of XAI in finance are given below.
its ability to make the decision-making process of AI
transparent and understandable, making it valuable in any 1) Fraud detection: XAI can help in fraud detection by
application where trust and accountability are critical. The explaining the decisions made by AI models. By providing
detailed discussion of key applications such as healthcare, transparent and interpretable results, it can help in
finance, and law are discussed as follows. identifying the reasons behind fraudulent activities and
prevent them from happening in the future.
Applications of XAI
2) Credit scoring: AI models are increasingly being used to
evaluate creditworthiness. XAI can help in explaining how
these models arrive at a credit score, making it easier for
Healthcare Law Education Transportation
banks and financial institutions to understand why a
particular score was assigned to a customer. This can help
in making more accurate lending decisions and reducing
Cybersecurity
Finance Marketing Agriculture
the risk of default.
Authorized licensed use limited to: The University of Toronto. Downloaded on August 06,2024 at 15:06:21 UTC from IEEE Xplore. Restrictions apply.
2) Legal decision-making: XAI can be used in legal decision-
making processes such as predicting case outcomes or 1 Explainability vs. Performance
recommending plea bargains. Studies have shown that XAI
models outperform traditional machine learning models in 2 Human Factors
terms of accuracy, transparency, and interpretability. Challenges and
Research Perspectives
3 Lack of a Universal Standard
3) Addressing challenges in the legal domain: XAI can help
address challenges such as model interpretability and the 4 Bias and Fairness
limited availability of legal data. Researchers have
proposed methods for designing and evaluating XAI 5 Evaluation
models that prioritize fairness and transparency and have
suggested the use of synthetic legal data to train and test Fig. 5. Various challenges and research directions in XAI.
XAI models in the legal domain.
A. Explainability versus Performance
Besides the aforementioned key applications, XAI has a Balancing explainability with performance in machine
range of other applications, which are summarized in Table 1. learning models can often present a trade-off. Models that
prioritize explainability may sacrifice performance, while
TABLE I. SUMMARY OF DIVERSE APPLICATIONS OF XAI highly performant models may lack interpretability. To address
Application Description this challenge, future XAI research should concentrate on
Marketing By leveraging XAI, personalized recommendations can developing more advanced techniques that strike a balance
be offered to customers, which can enhance their
satisfaction levels and increase the sales.
between these two objectives, thereby meeting the need for
Education The utilization of XAI can aid teachers and students in both high performance and explainability.
comprehending the learning process of students and
offering customized feedback to enhance their learning B. Human Factors
results. Another challenge in XAI is understanding how people
Cybersecurity Through its ability to provide insights into the actions of
interact with and interpret the explanations provided by XAI
attackers and defenders, XAI can play a crucial role in
identifying and mitigating potential security threats. techniques. People may have different levels of technical
Transportation Transportation systems can be made safer and more expertise and may interpret explanations in different ways,
efficient by utilizing XAI, which can analyze vast which can affect their trust in the system. To overcome this
amounts of data from diverse sources and provide real- challenge, research should focus on understanding the human
time recommendations.
Agriculture XAI can help farmers make better decisions about crop factors involved in XAI and developing techniques that are
management and irrigation by analyzing data from tailored to different user groups.
sensors.
C. Lack of a Universal Standard
As XAI can be used in various domains, it is important to A challenge in XAI is the lack of a universal standard or
consider the ethical and legal issues surrounding its use. One framework for developing and evaluating XAI techniques. This
major concern is the potential for bias in the algorithms used makes it difficult to compare different approaches and limits
for XAI. Bias can arise due to various reasons, such as the the ability to apply XAI techniques across different domains
data used to train the model, the features selected, or the and applications. Future research should focus on developing a
assumptions made during model building. This can lead to standardized framework for XAI that can be widely adopted
unfair treatment of certain groups of people, particularly those and applied in various contexts.
who are already marginalized in society. To mitigate this D. Bias and Fairness
issue, it is important to have diverse and representative
datasets and to regularly audit the models for bias. Machine learning models can perpetuate and amplify
Another ethical concern is the impact of XAI on privacy. existing biases in data, which can lead to unfair and
The use of personal data in XAI can potentially lead to discriminatory outcomes. XAI techniques should be designed
violations of privacy and data protection laws. To address this to identify and mitigate biases in machine learning models to
issue, data protection laws should be adhered to and the use of ensure fair and ethical decision-making.
personal data should be minimized whenever possible. E. Evaluation
IV. CHALLENGES AND RESEARCH PERSPECTIVES Assessing the effectiveness of XAI techniques is essential
to ensure that they provide accurate and practical explanations.
Despite the significant progress made in XAI in recent Nevertheless, evaluating XAI techniques can pose a challenge,
years, there are still various challenges and new research as there is no established consensus on what constitutes a good
avenues that require attention in order to further enhance the explanation. Therefore, future research should prioritize
field [24]-[27]. In this view, this section outlines and briefly developing standardized evaluation metrics and benchmarks
discusses various critical challenges and potential research that can be used to evaluate the effectiveness of the XAI
perspectives of XAI. These are depicted in Fig. 5 and described techniques.
as follows.
Authorized licensed use limited to: The University of Toronto. Downloaded on August 06,2024 at 15:06:21 UTC from IEEE Xplore. Restrictions apply.
V. SUMMARY How, and Where,” IEEE Trans. Ind. Inf., vol. 18, no. 8, pp. 5031–5042,
Aug. 2022, doi: https://doi.org/10.1109/TII.2022.3146552.
Explainable AI (XAI) provides a promising avenue for [12] C. Agarwal, O. Queen, H. Lakkaraju, and M. Zitnik, “Evaluating
increasing the transparency, accountability, and trustworthiness explainability for graph neural networks,” Sci Data, vol. 10, no. 1, p.
of AI systems. This paper explored the concept of XAI and its 144, Mar. 2023, doi: https://doi.org/10.1038/s41597-023-01974-x.
importance. Various methods such as feature visualization, [13] K. Simonyan, A. Vedaldi, and A. Zisserman, “Deep Inside
saliency mapping, and model interpretation are detailed. Convolutional Networks: Visualising Image Classification Models and
Saliency Maps,” 2013, doi: https://doi.org/10.48550/ARXIV.1312.6034.
Special attention was given to LIME and SHAP techniques.
Further, the XAI applications in diverse domains, such as [14] Inceptionism: Going Deeper into Neural Networks, Jun. 2015,
https://ai.googleblog.com/2015/06/inceptionism-going-deeper-into-
healthcare, finance, and law are discussed. The ethical and neural.html, last accessed on 06 May 2023.
legal implications of XAI are also highlighted. Finally, the [15] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D.
paper outlined challenges and prospects for future research. Batra, “Grad-CAM: Visual Explanations from Deep Networks via
Gradient-Based Localization,” in 2017 IEEE International Conference
REFERENCES on Computer Vision (ICCV), Venice: IEEE, Oct. 2017, pp. 618–626.
doi: https://doi.org/10.1109/ICCV.2017.74.
[1] K. Ramireddy, A. S. Hari, and Y. V. P. Kumar, “Artificial Intelligence
Based Control Methods for Speed Control of Wind Turbine Energy [16] M. T. Ribeiro, S. Singh, and C. Guestrin, “‘Why Should I Trust You?’:
System,” in Intelligent Computing in Control and Communication, G. T. Explaining the Predictions of Any Classifier,” 2016, doi:
C. Sekhar, H. S. Behera, J. Nayak, B. Naik, and D. Pelusi, Eds., Lecture https://doi.org/10.48550/ARXIV.1602.04938.
Notes in Electrical Engineering,, vol. 702. Singapore: Springer, 2021, [17] S. Lundberg and S.-I. Lee, “A Unified Approach to Interpreting Model
pp. 203–217. doi: https://doi.org/10.1007/978-981-15-8439-8_18. Predictions,” 2017, doi: https://doi.org/10.48550/ARXIV.1705.07874.
[2] S. N. V. B. Rao et al., “Day-Ahead Load Demand Forecasting in Urban [18] U. Pawar, D. O’Shea, S. Rea, and R. O’Reilly, “Explainable AI in
Community Cluster Microgrids Using Machine Learning Methods,” Healthcare,” in 2020 International Conference on Cyber Situational
Energies, vol. 15, no. 17, p. 6124, Aug. 2022, doi: Awareness, Data Analytics and Assessment (CyberSA), Dublin, Ireland:
https://doi.org/10.3390/en15176124. IEEE, Jun. 2020, pp. 1–2. doi:
[3] Y. V. P. Kumar and R. Bhimasingu, “Fuzzy logic based adaptive virtual https://doi.org/10.1109/CyberSA49311.2020.9139655.
inertia in droop control operation of the microgrid for improved [19] B. M. Keneni et al., “Evolving Rule-Based Explainable Artificial
transient response,” in 2017 IEEE PES Asia-Pacific Power and Energy Intelligence for Unmanned Aerial Vehicles,” IEEE Access, vol. 7, pp.
Engineering Conference (APPEEC), Bangalore: IEEE, Nov. 2017, pp. 17001–17016, 2019, doi:
1–6. doi: https://doi.org/10.1109/APPEEC.2017.8309006. https://doi.org/10.1109/ACCESS.2019.2893141.
[4] B. Vasu Murthy, Y. V. Pavan Kumar, and U. V. Ratna Kumari, “Fuzzy [20] C. Metta et al., “Explainable Deep Image Classifiers for Skin Lesion
logic intelligent controlling concepts in industrial furnace temperature Diagnosis,” 2021, doi: https://doi.org/10.48550/ARXIV.2111.11863.
process control,” in 2012 IEEE International Conference on Advanced
[21] F. Giuste et al., “Explainable Artificial Intelligence Methods in
Communication Control and Computing Technologies (ICACCCT),
Combating Pandemics: A Systematic Review,” IEEE Rev. Biomed.
Ramanathapuram, India: IEEE, Aug. 2012, pp. 353–358. doi:
Eng., vol. 16, pp. 5–21, 2023, doi:
https://doi.org/10.1109/ICACCCT.2012.6320801.
https://doi.org/10.1109/RBME.2022.3185953.
[5] P. P. Kasaraneni, Y. Venkata Pavan Kumar, G. L. K. Moganti, and R.
[22] M. Gandolfi et al., “eXplainable AI Allows Predicting Upper Limb
Kannan, “Machine Learning-Based Ensemble Classifiers for Anomaly
Rehabilitation Outcomes in Sub-Acute Stroke Patients,” IEEE J.
Handling in Smart Home Energy Consumption Data,” Sensors, vol. 22,
Biomed. Health Inform., vol. 27, no. 1, pp. 263–273, Jan. 2023, doi:
no. 23, p. 9323, Nov. 2022, doi: https://doi.org/10.3390/s22239323.
https://doi.org/10.1109/JBHI.2022.3220179.
[6] B. Prasanth et al., “Maximizing Regenerative Braking Energy
[23] B. H. M. van der Velden, H. J. Kuijf, K. G. A. Gilhuijs, and M. A.
Harnessing in Electric Vehicles Using Machine Learning Techniques,”
Viergever, “Explainable artificial intelligence (XAI) in deep learning-
Electronics, vol. 12, no. 5, p. 1119, Feb. 2023, doi:
based medical image analysis,” Medical Image Analysis, vol. 79, p.
https://doi.org/10.3390/electronics12051119.
102470, Jul. 2022, doi: https://doi.org/10.1016/j.media.2022.102470.
[7] S. N. V. B. Rao et al., “Power Quality Improvement in Renewable-
[24] A. Rawal, J. McCoy, D. B. Rawat, B. M. Sadler, and R. St. Amant,
Energy-Based Microgrid Clusters Using Fuzzy Space Vector PWM
“Recent Advances in Trustworthy Explainable Artificial Intelligence:
Controlled Inverter,” Sustainability, vol. 14, no. 8, p. 4663, Apr. 2022,
Status, Challenges, and Perspectives,” IEEE Trans. Artif. Intell., vol. 3,
doi: https://doi.org/10.3390/su14084663.
no. 6, pp. 852–866, Dec. 2022, doi:
[8] A. Adadi and M. Berrada, “Peeking Inside the Black-Box: A Survey on https://doi.org/10.1109/TAI.2021.3133846.
Explainable Artificial Intelligence (XAI),” IEEE Access, vol. 6, pp.
[25] W. Saeed and C. Omlin, “Explainable AI (XAI): A systematic meta-
52138–52160, 2018, doi:
survey of current challenges and future opportunities,” Knowledge-
https://doi.org/10.1109/ACCESS.2018.2870052.
Based Systems, vol. 263, p. 110273, Mar. 2023, doi:
[9] Matt Turek, “Explainable Artificial Intelligence,” https://doi.org/10.1016/j.knosys.2023.110273.
https://www.darpa.mil/program/explainable-artificial-intelligence, last
[26] L. Weber, S. Lapuschkin, A. Binder, and W. Samek, “Beyond
accessed on 06 May 2023.
explaining: Opportunities and challenges of XAI-based model
[10] G. Schwalbe and B. Finzel, “A comprehensive taxonomy for improvement,” Information Fusion, vol. 92, pp. 154–176, Apr. 2023,
explainable artificial intelligence: a systematic survey of surveys on doi: https://doi.org/10.1016/j.inffus.2022.11.013.
methods and concepts,” Data Min Knowl Disc, Jan. 2023, doi:
[27] P. Gohel, P. Singh, and M. Mohanty, “Explainable AI: current status and
https://doi.org/10.1007/s10618-022-00867-8.
future directions,” 2021, doi:
[11] I. Ahmed, G. Jeon, and F. Piccialli, “From Artificial Intelligence to https://doi.org/10.48550/ARXIV.2107.07045.
Explainable Artificial Intelligence in Industry 4.0: A Survey on What,
Authorized licensed use limited to: The University of Toronto. Downloaded on August 06,2024 at 15:06:21 UTC from IEEE Xplore. Restrictions apply.