# Img2Tab: Automatic Class Relevant Concept Discovery from StyleGAN Features
for Explainable Image Classification

Youngjae Song1 Sung Kuk Shyn2 Kwang-su Kim311footnotemark: 11Department of
Computer Science and Engineering, Sungkyunkwan University, South Korea
2Department of Artificial Intelligence, Sungkyunkwan University, South Korea
3Department of Computing and Informatics, Sungkyunkwan University, South Korea
{yuong13, davidshyn<EMAIL_ADDRESS>

###### Abstract

Traditional tabular classifiers provide explainable decision-making with
interpretable features(concepts). However, using their explainability in
vision tasks has been limited due to the pixel representation of images. In
this paper, we design Img2Tabs that classify images by concepts to harness the
explainability of tabular classifiers. Img2Tabs encode image pixels into
tabular features by StyleGAN inversion. Since not all of the resulting
features are class-relevant or interpretable due to their generative nature,
we expect Img2Tab classifiers to discover class-relevant concepts
automatically from the StyleGAN features. Thus, we propose a novel method
using the Wasserstein-1 metric to quantify class-relevancy and
interpretability simultaneously. Using this method, we investigate whether
important features extracted by tabular classifiers are class-relevant
concepts. Consequently, we determine the most effective classifier for
Img2Tabs in terms of discovering class-relevant concepts automatically from
StyleGAN features. In evaluations, we demonstrate concept-based explanations
through importance and visualization. Img2Tab achieves top-1 accuracy that is
on par with CNN classifiers and deep feature learning baselines. Additionally,
we show that users can easily debug Img2Tab classifiers at the concept level
to ensure unbiased and fair decision-making without sacrificing accuracy.

Figure 1: An outline of an Img2Tab example in a gender classification. A)
Img2Tab predicts its label of the image by tabular features encoded from the
image, not by pixels. B) Img2Tab explains its prediction by feature importance
and visualization at the concept level. We visualize concepts in the red boxes
by latent modifications. Important features (#$k_{1}$, #$k_{2}$, and #$k_{3}$)
extracted by the tabular classifier represent class-relevant concepts (“Hair
length,” “Mustache,” and “Lipstick,” respectively).

††*Corresponding author

##  1 Introduction

The performance of image classifications has soared markedly, but high
performance is still insufficient to deploy AI products in computer vision
domains. Many researchers deem XAI(eXplainable AI) crucial to design
trustworthy, unbiased, and fair AI models. Despite recent efforts, human
understanding of the intrinsic decision-making process in deep net classifiers
proves elusive. Alternatively, traditional tabular classifiers provide
inherently explainable decision-making of high-level features. Nevertheless,
pixel representation of images hinders their explainability from being applied
to vision tasks. Thus, we explore an alternative framework rather than solely
relying on deep net classifiers at the pixel level.

Generally, tabular features are assigned in quantitative semantics as discrete
or continuous scalars. Also, the relationship between the feature scalar and
semantics strength is monotone; a total order of feature scalar corresponds to
a total order of semantics strength. These tabular properties allow us to
understand each feature value with only one dimension. Meanwhile, tabular
models such as Logistic Regression [?], SVM with linear kernels [?], XGBoost
[?], and TabNet [?] are designed to make explainable decisions. According to
[?], explainability is becoming essential for tabular models as a useful tool
for debugging and auditing models’ decision-making. This paper argues that
StyleGAN features can be regarded as tabular data; we investigate which
tabular models are suitable for using such features as input data to
accomplish explainable, concept-based image classification.

In Section 3, we analyze StyleGAN [?] feature properties to implement them as
tabular features. As discussed in [?], distances along the StyleGAN latent are
globally consistent: a scalar distance along the latent element represents its
semantic strength. As such distance is monotonic, the StyleGAN feature values
apply to tabular feature values. Given the advancement of GANs, we exploit
StyleGAN feature space to encode image pixels into tabular features.

The StyleGAN feature space represents generative features indicating that not
all features are class-relevant. [?] demonstrates that not all StyleGAN
features are concepts. For the sake of explainable image classifications, we
expect our classifier to discover class-relevant concepts automatically from
such a feature space. To achieve this goal, we propose a novel method using
the Wasserstein-1 metric [?] to measure both class-relevancy and
interpretability of given StyleGAN features. The metric indicates that
important features extracted by XGBoost [?] are the most class-relevant and
interpretable compared to other tabular classifiers.

Based on the previous findings, we propose Img2Tab, a framework that
classifies images and explains its predictions based on automatically
discovered class-relevant concepts. By implementing GAN inversion and tabular
classifier, Img2Tabs consist of three modules sharing the StyleGAN feature
space: an encoder, a generator, and a classifier. They cooperate to predict,
explain, and debug at the concept level. Img2Tabs provide explanations by
importance and visualization at the concept level. By harnessing the
explainability of tabular models, Img2Tabs identify the importance of each
tabular feature. The StyleGAN generator visualizes concept semantics by latent
modification. By altering the concepts’ value of interest, their semantics
resolve into generated images as visual displays for users.

It is to be emphasized that Img2Tabs serve not to explain the pre-trained
classifiers but rather to design an inherently explainable framework.
Unfortunately, inherently explainable models usually struggle with relatively
lower performance[?] than black-box classifiers. The key to designing
practical and interpretable models involves reaching comparable performance as
black-box models. Section 5 exhibits that Img2Tab achieves top-1 accuracy, on
par with black-box baselines.

Fairness has evolved as a core part of designing AI models, which should rely
on something other than biased or unfair concepts for their decision-making.
However, it is challenging to filter specific semantics out of the image.
Masking a particular pixel region in the image may suffice, but this
unnecessarily removes all information in the region. Because of the concept-
level decision-making of Img2Tabs, users can easily debug the Img2Tabs
classifier by masking specific unwanted concepts before training. In Section
5, we evaluate how debugging affects the top-1 accuracy and concept
importance.

To our best knowledge, Img2Tabs become the first inherently explainable
framework that classifies high-resolution images based on human-understandable
concepts in an unsupervised manner, while providing explanations through
importance and with clear visualization at the concept level. Most
importantly, it encounters no reduction in accuracy. The key contributions of
this paper are summarized as follows:

  * •

We propose a novel method using the Wasserstein-1 metric to quantify the
class-relevancy and interpretability of given StyleGAN features
simultaneously.

  * •

We design an Img2Tab framework that classifies images and explains prediction
based on automatically discovered, class-relevant concepts.

  * •

Img2Tab achieves top-1 accuracy on par with CNN and deep feature learning
baselines.

  * •

Users can easily debug Img2Tab classifier at the concept level to ensure
unbiased and fair decision-making.

##  2 Related Work

Latent Space of GANs Many works leverage the advancement of GANs for feature
learning. For example, StyleGAN has attracted considerable attention due to
its well-disentangled, smooth, and semantically rich feature space. Recent
works such as Styleflow [?], GANspace [?], InterfaceGAN [?], and StyleSpace
[?] presented techniques to discover the concepts encoded in the GAN latent.
Such concepts appear semantically linear on the generated images when
interpolated along a certain latent direction. To edit real images along the
discovered concepts, users should reconstruct the images via GAN generators.
This idea has accelerated the advent of GAN inversion methods for
reconstructing images; such methods include ALI [?], e4e [?], pSp [?],
HyperStyle [?], ReStyle [?], and PTI [?]). GAN inversion has motivated another
possibility as a feature learning method for downstream tasks. Several
works(LARGE [?], GHFeat [?], BiGAN [?], BigBiGAN [?], and ALI [?]) exploit the
features projected from real images for regression or classification tasks. On
account of the interpretability of StyleGAN features, we extensively leverage
them in the view of XAI. Section 5 compares Img2Tabs performance with deep
feature learning methods on classification accuracy.

