
Gradient Backpropagation based Feature Attribution
to Enable Explainable-AI on the Edge
Ashwin Bhat, Adou Sangbone Assoa, Arijit Raychowdhury
School of Electrical and Computer Engineering
Georgia Institute of Technology, Atlanta, GA, USA
(ashwinbhat, aassoa3)@gatech.edu, arijit.raychowdhury@ece.gatech.edu
Abstract—There has been a recent surge in the field of
Explainable AI (XAI) which tackles the problem of providing
insights into the behavior of black-box machine learning models.
Within this field, feature attribution encompasses methods which
assign relevance scores to input features and visualize them
as a heatmap. Designing flexible accelerators for multiple such
algorithms is challenging since the hardware mapping of these
algorithms has not been studied yet. In this work, we first analyze
the dataflow of gradient backpropagation based feature attribu-
tion algorithms to determine the resource overhead required over
inference. The gradient computation is optimized to minimize the
memory overhead. Second, we develop a High-Level Synthesis
(HLS) based configurable FPGA design that is targeted for
edge devices and supports three feature attribution algorithms.
Tile based computation is employed to maximally use on-chip
resources while adhering to the resource constraints. Represen-
tative CNNs are trained on CIFAR-10 dataset and implemented
on multiple Xilinx FPGAs using 16-bit fixed-point precision
demonstrating flexibility of our library. Finally, through efficient
reuse of allocated hardware resources, our design methodology
demonstrates a pathway to repurpose inference accelerators
to support feature attribution with minimal overhead, thereby
enabling real-time XAI on the edge.
Index Terms—Convolution Neural Network, Explainable
Machine Learning, Back-propagation, Hardware Accelerator,
FPGA, High-Level Synthesis (HLS)
I. INTRODUCTION
There has been an exponential surge in the field of machine
learning (ML) and artificial intelligence (AI) in the past
decade. ML techniques, especially Deep Neural Networks
(DNN) have found widespread adoption in various domains
such as computer vision, speech recognition, autonomous
driving and bio-medical applications. However, one major
hurdle currently is the inability to interpret the output of
these models since they are treated as a ”black-box”. The
lack of transparency in the model’s decision making process
severely limits its applicability (Fig 1). In order to address
this issue, several techniques have been proposed recently to
interpret these models [1]. Explainable-AI (XAI) methods shed
light into the workings of ”black-box” models and thereby
identify failure modes, establish trust in the end user and would
eventually enable machine teaching [2].
This work was supported by Semiconductor Research Corporation (SRC)
Task 2969.001.
To appear in 30th IFIP/IEEE International Conference on Very Large Scale
Integration (VLSI-SoC 2022)
XAI techniques can be broadly classified into three cat-
egories namely (1) visualization (2) model distillation and
(3) training interpretable models [3]. Among these three,
visualization is the only post-hoc explanation method that can
be directly applied on existing pre-trained models [4], and
hence is the focus of this work. Visualization comprises of
assigning relevance scores to the input features of the model
in order to quantify their importance to the output of the
black-box model. In the case of image classification using
Convolutional Neural Networks (CNN), the feature attribution
scores can be visualized as a heatmap of the input pixels.
This would highlight regions that contributed most for that
particular input-output mapping produced by the model.
Fig. 1: Pitfalls of using models as black-box functions v/s
advantages of developing Explainable AI.
The different feature attribution methods comprise of two
common steps. First, a forward pass (FP) through the model to
determine the inference result. The second step is a backpropa-
gation (BP) through the model to evaluate the relevance scores
for input features and generate the heatmap (Fig. 2). Compared
to neural network training, feature attribution does not require
calculating gradient with respect to the model parameters
for the weight update (WU) step. Thus, the dataflow of
feature attribution algorithms (FP+BP) lies in between that
of inference (FP) and training (FP+BP+WU).
While inference accelerators have been designed for edge
applications, supporting on-device training is challenging be-
cause of the large compute and memory overheads. WU is
the most expensive step in training. It requires storing all
intermediate activations during FP (memory overhead) and
calculating gradient with respect to each model parameter
arXiv:2210.10922v1 [cs.AR] 19 Oct 2022