Tabular classifiers Tabular classifiers such as Linear Regression [?], SVM
[?], XGBoost [?], CatBoost [?], and TabNet [?] are widely used in tabular
classification tasks due to their inherent interpretability. They provide an
explanation of feature importance, one of the more intuitive methods. The
explanation enables users to understand its inference and to debug its
decision-making at the human-labeled feature level.

Concept-based Explanations A main challenge for concept-based explanations is
to extract high-level concepts and visualize them. CBM [?], TCAV [?], and
CoCoX [?] require concept annotation or additional information about concepts.
SENN [?], ConceptSHAP [?], and [?] visualize concepts by showing samples with
high concept activation. ACE [?] and CoCoX [?] visualize concepts in super-
pixels, which are unclear. In the case of DISSECT [?], EPE [?], SENN [?], and
ConceptSHAP [?], they fail to provide explanations in high-resolution images.
Lastly, those who learn concepts by jointly training GAN(DISSECT [?], EPE [?],
and StylEx [?]) ought to train the whole framework(including the generator) as
they cannot use pre-trained generators.

##  3 Setup for Designing Img2Tabs

In this section, we argue why StyleGAN features are effectively tabular
features. By studying the feature properties from the XAI perspectives, we
present a novel method using the Wasserstein-1 metric to simultaneously
measure the class-relevancy and interpretability of given StyleGAN features.
Then, we exploit the method to determine which tabular model proves the most
effective at automatically discovering class-relevant concepts without
requiring any manual feature selection.

###  3.1 StyleGAN latent for tabular features

Let $\mathcal{X}\subset\mathbb{R}^{H\times W\times C}$ be the input data(image
set), $\mathcal{Y}\subset\mathbb{R}$ be the output data(label set), where
$x\in\mathcal{X}$ and $y\in\mathcal{Y}$. We define our dataset with $N$
samples as follows, $\mathcal{D}=\\{(x_{i},y_{i})^{N}_{i=1}\\}$. The StyleGAN
generator $G:\sfPsi\rightarrow\mathcal{X}$ reconstructs the input image $x$ to
$\hat{x}$, where $\sfPsi\subset\mathbb{R}^{d_{\sfPsi}}$ is a feature space
containing concepts. We define a GAN encoder $E:\mathcal{X}\rightarrow\sfPsi$
transforming image $x$ into $\sfPsi$ space, $\psi=E(x)$, to encode image
pixels into tabular features. Note that $\psi_{i,k}$ stands for the $i$-th
sample’s $k$-th feature value , which potentially could be a concept. In this
exercise, we assume three conditions for a latent to be regarded as a tabular
feature. First, feature values are assigned quantitatively in human-
understandable semantics as discrete or continuous scalars. Second, each
dimension in the latent represents a single semantic by itself. Third, the
relationship between the feature scalar $\psi_{i,k}$ and semantic strength in
the image $\hat{x_{i}}$ is monotonic within a certain range of values. This
implies that directionally controlling the feature scalar $\psi_{i,k}$ reveals
the corresponding semantic in the generated image $\hat{x}_{i}$ in the same
direction.

We argue that a StyleGAN latent satisfies the three conditions for being
tabular features. $\sfPsi$ supports three latents $\mathcal{Z}$,
$\mathcal{W}$, and $\mathcal{S}$. $\mathcal{Z}$ denotes Gaussian prior, while
we obtain the remaining latents by feeding them forward through a mapping
network of StyleGAN ($\mathcal{W}$) and subsequent affine transformation layer
($\mathcal{S}$). Each latent spans in a continuous domain. In addition, as
studied in previous research[?], $\mathcal{S}$ space exhibits improved
disentanglement compared to other latent spaces $\mathcal{Z}$ and
$\mathcal{W}$. Improved disentanglement implies that each feature dimension
represents a single, lone semantic. Moreover, [?] demonstrates that
controlling a single element in $\mathcal{S}$ leads to a consistent and
monotonic change in generated images $\hat{x_{i}}$. Thus, the properties of
the space $\mathcal{S}$ satisfy the three desirable conditions for being a
tabular feature space. As a result, we leverage $\mathcal{S}$ space as
$\sfPsi$ in our Img2Tab frameworks.

###  3.2 Discovering class-relevant concepts within $\sfPsi$

An explainable classifier should make decisions by class-relevant concepts,
which are interpretable and useful for classification. Since the GAN inversion
networks $G(E(\cdot))$ reconstruct a real image $x_{i}$, the latent space
$\sfPsi$ contains all image features, even those that are not useful for
classification tasks. As researched by [?], only a small portion of features
in $\sfPsi$ are interpretable. Thus, explainable classifiers must discover
such features that are both class-relevant and interpretable from $\psi_{i}$.
In this section, we present a novel method using the Wasserstein-1 metric in
order to reveal quantitatively that an existing tabular classifier
automatically discovers class-relevant concepts within the StyleGAN latents
$\sfPsi$.

The encoder $E$ encodes all samples $x_{i}$ from the train dataset
$\mathcal{D}_{train}$, and store each row vector
$\psi_{i}\in\mathbb{R}^{d_{\sfPsi}}$ into a matrix
$\Psi\in\mathbb{R}^{|\mathcal{D}_{train}|\times d_{\sfPsi}}$ as illustrated in
Figure 2.

Figure 2: $\psi$ matrix illustration Figure 3: This figure depicts plots of
probability distributions between
$\tilde{\psi}_{pos,k}\in\tilde{\Psi}_{pos}^{\top}$(blue) and
$\tilde{\psi}_{neg,k}\in\tilde{\Psi}_{neg}^{\top}$(red) with corresponding
$\psi_{i,k}$ visualization. The upper half presents the results of top-2 $k$
with the largest $W_{k}$. Refer to Supplementary Figure 1 for more concepts.
The lower half presents the results of randomly chosen $k$. We observe that
semantics of $\psi_{k}$ appear strongly class-relevant and interpretable when
the two probability distributions are less overlapped each other. On the other
hand, randomly chosen features are neither interpretable nor relevant to the
class. Note that $\psi_{i,3050}$ seems relevant to the class, a mere
coincidence by random sampling. This figure highlights $W_{k}$ as an empirical
metric, discovering class-relevant concepts. Algorithm 1 Measure $W_{k}$ of
given StyleGAN features

Data: Train dataset $\mathcal{D}_{train}$, Encoder $E$.

Result: An array $W_{k}$

Initialization: $\Psi=$ 2-d matrix, $W=$ 1-d array

for $(x_{i},y_{i})$ in $\mathcal{D}_{train}$ do

$\psi_{i}=E(x_{i})$

Add $\psi_{i}$ to $\Psi$ as a row vector

end for

for $\psi_{k}$ in $\Psi^{\top}$ do

Standardize $\psi_{k}$

end for

$\tilde{\Psi}_{pos}=\\{\tilde{\psi}_{i}\in\Psi\ |\ y_{i}=1,\
(x_{i},y_{i})\in\mathcal{D}_{train}\\}$

$\tilde{\Psi}_{neg}=\\{\tilde{\psi}_{i}\in\Psi\ |\ y_{i}=-1,\
(x_{i},y_{i})\in\mathcal{D}_{train}\\}$

for $(\tilde{\psi}_{pos,k},\tilde{\psi}_{neg,k})$ in
$(\tilde{\Psi}_{pos}^{\top},\tilde{\Psi}_{neg}^{\top})$ do

$W_{k}=$ Wasserstein-1($\tilde{\psi}_{pos,k}$, $\tilde{\psi}_{neg,k}$)

Add $W_{k}$ to $W$

end for

return $W$

Then, we standardize each $k$-th column vector $\psi_{k}\in\Psi^{\top}$.
Considering binary classification, we split the $\tilde{\Psi}$ into positive
samples $\tilde{\Psi}_{pos}$ and negative samples $\tilde{\Psi}_{neg}$
according to their labels $y_{i}$. Note that the tilde sign implies “after
standardization.” We assume that the scalar $\tilde{\psi}_{i,k}$ consistently
conveys the strength of a certain semantic if $\psi_{i,k}$ represents an
interpretable feature. The scalar $\tilde{\psi}_{i,k}$ frequently fires
distinguishably according to the label if the $\psi_{i,k}$ feature represents
useful information for the classification. For example, if $\psi_{i,k}$
represents the concept of “makeup,” $\tilde{\psi}_{i,k}$ scalars will tend to
be frequently and consistently higher in female (as opposed to male) images.
Specifically, probability distributions of each $k$-th feature across the data
samples between $\tilde{\psi}_{k}\in{\tilde{\Psi}_{pos}^{\top}}$ and
$\tilde{\psi_{k}}\in\tilde{\Psi}_{neg}^{\top}$ will be distinct, ergo their
probability distribution plots do not overlap. The probability distributions
will overlap if the feature $\psi_{i,k}$ does not satisfy either class-
relevancy or interpretability. To quantify the degree of overlap, we compute
the Wasserstein-1 distance $W_{k}$ between the two probability distributions.
The detailed procedure is described in Algorithm 1.

Figure 4: This figure compares the average $W_{k}$ of top-5 important features
discovered by interpretable tabular classifiers for various classification
tasks. In every task, XGBoost classifier outperforms all other models at
automatically discovering class-relevant concepts within $\sfPsi$, yielding
the highest $W_{k}$. Note that we obtain globally important features of TabNet
by counting the frequency of locally important features across all test
samples. Figure 5: Architecture of Img2Tab frameworks in details. The image
$x_{i}$ is transformed via $E$ into StyleGAN latent space $\sfPsi$. A user
concatenates the extracted latent into the tabular form $\psi_{i}$. The
classifier $P$ predicts the label $hat{y_{i}}$ from $\sfPsi$ at the concept
level automatically discovering class-relevant concepts within $\psi_{i}$. In
the explanation stage, the classifier provides us an explanation by importance
and visualization $G(\psi_{i,\pm k})$. For debugging, users train the
classifier $P$ with train samples of which unwanted concepts $\psi_{i,k}$ are
masked into $\psi_{i}^{k}$. Note that we sequentially train each network in
the order of $G$, $E$, and $P$, sharing the $\sfPsi$ space as a bottleneck.

For empirical justifications, we search top-2 $\psi_{k}$ with the highest
$W_{k}$. Figure 3 depicts distributions of top-2 $\psi_{k}$ for each class and
concept visualization obtained by latent modifications. The less distributions
overlap, the more semantics of the $\psi_{k}$ are both class-relevant and
interpretable. Therefore, we use $W_{k}$ to measure whether or not the given
StyleGAN features are class-relevant concepts.

We investigate whether important features extracted by existing tabular
classifiers are class-relevant concepts. Figure 4 illustrates the $W_{k}$
average values for the top 5 important features discovered by each classifier.
We train the classifiers with dataset of $\psi_{train}=\\{E(x_{i})\ |\
x_{i}\in\mathcal{D}_{train}\\}$. Note that we employ SHAP[?] for MLP and a
linear kernel for SVM to compute feature importance. The evaluation
illustrates that important features extracted by the XGBoost classifier are
the most class-relevant and interpretable. Therefore, we implement the XGBoost
Img2Tab classifier as it automatically distinguishes class-relevant concepts
by extracting important features.

##  4 Img2Tab Frameworks

In this section, we design an Img2Tab framework based on the finding from
Section 3.

Architecture and concept-based inference As described in Figure 5, three main
components incorporated in bottleneck architecture share the latent space
$\sfPsi$: 1) a GAN encoder $E$ for the concept extractor, 2) a StyleGAN
generator $G$ for the concept visualizer, and 3) a tabular classifier $P$ for
classifying images based on concepts. The generator $G$ and the classifier $P$
cooperate in providing an explanation by importance and visualization at the
concept level. We implement e4e [?] for the GAN inversion network
$\hat{x_{i}}=G(E(x_{i}))$ as e4e is well-designed to manipulate and visualize
semantics of specific features. To classify an image $x_{i}$ from extracted
tabular feature vector $\psi_{i}$, we implement a tabular classifier
$P:\sfPsi\rightarrow\mathcal{Y}$. As discussed in Section 3.2, we choose
XGBoost for the classifier $P$. Img2Tab predicts the label of images in an
end-to-end fashion: $\hat{y_{i}}=P(E(x_{i}))$.

Figure 6: Top 4 important concepts automatically discovered by Img2Tab with
the XGboost classifier. For each image pair, the left image signifies for the
source image, and the one with the red box represents $G(x_{i,\pm k})$ of
$\psi_{i,k}$ for the corresponding image. The important concepts represent
diverse, well-disentangled, class-relevant, and human-understandable
semantics.

Concept-based explanation Img2Tab framework explains its prediction in two
steps: it discovers important concepts and visualizes them. Then, generator
$G$ visualizes the semantics of important concepts by latent modification.
Many works of literature such as EPE [?], DISSECT [?], and StylEx [?]) exploit
latent modification for visualizing concepts. In the same fashion, we redefine
the latent modification used in our framework. A modified concept vector after
modification in the latent level is defined as follows:
$\psi_{i,\pm{k}}=\psi_{i}\pm\lambda e_{k}$, where
$e_{k}\in\mathbb{R}^{d_{\psi}}$ stands for a unit vector of which $k$-th
element’s value is 1. To be more precise, $\psi_{i,\pm{k}}$ depicts a concept
vector of which $k$-th element is modified as much as $\lambda\in\mathbb{R}$
in either positive or negative direction. Then, we feed the modified concept
vector into the generator $G$: $\hat{x}_{i,\pm k}=G(\psi_{i,\pm{k}})$. We
expect $G(\psi_{i,\pm k})$ to manifest a change of the $k$-th concept’s
semantic. $G(\psi_{i})$ and $G(\psi_{i,\pm k})$ together enable users to
observe the semantics of the interesting concepts. After all, we identify
important concepts in decision-making and which semantics it matches.

Concept-based debugging Img2Tab enables users to identify class-relevant
concepts either from the $W_{k}$ metric or classifier $P$. Once Users examine
whether the class-relevant concept represents biased or unfair semantics, they
may filter the semantics out of classifier $P$ decision-making. Thanks to data
expressed in concepts, we mask unwanted $k$-th features across all training
samples as follows: $\psi_{i}^{k}=\psi_{i}\odot(e-e_{k})$, where
$e\in\mathbb{R}^{d_{\sfPsi}}$ denotes all-one-vectors, and $\odot$ represents
the Hadamard product. We train the classifier $P$ with
$\psi_{train}^{k}=\\{E(x_{i})\odot(e-e_{k})\ |\
x_{i}\in\mathcal{D}_{train}\\}$. As a result, Img2Tabs exclude the specific
unwanted concepts from decision-making.

##  5 Evaluation and Discussion

In this section, we provide three evaluations as follows: 1) we demonstrate
concept-based explanation by Img2Tab, and 2) we measure the top-1 accuracy of
Img2Tab to compare with CNN and deep feature learning baselines. 3) We show
how Img2Tab debugging affects important concepts and top-1 accuracy. Img2Tab
employs the XGBoost classifier for all evaluations. The datasets used in the
subsequent experiments are the CelebA (face recognition) and MNIST (digit
recognition). Note that GAN inversion networks of the face domain are pre-
trained by the FFHQ dataset for generalized concept learning. Refer to the
Supplementary for more implementation details.

###  5.1 Img2Tab Explanations

Visualizing important concepts We begin by visualizing important concepts
extracted by Img2Tabs emphasizing that Img2Tab automatically discovers them
without any manual selections using $W_{k}$ metrics. As exhibited in Figure 6,
important concepts automatically discovered by the Img2Tab are diverse, rich,
well-disentangled, and human-understandable in various samples. By common
sense, we observe that they are highly relevant to the class and human-
understandable concepts.

Figure 7: Importance plots for the top 4 important concepts discovered by
Img2Tab for perceived gender classification and age classification.

Identifying concept importance Figure 7 displays the importance of each
important concept. The Img2Tab framework explains its inference in that
“Makeup,” “Hair Length,” “Smiling,” and “Facial Hair” are of ranked importance
(descending order) for the perceived gender classification. We take exception
with “Smiling” as a concept, further discussed in Section 5.3. For perceived
age classification, the Img2Tab decision-making primarily leverages “Lip
Thickness,” “Chubby with Beard,” “Black hair,” and “Wrinkles.” The feature
importance explanation epitomizes the most intuitive method, allowing users to
identify the most influential concepts in the prediction at a glance.

Classifiers | Gender | Age | Eyeglasses | Bangs
---|---|---|---|---
ResNet-50 | 97.04 | 87.27 | 99.01 | 95.39
Inception-v4 | 97.24 | 87.05 | 99.00 | 95.17
MobileNet-v3 | 97.10 | 87.25 | 98.97 | 95.33
DenseNet-121 | 97.53 | 87.49 | 99.06 | 95.24
EfficientNet-b4 | 98.10 | 88.01 | 99.43 | 96.02
Img2Tab(Ours) | 97.85 | 87.44 | 99.23 | 94.88
Table 1: Top-1 accuracy[%] comparison for CelebA attributes

###  5.2 Performance Evaluations

In this section, we compare Img2Tabs to CNN baselines on top-1 accuracy,
showing demonstrating that Img2Tabs achieve comparable performance to black-
box baselines.

Img2Tab vs CNN Table 1 reports the top-1 accuracy of Img2Tab and CNN baselines
for CelebA attribute classifications. Every CNN baseline is initialized with
“ImageNet” pre-training. Our Img2Tab outperforms ResNet-50 [?], Inception-v4
[?], and MobileNet-v3 [?] with 0.85% in maximum except ‘Bangs’ classification.
DenseNet-121 achieves top-1 accuracy nearly on par with our Img2Tab.
Meanwhile, EfficientNet-b4 [?] outperforms our Img2Tab slightly with 0.6% on
average. This suggests that the discriminative capability of Img2Tab is
comparable to CNN baselines. Thus, Img2Tab frameworks possess tremendous
potential to compete with other CNN-based models while retaining
explainability.

Img2Tab vs Deep feature learning As Img2Tab uses GAN inversion for
feature(concept) learning, we compare deep feature learning methods to Img2Tab
in the MNIST digit recognition task. Note that the baseline results in Table 2
adhere to the GH-Feat paper [?] for this evaluation. Our Img2Tab accuracy
surpasses AEs [?], BiGAN [?] and ALAE [?] by 0.81%, 0.87%, 1.1%, and 0.63%
margin, respectively. Slightly lower accuracy compared to the GH-FEAT appears
at the cost of explainability with Img2Tab, as the decision-making of GH-Feat
[?] is not explainable.

Methods | Digit recognition
---|---
AE($l_{1}$) | 97.43
AE($l_{2}$) | 97.37
BiGAN | 97.14
ALAE | 97.61
GH-Feat | 99.06
Img2Tab(Ours) | 98.24
Table 2: Top-1 accuracy[%] comparison for MNIST digit recognition Figure 8:
Important concepts automatically discovered by Img2Tab for MNIST digit
recognition. For each image pair, the left captures the source image, and the
red-outlined represents $G(x_{i,\pm k})$ of the corresponding image.

###  5.3 Debugging Img2Tab Classifier

In previous evaluations, Img2Tab erroneously includes concepts of “Smiling”
and “Makeup” for classifying gender. By common sense, “Smiling” does not serve
as a reasonable concept when classifying gender. But Img2Tab considers the
concept important because females in CelebA samples smile more often than
males, which invites bias. Also “Makeup” is not an inborn characteristic of
females leading to unfair decisions. We debug the Img2Tab classifier by
masking “Makeup” and “Smiling” at the concept level(i.e., not by masking
pixels in an image) to ensure unbiased and fair decision-making. Figure 9
depicts the importance of perceived gender classification before and after
debugging. Accordingly, the importance of “Makeup” and “Smiling” becomes zero.
The debugged model does not include any information about “Makeup” and
“Smiling” concepts, which yields fair and unbiased decision-making.

To check whether masking concepts reduces the accuracy, we debug Img2Tab with
each top-4 important concept masked: $\psi_{i}^{4319}$(“Makeup”),
$\psi_{i}^{503}$(“Hair Length”), $\psi_{i}^{4440}$(“Smiling”), and
$\psi_{i}^{4614}$(“Facial Hair”). The accuracy results are 97.90%, 97.84%,
97.83%, and 97.95%; accuracy barely changes compared to the baseline(97.80%).
Img2Tabs effectively discover alternative class-relevant concepts, despite one
concept being masked, which captures the flexibility of Img2Tab decision-
making.

Figure 9: A plot comparing importance changes after masking unwanted concepts
for unbiased and fair decision-making. We mask ‘Makeup’ and ‘Smiling’
concepts.

##  6 Conclusion

We proposed a novel method using the Wasserstein-1 metric to measure class-
relevancy and interpretability simultaneously from StyleGAN features. By this
method, we evaluate that training XGBoost within StyleGAN features enables
Img2Tabs to produce explainable concept-based image classifications. Img2Tab
predicts image labels and explains its prediction through importance scores
and visualization at the concept level. In addition, users can easily debug
the Img2Tab classifier to ensure unbiased and fair decision-making. Img2Tabs
gains several advantages over existing concept-based explanations whilst not
encountering significant accuracy reduction compared to the deep net
baselines.

This paper bridges the gap between generative models and tabular classifiers
to harness the explainability of the latter for image classifications. Since
GAN inversion networks and tabular classifiers are not trained jointly, there
is room to enhance the classification performance and quality of the feature
space, with the advent of more sophisticated techniques from each research
domain.

## References

  * [Abdal et al., 2021] Rameen Abdal, Peihao Zhu, Niloy J Mitra, and Peter Wonka.  Styleflow: Attribute-conditioned exploration of stylegan-generated images using conditional continuous normalizing flows.  ACM Transactions on Graphics (ToG), 40(3):1–21, 2021.
  * [Akula et al., 2020] Arjun Akula, Shuai Wang, and Song-Chun Zhu.  Cocox: Generating conceptual and counterfactual explanations via fault-lines.  In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 2594–2601, 2020.
  * [Alaluf et al., 2021] Yuval Alaluf, Or Patashnik, and Daniel Cohen-Or.  Restyle: A residual-based stylegan encoder via iterative refinement.  In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6711–6720, 2021.
  * [Alaluf et al., 2022] Yuval Alaluf, Omer Tov, Ron Mokady, Rinon Gal, and Amit Bermano.  Hyperstyle: Stylegan inversion with hypernetworks for real image editing.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 18511–18521, 2022.
  * [Alvarez Melis and Jaakkola, 2018] David Alvarez Melis and Tommi Jaakkola.  Towards robust interpretability with self-explaining neural networks.  Advances in neural information processing systems, 31, 2018.
  * [Arik and Pfister, 2021] Sercan Ö Arik and Tomas Pfister.  Tabnet: Attentive interpretable tabular learning.  In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 6679–6687, 2021.
  * [Berkson, 1944] Joseph Berkson.  Application of the logistic function to bio-assay.  Journal of the American statistical association, 39(227):357–365, 1944.
  * [Borisov et al., 2021] Vadim Borisov, Tobias Leemann, Kathrin Seßler, Johannes Haug, Martin Pawelczyk, and Gjergji Kasneci.  Deep neural networks and tabular data: A survey.  arXiv preprint arXiv:2110.01889, 2021.
  * [Chen and Guestrin, 2016] Tianqi Chen and Carlos Guestrin.  Xgboost: A scalable tree boosting system.  In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pages 785–794, 2016.
  * [Donahue and Simonyan, 2019] Jeff Donahue and Karen Simonyan.  Large scale adversarial representation learning.  Advances in neural information processing systems, 32, 2019.
  * [Donahue et al., 2016] Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell.  Adversarial feature learning.  arXiv preprint arXiv:1605.09782, 2016.
  * [Dorogush et al., 2018] Anna Veronika Dorogush, Vasily Ershov, and Andrey Gulin.  Catboost: gradient boosting with categorical features support.  arXiv preprint arXiv:1810.11363, 2018.
  * [Dumoulin et al., 2016] Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville.  Adversarially learned inference.  arXiv preprint arXiv:1606.00704, 2016.
  * [Ghandeharioun et al., 2021] Asma Ghandeharioun, Been Kim, Chun-Liang Li, Brendan Jou, Brian Eoff, and Rosalind W Picard.  Dissect: Disentangled simultaneous explanations via concept traversals.  arXiv preprint arXiv:2105.15164, 2021.
  * [Ghorbani et al., 2019] Amirata Ghorbani, James Wexler, James Y Zou, and Been Kim.  Towards automatic concept-based explanations.  Advances in Neural Information Processing Systems, 32, 2019.
  * [Härkönen et al., 2020] Erik Härkönen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris.  Ganspace: Discovering interpretable gan controls.  Advances in Neural Information Processing Systems, 33:9841–9850, 2020.
  * [He et al., 2016] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun.  Deep residual learning for image recognition.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
  * [Hearst et al., 1998] Marti A. Hearst, Susan T Dumais, Edgar Osuna, John Platt, and Bernhard Scholkopf.  Support vector machines.  IEEE Intelligent Systems and their applications, 13(4):18–28, 1998\.
  * [Hinton and Salakhutdinov, 2006] Geoffrey E Hinton and Ruslan R Salakhutdinov.  Reducing the dimensionality of data with neural networks.  science, 313(5786):504–507, 2006.
  * [Howard et al., 2019] Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al.  Searching for mobilenetv3.  In Proceedings of the IEEE/CVF international conference on computer vision, pages 1314–1324, 2019.
  * [Kantorovich, 1960] Leonid V Kantorovich.  Mathematical methods of organizing and planning production.  Management science, 6(4):366–422, 1960.
  * [Karras et al., 2020] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila.  Analyzing and improving the image quality of stylegan.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 8110–8119, 2020.
  * [Kim et al., 2018] Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, et al.  Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav).  In International conference on machine learning, pages 2668–2677. PMLR, 2018.
  * [Koh et al., 2020] Pang Wei Koh, Thao Nguyen, Yew Siang Tang, Stephen Mussmann, Emma Pierson, Been Kim, and Percy Liang.  Concept bottleneck models.  In International Conference on Machine Learning, pages 5338–5348. PMLR, 2020.
  * [Lang et al., 2021] Oran Lang, Yossi Gandelsman, Michal Yarom, Yoav Wald, Gal Elidan, Avinatan Hassidim, William T Freeman, Phillip Isola, Amir Globerson, Michal Irani, et al.  Explaining in style: Training a gan to explain a classifier in stylespace.  In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 693–702, 2021.
  * [Lundberg and Lee, 2017] Scott M Lundberg and Su-In Lee.  A unified approach to interpreting model predictions.  Advances in neural information processing systems, 30, 2017.
  * [Molnar, 2018] Christoph Molnar.  A guide for making black box models explainable.  URL: https://christophm. github. io/interpretable-ml-book, 2018\.
  * [Nitzan et al., 2022] Yotam Nitzan, Rinon Gal, Ofir Brenner, and Daniel Cohen-Or.  Large: Latent-based regression through gan semantics.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 19239–19249, 2022.
  * [Pidhorskyi et al., 2020] Stanislav Pidhorskyi, Donald A Adjeroh, and Gianfranco Doretto.  Adversarial latent autoencoders.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14104–14113, 2020.
  * [Richardson et al., 2021] Elad Richardson, Yuval Alaluf, Or Patashnik, Yotam Nitzan, Yaniv Azar, Stav Shapiro, and Daniel Cohen-Or.  Encoding in style: a stylegan encoder for image-to-image translation.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2287–2296, 2021.
  * [Roich et al., 2022] Daniel Roich, Ron Mokady, Amit H Bermano, and Daniel Cohen-Or.  Pivotal tuning for latent-based editing of real images.  ACM Transactions on Graphics (TOG), 42(1):1–13, 2022.
  * [Sarkar et al., 2022] Anirban Sarkar, Deepak Vijaykeerthy, Anindya Sarkar, and Vineeth N Balasubramanian.  A framework for learning ante-hoc explainable models via concepts.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10286–10295, 2022.
  * [Shen et al., 2020] Yujun Shen, Ceyuan Yang, Xiaoou Tang, and Bolei Zhou.  Interfacegan: Interpreting the disentangled face representation learned by gans.  IEEE transactions on pattern analysis and machine intelligence, 2020\.
  * [Singla et al., 2019] Sumedha Singla, Brian Pollack, Junxiang Chen, and Kayhan Batmanghelich.  Explanation by progressive exaggeration.  arXiv preprint arXiv:1911.00483, 2019.
  * [Szegedy et al., 2017] Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi.  Inception-v4, inception-resnet and the impact of residual connections on learning.  In Thirty-first AAAI conference on artificial intelligence, 2017\.
  * [Tan and Le, 2019] Mingxing Tan and Quoc Le.  Efficientnet: Rethinking model scaling for convolutional neural networks.  In International conference on machine learning, pages 6105–6114. PMLR, 2019.
  * [Tov et al., 2021] Omer Tov, Yuval Alaluf, Yotam Nitzan, Or Patashnik, and Daniel Cohen-Or.  Designing an encoder for stylegan image manipulation.  ACM Transactions on Graphics (TOG), 40(4):1–14, 2021.
  * [Wu et al., 2021] Zongze Wu, Dani Lischinski, and Eli Shechtman.  Stylespace analysis: Disentangled controls for stylegan image generation.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12863–12872, 2021.
  * [Xu et al., 2021] Yinghao Xu, Yujun Shen, Jiapeng Zhu, Ceyuan Yang, and Bolei Zhou.  Generative hierarchical features from synthesizing images.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4432–4442, 2021.
  * [Yeh et al., 2020] Chih-Kuan Yeh, Been Kim, Sercan Arik, Chun-Liang Li, Tomas Pfister, and Pradeep Ravikumar.  On completeness-aware concept-based explanations in deep neural networks.  Advances in Neural Information Processing Systems, 33:20554–20565, 2020.