id
stringlengths 33
34
| updated
timestamp[s] | published
timestamp[s] | title
stringlengths 9
212
| summary
stringlengths 75
2.46k
| author
sequence | arxiv:doi
stringlengths 0
71
| link
list | arxiv:journal_ref
sequence | arxiv:primary_category
dict | category
sequence | content
stringlengths 0
1.25M
|
---|---|---|---|---|---|---|---|---|---|---|---|
http://arxiv.org/abs/2302.10706v2 | 2023-02-22T14:03:41 | 2023-02-21T14:51:08 | Variational Boosted Soft Trees | Gradient boosting machines (GBMs) based on decision trees consistently
demonstrate state-of-the-art results on regression and classification tasks
with tabular data, often outperforming deep neural networks. However, these
models do not provide well-calibrated predictive uncertainties, which prevents
their use for decision making in high-risk applications. The Bayesian treatment
is known to improve predictive uncertainty calibration, but previously proposed
Bayesian GBM methods are either computationally expensive, or resort to crude
approximations. Variational inference is often used to implement Bayesian
neural networks, but is difficult to apply to GBMs, because the decision trees
used as weak learners are non-differentiable. In this paper, we propose to
implement Bayesian GBMs using variational inference with soft decision trees, a
fully differentiable alternative to standard decision trees introduced by Irsoy
et al. Our experiments demonstrate that variational soft trees and variational
soft GBMs provide useful uncertainty estimates, while retaining good predictive
performance. The proposed models show higher test likelihoods when compared to
the state-of-the-art Bayesian GBMs in 7/10 tabular regression datasets and
improved out-of-distribution detection in 5/10 datasets. | [
"Tristan Cinquin",
"Tammo Rukat",
"Philipp Schmidt",
"Martin Wistuba",
"Artur Bekasov"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10706v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10706v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"stat.ML"
] | Variational Boosted Soft Trees
3
2
0
2
b
e
F
2
2
]
G
L
.
s
c
[
2
v
6
0
7
0
1
.
2
0
3
2
:
v
i
X
r
a
Tristan Cinquin
University of Tuebingen1
[email protected]
Tammo Rukat
Deekard1
[email protected]
Philipp Schmidt
Amazon
[email protected]
Martin Wistuba
Amazon
[email protected]
Artur Bekasov
Amazon
[email protected]
Abstract
1
INTRODUCTION
Gradient boosting machines (GBMs) based on
decision trees consistently demonstrate state-of-
the-art results on regression and classification
tasks with tabular data, often outperforming deep
neural networks. However, these models do not
provide well-calibrated predictive uncertainties,
which prevents their use for decision making in
high-risk applications. The Bayesian treatment
is known to improve predictive uncertainty cali-
bration, but previously proposed Bayesian GBM
methods are either computationally expensive, or
resort to crude approximations. Variational infer-
ence is often used to implement Bayesian neural
networks, but is difficult to apply to GBMs, be-
cause the decision trees used as weak learners
are non-differentiable. In this paper, we propose
to implement Bayesian GBMs using variational
inference with soft decision trees, a fully differ-
entiable alternative to standard decision trees in-
troduced by Irsoy et al. Our experiments demon-
strate that variational soft trees and variational soft
GBMs provide useful uncertainty estimates, while
retaining good predictive performance. The pro-
posed models show higher test likelihoods when
compared to the state-of-the-art Bayesian GBMs
in 7/10 tabular regression datasets and improved
out-of-distribution detection in 5/10 datasets.
1Work done while at Amazon.
Proceedings of the 26th International Conference on Artificial Intel-
ligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR:
Volume 206. Copyright 2023 by the author(s).
Tabular data, often combining both real valued and cate-
gorical variables, is common in machine learning appli-
cations (Borisov et al., 2021; Hoang and Wiegratz, 2021;
Clements et al., 2020; Ebbehoj et al., 2021; Mustafa and
Rahimi Azghadi, 2021). A number of these applications
require uncertainty estimates, in addition to the model's
predictions. Predictive uncertainty is particularly important
when using the model for making decisions associated with
risk, as common in healthcare (Abdullah et al., 2022; Kompa
et al., 2021) or finance (Bew et al., 2019; Gonzalvez et al.,
2019). In order to make optimal decisions, we require the
uncertainty estimates to be well-calibrated: the predictive
distribution returned by the model should capture the true
likelihood of the targets (Guo et al., 2017).
A decision tree is a predictive model that is fit by recur-
sively partitioning the feature space. These models are
fast, interpretable and support categorical data without addi-
tional pre-processing. To increase their expressivity without
exacerbating overfitting, multiple decision trees can be com-
bined into an ensemble using gradient boosting (Freund
and Schapire, 1997; Friedman, 2001). Gradient boosting
machines (GBM) are an expressive class of machine learn-
ing models trained by sequentially fitting an ensemble of
weak learners (e.g. decision trees). At each iteration, the
gradient boosting procedure fits an additional weak learner
that would minimize the training error when added to the
ensemble. These models demonstrate state-of-the-art re-
sults on tabular data (Bojer and Meldgaard, 2021; Liu et al.,
2021), often out-performing deep neural networks (Borisov
et al., 2021; Shwartz-Ziv and Armon, 2022).
While GBM models demonstrate good predictive perfor-
mance, they do not provide well-calibrated predictive un-
certainties (Niculescu-Mizil and Caruana, 2012). Bayesian
methods are known to improve predictive uncertainties by
explicitly capturing the epistemic uncertainty, a type of un-
certainty that results from learning with finite data (Kristiadi
Variational Boosted Soft Trees
et al., 2020; Mitros and Namee, 2019). Bayesian GBMs
have been proposed, and indeed improve upon the predic-
tive uncertainties of standard GBMs (Chipman et al., 1998;
Linero and Yang, 2017; Ustimenko and Prokhorenkova,
2020). Current methods rely on Markov chain Monte Carlo
(MCMC) to sample from the posterior, however, and do
not scale well to larger models and datasets. Alternative
approximate sampling methods have been proposed by He
and Hahn (2020) and Malinin et al. (2020). These methods
make the sampling procedure more efficient, but degrade
the quality of the resulting predictive uncertainties. More
scalable approximate inference methods such as the Laplace
approximation or variational inference are difficult to apply
to GBMs, because the decision trees used as weak learners
are non-differentiable.
Unlike standard decision trees that route the input to a
unique leaf based on a series of binary conditions, soft deci-
sion trees (Irsoy et al., 2012) compute a convex combination
of all leaves, weighing their values by a series of learned
gating functions. As a result, soft decision trees are fully
differentiable, and therefore amenable to scalable Bayesian
inference methods that are common in Bayesian deep learn-
ing (Blundell et al., 2015; Cobb and Jalaian, 2020; Immer
et al., 2020).
In this work we propose to implement Bayesian GBMs by
using soft trees as week learners in a GBM, and performing
variational inference on the resulting model. In particular,
we make the following contributions:
1. We propose a method for performing variational in-
ference in soft decision trees. The chosen variational
distribution allows trading-off memory and computa-
tion for a richer posterior approximation.
2. We increase the expressivity of the model by using
variational soft trees as weak learners in a GBM.
3. We run experiments to demonstrate that the pro-
posed models perform well on tabular data, yielding
useful predictive uncertainties in regression, out-of-
distribution detection and contextual bandits.
2 BACKGROUND
2.1 Bayesian inference
Bayesian inference provides a theoretical framework for
reasoning about model uncertainty, and has been shown to
improve calibration of machine learning models in prac-
tice (Mitros and Namee, 2019; Kristiadi et al., 2020). In
Bayesian inference we place a prior on the model parame-
ters θ, and use the Bayes rule to define the posterior distri-
bution having observed the data:
p(θ | D) ∝ p(D | θ)p(θ)
(1)
where D = {xi, yi}n
i=1 is the training data, p(θ) is the prior
distribution, and p(D | θ) the likelihood. The predictive
distribution of a new target y∗ given a feature vector x∗ is
then computed as
p(y∗ | x∗) = Eθ∼p(θ | D)[p(y∗ | x∗, θ)]
(2)
The posterior distribution in the Bayesian paradigm explic-
itly captures epistemic or model uncertainty that results from
learning with finite data. Epistemic uncertainty is one of
the two fundamental types of uncertainty (alongside the
aleatoric or data uncertainty), and capturing it was shown
to be especially important in risk-aware decision making
(Riquelme et al., 2018; Abdullah et al., 2022; Deisenroth
and Rasmussen, 2011), active learning (Kirsch et al., 2019)
and Bayesian optimisation (Gonzalvez et al., 2019; Krause
et al., 2006; Springenberg et al., 2016). Unfortunately, the
posterior distribution is typically intractable and requires
numerical approximation.
Variational inference Variational inference (VI) is an ap-
proximate inference method which selects a distribution q∗
within a variational family Q that best approximates the
posterior p. More formally, we select the distribution q∗
such that:
q∗ = argmin
q∈Q
DKL(q (cid:107) p)
= argmin
q∈Q
(cid:20)
log
Eθ∼q
q(θ)
p(θ | D)
(cid:21)
.
(3)
In practice, we define a parametric variational distribution
qφ and use standard optimization methods like stochastic
gradient descent to minimize the KL loss w.r.t. φ. We then
use q∗(θ) instead of p(θ | D) to approximate the predictive
distribution in Equation (2). In this paper, we focus on VI
because it can capture arbitrarily complex, high-dimensional
posteriors, assuming the chosen variational family is suffi-
ciently expressive. At the same time, VI can scale to large
datasets when combined with stochastic optimisation (Hoff-
man et al., 2013; Swiatkowski et al., 2020; Tomczak et al.,
2020; Tran et al., 2015).
Other commonly used approximate inference methods are
Markov chain Monte Carlo (MCMC) (Welling and Teh,
2011) and the Laplace approximation (Immer et al., 2020).
MCMC samples from the posterior directly, but does not
scale well to large models and datasets. The Laplace ap-
proximation is more scalable, but assumes that the posterior
can be approximated well with a Gaussian distribution.
2.2 Decision trees
Decision trees are predictive models trained by recursively
partitioning the input space and fitting a simple model (often
constant) in each partition (leaf). At each non-terminal
node of the tree, the model forwards the input to a child
T. Cinquin, T. Rukkat, P. Schmidt, M. Wistuba, A. Bekasov
based on a binary condition. For example, at a particular
node the model might route the input x to the left sub-tree
if x[i] ≤ τ , and to the right sub-tree otherwise, where i
indexes a particular feature and τ is a threshold. The splits
are determined by greedily optimizing a chosen criterion at
each node. For instance, in the regression setting the feature
index i and threshold τ could be selected to minimize the
sum of square errors of the induced partition. The splitting
hyperplanes are always parallel to the axes of the feature
space. Predictions are made by forwarding x to a unique
leaf and outputting the class (for classification) or the real
value (for regression) associated with this particular leaf.
Soft decision trees First introduced by Irsoy et al. (2012),
soft decision trees use sigmoid gating functions to "soften"
the binary routing at each node. More formally, the output
f (x) of a soft decision tree is computed as the sum of the
leaf outputs fl(x) weighted by the probability pl(x) that the
input x is routed to the leaf l:
f (x) =
(cid:88)
l∈L
pl(x)fl(x),
(4)
where L is the set of leaf nodes. The probability pl(x)
is defined as the product of probabilities returned by the
soft gating functions on the path from the root to the leaf
l. Details on the exact form of pl and fl are provided in
Section 4.1. The sigmoid gating functions allow learning
non-axis-aligned decision boundaries and smooth functions.
This results in a differentiable model that can be trained
by gradient descent, and yet performs well on tabular data
(Feng et al., 2020; Irsoy et al., 2012; Linero and Yang, 2017;
Luo et al., 2021). Computing the prediction of a soft tree
requires evaluating all the leaves, and is therefore more
expensive than doing so for the standard decision tree. In
practice, however, a shallow soft decision tree can match the
performance of a deep hard decision tree, which alleviates
some of the computational overhead (Irsoy et al., 2012).
Multiple variations of a soft decision tree exist. The tree
depth can be fixed (Feng et al., 2020; Kontschieder et al.,
2015; Luo et al., 2021) or adjusted dynamically by greedily
adding new nodes while the validation loss decreases (Irsoy
et al., 2012). Furthermore, the sigmoid gating functions can
be based on linear models (Feng et al., 2020; Frosst and Hin-
ton, 2017; Irsoy et al., 2012; Luo et al., 2021), multi-layer
perceptrons (Feng et al., 2020; Kontschieder et al., 2015),
or convolutional neural networks (Ahmeto ̆glu et al., 2018).
Likewise, the leaves of the tree can output constant values
(Feng et al., 2020; Frosst and Hinton, 2017; Kontschieder
et al., 2015; Luo et al., 2021), or be defined using complex
models such as neural networks (Ahmeto ̆glu et al., 2018).
To address the exponential increase in prediction cost as the
soft tree grows, Frosst and Hinton (2017) propose to only
consider the most probable path from the root to a leaf. This
method requires special regularization encouraging nodes
to make equal use of each sub-tree to work and performs
worse than averaging over all leaves, but is more efficient.
In addition to state-of-the-art performance on tabular data,
soft decision trees can be preferred to neural networks due
to their greater interpretability (Frosst and Hinton, 2017).
As soft trees rely on hierarchical decisions, one can examine
the weights of the soft gating functions and gain insight into
the learned function. In prior work, neural networks have
been distilled into into soft trees to make their decisions ex-
plainable, both in the context of image classification (Frosst
and Hinton, 2017) and reinforcement learning (Coppens
et al., 2019).
Soft decision trees are similar to hierarchical mixtures of
experts (HME, Jordan and Jacobs, 1993). While HMEs and
soft decision trees share the same architecture, HMEs explic-
itly model the assignment of each input to a leaf using latent
variables. Therefore, HMEs are trained using the expecta-
tion maximisation algorithm (EM, Dempster et al., 1977),
rather than by maximising the log-likelihood. Jordan and
Jacobs find that, when compared to the standard maximum
likelihood with backpropagation, fitting an HME using EM
requires fewer passes over the data, but the resulting models
demonstrate higher test error.
2.3 Gradient boosting machines
A gradient boosting machine (GBM) (Friedman, 2001) se-
quentially combines a set of weak learners (e.g. decision
trees) into an ensemble to obtain a stronger learner. At each
iteration, a weak learner is trained to minimize the error
of the existing ensemble, and is subsequently added to the
ensemble. More formally, at iteration t the GBM combines
the existing ensemble ft(x) = (cid:80)t
j=1 γjhj(x) with an ad-
ditional learner ht+1 ∈ H from some function class H s.t.
ft+1(x) = ft(x) + γt+1ht+1(x) minimizes the training
loss. Finding the optimal weak learner ht+1 is intractable in
general, so the optimization problem is simplified by taking
a step in the direction of the steepest decrease of the loss L
in function space:
ft+1(x) = ft(x) − γt+1
n
(cid:88)
i=1
∇ftL(ft(xi), yi),
(5)
(cid:80)n
i=1 is the training data.
where D = {xi, yi}n
In
other words, each weak learner ht+1 is fit to match
i=1 ∇ftL(ft(xi), yi). Taking multiple gradient
−γt+1
boosting steps minimizes the training loss and yields an
accurate model. GBMs demonstrate state-of-the-art perfor-
mance on tabular data for both classification and regression
tasks: models that win Kaggle1 competitions are commonly
based on GBMs (Bojer and Meldgaard, 2021; Liu et al.,
2021).
1https://www.kaggle.com
Variational Boosted Soft Trees
3 RELATED WORK
Bayesian hierarchical mixture of experts Prior work
performed Bayesian inference on the parameters of HMEs
using variational inference. These methods consider an ap-
proximate posterior which factorizes the parameters into
groups (leaf function, node gating function, latent variables,
prior parameters) and places isotropic Gaussian priors on
the leaf and node model parameters, as well as Gamma
hyper-priors. Waterhouse et al. (1995) perform inference by
iteratively optimizing the VI objective with respect to each
group of parameters separately, keeping the others fixed.
However, for tractability they use the Laplace approxima-
tion on the node gating function parameters and hence do
not get a lower bound on the evidence. Ueda and Ghahra-
mani (2002) propose to model the joint distribution over
both input and output variables, which allows to derive the
variational posterior without approximations for a tree of
height 1. However, capturing the input distribution is both
expensive and unnecessary for regression and classification.
Also this method does not apply to deeper trees. Finally,
Bishop and Svensen (2012) derive a tractable lower bound
on the variational inference objective, which is then opti-
mised by iteratively updating the parameters of each factor
of the variational posterior, keeping the others fixed.
In contrast, we consider a simpler model which does not
explicitly capture the assignment of data samples to leaves
with latent variables. Furthermore, our proposed variational
posterior is more expressive and can capture correlations
between all the parameters of the model. Finally, we fit
our model to optimise the variational objective using the
reparameterization trick from Kingma and Welling (2013)
and stochastic gradient descent.
Bayesian gradient boosted trees Previous work on
Bayesian GBMs uses MCMC to sample from the Bayesian
posterior. Chipman et al. (1998) suggest performing infer-
ence in a GBM using a Gibbs sampler which iteratively
samples each tree conditioned on the other trees in the en-
semble. This method, BART, requires a long burn-in period
(≈1000 iterations). Pratola et al. (2017) improve BART
with a heteroscedastic noise model at the cost of making
inference slower, as it is performed on both the mean and
noise models. In order to speed up the convergence of the
BART sampler, He and Hahn (2020) propose Accelerated
BART (XBART). Rather than making small changes to a
given tree at each iteration, XBART grows an entirely new
tree. This speeds up mixing considerably requiring only 15
burn-in iterations. As a mechanism for variable selection,
the authors also propose placing a Dirichlet prior on the
input features, improving performance on high-dimensional
data.
In parallel, Ustimenko and Prokhorenkova (2020) draw
analogies between gradient boosting and MCMC, and prove
that a set of modifications is enough to cast gradient boosting
with Gaussian noise as stochastic gradient Langevin dynam-
ics in function space. The resulting algorithm, stochastic
gradient Langevin boosting (SGLB), allows to draw multi-
ple samples from the posterior by training an ensemble of
GBMs with targets perturbed by Gaussian noise. To reduce
the memory and time complexity of SGLB, Malinin et al.
(2020) introduce virtual ensembles. Taking advantage of
the additive structure of GBMs, virtual ensembles collect
multiple sub-ensembles by running a single SGLB model.
However, faster training comes at the cost of higher corre-
lation among models, thus reducing the effective sample
size.
Soft gradient boosting machine
Just like decision trees,
soft decision trees can be combined into ensembles to im-
prove their predictive performance. Gradient boosting is
a particularly successful method for doing so, hence Luo
et al. (2021) experiment with combining soft trees using
gradient boosting, and find the resulting method to be highly
effective on tabular data. Similarly, Feng et al. (2020) sug-
gest to fit soft GBMs by directly minimizing the gradient
boosting loss using stochastic gradient descent. As each
weak learner is updated in parallel, this method diverges
significantly from the gradient boosting framework.
An alternative line of research aims to arrive at a Bayesian
soft GBM by making BART "smoother". Linero and Yang
(2017) propose soft BART (SBART), a model which replaces
the standard decision trees in BART with soft trees. Empiri-
cally, fitting the resulting method is significantly slower than
BART. Maia et al. (2022) suggest putting Gaussian process
priors on each leaf in a BART model, demonstrating that
this method performs better than BART and SBART, but is
also slower.
4 METHODS
4.1 Variational soft trees
In this section we propose a variational soft tree (VST), a
model that has the same architecture as a fixed depth soft
decision tree (Figure 1), but where we perform variational
inference to approximate the full posterior distribution. We
then sample from the posterior approximation to compute
the predictive distribution in Equation (2) by Monte Carlo
integration. We consider two variations of the variational
soft tree: one with constant leaves as in (Feng et al., 2020;
Frosst and Hinton, 2017; Kontschieder et al., 2015; Luo
et al., 2021), and another with linear leaves, where each leaf
outputs an affine function of the input. Linear leaves allow
the model to represent piecewise linear functions, which are
strictly more expressive than piecewise constant functions.
In fact, a piecewise linear function can represent any dif-
ferentiable scalar function in the limit of infinite pieces by
setting each piece to the derivative of the function. Linear
leaves use two additional parameter vectors per leaf, and in
T. Cinquin, T. Rukkat, P. Schmidt, M. Wistuba, A. Bekasov
model. In the constant leaf model, the output at each leaf is
independent of the input:
p(y | x, l, ψ) = p(y | l, ψ)
= N (cid:0)y | μl, softplus(αl)2(cid:1),
(10)
(11)
where ψ = {(μl, αl)}l∈L. In the linear leaf model, on the
other hand, the parameters of the Gaussian are linear in the
input:
p(y | x, l, ψ) = N (cid:0)y | μl(x), σ2
l (x)(cid:1)
μl(x) = wT
l x + bl
(cid:16)
σl(x) = softplus
(cid:17)
l x + ˆbl
ˆwT
(12)
(13)
(14)
where ψ =
(cid:111)
(cid:110)
(wl, bl, ˆwl, ˆbl)
and softplus(x) =
l∈L
log(1 + exp(x)). We use softplus functions to constrain
the standard deviation parameters to remain strictly positive,
while ensuring numerical stability (Blundell et al., 2015).
Prior We use a spherical, zero centered Gaussian prior
for the model parameters:
p(θ) = N (cid:0)θ | 0, τ 2I(cid:1).
(15)
Note that for a constant leaf model we put this prior on the
inverse softplus of the standard deviation at each leaf, which
restricts the variance to stay strictly positive.
Variational posterior We use the variational distribution
proposed by Tomczak et al. (2020), which is a Normal
distribution with a low-rank covariance matrix:
q(θ) = N (cid:0)θ | μ, diag[σ2] + V V T (cid:1)
(16)
where σ ∈ Rp and V is a matrix of rank k. The hyperpa-
rameter k determines the rank of the covariance matrix, and
hence the expressivity of the posterior. If θ ∈ Rp, choosing
k = p allows learning arbitrary covariance matrices, but
increases the memory requirements and computational cost.
As a result, in our experiments we typically choose k < p.
This choice of the variational posterior and the prior admits
an analytical KL-divergence which is detailed in Section 1.1
in the supplementary material.
4.2 Gradient boosted variational soft trees
In order to increase the expressivity of the variational soft
tree, we propose to use these models as weak learners in a
gradient boosting machine that we refer to as a variational
soft GBM (VSGBM). More formally, the model is defined
as
Fθ(x) =
T
(cid:88)
t=1
fθt(x) + (cid:15) where
(cid:15) ∼ N (cid:0)(cid:15) | 0, σ2(cid:1) (17)
(a) Soft tree
(b) Bayesian soft tree
Figure 1: Standard vs. Bayesian soft decision tree. In a
standard soft tree each weight is assigned a fixed value,
while in a Bayesian soft tree each weight is a distribution.
our experiments had a marginal effect on the computation
cost. To our knowledge, we are the first to consider soft
decision trees with linear leaves.
Likelihood We define the likelihood of the soft tree as
p(y | x, θ) =
(cid:88)
l∈L
P (l | x, φ)p(y | x, l, ψ),
(6)
where L is the set of tree leaves (terminal nodes) and θ =
{φ, ψ} are the parameters of the soft tree.
P (l | x, φ), the first term inside the sum in Equation (6), is
the probability that the input x is routed to the leaf l, defined
as:
P (l | x, φ) =
(cid:89)
(cid:104)
n∈Path(l)
P (r | n, x, φ)n(cid:38)l
P (¬r | n, x, φ)l(cid:46)n(cid:105)
,
(7)
where Path(l) the set of tree nodes on the path from the root
to the leaf l, n(cid:38)l = 1 if the leaf l is in the right subtree of
node n, l(cid:46)n = 1 if it is in the left subtree, and P (r | n, x, φ)
is the probability that x is routed to the right subtree at
the node n, with P (¬r | n, x, φ) = 1 − P (r | n, x, φ). We
parametrize P (r | n, x, φ) using a soft gating function fφ:
P (r | n, x, φ) = fφ(x, n),
(8)
restricting fφ(x, n) ∈ [0, 1] for all x and n. In this work,
we choose a simple linear gating function (Feng et al., 2020;
Frosst and Hinton, 2017; Irsoy et al., 2012; Luo et al., 2021):
fφ(x, n) = σ(cid:0)β(cid:0)wT
n x + bn
(cid:1)(cid:1),
(9)
where σ is the standard sigmoid function, β is an inverse
temperature parameter used to regularize the function during
training (Frosst and Hinton, 2017), and φ = {(wn, bn)}n∈N
are the parameters of the function for the set of tree nodes
N .
The second term inside the sum in Equation (6),
p(y | x, l, ψ), is the predictive probability when the input
x is routed to the leaf l. In this work, we consider two varia-
tions of this term: a constant leaf model, and a linear leaf
μ!σ!μ"σ"μ#σ#μ$σ$p!1−p!p!x1−p"1−p#p"p#p"xp#xp!1−p!x1−p"1−p#p"p#xxp!p#p"μ!σ!μ#σ#μ$σ$μ"σ"μ!σ!μ"σ"μ#σ#μ$σ$p!1−p!p!x1−p"1−p#p"p#p"xp#xp!1−p!x1−p"1−p#p"p#xxp!p#p"μ!σ!μ#σ#μ$σ$μ"σ"Variational Boosted Soft Trees
Algorithm 1: Gradient boosted variational soft trees
Input: Prior parameters aσ and bσ
T the number of soft trees in the GBM
Data: {X, y}
Fit variational soft tree fθ1 to {X, y}
for t ∈ [2, . . . T ] do
Sample parameters for all models fθj : θj ∼ qj for
j = 1 . . . t − 1
Compute the residual vector:
rt = y − (cid:80)t−1
Fit the new model fθt to {X, rt}
j=1 fθj (X)
end
Sample parameters θ = {θj}T
Compute final residuals r = y − Fθ(X)
Sample σ2 ∼ inverse-Gamma(aσ + n, bσ + rT r)
j=1 where θj ∼ qj
where fθt is a variational soft tree with parameters θt, T is
the number of trees in the ensemble and σ is a scale param-
eter. We consider variational soft trees fθt that output the
estimated mean value of the target and no standard devia-
tion. Hence the variational soft GBM has a homoskedastic
(input-independent) variance model. Heteroskedastic (input-
dependent) uncertainty could in principle be modeled by
returning the predictive variances from the weak learners
alongside the predictive means, and combining them up-
stream. In our early experiments this configuration proved
to be costly to train (it doubles the number of model param-
eters), and made the training unstable (the gradient boosting
loss had high variance). In prior work Pratola et al. (2017)
train a separate ensemble to capture aleatoric uncertainty,
likely to avoid this instability.
Inspired by He and Hahn (2020), we place an
inverse-Gamma(aσ, bσ) prior on σ2,
yielding an
inverse-Gamma(aσ + n, bσ + rT r) posterior, where
n is the number of data samples and r = y − Fθ(X)
is the residual vector. The variational soft GBM is fit
following the procedure described in Algorithm 1. Once
trained, samples from the approximate posterior of the
variational soft GBM are obtained by drawing parameters
from the variational distribution of each variational soft tree
model in the ensemble. The predictive distribution is then
approximated by Monte Carlo integration of the likelihood
as per Equation (2), i.e. by aggregating the predictions of
the variational soft trees as defined by Equation (17) for
different posterior samples.
5 EXPERIMENTS
lated. When reporting results, we bold the highest score, as
well as any score if its error bar and the highest score's error
bar overlap, considering the difference to not be statistically
significant.
5.1 Regression
We consider a suite of regression datasets used by Malinin
et al. (2020) described in Table 4 in supplementary material.
We perform 10-fold cross validation on the training data
and report the mean and standard deviation of the test log-
likelihood and root mean square error (RMSE) of our mod-
els across the folds. We compare our variational soft deci-
sion trees (VST) and variational soft GBM (VSGBM) with
two Bayesian GBMs (XBART (He and Hahn, 2020) and
SGLB (Ustimenko and Prokhorenkova, 2020)), an ensem-
ble of neural networks, and XGBoost (Chen and Guestrin,
2016). When comparing models to VSTs, we consider base-
lines with an ensemble size of one, and otherwise multiple
ensemble members when comparing with the VSGBM. The
only exception is the ensemble of deep neural networks for
which we always use an ensemble of ten models to measure
epistemic uncertainty.
Variational soft decision tree We find that our model
performs well in terms of test log-likelihood and RMSE
across the considered datasets (see Tables 1 and 6), which
confirms that soft decision trees are well-suited to tabular
data (Luo et al., 2021). VSTs outperform the baselines on
7/10 datasets in terms of log-likelihood, and 3/10 datasets in
terms of RMSE, also matching the log-likehood and RMSE
of best performing baselines on 1/10 and 3/10 datasets re-
spectively. In addition, soft decision trees with linear leaves
perform better than equivalent constant leaf models on 8/10
datasets in terms of log-likelihood and 5/10 in terms of
RMSE, bringing evidence that linear leaf models are more
expressive than constant leaf models.
VSTs are less competitive when trained on small datasets
like boston (506 training examples) and yacht (308 training
examples). We hypothesize that in these cases the model
underfits the data due to the choice of the prior. The param-
eters of the prior were chosen by hyper-parameter tuning
with the validation ELBO objective, and the underfitting
behavior could be an artifact of this tuning procedure. An al-
ternative hypothesis is that a normal prior is simply ill-suited
to this model. Choosing priors for complex, deep models
is difficult, and is an active research direction in Bayesian
deep learning (Flam-Shepherd, 2017; Fortuin et al., 2021;
Krishnan et al., 2020; Vladimirova et al., 2018).
In this section we evaluate the variational soft tree and varia-
tional soft GBM on regression, out-of-distribution detection
and multi-armed bandits. Although we are not measuring
model calibration directly, like prior work we assume that
model calibration and performance on these tasks are corre-
Variational soft GBM VSGBMs perform competitively
in terms of log-likelihood compared to the baselines (see
Tables 1 and 6), yielding the best log-likelihood on 7/10
datasets. The VSGBMs perform on par with baselines on
power and boston, worse on yacht but better on the other
T. Cinquin, T. Rukkat, P. Schmidt, M. Wistuba, A. Bekasov
Table 1: Test log-likelihood of evaluated methods on regression datasets. We find that variational soft decision trees (VST)
and variational soft GBMs (VSGBM) perform strongly compared to baselines in terms of test log-likelihood, both methods
out-performing them on 7/10 datasets.
MODEL
POWER
PROTEIN
BOSTON
NAVAL
YACHT
SONG
CONCRETE
ENERGY
KIN8NM
WINE
DEEP ENSEMBLE
-1.404 ± 0.001
-1.422 ± 0.000
-1.259 ± 0.007
-1.412 ± 0.000
-1.112 ± 0.009
-1.415 ± 0.001
-1.390 ± 0.001
-1.677 ± 0.073
-1.416 ± 0.000
-1.725 ± 0.075
XBART (1 TREE)
SGLB (1 TREE)
VST (CONST.)
VST (LINEAR)
XBART
SGLB
VSGBM (CONST.)
VSGBM (LINEAR)
-0.096 ± 0.003
-1.425 ± 0.027
-0.032 ± 0.010
0.024 ± 0.002
-0.001 ± 0.006
-0.500 ± 0.001
-0.002 ± 0.011
-0.015 ± 0.011
-1.136 ± 0.003
-1.499 ± 0.002
-0.719 ± 0.005
-0.631 ± 0.011
-1.136 ± 0.003
-1.204 ± 0.002
-1.039 ± 0.005
-1.051 ± 0.012
-0.508 ± 0.042
-1.361 ± 0.044
-0.920 ± 0.002
-0.682 ± 0.004
-0.462 ± 0.054
-0.504 ± 0.013
-0.567 ± 0.062
-0.462 ± 0.054
-0.485 ± 0.419
-1.410 ± 0.009
-0.555 ± 0.088
-0.335 ± 0.026
0.008 ± 0.130
-0.877 ± 0.004
0.573 ± 0.311
0.542 ± 0.295
1.110 ± 0.021
-0.891 ± 0.047
0.193 ± 0.024
-0.754 ± 0.005
1.116 ± 0.023
-0.018 ± 0.009
0.045 ± 0.912
-0.033 ± 0.049
-1.151 ± 0.006
-1.305 ± 0.007
-0.733 ± 0.010
-0.579 ± 0.002
-1.018 ± 0.002
-0.907 ± 0.001
-0.933 ± 0.008
-0.729 ± 0.019
-0.793 ± 0.079
-1.748 ± 0.050
-0.999 ± 0.006
-0.461 ± 0.070
-0.581 ± 0.024
-0.931 ± 0.010
-0.465 ± 0.040
-0.591 ± 0.079
-0.848 ± 0.567
-1.078 ± 0.006
-0.710 ± 0.280
0.377 ± 0.123
-0.462 ± 0.054
-0.232 ± 0.009
-0.227 ± 0.038
0.057 ± 0.134
-1.153 ± 0.014
-1.659 ± 0.015
-0.877 ± 0.014
-0.707 ± 0.012
-1.057 ± 0.007
-1.125 ± 0.002
-0.457 ± 0.021
-0.363 ± 0.031
-1.250 ± 0.008
-1.559 ± 0.033
1.458 ± 0.615
3.067 ± 1.168
-1.251 ± 0.010
-1.220 ± 0.006
-1.192 ± 0.007
-1.167 ± 0.004
(a) Variational soft tree
(b) XBART
(c) SGLB
Figure 2: Variational soft trees (VST) show high uncertainty in the tails outside of the data support while closely agreeing
with the mean inside the support. Sampled function show more diversity in tails with VSTs than with XBART and SGLB.
The VST uses linear leaves, while XBART and SGLB use constant leaves.
datasets. However, VSGBMs are less competitive in terms
of RMSE when compared to XGBoost that yields smaller
RMSE on all but three datasets. Compared to other base-
lines, VSGBM consistently outperforms the deep ensem-
ble, and performs favorably when compared to SGLB and
XBART. In addition, we find that VSGBMs with linear
leaves perform slightly better than equivalent constant leaf
models, outperforming them on 4/10 datasets in terms of
log-likelihood and 3/10 in terms of RMSE, while also match-
ing the log-likelihod and RMSE of constant leaves on 5/10
and 6/10 datasets respectively.
Compared to a VST, a VSGBM performs better in terms
of RMSE on all datasets but two where both models score
equally well. However, VSTs obtain higher log-likelihoods
than VSGBMs on 5/10 datasets, equivalent scores on 2/10
and performs worse on 3/10. We explain this by the simpler
variance model used in the VSGBM, which does not allow
for heteroskedastic (input dependent) uncertainty.
Uncertainty estimation visualization An important
property of a reliable predictive model is its increased pre-
dictive uncertainty for inputs in regions with little training
data. To understand if VSTs demonstrate this behavior, we
plot functions sampled from the variational posterior for
simple synthetic datasets, and compare them to functions
sampled from XBART and SGLB posteriors. We plot the
sampled functions in Figures 2 and 5.
We find that VSTs indeed capture the uncertainty outside of
the support of the data better than both XBART and SGLB:
functions agree with the true mean within the support of the
data, but diverge outside of it.
5.2 OOD detection
Out-of-distribution (OOD) data is data that is sampled from
a distribution that is sufficiently different from the train-
ing data distribution. It has been observed in prior work
(Ma and Hernández-Lobato, 2021; Tomczak et al., 2020)
that an effective Bayesian model will show high epistemic
uncertainty when presented with OOD data, so we further
evaluate our models by testing if their epistemic uncertainty
is predictive of OOD data.
Following the setup of Malinin et al. (2020), we define
OOD data by selecting a subset of data from a different
dataset. To perform OOD detection, we compute the epis-
temic uncertainty of each sample under our models and
evaluate how well a single splitting threshold separates the
epistemic uncertainty of in-distribution and OOD samples,
as proposed by Mukhoti et al. (2021). Epistemic uncertainty
is measured as the variance of the mean prediction with
respect to samples from the posterior or the ensemble. The
detection performance is quantified using the area under
the receiver operating characteristic curve (AUROC). We
report the mean and standard deviation of the AUROC of
each model across 10 folds of cross-validation. As before,
we compare our VSTs and VSGBMs with XBART, SGLB
0.00.20.40.60.81.0x21012yTraining dataTargetSample from predictive0.00.20.40.60.81.0x21012y0.00.20.40.60.81.0x21012yVariational Boosted Soft Trees
Table 2: OOD detection AUROC scores with variational soft trees (VST) and variational soft GBMs (VSGBM) against
baselines (higher is better). Variational soft decision trees and variational soft GBMs perform well on out of distribution
detection, yielding the best score on 6/10 and 5/10 datasets respectively.
MODEL
POWER
PROTEIN
BOSTON
NAVAL
YACHT
SONG
CONCRETE
ENERGY
KIN8NM
WINE
DEEP ENSEMBLE
0.540 ± 0.015
0.504 ± 0.003
0.545 ± 0.023
1.000 ± 0.000
0.691 ± 0.088
0.510 ± 0.007
0.767 ± 0.042
0.554 ± 0.036
0.508 ± 0.005
0.547 ± 0.019
XBART (1 TREE)
SGLB (1 TREE)
VST (CONST.)
VST (LINEAR)
XBART
SGLB
VSGBM (CONST.)
VSGBM (LINEAR)
0.562 ± 0.018
0.593 ± 0.025
0.591 ± 0.025
0.618 ± 0.024
0.572 ± 0.011
0.600 ± 0.011
0.569 ± 0.018
0.571 ± 0.010
0.684 ± 0.015
0.760 ± 0.018
0.866 ± 0.018
0.920 ± 0.019
0.678 ± 0.016
0.874 ± 0.006
0.890 ± 0.011
0.950 ± 0.016
0.656 ± 0.042
0.732 ± 0.039
0.712 ± 0.020
0.698 ± 0.020
0.741 ± 0.041
0.738 ± 0.027
0.775 ± 0.101
0.795 ± 0.025
0.578 ± 0.050
0.770 ± 0.021
0.884 ± 0.024
1.000 ± 0.000
0.912 ± 0.033
0.907 ± 0.011
1.000 ± 0.000
1.000 ± 0.000
0.603 ± 0.021
0.607 ± 0.035
0.718 ± 0.048
0.655 ± 0.015
0.607 ± 0.026
0.662 ± 0.036
0.663 ± 0.055
0.618 ± 0.020
0.608 ± 0.033
0.589 ± 0.035
0.560 ± 0.025
0.601 ± 0.015
0.565 ± 0.013
0.697 ± 0.029
0.586 ± 0.014
0.602 ± 0.006
0.671 ± 0.028
0.723 ± 0.018
0.677 ± 0.049
0.840 ± 0.013
0.818 ± 0.020
0.763 ± 0.024
0.666 ± 0.033
0.763 ± 0.023
0.852 ± 0.141
0.969 ± 0.003
0.863 ± 0.045
0.996 ± 0.003
0.837 ± 0.146
0.973 ± 0.007
0.901 ± 0.018
0.993 ± 0.008
0.525 ± 0.010
0.519 ± 0.005
0.529 ± 0.016
0.586 ± 0.011
0.541 ± 0.011
0.508 ± 0.004
0.562 ± 0.015
0.608 ± 0.012
0.548 ± 0.016
0.571 ± 0.021
0.796 ± 0.010
0.742 ± 0.036
0.549 ± 0.021
0.613 ± 0.019
0.625 ± 0.019
0.688 ± 0.027
Table 3: Cumulative regret of the bandits using variational
soft trees (VST) vs. baselines. We find that VST performs
competitively compared to baselines, achieving the lowest
cumulative regret on 2/4 bandits.
BANDIT
FINANCIAL
EXPLORATION
MUSHROOM
JESTER
RANDOM POLICY
VST
SGLB
XBART
1682.05 ± 20.23
357.47 ± 34.32
613.12 ± 45.96
984.86 ± 47.59
18904.95 ± 24.37
7054.60 ± 748.79
9469.07 ± 1197.60
5039.93 ± 322.63
1791.28 ± 29.61
1412.55 ± 5.64
DOESN'T WORK
1577.70 ± 61.56
7845.28 ± 26.99
6048.99 ± 42.26
5762.89 ± 82.10
6305.43 ± 31.97
SGLB as before. We do not experiment with VSGBMs in
the bandit setting due to computational cost. In this set-
ting, the model has to be re-trained after every update, and
training a VSGBM is expensive: boosting is sequential by
nature, and VST weak learners require a number of gradient
descent iterations to converge. Each bandit simulation is run
five times with different random seeds, and we report the
mean and the standard deviation of the cumulative regret
across the simulations.
The predictive uncertainty of VST is competitive in this
setting as well, as shown in Table 3. The VST obtains the
lowest cumulative regret on the mushroom and financial
datasets, converging to near zero instantaneous regret on
the latter (see Figure 4). On the jester dataset, the VST
demonstrates second best cumulative regret, although the
performance of all three models is comparable to the random
policy. We explain this by the difficulty of the regression
problem in this particular dataset. Finally, just like on jester,
the VST shows second best cumulative regret on the explo-
ration dataset.
6 DISCUSSION
In this work we proposed to perform variational inference
to approximate the Bayesian posterior of a soft decision
tree. We use a variational distribution that allows trading off
memory and computation for a richer posterior approxima-
tion. Using soft decision trees models as weak learners, we
build a variational soft GBM that is more expressive than the
individual trees, but preserves their well-calibrated predic-
tive uncertainty. We find that both variational soft trees and
variational soft GBMs perform well on tabular data com-
pared to strong baselines, and provide useful uncertainty
Figure 3: OOD detection AUROC score vs. the rank of the
variational posterior covariance matrix in variational soft
trees (VST). The quality of the OOD detection generally
increases with the rank of the approximate posterior covari-
ance. As we consider a large number of different model and
dataset configurations, we only present the ones for which
the increase in AUROC is most significant. The rightmost
point of each plot corresponds to a full rank covariance
approximation.
and a deep ensemble.
We find that variational soft decision trees perform well on
OOD detection, outperforming baselines on 6/10 datasets
and tying on others (see Table 2). VSGBMs also perform
well, yielding the best scores on 5/10 datasets and addition-
ally matching best baselines on 2/10 (see Table 2). However,
the improvements over the top baselines are less significant
than with variational soft decision trees. As expected, we
find that increasing the rank of the approximate variational
posterior increases the OOD performance, although the sig-
nificance of the improvement depends on the dataset (see
Figure 3). This effect is most prominent with variational
soft decision trees, and is less so in VSGBMs.
5.3 Bandits
We further evaluate the VST by using it in Thompson sam-
pling (Thompson, 1933) on four different multi-armed ban-
dit problems (see Section 2.3 in the supplementary material
for more detail on the datasets), comparing to XBART and
050100150200250Rank of variational posterior covariance0.550.600.650.700.75OOD detection AUROCwine linearwine constantboston linearyacht constantT. Cinquin, T. Rukkat, P. Schmidt, M. Wistuba, A. Bekasov
(a) Financial
(b) Mushroom
(c) Jester
(d) Exploration
Figure 4: Bandit results. We find that the variational soft tree (VST) converges to near zero instantaneous regret on the
financial bandit and performs competitively compared to baselines in the bandit setting.
estimates for OOD detection and multi-armed bandits.
An important direction for future work is to speed up the
training of variational soft trees and GBMs. This is es-
pecially important when working in the low-data regime
(<104 samples), where our models are slower than the base-
line based on standard decision trees, and in the context
of multi-armed bandits, where the model needs to be up-
dated repeatedly. For the latter, an alternative direction is
to adapt our models for continual learning by implement-
ing an efficient Bayesian update, which would accelerate
sequential learning tasks like multi-armed bandits, Bayesian
optimization and active learning. Finally, addapting VST
and VSGBM to the classification setting is an interesting
direction for future work. Classification with tabular data
is important in many applications, many of which might
also benefit from well-calibrated predictive uncertainties
(Ebbehoj et al., 2021; Mustafa and Rahimi Azghadi, 2021).
References
Borisov, V., Leemann, T., Sessler, K., Haug, J., Pawelczyk,
M., and Kasneci, G. (2021). Deep neural networks and
tabular data: A survey.
Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary,
C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J.,
Wanderman-Milne, S., and Zhang, Q. (2018). JAX: Com-
posable transformations of Python+NumPy programs.
Chen, T. and Guestrin, C. (2016). XGBoost: A scalable
tree boosting system. In Proceedings of the 22nd ACM
SIGKDD International Conference on Knowledge Discov-
ery and Data Mining, San Francisco, CA, USA, August
13-17, 2016, pages 785–794.
Chipman, H. A., George, E. I., and McCulloch, R. E. (1998).
Bayesian cart model search. Journal of the American
Statistical Association, 93(443):935–948.
Clements, J. M., Xu, D., Yousefi, N., and Efimov, D. (2020).
Sequential deep learning for credit risk monitoring with
tabular financial data.
Abdullah, A., Hassan, M., and Mustafa, Y. (2022). A review
on Bayesian deep learning in healthcare: Applications
and challenges. IEEE Access, 10:1–1.
Cobb, A. D. and Jalaian, B. (2020). Scaling Hamiltonian
Monte Carlo inference for Bayesian neural networks with
symmetric splitting.
Ahmeto ̆glu, A., ̇Irsoy, O., and Alpaydın, E. (2018). Convolu-
tional soft decision trees. In K ̊urková, V., Manolopoulos,
Y., Hammer, B., Iliadis, L., and Maglogiannis, I., edi-
tors, Artificial Neural Networks and Machine Learning
– ICANN 2018, pages 134–141, Cham. Springer Interna-
tional Publishing.
Bew, D., Harvey, C. R., Ledford, A., Radnor, S., and Sin-
clair, A. (2019). Modeling analysts' recommendations
via Bayesian machine learning. The Journal of Financial
Data Science, 1(1):75–98.
Coppens, Y., Efthymiadis, K., Lenaerts, T., and Nowé, A.
(2019). Distilling deep reinforcement learning policies in
soft decision trees. In IJCAI 2019.
Deisenroth, M. and Rasmussen, C. (2011). Pilco: A model-
based and data-efficient approach to policy search. pages
465–472.
Dempster, A. P., Laird, N. M., and Rubin, D. B. (1977).
Maximum likelihood from incomplete data via the EM
algorithm. JOURNAL OF THE ROYAL STATISTICAL
SOCIETY, SERIES B, 39(1):1–38.
Bishop, C. M. and Svensen, M. (2012). Bayesian hierarchi-
Dua, D. and Graff, C. (2017). UCI machine learning reposi-
cal mixtures of experts.
tory.
Blundell, C., Cornebise, J., Kavukcuoglu, K., and Wierstra,
D. (2015). Weight uncertainty in neural networks.
Bojer, C. S. and Meldgaard, J. P. (2021). Kaggle forecast-
ing competitions: An overlooked learning opportunity.
International Journal of Forecasting, 37(2):587–603.
Ebbehoj, A., Thunbo, M., Andersen, O. E., Glindtvad, M. V.,
and Hulman, A. (2021). Transfer learning for non-image
data in clinical research: a scoping review. medRxiv.
Feng, J., Xu, Y.-X., Jiang, Y., and Zhou, Z.-H. (2020). Soft
gradient boosting machine.
0100020003000Simulation steps050010001500Cumulative regretXBartSGLBVSTRandom policy0200040006000Simulation steps050010001500Cumulative regretXBartVSTRandom policy050001000015000Simulation steps02000400060008000Cumulative regretXBartSGLBVSTRandom policy05000100001500020000Simulation steps050001000015000Cumulative regretXBartSGLBVSTRandom policyVariational Boosted Soft Trees
Flam-Shepherd, D. (2017). Mapping Gaussian process pri-
ors to Bayesian neural networks.
Fortuin, V., Garriga-Alonso, A., Ober, S. W., Wenzel, F.,
Rätsch, G., Turner, R. E., van der Wilk, M., and Aitchison,
L. (2021). Bayesian neural network priors revisited.
Freund, Y. and Schapire, R. E. (1997). A decision-theoretic
generalization of on-line learning and an application to
boosting. Journal of Computer and System Sciences,
55(1):119–139.
Friedman, J. H. (2001). Greedy function approximation:
A gradient boosting machine. The Annals of Statistics,
29(5):1189 – 1232.
Frosst, N. and Hinton, G. (2017). Distilling a neural network
into a soft decision tree.
Goldberg, K., Roeder, T., Gupta, D., and Perkins, C. (2001).
Eigentaste: A constant time collaborative filtering algo-
rithm. Information Retrieval, 4:133–151.
Gonzalvez, J., Lezmi, E., Roncalli, T., and Xu, J. (2019). Fi-
nancial applications of Gaussian processes and Bayesian
optimization.
Graf, F., Kriegel, H.-P., Schubert, M., Pölsterl, S., and Cav-
allaro, A. (2011). 2D image registration in CT images
using radial image descriptors. Medical image computing
and computer-assisted intervention : MICCAI ... Inter-
national Conference on Medical Image Computing and
Computer-Assisted Intervention, 14 Pt 2:607–14.
Guo, C., Pleiss, G., Sun, Y., and Weinberger, K. Q. (2017).
On calibration of modern neural networks. In Interna-
tional conference on machine learning, pages 1321–1330.
PMLR.
He, J. and Hahn, P. R. (2020). Stochastic tree ensembles for
regularized nonlinear regression.
Hennigan, T., Cai, T., Norman, T., and Babuschkin, I. (2020).
Haiku: Sonnet for JAX.
Hoang, D. and Wiegratz, K. (2021). Machine learning
methods in finance: Recent applications and prospects.
Hoffman, M. D., Blei, D. M., Wang, C., and Paisley, J.
(2013). Stochastic variational inference. Journal of Ma-
chine Learning Research, 14(40):1303–1347.
Immer, A., Korzepa, M., and Bauer, M. (2020). Improving
predictions of Bayesian neural nets via local linearization.
Irsoy, O., Yildiz, O., and Alpaydın, E. (2012). Soft decision
trees. pages 1819–1822.
Jordan, M. and Jacobs, R. (1993). Hierarchical mixtures of
experts and the EM algorithm. In Proceedings of 1993
International Conference on Neural Networks (IJCNN-
93-Nagoya, Japan), volume 2, pages 1339–1344 vol.2.
Kingma, D. P. and Ba, J. (2014). Adam: A method for
stochastic optimization.
Kingma, D. P. and Welling, M. (2013). Auto-encoding
variational Bayes.
Kirsch, A., van Amersfoort, J., and Gal, Y. (2019). Batch-
bald: Efficient and diverse batch acquisition for deep
Bayesian active learning.
Kompa, B., Snoek, J., and Beam, A. (2021). Second opinion
needed: communicating uncertainty in medical machine
learning. npj Digital Medicine, 4.
Kontschieder, P., Fiterau, M., Criminisi, A., and Rota Bulò,
S. (2015). Deep neural decision forests. pages 1467–
1475.
Krause, A., Guestrin, C., Gupta, A., and Kleinberg, J. (2006).
Near-optimal sensor placements: Maximizing informa-
tion while minimizing communication cost. In 2006 5th
International Conference on Information Processing in
Sensor Networks, pages 2–10.
Krishnan, R., Subedar, M., and Tickoo, O. (2020). Specify-
ing weight priors in Bayesian deep neural networks with
empirical Bayes. Proceedings of the AAAI Conference on
Artificial Intelligence, 34(04):4477–4484.
Kristiadi, A., Hein, M., and Hennig, P. (2020). Being
Bayesian, even just a bit, fixes overconfidence in ReLU
networks.
Linero, A. R. and Yang, Y. (2017). Bayesian regression tree
ensembles that adapt to smoothness and sparsity.
Liu, Z., Pavao, A., Xu, Z., Escalera, S., Ferreira, F., Guyon,
I., Hong, S., Hutter, F., Ji, R., Jacques Junior, J. C. S., Li,
G., Lindauer, M., Luo, Z., Madadi, M., Nierhoff, T., Niu,
K., Pan, C., Stoll, D., Treguer, S., Wang, J., Wang, P., Wu,
C., Xiong, Y., Zela, A., and Zhang, Y. (2021). Winning
solutions and post-challenge analyses of the ChaLearn
AutoDL challenge 2019. IEEE Transactions on Pattern
Analysis and Machine Intelligence.
Luo, H., Cheng, F., Yu, H., and Yi, Y. (2021). SDTR: Soft
decision tree regressor for tabular data. IEEE Access,
9:55999–56011.
Ma, C. and Hernández-Lobato, J. M. (2021). Functional
variational inference based on stochastic process gener-
ators.
In Ranzato, M., Beygelzimer, A., Dauphin, Y.,
Liang, P., and Vaughan, J. W., editors, Advances in Neu-
ral Information Processing Systems, volume 34, pages
21795–21807. Curran Associates, Inc.
Maia, M., Murphy, K., and Parnell, A. C. (2022). GP-
BART: A novel Bayesian additive regression trees ap-
proach using Gaussian processes. arXiv e-prints, page
arXiv:2204.02112.
Malinin, A., Prokhorenkova, L., and Ustimenko, A. (2020).
Uncertainty in gradient boosting via ensembles.
Mitros, J. and Namee, B. M. (2019). On the validity of
Bayesian neural networks for uncertainty estimation.
Mukhoti, J., Kirsch, A., van Amersfoort, J., Torr, P. H. S.,
and Gal, Y. (2021). Deep deterministic uncertainty: A
simple baseline.
T. Cinquin, T. Rukkat, P. Schmidt, M. Wistuba, A. Bekasov
Mustafa, A. and Rahimi Azghadi, M. (2021). Automated
machine learning for healthcare and clinical notes analy-
sis. Computers, 10(2).
the 28th International Conference on International Con-
ference on Machine Learning, ICML'11, page 681–688,
Madison, WI, USA. Omnipress.
Niculescu-Mizil, A. and Caruana, R. A. (2012). Obtaining
calibrated probabilities from boosting.
Pratola, M., Chipman, H., George, E., and McCulloch, R.
(2017). Heteroscedastic BART using multiplicative re-
gression trees.
Riquelme, C., Tucker, G., and Snoek, J. (2018). Deep
Bayesian bandits showdown: An empirical comparison
of Bayesian deep networks for Thompson sampling.
Shwartz-Ziv, R. and Armon, A. (2022). Tabular data: Deep
learning is not all you need. Information Fusion, 81:84–
90.
Springenberg, J. T., Klein, A., Falkner, S., and Hutter, F.
(2016). Bayesian optimization with robust Bayesian neu-
ral networks. In Lee, D., Sugiyama, M., Luxburg, U.,
Guyon, I., and Garnett, R., editors, Advances in Neu-
ral Information Processing Systems, volume 29. Curran
Associates, Inc.
Swiatkowski, J., Roth, K., Veeling, B. S., Tran, L., Dillon,
J. V., Snoek, J., Mandt, S., Salimans, T., Jenatton, R., and
Nowozin, S. (2020). The k-tied normal distribution: A
compact parameterization of Gaussian mean field posteri-
ors in Bayesian neural networks.
Thompson, W. R. (1933). On the likelihood that one un-
known probability exceeds another in view of the evi-
dence of two samples. Biometrika, 25(3-4):285–294.
Tomczak, M., Swaroop, S., and Turner, R. (2020). Effi-
cient low rank Gaussian variational inference for neural
networks. In Larochelle, H., Ranzato, M., Hadsell, R.,
Balcan, M., and Lin, H., editors, Advances in Neural
Information Processing Systems, volume 33, pages 4610–
4622. Curran Associates, Inc.
Tran, D., Ranganath, R., and Blei, D. M. (2015). The
variational Gaussian process.
Ueda, N. and Ghahramani, Z. (2002). Bayesian model
search for mixture models based on optimizing variational
bounds. Neural Networks, 15(10):1223–1241.
Ustimenko, A. and Prokhorenkova, L. (2020). SGLB:
Stochastic gradient Langevin boosting.
Vladimirova, M., Verbeek, J., Mesejo, P., and Arbel, J.
(2018). Understanding priors in Bayesian neural networks
at the unit level.
Waterhouse, S., MacKay, D., and Robinson, A. (1995).
Bayesian methods for mixtures of experts. In Touretzky,
D., Mozer, M., and Hasselmo, M., editors, Advances in
Neural Information Processing Systems, volume 8. MIT
Press.
Welling, M. and Teh, Y. W. (2011). Bayesian learning via
stochastic gradient Langevin dynamics. In Proceedings of
Variational Boosted Soft Trees
1 Additional method details
1.1 Variational inference
We use the variational distribution proposed by Tomczak et al. (2020), which is a normal distribution with a low-rank
covariance matrix:
q(θ) = N (cid:0)θ | μ, diag[σ2] + V V T (cid:1)
(18)
where μ ∈ Rp is the mean of the normal distribution over parameters, diag[σ2] ∈ Rp×p is the diagonal component of the
covariance with σ ∈ Rp, and V ∈ Rp×k is the rank k component of the covariance. The hyperparameter k determines
the rank of the covariance matrix, and hence the expressivity of the posterior. Choosing k = p allows learning arbitrary
covariance matrices, but increases the memory requirements and computational cost. As a result, in our experiments we
typically choose k < p. We fit the variational soft tree by maximizing the evidence lower bound (ELBO):
ELBO = Eθ∼q(θ)[log p(y | x, θ)] − DKL(q(θ) (cid:107) p(θ)).
We compute a Monte Carlo estimate of the expectation:
Eθ∼q[log p(y | x, θ)] ≈
1
m
m
(cid:88)
i=1
(cid:16)
log p
y | x, θ(i)(cid:17)
,
(19)
(20)
where θ(i) ∼ q(θ). For the chosen posterior in Equation (18) and an isotropic Gaussian prior p(θ) = N (θ | 0, γI), the KL
divergence term is available in a closed form:
DKL(q(θ) (cid:107) p(θ)) =
1
2
(cid:34) p
(cid:88)
d=1
(cid:18) σ2
d
γ
− log σ2
d
(cid:19)
+
1
γ
k
(cid:88)
i=1
||vi||2
2 − ∆ +
1
γ
||μ||2
2 + p(log γ − 1)
,
(21)
(cid:35)
where V = [v1, . . . vk] ∈ Rp×k, σ ∈ Rp and ∆ = log det(Ik + V T diag[σ2]−1V ).
2 Experimental details
2.1 Regression
We consider a suite of regression datasets from Malinin et al. (2020) to measure the expressivity of our model. Table 4
summarizes the number of examples and features in each dataset. We preprocess the datasets by encoding categorical
variables as one-hot vectors and normalizing each feature to have zero mean and unit variance. We further split the datasets
into train (80%) and test (20%) data, and perform 10-fold cross validation on the training data. We report the mean and the
standard deviation of the test log-likelihood and root mean square error (RMSE) across all folds.
Table 4: Regression dataset description
DATASET
BOSTON NAVAL
POWER
PROTEIN YACHT
SONG
CONCRETE
ENERGY KIN8NM WINE
NUMBER SAMPLES
NUMBER FEATURES
506
13
11 934
16
9 568
4
45 730
9
308
6
514 345
90
1 030
8
768
8
8 192
8
1 599
11
2.2 OOD detection
Following the setup from Malinin et al. (2020), we consider the test data to be the in-distribution (ID) data, and create a
dataset of OOD data by taking a subset of the song dataset of the same size. We select a subset of features from the song
dataset in order to match the feature dimension of the ID dataset. The only exception is the song dataset itself, for which we
use the Relative location of CT slices on axial axis dataset from Graf et al. (2011) as OOD data. In both settings, categorical
features are encoded as one-hot vectors, and all features are normalized to have zero mean and unit variance. We use a
one-node decision tree to find the splitting threshold for the epistemic uncertainty that would separate ID and ODD data.
T. Cinquin, T. Rukkat, P. Schmidt, M. Wistuba, A. Bekasov
2.3 Bandit
We consider the following datasets for our bandit experiments:
Financial The financial bandit (Riquelme et al., 2018) was created by pulling the stock prices of d = 21 publicly traded
companies in NYSE and Nasdaq, for the last 14 years for a total of n = 3713 samples. For each day, the context was the
price difference between the beginning and end of the session for each stock. The arms are synthetically created to be a
linear combination of the contexts, representing k = 8 different portfolios.
Jester This bandit problem is taken from Riquelme et al. (2018). The Jester dataset (Goldberg et al., 2001) provides
continuous ratings in [−10, 10] for 100 jokes from 73 421 users. The authors find a complete subset of n = 19 181 users
rating all 40 jokes. We take d = 32 of the ratings as the context of the user, and k = 8 as the arms. The agent recommends
one joke, and obtains the reward corresponding to the rating of the user for the selected joke.
Exploration The exploration bandit tests the extent to which the models explore the different arms. The reward function
of each arm is sparse and requires maintaining high uncertainty to discover the context values for which the reward is high.
The reward given input x and selected arm a is given by:
r(x, a) = σ(β(x + α − offset[a])) − σ(β(x − α − offset[a])) + (cid:15)
(22)
where σ(x) = 1 / (1 + e−x) is the sigmoid function, α, β ∈ R are constants, (cid:15) ∼ N (0, δ2), and offset[a] is a function
mapping each arm a to a particular offset. Intuitively, this reward is composed of a smooth unit valued "bump" per arm
and is otherwise 0. The positions of the "bumps" across arms are disjoint and barely overlap. Furthermore, the context is
sampled uniformly at random in the interval [−1, 1]. We run this bandit for 20 000 steps.
Mushroom This bandit problem is taken from Riquelme et al. (2018). The Mushroom Dataset (Dua and Graff, 2017)
contains n = 7 310 samples, 22 attributes per mushroom, and two classes: poisonous and safe. The agent must decide
whether to eat a given mushroom or not. Eating a safe mushroom provides reward of 5. Eating a poisonous mushroom
delivers reward 5 with probability 1/2 and reward -35 otherwise. If the agent does not eat a mushroom, then the reward is 0.
2.4
Implementation
We implement the variational soft decision tree and variational soft GBM using the Jax (Bradbury et al., 2018) and DM-
Haiku (Hennigan et al., 2020) Python libraries. We fit our models using the Adam (Kingma and Ba, 2014) optimizer.
Hyperparameter optimization was conducted using Amazon SageMaker's2 automatic model tuning that uses Bayesian
optimisation to explore the hyperparameter space. We define the set of hyperparameters that the Bayesian optimisation
needs to explore, as well as the optimization objective. The service then runs a series of model tuning jobs with different
hyperparameters to find the set of values which minimize the objective. We use the same hyperparameter ranges as (He and
Hahn, 2020) and (Ustimenko and Prokhorenkova, 2020), summarized in Table 5.
Table 5: Hyperparameter tuning ranges.
VSGBM
XBART
XGBOOST
DEEP ENSEMBLE
VST
SGLB
LEARNING RATE
PRIOR SCALE
MAX. DEPTH
BETA
NUM. LEARNERS
PRIOR SIGMA ALPHA
PRIOR SIGMA BETA
[0.0001, 0.001]
[0.01, 2.5]
{1, . . . , 5}
[1, 50]
{1, . . . , 10}
[2.5, 5]
[0.1, 5]
S
TAU
BETA
NUM. LEARNERS
BURN-IN
ALPHA
KAPPA
[1, 300]
[1, 300]
[0.75, 2]
[1, 100]
{15}
{0.95}
{3}
LEARNING RATE
TREE DEPTH
LAMBDA
ALPHA
NUM. LEARNERS
[0.001, 0.1]
{1, . . . , 6}
[0.001, 1]
[0.001, 1]
{1, . . . , 1000}
LEARNING RATE
NUM. LAYERS
HIDDEN DIM.
DROPOUT RATE
PRIOR SCALE
[0.0001, 0.001]
{2, . . . , 5}
{10, . . . , 50}
[0.1, 0.4]
[0.001, 2.5]
LEARNING RATE
PRIOR SCALE
MAX. DEPTH
BETA
[0.0001, 0.001]
[0.01, 2.5]
{1, . . . , 5}
[1, 50]
LEARNING RATE
TREE DEPTH
NUM. LEARNERS
{0.001, 0.01, 0.1}
{3, . . . , 6}
{1, . . . , 1000}
3 Additional experimental results
3.1 Regression
In this section we present additional regression results reporting the root mean square error (RMSE) of evaluated methods
across the considered baselines, see Table 6. We find that the VST performs well in terms of test RMSE across datasets:
2https://aws.amazon.com/sagemaker/
Variational Boosted Soft Trees
Table 6: Test RMSE of evaluated methods on regression datasets. We find that variational soft decision trees (VST)
compares well with baselines in terms of test RMSE, out-performing them on 3/10 datasets and matching the RMSE of the
best baselines on three. Variational soft GBM (VSGBM) performs competitively in terms of RMSE compared to SGLB,
deep ensemble and XBART, but is generally weaker than XGBoost. This is unsurprising as XGBoost is the state-of-the-art
for fitting tabular data.
MODEL
POWER
PROTEIN
BOSTON
NAVAL
YACHT
SONG
CONCRETE
ENERGY
KIN8NM
WINE
DEEP ENSEMBLE
0.986 ± 0.001
1.003 ± 0.001
0.870 ± 0.004
0.993 ± 0.001
0.685 ± 0.002
0.999 ± 0.001
0.972 ± 0.001
1.007 ± 0.009
0.998 ± 0.001
1.013 ± 0.011
XBART (1 TREE)
SGLB (1 TREE)
XGBOOST (1 TREE)
VST (CONST.)
VST (LINEAR)
XBART
SGLB
XGBOOST
VSGBM (CONST.)
VSGBM (LINEAR)
0.243 ± 0.001
0.280 ± 0.006
0.242 ± 0.003
0.239 ± 0.001
0.242 ± 0.001
0.233 ± 0.001
0.453 ± 0.001
0.173 ± 0.003
0.238 ± 0.001
0.242 ± 0.001
0.693 ± 0.003
0.869 ± 0.002
0.828 ± 0.001
0.827 ± 0.008
0.798 ± 0.011
0.692 ± 0.003
0.822 ± 0.001
0.614 ± 0.004
0.652 ± 0.006
0.663 ± 0.012
0.356 ± 0.026
0.483 ± 0.025
0.397 ± 0.077
0.538 ± 0.004
0.469 ± 0.003
0.303 ± 0.022
0.583 ± 0.004
0.261 ± 0.012
0.363 ± 0.025
0.297 ± 0.009
0.339 ± 0.125
0.830 ± 0.007
0.703 ± 0.001
0.359 ± 0.033
0.376 ± 0.002
0.152 ± 0.045
0.649 ± 0.002
0.057 ± 0.001
0.111 ± 0.060
0.074 ± 0.018
0.052 ± 0.003
0.405 ± 0.007
0.056 ± 0.006
0.477 ± 0.027
0.500 ± 0.004
0.051 ± 0.003
0.300 ± 0.004
0.041 ± 0.006
0.142 ± 0.107
0.134 ± 0.005
0.680 ± 0.007
0.958 ± 0.007
0.795 ± 0.003
0.710 ± 0.010
0.633 ± 0.006
0.576 ± 0.003
0.834 ± 0.001
0.450 ± 0.001
0.563 ± 0.004
0.483 ± 0.007
0.474 ± 0.046
0.541 ± 0.010
0.454 ± 0.021
0.592 ± 0.005
0.423 ± 0.066
0.355 ± 0.012
0.593 ± 0.002
0.285 ± 0.014
0.347 ± 0.016
0.341 ± 0.014
0.406 ± 0.267
0.193 ± 0.003
0.059 ± 0.005
0.483 ± 0.099
0.281 ± 0.044
0.292 ± 0.295
0.318 ± 0.002
0.050 ± 0.001
0.227 ± 0.015
0.183 ± 0.037
0.703 ± 0.013
0.740 ± 0.002
0.776 ± 0.010
0.550 ± 0.010
0.530 ± 0.018
0.590 ± 0.007
0.778 ± 0.001
0.479 ± 0.019
0.348 ± 0.009
0.316 ± 0.010
0.815 ± 0.006
0.827 ± 0.004
0.854 ± 0.020
0.788 ± 0.009
0.781 ± 0.008
0.815 ± 0.008
0.857 ± 0.002
0.735 ± 0.014
0.781 ± 0.008
0.769 ± 0.006
(a) VST
(b) XBART
(c) SGLB
Figure 5: In-between uncertainty. Variational soft trees (VST) show high uncertainty between the two blobs of data while
closely agreeing with the true mean inside of the data support. The plot for the VST was generated with the linear leaf
model.
our model outperforms the baselines on 3/10 datasets and matching the RMSE of the top baselines on 3/10. This further
confirms that soft decision trees perform well on tabular data (Luo et al., 2021).
We observe that VSGBMs are generally weaker in terms of RMSE compared to XGBoost. XGBoost yields a smaller RMSE
on all but three datasets, where VSGBM performs better on one and ties on two. This result is not surprising as XGBoost is
the gold standard for fitting tabular data. Compared to other baselines, VSGBM systematically outperforms deep ensembles,
and performs favorably compared to SGLB and XBART. Compared to a single variational soft tree, VSGBMs perform
better in terms of RMSE on all datasets but two where they ties.
3.2 Uncertainty visualization
In order to demonstrate the quality of the predictive uncertainty of our model, we present additional plots of functions
sampled from the VST, comparing these to samples from XBART and SGLB. See Figure 2 and Figure 5. We find that
variational soft decision trees model the uncertainty outside of the support of the data better than XBART and SGLB:
functions agree with the true mean within the support of the data, but diverge outside of it.
3.3 Regression visualization
To test the flexiblity of the VST in the regression setting, we fit our model to a step function (Figure 6) and a Daubechies
wavelet (Figure 7) as done in (Linero and Yang, 2017), and plot functions sampled from our model. We see that the VST
captures the non-smooth step function as well as the hard decision trees used in XBART and SGLB. On the Daubechies
wavelet, however, we find that a VST of a reasonable depth (5) underfits. VSGBM visually improves the fit over a VST, but
still underfits the data compared to SGLB and XBART. We hypothesize that this effect is due to the choice of zero mean
Gaussian prior on the node weights wn in VSTs and VSGBMs, which encourages smooth functions. This phenomenon is
particularly visible when fitting the Daubechies wavelet, a complex function that fluctuates at different frequencies and
amplitudes. As expected, increasing the amount of training data reduces underfitting.
0.00.20.40.60.81.0x21012yTraining dataTargetSample from predictive0.00.20.40.60.81.0x21012y0.00.20.40.60.81.0x21012yT. Cinquin, T. Rukkat, P. Schmidt, M. Wistuba, A. Bekasov
(a) VST (RMSE: 0.2121)
(b) XBART (RMSE: 0.0982)
(c) SGLB (RMSE: 0.3014)
Figure 6: Step function. The variational soft decision tree (VST) can fit this non-smooth function. The plot for the VST
was generated with the linear leaf model.
(a) VST (RMSE: 0.2346)
(b) VSGBM (RMSE: 0.2534)
(c) XBART (RMSE: 0.1186)
(d) SGLB (RMSE: 0.1503)
Figure 7: Daubechies wavelet. The variational soft tree (VST) and variational soft GBM (VSGBM) underfit this complex
function.
0.00.20.40.60.81.0x21012yTraining dataTargetSample from predictive0.00.20.40.60.81.0x21012y0.00.20.40.60.81.0x21012y0.00.20.40.60.81.0x1.00.50.00.51.01.5yTraining dataTargetSample from predictive0.00.20.40.60.81.0x1.00.50.00.51.01.52.0y0.00.20.40.60.81.0x1.00.50.00.51.01.5y0.00.20.40.60.81.0x1.00.50.00.51.01.5y |
|
http://arxiv.org/abs/2302.10701v1 | 2023-02-21T14:40:25 | 2023-02-21T14:40:25 | Scalable Infomin Learning | The task of infomin learning aims to learn a representation with high utility
while being uninformative about a specified target, with the latter achieved by
minimising the mutual information between the representation and the target. It
has broad applications, ranging from training fair prediction models against
protected attributes, to unsupervised learning with disentangled
representations. Recent works on infomin learning mainly use adversarial
training, which involves training a neural network to estimate mutual
information or its proxy and thus is slow and difficult to optimise. Drawing on
recent advances in slicing techniques, we propose a new infomin learning
approach, which uses a novel proxy metric to mutual information. We further
derive an accurate and analytically computable approximation to this proxy
metric, thereby removing the need of constructing neural network-based mutual
information estimators. Experiments on algorithmic fairness, disentangled
representation learning and domain adaptation verify that our method can
effectively remove unwanted information with limited time budget. | [
"Yanzhi Chen",
"Weihao Sun",
"Yingzhen Li",
"Adrian Weller"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10701v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10701v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"cs.IT",
"math.IT",
"stat.ML"
] | 3
2
0
2
b
e
F
1
2
]
G
L
.
s
c
[
1
v
1
0
7
0
1
.
2
0
3
2
:
v
i
X
r
a
Scalable Infomin Learning
Yanzhi Chen1, Weihao Sun2, Yingzhen Li3, Adrian Weller1,4
1University of Cambridge, 2Rutgers University, 3Imperial College London, 4Alan Turing Institute
Abstract
The task of infomin learning aims to learn a representation with high utility while
being uninformative about a specified target, with the latter achieved by minimis-
ing the mutual information between the representation and the target. It has broad
applications, ranging from training fair prediction models against protected at-
tributes, to unsupervised learning with disentangled representations. Recent works
on infomin learning mainly use adversarial training, which involves training a
neural network to estimate mutual information or its proxy and thus is slow and
difficult to optimise. Drawing on recent advances in slicing techniques, we pro-
pose a new infomin learning approach, which uses a novel proxy metric to mutual
information. We further derive an accurate and analytically computable approx-
imation to this proxy metric, thereby removing the need of constructing neural
network-based mutual information estimators. Experiments on algorithmic fair-
ness, disentangled representation learning and domain adaptation verify that our
method can effectively remove unwanted information with limited time budget.
1
Introduction
Learning representations that are uninformative about some target but still useful for downstream
applications is an important task in machine learning with many applications in areas including
algorithmic fairness [1, 2, 3, 4], disentangled representation learning [5, 6, 7, 8], information bottle-
neck [9, 10], and invariant representation learning [11, 12, 13, 14].
A popular method for the above task is adversarial training [1, 2, 3, 4, 7, 11, 15], where two neural
networks, namely the encoder and the adversary, are trained jointly to compete with each other.
The encoder's goal is to learn a representation with high utility but contains no information about
the target. The adversary, on the contrary, tries to recover the information about the target from the
learned representation as much as possible. This leads to a minmax game similar to that in generative
adversarial networks [16]. Adversarial training is effective with a strong adversary, however, it
is often challenging to train the adversary thoroughly in practice, due to time constraints and/or
optimisation difficulties [17, 18]. In fact, recent studies have revealed that adversarial approaches
may not faithfully produce an infomin representation in some cases [18, 19, 20, 21, 22]. This
motivates us to seek a good, adversarial training-free alternative for scalable infomin learning.
In this work, we propose a new method for infomin learning which is almost as powerful as using
a strong adversary but is highly scalable. Our method is inspired by recent advances in information
theory which proposes to estimate mutual information in the sliced space [23]. We highlight the
following contributions:
• We show that for infomin learning, an accurate estimate of mutual information (or its bound) is
unnecessary: testing and optimising statistical independence in some sliced spaces is sufficient;
• We develop an analytical approximation to such sliced independence test, along with a scalable
algorithm for infomin learning based on this approximation. No adversarial training is required.
36th Conference on Neural Information Processing Systems (NeurIPS 2022).
Importantly, the proposed method can be applied to a wide range of infomin learning tasks without
any constraint on the form of variables or any assumption about the distributions. This contrasts our
method to other adversarial training-free methods which are either tailored for discrete or univariate
variables [22, 24, 25, 25, 26] or rely on variational approximation to distributions [10, 12, 19, 27].
2 Background
Infomin representation learning. Let X ∈ RD be the data, Y ∈ RD(cid:48)
be the target we want to
predict from X. The task we consider here is to learn some representation Z = f (X) that is useful
for predicting Y but is uninformative about some target T ∈ Rd. Formally, this can be written as
min
f
L(f (X); Y ) + β * I(f (X); T )
(1)
where f is an encoder, L is some loss function quantifying the utility of Z for predicting Y and
I(f (X); T ) quantifies the amount of information left in Z about T . β controls the trade-off between
utility and uninformativeness. Many tasks in machine learning can be seen as special cases of this
objective. For example, by setting T to be (a set of) sensitive attributes e.g. race, gender or age, we
arrive at fair representation learning [1, 2, 21, 28]. When using a stochastic encoder, by setting Y to
be X and T to be some generative factors e.g., a class label, we arrive at disentangled representation
learning [5, 6, 7, 8]. Similarly, the information bottleneck method [9, 10] corresponds to setting
T = X, which learns representations expressive for predicting Y while being compressive about X.
Adversarial training for infomin learning. A key ingredient in objective (1) is to quantify
I(f (X); T ) as the informativeness between f (X) and T . One solution is to train a predictor for
T from f (X) and use the prediction error as a measure of I(f (X); T ) [1, 3, 4, 29]. Another ap-
proach is to first train a classifier to distinguish between samples from p(Z, T ) vs. p(Z)p(T ) [7, 15]
or to distinguish samples Z ∼ p(Z|T ) with different T [2, 11], then use the classification error
to quantify I(f (X); T ). All these methods involve the training of a neural network t to provide a
lower-bound estimate to I(f (X); T ), yielding a minmax optimisation problem
min
f
max
t
L(f (X); Y ) + β * ˆIt(f (X); T )
(2)
where ˆIt(f (X); T ) is an estimator constructed using t that lower-bounds I(f (X); T ). The time
complexity of optimising (2) is O(L1L2) where L1 and L2 are the number of gradient steps for the
min and the max step respectively. The strength of t is crucial for the quality of the learned repre-
sentation [18, 19, 20, 21, 22]. For a strong adversary, a large L2 is possibly needed, but this means
a long training time. Conversely, a weak adversary may not produce a truly infomin representation.
3 Methodology
We propose an alternative to adversarial training for optimising (1). Our idea is to learn representa-
tion by the following objective, which replaces I(f (X); T ) in objective (1) with its 'sliced' version:
(3)
L(f (X); Y ) + β * SI(f (X); T ),
min
f
where SI denotes the sliced mutual information, which was also considered in [23]. Informally, SI
is a 'facet' of mutual information that is much easier to estimate (ideally has closed form) but can
still to some extent reflect the dependence between Z and T . Optimising (3) is then equivalent to
testing and minimising the dependence between Z and T from one facet. Importantly, while testing
dependence through only a single facet may be insufficient, by testing and minimising dependence
through various facets across a large number of mini-batches we eventually see I(Z; T ) → 0.
We show one instance for realising SI whose empirical approximation ˆSI has an analytic expres-
sion. The core of our method is Theorem 1, which is inspired by [4, 23].
Theorem 1. Let Z ∈ RD and T ∈ Rd be two random variables that have moments. Z and T are
statistically independent if and only if SI(Z, T ) = 0 where SI(Z, T ) is defined as follows
SI(Z; T ) = sup
h,g,θ,φ
ρ(h(θ(cid:62)Z), g(φ(cid:62)T )),
(4)
where ρ is the Pearson correlation, h, g : R → R are Borel-measurable non-constant functions, and
θ ∈ SD−1, φ ∈ Sd−1 are vectors on the surfaces on D-dimensional and d-dimensional hyperspheres.
2
Proof. See the Appendix.
We call θ and φ the slices for Z and T respectively, and θ(cid:62)Z, φ(cid:62)T the sliced Z and T respectively.
We sketch here how this result relates to [4, 23]. [23] considers SI(Z; T ), defined as the expected
mutual information E[I(θ(cid:62)Z, φ(cid:62)T )] of the sliced Z and T , where the expectation is taken over
respective Haar measures θ ∈ SD−1, φ ∈ Sd−1. Instead of considering the mutual information
I(θ(cid:62)Z, φ(cid:62)T ) in the average case, we handle Pearson correlation over the supreme functions h, g as
defined above, which links to R ́enyi's maximal correlation [4, 30, 31, 32] and has some interesting
properties suitable for infomin representation learning.
Intuitively, Theorem 1 says that in order to achieve I(Z; T ) → 0, we need not estimate I(Z; T ) in
the original space; rather we can test (and maximise) independence in the sliced space as realised by
(4). Other realisations of the sliced mutual information SI may also be used. The major merit of the
realisation (4) is it allows an analytic expression for its empirical approximation, as shown below.
Analytic approximation to SI. An empirical approximation to (4) is
i Z), gj(φ(cid:62)
ρ(hi(θ(cid:62)
j T )),
SI(Z; T ) ≈ sup
i,j
sup
hi,gj
where
θi ∼ U(SD−1), i = 1, ..., S,
φj ∼ U(Sd−1), j = 1, ..., S.
(5)
i.e., we approximate (4) by randomly sampling a number of slices θ, φ uniformly from the surface
of two hyperspheres SD−1 and Sd−1 and pick those slices where the sliced Z and the sliced T
are maximally associated. With a large number of slices, it is expected that (5) will approximate (4)
well. We refer to [23] for a theoretical analysis on the number of required slices in estimator-agnostic
settings. In Appendix B we also investigate empirically how this number will affect performance.
For each slicing direction, we further assume that the supreme functions hi, gj : R → R for that
direction can be well approximated by K-order polynomials given sufficiently large K, i.e.
hi(a) ≈ ˆhi(a) =
K
(cid:88)
k=0
wikσ(a)k,
gj(a) ≈ ˆgj(a) =
K
(cid:88)
k=0
vjkσ(a)k,
where σ(*) is a monotonic function which maps the input to the range of [−1, 1]. Its role is to en-
sure that σ(a) always has finite moments, so that the polynomial approximation is well-behaved.
Note that no information will be lost by applying σ(*). Here we take σ(*) as the tanh function. In
Appendix A we also investigate theoretically the approximation error of this polynomial approxi-
mation scheme. Other approximation schemes such as random feature model [33] can also be used
to approximate hi and gj, which will be explored in the future. In this work, we simply set K = 3.
With this polynomial approximation, the solving of each functions hi, gj in (5) reduces to finding
their weights wi, vj:
sup
hi,gj
i = [1, σ(θ(cid:62)
Z (cid:48)
ρ(hi(θ(cid:62)
i Z), gj(φ(cid:62)
i Z), ..., σ(θ(cid:62)
i Z)K],
i Z (cid:48)
ρ(w(cid:62)
j T )) ≈ sup
wi,gj
j = [1, σ(φ(cid:62)
T (cid:48)
i, v(cid:62)
j T (cid:48)
j),
j T ), ..., σ(φ(cid:62)
j T )K]
This is known as canonical correlation analysis (CCA) [34] and can be solved analytically by eigen-
decomposition. Hence we can find the weights for all pairs of hi, gj by S2 eigendecompositions.
In fact, the functions hi, gj for all i, j can be solved simultaneously by performing a larger eigende-
composition only once. We do this by finding w, v that maximise the following quantity:
ˆSI Θ,Φ(Z; T ) = sup
w,v
ρ(w(cid:62)Z (cid:48), v(cid:62)T (cid:48)),
(6)
where
Z (cid:48)
i = [1, σ(θ(cid:62)
1, ..., Z (cid:48)
Z (cid:48) = [Z (cid:48)
i],
i Z)K],
i Z), ..., σ(θ(cid:62)
θi ∼ U(SD−1), i = 1, ..., S,
1, ..., T (cid:48)
T (cid:48) = [T (cid:48)
j]
T (cid:48)
j = [1, σ(φ(cid:62)
φj ∼ U(Sd−1), j = 1, ..., S.
S into two 'long' vectors Z (cid:48) ∈ R(K+1)S and
1, ...T (cid:48)
That is, we first concatenate all Z (cid:48)
T (cid:48) ∈ R(K+1)S respectively, then solve a CCA problem corresponding to Z (cid:48) and T (cid:48). We then use
(6) to replace (5). The theoretical basis for doing so is grounded by Theorem 2, which tells that the
solution of (6) yields an upper bound of (5), provided that the polynomial approximation is accurate.
j T ), ..., σ(φ(cid:62)
S and T (cid:48)
j T )K]
1, ...Z (cid:48)
3
Theorem 2. Provided that each hi, gj in (5) are K-order polynomials , given the sampled Θ =
j=1, we have ˆSI Θ,Φ(Z; T ) ≤ (cid:15) ⇒ supi,j suphi,gj ρ(hi(θ(cid:62)
{θi}S
i=1, Φ = {φj}S
i Z), gj(φ(cid:62)
j T )) ≤ (cid:15).
Proof. See Appendix A.
The intuition behind the proof of Theorem 2 is that if all Z (cid:48)
correlation, each of them alone can not either.
i and T (cid:48)
j as a whole cannot achieve a high
The benefits for solving fi, gj for all slices jointly are two-fold. (a) The first benefit is better com-
putational efficiency, as it avoids invoking a for loop and only uses matrix operation. This has better
affinity to modern deep learning infrastructure and libraries (e.g. Tensorflow [35] and PyTorch [36])
which are optimised for matrix-based operations. In addition to computational efficiency, another
benefit for solving gj, hj jointly is (b) the stronger power in independence testing. More specifically,
while some sliced directions may individually be weak for detecting dependence, they together as a
whole can compensate for each other, yielding a more powerful test. This also echos with [37].
Algorithm 1 Adversarial Infomin Learning
Algorithm 2 Slice Infomin Learning
Input: data D = {X (n), Y (n), T (n)}N
Output: Z = f (X) that optimises (1)
Hyperparams: β, N (cid:48), L1, L2
Parameters: encoder f , MI estimator t
n=1
Input: data D = {X (n), Y (n), T (n)}N
Output: Z = f (X) that optimises (1)
Hyperparams: β, N (cid:48), L, S
Parameters: encoder f , weights w, v in ˆSI
n=1
for l1 in 1 to L1 do
sample mini-batch B from D
sample D(cid:48) from D whose size N (cid:48) < N
(cid:66) Max-step
for l2 in 1 to L2 do
t ← t + η∇t ˆIt(f (X); T ) with data in D(cid:48)
end for
(cid:66) Min-step
f ← f −η∇f [L(f (X); Y )+β ˆIt(f (X); T )]
with data in B
end for
return Z = f (X)
for l in 1 to L do
sample mini-batch B from D
sample D(cid:48) from D whose size N (cid:48) < N
(cid:66) Max-step
sample S slices Θ = {θi}S
j=1
solve the weights w, v in ˆSI (6) analytically
with Θ, Φ, D(cid:48) by eigendecomposition
(cid:66) Min-step
f ← f −η∇f [L(f (X); Y )+β ˆSI(f (X); T )]
with data in B
i=1, Φ = {φj}S
end for
return Z = f (X)
Mini-batch learning algorithm. Given the above approximation (6) to SI, we can now elaborate
the details of our mini-batch learning algorithm. In each iteration, we execute the following steps:
• Max-step. Sample S slices Θ = {θi}S
j=1 and a subset of the data D(cid:48) ⊂ D. Learn
the weights w, v of ˆSI(Z; T ) (6) with the sampled Θ, Φ and the data in D(cid:48) by eigendecomposition;
• Min-step. Update f by SGD: f ← f −η∇f [L(f (X), Y )+β ˆSI(f (X), T )] with Z = f (X) where
the parameters w, v of ˆSI(f (X), T ) is learned in the max-step: ˆSI(Z, T ) = ρ(w(cid:62)Z (cid:48), v(cid:62)T (cid:48)).
i=1, Φ = {φj}S
The whole learning procedure is shown in Algorithm 2. We note that the data in the subset D(cid:48) can be
different from the mini-batch B and its size can be much larger than the typical size of a mini-batch.
Compared to that of adversarial methods [1, 2, 3, 4, 11, 21] as shown in Algorithm 1, we replace neu-
ral network training in the max-step with a analytic eigendecomposition step, which is much cheaper
to execute. As discussed in Sec 2, if the network t is not trained thoroughly (due to e.g. insufficient
gradient steps L2 in the max-step), it may not provide a sensible estimate to It(f (X); T ) and can
hence a weak adversary. Our method does not suffer from this issue as ˆSI is solved analytically.
Finally, as an optional strategy, we can improve our method by actively seeking more informative
slices for independence testing by optimising the sampled slices with a few gradient steps (e.g. 1-3):
Θ ← Θ − ξ∇Θ ˆSI Θ,Φ(Z, T ),
(7)
which is still cheap to execute. Such a strategy can be useful when most of the sampled slices are
ineffective in detecting dependence, which typically happens in later iterations where I(Z; T ) ≈ 0.
Φ ← Φ − ξ∇Φ ˆSI Θ,Φ(Z, T )
4
4 Related works
Neural mutual information estimators. A set of neural network-based methods [38, 39, 40, 41]
have been proposed to estimate the mutual information (MI) between two random variables, most
of which work by maximising a lower bound of MI [42]. These neural MI estimators are in general
more powerful than non-parametric methods [43, 44, 45, 46] when trained thoroughly, yet the time
spent on training may become the computational bottleneck when applied to infomin learning.
Upper bound for mutual information. Another line of method for realising the goal of infomin
learning without adversarial training is to find an upper bound for mutual information [10, 12, 19,
47, 48]. However, unlike lower bound estimate, upper bound often requires knowledge of either
the conditional densities or the marginal densities [42] which are generally not available in practice.
As such, most of these methods introduce a variational approximation to these densities whose
choice/estimate may be difficult. Our method on the contrary needs not to approximate any densities.
Slicing techniques. A series of successes have been witnessed for the use of slicing methods in
machine learning and statistics [49], with applications in generative modelling [50, 51, 52, 53],
statistical test [54] and mutual information estimate [23]. Among them, the work [23] who proposes
the concept of sliced mutual information is very related to this work and directly inspires our method.
Our contribution is a novel realisation of sliced mutual information suitable for infomin learning.
Fair machine learning. One application of our method is to encourage the fairness of a predictor.
Much efforts have been devoted for the same purpose, however most of the existing methods can
either only work at the classifier level [4, 24, 25, 55], or only focus on the case where the sensitive
attribute is discrete or univariate [22, 26, 28, 55, 56], or require adversarial training [1, 2, 3, 4, 11, 21].
Our method on the contrary has no restriction on the form of the sensitive attribute, can be used in
both representation level and classifier level, and require no adversarial training of neural networks.
Disentangled representation learning. Most of the methods in this field work by penalising the
discrepancy between the joint distribution P = q(Z) and the product of marginals Q = (cid:81)D
d q(Zd)
[6, 7, 27, 57, 58].1 However, such discrepancy is often non-trivial to estimate, so one has to resort
to Monte Carlo estimate (β-TCVAE [27]), to train a neural network estimator (FactorVAE [7]) or to
assess the discrepancy between P and Q by only their moments (DIP-VAE [57]). Our method avoids
assessing distribution discrepancy directly and instead perform independence test in the sliced space.
5 Experiments
We evaluate our approach on four tasks: independence testing, algorithmic fairness, disentangled
representation learning, domain adaptation. Code is available at github.com/cyz-ai/infomin.
Evaluation metric. To assess how much information is left in the learned representation Z ∈ RD
about the target T ∈ RK, we calculate the R ́enyi's maximal correlation ρ∗(Z, T ) between Z and T :
ρ∗(Z, T ) = sup
h,g
ρ(h(Z), g(T ))
(8)
which has the properties ρ∗(Z, T ) = 0 if and only if Z ⊥ T and ρ∗(Z, T ) = 1 if h(Z) = g(T )
for some deterministic functions h, g [30]. One can also understand this metric as the easiness of
predicting (the transformed) T from Z, or vice versa.2 As there is no analytic solution for the supre-
mum in (8), we approximate them by two neural networks h, g trained with SGD. Early stopping
and dropout are applied to avoid overfitting. The reliability of this neural approximation has been
verified by the literature [4] and is also confirmed by our experiments; see Appendix B.
This metric is closely related to existing metrics/losses used in fairness and disentangled represen-
tation learning such as demographic parity (DP) [24] and total correlation (TC) [7]. For example,
if ρ∗(Z, T ) → 0 then it is guaranteed that ˆY ⊥ T for any predictor ˆY = F (Z), so ρ∗(Z, T ) is an
upper bound for DP . Similarly, ρ∗(Z, T ) coincides with TC which also assesses whether Z ⊥ T .
In additional to this metric, we will also use some task-specific metric; see each experiment below.
Baselines. We compare the proposed method (denoted as "Slice") with the following approaches:
1Note there exist methods based on group theory [59, 60, 61] which do not assess distribution discrepancy.
2It can be shown ρ∗(Z, T ) is equivalent to the normalised mean square error between h(Z) and g(T ).
5
(a) a
(b) a2
(c) sin(a)
(d) tanh(a)
Figure 1: Comparison of the test power of different independence test methods. The x-axis corre-
sponds to different values for the dependence level α and the y-axis corresponds to the test power.
1
DK
(cid:80)D
d
(cid:80)K
k ρ(Zd; Tk).
• Pearson, which quantifies I(Z; T ) by the Pearson correlation coefficient
It was used in [5, 57] as an easy-to-compute proxy to MI to learn disentangled representations;
• dCorr, i.e. distance correlation, a non-parametric method for the quantifying the independence
between two vectors [46]. It was applied in [41] as a surrogate to MI for representation learning;
• Neural R ́enyi, an adversarial method for fair machine learning [25] which quantifies I(Z; T ) by
the R ́enyi correlation ρ∗(Z, T ) = suph,g ρ(h(Z), g(T )) with h, g approximated by neural net-
works. It can be seen as training a predictor to predict (the transformed) T from Z and is closely
related to many existing methods in algorithmic fairness and domain adaptation [1, 2, 3, 4, 29];
• Neural TC, an adversarial method for learning disentangled representation [7, 62] which quanti-
fies I(Z; T ) by the total correlation T C(Z, T ) = KL[p(Z, T )(cid:107)p(Z)p(T )]. To computes TC, a
classifier is trained to classify samples from p(Z, T ) and samples from p(Z)p(T ). This method
can also be seen as a variant of the popular MINE method [38] for mutual information estimate.
• v-CLUB, i.e. variational contrastive log upper bound, which introduces a (learnable) variational
distribution q(T |Z) to form an upper bound of MI [47]: I(Z; T ) ≤ Ep(Z,T )[log q(T |Z)] −
Ep(Z)p(T )[log q(T |Z)]. Like adversarial method, q(T |Z) can be learned by a few gradient steps.
For a fair comparison, for adversarial training-based approaches (i.e. Neural R ́enyi, Neural TC),
we ensure that the training time of the neural networks in these methods is at least the same as the
execution time of our method or longer. We do this by controlling the number of adversarial steps
L2 in Algorithm 1. The same setup is used for v-CLUB. See each experiment for the detailed time.
Hyperparameter settings. Throughout our experiments, we use 200 slices. We find that this setting
is robust across different tasks. An ablation study on the number of slices is given in Appendix B.
The order of the polynomial used in (6) namely K is set as K = 3 and is fixed across different tasks.
Computational resource. All experiments are done with a single NVIDIA GeForce Tesla T4 GPU.
5.1
Independence testing
We first verify the efficacy of our method as a light-weight but powerful independence test. For
this purpose, we investigate the test power of the proposed method on various synthetic dataset with
different association patterns between two random variables X ∈ R10, Y ∈ R10 and compared
to that of the baselines. The test power is defined as the ability to discern samples from the joint
distribution p(X, Y ) and samples from the product of marginal p(X)p(Y ) and is expressed as a
probability p ∈ [0, 1]. The data is generated as Y = (1 − α)(cid:104)t(AX)(cid:105) + α(cid:15), Xd ∼ U[−3, 3], Add =
1, Adk = 0.2, (cid:15) ∼ N ((cid:15); 0, I), α ∈ (0, 1) and (cid:104)*(cid:105) is a scaling operation that scales the operand to
the range of [0, 1] according to the minimum and maximum values in the population. The function
t(*) determines the association pattern between X and Y and is chosen from one of the following:
t(a) = a, a2, sin(a), tanh(a). The factor α controls the strength of dependence between X and Y .
All tests are done on 100 samples and are repeated 1,000 times. We choose this sample number as
it is a typical batch size in mini-batch learning. For methods involving the learning of parameters
(i.e. Slice, Neural R ́enyi, Neural TC), we learn their parameters from 10,000 samples. The time for
learning the parameters of Slice, Neural R ́enyi and Neural TC are 0.14s, 14.37s, 30.18s respectively.
For completeness, we also compare with the 'optimal test' which calculates the R ́enyi correlation
ρ∗(X, Y ) = ρ(h(X), g(Y )) with the functions h, g exactly the same as the data generating process.
6
Table 1: Learning fair representations on the US Census Demographic dataset. Here the utility of
the representation is measured by ρ∗(Z, Y ), while ρ∗(Z, T ) is used to quantify the fairness of the
representation. Training time is also provided as the seconds required per max step.
N/A
Pearson
dCorr
Slice
Neural R ́enyi Neural TC
vCLUB
ρ∗(Z, Y ) ↑
ρ∗(Z, T ) ↓
0.95 ± 0.00
0.95 ± 0.00
0.95 ± 0.00
0.95 ± 0.01
0.95 ± 0.01
0.95 ± 0.02
0.94 ± 0.02
0.92 ± 0.02
0.84 ± 0.08
0.47 ± 0.08
0.07 ± 0.02
0.23 ± 0.10
0.27 ± 0.03
0.16 ± 0.10
time (sec./max step)
0.000
0.012
0.087
0.102
0.092
0.097
0.134
Table 2: Learning fair representations on the UCI Adult dataset. Here the utility of the representation
is measured by ρ∗(Z, Y ), while ρ∗(Z, T ) is used to quantify the fairness of the representation.
N/A
Pearson
dCorr
Slice
Neural R ́enyi Neural TC
vCLUB
ρ∗(Z, Y ) ↑
ρ∗(Z, T ) ↓
0.99 ± 0.00
0.99 ± 0.00
0.97 ± 0.01
0.98 ± 0.01
0.97 ± 0.01
0.98 ± 0.02
0.97 ± 0.02
0.94 ± 0.02
0.91 ± 0.06
0.71 ± 0.06
0.08 ± 0.02
0.17 ± 0.08
0.36 ± 0.13
0.26 ± 0.12
time (sec./max step)
0.000
0.015
0.071
0.112
0.107
0.131
0.132
Figure 1 shows the power of different methods under various association patterns t and dependence
levels α. Overall, we see that the proposed method can effectively detect dependence in all cases, and
has a test power comparable to neural network-based methods. Non-parametric tests, by contrast,
fail to detect dependence in quadratic and periodic cases, possibly due to insufficient power. Neural
TC is the most powerful test among all the methods considered, yet it requires the longest time to
train. We also see that the proposed method is relatively less powerful when α ≥ 0.8, but in such
cases the statistical dependence between X and Y is indeed very weak (also see Appendix B). The
results suggest that our slice method can provide effective training signals for infomin learning tasks.
5.2 Algorithmic fairness
For this task, we aim to learn fair representations Z ∈ R80 that are minimally informative about
some sensitive attribute T . We quantify how sensitive Z is w.r.t T by R ́enyi correlation ρ∗(Z, T )
calculated using two neural nets. Smaller ρ∗(Z, T ) is better. The utility of the learned representation
i.e., L(Z; Y ) is quantified by ρ∗(Z, Y ). This formulation for utility, as aforementioned, is equivalent
to measuring how well we can predict Y from Z. In summary, the learning objective is:
max ρ∗(Z; Y ) − β ˆI(Z; T ),
where ˆI(Z; T ) is estimated by the methods mentioned above. For each dataset considered, we use
20,000 data for training and 5,000 data for testing respectively. We carefully tune the hyperparameter
β for each method so that the utility ρ∗(Z; Y ) of that method is close to that of the plain model (i.e.
the model trained with β = 0, denoted as N/A below; other experiments below have the same setup).
For all methods, we use 5, 000 samples in the max step (so N (cid:48) = 5, 000 in Algorithm 1, 2).
US Census Demographic data. This dataset is an extraction of the 2015 American Community
Survey, with 37 features about 74,000 census tracts. The target Y to predict is the percentage of
children below poverty line in a tract, and the sensitive attribute T is the ratio of women in that tract.
The result is shown in Table 1. From the table we see that the proposed slice method produces highly
fair representation with good utility. The low ρ∗(Z, T ) value indicates that it is unlikely to predict
T from Z in our method. While adversarial methods can also to some extent achieve fairness, it is
still not comparable to our method, possibly because the allocated training time is insufficient (in
Appendix B we study how the effect of the training time). Non-parameteric methods can not produce
truly fair representation, despite they are fast to execute. v-CLUB, which estimates an upper bound
of MI, achieves better fairness than adversarial methods on average, but has a higher variance [63].
UCI Adult data. This dataset contains census data for 48,842 instances, with 14 attributes describ-
ing their education background, age, race, marital status, etc. Here, the target Y to predict is whether
the income of an instance is higher than 50,000 USD, and the sensitive attribute T is the race group.
The result is summarised in Table 2. Again, we see that the proposed slice method outperforms
other methods in terms of both fairness and utility. For this dataset, Neural R ́enyi also achieves good
fairness, although the gap to our method is still large. Neural TC, by contrast, can not achieve a
7
(a) Adversarial training
(b) Slice
Figure 2: Label swapping experiments on Dsprite dataset. Left: the original image X. Middle:
reconstructing X ≈ G(Z, T ) using Z = E(X) and the true label T . Right: reconstructing X (cid:48) =
G(Z, T (cid:48)) using Z = E(X) and a swapped label T (cid:48) (cid:54)= T . Changing T should only affects the style.
(a) Adversarial training
(b) Slice
Figure 3: Label swapping experiments on CMU-PIE dataset. Left: the original image X. Middle:
reconstructing X ≈ G(Z, T ) using Z = E(X) and the true label T . Right: reconstructing X (cid:48) =
G(Z, T (cid:48)) using Z = E(X) and a swapped label T (cid:48) (cid:54)= T . Changing T only affect the expression.
comparable level of fairness under the time budget given - a phenomenon also observed in the US
Census dataset. This is possibly because the networks in Neural TC require longer time to train. The
v-CLUB method does not work very satisfactorily on this task, possibly because the time allocated
to learn the variational distribution q(Z|T ) is not enough, leading to a loose upper bound of I(Z; T ).
5.3 Disentangled representation learning
We next apply our method to the task of disentangled representation learning, where we wish to
discover some latent generative factors irrelevant to the class label T . Here, we train a conditional
autoencoder X ≈ G(Z, T ) to learn representation Z = E(X) which encodes label-irrelevant in-
formation of X. The target to recover is Y = X. The utility of Z is therefore quantified as the
reconstruction error: L(Z; Y ) = E[(cid:107)G(Z, T ) − X(cid:107)2
2], resulting in the following learning objective:
max E[(cid:107)G(Z, T ) − X(cid:107)2
2] − β ˆI(Z; T ).
The conditional autoencoder uses a architecture similar to that of a convolutional GAN [64], with
the difference being that we insert an adaption layer Z (cid:48) = MLP(Z, T ) before feeding the features
to the decoder. See Appendix B for the details of its architecture. All images are resized to 32 × 32.
For all methods, we use 10, 000 samples in the max step (so N (cid:48) = 10, 000 in Algorithms 1 and 2).
Dsprite. A 2D shape dataset [65] where each image is generated by four latent factors: shape,
rotation, scale, locations. Here the class label T is the shape, which ranges from (square, ellipse,
heart). For this dataset, we train the autoencoder 100 iterations with a batch size of 512. The dimen-
sionality of the representation for this task is 20 i.e. Z ∈ R20. As in the previous experiments, we
provide quantitative comparisons of the utility and disentanglement of different methods in Table 3.
In addition, we provide a qualitative comparison in Figure 2 which visualises the original image, the
reconstructed image and the reconstructed image with a swapped label. From Table 3, we see that
the proposed method achieve very low ρ∗(Z, T ) while maintaining good MSE, suggesting that we
8
Table 3: Learning label-irrelevant representations on the Dsprite dataset. Here the utility of the
representation is measured by MSE, while ρ∗(Z, T ) is used to quantify the level of disentanglement
of the representation. Training time is also provided as the seconds needed per max step. Acc( ˆT ) is
the accuracy trying to predict T from Z. As there are 3 classes, the ideal value for Acc( ˆT ) is 0.33.
MSE ↓
ρ∗(Z, T ) ↓
Acc( ˆT )
time (sec./max step)
N/A
Pearson
dCorr
Slice
Neural R ́enyi Neural TC
vCLUB
0.37 ± 0.01
0.44 ± 0.02
0.55 ± 0.03
0.50 ± 0.01
0.61 ± 0.04
0.49 ± 0.03
0.65 ± 0.04
0.91 ± 0.03
0.81 ± 0.07
0.62 ± 0.07
0.08 ± 0.02
0.48 ± 0.05
0.34 ± 0.06
0.22 ± 0.08
0.98 ± 0.01
0.89 ± 0.03
0.76 ± 0.05
0.32 ± 0.02
0.55 ± 0.04
0.54 ± 0.04
0.48 ± 0.03
0.000
0.201
0.412
0.602
0.791
0.812
0.689
Table 4: Learning label-irrelevant representations on the CMU-PIE dataset. Here the utility of the
representation is measured by MSE, while ρ∗(Z, T ) is used to quantify the level of disentanglement
of the representation. Training time is also provided as the seconds needed per max step. Acc( ˆT ) is
the accuracy trying to predict T from Z. As there are 2 classes, the ideal value for Acc( ˆT ) is 0.50∗.
N/A
Pearson
dCorr
Slice
Neural R ́enyi Neural TC
vCLUB
1.81 ± 0.04
0.76 ± 0.04
1.85 ± 0.05
MSE ↓
ρ∗(Z, T ) ↓
Acc( ˆT )
time (sec./max step)
*For the plain model, Acc( ˆT ) is not necessarily around 1.0, as Z does not encode all content of the image.
1.99 ± 0.12
0.39 ± 0.06
0.76 ± 0.04
0.36 ± 0.04
0.73 ± 0.03
2.46 ± 0.06
2.15 ± 0.07
0.55 ± 0.03
0.76 ± 0.03
0.07 ± 0.01
0.51 ± 0.03
0.27 ± 0.07
0.71 ± 0.06
2.08 ± 0.08
0.91 ± 0.00
0.68 ± 0.05
0.16 ± 0.06
2.02 ± 0.10
0.841
0.750
0.621
0.332
0.000
0.184
0.581
may have discovered the true label-irrelevant generative factor for this dataset. This is confirmed vi-
sually by Figure 2(b), where by changing T in reconstruction we only change the style. By contrast,
the separation between T and Z is less evident in adversarial approach, as can be seen from Table
3 as well as from Figure 2(a) (see e.g. the reconstructed ellipses in the third column of the figure.
They are more like a interpolation between ellipses and squares).
CMU-PIE. A colored face image dataset [66] where each face image has different pose, illumina-
tion and expression. We use its cropped version [67]. Here the class label T is the expression, which
ranges from (neutral, smile). We train an autoencoder with 200 iteration and a batch size of 128. The
dimensionality of the representation for this task is 128 i.e. Z ∈ R128. Figure 3 and Table 4 shows
the qualitative and quantitative results respectively. From Figure 3, we see that our method can well
disentangle expression and non-expression representations: one can easily modify the expression of
a reconstructed image by only changing T . Other visual factors of the image including pose, illu-
mination, and identity remain the same after changing T . Adversarial approach can to some extent
achieve disentanglement between Z and T , however such disentanglement is imperfect: not all of
the instances can change the expression by only modifying T . This is also confirmed quantitatively
by Table 4, where one can see the relatively high ρ∗(Z, T ) values in adversarial methods. For this
task, v-CLUB also achieves a low ρ∗(Z, T ) value, though it is still outperformed by our method.
5.4 Domain adaptation
We finally consider the task of domain adaptation, where we want to learn some representation Z
that can generalise across different datasets. For this task, a common assumption is that we have
assess to two dataset Ds = {X (i), Y (i)}n
j=1 whose classes are the same but are
collected differently. Only the data in Ds has known labels. Following [47], we learn Z as follows:
i=1 and Dt = {X (j)}m
Zc = fc(X),
Zd = fd(X)
Lc = EX,Y ∈Ds [Y (cid:62) log C(Zc)],
Ld = EX∈Ds [log D(Zd)] + EX∈Dt[log(1 − D(Zd))],
min Lc + Ld + β ˆI(Zc, Zd),
where Zc, Zd are disjoint parts of Z that encode the content information and the domain information
of X separately. C is the content classifier that maps X to a (K − 1)-simplex (K is the number of
classes) and D is the domain classifier that distinguishes the domain from which X comes. Since the
9
(a) M → MM, adversarial
(b) M → MM, slice
(c) C → S, adversarial
(d) C → S, slice
Figure 4: T-SNE plots of the learned content representations Zc in domain adaptation tasks. (a)(c)
show the cases when the adversary is not trained thoroughly (i.e. L2 in Algorithm 1 is set too small).
Table 5: Learning domain-invariant representations. Here Acc( ˆYs) and Acc( ˆYt) are the classifica-
tion accuracy in the source and the target domains respectively. Time used per max step is given.
MNIST → MNIST-M
CIFAR10 → STL10
N/A
Slice
Neural TC
vCLUB
N/A
Slice
Neural TC
vCLUB
Acc( ˆYs) ↑
Acc( ˆYt) ↑
ρ∗(Zc, Zd) ↓
time (sec./step)
99.3 ± 0.04
99.2 ± 0.02
99.2 ± 0.04
99.0 ± 0.03
46.3 ± 0.03
98.5 ± 0.45
80.1 ± 0.17
93.8 ± 0.10
0.86 ± 0.05
0.06 ± 0.01
0.64 ± 0.04
0.49 ± 0.12
0.000
2.578
3.282
3.123
Acc( ˆYs) ↑
Acc( ˆYt) ↑
ρ∗(Zc, Zd) ↓
time (sec./step)
93.0 ± 0.03
92.5 ± 0.03
92.4 ± 0.03
92.1 ± 0.04
75.9 ± 0.09
82.3 ± 0.03
80.8 ± 0.08
78.5 ± 0.11
0.43 ± 0.05
0.08 ± 0.01
0.39 ± 0.07
0.42 ± 0.09
0.000
3.146
3.222
3.080
classifier C only sees labels in Ds, we call Ds the source domain and Dt the target domain. For the
two encoders fc and fd, we use Resnets [68] with 7 blocks trained with 100 iterations and a batch
size of 128. Here Zc, Zd ∈ R256. We use N (cid:48) = 5, 000 samples in the max step for all methods.
MNIST → MNIST-M. Two digit datasets with the same classes but different background colors.
Both datasets have 50,000 training samples. Table 5 shows the result, indicating that our method can
more effectively remove the information about the domain. This is further confirmed by the T-SNE
[69] plot in Figure 4, where one can hardly distinguish the samples of Zc from the two domains.
This naturally leads to a higher target domain accuracy Acc( ˆYt) than other methods.
CIFAR10 → STL10. Two datasets of natural images sharing 9 classes. There are 50,000 and 5,000
training samples in the two datasets respectively. Following existing works [47, 70, 71], we remove
the non-overlapping classes from both datasets. Table 5 and Figure 4 show the result. Again, we see
that our method can more effectively remove domain information from the learned representation.
6 Conclusion
This work proposes a new method for infomin learning without adversarial training. A major chal-
lenge is how to estimate mutual information accurately and efficiently, as MI is generally intractable.
We sidestep this challenge by only testing and minimising dependence in a sliced space, which can
be achieved analytically, and we showed this is sufficient for our goal. Experiments on algorithmic
fairness, disentangled representation learning and domain adaptation verify our method's efficacy.
Through our controlled experiments, we also verify that adversarial approaches indeed may not pro-
duce infomin representation reliably – an observation consistent with recent studies. This suggests
that existing adversarial approaches may not converge to good solutions, or may need more time for
convergence, with more gradient steps needed to train the adversary fully. The result also hints at the
potential of diverse randomisation methods as an alternative to adversarial training in some cases.
While we believe our method can be used in many applications for societal benefit (e.g. for promot-
ing fairness), since it is a general technique, one must always be careful to prevent societal harms.
Acknowledgement
AW acknowledges support from a Turing AI Fellowship under grant EP/V025279/1, The Alan Tur-
ing Institute, and the Leverhulme Trust via CFI. YC acknowledges funding from Cambridge Trust.
10
References
[1] David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning adversarially
fair and transferable representations. In International Conference on Machine Learning, pages
3384–3393. PMLR, 2018.
[2] Harrison Edwards and Amos Storkey. Censoring representations with an adversary. In ICLR,
2016.
[3] Yanai Elazar and Yoav Goldberg. Adversarial removal of demographic attributes from text
In Proceedings of the 2018 Conference on Empirical Methods in Natural Language
data.
Processing, pages 11–21, 2018.
[4] Vincent Grari, Boris Ruf, Sylvain Lamprier, and Marcin Detyniecki. Fairness-aware neural
R ́eyni minimization for continuous features. arXiv preprint arXiv:1911.04929, 2019.
[5] Brian Cheung, Jesse A Livezey, Arjun K Bansal, and Bruno A Olshausen. Discovering hidden
factors of variation in deep networks. arXiv preprint arXiv:1412.6583, 2014.
[6] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew
Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-VAE: Learning basic visual con-
cepts with a constrained variational framework. 2016.
[7] Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on
Machine Learning, pages 2649–2658. PMLR, 2018.
[8] Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard
Sch ̈olkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learn-
ing of disentangled representations. In International Conference on Machine Learning, pages
4114–4124. PMLR, 2019.
[9] Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle.
In 2015 IEEE information theory workshop (ITW), pages 1–5. IEEE, 2015.
[10] Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep variational infor-
mation bottleneck. arXiv preprint arXiv:1612.00410, 2016.
[11] Qizhe Xie, Zihang Dai, Yulun Du, Eduard Hovy, and Graham Neubig. Controllable invariance
through adversarial feature learning. Advances in neural information processing systems, 30,
2017.
[12] Proteek Chandan Roy and Vishnu Naresh Boddeti. Mitigating information leakage in image
representations: A maximum entropy approach. In Proceedings of the IEEE/CVF Conference
on Computer Vision and Pattern Recognition, pages 2586–2594, 2019.
[13] Ayush Jaiswal, Daniel Moyer, Greg Ver Steeg, Wael AbdAlmageed, and Premkumar Natarajan.
Invariant representations through adversarial forgetting. In Proceedings of the AAAI Confer-
ence on Artificial Intelligence, pages 4272–4279, 2020.
[14] Renjie Xie, Wei Xu, Jiabao Yu, Aiqun Hu, Derrick Wing Kwan Ng, and A Lee Swindle-
hurst. Disentangled representation learning for rf fingerprint extraction under unknown chan-
nel statistics. arXiv preprint arXiv:2208.02724, 2022.
[15] Pengyu Cheng, Weituo Hao, and Lawrence Carin. Estimating total correlation with mutual
information bounds. arXiv preprint arXiv:2011.04794, 2020.
[16] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil
Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural
information processing systems, 27, 2014.
[17] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen.
Improved techniques for training gans. Advances in neural information processing systems, 29,
2016.
[18] Congzheng Song and Vitaly Shmatikov. Overlearning reveals sensitive attributes. arXiv
preprint arXiv:1905.11742, 2019.
[19] Daniel Moyer, Shuyang Gao, Rob Brekelmans, Aram Galstyan, and Greg Ver Steeg. Invari-
ant representations without adversarial training. Advances in Neural Information Processing
Systems, 31, 2018.
11
[20] Rui Feng, Yang Yang, Yuehan Lyu, Chenhao Tan, Yizhou Sun, and Chunping Wang. Learning
fair representations via an adversarial framework. arXiv preprint arXiv:1904.13341, 2019.
[21] Jiaming Song, Pratyusha Kalluri, Aditya Grover, Shengjia Zhao, and Stefano Ermon. Learning
controllable fair representations. In The 22nd International Conference on Artificial Intelli-
gence and Statistics, pages 2164–2173. PMLR, 2019.
[22] Mislav Balunovic, Anian Ruoss, and Martin Vechev. Fair normalizing flows. In International
Conference on Learning Representations, 2021.
[23] Ziv Goldfeld and Kristjan Greenewald. Sliced mutual information: A scalable measure of
statistical dependence. Advances in Neural Information Processing Systems, 34, 2021.
[24] J ́er ́emie Mary, Cl ́ement Calauzenes, and Noureddine El Karoui. Fairness-aware learning for
continuous attributes and treatments. In International Conference on Machine Learning, pages
4382–4391. PMLR, 2019.
[25] Sina Baharlouei, Maher Nouiehed, Ahmad Beirami, and Meisam Razaviyayn. R\'enyi fair
inference. arXiv preprint arXiv:1906.12005, 2019.
[26] Ray Jiang, Aldo Pacchiano, Tom Stepleton, Heinrich Jiang, and Silvia Chiappa. Wasserstein
fair classification. In Uncertainty in Artificial Intelligence, pages 862–872. PMLR, 2020.
[27] Ricky TQ Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud.
Isolating sources
of disentanglement in variational autoencoders. Advances in neural information processing
systems, 31, 2018.
[28] Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair represen-
tations. In International conference on machine learning, pages 325–333. PMLR, 2013.
[29] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc ̧ois
Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural
networks. The journal of machine learning research, 17(1):2096–2030, 2016.
[30] Alfr ́ed R ́enyi. On measures of dependence. Acta mathematica hungarica, 10(3-4):441–451,
1959.
[31] Hans Gebelein. Das statistische problem der korrelation als variations-und eigenwertproblem
und sein zusammenhang mit der ausgleichsrechnung. ZAMM-Journal of Applied Mathematics
and Mechanics/Zeitschrift f ̈ur Angewandte Mathematik und Mechanik, 21(6):364–379, 1941.
[32] Hermann O Hirschfeld. A connection between correlation and contingency. In Mathematical
Proceedings of the Cambridge Philosophical Society, volume 31, pages 520–524. Cambridge
University Press, 1935.
[33] David Lopez-Paz, Philipp Hennig, and Bernhard Sch ̈olkopf. The randomized dependence
coefficient. Advances in neural information processing systems, 26, 2013.
[34] Harold Hotelling. Relations between two sets of variates. Biometrika, 28(3/4):321–377, 1936.
[35] Mart ́ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu
Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. {TensorFlow}: a system for
In 12th USENIX symposium on operating systems design
{Large-Scale} machine learning.
and implementation (OSDI 16), pages 265–283, 2016.
[36] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan,
Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative
style, high-performance deep learning library. Advances in neural information processing
systems, 32, 2019.
[37] Ziv Goldfeld, Kristjan Greenewald, Theshani Nuradha, and Galen Reeves. k-sliced mu-
arXiv preprint
information: A quantitative study of scalability with dimension.
tual
arXiv:2206.08526, 2022.
[38] Mohamed Ishmael Belghazi, Aristide Baratin, Sai Rajeshwar, Sherjil Ozair, Yoshua Bengio,
Aaron Courville, and Devon Hjelm. Mutual information neural estimation. In International
conference on machine learning, pages 531–540. PMLR, 2018.
[39] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman,
Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information
estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
12
[40] Aaron Van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive
predictive coding. arXiv e-prints, pages arXiv–1807, 2018.
[41] Yanzhi Chen, Dinghuai Zhang, Michael Gutmann, Aaron Courville, and Zhanxing Zhu. Neural
approximate sufficient statistics for implicit models. arXiv preprint arXiv:2010.10079, 2020.
[42] Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational
bounds of mutual information. In International Conference on Machine Learning, pages 5171–
5180. PMLR, 2019.
[43] Arthur Gretton, Kenji Fukumizu, Choon Teo, Le Song, Bernhard Sch ̈olkopf, and Alex Smola.
A kernel statistical test of independence. Advances in neural information processing systems,
20, 2007.
[44] Francis R Bach and Michael I Jordan. Kernel independent component analysis. Journal of
machine learning research, 3(Jul):1–48, 2002.
[45] Barnab ́as P ́oczos, Zoubin Ghahramani, and Jeff Schneider. Copula-based kernel dependency
measures. arXiv preprint arXiv:1206.4682, 2012.
[46] G ́abor J Sz ́ekely and Maria L Rizzo. Partial distance correlation with methods for dissimilari-
ties. The Annals of Statistics, 42(6):2382–2412, 2014.
[47] Pengyu Cheng, Weituo Hao, Shuyang Dai, Jiachang Liu, Zhe Gan, and Lawrence Carin. Club:
In International conference on
A contrastive log-ratio upper bound of mutual information.
machine learning, pages 1779–1788. PMLR, 2020.
[48] Boxin Wang, Shuohang Wang, Yu Cheng, Zhe Gan, Ruoxi Jia, Bo Li, and Jingjing Liu. In-
fobert: Improving robustness of language models from an information theoretic perspective.
arXiv preprint arXiv:2010.02329, 2020.
[49] Kimia Nadjahi, Alain Durmus, L ́ena ̈ıc Chizat, Soheil Kolouri, Shahin Shahrampour, and Umut
Simsekli. Statistical and topological properties of sliced probability divergences. Advances in
Neural Information Processing Systems, 33:20802–20812, 2020.
[50] Ishan Deshpande, Ziyu Zhang, and Alexander G Schwing. Generative modeling using the
sliced wasserstein distance. In Proceedings of the IEEE conference on computer vision and
pattern recognition, pages 3483–3491, 2018.
[51] Soheil Kolouri, Phillip E Pope, Charles E Martin, and Gustavo K Rohde. Sliced wasserstein
auto-encoders. In International Conference on Learning Representations, 2018.
[52] Mark Rowland, Jiri Hron, Yunhao Tang, Krzysztof Choromanski, Tamas Sarlos, and Adrian
Weller. Orthogonal estimation of wasserstein distances. In The 22nd International Conference
on Artificial Intelligence and Statistics, pages 186–195. PMLR, 2019.
[53] Yang Song, Sahaj Garg, Jiaxin Shi, and Stefano Ermon. Sliced score matching: A scalable
approach to density and score estimation. In Uncertainty in Artificial Intelligence, pages 574–
584. PMLR, 2020.
[54] Wenbo Gong, Yingzhen Li, and Jos ́e Miguel Hern ́andez-Lobato. Sliced kernelized stein dis-
crepancy. arXiv preprint arXiv:2006.16531, 2020.
[55] Yilun Xu, Hao He, Tianxiao Shen, and Tommi S Jaakkola. Controlling directions orthogonal
to a classifier. In International Conference on Learning Representations, 2021.
[56] Evgenii Chzhen, Christophe Denis, Mohamed Hebiri, Luca Oneto, and Massimiliano Pon-
til. Fair regression with wasserstein barycenters. Advances in Neural Information Processing
Systems, 33:7321–7331, 2020.
[57] Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of
disentangled latent concepts from unlabeled observations. arXiv preprint arXiv:1711.00848,
2017.
[58] Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Des-
jardins, and Alexander Lerchner. Understanding disentangling in β-vae. arXiv preprint
arXiv:1804.03599, 2018.
[59] Irina Higgins, David Amos, David Pfau, Sebastien Racaniere, Loic Matthey, Danilo Rezende,
and Alexander Lerchner. Towards a definition of disentangled representations. arXiv preprint
arXiv:1812.02230, 2018.
13
[60] Robin Quessard, Thomas Barrett, and William Clements. Learning disentangled representa-
tions and group structure of dynamical environments. Advances in Neural Information Pro-
cessing Systems, 33:19727–19737, 2020.
[61] Xinqi Zhu, Chang Xu, and Dacheng Tao. Commutative lie group vae for disentanglement
In International Conference on Machine Learning, pages 12924–12934. PMLR,
learning.
2021.
[62] Elliot Creager, David Madras, J ̈orn-Henrik Jacobsen, Marissa Weis, Kevin Swersky, Toniann
Pitassi, and Richard Zemel. Flexibly fair representation learning by disentanglement. In Inter-
national conference on machine learning, pages 1436–1445. PMLR, 2019.
[63] Jiaming Song and Stefano Ermon. Understanding the limitations of variational mutual infor-
mation estimators. In International Conference on Learning Representations, 2019.
[64] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with
deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
[65] Loic Matthey, Irina Higgins, Demis Hassabis, and Alexander Lerchner. dsprites: Disentangle-
ment testing sprites dataset. https://github.com/deepmind/dsprites-dataset/, 2017.
[66] Ralph Gross, Iain Matthews, Jeffrey Cohn, Takeo Kanade, and Simon Baker. Multi-pie. Image
and vision computing, 28(5):807–813, 2010.
[67] Yu Tian, Xi Peng, Long Zhao, Shaoting Zhang, and Dimitris N Metaxas. Cr-gan: learning
complete representations for multi-view generation. In Proceedings of the 27th International
Joint Conference on Artificial Intelligence, pages 942–948, 2018.
[68] 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 recogni-
tion, pages 770–778, 2016.
[69] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine
learning research, 9(11), 2008.
[70] Geoff French, Michal Mackiewicz, and Mark Fisher. Self-ensembling for visual domain adap-
tation. In International Conference on Learning Representations, 2018.
[71] Rui Shu, Hung Bui, Hirokazu Narui, and Stefano Ermon. A dirt-t approach to unsupervised
domain adaptation. In International Conference on Learning Representations, 2018.
14
|
|
http://arxiv.org/abs/2302.10698v1 | 2023-02-21T14:36:18 | 2023-02-21T14:36:18 | Unpaired Translation from Semantic Label Maps to Images by Leveraging
Domain-Specific Simulations | Photorealistic image generation from simulated label maps are necessitated in
several contexts, such as for medical training in virtual reality. With
conventional deep learning methods, this task requires images that are paired
with semantic annotations, which typically are unavailable. We introduce a
contrastive learning framework for generating photorealistic images from
simulated label maps, by learning from unpaired sets of both. Due to
potentially large scene differences between real images and label maps,
existing unpaired image translation methods lead to artifacts of scene
modification in synthesized images. We utilize simulated images as surrogate
targets for a contrastive loss, while ensuring consistency by utilizing
features from a reverse translation network. Our method enables bidirectional
label-image translations, which is demonstrated in a variety of scenarios and
datasets, including laparoscopy, ultrasound, and driving scenes. By comparing
with state-of-the-art unpaired translation methods, our proposed method is
shown to generate realistic and scene-accurate translations. | [
"Lin Zhang",
"Tiziano Portenier",
"Orcun Goksel"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10698v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10698v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CV",
"cs.LG"
] | 3
2
0
2
b
e
F
1
2
]
V
C
.
s
c
[
1
v
8
9
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Unpaired Translation from Semantic Label Maps to Images
by Leveraging Domain-Specific Simulations
Lin Zhang1, Tiziano Portenier1, Orcun Goksel1,2
1 Computer-assisted Applications in Medicine, Computer Vision Lab, ETH Zurich, Switzerland
2 Department of Information Technology, Uppsala University, Sweden
Abstract
Photorealistic image generation from simulated label maps are necessitated in several contexts,
such as for medical training in virtual reality. With conventional deep learning methods, this task
requires images that are paired with semantic annotations, which typically are unavailable. We
introduce a contrastive learning framework for generating photorealistic images from simulated
label maps, by learning from unpaired sets of both. Due to potentially large scene differences
between real images and label maps, existing unpaired image translation methods lead to artifacts
of scene modification in synthesized images. We utilize simulated images as surrogate targets for a
contrastive loss, while ensuring consistency by utilizing features from a reverse translation network.
Our method enables bidirectional label-image translations, which is demonstrated in a variety of
scenarios and datasets, including laparoscopy, ultrasound, and driving scenes. By comparing with
state-of-the-art unpaired translation methods, our proposed method is shown to generate realistic
and scene-accurate translations.
Keywords- Image translation, Simulated training, Medical training in VR, Contrastive learning,
Adversarial learning, GAN
1
Introduction
Photorealistic image simulation has been an active research area for decades with a wide range of
applications from movie- and game-industries [1, 2] to medical imaging for surgical training [3–6].
Extensive research in modelling imaging physics [5–7] and material representations [8, 9] has substan-
tially improved simulation realism in different applications, but there is still a very perceiveable visual
difference between the state-of-the-art simulators and real world images. Recent progress in deep
learning has paved the way for synthesizing photorealistic images by learning image features from
large-scale real data. Among them, generative adversarial networks [10] have shown promising results
in generating photorealistic images. Methods were shown to successfully generate images from noise
inputs with controlled styles at different level of details learned from given domains [11–13] as well as
to achieve semantic image synthesis [14–18] given paired label and target images. In the absence of
paired training samples, methods based on cycle consistency loss [19, 20], shared latent space [21, 22],
layer normalizations [23] and more recently contrastive loss [24,25] have been investigated with varying
levels of success.
As opposed to the widely used cyclic approaches, contrastive learning (CL) based unpaired image
translation methods focus on translating in single direction by relaxing the strong bijective assumption,
which has achieved impressive results in various unpaired translation settings [24]. Compared to image-
level feature contrasting for unsupervised classification and segmentation, patch-level contrasting is
employed in [24] which enforces structural similarity between images. Various approaches have been
accordingly proposed for bridging the appearance gap between synthetic and real images [26–29], also
further improved by leveraging auxiliary simulation information such as simulated semantic maps [30]
and geometry buffers (G-buffers) generated during 3D computer graphics rendering [31]. A parallel line
of work investigate photographic transfer [32–35], aiming at translating the appearance of reference
images to simulated contents; however, such methods require lengthy and difficult-to-parametrize
optimizations for each single target image. All above work aim to improve the realism of existing,
sub-realistic (e.g., simulated) images and hence require the existence of preceding, complex simulation
and rendering methods.
Funding was provided partially by the Medtech Science and Innovation Centre, Uppsala, Sweden.
Corresponding author: Orcun Goksel ([email protected])
1
style
and images I content
Figure 1: Overview of unpaired label-image translation by leveraging domain-specific simulations.
(a) An illustration of the simulation/generation pipeline from 3D computer graphics (CG) model to
label-maps Lcontent
style with the subscript indicating the style domain and superscript
indicating the content domain. R and S denote the real and simulated domains, respectively. Note
that the goal is to generate images I S
R with realistic appearance for simulated content, based on (i.e.
consistent with) label-maps LS
S of simulated scenes. To that end, one can collect and use many real-life
images I R
R , but these will not one-to-one match existing simulated content therefore preventing classical
(b) A schematic summary of existing unpaired image translation approaches
supervised training.
CycleGAN [19], CUT [24], and ConPres [30], as well as our proposed methods SimIT, SimIT-C,
and SimIT-PC. We define the label-to-image mapping function as G : L → I and the image-to-
label mapping function as F : I → L, with the label domain L and image domain I. Both G
and F are parameterized with a deep neural network consisting of an encoder and a decoder, i.e.
G(*) = GD(GE(*)) and F (*) = F D(F E(*)). Contrastive loss is computed on features obtained from the
mappings M G(*) = H(GE(*)) or M F(*) = H(F E(*)), where H maps the generator encoder latent to a
feature space Z.
2
Manipulation, contact physics, deformation, viewing perspective, ... Learning-basedLabel-to-Image TranslationOur goal3D ModelsLabel-map L!!Real images I""Translated Image I"!(a)Cycle consistencyGFCycleGANL!!I""ConPresGGSemantic-consistency lossL!!I!!I""SimIT-CGL!!I!!I""Contrastive lossZM#M#(b)GContrastive lossM#L!!I""ZCUTM#SceneGeometric processingProjective transform, cross-sectional slice, ...(simple)Simulated Image I!!Image simulationImaging physics, CG rendering, shading, acoustics, heuristics, ...(often complex)Conventional simulation pipelinesSimulation parametersObject properties, textures, surface roughness , lighting, internal composition, imaging parameters, ...SimITGL!!I!!I""Contrastive lossZM$M$SimIT-PCGL!!I""Contrastive lossZM#M#L!!S → I S
Photorealistic image generation directly from simulated scene layouts, so-called label-maps, would
obviate any complex and computationally-intensive simulation/rendering process in real-time, by
learning the internals of such rendering into a generative model during a non-time-critical offline
learning stage. Such label-maps can typically be extracted easily from existing simulation pipelines,
only given 3D objects models and a vantage point (thus a scene), i.e. without a need to tune model-
specific parameters nor to compute complex physical interactions. To illustrate this further, a generic
simulation pipeline is given in Figure 1(a). Given the above motivation, we aim to generate images
I with realistic appearance but simulation-controlled content, i.e. I S
R as appearance and content of
a representation are hereafter indicated in sub- and super-script, respectively. With this conven-
tion, the methods from the literature mentioned earlier mostly target image-to-image translation of
I S
S → I S
R . In comparison, label-to-image translation as we intend is often more challenging due to
the large domain shift between these two representations. Generating simulated images from labels,
i.e. LS
S translation, was studied in [9] for accelerating simulated image generation in real-time,
for which a conditional GAN with supervised per-pixel loss was shown to provide promising results.
This, however, relatively simpler compared to our goal of generating I S
R, since the former can be cast
as a paired translation problem where the paired data (LS
S, I S
S ) is typically available from conventional
simulation pipelines. In contrast for our desired target of I S
R, there exists no such paired label data.
A large domain gap together with the lack of paired data make our intended label-to-realistic-image
translation very challenging, and, to the best of our knowledge, without any working solution so far.
In this work we target the above problem of photorealistic image generation directly from label-
maps. To facilitate the learning of appearance information from real images I R
R , we propose to
utilize any available physics-based simulation to generate intermediate image representations I S
S . We
utilize these as a stepping stone to help bridge the domain gap between the labels LS
S and their
real-image counterparts I S
R as desired. To that end, we introduce a contrastive learning based image
translation framework that leverages physics-based simulations/rendering in the training of unpaired
label-to-image translation, but without needing such simulations during the real-time inference stage.
Compared to the existing works [9, 26, 30, 31], our proposed method performs image generation and
realism enhancement simultaneously in a single step. We demonstrate our method on enhancing
medical image simulators for training, as well as car driving simulators for entertainment.
Our proposed solution builds on a bidirectional (cyclic) translation idea. As a by-product of this
design, it can also perform the inverse operation of image-to-label translation, i.e. semantic image
segmentation is also learned meanwhile in an unsupervised fashion without seeing any annotations
of real images. We also evaluate such segmentation outcomes in this work, as they opens future
possibilities of alleviating annotation efforts.
2 Results
2.1 Compared methods
Proposed method. We call our proposed method for generating realistic images from simulated
semantic label-maps, with the target style learned from real images while retaining overall content
matching the simulated scene, as Simulation-based Image Translation framework (SimIT). Realistic
and scene-accurate translation given unpaired data is herein enabled by two major contributions:
1. To address missing label-image pair information, we leverage existing physics-based simulations by
using the simulated images (that are inherently paired with corresponding label-maps) as surrogate
targets for contrastive learning.
2. To enforce content/structure preservation, we devise a method that contrasts domain-specific image
features extracted from a translation network that is trained using a cycle consistency loss. This
further enables bidirectional translation, i.e. in both label-to-image and image-to-label directions.
Compared methods. We evaluate SimIT comparatively to the following three state-of-the-art
unpaired image translation methods: CycleGAN [19] is a conventional approach with cyclic con-
sistency loss by employing separate generators and discriminators in each direction. CUT [24] is a
3
unidirectional translation framework based on patch-based multi-scale contrastive loss computed on
generator features. ConPres [30] is a multi-domain translation framework that leverages simulated
label-image pairs to retain structural content. Together with cycle-consistency and contrastive losses,
ConPres proposes a regularization loss for semantic consistency, which enforces a generator to create
the same output for paired images and label-maps. Consequently, ConPres can be used for both
image-to-image and label-to-image translation. The latter being the focus herein, we employ that
use-case of ConPres in our comparisons. High-level conceptual schematics of above-mentioned three
approaches are illustrated in Figure 1(b).
To further evaluate our two major contributions listed above, we ablated them cu-
Ablations.
mulatively from SimIT, resulting in the following reduced models for comparison: SimIT-C (SimIT
without cycle loss) is a unidirectional version of SimIT, i.e. without learning an inverse translation from
image to labels, where the contrastive loss is then computed using features from the label-to-image
generator, c.f. SimIT-C in Figure 1(b). SimIT-CS (SimIT-C without leveraging simulations) does
not utilize any simulation information, where the contrastive loss is then computed between semantic
label-maps and translated images, similarly to CUT in Figure 1(b).
2.2 Evaluation
All results are evaluated on unseen test data. We employ the non-parametric two-sided Wilcoxon
signed-rank test to assess differences between paired test results and report statistical significance with
p-value. Methodological and implementation details are given later in the Methods. We compared
the methods on three different applications (more details given in the Methods):
Laparoscopy training. As physics-based simulation, computer-graphics rendering techniques were
employed [36, 37], to simulate synthetic laparoscopic images from a 3D abdominal model. During the
rendering of each frame, a camera projection of anatomical labels provided the corresponding semantic
label-maps. This simulated dataset with paired image and label-maps are herein called as LaparoSim.
For the laparoscopy application, we employed two different datasets of real images, thus evaluating
two different target styles, called herein: Style-C, represented by the public Cholec dataset containing
80 videos of cholecystectomy surgeries [38]; and Style-H, represented by a single, in-house laparoscopic
surgery video clip with a length of 13 minutes. Sample images can be seen in Figure 2.
The simulated images were generated using a ray-tracing framework [6]
Ultrasound training.
from a second trimester fetal model, by emulating a convex ultrasound probe at multiple locations
and orientations on the abdominal surface, with imaging settings following [30]. Semantic label-map
is rendered as a cross-section through the anatomical surfaces at the ultrasound center imaging plane.
We refer this simulated dataset as USSim.
For the targeted real-image style, sample ultrasound images were collected using a GE Voluson
E10 machine during standard fetal screening exams of 24 patients. We refer this as GE-E10 style.
Gaming. As the gaming simulation, we used the GTA dataset [39] containing image-label pairs
from a car-driving game. For the real image style, we used the Cityscapes dataset [40] containing
images of street scenes from German cities.
2.3 Experiments
Label-to-image translation. For the laparoscopy training application, we present the results in
Figure 2 for separately training two different styles. As seen qualitatively in Figure 2(b), CycleGAN
and CUT hallucinate inexistent tissue regions, e.g., fat tissues. ConPres achieves structural preserva-
tion by leveraging information from LaparoSim label-image pairs, but fails completely in generating
tissue textures, which leads to highly unrealistic image style. Going from label-to-image, our method
SimIT is seen to outperform the state-of-the-art in terms of anatomical content preservation as well
as in achieving a realistic image appearance. This observation is substantiated by the quantitative
evaluation in Table 1(a), where image realism is empirically measured using Frechet and Kernel Incep-
tion Distances (FID and KID, respectively) between translated and real image sets, and the content
4
Figure 2: (a) Examples of real laparoscopic images with two different appearances: Style-C for the
public Cholec80 dataset and Style-H for an in-house single-video dataset. (b) Qualitative comparison
of images translated from input LaparpSim label-maps, using the proposed SimIT and alternative
methods. For reference purposes, conventionally simulated/rendered LaparoSim images are shown
on the right. (c) Quantitative evaluation of structural preservation via Structure Similarity Index
Metric (SSIM). Using a paired test, distributions of pair-wise differences over the test set are shown
by comparing SimIT to each alternative method and ablated variant, i.e. the larger the positive
difference is, the more superior SimIT is with respect to another method. Significance is indicated
with respect to SimIT (represented with the dotted lines) or between different models (|-|), with
P-values of ≤ 0.0001 (****). (d) Qualitative comparison of our proposed method SimIT to its ablated
variants, with translated images zoomed in on the white field-of-view shown in the simulated image
as reference.
5
(a)(b)(d)LaparoSimSSIM (Relative to SimIT)SimIT-CSSimIT-CSimITReal image examples: Style-CStyle-CReal image examples: Style-HStyle-HStyle-CStyle-Ht************CycleGANCUTConPres03060SSIM [%]************(c)****CycleGANCUTConPres03060********************LaparoSimTranslatedTranslatedCycleGANImageLabel (input)LaparoSimImage (reference)CUTConPresSimITSimIT-CSSimIT-CSimIT-CSSimIT-CStyle-CStyle-HStyle-CStyle-HStyle-CStyle-HTable 1: Quantitative metrics reported as mean(std). Arrows indicate direction of superiority; ↑
meaning the higher the better, and ↓ the lower. KID is reported in 10−2 unit. Best results are marked
bold.
(a) Laparoscopy
Style-C
Style-H
Method
Simulation
s CycleGAN [19]
CUT [24]
ConPres [30]
r
e
h
t
O
s SimIT-CS
SimIT-C
SimIT
r
u
O
Content
Realism
Content
Realism
FID ↓
SSIM [%] ↑ KID ↓
17.76
257.39
14.46
254.61
12.85
234.65
380.70
36.72
202.24 10.40
12.65
210.94
11.97
214.22
-
39.21(6.80)
49.79(13.75)
71.12(3.96)
41.77(7.98)
58.05(7.34)
75.56(2.42)
SSIM [%] ↑ KID ↓
201.32
212.42
222.81
379.82
147.06
175.38
161.29
-
50.50(10.62)
58.74(6.77)
75.76(5.56)
56.15(5.23)
72.87(2.12)
83.69(1.63)
FID ↓
12.42
13.73
13.42
36.80
7.03
11.61
7.13
(b) Ultrasound
Method
Simulation
s CycleGAN [19]
CUT [24]
ConPres [30]
r
e
h
t
O
s SimIT-CS
SimIT-C
SimIT
r
u
O
Content
IoU [%] ↑
-
2.33(1.10)
3.39(1.47)
5.01(1.95)
2.97(1.30)
9.50(4.42)
20.54(6.80)
Realism
FID ↓ KID ↓
38.14
297.24
2.02
46.67
1.63
46.62
7.74
95.31
3.57
56.70
2.33
46.10
6.14
79.02
(c) Gaming
Method
Simulation
s CycleGAN [19]
CUT [24]
ConPres [30]
r
e
h
t
O
s SimIT-CS
SimIT-C
SimIT
r
u
O
mAP ↑
–
14.12
12.42
15.44
13.74
20.76
22.34
Content
pixAcc ↑
–
55.54
53.10
60.33
56.22
63.12
68.83
Realism
classAcc ↑ FID ↓ KID ↓
7.78
3.04
3.42
10.39
0.81
1.89
2.60
101.82
65.20
66.54
120.63
43.04
57.05
60.46
–
24.40
22.06
26.38
23.19
32.57
33.07
preservation is measured via the structural similarity index measure (SSIM) between translated and
corresponding simulated images. Note that SimIT also achieves the lowest SSIM standard devia-
tion, indicating its consistent content preservation over the test samples. A test-image wise paired
comparison of all methods with respect to SimIT is presented in Figure 2(c), which shows ConPres
as the closest contender in terms of content preservation (SSIM) but with largely unrealistic image
translation, as also demonstrated qualitatively (Figure 2(b)) and tabulated empirically (Table 1(a)).
Compared to the proposed method SimIT, its ablated variants, SimIT-C and SimIT-CS perform
substantially poorer as seen quantitatively in Table 1(a) and Figure 2(c), and qualitatively in Fig-
ure 2(d). This demonstrates the importance of our proposed method components. SimIT-CS lacks
our proposed component for utilizing simulations with a contrastive loss in learning the label-to-image
translation, and as such it can be seen as a variant of CUT implemented in our framework. With no
explicit label-to-image pairs provided, SimIT-CS then learns to simply emulate all structures seen in
the real examples, hence erroneously changing the image content as seen in the presented examples.
Using simulated images as surrogate targets for contrastive loss (SimIT-C in Figure 2(d)) largely pre-
vents such superfluous content generation. Still SimIT-C only uses the features from a label domain
for contrasting, and such features cannot be well aligned with image features. With the proposed
method SimIT, the addition of a custom cycle loss allows for training a bidirectional translation,
6
where the features from an encoder operating on images can then instead be used for contrasting.
With such domain-consistent features, content preservation is further enhanced, as seen both quan-
titatively given the error of SimIT-C in Figure 2(c), and qualitatively by visually comparing these
variants in Figure 2(d).
Evaluation on ultrasound training and gaming applications further confirms the superior perfor-
mance of our proposed method on label-to-image translation task (Figures 3 and 4). Translated ultra-
sound image examples in Figure 3(b) demonstrate that the alternative methods are not always correct
with the echogenecity (brightness) profile of different anatomical regions, e.g., outside the uterus is
sometimes black and sometimes white, and the same for the amniotic fluid. ConPres preserves the
echogenecity better than CycleGAN and CUT by leveraging simulated label-image pairs, however, it
is biased towards interpreting input labels as pixel intensities. In comparison, SimIT can retain cor-
rect echogenecity of each region, which can be seen by comparing to the reference simulated images,
while translating into a realistic appearance in the style of GE-E10 images. Furthermore, our method
successfully preserves fine anatomical structures, e.g., the ribs in the top row example, whereas the
other compared methods fail with such detail. We herein assess content preservation for ultrasound
images based on the alignment of bone surfaces, delineated by a phase-symmetry based bone-surface
estimation method [41] as exemplified in Figure 3(c). Alignment is then quantified by the intersec-
tion over union (IoU) score of bone surface pixels extracted from translated and simulated (reference)
images (cf. Figure 3(e) and Table 1(b)). When comparing image realism via FID/KID scores, SimIT
does not yield the best values, which is hypothetically caused by the large scene difference between
real and simulated training images, as illustrated in Figure 3(d). Since the alternative methods do
not enforce strict restrictions on content preservation, they hallucinate content in an unconstrained
manner, which helps lower their FID/KID scores; nevertheless, such arbitrary content does not match
the input label-maps, hence not fit for our purposes, as also quantified by the structural preservation
scores, i.e. IoU for the ultrasound training experiment.
For the gaming experiment, similarly to ultrasound experiment above, CUT and CycleGAN largely
hallucinate content, ignoring the input GTA label-maps and hence do not satisfy the desired content
preservation criterion. For example, as seen in Figure 4(b), the sky is erroneously filled with trees,
since the real Cityscapes images contain more trees and less sky compared to the simulated GTA
dataset [31]. Then, the discriminator can easily differentiate between real and fake images by looking
at the image top region, which in return encourages the generator to hallucinate more trees in the
sky. In comparison to CycleGAN and CUT, the domain-consistent deep features used in our proposed
SimIT explicitly encourages content preservation. To evaluate structural consistency, we apply on
the translated images the pretrained semantic segmentation network DRN [42] following [24] and
report the resulting segmentation metrics: mean average precision (mAP), pixel accuracy (pixAcc),
class accuracy (classAcc) – see the Methods for details. SimIT achieves the best scores among all
the methods for these content preservation metrics. Evaluating image realism using FID/KID scores
(Table 1(c)), SimIT outperforms the state-of-the-art, while faring suboptimal compared to its ablated
variants, which however in turn fail at successfully retaining content. This well indicates the conflicting
nature between content preservation and image realism, especially in the presence of substantial layout
differences between simulated and real image sets.
Image-to-label translation. By introducing the cyclic loss to train our framework with domain-
consistent features, at the end of the training we also obtain a generator that can translate real images
to label-maps, i.e. a semantic segmenter for real images. Note that such segmenter is trained truly
unsupervised, i.e. without requiring any annotation of any real image. To evaluate the segmentation
outcome of image-to-label translations of SimIT, we compare resulting label-maps to semantic seg-
mentations for the datasets where such annotations are available, i.e. the CholecSeg8k dataset as the
Style-C target for our laparoscopy application and the Cityscapes dataset for our gaming application.
For laparoscopy comparison, we report upper-bound segmentation results from a ResNet50 network
trained on annotated images from the CholecSeg8k dataset introduced by [43], which is a subset
of Cholec data [38].
In Figure 5(a) a sample input image is shown together with its supervised
ResNet50 segmentation as upper-bound; the semantic map predicted by SimIT used as a segmenter;
and the ground-truth annotation for this test image. Average segmentation scores are reported in
7
Figure 3: Ultrasound training experiment results: (a) Examples of real ultrasound images with the
style of GE-E10 ultrasound machine. (b) Visual examples of images translated using SimIT compared
to alternative methods. (c) Qualitative results of SimIT compared to its ablated variants, with bone
surfaces visualized in purple and green respectively for those from translated and simulated (reference)
images.
(d) Probability maps of containing content at each location, averaged over the training
images. A big scene distribution difference can be observed between simulated and target images.
(e) Quantitative evaluation of structural preservation. To this end, a paired test is employed to
compare the IoU scores between the bone maps extracted from the simulated and translated images.
The difference is computed by subtracting the score of other models from SimIT, i.e. the larger the
positive difference is, the more superior SimIT is with respect to another method. Significance is
indicated with respect to our proposed model SimIT (marked with dotted lines) or between different
models (|-|), with P-values of ≤ 0.0001 (****).
8
Scene distributionBone Extraction ScoreRelative to SimIT(d)10(b)(c)(e)USSimLabel (input)TranslatedCycleGANCUTConPresSimITUSSimSimIT-CSGE-E10USSimSimIT-CSimITTranslatedImage (reference)Bone SurfaceBone SurfaceImage (reference)USSimCycleGANCUTConPresSimIT-CSSimIT-C502040IoU [%]************************Real image examples: GE-E10 Style(a)Figure 4: Gaming experiment results: (a) Examples of images from Cityscapes dataset. (b) Visual
examples of images translated using SimIT compared to alternative methods. (c) Qualitative results
of SimIT compared to its ablated variants.
Figure 5(c). For the gaming application, we compare SimIT with the segmentation network DRN [42],
a standard technique for the Cityscapes dataset. DRN was trained on the labelled training set, acting
as a supervised upper-bound herein. A qualitative sample comparison is shown in Figure 5(b) with
quantitative results tabulated in Figure 5(d). SimIT presents a fair performance despite not having
seen any labeled real images and while not specifically targeting such segmentation problem.
For the ultrasound application, SimIT was trained with gray-scale label-maps, as this performed
well for the main focus of label-to-image translation and also using one-hot label encoding (performed
for the other two applications) was less stable in the parametrization of ultrasound training. Without
one-hot labels, our trained network fails to estimate meaningful label-maps from real ultrasound
images. This is mainly due to having nearly 80 different tissue classes and some classes with similar
ultrasound texture and appearance, which makes the segmentation problem very challenging and,
given no one-hot labels, also ill-posed as then a grayscale regression problem.
3 Discussion
In this work we present a contrastive learning based unpaired image-label translation framework,
by leveraging domain-specific simulations to generate photorealistic images from synthetic semantic
label-maps. We demonstrate the superior content-preservation performance of our proposed method
across several datasets. Our bidirectional framework as a by-product affords an image segmenter,
which is demonstrated herein to provide approximate segmentations of real images. Note that such
segmentation by our method requires no annotations of real images in training, and it utilizes merely
existing computational simulation outputs. As demonstrated in Figures 2 to 4(b), the unsupervised
losses between label and image representations, i.e. the cycle consistency loss [19] and the contrastive
loss [24], may lead to scene modification and semantic flipping, i.e. the content not being preserved
semantically consistently.
To mitigate these, we leverage simulated images as intermediate image representation to bridge the
9
Real image examples: Cityscapes-Style(a)GTALabel(input)GTAImage (reference)TranslatedCycleGANCUTConPresSimIT(b)(c)GTASimIT-CSSimIT-CSimITTranslatedImage (reference)Figure 5: (a) A visual example of semantic label-maps predicted by SimIT compared with the super-
vised baseline ResNet50, with the label legend shown on the bottom. (b) Visual examples of semantic
maps predicted by SimIT compared with DRN. (c) Quantitative segmentation results on the Cholec-
Seg8k dataset. We report average F1 scores for six label classes over 213 test images over 213 test
images. (d) Quantitative segmentation results on the Cityscapes dataset over 500 test images.
gap between the source and target domains. Among compared methods, ConPres is the closest to our
work, as it also leverages simulated pairs to enforce content preservation. To encourage the generator
encoder to extract content-related features, ConPres uses a unified generator for three translation
tasks: label-to-image, image-to-image, and image-to-label. This, however, complicates the generator's
task, leading to sub-optimal results in the label-to-image direction.
In comparison, we suggest to
utilize task-specific generators, relaxing the constraints of each generator. We accordingly leverage
simulated images as surrogate targets only for loss computation, not as an additional generation task.
During our preliminary experiments, we found out that using pixel-level supervised losses, e.g., L1/L2
loss, to assess content similarity between simulated and translated images is problematic due to the
intrinsic appearance shift, lighting variations, and texture differences between two domains. We also
experimented with employing the discriminator as a feature extractor for computing feature-level
losses, e.g., the perceptual loss [44], but the results were again not satisfactory. In comparison to the
above, the currently utilized patch-based contrastive loss is less affected by any appearance shift, and
can therefore successfully discern and focus on content dissimilarity. Together with our utilization
of adaptive discriminator augmentation and limited discriminator receptive field, the contrasting of
image features from the proposed addition of an image-to-label network has endowed results with
substantial content preservation without degrading image realism.
The above-mentioned challenge of measuring image content similarity during training also reflects
on the evaluation of inference results for structural preservation. For the gaming application experi-
ment, we have employed a pretrained segmentation network to assess the content difference between
simulated and translated images. This approach is only feasible when a large amount of annotated
images from the target domain are available to train a segmentation network. When such segmen-
tation method is not available, choosing surrogate metrics for quantifying structural similarity is a
non-trivial task. Compared to metrics based on pixel-wise difference, SSIM is relatively less sensitive
10
Image (Input)GTResNet50SimITImage (Input)GTDRNSimIT(a)(b)(c)(d)to appearance shifts. Thus, we used SSIM to capture structural differences between laparoscopic im-
ages. However, SSIM is less suitable for ultrasound images due to highly directional artifacts and the
inherent speckle noise. In ultrasound, bone surfaces are major anatomical landmarks which appear
consistently as hyperechoic bands due to their relatively higher acoustic impedance [45]. We thus use
bone surfaces extracted from simulated and translated ultrasound images using a phase-symmetry
based method (described further in the Methods) for assessing structural preservation in ultrasound.
As noted from the qualitative results shown in Figures 2 to 4, SimIT is not capable of recovering
image features, which are not encoded in label-maps, such as lighting and depth information in la-
paroscopy and gaming applications, and the acoustic shadows in the ultrasound application. Auxiliary
scene information, e.g., geometry and material information from the simulation, can be potentially in-
tegrated into SimIT as additional inputs, which can be a potential future direction to further improve
content preservation.
Our proposed method can also have other uses. For instance, in fields where annotated data is
scarce and/or cannot be distributed due to privacy concerns, such as for medical image segmentation,
there have been generative methods [46,47] that produce image and label-map pairs based on random
vectors, e.g., to train supervised methods with large datasets. In such a problem setting, our method
can generate label-conditional images to establish a control on the generated dataset, which can help
in, e.g., creating balanced classes, removing biases in the original dataset, and emphasizing certain
pathology.
4 Methods
Herein we use the notation X z
y to represent the domain of any sample, where X is the representation
from {L:label-map, I:image}, and y and z are, respectively, the style (appearance) and content of such
representation from {S:simulated, R:real}. We aim to learn a generator G : LS
S (cid:55)→ IS
R which maps
a simulated label-map LS
R while preserving the simulation-
consistent semantic content, i.e. (*)S.
S to a real-appearing image I S
S ∈ LS
R ∈ IS
S, I R
Generator G is divided into an encoder GE for extracting content-related features and a decoder
GD for generating target appearance. It is possible to collect many real image examples {I R
R} and
also to simulate label-image pairs (LS
S ), but paired data of the intended source-target translation,
i.e. (LS
S ), is inexistent and very challenging to procure. The unpaired data described above does
not allow for direct supervision in learning G. Existing unpaired methods often change both content
and style together, and the ones that aim content preservation only targets image-to-image translation,
with methods we show herein not to simply extend to label-to-image translation targeted herein. An
overview of the methods can be followed in Figure 6.
R ∈ IR
S, I S
Generative adversarial training. For learning a generator G and its discriminator DI differentiating
images I as real or fake, a non-saturating GAN loss with the R1 regularization [48] is used, i.e. :
GAN({LS
LG
S}, {I R
R }) = EI [log(DI (I R
R ) − 1)] + EL[log DI (G(LS
S))] +
γI
2
EI [(cid:107)∇DI (I R
R )(cid:107)2]
(1)
with the regularization parameter γI .
S ∈ IS
S} during training, which can have paired input label-maps {LS
Label-to-image translation guided by simulation. Herein we propose to leverage information
from simulations to achieve semantic preservation while learning G. To that end, we utilize simu-
S ∈ LS
lated (synthetic) images {I S
S}
generated from the existing simulation framework (Figure 1(a)) and available for training. We encour-
age scene-consistent translations using a contrastive loss [24] on image patches, where corresponding
patches from the source and translated images (positive pairs) are brought closer in a learned feature
space. This space is defined as a projection of the manifold learned by the generator encoder, as
illustrated in Figure 6(b). Meanwhile non-corresponding (arbitrary) patches are treated as negative
samples and hence pushed farther apart in that feature space. Compared to the pixel-wise supervised
losses, contrastive loss is known to be less affected by image appearance. It was utilized in [24] for
unpaired image-to-image translation, i.e. when both source and target are of the same representation
11
Figure 6: (a) Schematic overview of our proposed method SimIT with (b) an illustration of contrastive
loss. (c) Schematic overview of the ablated version SimIT-C, and (d) SimIT-CS. (e) Schematics of
the generator architecture. The number below each convolutional block indicates the channel number.
For G the input channel number is the number of classes (#class) and the output channel number is
the number of image channels (3 for RGB images), for F vice versa.
being in image domain I. However, for label-to-image translation, the source and target representa-
tions differ, i.e. while each pixel in L denotes a label, each pixel in I denotes a color. Thus, directly
contrasting label and image features cannot successfully guide the network for the intended task;
as also seen with the suboptimal performance of our ablation variant SimIT-CS. To alleviate this
problem, herein we leverage available simulated images I S
S as "surrogate" source images. This
implicitly enables the use of existing simulated images I S
S ). Note that these images that require com-
plex rendering operations are used for loss computation during the training of our method, so they
are not needed during inference. This is in contrast to the earlier works [30, 31] where the rendered
images are used as an input to the translation network and are thus complex rendering operations are
still required during inference in real-time.
S ∈ IS
R (cid:55)→ LR
Bidirectional label-image translation framework. To extract domain-consistent feature rep-
resentations, we propose to employ an additional generator F : IR
S with F (*) = F D(F E(*))
consisting of an encoder F E and a decoder F D, acting in the opposite direction for translating I → L,
i.e. mapping an image back to a label-map. Unlike [24] which contrasts features from GE operating
on the source domain L with labels, we propose to contrast the features of the segmenter encoder F E
trained to extract features for inferring semantic content from images, and it is thus more suited for
comparing image similarity.
Patch-based contrastive loss. For an input image x and its translated image ˆx = GD(GE(x)),
j (F E(ˆx)), with a light-weight projection head
we contrast feature maps zF
H G
as a query feature
j
at a given spatial location s within the feature map ˆzF
j of the translated image, the corresponding
input feature zF,s+
at the same location (denoted by +) is considered as a positive sample, while
j
any other input feature zF,s−
at arbitrary locations act as negative samples. Noise contrastive loss
(NCE) [24] for the j-th layer feature can then be computed as the sum of contrastive loss for several
j (F E(x)) and ˆzF
j mapping the features of j-th hidden layer in F E for training G. Given ˆzF,s
j = H G
j = H G
j
12
(e) Generator Architecture!I!"D!Real/Fake?I!!L##G$G%L→IL""lNCEL""&L"!D"L""I!!F$F%I→LReal/Fake?I""lNCEL""I""lNCEL""L!"#I!!lNCEI!!L$%!S+SS−S+(b) Contrastive LossF$H&,...,)*(a) SimIT(d) SimIT-CS(c) SimIT-C#class3...6412825625625625625625625625612864643#classesdown/up sampling blocksresidual blocksskip connectionsinput layeroutput layerL##L##Sj at randomly sampled spatial locations as follows:
LNCE,j(zF
j , ˆzF
j ) =
Sj
(cid:88)
s=1
LCE(ˆzF,s
j
, zF,s+
j
, zF,s−
j
)
with
LCE(z, z+, z−) = − log
(cid:20)
exp(d(z, z+)/τ )
exp(d(z, z+)/τ ) + (cid:80)
z− exp(d(z, z−)/τ )
(cid:21)
,
(2)
(3)
where z is the feature vector of query; z+ and z− are the feature vectors of positive and negative
samples, respectively; d(z1, z2) is a distance metric between two latent vectors (herein the cosine
distance); and τ is a temperature parameter controlling the smoothing of joint likelihoods.
We herein propose to leverage the simulated image domain as surrogate source domain by comput-
S paired
S)) and simulated image I S
ing contrastive loss between the translated image ˆI S
to LS
R = GD(GE(LS
S, i.e. :
LF
CL
(cid:0){LS
S}(cid:1) = EL
LNCE,j
(cid:16)
H G
j
J
(cid:88)
j=1
(cid:0)F E(I S
S )(cid:1), H G
j
(cid:0)F E( ˆI S
R)(cid:1)(cid:17)
(4)
computed over J feature layers to contrast information at different resolutions.
For a more expressive and distinctive label space, we herein encode label-maps as one-hot repre-
sentations, which prevents misinterpretation of categorical labels suitable for class separation as pixel
intensities for regression.
Learning image-to-label translation using cycle consistency loss.
In this work, we treat and
train the image-to-label translator F to perform pixel-wise semantic labeling task, known as image
segmentation. Based on our cyclic framework, we use the existing label-to-image mapping network G
to assess such segmentation accuracy, hence also obviating a need for pixel-wise annotations of real
images, which are difficult to procure. With that, we compute a cycle reconstruction loss between
R and the image reconstructed from the predicted label-map ̃I R
a real image I R
R )). Image
similarity is measured using the NCE loss, as it is less sensitive to appearance shifts, as follows
R = G(F (I R
LCYC
(cid:0){I R
R }(cid:1) = EL
LNCE,j
(cid:16)
H F
j
J
(cid:88)
j=1
(cid:0)F E(I R
R )(cid:1), H F
j
(cid:0)F E( ̃I R
R )(cid:1)(cid:17)
(5)
with the projection head H F
j
for the label representation direction, we employ a GAN training objective LF
to the original direction G, but with a different regularization parameter γL.
for the j-th layer feature of encoder F . For F and its discriminator DL
S}) similar
GAN({I R
R }, {LS
Training objective.
A schematic illustration of the proposed method SimIT summarizing the
above components is shown in Figure 6(a). Network training is performed by alternately optimizing
the following two losses:
LG({LS
LF({LS
S}, {I R
S}, {I R
R }) = LG
R }) = LF
GAN(LS
GAN(LS
S, I R
S, I R
R ) + λG * LF
CL(LS
S)
R ) + λF * LCYC(I R
R )
(6)
(7)
with the loss weighting parameters λG and λF .
We compare our full model against the ablated variant SimIT-C by excluding the inverse mapping
LF with the cyclic loss, as seen in Figure 6(c). Further ablating the paired simulation images yield
the variant SimIT-CS that instead uses the labels for contrasting (Figure 6(d)). For both ablated
variants, encoder GE is used for computing the contrastive loss LG
CL.
Network architecture. We build our method on the StyleGAN2 framework [12] for adversarial
training. We accordingly use a ResNet-based generator architecture [24] with four down- and up-
sampling layers and 6 residual blocks (Figure 6(d)). We use skip connections between the down-
13
and upsampling layers to avoid information loss. For the image synthesis decoder GE we use weight
demodulation [12]
w(cid:48)(cid:48)
ijk =
(cid:113)(cid:80)
w(cid:48)
ijk
i,k w(cid:48)
ijk2 + (cid:15)
with w(cid:48)
ijk = si * wijk
(8)
where wijk is the convolution weight from the i-th input feature map to the j-th output feature
map; k denotes the spatial footprint of the convolution; and the multiplier si is set to 1. To provide
stochastic means for texture synthesis, especially important to generate the noisy speckle patterns
of ultrasound images, we perturb each feature layer with an additive Gaussian (noise) image scaled
by learned weights following [11]. The output layer for G and F is linear and sigmoid, respectively.
We use ReLU activation for all intermediate layers. For both DI and DL, we adopt the feedforward
discriminator architecture in [12]. In training we use randomly cropped image patches, which enables
the discriminator to ignore global scene differences between simulation and real domains.
Experimental data utilization.
LaparoSim consists of 1850 synthetic laparoscopic image-label
pairs simulated from a 3D abdominal model. We randomly split this data into train-validation-test
sets with 80-10-10% ratio. Style-C consist of 2100 images from the Cholec dataset. We excluded all
frames with surgical tools, since surgical tools are not handled in our simulation. For Style-C testing,
we used the 213 frames that has ground-truth labels provided in [43], and the remaining frames were
used as Style-C training data. Style-H consists of 2262 frames in total, which was randomly split in
80-20% ratio, respectively, for training and testing. Some Style-H images had major blurring artifacts
due to camera motion, so we manually removed any blurry frames, since we treat the frames separately
without any temporal information and such temporal effect is also not represented in the label-maps.
All the images were resized to 256 × 432.
USSim consists of 6669 simulated image-label pairs, which we resized to 256 × 354 and randomly
split into training-validation-test sets with 80-10-10% ratio. GE-E10 style consists of 2328 ultrasound
images from 24 patients. We randomly selected images from 20 patients for training and 4 for testing,
resulting in 1902 training images and 426 test images.
GTA dataset [39] contains 24 966 image-label pairs. We followed its original train-validation-test
split. Cityscapes dataset [40] contains 3475 image-label pairs of street scenes from German cities. We
used its original training set for our network training, and its validation set with ground-truth labels
for testing our semantic segmentation output. As in [24], we resized all the images to 256 × 256.
Implementation. We implemented our method in PyTorch [49]. We used Adam [50] optimizer
with parameters β = (0, 0.99) and a learning rate of 10−3 for G and 10−4 for F . We applied adaptive
discriminator augmentation using its default hyperparameters [51]. The generator is trained on image
patches of size 256×256 while the discriminator receptive field is 64×64. Our network training involves
alternating updates of G and F . We trained our models for 400 epochs. To compute the contrastive
loss, we extract features from the four (stride-2) convolution layers in the encoder at 256 locations
randomly selected for each mini-batch. We use a two-layer MLP with 256 units at each layer and
ReLU activation for H G, and the identity mapping for H F. NCE temperature parameter τ is set to
0.07 following [24]. Generator loss weighting λG is set to 5 for all the experiments. λF is set to 1 for the
laparoscopy and ultrasound, and 0.5 for the gaming experiment. R1 regularization parameters γI and
γL are set to 0.01 and 1.0, respectively, for all the experiments. For all compared methods we used their
public implementations provided by the corresponding authors with their default hyperparameters.
Evaluation metrics. We use the following for quantitative evaluation:
• Image realism. Fr ́echet inception distance (FID) [52] is common for assessing the quality of images
generated by GANs, by comparing the feature distribution between two sets of images, herein real
and translated, using feature vectors of an ImageNet-pretrained Inception network. Kernel inception
distance (KID) [53] is an alternative metric to evaluate GAN performance. KID is computed as the
squared maximum mean-discrepancy between the features of Inception network. KID is then not
biased by the number of samples used, unlike FID.
• Content preservation. For laparoscopy images, content preservation is assessed using structural
similarity between simulated and translated images, quantified via Structural similarity index (SSIM)
14
(μ2
x+μ2
x+σ2
y+c1)(σ2
computed as SSIM(x, y)= (2μxμy+c1)(2σxy+c2)
y+c2) with regularization constants c1 and c2, local intensity
means μx and μy, local standard deviations σx and σy, and σxy being covariance between x and y.
To compute this metric, we used the python package scikit-image with its default parameters. For
ultrasound images, due to potential artifacts, typical speckle noise, and a lack of sharp edges, we
instead used the similarity of bone surfaces for assessing structure preservation. To that end, we
extracted bone surfaces from each image using [41]. This method is based on local phase symmetry
in B-mode images, and operates by aggregating images filtered by log-Gabor kernels with different
orientations r and scales m defined as
(cid:32)
Gr,m(ω, φ) = exp
−
log(ω/ω0)2
2 log(κm/ω0)2 −
(φ − φr)2
2σ2
φ
(cid:33)
,
(9)
where parameters φr, ω0, κm, and σφ define the filter orientation, center frequency, scaling factor,
and angular bandwidth of the employed filters, respectively. Following [45], we set κm/ω0 = 0.25 and
φr = [ 1
6 π]. To assess preservation, we report intersection over union (IoU) of pixels belonging
to bone surfaces extracted from corresponding simulated and translated images. We exclude from
computations the top 25 pixels of images corresponding to skin reflections.
6 π, 5
6 π, 3
• Segmentation. For the laparoscopic CholecSeg8k dataset, we trained a semantic segmentation
network with ResNet50 architecture initialized with weights pretrained on the ImageNet using the
pytorch segmentation library [54], following the training settings from a public implementation on the
Kaggle repository of this dataset. We randomly picked video24 for validation, video{09,17,26,28,43} for
testing, and the rest for training. We report F1 score for six classes that are also in our simulation. For
the Cityscapes dataset in the gaming application, we trained a segmentation network suggested for this
dataset in [24], with the DRN-D22 architecture [42] at 256×128 resolution with the default parameters
from its public implementation. Following [24], we report Cityscapes semantic segmentation results
using mean average precision (mAP) over the classes; pixel-wise accuracy (pixAcc) as the percentage
of correctly classified pixels; and average class accuracy (classAcc) over given classes.
Appendix
Additional sample images of image-to-label and label-to-image translations are shown in Figures 7
and 8, respectively.
References
[1] M. Masuch and N. R ̈ober, "Game graphics beyond realism: Then, now and tomorrow," in Level
UP: Digital Games Research Conference. DIGRA, Faculty of Arts, University of Utrecht, 2004.
[2] A. Tewari, O. Fried, J. Thies, V. Sitzmann, S. Lombardi, K. Sunkavalli, R. Martin-Brualla,
T. Simon, J. Saragih, M. Niessner et al., "State of the art on neural rendering," in Computer
Graphics Forum, vol. 39, no. 2, 2020, pp. 701–727.
[3] A. F. Frangi, S. A. Tsaftaris, and J. L. Prince, "Simulation and synthesis in medical imaging,"
IEEE Transactions on Medical Imaging (TMI), vol. 37, no. 3, pp. 673–679, 2018.
[4] M. A. ElHelw, B. P. Lo, A. Darzi, and G.-Z. Yang, "Real-time photo-realistic rendering for
surgical simulations with graphics hardware," in International Workshop on Medical Imaging
and Virtual Reality, 2004, pp. 346–352.
[5] B. Burger, S. Bettinghausen, M. Radle, and J. Hesser, "Real-time GPU-based ultrasound simu-
lation using deformable mesh models," IEEE Transactions on Medical Imaging (TMI), vol. 32,
no. 3, pp. 609–618, 2013.
15
[6] O. Mattausch, M. Makhinya, and O. Goksel, "Realistic ultrasound simulation of complex surface
models using interactive monte-carlo path tracing," in Computer Graphics Forum, vol. 37, no. 1,
2018, pp. 202–213.
[7] M. Pharr, W. Jakob, and G. Humphreys, Physically based rendering: From theory to implemen-
tation, 2016.
[8] T. Weyrich, J. Lawrence, H. P. Lensch, S. Rusinkiewicz, T. Zickler et al., "Principles of appearance
acquisition and representation," Foundations and Trends® in Computer Graphics and Vision,
vol. 4, no. 2, pp. 75–191, 2009.
[9] L. Zhang, V. Vishnevskiy, and O. Goksel, "Deep network for scatterer distribution estimation for
ultrasound image simulation," IEEE Transactions on Ultrasonics, Ferroelectrics, and Frequency
Control (TUFFC), vol. 67, no. 12, pp. 2553–2564, 2020.
[10] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and
Y. Bengio, "Generative adversarial nets," Advances in Neural Information Processing Systems
(NeurIPS), vol. 27, 2014.
[11] T. Karras, S. Laine, and T. Aila, "A style-based generator architecture for generative adversarial
networks," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019, pp.
4401–4410.
[12] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila, "Analyzing and improving
the image quality of stylegan," in IEEE Conference on Computer Vision and Pattern Recognition
(CVPR), 2020, pp. 8110–8119.
[13] T. Karras, M. Aittala, S. Laine, E. H ̈ark ̈onen, J. Hellsten, J. Lehtinen, and T. Aila, "Alias-free
generative adversarial networks," Advances in Neural Information Processing Systems (NeurIPS),
vol. 34, pp. 852–863, 2021.
[14] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros, "Image-to-image translation with conditional ad-
versarial networks," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR),
2017, pp. 1125–1134.
[15] T. Park, M.-Y. Liu, T.-C. Wang, and J.-Y. Zhu, "Semantic image synthesis with spatially-adaptive
normalization," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019,
pp. 2337–2346.
[16] T.-C. Wang, M.-Y. Liu, J.-Y. Zhu, A. Tao, J. Kautz, and B. Catanzaro, "High-resolution image
synthesis and semantic manipulation with conditional gans," in IEEE Conference on Computer
Vision and Pattern Recognition (CVPR), 2018, pp. 8798–8807.
[17] X. Liu, G. Yin, J. Shao, X. Wang et al., "Learning to predict layout-to-image conditional con-
volutions for semantic image synthesis," Advances in Neural Information Processing Systems
(NeurIPS), vol. 32, 2019.
[18] L. Jiang, C. Zhang, M. Huang, C. Liu, J. Shi, and C. C. Loy, "Tsit: A simple and versatile frame-
work for image-to-image translation," in European Conference on Computer Vision (ECCV),
2020, pp. 206–222.
[19] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros, "Unpaired image-to-image translation using cycle-
consistent adversarial networks," in IEEE International Conference on Computer Vision (ICCV),
2017, pp. 2223–2232.
[20] Z. Yi, H. Zhang, P. Tan, and M. Gong, "Dualgan: Unsupervised dual learning for image-to-
image translation," in IEEE International Conference on Computer Vision (ICCV), 2017, pp.
2849–2857.
16
[21] X. Huang, M.-Y. Liu, S. Belongie, and J. Kautz, "Multimodal unsupervised image-to-image
translation," in European Conference on Computer Vision (ECCV), 2018, pp. 172–189.
[22] M.-Y. Liu, T. Breuel, and J. Kautz, "Unsupervised image-to-image translation networks," Ad-
vances in Neural Information Processing Systems (NeurIPS), vol. 30, 2017.
[23] J. Kim, M. Kim, H. Kang, and K. Lee, "U-gat-it: Unsupervised generative attentional net-
works with adaptive layer-instance normalization for image-to-image translation," arXiv preprint
arXiv:1907.10830, 2019.
[24] T. Park, A. A. Efros, R. Zhang, and J.-Y. Zhu, "Contrastive learning for unpaired image-to-
image translation," in European Conference on Computer Vision (ECCV). Springer, 2020, pp.
319–345.
[25] C. Zheng, T.-J. Cham, and J. Cai, "The spatially-correlative loss for various image translation
tasks," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021, pp.
16 407–16 417.
[26] A. Shrivastava, T. Pfister, O. Tuzel, J. Susskind, W. Wang, and R. Webb, "Learning from simu-
lated and unsupervised images through adversarial training," in IEEE Conference on Computer
Vision and Pattern Recognition (CVPR), 2017, pp. 2107–2116.
[27] S. Vitale, J. I. Orlando, E. Iarussi, and I. Larrabide, "Improving realism in patient-specific ab-
dominal ultrasound simulation using CycleGANs," International Journal of Computer Assisted
Radiology and Surgery (IJCARS), vol. 15, no. 2, pp. 183–192, 2020.
[28] J. Hoffman, E. Tzeng, T. Park, J.-Y. Zhu, P. Isola, K. Saenko, A. Efros, and T. Darrell, "Cy-
cada: Cycle-consistent adversarial domain adaptation," in International Conference on Machine
Learning (ICML), 2018, pp. 1989–1998.
[29] L. Sharan, G. Romano, S. Koehler, H. Kelm, M. Karck, R. De Simone, and S. Engelhardt,
"Mutually improved endoscopic image synthesis and landmark detection in unpaired image-to-
image translation," IEEE Journal of Biomedical and Health Informatics, vol. 26, no. 1, pp. 127–
138, 2021.
[30] D. Tomar, L. Zhang, T. Portenier, and O. Goksel, "Content-preserving unpaired translation
from simulated to realistic ultrasound images," in International Conference on Medical Image
Computing and Computer-Assisted Intervention (MICCAI). Springer, 2021, pp. 659–669.
[31] S. R. Richter, H. A. Al Haija, and V. Koltun, "Enhancing photorealism enhancement," IEEE
Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2022.
[32] Y. Li, C. Fang, J. Yang, Z. Wang, X. Lu, and M.-H. Yang, "Universal style transfer via feature
transforms," Advances in Neural Information Processing Systems (NeurIPS), vol. 30, 2017.
[33] F. Luan, S. Paris, E. Shechtman, and K. Bala, "Deep photo style transfer," in IEEE Conference
on Computer Vision and Pattern Recognition (CVPR), 2017, pp. 4990–4998.
[34] X. Huang and S. Belongie, "Arbitrary style transfer in real-time with adaptive instance normal-
ization," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
[35] X. Li, S. Liu, J. Kautz, and M.-H. Yang, "Learning linear transformations for fast image and
video style transfer," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR),
2019, pp. 3809–3817.
[36] M. Harders, Surgical scene generation for virtual reality-based training in medicine.
Springer
Science & Business Media, 2008.
[37] S. Tuchschmid, "High fidelity surgical simulator for hysteroscopy," Ph.D. dissertation, ETH
Zurich, 2010.
17
[38] A. P. Twinanda, S. Shehata, D. Mutter, J. Marescaux, M. De Mathelin, and N. Padoy, "Endonet:
a deep architecture for recognition tasks on laparoscopic videos," IEEE Transactions on Medical
Imaging (TMI), vol. 36, no. 1, pp. 86–97, 2016.
[39] S. R. Richter, V. Vineet, S. Roth, and V. Koltun, "Playing for data: Ground truth from computer
games," in European Conference on Computer Vision (ECCV), 2016, pp. 102–118.
[40] M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and
B. Schiele, "The cityscapes dataset for semantic urban scene understanding," in IEEE Conference
on Computer Vision and Pattern Recognition (CVPR), 2016.
[41] I. Hacihaliloglu, R. Abugharbieh, A. J. Hodgson, and R. N. Rohling, "Bone surface localization in
ultrasound using image phase-based features," Ultrasound in Medicine & Biology, vol. 35, no. 9,
pp. 1475–1487, 2009.
[42] F. Yu, V. Koltun, and T. Funkhouser, "Dilated residual networks," in IEEE Conference on
Computer Vision and Pattern Recognition (CVPR), 2017, pp. 472–480.
[43] W.-Y. Hong, C.-L. Kao, Y.-H. Kuo, J.-R. Wang, W.-L. Chang, and C.-S. Shih, "Cholecseg8k:
a semantic segmentation dataset for laparoscopic cholecystectomy based on cholec80," arXiv
preprint arXiv:2012.12453, 2020.
[44] J. Johnson, A. Alahi, and L. Fei-Fei, "Perceptual losses for real-time style transfer and super-
resolution," in European Conference on Computer Vision (ECCV), 2016, pp. 694–711.
[45] F. Ozdemir, C. Tanner, and O. Goksel, "Delineating bone surfaces in b-mode images constrained
by physics of ultrasound propagation," arXiv preprint arXiv:2001.02001, 2020.
[46] G. Kwon, C. Han, and D.-s. Kim, "Generation of 3D brain mri using auto-encoding generative
adversarial networks," in International Conference on Medical Image Computing and Computer
Assisted Intervention(MICCAI), 2019, pp. 118–126.
[47] W. H. Pinaya, P.-D. Tudosiu, J. Dafflon, P. F. Da Costa, V. Fernandez, P. Nachev, S. Ourselin,
and M. J. Cardoso, "Brain imaging generation with latent diffusion models," in MICCAI Work-
shop Deep Generative Models, 2022, pp. 117–126.
[48] L. Mescheder, A. Geiger, and S. Nowozin, "Which training methods for GANs do actually con-
verge?" in International Conference on Machine Learning (ICML), 2018, pp. 3481–3490.
[49] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin,
N. Gimelshein, L. Antiga et al., "Pytorch: An imperative style, high-performance deep learn-
ing library," preprint arXiv:1912.01703, 2019.
[50] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization," in International Con-
ference on Learning Representations (ICLR), 2015, pp. 1–15.
[51] T. Karras, M. Aittala, J. Hellsten, S. Laine, J. Lehtinen, and T. Aila, "Training generative
adversarial networks with limited data," Advances in Neural Information Processing Systems
(NeurIPS), vol. 33, pp. 12 104–12 114, 2020.
[52] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter, "Gans trained by a two
time-scale update rule converge to a local nash equilibrium," Advances in Neural Information
Processing Systems (NeurIPS), vol. 30, 2017.
[53] M. Bi ́nkowski, D. J. Sutherland, M. Arbel, and A. Gretton, "Demystifying mmd gans," arXiv
preprint arXiv:1801.01401, 2018.
[54] P.
Iakubovskii, "Segmentation models pytorch," https://github.com/qubvel/segmentation
models.pytorch, 2019.
18
Figure 7: Additional qualitative label-to-image translation results for the laparoscopic simulation ap-
plication Style-C (top three rows) and Style-H (next three rows), the ultrasound simulation application
(next thre rows), and the gaming application (last three rows).
19
LaparoSim Style-CLaparoSim Style-HGTA CityscapesUSSim GE-E10TranslatedCycleGANCUTSimIT-CSimIT-CSSimITConPresSimulatedSimulatedImage (ref)Label (input)R ), reconstructed image G(F (I R
Figure 8: Additional image-to-label translation results of SimIT with the input real image I R
R , trans-
lated result F (I R
R )), and ground truth label-maps for reference; for
(a) in-house laparoscopic, (b) CholecSeg8k, and (c) Cityscapes images. No ground-truth annotation
is available for the dataset in (a). Note that although the reconstructed images are generated from
translated images, they are ordered in-reverse to place the same representations with the input and
GT next to each other for easier visual comparison.
20
(a)(c)Image(input)SimITReconstructedTranslatedImage(input)SimITReconstructedTranslated(b)Label(GT)Image(input)SimITReconstructedTranslatedLabel(GT) |
|
http://arxiv.org/abs/2302.10692v1 | 2023-02-21T14:22:01 | 2023-02-21T14:22:01 | On Inductive Biases for Machine Learning in Data Constrained Settings | Learning with limited data is one of the biggest problems of machine
learning. Current approaches to this issue consist in learning general
representations from huge amounts of data before fine-tuning the model on a
small dataset of interest. While such technique, coined transfer learning, is
very effective in domains such as computer vision or natural langage
processing, it does not yet solve common problems of deep learning such as
model interpretability or the overall need for data. This thesis explores a
different answer to the problem of learning expressive models in data
constrained settings: instead of relying on big datasets to learn neural
networks, we will replace some modules by known functions reflecting the
structure of the data. Very often, these functions will be drawn from the rich
literature of kernel methods. Indeed, many kernels can reflect the underlying
structure of the data, thus sparing learning parameters to some extent. Our
approach falls under the hood of "inductive biases", which can be defined as
hypothesis on the data at hand restricting the space of models to explore
during learning. We demonstrate the effectiveness of this approach in the
context of sequences, such as sentences in natural language or protein
sequences, and graphs, such as molecules. We also highlight the relationship
between our work and recent advances in deep learning. Additionally, we study
convex machine learning models. Here, rather than proposing new models, we
wonder which proportion of the samples in a dataset is really needed to learn a
"good" model. More precisely, we study the problem of safe sample screening,
i.e, executing simple tests to discard uninformative samples from a dataset
even before fitting a machine learning model, without affecting the optimal
model. Such techniques can be used to prune datasets or mine for rare samples. | [
"Grégoire Mialon"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10692v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10692v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | 3
2
0
2
b
e
F
1
2
]
G
L
.
s
c
[
1
v
2
9
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Préparée à l'École Normale Supérieure
On Inductive Biases for Machine Learning in Data
Constrained Settings
Soutenue par
Grégoire Mialon
Le 19 Janvier 2022
École doctorale no386
École Doctorale De Sci-
ences Mathématiques de
Paris
Spécialité
Mathématiques
Appliquées
Composition du jury :
Gabriel Peyré
Researcher, CNRS
Alexandre Gramfort
Researcher, INRIA
Michael Bronstein
Professor, Oxford/Twitter
Pascal Frossard
Professor, EPFL
Rapporteur et Prési-
dent du jury
Rapporteur
Examinateur
Examinateur
Anna Korba
Assistant Professor, ENSAE/CREST
Examinatrice
Alexandre d'Aspremont
Researcher, CNRS
Julien Mairal
Researcher, INRIA
Directeur de thèse
Directeur de thèse
Abstract
Learning with limited data is one of the biggest problems of deep learning. Current, popular
approaches to this issue consist in training models on huge amounts of data, labelled or not,
before re-training the model on a smaller dataset of interest from the same modality. Intuitively,
this technique allows the model to learn a general representation for some kind of data first,
such as images. Then, fewer data should be required to learn a specific task for this particular
modality. While this approach coined as "transfer learning" is very effective in domains such
as computer vision or natural langage processing, it does not solve common problems of deep
learning such as model interpretability or the overall need for data. This thesis explores a
different answer to the problem of learning expressive models in data constrained settings.
Instead of relying on big datasets to learn the parameters of a neural network, we will replace
some of them by known functions reflecting the structure of the data. Very often, these
functions will be drawn from the rich litterature of kernel methods. Indeed, many kernels
can be interpreted, and/or allow for learning with few data. Our approach falls under the
hood of "inductive biases", which can be defined as hypothesis on the data at hand restricting
the space of models to explore during learning. In the first two chapters of the thesis, we
demonstrate the effectiveness of this approach in the context of sequences, such as sentences in
natural language or protein sequences, and graphs, such as molecules. We also highlight the
relationship between our work and recent advances in deep learning. The last chapter of this
thesis focuses on convex machine learning models. Here, rather than proposing new models, we
wonder which proportion of the samples in a dataset is really needed to learn a "good" model.
More precisely, we study the problem of safe sample screening, i.e, executing simple tests to
discard uninformative samples from a dataset even before fitting a machine learning model,
without affecting the optimal model. Such techniques can be used to compress datasets or mine
for rare samples.
i
Résumé
Apprendre à partir de données limitées est l'un des plus gros problèmes du deep learning.
Les approches courantes et populaires de cette question consistent à entraîner un modèle sur
d'énormes quantités de données, étiquetées ou non, avant de réentraîner le modèle sur un
ensemble de données d'intérêt, plus petit, appartenant à la même modalité. Intuitivement,
cette technique permet au modèle d'apprendre d'abord une représentation générale pour un
certain type de données, telles que des images. Moins de données seront ensuite nécessaires
pour apprendre une tâche spécifique pour cette modalité particulière. Bien que cette approche
appelée « apprentissage par transfert » soit très efficace dans des domaines tels que la vision
par ordinateur ou le traitement du langage naturel, elle ne résout pas les problèmes courants
du deep learning tels que l'interprétabilité des modèles ou le besoin global en données. Cette
thèse explore une réponse différente au problème de l'apprentissage de modèles expressifs dans
des contextes où les données sont plus rares. Au lieu de s'appuyer sur de grands ensembles de
données pour apprendre les paramètres d'un réseau de neurones, nous remplacerons certains de
ces paramètres par des fonctions mathématiques connues reflétant la structure des données.
Très souvent, ces fonctions seront puisées dans la riche littérature des méthodes à noyau. En
effet, de nombreux noyaux peuvent être interprétés, et/ou permettre un apprentissage avec peu
de données. Notre approche s'inscrit dans le cadre des « biais inductifs », qui peuvent être
définis comme des hypothèses sur les données disponibles restreignant l'espace des modèles à
explorer lors de l'apprentissage. Dans les deux premiers chapitres de la thèse, nous démontrons
l'efficacité de cette approche dans le cadre de séquences, telles que des phrases en langage naturel
ou des séquences protéiques, et de graphes, tels que des molécules. Nous soulignons également la
relation entre notre travail et les progrès récents du deep learning. Le dernier chapitre de cette
thèse se concentre sur les modèles d'apprentissage automatique convexes. Ici, plutôt que de
proposer de nouveaux modèles, nous nous demandons quelle proportion des échantillons d'un jeu
de données est vraiment nécessaire pour apprendre un « bon » modèle. Plus précisément, nous
étudions le problème du filtrage sûr des échantillons, c'est-à-dire l'exécution de tests simples afin
d'éliminer les échantillons non informatifs d'un ensemble de données avant même d'entraîner
un modèle d'apprentissage automatique, sans affecter le modèle optimal. De telles techniques
peuvent être utilisées pour compresser des jeux de données ou extraire des échantillons rares.
ii
À mes grands-parents
iii
Remerciements
Comme tout un chacun, j'ai pour habitude de lire les remerciements d'une thèse avec une
attention teintée d'attentes. Y figurerai-je, dans ces remerciements ? Vais-je y glaner des détails
personnels sur l'impétrant, aujourd'hui chercheur reconnu ? Non, les remerciements ne sont
pas une tâche à prendre à la légère.
Mon aventure dans le monde de l'intelligence artificielle a commencé grâce à Jean Ponce et
Jean-Philippe Vert, qui m'ont gentiment permis de suivre le master recherche Mathématiques,
Vision, Apprentissage, et accepté de discuter avec moi de l'opportunité de faire une thèse.
J'ai ensuite eu la chance d'être encadré par Julien Mairal et Alexandre d'Aspremont. Ceux-ci
m'ont bien souvent prodigué le conseil qui débloquait. Je veux ici les remercier sincèrement
pour leur confiance, et pour avoir su créer un climat de travail serein durant ces trois années.
Je ne me suis jamais senti esseulé.
Ce doctorat a été effectué au sein de l'Institut national de recherche en informatique et
en automatique (Inria), encore trop peu connu en France, dont la mission est le développe-
ment de la recherche et de la valorisation en sciences et techniques de l'information et de la
communication. L'Inria, en particulier le centre de Paris, m'a fourni un environnement de
travail plus que confortable. Je pense ainsi à l'efficacité des démarches administrative, à la
prévenance de la célèbre équipe communication, celle toute teintée de patience d'Éric Fleury et,
plus prosaïquement, au confort de mon bureau.
Plus précisément, j'ai fait partie de deux équipes de l'Inria : Sierra, à Paris, et Thoth,
à Grenoble. J'ai été magnifiquement bien accueilli dans les deux. Sierra, c'est l'éclectisme
scientifique, mais aussi des discussions quotidiennes. Je veux ici remercier Francis Bach pour
l'attention qu'il porte au bien-être des doctorants. Thoth, c'est la chaleur de l'équipe et,
évidemment, les montagnes. J'aimais mes visites à Grenoble. Merci aux assistantes des deux
équipes, Hélène Bessin-Rousseau et Nathalie Gillot, pour leur gentillesse et leur patience, qui
m'ont grandement facilité la vie.
Cette thèse n'aurait pas été possible sans financement, apporté dans mon cas par l'European
Research Council (ERC). Je vais ici profiter de la gourmandise avec laquelle ces remerciements
seront peut-être parcourus pour détailler ce système de financement méritant d'être connu
au-delà du monde de la recherche scientifique, et qui m'a permis de mener ma recherche
sereinement et librement. L'ERC est un organe de l'Union européenne chargé de coordonner les
efforts de la recherche entre les États membres de l'Union, et la première agence de financement
pan-européenne pour une « recherche à la frontière de la connaissance ». Elle propose sur
concours différents financements. Pour un jeune chercheur souhaitant se lancer sur ses propres
thématiques, l'ERC propose une Starting Grant : 1,5 millions d'euros sur 5 ans, avec une très
grande liberté d'utilisation. L'ERC Starting Grant sur laquelle j'ai été financé a été obtenue
dans mon cas par Julien Mairal en 2016 (Projet SOLARIS). J'ai donc, durant ces trois ans,
iv
toujours eu les moyens de participer à une conférence, une école d'été, ou plus simplement me
rendre à Grenoble : là encore, tous les chercheurs n'ont pas cette chance.
La présente thèse a bénéficié du supercalculateur Jean Zay. Merci à ses équipes pour son
aide et sa gestion, offrant un outil à la fois puissant et simple d'utilisation.
Il me reste à présent à remercier celles et ceux dont j'ai eu la chance de croiser le chemin, en
demandant par avance pardon à mon lecteur en cas d'oubli. Merci, donc, à Adrien, Alessandro,
Francis, Pierre et Umut pour Sierra, et à Justin pour Willow : votre porte était toujours ouverte
pour moi et mes diverses interrogations. J'ai une pensée particulière pour Jean-Paul Lomond,
dont je garde l'image d'un scientifique inspirant et qui avait le souci d'expliquer au public les
grands enjeux de son domaine. Merci à Ghislain, Loïc, et Xavier pour avoir abondamment
conseillé le quasi-novice que j'étais sur le développement. Merci à mes comparses de bureau,
Benjamin, Manon, Mathieu, Radu, et Thomas : vous avez su endurer mes digressions. Merci à
Alex, Alexandre, Antoine, Bruno, Hadrien, Julia, Lenaic, Loucas&Raphaël, Margaux, Rémi,
Robin, Ronan, Thomas, Ulysse, Vivien, Yana, Yann, bref, à ma génération de doctorants et
ceux du dessus, pour les grands moments scientifiques et moins scientifiques que nous avons
partagé. Merci à Luca, notre pièce rapportée de Dyogene et à Arthur, le grand frère de thèse
que j'ai connu en dehors du laboratoire. Merci à Antoine, Bertille, Boris, Céline, Elliot, Eloïse,
Etienne, Gaspard, Gautier, Oumayma, Pierre-Cyril, Pierre-Louis, Ricardo, Thomas, Wilson, et
Yann, la génération suivante, avec laquelle j'aurais aimé passer plus de temps. Merci à Alberto,
Dexiong, Mathilde, Thomas, et Valentin, les compagnons de toujours à Grenoble, et l'une
de mes motivations pour y retourner. Merci à Alexander, Alexandre, Andrei, Daan, Florent,
Houssam, Juliette, Konstantin, Margot, Michael, Mikita, Minttu, Pauline, Theo, et Vladyslav :
c'était un plaisir de vous voir à Grenoble et Montbonnot. Merci au jury, Alexandre Gramfort
et Gabriel Peyré pour les rapporteurs, Michael Bronstein, Pascal Frossard, et Anna Korba pour
les examinateurs : c'était une fierté de vous présenter mon travail et un plaisir d'en discuter.
Je remercie enfin ceux qui m'ont entouré ou m'entourent encore de leur amitié et de leur
amour. Je pense en particulier à ma famille, ainsi qu'à celle qui est aujourd'hui mon étoile.
Paris, le 27 janvier 2022
v
Contents
1 Introduction
1.1 The state of machine learning . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Past and present of machine learning . . . . . . . . . . . . . . . . . . . .
1.1.2 Generalization and other problems of deep learning . . . . . . . . . . . .
1.1.3 A promising but limited answer to the generalization problem: transfer
learning from pre-trained models . . . . . . . . . . . . . . . . . . . . . .
1.1.4 Motivation: inductive biases, or another solution to the generalization
problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.1 Kernel methods.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.2 Transformers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Outline of the thesis and contributions . . . . . . . . . . . . . . . . . . . . . . .
1.2 Preliminaries
2 Embedding Sets of Features with Optimal Transport Kernels
2.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Proposed Embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . .
2.3.2 Optimal Transport Embedding and Associated Kernel
2.3.3 From infinite-dimensional kernel embedding to finite dimension . . . . .
2.3.4 Unsupervised and Supervised Learning of Parameter z . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.5 Extensions
2.4 Relation between our Embedding and Self-Attention . . . . . . . . . . . . . . .
2.5 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.1 Datasets, Experimental Setup and Baselines . . . . . . . . . . . . . . . .
2.5.2 Results and discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.1 Proof of Lemma 2.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
for multiple references . . . . . . . . .
2.7.2 Relationship between W2 and W z
2
2.8 Additional Experiments and Setup Details . . . . . . . . . . . . . . . . . . . . .
2.8.1 Protein fold recognition . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8.2 Detection of chromatin profiles . . . . . . . . . . . . . . . . . . . . . . .
SST-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8.3
vi
1
1
1
3
5
6
7
7
10
11
14
14
16
16
16
19
22
22
23
24
25
25
29
31
32
32
33
33
34
35
38
3 Encoding Graph Structure in Transformers with Kernels on Graphs
3.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Preliminaries about Kernels on Graphs . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
3.4 Encoding Graph Structure in Transformers
. . . . . . . . . . . . . . . . . . .
3.4.1 Transformer Architectures for Graphs
3.4.2 Encoding Node Positions
. . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.3 Encoding Topological Structures . . . . . . . . . . . . . . . . . . . . . .
3.5 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.2 Results and Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . .
3.5.3 Visualizing attention scores for the Mutagenicity dataset.
3.6 Remark on Generalized Self-attention . . . . . . . . . . . . . . . . . . . . . . .
3.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8 Experimental Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.1 General Details.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.2 Graph Classification Datasets . . . . . . . . . . . . . . . . . . . . . . . .
3.8.3 Graph Regression Dataset . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Sample Screening in Empirical Risk Minimization
4.1
4.2 Preliminaries
Safe Loss Functions and Sparsity in the Dual of ERM Formulations
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.1 Fenchel Conjugacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.2 Empirical Risk Minimization and Duality . . . . . . . . . . . . . . . . .
. .
4.2.3
4.3 Safe Rules for Screening Samples . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3.1 Principle of SAFE Rules for Data Points . . . . . . . . . . . . . . . . . .
4.3.2 Building the Test Region X . . . . . . . . . . . . . . . . . . . . . . . . .
4.3.3 Extension to Kernel Methods . . . . . . . . . . . . . . . . . . . . . . . .
4.4 Constructing Safe Losses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inducing Sparsity in the Dual of ERM . . . . . . . . . . . . . . . . . . .
4.4.1
4.4.2 Link Between the Original and Regularized Problems
. . . . . . . . . .
4.4.3 Effect of Regularization and Examples . . . . . . . . . . . . . . . . . . .
4.5 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
4.5.1 Accuracy of our safe logistic loss
4.5.2
Safe Screening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5.3 Dataset Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7 Proofs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7.1 Proof of Lemma 4.2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7.2 Proof of Lemma 4.3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7.3 Proof of Lemma 4.4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7.4 Lemma 4.7.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7.5 Proof of Lemma 4.4.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7.6 Proof of Screening-friendly regression . . . . . . . . . . . . . . . . . . .
4.8 Additional experimental results. . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
42
44
45
46
47
47
49
50
50
51
53
61
61
63
63
63
65
67
67
69
69
69
70
70
70
71
73
74
74
75
75
77
77
78
80
82
85
85
85
86
87
87
87
88
vii
5 Conclusion and Future Work
5.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bibliography
89
89
90
92
viii
Chapter 1
Introduction
1.1 The state of machine learning
Recent advances in machine learning, namely deep learning [Goodfellow et al., 2016], are
slowly starting to deliver. Deep language models such as BERT [Devlin et al., 2019] equip
search engines to improve the relevance of the results. Researchers in bioinformatics can rely on
strong models for protein structure prediction [Jumper et al., 2021], a crucial task to understand
the properties of proteins, the building block of life, which would otherwise being costly in
terms of time and money. Some programming task could soon be automated with new kinds of
programming languages taking instructions in natural language as input [Chen et al., 2021].
These three innovations share one common characteristic: their underlying deep neural networks
were trained on very large scale datasets. For example, BERT was trained on 3.3 billion words
from a corpus of books and English Wikipedia, representing 33,000 books, or ten times the
minimum amount of books a library should contain according to UNESCO. Several language
models have followed, trained on datasets a few order of magnitude bigger and this important
trend is emerging for many other data modalities. Such an approach to machine learning is an
answer to one of its biggest problem: generalization. Roughly, how to handle new, unseen data.
We will briefly delve into the definition and history of machine learning, before elaborating on
the generalization problem and how it is currently being addressed with pre-trained models.
Then, we will explain why and how the following thesis provides a different answer to this
problem and finally deliver its outline and contributions.
1.1.1 Past and present of machine learning
What is machine learning? In its best known form, machine learning is nothing else but a
computer program learning to map an input A to an output B. To do so, the program requires
training examples of A and corresponding B, a model whose parameters will be adjusted to fit
the examples, and a metric for the model to know whether it does good or not and adjust its
parameters accordingly. More precisely, and in many cases, training a machine learning model
consists in solving the following problem coined as Empirical Risk Minimization (ERM) i.e
given a dataset of n examples xi whose desired mapping is yi, finding a prediction function f
parameterized by θ solving:
minθ
1
n
n
X
i=1
'(fθ(xi), yi) + λΩ(fθ),
(1.1)
1
where ' is a loss term reflecting the discrepancy between a prediction fθ(xi) and the ground
truth yi, and Ω a term penalizing the complexity of the solution, according to Occam's razor.
Contrarily to pure optimization, whose objective would consist in optimizing the metric for
the training data only, machine learning aims at finding a model which will also do well on
new, unseen data, an ability coined as generalization. This is why we often add constraints to
the ERM problem such as Ω. As such, machine learning is a subfield of artificial intelligence,
whose goal is to create computers and programs exhibiting "intelligent" behavior - rigorously
defining intelligence being an open question [Chollet, 2019].
But, why would we want a computer program to learn to perform a task, such as predicting
the content of an image, instead of directly implementing rules for this task? Because, in
many cases, rules defined by a human programmer will be incomplete or nearly impossible
to formulate. Think for example about a program designed to identify an animal from its
picture. First, a dog could be distinguished from a cat by looking at its nose. But what if
the nose is obfuscated? This would require to add an additional rule. And, if this rule cannot
be applied, another one, etc. Second, rules can be difficult or even impossible to formulate:
how to express what a nose is in terms of pixels? In many cases, letting a program learn
its own rules will circumvent this difficulties and expand the spectrum of tasks that can be
automated as well as the level of performance. Until recently, and excepted older approaches to
neural networks, machine learning mostly relied on models that could be learned using convex
optimization: the training procedure often consisted in solving a convex optimization problem,
which is well-understood today [Boyd and Vandenberghe, 2004]. Many of these models were
linear, or achieved non-linearity via techniques such as the kernel trick (see below) and could
lack of expressiveness or ability to generalize compared to more recent approaches such as deep
neural networks. Somehow symmetrically, training procedures for deep learning are still not
understood today and are an important research topic.
Finally, note that there is much more to machine learning than solving problems such
as ERM. For example, an important area of machine learning is unsupervised learning, a
setting where we only have samples xi but no labels yi and we generally seek to learn a general
representation of the data that could be used for downstream tasks: formulating the learning
task is therefore a problem in itself.
Why is it important? Recent advances in machine learning, namely deep learning (see Good-
fellow et al. [2016] for a detailed introduction), raised high expectations in the past years for
its promise to help humans executing always more complex tasks with various degrees of
supervision:
- Machine learning could (and is in the process of) automate tasks with a level of perfor-
mance that were previously thought to be a human backyard such as image generation
(with techniques such as Generative Adversarial Networks [Goodfellow et al., 2014] and
Variational Autoencoders [Kingma and Welling, 2014] among others), sentence generation
in natural language [Brown et al., 2020] or simply playing games such as Go [Schrittwieser
et al., 2020] to give but a few examples.
- Even in contexts where human supervision is essential, machine learning could still be
used to handle large amounts of data that would otherwise be intractable for a human,
and find subtle patterns in complex data. In bioinformatics for example, the continuous
development and declining cost of high-throughput technologies led to a dramatic increase
2
in the quantity of omics data (i.e, genomics, proteomics, metabolomics, metagenomics
and transcriptomics) available to practitioners. One famous instance of this trend is
the human genome: in the last twenty years, its cost of sequencing (3.3GB) fell from
$100,000,000 to $1,000. In this context, machine learning could typically be used as a tool
by researchers to find complex relationships between genes, metabolisms and environment
resulting in onset and progression of diseases.
Where does it come from? Machine learning as a field emerged progressively during the
last 80 years, and takes its foundations in statistics, probabilities, linear algebra, and computer
science. Exhaustively retracing the history of machine learning would be out of the scope of
this introduction and we will simply review (subjectively) pivotal moments of the field. At the
heart of machine learning lies linear model fitting, such as linear regression, discovered in the
XVIIIe century or Support Vector Machine [Cortes and Vapnik, 1995], which rely on convex
optimization for solving the training problem. Such models have been flourishing since the
beginning of machine learning and are still of importance today for their simplicity both in terms
of interpretability and from a computational point of view. Years 2010 have seen sparse models
blossom: adding penalties such as the '1 norm to the training problem encourages the learned
models to be sparse, making those even more interpretable and fast to optimize [Bach et al., 2012].
It is now well-known that a combination of increase in the quantity of data and compute power,
briefly coined as the Big Data era, triggered the emergence of deep learning which is turning
the state of the art in many fields upside down. Indeed, deep learning had been known for a
while, but required more data than classical machine learning models to deliver its full potential.
In 2012, a Convolutional Neural Network (CNN) designed for image classification, AlexNet,
outperformed its non deep competitors at the ImageNet challenge for the first time [Krizhevsky
et al., 2012]. Since then, CNNs have been largely adopted as the cornerstone of many computer
vision technologies such as image classification, face recognition, character recognition, and
many others. This moment was also the spark that ignited massive research and investment
in deep learning. In 2016, Lee Sedol, one of the very best Go players at the moment, was
defeated by AlphaGo, an algorithm relying on deep reinforcement learning [Silver et al., 2016]
to select the best possible moves. This event demonstrated that deep learning was able to
achieve superhuman performances in fields that were previously thought to be out of reach for
computers. In 2018, BERT, a language model based on transformers, a deep neural network
architecture introduced the year before [Vaswani et al., 2017], beat other deep networks on
important natural language processing benchmarks [Devlin et al., 2019]. This work triggered
a great deal of research on transformers and huge models trained on similarly huge datasets.
Deep learning is still reaching new, impressive milestones as of today.
1.1.2 Generalization and other problems of deep learning
Although deep learning generated high expectations by outperforming the state of the art on
a wide range of tasks, its deployment in real life applications has been dampened for various
reasons.
- Deep models can express complicated functions but require a lot of data to be able to
generalize, i.e make good predictions on data which has not been seen during the training.
This can be problematic if one wants to use these models in data constrained settings such
as studying the onset of rare diseases. In France for example, it is estimated that there are
3
less than 30,000 people per rare disease, which means even less samples to study (2019).
More generally, using many samples is in contradiction with animal intelligence, which
seems to acquire deep knowledge of its environment by learning from a small amount of
samples. For example, most humans need few pictures of horses to be able to recognize a
new horse! Some may even be able to recognize unseen animals from their description.
Thinking about how to learn with minimal amount of samples is probably an interesting
path towards advancing machine learning.
- Deploying deep learning based technologies into real life products, some of them being
critical objects such as surveillance systems or self-driving cars, may require interpretability
to ensure the system complies with the norm, among other requirements1. Interpretability
is also a desirable property of machine learning models in the setting of scientific discovery,
as discovering key predictors for a particular phenomenon can suggest new avenues of
research.
- It is well-known that deep learning models lack of robustness to perturbations that can
happen when the model is deployed. Thus, slight modifications to the input of deep
models can trigger important responses at the output level. This is the cornerstone of
adversarial attacks in vision, where humanly imperceptible modifications of the input
image (generally a few pixels) trick the network into predicting an obviously wrong
label [Szegedy et al., 2014]. This is an important vulnerability of deep models, which
could be exploited to cause accidents with self-driving cars or avoid detection by facial
recognition technologies. In Natural Language Processing, it is also possible to retrieve
pieces of the training data by querying the model in the correct way [Carlini et al., 2020].
This could be a problem as many large models are pre-trained on huge, private datasets
potentially containing sensitive data.
- Deep learning is generally associated to high computational and environmental costs
[Strubell et al., 2019]. Indeed, the lack of theoretical understanding of the optimization
procedures of deep neural networks requires to perform many training iterations to yield a
satisfying model in terms of accuracy of predictions. Moreover, the size of the models and
datasets, which have grown bigger and bigger in the past few years, and the popularity of
such techniques in research and industry made the share of machine learning in overall
computations overwhelming. Discussing the energy efficiency of these models would be a
research topic on its own: the fact that the hardware is specializing for deep learning,
improving its energy efficiency, has to be taken into account, but does it balance the cost
of developing and producing these new chips? The energy mix of the country providing
electricity to the computing infrastructure also has to be taken into account. Hence, it
is very difficult to conclude regarding the real cost of deep learning. Be that as it may,
getting to the same level of performance as AlexNet required 44 less compute in 2019
than in 2012 [Hernandez and Brown, 2020].
Significant proportions of machine learning research are dedicated to solving these problems,
which are obviously not an exhaustive list of machine learning problems worth studying. This
thesis focuses on the generalization problem yet may include a discussion on the other issues
throughout the chapters.
1European Commission's proposal for a Regulation on Artificial Intelligence, 2021
4
1.1.3 A promising but limited answer to the generalization problem: trans-
fer learning from pre-trained models
Today, a popular answer to the problem of generalization lies in transfer learning from large
pre-trained models.
Definition 1.1.1 (Transfer learning). Transfer learning consists in training a model that has
already been trained on a dataset A, on a generally similar dataset B. By "similar", we mean a
dataset of the same modality but potentially different distribution.
The intuition behind is that knowledge acquired while learning on A could be reused to
handle B. For example, a computer vision model trained to classify images of animals could be
used as a backbone to classify images of cars since all natural images share features such as
edges, curves, or angles. Transfer learning is currently and typically used as follows: a model is
trained on a huge dataset on a pretext task, with the aim to learn a general representation that
will do well on different downstream tasks. Indeed, it is then possible to train the general model
on a smaller, specialized dataset of interest on which training a deep model from scratch would
have yielded poor performance or simply been impossible due to the lack of data. For example,
language models are trained by predicting masked words in a sentence using the other words.
The assumption is that the model will learn a language representation that will enable it to do
well on a specialized task, for example predicting whether a movie review is positive or not.
This idea is not new and may have been formulated for the first time in 1976 [Bozinovski
and Fulgosi, 1976] (although in Croatian). The same wave that carried deep learning, i.e
unprecedented availability of computational power and data, enabled to pre-train models on
always larger datasets. This was also allowed by the progress of self-supervised learning [He
et al., 2020], a learning framework which does not require annotated data, thus giving access to
massive, unlabelled corpus (labelling data, a base requirement of supervised learning, is generally
costly). Models can now be trained on datasets a few orders of magnitude bigger than what was
done a few years ago. When the author began to work on his thesis, transfer learning mainly
consisted in using various convolutional neural networks trained on ImageNet, a classification
dataset of 1 million images with 1000 labels, as a backbone for solving other computer vision
tasks. However, after the emergence of transformers and BERT, this approach became standard
for other data modalities. In the field of NLP, language models are now pre-trained on bigger and
bigger datasets [Brown et al., 2020], and for various languages [Martin et al., 2020], before being
fine-tuned for downstream tasks such as natural language understanding [Wang et al., 2020].
This practice has also been extended to new data modalities such as protein sequences [Rives
et al., 2019] or graphs as will be explained in Chapter 3. Models pre-trained on datasets one or
two orders of magnitude bigger than ImageNet are also emerging in computer vision [Dosovitskiy
et al., 2021]. In the same way as code of deep architectures was publicly released on GitHub,
pre-trained models are now often made available and centralized on platforms such as the
transformers library from HuggingFace [Wolf et al., 2019].
Pre-trained models are a promising answer to the problem of generalization in machine
learning postulating that it is possible to learn a general purpose representation of a given
modality, such as images. Indeed, natural images share low-level features such as edges, curves
or colors. Avoiding to learn these features from scratch each time a model is trained enables
to focus on learning features specific to the dataset, such as wheels or car door is model has
to classify models of cars, thus allowing to use deep learning on relatively small datasets.
Pre-trained models are currently a popular research topic.
5
The limits of transfer learning. Pre-trained models are currently changing the practice
of machine learning. Although these models are quite successful at providing general purpose
representations, they do not fundamentally solve the problems that deep learning is facing. In
fact, they even underlines some issues: pre-trained models require many data by definition
(although they are meant to be trained only once and for all), they are costly to train and
manipulate because of their size, they are prone to bias and to adversarial or privacy attacks.
GPT-3 [Brown et al., 2020], one of the most famous and strongest language models, was trained
on half a trillion words, including Wikipedia and branches of the internet. This is a few thousand
times the amount of words a human will hear and read in its lifetime. Although GPT-3 provides
impressive performance in terms of natural language understanding or generation, it has also
been put in evidence that its family of models, namely Large Language Models (LLM) have
some of the undesirable effects described above such as a high computational cost and tendency
to exhibit biases [Bender et al., 2021]. Moreover, not all domains provide access to enough data:
in many cases, pre-trained models are simply not available, think about the example of rare
diseases. Another potential problem of large pre-trained models is their decreasing return with
respect to the quantity of data: it becomes more and more difficult to train models on bigger
datasets with seemingly diminishing gains in terms of performance on downstream tasks: the
current trend may not be sustainable. Finally, data efficient models are believed to be a path
towards machine learning models that generalize better. For all these reasons, finding other
solutions to improve the generalization of machine learning models is an important problem.
1.1.4 Motivation: inductive biases, or another solution to the generalization
problem
We provide a different answer to the generalization problem. Instead of training bigger models
with more data, we will focus on data constrained settings, i.e datasets ranging from a few
hundreds to a few tenths of thousands of samples. We will keep using expressive models such
as neural networks yet reduce the number of learnable parameters by replacing them by known
mathematical functions, an approach belonging to the wide family of inductive biases. We now
define the term inductive bias, relying heavily on the definition provided by Battaglia et al.
[2018].
Definition 1.1.2 (Inductive bias). An inductive bias is an hypothesis allowing to prioritize
one solution or interpretation over another, independent of the observed data. It expresses
assumptions about either the data-generating process (linear least squares reflect the assumption
that the data is a line corrupted by Gaussian noise) or the space of solutions (the '1 penalty
generally promotes a sparse solution).
Why are they useful? Inductive bias are useful as they often trade flexibility of the learning
model for improved sample complexity, a useful property in data constrained settings. Another
useful feature of many inductive biases is their interpretability, as they are the result of a human
made assumption on the data generating process or the space of solutions. A simple example
of inductive bias in machine learning is the '1 norm used to penalize the weights of the model,
typically in the setting of linear regression. First, this term acts as a regularization: it prevents
the model of overfitting by enforcing a simple solution to the training problem. Moreover,
it can be interpreted, in the sense that the solution will be sparse in terms of features used
to make a prediction. Intuitively, the model will select the most relevant features, a useful
6
behavior in domains such as genomics where there are a few particular genes of interest among
thousands of others when it comes to predict the onset of a particular disease. As explained
above, not every domain has access to vast amounts of data, such as stock prices in finance or
more generally domains with rare events. Other domains may have plenty of data available
but require interpretability of the models, such as researchers studying phenomenon in natural
science, hence looking for interpretable patterns to further investigate and/or express theories.
Goal of this thesis. The object of this thesis is to introduce algorithms for learning in
data constrained settings and for various data modalities such as sequences or graphs when
pre-trained models are not available or advantageous. By constrained data setting, we mean
datasets ranging from a few hundreds to a few tenths of thousands of samples. To do so, we will
heavily rely on the previously discussed inductive biases, and particularly on kernel methods
which enable to encode inductive biases directly into a model. This thesis also builds on one of
the most recent deep learning architecture for dealing with set input data, the transformer.
1.2 Preliminaries
In this section, we introduce concepts that will be used in at least two of the three chapters of
this thesis.
1.2.1 Kernel methods.
What are kernel methods? Kernel methods have been extensively used in machine learning,
see Schölkopf and Smola [2001] for a detailed introduction. They consist in mapping data living
in some space X to a high or infinite dimensional space H via a kernel function K : X × X 7→ R.
The intuition behind this technique is that data lying in a high dimensional space may become
more easily separable for linear models. Intuitively, K acts as a measure of similarity between a
pair of elements (x, x0) living in H. H is a Reproducing Kernel Hilbert Space (RKHS) associated
to the positive definite kernel K via a mapping function Φ : X 7→ H: we have
K(x, x0) = hΦ(x), Φ(x0)iH.
(1.2)
Definition 1.2.1 (Positive definite kernel). K : X × X 7→ R is a positive definite kernel if
it is symmetric, i.e ∀(x, x0) ∈ X 2, K(x, x0) = K(x0, x) and satisfies ∀N ∈ N, (x1, . . . , xN ) ∈
X N and (a1, . . . , aN ) ∈ RN : PN
j=1 aiajK(xi, xj) ≥ 0.
i=1
It can be shown that positive definiteness of K is equivalent to the reproducing property:
PN
for any function f ∈ H, we have
f (x) = hf, Φ(x)iH for all x ∈ H.
(1.3)
In particular, it is possible to use kernel methods with linear models when the solution
to the empirical risk minimization problem can be written in terms of scalar products in X
between pairs of samples (x, x0). We will exploit this property to extend some results in the
non-linear case in Chapter 4. Then, one only needs to replace these products by the scalar
product in H, i.e by K(x, x0), thus obtaining potentially non-linear decision functions. This
classical approach has been coined as the kernel trick. The kernel trick has an implication
that will be exploited in the context of this thesis: it will be possible to work on non-vectorial
7
data such as graphs or strings, by replacing the scalar products by a well-chosen comparison
functions between these objects. For example, in Chapter 2, we will derive an embedding for
sets starting from a comparison function between two sets, which is based on the 2-Wasserstein
distance between two sets of points x and x0 living respectively in Rn×d and Rn0×d.
Finally, the Representer theorem states that any solution to the empirical risk minimization
problem has the form:
∀x ∈ X , f (x) =
n
X
i=1
αiK(xi, x).
(1.4)
Hence, f can be expressed in terms of n evaluations of the kernel K between the input and the
n known samples.
A famous example of kernel: the Gaussian kernel. The Gaussian kernel, or radial basis
function (RBF) will often be used in the context of this thesis. For a pair of elements of X
(x, x0), the Gaussian kernel with bandwidth σ is
K(x, x0) = e−
||x−x0||2
2
2σ2
.
(1.5)
The Gaussian kernel has interesting properties: all the points in the feature space actually lie
on the unit sphere since we have:
K(x, x) = 1 = ||Φ(x)||2
H.
(1.6)
It is also possible to express the distance induced by the Gaussian kernel in the feature space
in terms of distance between x and x0:
dK(x, x0) =
v
u
u
t2
1 − e−
||x−x0||2
2
2σ2
!
.
(1.7)
Going further, it is also possible to express the distance between a set of known samples
S = {x1, . . . , xn} and a new sample x:
dK(x, S) =
v
u
u
tC −
2
n
n
X
i=1
||x−xi||2
2
2σ2
.
e−
(1.8)
Then, given two sets S1 and S2 and a sample x, we can use this distance to know which set x
belongs to, using a decision function induced by K, as shown in Figure 1.1.
Kernel methods for large scale machine learning. Kernel methods enable to learn
non-linear decision functions f using tools from linear optimization. But, reformulating an
ERM problem including kernel comparisons for all pairs of input samples may be intractable in
the context of today's large datasets, with a number of sample typically greater than 100, 000:
such setting requires to compute a kernel matrix which is quadratic in the number of samples.
However, in many cases, it is possible to circumvent this issue by computing a low-rank
approximation of the kernel matrix which is done in Nyström's approximation described below,
or using random Fourier features [Rahimi and Recht, 2007]. In the latter setting, a randomized
feature map Ψ is used, such that:
K(x, x0) ≈ hΨ(x), Ψ(x0)iRd.
(1.9)
8
Figure 1.1: Points in red belong to S1, points in green belong to S2. Level curves for the
decision function f = dK(x, S1) − dK(x, S2) are plotted. Left: σ = 1. Right: σ = 0.2 (from
Jean-Philippe Vert and Julien Mairal course on Kernel Methods, 2021).
For example, Rahimi and Recht [2007] show that it is possible to approximate a shift invariant
kernel, i.e a kernel such that K(x, x0) is a function of x − x0, by drawing samples from the
Fourier transform of K and applying a cosine transformation on these samples using x. The
resulting mapping Ψ(x) is the concatenation of these transforms for each sample:
Ψ(x) =
r 2
D
(cos(ω1x + b1), . . . , cos(ωDx + bD)) ,
(1.10)
with ωi a sample drawn from the Fourier transform p of K, and bi uniformly sampled from
[ 0, 2π] .
Kernel methods for deep learning. Deep learning made kernel methods seemingly obso-
lete, as it allows to learn more expressive decision functions from the data. However, kernel
methods remain relevant in the context of deep learning. We now provide two instances of
kernel methods used in the context of deep learning, and whose present thesis is in line with.
- The RKHS norm ||f ||H acts as a natural regularization term because it controls the
variations of the models prediction according to the geometry induced by Φ. Indeed, for
all pairs (x, x0):
|f (x) − f (x0)| ≤ ||f ||H||Φ(x) − Φ(x0)||H.
Bietti and Mairal [2019] showed that it is possible to construct a multi-layer hierarchical
kernel whose RKHS contains CNNs but with smooth activations instead of ReLus. Then,
Bietti et al. [2019] used approximations of the corresponding RKHS norm to regularize the
training of real CNNs (with ReLus activations hence not contained in the RKHS), using
various upper-bounds or lower-bounds of ||f ||H as a penalty term in the empirical risk
minimization objective, thus improving generalization and robustness of deep convolutional
neural networks in the context of small datasets of images. For example, ||f ||H can be
upper-bounded as:
(1.11)
||f ||H ≤ ω(||W1||, . . . , ||WL||),
with ω a function increasing in all its arguments and ||Wi|| the spectral norm of the i-th
weight matrix of the network. Then, it is possible to regularize the training problem by
using the sum of the spectral norms of the weight matrices as a penalty term.
(1.12)
9
- It is possible to get an approximation Ψ for the kernel mapping Φ in the sense that
hΨ(x), Ψ(x0)iRd ≈ hΦ(x), Φ(x0)iH [Williams and Seeger, 2001].
In fact, the resulting
approximation will have a neural network-like structure, i.e alternating matrix multiplica-
tions and non-linearities [Mairal, 2016]:
Ψ(x) = K(Z, Z)−1/2K(Z, x),
(1.13)
where Z ∈ Rk×d is a set of k anchor points. K(Z, x) ∈ Rk denotes the comparison
between each anchor and the current query x, and K(Z, Z) ∈ Rk×k is the Gram matrix
for the anchors. By choosing a suitable kernel K depending on the data at hand, we are
therefore encoding a prior in our model. As opposed to neural networks, it is possible
to learn Ψ without labelled data. In a supervised context, Ψ can still be learned using
back-propagation. This technique naturally lends itself to contexts where few labelled
data is available. We will therefore rely on it in Chapters 2 and 3.
1.2.2 Transformers
A recently proposed neural network architecture. Transformers are a kind of deep
learning architecture introduced by Vaswani et al. [2017]. This architecture relies mostly on the
attention mechanism introduced in the context of machine translation [Bahdanau et al., 2015].
As opposed to common neural network architectures such as fully-connected or convolutional,
it takes a set of features such as the words of a sentence or patches composing an image as
input, and output a label or another set of features. More precisely, transformers consist in two
parts: the encoder and the decoder.
The encoder takes a set of n elements X in Rn×din. It outputs another set in Rn×dout.
Globally, the feature map X is updated via:
The update term is obtained via the self-attention mechanism:
X = X + Attention(Q, K, V ).
Attention(Q, K, V ) = softmax
!
QK>
√
dout
V ∈ Rn×dout,
(1.14)
with Q> = WQX > and K> = WKX > respectively the query and key matrices, V > = WV X >
the value matrix. WQ, WK, WV in Rdout×din are learned projection matrices.
Then, Layer Normalization [Ba et al., 2016] is applied to the output: each element of the
output is normalized via statistics computed over all the hidden units in the same layer. Finally,
a fully connected feed-forward neural network is applied to each element of the updated feature
map X. This neural network is the same for every elements in X. Again, the feature map is
updated with a residual connection. The sequence of operations forms a block which can be
repeated multiple times to build a deeper transformer encoder.
The decoder part of the transformer takes two inputs: the output of the encoder and another
input sequence (that will be iteratively built when the transformer is used for translation for
example). Here, the attention weights are computed via an attention mechanism between the
encoder output sequence and the decoder input sequence. We will not further detail the decoder
here since we will not make use of it in the thesis.
10
Position encoding. The sequence of operations detailed above does not take into account the
position of the elements in the input set. It is said that the transformer encoder is "permutation
equivariant": a permutation of two elements in the input set will simply result in the same
permutation in the output set, without further change in the feature map. To circumvent this
problem, positional information is added to the input elements when needed. This approach is
called position encoding. Position encoding can either be learnable vectors or scalars that are
added to the input elements (absolute position encoding) or at the attention mechanism level
for a pair of input elements (relative position encoding). For euclidean data such as sentences
and images which can be seen respectively as 1D or 2D grids, it is also possible to come up
with hand-crafted coordinate systems such as in Vaswani et al. [2017]:
P E(i, 2k) = sin
(cid:18)
P E(i, 2k + 1) = cos
(cid:19)
i
10002k/din
i
10002k/din
(cid:18)
(cid:19)
,
(1.15)
(1.16)
where i is the index of the element in the set, and k the index of the dimension. Position
encoding in transformers is less trivial when it comes to non-euclidean data structure such as
graphs, as will be detailed in Chapter 3.
Early success of transformers. Transformers can be used when one wants to deal with
sets of features or sequences (by sequence, we mean a set where the order of the elements
matter). Many data modalities can in fact be seen as set or sequences: sentences can be seen
as a sequence of word embeddings, images can be seen as a sequence of pixels or patches, and
graphs can be seen as Transformers met early success in Natural Language Processing, quickly
outperforming state-of-the-art models on various benchmarks as mentioned above.
Transformers recently met success in computer vision [Dosovitskiy et al., 2021] or bioinfor-
matics [Rives et al., 2019]. This architecture is remarkable because it puts the paradigm "to
one data modality corresponds one preferred architecture" into question 2. For example, it has
been shown in the context of NLP that transformers scale better than their LSTMs counterpart
as can be seen in Figure 1.2, probably due to their improved use of long contexts Kaplan et al.
[2020]. LSTMs were however the de facto architecture when it came to dealing with sequences.
Today, transformers are the cornerstone of most language models.
Current hardware is suited to large matrix multiplications required by the transformer
architecture, which enables to train bigger and bigger transformers on bigger and bigger datasets
of text, or images, or even both either in the traditional setting of supervised learning, or
via the more and more popular self-supervised learning. Ours minds should remain open to
different models in the future, but the surprising success of this simple architecture is what
motivated its study in this thesis in Chapter 2 and 3. Relevant information on the architecture
will be given in these chapters.
1.3 Outline of the thesis and contributions
Chapter 2 introduces an embedding inspired from optimal transport to learn on sequences
of varying size such as sentences in natural language processing or proteins in bioinformatics,
2How Natural Language Processing is reshaping Machine Learning
11
Figure 1.2: Transformers scale better than LSTMs for a given, big dataset. From Kaplan et al.
[2020].
with few annotated data. It can be learned with or without supervision and be used alone or
as a global pooling mechanisms within deep architectures. Finally, our embedding has strong
links with attention and transformers and can actually be seen as one of the first versions of
linearised attention.
Chapter 3 builds on the idea of global adaptive pooling introduced in Chapter 2 and
introduces one of the first transformers for learning on graphs, GraphiT. Transformers have an
interesting inductive bias when it comes to graph but cannot take their structure, a crucial
piece of information, into account. We overcome this limitation by introducing two mechanisms
for incorporating the structure of a graph into the transformers architecture. GraphiT is able
to outperform popular Graph Neural Networks, which are the current de facto architecture
for learning on graphs, on datasets of various sizes. GraphiT also demonstrates promising
visualization capabilities that could be helpful for scientific applications where interpretation is
important, for example in chemo-informatics as molecules can be seen as graphs.
Chapter 4 still seeks to learn with few samples while moving away from deep learning, and
focuses instead on models that can be learned by solving a convex training problem. More
precisely, we explore the problem of safe sample screening, where one wants to delete as many
useless samples as possible from the dataset before training a model, without modifying the
optimal solution. This is an important task in domains where there is a large amount of trivial
observations that are useless for learning. We introduce general rules working for non strongly
convex problems as well as a new regularization mechanism to design regression or classification
losses allowing for safe screening.
12
This manuscript is based on the following material:
- A. Bietti*, G. Mialon*, D. Chen, J. Mairal. "A Kernel Perspective for Regularizing
Deep Neural Networks" (ICML, 2019).
- G. Mialon, A. d'Aspremont, J. Mairal. "Screening Data Points in Empirical Risk
Minimization via Ellipsoidal Regions and Safe Loss Functions" (AISTATS, 2020).
- G. Mialon*, D. Chen*, A. d'Aspremont, J. Mairal. "A Trainable Optimal Transport
Embedding for Feature Aggregation and its Relationship to Attention" (ICLR,
2021).
- G. Mialon*, D. Chen*, M. Selosse*, J. Mairal. "GraphiT: Encoding Graph Structure
in Transformers" (preprint arXiv:2106.05667).
13
Chapter 2
Embedding Sets of Features with
Optimal Transport Kernels
This chapter tackles the problem of learning on sets of features, motivated by the need of
performing pooling operations in long biological sequences of varying sizes, with long-range
dependencies, and possibly few labeled data. To address this challenging task, we introduce a
parametrized representation of fixed size, which embeds and then aggregates elements from
a given input set according to the optimal transport plan between the set and a trainable
reference. Our approach scales to large datasets and allows end-to-end training of the reference,
while also providing a simple unsupervised learning mechanism with small computational cost.
Our aggregation technique admits two useful interpretations: it may be seen as a mechanism
related to attention layers in neural networks, or it may be seen as a scalable surrogate of
a classical optimal transport-based kernel. We experimentally demonstrate the effectiveness
of our approach on biological sequences, achieving state-of-the-art results for protein fold
recognition and detection of chromatin profiles tasks, and, as a proof of concept, we show
promising results for processing natural language sequences. We provide an open-source
implementation of our embedding that can be used alone or as a module in larger learning
models at https://github.com/claying/OTK.
This chapter is based on the following material:
- G. Mialon*, D. Chen*, A. d'Aspremont, J. Mairal. "A Trainable Optimal Transport
Embedding for Feature Aggregation and its Relationship to Attention" (ICLR,
2021).
2.1
Introduction
Many scientific fields such as bioinformatics or natural language processing (NLP) require
processing sets of features with positional information (biological sequences such as in Figure 2.1,
or sentences represented by a set of local features). These objects are delicate to manipulate
due to varying lengths and potentially long-range dependencies between their elements. For
14
CUU GAC AAA GUU GAG GCU GAA GUG CAA AUU GAU AGG UUG AUC ACA GGC
L
D
K
V
E
A
E
V
Q
I
D
R
L
I
T
G
Figure 2.1: Short part of mRNA sequence for the SARS-Cov-2 spike protein, lying at the
surface of the virus. The spike protein is an important part of the infection mechanism and the
target of potential treatments. Each triplet codes for an amino acid, represented below.
many tasks, the difficulty is even greater since the sets can be arbitrarily large, or only provided
with few labels, or both.
Deep learning architectures specifically designed for sets have recently been proposed [Lee
et al., 2019, Skianis et al., 2020]. Our experiments show that these architectures perform well
for NLP tasks, but achieve mixed performance for long biological sequences of varying size
with few labeled data. Some of these models use attention [Bahdanau et al., 2015], a classical
mechanism for aggregating features. Its typical implementation is the transformer [Vaswani
et al., 2017], which has shown to achieve state-of-the-art results for many sequence modeling
tasks, e.g, in NLP [Devlin et al., 2019] or in bioinformatics [Rives et al., 2019], when trained
with self supervision on large-scale data. Beyond sequence modeling, we are interested in this
chapter in finding a good representation for sets of features of potentially diverse sizes, with
or without positional information, when the amount of training data may be scarce. To this
end, we introduce a trainable embedding, which can operate directly on the feature set or be
combined with existing deep approaches.
More precisely, our embedding marries ideas from optimal transport (OT) theory [Peyré and
Cuturi, 2019] and kernel methods [Schölkopf and Smola, 2001]. We call this embedding OTKE
(Optimal Transport Kernel Embedding). Concretely, we embed feature vectors of a given set to
a reproducing kernel Hilbert space (RKHS) and then perform a weighted pooling operation,
with weights given by the transport plan between the set and a trainable reference. To gain
scalability, we then obtain a finite-dimensional embedding by using kernel approximation
techniques [Williams and Seeger, 2001]. The motivation for using kernels is to provide a
non-linear transformation of the input features before pooling, whereas optimal transport
allows to align the features on a trainable reference with fast algorithms [Cuturi, 2013]. Such
combination provides us with a theoretically grounded, fixed-size embedding that can be learned
either without any label, or with supervision. Our embedding can indeed become adaptive to
the problem at hand, by optimizing the reference with respect to a given task. It can operate
on large sets with varying size, model long-range dependencies when positional information is
present, and scales gracefully to large datasets. We demonstrate its effectiveness on biological
sequence classification tasks, including protein fold recognition and detection of chromatin
profiles where we achieve state-of-the-art results. We also show promising results in natural
language processing tasks, where our method outperforms strong baselines.
Contributions.
In summary, our contribution is three-fold.
- We propose a new method to embed sets of features of varying sizes to fixed size
representations that are well adapted to downstream machine learning tasks, and whose
parameters can be learned in either unsupervised or supervised fashion.
- We demonstrate the scalability and effectiveness of our approach on biological and natural
language sequences.
15
- We provide an open-source implementation of our embedding that can be used alone or
as a module in larger learning models.
2.2 Related Work
Kernel methods for sets and OT-based kernels. The kernel associated with our embed-
ding belongs to the family of match kernels [Lyu, 2004, Tolias et al., 2013], which compare all
pairs of features between two sets via a similarity function. Another line of research builds
kernels by matching features through the Wasserstein distance. A few of them are shown to
be positive definite [Gardner et al., 2018] and/or fast to compute [Rabin et al., 2011, Kolouri
et al., 2016]. Except for few hyper-parameters, these kernels yet cannot be trained end-to-end,
as opposed to our embedding that relies on a trainable reference. Efficient and trainable kernel
embeddings for biological sequences have also been proposed by Chen et al. [2019a,b]. Our
work can be seen as an extension of these earlier approaches by using optimal transport rather
than mean pooling for aggregating local features, which performs significantly better for long
sequences in practice.
Deep learning for sets. Deep Sets [Zaheer et al., 2017] feed each element of an input set
into a feed-forward neural network. The outputs are aggregated following a simple pooling
operation before further processing. Lee et al. [2019] propose a Transformer inspired encoder-
decoder architecture for sets which also uses latent variables. Skianis et al. [2020] compute
some comparison costs between an input set and reference sets. These costs are then used as
features in a subsequent neural network. The reference sets are learned end-to-end. Unlike our
approach, such models do not allow unsupervised learning. We will use the last two approaches
as baselines in our experiments.
Interpretations of attention. Using the transport plan as an ad hoc attention score was
proposed by Chen et al. [2019c] in the context of network embedding to align data modalities.
Our work goes beyond and uses the transport plan as a principle for pooling a set in a model,
with trainable parameters. Tsai et al. [2019] provide a view of Transformer's attention via
kernel methods, yet in a very different fashion where attention is cast as kernel smoothing and
not as a kernel embedding.
2.3 Proposed Embedding
2.3.1 Preliminaries
We handle sets of features in Rd and consider sets x living in
X = n
x | x = {x1, . . . , xn} such that x1, . . . , xn ∈ Rd for some n ≥ 1o
.
Elements of X are typically vector representations of local data structures, such as k-mers
for sequences, patches for natural images, or words for sentences. The size of x denoted by n
may vary, which is not an issue since the methods we introduce may take a sequence of any
size as input, while providing a fixed-size embedding. We now revisit important results on
optimal transport and kernel methods, which will be useful to describe our embedding and its
computation algorithms.
16
Figure 2.2: Discrete optimal transport consists in finding the transport plan (between points
with masses) minimizing a given transportation cost based on the distance between the masses,
from the red ones to the blue ones. Here, all masses are identical except the biggest, which is
twice the others.
Optimal transport. Our pooling mechanism will be based on the transport plan between
x and x0 seen as weighted point clouds or discrete measures, which is a by-product of the
optimal transport problem [Villani, 2008, Peyré and Cuturi, 2019]. OT has indeed been widely
used in alignment problems [Grave et al., 2019]. Throughout the chapter, we will refer to the
Kantorovich relaxation of OT with entropic regularization, detailed for example in [Peyré and
Cuturi, 2019]. Let a in ∆n (probability simplex) and b in ∆n0 be the weights of the discrete
measures P
with respective locations x and x0, where δx is the Dirac at
position x. Let C in Rn×n0 be a matrix representing the pairwise costs for aligning the elements
of x and x0. The entropic regularized Kantorovich relaxation of OT from x to x0 is
j bjδx0
and P
i aiδxi
j
min
P∈U (a,b)
X
ij
CijPij − εH(P),
(2.1)
where H(P) = − P
controls the sparsity of P, and U is the space of admissible couplings between a and b:
ij Pij(log(Pij) − 1) is the entropic regularization with parameter ε, which
U (a, b) = {P ∈ Rn×n0
+
: P1n = a and P>1n0 = b}.
The problem is typically solved by using a matrix scaling procedure known as Sinkhorn's
algorithm [Sinkhorn and Knopp, 1967, Cuturi, 2013]. In practice, a and b are uniform measures
since we consider the mass to be evenly distributed between the points. P is called the transport
plan, which carries the information on how to distribute the mass of x in x0 with minimal cost.
A simple representation of the problem can be seen in Figure 2.2. Our method uses optimal
transport to align features of a given set to a learned reference.
Sinkhorn's Algorithm: Fast Computation of Pκ(x, z). Without loss of generality, we
consider here κ the linear kernel. We recall that Pκ(x, z) is the solution of an optimal
transport problem, which can be efficiently solved by Sinkhorn's algorithm [Peyré and Cuturi,
2019] involving matrix multiplications only. Specifically, Sinkhorn's algorithm is an iterative
matrix scaling method that takes the opposite of the pairwise similarity matrix K with entry
Kij := hxi, zji as input C and outputs the optimal transport plan Pκ(x, z) = Sinkhorn(K, ε).
17
Each iteration step ' performs the following updates
u('+1) =
1/n
Ev(')
and v('+1) =
1/p
E>u(')
,
(2.2)
where E = eK/ε. Then the matrix diag(u('))Ediag(v(')) converges to Pκ(x, z) when ' tends
to ∞. However when ε becomes too small, some of the elements of a matrix product Ev or
E>u become null and result in a division by 0. To overcome this numerical stability issue,
computing the multipliers u and v is preferred (see e.g. [Peyré and Cuturi, 2019, Remark 4.23]).
This algorithm can be easily adapted to a batch of data points x, and with possibly varying
lengths via a mask vector masking on the padding positions of each data point x, leading
to GPU-friendly computation. More importantly, all the operations above at each step are
differentiable, which enables z to be optimized through back-propagation. Consequently, this
module can be injected into any deep networks.
Kernel methods. Kernel methods [Schölkopf and Smola, 2001] map data living in a space
X to a reproducing kernel Hilbert space H, associated to a positive definite kernel K through
a mapping function φ : X → H, such that K(x, x0) = hφ(x), φ(x0)iH. Even though φ(x) may
be infinite-dimensional, classical kernel approximation techniques [Williams and Seeger, 2001]
provide finite-dimensional embeddings ψ(x) in Rk such that K(x, x0) ≈ hψ(x), ψ(x0)i. Our
embedding for sets relies in part on kernel method principles and on such a finite-dimensional
approximation.
Attention and transformers. We clarify the concept of attention - a mechanism yielding
a context-dependent embedding for each element of x - as a special case of non-local opera-
tions [Wang et al., 2017, Buades et al., 2011], so that it is easier to understand its relationship
to the OTK. Let us assume we are given a set x ∈ X of length n. A non-local operation on x
is a function Φ : X 7→ X such that
Φ(x)i =
n
X
j=1
w(xi, xj)v(xj) = W(x)>
i V(x),
where W(x)i denotes the i-th column of W(x), a weighting function, and V(x) corresponds to
[v(x1), . . . , v(xn)]>, an embedding. In contrast to operations on local neighborhood such as
convolutions, non-local operations theoretically account for long range dependencies between
elements in the set. In attention and the context of neural networks, w is a learned function
reflecting the relevance of each other elements xj with respect to the element xi being embedded
and given the task at hand. In the context of the chapter, we compare to a type of attention
coined as dot-product self-attention, which can typically be found in the encoder part of the
transformer architecture [Vaswani et al., 2017]. Transformers are neural network models relying
mostly on a succession of an attention layer followed by a fully-connected layer. Transformers
can be used in sequence-to-sequence tasks - in this setting, they have an encoder with self-
attention and a decoder part with a variant of self-attention -, or in sequence to label tasks,
with only the encoder part. The chapter deals with the latter. The name self-attention means
that the attention is computed using a dot-product of linear transformations of xi and xj, and
x attends to itself only. In its matrix formulation, dot-product self-attention is a non-local
operation whose matching vector is
W(x)i = Softmax
WQxix>W >
K
√
dk
!
,
18
where WQ ∈ Rn×dk and WK ∈ Rn×dk are learned by the network. In order to know which xj
are relevant to xi, the network computes scores between a query for xi (WQxi) and keys of all
the elements of x (WKx). The softmax turns the scores into a weight vector in the simplex.
Moreover, a linear mapping V(x) = WV x, the values, is also learned. WQ and WK are often
shared [Kitaev et al., 2020]. A drawback of such attention is that for a sequence of length n,
the model has to store an attention matrix W with size O(n2). More details can be found
in Vaswani et al. [2017].
2.3.2 Optimal Transport Embedding and Associated Kernel
We now present the OTKE, an embedding and pooling layer which aggregates a variable-size
set or sequence of features into a fixed-size embedding. We start with an infinite-dimensional
variant living in a RKHS, before introducing the finite-dimensional embedding that we use in
practice.
Infinite-dimensional embedding in RKHS. Given a set x and a (learned) reference z in
X with p elements, we consider an embedding Φz(x) which performs the following operations:
(i) initial embedding of the elements of x and z to a RKHS H; (ii) alignment of the elements
of x to the elements of z via optimal transport; (iii) weighted linear pooling of the elements x
into p bins, producing an embedding Φz(x) in Hp, which is illustrated in Figure 2.3.
Before introducing more formal details, we note that our embedding relies on two main
ideas:
- Global similarity-based pooling using references. Learning on large sets with long-range
interactions may benefit from pooling to reduce the number of feature vectors. Our
pooling rule follows an inductive bias akin to that of self-attention: elements that are
relevant to each other for the task at hand should be pooled together. To this end, each
element in the reference set corresponds to a pooling cell, where the elements of the input
set are aggregated through a weighted sum. The weights simply reflect the similarity
between the vectors of the input set and the current vector in the reference. Importantly,
using a reference set enables to reduce the size of the "attention matrix" from quadratic
to linear in the length of the input sequence.
- Computing similarity weights via optimal transport. A computationally efficient similarity
score between two elements is their dot-product [Vaswani et al., 2017]. In this chapter,
we rather consider that elements of the input set should be pooled together if they align
well with the same part of the reference. Alignment scores can efficiently be obtained
by computing the transport plan between the input and the reference sets: Sinkhorn's
algorithm indeed enjoys fast solvers [Cuturi, 2013].
We are now in shape to give a formal definition.
Definition 2.3.1 (The optimal transport kernel embedding). Let x = (x1, . . . , xn) in
X be an input set of feature vectors and z = (z1, . . . , zp) in X be a reference set with p elements.
Let κ be a positive definite kernel, e.g., Gaussian kernel, with RKHS H and φ : Rd → H, its
associated kernel embedding. Let κ be the n × p matrix which carries the comparisons κ(xi, zj),
before alignment.
19
Then, the transport plan between x and z, denoted by the n × p matrix P(x, z), is defined as
the unique solution of (2.1) when choosing the cost C = −κ, and our embedding is defined as
Φz(x) := √
p ×
n
X
i=1
P(x, z)i1φ(xi),
. . . ,
n
X
i=1
P(x, z)ipφ(xi)
!
= √
p × P(x, z)>φ(x),
where φ(x) := [φ(x1), . . . , φ(xn)]>.
Interestingly, it is easy to show that our embedding Φz(x) is associated to the positive
definite kernel
Kz(x, x0) :=
n
X
i,i0=1
Pz(x, x0)ii0κ(xi, x0
i0) = hΦz(x), Φz(x0)i,
(2.3)
with Pz(x, x0) := p × P(x, z)P(x0, z)>. This is a weighted match kernel, with weights given by
optimal transport in H. The notion of pooling in the RKHS H of κ arises naturally if p ≤ n.
The elements of x are non-linearly embedded and then aggregated in "buckets", one for each
element in the reference z, given the values of P(x, z). This process is illustrated in Figure 2.3.
We acknowledge here the concurrent work by Kolouri et al. [2021], where a similar embedding
is used for graph representation. We now expose the benefits of this kernel formulation, and its
relation to classical non-positive definite kernel.
Kernel interpretation. Thanks to the gluing lemma [see, e.g., Peyré and Cuturi, 2019],
Pz(x, x0) is a valid transport plan and, empirically, a rough approximation of P(x, x0). Kz can
therefore be seen as a surrogate of a well-known kernel [Rubner et al., 2000], defined as
KOT(x, x0) :=
n
X
i,i0=1
P(x, x0)
ii0κ(xi, x0
i0).
(2.4)
When the entropic regularization ε is equal to 0, KOT is equivalent to the 2-Wasserstein distance
W2(x, x0) with ground metric dκ induced by kernel κ. KOT is generally not positive definite
(see Peyré and Cuturi [2019], Chapter 8.3) and computationally costly (the number of transport
plans to compute is quadratic in the number of sets to process whereas it is linear for Kz).
Now, we show the relationship between this kernel and our kernel Kz, which is proved in
Appendix 2.7.1.
Lemma 2.3.2 (Relation between P(x, x0) and Pz(x, x0) when ε = 0). For any x, x0 and z in
X with lengths n, n0 and p, by denoting W z
2
(x, x0) := hPz(x, x0), d2
κ
(x, x0)i1/2 we have
|W2(x, x0) − W z
2
(x, x0)| ≤ 2 min(W2(x, z), W2(x0, z)).
(2.5)
This lemma shows that the distance W z
2
resulting from Kz is related to the Wasserstein
distance W2; yet, this relation should not be interpreted as an approximation error as our
goal is not to approximate W2, but rather to derive a trainable embedding Φz(x) with good
computational properties. Lemma 2.3.2 roots our features and to some extent self-attention in
a rich optimal transport literature. In fact, W z
is equivalent to a distance introduced by Wang
2
et al. [2013b], whose properties are further studied by Moosmüller and Cloninger [2020]. A
major difference is that W z
crucially relies on Sinkhorn's algorithm so that the references can
2
be learned end-to-end, as explained below.
20
Figure 2.3: The input point cloud x is transported onto the reference z = (z1, . . . , zp) (top),
yielding the optimal transport plan Pκ(x, z) used to aggregate the embedded features and form
Φz(x) (bottom).
21
x1x2xnz1zpP11P2pPn1φ(x1)φ(x2)...φ(xn)Φz(x)1...Φz(x)pP11Pn1P2p2.3.3 From infinite-dimensional kernel embedding to finite dimension
In some cases, φ(x) is already finite-dimensional, which allows to compute the embedding Φz(x)
explicitly. This is particularly useful when dealing with large-scale data, as it enables us to use
our method for supervised learning tasks without computing the Gram matrix, which grows
quadratically in size with the number of samples. When φ is infinite or high-dimensional, it is
nevertheless possible to use an approximation based on the Nyström method [Williams and
Seeger, 2001], which provides an embedding ψ : Rd → Rk such that
hψ(xi), ψ(x0
j
)iRk ≈ κ(xi, x0
j
).
Concretely, the Nyström method consists in projecting points from the RKHS H onto a linear
subspace F, which is parametrized by k anchor points F = Span(φ(w1), . . . , φ(wk)). The
corresponding embedding admits an explicit form ψ(xi) = κ(w, w)−1/2κ(w, xi), where κ(w, w)
is the k × k Gram matrix of κ computed on the set w = {w1, . . . , wk} of anchor points and
κ(w, xi) is in Rk. Then, there are several ways to learn the anchor points: (a) they can be
chosen as random points from data; (b) they can be defined as centroids obtained by K-means,
see Zhang et al. [2008]; (c) they can be learned by back-propagation for a supervised task,
see Mairal [2016].
Using such an approximation within our framework can be simply achieved by (i) replacing
κ by a linear kernel and (ii) replacing each element xi by its embedding ψ(xi) in Rk and
considering a reference set with elements in Rk. By abuse of notation, we still use z for the new
parametrization. The embedding, which we use in practice in all our experiments, becomes
simply
Φz(x) = √
= √
p ×
n
X
i=1
P(ψ(x), z)i1ψ(xi),
. . . ,
P(ψ(x), z)ipψ(xi)
!
n
X
i=1
p × P(ψ(x), z)>ψ(x) ∈ Rp×k,
(2.6)
where p is the number of elements in z. Next, we discuss how to learn the reference set z.
2.3.4 Unsupervised and Supervised Learning of Parameter z
In the fashion of the Nyström approximation, the p elements of z
Unsupervised learning.
can be defined as the centroids obtained by K-means applied to all features from training sets
in X . A corollary of Lemma 2.3.2 suggests another algorithm: a bound on the deviation term
between W2 and W z
2
for m samples (x1, . . . , xm) is indeed
E 2 :=
1
m2
m
X
i,j=1
|W2(xi, xj) − W z
2
(xi, xj)|2 ≤
4
m
X
m
i=1
W 2
2
(xi, z).
(2.7)
The right-hand term corresponds to the objective of the Wasserstein barycenter problem [Cuturi
and Doucet, 2013], which yields the mean of a set of empirical measures (here the x's) under
the OT metric. The Wasserstein barycenter is therefore an attractive candidate for choosing
z. K-means can be seen as a particular case of Wasserstein barycenter when m = 1 [Cuturi
and Doucet, 2013, Ho et al., 2017] and is faster to compute. In practice, both methods yield
similar results, see Appendix 2.8, and we thus chose K-means to learn z in unsupervised settings
throughout the experiments. The anchor points w and the references z may be then computed
22
using similar algorithms; however, their mathematical interpretation differs as exposed above.
The task of representing features (learning w in Rd for a specific κ) is decoupled from the task
of aggregating (learning the reference z in Rk).
Supervised learning. As mentioned in Section 2.3.1, P(ψ(x), z) is computed using Sinkhorn's
algorithm, recalled in introduction, which can be easily adapted to batches of samples x, with
possibly varying lengths, leading to GPU-friendly forward computations of the embedding Φz.
More important, all Sinkhorn's operations are differentiable, which enables z to be optimized
with stochastic gradient descent through back-propagation [Genevay et al., 2018], e.g., for
minimizing a classification or regression loss function when labels are available. In practice, a
small number of Sinkhorn iterations (e.g., 10) is sufficient to compute P(ψ(x), z). Since the
anchors w in the embedding layer below can also be learned end-to-end [Mairal, 2016], our
embedding can thus be used as a module injected into any model, e.g, a deep network, as
demonstrated in our experiments.
2.3.5 Extensions
Integrating positional information into the embedding. The discussed embedding and
kernel do not take the position of the features into account, which may be problematic when
dealing with structured data such as images or sentences. To this end, we borrow the idea of
convolutional kernel networks, or CKN [Mairal, 2016, Mairal et al., 2014], and penalize the
similarities exponentially with the positional distance between a pair of elements in the input
and reference sequences. More precisely, we multiply P(ψ(x), z) element-wise by a distance
matrix S defined as:
Sij = e
− 1
σ2
pos
(i/n−j/p)2
,
and replace it in the embedding. With similarity weights based both on content and position,
the kernel associated to our embedding can be viewed as a generalization of the CKNs (whose
similarity weights are based on position only), with feature alignment based on optimal transport.
When dealing with multi-dimensional objects such as images, we just replace the index scalar i
with an index vector of the same spatial dimension as the object, representing the positions of
each dimension.
Using multiple references. A naive reconstruction using different references z1, . . . , zq in
X may yield a better approximation of the transport plan. In this case, the embedding of x
becomes
Φz1,...,zq (x) = 1/√
q (Φz1(x), . . . , Φzq (x)) ,
(2.8)
with q the number of references (the factor 1/√
q comes from the mean). Using Eq. (2.5), we
can obtain a bound similar to (2.7) for a data set of m samples (x1, . . . , xm) and q references
(see Appendix 2.7.2 for details). To choose multiple references, we tried a K-means algorithm
with 2-Wasserstein distance for assigning clusters, and we updated the centroids as in the
single-reference case. Using multiple references appears to be useful when optimizing z with
supervision (see Appendix 2.8).
23
Table 2.1: Relationship between Φz and transformer self-attention. k: a function describing how
the transformer integrates positional information; n: sequence length; q: number of references
or attention heads; d: dimension of the embeddings; p: number of supports in z. Typically,
p (cid:28) d. In recent transformer architectures, positional encoding requires learning additional
parameters (∼ qd2).
Self-Attention
Φz
Attention score
Size of score
Alignment w.r.t:
Learned + Shared
Nonlinear mapping
W = W >Q
O(n2)
x itself
W and Q
Feed-forward
Position encoding
Nb. parameters
Supervision
k(ti, t0
j)
∼ qd2
Needed
P
O(np)
z
z
φ or ψ
n − j
( i
− 1
σ2
e
pos
n0 )2
qpd
Not needed
2.4 Relation between our Embedding and Self-Attention
Our embedding and a single layer of transformer encoder, recalled in introduction, share the
same type of inductive bias, i.e, aggregating features relying on similarity weights. We now
clarify their relationship. Our embedding is arguably simpler (see respectively size of attention
and number of parameters in Table 2.1), and may compete in some settings with the transformer
self-attention as illustrated in Section 2.5.
Shared reference versus self-attention. There is a correspondence between the values,
attention matrix in the transformer and φ, P in Definition 2.3.1, yet also noticeable differences.
On the one hand, Φz aligns a given sequence x with respect to a reference z, learned with or
without supervision, and shared across the data set. Our weights are computed using optimal
transport. On the other hand, a transformer encoder performs self-alignment: for a given xi,
features are aggregated depending on a similarity score between xi and the elements of x only.
The similarity score is a matrix product between queries Q and keys K matrices, learned with
supervision and shared across the data set. In this regard, our work complements a recent line
of research questioning the dot-product, learned self-attention [Raganato et al., 2020, Weiqiu
et al., 2020]. Self-attention-like weights can also be obtained with our embedding by computing
P(x, zi)P(x, zi)> for each reference i. In that sense, our work is related to recent research
on efficient self-attention [Wang et al., 2020, Choromanski et al., 2020], where a low-rank
approximation of the self-attention matrix is computed.
Position smoothing and relative positional encoding. Transformers can add an abso-
lute positional encoding to the input features [Vaswani et al., 2017]. Yet, relative positional
encoding [Dai et al., 2019] is a current standard for integrating positional information: the
position offset between the query element and a given key can be injected in the attention
score [Tsai et al., 2019], which is equivalent to our approach. The link between CKNs and our
kernel, provided by this positional encoding, stands in line with recent works casting attention
and convolution into a unified framework [Andreoli, 2019]. In particular, Cordonnier et al.
24
[2020] show that attention learns convolution in the setting of image classification: the kernel
pattern is learned at the same time as the filters.
In the transformer architecture, the succession
Multiple references and attention heads.
of blocks composed of an attention layer followed by a fully-connected layer is called a head,
with each head potentially focusing on different parts of the input. Successful architectures
have a few heads in parallel. The outputs of the heads are then aggregated to output a final
embedding. A layer of our embedding with non-linear kernel κ can be seen as such a block,
with the references playing the role of the heads. As some recent works question the role of
attention heads [Voita et al., 2019, Michel et al., 2019], exploring the content of our learned
references z may provide another perspective on this question. More generally, visualization
and interpretation of the learned references could be of interest for biological sequences.
[Mialon et al., 2021a] was proposed at the same time as a line of
Efficient transformers.
work coined as "efficient transformers". These works sought to improve transformers both in
terms of memory and computational cost [Beltagy et al., 2020, Kitaev et al., 2020]. We refer the
reader to the following survey [Tay et al., 2020]. Although our work does not aim at challenging
transformers since we are rather interested in data constrained settings, it is interesting to note
that OTKE fits in different families of the taxonomy proposed by Tay et al. [2020]: anchors z
can be seen as a memory and P(x, zi) as a factorized approximation of an attention matrix.
2.5 Experiments
We now show the effectiveness of our embedding OTKE in tasks where samples can be expressed
as large sets with potentially few labels, such as in bioinformatics. We evaluate our embedding
alone in unsupervised or supervised settings, or within a model in the supervised setting. We
also consider NLP tasks involving shorter sequences and relatively more labels.
Note that experiments in bioinformatics (SCOP1.75 and DeepSEA) were conducted by
Dexiong Chen in the context of Mialon et al. [2021a] and already presented in Dexiong
Chen's PhD thesis [Chen, 2020]. Hence, they are not a contribution of the present thesis.
However, as these supplementary experiments provide insightful results and discussion,
we kept it in the main manuscript for completeness.
2.5.1 Datasets, Experimental Setup and Baselines
In unsupervised settings, we train a linear classifier with the cross entropy loss between true
labels and predictions on top of the features provided by our embedding (where the references
z and Nyström anchors w have been learned without supervision), or an unsupervised baseline.
In supervised settings, the same model is initialized with our unsupervised method and then
trained end-to-end (including z and w) by minimizing the same loss. We use an alternating
optimization strategy to update the parameters for both SCOP and SST datasets, as used
by Chen et al. [2019a,b]. We train for 100 epochs with Adam on both data sets: the initial
learning rate is 0.01, and get halved as long as there is no decrease in the validation loss for
5 epochs. The hyper-parameters we tuned include number of supports and references p, q,
25
Table 2.2: Classification accuracies for 5000 samples of CIFAR-10 using CKN features [Mairal,
2016] and forming Gram matrix. A random baseline would yield 10%.
Dataset
Kernel
Mean Pooling
Flatten
Sliced-Wasserstein [Kolouri et al., 2016]
Sliced-Wasserstein [Kolouri et al., 2016] + sin. pos enc. [Devlin et al., 2019]
KOT
KOT + our pos enc.
Kz
Kz + our pos enc.
(3 × 3), 256
Accuracy Runtime
58.5
67.6
63.8
66.0
64.5
67.1
67.9
70.2
∼ 30 sec
∼ 30 sec
∼ 2 min
∼ 2 min
∼ 20 min
∼ 20 min
∼ 30 sec
∼ 30 sec
entropic regularization in OT ε, the bandwidth of Gaussian kernels and the regularization
parameter of the linear classifier. The best values of ε and the bandwidth were found stable
across tasks, while the regularization parameter needed to be more carefully cross-validated.
Additional results and implementation details can be found in Appendix 2.8.
Experiments on Kernel Matrices (only for small data sets). Here, we compare the
optimal transport kernel KOT (2.4) and its surrogate Kz (2.3) (with z learned without super-
vision) to common and other OT kernels. Although our embedding Φz is scalable, the exact
kernel require the computation of Gram matrices. For this toy experiment, we therefore use
5000 samples only of CIFAR-10 (images with 32 × 32 pixels), encoded without supervision
using a two-layer convolutional kernel network [Mairal, 2016]. The resulting features are 3 × 3
patches living in Rd with d = 256 or 8192. KOT and Kz aggregate existing features depending
on the ground cost defined by −κ (Gaussian kernel) given the computed weight matrix P. In
that sense, we can say that these kernels work as an adaptive pooling. We therefore compare it
to kernel matrices corresponding to mean pooling and no pooling at all (linear kernel). We
also compare to a recent positive definite and fast optimal transport based kernel, the Sliced
Wasserstein Kernel [Kolouri et al., 2016] with 10, 100 and 1000 projection directions. We add a
positional encoding to it so as to have a fair comparison with our kernels. A linear classifier
is trained from this matrices. Although we cannot prove that KOT is positive definite, the
classifier trained on the kernel matrix converges when ε is not too small. The results can be
seen on Table 2.2. Without positional information, our kernels do better than Mean pooling.
When the positions are encoded, the Linear kernel is also outperformed. Note that including
positions in Mean pooling and Linear kernel means interpolating between these two kernels:
in the Linear kernel, only patches with same index are compared while in the Mean pooling,
all patches are compared. All interpolations did worse than the Linear kernel. The runtimes
illustrate the scalability of Kz.
CIFAR-10. Here, we test our embedding on the same data modality: we use CIFAR-10
features, i.e., 60, 000 images with 32 × 32 pixels and 10 classes encoded using a two-layer
CKN [Mairal, 2016], one of the baseline architectures for unsupervised learning of CIFAR-10,
and evaluate on the standard test set. The very best configuration of the CKN yields a small
26
Table 2.3: Hyperparameter search range for CIFAR-10
Hyperparameter
Search range
Entropic regularization ε
Position encoding bandwidth σpos
[1.0; 0.1; 0.01; 0.001]
[0.5; 0.6; 0.7; 0.8; 0.9; 1.0]
Table 2.4: Classification results using unsupervised representations for CIFAR-10 for two feature
configurations (extracted from a 2-layer unsupervised CKN with different number of filters).
We consider here our embedding with one reference and different number of supports, learned
with K-means, with or without position encoding (PE).
Method
Nb. supports
Flatten
Mean pooling
Gaussian pooling [Mairal, 2016]
16 × 16 × 256
73.1
64.9
77.5
16 × 16 × 1024
76.1
73.4
82.0
Ours
Ours (with PE)
Ours
Ours (with PE)
Ours
Ours (with PE)
9
64
144
75.6
78.0
77.9
81.4
78.4
81.8
79.3
82.2
80.1
83.2
80.7
83.4
number (3 × 3) of high-dimensional (16, 384) patches and an accuracy of 85.8%. We will
illustrate our embedding on a configuration which performs slightly less but provides more
patches (16 × 16), a setting for which it was designed.
The input of our embedding are unsupervised features extracted from a 2-layer CKN with
kernel sizes equal to 3 and 3, and Gaussian pooling size equal to 2 and 1. We consider the
following configurations of the number of filters at each layer, to simulate two different input
dimensions for our embedding:
• 64 filters at first and 256 at second layer, which yields a 16 × 16 × 256 representation for
each image.
• 256 filters at first and 1024 at second layer, which yields a 16 × 16 × 1024 representation
for each image.
Since the features are the output of a Gaussian embedding, κ in our embedding will be the
linear kernel. The embedding is learned with one reference and various supports using K-means
method described in Section 2.3, and compared to several classical pooling baselines, including
the original CKN's Gaussian pooling with pooling size equal to 6. The hyper-parameters are
the entropic regularization ε and bandwidth for position encoding σpos. Their search grids are
shown in Table 2.3 and the results in Table 2.4. Without supervision, the adaptive pooling of
the CKN features by our embedding notably improves their performance. We notice that the
position encoding is very important to this task, which substantially improves the performance
of its counterpart without it.
Sentiment analysis on Stanford Sentiment Treebank. SST-2 [Socher et al., 2013]
belongs to the NLP GLUE benchmark [Wang et al., 2019] and consists in predicting whether a
27
Table 2.5: Classification accuracies for SST-2 reported on standard validation set, averaged
from 10 different runs (q references × p supports).
Method
Unsupervised
Supervised
[CLS] embedding [Devlin et al., 2019]
Mean Pooling of BERT features [Devlin et al., 2019]
Approximate Rep the Set [Skianis et al., 2020]
Rep the Set [Skianis et al., 2020]
Set Transformer [Lee et al., 2019]
84.6±0.3
85.3±0.4
Not available.
Not available.
Not available.
Ours (dot-product instead of OT)
Ours (Unsupervised: 1 × 300. Supervised: 4 × 30)
85.7±0.9
86.8±0.3
90.3±0.1
90.8±0.1
86.8±0.9
87.1±0.5
87.9±0.8
86.9±1.1
88.1±0.8
movie review is positive. The dataset contains 70, 042 reviews. The test predictions need to
be submitted on the GLUE leaderboard, so that we remove a portion of the training set for
validation purpose and report accuracies on the actual validation set used as a test set. Our
model is one layer of our embedding with φ a Gaussian kernel mapping with 64 Nyström filters
in the supervised setting, and a linear mapping in the unsupervised setting. The features used in
our model and all baselines are word vectors with dimension 768 provided by the HuggingFace
implementation [Wolf et al., 2019] of the pre-trained transformer model BERT [Devlin et al.,
2019]. State-of-the-art accuracies are usually obtained after supervised fine-tuning of pre-trained
transformers. Training a linear model on pre-trained features after simple pooling (e.g, mean)
also yields good results. [CLS], which denotes the BERT embedding used for classification, is
also a common baseline. The results are shown in Table 2.5.
Additional experiments: Protein fold classification on SCOP 1.75. We follow the
protocol described by Hou et al. [2019] for this important task in bioinformatics. The dataset
contains 19, 245 sequences from 1, 195 different classes of fold (hence less than 20 labels in
average per class). The sequence lengths vary from tens to thousands. Each element of a
sequence is a 45-dimensional vector. The objective is to classify the sequences to fold classes,
which corresponds to a multiclass classification problem. The features fed to the linear classifier
are the output of our embedding with φ the Gaussian kernel mapping on k-mers (subsequences
of length k) with k fixed to be 10, which is known to perform well in this task [Chen et al.,
2019a]. The number of anchor points for Nyström method is fixed to 1024 and 512 respectively
for unsupervised and supervised setting. In the unsupervised setting, we compare our method
to state-of-the-art unsupervised method for this task: CKN [Chen et al., 2019a], which performs
a global mean pooling in contrast to the global adaptive pooling performed by our embedding.
In the supervised setting, we compare the same model to the following supervised models: CKN,
Recurrent Kernel Networks (RKN) [Chen et al., 2019b], a CNN with 10 convolutional layers
named DeepSF [Hou et al., 2019], Rep the Set [Skianis et al., 2020] and Set Transformer [Lee
et al., 2019], using the public implementations by their authors. Rep the Set and Set Transformer
are used on the top of a convolutional layer of the same filter size as CKN to extract k-mer
features. Their model hyper-parameters, weight decay and learning rate are tuned in the same
way as for our models (see Appendix for details). The default architecture of Set Transformer
did not perform well due to overfitting. We thus used a shallower architecture with one Induced
Set Attention Block (ISAB), one Pooling by Multihead Attention (PMA) and one linear layer,
similar to the one-layer architectures of CKN and our model. The results are shown in Table 2.6.
28
Table 2.6: Classification accuracy (top 1/5/10) on test set for SCOP 1.75 for different unsuper-
vised and supervised baselines, averaged from 10 different runs (q references × p supports).
Method
Unsupervised
Supervised
DeepSF [Hou et al., 2019]
CKN [Chen et al., 2019a]
RKN [Chen et al., 2019b]
Set Transformer [Lee et al., 2019]
Approximate Rep the Set [Skianis et al., 2020]
Ours (dot-product instead of OT)
Ours (Unsup.: 1 × 100 / Sup.: 5 × 10)
Not available.
81.8±0.8/92.8±0.2/95.0±0.2
Not available.
Not available.
Not available.
78.2±1.9/93.1±0.7/96.0±0.4
73.0/90.3/94.5
84.1±0.1/94.3±0.2/96.4±0.1
85.3±0.3/95.0±0.2/96.5±0.1
79.2±4.6/91.5±1.4/94.3±0.6
84.5±0.6/94.0±0.4/95.7±0.4
87.5±0.3/95.5±0.2/96.9±0.1
85.8±0.2/95.3±0.1/96.8±0.1 88.7±0.3/95.9±0.2/97.3±0.1
Table 2.7: Results for prediction of chromatin profiles on the DeepSEA dataset. The metrics
are area under ROC (auROC) and area under PR curve (auPRC), averaged over 919 chromatin
profiles. Due to the huge size of the dataset, we only provide results based on a single run.
Method
auROC
auPRC
DeepSEA [Zhou and Troyanskaya, 2015]
Ours with position encoding (Sinusoidal [Vaswani et al., 2017]/Ours)
0.933
0.917/0.936
0.342
0.311/0.360
Additional experiments: Detection of chromatin profiles. Predicting the chromatin
features such as transcription factor (TF) binding from raw genomic sequences has been studied
extensively in recent years. CNNs with max pooling operations have been shown effective for
this task. Here, we consider DeepSEA dataset [Zhou and Troyanskaya, 2015] consisting in
simultaneously predicting 919 chromatin profiles, which can be formulated as a multi-label
classification task. DeepSEA contains 4, 935, 024 DNA sequences of length 1000 and each of
them is associated with 919 different labels (chromatin profiles). Each sequence is represented
as a 1000 × 4 binary matrix through one-hot encoding and the objective is to predict which
profiles a given sequence possesses. As this problem is very imbalanced for each profile, learning
an unsupervised model could require an extremely large number of parameters. We thus only
consider our supervised embedding as an adaptive pooling layer and inject it into a deep
neural network, between one convolutional layer and one fully connected layer, as detailed
in Appendix 2.8.2. In our embedding, φ is chosen to be identity and the positional encoding
described in Section 2.3 is used. We compare our model to a state-of-the-art CNN with 3
convolutional layers and two fully-connected layers [Zhou and Troyanskaya, 2015]. The results
are shown in Table 2.7.
2.5.2 Results and discussion
In protein fold classification, our embedding outperforms all baselines in both unsupervised and
supervised settings. Surprisingly, our unsupervised model also achieves better results than most
supervised baselines. In contrast, Set Transformer does not perform well, possibly because its
implementation was not designed for sets with varying sizes, and tasks with few annotations.
In detection of chromatin profiles, our model (our embedding within a deep network) has
fewer layers than state-of-the-art CNNs while outperforming them, which advocates for the
use of attention-based models for such applications. Our results also suggest that positional
information is important (CIFAR-10 results and Appendix 2.8.2), and our Gaussian position
29
encoding outperforms the sinusoidal one introduced in Vaswani et al. [2017]. Note that in
contrast to a typical transformer, which would have stored a 1000 × 1000 attention matrix, our
attention score with a reference of size 64 is only 1000 × 64, which illustrates the discussion
in Section 2.4. In NLP, an a priori less favorable setting since sequences are shorter and
there are more data, our supervised embedding gets close to a strong state-of-the-art, i.e. a
fully-trained transformer. We observed our method to be much faster than RepSet, as fast as
Set Transformer, yet slower than ApproxRepSet (2.8.1). Using the OT plan as similarity score
yields better accuracies than the dot-product between the input sets and the references (see
Table 2.6; 2.5).
Choice of parameters. This paragraph sums up the impact of hyper-parameter choices.
Experiments justifying our claims can be found in Appendix 2.8.
- Number of references q: for biological sequences, a single reference was found to be enough
in the unsupervised case, see Table 2.11. In the supervised setting, Table 2.14 suggests
that using q = 5 provides slightly better results but q = 1 remains a good baseline, and
that the sensitivity to number of references is moderate.
- Number of supports p in a reference: Table 2.11 and Table 2.14 suggest that the sensitivity
of the model to the number of supports is also moderate.
- Nyström anchors: an anchor can be seen as a neuron in a feed-forward neural network
(see expression of ψ in 2.3.3). In unsupervised settings, the more anchors, the better the
approximation of the kernel matrix. Then, the performance saturates, see Table 2.12.
In supervised settings, the optimal number of anchors points is much smaller, as also
observed by Chen et al. [2019a], Fig 6.
- Bandwidth σ in Gaussian kernel: σ was chosen as in Chen et al. [2019b] and we did not
try to optimize it in this work, as it seemed to already provide good results. Nevertheless,
slightly better results can be obtained when tuning this parameter, for instance in SST-2.
OTKE and self-supervised methods. Our approach should not be positioned against
self-supervision and instead brings complementary features: the OTKE may be plugged in
state-of-the-art models pre-trained on large unannotated corpus. For instance, on SCOP 1.75,
we use ESM-1 [Rives et al., 2019], pre-trained on 250 millions protein sequences, with mean
pooling followed by a linear classifier. As we do not have the computational ressources to
fine-tune ESM1-t34, we only train a linear layer on top of the extracted features. Using the same
model, we replace the mean pooling by our (unsupervised) OTKE layer, and also only train
the linear layer. This results in accuracy improvements as showed in Table 2.8. While training
huge self-supervised learning models on large datasets is very effective, ESM1-t34 admits more
than 2500 times more parameters than our single-layer OTKE model (260k parameters versus
670M) and our single-layer OTKE outperforms smaller versions of ESM1 (43M parameters).
Finally, self-supervised pre-training of a deep model including OTKE on large data sets would
be interesting for fair comparison.
Multi-layer extension. Extending the OTKE to a multi-layer embedding is a natural yet not
straightforward research direction: it is not clear how to find a right definition of intermediate
feature aggregation in a multi-layer OTKE model. Note that for DeepSEA, our model with
30
Table 2.8: Classification accuracy (top 1/5/10) results of our unsupervised embedding for SCOP
1.75 with pre-trained ESM models [Rives et al., 2019].
Model
Nb parameters
Mean Pooling
Unsupervised OTKE
ESM1-t6-43M-UR50S
ESM1-t34-670M-UR50S
43M
670M
84.01/93.17/95.07
94.95/97.32/97.91
85.91/93.72/95.30
95.22/97.32/98.03
single-layer OTKE already outperforms a multi-layer CNN, which suggests that a multi-layer
OTKE is not always needed.
2.6 Conclusion
We showed the effectiveness of OTKE for pooling in sequences in the context of bioinformatics
and natural language processing: our model is more expressive than mean, max or sum and
competitive with attention mechanisms in terms of sample complexity and model size. In the
next chapter, we will explain how pooling is also an important component of a family of neural
networks for graphs (GNNs). This pooling is often limited to the closest neighbors of the graph
nodes, which leads to issues when processing graphs with complex interactions between distant
nodes. In the philosophy of this chapter, we will see graphs as sequences and aggregate node
features across the whole graph, an inductive bias different from that of GNNs. While OTKE
used basic position encoding scheme and focused on the pooling mechanism, next chapter will
do the opposite, relying on simple attention mechanisms for feature aggregation and introducing
new mechanisms, or inductive biases, for encoding the position of the nodes, and more globally
the structure of the graph.
31
Appendix
Appendix 2.7 contains the proofs skipped in the main part of the chapter; Appendix 2.8 provides
additional experimental results as well as details on our protocol for reproducibility.
2.7 Proofs
2.7.1 Proof of Lemma 2.3.2
Proof. First, since Pn0
j=1 pP(x0, z)jk = 1 for any k, we have
W2(x, z)2 =
=
n
X
p
X
i=1
n
X
k=1
p
X
i=1
k=1
= kuk2
2,
P(x, z)ikd2
κ
(xi, zk)
n0
X
j=1
pP(x0, z)jkP(x, z)ikd2
κ
(xi, zk)
with u a vector in Rnn0p whose entries are q
pP(x0, z)jkP(x, z)ikdκ(xi, zk) for i = 1, . . . , n,
(x, x0) as an '2-norm of a vector v in
j = 1, . . . , n0 and k = 1, . . . , p. We can also rewrite W z
2
Rnn0p whose entries are q
). Then by Minkowski inequality for the
'2-norm, we have
pP(x0, z)jkP(x, z)ikdκ(xi, x0
j
|W2(x, z) − W z
2
(x, x0)| = |kuk2 − kvk2|
≤ ku − vk2
n
X
p
X
n0
X
pP(x0, z)jkP(x, z)ik(dκ(xi, zk) − dκ(xi, x0
j))2
1/2
=
≤
i=1
k=1
j=1
n
X
p
X
n0
X
i=1
k=1
j=1
pP(x0, z)jkP(x, z)ikd2
κ
(x0
j, zk)
1/2
=
p
X
n0
X
1/2
P(x0, z)jkd2
κ
(x0
j, zk)
j=1
k=1
= W2(x0, z),
where the second inequality is the triangle inequality for the distance dκ. Finally, we have
(x, x0)|
≤|W2(x, x0) − W2(x, z)| + |W2(x, z) − W z
2
≤W2(x0, z) + W2(x0, z)
=2W2(x0, z),
|W2(x, x0) − W z
2
(x, x0)|
where the second inequality is the triangle inequality for the 2-Wasserstein distance. By
symmetry, we also have |W2(x, x0) − W z
2
(x, x0)| ≤ 2W2(x, z), which concludes the proof.
32
2.7.2 Relationship between W2 and W z
Using the relation proved in Appendix 2.7.1, we can obtain a bound on the error term between
W2 and W z
for a data set of m samples (x1, . . . , xm) and q references (z1, . . . , zq)
2
2 for multiple references
E 2 :=
1
m2
m
X
i,j=1
|W2(xi, xj) − W z1,...,zq
2
(xi, xj)|2 ≤
4
m
X
q
X
mq
i=1
j=1
W 2
2
(xi, zj).
(2.9)
When q = 1, the right-hand term in the inequality is the objective to minimize in the Wasserstein
barycenter problem [Cuturi and Doucet, 2013], which further explains why we considered it:
Once W z
is close to the Wasserstein distance W2, Kz will also be close to KOT. We extend here
2
the bound in (2.7) in the case of one reference to the multiple-reference case. The approximate
2-Wasserstein distance W z
2
(x, x0) thus becomes
W z1,...,zq
2
(x, x0) :=
* 1
q
q
X
j=1
Pzj (x, x0), d2
κ
(x, x0)
+1/2
=
1
q
q
X
j=1
1/2
W zj
2
(x, x0)2
.
Then by Minkowski inequality for the '2-norm we have
|W2(x, x0) − W z1,...,zq
2
(x, x0)| =
≤
and by (2.7) we have
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1/2
W2(x, x0)2
−
1
q
q
X
j=1
1
q
q
X
j=1
W zj
2
(x, x0)2
1/2(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1
q
q
X
(W2(x, x0) − W zj
2
(x, x0))2
,
1/2
j=1
|W2(x, x0) − W z1,...,zq
2
(x, x0)| ≤
4
q
q
X
j=1
min(W2(x, zj), W2(x0, zj))2
.
1/2
Finally the approximation error in terms of Frobenius is bounded by
E 2 :=
1
m2
m
X
i,j=1
|W2(xi, xj) − W z1,...,zq
2
(xi, xj)|2 ≤
4
m
X
q
X
mq
i=1
j=1
W 2
2
(xi, zj).
In particular, when q = 1 that is the case of single reference, we have
E 2 ≤
4
m
X
m
i=1
W 2
2
(xi, z),
where the right term equals to the objective of the Wasserstein barycenter problem, which
justifies the choice of z when learning without supervision.
2.8 Additional Experiments and Setup Details
This section contains additional results for the experiments of the main section; details on our
setup, in particular hyper-parameter tuning for our methods and the baselines.
33
2.8.1 Protein fold recognition
Dataset description. Our protein fold recognition experiments consider the Structural
Classification Of Proteins (SCOP) version 1.75 and 2.06. We follow the data preprocessing
protocols in Hou et al. [2019], which yields a training and validation set composed of 14699
and 2013 sequences from SCOP 1.75, and a test set of 2533 sequences from SCOP 2.06. The
resulting protein sequences belong to 1195 different folds, thus the problem is formulated as
a multi-classification task. The input sequence is represented as a 45-dimensional vector at
each amino acid. The vector consists of a 20-dimensional one-hot encoding of the sequence, a
20-dimensional position-specific scoring matrix (PSSM) representing the profile of amino acids,
a 3-class secondary structure represented by a one-hot vector and a 2-class solvent accessibility.
The lengths of the sequences are varying from tens to thousands.
Models setting and hyperparameters. We consider here the one-layer models followed
by a global mean pooling for the baseline methods CKN [Chen et al., 2019a] and RKN [Chen
et al., 2019b]. We build our model on top of the one-layer CKN model, where κ can be seen as
a Gaussian kernel on the k-mers in sequences. The only difference between our model and CKN
is thus the pooling operation, which is given by our embedding introduced in Section 2.3. The
bandwidth parameter of the Gaussian kernel κ on k-mers is fixed to 0.6 for unsupervised models
and 0.5 for supervised models, the same as used in CKN which were selected by the accuracy
on the validation set. The filter size k is fixed to 10 and different numbers of anchor points in
Nyström for κ are considered in the experiments. The other hyperparameters for our embedding
are the entropic regularization parameter ε, the number of supports in a reference p, the
number of references q, the number of iterations for Sinkhorn's algorithm and the regularization
parameter λ in the linear classifier. The search grid for ε and λ is shown in Table 2.9 and they
are selected by the accuracy on validation set. ε plays an important role in the performance
and is observed to be stable for the same dataset. For this dataset, it is selected to be 0.5 for all
the unsupervised and supervised models. The effect of other hyperparameters will be discussed
below.
For the baseline methods, the accuracies of PSI-BLAST and DeepSF are taken from Hou
et al. [2019]. The hyperparameters for CKN and RKN can be found in Chen et al. [2019b].
For Rep the Set [Skianis et al., 2020] and Set Transformer [Lee et al., 2019], we use the public
implementations by the authors. These two models are used on the top of a convolutional layer
of the same filter size as CKN to extract k-mer features. As the exact version of Rep the Set
does not provide any implementation for back-propagation to a bottom layer of it, we consider
the approximate version of Rep the Set only, which also scales better to our dataset. The
default architecture of Set Transformer did not perform well due to overfitting. We therefore
used a shallower architecture with one ISAB, one PMA and one linear layer, similar to the
one-layer architectures of CKN and our model. We tuned their model hyperparameters, weight
decay and learning rate. The search grids for these hyperparameters are shown in Table 2.10.
Unsupervised embedding. The kernel embedding φ, which is infinite dimensional for the
Gaussian kernel, is approximated with the Nyström method using K-means on 300000 k-mers
extracted from the same training set as in Chen et al. [2019b]. The reference measures are
learned by using either K-means or Wasserstein to update centroids in 2-Wasserstein K-means
on 3000 subsampled sequences for RAM-saving reason. We evaluate our model on top of features
extracted from CKNs of different dimensions, representing the number of anchor points used to
34
Table 2.9: Hyperparameter search grid for SCOP 1.75
Hyperparameter
Search range
ε for Sinkhorn
λ for classifier (unsupervised setting)
λ for classifier (supervised setting)
[1.0; 0.5; 0.1; 0.05; 0.01]
1/2range(5,20)
[1e-6;1e-5;1e-4;1e-3]
Table 2.10: Hyperparameter search grid for SCOP 1.75 baselines.
Model and Hyperparameter
Search range
ApproxRepSet: Hidden Sets × Cardinality
ApproxRepSet: Learning Rate
ApproxRepSet: Weight Decay
Set Transformer: Heads × Dim Hidden
Set Transformer: Learning Rate
Set Transformer: Weight Decay
[20; 30; 50; 100] × [10; 20; 50]
[0.0001; 0.0005; 0.001]
[1e-5;1e-4;1e-3;1e-2]
[1; 4; 8] × [64; 128; 256]
[0.0001; 0.0005; 0.001]
[1e-5;1e-4;1e-3;1e-2]
approximate κ. The number of iterations for Sinkhorn is fixed to 100 to ensure the convergence.
The results for different combinations of q and p are provided in Table 2.11. Increasing the
number of supports p can improve the performance and then saturate it when p is too large.
On the other hand, increasing the number of references while keeping the embedding dimension
(i.e. p × q) constant is not significantly helpful in this unsupervised setting. We also notice
that Wasserstein Barycenter for learning the references does not outperform K-means, while
the latter is faster in terms of computation.
Supervised embedding. Our supervised embedding is initialized with the unsupervised
method and then trained in an alternating fashion which was also used for CKN: we use an
Adam algorithm to update anchor points in Nyström and reference measures z, and the L-BFGS
algorithm to optimize the classifier. The learning rate for Adam is initialized with 0.01 and
halved as long as there is no decrease of the validation loss for 5 successive epochs. In practice,
we notice that using a small number of Sinkhorn iterations can achieve similar performance to a
large number of iteration, while being much faster to compute. We thus fix it to 10 throughout
the experiments. The accuracy results are obtained by averaging on 10 runs with different
seeds following the setting in Chen et al. [2019b]. The results are shown in Table 2.13 with
error bars. The effect of the number of supports q is similar to the unsupervised case, while
increasing the number of references can indeed improve performance.
2.8.2 Detection of chromatin profiles
Dataset description. Predicting the functional effects of non-coding variants from only
genomic sequences is a central task in human genetics. A fundamental step for this task
is to simultaneously predict large-scale chromatin features from DNA sequences [Zhou and
Troyanskaya, 2015]. We consider here the DeepSEA dataset, which consists in simultaneously
predicting 919 chromatin profiles including 690 transcription factor (TF) binding profiles for 160
different TFs, 125 DNase I sensitivity profiles and 104 histone-mark profiles. In total, there are
4.4 million, 8000 and 455024 samples for training, validation and test. Each sample consists of
35
Table 2.11: Classification accuracy (top 1/5/10) results of our unsupervised embedding for
SCOP 1.75. We show the results for different combinations of (number of references q × number
of supports p). The reference measures z are learned with either K-means or Wasserstein
barycenter for updating centroids.
Nb. filters Method
128
K-means
Wass. bary.
1024
K-means
q
1
5
10
1
5
10
1
5
10
10
Embedding size (q × p)
100
50
200
76.5/91.5/94.4
72.8/89.9/93.7
62.7/85.8/91.1
77.5/91.7/94.5
77.8/91.7/94.6
76.5/91.0/94.2
79.4/92.4/94.9
78.6/91.9/94.6
78.1/92.2/94.9
78.7/92.1/95.1
78.1/92.1/94.7
78.6/92.2/94.7
64.0/85.9/91.5
70.5/89.1/93.0
63.0/85.7/91.0
71.6/88.9/93.2
76.6/91.3/94.4
75.9/91.4/94.3
77.2/91.4/94.2
78.4/91.7/94.3
77.5/91.9/94.6
77.5/91.9/94.8
77.1/91.9/94.7
77.7/92.0/94.7
84.4/95.0/96.6
81.1/94.0/96.2
79.8/93.5/95.9
84.6/95.0/97.0
84.9/94.8/96.8
83.1/94.6/96.6
85.7/95.3/96.7
84.7/94.4/96.7
84.4/94.7/96.7
85.4/95.2/96.7
85.2/95.0/96.7
84.8/94.9/96.7
Table 2.12: Classification accuracy (top 1/5/10) results of our unsupervised embedding for
SCOP 1.75. We show the results for different number of Nyström anchors. The number of
references and supports are fixed to 1 and 100.
Number of anchors
Accuracies
1024
2048
3072
85.8/95.3/96.8
86.6/95.9/97.2
87.8/96.1/97.4
Table 2.13: Classification accuracy (top 1/5/10) of supervised models for SCOP 1.75. The
accuracies obtained by averaging 10 different runs. We show the results of using either one
reference with 50 supports or 5 references with 10 supports. Here DeepSF is a 10-layer CNN
model.
Method
Runtime
Top 1/5/10 accuracy on SCOP 2.06
PSI-BLAST [Hou et al., 2019]
DeepSF [Hou et al., 2019]
Set Transformer [Lee et al., 2019]
ApproxRepSet [Skianis et al., 2020]
Number of filters
CKN [Chen et al., 2019a]
RKN [Chen et al., 2019b]
Ours
Φz (1 × 50)
Φz (5 × 10)
-
-
3.3h
2h
1.5h
-
3.5h
4h
84.53/86.48/87.34
73.00/90.25/94.51
79.15±4.61/91.54±1.40/94.33±0.63
84.51±0.58/94.03±0.44/95.73±0.37
128
512
76.30±0.70/92.17±0.16/95.27±0.17
77.82±0.35/92.89±0.19/95.51±0.20
84.11±0.11/94.29±0.20/96.36±0.13
85.29±0.27/94.95±0.15/96.54±0.12
82.83±0.41/93.89±0.33/96.23±0.12
84.68±0.50/94.68±0.29/96.49±0.18
88.40±0.22/95.76±0.13/97.10±0.15
88.66±0.25/95.90±0.15/97.33±0.14
36
Table 2.14: Classification accuracy (top 1/5/10) results of our supervised embedding for SCOP
1.75. We show the results for different combinations of (number of references q × number of
supports p). The reference measures z are learned with K-means.
Embedding size (q × p)
q = 1
q = 2
q = 5
q = 10
10
50
100
200
88.3/95.5/97.0
87.8/95.8/97.0
87.0/95.1/96.7
84.5/93.6/95.6
88.4/95.8/97.2
89.6/96.2/97.5
88.8/96.0/97.2
89.8/96.0/97.2
87.1/94.9/96.7
86.5/94.9/96.6
87.4/95.4/97.0
88.0/95.7/97.0
87.7/94.9/96.3
87.6/94.9/96.3
87.4/94.7/96.2
85.6/94.4/96.1
Table 2.15: Model architecture for DeepSEA dataset.
Model architecture
Conv1d(in channels=4, out channels=d, kernel size=16) + ReLU
(Ours) EmbeddingLayer(in channels=d, supports=64, references=1, ε = 1.0, PE=True, σpos = 0.1)
Linear(in channels=d, out channels=d) + ReLU
Dropout(0.4)
Linear(in channels=d × 64, out channels=919) + ReLU
Linear(in channels=919, out channels=919)
a 1000-bp DNA sequence from the human GRCh37 reference. Each sequence is represented as a
1000 × 4 binary matrix using one-hot encoding on DNA characters. The dataset is available at
http://deepsea.princeton.edu/media/code/deepsea_train_bundle.v0.9.tar.gz. Note
that the labels for each profile are very imbalanced in this task with few positive samples. For
this reason, learning unsupervised models could be intractable as they may require an extremely
large number of parameters if junk or redundant sequences cannot be filtered out.
Model architecture and hyperparameters. For the above reason and fair comparison,
we use here our supervised embedding as a module in Deep NNs. The architecture of our model
is shown in Table 2.15. We use an Adam optimizer with initial learning rate equal to 0.01 and
halved at epoch 1, 4, 8 for 15 epochs in total. The number of iterations for Sinkhorn is fixed
to 30. The whole training process takes about 30 hours on a single GTX2080TI GPU. The
dropout rate is selected to be 0.4 from the grid [0.1; 0.2; 0.3; 0.4; 0.5] and the weight decay is
1e-06, the same as Zhou and Troyanskaya [2015]. The σpos for position encoding is selected to
be 0.1, by the validation accuracy on the grid [0.05; 0.1; 0.2; 0.3; 0.4; 0.5]. The checkpoint with
the best validation accuracy is used to evaluate on the test set. Area under ROC (auROC) and
area under precision curve (auPRC), averaged over 919 chromatin profiles, are used to measure
the performance. The hidden size d is chosen to be either 1024 or 1536.
Results and importance of position encoding. We compare our model to the state-
of-the-art CNN model DeepSEA [Zhou and Troyanskaya, 2015] with 3 convolutional layers,
whose best hyper-parameters can be found in the corresponding paper. Our model outperforms
DeepSEA, while requiring fewer layers. The positional information is known to be important
in this task. To show the efficacy of our position encoding, we compare it to the sinusoidal
encoding used in the original transformer [Vaswani et al., 2017]. We observe that our encoding
with properly tuned σpos requires fewer layers, while being interpretable from a kernel point of
37
Table 2.16: Results for prediction of chromatin profiles on the DeepSEA dataset. The metrics
are area under ROC (auROC) and area under PR curve (auPRC), averaged over 919 chromatin
profiles. The accuracies are averaged from 10 different runs. Armed with the positional
encoding (PE) described in Section 2.3, our embedding outperforms the state-of-the-art model
and another model of our embedding with the PE proposed in Vaswani et al. [2017].
Method
Position encoding
DeepSEA
-
Ours
Sinusoidal [Vaswani et al., 2017]
auROC
auPRC
0.933
0.342
0.917
0.311
Ours (d = 1024) Ours (d = 1536)
Ours
0.935
0.354
Ours
0.936
0.360
view. We also find that larger hidden size d performs better, as shown in Table 2.16. ROC
and PR curves for all the chromatin profiles and stratified by transcription factors, DNase
I-hypersensitive sites and histone-marks can also be found in Figure 2.4.
2.8.3 SST-2
Dataset description. The data set contains 67,349 training samples and 872 validation
samples and can be found at https://gluebenchmark.com/tasks. The test set contains 1,821
samples for which the predictions need to be submitted on the GLUE leaderboard, with limited
number of submissions. As a consequence, our training and validation set are extracted from
the original training set (80% of the original training set is used for our training set and
the remaining 20% is used for our validation set), and we report accuracies on the standard
validation set, used as a test set. The reviews are padded with zeros when their length is shorter
than the chosen sequence length (we choose 30 and 66, the latter being the maximum review
length in the data set) and the BERT implementation requires to add special tokens [CLS] and
[SEP] at the beginning and the end of each review.
In most transformers such as BERT, the
Model architecture and hyperparameters.
embedding associated to the token [CLS] is used for classification and can be seen in some
sense as an embedding of the review adapted to the task. The features we used are the word
features provided by the BERT base-uncased version, available at https://huggingface.co/
transformers/pretrained_models.html. For this version, the dimension of the word features
is 768. Our model is one layer of our embedding, with φ the Gaussian kernel mapping with
varying number of Nyström filters in the supervised setting, and the Linear kernel in the
unsupervised setting. We do not add positional encoding as it is already integrated in BERT
features. In the unsupervised setting, the output features are used to train a large-scale linear
classifier, a Pytorch linear layer. We choose the best hyper-parameters based on the accuracy
of a validation set. In the supervised case, the parameters of the previous model, w and z,
are optimized end-to-end. In this case, we tune the learning rate. In both case, we tune the
entropic regularization parameter of optimal transport and the bandwidth of the Gaussian
kernel. The parameters in the search grid are summed up in Table 2.18. The best entropic
regularization and Gaussian kernel bandwidth are typically and respectively 3.0 and 0.5 for
this data set. The supervised training process takes between half an hour for smaller models
(typically 128 filters in w and 3 supports in z) and a few hours for larger models (256 filters
and 100 supports) on a single GTX2080TI GPU. The hyper-parameters of the baselines were
38
Figure 2.4: ROC and PR curves for all the chromatin profiles (first row) and stratified by
transcription factors (left column), DNase I-hypersensitive sites (middle column) and histone-
marks (right column). The profiles with positive samples fewer than 50 on the test set are not
taken into account.
39
Table 2.17: Accuracies on standard validation set for SST-2 with our unsupervised features
depending on the number of references and supports. The references were computed using
K-means on samples for multiple references and K-means on patches for multiple supports.
The size of the input BERT features is (length × dimension). The accuracies are averaged from
10 different runs. (q references × p supports)
BERT Input Feature Size
(30 × 768)
(66 × 768)
Features
[CLS]
Flatten
Mean pooling
Φz (1 × 3)
Φz (1 × 10)
Φz (1 × 30)
Φz (1 × 100)
Φz (1 × 300)
Pre-trained Fine-tuned Pre-trained Fine-tuned
84.6±0.3
84.9±0.4
85.3±0.3
85.5±0.1
85.1±0.4
86.3±0.3
85.7±0.7
86.8±0.3
90.3±0.1
91.0±0.1
90.8±0.1
90.9±0.1
90.9±0.1
90.8±0.1
90.9±0.1
90.9±0.1
86.0±0.2
85.2±0.3
85.4±0.3
86.5±0.1
85.9±0.3
86.6±0.5
86.6±0.1
87.2±0.1
92.8±0.1
92.5±0.1
92.6±0.2
92.6±0.1
92.6±0.1
92.6±0.1
92.7±0.1
92.7±0.1
Table 2.18: Hyperparameter search grid for SST-2.
Hyperparameter
Search range
Entropic regularization ε
λ for classifier (unsupervised setting)
Gaussian kernel bandwidth
Learning rate (supervised setting)
[0.5; 1.0; 3.0; 10.0]
10range(−10,1)
[0.4; 0.5; 0.6; 0.7; 0.8]
[0.1; 0.01; 0.001]
similarly tuned, see 2.19. Mean Pooling and [CLS] embedding did not require any tuning except
for the regularization λ of the classifier, which followed the same grid as in Table 2.18.
Results and discussion. As explained in Section 2.5, our unsupervised embedding improves
the BERT pre-trained features while still using a simple linear model as shown in Table 2.17,
and its supervised counterpart enables to get even closer to the state-of-the art (for the BERT
base-uncased model) accuracy, which is usually obtained after fine-tuning of the BERT model
on the whole data set. This can be seen in Tables 2.20; 2.21. We also add a baseline consisting
of one layer of classical self-attention, which did not do well hence was not reported in the main
text.
Table 2.19: Hyperparameter search grid for SST-2 baselines.
Model and Hyperparameter
Search range
RepSet and ApproxRepSet: Hidden Sets × Cardinality
ApproxRepSet: Learning Rate
Set Transformer: Heads × Dim Hidden
Set Transformer: Learning Rate
[4; 20; 30; 50; 100] × [3; 10; 20; 30; 50]
[0.0001; 0.001; 0.01]
[1; 4] × [8; 16; 64; 128]
[0.001; 0.01]
40
Table 2.20: Classification accuracy on standard validation set of supervised models for SST-2,
with pre-trained BERT (30 × 768) features. The accuracies of our embedding were averaged
from 3 different runs before being run 10 times for the best results for comparison with baselines,
cf. Section 2.5. 10 Sinkhorn iterations were used. (q references × p supports).
Method
Accuracy on SST-2
Number of Nyström filters
32
64
128
Φz (1 × 3)
Φz (1 × 10)
Φz (1 × 30)
Φz (4 × 3)
Φz (4 × 10)
Φz (4 × 30)
88.38
88.11
88.30
88.07
87.6
88.18
88.38
88.15
88.30
88.26
87.84
88.68
88.18
87.61
88.26
88.30
88.11
88.07
Table 2.21: Classification accuracy on standard validation set of all baselines for SST-2, with
pre-trained BERT (30 × 768) features, averaged from 10 different runs.
Method
Accuracy on SST-2
[CLS] embedding [Devlin et al., 2019]
Mean Pooling of BERT features [Devlin et al., 2019]
One Self-Attention Layer [Vaswani et al., 2017]
Approximate Rep the Set [Skianis et al., 2020]
Rep the Set [Skianis et al., 2020]
Set Transformer [Lee et al., 2019]
Φz (1 × 30) (dot-product instead of OT)
90.3±0.1
90.8 ± 0.1
83.7±0.1
86.8±0.9
87.1±0.5
87.9±0.8
86.9±1.1
41
Chapter 3
Encoding Graph Structure in
Transformers with Kernels on
Graphs
We show that viewing graphs as sets of node features and incorporating structural and positional
information into a transformer architecture is able to outperform representations learned with
classical graph neural networks (GNNs). Our model, GraphiT, encodes such information by
(i) leveraging relative positional encoding strategies in self-attention scores based on positive
definite kernels on graphs, and (ii) enumerating and encoding local sub-structures such as
paths of short length. We thoroughly evaluate these two ideas on many classification and
regression tasks, demonstrating the effectiveness of each of them independently, as well as their
combination. In addition to performing well on standard benchmarks, our model also admits
natural visualization mechanisms for interpreting graph motifs explaining the predictions,
making it a potentially strong candidate for scientific applications where interpretation is
important.1
This chapter is based on the following material:
- G. Mialon*, D. Chen*, M. Selosse*, J. Mairal. "GraphiT: Encoding Graph Structure
in Transformers" (preprint arXiv:2106.05667).
3.1
Introduction
Graph-structured data are present in numerous scientific applications and are the subject of
growing interest. Examples of such data are as varied as proteins in computational biology [Senior
et al., 2020], which may be seen as a sequence of amino acids, but also as a graph representing
their tertiary structure, molecules in chemo-informatics [Duvenaud et al., 2015], shapes in
computer vision and computer graphics [Verma et al., 2018], electronic health records, or
communities in social networks. In the case of molecules for examples, the atoms can be seens
1Code available at https://github.com/inria-thoth/GraphiT.
42
Figure 3.1: A molecule of Theobromin, hypothetically responsible for the positive effect of
chocolate on the mood (from Wikipedia).
as nodes and chemical bonds as edges as in Figure 3.1. Designing graph representations for
machine learning is a particularly active area of research, even though not new [Borgwardt et al.,
2020], with a strong effort currently focused on graph neural networks [Bronstein et al., 2017,
Chen et al., 2020, Kipf and Welling, 2017, Scarselli et al., 2008, Veličković et al., 2018, Xu et al.,
2019]. A major difficulty is to find graph representations that are computationally tractable,
adaptable to a given task, and capable of distinguishing graphs with different topological
structures and local characteristics.
In this work, we are interested in the transformer, which has become the standard architecture
for natural language processing [Vaswani et al., 2017], and is gaining ground in computer
vision [Dosovitskiy et al., 2021] and computational biology [Rives et al., 2019]. The ability
of a transformer to aggregate information across long contexts for sequence data makes it an
interesting challenger for GNNs that successively aggregate local information from neighbors in
a multilayer fashion. In contrast, a single self-attention layer of the transformer can potentially
allow all the nodes of an input graph to communicate. The price to pay is that this core
component is invariant to permutations of the input nodes, hence does not take the topological
structure of the graph into account and looses crucial information.
For sequence data, this issue is addressed by encoding positional information of each token
and giving it to the transformer architecture. For graphs, the problem is more challenging as
there is no single way to encode node positions. For this reason, there have been few attempts
to use vanilla transformers for graph representation. To the best of our knowledge, the closest
work to ours seems to be the graph transformer architecture of Dwivedi and Bresson [2021],
who propose an elegant positional encoding strategy based on the eigenvectors of the graph
Laplacian [Belkin and Niyogi, 2003]. However, they focus on applying attention to neighboring
nodes only, as in GNNs, and their results suggest that letting all nodes communicate is not a
competitive approach.
Our work provides another perspective and reaches a slightly different conclusion; we show
that even though local communication is indeed often more effective, the transformer with
global communication can also achieve good results. For that, we introduce a set of techniques
to encode the local graph structure within our model, GraphiT (encoding graph structure
in transformers). More precisely, GraphiT relies on two ingredients that may be combined,
or used independently. First, we propose relative positional encoding strategies for weighting
43
attention scores by using positive definite kernels, a viewpoint introduced for sequences in Tsai
et al. [2019]. This concept is particularly appealing for graphs since it allows to leverage the
rich literature on kernels on graphs Kondor and Vert [2004], Smola and Kondor [2003], which
are powerful tools for encoding the similarity between nodes. The second idea consists in
computing features encoding the local structure in the graph. To achieve this, we leverage the
principle of graph convolutional kernel networks (GCKN) of Chen et al. [2020], which consists
in enumerating and encoding small sub-structure (for instance, paths or subtree patterns),
which may then be used as an input to the transformer model.
We demonstrate the effectiveness of our approach on several classification and regression
benchmarks, showing that GraphiT with global or local attention layer can outperform GNNs
in various tasks, and also show that basic visualization mechanisms allow us to automatically
discover discriminative graph motifs, which is potentially useful for scientific applications where
interpretation is important.
Contributions.
In summary, our contribution is three-folds:
- We introduce two mechanism within the transformer architecture to integrate structural
information from graphs.
- We demonstrate the effectiveness of this approach, which is able to outperform GNNs in
various tasks.
- We show that basic visualization mechanisms allows to recover meaningful graph motifs.
3.2 Related work
Graph kernels. A classical way to represent graphs for machine learning tasks consists
in defining a high-dimensional embedding for graphs, which may then be used to perform
prediction with a linear models (e.g., support vector machines). Graph kernels typically
provide such embeddings by counting the number of occurrences of local substructures that
are present within a graph [Borgwardt et al., 2020]. The goal is to choose substructures
leading to expressive representations sufficiently discriminative, while allowing fast algorithms
to compute the inner-products between these embeddings. For instance, walks have been used
for such a purpose [Gärtner et al., 2003], as well as shortest paths [Borgwardt and Kriegel,
2005], subtrees [Harchaoui and Bach, 2007, Mahé and Vert, 2009, Shervashidze et al., 2011],
or graphlets [Shervashidze et al., 2009]. Our work uses short paths, but other substructures
could be used in principle. Note that graph kernels used in the context of comparing graphs,
is a line of work different from the kernels on graphs that we will introduce in Section 3.3 for
computing embeddings of nodes.
Graph neural networks. Originally introduced in Scarselli et al. [2008], GNNs have been
derived as an extension of convolutions for graph-structured data: they use a message passing
paradigm in which vectors (messages) are exchanged (passed) between neighboring nodes whose
representations are updated using neural networks. Many strategies have been proposed to
aggregate features of neighboring nodes (see, e.g, Bronstein et al. [2017], Duvenaud et al.
[2015]). The graph attention network (GAT) [Veličković et al., 2018] is the first model to use an
attention mechanism for aggregating local information. Recently, hybrid approaches between
44
graph neural networks and graph kernels were proposed in Chen et al. [2020], Du et al. [2019].
Diffusion processes on graphs that are related to the diffusion kernel we consider in our model
were also used within GNNs in Klicpera et al. [2019].
Transformers for graph-structured data. Prior to Dwivedi and Bresson [2021], there
were some attempts to use transformers in the context of graph-structured data. The authors
of Li et al. [2019] propose to apply attention to all nodes, yet without position encoding.
In Zhang et al. [2020], a transformer architecture called Graph-BERT is fed with sampled
subgraphs of a single graph in the context of node classification and graph clustering. They
also propose to encode positions by aggregating different encoding schemes. However, these
encoding schemes are either impossible to use in our settings as they require having sampled
subgraphs of regular structures as input, or less competitive than Laplacian eigenvectors as
observed in Dwivedi and Bresson [2021]. The transformer model introduced in Yun et al. [2019]
needs to first transform an heterogeneous graph into a new graph structure via meta-paths,
which does not directly operate on node features. To the best of our knowledge, our work is
the first to demonstrate that vanilla transformers with appropriate node position encoding can
compete with GNNs in graph prediction tasks.
3.3 Preliminaries about Kernels on Graphs
Spectral graph analysis. The Laplacian of a graph with n nodes is defined as L = D − A,
where D is a n × n diagonal matrix that carries the degrees of each node on the diagonal
and A is the adjacency matrix. Interestingly, L is a positive semi-definite matrix such that
for all vector u in Rn, u>Lu = P
(u[i] − u[j])2, which can be interpreted as the amount of
"oscillation" of the vector u, hence its "smoothness', when seen as a function on the nodes of
the graph.
i∼j
The Laplacian is often used via its eigenvalue decomposition L = P
, where the
eigenvalue λi = u>
i Lui characterizes the amount of oscillation of the corresponding eigenvector ui.
For this reason, this decomposition is traditionally viewed as the discrete equivalent to the
sine/cosine Fourier basis in Rn and associated frequencies. Note that very often the normalized
Laplacian I − D− 1
2 is used instead of L, which does not change the above interpretation.
Interestingly, it is then possible to define a whole family of positive definite kernels on the
graph [Smola and Kondor, 2003] by applying a regularization function r to the spectrum of L.
We therefore get a rich class of kernels
i λiuiu>
i
2 AD− 1
Kr =
m
X
i=1
r(λi)uiu>
i ,
(3.1)
= Pm
i ui)2/r(λi) from a reproducing kernel
associated with the following norm kf k2
r
Hilbert space (RKHS), where r : R 7→ R+
is a non-increasing function such that smoother
∗
functions on the graph would have smaller norms in the RKHS. We now introduce two examples.
(f >
i=1
Diffusion Kernel Kondor and Vert [2004].
which gives:
It corresponds to the case r(λi) = e−βλi,
KD =
m
X
i=1
e−βλiuiu>
i
= e−βL = lim
p→+∞
(cid:18)
I −
(cid:19)p
.
β
p
L
(3.2)
45
Figure 3.2: Diffusion kernel (β = 1) for a molecular graph from the MUTAG dataset used in
our experiments. Neighboring nodes have higher values. Note that nodes that are structurally
similar, such as 7 and 8, have similar entries.
The diffusion kernel can be seen as a discrete equivalent of the Gaussian kernel, a solution of
the heat equation in the continuous setting, hence its name. Intuitively, the diffusion kernel
between two nodes can be interpreted as the quantity of some substance that would accumulate
at the first node after a given amount of time (controlled by β) if we injected the substance at
the other node and let it diffuse through the graph. An illustration of the diffusion kernel is
presented in Figure 3.2. It is related to the random walk kernel that will be presented below.
p-step random walk kernel. By taking r(λi) = (1 − γλi)p , we obtain a kernel that admits
an interpretation in terms of p steps of a particular random walk on the graph:
KpRW = (I − γL)p.
(3.3)
It is related to the diffusion kernel by choosing γ = β/p and taking the limit with p → +∞,
according to (3.2). Unlike the diffusion kernel which yields a dense matrix, the random walk
kernel is sparse and has limited connectivity, meaning that two nodes are connected in KpRW
only if there exists a path of length p between them. As these kernels on graphs reflect the
structural similarity of the nodes independently of their features, it is natural to use the resulting
Gram matrix to encode such a structure within the transformer model, as detailed next.
3.4 Encoding Graph Structure in Transformers
In this section, we detail the architecture and structure encoding strategies behind GraphiT.
In particular, we build upon the findings of Tsai et al. [2019] for our architectural choices and
46
propose new strategies for encoding structural information in the transformer architecture.
3.4.1 Transformer Architectures for Graphs
We process graphs with a vanilla transformer encoder architecture [Vaswani et al., 2017] for
solving classification and regression tasks, by seeing graphs as sets of node features. We first
present the transformer without encoding the graph structure, before introducing mechanisms
for encoding nodes positions in Section 3.4.2, and then topological structures in Section 3.4.3.
Specifically, a transformer is composed of a sequence of layers, which process an input set of din
features represented by a matrix X in Rn×din, and compute another set in Rn×dout. A critical
component is the attention mechanism:
Attention(Q, V ) = softmax
!
QQ>
√
dout
V ∈ Rn×dout,
(3.4)
with Q> = WQX > is called the query matrix, V > = WV X > the value matrix, and WQ, WV in
Rdout×din are projection matrices that are learned. Note that following the recommendation
of Tsai et al. [2019], we use the same matrix for keys and queries. This allows us to define a
symmetric and positive definite kernel on pairs of nodes and thus to combine with other kernels
on graph. This also reduces the number of parameters in our models without hurting the
performance in practice. During the forward pass, the feature map X is updated in a residual
fashion (with either din = dout or with an additional projection matrix when the dimensions do
not match, omitted here for simplicity) as follows:
X = X + Attention(Q, V ).
Note that transformers without position encoding and GNNs are tightly connected: a
GNN can be seen as a transformer where aggregation is performed on neighboring nodes
only, and a transformer as a GNN processing a fully-connected graph. However, even in this
case, differences would remain between common GNNs and Transformers, as the latter use
for example LayerNorm and skip-connections. In this work, we will either adopt the local
aggregation strategy, or let all nodes communicate in order to test this inductive bias in the
context of graphs, where capturing long range interactions between nodes may be useful for
some tasks.
3.4.2 Encoding Node Positions
The output of the transformer is invariant to permutations in the input data. It is therefore
crucial to provide the transformer with information about the data structure. In this section,
we revisit previously proposed strategies for sequences and graphs and devise new methods
for positional encoding. Note that a natural baseline is simply to adopt a local aggregation
strategy similar to Veličković et al. [2018] or Dwivedi and Bresson [2021] for example.
Existing Strategies for Sequences and Graphs
In NLP,
Absolute and relative positional encoding in transformers for sequences.
positional information was initially encoded by adding a vector based on sinusoidal functions
to each of the input token features Vaswani et al. [2017]. This approach was coined as absolute
47
position encoding and proved to be also useful for other data modalities [Dosovitskiy et al., 2021,
Dwivedi and Bresson, 2021]. In relative position encoding, which was proposed later [Parikh
et al., 2016, Shaw et al., 2018], positional information is added to the attention logits and in
the values. This information only depends on the relative distance between the two considered
elements in the input sequence.
Absolute positional encoding for graphs. Whereas positional encodings can be hand-
crafted or learned relatively easily for sequences and images, which respectively admit a chain
or grid structure, this task becomes non-trivial for graphs, whose structure may vary a lot inside
a data set, besides the fact that the concept of node position is ill-defined. To address these
issues, an absolute position encoding scheme was recently proposed in Dwivedi and Bresson
[2021], by leveraging the graph Laplacian (LapPE). More precisely, each node of each graph is
assigned a vector containing the first k coordinates of the node in the eigenbasis of the graph
normalized Laplacian sorted in ascending order of the eigenvalues. Since the first eigenvector
associated to the eigenvalue 0 is constant, the first coordinate is omitted.
As detailed in Section 3.3, these eigenvectors oscillate more and more and the corresponding
coordinates are often interpreted as Fourier coefficients representing frequency components in
increasing order. Note that eigenvectors of the Laplacian computed on different graphs could
not be compared to each other in principle, and are also only defined up to a ±1 factor. While
this raises a conceptual issue for using them in an absolute positional encoding scheme, it is
shown in Dwivedi and Bresson [2021]-and confirmed in our experiments-that the issue is
mitigated by the Fourier interpretation, and that the coordinates used in LapPE are effective
in practice for discriminating between nodes in the same way as the position encoding proposed
in Vaswani et al. [2017] for sequences. Yet, because the eigenvectors are defined up to a ±1
factor, the sign of the encodings needs to be randomly flipped during the training of the network.
In the next section, we introduce a novel strategy in the spirit of relative positional encoding
that does not suffer from the previous conceptual issue, and can also be combined with LapPE
if needed.
Relative Position Encoding Strategies by Using Kernels on Graphs
Modulating the transformer attention. To avoid the issue of transferability of the abso-
lute positional encoding between graphs, we use information on the nodes structural similarity
to bias the attention scores. More precisely, and in the fashion of the last chapter, or Tsai et al.
[2019] for sequences, we modulate the attention kernel using the Gram matrix of some kernel
on graphs described in Section 3.3 as follows:
PosAttention(Q, V, Kr) = normalize
exp
!
!
(cid:12) Kr
V ∈ Rn×dout,
(3.5)
QQ>
√
dout
with the same Q and V matrices, and Kr a kernel on the graph. "exp" denotes the elementwise
exponential of the matrix entries and normalize means '1-normalization on rows such that
normalization(exp(u))=softmax(u). The reason for multiplying the exponential of the attention
logits before '1-normalizing the rows is that it corresponds to a classical kernel smoothing.
Indeed, if we consider the PosAttention output for a node i:
PosAttention(Q, V, Kr)i =
n
X
j=1
exp (cid:0)QiQ>
j /√
exp (cid:0)QiQ>
dout
j0/√
(cid:1) × Kr(i, j)
dout
(cid:1) × Kr(i, j0)
Pn
j0=1
Vj ∈ Rdout,
48
we obtain a typical smoothing, i.e, a linear combination of features with weights determined
by a non-negative kernel, here k(i, j) := exp(QiQ>
dout) × Kr(i, j), and summing to 1. In
fact, k can be considered as a new kernel between nodes i and j made by multiplying a kernel
based on positions (Kr) and a kernel based on content (via Q). As observed in Tsai et al.
[2019] for sequences, modulating the attention logits with a kernel on positions is related to
relative positional encoding [Shaw et al., 2018], where we bias the attention matrix with a term
depending only on the relative difference in positions between the two elements in the input set.
Moreover, during the forward pass, the feature map X is updated as follows:
j /√
X = X + D− 1
2 PosAttention(Q, V, Kr),
(3.6)
where D is the matrix of node degrees. We found such a normalization with D−1/2 to be
beneficial in our experiments since it reduces the overwhelming influence of highly connected
graph components. Note that, as opposed to absolute position encoding, we do not add
positional information to the values and the model does not rely on the transferability of
eigenvectors between different Laplacians.
Interestingly, the choice of the kernel enables to
Choice of kernels and parameters.
encode a priori knowledge directly within the model architecture, while the parameter has an
influence on the attention span. For example, in the diffusion kernel, β can be seen as the
duration of the diffusion process. The smaller it is, the more focused the attention on the close
neighbors. Conversely, a large β corresponds to an homogeneous attention span. As another
example, it is clear that the choice of p in the random walk kernel corresponds to visiting at best
p-degree neighbors. In our experiments, the best kernel may vary across datasets, suggesting
that long-range global interactions are of different importance depending on the task. For
example, on the dataset PROTEINS (see Section 4.5), the vanilla transformer without using
any structural information performs very well.
3.4.3 Encoding Topological Structures
Position encoding aims at adding positional only information to the feature vector of an input
node or to the attentions scores. Substructures is a different type of information, carrying
local positional information and content, which has been heavily used within graph kernels,
see Section 3.2. In the context of graphs neural networks, this idea was exploited in the graph
convolutional kernel network model (GCKN) of Chen et al. [2020], which is a hybrid approach
between GNNs and graph kernels based on substructure enumeration (e.g., paths). Among
different strategies we experimented, enriching nodes features with the output of a GCKN layer
turned out to be a very effective strategy.
Graph convolutional kernel networks (GCKN). GCKNs Chen et al. [2020] is a multi-
layer model that produces a sequence of graph feature maps akin to a GNN. The main difference
is that each layer enumerates local sub-structures at each node (here, paths of length k), encodes
them using a kernel embedding, and aggregates the resulting sub-structure representations.
This results in a feature map that carries more information about the graph structure than
traditional neighborhood aggregation based GNNs, which is appealing for transformers since
the vanilla version is blind to the graph structure.
49
Formally, let us consider a graph G with n nodes, and let us denote by Pk(u) the set of
paths shorter than or equal to k that start with node u. With an abuse of notation, p in Pk(u)
will denote the concatenation of all node features encountered along the path. Then, a layer of
GCKN defines a feature map X in Rn×d such that
X(u) = X
ψ(p),
p∈Pk(u)
where X(u) is the column of X corresponding to node u and ψ is a d-dimensional embedding
of the path features p. More precisely, the path features in Chen et al. [2020] are embedded to
a RKHS by using a Gaussian kernel, and a finite-dimensional approximation is obtained by
using the Nyström method Williams and Seeger [2001]. The embedding is parametrized and
can be learned without or with supervision (see Chen et al. [2020] for details). Moreover, path
features of varying lengths up to a maximal length can be used with GCKN. In this work, we
evaluate the strategy of encoding a node as the concatenation of its original features and those
produced by one GCKN layer. This strategy has proven to be very successful in practice.
3.5 Experiments
In this section, we evaluate instances of GraphiT as well as popular GNNs and position
encoding baselines on various graph classification and regression tasks. We want to answer
several questions:
Q1: Can vanilla transformers, when equipped with appropriate position encoding and/or
structural information, outperform GNNs in graph classification and regression tasks?
Q2: Is kernel-based relative positional encoding more effective than the absolute position
encoding provided by the eigenvectors of the Laplacian (LapPE)?
Q3: What is the most effective way to encode graph structure information within transformers?
We also discuss our results and conduct ablation studies. Finally, we demonstrate the ability
of attention scores to highlight meaningful graph features when using kernel-based positional
encoding.
3.5.1 Methodology
Benchmark and baselines. We benchmark our methods on various graph classification
datasets with discrete node labels (MUTAG, PROTEINS, PTC, NCI1) and one regression
dataset with discrete node labels (ZINC). These datasets can be obtained e.g via the Pytorch
Geometric toolbox [Fey and Lenssen, 2019]. We compare our models to the following GNN
models: Molecular Fingerprint (MF) [Duvenaud et al., 2015], Graph Convolutional Networks
(GCN) [Kipf and Welling, 2017], Graph Attention Networks (GAT) [Veličković et al., 2018],
Graph Isomorphism Networks (GIN) [Xu et al., 2019] and finally Graph Convolutional Kernel
Networks (GCKN) [Chen et al., 2020]. In particular, GAT is an important baseline as it
uses attention to aggregate neighboring node information. We compare GraphiT to the
transformer architecture proposed in Dwivedi and Bresson [2021] and also use their Laplacian
absolute position encoding as a baseline for evaluating our graph kernel relative position
encoding. All models are implemented in Pytorch and our code is available online at https:
//github.com/inria-thoth/GraphiT.
50
Reporting scores. For all datasets except ZINC, we sample ten times random train/val/test
splits, of size 80/10/10, respectively. For each split, we evaluate all methods by (i) training
several models on the train fold with various hyperparameters; (ii) performing model selection
on val, by averaging the validation accuracy of a model on its last 50 epochs; (iii) retraining the
selected model on train+val; (iv) estimate the test score by averaging the test accuracy over the
last 50 epochs. The results reported in our tables are then averaged over the ten splits. This
procedure is a compromise between a double-nested cross validation procedure that would be too
computationally expensive and reporting 10-fold cross validation scores that would overestimate
the test accuracy. For ZINC, we use the same train/val/test splits as in Dwivedi and Bresson
[2021], train GraphiT with 10 layers, 8 heads and 64 hidden dimensions as in Dwivedi and
Bresson [2021], and report the average test mean absolute error on 4 independent runs.
Optimization procedure and hyperparameter search. Our models are trained with the
Adam optimizer by decreasing the learning rate by a factor of 2 each 50 epochs. For classification
tasks, we train about the same number (81) of models with different hyperparameters for each
GNN and transformer method, thus spending a similar engineering effort on each method. For
GNN models, we select the best type of global pooling, number of layers and hidden dimensions
from three different values. Regarding transformers, we select the best number of heads instead
of global pooling type for three different values. For all considered models, we also select the
best learning rate and weight decay from three different values and the number of epochs is fixed
to 300 to guarantee the convergence. For the ZINC dataset, we found that a standard warmup
strategy suggested for transformers in Vaswani et al. [2017] leads to more stable convergence
for larger models. The rest of the hyperparameters remains the same as used in Dwivedi and
Bresson [2021]. More details and precise grids for hyperparameter search can be found in
Appendix 3.8.
3.5.2 Results and Discussion
Comparison of GraphiT and baselines methods. We show our results in Table 3.1. For
smaller datasets such as MUTAG, PROTEINS or PTC, our Transformer without positional
encoding performs reasonably well compared to GNNs, whereas for NCI1 and ZINC, incor-
porating structural information into the model is key to good performance. On all datasets,
GraphiT is able to perform as well as or better than the baseline GNNs. In particular on ZINC,
GraphiT outperforms all previous baseline methods by a large margin. For this, it seems that
the factor D−1/2 in (3.6) is important, allowing to capture more information about the graph
structure. The answer to Q1 is therefore positive.
Comparison of relative position encoding schemes. Here, we compare our transformer
used with different relative positional encoding strategies, including adjacency (1-step RW
kernel with γ = 1.0 corresponding to a normalized adjacency matrix D−1/2AD−1/2) which is
symmetric but not positive semi-definite, 2 and 3-step RW kernel with γ = 0.5 and a diffusion
kernel with β = 1. Unlike the vanilla transformer that works poorly on big datasets including
NCI1 and ZINC, keeping all nodes communicate through our diffusion kernel positional encoding
can still achieve performances close to encoding methods relying on local communications such
as adjacency or p-step kernel encoding. Interestingly, our adjacency encoding, which could be
seen as a variant of the neighborhood aggregation of node features used in GAT, is shown to
51
Table 3.1: Average mean classification accuracy/mean absolute error.
Method / Dataset
Size
Classes
Max. number of nodes
MF [Duvenaud et al., 2015]
GCN [Kipf and Welling, 2017]
GAT [Veličković et al., 2018]
GIN [Xu et al., 2019]
GCKN-subtree [Chen et al., 2020]
[Dwivedi and Bresson, 2021]
[Dwivedi and Bresson, 2021] + LapPE
Transformers (T)
T + LapPE
T + Adj PE
T + 2-step RW kernel
T + 3-step RW kernel
T + Diffusion kernel
T + GCKN
T + GCKN + 2-step RW kernel
T + GCKN + Adj PE
MUTAG PROTEINS
PTC
NCI1
ZINC (no edge feat.)
188
2
28
81.5±11.0
78.9±10.1
80.3±8.5
82.6±6.2
87.8±9.4
79.3±11.6
83.9±6.5
82.2±6.3
85.8±5.9
87.2±9.8
85.3±6.9
83.3±6.3
82.7±7.6
84.4±7.8
90.4±5.8
90.5±7.0
1113
2
620
71.9±5.2
75.8±5.5
74.8±4.1
73.1±4.6
72.0±3.7
65.8±3.1
70.1±3.2
75.6±4.9
74.6±2.7
72.4±4.9
72.8±4.5
76.2±4.4
74.6±4.2
69.5±3.8
72.5±4.6
71.1±6.9
344
2
109
57.3±6.9
54.0±6.3
55.0±6.0
55.0±8.7
62.1±6.4
58.4±8.2
57.7±3.1
58.1±10.5
55.6±5.0
59.9±5.9
62.0±9.4
61.0±6.2
59.1±7.4
61.5±5.8
58.4±7.6
57.9±4.2
4110
2
111
80.6±2.5
75.9±1.6
76.8±2.1
81.7±1.7
79.6±1.8
78.9±1.1
80.0±1.9
70.0±4.5
74.6±1.9
79.7±2.0
78.0±1.5
77.6±3.6
78.9±1.6
78.1±5.1
81.0±1.8
81.4±2.2
12k
Reg.
37
0.387±0.019
0.367±0.011
0.384±0.007
0.387±0.015
0.474±0.001
0.359±0.014
0.323±0.013
0.696±0.007
0.507±0.003
0.243±0.005
0.243±0.010
0.244±0.011
0.255±0.010
0.274±0.011
0.213±0.016
0.211±0.010
be very effective on many datasets. In general, sparse local positional encoding seems to be
useful for our prediction tasks, which tempers the answer to Q1.
In this paragraph, we
Comparison of structure encoding schemes in node features.
compare different ways of injecting graph structures to the vanilla transformer, including
Laplacian PE [Dwivedi and Bresson, 2021] and unsupervised GCKN-path features [Chen et al.,
2020]. We observe that incorporating topological structures directly into the features of input
nodes is a very useful strategy for vanilla transformers. This yields significant performance
improvement on almost all datasets except PROTEINS, by either using the Laplacian PE or
GCKN-path features. Among them, GCKN features are observed to outperform Laplacian PE
by a large margin, except on MUTAG and PROTEINS (third column of Table 3.2). A possible
reason for this exception is that PROTEINS seems to be very specific, such that prediction
models do not really benefit from encoding positional information. In particular, GCKN brings
a pronounced performance boost on ZINC, suggesting the importance of encoding substructures
like paths for prediction tasks on molecules.
Combining relative position encoding and structure encoding in node features.
Table 3.2 reports the ablation study of the transformer used with or without structure encoding
and coupled or not with a relative positional encoding. The results show that relative PE
outperforms the topological Laplacian PE, suggesting a positive answer to Q2. However, using
both simultaneously improves the results considerably, especially on ZINC. In fact, combining
relative position encoding and a structure encoding scheme globally improves the performances.
In particular, using the GCKN-path layer features works remarkably well for all datasets except
PROTEINS. More precisely, we see that the combination of GCKN with the adjacent matrix
PE yields the best results among the other combinations for MUTAG and NCI1. In addition,
the GCKN coupled with the 3-step RW kernel achieves the second best performance for ZINC.
52
Table 3.2: Ablation: comparison of different structural encoding schemes and their combinations.
Dataset
MUTAG
PROTEINS
PTC
NCI1
ZINC
Structure encoding
in node features
None
LapPE
GCKN
None
LapPE
GCKN
None
LapPE
GCKN
None
LapPE
GCKN
None
LapPE
GCKN
T vanilla
82.2±6.3
85.8±5.9
84.4±7.8
75.6±4.9
74.6±2.7
69.5±3.8
58.1±10.5
55.6±5.0
61.5±5.8
70.0±4.5
74.6±1.9
78.1±5.1
0.696±0.007
0.507±0.003
0.274±0.011
Relative positional encoding in attention scores
T + 2-step
T + 3-step
T + Adj
87.2±9.8
86.0±4.2
90.5±7.0
72.4±4.9
74.7±5.2
71.1±6.9
59.9±5.9
57.1±3.8
57.9±4.2
79.7±2.0
78.7±1.9
81.4±2.2
0.243±0.005
0.202±0.011
0.211±0.010
85.3±6.9
84.7±4.7
90.4±5.8
72.8±4.5
75.0±4.7
72.5±4.6
62.0±9.4
58.8±6.6
58.4±7.6
78.0±1.5
78.4±1.3
81.0±1.8
0.243±0.010
0.227±0.030
0.213±0.016
83.3±6.3
83.5±5.2
90.0±6.3
76.2±4.4
74.3±5.3
70.0±5.1
61.0±6.2
57.1±5.3
55.2±8.8
77.6±3.6
78.7±1.5
81.0±1.8
0.244±0.011
0.210±0.003
0.203±0.011
T + Diffusion
82.7±7.6
84.2±7.2
90.0±6.8
74.6±4.2
74.7±5.3
72.4±4.9
59.1±7.4
57.3±7.8
55.9±8.1
78.9±1.6
77.8±1.0
81.0±2.0
0.255±0.010
0.221±0.038
0.218±0.006
The answer to Q3 is therefore combining a structure encoding scheme in node features, such as
GCKN, with relative positional encoding.
Discussion. Combining transformer and GCKN features results in substantial improvement
over the simple sum or mean global pooling used in original GCKN models on ZINC dataset
as shown in Table 3.1, which suggests that transformers can be considered as a very effective
method for aggregating local substructure features on large datasets at the cost of using
much more parameters. This point of view has also been explored in the previous chapter,
which introduces a different form of attention for sequence and text classification. A potential
limitation of GraphiT is its application to large graphs, as the complexity of the self-attention
mechanism scales quadratically with the size of the input sequence. However, and as mentionned
in Chapter 2, a recent line of work coined as efficient transformers alleviated these issues both
in terms of memory and computational cost and we refer the reader to the following survey [Tay
et al., 2020].
3.5.3 Visualizing attention scores for the Mutagenicity dataset.
We now show that the attention yields visualization mechanisms for detecting important graph
motifs.
In chemistry, a mutagen is a compound that causes genetic mutations. This
Mutagenicity.
important property is related to the molecular substructures of the compound. The Mutagenicity
dataset [Kersting et al., 2016] contains 4337 molecules to be classified as mutagen or not, and
aims at better understanding which substructures cause mutagenicity. We train GraphiT
with diffusion position encoding on this dataset with the aim to study whether important
substructures can be detected. To this end, we feed the model with molecules of the dataset
and collect the attention scores of each layer averaged by heads, as can be seen in Figure 3.4
for the molecules of Figure 3.3.
53
(a) Nitrothiopheneamide-methylbenzene
(b) Aminofluoranthene
Figure 3.3: Examples of molecules from Mutagenicity correctly classified as mutagenetic by our
model.
54
COHNS01234567891011121314151617181920212223242526270123456789101112131415161718192021222324252627Figure 3.4: Attention scores averaged by heads for each layer of our trained model for the
compounds in Figures 3.3a (Left) and 3.3b (Right). Top Left: diffusion kernel for 3.3a. Bottom
Left: node 8 (N of NO2) is salient. Top Right: diffusion kernel for 3.3b. Bottom Right: node 14
(N of NH2) is salient.
55
0510152025051015202505101520250510152025Layer 10510152025051015202505101520250510152025Layer 10510152025051015202505101520250510152025Layer 20510152025051015202505101520250510152025Layer 205101520250510152025NNLayer 305101520250510152025NNLayer 3Attention scores interpretation. While the scores in the first layer are close to the diffusion
kernel, the following layers get sparser. Since the attention matrix is multiplied on the right
by the values, the coefficients of the node aggregation step for the n-th node is given by the
n-th row of the attention matrix. As a consequence, salient columns suggest the presence of
important nodes. After verification, for many samples of Mutagenicity fed to our model, salient
atoms indeed represent important groups in chemistry, many of them being known for causing
mutagenicity.
In compound 3.3a, the N atom of the nitro group
Nitrothiopheneamide-methylbenzene.
(NO2) is salient. 3.3a was correctly classified as a mutagen by our model and the nitro group is
indeed known for its mutagenetic properties [Chung et al., 1996]. Note how information flows
from O atoms to N in the first two layers and then, at the last layer, how every element of the
carbon skeleton look at N, i.e the NO2 group.
Aminofluoranthene. We can apply the same reasoning for the amino group (NH2) in
compound 3.3b [Berry et al., 1985]. We were also able to identify long-range intramolecular
hydrogen bounds such as between H and Cl in other samples.
1,2-Dibromo-3-Chloropropane (DBCP). DBCP in Figure 3.5a was used as a soil fumi-
gant in various countries. It was banned from use in the United Stated in 1979 after evidences
that DBCP causes diseases, male sterility, or blindness, which can be instances of mutagenicity.
In Figure 3.6, attention focuses on the carbon skeleton and on the two Bromine (Br) atoms,
the latter being indeed known for being associated with mutagenicity [Låg et al., 1994].
Nitrobenzene-nitroimidazothiazole. This compound is shown in Figure 3.5b. As for
compound 3.3a in Section 3.5.3, our model puts emphasis on two nitro groups which are indeed
known for inducing mutagenicity.
Triethylenemelamine. Triethylenemelamine in Figure 3.7 is a compound exhibiting mu-
tagenic properties, and is used to induce cancer in experimental animal models. Our model
focuses on the three nitrogen atoms of the aziridine groups which are themselves mutagenic
compounds.
56
(a) 1,2-Dibromo-3-Chloropropane.
(b) Nitrobenzene-nitroimidazothiazole.
57
COClHNBrS012345678910012345678910111213141516171819202122232425Figure 3.6: Attention scores averaged by heads for each layer of our trained model for the
compounds in Figure 3.5a and Figure 3.5b. Top Left: diffusion kernel for 3.5a. Bottom Left:
node 3 and 5 (Br) are salient. Top Right: diffusion kernel for 3.5b. Bottom Right: node 5 and
17 (N) are salient.
58
0246810024681002468100246810Layer 10510152025051015202505101520250510152025Layer 10246810024681002468100246810Layer 20510152025051015202505101520250510152025Layer 202468100246810BrBrBrBrLayer 305101520250510152025NNNNLayer 3Figure 3.7: Triethylenemelamine.
59
COClHNBrS01234567891011121314151617181920212223242526Figure 3.8: Attention scores averaged by heads for each layer of our trained model for the
compound in Figure 3.7. Left: diffusion kernel for 3.7. Right: node 1, 8, and 10 (N) are salient.
60
0510152025051015202505101520250510152025Layer 10510152025051015202505101520250510152025Layer 205101520250510152025NNNNNNLayer 33.6 Remark on Generalized Self-attention
Tsai et al. [2019] shown that it is actually possible to rewrite self-attention as a kernel smoothing.
Kernel smoothing is a solution to the problem of estimating the value of an unknown function
for a new input, given the values of the function for some inputs. It consists in outputting a
weighted average of the known values, with weights reflecting the similarity between the new
sample and the known samples. If we consider the self-attention output for one member of the
feature map:
Attention(Q, K, V )i =
=
n
X
j=1
n
X
j=1
exp
(cid:19)
(cid:18) QiK>
j√
dout
(cid:18) QiK>
j0
√
dout
exp
Pn
j0=1
(cid:19) Vj ∈ Rdout
k(i, j)
j0=1 k(i, j) v(Xj) ∈ Rdout,
Pn
with Qi = WQXi, Kj = WKXj, v(Xj) = WV Xj. When k is a non-negative kernel function
between a pair (i, j), we indeed get a kernel smoothing. In the vanilla transformer [Vaswani
et al., 2017], we have:
k(i, j) = exp
QiK>
j√
dout
!
.
However, different choices for k suggest different transformers architectures. In this chapter,
our similarity function was:
k(i, j) = exp
!
QiK>
j√
dout
× Kr(i, j),
with a first term based on the nodes contents similarity, and a second term based on the nodes
structural similarity. Tsai et al. [2019] show that splitting the attention into such terms can
be related to relative positional encoding Shaw et al. [2018]. The method introduced in the
previous chapter can also be derived from this approach. Indeed, we replaced the attention
weights (after the softmax) by the corresponding entries in the optimal transport plan P (which
are normalized by design). More generally, inductive bias can be injected into the transformer
architecture via an appropriate choice of the similarity function k(i, j).
3.7 Conclusion
In this work, we show that using a transformer to aggregate local substructures with appropriate
position encoding, GraphiT, is a very effective strategy for graph representation, and that
attention scores allow simple model interpretation. Here, the role of inductive bias is twofold:
first, the choice of the kernel for comparing the position of the nodes can depend on the
properties we expect from the graphs. When long range interactions are expected, kernels
on the graph with higher characteristic length should be more appropriate. Second, we also
augment the node features with kernel methods for representing the extended neighborhood of a
given node: this reflects the assumption that the meaning of a node depends on its neighborhood.
61
On a different note, transformers for graphs also reflect a different inductive bias compared to
GNNs: not only neighbors but all nodes should communicate.
One of the reasons for the success of transformers lies in their scaling properties: in language
modeling for example, it has been shown that for an equal large amount of data, the transformer's
loss follows a faster decreasing power law than Long-Short-Term-Memory networks when the
size of the model increases [Kaplan et al., 2020]. We believe that an interesting future direction
for this work would be to evaluate if GNNs and GraphiT also scale similarly in the context
of large self-supervised pre-training, and can achieve a similar success as in natural language
processing.
62
Appendix
3.8 Experimental Details
In this section, we provide implementation details and additional experimental results.
3.8.1 General Details.
Computing infrastructure. Computations were done on a GPU cluster equipped with
Tesla V100-16G and Tesla V100-32G. We have monitored precisely the entire computational
cost of this research project (including preliminary experiments, designing early and final
models, evaluating baselines, running final experiments), which was approximately 20k GPU
hours.
Position encoding and structure encoding parameters for all datasets. γ for p-step
random walk kernels is fixed to 0.5 for both 2- and 3-step random walk kernels. β for the
diffusion kernel is fixed to 1.0. Regarding the structure encoding in node features, the dimension
of Laplacian positional encoding is set to 8 for ZINC as suggested by Dwivedi and Bresson
[2021] and to 2 for graph classification datasets. The path size, the filter number and the
bandwidth parameter of the unsupervised GCKN path features (used for structure encoding)
are set to 8, 32 and 0.6 respectively for the ZINC dataset whereas the path size is set to 5 for
graph classification datasets.
Other details. For all instances of GraphiT, the hidden dimensions of the feed-forward
hidden layer in each layer of the encoder are fixed to twice of the dimensions of the attention.
3.8.2 Graph Classification Datasets
Here, we provide experimental details for MUTAG, PROTEINS, PTC, NCI1 and Mutagenicity
datasets.
Datasets. These free datasets were collected by Kersting et al. [2016] for academic purpose.
MUTAG consists in classifying molecules into mutagenetic or not. PROTEINS consists in
classifying proteins into enzymes and non-enzymes. PTC consists in classifying molecules into
carcinogenetic or not. NCI1 consists in classifying molecules into positive or negative to cell
lung cancer. Mutagenicity consists in classifying compounds into mutagenetic or not.
Training splits. For MUTAG, PROTEINS, PTC and NCI1, our outer splits correspond to
the splits used in Xu et al. [2019]. Our inner splits that divide their train splits into our train
and validation splits are provided in our code. The error bars are computed as the standard
deviation of the test accuracies across the 10 outer folds. On the other side, as the purpose
of using Mutagenicity is model interpretation, we use simple train, validation and test splits
respectively composed of 80%, 10%, and 10% of the whole dataset.
63
Table 3.3: Parameter grid for GNNs trained on MUTAG, PROTEINS, PTC, NCI1.
Parameter
Grid
Layers
Hidden dimension
Global pooling
Learning rate
Weight decay
[1, 2, 3]
[64, 128, 256]
[sum, max, mean]
[0.1, 0.01, 0.001]
[0.1, 0.01, 0.001]
Table 3.4: Parameter grid for GCKN trained on MUTAG, PROTEINS, PTC, NCI1.
Parameter
Grid
Path size
Hidden dimension
Sigma
Global pooling
Learning rate
Weight decay
[3, 5, 7]
[16, 32, 64]
[0.5]
[sum, max, mean]
[0.001]
[0.01, 0.001, 0.0001]
Hyperparameter choices. For smaller datasets (MUTAG, PTC, PROTEINS), we use the
search grids in Table 3.3 for GNNs, the search grids in Table 3.4 for GCKN and the search
grids in Table 3.5 for both GraphiT and the transformer model of Dwivedi and Bresson [2021].
For bigger datasets (NCI1), we use the search grid in Table 3.3 for GNNs, the search grids in
Table 3.4 for GCKN and the search grids in Table 3.6 for both GraphiT and the transformer
model of Dwivedi and Bresson [2021]. The best models are selected based on the validation
scores that are computed as the average of the validation scores over the last 50 epochs. Then,
the selected model is retrained on train plus validation sets and the average of the test scores
over the last 50 epochs is reported. For Mutagenicity, we train a GraphiT model with 3 layers,
4 heads, 64 hidden dimensions. Initial learning rate was set to 1e-3, weight-decay was fixed
to 1e-4 and structural information was encoded only via relative position encoding with the
diffusion kernel.
Optimization. We use the cross-entropy loss and Adam optimizer with batch size 128 for
GNNs and 32 for both GraphiT and the transformer model of Dwivedi and Bresson [2021]. For
transformers, we do not observe significant improvement using warm-up strategies on these
classification tasks. Thus, we simply follow a scheduler that halves the learning rate after every
50 epochs, as for GNNs. All models are trained for 300 epochs.
Table 3.5: Parameter grid for transformers trained on MUTAG, PROTEINS, PTC.
Parameter
Grid
Layers
Hidden dimension
Heads
Learning rate
Weight decay
[1, 2, 3]
[32, 64, 128]
[1, 4, 8]
[0.001]
[0.01, 0.001, 0.0001]
64
Table 3.6: Parameter grid for transformers trained on NCI1.
Parameter
Grid
Layers
Hidden dimension
Heads
Learning rate
Weight decay
[2, 3, 4]
[64, 128, 256]
[1, 4, 8]
[0.001]
[0.01, 0.001, 0.0001]
3.8.3 Graph Regression Dataset
Here, we present experimental details and additional experimental results for ZINC dataset.
Dataset. ZINC is a free dataset consisting of 250k compounds and the task is to predict the
constrained solubility of the compounds, formulated as a graph property regression problem.
This problem is crucial for designing generative models for molecules. Each molecular graph
in ZINC has the type of heavy atoms as node features (represented by a binary vector using
one-hot encoding) and the type of bonds between atoms as edge features. In order to focus
on the exploitation of the topological structures of the graphs, we omitted the edge features
in our experiments. They could possibly be incorporated into GraphiT through the approach
of Dwivedi and Bresson [2021] or considering different kernels on graph for each edge bond
type, which is left for future work.
Training splits. Following Dwivedi and Bresson [2021], we use a subset of the ZINC dataset
composed of respectively 10k, 1k and 1k graphs for train, validation and test split. The error
bars are computed as the standard deviation of test accuracies across 4 different runs.
In order to make fair comparisons with the most relevant work
Hyperparameter choice.
Dwivedi and Bresson [2021], we use the same number of layers, number of heads and hidden
dimensions, namely 10, 8 and 64. The number of model parameters for our transformers is
only 2/3 of that of Dwivedi and Bresson [2021] as we use a symmetric variant for the attention
score function in (3.5). Regarding the GNNs, we use the values reported in Dwivedi and
Bresson [2021] for GIN, GAT and GCN. In addition, we use the same grid to train the MF
model [Duvenaud et al., 2015], i.e., a learning rate starting at 0.001, two numbers of layers (4
and 16) and the hidden dimension equal to 145. Regarding the GCKN-subtree model, we use
the same hidden dimension as GNNs, that is 145. We fix the bandwidth parameter to 0.5 and
the path size is fixed to 10. We select the global pooling form max, mean, sum and weight decay
from 0.001, 0.0001 and 1e-5, similar to the search grid used in Dwivedi and Bresson [2021].
Optimization. Following Dwivedi and Bresson [2021], we use the L1 loss and the Adam
optimization method with batch size of 128 for training. Regarding the scheduling of the
learning rate, we observe that a standard warm-up strategy used in Vaswani et al. [2017] leads
to more stable convergence for larger models (hidden dimension equal to 128). We therefore
adopt this strategy throughout the experiments with a warm-up of 2000 iteration steps.
65
Table 3.7: Mean absolute error for regression problem ZINC. The results are computed from 4
different runs following [Dwivedi and Bresson, 2021].
Relative PE in attention score
Structural encoding in node features
None
LapPE
GCKN (p=8,d=32)
Dwivedi and Bresson [2021]
0.3585±0.0144
0.3233±0.0126
-
Transformers with d=64
T
T + Adj PE
T + 2-step RW kernel
T + 3-step RW kernel
T + diffusion
Setting diagonal to zero, d=64
T
T + 2-step
T + 3-step
T + diffusion
Larger models with d=128
T
T + Adj PE
T + 2-step RW kernel
T + 3-step RW kernel
T + diffusion
Setting diagonal to zero, d=128
0.6964±0.0067
0.5065±0.0025
0.2432±0.0046 0.2020±0.0112
0.2272±0.0303
0.2429±0.0096
0.2099±0.0027
0.2435±0.0111
0.2209±0.0038
0.2548±0.0102
0.2741±0.0112
0.2106±0.0104
0.2133±0.0161
0.2028±0.0113
0.2180±0.0055
0.7041±0.0044
0.2427±0.0053
0.2451±0.0043
0.2468±0.0061
0.5123±0.0232
0.2108±0.0072
0.2054±0.0072
0.2027±0.0084
0.2735±0.0046
0.2176±0.0430
0.1986±0.0091
0.1967±0.0023
0.7044±0.0061
0.4965±0.0338
0.2310±0.0072 0.1911±0.0094
0.2005±0.0064
0.2759±0.0735
0.2044±0.0058
0.2501±0.0328
0.2116±0.0103
0.2371±0.0040
0.2776±0.0084
0.2055±0.0062
0.2136±0.0062
0.2128±0.0069
0.2238±0.0068
T
T + 2-step
T + 3-step
T + diffusion
0.4964±0.0340
0.7044±0.0061
0.2012±0.0038
0.2348±0.0010
0.2402±0.0056
0.2031±0.0076
0.2351±0.0121 0.1985±0.0032
0.2721±0.0099
0.2031±0.0083
0.2019±0.0084
0.2019±0.0018
Additional results. Besides the relatively small models presented in Table 3.1, we also
show in Table 3.7 the performance of larger models with 128 hidden dimensions. Increasing
the number of hidden dimensions generally results in boosting performance, especially for
transformer variants combined with Laplacian positional encoding in node features. While
sparse local positional encoding is shown to be more useful compared to the positional encoding
with a diffusion kernel, we show here that a variant of diffusion kernel positional encoding
outperforms all other sparse local positional encoding schemes. Since the skip-connection in
transformers already assigns some weight to each node itself and the diagonal of our kernels on
graphs also have important weight, we considered setting these diagonal to zero in order to
remove the effect of the attention scores on self-loop. This modification leads to considerable
performance improvement on longer range relative positional encoding schemes, especially
for the transformer with diffusion kernel positional encoding combined with GCKN in node
features, which results in best performance.
66
Chapter 4
Sample Screening in Empirical Risk
Minimization
In this chapter, we design simple screening tests to automatically discard data samples in
empirical risk minimization without losing optimization guarantees. We derive loss functions
that produce dual objectives with a sparse solution. We also show how to regularize convex
losses to ensure such a dual sparsity-inducing property, and propose a general method to design
screening tests for classification or regression based on ellipsoidal approximations of the optimal
set. In addition to producing computational gains, our approach also allows us to compress a
dataset into a subset of representative points.
This chapter is based on the following material:
- G. Mialon, A. d'Aspremont, J. Mairal. "Screening Data Points in Empirical Risk
Minimization via Ellipsoidal Regions and Safe Loss Functions" (AISTATS, 2020).
4.1
Introduction
Let us consider a collection of n pairs (ai, bi)i=1,...,n, where each vector ai in Rp describes a
data point and bi is its label. For regression, bi is real-valued, and we address the convex
optimization problem
min
x∈Rp,t∈Rn
f (t) + λR(x)
s.t.
t = Ax − b,
(P1)
where A = [a1, . . . , an]> in Rn×p carries the feature vectors, and b = [b1, . . . , bn] carries the
labels. The function f is a convex loss and measures the fit between data points and the model,
and R is a convex regularization function. For classification, the scalars bi are binary labels
in {−1, +1}, and we consider instead of (P1) margin-based loss functions, where our problem
becomes
min
x∈Rp,t∈Rn
f (t) + λR(x)
s.t.
t = diag(b)Ax,
(P2)
The above problems cover a wide variety of formulations such as Lasso [Tibshirani, 1996] and
its variants [Zou and Hastie, 2005], logistic regression, support vector machines [Friedman et al.,
67
2001], and many more. When R is the '1-norm, the solution is encouraged to be sparse [Bach
et al., 2012], which can be exploited to speed-up optimization procedures.
A recent line of work has focused on screening tests that seek to automatically discard
variables before running an optimization algorithm. For example, El Ghaoui et al. [2010] derive
a screening rule from Karush-Kuhn-Tucker conditions, noting that if a dual optimal variable
satisfies a given inequality constraint, the corresponding primal optimal variable must be zero.
Checking this condition on a set that is known to contain the optimal dual variable ensures
that the corresponding primal variable can be safely removed. This prunes out irrelevant
features before solving the problem. This is called a safe rule if it discards variables that are
guaranteed to be useless; but it is possible to relax the "safety" of the rules [Tibshirani et al.,
2012] without losing too much accuracy in practice. The seminal approach by El Ghaoui et al.
[2010] has led to a series of works proposing refined tests [Dai and Pelckmans, 2012, Wang et al.,
2013a] or dynamic rules [Fercoq et al., 2015] for the Lasso, where screening is performed as
the optimization algorithm proceeds, significantly speeding up convergence. Other papers have
proposed screening rules for sparse logistic regression [Wang et al., 2014] or other linear models.
Whereas the goal of these previous methods is to remove variables, our goal is to design
screening tests for data points in order to remove observations that do not contribute to the
final model. The problem is important when there is a large amount of "trivial" observations
that are useless for learning. This typically occurs in tracking or anomaly detection applications,
where a classical heuristic seeks to mine the data to find difficult examples [Felzenszwalb et al.,
2009]. A few of such screening tests for data points have been proposed in the literature. Some
are problem-specific (e.g. Ogawa et al. [2014] for SVM), others are making strong assumptions
on the objective. For instance, the most general rule of Shibagaki et al. [2016] for classification
requires strong convexity and the ability to compute a duality gap in closed form. The goal of
our work is to provide a more generic approach for screening data samples, both for regression
and classification. Such screening tests may be designed for loss functions that induce a sparse
dual solution. We describe this class of loss functions and investigate a regularization mechanism
that ensures that the loss enjoys such a property.
Contributions. Our contributions can be summarized as follows:
- We revisit the Ellipsoid method [Bland et al., 1981] to design screening test for samples,
when the objective is convex and its dual admits a sparse solution.
- We propose a new regularization mechanism to design regression or classification losses
that induce sparsity in the dual. This allows us to recover existing loss functions and to
discover new ones with sparsity-inducing properties in the dual.
- Originally designed for linear models, we extend our screening rules to kernel methods.
Unlike the existing literature, our method also works for non strongly convex objectives.
- We demonstrate the benefits of our screening rules in various numerical experiments on
large-scale classification problems and regression1.
1Our code is available at https://github.com/GregoireMialon/screening_samples.
68
4.2 Preliminaries
We now present the key concepts used in this chapter.
4.2.1 Fenchel Conjugacy
Definition 4.2.1 (Fenchel conjugate). Let f : Rp → R ∪ {−∞, +∞} be an extended real-valued
function. The Fenchel conjugate of f is defined by
f ∗(y) = max
t∈Rp
ht, yi − f (t).
The biconjugate of f is naturally the conjugate of f ∗ and is denoted by f ∗∗. The Fenchel-
Moreau theorem [Hiriart-Urruty and Lemaréchal, 1993] states that if f is proper, lower semi-
continuous and convex, then it is equal to its biconjugate f ∗∗. Finally, Fenchel-Young's inequality
gives for all pair (t, y)
f (t) + f ∗(y) ≥ ht, yi,
with an equality case iff y ∈ ∂f (t).
Suppose now that for such a function f , we add a convex term Ω to f ∗ in the definition of
the biconjugate. We get a modified biconjugate fμ, written
fμ(t) = max
y∈Rp
= max
y∈Rp
hy, ti − f ∗(y) − μΩ(y)
hy, ti + min
z∈Rp
{−hz, yi + f (z)} − μΩ(y).
The inner objective function is continuous, concave in y and convex in z, such that we can
switch min and max according to Von Neumann's minimax theorem to get
fμ(t) = min
z∈Rp
f (z) + max
y∈Rp
{ht − z, yi − μΩ(y)}
= min
z∈Rp
f (z) + μΩ∗
(cid:18) t − z
μ
(cid:19)
.
Definition 4.2.2 (Infimum convolution). fμ is called the infimum convolution of f and Ω∗,
which may be written as f (cid:3) Ω∗.
Note that fμ is convex as the minimum of a convex function in (t, z). We recover the Moreau-
Yosida smoothing [Moreau, 1962, Yosida, 1980] and its generalization when Ω is respectively a
quadratic term or a strongly-convex term [Nesterov, 2005].
4.2.2 Empirical Risk Minimization and Duality
Let us consider the convex ERM problem
min
x∈Rp
P (x) =
1
n
X
n
fi(a>
i x) + λR(x),
(4.1)
i=1
which covers both (P1) and (P2) by using the appropriate definition of function fi. We consider
the dual problem (obtained from Lagrange duality)
max
ν∈Rn
D(ν) =
1
n
n
X
i=1
−f ∗
i
(νi) − λR∗
!
.
−
A>ν
λn
(4.2)
We always have P (x) ≥ D(ν). Since there exists a pair (x, t) such that Ax = t (Slater's
conditions), we have P (x?) = D(ν?) and x? = − A>ν?
λn
at the optimum.
69
4.2.3 Safe Loss Functions and Sparsity in the Dual of ERM Formulations
A key feature of our losses is to encourage sparsity of dual solutions, which typically emerge
from loss functions with a flat region. We call such functions "safe losses" since they will allow
us to design safe screening tests.
Definition 4.2.3 (Safe loss function). Let f : R → R be a continuous convex loss function such
that inf t∈R f (t) = 0. We say that f is a safe loss if there exists a non-singleton and non-empty
interval I ⊂ R such that
t ∈ I =⇒ f (t) = 0.
Lemma 4.2.4 (Dual sparsity). Consider the problem (4.1) where R is a convex penalty.
Denoting by x? and ν? the optimal primal and dual variables respectively, we have for all
i = 1, . . . , n,
The proof can be found in Appendix 4.7.
i ∈ ∂fi(a>
ν?
i x?).
Remark 4.2.5 (Safe loss and dual sparsity). A consequence of this lemma is that for both
classification and regression, the sparsity of the dual solution is related to loss functions that
(t). This is the case for safe loss functions defined
have "flat" regions-that is, such that 0 ∈ ∂f 0
i
above.
The relation between flat losses and sparse dual solutions is classical, see Steinwart [2004],
Blondel et al. [2019].
4.3 Safe Rules for Screening Samples
In this section, we derive screening rules in the spirit of SAFE [El Ghaoui et al., 2010] to select
data points in regression or classification problems with safe losses.
4.3.1 Principle of SAFE Rules for Data Points
We recall that our goal is to safely delete data points prior to optimization, that is, we want to
train the model on a subset of the original dataset while still getting the same optimal solution
as a model trained on the whole dataset. This amounts to identifying beforehand which dual
variables are zero at the optimum. Indeed, as discussed in Section 4.2.2, the optimal primal
variable x? = − A>ν?
only relies on non-zero entries of ν?. To that effect, we make the following
λn
assumption:
Assumption 4.3.1 (Safe loss assumption). We consider problem (4.1), where each fi is a
safe loss function. Specifically, we assume that fi(a>
i x − bi) for regression, or
fi(a>
i x) for classification, where φ satisfies Definition 4.2.3 on some interval I.
For simplicity, we assume that there exists μ > 0 such that I = [−μ, μ] for regression losses
and I = [μ, +∞) for classification, which covers most useful cases.
i x) = φ(bia>
i x) = φ(a>
We may now state the basic safe rule for screening.
Lemma 4.3.2 (SAFE rule). Under Assumption 4.3.1, consider a subset X containing the
i x − bi ∈ ̊I for all x in X , (resp.
optimal solution x?. If, for a given data point (ai, bi), a>
i x ∈ ̊I), where ̊I is the interior of I, then this data point can be discarded from the dataset.
bia>
70
Proof. From the definition of safe loss functions, fi is differentiable at a>
0.
i x? with ν?
i
= f 0
i
(a>
i x) =
We see now how the safe screening rule can be interpreted in terms of discrepancy between
the model prediction a>
i x and the true label bi. If, for a set X containing the optimal solution
x∗ and a given data point (ai, bi), the prediction always lies in ̊I, then the data point can be
discarded from the dataset. The data point screening procedure therefore consists in maximizing
i x in classification),
linear forms, a>
over a set X containing x∗ and check whether they are lower (resp. greater) than the threshold
μ. The smaller X , the lower the maximum (resp. the higher the minimum) hence the more
data points we can hope to safely delete. Finding a good test region X is critical however. We
show how to do this in the next section.
i x + bi in regression (resp. minimizing bia>
i x − bi and −a>
4.3.2 Building the Test Region X
Screening rules aim at sparing computing resources, testing a data point should therefore be
easy. As in El Ghaoui et al. [2010] for screening variables, if X is an ellipsoid, the optimization
problem detailed above admits a closed-form solution. Furthermore, it is possible to get a
smaller set X by adding a first order optimality condition with a subgradient g of the objective
evaluated in the center z of this ellipsoid. This linear constraint cuts the final ellipsoid roughly
in half thus reducing its volume.
Lemma 4.3.3 (Closed-form screening test). Consider the optimization problem
i x − bi
maximize a>
subject to (x − z)>E−1(x − z) ≤ 1
gT (x − z) ≤ 0
(4.3)
in the variable x in Rp with E defining an ellipsoid with center z and g is in Rp. Then the
maximum is
(cid:16)
i z + (a>
a>
z + 1
a>
i
i Eai) 1
2γ E(ai − νg)(cid:17)
(ai − νg)>E(ai − νg)(cid:17) 1
2 .
2 − bi if g>Eai < 0
− bi otherwise,
with ν = g>Eai
g>Eg and γ = (cid:16) 1
2
The proof can be found in Appendix 4.7 and it is easy to modify it for minimizing bia>
i x.
We can obtain both E and z by using a few steps of the ellipsoid method [Nemirovskii and
Yudin, 1979, Bland et al., 1981]. This first-order optimization method starts from an initial
ellipsoid containing the solution x∗ to a given convex problem (here 4.1) . It iteratively computes
a subgradient in the center of the current ellipsoid, selects the half-ellipsoid containing x∗,
and computes the ellipsoid with minimal volume containing the previous half-ellipsoid before
starting all over again. Such a method, presented in Algorithm 1, performs closed-form updates
of the ellipsoid. It requires O(p2 log( RL
)) iterations for a precision (cid:15) starting from a ball of
(cid:15)
radius R with the Lipschitz bound L on the loss, thus making it impractical for accurately
solving high-dimensional problems. Finally, the ellipsoid update formula was also used to screen
primal variables for the Lasso problem [Dai and Pelckmans, 2012], although not iterating over
ellipsoids in order to get smaller volumes.
71
E k+1
E k
g ∈ −∂f (xk)
xk
Figure 4.1: One step of the ellipsoid method.
Algorithm 1 Building ellipsoidal test regions
1: initialization: Given E 0(x0, E0) containing x∗;
2: while k < nbsteps do
3:
• Compute a subgradient g of (4.1) in xk;
• ̃g ← g/pg>Ekg;
• xk+1 ← xk − 1
• Ek+1 ← p2
p2−1
p+1 Ek ̃g;
(Ek − 2
p+1 Ek ̃g ̃g>Ek);
4:
5:
6:
7: end while
8: For regression problems:
9: for each sample ai in A do
10:
if max|a>
11:
Discard ai from A.
i x − bi| ≤ μ for x ∈ E nbsteps then
end if
12:
13: end for
14: For classification, replace condition |a>
i x − bi| ≤ μ by bia>
i x ≥ μ in the above expression.
72
Initialization. The algorithm requires an initial ellipsoid E 0(x0, E0) that contains the solution.
This is typically achieved by defining the center x0 as an approximate solution of the problem,
which can be obtained in various ways. For instance, one may run a few steps of a solver
on the whole dataset, or one may consider the solution obtained previously for a different
regularization parameter when computing a regularization path, or the solution obtained for
slightly different data, e.g., for tracking applications where an optimization problem has to be
solved at every time step t, with slight modifications from time t − 1.
Once the center x0 is defined, there are many cases where the initial ellipsoid can be safely
assumed to be a sphere. For instance, if the objective-let us call it F -is κ-strongly convex,
we have the basic inequality κ
2 kx0 − x?k2 ≤ F (x0) − F ?, which can often be upper-bounded by
several quantities, e.g., a duality gap [Shibagaki et al., 2016] or simply F (x0) if F is non-negative
as in typical ERM problems. Otherwise, other strategies can be used depending on the problem
at hand. If the problem is not strongly convex but constrained (e.g. often a norm constraint
in ERM problems), the initialization is also natural (e.g., a sphere containing the constraint
set). We will see below that one of the most successful applications of screening methods is for
computing regularization paths. Given that regularization path for penalized and constrained
problems coincide (up to minor details), computing the path for a penalized objective amounts
to computing it for a constrained objective, whose ellipsoid initialization is safe as explained
above. Even though we believe that those cases cover many (or most) problems of interest, it
is also reasonable to believe that guessing the order of magnitude of the solution is feasible
with simple heuristics, which is what we do for '1-safe logistic regression. Then, it is possible
to check a posteriori that screening was safe and that indeed, the initial ellipsoid contained the
solution.
Efficient implementation. Since each update of the ellipsoid matrix E is rank one, it is
possible to parametrize Ek at step k as
Ek = skI − LkDkL>
k ,
with I the identity matrix, Lk is in Rp×k and Dk in Rk×k is a diagonal matrix. Hence, we only
have to update D and L while the algorithm proceeds.
Complexity of our screening rules. For each step of Algorithm 1, we compute a subgra-
dient g in O(np) operations. The ellipsoids are modified using rank one updates that can be
stored. As a consequence, the computations at this stage are dominated by the computation of
Eg, which is O(pk). As a result, k steps cost O(k2p + npk). Once we have the test set X , we
have to compute the closed forms from Lemma 4.3.3 for each data point. This computation is
dominated by the matrix-vector multiplications with E, which cost O(kp) using the structure
of E. Hence, testing the whole dataset costs O(npk). Since we typically have n (cid:29) k, the cost
of the overall screening procedure is therefore O(npk). In contrast, solving the ERM problem
without screening would cost O(npT ) where T is the number of passes over the data, with
T (cid:29) k. With screening, the complexity becomes O(nsT + npk), where s is the number of data
points accepted by the screening procedure.
4.3.3 Extension to Kernel Methods
It is relatively easy to adapt our safe rules to kernel methods. Consider for example (P1), where
A has been replaced by φ(A) = [φ(a1), . . . , φ(an)]> in Hn, with H a RKHS and φ its mapping
73
function Rp → H. The prediction function x : Rp → R lives in the RKHS, thus it can be written
x(a) = hx, φ(a)i, ∀a ∈ Rp. In the setting of an ERM strictly increasing with respect to the
RKHS norm and each sample loss, the Representer theorem ensures x(a) = Pn
i=1 αiK(ai, a)
with αi ∈ R and K the kernel associated to H. If we consider the squared RKHS norm as the
regularization term, which is typically the case, the problem becomes:
min
α∈Rn,t∈Rn
f (t) + λ
n
X
i,j=1
αiαjK(ai, aj)
s.t.
t = Kα − b,
(4.4)
with K the Gram matrix. The constraint is linear in α (thus satisfying to Lemma 4.4.1) while
yielding non-linear prediction functions. The screening test becomes maximizing the linear
forms [K]iα − bi and −[K]iα + bi over an ellipsoid X containing α∗. When the problem is
convex (it depends on K), X can still be found using the ellipsoid method.
We now have an algorithm for selecting data points in regression or classification problems
with linear or kernel models. As detailed above, the rules require a sparse dual, which is not
the case in general except in particular instances such as support vector machines. We now
explain how to induce sparsity in the dual.
4.4 Constructing Safe Losses
In this section, we introduce a way to induce sparsity in the dual of empirical risk minimization
problems.
4.4.1 Inducing Sparsity in the Dual of ERM
When the ERM problem does not admit a sparse dual solution, safe screening is not possible.
To fix this issue, consider the ERM problem (P1) and replace f by fμ defined in Section 4.2:
min
x∈Rp,t∈Rn
fμ(t) + λR(x)
s.t.
t = Ax − b,
We have the following result connecting the dual of (P1) with that of (P 0
1
).
Lemma 4.4.1 (Regularized dual for regression). The dual of (P 0
1
) is
max
ν∈Rn
−hb, νi − f ∗(ν) − λR∗
−
!
A>ν
λ
− μΩ(ν),
and the dual of (P1) is obtained by setting μ = 0.
(P 0
1
)
(4.5)
The proof can be found in Appendix 4.7. We remark that is possible, in many cases, to
induce sparsity in the dual if Ω is the '1-norm, or another sparsity-inducing penalty. This
is notably true if the unregularized dual is smooth with bounded gradients. In such a case,
it is possible to show that the optimal dual solution would be ν? = 0 as soon as μ is large
enough [Bach et al., 2012].
We consider now the classification problem (P2) and show that the previous remarks about
sparsity-inducing regularization for the dual of regression problems also hold in this new context.
74
Lemma 4.4.2 (Regularized dual for classification). Consider now the modified classification
problem
The dual of P 0
2 is
min
x∈Rp,t∈Rn
fμ(t) + λR(x)
s.t.
t = diag(b)Ax.
max
ν∈Rn
−f ∗(−ν) − λR∗
!
A> diag(b)ν
λ
− μΩ(−ν).
(P 0
2
)
(4.6)
Proof. We proceed as above with a linear constraint ̃A ̃x = 0 and ̃A = (Id, − diag(b)A).
Note that the formula directly provides the dual of regression and classification ERM
problems with a linear model such as the Lasso and SVM.
4.4.2 Link Between the Original and Regularized Problems
The following results should be understood as an indication that f and fμ are similar objectives.
Lemma 4.4.3 (Smoothness of fμ). If f ∗ + Ω is strongly convex, then fμ is smooth.
Proof. The lemma follows directly from the fact that fμ = (f ∗ + μΩ)∗ (see the proof of
Lemma 4.4.1). The conjugate of a closed, proper, strongly convex function is indeed smooth
(see e.g. Hiriart-Urruty and Lemaréchal [1993], chapter X).
Lemma 4.4.4 (Bounding the value of P1). Let us denote the optimum objectives of P1, P 0
Pλ, Pλ,μ. If Ω is a norm, we have the following inequalities:
1 by
with δ∗ the value of δ at the optimum of Pλ(t) − δ(t).
Pλ − δ∗ ≤ Pλ,μ ≤ Pλ,
The proof can be found in Appendix 4.7. When μ → 0, δ(t) → 0 hence the objectives can
be arbitrarily close.
4.4.3 Effect of Regularization and Examples
We start by recalling that the infimum convolution is traditionally used for smoothing an objec-
tive when Ω is strongly convex, and then we discuss the use of sparsity-inducing regularization
in the dual.
It is known that convolving the indicator
Euclidean distance to a closed convex set.
function of a closed convex set C with a quadratic term Ω (the Fenchel conjugate of a quadratic
term is itself) yields the euclidean distance to C
fμ(t) = min
z∈Rn
IC(z) +
1
2μ
kt − zk2
2
= min
z∈C
1
2μ
kt − zk2
2.
75
Huber loss. The '1-loss is more robust to outliers than the '2-loss, but is not differentiable
in zero which may induce difficulties during the optimization. A natural solution consists in
smoothing it: Beck and Teboulle [2012] for example show that applying the Moreau-Yosida
2 t2 yields the well-known Huber loss, which
smoothing, i.e convolving |t| with a quadratic term 1
is both smooth and robust:
fμ(t) =
( t2
2μ
|t| − μ
2
if |t| ≤ μ,
otherwise.
Now, we present examples where Ω has a sparsity-inducing effect.
2/2
Squared Hinge loss. Let us now consider a problem with a quadratic loss f : t 7→ k1 − tk2
designed for a classification problem, and consider Ω(x) = kxk1 + 1x(cid:22)0. We have Ω∗(y) = 1y(cid:23)−1,
and
fμ(t) =
n
X
i=1
[1 − ti − μ, 0]2
+,
which is a squared Hinge Loss with a threshold parameter μ and [.]+ = max(0, .).
Instead of the quadratic loss in the previous example, choose a robust loss
Hinge loss.
f : t 7→ k1 − tk1. By using the same function Ω, we obtain the classical Hinge loss of support
vector machines
fμ(t) =
[1 − ti − μ, 0]+.
n
X
i=1
1
2
We see that the effect of convolving with the constraint 1x(cid:22)0 is to turn a regression loss (e.g.,
square loss) into a classification loss. The effect of the '1-norm is to encourage the loss to be flat
(when μ grows, [1 − ti − μ, 0]+ is equal to zero for a larger range of values ti), which corresponds
to the sparsity-inducing effect in the dual that we will exploit for screening data points.
Screening-friendly regression. Consider now the quadratic loss f : t 7→ ktk2/2 and Ω(x) =
kxk1. Then Ω∗(y) = 1kyk∞≤1 (see e.g. Bach et al. [2012]), and
fμ(t) =
n
X
i=1
1
2
[|ti| − μ]2
+.
(4.7)
A proof can be found in Appendix 4.7. As before, the parameter μ encourages the loss to be
flat (it is exactly 0 when ktk∞ ≤ μ).
Screening-friendly logistic regression. Let us now consider the logistic loss f (t) =
log (1 + e−t), which we define only with one dimension for simplicity here.
It is easy to
show that the infimum convolution with the '1-norm does not induce any sparsity in the dual,
because the dual of the logistic loss has unbounded gradients, making classical sparsity-inducing
penalties ineffective. However, we may consider instead another penalty to fix this issue:
Ω(x) = −x log (−x) + μ|x| for x ∈ [−1, 0]. We have Ω∗(y) = −ey+μ−1. Convolving Ω∗ with f
yields
fμ(x) =
(ex+μ−1 − (x + μ)
0
if x + μ − 1 ≤ 0,
otherwise.
(4.8)
76
Figure 4.2: Effect of the dual sparsity-inducing regularization on the quadratic loss (4.7) (left)
and logistic loss (4.8) (right). After regularization, the loss functions have flat areas. Note that
both of them are smooth.
Note that this loss is asymptotically robust. Moreover, the entropic part of Ω makes this
penalty strongly convex hence fμ is smooth [Nesterov, 2005]. Finally, the '1 penalty ensures
that the dual is sparse thus making the screening usable. Our regularization mechanism thus
builds a smooth, robust classification loss akin to the logistic loss on which we can use screening
rules. If μ is well chosen, the safe logistic loss maximizes the log-likelihood of the data for a
probabilistic model which slightly differs from the sigmoid in vanilla logistic regression. The
effect of regularization parameter in a few previous cases are illustrated in Figure 4.2.
In summary, regularizing the dual with the '1 norm induces a flat region in the loss, which
induces sparsity in the dual. The geometry is preserved elsewhere. Note that we do not suggest
to use P 0
1
to screen for P1 and P2.
and P 0
2
4.5 Experiments
We now present experimental results demonstrating the effectiveness of the data screening
procedure.
Datasets. We consider three real datasets, SVHN, MNIST, RCV-1, and a synthetic one.
MNIST (n = 60000) and SVHN (n = 604388) both represent digits, which we encode by
using the output of a two-layer convolutional kernel network [Mairal, 2016] leading to feature
dimensions p = 2304. RCV-1 (n = 781265) represents sparse TF-IDF vectors of categorized
newswire stories (p = 47236). For classification, we consider a binary problem consisting of
discriminating digit 9 for MNIST vs. all other digits (resp. digit 1 vs rest for SVHN, 1st
category vs rest for RCV-1). For regression, we also consider a synthetic dataset, where data
is generated by b = Ax + (cid:15), where x is a random, sparse ground truth, A ∈ Rn×p a data
matrix with coefficients in [−1, 1] and (cid:15) ∼ N (0, σ) with σ = 0.01. Implementation details are
provided in Appendix. We fit usual models using Scikit-learn [Pedregosa et al., 2011] and
Cyanure [Mairal, 2019] for large-scale datasets.
4.5.1 Accuracy of our safe logistic loss
The accuracies of the Safe Logistic loss we build is similar to the accuracies obtained with the
Squared Hinge and the Logistic losses on the datasets we use in this paper thus making it a
realistic loss function, see Table 4.1.
77
f(t)fμ(t)μ=0.8μ=0.4f(t)fμ(t)μ=0.6μ=0.1Dataset
MNIST
SVHN
RCV-1
Logistic + '1
Logistic + '2
Squared Hinge + '1
Squared Hinge + '2
Safelog + '1
Safelog + '2
0.997 (0.01)
0.997 (0.001)
0.99 (0.0003)
0.99 (0.0003)
0.997 (0.03)
0.997 (0.003)
0.99 (0.03)
0.99 (0.003)
0.975 (1.0)
0.975 (1.0)
0.975 (1.0)
0.974 (1.0)
0.996 (0.0)
0.996 (0.0)
0.989 (0.0)
0.989 (0.0)
0.974 (1e-05)
0.975 (1e-05)
Table 4.1: Averaged best accuracies on test set (best λ in a logarithmic grid from λ = 0.00001
to 1.0).
4.5.2 Safe Screening
Here, we consider problems that naturally admit a sparse dual solution, which allows safe
screening.
Interval regression. We first illustrate the practical use of the screening-friendly regression
loss (4.7) derived above. It corresponds indeed to a particular case of a supervised learning task
called interval regression [Hocking et al., 2013], which is widely used in fields such as economics.
In interval regression, one does not have scalar labels but intervals Si containing the true labels
̃bi, which are unknown. The loss is written
'(x) =
n
X
i=1
inf
bi∈Si
(a>
i x − bi)2,
(4.9)
where Si contains the true label ̃bi. For a given data point, the model only needs to predict a
value inside the interval in order not to be penalized. When the intervals Si have the same
width and we are given their centers bi, (4.9) is exactly (4.7). Since (4.7) yields a sparse dual,
we can apply our rules to safely discard intervals that are assured to be matched by the optimal
solution. We use an '1 penalty along with the loss. As an illustration, the experiment was
done using a toy synthetic dataset (n = 20, p = 2), the signal to recover being generated by
one feature only. The intervals can be visualized in Figure 4.3. The "difficult" intervals (red)
were kept in the training set. The predictions hardly fit these intervals. The "easy" intervals
(blue) were discarded from the training set: the safe rules certify that the optimal solution will
fit these intervals. Our screening algorithm was run for 20 iterations of the Ellipsoid method.
Most intervals can be ruled out afterwards while the remaining ones yield the same optimal
solution as a model trained on all the intervals.
Classification. Common sample screening methods such as Shibagaki et al. [2016] require a
strongly convex objective. When it is not the case, there is, to the best of our knowledge, no
baseline for this case. Thus, when considering classification using the non strongly convex safe
logistic loss derived in Section 4.4 along with an '1 penalty, our algorithm is still able to screen
samples, as shown in Table 4.2. The algorithm is initialized using an approximate solution to
the problem, and the radius of the initial ball is chosen depending on the number of epochs
(100 for 10 epochs, 10 for 20 and 1 for 30 epochs), which is valid in practice.
78
Figure 4.3: Safe interval regression on synthetic dataset. Most "easy" samples (in blue) can be
discarded while the "difficult" ones (in red) are kept.
Epochs
20
30
λ
10−3
10−4
10−5
MNIST SVHN RCV-1 MNIST SVHN RCV-1
0
0.3
35
0
0.01
12
1
8
45
0
27
65
2
17
54
12
42
75
Table 4.2: Percentage of samples screened (i.e that can be thrown away) in an '1 penalized
Safe Logistic loss given the epochs made at initialization. The radius is initialized respectively
at 10 and 1 for MNIST and SVHN at Epochs 20 and 30, and at 1 and 0.1 for RCV-1.
Epochs
20
30
λ
1.0
10−1
10−2
10−3
MNIST SVHN MNIST
SVHN
89 / 89
95 / 95
16 / 84
0 / 0
87 / 87
11 / 47
0 / 0
0 / 0
89 / 89
95 / 95
98 / 98
34 / 50
87 / 87
91 / 91
90 / 92
0 / 0
Table 4.3: Percentage of samples screened in an '2 penalized SVM with Squared Hinge loss
(Ellipsoid (ours) / Duality Gap [Shibagaki et al., 2016]) given the epochs made at initialization.
79
The Squared Hinge loss allows for safe screening (see 4.2.4). Combined with an '2 penalty,
the resulting ERM is strongly convex. We can therefore compare our Ellipsoid algorithm to the
baseline introduced by Shibagaki et al. [2016], where the safe region is a ball centered in the
with ∆ a duality gap of the ERM problem.
current iterate of the solution and whose radius is 2∆
λ
Both methods are initialized by running the default solver of scikit-learn with a certain number
of epochs. The resulting approximate solution and duality gap are subsequently fed into our
algorithm for initialization. Then, we perform one more epoch of the duality gap screening
algorithm on the one hand, and the corresponding number of ellipsoid steps computed on a
subset of the dataset on the other hand, so as to get a fair comparison in terms of data access.
The results can be seen in Table 4.3 for MNIST and SVHN, and in Table 4.4 for RCV-1. While
being more general (our approach is neither restricted to classification, nor requires strong
convexity), our method performs similarly to the baseline. Figure 4.4 highlights the trade-off
between optimizing and evaluating the gap (Duality Gap Screening) versus performing one step
of Ellipsoid Screening. Both methods start screening after a correct iterate (i.e. with good test
accuracy) is obtained by the solver (blue curve) thus suggesting that screening methods would
rather be of practical use when computing a regularization path, or when the computing budget
is less constrained (e.g. tracking or anomaly detection) which is the object of next paragraph.
Epochs
10
20
λ = 1
λ = 10
λ = 100
7 / 84
80 / 80
68 / 68
85 / 85
80 / 80
68 / 68
Table 4.4: RCV-1 : Percentage of samples screened in an '2 penalized SVM with Squared Hinge
loss (Ellipsoid (ours) / Duality Gap) given the epochs made at initialization.
Computational gains. As demonstrated in Figure 4.5, computational gains can indeed
be obtained in a regularization path setting (MNIST features, Squared Hinge Loss and L2
penalty). Each point of both curves represents an estimator fitted for a given lambda against
the corresponding cost (in epochs). Each estimator is initialized with the solution to the
previous parameter lambda. On the orange curve, the previous solution is also used to initialize
a screening. In this case, the estimator is fit on the remaining samples which further accelerates
the path computation.
4.5.3 Dataset Compression
We now consider the problem of dataset compression, where the goal is to maintain a good
accuracy while using less examples from a dataset. This section should be seen as a proof
of concept. A natural scheme consists in choosing the samples that have a higher margin
since those will carry more information than samples that are easy to fit. In this setting, our
screening algorithm can be used for compression by using the scores of the screening test as
a way of ranking the samples. In our experiments, and for a given model, we progressively
delete data points according to their score in the screening test for this model, before fitting
the model on the remaining subsets. We compare those methods to random deletions in the
80
Figure 4.4: Fraction of samples screened vs Epochs done for two screening strategies along with
test accuracy of the current iterate (Sq. Hinge + '2 trained on MNIST).
Figure 4.5: Regularization path of a Squared Hinge SVM trained on MNIST. The screening
enables computational gains compared to a classical regularization path.
81
dataset and to deletions based on the sample margin computed on early approximations of the
solution when the loss admits a flat area ("margin screening").
Classification. We first apply our compression scheme in the context of classification, using
again MNIST, SVHN, and RCV-1. We test the combinations of the '1 penalty with the safe
logistic loss, and the '2 penalty with the squared hinge loss. Our strategy is effective, as can be
seen in Figure 4.6.
Lasso regression. The Lasso objective combines an '2 loss with an '1 penalty. Since its dual
is not sparse, we will instead apply the safe rules offered by the screening-friendly regression
loss (4.7) derived in Section 4.4.3 and illustrated in Figure 4.2, combined with an '1 penalty.
We can draw an interesting parallel with the SVM, which is naturally sparse in data points. At
the optimum, the solution of the SVM can be expressed in terms of data points (the so-called
support vectors) that are close to the classification boundary, that is the points that are the
most difficult to classify. Our screening rule yields the analog for regression: the points that
are easy to predict, i.e. that are close to the regression curve, are less informative than the
points that are harder to predict. In our experiments on synthetic data (n = 100), this does
consistently better than random subsampling as can be seen in Figure 4.7.
Discussion. For all methods, the degradation in performance is lesser than with random
deletions. Nevertheless, in the regime where most samples are deleted (beyond 80%), random
deletions tend to do better. This is not surprising since the screening deletes the samples that
are "easy" to classify. Then, only the difficult ones and outliers remain, making the prediction
task harder compared to a random subsampling.
4.6 Conclusion
In this chapter, we saw how common losses could be regularized in their dual to yield safe losses.
However, adding a regularization term enforcing sparsity in the dual does not always result in
a loss with a flat region. For example, we showed in Section 4.4.3 that the logistic loss could
not be regularized with the '1 norm only. Thus, it could be insightful to better understand
which regularization is needed for which functions to yield safe losses. More generally, the work
initiated in Section 4.4.2 to study the link between an ERM problem and its regularized dual
could be further pursued.
A limit of this work is the size of the screening region X , whose price for being tractable and
generic (i.e not requiring strong convexity of the objective) is its high volume, making typical
safe screening (i.e deleting samples before solving the ERM problem) too computationally
intensive to be beneficial in most problems. Would it be possible to find a region with smaller
volume while remaining generic and tractable?
Finally, safe screening techniques where introduced in 2010, at a time when machine learning
often consisted in working on a dataset on its laptop or working machine. In this context,
reducing the size of a dataset in terms of features and/or samples was valuable to fit models
with lower running time. The advent of deep learning popularized the use of massive datasets
for training models via clusters of computers, thus making screening rules slightly less relevant
today. However, and as stated in introduction, screening rules are still of use to speed solvers
up, such as for the Lasso [Massias et al., 2018], and may have other surprising applications, such
82
Figure 4.6: Dataset compression in classification. Left: '1 penalty + Safe Logistic loss. Right:
'2 penalty + Squared Hinge loss. Top: MNIST. Middle: SVHN. Down: RCV-1.
83
Figure 4.7: Dataset compression for the Lasso trained on a synthetic dataset. The scores given
by the screening yield a ranking that is better than random subsampling.
as in differential privacy. More precisely, safe losses might be used in the context of black-box
membership inference (see for example Sablayrolles et al. [2019] for a more detailed introduction
on these problems). In this setting, the parameters of the model are unknown but it is possible
to query it. The objective is to guess whether a particular sample was part of the training
set. When samples are in the flat region of a safe loss at the optimum, it means that they are
non-support, hence can be deleted without modifying the loss or the model. It may therefore
be impossible to guess whether such samples have been used for training. In the future, we plan
to work on a new notion of differential privacy, where a model would be private for non-support
samples and public for the support samples.
84
Appendix
4.7 Proofs.
4.7.1 Proof of Lemma 4.2.4
Proof. At the optimum,
P (x∗) − D(ν∗) =
1
n
n
X
i=1
λR(x) + λR∗
−
Adding the null term hx, − A>ν
n i − hx, − A>ν
n i gives
fi(a>
i x) + f ∗
i
(νi)+
!
AT ν
λn
= 0.
1
n
n
X
i=1
fi(a>
|
(νi) − a>
i x) + f ∗
i
{z
≥0
i xνi
}
+
λ
R(x) + R∗
−
|
!
*
−
x, −
+!
A>ν
λn
= 0,
}
A>ν
λn
{z
≥0
since Fenchel-Young's inequality states that each term is greater or equal to zero. We have a
null sum of non-negative terms; hence, each one of them is equal to zero. We therefore have for
each i = 1 . . . n:
i x) + f ∗(νi) = a>
which corresponds to the equality case in Fenchel-Young's relation, which is equivalent to
i ∈ ∂fi(a>
ν∗
i x∗).
i xνi,
f (a>
4.7.2 Proof of Lemma 4.3.3
Proof. The Lagrangian of the problem writes:
L(x, ν, γ) = a>
i x − bi + ν
(cid:16)1 − (x − z)T E−1(x − z)(cid:17)
−
γgT (x − z),
with ν, γ ≥ 0. When maximizing in x, we get:
∂L
∂x
= ai + 2ν(E−1z − E−1x) − γ = 0.
We have ν > 0 since the opposite leads to a contradiction. This yields x = z + 1
2ν
and (x − z)T E−1(x − z) = 1 at the optimum which gives ν = 1
2
(ai − γ)T E(ai − γ).
q
(Eai − γEg)
85
Now, we have to minimize
1
2ν
(cid:18) 1
2ν
To do that, we consider the optimality condition
g(ν, γ) = ai
z +
γ>
(cid:18)
(Eai − γEg)
(cid:19)
−
(Eai − γEg)
(cid:19)
.
∂g
∂γ
= −
1
2ν
aiEg −
1
2ν
gT Eai + γ
ν
gT Eg = 0,
. If gT Eai < 0 then γ = 0 in order to avoid a contradiction.
which yields γ = gT Eai
gT Eg
In summary, either gT Eai ≤ 0 hence the maximum is attained in x = z + 1
q
to aiz +
and is equal to ai
i Eai − yi, or gT Eai > 0 and the maximum is attained in x = z + 1
aT
− bi with ν = 1
2
2ν E(ai − γg)(cid:17)
(ai − γ)T E(ai − γ) and γ = gT Eai
gT Eg
z + 1
q
(cid:16)
.
2ν Eai and is equal
2ν E(ai − γEg)
4.7.3 Proof of Lemma 4.4.1
Proof. We can write P 0
1
as
minimize
subject to
̃f ( ̃x) + λ ̃R( ̃x)
̃A ̃x = −b
(4.10)
in the variable ̃x = (t, x) ∈ Rn+p with ̃f : ̃x 7→ fμ(t) and ̃R : ̃x 7→ R(x) and ̃A ∈ Rn×(n+p) =
(Id, −A). Since the constraints are linear, we can directly express the dual of this problem in
terms of the Fenchel conjugate of the objective (see e.g. Boyd and Vandenberghe [2004], 5.1.6).
Let us note f0 = ̃f + λ ̃R. For all y ∈ Rn+p, we have
(y) = sup
hx, yi − ̃f (x) − λ ̃R(x)
f ∗
0
=
x∈Rn+p
sup
x1∈Rn,x2∈Rp
hx1, y1i + hx2, y2i − f (x1) − λR(x2)
= f ∗
μ
(y1) + λR∗
(cid:19)
.
(cid:18) y2
λ
It is known from Beck and Teboulle [2012] that fμ = f (cid:3) Ω∗
μ
Clearly, Ω∗∗
μ
consequence, f ∗
μ
f ∗
μ
).
= μΩ∗( .
μ
= μΩ. If Ω is proper, convex and lower semicontinuous, then Ω = Ω∗∗ . As a
= (f ∗ + μΩ)∗∗. If f ∗ + μΩ is proper, convex and lower semicontinuous, then
= f ∗ + μΩ, hence
= (f ∗ + Ω∗∗
μ
)∗ with Ω∗
μ
f ∗
0
(y) = f ∗(y1) + λR∗
+ μΩ(y1).
(cid:19)
(cid:18) y2
λ
Now we can form the dual of P 0
1
maximize −h−b, νi − f ∗
0
by writing
(4.11)
in the variable ν ∈ Rn. Since − ̃AT ν = (−ν, AT ν) with ν ∈ Rn the dual variable associated to
the equality constraints,
(− ̃AT ν)
(− ̃AT ν) = f ∗(−ν) + λR∗
f ∗
0
!
AT ν
λ
+ μΩ(−ν).
Injecting f ∗
0
in the problem and setting ν instead of −ν (we optimize in R) concludes the proof.
86
4.7.4 Lemma 4.7.1
Lemma 4.7.1 (Bounding fμ). If μ ≥ 0 and Ω is a norm then
f (t) − δ(t) ≤ fμ(t) ≤ f (t),
for all t ∈ domf
with δ(t) = max
k u
μ k∗≤1
gT u and g ∈ ∂f (t).
Proof. If Ω is a norm, then Ω(0) = 0 and Ω∗ is the indicator function of the dual norm of Ω
hence non-negative. Moreover, if μ > 0 then, ∀z ∈ domf and ∀t ∈ Rn,
fμ(t) ≤ f (z) + μΩ∗
(cid:18) t − z
μ
(cid:19)
.
In particular, we can take t = z hence the right-hand inequality. On the other hand,
fμ(t) − f (t) = min
f (z) + μIk z−t
μ k∗≤1 − f (t)
z
= min
k u
μ k∗≤1
f (t + u) − f (t).
Since f is convex,
As a consequence,
f (t + u) − f (t) ≥ gT u with g ∈ ∂f (t).
fμ(t) − f (t) ≥ min
k u
μ k∗≤1
gT u.
4.7.5 Proof of Lemma 4.4.4
Proof. The proof is trivial given the inequalities in Lemma 4.7.1.
4.7.6 Proof of Screening-friendly regression
Proof. The Fenchel conjugate of a norm is the indicator function of the unit ball of its dual
norm, the '∞ ball here. Hence the infimum convolution to solve
fμ(x) = min
z∈Rn
{f (z) + 1kx−zk∞≤μ}
(4.12)
Since f (x) = 1
2n kxk2
2
,
fμ(x) = min
z∈Rn
1
2n
zT z + 1kx−zk∞≤μ.
If we consider the change of variable t = x − z, we get:
fμ(x) = min
t∈Rn
1
2n
kx − tk2
2
+ 1ktk∞≤μ.
The solution t∗ to this problem is exactly the proximal operator for the indicator function of
the infinity ball applied to x. It has a closed form
t∗ = prox
(x)
1k.k∞≤μ
= x − prox(1k.k∞≤μ)∗(x),
87
using Moreau decomposition. We therefore have
Hence,
t∗ = x − prox
(x).
μk.k1
fμ(x) =
1
2n
kx − t∗k2
2
=
1
2n
kprox
(x)k2
2.
μk.k1
But, prox
μk.k1
(t) = sgn(t) × [|t| − μ]+ for t ∈ R, where [x]+ = max(x, 0).
4.8 Additional experimental results.
Reproducibility. The data sets did not require any pre-processing except MNIST and SVHN
on which exhaustive details can be found in Mairal [2016]. For both regression and classification,
the examples were allocated to train and test sets using scikit-learn's train-test-split (80% of the
data allocated to the train set). The experiments were run three to ten times (depending on the
cost of the computations) and our error bars reflect the standard deviation. For each fraction
of points deleted, we fit three to five estimators on the screened dataset and the random subset
before averaging the corresponding scores. The optimal parameters for the linear models were
found using a simple grid-search.
88
Chapter 5
Conclusion and Future Work
5.1 Conclusion
In this thesis, we showed how inductive biases could be integrated into
Main conclusions.
models using kernel methods. In the context of sets of features, and starting from the optimal
transport kernel between two sets of features, which is interpretable, it is possible to derive an
embedding which is reminiscent of transformers [Mialon et al., 2021a]. We can also integrate
the structure of a graph in transformers using kernels on the graph [Mialon et al., 2021b]. This
creates a promising architecture for graphs that differs from GNNs. On a different note, we
explored surprising properties of losses admitting a flat area, which can be used for data pruning,
with for example potential applications in anomaly detection or differential privacy [Mialon
et al., 2020]. All these projects offer interesting directions for future work.
Relationship between transfer learning from pre-trained models and inductive
biases. At the beginning of this thesis, we introduced inductive biases as a point of view on
the generalization problem that appeared to be opposed to pre-trained models: whereas one
requires plenty of data, the other is meant to be data efficient. As demonstrated in Chapter 2
and Chapter 3, these practices can be complementary: it is possible to use a module relying on
inductive biases on top of a pre-trained model in a context where labelled data is scarce. This
approach was shown to be very effective in the context of classifying protein foldings [Mialon
et al., 2021a]. Another example is the architecture of a CNN, which can be seen as an inductive
bias focused on image processing. Indeed, small or medium convolution filters exploit locality
properties of natural images.
It is believed that such an inductive bias is nearly optimal
for image processing: self-attention in vision transformers seems to learn the same kind of
inductive bias [Cordonnier et al., 2020], thus requiring more data to attain the performance
of CNNs [Dosovitskiy et al., 2021]. Note however that the aforementioned work also suggests
that when the amount of data grows to be huge – one or two orders of magnitude bigger than
ImageNet – transformers perform better than CNNs1. In summary, inductive biases can also
be useful in context where data is big but not huge. In the latter case, the picture is not
clear as of today: the quantity of data and thz size of the model seems more important than
its architecture as suggested by the success of different computer vision architectures such as
1Recent work however shows that improved training procedure of transformers can close the gap with CNNs
trained on ImageNet only although the training procedure differs: the transformer is trained using knowledge
distilled from a CNN teacher [Touvron et al., 2021b].
89
ResMLP [Touvron et al., 2021a], DeiT [Touvron et al., 2021b], and BiT [Kolesnikov et al., 2020]
2.
Relationship between inductive biases and geometric deep learning. An exciting
field of deep learning coined as geometric deep learning recently emerged [Bronstein et al.,
2021]. From the point of view of geometric deep learning, and for many problems, there
exists regularities under the form of symmetries and invariances. For example, the energy of a
molecule is invariant given any rotation of the molecule in the 3D space. These regularities
strongly suggest a preferred architecture, and the zoo of deep learning architectures can in
fact be classified depending on the invariance they encode. As an example, a transformer is
permutation equivariant: any permutation of two elements in its input will result in the same
permutation in the output. This makes the transformer an appropriate model for handling
unordered sets of features. Some inductive biases discussed in this thesis can naturally be put
under the hood of geometrical deep learning, see our discussion on different possible models for
handling graphs in Chapter 3, between GNNs and transformers. Other inductive biases such as
using an optimal transport geometry for representing sets may require more thinking to find
their place in the geometric deep learning perspective.
5.2 Future work
At the end of the chapters, we provided short term directions for further work. In this last
section, we detail two general avenues of work starting from the conclusion of this thesis.
Applications of inductive biases: scientific discovery. Although inductive biases are
typically outperformed in the more and more common huge data setting by large pre-trained
models, they are still an important tool for machine learning. We believe scientific discovery is
an appropriate application for recent machine learning models. First, as opposed to models
that will be deployed in production for use by non-experts, which must comply with the norm,
often requiring interpretability, guarantees on the error, and other constraints that are not yet
compatible with deep learning, scientific machine learning models may stay in the lab. This
means that norms are less binding and more human supervision is allowed, thus enabling to
leverage the most recent advances in deep learning. Second, scientific data has often been
generated by some potentially complex physical law, meaning that there is probably properties
such as invariances in the problem or more generally domain knowledge to incorporate in the
learning model. AlphaFold2 [Jumper et al., 2021] is a good example for our discussion: first,
it is both a complex system relying on deep neural networks (a core block of AlphaFold2 is
a deep transformer), yet also a model integrating expert knowledge on proteins via inductive
biases (the triangular attention mechanism helps the network to learn a pairwise representations
of amino-acids which is compatible with a 3D structure in terms of pairwise distances). As
AlphaFold2 should largely be used by experts in bioinformatics, there is to the best of our
knowledge no norm to comply with that would be incompatible with deep learning blocks.
As many interesting scientific data can be seen as graphs or sequences, and because scientific
data may be scarce for some domains such as are disease or econometrics studies, we believe a
promising application of our work to be science problems.
2Thus making the bitter lesson of machine learning maybe more true than ever.
90
Inductive biases are elsewhere, for example in different learning paradigms. This
thesis focused on integrating inductive biases directly within models. But, inductive biases
can be found elsewhere, namely in the learning procedure. The main learning paradigm in
machine learning is Empirical Risk Minimization (ERM) that we studied in Chapter 4. ERM
consists in minimizing a prediction error on hypothetically i.i.d samples with possibly regularity
constraints for the model to hopefully ensure better generalization. Such a learning procedure
suffers from various issues, two of them being that labels are required, and that spurious
correlations may be learned. The former requires manually annotated samples which can be
tedious, expensive or even impossible to obtain. The latter makes generalization more difficult:
a famous example being a classifier that would learn to recognize cows. As cow pictures are often
taken in green grass, the classifier trained on such data could have difficulties to recognize a cow
lying on a beach [Beery et al., 2018]. Different learning procedures can be used to circumvent
these issues. In computer vision, self-supervised learning relies on a pretext task to learn
general visual representations [He et al., 2020]. These approaches typically aim to minimize
the difference between two representations of two different augmentations of the same image.
These augmentations are human-engineered: in this sense, this component is an inductive bias
and could be used to inject domain knowledge for various data modalities. Invariant Risk
Minimization [Arjovsky et al., 2020] (IRM) tackles the problem of spurious correlations in
ERM: the inductive bias here is that the model should learn correlations that are stable across
different environments, i.e different training distributions. In this sense, inductive biases are
broader than integrating domain knowledge into the learning architecture, and progress may
be sought by improving the learning paradigms used in machine learning.
91
Bibliography
Jean-Marc Andreoli. Convolution, attention and structure embedding.
In arXiv preprint arXiv:
1905.01289v5, 2019.
Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization,
2020.
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. In Advances in Neural
Information Processing Systems (NeurIPS), 2016.
Francis Bach, Rodolphe Jenatton, Julien Mairal, Guillaume Obozinski, et al. Optimization with
sparsity-inducing penalties. Foundations and Trends in Machine Learning, 4(1):1–106, 2012.
Dzimitry Bahdanau, Kyunghyun Cho, and Joshua Bengio. Neural machine translation by jointly learning
to align and translate. In International Conference on Learning Representations (ICLR), 2015.
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi,
Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Caglar
Gulcehre, Francis Song, Andrew Ballard, Justin Gilmer, George Dahl, Ashish Vaswani, Kelsey Allen,
Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matt
Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning,
and graph networks, 2018.
Amir Beck and Marc Teboulle. Smoothing and first order methods: a unified framework. SIAM J.
Optim Vol. 22, No. 2, 2012.
Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the
European Conference on Computer Vision (ECCV), September 2018.
Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data represen-
tation. Neural computation, 15(6):1373–1396, 2003.
Iz Beltagy, Matthew E. Peters, and Arman Cohan. Longformer: The long-document transformer.
arXiv:2004.05150, 2020.
Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. On the dangers
of stochastic parrots: Can language models be too big? In Proceedings of the 2021 ACM Conference
on Fairness, Accountability, and Transparency, 2021.
David L. Berry, Gary M. Schoofs, and William A. Vance. Mutagenicity of nitrofluoranthenes, 3-
aminofluoranthene and 1-nitropyrene in Chinese hamster V79 cells. Carcinogenesis, 6(10):1403–1407,
1985. URL https://doi.org/10.1093/carcin/6.10.1403.
Alberto Bietti and Julien Mairal. Group invariance, stability to deformations, and complexity of deep
convolutional representations. The Journal of Machine Learning Research, 20(1):876–924, 2019.
Alberto Bietti, Grégoire Mialon, Dexiong Chen, and Julien Mairal. A kernel perspective for regularizing
deep neural networks. In International Conference on Machine Learning (ICML), 2019.
Robert G. Bland, Donald Goldfarb, and Michael J. Todd. The ellipsoid method: A survey. Operation
Research, 29, 1981.
92
Mathieu Blondel, André F. T. Martins, and Vlad Niculae. Learning classifiers with fenchel-young losses:
Generalized entropies, margins, and algorithms. In International Conference on Artificial Intelligence
and Statistics (AISTATS), 2019.
Karsten Borgwardt and Hans-Peter Kriegel. Shortest-path kernels on graphs. In International conference
on data mining (ICDM), 2005.
Karsten Borgwardt, Elisabetta Ghisu, Felipe Llinares-López, Leslie O'Bray, and Bastian Rieck. Graph
kernels: State-of-the-art and future challenges. arXiv preprint arXiv:2011.03854, 2020.
Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, 2004.
Stevo Bozinovski and Ante Fulgosi. The influence of pattern similarity and transfer of learning upon
training of a base perceptron b2. (original in croatian: Utjecaj slicnosti likova i transfera ucenja na
obucavanje baznog perceptrona b2). In Proc. Symp. Informatica 3-121-5, Bled, 1976.
Michael M. Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric
deep learning: Going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017.
Michael M. Bronstein, Joan Bruna, Taco Cohen, and Petar Veličković. Geometric deep learning: Grids,
groups, graphs, geodesics, and gauges, 2021.
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind
Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss,
Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu,
Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin
Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario
Amodei. Language models are few-shot learners, 2020.
Antoni Buades, Bartomeu Coll, and Jean-Michel Morel. Non-Local Means Denoising. Image Processing
On Line, 1:208–212, 2011.
Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee,
Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, et al. Extracting training data from large
language models. arXiv preprint arXiv:2012.07805, 2020.
Dexiong Chen. Structured Data Modeling with Deep Kernel Machines and Applications in Com-
putational Biology. PhD thesis, Université Grenoble Alpes [2020-....], 2020. URL https://tel.
archives-ouvertes.fr/tel-03193220.
Dexiong Chen, Laurent Jacob, and Julien Mairal. Biological sequence modeling with convolutional
kernel networks. Bioinformatics, pages 35(18):3294–3302, 2019a.
Dexiong Chen, Laurent Jacob, and Julien Mairal. Recurrent kernel networks. In Advances in Neural
Information Processing Systems (NeurIPS), 2019b.
Dexiong Chen, Laurent Jacob, and Julien Mairal. Convolutional kernel networks for graph-structured
data. In International Conference on Machine Learning (ICML), 2020.
Liqun Chen, Guoyin Wang, Chenyang Tao, Dinghan Shen, Pengyu Cheng, Xinyuan Zhang, Wenlin
Wang, Yizhe Zhang, and Lawrence Carin. Improving textual network embedding with global attention
via optimal transport. In Proceedings of the Annual Meeting of the Association for Computational
Linguistics (ACL), 2019c.
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan,
Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger,
Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder,
Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe
Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes,
Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor
Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan
Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage,
93
Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya
Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code, 2021.
François Chollet. On the measure of intelligence, 2019.
Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas
Sarlos, Peter Hawkins, Jared Davis, David Belanger, Lucy Colwell, and Adrian Weller. Masked
language modeling for proteins via linearly scalable long-context transformers. In arXiv:2006.03555v3,
2020.
King-Thom Chung, Chris A. Murdock, Yonggui Zhou, S. Edward Stevens Jr., Ying-Sing Li,
Cheng-I. Wei, S. Y. Fernando, and Ming-W. Chou. Effects of the nitro-group on the muta-
genicity and toxicity of some benzamines. Environmental and Molecular Mutagenesis, 27(1):
67–74, 1996. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/%28SICI%291098-2280%
281996%2927%3A1%3C67%3A%3AAID-EM9%3E3.0.CO%3B2-B.
Jean-Baptiste Cordonnier, Andreas Loukas, and Martin Jaggi. On the relationship between self-attention
and convolutional layers. In International Conference on Learning Representations (ICLR), 2020.
Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine learning, 20(3):273–297, 1995.
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural
Information Processing Systems (NeurIPS), 2013.
Marco Cuturi and Arnaud Doucet. Fast computation of wasserstein barycenters. In International
Conference on Machine Learning (ICML), 2013.
Liang Dai and Kristiaan Pelckmans. An ellipsoid based, two-stage screening test for bpdn. European
Signal Processing Conference, pages 654–658, 01 2012.
Zihang Dai, Yiming Yang, Jaime Carbonell, Quoc V. Le, and Ruslan Salakhutdinov. Transformer-xl:
Attentive language models beyond a fixed-length context. In Proceedings of the Annual Meeting of
the Association for Computational Linguistics (ACL), 2019.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep
bidirectional transformers for language understanding. In Proceedings of the North American Chapter
of the Association for Computational Linguistics (NAACL), 2019.
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas
Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit,
and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In
International Conference on Learning Representations (ICLR), 2021.
Simon S Du, Kangcheng Hou, Russ R Salakhutdinov, Barnabas Poczos, Ruosong Wang, and Keyulu
Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In Advances in
Neural Information Processing Systems (NeurIPS), 2019.
David Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael Gómez-Bombarelli, Timothy
Hirzel, Alán Aspuru-Guzik, and Ryan P. Adams. Convolutional networks on graphs for learning
molecular fingerprints. In Advances in Neural Information Processing Systems (NeurIPS), 2015.
Vijay Prakash Dwivedi and Xavier Bresson. A generalization of transformer networks to graphs. AAAI
Workshop on Deep Learning on Graphs: Methods and Applications, 2021.
Laurent El Ghaoui, Vivian Viallon, and Tarek Rabbani. Safe Feature Elimination for the LASSO and
Sparse Supervised Learning Problems. arXiv e-prints, art. arXiv:1009.4219, Sep 2010.
Pedro F Felzenszwalb, Ross B Girshick, David McAllester, and Deva Ramanan. Object detection with
discriminatively trained part-based models. IEEE transactions on pattern analysis and machine
intelligence, 32(9):1627–1645, 2009.
Olivier Fercoq, Alexandre Gramfort, and Joseph Salmon. Mind the duality gap: safer rules for the Lasso.
In International Conference on Machine Learning (ICML), 2015.
94
Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR
Workshop on Representation Learning on Graphs and Manifolds, 2019.
Jerome Friedman, Trevor Hastie, and Robert Tibshirani. The elements of statistical learning. Springer
series in statistics New York, 2001.
Andrew Gardner, Christian A. Duncan, Jinko Kanno, and Rastko R. Selmic. On the definiteness of
earth mover's distance and its relation to set intersection. IEEE Transactions on Cybernetics, 48(11):
3184–3196, 2018.
Thomas Gärtner, Peter Flach, and Stefan Wrobel. On graph kernels: Hardness results and efficient
alternatives. In Learning theory and kernel machines, pages 129–143. Springer, 2003.
Aude Genevay, Gabriel Peyré, and Marco Cuturi. Learning generative models with sinkhorn divergences.
In International Conference on Artificial Intelligence and Statistics (AISTATS), 2018.
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http:
//www.deeplearningbook.org.
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron
Courville, and Yoshua Bengio. Generative adversarial networks. In Advances in Neural Information
Processing Systems (NeurIPS), 2014.
Edouard Grave, Armand Joulin, and Quentin Berthet. Unsupervised alignment of embeddings with
wasserstein procrustes. In International Conference on Artificial Intelligence and Statistics (AISTATS),
2019.
Zaïd Harchaoui and Francis Bach. Image classification with segmentation graph kernels. In 2007 IEEE
Conference on Computer Vision and Pattern Recognition, pages 1–8. IEEE, 2007.
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised
visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and
Pattern Recognition, pages 9729–9738, 2020.
Danny Hernandez and Tom B Brown. Measuring the algorithmic efficiency of neural networks. arXiv
preprint arXiv:2005.04305, 2020.
Jean-Baptiste Hiriart-Urruty and Claude Lemaréchal. Convex Analysis and Minimization Algorithms.
Springer, 1993.
Jean-Baptiste Hiriart-Urruty and Claude Lemaréchal. Convex Analysis and Minimization Algorithms II.
Springer, 1993.
Nhat Ho, XuanLong Nguyen, Mikhail Yurochkin, Hung Hai Bui, Viet Huynh, and Dinh Phung. Multilevel
clustering via wasserstein means. In International Conference on Machine Learning (ICML), 2017.
Toby Hocking, Guillem Rigaill, Jean-Philippe Vert, and Francis Bach. Learning sparse penalties for
change-point detection using max margin interval regression. In International Conference on Machine
Learning (ICML), 2013.
Jie Hou, Badri Adhikari, and Jianlin Cheng. Deepsf: deep convolutional neural network for mappingpro-
tein sequences to folds. Bioinformatics, pages 34(8):1295–1303, 2019.
John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger,
Kathryn Tunyasuvunakool, Russ Bates, Augustin Žídek, Anna Potapenko, Alex Bridgland, Clemens
Meyer, Simon A. A. Kohl, Andrew J. Ballard, Andrew Cowie, Bernardino Romera-Paredes, Stanislav
Nikolov, Rishub Jain, Jonas Adler, Trevor Back, Stig Petersen, David Reiman, Ellen Clancy, Michal
Zielinski, Martin Steinegger, Michalina Pacholska, Tamas Berghammer, Sebastian Bodenstein, David
Silver, Oriol Vinyals, Andrew W. Senior, Koray Kavukcuoglu, Pushmeet Kohli, and Demis Hassabis.
Highly accurate protein structure prediction with alphafold. Nature, 596(7873):583–589, 2021.
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott
Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models, 2020.
95
Kristian Kersting, Nils M. Kriege, Christopher Morris, Petra Mutzel, and Marion Neumann. Benchmark
data sets for graph kernels, 2016. URL http://graphkernels.cs.tu-dortmund.de.
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on
Learning Representations (ICLR), 2014.
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In
International Conference on Learning Representations (ICLR), 2017.
Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In International
Conference on Learning Representations (ICLR), 2020.
Johannes Klicpera, Stefan Weissenberger, and Stephan Günnemann. Diffusion improves graph learning.
In Advances in Neural Information Processing Systems (NeurIPS), 2019.
Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and
Neil Houlsby. Big transfer (bit): General visual representation learning. In Proceedings of the European
Conference on Computer Vision (ECCV), 2020.
Soheil Kolouri, Yang Zou, and Gustavo K. Rohde. Sliced wasserstein kernels for probability distributions.
In Proceedings of the Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
Soheil Kolouri, Navid Naderializadeh, Gustavo K. Rohde, and Heiko Hoffmann. Wasserstein embedding
for graph learning. In International Conference on Learning Representations (ICLR), 2021.
Risi Kondor and Jean-Philippe Vert. Diffusion kernels. In Kernel Methods in Computational Biology,
pages 171–192. MIT Press, 2004.
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional
neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances
in Neural Information Processing Systems, volume 25. Curran Associates, Inc., 2012. URL https://
proceedings.neurips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf.
Juho Lee, Yoonho Lee, Jungtaek Kim, Adam R. Kosiorek, Seungjin Choi, and Yee Whye Teh. Set
transformer: A framework for attention-based permutation invariant neural networks. In International
Conference on Machine Learning (ICML), 2019.
Yuan Li, Xiaodan Liang, Zhiting Hu, Yinbo Chen, and Eric P. Xing. Graph transformer, 2019. URL
https://openreview.net/forum?id=HJei-2RcK7.
Marit Låg, James G. Omichinski, Erik Dybing, Sidney D. Nelson, and Erik J. SÞderlund. Mutagenic
activity of halogenated propanes and propenes: effect of bromine and chlorine positioning. Chemico-
Biological Interactions, 93(1):73–84, 1994. doi: https://doi.org/10.1016/0009-2797(94)90087-6. URL
https://www.sciencedirect.com/science/article/pii/0009279794900876.
Siwei Lyu. Mercer kernels for object recognition with local features. In Conference on Computer Vision
and Pattern Recognition (CVPR), 2004.
Pierre Mahé and Jean-Philippe Vert. Graph kernels based on tree patterns for molecules. Machine
learning, 75(1):3–35, 2009.
Julien Mairal. End-to-end kernel learning with supervised convolutional kernel networks. In Advances
in Neural Information Processing Systems (NeurIPS), 2016.
Julien Mairal. Cyanure: An open-source toolbox for empirical risk minimization for python, C++, and
soon more. arXiv preprint arXiv:1912.08165, 2019.
Julien Mairal, Piotr Koniusz, Zaid Harchaoui, and Cordelia Schmid. Convolutional kernel networks. In
Advances in Neural Information Processing Systems (NeurIPS), 2014.
Louis Martin, Benjamin Muller, Pedro Javier Ortiz Suárez, Yoann Dupont, Laurent Romary, Éric Ville-
monte de la Clergerie, Djamé Seddah, and Benoît Sagot. Camembert: a tasty french language model.
In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, 2020.
Mathurin Massias, Alexandre Gramfort, and Joseph Salmon. Celer: a fast solver for the lasso with dual
96
extrapolation. In International Conference on Machine Learning (ICML), 2018.
Grégoire Mialon, Alexandre d'Aspremont, and Julien Mairal. Screening data points in empirical risk
minimization via ellipsoidal regions and safe loss functions. In International Conference on Artificial
Intelligence and Statistics (AISTATS), 2020.
Grégoire Mialon, Dexiong Chen, Alexandre d'Aspremont, and Julien Mairal. A trainable optimal
In International
transport embedding for feature aggregation and its relationship to attention.
Conference on Learning Representations (ICLR), 2021a.
Grégoire Mialon, Dexiong Chen, Margot Selosse, and Julien Mairal. Graphit: Encoding graph structure
in transformers, 2021b.
Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? In Advances
in Neural Information Processing Systems (NeurIPS), 2019.
Caroline Moosmüller and Alexander Cloninger. Linear optimal transport embedding: Provable fast
wasserstein distance computation and classification for nonlinear problems, 2020.
Jean-Jacques Moreau. Fonctions convexes duales et points proximaux dans un espace hilbertien. CR
Acad. Sci. Paris Sér. A MAth, 1962.
Arkadi Nemirovskii and David Yudin. Problem complexity and method efficiency in optimization. Nauka
(published in English by John Wiley, Chichester, 1983), 1979.
Yuri Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103(1):
127–152, 2005.
Kohei Ogawa, Yoshiki Suzuki, Shinya Suzumura, and Ichiro Takeuchi. Safe sample screening for support
vector machines, 2014.
Ankur Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model
for natural language inference. In Conference on Empirical Methods in Natural Language Processing
(EMNLP), 2016.
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer,
R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and
E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:
2825–2830, 2011.
Gabriel Peyré and Marco Cuturi. Computational optimal transport. Foundations and Trends in Machine
Learning, 11(5-6):355–206, 2019.
Julien Rabin, Gabriel Peyré, Julie Delon, and Marc Bernot. Wasserstein barycenter and its application
to texture mixing. In International Conference on Scale Space and Variational Methods in Computer
Vision (SSVM), 2011.
Alessandro Raganato, Yves Scherrer, and Tiedemann Jörg. Fixed encoder self-attention patterns in
transformer-based machine translation. In arXiv preprint arXiv: 2002.10260, 2020.
Ali Rahimi and Ben Recht. Random features for large-scale kernel machines. In Advances in Neural
Information Processing Systems (NeurIPS), 2007.
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle
Ott, C. Lawrence Zitnick, Jerry Ma, and Rob Fergus. Biological structure and function emerge from
scaling unsupervised learning to 250 million protein sequences. bioRxiv, 2019. doi: 10.1101/622803.
URL https://www.biorxiv.org/content/10.1101/622803v4.
Yossi Rubner, Carlo Tomasi, and Leonidas J. Guibad. The earth mover's distance as a metric for image
retrieval. International Journal of Computer Vision, 40:99–121, 2000.
Alexandre Sablayrolles, Matthijs Douze, Cordelia Schmid, Yann Ollivier, and Herve Jegou. White-box
vs black-box: Bayes optimal strategies for membership inference. In International Conference on
Machine Learning (ICML), 2019.
97
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The
graph neural network model. IEEE transactions on neural networks, 20(1):61–80, 2008.
Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon
Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, et al. Mastering atari, go,
chess and shogi by planning with a learned model. Nature, 588(7839):604–609, 2020.
Bernhard Schölkopf and Alexander Smola. Learning with kernels: support vector machines, regularization,
optimization, and beyond. MIT Press, 2001.
A. W. Senior, R. Evans, J. Jumper, J. Kirkpatrick, L. Sifre, T. Green, et al. Improved protein structure
prediction using potentials from deep learning. Nature, 577(7792):706–710, 2020.
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations.
In Proceedings of the North American Chapter of the Association for Computational Linguistics
(NAACL), 2018.
Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten Borgwardt. Efficient
graphlet kernels for large graph comparison. In International Conference on Artificial Intelligence
and Statistics (AISTATS), 2009.
Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt.
Weisfeiler-Lehman graph kernels. Journal of Machine Learning Research (JMLR), 12:2539–2561, 2011.
Atsushi Shibagaki, Masayuki Karasuyama, Kohei Hatano, and Ichiro Takeuchi. Simultaneous Safe
Screening of Features and Samples in Doubly Sparse Modeling. In International Conference on
Machine Learning (ICML), 2016.
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche,
Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the
game of go with deep neural networks and tree search. nature, 529(7587):484–489, 2016.
Richard Sinkhorn and Paul Knopp. Concerning nonnegative matrices and doubly stochastic matrices.
Pacific Journal of Mathematics, 21(2), 1967.
Konstantinos Skianis, Giannis Nikolentzos, Stratis Limnios, and Michalis Vazirgiannis. Rep the set:
Neural networks for learning set representations. In International Conference on Artificial Intelligence
and Statistics (AISTATS), 2020.
Alexander J. Smola and Risi Kondor. Kernels and regularization on graphs. In Bernhard Schölkopf and
Manfred K. Warmuth, editors, Learning Theory and Kernel Machines, pages 144–158. Springer Berlin
Heidelberg, 2003.
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and
Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank.
In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2013.
Ingo Steinwart. Sparseness of support vector machines-some asymptotically sharp bounds. In Advances
in Neural Information Processing Systems, 2004.
Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep
learning in nlp, 2019.
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and
Rob Fergus. Intriguing properties of neural networks. In iclr, 2014.
Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey, 2020.
Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical
Society: Series B (Methodological), 58(1):267–288, 1996.
Robert Tibshirani, Jacob Bien, Jerome Friedman, Trevor Hastie, Noah Simon, Jonathan Taylor, and
Ryan J Tibshirani. Strong rules for discarding predictors in lasso-type problems. Journal of the Royal
Statistical Society: Series B (Statistical Methodology), 74(2):245–266, 2012.
98
Giorgos Tolias, Yannis Avrithis, and Hervé Jégou. To aggregate or not to aggregate: Selective match
kernels for image search. In Proceedings of the International Conference on Computer Vision (ICCV),
2013.
Hugo Touvron, Piotr Bojanowski, Mathilde Caron, Matthieu Cord, Alaaeldin El-Nouby, Edouard Grave,
Gautier Izacard, Armand Joulin, Gabriel Synnaeve, Jakob Verbeek, and Hervé Jégou. Resmlp:
Feedforward networks for image classification with data-efficient training, 2021a.
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé
Jégou. Training data-efficient image transformers & distillation through attention. In International
Conference on Machine Learning (ICML), pages 10347–10357. PMLR, 2021b.
Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, and Ruslan Salakhutdinov.
Transformer dissection: A unified understanding of transformer's attention via the lens of kernel. In
Conference on Empirical Methods in Natural Language Processing (EMNLP), 2019.
Ashish Vaswani, Noam Shazeer, Nikki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing
Systems (NeurIPS), 2017.
Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio.
Graph attention networks. In International Conference on Learning Representations (ICLR), 2018.
Nitika Verma, Edmond Boyer, and Jakob Verbeek. Feastnet: Feature-steered graph convolutions for
3d shape analysis. In Proceedings of the Conference on Computer Vision and Pattern Recognition
(CVPR), 2018.
Cédric Villani. Optimal Transport: Old and New. Springer, 2008.
Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. Analyzing multi-head
self-attention: Specialized heads do the heavy lifting, the rest can be pruned. In Proceedings of the
Annual Meeting of the Association for Computational Linguistics (ACL), 2019.
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. Glue: a
multi-task benchmark and analysis platform for natural language understanding. In International
Conference on Learning Representations (ICLR), 2019.
Jie Wang, Jiayu Zhou, Peter Wonka, and Jieping Ye. Lasso screening rules via dual polytope projection.
In Advances in Neural Information Processing Systems (NeurIPS), 2013a.
Jie Wang, Jiayu Zhou, Jun Liu, Peter Wonka, and Jieping Ye. A safe screening rule for sparse logistic
regression. In Advances in Neural Information Processing Systems (NeurIPS), 2014.
Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with
linear complexity. In arXiv preprint arXiv: 2006.04768v3, 2020.
Wei Wang, Dejan Slepcev, Saurav Basu, John A. Ozolek, and Gustavo K. Rohde. A linear optimal
transportation framework for quantifying and visualizing variations in sets of images. International
Journal of Computer Vision, 101(2):254–269, 2013b.
Xiaolong Wang, Ross B. Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In
Proceedings of the Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
You Weiqiu, Simeng Sun, and Mohit Iyyer. Hard-coded gaussian attention for neural machine translation.
In Proceedings of the Annual Meeting of the Association for Computational Linguistics (ACL), 2020.
Christopher KI Williams and Matthias Seeger. Using the Nyström method to speed up kernel machines.
In Advances in Neural Information Processing Systems (NeurIPS), 2001.
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric
Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, and Jamie Brew. Huggingface's transformers:
State-of-the-art natural language processing. In arXiv preprint arXiv: 1910.03771, 2019.
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks?
99
In International Conference on Learning Representations (ICLR), 2019.
Kosaku Yosida. Functional analysis. Berlin-Heidelberg, 1980.
Seongjun Yun, Minbyul Jeong, Raehyun Kim, Jaewoo Kang, and Hyunwoo Kim. Graph transformer
networks. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
Manzil Zaheer, Satwik Kottur, Siamak Ravanbhakhsh, Barnabás Póczos, Ruslan Salakhutdinov, and
Alexander J. Smola. Deep sets. In Advances in Neural Information Processing Systems (NeurIPS),
2017.
Jiawei Zhang, Haopeng Zhang, Congying Xia, and Li Sun. Graph-bert: Only attention is needed for
learning graph representations, 2020.
Kai Zhang, Ivor W. Tsang, and James T. Kwok. Improved nyström low-rank approximation and error
analysis. In International Conference on Machine Learning (ICML), 2008.
Jian Zhou and Olga G Troyanskaya. Predicting effects of noncoding variants with deep learning–based
sequence model. Nature methods, 12(10):931–934, 2015.
Hui Zou and Trevor Hastie. Regularization and variable selection via the elastic net. Journal of the
Royal Statistical Society: Series B (Statistical Methodology), 67(2):301–320, 2005.
100
RÉSUMÉ
Apprendre à partir de données limitées est l'un des plus gros problèmes du deep learning. Les approches courantes
et populaires de cette question consistent à entraîner un modèle sur d'énormes quantités de données, étiquetées ou
non, avant de réentraîner le modèle sur un ensemble de données d'intérêt, plus petit, appartenant à la même modalité.
Intuitivement, cette technique permet au modèle d'apprendre d'abord une représentation générale pour un certain type de
données, telles que des images. Moins de données seront ensuite nécessaires pour apprendre une tâche spécifique pour
cette modalité particulière. Bien que cette approche appelée « apprentissage par transfert » soit très efficace dans des
domaines tels que la vision par ordinateur ou le traitement du langage naturel, elle ne résout pas les problèmes courants
du deep learning tels que l'interprétabilité des modèles ou le besoin global en données. Cette thèse explore une réponse
différente au problème de l'apprentissage de modèles expressifs dans des contextes où les données sont plus rares. Au
lieu de s'appuyer sur de grands ensembles de données pour apprendre les paramètres d'un réseau de neurones, nous
remplacerons certains de ces paramètres par des fonctions mathématiques connues reflétant la structure des données.
Très souvent, ces fonctions seront puisées dans la riche littérature des méthodes à noyau. En effet, de nombreux noyaux
peuvent être interprétés, et/ou permettre un apprentissage avec peu de données. Notre approche s'inscrit dans le
cadre des « biais inductifs », qui peuvent être définis comme des hypothèses sur les données disponibles restreignant
l'espace des modèles à explorer lors de l'apprentissage. Dans les deux premiers chapitres de la thèse, nous démontrons
l'efficacité de cette approche dans le cadre de séquences, telles que des phrases en langage naturel ou des séquences
protéiques, et de graphes, tels que des molécules. Nous soulignons également la relation entre notre travail et les progrès
récents du deep learning. Le dernier chapitre de cette thèse se concentre sur les modèles d'apprentissage automatique
convexes. Ici, plutôt que de proposer de nouveaux modèles, nous nous demandons quelle proportion des échantillons
d'un jeu de données est vraiment nécessaire pour apprendre un « bon » modèle. Plus précisément, nous étudions le
problème du filtrage sûr des échantillons, c'est-à-dire l'exécution de tests simples afin d'éliminer les échantillons non
informatifs d'un ensemble de données avant même d'entraîner un modèle d'apprentissage automatique, sans affecter
le modèle optimal. De telles techniques peuvent être utilisées pour compresser des jeux de données ou extraire des
échantillons rares.
MOTS CLÉS
Apprentissage automatique, apprentissage profond, méthodes à noyau, optimisation convexe
ABSTRACT
Learning with limited data is one of the biggest problems of deep learning. Current, popular approaches to this issue
consist in training models on huge amounts of data, labelled or not, before re-training the model on a smaller dataset of
interest from the same modality. Intuitively, this technique allows the model to learn a general representation for some
kind of data first, such as images. Then, fewer data should be required to learn a specific task for this particular modality.
While this approach coined as "transfer learning" is very effective in domains such as computer vision or natural langage
processing, it does not solve common problems of deep learning such as model interpretability or the overall need for
data. This thesis explores a different answer to the problem of learning expressive models in data constrained settings.
Instead of relying on big datasets to learn the parameters of a neural network, we will replace some of them by known
functions reflecting the structure of the data. Very often, these functions will be drawn from the rich litterature of kernel
methods. Indeed, many kernels can be interpreted, and/or allow for learning with few data. Our approach falls under the
hood of "inductive biases", which can be defined as hypothesis on the data at hand restricting the space of models to
explore during learning. In the first two chapters of the thesis, we demonstrate the effectiveness of this approach in the
context of sequences, such as sentences in natural language or protein sequences, and graphs, such as molecules. We
also highlight the relationship between our work and recent advances in deep learning. The last chapter of this thesis
focuses on convex machine learning models. Here, rather than proposing new models, we wonder which proportion of
the samples in a dataset is really needed to learn a "good" model. More precisely, we study the problem of safe sample
screening, i.e, executing simple tests to discard uninformative samples from a dataset even before fitting a machine
learning model, without affecting the optimal model. Such techniques can be used to compress datasets or mine for rare
samples.
KEYWORDS
Machine learning, deep learning, kernel methods, convex optimization
|
|
http://arxiv.org/abs/2302.10688v3 | 2023-10-29T12:14:29 | 2023-02-21T14:14:40 | On Calibrating Diffusion Probabilistic Models | Recently, diffusion probabilistic models (DPMs) have achieved promising
results in diverse generative tasks. A typical DPM framework includes a forward
process that gradually diffuses the data distribution and a reverse process
that recovers the data distribution from time-dependent data scores. In this
work, we observe that the stochastic reverse process of data scores is a
martingale, from which concentration bounds and the optional stopping theorem
for data scores can be derived. Then, we discover a simple way for calibrating
an arbitrary pretrained DPM, with which the score matching loss can be reduced
and the lower bounds of model likelihood can consequently be increased. We
provide general calibration guidelines under various model parametrizations.
Our calibration method is performed only once and the resulting models can be
used repeatedly for sampling. We conduct experiments on multiple datasets to
empirically validate our proposal. Our code is at
https://github.com/thudzj/Calibrated-DPMs. | [
"Tianyu Pang",
"Cheng Lu",
"Chao Du",
"Min Lin",
"Shuicheng Yan",
"Zhijie Deng"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10688v3",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10688v3",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CV",
"stat.ML"
] | 3
2
0
2
t
c
O
9
2
]
G
L
.
s
c
[
3
v
8
8
6
0
1
.
2
0
3
2
:
v
i
X
r
a
On Calibrating Diffusion Probabilistic Models
Tianyu Pang†1, Cheng Lu2, Chao Du1, Min Lin1, Shuicheng Yan1, Zhijie Deng†3
1Sea AI Lab, Singapore
2Department of Computer Science, Tsinghua University
3Qing Yuan Research Institute, Shanghai Jiao Tong University
{tianyupang, duchao, linmin, yansc}@sea.com;
[email protected]; [email protected]
Abstract
Recently, diffusion probabilistic models (DPMs) have achieved promising results
in diverse generative tasks. A typical DPM framework includes a forward process
that gradually diffuses the data distribution and a reverse process that recovers the
data distribution from time-dependent data scores. In this work, we observe that the
stochastic reverse process of data scores is a martingale, from which concentration
bounds and the optional stopping theorem for data scores can be derived. Then, we
discover a simple way for calibrating an arbitrary pretrained DPM, with which the
score matching loss can be reduced and the lower bounds of model likelihood can
consequently be increased. We provide general calibration guidelines under various
model parametrizations. Our calibration method is performed only once and the
resulting models can be used repeatedly for sampling. We conduct experiments
on multiple datasets to empirically validate our proposal. Our code is available at
https://github.com/thudzj/Calibrated-DPMs.
1
Introduction
In the past few years, denoising diffusion probabilistic modeling [17, 40] and score-based Langevin
dynamics [42, 43] have demonstrated appealing results on generating images. Later, Song et al. [46]
unify these two generative learning mechanisms through stochastic/ordinary differential equations
(SDEs/ODEs). In the following we refer to this unified model family as diffusion probabilistic models
(DPMs). The emerging success of DPMs has attracted broad interest in downstream applications,
including image generation [10, 22, 48], shape generation [4], video generation [18, 19], super-
resolution [35], speech synthesis [5], graph generation [51], textual inversion [13, 34], improving
adversarial robustness [50], and text-to-image large models [32, 33], just to name a few.
A typical framework of DPMs involves a forward process gradually diffusing the data distribution
[0, T ] is a conditional
q0(x0) towards a noise distribution qT (xT ). The transition probability for t
R+. Song et al. [46] show
Gaussian distribution q0t(xt
that there exist reverse SDE/ODE processes starting from qT (xT ) and sharing the same marginal
distributions qt(xt) as the forward process. The only unknown term in the reverse processes is the
data score
θ(xt) (or
with other model parametrizations). st
xt log qt(xt), which can be approximated by a time-dependent score model st
θ(xt) is typically learned via score matching (SM) [20].
t I), where αt, σt
x0) =
|
αtx0, σ2
(xt
∇
N
∈
∈
|
In this work, we observe that the stochastic process of the scaled data score αt
xt log qt(xt) is a
martingale w.r.t. the reverse-time process of xt from T to 0, where the timestep t can be either
continuous or discrete. Along the reverse-time sampling path, this martingale property leads to
concentration bounds for scaled data scores. Moreover, a martingale satisfies the optional stopping
theorem that the expected value at a stopping time is equal to its initial expected value.
∇
†Corresponding authors.
37th Conference on Neural Information Processing Systems (NeurIPS 2023).
∈
−
θ(xt)
[0, T ] and any pretrained score
Based on the martingale property of data scores, for any t
model st
θ(xt) (or with other model parametrizations), we can calibrate the model by subtracting
its expectation over qt(xt), i.e., Eqt(xt) [st
θ(xt)]. We formally demonstrate that the calibrated score
model st
Eqt(xt) [st
θ(xt)] achieves lower values of SM objectives. By the connections between
SM objectives and model likelihood of the SDE process [23, 45] or the ODE process [28], the
calibrated score model has higher evidence lower bounds. Similar conclusions also hold for the
conditional case, in which we calibrate a conditional score model st
θ(xt, y) by subtracting its
conditional expectation Eqt(xt|y) [st
In practice, Eqt(xt) [st
θ(xt, y)] can be approximated using noisy training data
when the score model has been pretrained. We can also utilize an auxiliary shallow model to estimate
these expectations dynamically during pretraining. When we do not have access to training data, we
could calculate the expectations using data generated from st
θ(xt, y). In experiments, we
evaluate our calibration tricks on the CIFAR-10 [25] and CelebA 64
64 [27] datasets, reporting the
FID scores [16]. We also provide insightful visualization results on the AFHQv2 [7], FFHQ [21] and
ImageNet [9] at 64
θ(xt, y)].
θ(xt)] or Eqt(xt|y) [st
θ(xt) or st
64 resolution.
×
×
2 Diffusion probabilistic models
In this section, we briefly review the notations and training paradigms used in diffusion probabilistic
models (DPMs). While recent works develop DPMs based on general corruptions [2, 8], we mainly
focus on conventional Gaussian-based DPMs.
2.1 Forward and reverse processes
Rk and define a forward diffusion process on x as
We consider a k-dimensional random variable x
}t∈[0,T ] with T > 0, which satisfies
q0(x0),
∈
q0t(xt
xt
{
t
∀
x0
∈
[0, T ],
x0) =
(xt
αtx0, σ2
|
t I).
(1)
(2)
∼
|
Here q0(x0) is the data distribution; αt and σt are two positive real-valued functions that are
x0)q0(x0)dx0 be the marginal
differentiable w.r.t. t with bounded derivatives. Let qt(xt) =
|
distribution of xt. The schedules of αt, σ2
σ2I) for some
0,
σ. Kingma et al. [23] prove that there exists a stochastic differential equation (SDE) satisfying the
forward transition distribution in Eq. (1), and this SDE can be written as
t need to ensure that qT (xT )
q0t(xt
≈ N
(xT
N
(cid:82)
|
(cid:101)
(cid:101)
dxt = f (t)xtdt + g(t)dωt,
where ωt
t . Song
et al. [46] demonstrate that the forward SDE in Eq. (2) corresponds to a reverse SDE constructed as
Rk is the standard Wiener process, f (t) = d log αt
2 d log αt
dt σ2
dt −
, and g(t)2 = dσ2
∈
dt
t
dxt =
f (t)xt
(3)
xt log qt(xt)
Rk is the standard Wiener process in reverse time. Starting from qT (xT ), the marginal
(cid:3)
[0, T ]. There also exists a deterministic
dt + g(t)dωt,
∇
−
(cid:2)
g(t)2
∈
where ωt
distribution of the reverse SDE process is also qt(xt) for t
process described by an ordinary differential equation (ODE) as
dxt
dt
= f (t)xt
g(t)2
1
2
∈
∇
−
xt log qt(xt),
(4)
which starts from qT (xT ) and shares the same marginal distribution qt(xt) as the reverse SDE in
Eq. (3). Moreover, let q0t(x0
and by Tweedie's formula [12], we know that
αtEq0t(x0|xt) [x0] = xt + σ2
xt) = q0t(xt|x0)q0(x0)
xt log qt(xt).
qt(xt)
|
t ∇
2.2 Training paradigm of DPMs
xt log qt(xt) at timestep t, a score-based model st
To estimate the data score
parameters θ is trained to minimize the score matching (SM) objective [20] as
θ(xt) [46] with shared
To eliminate the intractable computation of
(cid:3)
xt log qt(xt), denoising score matching (DSM) [49]
transforms
t
SM(θ) into
J
J
t
DSM(θ) ≜ 1
2 Eq0(x0),q(ε)
θ(xt) + ε
st
σt
, where xt = αtx0 + σtε and
(cid:21)
xt log qt(xt)
.
2
2
∥
− ∇
(5)
Eqt(xt)
st
θ(xt)
∥
(cid:2)
∇
(cid:20)(cid:13)
(cid:13)
(cid:13)
2
2
2
(cid:13)
(cid:13)
(cid:13)
∇
SM(θ) ≜ 1
2
t
J
J
N
(ε
q(ε) =
|
t
SM(θ) and
t
DSM(θ) is equivalent up to a constant, i.e.,
0, I) is a standard Gaussian distribution. Under mild boundary conditions, we know
DSM(θ) + C t and C t is a
t
J
constant independent of the model parameters θ. Other SM variants [31, 44] are also applicable
here. The total SM objective for training is a weighted sum of
[0, T ], defined
SM(θ; λ(t)) ≜
t
SM(θ)dt, where λ(t) is a positive weighting function. Similarly, the
as
T
t
DSM(θ)dt. The training objectives under other
total DSM objective is
0 λ(t)
J
model parametrizations such as noise prediction εt
θ(xt) [23, 32], and
velocity prediction vt
J
θ(xt) [17, 33], data prediction xt
(cid:82)
θ(xt) [18, 38] are recapped in Appendix B.1.
DSM(θ; λ(t)) ≜
t
SM(θ) across t
t
SM(θ) =
T
0 λ(t)
J
J
J
J
J
∈
(cid:82)
2.3 Likelihood of DPMs
f (t)xt
g(t)2st
Suppose that the reverse processes start from a tractable prior pT (xT ) =
approximate the reverse-time SDE process by substituting
dxt =
t
by the total SM objective
Lemma 1. (Proof in Song et al. [45]) Let qt(xt) be constructed from the forward process in Eq. (2).
Then under regularity conditions, we have
q0
σ2I). We can
|
θ(xt) in Eq. (3) as
(xt; θ) for
(x0; θ) can be bounded
∇
dt + g(t)dωt, which induces the marginal distribution pSDE
[0, T ]. In particular, at t = 0, the KL divergence between q0(x0) and pSDE
SM(θ; g(t)2) with the weighing function of g(t)2, as stated below:
(xT
xt log qt(xt) with st
SM(θ; g(t)2) +
θ(xt)
KL (qT
pT ).
(θ)
N
−
0,
J
∈
KL
(cid:101)
t
(cid:2)
(cid:3)
0
D
pSDE
0
∥
≤ J
D
∥
(cid:0)
D
∇
KL (qT
xt log qt(xt) with st
(cid:1)
θ(xt) in Eq. (4) as dxt
pT ) is the prior loss independent of θ. Similarly, we approximate the reverse-time
Here
∥
ODE process by substituting
θ(xt),
which induces the marginal distribution pODE
[0, T ]. By the instantaneous change
t
of variables formula [6], we have log pODE
(xt;θ)
f (t)xt
)
θ(xt)
*
denotes the trace of a matrix. Integrating change in log pODE
(xt; θ) from t = 0 to T can give the
(cid:0)
log pODE
value of log pT (xT )
(x0; θ), but requires tracking the path from x0 to xT . On the other
0
hand, at t = 0, the KL divergence between q0(x0) and pODE
Lemma 2. (Proof in Lu et al. [28]) Let qt(xt) be constructed from the forward process in Eq. (2).
Then under regularity conditions, we have
pT ) +
∥
KL
J
Diff(θ) measures the difference between st
θ(xt) and
(xt; θ) for t
tr
=
(x0; θ) can be decomposed:
KL (qT
D
xt log pODE
Diff(θ), where the term
SM(θ; g(t)2) +
dt = f (t)xt
2 g(t)2st
2 g(t)2st
pODE
0
∥
, where tr(
(xt; θ).
(θ)
(cid:1)(cid:1)
q0
∇
−
−
−
=
−
D
∈
xt
dt
(cid:0)
1
0
1
t
t
t
Diff(θ) is intractable due to the term
(xt; θ), nevertheless, we could
Diff(θ) via bounding high-order SM objectives [28].
(cid:0)
(cid:1)
xt log pODE
t
∇
∇
J
Directly computing
bound
J
J
J
3 Calibrating pretrained DPMs
In this section we begin with deriving the relationship between data scores at different timesteps,
which leads us to a straightforward method for calibrating any pretrained DPMs. We investigate
further how the dataset bias of finite samples prevents empirical learning from achieving calibration.
3.1 The stochastic process of data score
|
According to Kingma et al. [23], the form of the forward process in Eq. (1) can be generalized to
T . Then, the transition probability from xs to xt is written as
any two timesteps 0
s < t
≤
≤
, where αt|s = αt
αt|sxs, σ2
t|sI
s . Here the marginal
qst(xt
xt
xs) =
t −
αs
N
xs)qs(xs)dxs. We can generally derive the connection
distribution satisfies qt(xt) =
qst(xt
(cid:17)
|
between data scores
xs log qs(xs) as stated below:
xt log qt(xt) and
∇
Theorem 1. (Proof in Appendix A.1) Let qt(xt) be constructed from the forward process in Eq. (2).
Then under some regularity conditions, we have
0
∀
t|s = σ2
t|sσ2
α2
and σ2
(cid:12)
(cid:12)
(cid:12)
∇
s < t
T ,
≤
(cid:16)
(cid:82)
αt
∇
xt log qt(xt) = Eqst(xs|xt) [αs
∇
≤
xs log qs(xs)] ,
(6)
where qst(xs
|
xt) = qst(xt|xs)qs(xs)
qt(xt)
is the transition probability from xt to xs.
xt log qt(xt) is a martingale w.r.t. the reverse-
Theorem 1 indicates that the stochastic process of αt
time process of xt from timestep T to 0. From the optional stopping theorem [14], the expected
∇
3
x0 log q0(x0)].
value of a martingale at a stopping time is equal to its initial expected value Eq0(x0) [
It is known that, under a mild boundary condition on q0(x0), there is Eq0(x0) [
x0 log q0(x0)] = 0
(proof is recapped in Appendix A.2). Consequently, as to the stochastic process, the martingale
property results in Eqt(xt) [
[0, T ]. Moreover, the martingale property of
∇
the (scaled) data score αt
xt log qt(xt) leads to concentration bounds using Azuma's inequality and
Doob's martingale inequality as derived in Appendix A.3. Although we do not use these concentration
bounds further in this paper, there are other concurrent works that use roughly similar concentration
bounds in diffusion models, such as proving consistency [47] or justifying trajectory retrieval [52].
xt log qt(xt)] = 0 for
t
∀
∇
∇
∇
∈
3.2 A simple calibration trick
θ(xt)
θ(xt) in practice, there is usually Eqt(xt) [st
= 0, despite the fact
θ(xt)
ηt, where ηt is a time-dependent calibration term that is independent of any particular
xt log qt(xt)] = 0. This motivates us to calibrate st
Given a pretrained model st
that the expect data score is zero as Eqt(xt) [
to st
input xt. The calibrated SM objective is written as follows:
SM(θ, ηt) ≜ 1
2
xt log qt(xt)
2
2
∥
θ(xt)]
Eqt(xt)
∇
ηt
−
J
t
st
θ(xt)
∥
(cid:2)
Eqt(xt)
−
− ∇
⊤
−
st
θ(xt)
ηt +
t
SM(θ)
=
J
1
2 ∥
ηt
2
2,
∥
(cid:3)
(7)
where the second equation holds after the results of Eqt(xt) [
xt log qt(xt)] = 0, and there is
t
SM(θ) specifically when ηt = 0. Note that the orange part in Eq. (7) is a quadratic
t
SM(θ, ηt) that minimizes the calibrated
t
SM(θ, 0) =
∇
(cid:2)
(cid:3)
st
θ(xt)
2
2 .
(8)
(9)
J
J
function w.r.t. ηt. We look for the optimal η∗
SM objective, from which we can derive
η∗
t = Eqt(xt)
t
SM(θ, ηt), we have
SM(θ, η∗
t
After taking η∗
t
SM(θ)
t into
t ) =
J
t = arg minηt J
st
.
θ(xt)
(cid:3)
(cid:2)
1
2
(cid:13)
DSM(θ, η∗
t
(cid:13)
Eqt(xt)
J
−
DSM(θ) + C t, we have
t
J
1
2
J
J
J
J
−
(cid:2)
t ) =
θ(xt)]
(cid:3)(cid:13)
t
DSM(θ)
(cid:13)
t
SM(θ) =
Eqt(xt) [st
2
Since there is
2
for the DSM objective. Similar calibration tricks are also valid under other model parametrizations
(cid:13)
(cid:13)
and SM variants, as formally described in Appendix B.2.
(cid:13)
(cid:13)
Remark. For any pretrained score model st
Eqt(xt) [st
θ(xt), we can calibrate it into st
θ(xt)],
θ(xt)
2
which reduces the SM/DSM objectives at timestep t by 1
2. The expectation of the
2
st
calibrated score model is always zero, i.e., Eqt(xt)
= 0 holds for any θ,
θ(xt)]
θ(xt)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
xt log qt(xt)] = 0 satisfied by data scores.
which is consistent with Eqt(xt) [
Calibration preserves conservativeness. A theoretical flaw of score-based modeling is that st
θ(xt)
may not correspond to a probability distribution. To solve this issue, Salimans and Ho [37] develop
an energy-based model design, which utilizes the power of score-based modeling and simultaneously
θ(xt) is conservative, i.e., there exists a probability distribution pt
makes sure that st
θ(xt) such that
θ(xt) by subtracting
xt
x⊤
t ηt
θ(xt). In this case, after we calibrate st
Rk, we have st
θ(xt)
∀
ηt, there is st
θ(xt)]
Eqt(xt) [st
, where Zt(θ) =
pt
θ(xt) exp
Eqt(xt) [st
∇
xt log
xt log pt
θ(xt) =
ηt =
dxt
∇
−
−
∈
(cid:3)
(cid:2)
pt
θ(xt)
exp(x⊤
t ηt)Zt(θ)
(cid:19)
(cid:18)
θ(xt) is conservative, its calibrated version st
represents the normalization factor. Intuitively, subtracting by ηt corresponds to a shift in the vector
space, so if st
Conditional cases. As to the conditional DPMs, we usually employ a conditional model st
where y
ditional data score
fined as
Eqt(xt) [
the conditional term ηt(y) and the calibrated SM objective is formulated as
θ(xt, y),
is the conditional context (e.g., class label or text prompt). To learn the con-
xt log qt(xt, y), we minimize the SM objective de-
. Similar to the conclusion of
θ(xt, y), we use
∈ Y
xt log qt(xt
∇
SM(θ) ≜ 1
t
2 Eqt(xt,y)
J
xt log qt(xt)] = 0, there is Eqt(xt|y) [
∇
y)] = 0. To calibrate st
|
xt log qt(xt, y)
∥
xt log qt(xt
ηt is also conservative.
θ(xt)
−
2
2
(cid:82)
(cid:1)
(cid:0)
(cid:3)
y) =
∇
|
st
θ(xt, y)
− ∇
∥
(cid:2)
∇
SM(θ, ηt(y)) ≜ 1
2
J
Eqt(xt,y)
t
ηt(y)
xt log qt(xt, y)
∥
− ∇
−
st
θ(xt, y)
−
∇
−
2
2
(cid:3)
(10)
=
J
t
SM(θ)
−
Eqt(xt,y)
θ(xt, y)⊤ηt(y) +
st
(cid:20)
1
2 ∥
ηt(y)
∥
2
2
,
(cid:21)
∥
(cid:2)
4
̸
∈ Y
, the optimal η∗
θ(xt, y)]. We highlight
and for any y
the conditional context y in contrast to the unconditional form in Eq. (7). After taking η∗
t (y)
into
. This
J
conditional calibration form can naturally generalize to other model parametrizations and SM variants.
t
SM(θ, ηt(y)), we have
Eqt(xt|y) [st
t (y) = Eqt(xt|y) [st
t (y) is given by η∗
SM(θ, η∗
t
1
2 Eqt(y)
θ(xt, y)]
t (y)) =
t
SM(θ)
−
2
2
J
J
(cid:104)(cid:13)
(cid:13)
(cid:105)
(cid:13)
(cid:13)
3.3 Likelihood of calibrated DPMs
Now we discuss the effects of calibration on model likelihood. Following the notations in Section 2.3,
we use pSDE
(θ, ηt) to denote the distributions induced by the reverse-time SDE and
ODE processes, respectively, where
(θ, ηt) and pODE
0
0
ηt.
∇
xt log qt(xt) is substituted with st
T
0 g(t)2
(cid:82)
J
θ(xt)
−
pSDE
0
∥
D
(cid:0)
≤
(cid:1)
Likelihood of pSDE
after the score model is calibrated by ηt, then according to Lemma 1, we have
t
SM(θ, ηt)dt be the total SM objective
q0
SM(θ, ηt; g(t)2) ≜
(θ, ηt). Let
(θ, ηt)
J
0
KL
SM(θ, ηt; g(t)2) +
KL (qT
pT ). From the result in Eq. (9), there is
J
D
t ; g(t)2) =
SM(θ, η∗
∥
T
(cid:0)
∥
KL
D
−
0
(cid:90)
(11)
J
q0
pSDE
0
g(t)2
Eqt(xt)
2
2 dt.
st
θ(xt)
SM(θ; g(t)2)
J
Therefore, the likelihood
t ; g(t)2) +
q0
KL
1
2
(cid:3)(cid:13)
(cid:2)
after calibration has a lower upper bound of
(cid:13)
SM(θ; g(t)2) +
pT ) for
∥
pSDE
may not
q0
0
∥
(cid:0)
Likelihood of pODE
0
practice since st
θ(xt) and
(cid:13)
(θ, η∗
t )
(cid:13)
KL
D
SM(θ, η∗
pT ), compared to the bound of
KL (qT
(cid:1)
D
∥
J
J
pSDE
the original
. However, we need to clarify that
(θ)
0
∥
necessarily smaller than
q0
(cid:1)
(cid:0)
xt log pODE
pODE
(θ, ηt)
KL
0
∥
D
(θ, η∗
approximately achieves its lowest value. Lu et al. [28] show that
t )
(cid:0)
can be further bounded by high-order SM objectives (as detailed in Appendix A.4),
xtst
θ(xt)). Since the calibration term ηt is independent of
xtηt = 0, it does not affect the values of high-order SM objectives, and achieves a lower
pODE
q0
0
∥
pODE
(θ)
0
(cid:0)
D
∥
which depend on
∇
xt, i.e.,
upper bound due to the lower value of the first-order SM objective.
(xt; θ) are close. Thus, we have
SM(θ, ηt; g(t)2) +
(θ, ηt). Note that in Lemma 2, there is a term
(cid:1)
, since we can only compare their upper bounds.
Diff(θ), which is usually small in
KL (qT
D
(θ, η∗
t )
(cid:1)
θ(xt) and
pSDE
0
∥
pT ) ,
∥
KL
D
q0
KL (qT
xttr (
xtst
∇
q0
≈ J
and
(θ)
(cid:1)
∇
∇
∇
D
D
D
J
KL
KL
(cid:0)
(cid:1)
(cid:0)
(cid:1)
t
3.4 Empirical learning fails to achieve Eqt(xt) [st
θ(xt)] = 0
A question that naturally arises is whether better architectures or learning algorithms for DPMs
(e.g., EDMs [22]) could empirically achieve Eqt(xt) [st
θ(xt)] = 0 without calibration? The answer
may be negative, since in practice we only have access to a finite dataset sampled from q0(x0).
More specifically, assuming that we have a training dataset D ≜
n=1 where xn
N
xn
q0(x0),
0 }
{
0, I
and defining the kernel density distribution induced by D as qt(xt; D)
.
∝
When the quantity of training data approaches infinity, we have limN→∞ qt(xt; D) = qt(xt) holds
(cid:17)
for
(cid:80)
[0, T ]. Then the empirical DSM objective trained on D is written as
N
2
0 ∼
xt−αtxn
0
σt
N
n=1 N
t
∀
∈
(cid:16)
(cid:12)
(cid:12)
t
DSM(θ; D) ≜ 1
2N
J
Eq(ε)
θ(αtxn
st
0 + σtε) +
,
(12)
and it is easy to show that the optimal solution for minimizing
universal model capacity) st
θ(xt) =
Eqt(xt;D) [
∇
t
DSM(θ; D) satisfies (assuming st
J
xt log qt(xt; D). Given a finite dataset D, there is
∇
xt log qt(xt; D)]
= 0,
xt log qt(xt; D)] = 0, but typically Eqt(xt) [
indicating that even if the score model is learned to be optimal, there is still Eqt(xt) [st
= 0.
Thus, the mis-calibration of DPMs is partially due to the dataset bias, i.e., during training we can
only access a finite dataset D sampled from q0(x0).
Furthermore, when trained on a finite dataset in practice, the learned model will not converge to the
optimal solution [15], so there is typically st
= 0.
θ(xt)]
∇
After calibration, we can at least guarantee that Eqt(xt;D)
= 0 always
holds on any finite dataset D. In Figure 3, we demonstrate that even state-of-the-art EDMs still have
non-zero and semantic Eqt(xt) [st
θ(xt)], which emphasises the significance of calibrating DPMs.
xt log qt(xt; D) and Eqt(xt;D) [st
Eqt(xt;D) [st
st
θ(xt)
θ(xt)]
θ(xt)]
θ(xt)
(13)
∇
=
−
(cid:2)
(cid:3)
θ has
n=1
(cid:88)
(cid:34)(cid:13)
(cid:13)
(cid:13)
(cid:13)
ε
σt (cid:13)
(cid:13)
(cid:13)
(cid:13)
2(cid:35)
5
̸
̸
̸
̸
Figure 1: Time-dependent values of 1
2
θ(xt)]
2
∥
(the second row) calculated on different datasets. The models on CIFAR-10 and CelebA is trained on
, 1000), while those on AFHQv2, FFHQ, and ImageNet are trained
discrete timesteps (t = 0, 1,
on continuous timesteps (t
θ(xt)
based on εt
* * *
[0, 1]). We convert data prediction xt
∈
αtxt
θ(xt))/σt. The y-axis is clamped into [0, 500].
θ(xt) into noise prediction εt
2 (the first row) and g(t)2
t ∥
θ(xt) = (xt
Eqt(xt) [εt
Eqt(xt) [εt
θ(xt)]
2 ∥
2σ2
∥
2
−
3.5 Amortized computation of Eqt(xt) [st
θ(xt)]
By default, we are able to calculate and restore the value of Eqt(xt) [st
θ(xt)] for a pretrained model
st
θ(xt), where the selection of timestep t is determined by the inference algorithm, and the expectation
over qt(xt) can be approximated by Monte Carlo sampling from a noisy training set. When we
do not have access to training data, we can approximate the expectation using data generated
(xt; θ). Since we only need to calculate Eqt(xt) [st
from pODE
θ(xt)] once, the raised
computational overhead is amortized as the number of generated samples increases.
(xt; θ) or pSDE
t
t
Dynamically recording. In the preceding context, we focus primarily on post-training computing
of Eqt(xt) [st
θ(xt)]. An alternative strategy would be to dynamically record Eqt(xt) [st
θ(xt)] during
the pretraining phase of st
θ(xt). Specifically, we could construct an auxiliary shallow network hφ(t)
parameterized by φ, whose input is the timestep t. We define the expected mean squared error as
where the superscript
t
J
Cal(φ) ≜ Eqt(xt)
θ(xt)†
st
denotes the stopping gradient and φ∗ is the optimal solution of minimizing
θ(xt)] (assuming sufficient model capacity).
T
t
Cal(φ), where βt
0 βt
hφ(t)
∥
(cid:2)
t = Eqt(xt) [st
SM(θ; λ(t)) +
2
2
∥
(14)
−
(cid:3)
,
†
Cal(φ) w.r.t. φ, satisfying hφ∗ (t) = η∗
t
J
The total training objective can therefore be expressed as
is a time-dependent trade-off coefficient for t
[0, T ].
* J
J
∈
(cid:82)
4 Experiments
In this section, we demonstrate that sample quality and model likelihood can be both improved by
calibrating DPMs. Instead of establishing a new state-of-the-art, the purpose of our empirical studies
is to testify the efficacy of our calibration technique as a simple way to repair DPMs.
4.1 Sample quality
Setup. We apply post-training calibration to discrete-time models trained on CIFAR-10 [25] and
CelebA [27], which apply parametrization of noise prediction εt
θ(xt). In the sampling phase, we
employ DPM-Solver [29], an ODE-based sampler that achieves a promising balance between sample
efficiency and image quality. Because our calibration directly acts on model scores, it is also
compatible with other ODE/SDE-based samplers [3, 26], while we only focus on DPM-Solver cases
in this paper. In accordance with the recommendation, we set the end time of DPM-Solver to 10−3
when the number of sampling steps is less than 15, and to 10−4 otherwise. Additional details can be
6
0.00.20.40.60.81.0Timestep0100200300400500g(t)22ae2tkEqt(xt)[≤tμ(xt)]k220.00.20.40.60.81.0Timestep0100200300400500g(t)22ae2tkEqt(xt)[≤tμ(xt)]k2202004006008001000Timestep0.040.060.080.100.1212kEqt(xt)[≤tμ(xt)]k2202004006008001000Timestep051015g(t)22ae2tkEqt(xt)[≤tμ(xt)]k2202004006008001000Timestep123g(t)22ae2tkEqt(xt)[≤tμ(xt)]k2202004006008001000Timestep0.0250.0300.0350.04012kEqt(xt)[≤tμ(xt)]k220.00.20.40.60.81.0Timestep0.200.250.300.350.4012kEqt(xt)[≤tμ(xt)]k220.00.20.40.60.81.0Timestep0.0800.0850.09012kEqt(xt)[≤tμ(xt)]k220.00.20.40.60.81.0Timestep0510152012Eqt(y)£kEqt(xt|y)[≤tμ(xt,y)]k22§0.00.20.40.60.81.0Timestep0100200300400500g(t)22ae2tEqt(y)£kEqt(xt|y)[≤tμ(xt,y)]k22§ImageNet 64×64FFHQ 64×64AFHQv2 64×64CelebA 64×64CIFAR-10with varying NFE on CIFAR-10.
Table 1: Comparison on sample quality measured by FID
Experiments are conducted using a linear noise schedule on the discrete-time model from [17]. We
consider three variants of DPM-Solver with different orders. The results with
mean the actual NFE
is order
which is smaller than the given NFE, following the setting in [29].
↓
†
NFE
order ⌋
× ⌊
Noise prediction
DPM-Solver
εt
θ(xt)
εt
θ(xt)
−
Eqt(xt) [εt
θ(xt)]
1-order
2-order
3-order
1-order
2-order
3-order
10
20.49
7.35
†23.96
19.31
6.76
†53.50
Number of evaluations (NFE)
25
15
20
30
35
40
12.47
†4.52
4.61
9.72
7.89
4.14 †3.92
†3.89 †3.73
5.75
6.84
6.22
3.74 †3.71
3.68
3.65 †3.65 †3.60
8.86
7.35
11.77
†4.36
4.03 †3.66
4.22 †3.32 †3.33
5.36
6.28
5.76
3.54 †3.44
3.48
3.35 †3.32 †3.31
Table 2: Comparison on sample quality measured by FID
64.
Experiments are conducted using a linear noise schedule on the discrete-time model from [41]. The
settings of DPM-Solver are the same as on CIFAR-10.
with varying NFE on CelebA 64
×
↓
Noise prediction
DPM-Solver
εt
θ(xt)
εt
θ(xt)
−
Eqt(xt) [εt
θ(xt)]
1-order
2-order
3-order
1-order
2-order
3-order
10
16.74
4.32
†11.92
16.13
4.42
†35.47
Number of evaluations (NFE)
25
15
20
30
35
40
11.85
†3.98
3.91
11.29
†3.94
3.62
7.93
6.67
2.94 †2.88
†2.84 †2.76
7.09
6.06
2.61 †2.66
†2.33 †2.43
5.90
2.88
2.82
5.28
2.54
2.40
5.01
5.38
†2.88
2.84
†2.81 †2.85
4.39
4.87
†2.52
2.49
†2.43 †2.49
found in Lu et al. [29]. By default, we employ the FID score [16] to quantify the sample quality using
50,000 samples. Typically, a lower FID indicates a higher sample quality. In addition, in Table 3, we
evaluate using other metrics such as sFID [30], IS [39], and Precision/Recall [36].
Computing Eqt(xt) [εt
θ(xt)]. To estimate the expectation over qt(xt), we construct xt = αtx0 + σtε,
0, I) is sampled from a standard
where x0
(ε
|
Gaussian distribution. The selection of timestep t depends on the sampling schedule of DPM-Solver.
The computed values of Eqt(xt) [εt
θ(xt)] are restored in a dictionary and warped into the output layers
of DPMs, allowing existing inference pipelines to be reused.
q0(x0) is sampled from the training set and ε
∼ N
∼
We first calibrate the model trained by Ho et al. [17] on the CIFAR-10 dataset and compare it to the
original one for sampling with DPM-Solvers. We conduct a systematical study with varying NFE
(i.e., number of function evaluations) and solver order. The results are presented in Tables 1 and 3.
After calibrating the model, the sample quality is consistently enhanced, which demonstrates the
significance of doing so and the efficacy of our method. We highlight the significant improvement in
sample quality (4.61
3.32 when using
20 NFE and 3-order DPM-Solver). After model calibration, the number of steps required to achieve
convergence for a 3-order DPM-Solver is reduced from
30 to 20, making our method a new option
for expediting the sampling of DPMs. In addition, as a point of comparison, the 3-order DPM-Solver
with 1,000 NFE can only yield an FID score of 3.45 when using the original model, which, along with
the results in Table 1, indicates that model calibration helps to improve the convergence of sampling.
4.22 when using 15 NFE and 3-order DPM-Solver; 3.89
→
→
≥
Then, we conduct experiments with the discrete-time model trained on the CelebA 64x64 dataset
by Song et al. [41]. The corresponding sample quality comparison is shown in Table 2. Clearly,
model calibration brings significant gains (3.91
3.62 when using 15 NFE and 3-order DPM-Solver;
2.84
2.33 when using 20 NFE and 3-order DPM-Solver) that are consistent with those on the
CIFAR-10 dataset. This demonstrates the prevalence of the mis-calibration issue in existing DPMs
and the efficacy of our correction. We still observe that model calibration improves convergence of
sampling, and as shown in Figure 2, our calibration could help to reduce ambiguous generations.
More generated images are displayed in Appendix C.
→
→
7
, precision
,
Table 3: Comparison on sample quality measured by different metrics, including FID
↓
with varying NFE on CIFAR-10. We use Base
inception score (IS)
to denote the baseline εt
θ(xt)]. The
sampler is DPM-Solver with different orders. Note that FID is computed by the PyTorch checkpoint
of Inception-v3, while sFID/IS/Precision/Recall are computed by the Tensorflow checkpoint of
Inception-v3 following github.com/kynkaat/improved-precision-and-recall-metric.
↑
θ(xt) and Ours to denote calibrated score εt
Eqt(xt) [εt
, sFID
↓
and recall
θ(xt)
−
↑
↑
Method
Number of evaluations (NFE)
25
FID sFID IS Pre. Rec. FID sFID IS Pre. Rec. FID sFID IS Pre. Rec.
20
30
Base
Ours
1-ord. 9.72 6.03 8.49 0.641 0.542 7.89 5.45 8.68 0.644 0.556 6.84 5.12 8.76 0.650 0.565
2-ord. 4.14 4.36 9.15 0.654 0.590 3.92 4.22 9.17 0.657 0.591 3.74 4.18 9.20 0.658 0.591
3-ord. 3.89 4.18 9.29 0.652 0.597 3.73 4.15 9.21 0.657 0.595 3.65 4.12 9.22 0.658 0.593
1-ord. 8.86 6.01 8.56 0.649 0.544 7.35 5.42 8.76 0.653 0.560 6.28 5.09 8.84 0.653 0.568
2-ord. 4.03 4.31 9.17 0.661 0.592 3.66 4.20 9.20 0.664 0.594 3.54 4.14 9.23 0.662 0.599
3-ord. 3.32 4.14 9.38 0.657 0.603 3.33 4.11 9.28 0.665 0.597 3.35 4.08 9.27 0.662 0.600
Figure 2: Selected images on CIFAR-10 (generated with NFE = 20 using 3-order DPM-Solver)
demonstrating that our calibration could reduce ambiguous generations, such as generations that
resemble both horse and dog. However, we must emphasize that not all generated images have a
visually discernible difference before and after calibration.
4.2 Model likelihood
0
αtxt
(θ, η∗
64 [7], FFHQ 64
As described in Section 3.3, calibration contributes to reducing the SM objective, thereby decreasing
(θ, η∗
the upper bound of the KL divergence between model distribution at timestep t = 0 (either pSDE
t )
or pODE
t )) and data distribution q0. Consequently, it aids in raising the lower bound of model
0
likelihood. In this subsection, we examine such effects by evaluating the aforementioned DPMs
on the CIFAR-10 and CelebA datasets. We also conduct experiments with continuous-time models
64 [9]
trained by Karras et al. [22] on AFHQv2 64
×
datasets considering their top performance. These models apply parametrization of data prediction
xt
θ(xt) based on the relationship εt
θ(xt), and for consistency, we convert it to align with εt
θ(xt) =
(xt
Given that we employ noise prediction models in practice, we first estimate 1
2
2 at
[0, T ], which reflects the decrement on the SM objective at t according to Eq. (9) (up
timestep t
to a scaling factor of 1/σ2
t ). We approximate the expectation using Monte Carlo (MC) estimation
with training data points. The results are displayed in the first row of Figure 1. Notably, the value of
1
2
2 varies significantly along with timestep t: it decreases relative to t for CelebA
2 ∥
∥
but increases in all other cases (except for t
64). Ideally, there should
[0.4, 1.0] on ImageNet 64
be 1
2
2 = 0 at any t. Such inconsistency reveals that mis-calibration issues
xt log qt(xt)]
∥
exist in general, although the phenomenon may vary across datasets and training mechanisms.
θ(xt))/σt, as detailed in Kingma et al. [23] and Appendix B.2.
64 [21], and ImageNet 64
Eqt(xt) [εt
Eqt(xt) [εt
Eqt(xt) [
θ(xt)]
θ(xt)]
2 ∥
2 ∥
∇
×
×
×
−
∈
∈
∥
T
0 g(t)2
Then, we quantify the gain of model calibration on increasing the lower bound of model likelihood,
2
which is 1
2 dt according to Eq. (11). We first rewrite it with the model
θ(xt)]
2
parametrization of noise prediction εt
θ(xt), and it can be straightforwardly demonstrated that it equals
(cid:13)
(cid:13)
2
2 using MC
2. Therefore, we calculate the value of g(t)2
t ∥
(cid:82)
Eqt(xt) [εt
Eqt(xt) [st
Eqt(xt) [εt
(cid:13)
(cid:13)
θ(xt)]
g(t)2
2σ2
θ(xt)]
t ∥
T
0
2σ2
∥
∥
2
(cid:82)
8
w/o calibration (baseline)w/ calibration (ours)Figure 3: Visualization of the expected predicted noises with increasing t. For each dataset, the
first row displays Eqt(xt) [εt
θ(xt)] (after normalization) and the second row highlights the top-10%
pixels that Eqt(xt) [εt
θ(xt)] has high values. The DPM on CelebA is a discrete-time model with 1000
timesteps [41] and that on FFHQ is a continuous-time one [22].
estimation and report the results in the second row of Figure 1. The integral is represented by the area
under the curve (i.e., the gain of model calibration on the lower bound of model likelihood). Various
datasets and model architectures exhibit non-trivial gains, as observed. In addition, we notice that the
DPMs trained by Karras et al. [22] show patterns distinct from those of DDPM [17] and DDIM [41],
indicating that different DPM training mechanisms may result in different mis-calibration effects.
Visualizing Eqt(xt) [εt
θ(xt)]. To better understand the inductive bias learned by DPMs, we visualize
the expected predicted noises Eqt(xt) [εt
θ(xt)] for timestep from 0 to T , as seen in Figure 3. For each
dataset, the first row normalizes the values of Eqt(xt) [εt
θ(xt)] into [0, 255]; the second row calculates
pixel-wise norm (across RGB channels) and highlights the top-10% locations with the highest norm.
As we can observe, on facial datasets like CelebA and FFHQ, there are obvious facial patterns
inside Eqt(xt) [εt
θ(xt)], while on other datasets like CIFAR-10, ImageNet, as well as the animal face
dataset AFHQv2, the patterns inside Eqt(xt) [εt
θ(xt)] are more like random noises. Besides, the facial
patterns in Figure 3 are more significant when t is smaller, and become blurry when t is close to
T . This phenomenon may be attributed to the bias of finite training data, which is detrimental to
generalization during sampling and justifies the importance of calibration as described in Section 3.4.
θ(xt)].
4.3 Ablation studies
We conduct ablation studies focusing on the estimation methods of Eqt(xt) [εt
Estimating Eqt(xt) [εt
θ(xt)] with partial training data. In the post-training calibration setting, our
primary algorithmic change is to subtract the calibration term Eqt(xt) [εt
θ(xt)] from the pretrained
DPMs' output. In the aforementioned studies, the expectation in Eqt(xt) [εt
θ(xt)] (or its variant
of other model parametrizations) is approximated with MC estimation using all training images.
However, there may be situations where training data are (partially) inaccessible. To evaluate the
effectiveness of our method under these cases, we examine the number of training images used to
estimate the calibration term on CIFAR-10. To determine the quality of the estimated calibration
term, we sample from the calibrated models using a 3-order DPM-Solver running for 20 steps and
evaluate the corresponding FID score. The results are listed in the left part of Table 4. As observed,
we need to use the majority of training images (at least
20,000) to estimate the calibration term.
We deduce that this is because the CIFAR-10 images are rich in diversity, necessitating a non-trivial
number of training images to cover the various modes and produce a nearly unbiased calibration term.
Estimating Eqt(xt) [εt
θ(xt)] with generated data. In the most extreme case where we do not have
access to any training data (e.g., due to privacy concerns), we could still estimate the expectation over
qt(xt) with data generated from pODE
(x0; θ). Specifically, under the hypothesis that
pODE
(x0; θ)
0
q0(x0) (DPM-Solver is an ODE-based sampler), we first generate
(x0; θ) or pSDE
(x0; θ)
pODE
0
x0
≥
0
0
≈
∼
9
(cid:101)
CelebA64×64FFHQ64×64Timestep t0TTable 4: Sample quality varies w.r.t. the num-
ber of training images (left part) and generated
images (right part) used to estimate the cali-
bration term on CIFAR-10. In the generated
data case, the images used to estimate the cali-
bration term Eqt(xt) [εt
θ(xt)] is crafted with 50
sampling steps by a 3-order DPM-Solver.
Figure 4: Dynamically recording Eqt(xt) [εt
θ(xt)].
During training, the mean square error between
the ground truth and the outputs of a shallow net-
work for recording the calibration terms rapidly
decreases, across different timesteps t.
Training data
# of samples FID
Generated data
# of samples FID
500
1,000
2,000
5,000
10,000
20,000
50,000
↓
55.38
18.72
8.05
4.31
3.47
3.25
3.32
2,000
5,000
10,000
20,000
50,000
100,000
200,000
↓
8.80
4.53
3.78
3.31
3.46
3.47
3.46
xt
t
(cid:101)
and construct
∼
approximated by the expectation over pODE
x0 + σtε, where
xt = αt
pODE
t
(xt; θ).
(xt; θ). Then, the expectation over qt(xt) could be
(cid:101)
(cid:101)
Empirically, on the CIFAR-10 dataset, we adopt a 3-order DPM-Solver to generate a set of samples
from the pretrained model of Ho et al. [17], using a relatively large number of sampling steps (e.g.,
50 steps). This set of generated data is used to calculate the calibration term Eqt(xt) [εt
θ(xt)]. Then,
we obtain the calibrated model εt
θ(xt)] and craft new images based on a 3-order
20-step DPM-Solver. In the right part of Table 4, we present the results of an empirical investigation
into how the number of generated images influences the quality of model calibration.
Eqt(xt) [εt
θ(xt)
−
Using the same sampling setting, we also provide two reference points: 1) the originally mis-calibrated
model can reach the FID score of 3.89, and 2) the model calibrated with training data can reach the
FID score of 3.32. Comparing these results reveals that the DPM calibrated with a large number of
high-quality generations can achieve comparable FID scores to those calibrated with training samples
(see the result of using 20,000 generated images). Additionally, it appears that using more generations
is not advantageous. This may be because the generations from DPMs, despite being known to cover
diverse modes, still exhibit semantic redundancy and deviate slightly from the data distribution.
Dynamical recording. We simulate the proposed dynamical recording technique. Specifically, we
use a 3-layer MLP of width 512 to parameterize the aforementioned network hφ(t) and train it with
an Adam optimizer [24] to approximate the expected predicted noises Eqt(xt) [εt
θ(xt)
comes from the pretrained noise prediction model on CIFAR-10 [17]. The training of hφ(t) runs for
1,000 epochs. Meanwhile, using the training data, we compute the expected predicted noises with
MC estimation and treat them as the ground truth. In Figure 4, we compare them to the outputs of
hφ(t) and visualize the disparity measured by mean square error. As demonstrated, as the number
of training epochs increases, the network hφ(t) quickly converges and can form a relatively reliable
approximation to the ground truth. Dynamic recording has a distinct advantage of being able to
be performed during the training of DPMs to enable immediate generation. We clarify that better
timestep embedding techniques and NN architectures can improve approximation quality even further.
θ(xt)], where εt
5 Discussion
We propose a straightforward method for calibrating any pretrained DPM that can provably reduce the
values of SM objectives and, as a result, induce higher values of lower bounds for model likelihood.
We demonstrate that the mis-calibration of DPMs may be inherent due to the dataset bias and/or
sub-optimally learned model scores. Our findings also provide a potentially new metric for assessing
a diffusion model by its degree of "uncalibration", namely, how far the learned scores deviate from
the essential properties (e.g., the expected data scores should be zero).
Limitations. While our calibration method provably improves the model's likelihood, it does not
necessarily yield a lower FID score, as previously discussed [45]. Besides, for text-to-image genera-
tion, post-training computation of Eqt(xt|y) [st
θ(xt, y)] becomes infeasible due to the exponentially
large number of conditions y, necessitating dynamic recording with multimodal modules.
10
02004006008001000TrainingEpoch0.20.30.40.50.60.70.8MeanSquareErrort=0t=250t=500t=750t=999Acknowledgements
Zhijie Deng was supported by Natural Science Foundation of Shanghai (No. 23ZR1428700) and the
Key Research and Development Program of Shandong Province, China (No. 2023CXGC010112).
References
[1] Kazuoki Azuma. Weighted sums of certain dependent random variables. Tohoku Mathematical
Journal, Second Series, 19(3):357–367, 1967.
[2] Arpit Bansal, Eitan Borgnia, Hong-Min Chu, Jie S Li, Hamid Kazemi, Furong Huang, Micah
Goldblum, Jonas Geiping, and Tom Goldstein. Cold diffusion: Inverting arbitrary image
transforms without noise. arXiv preprint arXiv:2208.09392, 2022.
[3] Fan Bao, Chongxuan Li, Jun Zhu, and Bo Zhang. Analytic-dpm: an analytic estimate of the
optimal reverse variance in diffusion probabilistic models. In International Conference on
Learning Representations (ICLR), 2022.
[4] Ruojin Cai, Guandao Yang, Hadar Averbuch-Elor, Zekun Hao, Serge Belongie, Noah Snavely,
and Bharath Hariharan. Learning gradient fields for shape generation. In European Conference
on Computer Vision (ECCV), 2020.
[5] Nanxin Chen, Yu Zhang, Heiga Zen, Ron J Weiss, Mohammad Norouzi, and William Chan.
Wavegrad: Estimating gradients for waveform generation. In International Conference on
Learning Representations (ICLR), 2021.
[6] Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary
differential equations. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
[7] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image
synthesis for multiple domains. In IEEE International Conference on Computer Vision (CVPR),
2020.
[8] Giannis Daras, Mauricio Delbracio, Hossein Talebi, Alexandros G Dimakis, and Peyman Milan-
far. Soft diffusion: Score matching for general corruptions. arXiv preprint arXiv:2209.05442,
2022.
[9] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale
hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition
(CVPR), 2009.
[10] Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. In
Advances in Neural Information Processing Systems (NeurIPS), 2021.
[11] Joseph L Doob and Joseph L Doob. Stochastic processes, volume 7. Wiley New York, 1953.
[12] Bradley Efron. Tweedie's formula and selection bias. Journal of the American Statistical
Association, 106(496):1602–1614, 2011.
[13] Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patashnik, Amit H Bermano, Gal Chechik, and
Daniel Cohen-Or. An image is worth one word: Personalizing text-to-image generation using
textual inversion. arXiv preprint arXiv:2208.01618, 2022.
[14] Geoffrey Grimmett and David Stirzaker. Probability and random processes. Oxford university
press, 2001.
[15] Xiangming Gu, Chao Du, Tianyu Pang, Chongxuan Li, Min Lin, and Ye Wang. On memorization
in diffusion models. arXiv preprint arXiv:2310.02664, 2023.
[16] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter.
Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances
in Neural Information Processing Systems (NeurIPS), pages 6626–6637, 2017.
11
[17] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In
Advances in Neural Information Processing Systems (NeurIPS), 2020.
[18] Jonathan Ho, William Chan, Chitwan Saharia, Jay Whang, Ruiqi Gao, Alexey Gritsenko,
Diederik P Kingma, Ben Poole, Mohammad Norouzi, David J Fleet, et al. Imagen video: High
definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022.
[19] Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J
Fleet. Video diffusion models. arXiv preprint arXiv:2204.03458, 2022.
[20] Aapo Hyv ̈arinen. Estimation of non-normalized statistical models by score matching. Journal
of Machine Learning Research (JMLR), 6(Apr):695–709, 2005.
[21] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative
adversarial networks. In IEEE International Conference on Computer Vision (CVPR), 2019.
[22] Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of
diffusion-based generative models. In Advances in Neural Information Processing Systems
(NeurIPS), 2022.
[23] Diederik Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. In
Advances in Neural Information Processing Systems (NeurIPS), 2021.
[24] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint
arXiv:1412.6980, 2014.
[25] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images.
Technical report, Citeseer, 2009.
[26] Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo numerical methods for diffusion models
on manifolds. In International Conference on Learning Representations (ICLR), 2022.
[27] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the
wild. In International Conference on Computer Vision (ICCV), 2015.
[28] Cheng Lu, Kaiwen Zheng, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. Maximum
likelihood training for score-based diffusion odes by high order denoising score matching. In
International Conference on Machine Learning (ICML), 2022.
[29] Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. Dpm-solver: A
fast ode solver for diffusion probabilistic model sampling in around 10 steps. In Advances in
Neural Information Processing Systems (NeurIPS), 2022.
[30] Charlie Nash, Jacob Menick, Sander Dieleman, and Peter W Battaglia. Generating images with
sparse representations. arXiv preprint arXiv:2103.03841, 2021.
[31] Tianyu Pang, Kun Xu, Chongxuan Li, Yang Song, Stefano Ermon, and Jun Zhu. Efficient
learning of generative models via finite-difference score matching. In Advances in Neural
Information Processing Systems (NeurIPS), 2020.
[32] Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical
text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.
[33] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bj ̈orn Ommer. High-
resolution image synthesis with latent diffusion models. In IEEE Conference on Computer
Vision and Pattern Recognition (CVPR), 2022.
[34] Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman.
Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. arXiv
preprint arXiv:2208.12242, 2022.
[35] Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad
Norouzi. Image super-resolution via iterative refinement. IEEE Transactions on Pattern Analysis
and Machine Intelligence (TPAMI), 2022.
12
[36] Mehdi SM Sajjadi, Olivier Bachem, Mario Lucic, Olivier Bousquet, and Sylvain Gelly. Assess-
ing generative models via precision and recall. In Advances in Neural Information Processing
Systems (NeurIPS), 2018.
[37] Tim Salimans and Jonathan Ho. Should ebms model the energy or the score? In Energy Based
Models Workshop-ICLR, 2021.
[38] Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models.
In International Conference on Learning Representations (ICLR), 2022.
[39] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen.
Improved techniques for training gans. In Advances in Neural Information Processing Systems
(NeurIPS), 2016.
[40] Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsuper-
vised learning using nonequilibrium thermodynamics. In International Conference on Machine
Learning (ICML), pages 2256–2265. PMLR, 2015.
[41] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In
International Conference on Learning Representations (ICLR), 2021.
[42] Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data
distribution. In Advances in Neural Information Processing Systems (NeurIPS), pages 11895–
11907, 2019.
[43] Yang Song and Stefano Ermon. Improved techniques for training score-based generative models.
In Advances in Neural Information Processing Systems (NeurIPS), 2020.
[44] Yang Song, Sahaj Garg, Jiaxin Shi, and Stefano Ermon. Sliced score matching: A scalable
approach to density and score estimation. In Conference on Uncertainty in Artificial Intelligence
(UAI), 2019.
[45] Yang Song, Conor Durkan, Iain Murray, and Stefano Ermon. Maximum likelihood training of
score-based diffusion models. In Advances in Neural Information Processing Systems (NeurIPS),
2021.
[46] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and
Ben Poole. Score-based generative modeling through stochastic differential equations. In
International Conference on Learning Representations (ICLR), 2021.
[47] Yang Song, Prafulla Dhariwal, Mark Chen, and Ilya Sutskever. Consistency models. arXiv
preprint arXiv:2303.01469, 2023.
[48] Arash Vahdat, Karsten Kreis, and Jan Kautz. Score-based generative modeling in latent space.
In Advances in Neural Information Processing Systems (NeurIPS), 2021.
[49] Pascal Vincent. A connection between score matching and denoising autoencoders. Neural
computation, 23(7):1661–1674, 2011.
[50] Zekai Wang, Tianyu Pang, Chao Du, Min Lin, Weiwei Liu, and Shuicheng Yan. Better diffusion
models further improve adversarial training. In International Conference on Machine Learning
(ICML), 2023.
[51] Minkai Xu, Lantao Yu, Yang Song, Chence Shi, Stefano Ermon, and Jian Tang. Geodiff: A
geometric diffusion model for molecular conformation generation. In International Conference
on Learning Representations (ICLR), 2022.
[52] Kexun Zhang, Xianjun Yang, William Yang Wang, and Lei Li. Redi: Efficient learning-free
diffusion inference via trajectory retrieval. arXiv preprint arXiv:2302.02285, 2023.
13
A Detailed derivations
In this section, we provide detailed derivations for the Theorem and equations shown in the main text.
We follow the regularization assumptions listed in Song et al. [45].
A.1 Proof of Theorem 1
Proof. For any two timesteps 0
as qst(xt
|
distribution qt(xt) =
(cid:16)
xs) =
xt
N
≤
αt|sxs, σ2
qst(xt
(cid:12)
(cid:12)
(cid:12)
s < t
t|sI
(cid:17)
, where αt|s = αt
αs
xs)qs(xs)dxs and we have
|
≤
T , i.e., the transition probability from xs to xt is written
s . The marginal
and σ2
t|s = σ2
α2
t|sσ2
t −
(cid:82)
xt log qt(xt) =
∇
t|s xt
1
αt|s ∇α−1
1
αt|s ∇α−1
log
1
αk
t|s
(cid:32)
EN
(cid:16)
xs
α−1
t|s xt,α−2
t|s σ2
t|sI
(cid:17) [qs(xs)]
(cid:33)
log
t|s xt
EN
(cid:16)
η
(cid:12)
(cid:12)
0,α−2
t|s σ2
t|sI
(cid:17)
qs(α−1
t|s xt + η)
(cid:105)(cid:19)
EN
(cid:16)
η
0,α−2
t|s σ2
t|sI
(cid:12)
αt|sEN
(cid:12)
(cid:16)
η
0,α−2
(cid:18)
(cid:17)
(cid:12)
∇α−1
(cid:12)
t|s xt
(cid:104)
t|s σ2
t|sI
(cid:17)
qs(α−1
(cid:104)
t|s xt + η)
(cid:105)
qs(α−1
t|s xt + η)
EN
(cid:16)
η
(cid:12)
(cid:12)
EN
(cid:16)
(cid:12)
(cid:12)
0,α−2
t|s σ2
(cid:17)
t|sI
(cid:104)
qs(α−1
t|s xt + η)
(cid:104)
αt|sEN
0,α−2
(cid:16)
(cid:17)
η
t|sI
t|s σ2
(cid:17) [qs(xs)
(cid:12)
(cid:12)
t|s σ2
t|sI
t|s xt,α−2
α−1
xs
αt|sEN
(cid:12)
(cid:12)
xs
(cid:16)
t|s xt,α−2
α−1
t|s σ2
t|sI
∇
(cid:17) [qs(xs)]
(cid:105)
t|s xt+η log qs(α−1
∇α−1
qs(α−1
t|s xt + η)
(cid:105)
t|s xt + η)
(cid:105)
(cid:104)
xs log qs(xs)]
(15)
=
=
=
=
xt
αt|sxs, σ2
t|sI
(cid:12)
(cid:12)
qs(xs)
N
=
(cid:82)
=
1
αt|s
(cid:16)
(cid:12)
αt|s
(cid:12)
N
(cid:16)
(cid:82)
Eqst(xs|xt) [
∇
(cid:17)
xt
αt|sxs, σ2
(cid:17)
(cid:12)
xs log qs(xs)] .
(cid:12)
xs log qs(xs)dxs
qs(xs)dxs
∇
t|sI
Note that when the transition probability qst(xt
process,
Eqst(xs|xt) [αs
there is αt > 0 for
xs log qs(xs)].
t
∀
∈
∇
[0, T ], and thus we achieve αt
xs) corresponds to a well-defined forward
xt log qt(xt) =
|
∇
A.2 Proof of Eq0(x0) [
∇
x0 log q0(x0)] = 0
2 denotes the family of functions with
Proof. The input variable x
∈ C
continuous second-order derivatives.1 We use xi denote the i-th element of x, then we can derive the
expectation
Rk and q0(x0)
2, where
∈
C
Eq0(x0)
∂
∂xi
0
(cid:20)
log q0(x0)
=
(cid:21)
=
=
=
(cid:90)
(cid:90)
(cid:90)
(cid:90)
* * *
(cid:90)
(cid:90)
* * *
∂
∂xi
d
dxi
0
q0(x0)
∂
∂xi
0
log q0(x0)dx1
0dx2
0 * * *
dxk
0
∂
∂xi
0
q0(x0)dx1
0dx2
0 * * *
dxk
0
(16)
q0(xi
0, x\i
0 )dx\i
0
dxi
0
(cid:19)
0 (cid:18)(cid:90)
q0(xi
0)dxi
0 = 0,
1This continuously differentiable assumption can be satisfied by adding a small Gaussian noise (e.g., with
variance of 0.0001) on the original data distribution, as done in Song and Ermon [42].
14
0 denotes all the k
where x\i
under the boundary condition that limxi
conclusion that Eq0(x0) [
−
x0 log q0(x0)] = 0.
∇
1 elements in x0 except for the i-th one. The last equation holds
[K]. Thus, we achieve the
0) = 0 hold for any i
0→∞ q0(xi
∈
A.3 Concentration bounds
We describe concentration bounds [11, 1] of the martingale αt
Azuma's inequality. For discrete reverse timestep t = T, T
constants 0 < c1, c2,
∂
∂xi
almost surely. Then
xt log qt(xt).
1,
such that for the i-th element of x,
∂
∂xi
t
ε > 0, the probability (note that α0 = 1)
αt−1 log qt−1(xt−1)
αt log qt(xt)
Bt and Bt
, <
* * *
* * *
At
∞
t−1
∇
−
≤
−
≤
, 0, Assuming that there exist
At
ct
≤
−
(17)
∀
∂
∂xi
0
P
log q0(x0)
(cid:18)(cid:12)
(cid:12)
(cid:12)
Specially, considering that qT (xT )
(cid:12)
approximately obtain
∂
∂xi
T
αT log qT (xT )
−
ε
≥
2 exp
(cid:32)−
(xT
0,
|
≈ N
σ2I), there is
log qT (xT )
(cid:80)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
≤
(cid:19)
∂
∂xi
T
.
(18)
2ε2
T
t=1 c2
t (cid:33)
xi
(cid:101)σ2 . Thus, we can
T
≈ −
P
log q0(x0) +
∂
∂xi
0
(cid:101)
αT xi
T
σ2
ε
≥
≤
2 exp
(cid:32)−
2ε2
T
t=1 c2
t (cid:33)
(cid:12)
(cid:12)
(cid:12)
Doob's inequality. For continuous reverse timestep t from T to 0, if the sample paths of the
(cid:12)
martingale are almost surely right-continuous, then for the i-th element of x we have (note that
α0 = 1)
(cid:18)(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:80)
(cid:19)
(cid:101)
.
(19)
P
sup
0≤t≤T
(cid:18)
∂
∂xi
t
αt log qt(xt)
C
≥
≤
(cid:19)
Eq0(x0)
max
(cid:104)
∂
∂xi
0
C
(cid:16)
log q0(x0), 0
(cid:17)(cid:105)
.
(20)
A.4 High-order SM objectives
Lu et al. [28] show that the KL divergence
KL
q0
pODE
0
(θ)
can be bounded as
KL
∥
pT ) +
(cid:0)
∥
Fisher(θ) is a weighted sum of Fisher divergence between qt(xt) and pODE
T
SM(θ; g(t)2)
D
KL (qT
pODE
0
∥
≤ D
(θ)
(cid:112)
(cid:112)
q0
D
J
J
(cid:0)
(cid:1)
(cid:1)
*
t
J
Fisher(θ),
(θ) as
where
Fisher(θ) =
J
1
2
g(t)2DF
qt
pODE
t
∥
(θ)
dt.
Moreover, Lu et al. [28] prove that if
the spectral norm of Hessian matrix
such that
0
(cid:90)
[0, T ] and
t
∈
∀
2
xt log pODE
∥∇
t
(cid:1)
(cid:0)
Rk, there exist a constant CF such that
xt
∈
∀
CF , and there exist δ1, δ2, δ3 > 0
(xt; θ)
2
≤
∥
∥
st
θ(xt)
xtst
xttr
∥∇
− ∇
θ(xt)
xt log qt(xt)
∥
2
≤
2
xt log qt(xt)
∥
xttr
− ∇
xtst
θ(xt)
δ1,
F
δ2,
≤
2
xt log qt(xt)
∥∇
∇
F is the Frobenius norm of matrix. Then there exist a function U (t; δ1, δ2, δ3, q) that
= 0) w.r.t. δ1, δ2, and δ3, respectively, such that the
− ∇
∇
≤
(cid:0)
(cid:0)
(cid:1)
∥ * ∥
where
independent of θ and strictly increasing (if g(t)
Fisher divergence can be bounded as DF
The case after calibration. When we impose the calibration term η∗
score model st
have
(cid:0)
(cid:1)
t = 0 and thus
η∗
t , there is
pODE
t
∥
xt (st
θ(xt)
θ(xt)
xtη∗
(θ)
∇
∇
≤
−
qt
(cid:1)
−
U (t; δ1, δ2, δ3, q).
t = Eqt(xt) [st
xtst
η∗
t ) =
θ(xt)] to get the
θ(xt). Then we
∇
δ3,
2
∥
(21)
(22)
(23)
st
η∗
θ(xt)
t − ∇
−
∥
η∗
st
θ(xt)
t
−
st
θ(xt)
(cid:1)
xt
xttr
(cid:0)
δ′
xt log qt(xt)
2
1 ≤
∥
2
xt log qt(xt)
F
∥
− ∇
η∗
xttr
t
∥∇
≤
xt
−
− ∇
∇
∥∇
∇
δ1,
δ2,
≤
2
xt log qt(xt)
(cid:0)
(cid:0)
(cid:1)(cid:1)
15
(cid:0)
(24)
δ3.
2
∥
≤
(cid:1)
̸
pODE
t
(θ, η∗
t )
qt
qt
pODE
t
pODE
qt
t
∥
pODE
q0
0
∥
From these, we know that the Fisher divergence DF
U (t; δ1, δ2, δ3, q), namely, DF
DF
(θ, η∗
t )
. Consequently, we can get lower upper bounds for both
(θ)
(θ, η∗
t )
(cid:1)
D
B Model parametrization
This section introduces different parametrizations used in diffusion models and provides their cali-
brated instantiations.
≤
≤
has a lower upper bound compared to
t ) and
(cid:0)
, compared to
J
, respectively.
Fisher(θ) and
1, δ2, δ3, q)
Fisher(θ, η∗
pODE
0
∥
KL
(cid:0)
(cid:0)
(cid:1)
D
(θ)
q0
J
KL
∥
∥
(cid:1)
(cid:0)
(cid:1)
(cid:1)
(cid:0)
U (t; δ′
B.1 Preliminary
Along the research routine of diffusion models, different model parametrizations have been used,
including score prediction st
θ(xt) [42, 46], noise prediction εt
θ(xt) [17, 33], data prediction
xt
θ(xt) [23, 32], and velocity prediction vt
θ(xt) [38, 18]. Taking the DSM objective as the training
loss, its instantiation at timestep t
[0, T ] is written as
∈
t
DSM(θ) =
J
1
2 Eq0(x0),q(ε)
α2
t
2σ4
t
(cid:104)
Eq0(x0),q(ε)
1
2σ2
t
α2
t
2σ2
t
Eq0(x0),q(ε)
Eq0(x0),q(ε)
θ(xt) + ε
st
∥
xt
θ(xt)
εt
θ(xt)
vt
θ(xt)
∥
(cid:2)
∥
(cid:2)
∥
(cid:2)
2
2
σt ∥
x0
−
(cid:105)
2
2
∥
2
2
∥
(cid:3)
(αtε
ε
−
−
,
score prediction;
,
data prediction;
noise prediction;
(25)
,
(cid:3)
σtx0)
2
2
∥
,
velocity prediction.
−
B.2 Calibrated instantiation
Under different model parametrizations, we can derive the optimal calibration terms η∗
ing
(cid:3)
t
DSM(θ, ηt) as
t that minimiz-
J
θ(xt)] ,
θ(xt)] ,
Eqt(xt) [st
Eqt(xt) [xt
Eqt(xt) [εt
Eqt(xt) [vt
η∗
t =
θ(xt)]
Eq0(x0) [x0] ,
data prediction;
−
score prediction;
noise prediction;
velocity prediction.
Taking η∗
t into
J
t
DSM(θ, ηt) we can obtain the gap
θ(xt)] + σtEq0(x0) [x0] ,
t
DSM(θ)
J
− J
DSM(θ, η∗
t
t ) =
Eqt(xt) [st
θ(xt)]
2
2,
∥
θ(xt)]
θ(xt)]
−
2
2,
∥
Eqt(xt) [xt
Eqt(xt) [εt
Eq0(x0) [x0]
2
2,
∥
score prediction;
data prediction;
noise prediction;
Eqt(xt) [vt
θ(xt)] + σtEq0(x0) [x0]
2
2,
∥
velocity prediction.
1
2 ∥
α2
t
2σ4
t ∥
1
2σ2
t ∥
α2
t
2σ2
t ∥
C Visualization of the generations
We further show generated images in Figure 5 to double confirm the efficacy of our calibration
method. Our calibration could help to reduce ambiguous generations on both CIFAR-10 and CelebA.
(26)
(27)
(a) CIFAR-10, w/ calibration
(b) CIFAR-10, w/o calibration
(c) CelebA, w/ calibration
(d) CelebA, w/o calibration
Figure 5: Unconditional generation results on CIFAR-10 and CelebA using models from [17] and
[41] respectively. The number of sampling steps is 20 based on the results in Tables 1 and 2.
16
|
|
http://arxiv.org/abs/2302.11343v1 | 2023-02-21T14:03:47 | 2023-02-21T14:03:47 | Advancing Stuttering Detection via Data Augmentation, Class-Balanced
Loss and Multi-Contextual Deep Learning | Stuttering is a neuro-developmental speech impairment characterized by
uncontrolled utterances (interjections) and core behaviors (blocks,
repetitions, and prolongations), and is caused by the failure of speech
sensorimotors. Due to its complex nature, stuttering detection (SD) is a
difficult task. If detected at an early stage, it could facilitate speech
therapists to observe and rectify the speech patterns of persons who stutter
(PWS). The stuttered speech of PWS is usually available in limited amounts and
is highly imbalanced. To this end, we address the class imbalance problem in
the SD domain via a multibranching (MB) scheme and by weighting the
contribution of classes in the overall loss function, resulting in a huge
improvement in stuttering classes on the SEP-28k dataset over the baseline
(StutterNet). To tackle data scarcity, we investigate the effectiveness of data
augmentation on top of a multi-branched training scheme. The augmented training
outperforms the MB StutterNet (clean) by a relative margin of 4.18% in macro
F1-score (F1). In addition, we propose a multi-contextual (MC) StutterNet,
which exploits different contexts of the stuttered speech, resulting in an
overall improvement of 4.48% in F 1 over the single context based MB
StutterNet. Finally, we have shown that applying data augmentation in the
cross-corpora scenario can improve the overall SD performance by a relative
margin of 13.23% in F1 over the clean training. | [
"Shakeel A. Sheikh",
"Md Sahidullah",
"Fabrice Hirsch",
"Slim Ouni"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11343v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11343v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.SD",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.SD",
"cs.LG",
"eess.AS"
] | IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
1
Advancing Stuttering Detection via Data
Augmentation, Class-Balanced Loss and
Multi-Contextual Deep Learning
Shakeel A. Sheikh, Md Sahidullah, Fabrice Hirsch, Slim Ouni
3
2
0
2
b
e
F
1
2
]
D
S
.
s
c
[
1
v
3
4
3
1
1
.
2
0
3
2
:
v
i
X
r
a
Abstract- Stuttering is a neuro-developmental speech
impairment characterized by uncontrolled utterances (in-
terjections) and core behaviors (blocks, repetitions, and
prolongations), and is caused by the failure of speech sen-
sorimotors. Due to its complex nature, stuttering detection
(SD) is a difficult task. If detected at an early stage, it
could facilitate speech therapists to observe and rectify
the speech patterns of persons who stutter (PWS). The
stuttered speech of PWS is usually available in limited
amounts and is highly imbalanced. To this end, we address
the class imbalance problem in the SD domain via a multi-
branching (MB) scheme and by weighting the contribution
of classes in the overall loss function, resulting in a huge
improvement in stuttering classes on the SEP-28k dataset
over the baseline (StutterNet). To tackle data scarcity, we
investigate the effectiveness of data augmentation on top of
a multi-branched training scheme. The augmented training
outperforms the MB StutterNet (clean) by a relative margin
of 4.18% in macro F1-score (F1). In addition, we propose
a multi-contextual (MC) StutterNet, which exploits different
contexts of the stuttered speech, resulting in an overall
improvement of 4.48% in F1 over the single context based
MB StutterNet. Finally, we have shown that applying data
augmentation in the cross-corpora scenario can improve
the overall SD performance by a relative margin of 13.23%
in F1 over the clean training.
Index Terms- Stuttering detection, speech disorder,
data augmentation, class balanced learning.
I. INTRODUCTION
S PEECH impairments, often known as speech disorders,
are difficulty in producing speech sounds. These speech
difficulties usually take the form of dysarthria, cluttering
lisping, apraxia, and stutter-
(poorly intelligible speech),
ing [1]–[5]. Only a few percentage (5-10%) of the world
population can produce accurate speech units, the rest en-
counter some type of speech disorder in their life span [6]. Of
these speech impairments, stuttering is the most predominant
one [1]. Stuttering1, is a neuro-developmental speech disorder,
in which the flow of speech is disturbed by abnormally
persistent and involuntarily speech sounds, which usually take
Shakeel A. Sheikh, Md Sahidullah, and Slim Ouni are from Universit ́e
Inria, LORIA, F-54000, Nancy, France (e-mail:
de Lorraine, CNRS,
shakeel-ahmad.sheikh, md.sahidullah, [email protected]).
Fabrice Hirsch is from Universit ́e Paul-Val ́ery Montpellier, CNRS,
Praxiling, Montpellier, France (e-mail: [email protected]).
1Stuttering is also called stammering. In this paper, we will use the terms
disfluency, stuttering, and stammering interchangeably.
the shape of core behaviors: including blocks, prolongations
and repetitions [1]. Stuttering is complex and the several
factors that lead to it are delayed childhood development,
stress, and speech motor abnormalities [1]. In [7], Smith and
Weber put forward the multifactorial dynamic pathway theory,
where they argued that stuttering occurs due to the failure
of the nervous system. People with stuttering (PWS) exhibit
impairment in sensorimotor processes which are responsible
for the production of speech, and its direction is influenced by
emotional and linguistic aspects.
In conventional stuttering detection (SD) and therapy ses-
sions, the speech therapists or speech-language pathologists
manually analyze the PWS' speech [8]. The speech therapists
observe and monitor the speech patterns of PWS to rectify
them [1]. This convention of SD is very laborious and time-
consuming and is also inclined toward the idiosyncratic belief
of speech therapists. In addition, the automatic speech recogni-
tion systems (ASR) are working fine for normal fluent speech,
however, they are unsuccessful in recognizing the stuttered
speech [9], which makes it impractical for PWS to easily
access virtual assistants like Apple Siri, Alexa, etc. As a result,
interactive automatic SD systems that provide an impartial
objective, and consistent evaluation of stuttering speech are
strongly encouraged. The SD can also be used to adapt
and improve ASR virtual assistant tools for stuttered speech.
Despite the fact that having numerous potential applications,
very little research attention has been given to the domain
of SD and measurement. The detection and identification of
stuttering events can be quite a difficult and complex problem
due to several variable factors including language, gender, age,
accent, speech rate, etc.
The main goal of this work is to build robust automatic
stuttering detection systems capable of detecting multiple
stuttering types based on speech modality, which later on can
be deployed as a tool in real-world settings by providing a
means to both PWS and speech therapists to keep track of the
stutter speech. These systems can later on be further improved
by providing a feedback mechanism to PWS and help them
to rectify their stuttering.
A significant amount of work is done in the detection of
other speech disorders [10] like dysarthria [11] and Parkin-
sons [12], but stuttering has not been addressed widely even
though it is the most common one. In this paper, we propose
a deep learning framework for robust SD. The automatic
2
IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
detection of stuttering can help in the treatment of stuttering
if detected at an early age [1].
Most of the computer-based SD methods are based either
on ASR systems [13], [14] or language models [15], [16].
These methods are two-stage approaches that first convert the
acoustic speech signals into their corresponding spoken textual
modality, and then detect stuttering by the application of
language models. Even though this ASR-based two-stage ap-
proach for identifying stuttering has shown promising results,
the dependence on the ASR unit makes it computationally
costly and prone to error. Moreover, the adaption towards the
ASR task results in the possible loss of stuttering relevant
information such as prosodic and emotional content.
In recent decades, the applications of deep learning have
grown tremendously in speech recognition [17], speaker recog-
nition [18], speech synthesis [19], emotion detection [20],
voice conversion [21], voice disorder detection [10] including
Parkinson's disease detection [22] and dysarthric speech de-
tection [11], [23]. Inspired by the human auditory temporal
mechanism, Kodrasi et al. [23] recently proposed a con-
volutional neural network based dysarthric speech detection
method by factoring the speech signal into two discriminative
representations including temporal envelope (stress, voicing,
and phonetic information) and fine structure (breathiness,
pitch, and vowel quality) and reported the state-of-the-art re-
sults in dysarthria detection. However, the application of deep
learning in SD is limited. The acoustic properties of speech
disfluencies are different for different disfluencies which can
help to discriminate from fluent voice. Due to the presence
of these acoustic cues in the stuttered embedded speech, deep
learning models can be used to exploit these acoustic cues
in the detection and identification of stuttering events. Most
of the SD existing methods employ spectral features including
mel-frequency cepstral coefficients (MFCCs) and spectrograms
or their variants that capture the stuttering-related information.
The earlier studies in this domain applied shallow deep
learning approaches in SD. In 1995, Howell et al. [24]
employed two fully connected artificial neural networks for
the identification of two types of disfluencies, namely, repeti-
tion and prolongation. They extracted autocorrelation features,
envelope parameters, and spectral information and used these
features as an input to the artificial neural networks for SD.
The network was trained on 12 speakers with 20 autocorrela-
tion features and 19 vocoder coefficients. In 2009, Ravikumar
et al [25] proposed multi-layered perceptron for the repetition
type of stuttering. The network was trained by using MFCC
input features on 12 different disfluent speakers. In 2019,
B. Villegas et al. [26] trained multi-layer perceptron on 10-
dimensional respiratory features for the block SD. They used
a dataset of 68 Latin American Spanish speakers in their case
study. In a recent study, Kourkounakis et al. [27] proposed
residual network and bi-directional long short-term memory
(ResNet+BiLSTM) based binary deep learning classifiers for
the detection of six different types of disfluencies including
prolongation, word repetition, sound repetition, phrase repeti-
tion, and false starts. They used spectrograms as input features
and reported promising results on a small subset (25 speakers)
from the UCLASS dataset [27]. In another study Lee et al. [28]
curated a large stuttering dataset (SEP-28k) and utilized the
convolutional long short-term memory (ConvLSTM) model
for the detection and identification of six types of stuttering,
namely, blocks, prolongations, sound repetitions, word rep-
etitions, and interjections. The model takes 40-dimensional
input MFCCs, eight-dimensional articulatory features, 41-
dimensional phoneme feature vector, and three-dimensional
pitch features. Sheikh et al. [29] recently proposed a single
multi-class time delay neural network (TDNN) based Stutter-
Net classifier which is capable of detecting core behaviors
and fluent speech segments and gives promising detection
performance on a larg subset of UCLASS (100+) speakers
compared to the state-of-the-art classifiers. The model solely
takes 20-dimensional MFCC features as an input. In another
recent study M. Jouaiti et al. [30] introduced phoneme-based
bi-drectional long short-term memory (BiLSTM) model for
SD by mixing the SEP-28k and UCLASS datasets. The model
is trained on 20-dimensional MFCCs and 19-dimensional
phoneme input features. The disfluencies considered in this
work are prolongations, repetitions, and interjections. A de-
tailed summary and comparison of various feature extraction
methods and classifiers can be found in [31].
This work provides a complete deep learning framework for
robust SD following our preliminary initial investigations [29]
in which StutterNet yields state-of-the-art SD results. In this
study, we identify the limitations of StutterNet and proposed
further advancements to address those drawbacks. Our main
contributions are summarized below:
• Solution for class imbalance problem: The standard stut-
tering datasets suffer from class imbalance problems. We
introduced two strategies based on weighted loss and
multi-branch architecture to tackle the class imbalance
problem.
• Introducing data augmentation: The stuttering datasets
have a limited amount of training data and this makes
it difficult to apply advanced deep learning models with
a large number of parameters. To address this limitation,
this work introduces audio data augmentation. To the best
of our knowledge, this is the first work to apply audio data
augmentation in the SD problem.
• Introducing multi-contextual architecture: Stuttering de-
tection is a special type of speech characterization prob-
lem where each class (i.e., stuttering types) has a varying
duration. For example, block lasts for a shorter duration
than prolongations and repetitions. Therefore, a fixed
length of context in the basic StutterNet framework might
not be the optimized one for detecting all
types of
stuttering. We introduce a multi-contextual architecture
that uses different context lengths in a parallel fashion.
The remaining of the paper is organized as follows. Sec-
tion II describes the StutterNet and analyzes its deficiencies.
Section III discusses the proposed methodology for addressing
the deficiencies. Section IV details the experimental design,
metrics used and datasets. Section V discusses the experimen-
tal results on class balanced, data augmentation, MC StutterNet
and cross corpora scenario. Finally, in Section VI, we conclude
with the possible future directions.
SHEIKH et al.: ADVANCING STUTTERING DETECTION VIA DATA AUGMENTATION, CLASS-BALANCED LOSS AND MULTI-CONTEXTUAL DEEP LEARNING
3
II. STUTTERNET: OVERVIEW & LIMITATIONS
A. StutterNet
Most of the earlier work employed only a small set of
disfluent speakers in their experimental studies, and has ap-
proached the SD problem as a binary classification problem:
disfluent vs fluent identification or one vs other type [31].
The StutterNet we propose in our earlier work, is a time delay
neural network based architecture that has been used to tackle
the SD as a multi-class classification problem. The StutterNet
takes 20 MFCCs as input features with a frame length of
20 ms, mean-normalized with a hop length of 10 ms. Usually,
the initial layers in a standard deep neural network learn wider
contexts when processing a temporal input signal. However in
StutterNet network as shown in Table I, the initial layers learn
and capture only smaller contexts and the deeper ones compute
the activations from a wider context, thus the deeper/higher
layers are able to capture and learn the longer temporal
contexts. The network consists of five time delay layers with
the first three focusing on [t − 2, t + 2], {t − 2 , t, t + 2},
{t − 3 , t, t + 3} and the other two on {t} contextual frames,
respectively. The TDNN layers are having a dilation of (1, 2, 3,
1, 1) respectively. This is followed by a two-layered BiLSTM
unit, mean and standard deviation pooling layer, three fully
connected (FC) layers, and a softmax layer on top of the
network that reveals the classification scores of stuttering
disfluencies. A ReLU nonlinearity activation function and a
1D batch normalization are applied after each layer except the
statistical pooling layer. We apply dropout of 0.3. in FC layers.
Consider an input speech sample with T frames. The first
five layers of StutterNet focus on the small context of speech
frames. For example, layer 2 takes as input the sliced output
of layer 1 at time frames of {t − 2, t, t + 2}, which results
in capturing a total temporal context of 9 with the help of the
previous layer's context of [t−2, t+2]. Similarly, layer 3 sees
a total context of 15 time frames. The statistical pooling layer
computes and concatenates the mean and standard deviation
by aggregating all T output frames at the end of BiLSTM
output. The statistical pooling layer accumulates the informa-
tion across the temporal dimension which makes it suitable
for subsequent layers to operate on the entire temporal speech
segment. The StutterNet is trained to classify 5 different types
of stuttering including core behaviors and the fluent part of the
PWS. For detailed StutterNet architecture, please refer to [29].
B. Limitations
Although this network has shown promising results on a
SEP-28K dataset in SD, it has several deficiencies. First, it
does not generalize quite well on unseen data and leads to
overfitting due to the limited amount of data available for
training. In addition to data scarcity, the SEP-28k dataset
was collected from podcasts in a clean environment, which
makes the trained StutterNet difficult to generalize in other
environmental conditions. Second, obtaining class-balanced
datasets is extremely difficult and very expensive in the speech
domain and the SEP-28k dataset is no exception. Deep neural
network (DNN) classifiers trained on highly class-imbalanced
datasets are usually biased towards the majority class, which
TABLE I: STUTTERNET ARCHITECTURE, TC: TOTAL CON-
TEXT, TDNN: TIME DELAY NEURAL NETWORK LAYER,
FC: FULLY CONNECTED LAYER, BILSTM: BIDIRECTINAL
LONG SHORT-TERM MEMORY (2 LAYERS), LAYER CON-
TEXT OF [T-2, T+2] MEANS 5 FRAMES ARE TAKEN INTO
CONSIDERATION TWO BEFORE THE CURRENT TIME STEP
AND TWO AFTER THE CURRENT TIME STAMP.
Layer
TDNN 1
TDNN 2
TDNN 3
TDNN 4
TDNN 5
BiLSTM
Statistical Pooling
FC1
FC2
FC3
Output Layer Size
64
64
64
64
3*64
64 * 2
3 ∗ 64 ∗ 2×1
64
64
NumClasses
Layer Context
[t − 2, t + 2]
{t-2, t, t+2}
{t-3, t, t+3}
{t}
{t}
{t}
[0, T )
-
-
-
TC
5
9
15
15
15
T
T
T
T
T
results in poor modeling of minority classes [32]. In addition
to the above deficiencies, we found in our previous work Stut-
terNet [29] that the context is very important in SD. Stuttering
detection is a special type of speech characterization problem
where each class (i.e., stuttering types) has a varying duration.
For example, block lasts for a shorter duration than prolonga-
tions and repetitions. Therefore, a fixed length of context in
the basic StutterNet framework might not be the optimized
one for detecting all types of stuttering. A larger context
increases the performance of prolongation and repetition types
of disfluencies but decreases the recognition performance of
fluent speech segments on the UCLASS dataset [29].
III. ADDRESSING DEFICIENCIES
In this section, we address the three above-mentioned issues.
A. Class Imbalance
In class imbalance learning,
the distribution of samples
across each class is not uniform. The DNN classifiers, trained
on highly imbalanced datasets generally perform poorly for
the minority class and favor the majority class [33]. In the
worst case, where there is an extreme imbalance in the training
set, the majority class dominates the learning, and samples
among the minority class may go undetected, thus affecting
performance [34].
The class-imbalance is one of the major problems in real-
world applications, including multi-lingual speech recogni-
tion [35], and stuttering is no different as shown in Fig. 1. In
fact, stuttering is extremely imbalanced across fluent and other
speech disfluencies. The Fig. 1. shows that the interjections are
the most common disfluency present in the SEP-28k dataset
followed by repetitions, blocks, and prolongations and the
overall distribution is approximately equivalent to the fluent
distribution.
Collecting a balanced dataset is difficult and expensive for
the stuttering detection task. Other datasets such as Kassel
State of Fluency (KSoF) (not publicly accessible) [36], Flu-
encyBank [28] also suffer from this issue.
4
IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
where B is the number of batches, M is number of stuttered
is the predicted
(cid:16)
(cid:17)
speech samples in a batch bi, pi =
probability of class ci of sample i.
eci
j=1 ecj
(cid:80)C
For architecture-level, we propose a multi-branched ap-
proach similar to the work by C. Lea et al. [28] and M.
Bader-El-Den et al. [38] to address the class imbalance
issue in SD task. Inspired by the fact that the number of
fluent class samples is almost equal to the total number of
samples in disfluent classes, we simultaneously classify fluent
vs difluent classes in one output branch and subcategories of
disfluent classes in another output branch. The multi-branched
architecture with two output branches is shown in Fig. 3 (The
figure is overall architecture of mulit-contextual StutterNet
with two contexts, For single contextual MB StutterNet, only
context = 5 is taken into consideration). This has one common
encoder E (θe) section followed by two parallel branches
referred as FluentBranch F (θf ) and DisfluentBranch D (θd).
The embeddings from the encoder are processed with both
the branches parallelly, where the F is trained to distinguish
between fluent and disfluent samples, and the D is trained to
differentiate within the disfluent sub-categories.
The objective is to optimize the sum of FluentBranch loss
Lf and DisfluentBranch loss Ld. For simplicity, a simple sum
of the two losses has been taken into consideration and it
works well. Thus, the overall objective function is define as:
L(θe, θf , θd) = Lf (θe, θf ) + Ld(θe, θd).
(2)
During the evaluation step, if the FluentBranch predicts the
sample as fluent, then FluentBranch predictions are considered
otherwise DisfluentBranch predictions are taken into consid-
eration to reveal the stuttering category.
B. Data Augmentation
Deep learning has achieved rapid progress in the domain
of speech processing tasks including speech recognition [17],
speaker recognition [18], emotion recognition [20], speech
disorder detection [29]. However, as a drawback, deep learning
based models are hungry for the data and require a substantial
amount of annotated data for training, and StutterNet is no
exception. The model may require more stuttering data than
other speech processing domains, as the presence of disfluen-
cies in stuttering speech corpus is not frequent.
Data augmentation is a popular technique that increases the
quantity and diversity of the existing annotated training data,
improves robustness, and avoids the overfitting of DNNs. For
normal speech recognition, data augmentation demonstrates
to be an effective approach for dealing with data scarcity and
enhancing the performance of various DNN acoustic meth-
ods [39]. Several data augmentation techniques have been in-
vestigated including pitch adjust [40], spectral distortion [41],
tempo perturbation [42], speed perturbation, cross-domain
adaptation [43], adding noise to clean speech [42], spectro-
gram deformation with frequency and time masking [39],
mixspeech [40], etc.
On the contrary, so far, very limited attention has been given
to data augmentation targeting the speech disorder domain.
Fig. 1: Stuttering data distribution in SEP-28k dataset showing
five classes consisting of single stuttering class.
Over the years, the class imbalance problem is one of the
main concerns due to its prevalence, especially in the biomed-
ical domain. Several methods have been proposed to tackle the
class imbalance problem, which are mainly categorized into
three groups: data-level, cost-level, and architecture-level [32].
Data-level approaches attempt to re-balance the class distribu-
tion by means of some re-sampling methods which include:
under-sampling, over-sampling, or combined over-sampling
and under-sampling [32], [33]. The architecture-level ap-
proaches attempt to modify the existing algorithm or develop a
new one to tune and adapt it for imbalanced datasets [32], [33].
Cost-level approaches attempt to influence the loss/objective
function by providing comparatively higher misclassification
cost penalties to the minority class in order to force the
model to learn about minority classes [32], [33]. In DNNs,
addressing the class-imbalance problem by re-sampling may
either get rid of sensitive speech samples that are extremely
important in training when under-sampling. It can also add
numerous quantities of duplicated speech samples under the
over-sampling strategy, which eventually makes the training
expensive and makes the DNN model likely to overfit [32].
Because of these limitations, we investigate cost-level and
architecture-level approaches in this work.
For the cost-based approach, we modify the standard cross
entropy loss by assigning weights to different classes [37].
We set the class weights inversely proportional to the number
of samples. We define the weight for class i as wi = N
C∗Ni
where N is the number of training samples, C is the number
of classes, Ni is the number of training samples for class i.
Therefore, the weighted cross-entropy (WCE) over the train
set can be defined as,
LWCE =
M
(cid:80)
i
1
B
B
(cid:88)
b=1
wi ∗ log(pi)
M
(cid:80)
i, i∈B
wi
(1)
SHEIKH et al.: ADVANCING STUTTERING DETECTION VIA DATA AUGMENTATION, CLASS-BALANCED LOSS AND MULTI-CONTEXTUAL DEEP LEARNING
5
In [44], speed and tempo perturbation based data augmen-
tation were used to convert the normal speech to dysarthric
speech impairment. In [45], a voice conversion adversarial
training based framework was used to simulate dysarthric
speech from healthy speech. In [46], normal speech samples
(also called out-of-domain) were used as a data augmentation
for dysarthric speech in the bottleneck feature extraction
stage. In [47], the speaker-dependent parameter was computed,
which was then used for augmentation of scarce dysarthric
speech in tempo adjustment. In [48], several data augmentation
techniques such as noise, time stretching, pitch shifting, time
shift, masking, etc., were analysed in Dementia detection.
There are some studies on data augmentation targeting text
based stuttering detection [13], however, in the case of audio
based stuttering/disfluency detection, this has not been studied
and analysed deeply [49] .
In the stuttering domain,
the employment of data aug-
mentation is not straightforward, because most of the data
augmentations like time stretch, speed perturbation, etc, al-
ter the underlying structure of the stuttering speech sample
completely. Our approach employs reverberation and additive
noises because it reflects the real-world scenario and does not
change significantly the underlying stuttering in the speech
sample as shown in Fig. 2. Reverberation consists of convolv-
ing speech samples with room impulse responses. We utilize
the simulated room impulse responses as described in [50]. For
additive noises, we utilize the MUSAN dataset, comprised of
60 hours of speech from 12 languages, 42 hours of music from
various genres, and 900 hours of noises [51].
To augment the original speech samples, we combine the
training "clean" set with below mentioned augmented copies
which results in 5 times increase in training samples.
1) music: A single music sample file randomly chosen
from MUSAN is added to the original clean stuttering
speech sample (SNR: 5-15dB) (The music sample file is
trimmed or repeated as required to match the duration
of the clean stuttered speech sample).
2) noise: Throughout the stuttered speech, samples from
MUSAN noises are added at 1 sec intervals (SNR: 0-
15dB).
3) babble: Speech samples from randomly three to seven
speakers are summed together, then added to the original
clean stuttered speech sample (SNR: 13-20dB).
4) reverb: The "clean" train set is convolved with simulated
room impulse responses.
All the data augmentation types shown in Fig. 2 were per-
formed using Kaldi [52] tool.
C. Multi-contextual StutterNet
The multi-contextual framework is based on the way hu-
mans perceive speech. In the cochlea, the input acoustic speech
signal is partitioned into several frequency bands so that the
information in each band can be filtered independently and
thus processed in parallel in the human brain [53].
Multi-contextual has been studied for action recognition in
videos [54], robust ASR [55]–[59], speech separation [60],
is processed in multiple
where the input speech signal
(a) Repetition (clean speech)
(b) Repetition with reverberation
(c) Repetition with babble noise
(d) Repetition with white noise
(e) Repetition with music
Fig. 2: Repetition stuttering with utterance "said that, that"
and the effect of various data augmentations (From 0 to 0.25
seconds, the speaker is saying "said", then followed by two
repetitions "that" from 0.25 to 0.6 and 1.4 to 1.75).
00.511.522.53Time0512102420484096Hz00.511.522.53Time0512102420484096Hz00.511.522.53Time0512102420484096Hz00.511.522.53Time0512102420484096Hz00.511.522.53Time0512102420484096Hz6
IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
streams/contexts (multiple time or frequency resolutions), etc.
K.J Han et al. [55] recently proposed a multi-stream2 convo-
lutional neural network for robust acoustic modeling. Chiba et
al. [61] recently proposed multi-stream attention-based BiL-
STM network for speech emotion recognition. Li et al. [62]
extracted deep features by training multi-stream hierarchical
DNN for acoustic event detection. Moreover Sheikh et al. [29]
found that settings like context frame size optimized for one
stuttering class are not good for other stuttering types.
Exploiting this fact, we investigate how the multi-contextual
neural networks will impact classification performance in the
speech disorder domain, and in particular stuttering identifica-
tion. In our preliminary study, we found that the context win-
dow improves the identification performance of two types of
disfluencies on the UCLASS dataset [29]. As the context frame
size increases in the StutterNet, the performance detection of
prolongation and repetition also increases, but decreases for
fluent speech segments, and almost remains unaffected for a
block type of stuttering. The prolongation and repetition last
longer than other types of disfluencies. To address this issue,
we exploit the variable contexts of MB StutterNet by training
the model jointly on different contexts as shown in Fig. 3. The
pseudo-code of multi-contextual (MC) StutterNet is provided
in Algorithm 1.
IV. EXPERIMENTAL SETUP
We evaluate our proposed architecture thoroughly on the
newly released SEP-28k stuttered dataset [28], and for cross
copora, we use the FluencyBank and LibriStutter datasets.
A. Datasets
SEP-28k: The SEP-28k stuttering dataset was curated from
a set of 385 podcasts. The original podcast recordings have
varying lengths. From each podcast, 40 to 250 segments (each
of length 3 seconds) are extracted which resulted in a total of
28,177 segments. The original SEP-28k dataset contains two
types of labels: stuttering and non-stuttering. The stuttering
labels include blocks, prolongations, repetitions, interjections,
and fluent segments, whereas the nonstuttering labels include
unintelligible, unsure, no speech, poor audio quality, and
music which are not relevant to our study. In our case study,
we use only the stuttering single labeled samples. Out of
28,177 clips, we use only 23573 segments, among which
3286 are repetitions, 1770 are prolongations, 2103 are blocks
and 12419 are fluent segments, and 3995 are interjections.
This resulted in a total of 19.65 hours of data which includes
2.74 hours of repetition, 1.48 hours of prolongation, 1.75
hours of block, 10.35 hours of fluent speech, and 3.34 hours
of interjections. After labeling, each 3-sec sliced speech
segment
is downsampled to 16 kHz. We randomly select
80% of podcasts (without mixing podcasts) for training,
10% of podcasts for validation, and the remaining 10%
of the podcast for evaluation in a 10-fold cross-validation
scheme. The speaker
information is missing from the
SEP-28k dataset, so we divide the dataset based on podcast
2multi-stream, multi-scale, multi-resolution are the different names of multi-
context.
Algorithm 1 Pseudo-code for MC StutterNet
Output: Predicted label set ˆy ∈ (R, P, B, In, F )
Input: Stutter dataset with D = (Xi, fi, di), where each sample Xi
R20×T MFCC input sequence
is
d: Stutter label
f : Pseudo label for FluentBranch
K: Number of epochs
CE: Cross entropy loss function
pf : Prediction of FluentBranch
pd: Prediction of DisfluentBranch
Lf : Loss of FluentBranch
Ld: Loss of DisfluentBranch
L: Total loss
b: Sample batch
C: Context
λ: Learning rate
θ = [θe, θf , θd] : Network parameters
θe : Encoder parameters
θd : DisfluentBranch parameters
θf : FluentBranch parameters
for b in D do
Forward Pass:
b = ApplyKaldiAugmentation(b)
out5 = StutterNetBase(b, C = 5)
out9 = StutterNetBase(b, C = 9)
stat5 = StatisticalPooling(out5)
stat9 = StatisticalPooling(out9)
statembed = Concat(stat5, stat9)
pf = FluentBranch(statembed)
pd = DisfluentBranch(statembed)
Lf = CE(pf , fb) // fb: Pseudo label of a batch
Ld = CE(pd, db) // db: Stutter label of a batch
L(θe, θf , θd) = Lf (θf ) + Ld(θd)
Backward Pass:
∇θb = backward propagation(L(θ), ˆy, d)
Parameter Updates:
θb ← θb − λ ∗ ∇θb
Ensure: MC StutterNet weight initialization
1: for i in K do
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28: end for
end for
Compute CE loss on validation set
if CEval ≤ CEprev
val
Continue training → Go to step 2
if patience ≤ 7 then
Stop training
end if
end if
then
else
identities (assuming each podcast is having a unique speaker)3.
FluencyBank: The actual FluencyBank AudioVisual dataset
was created by Nan Bernstein Ratner (University of Maryland)
and Brian MacWhinney (Carnegie Mellon University) for the
study of fluency development. In our case study, we use the
annotation done by the Apple similar to SEP-28k [1]. This
stuttering dataset was curated from 33 podcasts with 23 males
and 10 females, which resulted in a total of 4,144 segmented
clips. Out of which, we only use 3355 samples (ignoring the
non-stuttering and multiple samples), among which 542 are
repetitions, 222 are prolongations, 254 are blocks and 1584
are fluent segments, and 753 are Interjections. This results in
a total of 2.80 hours of data which includes 0.45 hours of
repetition, 0.19 hours of prolongation, 0.21 hours of block,
0.63 hours of interjection samples, and 1.32 hours of fluent
samples. We have considered those samples where at least
two annotators agree with the same labeling of the segment.
Simulated LibriStutter: The LibriStutter (English) consists
of 50 speakers (23 males and 27 females), is approximately
3The details about the train, validation, and test set splits about the SEP-28k
dataset is not publicly available. We create a protocol by ensuring no overlap
of podcasts between train, validation, and test sets. The details are available
in https://shakeel608.github.io/protocol.pdf
SHEIKH et al.: ADVANCING STUTTERING DETECTION VIA DATA AUGMENTATION, CLASS-BALANCED LOSS AND MULTI-CONTEXTUAL DEEP LEARNING
7
Fig. 3: A schematic diagram of Multi-contextual StutterNet, which is a multi-class classifier that exploits different variable
contexts of (5, 9) in SD. The FluentBranch and DisfluentBranch are composed of 3 fully connected layers followed by a
softmax layer for prediction of different stuttering classes, CB: Context Block, SPL: Statistical Pooling Layer. The context C
(5, 9) here does not mean the TDNN layers, but rather it means the kernel-size which is number of frames taken into account
when processing speech frames (C=5 means a context of 5 frames are taken at a time and C =9 means a context of 9 frames
are taken at a time). These two contexts are jointly exploited in MC StutterNet as shown in the left hand side of the figure.
20 hours and includes synthetic stutters for repetitions, pro-
longations, and interjections [63]. Random stuttering was
inserted within the four-second window of each speech signal.
The original LibriStutter is having 6 classes including fluent,
interjection4, prolongation, sound, word and phrase repetitions.
To make our experiments consistent with the SEP-28k dataset,
we treat all repetitions as one class. After extracting samples
based on the class label, we did not find any interjection
samples in the dataset, so we only train with three classes
including fluent, prolongation, and repetitions. For splitting of
the dataset, please refer Table 3 in the response sheets.
B. Training Setup
We implement models using the PyTorch library. The acous-
tic input features used in this case study are 20-dimensional
MFCC features, which are generated every 10 ms using a
20 ms window and extracted using the Librosa library [64]. For
3-dim pitch and phoneme features, we use Pykaldi [65] and
Phonexia [66] tools respectively. For training, we use Adam
optimizer and cross-entropy loss function with a learning rate
of 10−2 and batch size of 128. All the results reported in this
4https://borealisdata.ca/dataset.xhtml?
persistentId=doi:10.5683/SP3/NKVOGQ
paper are the average of the 10-fold validation technique and
all the training experiments were stopped by early stopping
criteria with patience of 7 on validation loss.
C. Evaluation metrics
To evaluate the model performance, we use the following
metrics: macro F1-score and accuracy which are the standard
and are widely used in the stuttered speech domain [27], [28],
[31], [36], [67]. The macro F1-score (F1) (which combines
the advantages of both precision and recall in a single metric
unlike unweighted average recall which only takes recall into
account) from equation (3) is often used in class imbalance
scenarios with the intention to give equal importance to fre-
quent and infrequent classes, and also is more robust towards
the error type distribution [68].
F1 = 1/C
(cid:88)
k
F 1k = 1/C
(cid:88)
k
2.PkRk
Pk + Rk
(3)
where C is the number of classes and Pk, Rk, and F 1k denotes
the precision, recall, and F1-score with respect to class k.
Context = 5Context = 9Speech UtteranceMFCC Input FramesTDNN Layer 1TDNN Layer 2TDNN Layer 3TDNN Layer 5TDNN Layer 4CB: Context BlockFluentBranch ΘfDisfluentBranch ΘdFluent/StutterRept, Prolong, Interj, BlockCB Θe CB ΘeDuring evaluation, FluentBranch predictions are considered only for fluent speech samples. If the prediction for speech sample in FluentBranch is "stutter", then predictions of DisfluentBranch are taken into consideration to reveal the type of stuttering class. Otherwise a speech utterance sample could be predicted as fluent in FluentBranch and stutter in DisfluentBranch. ConcatenationBiLSTMBiLSTMBiLSTMBiLSTMSPLSPL8
IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
D. Experiments
This sections describes briefly the experiments carried out
in this paper.
• We carry out experiments using StutterNet with the two
state-of-the art SD baselines including ResNet+BiLSTM
and ConvLSTM models in the same settings to have a
fair comparison.
• We perform experiments using weighted loss and multi-
branched training schemes for addressing class-imbalance
problem in stuttering domain, and also exploit the advan-
tage of both the schemes in freezing parts of network.
• We experiment with the data augmented training to
evaluate its performance in stuttering detection.
• We experiment with MC StutterNet on top of data aug-
mentation, and also analyse its performance in cross-
corpora settings.
V. RESULTS
In this section, we discuss the results with class balanced
training, data augmentation, and multi-contextual
learning.
We propose two modifications to the vanilla StutterNet to
address the class imbalance issue and one of them involves
the loss function on the SEP-28k dataset. We further present
the results of cross-corpora experiments on the FluencyBank
and LibriStutter datasets. Table II shows the results of state-
of-the-art baselines (1st part are baselines) and impact of
class balanced training. Table III depicts the results using
data augmentation on top of class balanced training. Table IV
shows the results using MC StutterNet.
Baselines: In addition to our single branch StutterNet
baseline (BL5), we first implement the state-of-the-art Con-
vLSTM and ResNet+BiLSTM as our baseline models for
comparison purposes in the same settings. Our baseline model
StutterNet is performing well in almost all the disfluent classes
except blocks as compared to the baseline model used in SEP-
28k paper [28] ConvLSTM (MFCC features) (referred to as
BL1), ConvLSTM (phoneme features) (referred to as BL2),
and ConvLSTM (pitch+MFCC features) (referred to as BL3).
In addition, we also use one more model i.e, ResNet+BiLSTM
classifier (referred to as BL4) from Kourkounakis et al. [27].
Comparing our single branch baseline StutterNet to BL4, the
model performs well only in interjection and prolongation
classes as shown in Table II. For subsequent comparison, we
select BL1 (best among BL1, BL2 and BL3) and BL4.
A. Class Imbalance
1) Weighted cross entropy: This section discusses the im-
pact of applying weighted cross entropy to StutterNet (which
we call StutterNetWCE) in order to improve the detection
performance of minority classes including repetitions, blocks,
and prolongations. Figure 4. illustrates the class-wise training
loss curves for normal and weighted cross-entropy loss func-
tions. We can observe that for the standard cross entropy loss
function, the majority class (i.e., fluents) exhibit higher loss
values and it dominates the overall loss.
Therefore, during training with backpropagation, the num-
ber of updates for fluent class dominates the gradient values
Fig. 4: Class-wise loss values for different probabilities of
ground truth classes. Here block, fluent, repetition, prolonga-
tion, and interjection classes are correspondingly denoted by
B, F, R, P, and I. The standard cross entropy (CE) is shown
by solid curves and its weighted version is shown by dashed
ones (WX represents the weighted loss of class X).
that in turn forces the model to focus mainly on correctly
classifying/predicting the majority class. Thus, the minority
classes including the blocks, prolongations, and repetitions are
given less importance during training, which leads to their poor
detection performance. Table II confirms that the detection per-
formance of blocks, prolongations, and repetitions is very poor,
as they are mostly predicted as fluent samples due to the class
imbalance nature of the problem. The loss functions for the
weighted cross entropy are shown by dashed curves in Fig. 4.
The figure indicates that applying weights to standard cross
entropy loss function by equation (1) forces the model to give
balanced importance to each disfluency class while optimizing
the parameters of the network during backpropagation. This,
in turn, helps in boosting the gradient updates for minority
classes during training, and thus increases their detection
performance in baselines including BL4, and BL5 as shown in
Table II. The StutterNetWCE gives a relative improvement of
33.49%, 83.50%, 1,185%, and 5.98% over BL5 and 58.69%,
462%, 500%, and 7.84% over BL1 for detecting repetitions,
prolongations, blocks, and interjections, respectively. Table II
also demonstrates the suitability of WCE with competitive
ResNet+BiLSTM method and results in 54%, 57.35%, 517%,
and 10.23% relative improvement in repetitions, prolongations,
blocks, and prolongations over BL4.
2) Multi-branch training: Moreover, we address the class
imbalance problem via a multi-branch network (referred to as
StutterNetMB). This has two output branches: FluentBranch
and DisfluentBranch as shown in Fig. 3. (For StutterNetMB,
only a single context of five is taken into consideration) This
method improves the detection performance of repetitions,
prolongations, blocks by a relative margin of 29.92%, 0.65%,
144% respectively over BL5, and 54.45%, 208%, 13.72%,
SHEIKH et al.: ADVANCING STUTTERING DETECTION VIA DATA AUGMENTATION, CLASS-BALANCED LOSS AND MULTI-CONTEXTUAL DEEP LEARNING
9
TABLE II: RESULTS WITH BASELINES (BL) AND USING CLASS IMBALANCE LEARNING (CLEAN TRAINING) (B: BLOCK,
F: FLUENT, R: REPETITION, P: PROLONGATION, IN: INTERJECTION, TA: TOTAL ACCURACY, F1: MACRO F1- SCORE),
FMFCC: MFCC INPUT FEATURES, FF0: 3-DIM (PITCH, PITCH-DELTA, VOICING) FEATURES, Fphone: PHONEME FEATURES,
MB: MULTI BRANCH, WCE: WEIGHTED CROSS ENTROPY, Mfrz
enc,disf : FREEZING ENCODER
AND DISFLUENTBRANCH, Mfrz
enc:FREEZING ENCODER, Mfrz
enc,fluent: FREEZING ENCODER AND FLUENTBRANCH.
Method
R
P
Accuracy
B
In
F
Baselines
TA
F1(%)
ConvLSTM + FMFCC (BL1)
ConvLSTM + Fphone (BL2)
ConvLSTM + FF0+MFCC (BL3)
ResNet+BiLSTM (BL4) [27]
StutterNet (BL5) [29]
[28]
[28]
[28]
ResNet+BiLSTM + WCE [27]
MB ResNet+BiLSTM [27]
StutterNet + WCE (StutterNetWCE)
MB StutterNet (StutterNetMB)
Mfrz
enc
Mfrz
Mfrz
enc,disf
enc,fluent
22.83
10.18
19.28
18.76
27.14
28.90
34.79
36.23
35.26
39.82
29.25
31.15
10.61
01.06
09.55
41.24
32.55
64.89
30.19
59.73
32.76
37.91
45.85
27.62
06.34
00.35
08.51
5.47
2.96
33.79
5.92
38.05
7.21
10.45
18.11
05.01
72.35
74.48
66.60
88.19
87.60
56.74
43.88
51.78
57.18
57.74
Class Imbalance
63.03
49.26
61.19
56.04
60.57
56.88
57.64
46.90
75.47
41.59
77.27
73.49
74.49
73.64
52.68
48.43
48.47
62.36
62.57
47.42
55.62
45.26
58.56
58.58
58.18
55.83
34.00
24.00
30.80
43.12
42.84
41.00
39.20
41.02
42.26
44.42
44.80
38.60
TABLE III: RESULTS USING DATA AUGMENTATION (B: BLOCK, F: FLUENT, R: REPETITION, P: PROLONGATION, IN:
INTERJECTION, TA: TOTAL ACCURACY, F1: MACRO F1- SCORE), A4: BABBLE + REVERBERATION + MUSIC + NOISE
AUGMENTATION, MB: MULTI BRANCH, WCE: WEIGHTED CROSS ENTROPY, Mfrz
enc,disf :
FREEZING ENCODER AND DISFLUENTBRANCH, Mfrz
enc:FREEZING ENCODER, Mfrz
enc,fluent: FREEZING ENCODER AND FLUENTBRANCH.
Method
StutterNet + A4
StutterNet + WCE (StutterNetWCE) + A4
MB ResNet+BiLSTM + A4
MB StutterNet (StutterNetMB) + A4
Mfrz
enc + A4
enc,disf + A4
enc,fluent + A4
Mfrz
Mfrz
Accuracy
B
3.69
38.18
0.99
4.32
4.26
11.52
04.48
In
64.24
65.33
65.95
68.74
64.12
62.31
61.30
P
32.53
61.43
32.85
33.93
30.94
36.33
25.14
R
28.67
43.06
33.27
34.05
28.87
27.63
31.19
F
88.70
43.73
70.92
78.88
85.29
83.05
77.56
TA
64.69
48.30
55.75
61.35
62.85
62.14
58.32
F1(%)
45.30
44.34
39.44
44.03
44.06
45.76
39.80
(a) StutterNet (BL)
(b) StutterNet (WCE) (StutterNetWCE)
(c) MB StutterNet (StutterNetMB)
Fig. 5: Accuracy confusion matrices showing the confusion of fluent speech with repetitions and blocks. F: Fluent, R: Repetition,
B: Block, P: Prolongation, In: Interjection, BL: Baseline, WCE: Weighted cross-entropy, MB: Multi-branch.
6.80% in repetitions, prolongations, blocks, and fluents re-
spectively over BL1, and 88%, 31.81% in repetitions, blocks
respectively over BL4, however, the BL4 is performing better
in prolongations and interjection classes. We also applied
multi-branch training in ResNet+BiLSTM which results in a
relative improvement of 85.45% in repetition class only as
compared to the baseline BL4.
In applying class balanced training, we found that there is
drop in macro F1 score. Using StutterNetWCE and WCE
the macro F1 score drops from
based ResNet+BiLSTM,
42.84% and 43.12% to 41.02% in StutterNet and 41.02%
in ResNet+BiLSTM respectively. By employing multi-branch
training, the macro F1 score drops very slightly from 42.84%
to 42.26% in StutterNet but it drops remarkably from 43.12%
10
IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
to 39.20% in ResNet+BiLSTM.
3) Analysis of confusion matrix: Using the WCE training
scheme, the detection performance of minority classes im-
proved remarkably at the cost of fluent accuracy. From the
Fig. 5 (a), we analyze that most of the repetitions and blocks
are being classified as fluent speech. Initially, we hypothesize
that it is most likely because of the imbalanced nature of the
problem. Despite addressing the class imbalance problem in
the stuttering domain using WCE and multi-branched training,
we found that
the block and repetition type of stuttering
disfluencies are the ones that are still getting confused with
the fluent class as depicted in Fig. 5 (b) and Fig. 5 (c). This
makes intuitive sense because the blocks are closely related
with fluent segments having just different initial silence or
gasp followed by fluent utterances like fluent speech. The
repetitions, on the other hand, contain some word or phrasal
repetitions, which are actually fluent utterances, if we carefully
analyze their individual parts. Consider an utterance he he is
a boy. The word he is being repeated twice but is a fluent part
if two he's can be analyzed on an individual basis.
4) Exploiting advantage of WCE and MB StutterNet: Since
StutterNetWCE and StutterNetMB address the class-imbalance
issue differently, we combine them to exploit both of their
advantages. We first pre-train the StutterNetWCE and use it
as a DisfluentBranch in our multi-branched StutterNet. After
the pre-training step, we freeze parameters in two ways.
First, we freeze the parameters of the contextual encoder
only and fine-tune only the two output branches. We label
this training scheme as Mfrz
enc. By exploiting this method,
we achieve an overall detection improvement of 5.11% in
F1 over StutterNetMB. Second, we freeze the base encoder
and StutterNetWCE (DisfluentBranch) and append with one
more FluentBranch (to distinguish between fluents and stutter
samples). We refer this as Mfrz
enc,disf and it results in an overall
improvement of 6.01% in F1 over StutterNetMB.
We also experiment by first
training the model using
weighted cross entropy in FluentBranch, and then by fine-
tuning the DisfluentBranch by freezing the parameters of
the encoder and FlunetBranch. We refer to it as Mfrz
enc,fluent
and the results for this configuration are shown in Table II
and III. However, this training scheme degrades performance
in almost all the disfluent classes in comparison to Mfrz
enc
(freezing encoder only) and Mfrz
enc,disf (freezing encoder and
DisfluentBranch). This is possibly due to the reason that the
base encoder is trained only to distinguish between fluent
and disfluent classes via FluentBranch. Then freezing its
parameters in a fine-tuning step further inhibits it more in
learning sub-classes (repetitions, prolongations, interjections,
and blocks) of the disfluent category which makes their overall
detection performance lower.
B. Data augmentation
The main experimental results obtained with various data
augmentation techniques are shown in Table III, where we
compare the detection performance obtained with data aug-
mented training to the baseline clean dataset. We first sepa-
rately train the StutterNetMB on different data augmentation
MC SC:Clean 1
MC SC:A4 2
MC CC:Clean 3
MC CC:A4 4
80
60
40
20
0
RA
PA
BA
InA
FA
F1
Fig. 6: Impact of data augmentation (A4) in cross corpora
FluencyBank dataset with MC StutterNet (R: Repetition, P:
Prolongation, B: Block, In: Interjection, F: Fluent, XA: X:
Disfluency Class and A: Accuracy, MC: Multi contextual
StutterNet, SC: Same corpora, CC: Cross corpora, A4: Aug-
mentation). The bar plot clearly shows that the model MC
StutterNet trained on clean SEP-28k dataset fails to generalize
on FluencyBank cross corpora data. Applying data augmenta-
tion improves the stuttering detection in cross domain corpora
as shown orange bars (4th column in each disfluency).
techniques which are described in Section III. We found that
the training MB ResNet+BiLSTM and StutterNetMB with
Kaldi augmentation increases the overall F1 performance.
From Table III, it can be seen that the data augmentation does
help in improving the F1 in almost all the cases. Applying
data augmentation with a single branched and StutterNetWCE,
there is a relative improvement of 5.74% and 3.50% in F1
respectively, over the clean versions of the training. When
data augmentation is applied to MB training, there is a relative
improvement of 4.17% and 0.61% in F1 using StutterNetMB
and ResNet+BiLSTM over clean training, respectively.
enc and Mfrz
Moreover, applying Kaldi data augmentation on top of
the Mfrz
enc,disf training scheme, there is a relative
improvement of 7.28%, and 6.81% in overall accuracy respec-
tively. In addition to Kaldi augmentation, we also apply pitch
scaling and bandpass filter as data augmentation, however, we
did not achieve much improvement in SD.
C. Multi-contextual StutterNet
Different contexts show different optimized class accuracies.
In order to exploit these different variable contexts and to
improve the detection performance further, we propose a
multi-contextual (MC) StutterNet for SD as shown in Fig. 3.
We jointly train and optimize the MC StutterNet on the clean
and augmented data using variable contexts of 5 and 9. The
embeddings extracted from each context as depicted by CB
block are passed to a two-layered BiLSTM unit, and then
concatenated after applying statistical pooling layer (SPL),
resulting in a 1×2×(2×N )-dimensional feature vector (where
SHEIKH et al.: ADVANCING STUTTERING DETECTION VIA DATA AUGMENTATION, CLASS-BALANCED LOSS AND MULTI-CONTEXTUAL DEEP LEARNING 11
TABLE IV: RESULTS USING MC StutterNet WITH CLEAN AND DATA AUGMENTATION. THE MC StutterNet ALSO CONTAINS
MB TRAINING. (B: BLOCK, F: FLUENT, R: REPETITION, P: PROLONGATION, IN: INTERJECTION, TA: TOTAL ACCURACY,
BB: BABBLE, RV:REVERBERATION, MU:MUSIC, NO:NOISE, A4: BB + MU + NO + RV AUGMENTATION)
Method
MC StutterNet (Clean)
MC StutterNet + Bb
MC StutterNet + Mu
MC StutterNet + No
MC StutterNet + Rv
MC StutterNet + A4
R
33.36
32.29
32.08
28.54
31.98
34.65
Accuracy
B
08.34
09.85
07.98
04.75
05.83
10.12
In
59.63
66.50
65.68
64.20
67.63
67.91
P
37.15
37.11
36.57
32.39
37.02
39.75
F
78.34
74.54
77.67
80.42
77.41
77.89
TA
59.77
58.71
59.96
59.99
60.08
61.72
F1(%)
43.86
44.40
44.00
42.80
44.20
46.00
N is layer size), which is then fed parallelly to two different
branches including FluentBranch and DisfluentBranch for
class predictions. This results in a relative improvement of
13.40%, 15.67%, 6.41%, and 1.38% in prolongation, block,
interjection, and fluent classes over StutterNetMB (clean), thus
an improvement of 3.79% in macro F1 score, however, em-
ploying multi-contextual training, we see a drop from 35.26%
to 33.36% in repetition accuracy over the StutterNetMB. In
comparison to baseline BL5 (vanilla single branch StutterNet),
there is a relative improvement of 22.92%, 14.13%, 181.81%,
3.27% in repetition, prolongation, block, and interjection
classes respectively. Thus a relative improvement of 2.38%
in macro F1 score. The MC StutterNet also performs better
in macro F1 score in comparison to state-of-the-art baselines
BL1 and BL4. Applying data augmentation on top of the MC
StutterNet, we found that except noise augmentation, all other
data augmentation types help in improving the macro F1 score
in comparison to MC StutterNet (clean) The noise augmented
samples help in improving the detection accuracy of fluent
class. For interjections, we found that all the data augmentation
helps, and for blocks, only babble augmentation helps in
improving their detection accuracy. We also found applying
all four data augmentation techniques in MC StutterNet results
in an accuracy improvement in prolongation and repetition
classes, however, with individual data augmentation, a drop
in their accuracies can be observed in Table IV. By applying
all four data augmentation in MC StutterNet training, there
is an overall improvement of 1.76%, 17.15%, and 134% in
repetitions, prolongations, and blocks respectively as shown
in the Table IV, which is a 4.48% relative gain in macro F1
score over the augmented StutterNetMB training.
D. Summary of proposed methods
This work advances the basic StutterNet by addressing its
limitations with three modifications. In Table V, we present
a summary of the results demonstrating systematic improve-
ments. We observe that all the proposed modifications help
to gradually improve the performance and we achieve 7.37%
overall relative improvement in terms of macro F1 score.
E. Cross corpora evaluation
Table VI shows the results on cross corpora datasets includ-
ing FluencyBank and simulated LibriStutter. By optimizing
on SEP-28k dataset in terms of data augmentation and multi-
contextual, we aim to evaluate our proposed methodology MC
StutterNet on a cross corpora scenario. We train StutterNet
TABLE V: SUMMARY OF RESULTS OF PROPOSED METHODS
(A4: ALL FOUR AUGMENTATION (BB + MU + NO + RV)
Method
StutterNet (BL5) (Clean) [29]
Class Imbalance
F1 (%)
42.84
StutterNetWCE (Clean)
StutterNetMB (Clean)
Mfrz
enc (Clean)
enc,disf (Clean)
Mfrz
Data Augmentation
StutterNet + A4
StutterNetWCE + A4
StutterNetMB + A4
Mfrz
enc + A4
enc,disf + A4
Mfrz
Multi-Contextual
MC StutterNet (Clean)
MC StutterNet + A4
41.02
42.26
44.42
44.80
45.30
44.34
44.03
44.06
45.76
43.86
46.00
on SEP-28k dataset and evaluate it on FluencyBank dataset
which comprises samples from 33 podcasts. We found that
the model trained on one corpus (SEP-28k) fails to generalize
and performs poorly on cross-domain corpora. As can be seen
from the Table VI and Fig. 6, the F1 detection performance
decreases remarkably from 43.86% to 38.92% employing
the performance drop
clean training. We hypothesize that
is due to the domain mismatch due to the difference in
speaker accent and recording environment between the SEP-
28k and FluencyBank datasets. The repetitions and block
classes show more degradation in their performance in cross
corpora scenarios. Furthermore, we apply data augmentation
in cross corpora evaluation, and we found that it boosts the
detection performance of all the classes, which results in an
improvement of 13.23% in F1.
Experimental evaluation of MC StutterNet on simulated
LibriStutter dataset [63] results in a macro F1 score of ≈ 91%
(shown in Table VI). However, the performance considerably
drops when evaluated in cross-corpora setting in comparison
to real stuttering dataset FluencyBank. The MC StutterNet
trained on SEP-28k dataset shows extremely poor performance
when tested on simulated LibriStutter dataset. Applying data
augmented training, we see there is minimal improvement
of 1% and 2% in repetition and prolongation, respectively.
The LibriStutter simulated dataset does not reflect the actual
nature and characteristics of stuttered speech. The results also
confirms that a model trained on simulated stuttered datasets
should not be used in a real clinical condition.
12
IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
TABLE VI: RESULTS ON CROSS CORPORA FLUENCYBANK AND SIMULATED LIBRISTUTTER DATASETS. THE FIRST ROW
IS FROM TABLE IV WHICH SHOWS THE RESULTS ON THE SAME CORPORA SEP-28K DATASET. THE LAST TWO ROWS
IN THE FIRST HALF OF THE TABLE SHOW THE RESULTS, WHERE THE MODEL IS TRAINED ON SEP-28K AND TESTED
ON FLUENCYBANK IN CROSS CORPORA SETTING. (B: BLOCK, F: FLUENT, R: REPETITION, P: PROLONGATION, IN:
INTERJECTION), BB: BABBLE, RV: REVERBERATION, MU: MUSIC, NO: NOISE, A4: ALL FOUR BB + RV + MU + NO
AUGMENTATION. THE MULTI-BRANCHED TRAINING IS ALSO CONSIDERED IN MC StutterNet.
Method
MC StutterNet
MC StutterNet (Clean)
MC StutterNet + A4
MC StutterNet
MC StutterNet(clean)
MC StutterNet + A4
MC StutterNet
TrainSet
SEP-28k
SEP-28k
SEP-28k
LibriStutter
SEP-28k
SEP-28k
LibriStutter
TestSet
SEP-28k
FluencyBank
FluencyBank
LibriStutter
LibriStutter
LibriStutter
SEP-28k
R
33.36
19.48
22.54
93.36
00.65
01.11
24.24
Accuracy
B
08.34
01.83
4.36
NA
NA
NA
NA
In
59.63
56.36
64.56
NA
NA
NA
NA
P
37.15
35.80
42.22
76.26
00.48
02.39
55.11
F
78.34
80.85
84.04
98.19
99.95
97.35
60.60
TA
59.77
56.48
60.92
96.11
77.25
75.43
53.21
F1(%)
43.86
38.92
44.07
91.00
30.00
31.00
41.00
46
44
42
40
38
36
34
1
L
B
4
L
B
E
C
W
t
e
N
r
e
t
t
u
t
S
B
M
t
e
N
r
e
t
t
u
t
S
4
A
+
B
M
t
e
N
r
e
t
t
u
t
S
4
A
+
E
C
W
t
e
N
r
e
t
t
u
t
S
c
n
e
z
r
f
M
4
A
+
c
n
e
z
r
f
M
f
s
i
d
,
c
n
e
z
r
f
M
t
e
N
r
e
t
t
u
t
S
C
M
4
A
+
f
s
i
d
,
c
n
e
z
r
f
M
C
C
t
e
N
r
e
t
t
u
t
S
C
M
4
A
+
t
e
N
r
e
t
t
u
t
S
C
M
4
A
+
C
C
t
e
N
r
e
t
t
u
t
S
C
M
Fig. 7: Macro F1 score summary of proposed and baseline
models (BL1 and BL4). The red, light blue and purple bars
indicate the baseline, same-corpora setting, and cross-corpora
settings. (CC: Cross Corpora with training on SEP-28k and
evaluated on FluencyBank dataset, A4: All four data augmen-
tation. The second last bar shows cross-corpora performance
on FluencyBank when trained using a clean SEP-28k dataset
and the last bar shows the same with data augmentation).
VI. CONCLUSION
This paper addresses the problem of class imbalance in the
stuttering domain. We address the class imbalance problem
via two strategies including weighted cross entropy and a
multi-branch training scheme. The weighted cross entropy
loss function forces the StutterNet classifier to give more
attention to minority classes. We also investigate the effec-
tiveness of data augmentation in the SD domain. For data
augmentation, we employ reverberations and additive noises
from the MUSAN dataset [51]. Additionally, we propose a
MC StutterNet, time delay based neural network for SD. The
proposed MC StutterNet is a multi-class classifier that exploits
different variable contexts trained jointly on different contexts
(5, 9) using CE. More importantly, the experiments using data
augmentation over the FluencyBank dataset revealed that our
methodology generalizes better in the cross corpora domain.
For class imbalance, we have used only a simple weighting
scheme in the cross-entropy loss function, which results in an
accuracy trade-off between majority and minority classes.
thus,
In general, the data augmentation helps in stuttering domain,
however, the use of data augmentation in the stuttering domain
is not straightforward,
is limited because most data
augmentations, such as time stretch, speed perturbation, and so
on, completely alter the underlying structure of the stuttering
speech sample. In order for data augmentation to be more
effective, a domain stuttering specific data augmentation is
required to be developed. In addition, the stuttering detection
domain has not matured enough, so a single metric like
other speech domains which reflects the overall performance
of a model is yet to be developed. In addition to accuracy
metric, we have also used a macro F1-score (F1) which
gives a good indication for the better evaluation of proposed
methods. Moreover, we use joint training over multi contexts
in this work, and it is possible that one context can dominate
the training. A visualisation summary of macro F1 score of
models in stuttering detection is shown in Fig. 7.
The proposed methodology show promising results and it
can detect if the stuttering is present in the speech sample
or not, however, it cannot predict where exactly the stuttering
occurs in the speech frames. For future study, we would like to
explore combining the other different types of neural networks
in SD to predict the frames where exactly the stuttering occurs.
In addition to varying context, the investigation of varying
depth and different number of convolutional kernels is also
an interesting topic to study in SD. Moreover, the temporal
information captured by recurrent neural networks can also be
investigated in a multi-stream fashion for the identification of
disfluent speech frames.
The performance comparison of the proposed systems with
two state-of-the-art systems demonstrate that even though we
achieve a noticeable advancements, the automated stuttering
detection requires further research for developing a clini-
cally usable system. The stuttering detection is fundamen-
SHEIKH et al.: ADVANCING STUTTERING DETECTION VIA DATA AUGMENTATION, CLASS-BALANCED LOSS AND MULTI-CONTEXTUAL DEEP LEARNING 13
tally a challenging task due to inter-person variations, lan-
guage/accent/dialect variability and other speaking variations.
The scopes of the current work are limited to addressing basic
problems related to stuttering detection. This work can be
extended with speaker-adaptive training, domain adaptation to
further improve the stuttering detection problem.
Regarding cognitive aspects of stuttering are well modeled
or not as the explainability analysis of the used deep models
along with auxiliary data (e.g., functional magnetic resonance
imaging or fMRI data) is yet to be explored. However, we
think the base architecture (i.e., MC StutterNet) developed in
this work could still be useful for such explainability analysis.
The stuttering detection can be improved with multimodality
by integrating with visual cues related to head nodding, lip
tremors, unusual lip shapes, quick eye blinks, facial expres-
sions, etc. We think that the same base acoustic model can be
used in a fusion framework.
We have found that the blocks are the most difficult to
detect. It would be interesting to analyze the disfluencies of the
speakers which are hardest to identify by doing more ablation
analysis. The future work includes exploring self-supervised
models that exploit unlabelled audio data.
ACKNOWLEDGMENT
This work was made with the support of the French National Research
Agency, in the framework of the project ANR BENEPHIDIRE (18-CE36-
0008-03). Experiments presented in this paper were carried out using the
Grid'5000 testbed, supported by a scientific interest group hosted by Inria
and including CNRS, RENATER and several universities as well as other
organizations(see https://www.grid5000.fr) and using the EXPLOR centre,
hosted by the University of Lorraine.
REFERENCES
[1] B. Guitar, Stuttering: An Integrated Approach to its Nature and Treat-
ment. Lippincott Williams & Wilkins, 2013.
[2] J. R. Duffy, Motor Speech Disorders-E-Book: Substrates, Differential
Diagnosis, and Management. Elsevier Health Sciences, 2013.
[3] N. B. Ratner and B. MacWhinney, "Fluency bank: A new resource for
fluency research and practice," Journal of Fluency Disorders, vol. 56,
p. 69, 2018.
[4] D. Ward, Stuttering and Cluttering: Frameworks for Understanding and
Treatment. Psychology Press, 2008.
[5] T. D. Kehoe and W. Contributors, Speech Language Pathology-
Stuttering. Kiambo Ridge, 2006.
[6] I. Hurjui, S. Pete, and I. Bostan, "Spatial distribution and the prevalence
of speech disorders in the provinces of Iran," Journal of Medicine and
Life, vol. 9, no. 1, p. 56, 2016.
[7] A. Smith and C. Weber, "How stuttering develops: The multifactorial
dynamic pathways theory," Journal of Speech, Language, and Hearing
Research, vol. 60, no. 9, pp. 2483–2505, 2017.
[8] E. N ̈oth et al., "Automatic stuttering recognition using hidden Markov
models," in Proc. ICSLP, 2000.
[9] V. Mitra et al., "Analysis and tuning of a voice assistant system for
dysfluent speech," in Proc. Interspeech 2021, 2021, pp. 4848–4852.
[10] L. Verde, G. De Pietro, and G. Sannino, "Voice disorder identification
by using machine learning techniques," IEEE Access, vol. 6, pp. 16 246–
16 255, 2018.
[11] N. Narendra and P. Alku, "Dysarthric speech classification from coded
telephone speech using glottal features," Speech Communication, vol.
110, pp. 47–55, 2019.
[12] C. Quan, K. Ren, and Z. Luo, "A deep learning based method for
parkinson's disease detection using dynamic features of speech," IEEE
Access, vol. 9, pp. 10 239–10 252, 2021.
[13] S. Alharbi et al., "A lightly supervised approach to detect stuttering in
children's speech," in Proc. Interspeech 2018, 2018, pp. 3433–3437.
[14] --, "Sequence labeling to detect stuttering events in read speech,"
Computer Speech & Language, vol. 62, p. 101052, 2020.
[15] V. Zayats, M. Ostendorf, and H. Hajishirzi, "Disfluency detection using
a bidirectional LSTM," in Proc. Interspeech 2016, 2016, pp. 2523–2527.
[16] Q. Chen, M. Chen, B. Li, and W. Wang, "Controllable time-delay trans-
former for real-time punctuation prediction and disfluency detection," in
Proc. ICASSP 2020, 2020, pp. 8069–8073.
[17] A. B. Nassif and et al., "Speech recognition using deep neural networks:
A systematic review," IEEE Access, vol. 7, pp. 19 143–19 165, 2019.
[18] S. Latif and at al., "Deep representation learning in speech process-
ing: Challenges, recent advances, and future trends," arXiv preprint
arXiv:2001.00378, 2020.
[19] Y. Ning et al., "A review of deep learning based speech synthesis,"
Applied Sciences, vol. 9, no. 19, p. 4050, 2019.
[20] M. B. Akc ̧ay and K. O ̆guz, "Speech emotion recognition: Emotional
models, databases, features, preprocessing methods, supporting modali-
ties, and classifiers," Speech Communication, vol. 116, pp. 56–76, 2020.
[21] B. Sisman et al., "An overview of voice conversion and its challenges:
From statistical modeling to deep learning," IEEE/ACM Transactions on
Audio, Speech, and Language Processing, 2020.
[22] J. S. Almeida et al., "Detecting Parkinson's disease with sustained
phonation and speech signals using machine learning techniques," Pat-
tern Recognition Letters, vol. 125, pp. 55–62, 2019.
[23] I. Kodrasi, "Temporal envelope and fine structure cues for dysarthric
speech detection using CNNs," IEEE Signal Processing Letters, vol. 28,
pp. 1853–1857, 2021.
[24] P. Howell and S. Sackin, "Automatic recognition of repetitions and
prolongations in stuttered speech," in Proc. of the first World Congress
on Fluency Disorders, vol. 2. University Press Nijmegen Nijmegen,
The Netherlands, 1995, pp. 372–374.
[25] K. Ravikumar, B. Reddy, R. Rajagopal, and H. Nagaraj, "Automatic
detection of syllable repetition in read speech for objective assessment
of stuttered disfluencies," in Proc. of World Academy of Science,
Engineering and Technology, vol. 36. Citeseer, 2008, pp. 270–273.
[26] B. Villegas et al., "A novel stuttering disfluency classification system
IEEE,
based on respiratory biosignals," in Proc. IEEE EMBC 2019.
2019, pp. 4660–4663.
[27] T. Kourkounakis, A. Hajavi, and A. Etemad, "Detecting multiple speech
disfluencies using a deep residual network with bidirectional long short-
term memory," in Proc. ICASSP 2020, 2020, pp. 6089–6093.
[28] C. Lea et al., "SEP-28k: A dataset for stuttering event detection from
podcasts with people who stutter," in Proc. ICASSP 2021, 2021.
[29] S. A. Sheikh, M. Sahidullah, F. Hirsch, and S. Ouni, "StutterNet: Stut-
tering detection using time delay neural network," in Proc. EUSIPCO
2021, 2021, pp. 426–430.
[30] M. Jouaiti and K. Dautenhahn, "Dysfluency classification in stuttered
speech using deep learning for real-time applications," in Proc. ICASSP
2022, 2022, pp. 6482–6486.
[31] S. A. Sheikh, M. Sahidullah, F. Hirsch, and S. Ouni, "Machine learning
for stuttering identification: Review, challenges and future directions,"
Neurocomputing, vol. 514, pp. 385–402, 2022.
[32] A. Fern ́andez, S. Garc ́ıa, M. Galar, R. C. Prati, B. Krawczyk, and
Springer, 2018,
F. Herrera, Learning from Imbalanced Data Sets.
vol. 10.
[33] B. Krawczyk, "Learning from imbalanced data: open challenges and
future directions," Progress in Artificial Intelligence, vol. 5, no. 4, pp.
221–232, 2016.
[34] G. M. Weiss, "Foundations of Imbalanced Learning," Imbalanced Learn-
ing: Foundations, Algorithms, and Applications, pp. 13–41, 2013.
[35] G. I. Winata, G. Wang, C. Xiong, and S. Hoi, "Adapt-and-adjust:
Overcoming the long-tail problem of multilingual speech recognition,"
arXiv preprint arXiv:2012.01687, 2020.
[36] B. W. Schuller et al., "The ACM multimedia 2022 computational par-
alinguistics challenge: vocalisations, stuttering, activity, & mosquitos,"
in Proc. ACM Multimedia 2022, 2022.
[37] Y. Cui et al., "Class-balanced loss based on effective number of
samples," in Proc. IEEE CVPR, 2019, pp. 9268–9277.
[38] M. Bader-El-Den, E. Teitei, and M. Adda, "Hierarchical classification
for dealing with the class imbalance problem," in Proc. 2016 IJCNN,
2016, pp. 3584–3591.
[39] D. S. Park et al., "SpecAugment: A simple data augmentation method
for automatic speech recognition," in Proc. Interspeech 2019, 2019, pp.
2613–2617.
[40] L. Meng, J. Xu, X. Tan, J. Wang, T. Qin, and B. Xu, "Mixspeech: Data
augmentation for low-resource automatic speech recognition," in Proc.
ICASSP 2021, 2021, pp. 7008–7012.
[41] N. Kanda, R. Takeda, and Y. Obuchi, "Elastic spectral distortion for low
resource speech recognition with deep neural networks," in Proc. IEEE
ASRU 2013, 2013, pp. 309–314.
[42] T. Ko et al., "Audio augmentation for speech recognition," in Proc.
Interspeech 2015, 2015.
14
IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. XX, XXXX 2022
[43] P. J. Bell et al., "Transcription of multi-genre media archives using out-
[57] H. Bourlard et al., "Towards subband-based speech recognition," in Proc.
of-domain data," in Proc. IEEE SLT 2012, 2012, pp. 324–329.
EUSIPCO 1996.
IEEE, 1996, pp. 1–4.
[44] B. Vachhani, C. Bhat, and S. K. Kopparapu, "Data augmentation using
healthy speech for dysarthric speech recognition," in Proc. Interspeech
2018, 2018, pp. 471–475.
[45] Y. Jiao et al., "Simulating dysarthric speech for training data augmen-
tation in clinical speech applications," in Proc. ICASSP 2018, 2018, pp.
6009–6013.
[46] H. Christensen et al., "Combining in-domain and out-of-domain speech
data for automatic recognition of disordered speech." in Proc. Inter-
speech 2013, 2013, pp. 3642–3645.
[47] F. Xiong, J. Barker, and H. Christensen, "Phonetic analysis of dysarthric
speech tempo and applications to robust personalised dysarthric speech
recognition," in Proc. ICASSP 2019, 2019, pp. 5836–5840.
[48] D. Woszczyk et al., "Data augmentation for Dementia detection in
spoken language." in Proc. Interspeech 2022, 2022, pp. 2858–2862.
[49] T. Gr ́osz et al., "Wav2vec2-based paralinguistic systems to recognise
vocalised emotions and stuttering," in Proc. ACM Multimedia, 2022, p.
7026–7029.
[50] T. Ko et al., "A study on data augmentation of reverberant speech for
robust speech recognition," in Proc. ICASSP 2017, 2017, pp. 5220–5224.
[51] D. Snyder, G. Chen, and D. Povey, "Musan: A music, speech, and noise
corpus," arXiv preprint arXiv:1510.08484, 2015.
[58] H. Hennansky, S. Tibrewala, and M. Pavel, "Towards ASR on partially
corrupted speech," in Proc. Fourth International Conference on Spoken
Language Processing. ICSLP '96, vol. 1, 1996, pp. 462–465 vol.1.
[59] N. Naderi and B. Nasersharif, "Multiresolution convolutional neural net-
work for robust speech recognition," in Proc. 2017 Iranian Conference
on Electrical Engineering (ICEE), 2017, pp. 1459–1464.
[60] X.-L. Zhang and D. Wang, "A deep ensemble learning method for
monaural speech separation," IEEE/ACM Transactions on Audio, Speech,
and Language Processing, vol. 24, no. 5, pp. 967–977, 2016.
[61] Y. Chiba, T. Nose, and A. Ito, "Multi-stream attention-based BLSTM
with feature segmentation for speech emotion recognition," in Proc.
Interspeech 2020, 2020.
[62] Y. Li, X. Zhang, H. Jin, X. Li, Q. Wang, Q. He, and Q. Huang, "Using
multi-stream hierarchical deep neural network to extract deep audio
feature for acoustic event detection," Multimedia Tools and Applications,
vol. 77, no. 1, pp. 897–916, 2018.
[63] T. Kourkounakis, A. Hajavi, and A. Etemad, "FluentNet: End-to-end de-
tection of stuttered speech disfluencies with deep learning," IEEE/ACM
Transactions on Audio, Speech, and Language Processing, vol. 29, pp.
2986–2999, 2021.
[64] B. McFee et al., "Librosa: Audio and music signal analysis in python,"
[52] D. Povey et al., "The Kaldi speech recognition toolkit," in Proc. IEEE
in Proc. 14th Python in Science Conference, 2015.
ASRU 2021, 2011.
[65] D. Can, V. R. Martinez, P. Papadopoulos, and S. S. Narayanan, "PyKaldi:
[53] J. B. Allen, "How do humans process and recognize speech?" in Modern
A Python wrapper for Kaldi," in Proc. ICASSP.
IEEE, 2018.
methods of speech processing. Springer, 1995, pp. 251–275.
[54] K. Simonyan and A. Zisserman, "Two-stream convolutional networks
Cambridge,
for action recognition in videos," in Proc. NIPS 2014.
MA, USA: MIT Press, 2014.
[55] K. J. Han et al., "Multistream CNN for robust acoustic modeling," in
Proc. ICASSP 2021, 2021, pp. 6873–6877.
[56] H. Bourlard and S. Dupont, "A new ASR approach based on independent
processing and recombination of partial frequency bands," in Proc.
ICSLP, 1996.
[66] R. Fer et al., "Multilingually trained bottleneck features in spoken
language recognition," Computer Speech & Language, vol. 46, no.
Supplement C, pp. 252 – 267, 2017.
[67] S. A. Sheikh, M. Sahidullah, F. Hirsch, and S. Ouni, "End-to-end and
self-supervised learning for ComParE 2022 stuttering sub-challenge," in
Proc. ACM Multimedia 2022, 2022.
[68] J. Opitz and S. Burst, "Macro F1 and macro F1 a note," arXiv preprint
arXiv:1911.03347, 2019.
|
|
http://arxiv.org/abs/2302.10681v3 | 2023-07-02T23:51:57 | 2023-02-21T14:03:22 | FrankenSplit: Efficient Neural Feature Compression with Shallow
Variational Bottleneck Injection for Mobile Edge Computing | The rise of mobile AI accelerators allows latency-sensitive applications to
execute lightweight Deep Neural Networks (DNNs) on the client side. However,
critical applications require powerful models that edge devices cannot host and
must therefore offload requests, where the high-dimensional data will compete
for limited bandwidth. This work proposes shifting away from focusing on
executing shallow layers of partitioned DNNs. Instead, it advocates
concentrating the local resources on variational compression optimized for
machine interpretability. We introduce a novel framework for resource-conscious
compression models and extensively evaluate our method in an environment
reflecting the asymmetric resource distribution between edge devices and
servers. Our method achieves 60% lower bitrate than a state-of-the-art SC
method without decreasing accuracy and is up to 16x faster than offloading with
existing codec standards. | [
"Alireza Furutanpey",
"Philipp Raith",
"Schahram Dustdar"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10681v3",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10681v3",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "eess.IV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"eess.IV",
"cs.AI",
"cs.DC",
"cs.LG"
] | 1
FrankenSplit: Efficient Neural Feature
Compression with Shallow Variational
Bottleneck Injection for Mobile Edge Computing
Alireza Furutanpey∗, Philipp Raith, Schahram Dustdar,
Distributed Systems Group, TU Vienna [email protected]
∗Corresponding Author
3
v
1
8
6
0
1
.
2
0
3
2
:
v
i
X
r
a
3
2
0
2
1 INTRODUCTION
l
u
J
✦
]
2
I
.
s
s
e
e
[
D EEP Learning (DL) has demonstrated that it can solve
V
real-world problems in challenging areas ranging from
Computer Vision (CV) [1] to Natural language Process-
ing (NLP) [2]. Complementary with the advancements in
mobile edge computing (MEC) [3] and energy-efficient
AI accelerators, visions of intelligent city-scale platforms
for critical applications, such as mobile augmented real-
ity (MAR) [4], disaster warning [5], or facilities manage-
ment [6], seem progressively feasible. Nevertheless, the
accelerating pervasiveness of mobile clients gave unprece-
dented growth in Machine-to-Machine (M2M) communi-
cation [7], leading to an insurmountable amount of net-
work traffic. A root cause is the intrinsic limitation of
mobile devices that allows them to realistically host a single
lightweight Deep Neural Network (DNN) in memory at
a time. Hence, clients must frequently offload inference
requests since the local resources alone cannot meet the
complex and demanding requirements of applications that
rely on multiple highly accurate DNNs [8].
The downside to offloading approaches is that by con-
stantly streaming high-dimensional visual data, the limited
bandwidth will inevitably lead to network congestion re-
sulting in erratic response delays, and it leaves valuable
client-side resources idle.
Split Computing (SC) emerged as an alternative to al-
leviate inefficient resource utilization and to facilitate low-
latency and performance-critical mobile inference. The basic
idea is to partition a DNN to process the shallow layers
with the client and send a processed representation to
the remaining deeper layers deployed on a server. The
SC paradigm can potentially draw resources from the en-
tire edge-cloud compute continuum. However, current SC
methods are only conditionally applicable (e.g., in highly
bandwidth-constrained networks) or tailored toward spe-
cific neural network architectures. Still, even methods that
claim to generalize towards a broader range of architectures
do not consider that mobile clients can typically only load
a single model into memory. Consequently, SC methods are
impractical for applications with complex requirements re-
lying on inference from multiple models concurrently (e.g.,
MAR). Mobile clients reloading weights from its storage into
memory, and sending multiple intermediate representations
for each pruned model would incur more overhead than
directly transmitting image data with fast lossless codecs
to an unmodified model. Moreover, due to the conditional
applicability of SC, practical methods rely on a decision
mechanism that periodically probes external conditions
(e.g., available bandwidth), resulting in further deployment
and runtime complexity [9].
This work shows that we can address the increasing need
to reduce bandwidth consumption while simultaneously
generalizing the objective of SC methods to provide mobile
clients access to low-latency inference from remote off-the-
shelf discriminative models even in constrained networks.
We draw from recent advancements in lossy learned
image compression (LIC) and the Information Bottleneck
(IB) principle [10]. Despite outperforming handcrafted
codecs [11], such as PNG, or WebP [12], LIC is unsuitable
for real-time inference in MEC since they consist of large
models and other complex mechanisms that are demand-
ing even for server-grade hardware. Moreover, research in
compression primarily focuses on reconstruction for human
perception containing information superfluous for M2M
communication. In comparison, the deep variational infor-
mation bottleneck (DVIB) provides an objective for learned
feature compression with DNNs, prioritizing information
valuable for machine interpretability over human percep-
tion.
With DVIB, we can conceive methods universally appli-
cable to off-the-shelf architectures. However, current DVIB
methods typically place the bottleneck at the penultimate
layer. Thus, they are unsuitable for most common dis-
tributed settings that assume an asymmetric resource allo-
cation between the client and the server. In other words, the
objective of DVIB contradicts objectives suitable for MEC,
where we would ideally inverse the bottleneck's location to
the shallow layers.
To this end, we introduce Shallow Variational Information
Bottleneck (SVIB) that accommodates the restrictions of mo-
bile clients while retaining the generalizability of DVIB to
arbitrary architectures. Although shifting the bottleneck to
the shallow layers does not formally change the objective,
we will demonstrate that existing methods for mutual infor-
mation estimation lead to unsatisfactory results.
Specifically, we introduce FrankenSplit: A novel training
and design heuristic for variational feature compression
models embeddable in arbitrary DNN architectures with
pre-trained weights for high-level vision tasks.
FrankenSplit is refreshingly simple to implement and
deploy without additional decision mechanisms that rely
on runtime components for probing external conditions.
Moreover, by deploying a single lightweight encoder, the
client can access state-of-the-art accuracy from multiple
large server-grade models without reloading weights from
memory for each task. Lastly, the approach does not re-
quire modifying discriminative models (e.g., by finetuning
weights). Therefore, we can directly utilize foundational off-
the-shelf models and seamlessly integrate FrankenSplit into
existing systems.
We open-source our repository 1 as an addition to the
community for researchers to reproduce and extend our
experiments. In summary, our contributions are:
• Thoroughly exploring how shallow and deep bottle-
neck injection differ for feature compression.
• Introducing a novel saliency-guided training method to
overcome the challenges of SVBI to train a lightweight
encoder with limited capacity and demonstrate how the
compressed features are usable for several downstream
tasks without predictive loss.
• Introducing a generalizable architecture design heuris-
tic for a variational feature compression model to ac-
commodate arbitrary DNN architectures for discrimi-
native models.
Section 2 discusses relevant work on SC and LIC. Sec-
tion 3 discusses the limitations of SC methods and moti-
vates neural feature compression. Section 4 describes the
problem domain. Section 5 progressively introduces the
solution approach. Section 6 extensively justify relevant
performance indicators and evaluates several implementa-
tions of FrankenSplit against various baselines to assess our
method's efficacy. Lastly, Section 7 summarizes this work
and highlights limitations to motivate follow-up work.
2 RELATED WORK
2.1 Neural Data Compression
2.1.1 Learned Image Compression
The goal of (lossy) image compression is minimizing bitrates
while preserving information critical for human perception.
Transform coding is a basic framework of lossy compres-
sion, which divides the compression task into decorrelation
and quantization [13]. Decorrelation reduces the statistical
dependencies of the pixels, allowing for more effective
entropy coding, while quantization represents the values
as a finite set of integers. The core difference between
handcrafted and learned methods is that the former relies on
linear transformations based on expert knowledge. Contrar-
ily, the latter is data-driven with non-linear transformations
learned by neural networks [14].
Ball ́e et al. introduced the Factorized Prior (FP) entropy
model and formulated the neural compression problem by
1. https://github.com/rezafuru/FrankenSplit
2
finding a representation with minimal entropy [15]. An
encoder network transforms the original input to a latent
variable, capturing the input's statistical dependencies. In
follow-up work, Ball ́e et al. [16] and Minnen et al. [17]
extend the FP entropy model by including a hyperprior as
side information for the prior. Minnen et al. [17] introduce
the Joint Autoregressive and Hierarchical Priors (JAHP)
entropy model, which adds a context model to the existing
scale hyperprior latent variable models. Typically, context
models are lightweight, i.e., they add a negligible number
of parameters, but their sequential processing increases the
end-to-end latency by orders of magnitude.
2.1.2 Feature Compression
Singh et al. demonstrate a practical method for the Infor-
mation Bottleneck principle in a compression framework
by introducing the bottleneck in the penultimate layer and
replacing the distortion loss with the cross-entropy for im-
age classification [18]. Dubois et al. generalized the VIB for
multiple downstream tasks and were the first to describe
the feature compression task formally [19]. However, their
encoder-only CLIP compressor has over 87 million parame-
ters. Both Dubois and Singh et al. consider feature compres-
sion for mass storage, i.e., they assume the data is already
present at the target server. In contrast, we consider how
resource-constrained clients must first compress the high-
dimensional visual data before sending it over a network.
Closest to our work is the Entropic Student (ES) pro-
posed by Matsubara et al. [20], [21], as we follow the same
objective of real-time inference with feature compression.
Nevertheless, they simply apply the learning objective, and
a scaled-down version of autoencoder from [15], [16]. More-
over, they do not analyze the intrinsic differences between
feature and image compression nor explain their solution
approach. Contrastingly, we carefully examine the problem
domain of resource-conscious feature compression to iden-
tify underlying issues with current methods, allowing us
to conceive novel solutions with significantly better rate-
distortion performance.
2.2 Split Computing
We distinguish between two orthogonal approaches to SC.
2.2.1 Split Runtimes
Split runtime systems are characterized by performing no
or minimal modifications on off-the-shelf DNNs. The ob-
jective is to dynamically determine split points according
to the available resources, network conditions, and intrinsic
model properties. Hence, split runtimes primarily focus on
profilers and adaptive schedulers. Kang et al. performed
extensive compute cost and feature size analysis on the
layer-level characterizations of DNNs and introduced the
first split runtime system [22]. Their study has shown that
split runtimes are only sensible for DNNs with an early
natural bottleneck, i.e., models performing aggressive di-
mensionality reduction within the shallow layers. However,
most modern DNNs increase feature dimensions until the
last layers for better representation. Consequently, follow-
up work focuses on feature tensor manipulation [23]–[25].
We argue against split runtimes since they introduce con-
siderable complexity. Worse, the system must be tuned
toward external conditions, with extensive profiling and
careful calibration. Additionally, runtimes raise overhead
and another point of failure by hosting a network-spanning
system. Notably, even the most sophisticated methods still
rely on a natural bottleneck, evidenced by how state-of-the-
art split runtimes still report results on superseded DNNs
with an early bottleneck [26], [27].
2.2.2 Artificial Bottleneck Injection
By shifting the effort towards modifying and re-training an
existing base model (backbone) to replace the shallow layers
with an artificial bottleneck, bottleneck Injection retains the
simplicity of offloading. Eshratifar et al. replace the shallow
layers of ResNet-50 with a deterministic autoencoder net-
work [28]. A follow-up work by Jiawei Shao and Jun Zhang
further considers noisy communication channels [29]. Mat-
subara et al. [30], and Sbai et al. [31] propose a more general
network agnostic knowledge distillation (KD) method for
embedding autoencoders, where the output of the split
point from the unmodified backbone serves as a teacher.
Lastly, we consider the work in [20] as the state-of-the-art
for bottleneck injection.
Although bottleneck injection is promising, there are two
problems with current methods. They rely on deterministic
autoencoder for crude data compression or are intended for
a specific class of neural network architecture.
This work addresses both limitations of such bottleneck
injection methods.
3 THE CASE FOR NEURAL DATA COMPRESSION
Based on the following assumptions and observations, we
consider local inference with mobile-friendly models or-
thogonal to our work.
First, we assume an asymmetric resource allocation be-
tween the client and the server, i.e., the latter has con-
siderably higher computational capacity. Additionally, we
assume that server-grade hardware unsuitable for mobile
clients must achieve state-of-the-art performance for non-
trivial discriminative tasks with inference times suitable for
latency-sensitive applications.
Although progress in energy-efficient ASICs and em-
bedded AI with model compression with quantization,
channel pruning, etc., permit constrained clients to execute
lightweight DNNs, they are bound to reduced predictive
strength relative to their contemporary unconstrained coun-
terparts [32]. This assumption is sensible considering the
trend for DNNs towards pre-trained foundational models
with rising computational requirements due to increasing
model sizes [33] and demanding operations [34].
Lastly, mobile devices cannot realistically load model
weights for multiple models simultaneously, and it is un-
reasonable to expect that a single compressed model is
sufficient for applications with complex requirements that
rely on various models concurrently or in quick succession.
Consistent with CICOs reporting an accelerating rise of
M2M communication [7], we conclude that it is inevitable
that the demand for inference models to solve intelligent
tasks will lead to an increase in transmitting large volumes
3
of high-dimensional data, despite the wide availability of
onboard AI accelerators.
3.1 Limitations of Split Computing
Still, it would be useful to leverage advancements in energy-
efficient mobile chips beyond applications where local in-
ference is sufficient. In particular, SC can potentially draw
resources from an entire edge-cloud commute continuum
while binary on- or offloading decision mechanisms will
leave valuable client or server-side resources idle. Figure 1
illustrates generic on/offloading and split runtimes.
Fig. 1: Prediction with On/Offloading and Split Runtimes
Nevertheless, both SC approaches discussed in sec-
tion 2.2 are only conditionally applicable. In particular,
split Runtimes reduce server-side computation for inference
tasks with off-the-shelf models by onloading and executing
shallow layers at the client. This approach introduces two
major limitations.
First, when the latency is crucial, this is only sensible if
the time for client-slide execution, transferring the features,
and remotely executing the remaining layers is less than
the time of directly offloading the task. Consequently, more
recent work [25]–[27] relies on carefully calibrated dynamic
decision mechanisms that periodically measure external and
internal conditions (e.g., client state, hardware specifica-
tions, and network conditions) to measure ideal split points
or whether direct offloading is preferable. Second, since the
shallow layers must match the deeper layers, split runtimes
cannot accommodate applications with complex require-
ments which are a common justification for MEC (e.g.,
MAR). Constrained clients would need to swap weights
from the storage in memory each time the prediction model
changes to classify from a different set of labels. Worse, the
layers must match even for models predicting the same
classes with closely related architectures (e.g., ResNet50
and ResNet101). Hence, it is particularly challenging to
integrate split runtimes into systems that can increase the
resource efficiency of servers by adapting to shifting and
fluctuating client conditions [35], [36]. For example, when
a client specifies a target accuracy and a tolerable lower
Local and Remote InferenceloadstoreCompressorPNGWEBPJPGHead Models (Shallow Layers)decision0.070.140.58Mobile Discriminative ModelsDiscriminative ModelsSplit Runtimes0.110.030.620.570.180.090.250.410.130.250.410.130.570.180.090.110.030.62Discriminative ModelsClientServerWeightsStorageRuntimeTransferRequestAlternative(Mobile)AI AcceleratorFeatureTensorDecompressorPNGWEBPJPGCompressorPNGWEBPJPGDecompressorPNGWEBPJPGloadstorebound, the system could select a ResNet101 that can hit the
target accuracy but may temporarily fall back to a ResNet50
to ease the load when necessary.
3.2 Execution Times with Resource Asymmetry
Table 1 summarizes the execution times of ResNet variants
that classify a single tensor with dimensions 3 × 224 × 224
to demonstrate the limitation incurred by partitioning ex-
ecution of a model when there is considerable resource
asymmetry between a client and a server. Specifically, the
client is an Nvidia Jetson NX2 equipped with an AI accel-
erator, and the server hosts an RTX 3090. Section 6 details
evaluation setup and hardware configuration. Like other
TABLE 1: Execution Times of Split Models
Model
ResNet50
ResNet101
ResNet152
Split
Index
Stem
Stage 1
Stem
Stage 1
Stem
Stage 1
Head
[NX2] (ms)
1.5055
8.2628
1.5055
8.2628
1.5055
8.2628
Head
[3090] (ms)
0.1024
0.9074
0.1024
0.9074
0.1024
0.9074
Tail
[3090] (ms)
4.9687
4.0224
9.8735
8.9846
14.8862
13.8687
Rel. Exec.
[NX2] (%)
23.25
67.26
13.23
47.91
9.18
37.34
Contribution
[NX2] (%)
0.037
0.882
0.021
0.506
0.015
0.374
widespread architectural families, ResNets organize their
layers into four top-level layers, while the top-grained ones
recursively consist of finer-grained ones. The terminology
differs for architectures, but for the remainder of this work,
we will refer to top-level layers as stages and the coarse-
grained layers as blocks.
Split point stem assigns the first preliminary block as
the head model. It consists of a convolutional layer with
batch normalization [37] and ReLU activation, followed by
a maxpool. Split point stage 1 additionally assigns the first
stage to the head.
Notice how the shallow layers barely constitute the
overall computation even when the client takes more time
to execute the head than the server for the entire model.
Further, compare the percentage of total computation time
and relate them to the number of parameters. At best, the
client contributes to 0.02% of the model execution when
taking 9% of the total computation time and may only
contribute 0.9% when taking 67% off the computation time.
Despite a reasonably powerful mobile-friendly AI accel-
erator, it is evident that utilizing client-side resources to aid
a server is inefficient. Hence, SC methods commonly include
some form of quantization and data size reduction.
3.3 Feature Tensor Dimensionality and Quantization
To further explain the intuition of our claims and present
some preliminary empirical evidence, we conceive a hypo-
thetical SC method that typically starts with some statistical
analysis of the output layer as illustrated in Figure 2. Exclud-
ing repeating blocks, the feature dimensionality is identical
for ResNet50, 101, and 152. The red line marks the cutoff
where the size of the intermediate feature tensor is less
than the original input. ResNets (including more modern
variants), among numerous modern architectures, do not
have an early natural bottleneck and will only drop below
the cutoff from the first block of the second stage (S3RB1-
2). Since executing until S3RB1-2 is only about 0.06% of
the model parameters of ResNet152, it may seem like a
negligible computational overhead. However, as shown in
4
Table 1, even when executing 0.04% of the model, the client
will make up 37% of the total computation time.
Nevertheless, more modern methods reduce the num-
ber of layers a client must execute with feature tensor
quantization and other clever (typically statistical) meth-
ods that statically or dynamically prune channels [9]. For
Fig. 2: Output Dimensionality Distribution for ResNet
our hypothetical method, we use the execution times from
Table 1, except we generously assume that it can apply
feature tensor quantization and channel pruning to reduce
the expected data size without a loss in accuracy for the
ImageNet classification task [38] and with no computational
costs. Moreover, we reward the client for executing deeper
layers to reflect deterministic bottleneck injection methods,
such that the output size of the stem and stage one are
802816 and 428168 bits, respectively. Note that, for stage
one, this is roughly a 92% reduction relative to its original
FP32 output size at no additional computational cost. Yet,
the plots in Figure 3 show that offloading with PNG, let
alone more modern lossless codecs (e.g., WebP), will beat SC
in total request time, except when the data rate is severely
constrained. Evidently, using reasonably powerful energy-
Fig. 3: Inference Latency for SC and Offloading
efficient AI accelerators to execute the shallow layers of a
target model is not an efficient use of client-side resources.
3.4 The advantage of learned methods
In a narrow sense, most SC more modern methods consider
minimizing transmitting data with feature tensor quanti-
zation and other clever (typically statistical) methods that
statically or dynamically prune channels, which we reflected
with our hypothetical SC method.
Stem-cStem-mpS1RB1-1S1RB1-2S1RB1-3S1RB2-1S1RB2-2S1RB2-3S2RB1-1S2RB1-2S2RB1-3S2RB2-1S2RB2-2S3RB1-1S3RB1-2S3RB1-3S3RB2-1S3RB2-2S3RB3-3S4RB1-1S4RB1-2S4RB1-3S4RB2-1S4RB2-2S4RB3-3Layer Name0200000400000600000800000Output Dimension (CxHxW)Layer Parameters Distribution10203040506070Data rate (Mbps)255075Total Latency (ms)ResNet50 (Split: Stem)10203040506070Data rate (Mbps)255075Total Latency (ms)ResNet101 (Split: Stem)10203040506070Data rate (Mbps)255075Total Latency (ms)ResNet152 (Split: Stem)10203040506070Data rate (Mbps)255075Total Latency (ms)ResNet50 (Split: Stage 1)10203040506070Data rate (Mbps)255075Total Latency (ms)ResNet101 (Split: Stage1)10203040506070Data rate (Mbps)255075Total Latency (ms)ResNet152 (Split: Stage1)SC with Dimensionality ReductionOffloading with PNGWhile dimensionality reduction can be seen as a crude
approximation to compression, it is not equivalent to it [17].
With compression, the aim is to reduce the entropy of the
latent under a prior shared between the sender and the
receiver [14]. Dimensionality reduction (especially chan-
nel pruning) may seem effective when evaluating simple
datasets (e.g., CIFAR-10 [39]). However, this is more due
to the overparameterization of deep neural networks. Pre-
cisely, for a simple task, we can prune most channels or in-
ject a small autoencoder for dimensionality reduction at the
shallow layers that may appear to achieve unprecedented
compression rates relative to the unmodified head's feature
tensor size. In Section 6.3.7, we will show that methods may
seem to work reasonably well on a simple dataset while
completely faltering on more challenging datasets.
From an information-theoretic point of view [40], fea-
ture tensor (especially non-spatial) dimensionality to assert
whether it is a suitable bottleneck is not an ideal mea-
sure. Instead, we should consider the information content
of the feature tensor. Notably, due to the data processing
inequality, as Section 4.1 will elaborate on, the information
content of a feature tensor will always be at most as high
as the unprocessed input respective to the task. Although
dimensionality reduction across spatial dimensions is an
effective inductive bias to force a network to discern signals
from noise during optimization,
When treating the model itself as a black box, the raw
output size measured as C × H × W × Precision is not
a suitable approximation of the data's entropy, i.e., it is
not a meaningful way to assert whether a layer may be a
split point. Conversely, with learned approaches, we can
optimize a model to compress the input according to its
information content and be selective toward the signals
we require for tasks we are interested in. Moreover, in
Section 6.3.6, we show that with learned transforms and a
parametric entropy model, increasing the latent dimension-
ality, reduces the compressed data size.
To summarize, the potential of SC is inhibited by primar-
ily focusing on shifting parts of the model execution from
the server to the client. SC's viability is not determined by
how well they can partially compute a split network but
by how well they can reduce the input size. Therefore, we
pose the following question: Is it more efficient to focus the
local resources exclusively on compressing the data rather than
executing shallow layers of a network that would constitute a
negligible amount of the total computation cost on the server?
In Figure 4, we sketch predictions with our proposed
approach. There are two underlying distinctions to common
Fig. 4: Prediction with Variational Bottleneck Injection
SC methods. First, the model is not split between the client
5
and the server. Instead, it deploys a lightweight encoder,
and the decoder replaces the shallow layers, i.e., the dis-
criminative model is split within the server. The decoder's
purpose is to restore and transform the compressed signals
and may match multiple backbones and tasks.
Second, compared to split runtimes, the decision to
apply the compression model may only depend on internal
conditions. It can decouple the client from any external com-
ponent (e.g., server, router). Ideally, applying the encoder
should always be preferable if a mobile device has the mini-
mal required resources. Still, since our method does not alter
the backbones, we do not need to serve additional models to
accommodate clients that cannot apply the encoder. We can
simply route the input to the original input layer, similar
to split runtimes, without a runtime that influences client
decisions based on external conditions.
This work aims to demonstrate that advancements in
energy-efficient AI accelerators for providing constrained
clients with demanding requirements (low latency, high
accuracy) access to state-of-the-art foundational models
are best leveraged with neural compression methods. The
following describes the limitations of existing work for
constrained devices which we must address to conceive a
method suitable for MEC.
4 PROBLEM FORMULATION
The goal
is for constrained clients to request real-time
predictions from a large DNN while maximizing resource
efficiency and minimizing bandwidth consumption with
compression methods. Figure 5 illustrates the possible ap-
proaches when dedicating client resources exclusively for
compression. Strategy a) corresponds to offloading strate-
Fig. 5: Utilizing Client Resources for (Learned) Codecs
gies with CPU-bound handcrafted codecs. Although learned
methods can achieve considerably lower bitrates with
comparable distortion than commonly used handcrafted
codecs [14], we must consider that the latency overhead
incurred by the DNNs (even if executed on AI accelera-
tors) may dominate the reduced transfer time. Strategy b)
represents recent LIC models outperforming handcrafted
baselines but relying on large DNNs and other complex
mechanisms. Strategy c) is our advocated method with an
embeddable variational feature compression method and
draws from the same underlying Nonlinear Transform Cod-
ing (NTC) framework as b). It may seem straightforward to
Shallow Variational Bottleneck Injection(Pruned) Discriminative ModelsEntropy ModelEDRestoration & Transformation0.570.180.09Shallow BottleneckECEncoder0.250.410.130.110.030.62DecoderEntropy Model(Mobile)ClientServerTransferRequestAlternativeAcceleratorTransformed(De)coderEntropyFeature TensorFeatureTensorEDECEdge/Mobile DeviceRestoration & Transformation DecoderImage Decompressor (Learned)Edge/Cloud ServerCompressedBitstringb)Image Decompressor(Handcrafted)Image Compressor(Handcrafted)Feature Compressor (Learned)CompressedBitstringCompressedBitstring0.030.620.110.07....CompressorImage Compressor (Learned)ECECECECPNGJPGWEBP01100011 01100101 01100011 01100101 01100101 01100011 01100101 01100101 01100011 01100101 01100011 01100101 ED01100101 01100011 01100101 01100011 01100101 01100101 01100011 01100101 01100101 01100011 01100101 EDEDChannelPNGJPGWEBPa) b) c) 0.030.620.110.07....0.030.620.110.07....reduce the size of LIC models by prioritizing information
sufficient for a particular set of tasks rather than recon-
input. Nevertheless, the challenge
structing the original
is to reduce enough overhead while achieving sufficiently
low bitrates without sacrificing predictive strength to make
variational compression models suitable for real-time pre-
diction with limited client resources and varying network
conditions.
Specifically, to overcome the limitations of SC methods
described in Section 3, in addition to offloading with strat-
egy a) and b), (i) we require a resource-conscious encoder
that is maximally compressive about a useful representation
without increasing the predictive loss. Additionally, (ii) the
decoder should exploit the available server-side resources
but still incur minimal overhead on the backbone. Lastly,
(iii) a compression model should fit for different down-
stream tasks and architectural families (e.g., CNNs or Vision
Transformers).
Our solution approach in Section 5 must focus on two
distinct but intertwined aspects. First is an appropriate
training objective for feature compression with limited
model capacity. The second concerns a practical implemen-
tation by introducing an architectural design heuristic for
edge-oriented variational autoencoders. Hence, the follow-
ing formalizes the properties of a suitable objective function
and describes why related existing methods are unsuitable
for SVBI.
4.1 Rate-Distortion Theory for Model Prediction
By Shannon's rate-distortion theory [41], we seek a mapping
bound by a distortion constraint from a random variable
(r.v.) X to an r.v. U , minimizing the bitrate of the outcomes
of X. More formally, given a distortion measure D and a
distortion constraint Dc, the minimal bitrate is
min
PU |X
I(X; U ) s.t. D(X, U ) ≤ Dc
(1)
where I(X; U ) is the mutual information and is defined as
I(X; U ) =
(cid:90) (cid:90)
p(x, u) log
(cid:19)
(cid:18) p(x, u)
p(x)p(u)
dxdz
(2)
In lossy image compression, U is typically the recon-
struction of ̃X of the original input, and the distortion is
some sum of squared errors d(x, ̃x). Since the r-d theory
does not restrict us to reconstruction [42], we can apply dis-
tortion measures relevant to M2M communication. Notably,
when our objective is to minimize predictive loss rather than
reconstructing the input, we keep information that may be
important for human perception but excessive for model
predictions.
To intuitively understand the potential to discard signifi-
cantly more information for discriminative models, consider
the Data Processing Inequality (DPI). For any 3 r.v.s X, Y, Z
that form a Markov chain X ↔ Y ↔ Z where the following
holds:
I(X; Y ) ≥ I(X; Z)
(3)
Then, describe the information flow in an n-layered se-
quential DNN, layer with the information path by viewing
6
layered neural networks as a Markov chain of successive
representations [43]:
I(X; Y ) ≥ I(R1; Y ) ≥ I(R2; Y ) ≥ . . . I(Rn; Y ) ≥ I( ̃Y ; Y )
(4)
In other words, due to the DPI, the final representation be-
fore a prediction Rn cannot have more mutual information
with the target than the input X and typically has less. In
particular, for discriminative models for high-level vision
tasks that map a high dimensional input vector with strong
pixel correlations to a small set of labels, we can expect
I(X; Y ) ≫ I( ̃Rn, Y ).
4.2 From Deep to Shallow Bottlenecks
When the task is to predict the ground-truth labels Y from a
joint distribution PX,Y , the rate-distortion objective is essen-
tially given by the information bottleneck principle [10]. By
relaxing the (1) with a lagrangian multiplier, the objective is
to maximize:
I(Z; Y ) − βI(Z; X)
(5)
Specifically, an encoding Z should be a minimal sufficient
statistic of X respective Y , i.e., we want Z to contain rel-
evant information regarding Y while discarding irrelevant
information from X. Practical implementations differ by the
target task and how they approximate (5). For example, an
approximation of I(Z; Y ) for an arbitrary classification task
the conditional cross entropy (CE) [11]:
D = H(PY , P ̃Y |Z)
(6)
Unsurprisingly, using (6) for estimating the distortion mea-
sure in (5) for end-to-end optimization of a neural compres-
sion model is not a novel idea (Section 2.1.2). However, a
common assumption in such work is that the latent variable
is the final representation Rn before performing the predic-
tion, i.e., the encoder must consist of an entire backbone
model which we refer to as Deep Variational Information Bot-
tleneck Injection (DVBI). Conversely, we work with resource-
constrained clients, i.e., to conceive lightweight encoders,
we must shift the bottleneck to the shallow layers, which
we refer to as Shallow Variational Bottleneck Injection (SVBI).
Intuitively, the existing methods for DVBI should generalize
to SVBI should, e.g., approximating the distortion term with
(6) as in [18]. Although by shifting the bottleneck to the
shallow layers, the encoder has less capacity for finding a
minimal sufficient representation, the objective is still an
approximation of (1). Yet, as we will show in Section 6.3.7,
applying the objective from [18] will result in incomparably
worse results for shallow bottlenecks.
In the following, elaborate on Head Distillation (HD)
[30], [31] that poses an objective that is a suboptimal
approximation of (1), but surprisingly yields significantly
better results. Moreover, we bridge the gap between deep
and shallow bottleneck injection by formulating the VIB
objective for HD.
4.3 Head Distilled Deep Variational IB
Ideally, the bottleneck is embeddable in an existing predictor
PT without decreasing the performance. Therefore, it is not
the hard labels Y that define the task but the soft labels YT .
For simplicity, we handle the case for one task and defer
how SVBI naturally generalizes to multiple downstream
tasks and DNNs to Section 6.3.5.
To perform SVBI, take a copy of PT . Then, mark the
location of the bottleneck by separating the copy into a head
Ph and a tail Pt. Importantly, both parts are deterministic,
i.e., for every realization of r.v. X there is a representation
Ph(x) = h such that PT (x) = Ph(Pt(x)). Lastly, replace the
head with an autoencoder and a parametric entropy model.
The encoder is deployed at the sender, the decoder at the
receiver, and the entropy model is shared.
We distinguish between two optimization strategies to
train the bottleneck's compression model. First, is direct
optimization corresponding to the DVIB objective in (5),
except we replace the CE with the standard KD loss [44]
to approximate I(Z; Y ). Second is indirect optimization and
describes HD with the objective:
I(Z; H) − β I(Z; X)
(7)
Unlike the former, the latter does not directly correspond
to (1) for a representation Z that is a minimal sufficient
statistic of X respective YT . Instead, it replaces Y with a
proxy task for the compression model to replicate the output
of the replaced head, i.e., training methods approximating
(7) optimize for a Z that is a minimal sufficient statistic
of X respective H. Figure 6 illustrates the difference be-
tween estimating the objectives (5) and (7). Intuitively, with
faithful replication of H, the partially modified DNN has
an information path equivalent to its unmodified version.
A sufficient statistic retains the information necessary to
replicate the input for a deterministic tail, i.e., the final
prediction does not change. The problem of (7) is that it
is a suboptimal approximation of (1). Although sufficiency
holds, it does not optimize Z respective YT . The marginal
distribution of YT now arises from the r.v. X and the
parameters of PT . Moreover, since maximizing I(Z; H) is
only a proxy objective for I(Z; YT ), it corresponds to the
Markov chain YT ↔ H ↔ X ↔ Z. Notice how X is
now conditional independent of YT . Consequently, when
training a compression model with (7), we skew the rate-
distortion optimization towards a higher rate than necessary
by setting the lower bound for the distortion estimation too
high.
Fig. 6: Bottom: direct optimization. Top: Head Distillation
5 SOLUTION APPROACH
We embed a stochastic compression model that we jointly
optimize with an entropy model. Categorically, we follow
7
NTC [14] to implement a neural compression algorithm. For
an image vector x, we have a parametric analysis transform
ga(x; φg) maps x to a latent vector z. Then, a quantizer Q
discretizes z to ̄z, such that an entropy coder can use the
entropy model to losslessly compress ̄z to a sequence of bits.
It may seem redundant to have a synthesis transform.
Instead, we could directly feed the encoder output to the
tail of a backbone model. However, this locks the encoder to
only a single backbone and disregards the server resources.
Thus, we start diverging from NTC for image compression.
As shown in Figure 7, rather than an approximate inverse
of the analysis, the parametric synthesis transforms gs( ̄z; θg)
maps ̄z to a representation ̃h that is suitable for various tail
predictors and downstream tasks.
Fig. 7: Diagram of Model Components
5.1 Loss Function for End-to-end Optimization
Our objective resembles variational image compression op-
timization, as introduced in [15], [16]. Further, we favor
HD over direct optimization as a distortion measure, as
the former yields considerably better results even with a
suboptimal loss function (Section 6.3.7).
Analogous to variational inference, we approximate the
intractable posterior p( ̃z|x) with a parametric variational
density q( ̃z|x) as follows (excluding constants):
Ex∼pxDKL
(cid:2)q∥p ̃z|x
(cid:3) = Ex∼px
weighted rate
(cid:122) (cid:125)(cid:124) (cid:123)
log p( ̃z) ]
−
E ̃z∼q[−log p(x| ̃z)
(cid:125)
(cid:124)
(cid:123)(cid:122)
distortion
(8)
By assuming a gaussian distribution such that the likelihood
of the distortion term is given by
Px| ̃z(x | ̃z, θg) = N (x | gs( ̃z; θg), 1)
(9)
we can use the square sum of differences between h and ̃h
as our distortion loss.
The rate term describes the cost of compressing ̃z. Anal-
ogous to the LIC methods discussed in Section 2.1, we apply
uniform quantization ̄z = ⌊ ̃z⌉. Since discretization leads to
problems with the gradient flow, we apply a continuous
relaxation by adding uniform noise η
2 ).
Combining the rate and distortion term, we derive the loss
function for approximating objective (7) as
L = ∥Ph(x) - (gs(ga(x; φg) + η; θg)∥2
U(− 1
2 , 1
∼
2 + β log(ga(x; θg) + η)
(10)
Backbone(Tail)Embedded Model(Student)Teacher (Head)2.5915.430.058.36....8.321.150.463.84....0.030.620.110.07....0.190.430.010.26....FrozenTrainableOptional TrainableECEDChannelNote, in the relaxed lagrangian of (1), the weight is on the
distortion while we weight the rate term to align closer to
the variational information bottleneck objective. Moreover,
omitting the second term (β = 0) and the entropy model
would result in the head distillation objective for determin-
istic bottleneck injection.
We will show that the loss function (10) can yield strong
results, despite corresponding to the objective in (7), i.e.,
it is only a suboptimal approximation of (1) using H as a
proxy target. In the previous subsection, we established that
as the remaining layers further process a representation h,
its information content decreases monotonously. Intuitively,
the shallow layers extract high-level features, while deeper
layers are more focused. Hence, the suboptimality stems
from treating every pixel of H equally crucial to the re-
maining layer. The implication here is that the MSE in (10)
overly strictly penalizes pixels at spatial locations which
contain redundant information that later layers can safely
discard. Contrarily, the loss may not penalize the salient
pixels enough when ̃h is numerically close to h.
5.2 Saliency Guided Distortion
We can improve the loss in (10) by introducing additional
signals that regularize the distortion term. The challenge
is finding a tractable method that emphasizes the salient
pixels necessary for multiple instances of a high-level vision
task (e.g., classification on various datasets and labels).
Moreover, the methods' overhead should only impact train
time, i.e., it should not introduce any additional model
components or operations during inference.
HD is an extreme form of Hint Training (HT) [45], [46]
where the hint becomes the primary objective rather than
an auxiliary regularization term. Sbai et al. perform deter-
ministic bottleneck injection with HD using the suboptimal
distortion term [31]. Nevertheless, their method only con-
siders crude dimensionality reduction without a parametric
entropy model as an approximation to compression, i.e., it
is generalized by the loss in (1)(β = 0). Matsubara et al.
add further hints from the deeper layers by extending the
distortion term with the sum of squared between the deeper
layers [21], [30]:
This approach has several downsides besides prolonged
train time. In particular, even if (10) could approximate the
objective in (1), the distortion term may now dominate the
rate term, i.e., without exhaustively tuning the hyperparam-
eters for each distortion term, the optimization algorithm
should favor converging towards local optima. We show in
Section 6.3.2 that pure HD can significantly outperform this
method using the loss in Equation (1) without the hints from
the deeper layers.
Ideally, we could improve the performance with signals
from deeper layers near the bottleneck. The caveat is that the
effectiveness of knowledge distillation decreases for teach-
ers when the student has considerably less capacity than the
teacher [45]. Hence, we should not directly introduce hints
at the encoder. Instead, we regularize the distortion term
with class activation mapping (CAM) [47].
Although CAMs are typically used to improve the ex-
plainability of DNNs, we use a variant of Grad-CAM [48]
for generating saliency maps to measure a spatial location's
importance at any stage. Figure 8 illustrates some examples
of saliency maps when averaged over the deeper backbone
stages. Specifically, for each sample, we can derive a vector
8
Fig. 8: Extracted Saliency Maps using Grad-CAM
S, where each si ∈ S is a weight term for a spatial location
salient about the conditional probability distributions of the
remaining tail layers. Then, we should be able to improve
the rate-distortion performance by regularizing the distor-
tion term in (10) with
Ldistortion = γ1 * L1 + γ2 * si *
1
N
(cid:88)
(hi − ̃hi)2
(11)
i
Where L1 is the distortiont term from Equation (10), and
γ1, γ2 are nonnegative real numbers summing to 1. We
default to γ1 = γ2 = 1
2 in our experiments.
Figure 9 describes our final training setup. Note that we
only require computing the CAM maps once, and they are
architecturally agnostic towards the encoder, i.e., we can re-
use them to train various compression models.
Fig. 9: Training Setup
5.3 Network Architecture
The beginning of this section broke down our aim into three
problems. We addressed the first with SVBI and proposed
a novel training method for low-capacity models. To not
inflate the significance of our contribution, we refrain from
including efficient neural network components based on
existing work in efficient neural network design. A gen-
eralizable resource-asymmetry-aware autoencoder design
remains; components should be reusable and attachable to
at least directly related network architectures once trained.
TeacherStageStageExtracted Saliency MapsLoad Saliency MapGuided DistortionRate EstimationCompressorHeadStage5.3.1 Model Taxonomy
We introduce a minimal taxonomy described in Figure 10
for our approach. The top-level, Archtype, describes the pri-
mary inductive bias of the model. Architectural families de-
scribe variants (e.g., ResNets such as ResNet, Wide ResNet,
ResNeXt [49], etc.). Lastly, directly related refers to the same
architecture of different sizes (e.g., Swin-T, Swin-S, Swin-B,
etc.). The challenge is to conceive a design heuristic that can
Fig. 10: Simple Taxonomy with Minimal Example
exploit the available server resources to aid the lightweight
encoder with minimal overhead on the prediction task. We
assume that, after training an embedded compression model
with one particular backbone as described in Section 5.1,
it is possible to reuse the encoder or decoder for different
backbones with little effort based on the following two
observations.
5.3.2 Bottleneck Location by Stage Depth
First is how most modern DNNs consist of an initial em-
bedding followed by a few stages (Described in Section 3.1).
Within directly related architectures, the individual com-
ponents are identical. The difference between variants is
primarily the embed dimensions or the block ratio of the
deepest stages. For example, the block ratio of ResNet-50
is 3:4:6:3, while the block ratio of ResNet-101 is 3:4:23:3.
Therefore, the stage-wise organization of models defines a
natural interface for SVBi. For the remainder of this work,
we define the shallow layers as all the layers before the stage
with the most blocks.
5.3.3 Decoder Blueprint by Inductive Bias
This second observation is how archetypes introduce dif-
ferent inductive biases (e.g., convolutions versus atten-
tion modules with sliding windows), leading to diverging
representations among non-related architectures. Thus, we
should not disregard architecture-induced bias by directly
repurposing neural compression models for SC.
For example, a scaled-down version of Ball ́e et al.'s [15]
convolutional neural compression model can yield strong
rate-distortion performance for bottlenecks reconstructing a
convolutional layer [20] of a discriminative model. How-
ever, we will show that this does not generalize to other
architectural families, such as hierarchical vision transform-
ers [50].
9
the homogeneity of server hardware, it is inadequate for
encoders due to the heterogeneity of edge devices. Ven-
dors have varying support for the basic building blocks
of a DNN, and particular operations may be prohibitively
expensive for the client.
Consequently, regardless of the decoder architecture,
we account for the heterogeneity with a universal encoder
composed of three downsampling residual blocks of two
stacked 3×3 convolutions, totaling around 140k parameters.
Since the mutual information between the original input
and shallow layers is still high, it should be possible to add
a decoder that maps the representation of the encoder to
one suitable for different architectures based on invariance
towards invertible transformations of mutual information.
Specifically, for invertible functions φ, ψ, it holds that:
I(X; Y ) = I(φ(X); ψ(Y ))
(12)
Specifically, we introduce decoder blueprints for directly re-
lated architectures. Blueprints use the same components
as target backbones, with some further considerations we
describe in the following.
5.3.4 Resource-Asymmetry Aware Network Design
The number of parameters for conventional autoencoders
is typically comparable between the encoder and decoder.
Increasing the decoder parameters does not change the
inability to recover lost signals (Section 4.1), i.e., it does
not offset the limited encoder capacity for accurately dis-
tinguishing between valuable and redundant information.
Nevertheless, when optimizing the entire compression
pipeline simultaneously, the training algorithm should con-
sider the decoder's restoration ability, which in turn should
help the encoder parameters converge towards finding a
minimal sufficient statistic respective to the task. Hence,
Inspired by [51], we partially treat decoding as an image
restoration problem and add restoration blocks with optional
upsampling (e.g., deconvolutions or PixelShuffle [52]) be-
tween backbone-specific transformation blocks. In other
words, our decoder is a restoration model we jointly train
with the encoder, such that the optimization process is
informed on how faint the bottleneck's output signal can
be to remain recoverable. The decoder size can be as large
as the pruned layers, i.e., our method does not reduce
computational time on the server. To summarize, our net-
work architecture is a general design heuristic, i.e., the
individual components are interchangeable with the current
state-of-the-art building blocks for vision models. Figure 11
illustrates one of the reference implementations we will use
for our evaluation in Section 6. The number in parenthe-
ses represents stage depth. We include implementations of
other reference blueprints in the accompanying repository
with descriptive configurations. Multiple downstream tasks
are supported by attaching different predictors on the pre-
trained backbones from foundational models.
6 EVALUATION
6.1 Training & Implementation Details
One potential solution is to use identical components
for the compression model from a target network. While
this approach may be inconsequential for decoders, given
We optimize our compression models initially on the 1.28
million ImageNet [38] training samples for 15 epochs, as
described in section 5.1 and section 5.2, with some slight
CNNsVision TransformersVision ModelsArchtypeArchitecturalFamilyDirectlyRelatedResNetsHierarchical VisionTransformersResNet50/101/152Swin-T/S/B/LConvNeXtConvNeXtsConvNeXt-S/B/L10
Namely, (i) ResNet [59] for classic residual CNNs. (ii) Swin
Transformer [50] for hierarchical vision transformers, which
are receiving increasing adaptation for a wide variety of vi-
sion tasks. (iii) ConvNeXt [60] for modernized state-of-the-
art CNNs. Table 2 summarizes the relevant characteristics of
the unmodified backbones subject to our experiments.
TABLE 2: Overview of Backbone Performance on Server
Backbone
Ratios
Params
Inference
(ms)
Top-1 Acc.
(%)
Swin-T
Swin-S
Swin-B
ConvNeXt-T
ConvNeXt-S
ConvNeXt-B
ResNet-50
ResNet-101
ResNet-152
2:2:6:2
2:2:18:2
2:2:30:2
3:3:9:3
3:3:27:3
3:3:27:3
3:4:6:3
3:4:23:3
3:8:36:3
28.33M
49.74M
71.13M
28.59M
50.22M
88.59M
25.56M
44.55M
60.19M
4.77
8.95
13.14
5.12
5.65
6.09
5.17
10.17
15.18
81.93
83.46
83.88
82.70
83.71
84.43
80.10
81.91
82.54
6.2.1 Baselines
Since our work aligns closest to learned image compression,
we extensively compare FrankenSplit with learned and
handcrafted codecs applied to the input images, i.e., the
input to the backbone is the distorted output. Comparing
task-specific methods to general-purpose image compres-
sion methods may seem unfair. However, FrankenSplit's
universal encoder has up to 260x less trainable parameters
and further reduces overhead by not including side infor-
mation or a sequential context model.
The naming convention for the learned baselines is the
first author's name, followed by the entropy model. Specif-
ically, we choose the work by Balle et al. [15], [16] and
Minnen et al. [17] for LIC methods since they represent
foundational milestones. Complementary, we include the
work by Cheng et al. [61] to demonstrate improvements
with architectural enhancement.
As the representative for disregarding autoencoder size
to achieve state-of-the-art r-d performance in LIC, we chose
the work by Chen et al. [62] Their method differs from other
LIC baselines by using a partially parallelizable context
model, which trades off compression rate with execution
time according to the configurable block size. However, due
to the large autoencoder, we found evaluating the inference
time on constrained devices impractical when the context
model is purely sequential and set the block size to 64x64.
Additionally, we include the work by Lu et al. [63] as a
milestone of the recent effort on efficient LIC with reduced
autoencoders but only for latency-related experiments since
we do not have access to the trained weights.
As a baseline for the state-of-the-art SC, we include the
Entropic Student (ES) [20], [21]. Crucially, the ES demon-
strates the performance of directly applying a minimally
adjusted LIC method for feature compression without con-
sidering the intrinsic properties of the problem domain
we have derived in Section 4.1. One caveat is that we
intend to show how FrankenSplit generalizes beyond CNN
backbones, despite the encoder's simplistic CNN architec-
ture. Although Matsubara et al. evaluate the ES on a wide
Fig. 11: Reference Implementation with Swin backbones
practical modifications for stable training. We use Adam
optimization [53] with a batch size of 16 and start with an
initial learning rate of 1 * 10−3, then gradually lower it to
1 × 10−6 with an exponential scheduler.
We aim to minimize bitrate without sacrificing predictive
strength. Hence, we first seek the lowest β resulting in
lossless prediction.
To implement our method, we use PyTorch [54], Com-
pressAI [55] for entropy estimation and entropy coding,
and pre-trained backbones from PyTorch Image Models [56].
All baseline implementations and weights were either taken
from CompressAI or the official repository of a baseline. To
compute the saliency maps, we use a modified XGradCAM
method from the library in [57] and include necessary
patches in our repository. Lastly, to ensure reproducibility,
we use torchdistill [58].
6.2 Experiment Setting
The experiments reflect the deployment strategies illus-
trated in Figure 5 and Figure 4. Ultimately, we must eval-
uate whether FrankenSplit enables latency-sensitive and
performance-critical applications. Regardless of the particu-
lar task, a mobile edge client requires access to a DNN with
high predictive strength on a server. Therefore, we must
show whether FrankenSplit adequately solves two problems
associated with offloading high-dimensional
image data
for real-time inference tasks. First, whether it considerably
reduces the bandwidth consumption compared to existing
methods without sacrificing predictive strength. Second,
whether it improves inference times over various communi-
cation channels, i.e., it must remain competitive even when
stronger connections are available.
Lastly, FrankenSplit should still be applicable as newer
DNN architectures emerge, i.e., the evaluation should assess
whether our method generalizes to arbitrary backbones.
However, since it is infeasible to perform exhaustive experi-
ments on all existing visual models, we focus on three well-
known representatives and a subset of their variants instead.
Task FCPredictionTask FCPredictionSwin Stage (2)Swin Stage (6)PredictorsEncoder BlockEncoder BlockEncoder BlockEncoderAutoencoderDecoderPre-trained BackbonesRestoration BlockSwin Stage (3)Restoration BlockSwin Stage (1)Swin Stage (18)Swin Stage (2)Swin Stage (2)Swin Stage (6)Swin Stage (30)Swin Stage (2)Task FCPredictionSwin Stage (6)Swin Stage (2)Split Swin-TSplit Swin-SSplit Swin-BEncoder BlockConv 3x3ReLUConv 3x3ReLUPS/ConvTL ReLURestoration Blockrange of backbones, most have no lossless configurations.
However, comparing bottleneck injection methods using
different backbones is fair, as we found that the choice does
not significantly impact the rate-ddistortion performance.
Therefore, for an intuitive comparison, we choose ES with
ResNet-50 using the same factorized prior entropy model as
FrankenSplit.
We separate the experiments into two categories to as-
sess whether our proposed method addresses the above-
mentioned problems.
6.2.2 Criteria rate-distortion performance
We primarily measure the bitrate in bits per pixel (bpp)
which is sensible because it permits directly comparing
models with different input sizes. Choosing a distortion
measure to draw meaningful and honest comparisons is
challenging for feature compression. Unlike evaluating re-
construction fidelity for image compression, PSNR or MS-
SSIM does not provide intuitive results regarding predictive
strength. Similarly, adhering to the customs of SC by report-
ing absolute values, such as top-1 accuracy, gives an unfair
advantage to experiments conducted on higher capacity
backbones and veils the efficacy of a proposed method.
Consequently, we evaluate the distortion with the relative
measure predictive loss. To ensure a fair comparison, we give
the LIC and handcrafted baselines a grace threshold of 1.0%
top-1 accuracy, considering it is possible to mitigate some
predictive loss incurred by codec artifacts [64]. For example,
if a model has a predictive loss of 1.5% top-1 accuracy, we
report it as 0.5% below our definition of lossless prediction.
However, for FrankenSplit, we set the grace threshold at
0.4%, reflecting the configuration with the lowest predictive
loss of the ES. Note that the ES improves rate-distortion per-
formance by finetuning the backbone weights by applying a
secondary training stage. In contrast, we put our work at a
disadvantage by training FrankenSplit exclusively with the
methods introduced in this work.
6.2.3 Measuring latency and overhead
The second category concerns with execution times of pre-
diction pipelines with various wireless connections. To ac-
count for the resource asymmetry in MEC, we use NVIDIA
Jetson boards2
the capable but resource-
constrained mobile client, and the server hosts a powerful
GPU. Table 3 summarizes the hardware we use in our
experiments.
to represent
TABLE 3: Clients and Server Hardware Configuration
Device
Server
Client (TX2)
Client (NX)
Arch
x86
arm64x8
arm64x8
CPU
16x Ryzen @ 3.4 GHz
4x Cortex @ 2 GHz
4x Cortex @ 2 GHz
GPU
RTX 3090
Vol. 48 TC
Pas. 256 CC
6.3 Rate-Distortion Performance
We measure the predictive loss by the drop in top-1 accuracy
from Table 2 using the ImageNet validation set for the stan-
dard classification task with 1000 categories. Analogously,
2. nvidia.com/en-gb/autonomous-machines/embedded-systems/
11
we measure filesizes of the entropy-coded binaries to calcu-
late the average bpp. Figure 12 shows rate-distortion curves
with the Swin-B backbone. The architecture of FrankenSplit-
FP (FS-FP) and FrankenSplit-SGFP (FS-SGFP) are identical.
We train both models with the loss functions derived in Sec-
tion 5.1. The difference is that FS-SGFP is saliency guided,
i.e., FS-FP represents the suboptimal HD training method
and is an ablation to our proposed solution.
6.3.1 Effect of Saliency Guidance
Although FS-FP performs better than almost all other mod-
els, it is trained with the suboptimal objective discussed in
Section 4.3. Empirically, this is demonstrated by FS-SGFP
outperforming FS-FP on the r-d curve. By simply guiding
the distortion loss with saliency maps, we achieve a 25%
lower bitrate at no additional cots.
Fig. 12: Rate-distortion curve for ImageNet
6.3.2 Comparison to the ES
Even without saliency guidance, FS-FP consistently outper-
forms ES by a large margin. Specifically, FS-FP and FS-
SGFP achieve 32% and 63% lower bitrates for the lossless
configuration.
We ensured that our bottleneck injection incurs compa-
rable overhead for a direct comparison to the ES. Moreover,
the ES has an advantage due to fine-tuning tail parameters
in an auxiliary training stage. Therefore, we attribute the
performance gain to the more sophisticated architectural
design decisions described in Section 5.3.
6.3.3 Comparison to Image Codecs
For almost all lossy codec baselines, Figure 12 illustrates
that FS-(SG)FP has a significantly better r-d performance.
Comparing FS-FP to Ball ́e-FP demonstrates the r-d gain
of task-specific compression over general-purpose image
compression. Although the encoder of FrankenSplit has 25x
fewer parameters, both codecs use an FP entropy model
with encoders consisting of convolutional layers. Yet, the
average file size of FS-FP with a predictive loss of around
5% is 7x less than the average file size of Ball ́e-FP with
comparable predictive loss.
FrankenSplit also beats modern general-purpose LIC
without including any of their complex or heavy-weight
mechanisms. The only baseline, FrankenSplit does not
convincingly outperform is Chen-BJHAP. Nevertheless, in-
curred overhead is as vital for real-time inference, which we
will evaluate Section 6.4.
6.3.4 Generalization to arbitrary backbones
In the previous, we intentionally demonstrated the rate-
distortion performance of FrankenSplit with a Swin back-
bone since it backs up our claim from Section 5.3 that the
synthesis transform can map the CNN encoder output to
the input of a hierarchical vision transformer. Nevertheless,
we found that the choice of backbone has a negligible impact
on the rate-distortion performance. Additionally, due to the
relative distortion measure, different backbones will not
lead to significantly different rate-distortion curves for the
baseline codecs, i.e., when we measure by predictive loss,
we get nearly identical results. Arguably, allowing operators
to reason in predictive loss is more valuable than by-model
absolute values, as it permits measuring whether and how
much performance drop clients can expect decoupled from
the backbones they use.
The insignificance of teacher choice for rate-distortion
performance is consistent with all our claims and findings.
With the objective in (7), we learn the representation of a
shallow layer, which generalizes well since such representa-
tions can retain high mutual information with the original
input.
What remains is to demonstrate the necessity of our
heuristic regarding inductive bias with decoder blueprints.
As Section 5.3 detailed, the decoder consists of interchange-
TABLE 4: Effect of Blueprints on a Backbone
Blueprint-Backbone
Swin-Swin
ConvNeXt-Swin
ResNet-Swin
File Size (kB)
8.70
5.08
3.19
19.05
15.07
10.05
22.54
18.19
8.27
Predictive Loss (%)
0.00
0.40
0.77
2.49
3.00
3.35
0.82
0.99
1.34
able restoration and transformation blocks. Irrespective of
the backbone, restoration blocks are residual pixel shuffles
or transpose convolutions. Contrarily, the transformation
block depends on the target backbone, and we argued
that the r-d performance improves when the transforma-
tion block induces the same bias as the target backbone.
Specifically, we create a synthesis transform blueprint for
each of the three architectural families (Swin, ResNet, and
ConvNeXt) that results in comparable rate-distortion per-
formance from Figure 12 for their intended variations.
For example, for any ConvNeXt backbone variation, we
train the bottleneck with the ConvNeXt synthesis blueprint.
However, as summarized in Table 4, once we attempt to
use the ResNet or ConvNeXt restoration blocks, the rate-
distortion performance for the Swin-B is significantly worse.
Most notably, the lossless configuration for Swin-Swin has
12
less than half the average file size of ConvNeXt-Swin with
2.49% predictive loss.
6.3.5 Generalization to multiple Downstream Tasks
We argue that SVBI naturally generalizes to multiple down-
stream tasks for two reasons. First, the head distillation
method optimizes our encoder to learn high-level represen-
tations, i.e., the mutual information between the bottleneck
output and the original input is still high. Additionally,
hierarchical vision models are primarily feature extractors.
Since the bottleneck learns to approximate the representa-
tion from a challenging distribution, embedding the same
compression module on backbones or predictors trained
for other tasks should be possible. We provide empirical
evidence by finetuning a predictor prepared on ImageNet
for different datasets.
For FrankenSplit, we applied none or only rudimentary
augmentation to evaluate how our method handles a type
of noise it did not encounter during training. Hence, we
include the Food-101 [65] dataset since it contains noise
in high pixel intensities. Additionally, we include CIFAR-
100 [39]. Lastly, we include Flower-102 [66] datasets to
contrast more challenging tasks.
We freeze the entire compression model trained on the
ImageNet dataset and finetune the tails separately for five
epochs with no augmentation, a learning rate of 5 * 10−5
using Adam optimization. The teacher backbones achieve
an 87.73%, 88.01%, and 89.00% top-1 accuracy, respec-
tively. Figure 13 summarizes the rate-distortion perfor-
mance for each task. Our method still demonstrates clear
rate-distortion performance gains over the baselines. More
importantly, notice how FS-SGFP outperforms FS-FP on
the r-d curve for the Food-101 dataset, with a comparable
margin to the ImageNet dataset. Contrarily, on the Flower-
102 datasets, there is noticeably less performance difference
between them. Presumably, on simple datasets, the subop-
timality of HD is less significant. Considering how simpler
tasks require less model capacity, the diminishing efficacy
of our saliency-guided training method is consistent with
our claims and derivations in Section 4. The information
of the shallow layer may suffice, i.e., the less necessary the
activations of the deeper layers are, the better a minimal
sufficient statistic respective H approximates a minimal
sufficient statistic respective Y .
6.3.6 Effect of Tensor Dimensionality on R-D Performance
In Section 3.3, we argued that tensor dimensionality is not
a suitable measure to assess whether it is worthwhile to
perform some client-side execution.
To provide further evidence, we implement and train
additional instances of FrankenSplit and show results in
Figure 14 FS-SGFP(S) is the model with a small encoder
( 140'000 parameters) we have used for our previous results.
FS-SGFP(M) and FS-SGFP(L) are medium and large models
where we increased the (output) channels C = 48 to
96 and 128, respectively. Besides the number of channels,
we've trained the medium and large models using the
same configurations. On the left, we plot the rate-distortion
curves showing that increasing encode capacity naturally
results in lower bitrates without additional predictive loss.
For the plot on the right, we train further models with
13
Fig. 13: Rate-distortion curve for multiple downstream tasks
Since the representation of the last hidden layer and
the representation of the shallow layer are so far apart in
the information path, there is insufficient information to
minimize D(H; ̃H). When the joint distribution PX,Y arises
from a simple dataset, I(Y ; ̃Y ) has just enough information
to propagate down for the compression model to come
close to a sufficient statistic of Z respective Y . However,
when PX,Y arises from a challenging dataset, where the
information content of I(Y ; ̃Y ) is not enough to approxi-
mate a sufficient statistic, it performs significantly worse.
A final observation is that we should not assume feature
Fig. 14: Comparing Effects on Sizes
C = {48, 64, 96, 108, 120, 128} using the configuration re-
sulting in lossless prediction. Notice how increasing output
channels will result in higher dimensional latent tensors
C × 28 × 28 but inversely correlates to compressed file
size. An obvious explanation is that increasing the encoder
capacity will yield more powerful transforms for better
entropy coding and uniform quantization.
6.3.7 The Limitations of Direct Optimization for SVBI
In Section 5.1, we mentioned that direct optimization does
not work for SVBI as it does for DVBI, where the bottle-
neck is at the penultimate layer. Specifically, it performs
incomparably worse than HD despite the latter's inherent
suboptimality. Contrasting the rate-distortion performance
on the simple CIFAR-10 [39] dataset summarized in the
left with the rate-distortion performance on the ImageNet
dataset on the right in Figure 15 provides empirical evi-
dence. Other than training direct optimization methods for
more epochs to account for slower convergence, all models
are identical and optimized with the setup described in
Section 6.1. On the simple task, SVBI-CE and SVBI-KD yield
moderate performance gain over JPEG. Since sufficiency is
a necessary precondition for a minimal sufficient statistic
which may explain why the objective in (5) does not yield
good results when the bottleneck is at a shallow layer, as
the mutual information I(Y ; ̃Y ) is not adequately high. This
becomes especially evident when the same method entirely
falters on the more challenging ImageNet dataset. Despite
skewing the rate-distortion objective heavily towards high
bitrates, it does not result in ̃H to be a sufficient statistic of
H.
Fig. 15: Contrasting the r-d performance
compression methods demonstrating excellent results on
simple tasks will naturally generalize, especially when not
supplemented with relative evaluation metrics.
6.4 Prediction Latency and Overhead
We exclude entropy coding from our measurement, since
not all baselines use the same entropy coder. For brevity,
the results implicitly assume the Swin-B backbone for
the remainder of this section. Inference times with other
backbones for FrankenSplit can be derived from Table 5.
Analogously, the inference times of applying LIC models
for different unmodified backbones can be derived using
Table 2. Notably, the relative overhead decreases the larger
the tail is, which is favorable since we target inference from
more accurate predictors.
6.4.1 Computational Overhead
We first disregard network conditions to get an overview of
the computational overhead of applying compression mod-
els. Table 6 summarizes the execution times of the prediction
0.00.10.20.30.40.50.60.7bits per pixel (bpp)0246810Pred. Loss [%]CIFAR-100WebPJPEGBallé-FPBallé-SHPChen-BJHAPCheng-JHAPFrankenSplit-FPFrankenSplit-SGFPMinnen-JHAPMinnen-MSHP0.00.51.01.52.0bits per pixel (bpp)0510152025Pred. Loss [%]Flower-1020.00.51.01.52.0bits per pixel (bpp)0510152025303540Pred. Loss [%]Food-1010.40.60.81.0bit per pixel (bpp)0.00.51.01.5Predictive Loss [%]Effect of Model Size on R-DFG-SGFP (L)FG-SGFP (M)FG-SGFP (S)6.06.57.0File Size (kB)400005000060000700008000090000100000Enc. Latent DimensionLatent Dimensionality0.20.30.40.50.60.70246Predictive Loss [%]bit per pixel (bpp)CIFAR-10WebPJPEGSVBI-CESVBI-KD1234 024681012ImageNetWebPJPEGSVBI-CESVBI-KDTABLE 5: Execution Times of FS (S) with Various Backbones
TABLE 7: Total Latency with Various Wireless Standards
14
Backbone
Swin-T
Swin-S
Swin-B
ConvNeXt-T
ConvNeXt-S
ConvNeXt-B
ResNet-50
ResNet-101
ResNet-152
Overhead Prams
(%)
2.51
1.41
1.00
3.46
1.97
0.90
3.50
2.01
1.48
Inf. Server+NX
(m/s)
7.83
11.99
16.12
6.83
8.50
9.70
13.16
8.13
18.86
Inf. Server+TX2
(m/s)
9.75
13.91
18.04
8.75
10.41
11.62
10.05
15.08
20.78
pipeline's components. Enc. NX/TX2 refers to the encoding
TABLE 6: Inference Pipeline Components Execution Times
Model
FrankenSplit
Ball ́e-FP
Ball ́e-SHP
Minnen-MSHP
Minnen-JHAP
Cheng-JHAP
Lu-JHAP
Chen-BJHAP
Prams
Enc./Dec.
0.14M/
2.06M
3.51M/
3.51M
8.30M/
5.90M
14.04M/
11.65M
21.99M/
19.59M
16.35M/
22.27M
5.28M/
4.37M
36.73M/
28.08M
Enc. [NX/TX2]
(ms)
2.92/
4.87
27.27/
48.93
28.16/
50.89
29.51/
52.39
4128.17/
4789.89
2167.34/
4153.95
2090.88/
5011.56
3111.01/
5837.38
Dec.
(ms)
2.00
1.30
1.51
1.52
275.18
277.26
352.85
43.16
Full [NX/TX2]
(ms)
16.34/
18.29
41.71/
63.37
42.81/
65.54
44.17/
67.05
4416.7/
5078.2
2457.7/
4444.3
2456.8/
5377.8
3167.3/
5893.6
time on the respective client device. Analogously, dec. refers
to the decoding time at the server. Lastly, Full NX/TX2 is the
total execution time of encoding at the respective client plus
decoding and the prediction task at the server. Lu-JHAP
demonstrates how LIC models without a sequential context
component are noticeably faster but are still 9.3x-9.6x slower
than FrankenSplit despite a considerably worse r-d perfor-
mance. Comparing Ball ́e-FP to Minnen-MSHP reveals that
including side information only incurs minimal overhead,
even on the constrained client. On the server, FrankenSplit's
is slightly slower than some baselines due to the attention
mechanism of the decoder blueprint for the swin backbone.
However, unlike all other baselines, the computational load
of FrankenSplit is near evenly distributed between the
client and the server, i.e., FrankenSplit's design heuristic
successfully considers resource asymmetry. The significance
of considering resource asymmetry is emphasized by how
the partially parallelized context model of Chen-BHJAP
leads to faster decoding on the server. Nevertheless, it is
slower than other JHAP baselines due to the overhead of the
increased encoder size outweighing the performance gain of
the blocked context model on constrained hardware.
6.4.2 Competing against Offloading
Unlike SC methods, we do not reduce the latency on the
server, i.e., performance gains of FrankenSplit solely stem
from reduced transfer times. The average compressed file-
size gives the transfer size from the ImageNet validation set.
Using the transfer size, we evaluate transfer time on a broad
range of standards. Since we did not include the execution
time of entropy coding for learned methods, the encoding
and decoding time for the handcrafted codecs is set to 0. The
Standard/
Data Rate
(Mbps)
codec
Transfer
(ms)
Total [TX2]
(ms)
Total [NX]
(ms)
BLE/
0.27
4G/
12.0
Wi-Fi/
54.0
5G/
66.9
FS-SGFP (0.23)
FS-SGFP (LL)
Minnen-MSHP
Chen-BJHAP
WebP
PNG
FS-SGFP (0.23)
FS-SGFP (LL)
Minnen-MSHP
Chen-BJHAP
WebP
PNG
FS-SGFP (0.23)
FS-SGFP (LL)
Minnen-MSHP
Chen-BJHAP
WebP
PNG
FS-SGFP (0.23)
FS-SGFP (LL)
Minnen-MSHP
Chen-BJHAP
WebP
PNG
142.59
209.89
348.85
40.0
865.92
2532.58
3.21
4.72
7.85
0.9
19.48
56.98
0.71
1.05
1.74
0.2
4.33
12.66
0.58
0.85
1.41
0.16
3.49
10.22
160.48
227.78
415.89
6167.79
879.06
2545.72
21.09
22.61
74.89
6128.69
32.63
70.13
18.6
18.93
68.78
6127.99
17.47
25.81
18.46
18.73
68.44
6127.95
16.64
23.36
158.53
225.83
393.01
3441.41
879.06
2545.72
19.15
20.66
52.01
3402.31
32.63
70.13
16.65
16.99
45.9
3401.61
17.47
25.81
16.51
16.78
45.56
3401.57
16.64
23.36
setting favors the baselines because both rely on entropy
coding and sequential CPU-bound transforms. Table 7 sum-
marizes how our method performs in various standards.
Due to space constraints, we only include LIC models with
the lowest request latency (Minnen-MSHP) or the lowest
compression rate (Chen-BJAHP). Still, with Table 6 and the
rate-distortion results from the previous subsection, we can
infer that the LIC baselines have considerably higher latency
than FrankenSplit.
Generally, the more constrained the network is the more
we can benefit from reducing the transfer size. In particu-
lar, FrankenSplit is up to 16x faster in highly constrained
networks, such as BLE. Conversely, offloading with fast
handcrafted codecs may be preferable in high-bandwidth
environments. Yet, FrankenSplit is significantly better than
offloading with PNG, even for 5G. Figure 16 plots the
inference latencies against handcrafted codecs using the
NX client. For stronger connections, such as 4G LTE, it is
Fig. 16: Comparing Effects on Sizes
10203040506070Data rate (Mbps)255075Total Latency (ms)FS-SGFP (LL) vs. PNG10203040506070Data rate (Mbps)255075Total Latency (ms)FS-SGFP (-0.40) vs. PNG10203040506070Data rate (Mbps)2030Total Latency (ms)FS-SGFP (LL) vs. WebP10203040506070Data rate (Mbps)2030Total Latency (ms)FS-SGFP (-0.40) vs. WebPFrankenSplit (FS)Offloading with Codecstill 3.3x faster than using PNG. Nevertheless, compared to
WebP, offloading seems more favorable when bandwidth
is high. Still, this assumes that the rates do not fluctuate
and that the network can seamlessly scale for an arbitrary
number of client connections. Moreover, kept the encoder
as simple and minimal as possible without applying any
further architectural optimizations.
7 CONCLUSION
In this work, we introduced a novel lightweight compres-
sion framework to facilitate critical MEC applications re-
lying on large DNNs. We demonstrated that a minimal-
istic implementation of our design heuristic is sufficient
to outperform numerous baselines. However, our method
still has several limitations. Notably, it assumes that the
client has an onboard accelerator. Moreover, the simplis-
tic Factorized Prior entropy model is not input adaptive,
i.e., it does not adequately discriminate between varying
inputs. Although adding side information with hypernet-
works taken from LIC trivially improves rate-distortion per-
formance, our results show that it may not be a productive
approach to directly repurpose existing image compression
methods. Hence, conceiving an efficient way to include task-
dependent side information is a promising direction.
REFERENCES
[1] A. Voulodimos, N. Doulamis, A. Doulamis, E. Protopapadakis,
et al., "Deep learning for computer vision: A brief review," Com-
putational intelligence and neuroscience, vol. 2018, 2018.
[2] D. W. Otter, J. R. Medina, and J. K. Kalita, "A survey of the
usages of deep learning for natural language processing," IEEE
transactions on neural networks and learning systems, vol. 32, no. 2,
pp. 604–624, 2020.
[3] C. Feng, P. Han, X. Zhang, B. Yang, Y. Liu, and L. Guo, "Compu-
tation offloading in mobile edge computing networks: A survey,"
Journal of Network and Computer Applications, p. 103366, 2022.
[4] T. Rausch, W. Hummer, C. Stippel, S. Vasiljevic, C. Elvezio,
S. Dustdar, and K. Kr ̈osl, "Towards a platform for smart city-
scale cognitive assistance applications," in 2021 IEEE Conference
on Virtual Reality and 3D User Interfaces Abstracts and Workshops
(VRW), pp. 330–335, 2021.
[5] R. R. Arinta and E. Andi W.R., "Natural disaster application on
big data and machine learning: A review," in 2019 4th International
Conference on Information Technology, Information Systems and Elec-
trical Engineering (ICITISEE), pp. 249–254, 2019.
[6] Q. Xin, M. Alazab, V. G. D ́ıaz, C. E. Montenegro-Marin, and R. G.
Crespo, "A deep learning architecture for power management in
smart cities," Energy Reports, vol. 8, pp. 1568–1577, 2022.
[7] U. Cisco, "Cisco annual internet report (2018–2023) white paper,"
Cisco: San Jose, CA, USA, vol. 10, no. 1, pp. 1–35, 2020.
[8] F. Romero, Q. Li, N. J. Yadwadkar, and C. Kozyrakis, "INFaaS:
Automated model-less inference serving," in 2021 USENIX An-
nual Technical Conference (USENIX ATC 21), pp. 397–411, USENIX
Association, July 2021.
[9] Y. Matsubara, M. Levorato, and F. Restuccia, "Split computing and
early exiting for deep learning applications: Survey and research
challenges," ACM Computing Surveys, vol. 55, no. 5, pp. 1–30, 2022.
[10] N. Tishby, F. C. Pereira, and W. Bialek, "The information bottleneck
method," 2000.
[11] Y. Yang, S. Mandt, and L. Theis, "An introduction to neural data
compression," 2022.
[12] G. LLC, "An image format for the web."
[13] V. Goyal, "Theoretical foundations of transform coding," IEEE
Signal Processing Magazine, vol. 18, no. 5, pp. 9–21, 2001.
[14] J. Ball ́e, P. A. Chou, D. Minnen, S. Singh, N. Johnston, E. Agusts-
son, S. J. Hwang, and G. Toderici, "Nonlinear transform coding,"
CoRR, vol. abs/2007.03034, 2020.
15
[15] J. Ball ́e, V. Laparra, and E. P. Simoncelli, "End-to-end optimized
image compression," in 5th International Conference on Learning
Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Con-
ference Track Proceedings, OpenReview.net, 2017.
[16] J. Ball ́e, D. Minnen, S. Singh, S. J. Hwang, and N. Johnston,
"Variational image compression with a scale hyperprior," 2018.
[17] D. Minnen, J. Ball ́e, and G. Toderici, "Joint autoregressive and
hierarchical priors for learned image compression," 2018.
[18] S. Singh, S. Abu-El-Haija, N. Johnston, J. Ball ́e, A. Shrivastava, and
G. Toderici, "End-to-end learning of compressible features," CoRR,
vol. abs/2007.11797, 2020.
[19] Y. Dubois, B. Bloem-Reddy, K. Ullrich, and C. J. Maddison, "Lossy
compression for lossless prediction," Advances in Neural Informa-
tion Processing Systems, vol. 34, pp. 14014–14028, 2021.
[20] Y. Matsubara, R. Yang, M. Levorato, and S. Mandt, "Sc2: Super-
vised compression for split computing," 2022.
[21] Y. Matsubara, R. Yang, M. Levorato, and S. Mandt, "Supervised
compression for resource-constrained edge computing systems,"
in Proceedings of the IEEE/CVF Winter Conference on Applications of
Computer Vision, pp. 2685–2695, 2022.
[22] Y. Kang, J. Hauswald, C. Gao, A. Rovinski, T. Mudge, J. Mars, and
L. Tang, "Neurosurgeon: Collaborative intelligence between the
cloud and mobile edge," ACM SIGARCH Computer Architecture
News, vol. 45, no. 1, pp. 615–629, 2017.
[23] H. Li, C. Hu, J. Jiang, Z. Wang, Y. Wen, and W. Zhu, "Jalad:
Joint accuracy-and latency-aware deep structure decoupling for
edge-cloud execution," in 2018 IEEE 24th international conference on
parallel and distributed systems (ICPADS), pp. 671–678, IEEE, 2018.
[24] S. Laskaridis, S. I. Venieris, M. Almeida, I. Leontiadis, and N. D.
Lane, "Spinn: synergistic progressive inference of neural networks
over device and cloud," in Proceedings of the 26th annual interna-
tional conference on mobile computing and networking, pp. 1–15, 2020.
[25] M. Almeida, S. Laskaridis, S. I. Venieris, I. Leontiadis, and N. D.
Lane, "Dyno: Dynamic onloading of deep neural networks from
cloud to device," ACM Transactions on Embedded Computing Sys-
tems, vol. 21, no. 6, pp. 1–24, 2022.
[26] H. Liu, W. Zheng, L. Li, and M. Guo, "Loadpart: Load-aware
dynamic partition of deep neural networks for edge offloading,"
in 2022 IEEE 42nd International Conference on Distributed Computing
Systems (ICDCS), pp. 481–491, 2022.
[27] A. Bakhtiarnia, N. Miloˇsevi ́c, Q. Zhang, D. Bajovi ́c, and A. Iosi-
fidis, "Dynamic split computing for efficient deep edge intelli-
gence," in ICASSP 2023 - 2023 IEEE International Conference on
Acoustics, Speech and Signal Processing (ICASSP), pp. 1–5, 2023.
[28] A. E. Eshratifar, A. Esmaili, and M. Pedram, "Bottlenet: A deep
learning architecture for intelligent mobile cloud computing ser-
vices," in 2019 IEEE/ACM International Symposium on Low Power
Electronics and Design (ISLPED), pp. 1–6, 2019.
[29] J. Shao and J. Zhang, "Bottlenet++: An end-to-end approach for
feature compression in device-edge co-inference systems," in 2020
IEEE International Conference on Communications Workshops (ICC
Workshops), pp. 1–6, 2020.
[30] Y. Matsubara, S. Baidya, D. Callegaro, M. Levorato, and S. Singh,
"Distilled split deep neural networks for edge-assisted real-time
systems," in Proceedings of the 2019 Workshop on Hot Topics in Video
Analytics and Intelligent Edges, HotEdgeVideo'19, (New York, NY,
USA), p. 21–26, Association for Computing Machinery, 2019.
[31] M. Sbai, M. R. U. Saputra, N. Trigoni, and A. Markham, "Cut, distil
and encode (cde): Split cloud-edge deep inference," in 2021 18th
Annual IEEE International Conference on Sensing, Communication,
and Networking (SECON), pp. 1–9, 2021.
[32] L. Deng, G. Li, S. Han, L. Shi, and Y. Xie, "Model compression
and hardware acceleration for neural networks: A comprehensive
survey," Proceedings of the IEEE, vol. 108, no. 4, pp. 485–532, 2020.
[33] Z. Li, F. Liu, W. Yang, S. Peng, and J. Zhou, "A survey of convo-
lutional neural networks: analysis, applications, and prospects,"
IEEE transactions on neural networks and learning systems, 2021.
[34] K. Han, Y. Wang, H. Chen, X. Chen, J. Guo, Z. Liu, Y. Tang,
A. Xiao, C. Xu, Y. Xu, et al., "A survey on vision transformer,"
IEEE transactions on pattern analysis and machine intelligence, vol. 45,
no. 1, pp. 87–110, 2022.
[35] F. Romero, Q. Li, N. J. Yadwadkar, and C. Kozyrakis, "Infaas:
Automated model-less inference serving.," in USENIX Annual
Technical Conference, pp. 397–411, 2021.
[36] K. Zhao, Z. Zhou, X. Chen, R. Zhou, X. Zhang, S. Yu, and D. Wu,
"Edgeadaptor: Online configuration adaption, model selection
16
[61] Z. Cheng, H. Sun, M. Takeuchi, and J. Katto, "Learned image
compression with discretized gaussian mixture likelihoods and
attention modules," 2020.
[62] T. Chen, H. Liu, Z. Ma, Q. Shen, X. Cao, and Y. Wang, "End-to-end
learnt image compression via non-local attention optimization and
improved context modeling," IEEE Transactions on Image Process-
ing, vol. 30, pp. 3179–3191, 2021.
[63] M. Lu, P. Guo, H. Shi, C. Cao, and Z. Ma, "Transformer-based
image compression," in 2022 Data Compression Conference (DCC),
pp. 469–469, 2022.
[64] X. Luo, H. Talebi, F. Yang, M. Elad, and P. Milanfar, "The
rate-distortion-accuracy tradeoff: Jpeg case study," arXiv preprint
arXiv:2008.00605, 2020.
[65] L. Bossard, M. Guillaumin, and L. Van Gool, "Food-101–mining
discriminative components with random forests," in Computer
Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland,
September 6-12, 2014, Proceedings, Part VI 13, pp. 446–461, Springer,
2014.
[66] M.-E. Nilsback and A. Zisserman, "Automated flower classifica-
tion over a large number of classes," in 2008 Sixth Indian Conference
on Computer Vision, Graphics & Image Processing, pp. 722–729, 2008.
and resource provisioning for edge dnn inference serving at scale,"
IEEE Transactions on Mobile Computing, pp. 1–16, 2022.
[37] S. Ioffe and C. Szegedy, "Batch normalization: Accelerating deep
network training by reducing internal covariate shift," in Interna-
tional conference on machine learning, pp. 448–456, pmlr, 2015.
[38] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma,
Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, et al., "Imagenet
large scale visual recognition challenge," International journal of
computer vision, vol. 115, no. 3, pp. 211–252, 2015.
[39] A. Krizhevsky, G. Hinton, et al., "Learning multiple layers of
features from tiny images," 2009.
[40] R. Shwartz-Ziv and N. Tishby, "Opening the black box of deep
neural networks via information," arXiv preprint arXiv:1703.00810,
2017.
[41] C. E. Shannon, "Coding theorems for a discrete source with a
fidelity criterion," in IRE National Convention Record, 1959, vol. 4,
pp. 142–163, 1959.
[42] T. Berger, "Rate distortion theory for sources with abstract alpha-
bets and memory," Information and Control, vol. 13, no. 3, pp. 254–
273, 1968.
[43] N. Tishby and N. Zaslavsky, "Deep learning and the information
bottleneck principle," in 2015 ieee information theory workshop (itw),
pp. 1–5, IEEE, 2015.
[44] G. Hinton, O. Vinyals, and J. Dean, "Distilling the knowledge in a
neural network," 2015.
[45] L. Wang and K.-J. Yoon, "Knowledge distillation and student-
teacher learning for visual intelligence: A review and new out-
looks," IEEE Transactions on Pattern Analysis and Machine Intelli-
gence, 2021.
[46] A. Romero, N. Ballas, S. E. Kahou, A. Chassang, C. Gatta, and
Y. Bengio, "Fitnets: Hints for thin deep nets," arXiv preprint
arXiv:1412.6550, 2014.
[47] B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba,
"Learning deep features for discriminative localization," in Pro-
ceedings of the IEEE conference on computer vision and pattern recogni-
tion, pp. 2921–2929, 2016.
[48] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and
D. Batra, "Grad-CAM: Visual explanations from deep networks
via gradient-based localization," International Journal of Computer
Vision, vol. 128, pp. 336–359, oct 2019.
[49] S. Xie, R. Girshick, P. Doll ́ar, Z. Tu, and K. He, "Aggregated
residual transformations for deep neural networks," in Proceedings
of the IEEE conference on computer vision and pattern recognition,
pp. 1492–1500, 2017.
[50] Z. Liu, Y. Lin, Y. Cao, H. Hu, Y. Wei, Z. Zhang, S. Lin, and B. Guo,
"Swin transformer: Hierarchical vision transformer using shifted
windows," in Proceedings of the IEEE/CVF International Conference
on Computer Vision, pp. 10012–10022, 2021.
[51] J. Liang, J. Cao, G. Sun, K. Zhang, L. Van Gool, and R. Timofte,
"Swinir: Image restoration using swin transformer," in Proceed-
ings of the IEEE/CVF International Conference on Computer Vision,
pp. 1833–1844, 2021.
[52] W. Shi, J. Caballero, F. Husz ́ar, J. Totz, A. P. Aitken, R. Bishop,
D. Rueckert, and Z. Wang, "Real-time single image and video
super-resolution using an efficient sub-pixel convolutional neural
network," in Proceedings of the IEEE conference on computer vision
and pattern recognition, pp. 1874–1883, 2016.
[53] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimiza-
tion," arXiv preprint arXiv:1412.6980, 2014.
[54] A. D. I. Pytorch, "Pytorch," 2018.
[55] J. B ́egaint, F. Racap ́e, S. Feltman, and A. Pushparaja, "Compressai:
a pytorch library and evaluation platform for end-to-end compres-
sion research," arXiv preprint arXiv:2011.03029, 2020.
[56] R.
Wightman,
"Pytorch
https://github.com/rwightman/pytorch-image-models, 2019.
[57] J. Gildenblat and contributors, "Pytorch library for cam methods."
models."
image
https://github.com/jacobgil/pytorch-grad-cam, 2021.
[58] Y. Matsubara, "torchdistill: A Modular, Configuration-Driven
Framework for Knowledge Distillation," in International Workshop
on Reproducible Research in Pattern Recognition, pp. 24–44, Springer,
2021.
[59] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for
image recognition," CoRR, vol. abs/1512.03385, 2015.
[60] Z. Liu, H. Mao, C.-Y. Wu, C. Feichtenhofer, T. Darrell, and S. Xie,
"A convnet for the 2020s," in Proceedings of the IEEE/CVF Confer-
ence on Computer Vision and Pattern Recognition, pp. 11976–11986,
2022.
|
|
http://arxiv.org/abs/2302.10679v1 | 2023-02-21T13:56:47 | 2023-02-21T13:56:47 | Evaluating the effect of data augmentation and BALD heuristics on
distillation of Semantic-KITTI dataset | Active Learning (AL) has remained relatively unexplored for LiDAR perception
tasks in autonomous driving datasets. In this study we evaluate Bayesian active
learning methods applied to the task of dataset distillation or core subset
selection (subset with near equivalent performance as full dataset). We also
study the effect of application of data augmentation (DA) within Bayesian AL
based dataset distillation. We perform these experiments on the full
Semantic-KITTI dataset. We extend our study over our existing work only on
1/4th of the same dataset. Addition of DA and BALD have a negative impact over
the labeling efficiency and thus the capacity to distill datasets. We
demonstrate key issues in designing a functional AL framework and finally
conclude with a review of challenges in real world active learning. | [
"Anh Duong",
"Alexandre Almin",
"Léo Lemarié",
"B Ravi Kiran"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10679v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10679v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CV",
"cs.LG"
] | Evaluating the effect of data augmentation and BALD
heuristics on distillation of Semantic-KITTI dataset
Ngoc Phuong Anh Duong, Alexandre Almin, L ́eo Lemari ́e and B Ravi Kiran
1
(cid:70)
3
2
0
2
b
e
F
1
2
]
V
C
.
s
c
[
1
v
9
7
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Abstract-Active Learning (AL) has remained relatively unexplored for LiDAR
perception tasks in autonomous driving datasets. In this study we evaluate
Bayesian active learning methods applied to the task of dataset distillation
or core subset selection (subset with near equivalent performance as full
dataset). We also study the effect of application of data augmentation (DA) within
Bayesian AL based dataset distillation. We perform these experiments on the full
Semantic-KITTI dataset. We extend our study over our existing work (Duong.
et al., 2022) only on 1/4th of the same dataset. Addition of DA and BALD have
a negative impact over the labeling efficiency and thus the capacity to distill
datasets. We demonstrate key issues in designing a functional AL framework
and finally conclude with a review of challenges in real world active learning.
Index Terms-Active Learning Semantic Segmentation Dataset distillation Data
augmentation
1 INTRODUCTION
Autonomous driving perception datasets in the point cloud domain
including Semantic-KITTI (Behley et al., 2019) and nuScenes
(Caesar et al., 2020) provide a large variety of driving scenarios
& lighting conditions, along with variation in the poses of on-
road obstacles. Large scale datasets are created across different
sensor sets, vehicles and sites. There are multiple challenges in
creating a functional industrial grade autonomous driving dataset
(Uric ́ar et al., 2019). During the phase of creating a dataset, these
following key steps are generally followed:
• Defining the operation design domain of operation of the
perception models. This involves parameters (but are not
limited to) such as minimum & maximum distance, speed
& illumination, classes to be recognized in the scene,
relative configurations of objects or classes w.r.t ego-
vehicle,
Fixing sensors (camera, LiDAR, RADAR, ...) suite, with
their number & parameters,
•
• Choosing target vehicles and locations over which logs
should be collected,
• Collecting logs given the ODD parameters, vehicles and
sites,
Selecting key frames and samples to annotate,
•
• Creating a labeled dataset by using human experts,
•
Incrementally improving the dataset for a given model by
using active learning strategies.
• Machine Learning, Navya .
E-mail: see [email protected]
Preprint October 2022.
These large-scale point clouds datasets have high redundancy
due to temporal and spatial correlation. Redundancy makes train-
ing Deep Neural Network (DNN) architectures costlier for very
little gain in performance. This redundancy is mainly due to
the temporal correlation between point clouds scans, the similar
urban environments and the symmetries in the driving environment
(driving in opposite directions at the same location). Hence, data
redundancy can be seen as the similarity between any pair of point
clouds resulting from geometric transformations as a consequence
of ego-vehicle movement along with changes in the environment.
Data augmentations (DA) are transformations on the input samples
that enable DNNs to learn invariances and/or equivariances to said
transformations (Anselmi et al., 2016). DA provides a natural way
to model the geometric transformations to point clouds in large-
scale datasets due to ego-motion of the vehicle.
Active Learning (AL) is an established field that aims at inter-
actively annotating unlabeled samples guided by a human expert
in the loop. With existing large datasets, AL methods could be
used to find a core-subset with equivalent performance w.r.t a full
dataset. This involves iteratively selecting subsets of the dataset
that greedily maximises model performance. As a consequence,
AL helps reduce annotation costs, while preserving high accuracy.
AL distills an existing dataset to a smaller subset, thus enabling
faster training times in production. It uses uncertainty scores
obtained from predictions of a model or an ensemble to select
informative new samples to be annotated by a human oracle.
Uncertainty-based sampling is a well-established component of
AL frameworks today (Settles, 2009).
This extended study following our paper (Duong. et al., 2022)
demonstrates results on full dataset distillation on the Semantic-
KITTI dataset. In the original study we evaluated the effect of
data augmentation on the quality of heuristic function to select
informative samples in the active learning loop. We demonstrated
for a 6000 samples train subset and 2000 samples test subset of
Semantic-KITTI, the increase in performance of label efficiency
that data augmentation methods achieved.
In the current study we have extended our previous work and
performed the dataset distillation over the complete Semantic-
KITTI dataset. Contributions include:
1) An evaluation of Bayesian AL methods on the complete
Semantic-KITTI dataset using data augmentation as well
as heuristics from BAAL libraries (Atighehchian et al.,
2019)(Atighehchian et al., 2020).
2) We compare the AL study from (Duong. et al., 2022)
that is performed on a smaller subset (1/4th) of same
dataset with the full study, and demonstrate that the
data augmentation schemes as well as BALD Bayesian
heuristic have negligible gains over a random sampler. We
point out the key issues underlying this poor performance.
3) A qualitative analysis of how labelling efficiency changes
when increasing dataset size.
4) We also perform an ablation study comparing 2 different
models: SqueezeSegV2 and SalsaNext within an AL
framework.
5) A summary of key real-world challenges in active learn-
ing over large point cloud datasets.
Like many previous studies on AL, we do not explicitly quantify
the amount of redundancy in the datasets and purely determine
the trade-off of model performance with smaller subsets w.r.t the
original dataset.
1.1 Related work
The reader can find details on the major approaches to AL in
the following articles: uncertainty-based approaches (Gal et al.,
2017), diversity-based approaches (Sener and Savarese, 2018),
and a combination of the two (Kirsch et al., 2019)(Ash et al.,
2020). Most of these studies were aimed at classification tasks.
Adapting diversity-based frameworks usually applied to a clas-
sification, such as (Sener and Savarese, 2018), (Kirsch et al.,
2019), (Ash et al., 2020), to the point cloud semantic segmentation
task is computationally costly. This is due to the dense output
tensor from DNNs with a class probability vector per pixel,
while the output for the classification task is a single class
probability vector per image. Various authors in (Kendall and
Gal, 2017)(Golestaneh and Kitani, 2020), Camvid (Brostow et al.,
2009) and Cityscapes(Cordts et al., 2016) propose uncertainty-
based methods for image and video segmentation. However, very
few AL studies are conducted for point cloud semantic segmenta-
tion. Authors (Wu et al., 2021) evaluate uncertainty and diversity-
based approaches for point cloud semantic segmentation. This
study is the closest to our current work.
Authors (Birodkar et al., 2019) demonstrate the existence of
redundancy in CIFAR-10 and ImageNet datasets, using agglom-
erative clustering in a semantic space to find redundant groups
of samples. As shown by (Chitta et al., 2019), techniques like
ensemble active learning can reduce data redundancy significantly
on image classification tasks. Authors (Beck et al., 2021) show
that diversity-based methods are more robust compared to stan-
dalone uncertainty methods against highly redundant data. Though
authors suggest that with the use of DA, there is no significant ad-
vantage of diversity over uncertainty sampling. Nevertheless, the
uncertainty was not quantified in the original studied datasets, but
were artificially added through sample duplication. This does not
represent real word correlation between sample images or point
clouds. Authors (Hong et al., 2020) uses DA techniques while
adding the consistency loss within a semi-supervised learning
setup for image classification task.
2 ACTIVE LEARNING: METHOD
2.1 Dataset, point cloud representation & DNN-Model
Although there are many datasets for image semantic segmen-
tation, few are dedicated to point clouds. The Semantic-KITTI
dataset & benchmark by authors (Behley et al., 2019) provides
more than 43000 point clouds of 22 annotated sequences, acquired
2
with a Velodyne HDL-64 LiDAR. Semantic-KITTI is by far the
most extensive dataset with sequential information. All available
annotated point clouds, from sequences 00 to 10, for a total of
23201 point clouds, are later randomly sampled, and used for our
experiments.
Among different deep learning models available, we choose
SqueezeSegV2 (Wu et al., 2018) and SalsaNext(Cortinhal et al.,
2020), spherical-projection-based semantic segmentation models.
While SqueezeSegV2 (Wu et al., 2018) performs well with a
fast inference speed compared to other architectures, thus reduces
training and uncertainty computation time, SalsaNext is more
dense and computationally expensive but shown to have better
performance. We apply spherical projection (Wu et al., 2018)
on point clouds to obtain a 2D range image as an input for
the network shown in figure 1. To simulate Monte Carlo (MC)
sampling for uncertainty estimation (Gal and Ghahramani, 2016),
a 2D Dropout layer is added right before the last convolutional
layer of SqueezeSegV2. (Wu et al., 2018) with a probability of 0.2
and turned only at test time.
Rangenet++ architectures by authors (Milioto et al., 2019)
use range image based spherical coordinate representations of
point clouds to enable the use of 2D-convolution kernels. The
relationship between range image and LiDAR coordinates is the
following:
(cid:18)u
v
2 [1 − arctan(y, x)π−1] × w
[1 − (arcsin(z × r−1) + fup) × f −1] × h
=
(cid:19)
(cid:18)
(cid:19)
,
1
f = fup + fdown, is the vertical
where (u, v) are image coordinates, (h, w) the height and width
f ov
of the desired range image,
of the sensor, and r = (cid:112)x2 + y2 + z2, range measurement of each
point. The input to the DNNs used in our study are images of
size W × H × 4, with spatial dimensions W, H determined by the
FoV and angular resolution, and 4 channels containing the x, y
coordinates of points, r range or depth to each point, i intensity or
remission value for each point.
2.2 Bayesian AL: Background
supervised learning setup, given a dataset D :=
In a
{(x1, y1), (x2, y2), . . . , (xN, yN)} ⊂ X × Y , the DNN is seen as a
high dimensional function fω : X → Y with model parameters ω.
A simple classifier maps each input x to outcomes y. A good
classifier minimizes the empirical risk l : Y × Y → R, which
is defined with the expectation Remp( f ) := PX,Y [Y (cid:54)= f (X)]. The
optimal classifier is one that minimizes the above risk. Thus, the
classifier's loss does not explicitly refer to sample-wise uncertainty
but rather to obtain a function which makes good predictions on
average. We shall use the following terminologies to describe our
AL training setup.
1)
2)
Labeled dataset D = {(xi, yi)}N
i=1 where xi ∈ W × H × 4
are range images with 4 input channels, W, H are spatial
dimensions, and yi ∈ W × H × C are one-hot encoded
ground truth with C classes. The output of the DNN
model is distinguished from the ground truth as ˆyi with
the same dimensions. The 4 channels in our case are x, y,
z coordinates and LiDAR intensity channel values.
Labeled pool L ⊂ D and an unlabeled pool U ⊂ D con-
sidered as a data with/without any ground-truth, where
at any AL-step L ∪ U = D, the subsets are disjoint and
restore the full dataset.
3
Fig. 1: Global flow of active learning on range images from point clouds using uncertainty methods.
3) Query size B, also called a budget, to fix the number of
3 EXPERIMENTAL SETUP
unlabeled samples selected for labeling
5)
4) Acquisition function, known as heuristic, providing a
score for each pixel given the output ˆyi of the DNN
model, f : RW ×H×C → RW ×H
Including the usage of MC iterations where the output of
the DNN model could provide several outputs given the
same model and input, ˆyi ∈ W ×H ×C ×T where T refers
to the number of MC iterations.
Subset model fL is the model trained on labeled subset L
6)
7) Aggregation function a : RW ×H×C×T → R+ is a function
that aggregates heuristic scores across all pixels in the
input image into a positive scalar value, which is used to
rank samples in the unlabeled pool.
Heuristic functions are transformations over the model output
probabilities p(y|x) that define uncertainty-based metrics to rank
and select informative examples from the unlabeled pool at each
AL-step. In our previous study (Duong. et al., 2022) we have
identified BALD to be a robust heuristic function (Houlsby et al.,
2011). It selects samples maximizing information gain between
the predictions from model parameters, using MC Iterations.
In this study we have evaluated the performance of AL based
sampling of a large scale LiDAR dataset Semantic-KITTI. As
in (Duong. et al., 2022) we follow a Bayesian AL loop using
MC Dropout. The heuristic computes uncertainty scores for each
pixel. To obtain the final score per range image, we use sum as
an aggregation function to combine all pixel-wise scores of an
image into a single score. At each AL step, the unlabeled pool is
ranked w.r.t the aggregated score. A new query of samples limited
to the budget size is selected from the ranked unlabeled pool. The
total number of AL steps is indirectly defined by budget size,
nAL = |D| /B
In this study we evaluated BALD (Houlsby et al., 2011)
heuristic, while applying it with and without DA applied during
training time. As mentioned in Table 1, we only use 16000
randomly chosen samples from Semantic-KITTI over the 23201
samples available. At each training step, we reset model weights
to avoid biases in the predictions, as proven by (Beck et al., 2021).
We evaluate LE mIoU as our metric on the test set of 6960
samples. For quicker training, we use early stopping based on
the stability of training mIoU over patience ∗ evaluation period
iterations.
2.3 Data augmentations on range images
3.1 Analysis of results
We apply DA directly on the range image projection. We apply
the same transformations as in our previous study (Duong. et al.,
2022), we repeat images of the data augmentation here to visually
demonstrate them, in figure 2.
2.4 AL Evaluation metrics
To evaluate the performance of our experiments we are using the
following metrics:
The figure 3, demonstrates all the trainings performed on the
full Semantic-KITTI dataset. The models SalsaNext (SN) and
SqueezeSegV2 (SSV2) were chosen to be evaluated. Both models
use rangenet based representations as mentioned earlier. The SSV2
model was trained with and without data augmentation, using
a baseline random sampler, the model was also evaluated with
BALD heuristic function. SN model was mainly evaluated in the
AL framework using data augmentation and with BALD.
The goals here have been to compare the effect of:
• The Mean Intersection over Union (mIoU) (Song et al.,
• Data augmentation on the label efficiency over a large
•
C ∑C
c=1 IoUc
2016): 1
Labeling efficiency: Authors (Beck et al., 2021) use the
labeling efficiency (LE) to compare the amount of data
needed among different sampling techniques with respect
to a baseline. In our experiments, instead of accuracy, we
use mIoU as the performance metric. Given a specific
value of mIoU, the labeling efficiency is the ratio between
the number of labeled range images, acquired by the
baseline sampling and the other sampling techniques.
LE =
nlabeled others(mIoU = a)
nlabeled baseline(mIoU = a)
(1)
dataset.
• Difference in model capacity (SN with 6.7M parameters
vs SSV2 with 1M parameters) .
• Difference in performance of random sampler vs the
BALD heuristic.
3.2 Class based learning efficiency
In this section we study the variation of ClassIoU for all classes
in the Semantic-KITTI dataset. Along with this we also study the
variation from mIoU of the fully supervised (FS) model, expressed
by:
The baseline method is usually the random heuristic.
∆cIOU[i] = cIoU[i] − mIoUFS
(2)
4
(a) Random dropout mask
(b) CoarseDropout of Albumentations library
(c) Gaussian noise applied on depth channel
(d) Gaussian noise applied on remission channel
(e) Random cyclic shift range image
Fig. 2: Before and after applying transformations on Semantic-KITTI. Each image corresponds to a sample such that inner images,
from top to bottom, are before and after applying transformations, and the error between them. a, b, c, d are directly used or customized
based on Albumentations library (Buslaev et al., 2020)
(f) Instance Cut Paste
Data related parameters
Range image resolution
1024x64
Range image resolution
1024x64
Total pool size
6000
Total pool size
16241
Test pool size
2000
Test pool size
6960
Init set size
240
Init set size
1041
Hyper parameters for each AL step
Budget
240
Budget
800
AL Hyper parameters
MC Dropout
0.2
MC Dropout
0.2
AL steps
25
AL steps
20
Aggregation
sum
Aggregation
sum
Max train iterations
Learning rate (LR)
LR decay
Weight decay
Batch size
100000
0.01
0.99
0.0001
16
Evaluation period
500
Early stopping
Metric
train mIoU
Patience
15
TABLE 1: Active learning (AL) parameter setup (first line for (Duong. et al., 2022) result).
where i is the index of the active learning loop (or the perception
of dataset). This score basically subtracts the mean performance
away from the class IoU scores to demonstrate deviations from the
mean. The objective of such a measure is to demonstrate the rate
at which each class IoU reaches its maximum contribution.
The ∆cIOU[i] score represents the deviation of the class IoU
from the model's full supervised mean performance. When this
deviation is positive and large, these represent classes that have
been learnt efficiently at the AL-Step i, while negative scores
represent classes that have been learnt poorly. This score enables
us to determine visually when each class reaches its maximum
performance and decide when any incremental addition of samples
would have little impact on the final cIoU.
Class-frequency and ClassIoU: In figure 5 we observe that
several majority classes like ROAD, TERRAIN, BUILDING and
VEGETATION do not demonstrate any large change in their IoUs
after the 6th AL step, while classes such as BICYCLE, POLE,
PERSON and OTHER VEHICLE are the slowest to learn their
maximum performance. The majority classes produce a positive
deviation from mIoU while the least frequent classes produce a
negative deviation from mIoU.
DA effect on ClassIoU: In figure 6 we plot the ∆cIoU[i] scores
to demonstrate how fast different classes are learnt over the AL
loop (different subset sizes of the full dataset). With this plot we
would like to observe the change in sample complexity for each
class with and without data augmentations using baseline random
sampling.
Model complexity on ClassIoU: We evaluate two models on
the Semantic-KITTI dataset: SSV2 model vs SalsaNext model. We
compare the performances of these models in terms of how fast
they learn different classes, see figure 7. We observe that majority
of classes have had a large jump within the first 3-4 AL steps
points, leading wrong prediction and impractical sam-
pling selection.
5
3.4 t-SNE problem analysis
t-SNE (van der Maaten and Hinton, 2008) is a technique used to
visualize high-dimensional data in low-dimensional spaces such
as 2D or 3D by minimizing Kullback-Leibler divergence between
the low-dimensional distribution and the high-dimensional distri-
bution.
To visualize whether DA is relevant for Semantic-KITTI, we
use t-SNE to reduce score images of labeled and DA (labeled)
at AL step 0 of Semantic-KITTI/4's to 2D vector and plot on
2D axes (fig 9). The samples located in regions with dense red
color are out-of-training-set-distribution candidates at AL step 0.
Visualization of the candidates is in fig 10.
In the figure 11, deep red spots show that there are a lot of
selected high-score samples concentrated in the same location.
4 CONCLUSION
Core subset extraction/dataset distillation experiments were car-
ried out on Semantic-KITTI dataset using SalsaNext and SSV2
models. The results of data augmentation and BALD heuristic
were limited and did not perform any better than a random
sampling method, the first baseline in active learning methods.
These limited improvements are an important observation for ac-
tive learning benchmarks, even though they constitute in marginal
gains, and aids further studies to focus on other ways to improve
labeling efficiency. Active learning strategies struggle with large-
scale datasets such as point clouds in the real-world scenario.
1) Data augmentation's have a strong effect on the quality of
the heuristic function. It is thus key to evaluate data aug-
mentation schemes that are dataset dependant, especially
when unlabeled pool is just a small subset of target do-
main. Inappropriate or overwhelming augmentation can
cause out-of-distribution, reducing model bias to target
domain. (Fawzi et al., 2016) propose an adaptive data
augmentation algorithm for image classification, which
looks for a small transform maximizing the loss on that
transformed sample.
2) The final aggregation score in an active learning frame-
work is a crucial choice. Aggregation is required when
working on detection or segmentation tasks, while most
AL study has been focused on classification. Here are a
few choices of aggregation functions and how they affect
the final ranking of images from which to sample:
•
Sum of all scores: select a sample having a balance
of high score and high number of elements.
• Average of all scores: select a sample having a
high score comparable to the others regardless of
the number of elements within a sample.
• Max of all scores: select a sample having the
highest element scores of all samples, targeting
noises.
• Weighted average of all scores: similar to aver-
age but focus on the given weights. The class
weights can be inverse-frequency class weights or
customized based on the use case to prioritize the
selection for certain classes.
Fig. 3: Mean IoU vs dataset size (in percentage) using random
and BALD heuristic based samplers under the effect of data
augmentation.
Fig. 4: SalsaNext & SSV2 models evaluated w.r.t the Random
sampling baseline. The plots demonstrate the label efficiency.
for the SalsaNext model, demonstrating how model capacity plays
an important role in the sample complexity of learning certain
classes.
3.3 Dataset size growth: 1/4 Semantic-KITTI vs full Semantic-
KITTI
In our previous study on Semantic-KITTI (Duong. et al., 2022)
we have evaluated the performance of AL methods while applying
data augmentation on 1/4th subset of the Semantic-KITTI dataset.
As expected, DA sampled harder samples by eliminating similar
samples learnt by invariance. That
is to say, models trained
with DA are prone to select samples different from the trained
samples and their transformations, thus reducing redundancy in
the selection.
On the other hand, although DA significantly reduce redun-
dancy in 1/4 Semantic-KITTI experiments, there is almost no
increment in the gain by DA in full Semantic-KITTI experiments.
This can be seen in figure 8 and could be mainly attributed to the
following reasons (we hypothesize):
1) Larger dataset includes larger amount of near similar or
redundant samples, but all standalone uncertainty-based
methods still encounter the problem of high-score similar
samples. Semantic-KITTI is a sequential dataset and thus
contain similar scans due to temporal correlation. Thus
random sampling breaks this redundancy, while methods
like BALD are unable to do so due to the above said rea-
sons. Potential solutions for this problem are mentioned
in future work and challenges section below.
2) The gain by DA is getting smaller as dataset size in-
creases because some augmented samples can be found
in larger dataset (when dataset is getting larger) or test
domain.
From the hypothesis, uncorrelated-to-real-world DA can
increase uncertainty in predictions of unnecessary sample
3)
6
Fig. 5: Top Left: Class IoU for SSV2 model Top Right: Deviation from mean IoU from equation 2. Bottom, the same for the SalsaNext
model.
Fig. 6: Deviation of Class IoU from mIoU for the SSV2 model: with and without data augmentation applied.
It is noted that for our proposed method, sum and average
eventually yield the same rankings because the number of
pixels for range images are constant.
3) Another key issue in industrial datasets is the filtering
or exclusion of corrupted or outlier images/point clouds
from the AL loop. (Chitta et al., 2019) show that remov-
ing top highest uncertain samples as outliers improves
model performances.
4) To avoid selection of similar high-score samples and
to reduce the sensitivity and bias of the model when
training on a small dataset, a potential strategy can be
an integration of diversity. Some hybrid methods, such
as (Sener and Savarese, 2018) (Kirsch et al., 2019) (Ash
et al., 2020) (Yuan et al., 2022), are shown to have more
competitive results comparing to standalone uncertainty-
based methods for datasets containing high rate of redun-
dancy, but their computations are often costly for large
scale point clouds datasets. Another strategy is using
temporal information to sample (Aghdam et al., 2019)
before or after uncertainty computation. Although it has
low computation cost, it cannot ensure the dissimilarity
among different samples.
5) According to authors (Chitta et al., 2019) (Pop and
6)
Fulop, 2018), MC Dropout is observed to lack of diver-
sity for uncertainty estimation. To address this problem,
(Chitta et al., 2019) (Bengar et al., 2019) use multiple
checkpoints during training epochs from different random
seeds.
Pool-based AL might not be a proper AL strategy in real-
world scenario for large scale datasets because of unlim-
ited instances streamed sequentially, but limited at any
given time. Due to memory limitation, it is impossible to
store or re-process all past instances. In this case, stream-
based methods are more pertinent by querying annotator
for each sample coming from the stream. Although this
type of query is often computationally inexpensive, the
selected samples are not as informative as the ones
selected by pool-based AL due to the lack of exploitation
underlying distribution of datasets.
7
Fig. 7: Deviation of ClassIoU from mIoU comparison: Between SSV2 and SN models.
Birodkar, V., Mobahi, H., and Bengio, S. (2019).
Semantic
redundancies in image-classification datasets: The 10don't
need.
Brostow, G. J., Fauqueur, J., and Cipolla, R. (2009). Semantic ob-
ject classes in video: A high-definition ground truth database.
Pattern Recognit. Lett., 30:88–97.
Buslaev, A., Iglovikov, V. I., Khvedchenya, E., Parinov, A.,
Druzhinin, M., and Kalinin, A. A. (2020). Albumentations:
Fast and flexible image augmentations. Information, 11(2).
Caesar, H., Bankiti, V., Lang, A. H., Vora, S., Liong, V. E., Xu, Q.,
Krishnan, A., Pan, Y., Baldan, G., and Beijbom, O. (2020).
nuscenes: A multimodal dataset for autonomous driving.
Chitta, K., Alvarez, J. M., Haussmann, E., and Farabet, C. (2019).
Training data subset search with ensemble active learning.
arXiv preprint arXiv:1905.12737.
Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M.,
Benenson, R., Franke, U., Roth, S., and Schiele, B. (2016).
The cityscapes dataset for semantic urban scene understand-
ing.
Cortinhal, T., Tzelepis, G., and Aksoy, E. E. (2020). Salsanext:
Fast, uncertainty-aware semantic segmentation of lidar point
clouds for autonomous driving.
Duong., A., Almin., A., Lemari ́e., L., and Kiran., B. (2022). Lidar
dataset distillation within bayesian active learning framework
understanding the effect of data augmentation. In Proceed-
ings of the 17th International Joint Conference on Computer
Vision, Imaging and Computer Graphics Theory and Ap-
plications - Volume 4: VISAPP,, pages 159–167. INSTICC,
SciTePress.
Fawzi, A., Samulowitz, H., Turaga, D., and Frossard, P. (2016).
Adaptive data augmentation for image classification. In 2016
IEEE International Conference on Image Processing (ICIP),
pages 3688–3692.
Gal, Y. and Ghahramani, Z. (2016). Dropout as a bayesian approx-
imation: Representing model uncertainty in deep learning.
Gal, Y., Islam, R., and Ghahramani, Z. (2017). Deep bayesian
active learning with image data.
Golestaneh, S. A. and Kitani, K. M. (2020). Importance of self-
consistency in active learning for semantic segmentation.
Hong, S., Ha, H., Kim, J., and Choi, M.-K. (2020). Deep active
learning with augmentation-based consistency estimation.
arXiv preprint arXiv:2011.02666.
Houlsby, N., Husz ́ar, F., Ghahramani, Z., and Lengyel, M. (2011).
Bayesian active learning for classification and preference
learning.
Kendall, A. and Gal, Y. (2017). What uncertainties do we need in
bayesian deep learning for computer vision?
Fig. 8: Comparison of the BALD performance. Left: AL training
on Semantic-KITTI subset 1/4 from (Duong. et al., 2022), Right:
AL training on Semantic-KITTI full dataset from this study.
We observe that the two LE are poor in the initial steps, with
subsequent increases in the future AL steps.
Acknowledgements This work was granted access to HPC
resources of [TGCC/CINES/IDRIS] under the allocation 2021-
[AD011012836] made by GENCI (Grand Equipement National de
Calcul Intensif). It is also part of the Deep Learning Segmentation
(DLS) project financed by ADEME.
REFERENCES
Aghdam, H. H., Gonzalez-Garcia, A., van de Weijer, J., and
L ́opez, A. M. (2019). Active learning for deep detection
neural networks.
Anselmi, F., Rosasco, L., and Poggio, T. (2016). On invariance
Information and
and selectivity in representation learning.
Inference: A Journal of the IMA, 5(2):134–158.
Ash, J. T., Zhang, C., Krishnamurthy, A., Langford, J., and
Agarwal, A. (2020). Deep batch active learning by diverse,
uncertain gradient lower bounds.
Atighehchian, P., Branchaud-Charron, F., Freyberg, J., Pardinas,
R., and Schell, L. (2019). Baal, a bayesian active learning
library. https://github.com/ElementAI/baal/.
Atighehchian, P., Branchaud-Charron, F., and Lacoste, A. (2020).
Bayesian active learning for production, a systematic study
and a reusable library.
Beck, N., Sivasubramanian, D., Dani, A., Ramakrishnan, G., and
Iyer, R. (2021). Effective evaluation of deep active learning
on image classification tasks.
Behley, J., Garbade, M., Milioto, A., Quenzel, J., Behnke, S.,
Stachniss, C., and Gall, J. (2019). Semantickitti: A dataset
for semantic scene understanding of lidar sequences.
Bengar, J. Z., Gonzalez-Garcia, A., Villalonga, G., Raducanu, B.,
Aghdam, H. H., Mozerov, M., Lopez, A. M., and van de
Weijer, J. (2019). Temporal coherence for active learning in
videos.
8
Fig. 9: Left image is a t-SNE visualization of labeled and DA(labeled) at step 0. Right image is t-SNE visualization of DA(labeled)
clustering region by K-means
Kirsch, A., van Amersfoort, J., and Gal, Y. (2019). Batchbald:
Efficient and diverse batch acquisition for deep bayesian
active learning.
Milioto, A., Vizzo, I., Behley, J., and Stachniss, C. (2019).
Rangenet++: Fast and accurate lidar semantic segmentation.
In 2019 IEEE/RSJ International Conference on Intelligent
Robots and Systems (IROS), pages 4213–4220. IEEE.
Pop, R. and Fulop, P. (2018). Deep ensemble bayesian active
learning : Addressing the mode collapse issue in monte carlo
dropout via ensembles.
Sener, O. and Savarese, S. (2018). Active learning for convolu-
tional neural networks: A core-set approach.
Settles, B. (2009). Active learning literature survey.
Song, S., Yu, F., Zeng, A., Chang, A. X., Savva, M., and
Funkhouser, T. (2016). Semantic scene completion from a
single depth image.
Uric ́ar, M., Hurych, D., Krizek, P., and Yogamani, S. (2019). Chal-
lenges in designing datasets and validation for autonomous
driving. arXiv preprint arXiv:1901.09270.
van der Maaten, L. and Hinton, G. (2008). Viualizing data using
t-sne. Journal of Machine Learning Research, 9:2579–2605.
Wu, B., Zhou, X., Zhao, S., Yue, X., and Keutzer, K. (2018).
Squeezesegv2: Improved model structure and unsupervised
domain adaptation for road-object segmentation from a lidar
point cloud.
Wu, T.-H., Liu, Y.-C., Huang, Y.-K., Lee, H.-Y., Su, H.-T.,
Huang, P.-C., and Hsu, W. H. (2021). Redal: Region-based
and diversity-aware active learning for point cloud semantic
segmentation.
Yuan, S., Sun, X., Kim, H., Yu, S., and Tomasi, C. (2022). Optical
flow training under limited label budget via active learning.
9
Fig. 10: Visualization of samples deviating from dataset distribution.
10
Fig. 11: Left image is a t-SNE visualization of unlabeled pool at step 0, whose colors are corresponding to heuristic scores. Right image
is the t-SNE visualization of selected samples and unlabeled pool.
|
|
http://arxiv.org/abs/2302.10672v1 | 2023-02-21T13:44:13 | 2023-02-21T13:44:13 | Importance of methodological choices in data manipulation for validating
epileptic seizure detection models | Epilepsy is a chronic neurological disorder that affects a significant
portion of the human population and imposes serious risks in the daily life of
patients. Despite advances in machine learning and IoT, small, nonstigmatizing
wearable devices for continuous monitoring and detection in outpatient
environments are not yet available. Part of the reason is the complexity of
epilepsy itself, including highly imbalanced data, multimodal nature, and very
subject-specific signatures. However, another problem is the heterogeneity of
methodological approaches in research, leading to slower progress, difficulty
comparing results, and low reproducibility. Therefore, this article identifies
a wide range of methodological decisions that must be made and reported when
training and evaluating the performance of epilepsy detection systems. We
characterize the influence of individual choices using a typical ensemble
random-forest model and the publicly available CHB-MIT database, providing a
broader picture of each decision and giving good-practice recommendations,
based on our experience, where possible. | [
"Una Pale",
"Tomas Teijeiro",
"David Atienza"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10672v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10672v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | Importance of methodological choices in data manipulation for
validating epileptic seizure detection models
Una Pale∗, Tomas Teijeiro∗†, David Atienza∗
∗Embedded Systems Laboratory (ESL), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland
† BCAM - Basque Center for Applied Mathematics, Spain
{una.pale, david.atienza}@epfl.ch, [email protected]
3
2
0
2
b
e
F
1
2
]
G
L
.
s
c
[
1
v
2
7
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Abstract-Epilepsy is a chronic neurological disorder that
affects a significant portion of the human population and
imposes serious risks in the daily life of patients. Despite
advances in machine learning and IoT, small, nonstigmatizing
wearable devices for continuous monitoring and detection in
outpatient environments are not yet available. Part of the
reason is the complexity of epilepsy itself, including highly
imbalanced data, multimodal nature, and very subject-specific
signatures. However, another problem is the heterogeneity
of methodological approaches in research, leading to slower
progress, difficulty comparing results, and low reproducibility.
Therefore, this article identifies a wide range of methodological
decisions that must be made and reported when training and
evaluating the performance of epilepsy detection systems. We
characterize the influence of individual choices using a typical
ensemble random-forest model and the publicly available CHB-
MIT database, providing a broader picture of each decision
and giving good-practice recommendations, based on our ex-
perience, where possible.
Index Terms-Methodological
learning,
seizure detection, epilepsy, data selection, cross-validation ap-
proaches, performance metrics, reproducibility, comparability
choices, machine
1. Introduction
In recent years, advances in signal processing, machine
learning algorithms, the Internet of Things (IoT), and wear-
able devices have enabled a variety of continuous monitoring
applications in many domains, particularly health monitoring.
One such example is epilepsy detection, with the ultimate
goal of having small, non-stigmatizing, wearable devices
for long-term epilepsy monitoring in patients' homes and
everyday life, rather than limited to in-hospital monitoring.
Epilepsy is a chronic neurological disorder characterized
by the unexpected occurrence of seizures, imposing serious
health risks and many restrictions on daily life. It affects a
significant portion of the world's population (0.6 to 0.8%) [1],
of which one third of patients still suffer from seizures despite
pharmacological treatments [2]. Thus, there is a clear need
for solutions that allow continuous unobstructed monitoring
and reliable detection (and ideally prediction) of seizures [3],
This work has been partially supported by the ML-Edge Swiss National
Science Foundation (NSF) Research project (GA No. 200020182009/1), and
the PEDESITE Swiss NSF Sinergia project (GA No. SCRSII5 193813/1).
T. Teijeiro is supported by the grant RYC2021-032853-I funded by
MCIN/AEI/ 10.13039/501100011033 and by the "European Union NextGen-
erationEU/PRTR"
[4]. Furthermore, these solutions will be instrumental in the
design of new treatments, assisting patients in their daily
lives, and preventing possible accidents. This need is also
evident in the growing number of publications on seizure
detection methods [5], [6] and wearable devices [7], [8].
However, although many studies report impressive lev-
els of accuracy via machine learning (ML) methods, the
widespread adoption of commercial technology has not yet
occurred. The reasons for this are many and include the
specificities of epilepsy itself. For example, to properly
characterize epileptic seizures, recordings must be continuous,
often lasting days and leading to extremely unbalanced
datasets. This imbalance must be taken into account when
preparing the data set, splitting it into training and testing,
training epilepsy detection models, and reporting final perfor-
mance values. Another challenge is the fact that epilepsy is
a holistic phenomenon affecting many signal modalities, and
thus, to get a full picture, multimodal data are needed from
several different sensors. How to efficiently process all this
data and fuse information and predictions remains an open
research topic [9]. Finally, seizures show highly personalized
patterns, which require new methods of personalizing general
models (that were developed from many subjects) using the
characteristics of individual patients. [10], [11].
The last reason for slower progress is that the way studies
are designed, algorithms assessed, and results reported is very
heterogeneous. It can be difficult to understand the level of
evidence these studies provide [12] and it is also impossible
to fairly compare the results. For example, it is very difficult
to compare the performance of various systems when only
two quantitative values are reported (e.g., sensitivity and
specificity) and when the prior probabilities vary significantly
(the a priori probability of a seizure is very low, which means
that the assessment of background events dominates the error
calculations) [13].
Thus,
in this paper, we want
to bring attention to
a number of methodological choices which are usually
underreported but ultimately can have a strong influence
on system performance. These choices are necessarily made
during data preparation, training, and also evaluation and
reporting of the results.
The contributions of this work are summarized as follows:
• We identify a wide range of methodological decisions
that must be made and reported when training and eval-
uating the performance of epilepsy detection systems.
• We characterize and assess the influence of individual
choices using a typical ensemble random-forest model
and the publicly available CHB-MIT database.
TABLE 1. OVERVIEW OF ALL METHODOLOGICAL CHOICES TESTED
Data used
Training
Perf.
metric
Subsets of data with different imbalance
ratios (e.g. Factor1 and Factor10)
All data, with different splits into training
folds (SeizureToSeizure, 1h/4h windows)
Cross-validation
type: Leave-one-out
(L1O) or Time-series-CV (TSCV)
Window step: 0.5 to 4s, with 4s windows
Personalized models or generalized models
Episode and duration-level performance
Micro or macro CV folds averaging
• We provide a broader picture of each decision and give
good-practice recommendations where possible.
The remainder of the paper is organized as follows:
Section 2 details the relevant methodological choices and
their potential influence. Section 3 provides a description of
the experimental setup used to evaluate the influence of these
methodological choices and parameters. Section 4 presents
the experimental results, while Section 5 comments on more
broad and general observations on the presented results. It
also presents certain methodological recommendations for the
development of future epileptic seizure detection algorithms,
as well as more general time series analysis applications.
Section 6 concludes this work.
2. Methodological choices
There are many methodological choices to make when
evaluating machine learning algorithms and systems in terms
of their performance and suitability for real-life applications.
These choices, can significantly impact the performance and
repeatability of such results in practice. In this section we go
through the most important choices, discussing data prepa-
ration, training and testing methodology, and performance
measures, as listed in Table 1. We will later show how they
influence the detection of epileptic seizures.
2.1. Data preparation
An important part of evaluating machine learning al-
gorithms is the data used to train and test the algorithm.
A well-known practice is that training, validation, and test
subsets must be chosen without overlap and be statistically
independent to avoid the effect known as 'data leakage'.
But the question that is less discussed is how representative
are the data that we use. With the increasing amount of
big data collected using the Internet of Things (IoT) and
wearable devices, big data sets are no longer rare. Such large
datasets are incredibly valuable and essential for having
more ML/AI-powered devices in everyday life, but they
also bring certain challenges. Training on such a huge
amount of data, especially for computationally demanding or
memory intensive algorithms or without lots of computational
resources, can be complex, slow, and even potentially not
feasible. For this reason, a common approach is to create
smaller subsets of available datasets.
Figure 1. Epilepsy model predictions example. Predictions without
any post-processing and with two types of post-processing as
well as true labels are shown. Of interest are the distributions of
false positives. The distributions of false positives are of particular
interest.
In the case of epilepsy, it is characterized by recurrent
but unpredictable electrical discharges in the brain. Epilepsy
episodes can last from a few seconds to a few minutes.
Overall, when looking at the recorded data, the percentage
of seizure data is extremely small, commonly less than 0.5%.
This huge imbalance in epilepsy recordings leads to the com-
mon choice of creating a data subset that contains all seizure
signals but only a reduced amount of non-seizure signals.
This step of generating smaller or even balanced datasets
makes training simpler, performance reporting clearer, and
speeds up the research process. Most papers tackling the
epilepsy detection problem do not use whole long-term
epilepsy recordings, but rather data subsets and also very
rarely discuss the influence of this decision on their results.
In this paper, we address this question by testing several
epilepsy subsets created from a main dataset. We evaluate
the influence of using all or only some data samples, as
well as the impact of the seizure to non-seizure imbalance
ratio. We also test the influence of data splitting during the
training and cross-validation folds and show that this choice
can be very critical and make a big difference in whether
the proposed algorithm will work in practice when all data
are used, without the possibility of performing any selection.
2.2. Generalized vs. personalized models
In many applications where underlying data patterns are
highly specific, such as in many biomedical use cases, there
are two approaches to training; personalized and generalized
training and models. Epilepsy is a good example of this,
where underlying electroencephalography (EEG) patterns are
highly variable between EEG channels, recording sessions,
and subjects. Personalized training means that data from the
same subject are used to train the model. This leads to as
many ML models as subjects we have. Generalized training,
on the other hand, would lead to a single ML model for all
subjects. To avoid data leakage (and enable comparison with
personalized models), every subject has its own generalized
model trained on all subject's data but that test subject, which
is also known as the leave-one-subject-out approach.
On one hand, personalized modes can capture subject-
specific patterns better, but are also trained on less data in
total, which can sometimes be limiting, as some subjects have
very few seizures recorded. On the other hand, generalized
models are more complex to train as they are trained on
more data, and can also be less subject-specific but may be
more interesting for building large-scale wearable outpatient
systems.
Figure 2. Illustration of duration and episode-based performance
metrics.
2.3. Respecting temporal data dependencies
Another aspect of data that is commonly forgotten is that
all data are recorded in time and that sometimes this imposes
some unavoidable statistical dependencies. Some underlying
patterns that our ML algorithms can use can only exist in a
certain order, and for this reason it might not be fair to use
data that are in the future to train and then test using data
that was before it. On one hand, it can miss some patterns
useful for detection, and on the other hand, it can lead to
potentially unfeasible results for in-practice applications.
Two parts of the ML workflow must be considered in
this case. Often, data samples are shuffled before training,
whereas for temporal data, this might not be advisable.
Furthermore, if some statistical knowledge on the distribution
and length of certain classes is available, this knowledge
can be used to post-process predicted labels and lower mis-
classification chances. For example, in the case of epileptic
seizures, it would not be realistic. that an individual suffers
an epileptic seizure of 1-second duration every minute.
Second, the temporal aspect of the data is relevant when
choosing the cross-validation (CV) approach. A common
CV approach for personalized training is leave-one-seizure-
out, which means that data from one seizure is left out for
testing, and seizures that come before but also after will
be used for training. On the other hand, in the time series
cross-validation (TSCV) approach [14], [15] only previously
acquired data can be used for training. This means that if
files are ordered in time, for the first CV fold only one file
will be used for training and the one after it for testing. For
the following CV folds, one more file is always added to the
training set (the file previously used for testing), and testing
is done on the next available file. This CV approach is rarely
used in the literature but is the only feasible approach for
online data training (and inference) on wearable devices.
2.4. Data segmentation
Typically, features are extracted from fixed-size windows
of data and calculated with the'moving window' repeatedly
in shifts of a chosen step size. Here, two parameters have to
be decided: window size (WS) and window step size (WSS)
for which we move the feature extraction window. Choosing
a larger window size might be necessary when extracting
frequency information, but it also limits the possibility of
detecting very short patterns. Similarly, a smaller step size
can decrease detection latency, but increases the computa-
tional costs of the algorithm due to more frequent feature
extraction. These parameters can be optimized according
to several aspects: features used and their properties and
complexity, latency requirements, or available computational
resources. If none of these is limiting, the parameters are
generally optimized in terms of performance. It is interesting
to note how much performance can change depending on
these choices. More importantly, parameter choice and the
reasoning behind it should be mentioned and documented
in papers.
2.5. Evaluation metrics
For temporal and sequential data, standard performance
evaluation metrics, such as sensitivity and specificity, may
not always be the most appropriate and can even be mislead-
ing [16]. Evaluation metrics must ultimately reflect the needs
of users and also be sufficiently sensitive to guide algorithm
development [13]. As Shah et al. stated in [17] there is a lack
of standardization in the evaluation of sequential decoding
systems in the bioengineering community.
The same authors compare five popular scoring met-
rics for sequential data in [13]. Among them, the most
interesting are 'Epoch-based sampling' (EPOCH), 'Any-
overlap' (OVLP), and 'Time-aligned event scoring' (TAES).
EPOCH treats the reference and hypothesis as temporal
signals, samples them at a fixed epoch duration, and counts
errors (TP, TN, FP, and FN) accordingly. For an epoch
duration of one sample, this metric processes data sample-
by-sample and results in typical performance measures (such
as accuracy, sensitivity, specificity, F1 score etc). The OVLP
measure [18], interprets signals as a series of same-label
episodes and then assesses the overlap in time between
reference and hypothesis. It counts a 'hit' in case there is
any overlap between the reference and hypothesis. In Fig. 2
we illustrate several use cases, how errors are counted, and
what is the final performance measure. The authors in [13]
also propose the TAES metric which combines the EPOCH
and OVLP information into one metric. The approach is
very similar to OVLP, but rather than simply considering
if there is any overlap between reference and hypothesis
episodes, the percentage of overlap is measured and weighs
the errors (TP, TN, FP, FN) accordingly. Here, we want to
demonstrate the difference in performance in the use case
of epilepsy detection, depending on the chosen performance
measure, and also how these performance metrics can be
used to interpret the quality of algorithm predictions. The
code of those metrics is available online1.
Another performance measure with a strong practical
impact, and thus often used for epilepsy detection, is the
false alarm rate (FAR), or the number of false positives per
hour/day. Clinicians and patients see this measure as more
meaningful than many more commonly used metrics, and are
very demanding in terms of performance, requiring it to be
as low as possible for potential wearable applications (e.g.,
less than 1 FP/day) [17]. This also necessitates exceptionally
high constraints on the required precision (usually much
higher than 99%).
Finally, to quantify global performance, the accumulated
performance of all cross-validation folds has to be calculated.
1. https://c4science.ch/source/PerformanceMetricsLib/
Figure 3. Epilepsy detection performance measured through seven
measures; both on episode and duration level. For each, sensitivity
(TPR), precision (PPV) and F1 score are measured. The results
show average performance for all 24 subjects for 'Fact1' data
subset.
But here are also choices to be made. One can measure the
average performance of all CV folds (micro-averaging) or
can, for example, append predictions of all test files next
to each other and only then measure performance on all
appended data (macro-averaging). In Fig. 1, an example
of predictions (also with moving average post-processing)
is given for all files of one subject. What is important to
notice is the distribution of false positives over time and
over the different files/CV folds. Most often, false positives
occur around seizures. However, there can potentially be a
fold(s) with an unexpectedly large number of false positives.
If the final performance is measured as an average of the
performances of each fold, a fold with many false positives,
as in Fig. 1, will have a lower influence on the total perfor-
mance than if all predictions are appended and performance
is measured only afterward. This potential overestimation of
performance when averaging cross-validations should also
be taken into account.
3. Experimental setup
3.1. Dataset
In this work, we use the CHB-MIT epilepsy dataset,
an open source widely used dataset for the detection of
epilepsy [19], as it is a good representative of continuous,
relatively long-term monitoring (over several days). CHB-
MIT is an EEG database, with a total of 982.9 hours of
data recorded at 256Hz. It consists of 183 seizures forming
a total of 3.2 hours or 0.32% of labeled ictal data, from
24 subjects with medically resistant seizures ranging in age
from 1.5 to 22 years. On average, it has 7.6 ± 5.8 seizures
per subject, with an average seizure length of 58.6 ± 65.0 s.
It was recorded using the bipolar montage (10-20 system)
and thus contains between 23 and 26 channels, of which we
use the 18 channels that are common to all patients.
3.2. Machine learning training
We extract 19 features from each of the 18 channels,
similar to [20], calculating them on 4-second windows with
a moving step of 0.5 seconds (unless otherwise specified).
We use two time-domain features, mean amplitude and line
length, and 17 frequency domain features. Both relative and
absolute values of power spectral density in the five common
brain wave frequency bands are used: delta: [0.5-4] Hz, theta:
[4-8] Hz, alpha: [8-12] Hz, beta: [12-30] Hz, gamma: [30-45]
Figure 4. Epilepsy detection results depending on the data subset
used.
Hz, and low-frequency components: [0-0.5] Hz and [0.1-0.5]
Hz. Before extracting the features, the data is filtered with
a 4th-order, zero-phase Butterworth bandpass filter between
[1, 20] Hz.
As an algorithm to test the range of parameters mentioned,
we choose a highly popular but also feasible algorithm for
wearable and outpatient monitoring devices. We implemented
a random forest classification algorithm, which is based
on an ensemble of 100 decision trees to reduce model
overfitting. It is fast and lightweight, both in model size
and memory footprint [21], and has been used extensively
for EEG-based seizure classification [22]–[24]. In the end we
postprocess predicted labels with a moving average window
of 5 seconds, and majority voting to smooth predictions and
remove unrealistically small seizures. If seizures are closer
than 30s, we merge them into one.
4. Experimental results
4.1. Evaluation metrics
In this work, we use two metrics to measure performance.
One is the EPOCH approach described in Sec. 2.5, with
an epoch duration of one sample. TP, TN, FP, and FN
are detected sample by sample, which are further used to
calculate the sensitivity (TPR), precision (PPV), and F1 score.
We call this duration-based performance, which characterizes
how well seizures are detected with respect to their full
length. The other performance metric is OVLP, which detects
overlaps between predicted (hypothetic) and reference seizure
or non-seizure episodes. We call this an episode-based metric,
as it cares only about whether each of the seizure episodes has
been detected, not caring exactly about the predicted seizure
duration. These two metrics are very easily interpretable.
For example, if the sensitivity at the episode level is 80%
and there were 10 seizures, it means that 8 episodes were
detected but 2 were missed. The TAES metric proposed
in [13] is an interesting approach to combine both metrics
but is harder to interpret, and thus it is not used here.
Fig. 3 shows the average performance of personalized
models for the 24 subjects from the balanced CHB-MIT
dataset. For both episode- and duration-based performance,
sensitivity, precision, and F1 scores are shown, as well
as one accumulative measure, the mean of F1 score for
episode and duration-level ('F1 DE'). The sensitivity of the
episode is on average 100%, which means that except for a
few cases, all episodes of seizures were detected. Looking
at duration-level sensitivity, it is clear that even if seizure
episodes were perfectly detected, their whole duration was
Figure 5. Performance results when using leave-one-out vs. time-
series cross-validation. Results are shown for three data subsets
(F1, F10 and StoS).
not always predicted. Looking at the precision, it is clear
that there are also false positive predictions, and more of
them when measuring on episode level than duration level,
meaning that there were many short false positives. Observing
the performance through these six values enables a more
complete characterization of the prediction performance of a
certain algorithm. It also enables a more nuanced comparison
between different methodological steps or parameter values
used, as will be shown next.
4.2. Generalized vs. personalized models
Here we test the performance difference when training
both personalized and generalized models for each subject.
We used a balanced data subset ('Fact1'). In Fig. 6, the
average for all subjects is shown, making clear the lower
performance of generalized models. Inspecting the perfor-
mance of the generalized model per subject reveals a clear
distinction between patients on which generalized models
perform very well and those for whom it performed poorly,
either due to many false positives or almost no detected
seizures. How to create generalized models and whether
there should be subtypes of generalized models for different
patient groups remains a question for future generations. For
the remainder of this work, we will focus on personalized
models.
4.3. Data preparation
In Fig. 4, the performance of epilepsy detection is shown
for five different data subsets used to train and test. The
first two approaches, 'Fact1', and 'Fact10', contain a subset
of the original CHB-MIT dataset in two different ratios
of seizure and non-seizure data. 'Fact1' is a balanced data
subset that has the same amount of seizure and non-seizure
data, where all available seizure data are used, along with
a randomly selected equal amount of non-seizure data. The
'Fact10' subset is constructed similarly, with the difference
that the amount of randomly selected non-seizure data is
10x more than seizure data. Data are divided into files equal
to the number of seizures with one seizure per file. Each file
is arranged such that seizure data occur in the middle of the
file, with nonseizure data split on both sides. Therefore, the
total file length depends on the length of the seizure and the
factor value. This organization enables easier training in the
case of the leave-one-seizure-out approach, as each file is
equally balanced.
Figure 6. Comparison of average performance (for all subjects) of
personalized and generalized models.
gether), contain all data samples from the CHB-MIT database
but are rearranged into files containing different amounts of
data. The 'StoS' approach consists of files that start with the
non-seizure data after the previous seizure and end when the
next seizure ends. In this way, every file contains exactly one
seizure, but the entire length of the file is not fixed. The last
two approaches, 'Win1h' and 'Win4h', as the names imply,
divide the dataset into files of 1-hour or 4-hour duration.
In this way, some of the files may contain zero to possibly
multiple seizures. In all three cases, we trained using time-
series cross-validation. We specified that the first file must
contain a certain amount of data (five hours) and at least
one seizure, and as such it is slightly different from other
consequent files.
We analyze the impact of data preparation considering
three metrics: false alarm rate (FAR), sensitivity (TPR), and
precision (PPV). First, the false alarm rate, defined here as
the number of FPs per day, as shown in Fig. 4, is significantly
higher for data subsets (Fact1(0)) than for the whole dataset
training (StoS or Win1h/4h). This can be traced to two
reasons. The first is that Fact1(0) is trained on much less non-
seizure data, potentially not enough to model properly the
non-seizure patterns, resulting in more non-seizure samples
being falsely classified. The second is that because testing is
done only on a subset of data, FPs must be linearly scaled
to estimate the false alarm rate per day, potentially leading
to very high numbers. For these reasons, data subsets should
not be used to estimate the false alarm rate of an epilepsy
detection algorithm.
Next, we consider the sensitivity and precision. For
Fact1(0), seizure episode detection is easier, visible from
episode-level sensitivity that is 100%. Detecting all seizure
episodes perfectly is much harder when the entire dataset
(StoS or WinXh) is used and visible by episode sensitivity
values ranging between 80 and 95%. Precision presents a
more complex picture, dropping sharply for StoS before
recovering for WinXh. This is because StoS retraining
and testing only occurs after every new seizure, where
in the meanwhile could have been hours of non-seizure
data. The WinXh strategies retrain much more often, thus
making it easier to learn non-seizure patterns and lower false
predictions. To conclude, using all data significantly reduces
false positives, but also results in lower, but more realistic,
sensitivity and precision values.
4.4. Respecting temporal data dependencies
The last three approaches, Seizure To Seizure ('StoS'),
and 1 or 4 hour windows ('Win1h'/'Win4h', 'WinXh' to-
To show the influence of cross-validation choices on
performance results, we trained and tested three data sub-
Figure 7. Performance with respect to different window step sizes.
Steps of 0.5, 1, 2 and 4s were used, with window size of 4s.
sets with different data imbalance ratios ('Fact1', 'Fact10',
'StoS'), both using leave-one-seizure-out (L1O), and time-
series cross-validation (TSCV) approaches. The results are
shown in Fig. 5. The superior performance of the L1O ap-
proach is evident in almost all aspects (sensitivity, precision,
and numFP). This is reasonable as more data were used to
train with L1O than with TSCV approach. The difference
in performance ranged from 3 to 7% for the F1 score in
episode detection. This is not a recommendation to use L1O;
in contrast, it demonstrates that training on future data leads
to overestimated performance and should be avoided.
4.5. Data segmentation
In Fig. 7, the performance of epilepsy detection is shown
when the window step ranged from 0.5 to 4 s, with a window
size of 4 s. The most clear and expected pattern is that
by increasing the step size, the number of false positives
is reduced significantly, but what is interesting is that the
proportion of FP increases, thus reducing the precision for
episodes. More precisely, precision increases first (while
sensitivity is still high) and then drops for episodes (because
less seizures were also detected), leading to the conclusion
that too big steps are risky. Increasing window step size
also reduces sensitivity, more noticeably for duration level,
which may be due to the fact that with large steps, shorter
seizures can be potentially missed. These results demonstrate
the complexity of the window step size parameter, that it
is beneficial to experiment before choosing one value, and
that it has to be necessarily reported to make the results
comparable and reproducible.
5. Discussion
5.1. Data aspects
As seen from results in Sec. 4.3, using all the data
significantly reduces false positives and also results in lower
and more realistic sensitivity values. Thus, if computational
and memory resources are sufficient, models should be
trained using all available data. If this is not possible, then the
subset of data should contain significantly more non-seizure
data. However, data subsets will result in an unrealistic
false alarm rate. When using the whole dataset, the most
appropriate seems to be to use fixed-size time frames in which
models are retrained/updated regularly. The size of this time
frame should also be tested and reported. General advice
would be to use data subsets for initial experimentation and
building an understanding of the algorithm and its parameters,
but that all the available data should be used for reporting
the final performance. It is also useful to take into account
and characterize the class imbalance.
When talking about the temporal aspect of data, several
things should be taken into account. We advise not to shuffle
data samples before training and testing but rather to use
temporal information and knowledge on class distribution to
postprocess predicted labels, which can increase performance,
but must also be clearly reported.
Finally, it is critical to decide whether to use only the
data from the same subject to create personalized and, as
shown, more precise models or to use all available data from
other subjects to create generalized models. Generalized
models can have lower individual performance, but can
be used for new subjects. This topic represents a full
research topic on its own. For example, future research
should investigate whether it is possible to create models
that can use generalized models as a starting point from
which they can be personalized.Would these models lead
to better overall performance in comparison to personalized
models? Would less personal data be needed to personalize
models if generalized modes are used as starting point?
Similarly, the unavoidable question is, can we somehow
profit from both generalized and personalized models? Can
we combine them in some beneficial way?
5.2. Training aspects
When talking about the choice of cross-validation as
shown in Sect. 4.4, the leave-one-out approach leads to higher
performance than if data are trained in temporal order using
time series cross-validation. However, the L1O approach is
not realistic for training data in real time, while TSCV is
intended for such scenarios. Training models online as data
are being acquired is one of the necessary next steps for ML
models on IoT devices, and thus TSCV will have to become
the standard method.
Data partitioning has two parameters that can also play a
significant role in performance, namely the window size used
to extract features and the window step size. Their optimal
choice can depend on each use case, the features extracted
and their properties and complexity, latency requirements,
and available computational resources. Here, we show how
window step size can influence performance, with different
patterns for false alarms, sensitivity, and precision, and
how it has different impacts on duration- or episode-level
classification. The results show the complexity of the window
step size parameter, indicating that it is beneficial to test it
before choosing one value and that it must be reported to
make results comparable with the literature. One research
avenue that we have not considered here as it is outside
the scope of this work, but which can be potentially very
beneficial, is optimizing the window size parameter for each
feature individually.
5.3. Performance estimation aspects
Here we proposed to use two performance metrics, one
at the duration-level and one at the episode-level. Each of
them has certain advantages, and thus their values should be
interpreted carefully. Nevertheless, together they provide a
full picture of the detection characteristics of the algorithm
analyzed.
For example, EPOCH, a duration-based metric, cares
about the duration of the events and thus weighs long events
more importantly. This means that if a signal contains one
very long seizure event and some shorter ones, the accuracy
with which the long event is detected will dominate the
overall scoring. In epilepsy detection, as in many applications,
the duration of the event can vary dramatically; therefore,
this must be taken into account. For this reason, OVLP, an
episode-level performance metric, is much easier to interpret.
However, such an episode-level metric is more permissive
and tends to produce much higher sensitivities. It can also be
implemented so that if an event is detected in close proximity
to the reference annotation, it is considered correctly detected,
which can further increase the performance values.
Nowadays, in the literature, duration-level-based perfor-
mance is still the most popular, but there are trends of moving
toward more event/episode-based performance measures [13].
Currently, there is no standardization. Until then, the perfor-
mance metrics used, as well as post-processing that has been
utilized to smooth the labels, must be clearly described.
Similarly, the method to achieve the overall perfor-
mance measure from the individual CV folds must be
documented. We recommend that overall performance be
calculated by temporally appending all fold predictions in
time, rather than as the average of all fold performances. For
example, if one CV fold (or small portion, as in Fig. ref-
fig:dataPredictionExample) has extremely high number of
false positives, but all other ones have good performance,
it will affect overall estimation of e.g., precision much less
(due to averaging over all folds), leading to potentially
overestimated performance.
6. Conclusion
In this work, we have characterized the influence of a
wide range of important methodological choices for epilepsy
detection systems. When choosing a subset of the dataset for
training, performance can be highly overestimated compared
to training in the entire long-term data set. Thus, for real-life
performance estimation, using all long-term data is necessary.
Similarly, using the leave-one-seizure-out cross-validation
approach can improve detection performance, but it is not
realistic for online data training, as it uses future data. Thus,
we recommend using a time-series cross-validation approach
instead, with macro-averaging rather than microaveraging.
Training on a generalized level can be challenging due to its
subject-specific nature, leaving personalized models outper-
forming generalized ones. Furthermore, performance metrics
must reflect users' needs and be sufficiently sensitive to guide
algorithm development. Consequently, we encourage the
usage of both episode-based and duration-based performance
metrics, which together can give a more nuanced picture of
algorithm performance. Finally, whatever choices are made,
to further increase the comparability and reproducibility of
results, it is essential that all choices and parameters are well
reported.
References
[1]
F. Mormann et al., "Seizure prediction: The long and winding
road," Brain: A Journal of Neurology, 2007.
[2] D. Schmidt and M. Sillanp ̈a ̈a, "Evidence-based review on
the natural history of the epilepsies," Current Opinion in
Neurology, 2012.
[3] A. D. Patel et al., "Patient-centered design criteria for
wearable seizure detection devices," Epilepsy & Behavior:
E&B, 2016.
[4] A. Van de Vel et al., "Automated non-EEG based seizure
detection: Do users have a say?" Epilepsy & Behavior, 2016.
[5] K. Rasheed et al., "Machine Learning for Predicting Epileptic
Seizures Using EEG Signals: A Review," IEEE reviews in
biomedical engineering, 2021.
[6] C. Jory et al., "Safe and sound? A systematic literature review
of seizure detection methods for personal use," Seizure, 2016.
[7] B. H. Brinkmann et al., "Seizure Diaries and Forecasting
With Wearables: Epilepsy Monitoring Outside the Clinic,"
Frontiers in Neurology, 2021.
J. Verdru and W. Van Paesschen, "Wearable seizure detection
devices in refractory epilepsy," Acta Neurologica Belgica,
2020.
[8]
[9] A. Schulze-Bonhage, "Seizure prediction: Time for new,
multimodal and ultra-long-term approaches," Clinical Neu-
rophysiology, 2022.
[10] D. Cogan et al., "Personalization of NonEEG-based seizure
detection systems," 2016.
[11] T. De Cooman et al., "Personalizing Heart Rate-Based
Seizure Detection Using Supervised SVM Transfer Learning,"
Frontiers in Neurology, 2020.
S. Beniczky and P. Ryvlin, "Standards for testing and clinical
validation of seizure detection devices," Epilepsia, 2018.
S. Ziyabari et al., "Objective evaluation metrics for automatic
classification of EEG events," arXiv:1712.10107, 2019.
[13]
[12]
[14] A. Mohammed et al., "Time-series cross-validation parallel
programming using mpi," ICDABI, 2021.
[15] R. Zanetti et al., "Approximate zero-crossing: A new inter-
pretable, highly discriminative and low-complexity feature
for EEG and iEEG seizure detection," Journal of Neural
Engineering, 2022.
[16] N. Japkowicz and M. Shah, Evaluating Learning Algorithms:
A Classification Perspective. Cambridge Uni Press, 2011.
[17] V. Shah et al., "Validation of Temporal Scoring Metrics for
[18]
Automatic Seizure Detection," in SPMB, 2020.
S. B. Wilson et al., "Seizure detection: Correlation of human
experts," Clinical Neurophysiology, 2003.
[19] A. H. Shoeb, "Application of machine learning to epileptic
seizure onset detection and treatment," Thesis, MIT, 2009.
[20] U. Pale et al., "Hyperdimensional computing encoding
for feature selection on the use case of epileptic seizure
detection," arXiv:2205.07654, 2022.
[21] R. Zanetti et al., "Real-Time EEG-Based Cognitive Workload
Monitoring on Wearable Devices," IEEE transactions on bio-
medical engineering, 2022.
[22] M. K. Siddiqui et al., "A review of epileptic seizure detection
using machine learning classifiers," Brain Informatics, 2020.
[23] D. Sopic et al., "E-glass: A wearable system for real-time
detection of epileptic seizures," AISCAS, 2018.
[24] R. Zanetti et al., "Robust epileptic seizure detection on
wearable systems with reduced false-alarm rate," EMBC,
2020.
|
|
http://arxiv.org/abs/2302.10671v1 | 2023-02-21T13:40:16 | 2023-02-21T13:40:16 | Directive Explanations for Monitoring the Risk of Diabetes Onset:
Introducing Directive Data-Centric Explanations and Combinations to Support
What-If Explorations | Explainable artificial intelligence is increasingly used in machine learning
(ML) based decision-making systems in healthcare. However, little research has
compared the utility of different explanation methods in guiding healthcare
experts for patient care. Moreover, it is unclear how useful, understandable,
actionable and trustworthy these methods are for healthcare experts, as they
often require technical ML knowledge. This paper presents an explanation
dashboard that predicts the risk of diabetes onset and explains those
predictions with data-centric, feature-importance, and example-based
explanations. We designed an interactive dashboard to assist healthcare
experts, such as nurses and physicians, in monitoring the risk of diabetes
onset and recommending measures to minimize risk. We conducted a qualitative
study with 11 healthcare experts and a mixed-methods study with 45 healthcare
experts and 51 diabetic patients to compare the different explanation methods
in our dashboard in terms of understandability, usefulness, actionability, and
trust. Results indicate that our participants preferred our representation of
data-centric explanations that provide local explanations with a global
overview over other methods. Therefore, this paper highlights the importance of
visually directive data-centric explanation method for assisting healthcare
experts to gain actionable insights from patient health records. Furthermore,
we share our design implications for tailoring the visual representation of
different explanation methods for healthcare experts. | [
"Aditya Bhattacharya",
"Jeroen Ooge",
"Gregor Stiglic",
"Katrien Verbert"
] | 10.1145/3581641.3584075 | [
{
"@title": "doi",
"@href": "http://dx.doi.org/10.1145/3581641.3584075",
"@rel": "related",
"@type": null
},
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10671v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10671v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.HC",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.HC",
"cs.AI",
"cs.LG",
"cs.SE"
] | 3
2
0
2
b
e
F
1
2
]
C
H
.
s
c
[
1
v
1
7
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Directive Explanations for Monitoring the Risk of Diabetes
Onset: Introducing Directive Data-Centric Explanations and
Combinations to Support What-If Explorations
Aditya Bhattacharya
[email protected]
KU Leuven
Leuven, Belgium
Gregor Stiglic
[email protected]
University of Maribor
Maribor, Slovenia
Jeroen Ooge
[email protected]
KU Leuven
Leuven, Belgium
Katrien Verbert
[email protected]
KU Leuven
Leuven, Belgium
ABSTRACT
Explainable artificial intelligence is increasingly used in machine
learning (ML) based decision-making systems in healthcare. How-
ever, little research has compared the utility of different explanation
methods in guiding healthcare experts for patient care. Moreover, it
is unclear how useful, understandable, actionable and trustworthy
these methods are for healthcare experts, as they often require
technical ML knowledge. This paper presents an explanation dash-
board that predicts the risk of diabetes onset and explains those
predictions with data-centric, feature-importance, and example-
based explanations. We designed an interactive dashboard to assist
healthcare experts, such as nurses and physicians, in monitoring
the risk of diabetes onset and recommending measures to minimize
risk. We conducted a qualitative study with 11 healthcare experts
and a mixed-methods study with 45 healthcare experts and 51 di-
abetic patients to compare the different explanation methods in
our dashboard in terms of understandability, usefulness, actionabil-
ity, and trust. Results indicate that our participants preferred our
representation of data-centric explanations that provide local expla-
nations with a global overview over other methods. Therefore, this
paper highlights the importance of visually directive data-centric
explanation method for assisting healthcare experts to gain action-
able insights from patient health records. Furthermore, we share
our design implications for tailoring the visual representation of
different explanation methods for healthcare experts.
CCS CONCEPTS
• Human-centered computing → Human computer interac-
tion (HCI); Visualization; Interaction design; • Computing
methodologies → Machine learning.
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation
on the first page. Copyrights for components of this work owned by others than the
author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or
republish, to post on servers or to redistribute to lists, requires prior specific permission
and/or a fee. Request permissions from [email protected].
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
© 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM.
ACM ISBN 979-8-4007-0106-1/23/03. . . $15.00
https://doi.org/10.1145/3581641.3584075
KEYWORDS
Explainable AI, XAI, Interpretable AI, Human-centered AI, Respon-
sible AI, Visual Analytics
ACM Reference Format:
Aditya Bhattacharya, Jeroen Ooge, Gregor Stiglic, and Katrien Verbert. 2023.
Directive Explanations for Monitoring the Risk of Diabetes Onset: Intro-
ducing Directive Data-Centric Explanations and Combinations to Support
What-If Explorations. In 28th International Conference on Intelligent User
Interfaces (IUI '23), March 27–31, 2023, Sydney, NSW, Australia. ACM, New
York, NY, USA, 16 pages. https://doi.org/10.1145/3581641.3584075
1 INTRODUCTION
Machine Learning (ML) based systems have been increasingly
adopted in healthcare over the past few decades, in applications
ranging from surgical robots to automated medical diagnostics
[41]. Especially for screening and monitoring of diseases such as
type-2 diabetes, ML models have proven to be significant [15, 53].
However, most of these algorithms are "black-boxes" because the
reasoning behind their predictions is unclear [9]. Moreover, the
growing concern of bias, lack of fairness, and inaccurate model
prediction have limited the adoption of ML more recently [36].
Consequently, explainable artificial intelligence (XAI) has gained
a lot of focus from ML practitioners as XAI methods facilitate the
interpretation and understanding of complex algorithms, thereby
increasing the transparency and trust of such black-box models
[33, 37, 41]. In healthcare, XAI empowers medical experts to make
data-driven decisions using ML, resulting in a higher quality of
medical services [54] and can impact its trust and reliance [8, 56].
Existing XAI methods [5, 24, 34, 44] are predominantly designed
for ML practitioners instead of non-expert users [6], who might be
specialized in a particular application domain but lack ML knowl-
edge [25]. Yet, the effectiveness of these explanation methods has
not been fully analyzed due to the lack of user studies with non-
expert users [48, 56]. This gap highlights the necessity for analyzing
and comparing explanation methods with healthcare professionals
(HCPs) such as nurses and physicians [17] as it is unclear how
useful, understandable, actionable, and trustworthy these methods
are for them.
Moreover, non-expert users need help to understand how to
obtain a favorable outcome [16, 49, 51]. This emphasizes the need
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
to make explanations directive, i.e. guiding the users to take action
for achieving their desired outcome [49]. Additionally, instead of
static explanations, non-expert users have considered interactive
explanations essential to support understanding and interpretation
[1, 26, 30]. Therefore, visually directive explanations should enable
non-experts not only to understand why a certain outcome is pre-
dicted but also to guide them in the process of finding how to obtain
their desired outcome without any intervention from ML experts
[29, 45, 52, 58].
We designed a prototypical dashboard that predicts patient's risk
of diabetes onset using visually directive explanations based on dif-
ferent explanation methods, including data-centric approaches [3],
feature importance [2], and example-based methods [2]. We aimed
to support nurses and physicians in screening patients with undiag-
nosed type-2 diabetes, monitoring their conditions, and suggesting
actions to control their risk of diabetes onset.
We also obtained the perspective of diabetic patients during the
evaluation process as they are well aware of the risk factors of
type-2 diabetes. Furthermore, some of them were recently in the
pre-diabetes phase and all of them are actively in contact with their
HCP. Thus, we analyzed their motivation to use such a dashboard.
This paper probes into the following research questions:
RQ1. In what ways do patients and HCPs find our visually
directive explanation dashboard useful for monitoring and
evaluating the risk of diabetes onset?
RQ2. In what ways do HCPs and patients perceive data-centric,
model-centric, and example-based visually directive expla-
nations in terms of usefulness, understandability, and trust-
worthiness in the context of healthcare?
RQ3. In what ways do visually directive explanations facili-
tate patients and HCPs to take action for improving patient
conditions?
We explored these questions through a two-phased study: first,
a qualitative study on a low-fidelity click-through prototype involv-
ing 11 HCPs; and second, a mixed-methods online study for the
evaluation of a high-fidelity web application prototype involving
51 patients and 45 HCPs. We analyzed the effectiveness of our dif-
ferent visual explanation methods and compared them in terms of
understandability, usefulness, actionability, and trust [21, 50]. Our
results show that our dashboard provided actionable insights to
HCPs about patient health by helping them to identify important
risk factors and showcase how critical the patients' conditions are.
Additionally, it helped patients to self-monitor and analyze their
health conditions.
This paper presents three primary research contributions. First,
we present our visually directive data-centric explanation meth-
ods that are aimed to provide local explanations of the predicted
risk for individual patients with a global overview of risk factors
for the entire patient population. Whereas it has been shown that
non-expert users prefer local explanations that justify a single de-
cision [6], it has also been argued that these explanations rarely
provide sufficient insight into the reasoning of models and the ex-
planatory depth that non-experts require to accept and trust the
decision-making of the model [13]. To address this challenge, we
present an approach that combines perspectives of both local and
global explanation methods [32] to provide more insight into both
the model predictions and the data for non-expert users. Second,
we present the design of a dashboard that combines different ex-
planation methods based on an iterative user-centered research
process. Third, based on observations of our user-centered design
process and an elaborate user study, we present design implications
for tailoring explanations for healthcare experts. We observed that
our participants had a higher preference for our representation of
data-centric explanations over other methods as they found them
more informative. We also observed that participants combined
multiple explanation methods, particularly for recommending ac-
tions to minimize the risk and interpreting the rationale behind
the predicted risk. Based on these observations, we present de-
sign implications for tailoring directive explanations for healthcare
experts.
2 BACKGROUND AND RELATED WORK
Designing visually explainable Decision Support System (DSS) in
healthcare considering different types of explanations is an active
area of research in XAI [4]. To contextualize our research, we first
review recent research findings in the domain of visually interactive
DSS in healthcare and then investigate XAI methods that provide
visual explanations to end-users.
2.1 Visually Interactive DSS in Healthcare
In healthcare, using DSSs built on the domain knowledge of medical
experts has a long history [47]. Usually, such systems are rule-based
logical systems developed on pre-defined rules supplied by medical
experts [10]. Despite the explainability offered by such systems,
there are many challenges such as poor user experience and scarcity
of involvement of medical experts in forming the knowledge base
[12, 20].
To overcome these challenges, modern DSSs in healthcare use
ML and data-driven techniques to learn patterns from historical
data and apply visualizations to facilitate prescriptive insights for
medical practitioners [20, 23, 43]. ML-based DSSs are being increas-
ingly used in healthcare for the early detection of health conditions
such as undiagnosed type-2 diabetes mellitus [53]. Despite the suc-
cess of such systems, the lack of transparency of advanced ML
algorithms has increased the need for human-friendly explainable
DSS in healthcare [27]. To mitigate these challenges, interactive
interfaces have proven to improve the understanding of non-expert
users [11].
Moreover, many researchers have found additional benefits in
applying XAI for clinical DSSs such as the mitigation of cognitive
bias [57]. Our research work focuses on providing an explainable
DSS which is interactive and personalized to meet the needs of the
medical experts involved in the progressive monitoring of the risk
of diabetes onset for patients.
2.2 Exploration in Visual Explanations
Harmonizing XAI techniques with visual explanations enable non-
expert users to gain appropriate trust in the outcome of ML systems
[40]. Recent works also suggest that exploration and contextual-
ization of explanation methods can enhance the satisfaction and
interpretability of non-expert users [6].
Directive Explanations for Monitoring the Risk of Diabetes Onset
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Model-agnostic post-hoc explanation techniques [31, 50, 54] ex-
plain black-box ML models without having any intrinsic informa-
tion about the inner working of the algorithm, i.e. knowledge about
inner parameters or hyper-parameters of the model. Most com-
mon model-agnostic local explanation methods like LIME [44], and
SHAP [34] are feature-importance-based methods that identify the
most impactful features contributing to the model's prediction [2].
However, more recently, due to the failure of ML models trained
on biased, inconsistent and poor-quality data, the ML research com-
munity is exploring data-centric approaches [3, 35]. Examples of
data-centric approaches are summarizing individual data instances
(using common statistical methods like mean, mode, and variance),
visualizing the data distribution to compare feature values of an in-
stance to those across the remaining dataset and observing changes
in model predictions through what-if analysis [18, 19, 22, 57]. Addi-
tionally, data-centric explanations include data-driven rule-based
approaches that are adopted commonly in medical DSS for assisting
health experts [4, 12, 19, 27, 47].
Additionally, researchers have used counterfactuals to provide
recommendations for health-related changes [2, 40, 57]. Adadi and
Berrada [2] have defined counterfactual explanations as example-
based methods that provide minimum conditions required to ob-
tain an alternate decision. Although counterfactuals provide useful
model-agnostic post-hoc explanations, examples generated by coun-
terfactual algorithms can be practically infeasible, contradictory,
or uncontrolled, thereby indicating a need for actionable recourse
[28, 51]. For instance, to obtain a lower risk of diabetes, counter-
factual algorithms can indicate patients to reduce their age by 30
years or alter their gender, which is practically infeasible. Yet, vi-
sually interactive counterfactuals hold great potential to produce
actionable insights [18]. Thus, there is an opportunity to explore a
better representation of such explanation methods for achieving
actionable recourse.
Moreover, as established by Bove et al. [6], exploring explainable
interfaces is considered essential for the interpretation and satis-
faction of end-users. The same notion is adopted in our work for
considering different types of visual explanation methods.
3 MATERIAL AND METHODS
This section presents our visually directive explanation dashboard
and our user-centric methodology for the design and evaluation of
our prototypical dashboard. The ethical approval for our research
was granted by the ethical committee of KU Leuven with the num-
ber G-2019-09-1742.
3.1 Visually Directive Explanation Dashboard
Our explanation dashboard is designed to assist HCPs in moni-
toring and screening the risk of diabetes onset for patients. We
enabled users to explore different kinds of visual explanations for
interpreting the model prediction.
ML Model: We used a logistic regression algorithm from Python
scikit-learn module to train a classifier on our diabetes healthcare
dataset. We achieved a training accuracy of 93% and a test accuracy
of 91% (no overfitting effect). The test accuracy is considered as
overall model accuracy. The complete technical approach of data
processing, model training, tuning and evaluation was conducted
in Python
Dataset: Our ML model was trained on patient's electronic health
records of comprehensive medical examinations conducted from 5
Slovenian primary care institutions [53]. The health records include
information about patients such as blood glucose, waist circumfer-
ence measure, BMI, age, gender, etc., along with patient behaviors
collected from the Finnish Diabetes Risk Score questionnaire (FIND-
RISC) to predict the risk of diabetes.
Our dashboard explained the predicted risk for an individual
patient along with an overview of the health statistics of the en-
tire patient population in the medical records. Thus, our approach
provides local explanations with a global perspective to HCPs [32].
3.1.1 User requirements. We conducted a preliminary one-hour
focus group with four healthcare workers with active experience
in patient-care from Community Healthcare Centre dr. Adolf Drolc
Maribor, Slovenia to understand their needs and challenges while
monitoring the risk of diabetes in patients. We first demonstrated
a dashboard based on the work of Rojo et al. [46], AHMoSe, that
explains the predicted risk of diabetes using SHAP values. Then, we
did a co-design session with our participants to tailor the AHMose
interface for meeting their requirements. The session was recorded
and transcribed for analyzing their feedback and responses.
From this exploratory study, we identified their struggles in
monitoring patients for the onset of diabetes. We also learned that
the visualizations for SHAP based explanations in AHMose were
too complex and detailed. Our participants wanted an easy way to
find only health factors which plays a vital role in elevating the
risk of diabetes for patients, instead of looking into all the features
considered by the model for making predictions. We also learned
from the co-design activity that the healthcare workers preferred
simpler line-chart, bar-chart and textual representations of the data
that could also be used to communicate with patients.
Additionally, we asked our about their specific needs in this study.
We summarize their responses into the following user requirements
that our explanation system should meet:
1. An interface for monitoring patients – HCPs wanted a
visual interface to quickly observe the medical records of
patients as it is inconvenient and time-consuming to examine
multiple medical reports to assess patient health conditions.
Additionally, HCPs wanted to analyze how a specific patient
is doing compared to other patients.
2. Suggest actions to minimize the predicted risk - HCPs
wanted to use an interactive interface to suggest actions to
patients to minimize their risk of diabetes onset.
3. Increase patient awareness - HCPs wanted the interface
to show patients how critical their conditions are for creating
more conscious awareness and motivating them to follow
the prescribed suggestions sincerely.
Then we designed our tailored explanation dashboard which
supported the following tasks for meeting the user requirements:
T1: Monitor the risk of diabetes for patients – Understand
the current risk of diabetes onset for patients and identify
if the patient's condition is more critical or not for deciding
the amount of attention needed for the patient.
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
Figure 1: Dashboard design of our click-through prototype. Visual explanations are provided using: Patient information with
the risk prediction chart (VC1), Patient Summary (VC2), Factors Contributing to Risk (VC3), Recommendations to reduce risk
(VC4), Risk recovery (VC5).
T2: Propose actions to minimize the predicted risk – Sug-
gest actions to patients to reduce the risk of diabetes or to
keep it under control.
T3: Interpret the rationale behind the predicted risk – Un-
derstand and explain the system's logic for the estimated
risk of diabetes by identifying the health variables and their
range of values that can increase or decrease the risk of
diabetes.
T4: Compare the current patient with other patients – By
comparing the health measures of the current patient with
other patients, get an indication about a specific patient's
situation as compared to other patients to decide the amount
of attention needed.
Task T1 aims to meet the first requirement, T2 aims to meet
the second requirement and T3 and T4 aims to meet the third
requirement.
3.1.2 XAI techniques and visual components. When we ana-
lyzed our user requirements, we found that these requirements are
aligned with the explanation goals presented by Wang et al. [57].
Therefore, the choice of our explanation methods should facilitate
learning by enabling our users to filter a small set of factors to make
their observations simpler and provide them with the ability to
predict and control future phenomena by generalizing these obser-
vations into a conceptual model. Wang et al. [57] also proposed XAI
elements that can meet these explanation goals and recommended
visualizations that can be used to present these XAI elements. More-
over, we considered model-agnostic local explanation methods for
explaining the predicted risk for individual patients irrespective of
the ML algorithm used. We further designed visual components as
illustrated in Figure 1 for the following three types of explanation
methods that meet our explanation goals:
Feature Importance explanation – As the dashboard aimed
to direct HCPs towards suggesting actions to patients for mini-
mizing the risk, feature-importance explanations enabled them to
identify the most influential risk factors according to the prediction
model. However, Szymanski et al. [55] have shown that the repre-
sentation of feature-importance explanations can impact the under-
standability and usefulness of this method. Additionally, from our
preliminary focus group session, we observed that our participants
did not understand simplified SHAP-based feature-importance ex-
planations in the AHMoSe dashboard [46].
Our representation of directive feature-importance explanations
presented in Factors Contributing to Risk (VC3) included only the
actionable health variables with a percentage measure that indi-
cated how specific features influenced the prediction. We define
Directive Explanations for Monitoring the Risk of Diabetes Onset
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
actionable health variables as variables that can be controlled by the
patient such as BMI, waist circumference, physical activity level.
We considered other factors that are infeasible for the patient to
alter such as age, gender, and geographical region as non-actionable
health variables.
The feature-importance scores are calculated using the SHAP
Python module. Factors that can increase risk are displayed in red,
while those which can decrease risk are displayed in green. Subtle
explanations are provided beside each health variable by comparing
the feature value with the recommended range to indicate why it
can increase or decrease risk.
Data-Centric explanations – Data-centric explanations in-
cluded in our dashboard aimed to explain why a certain health
variable is increasing or decreasing the risk of diabetes without
focusing on what the model considered important. Patient infor-
mation with risk prediction chart (VC1), Patient Summary (VC2),
and Risk Recovery (VC5) provided data-centric explanations in our
dashboard.
VC1 gave a textual overview of the health information of a
particular patient with a doughnut chart showing the predicted
risk of diabetes onset. To enable HCPs to observe the variance in
the predicted risk between different patients we categorized the
probability score (prob) generated by our ML classifier into three
levels: High (prob > 0.75), Moderate (0.5 ≤ prob ≤ 0.75) and Low
(prob < 0.5). The abstracted level is displayed in the center of the
doughnut chart, and the risk percentage (prob * 100%) as a tool-
tip. Moreover, we used consistent color coding across the different
visual components (red for high, orange for moderate, and green for
low risk). We also provided subtle indicators like colored arrows
for numerical feature variables and colored text for categorical
feature variables, along with necessary tool-tips to indicate if the
specific health variable is within the recommended range or not.
However, these visual indicators are only provided for actionable
health variables.
VC2 showed the value of each actionable health variable of a
patient along with data-distribution charts, considering the en-
tire patient population in the records. This component enabled
HCPs to have a quick overview of a specific patient as compared
to other patients and observe common patterns across all patients
using the data-distribution charts. The health variables used in the
data-distribution charts are further segregated as patient measures,
which is visually represented with area charts as these are contin-
uous variables, and behaviors which is visually represented with
bar charts as these are categorical variables. VC2 also showed the
recommended ranges for the patient measures as configured by
the health experts. It can be used to observe the health status of a
patient in comparison to other patients. The data-distribution zone
where the current health measure lies in the distribution chart is
also color-coded with our consistent color-coding convention.
VC5 enabled progressive monitoring of the predicted risk of
diabetes considering the historical patient records. It was designed
to allow users to identify if the patient's condition is improving or
not over a period of time.
Counterfactual explanations – Recommendations to reduce
risk (VC4) suggested actions using counterfactual explanations
generated by the DiCE framework [38] that patients can take to
reduce the predicted risk of diabetes. To mitigate the drawbacks of
the counterfactual algorithm implemented in the DiCE framework
[38], we considered generating counterfactuals for only actionable
health variables instead of non-actionable variables.
We also added data-driven boundary conditions so that coun-
terfactuals with absurd alterations are avoided. Furthermore, the
recommendations are presented as textual statements instead of
discrete numbers for easier interpretation. We considered having
these textual recommendations pre-configured for the patient be-
haviors that are categorical features of the model. For example,
instead of suggesting the patient to increase their physical activity
level from low to moderate, the visual recommends they exercise
daily for 30 minutes.
VC4 also included an indication of feasibility (easy or difficult)
and an estimated measure of risk reduction using sensitivity anal-
ysis [2, 19, 58] to compare between different recommended tasks.
For continuous numerical features of the model, feasibility is mea-
sured by calculating the percentage change between recommended
measure value and the current health measure. If the percentage
change is within ±10%, feasibility is labeled as easy. Otherwise, it is
considered as difficult. For categorical model features, ordinal inte-
ger encoding is done based on how the specific value can increase
or decrease the risk of diabetes, and feasibility is considered based
on the encoded ordinal values. For instance, physical activity level
is a categorical variable having three possible values: low, moderate,
and high. Low physical activity can increase the risk, and hence
the corresponding ordinal value of 1 is assigned to it. If the value is
moderate, an ordinal value of 2 is assigned, and if it is high an ordi-
nal value of 3 is assigned. Any change to immediate ordinal value
is considered easy. For instance, a change from low to moderate is
considered easy. But otherwise, it is considered as difficult. With
this approach, we aimed to make counterfactual explanations more
useful and actionable in a controlled way.
3.2 Evaluation Process
We evaluated our prototype in a two-phased user study. First, a
qualitative study for evaluating a low-fidelity click-through pro-
totype was conducted through individual interviews involving 11
HCPs. The goal of this study was to get early feedback on how
our primary users (HCPs like nurses and physicians) perceive the
dashboard and whether the user requirements are being met or not.
Second, we conducted a mixed-methods study involving 45 HCPs
and 51 diabetic patients through online survey questionnaires. The
goal of this study was to evaluate the effectiveness of the dashboard
in meeting the needs of HCPs and patients. We also compared
the different explanation methods represented by our five visual
components in terms of understandability, usefulness, actionability,
and trustworthiness. The patient's perspective was also collected
from this study as our dashboard would directly or indirectly impact
them.
The main similarity between these two user studies is that our
participants were given similar task-based questions about the four
supported tasks (T1, T2, T3, T4) by our prototype in both stud-
ies. Regarding the differences, our first study involved only HCPs,
and we recorded the measures of our qualitative evaluation of the
visual components through 1:1 interviews. In our second study,
we involved a larger pool of participants (including patients) to
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
evaluate our high-fidelity prototype. We recorded our measures of
the slightly modified visual components (Figure 3) using a combina-
tion of participant-reported qualitative responses and self-reported
Likert scale responses.
4 EVALUATION AND ANALYSIS OF
LOW-FIDELITY PROTOTYPE
For our first study, we designed a click-through prototype in Figma
[14] in multiple iterations. Figure 1 illustrates the final design of
our low-fidelity click-through prototype.
Table 1: Participants' information for the qualitative evalu-
ation of the low-fidelity prototype.
We performed a thematic analysis considering the 6-phase-method
from Braun and Clarke [7] on the qualitative data. We first reviewed
the transcripts of the recorded interviews. Then, we created a list
of initial codes from the data. In multiple iterations, we grouped
the identified codes into potential themes. After reviewing the
preliminary set of themes, we formed a definitive set of themes
and accordingly grouped them to analyze how each participant
succeeded or failed to answer the tasks-based questions.
To preserve the anonymity of the participants while present-
ing the results of this study, we refer to the participant as P(N),
where N is a particular participant from 1 to 11. We only made nec-
essary grammatical corrections to the participants' quotes when
presenting the results.
Gender
Age group
Participant distribution
3 : Male
8 : Female
8 : (21-30) years
1 : (31 - 40) years
1: (41 - 50) years
1: (51-60) years
Highest education level
11 : Master's degree
Experience in patient care
10 : > 1-year experience
in direct patient interaction
1: Indirect patient interaction
through training of nurses
4.1 Participants
We conducted a qualitative study involving 11 HCPs (male: 3, fe-
male: 8) from the University of Maribor to evaluate our low-fidelity
prototype. We recruited participants who had backgrounds in nurs-
ing and patient care. Participants recruited for this study belonged
to the same country as the participants of our focus group dis-
cussion. But they belonged to two different institutions. Table 1
presents the demographic information of our participants. Our par-
ticipants reported having experience in diverse specialization areas
of healthcare like surgical nursing, interventional radiology, plas-
tic and reconstructive surgery, pediatrics, orthopedics, preventive
care, and others. Only one participant had explicit experience in
preventive care of diabetes patients. Ten participants had at least
one year of experience in looking after patients and having fre-
quent direct interactions with patients. One of the participants was
only involved in the training of nurses and did not have any active
interaction with patients.
4.2 Procedure
The study was conducted through semi-structured individual in-
terviews that lasted between 45-70 minutes, that were recorded
and transcribed. During each interview, we introduced our click-
through prototype to our participants with brief contextual infor-
mation.
Our participants were first asked to explore the prototype, and
then asked questions based on the four tasks (T1, T2, T3, T4) sup-
ported by the prototype. Each question was followed by necessary
follow-up questions about each visual component to understand
how effective each component was for performing the given tasks.
4.3 Observation and Results
As shown in Table 2, 6 participants failed to answer T3(Q2) and 5
failed to answer T4(Q1), thereby indicating that performing tasks
T3 and T4 was difficult for our participants using this prototype.
Also, for T1(Q2), 3 participants failed to answer correctly, and 1
participant could not answer T2(Q1). However, all our participants
could successfully answer T1(Q1) and T3(Q1).
Figure 2 shows the preferred visuals for each task and compares
all the visual components based on understandability, usefulness,
actionability, and trust based on the participant's responses. Al-
though each visual was designed to support a specific set of tasks,
it was observed that for all the tasks, there is a high preference
for the Patient Summary (VC2) as the majority found it more in-
formative because of the graphical representation of the data with
clear color-coding. More than half of the participants considered all
the visual components useful. But the textual patient information
with the risk chart presented in VC1 is considered the most useful,
followed by the graphical representation of patient data in VC2
and recommendations in VC4. In terms of actionability, VC2 and
VC4 were considered the most actionable. VC1 was also considered
the most trustworthy, while only 5 participants considered the risk
recovery information in VC5 as trustworthy as the others either
found it difficult to interpret or did not consider it important.
We relate our observations with the following themes generated
using our thematic analysis process.
Visualizations facilitate quick understanding: All the participants
were positive about the entire dashboard but the visual represen-
tation of the patient records enabled them to understand the pa-
tient's condition quickly. Most of them connected the usefulness
and understandability of the visual components with graphical and
color-coded representations. For example, P10 stated, "It's clearly
indicated that the risk is high. I think it's very colorfully indicated
and that's good because it looks like it's marked in colors from green,
orange, and red". This justifies why the Patient Summary (VC2) was
highly preferred by our participants.
Including textual annotations can improve understandability: Al-
though the Patient Summary VC2 was highly preferred, some par-
ticipants expressed difficulty in interpreting the data-distribution
charts in VC2: "I'm not sure about the distribution [in patient sum-
mary] and what does that tell . . . what does the peak mean?"(P9).
This justifies why many participants failed to answer T4(Q1) cor-
rectly. They preferred more textual representation provided in VC1
Directive Explanations for Monitoring the Risk of Diabetes Onset
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Table 2: Observation from our first user study. The task-based questions are: T1(Q1): What is the overall risk for the patients?
T1(Q2): Is the condition improving? T2(Q1): What actions can you suggest to the patient to reduce the risk? T3(Q1): Can you
explain why the system is showing a high risk of diabetes? T3(Q2): Does the system allow you to see what happens if the blood
sugar is less than six instead the current value (7.5)? T4(Q1): What can you tell about the health variables of the patient as
compared to other patients? ✓denotes that the participant was successful in answering the questions, and × denotes they failed
to answer. Visual component(s) used by them to successfully respond to the task-based questions are mentioned in brackets.
T1
Q1
✓{VC1}
✓{VC2, VC1}
✓{VC2}
Q2
✓{VC1, VC2, VC3, VC5}
×
✓{VC2}
P1
P2
P3
P4 ✓{VC1, VC2, VC3, VC4, VC5} ✓{VC1, VC2, VC3, VC4, VC5}
P5
P6
P7
P8
P9
P10
P11
✓{VC1, VC2}
✓{VC1, VC2}
✓{VC1}
✓{VC1, VC2, VC3}
✓{VC1, VC2}
✓{VC1, VC2, VC3, VC5}
✓{VC1}
✓{VC5}
×
✓{VC5}
✓{VC5}
✓{VC2, VC3, VC5}
✓{VC1, VC2, VC3, VC5}
×
T2
Q1
✓{VC4}
×
✓{VC1, VC2}
✓{VC1, VC2, VC3}
✓{VC2, VC3, VC4}
✓{VC1, VC2, VC3, VC4}
✓{VC4}
✓{VC1, VC2, VC3, VC4}
✓{VC4}
✓{VC1, VC2, VC4}
✓{VC4}
T3
Q1
✓{VC2}
✓{VC2}
✓{VC1, VC2, VC4}
✓{VC2, VC3}
✓{VC3}
✓{VC3}
✓{VC1, VC2, VC3, VC4, VC5}
✓{VC1, VC2, VC3}
✓{VC1, VC2, VC3}
✓{VC1, VC2, VC3, VC5}
✓{VC1, VC2}
Q2
✓{VC1, VC2}
×
×
×
×
✓{VC2}
✓{VC2}
✓{VC2}
×
✓{VC2}
×
T4
Q1
×
✓{VC2}
✓{VC2}
×
×
✓{VC1, VC2}
×
✓{VC2}
×
✓{VC2}
✓{VC2}
Figure 2: Results from our qualitative evaluation of our low-fidelity prototype. (left) Chart showing the count of participants
using the visual components for the task-based questions. (right) Comparison of each visual component in terms of under-
standability, usefulness, actionability and trustworthiness by reported by the participants.
and VC3. However, it is important to keep the balance between
the amount of textual and graphical representations, as too much
textual information can affect the usefulness of the visual: "I think
it is very important [to have graphical representations] . . . not just
numbers, as it should tell you what will happen with the numbers. It
makes it likable and useful and easy to understand" (P6). While a lack
of concise textual description can also impact the interpretation of
the visual, like in the case of Risk Recovery (VC5), almost half of
our participants, found it difficult to interpret "I don't know what it
[risk recovery] means. I need more text and information on this" (P2).
Interactive visuals increase the interpretability of explanation meth-
ods: Most of our participants liked how they could interact with
the dashboard to observe changes in the predicted risk: "Using it
[interactions] you can show them [patients] if they have lower blood
sugar, then what will happen. So, you are not just telling them, they
can see how it improves their health" (P6), "I think that when you see
that way if you reduce the blood sugar, how the graph is changing, it
would be a motivation from them [patients]" (P5). Interactions allow
them to explore and easily understand visual explanations. This
indicates that exploration through interactive visuals can increase
the interpretability of the method. On the contrary, less interactive
visual like the Risk Recovery (VC5) was difficult to understand for
our participants "I don't understand the risk recovery too well. That
can be improved" (P3). As the interpretation of VC5 was not very
clear to many, they failed to answer T1(Q2) correctly. However,
we observed that the discoverability of interactions was very dif-
ficult using the click-through prototype. This justifies why many
participants failed to answer T3(Q2).
Combination of visual components: It was observed that most
participants combined two or more visuals to perform the given
tasks. Particularly, we observed them combining multiple visuals
when suggesting actions (T2). For interpreting the logic behind
the predictions and drawing comparisons with other patients they
mostly used the patient summary (VC2). Some of the participants
mentioned all the visuals were useful, and it was hard for them to
comment if a visual was more useful than others. Thus, they consid-
ered the entire dashboard very useful, actionable, and trustworthy.
P10 stated: "It's hard to say [which one is better] because I think all
of them are very good. This [VC1] provides the basic information you
need to know first. This [VC2] is like a really good summary because
it shows you in detail what's going on with the patient . . . Well, here's
the risk recovery, and you can see in the graph that risk is elevating.
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
From risk factors, I can figure out what increased risk. This [VC4]
recommends how to reduce risks. So, I would say all of them combined
have their own role".
Association of trust with visualization and underlying data: None
of the participants mentioned a lack of trust due to "complex algo-
rithms". They could trust the system as they could see the reference
patient data: "Yeah, I trust this not because it's generated by the
computer, but the overall score is evidence-based [based on patient
data]" (P9). When asked about why the system is predicting the
risk of diabetes as high, all of them mentioned values of the health
variables which were higher than the recommended ranges and
mentioned the color-coding of red used to denote health factors
that are not good for the patient: "[Risk is high] because you see
the high-risk circle and a lot of things are in color red, and we also
see that the blood sugar is 7.5, much higher than the recommended
range. This is the biggest indicator of diabetes" (P11). So, their sense
of trust is linked with the visual representation of the patient data.
Moreover, lack of interpretation of the visuals (like for VC5) affects
the overall trust and hence the usefulness of the visual. Like P2 and
P3, even P11 did not consider the risk recovery visual trustworthy
as they did not understand it: "I really don't know. It's something to
do with months, so with time and the risk. What I don't know is what
it should mean" (P11).
Action recommendation based on data, risk predictions, and a pri-
ori knowledge: For suggesting actions to reduce the risk of diabetes,
most participants relied on the reference data and their interpre-
tation of how the underlying patient data is related to the overall
risk. Their ability to perform interactions with the patient data to
observe changes in the predicted risk helped them to suggest ac-
tions: "if the blood sugar is lower say 5.8, the overall risk is in orange
and I see that risk is lower and so moderate" (P6). However, most
of them used their a priori knowledge of the domain to suggest
actions to minimize risk: "The highest risk is [due to] the blood sugar
as we can see in the chart because the red level [from VC2] is the
biggest and I would recommend a diet for the blood sugar" (P5). Even
feature-importance-based VC3 and counterfactual-based recom-
mendations provided in VC4 were less preferred for suggesting
actions as they expressed the need to have additional information
about the patient's diet, current medications, blood pressure, and
other information not used by the ML model: "Something about the
patient's diet is missing in this dashboard . . . nutrition is not included
and whether the patient is taking a specific medication for diabetes
or other reasons" (P4). However, we observed a higher preference
for data-centric explanations provided through VC2 for action rec-
ommendation compared to counterfactual explanations provided
through VC4 as they considered the recommendations to be very
generic and not personalized: "It [VC4] is useful. But it's like a general
suggestion for everyone. I think they [patients] trust much more when
we don't generalize them with another. This kind of recommendation
would be too general for one patient" (P5).
Patients as potential users: All our participants mentioned that
our dashboard can be a useful tool for monitoring patient health
conditions: "I think it will be great tool for the healthcare providers,
because you can't remember everything. And if you have all the data
combined in one platform, it will be very good and you can see the
progress, the risk factors all at once. So, you don't have to put them
together from the different lab results" (P8). Additionally, most of
them considered the dashboard to be a good source of motivation
for patients to create a better awareness of their health conditions:
"Patients also need to see some graphs to realize that their health is
not so good"(P3). However, they expressed some concern for older
patients to directly use this dashboard: "The younger patients would
use this but for the older patients I don't know" (P8). Even though our
prototype was designed around the needs of HCPs, an interesting
point of analyzing the patient's perspective was raised from their
feedback. Thus, we included patients as participants along with
HCPs during the evaluation of our high-fidelity prototype.
5 EVALUATION AND ANALYSIS OF
HIGH-FIDELITY PROTOTYPE
After analyzing the qualitative data collected from the previous
study, we implemented a high-fidelity web application prototype de-
veloped using Meteor, React.js, HTML, and CSS. The various charts
used in our interactive dashboard are developed using Chart.js and
the application is deployed using Docker. Fig. 3 presents a snap-
shot of our high-fidelity prototype. The prototype was evaluated
through an online user study in Prolific [42] as our recruitment
platform and Qualtrics [59] as our survey platform.
5.1 Design Rationale
From our first study, we observed that some of our participants
found it difficult to discover the interactive components from our
click-through prototype. Thus, we added icons as explicit indica-
tors for the visuals which supported what-if interactions in our
high-fidelity prototype. Additionally, we added tooltips with short
descriptions for each visual component. Furthermore, the mouse
cursor style was modified when the user hovered over the inter-
active components for encouraging them to click and observe the
changes in the interactive plots.
As many participants found the Risk Recovery (VC5) difficult to
interpret, we added interactive effects on hover that highlights the
risk zones of the patient. We aimed to increase user exploration
through interactions to increase understandability of this visual.
We also observed that our participants in our first study found
the Factors contributing to risk (VC3) to be less actionable than
the patient summary (VC2) and Recommendations to reduce risk
visual (VC4). Some of our participants suggested adding what-
if interactions to VC3 for making it more actionable. Thus, we
have considered this feedback and modified VC3 for supporting
what-if interactions. Another feedback was received for simplifying
the title of VC3 and so we renamed it Important Risk Factors. We
also swapped the position of VC3 and VC4 in the high-fidelity
prototype to improve the discoverability of the recommendations
as suggested by our participants.
Hence, we considered the feedback received through our ob-
servation and participant responses during the evaluation of our
click-through prototype to improve the design of our high-fidelity
prototype to effectively meet our user requirements.
5.2 Participants
This prototype was evaluated using 45 HCPs like nurses, physicians,
and medical workers and 51 diabetic patients. We recruited patients
who had been diagnosed with diabetes at least 6 months prior to
Directive Explanations for Monitoring the Risk of Diabetes Onset
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Figure 3: Dashboard design of the high-fidelity web application prototype. Visual explanations are provided using: Patient
information with the risk prediction chart (VC1), Patient Summary (VC2), Important Risk Factors (VC3), Recommendations
to reduce risk (VC4), Risk Recovery (VC5). This is the modified version of the dashboard used for final evaluation.
our experiment and HCPs' who were actively involved in patient
care. Using Prolific, the recruited participants were compensated
with an hourly rate of $10 for their time.
Table 3a presents the demographic information of our HCP par-
ticipants. Collectively, they had experience in dealing with all types
of patients in any age group with both acute and chronic disor-
ders (not just diabetes) from non-critical to critical nature. The
demographic information of our patient participants is presented
in Table 3b. All of our patient participants were actively in contact
with their HCPs and they had awareness of the risk factors of type-2
diabetes.
5.3 Procedure
We first gave an overview of the prototype to our participants and
suggested them to explore it on their own. Then, they were given
similar task-based questions as the previous study based on the four
supported tasks (T1, T2, T3, T4) through an online questionnaire.
Based on the information shown in our prototypical dashboard, our
participants were asked to identify patients with the most critical
condition, their current risk level, and whether their condition is
improving or not for task T1. For T2, they were asked to suggest
actions to reduce the high risk for a specific patient shown on
our dashboard. For T3, they were asked to justify why the system
indicated that a specific patient had a high risk while another had
a low risk. Finally, for T4, they were asked to compare a specific
patient's health factors with the recommended range of values for
the health factor and with those of the other patients.
Additionally, our participants had to justify their responses to the
task-based questions. We also asked them to report their perception
of the visual components in terms of understandability, usefulness
and trustworthiness through 4-point Likert Scale questions. We in-
cluded additional open-ended questions to gather more qualitative
data about actionability of our dashboard and their motivation for
using it.
During the evaluation process, we categorized all the responses
to the task-based questions into four categories: correct with suffi-
cient justification, correct with insufficient justification, guess / unin-
telligible and incorrect, similar to Lim et al. [33] as shown in Table 4.
We recorded their overall response time and mouse-movements
to track their interactions with our dashboard while answering
the given questions. Furthermore, we analyzed the qualitative re-
sponses about the actionability of our dashboard to understand
why the participants found it actionable and which component is
considered most actionable. Additionally, we categorized the quali-
tative responses about motivation to use our dashboard as positive,
negative or neutral to analyze their sentiments and understand the
rationale behind their responses.
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
Table 3: Information of participants recruited for the evaluation of the high-fidelity prototype
(a) HCPs
Participant distribution
United Kingdom (12/45)
South Africa (8/45)
Mexico (5/45)
Poland (4/45)
United States, Portugal (3/45)
Chile (2/45)
Finland, Sweden, Hungary,
Israel, Canada, Spain,
Italy, Germany (1/45)
17 : male
27 : female
1 : non-binary
26 : (21 - 30) years
11 : (31 - 40) years
2 : (41 - 50) years
6 : (51 - 60) years
1: Ph.D.
9 : Master's degree
35 : Bachelor's degree
12 : < 1-year
16 : (1 - 3) years
3 : (3 - 5) years
1 : (5 - 10) years
13 : > 10-years
Country
Gender
Age group
Highest education level
Experience in patient care
(b) Patients
Country
Gender
Age group
Highest education level
Diabetes duration
Participant distribution
United States (17/51)
South Africa (13/51)
United Kingdom (8/51)
Portugal (4/51)
Spain (3/51)
Poland (2/51)
Czech Republic, Estonia,
Norway, Italy (1/51)
27 : male
24 : female
1 : < 20-years
10 : (21 - 30) years
8 : (31 - 40) years
9 : (41 - 50) years
13 : (51 - 60) years
10 : > 60-years
5 : Master's degree
24 : Bachelor's degree
21 : High School degree
1 : Preferred not to disclose
2 : < 1-year
7 : (1 - 3) years
11 : (3 - 5) years
7 : (5 - 10) years
24 : > 10-years
Table 4: Grading rubric considered during evaluation of the high-fidelity prototype.
Correct with sufficient justification
Correct with insufficient justification Correct response but with only some rules or extra, unnecessary rules
Correct response with all correct rules and no extra, unnecessary rules
Guess/unintelligible
Incorrect
Correct response but with no reason, or with wrong interpretation of the visual(s)
Failed to give correct responses
We performed hypothesis testing with one-proportion z-test at
5% significance level [39] to measure the statistical significance
of the correct responses to the task-based questions. We aimed to
achieve to a success rate of 80% for the tasks supported by our
dashboard. Thus, our null hypothesis (H0) was that 80% of the par-
ticipants giving correct responses, while our alternate hypothesis
(HA) is more than 80% giving correct responses. We further noted
the proportion of participants giving correct responses with suffi-
cient and insufficient justifications. We used descriptive statistics
for the evaluation of the remaining questions considering their
format instead of hypothesis testing.
5.4 Observation and Results
HCP participants: We observed that 41 HCPs (91.1%) gave correct
responses for T1 questions (z =2.619, p= 0.0044). It was observed
that 84.4% of them provided sufficient justifications, while only
6.67% HCPs failed to provide sufficient justifications to their correct
responses. They mostly used the risk recovery visual to perform
this task. For questions asked for task T2, all 45 HCPs gave correct
responses (z=∞, p=0.00). However, 31.1% of them failed to provide
sufficient justifications. For task T3, 43 HCPs (95.56%) gave correct
responses (z=5.064, p=0.00). But only 4.4% of the correct responses
did not include sufficient justifications. Although most of them
reported using the patient summary (VC2) to perform tasks T3 and
T4, we observed them combining multiple visuals like VC2, VC3
and VC4. This indicates that the participants preferred combining
different explanation methods, i.e. data-centric, feature-importance,
and counterfactual explanations when suggesting actions and un-
derstanding the rationale behind the predicted risk. For T4, 33 HCPs
(73.3%) gave correct responses (z=-1.011, p=0.8441), out of which
11.1% did not include sufficient justifications. They mostly used
VC2 to perform this task.
We only failed to reject H0 for task T4, even though we observed
a high proportion (73.3%) of the HCP participants giving correct re-
sponses. For other tasks, we rejected H0, suggesting that more than
80% of HCPs can perform these tasks correctly. On investigating the
reason why 9 HCPs (20%) gave incorrect answers to T4 questions,
we observed that unlike the majority of the HCPs who used the
patient summary (VC2), they used the patient information provided
in VC1 to manually compare different patient records by using the
patient id filter. This involved many interactions and it was not
convenient to perform the comparisons manually. Therefore, many
of them failed to give the correct responses. Fig. 4 illustrates visual
Directive Explanations for Monitoring the Risk of Diabetes Onset
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Figure 4: Results obtained from the responses of the HCP participants. (left) Responses are categorized according to the grading
rubric in Table 4 for the tasks supported. (right) Chart showing the count of the participants using the visual components to
answer the task-based questions.
Figure 5: Diverging bar-charts summarizing the self-reported Likert-scale responses of the HCP group
components used by HCPs for all the task-based questions and
gives an overview of their responses to all the tasks.
Fig. 5 illustrates the self-reported responses to the Likert-scale
questions about understandability, usefulness, and trustworthiness
of the visual components of the HCP group. This group found the
Patient Summary (VC2) the easiest to understand and the most
useful. For trustworthiness, the HCPs found VC1 to be most trust-
worthy. Table 5 presents the proportion of participants for each
self-reported Likert scale question for both groups.
The majority (64.4%) of the HCPs considered VC2 as the most
actionable. They mentioned that the color-coded and graphical rep-
resentation of the health variables helped them to easily identify
risk factors that need immediate attention for suggesting actions.
However, most of them mentioned using two or more visuals to-
gether for suggesting actions and understanding the logic behind
the predicted risk. For instance, one of the participants mentioned:
"Given the patient summary it would make it easier to address the
most pressing risk factors for a patient and what they need to work
on at most".
For the motivation of using our dashboard, 44 HCPs (97.7%)
responded positively for using it as a screening tool during their
consultation with patients. They mentioned about using our dash-
board to show the risk levels and create more awareness for the
patients.
Patient participants : We observed that 39 patients (76.5%) gave
correct responses to T1 questions (z=-0.594, p=0.724). Despite 62.7%
of them giving sufficient justification for their correct responses,
we failed to reject H0. But as 45 of them (88.2%) could answer T2
questions correctly (z=1.825, p=0.034), we could reject H0. However,
we observed 43.14% of them failed to give sufficient justification
for their correct responses. On investigating further, we observed
that 58% of the older patients (>50 years) failed to give sufficient
explanations for T2 questions, indicating their understanding of
the visual components used to recommend actions was not fully
correct. Like T2 questions, 45 of them (88.2%) could answer T3
questions correctly (z=1.825, p=0.034). So, we could reject H0 for
T3 questions. But we observed 66.67% of them giving sufficient
justifications, while 21.57% gave insufficient justification for their
correct responses. For T4, we observed only 33 (64.7%) could give
correct responses (z=-2.286, p=0.98). Despite 54.9% of them giving
sufficient justification for their correct responses, we failed to re-
ject H0. Additionally, we observed that most older patients (>50
years) struggled with T4 as 50% of the older patients failed to give
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
Figure 6: Results obtained from the responses of the patient participants. (left) Responses are categorized according to the grad-
ing rubric in Table 4 for the tasks supported. (right) Chart showing the count of the participants using the visual components
to answer the task-based questions.
Figure 7: Diverging bar-charts summarizing the self-reported Likert-scale responses of the patient group
Table 5: Results showing the proportion of participants for the self reported responses to 4-point Likert Scale questions about
Understandability, Usefulness, Trustworthiness
Understandability
Very Easy to Understand
Somewhat Easy to Understand
Somewhat Difficult to Understand
Very Difficult to Understand
Usefulness
Trustworthiness
Always Useful
Sometimes Useful
Rarely Useful
Never Useful
Always Trust
Sometimes Trust
Rarely Trust
Never Trust
VC1
VC2
VC3
VC4
VC5
HCPs
Patients HCPs
Patients HCPS
Patients HCPS
Patients HCPs
Patients
55.5% 62.7%
42.2% 31.3%
1.9%
0%
3.9%
2.2%
78.4%
60%
33.3% 15.6%
1.9%
6.6%
3.9%
0%
66.6% 74.5%
31.1% 19.6%
1.9%
2.2%
3.9%
0%
64.4% 64.7%
33.3% 29.4%
1.9%
2.2%
3.9%
0%
77.7% 74.5%
19.6%
20%
1.9%
2.2%
3.9%
0%
68.8% 78.4%
24.4% 17.6%
6.6%
0%
0%
3.9%
60%
58.8%
33.3% 31.3%
5.8%
6.6%
3.9%
0%
66.6% 70.5%
24.4% 19.6%
5.8%
8.8%
3.9%
0%
64.4% 68.6%
33.3% 23.5%
3.9%
2.2%
3.9%
0%
62.2% 64.7%
33.3% 29.4%
1.9%
2.2%
3.9%
2.2%
60%
40%
0%
0%
66.6%
25.4%
1.9%
5.8%
57.7% 66.6%
33.3% 23.5%
5.8%
8.8%
3.9%
0%
46.7% 50.9%
33.3%
40%
9.8%
8.8%
5.8%
4.4%
48.8% 58.8%
40%
19.6%
11.1% 11.7%
9.8%
0%
51.1% 58.8%
42.2% 25.4%
9.8%
6.6%
5.8%
0%
sufficient explanations for T4 questions. Fig. 6 illustrates visual
components used by the patients for all the task-based questions
and gives an overview of their responses to all the tasks.
Figure 7 illustrates the responses of the patient group to the
Likert-scale questions about understandability, usefulness and trust-
worthiness of the visual components. This group found both VC2
and VC3 as the easiest to understand as compared to other visuals.
However, they found VC1 to be the most useful and VC2 to be
most trustworthy.
We observed the majority (68.6%) of the patients also considered
VC2 as the most actionable as they could easily identify the high-
risk factors similar to the HCP group. Like the HCPs, even this group
had mentioned combining multiple visuals together for all the given
tasks. For instance, one of the patient participants mentioned: "The
'Recommendations to reduce risk gives precise ways to reduce my risk
Directive Explanations for Monitoring the Risk of Diabetes Onset
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
of diabetes. The 'Patient Summary' section showed me areas where
my behavior, such as physical exercise, was too low in certain areas".
We observed that 48 patients (94.11%) responded positively when
asked about their motivation to use this dashboard. Most of them
mentioned interactive explanations increased their motivation as
they could see how the risk changes on changing the values of the
health variables.
6 DISCUSSION
6.1 Key Takeaways From Our User Studies
From our first user study, we collected feedback on the design of our
visually directive explanation methods from HCPs. We used their
feedback to make design changes discussed in Section 5.1 for our
web application prototype. We also collected an early indication of
the usefulness, understandability, actionability and trustworthiness
of the visual components from our participants.
In our second study, we collected data from a larger pool of
participants to validate our observations from the previous study.
The web application used in our second study was interactive and
enabled our participants to give better feedback. Also, the feedback
collected from patients along with HCPs helped us to justify the
effectiveness of our explanation methods included in our dashboard.
Results from our second study indicate that a significant propor-
tion of HCPs could successfully perform all the given tasks. Most
of them could provide sufficient justifications for their correct re-
sponses irrespective of their age group, domain expertise, or years
of experience in patient care. However, we observed older patients
(> 50 years) struggled with tasks for suggesting actions to reduce
risk (T2) and comparing their health measures with that of other
patients (T4). Further simplifications may be needed for this user
group.
Overall, our participants used data-centric explanation based
patient summary (VC2) and patient information (VC1) more than
other visuals for all the tasks. While explaining their responses,
most of them compared the current health measures with the rec-
ommended values of health variables. Color-coded representations
were considered more useful than graphical representations of the
data. This indicates that color-coded and interactive data-centric
explanations form a vital part of our explanation dashboard for
both HCPs and patients.
Unlike the HCPs, we observed a high proportion of patients
(68.6%) using the counterfactual-based recommendations (VC4) for
suggesting actions to minimize risk (T2). Some of them mentioned
that for getting quick suggestions, they preferred the recommenda-
tion list. But to get more detail on how these recommendations are
helpful, they relied on data-centric explanations.
Moreover, both HCPs and patients have mentioned combining
multiple visual components, especially for suggesting actions to
minimize high risk and understanding the rationale behind the
predicted risk. This suggests that the limitations of any explanation
method included in our dashboard can be complemented by the
other methods.
6.2 Addressing the Research Questions
RQ1. In what ways do patients and HCPs find our visually
directive explanation dashboard useful for monitoring and
evaluating the risk of diabetes onset? – Our results indicate
that both HCPs and patients found our explanation dashboard very
useful for monitoring and evaluating the risk of diabetes onset. As
inferred from our user studies, the interactive visual components
enabled our participants to explore and unravel the rationale behind
the predicted risk. They mentioned that interactive and directive
visuals, that show how the predicted risk changes when changing
the health variables, are useful to create more awareness for the
patients and drive change in their behavior.
RQ2. In what ways do HCP and patients perceive data-
centric, model-centric, and example-based visually directive
explanations in terms of usefulness, understandability, and
trustworthiness in the context of healthcare? – It was observed
that most of our participants justified the rationale behind the pre-
dicted risk by referring to the underlying patient data used for
training the ML model and its color-coded visual representations.
They mentioned about trusting the predictions as they could easily
relate the prediction with the underlying data. Thus, we get an
indication that data-centric explanations are more trustworthy and
useful than commonly adopted model-centric feature-importance
explanations, especially in healthcare.
However, as they mentioned using a combination of visual com-
ponents together, the significance of feature-importance explana-
tions cannot be neglected. Additionally, our participants have men-
tioned that the what-if interactions enabled them to explore our
dashboard and develop a better understanding of the visual ex-
planations. Also, our participants found the example-based coun-
terfactual explanations important and useful when they wanted
explanations in the form of recommendations.
Furthermore, our participants have shown a higher usage of
our representation of data-centric explanations through the pa-
tient summary (VC2) for performing given tasks and actions over
other explanation methods as they found them more informative.
However, in general, it was observed that more visual, interactive
explanations with reference to the recommended range of data
having concise textual descriptions are more useful to both HCPs
and patients.
RQ3. In what ways do visually directive explanations fa-
cilitate patients and HCPs to take action for improving pa-
tient conditions? – Patients reported that interactive explana-
tions increased their motivation of using our dashboard as a self-
screening tool as they could see how the risk changes on changing
the health variables. While HCPs wanted to use this dashboard
for better communication with patients during their consultations.
They found our dashboard to be actionable and useful as they can
utilize it for guiding patients in improving their health by showing
the high-risk factors. From the qualitative data collected through
our user studies, we inferred that the interactive visual explana-
tions enabled both HCPs and patients to explore how to alter the
predicted outcome along with explaining the factors that could
affect the predictions.
6.3 Tailoring Directive Explanations for
Healthcare Experts
We share our design implications for tailoring the visual represen-
tation of directive explanations for healthcare experts from our
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
observations and results. Our design implications are aligned with
the recommendations from Wang et al.'s framework [57].
Increasing actionability through interactive what-if analysis: Dur-
ing the evaluation of our low-fidelity prototype, our participants
highlighted that the conventional representation of feature-importance
explanations (as illustrated by factors contributing to risk visual in
Figure 1) was less actionable than data-centric explanations pre-
sented through the patient summary (VC2) as it was difficult for
them to understand how the risk factors affected the predicted risk.
Our modified design of this visual component (VC3) used in our
high-fidelity prototype enabled them to perform interactive what-if
analysis, i.e. allowed them to change the feature values and observe
the change in the overall prediction. Hence, we recommend the
usage of interactive design elements that allows what-if analysis
for representing directive explanations for HCPs. This recommen-
dation also supports hypothesis generation as proposed by Wang et
al. [57]
Explanations through actionable features instead of non-actionable
features: In our approach, we included only actionable variables for
visual components which supports what-if interactions and better
identification of coherent factors [57]. We anticipated that allowing
the ability to alter values of non-actionable variables can create
confusion for HCPs, especially for representing counterfactual ex-
planations. Thus, we propose providing explanations through ac-
tionable variables for suggesting actions that the user can perform
to obtain their desired outcomes.
Color-coded visual indicators: HCPs indicated that the color-
coded representations of risk factors were very useful for getting
quick insights. Hence, we recommend the usage of color-coded
representations and visual indicators to highlight factors that can
increase or decrease the predictor variable. This suggestion further
facilitates Wang et al.'s recommendation [57] of identifying coherent
factors.
Data-centric directive explanations: HCPs indicated that our rep-
resentation of data-centric explainability through the patient sum-
mary was very informative. They could easily identify how good
or bad the risk factors are for a specific patient. Additionally, they
could get an overview of how other patients are doing as compared
to a specific patient through the data-distribution charts. Thus, our
representation of data-centric explainability provided a local expla-
nation but with a global perspective. This suggestion is also aligned
with the recommendations from Wang et al. [57] as data-centric di-
rective explanations support forward reasoning by providing access
to source and situational data and yet can be easily integrated with
multiple explanation methods.
6.4 Limitations and Future Work
In this section, we articulated some limitations of this work: (1) Our
prototype used offline predictions about the overall risk generated
by our model instead of real-time predictions. The use of other ML
algorithms with real-time inference processes might impact the
perceived utility of the tool. (2) The prototype was evaluated with
HCPs with backgrounds in diverse specializations. Even though we
were able to reach a wider population, it would be more helpful to
evaluate this prototype with HCPs who are dedicated to taking care
of patients with type-2 diabetes. (3) The importance of different
explanation methods was examined jointly as part of the dashboard
and not analyzed independently. Consequently, the limitations of
some of the explanation methods could be concealed by the benefits
of other methods. (4) Since the prototype was personalized for
monitoring the risk of diabetes onset, the findings from this research
may not be applicable for monitoring other diseases as the user
needs for other diseases can be very distinct.
In our future studies, we aim to focus on personalizing directive
counterfactual explanations, as our participants had expressed a
need for a better representation of such explanations. Additionally,
we plan to analyze the utility of different explanation methods used
in the dashboard in isolation.
7 CONCLUSION
In this research work, we present a directive explanation dash-
board that combines visually represented data-centric, feature-
importance, and counterfactual explanations for monitoring the risk
of diabetes onset. Our research compared the different visual expla-
nations in terms of understandability, usefulness, actionability, and
trustworthiness with healthcare experts and patients. Our partici-
pants have shown a higher preference for the visually represented
data-centric explanations that provided local explanations with a
global overview, over other methods. Especially, we observed that
the color-coded risk factors and data-distribution charts in our visu-
ally directive data-centric explanations assisted healthcare experts
in suggesting actions to reduce risk by easily identifying high-risk
factors. Based on our results, we suggest using such data-centric
explanations combined with other explanations. We hope our re-
sults will inspire other researchers to utilize such visually directive
explanations to other specialization areas in healthcare as well.
ACKNOWLEDGMENTS
We would like to thank Oscar Alvarado, Robin De Croon, Maxwell
Szymanski, Houda Lamqaddam and Diego Rojo for providing help-
ful comments that improved this text. We also thank Lucija Gosak
for helping us with participant recruitment for our first user study.
This work was supported by Research Foundation–Flanders (FWO,
grant G0A3319N) and KU Leuven Internal Funds (grant C14/21/072).
REFERENCES
[1] Ashraf Abdul, Jo Vermeulen, Danding Wang, Brian Y. Lim, and Mohan Kankan-
halli. 2018. Trends and Trajectories for Explainable, Accountable and Intel-
ligible Systems: An HCI Research Agenda. In Proceedings of the 2018 CHI
Conference on Human Factors in Computing Systems (Montreal QC, Canada)
(CHI '18). Association for Computing Machinery, New York, NY, USA, 1–18.
https://doi.org/10.1145/3173574.3174156
[2] Amina Adadi and Mohammed Berrada. 2018. Peeking Inside the Black-Box: A
Survey on Explainable Artificial Intelligence (XAI). IEEE Access 6 (2018), 52138–
52160. https://doi.org/10.1109/ACCESS.2018.2870052
[3] Ariful Islam Anik and Andrea Bunt. 2021. Data-Centric Explanations: Explain-
ing Training Data of Machine Learning Systems to Promote Transparency. In
Proceedings of the 2021 CHI Conference on Human Factors in Computing Systems
(Yokohama, Japan) (CHI '21). Association for Computing Machinery, New York,
NY, USA, Article 75, 13 pages. https://doi.org/10.1145/3411764.3445736
[4] Anna Markella Antoniadi, Yuhan Du, Yasmine Guendouz, Lan Wei, Claudia Mazo,
Brett A. Becker, and Catherine Mooney. 2021. Current Challenges and Future
Opportunities for XAI in Machine Learning-Based Clinical Decision Support
Systems: A Systematic Review. Applied Sciences 11, 11 (2021). https://doi.org/10.
3390/app11115088
[5] Aditya Bhattacharya. 2022. Applied Machine Learning Explainability Techniques.
In Applied Machine Learning Explainability Techniques. Packt Publishing, Birm-
ingham, UK. https://www.packtpub.com/product/applied-machine-learning-
Directive Explanations for Monitoring the Risk of Diabetes Onset
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
explainability-techniques/9781803246154
https://doi.org/10.1007/s11257-019-09247-2
[6] Clara Bove, Jonathan Aigrain, Marie-Jeanne Lesot, Charles Tijus, and Marcin
Detyniecki. 2022. Contextualization and Exploration of Local Feature Importance
Explanations to Improve Understanding and Satisfaction of Non-Expert Users
(IUI '22). Association for Computing Machinery, New York, NY, USA, 807–819.
https://doi.org/10.1145/3490099.3511139
[7] Virginia Braun and Victoria Clarke. 2012. Thematic Analysis. In APA Handbook
of Research Methods in Psychology, Vol 2: Research Designs: Quantitative, Quali-
tative, Neuropsychological, and Biological. American Psychological Association,
Washington, DC, US, 57–71. https://doi.org/10.1037/13620-004
[8] Adrian Bussone, Simone Stumpf, and Dympna O'Sullivan. 2015. The Role of
Explanations on Trust and Reliance in Clinical Decision Support Systems. https:
//doi.org/10.1109/ICHI.2015.26
[9] Carrie J. Cai, Emily Reif, Narayan Hegde, Jason Hipp, Been Kim, Daniel Smilkov,
Martin Wattenberg, Fernanda Viegas, Greg S. Corrado, Martin C. Stumpe, and
Michael Terry. 2019. Human-Centered Tools for Coping with Imperfect Algo-
rithms during Medical Decision-Making. https://doi.org/10.48550/ARXIV.1902.
02960
[10] Gabriella Casalino, Giovanna Castellano, Vincenzo Pasquadibisceglie, and Gi-
anluca Zaza. 2018. Contact-Less Real-Time Monitoring of Cardiovascular Risk
Using Video Imaging and Fuzzy Inference Rules. Information 10 (12 2018), 9.
https://doi.org/10.3390/info10010009
[11] Hao Fei Cheng, Ruotong Wang, Zheng Zhang, Fiona O'Connell, Terrance Gray,
F. Maxwell Harper, and Haiyi Zhu. 2019. Explaining Decision-Making Algorithms
through UI: Strategies to Help Non-Expert Stakeholders. Proceedings of the 2019
CHI Conference on Human Factors in Computing Systems (2019).
[12] Hwayoung Cho, Gail Keenan, Olatunde O Madandola, Fabiana Cristina Dos San-
tos, Tamara G R Macieira, Ragnhildur I Bjarnadottir, Karen J B Priola, and Karen
Dunn Lopez. 2022. Assessing the Usability of a Clinical Decision Support
System: Heuristic Evaluation. JMIR Hum Factors 9, 2 (10 May 2022), e31758.
https://doi.org/10.2196/31758
[13] Richard Dazeley, Peter Vamplew, Cameron Foale, Charlotte Young, Sunil Aryal,
and Francisco Cruz. 2021. Levels of explainable artificial intelligence for human-
aligned conversational explanations. Artificial Intelligence 299 (2021), 103525.
[14] Figma. 2022. . Figma. https://www.figma.com/ Accessed: 2022-08-25.
[15] Luis Fregoso-Aparicio, Julieta Noguez, Luis Montesinos, and José García-García.
2021. Machine learning and deep learning predictive models for type 2 diabetes:
a systematic review. Diabetology and Metabolic Syndrome 13 (12 2021). https:
//doi.org/10.1186/s13098-021-00767-9
[16] Stephanie Galaitsi, Benjamin D. Trump, Jeffrey M. Keisler, Igor Linkov, and
Alexander Kott. 2022. Cybertrust: From Explainable to Actionable and Inter-
pretable AI (AI2). (2022). https://doi.org/10.48550/ARXIV.2201.11117
[17] Fatih Gedikli, Dietmar Jannach, and Mouzhi Ge. 2013. How should I explain? A
comparison of different explanation types for recommender systems. Interna-
tional Journal of Human-Computer Studies 72 (01 2013). https://doi.org/10.1016/j.
ijhcs.2013.12.007
[18] Oscar Gomez, Steffen Holter, Jun Yuan, and Enrico Bertini. 2020. ViCE: Visual
Counterfactual Explanations for Machine Learning Models. https://doi.org/10.
48550/ARXIV.2003.02428
[19] Stefan Grafberger, Paul Groth, and Sebastian Schelter. 2022. Towards Data-
Centric What-If Analysis for Native Machine Learning Pipelines. In Proceedings
of the Sixth Workshop on Data Management for End-To-End Machine Learning
(Philadelphia, Pennsylvania) (DEEM '22). Association for Computing Machinery,
New York, NY, USA, Article 3, 5 pages. https://doi.org/10.1145/3533028.3533303
[20] Francisco Gutiérrez, Nyi Nyi Htun, Vero Vanden Abeele, Robin De Croon, and
Katrien Verbert. 2022. Explaining Call Recommendations in Nursing Homes: A
User-Centered Design Approach for Interacting with Knowledge-Based Health
Decision Support Systems. In 27th International Conference on Intelligent User
Interfaces (Helsinki, Finland) (IUI '22). Association for Computing Machinery,
New York, NY, USA, 162–172. https://doi.org/10.1145/3490099.3511158
[21] Robert R. Hoffman, Shane T. Mueller, Gary Klein, and Jordan Litman. 2018.
Metrics for Explainable AI: Challenges and Prospects. https://doi.org/10.48550/
ARXIV.1812.04608
[22] Frederick Hohman, Andrew Head, Rich Caruana, Robert Deline, and Steven
Drucker. 2019. Gamut: A Design Probe to Understand How Data Scientists
Understand Machine Learning Models.
, 13 pages. https://doi.org/10.1145/
3290605.3300809
[23] Andreas Holzinger, Chris Biemann, Constantinos S. Pattichis, and Douglas B.
Kell. 2017. What do we need to build explainable AI systems for the medical
domain? https://doi.org/10.48550/ARXIV.1712.09923
[24] Sheikh Rabiul Islam, William Eberle, Sheikh Khaled Ghafoor, and Mohiuddin
Ahmed. 2021. Explainable Artificial Intelligence Approaches: A Survey. (2021).
https://doi.org/10.48550/ARXIV.2101.09429
[25] Liu Jiang, Shixia Liu, and Changjian Chen. 2018. Recent Research Advances on
Interactive Machine Learning. (2018). https://doi.org/10.48550/ARXIV.1811.04548
[26] Yucheng Jin, Nava Tintarev, Nyi Nyi Htun, and Katrien Verbert. 2020. Effects
of personal characteristics in control-oriented user interfaces for music rec-
ommender systems. User Modeling and User-Adapted Interaction 30 (04 2020).
[27] Alessandro Blasimme Julia Amann, Dietmar Frey Effy Vayena, and Vince I. Madai
on behalf of the Precise4Q consortium. 2022. Explainability for artificial intelli-
gence in healthcare: a multidisciplinary perspective. BMC Medical Informatics
and Decision Making (2022). https://doi.org/10.1186/s12911-020-01332-6
[28] Amir-Hossein Karimi, Bernhard Schölkopf, and Isabel Valera. 2020. Algorithmic
Recourse: from Counterfactual Explanations to Interventions. https://doi.org/
10.48550/ARXIV.2002.06278
[29] Josua Krause, Adam Perer, and Kenney Ng. 2016. Interacting with Predictions:
, 5686-5697 pages.
Visual Inspection of Black-box Machine Learning Models.
https://doi.org/10.1145/2858036.2858529
[30] Todd Kulesza, Margaret Burnett, Weng-Keen Wong, and Simone Stumpf. 2015.
Principles of Explanatory Debugging to Personalize Interactive Machine Learning.
In Proceedings of the 20th International Conference on Intelligent User Interfaces
(Atlanta, Georgia, USA) (IUI '15). Association for Computing Machinery, New
York, NY, USA, 126–137. https://doi.org/10.1145/2678025.2701399
[31] Markus Langer, Daniel Oster, Timo Speith, Holger Hermanns, Lena Kästner,
Eva Schmidt, Andreas Sesing, and Kevin Baum. 2021. What do we want from
Explainable Artificial Intelligence (XAI)? – A stakeholder perspective on XAI and
a conceptual model guiding interdisciplinary XAI research. Artificial Intelligence
296 (jul 2021), 103473. https://doi.org/10.1016/j.artint.2021.103473
[32] Q. Vera Liao, Daniel Gruen, and Sarah Miller. 2020. Questioning the AI: Informing
(2020), 1–15. https:
Design Practices for Explainable AI User Experiences.
//doi.org/10.1145/3313831.3376590
[33] Brian Y. Lim, Anind K. Dey, and Daniel Avrahami. 2009. Why and Why Not
Explanations Improve the Intelligibility of Context-Aware Intelligent Systems
(CHI '09). Association for Computing Machinery, New York, NY, USA, 2119–2128.
https://doi.org/10.1145/1518701.1519023
[34] Scott Lundberg and Su-In Lee. 2017. A Unified Approach to Interpreting Model
Predictions. (2017). https://doi.org/10.48550/ARXIV.1705.07874
[35] Mark Mazumder, Colby Banbury, Xiaozhe Yao, Bojan Karlaš, William Gaviria
Rojas, Sudnya Diamos, Greg Diamos, Lynn He, Douwe Kiela, David Jurado, David
Kanter, Rafael Mosquera, Juan Ciro, Lora Aroyo, Bilge Acun, Sabri Eyuboglu,
Amirata Ghorbani, Emmett Goodman, Tariq Kane, Christine R. Kirkpatrick, Tzu-
Sheng Kuo, Jonas Mueller, Tristan Thrush, Joaquin Vanschoren, Margaret Warren,
Adina Williams, Serena Yeung, Newsha Ardalani, Praveen Paritosh, Ce Zhang,
James Zou, Carole-Jean Wu, Cody Coleman, Andrew Ng, Peter Mattson, and Vi-
jay Janapa Reddi. 2022. DataPerf: Benchmarks for Data-Centric AI Development.
https://doi.org/10.48550/ARXIV.2207.10062
[36] Ninareh Mehrabi, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram
Galstyan. 2019. A Survey on Bias and Fairness in Machine Learning. (2019).
https://doi.org/10.48550/ARXIV.1908.09635
[37] Tim Miller. 2017. Explanation in Artificial Intelligence: Insights from the Social
Sciences. https://doi.org/10.48550/ARXIV.1706.07269
[38] Ramaravind K Mothilal, Amit Sharma, and Chenhao Tan. 2020. Explaining
machine learning classifiers through diverse counterfactual explanations. In
Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency.
607–617.
[39] Department of Statistics. 2022. Statistics Online S.6 Test of Proportion. PennState
https://online.stat.psu.edu/statprogram/reviews/
Eberly College of Science.
statistical-concepts/proportions Accessed: 2022-08-30.
[40] Jeroen Ooge and Katrien Verbert. 2022. Explaining Artificial Intelligence with
, 120-123 pages. https://doi.org/10.1145/
Tailored Interactive Visualisations.
3490100.3516481
[41] Urja Pawar, Donna O'Shea, Susan Rea, and Ruairi O'Reilly. 2020. Incorporating
Explainable Artificial Intelligence (XAI) to aid the Understanding of Machine
Learning in the Healthcare Domain.
[42] Prolific Platform. 2022. . Prolific. https://www.prolific.co/ Accessed: 2022-08-15.
[43] Sreekanth Rallapalli. 2016. Improving Healthcare-Big Data Analytics for Elec-
tronic Health Records on Cloud. Journal of Advances in Information Technology
7, 1 (2016), 65–68. https://doi.org/10.12720/jait.7.1.65-68
[44] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2016. "Why Should
https:
I Trust You?": Explaining the Predictions of Any Classifier.
//doi.org/10.48550/ARXIV.1602.04938
(2016).
[45] Abdallah Abbas Ritvij Singh, Edward Korot Sara Beqiri, Peter Woodward-Court
Robbert Struyven, and Pearse Keane. 2021. Exploring the What-If-Tool as a solu-
tion for machine learning explainability in clinical practice. Invest. Ophthalmol.
Vis. Sci. 2021;62(8):79. (2021).
[46] Diego Rojo, Nyi Nyi Htun, Denis Parra, Robin De Croon, and Katrien Verbert.
2021. AHMoSe: A knowledge-based visual support system for selecting regression
machine learning models. Computers and Electronics in Agriculture 187 (aug 2021),
106183. https://doi.org/10.1016/j.compag.2021.106183
[47] Sheila A Ryan. 1985. An expert system for nursing practice. Journal of medical
systems 9, 1 (1985), 29–41.
[48] Waddah Saeed and Christian Omlin. 2021. Explainable AI (XAI): A Systematic
Meta-Survey of Current Challenges and Future Opportunities. (2021). https:
//doi.org/10.48550/ARXIV.2111.06420
IUI '23, March 27–31, 2023, Sydney, NSW, Australia
Bhattacharya, et al.
[49] Ronal Singh, Paul Dourish, Piers Howe, Tim Miller, Liz Sonenberg, Eduardo Vel-
loso, and Frank Vetere. 2021. Directive Explanations for Actionable Explainability
in Machine Learning Applications. (2021). https://doi.org/10.48550/ARXIV.2102.
02671
[50] Kacper Sokol and Peter Flach. 2020. Explainability fact sheets. In Proceedings of
the 2020 Conference on Fairness, Accountability, and Transparency. ACM. https:
//doi.org/10.1145/3351095.3372870
[51] Alexander Spangher and Berk Ustun. 2018. Actionable Recourse in Linear Classi-
fication. https://doi.org/10.1145/3287560.3287566
[52] Thilo Spinner, Udo Schlegel, Hanna Hauptmann, and Mennatallah El-Assady.
2019. explAIner: A Visual Analytics Framework for Interactive and Explainable
Machine Learning. (07 2019).
[53] Gregor Stiglic, P Kocbek, Leona Cilar Budler, Nino Fijacko, Andraz Stozer, Jelka
Zaletel, Aziz Sheikh, and Petra Povalej. 2018. Development of a screening tool
using electronic health records for undiagnosed Type 2 diabetes mellitus and
impaired fasting glucose detection in the Slovenian population. Diabetic medicine
: a journal of the British Diabetic Association 35 (02 2018). https://doi.org/10.1111/
dme.13605
[54] Gregor Stiglic, Primoz Kocbek, Nino Fijacko, Marinka Zitnik, Katrien Verbert,
and Leona Cilar. 2020. Interpretability of machine learning-based prediction
models in healthcare. Wiley Interdisciplinary Reviews: Data Mining and Knowledge
Discovery 10, 5 (2020), e1379.
[55] Maxwell Szymanski, Martijn Millecamp, and Katrien Verbert. 2021. Visual, textual
or hybrid: the effect of user expertise on different explanations. 26th International
Conference on Intelligent User Interfaces (2021).
[56] Erico Tjoa and Cuntai Guan. 2021. A Survey on Explainable Artificial Intelligence
(XAI): Toward Medical XAI. IEEE Transactions on Neural Networks and Learning
Systems 32, 11 (nov 2021), 4793–4813. https://doi.org/10.1109/tnnls.2020.3027314
[57] Danding Wang, Qian Yang, Ashraf Abdul, and Brian Y. Lim. 2019. Designing
Theory-Driven User-Centric Explainable AI (CHI '19). Association for Computing
Machinery, New York, NY, USA, 1–15. https://doi.org/10.1145/3290605.3300831
[58] James Wexler, Mahima Pushkarna, Tolga Bolukbasi, Martin Wattenberg, Fernanda
Viegas, and Jimbo Wilson. 2019. The What-If Tool: Interactive Probing of Machine
Learning Models. IEEE Transactions on Visualization and Computer Graphics PP
(08 2019), 1–1. https://doi.org/10.1109/TVCG.2019.2934619
[59] Qualtrics XM. 2022. . Qualtrics. https://www.qualtrics.com/ Accessed: 2022-08-
15.
|
http://arxiv.org/abs/2302.10669v2 | 2023-03-07T13:06:51 | 2023-02-21T13:39:40 | UAV Path Planning Employing MPC- Reinforcement Learning Method
Considering Collision Avoidance | In this paper, we tackle the problem of Unmanned Aerial (UA V) path planning
in complex and uncertain environments by designing a Model Predictive Control
(MPC), based on a Long-Short-Term Memory (LSTM) network integrated into the
Deep Deterministic Policy Gradient algorithm. In the proposed solution,
LSTM-MPC operates as a deterministic policy within the DDPG network, and it
leverages a predicting pool to store predicted future states and actions for
improved robustness and efficiency. The use of the predicting pool also enables
the initialization of the critic network, leading to improved convergence speed
and reduced failure rate compared to traditional reinforcement learning and
deep reinforcement learning methods. The effectiveness of the proposed solution
is evaluated by numerical simulations. | [
"Mahya Ramezani",
"Hamed Habibi",
"Jose luis Sanchez Lopez",
"Holger Voos"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10669v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10669v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"cs.RO"
] | UAV Path Planning Employing MPC-
Reinforcement Learning Method Considering
Collision Avoidance
Hamed Habibi
Centre for Security, Reliability, and
Trust
University of Luxembourg
Luxembourg, Luxembourg
[email protected]
Jose Luis Sanchez-Lopez
Centre for Security, Reliability, and
Trust
University of Luxembourg
Luxembourg, Luxembourg
[email protected]
Mahya Ramezani
Centre for Security, Reliability, and
Trust
University of Luxembourg
Luxembourg, Luxembourg
[email protected]
Holger Voos
Centre for Security, Reliability, and
Trust
University of Luxembourg
Luxembourg, Luxembourg
[email protected]
Abstract-In this paper, we tackle the problem of Unmanned
Aerial (UAV) path planning in complex and uncertain
environments by designing a Model Predictive Control (MPC),
based on a Long-Short-Term Memory (LSTM) network
integrated
into the Deep Deterministic Policy Gradient
algorithm. In the proposed solution, LSTM-MPC operates as a
deterministic policy within the DDPG network, and it leverages
a predicting pool to store predicted future states and actions for
improved robustness and efficiency. The use of the predicting
pool also enables the initialization of the critic network, leading
to improved convergence speed and reduced failure rate
compared to traditional reinforcement learning and deep
reinforcement learning methods. The effectiveness of the
proposed solution is evaluated by numerical simulations.
Keywords-path planning, reinforcement learning, model
predictive control, LSTM network modeling, improved DDPG
algorithm
I. INTRODUCTION
Nowadays, Unmanned Aerial Vehicles (UAVs) are being
increasingly used in various industries, e.g., agriculture,
mining, and construction, with different applications, such as
monitoring,
reconnaissance, and
mapping [1-3]. For this, UAV path planning plays a vital role
in determining and tracking efficient and safe flight paths
considering
terrain, weather conditions, and dynamic
obstacles.
inspection, detection,
Path planning, in the context of UAV navigation, refers to
determining the best route for the UAV to follow while
avoiding obstacles and reaching its destination [4, 5]. Early
path planning methods were mainly graph-based, which could
not handle dynamic obstacles [6, 7]. Subsequently, Artificial
Potential Field (APF), Rapid exploration Random Tree
(RRT), and D* algorithms were proposed as solutions for
dynamic environments[8, 9]. However, APF can be stuck in
local minima, RRT is unsuitable for continuous, highly
dynamic environments, and the planned path is usually
suboptimal and nonsmooth. Even though the D* algorithm
in a dynamic environment,
effectively finds a path
convergence is still challenging in complex environments
with many obstacles and dynamic obstacles.
To resolve these issues, Reinforcement Learning (RL) has
emerged as a promising approach for UAV path planning.
Salient features of RL, such as learning from experience and
improving decision-making over time, make it a well-suited
approach for UAV path planning in dynamic and uncertain
environments[10]. RL can overcome traditional methods'
limitations by allowing the UAV to adapt to time-varying
conditions and obstacles. Additionally, the uncertainty and
randomness of complex environments can be tackled by RL-
based algorithms [11]. However, the poor performance of RL
methods for handling high-dimensional systems is the main
drawback that might make it impractical.
Deep Reinforcement Learning (DRL) is a recent Artificial
intelligence (AI) technique that combines the strengths of
Deep Learning and RL to solve decision-making problems for
high-dimension systems. Therefore, DRL has been applied to
UAV path planning in complex scenarios [12], resulting in
more efficient and accurate solutions. For instance, in [13], the
path
robustness were
demonstrated. Furthermore, similar studies highlight the
practical benefits of DRL for improving UAV path planning,
addressing the challenges of dynamic obstacle avoidance and
real-time decision-making in complex environments while
handling the high-dimension issue [13-15].
smoothness,
efficiency,
and
Moreover, DRL methods require an approximation of the
action-value function, often using deep neural networks
(DNNs) [16]. However, it can be challenging to analyze the
performance of a system controlled by an RL algorithm with
an approximate policy represented by a DNN or another
function approximation, which is especially important for
systems with critical safety requirements. Furthermore, DNN-
based RL has limitations regarding stability analysis,
state/input constraints satisfaction, and meaningful weight
initialization [17].
equipped with a LIDAR for obstacle avoidance and a GPS for
positioning.
Recently, Model Predictive Control (MPC)-based RL
approaches have been proposed to overcome these limitations,
which suggests using MPC as the function approximation for
the optimal policy in RL. MPC involves solving an optimal
control problem at each time step to determine the best control
policy [18]. As a result, MPC not only generates an optimal
input and state sequence for the entire prediction horizon but
also has the ability to anticipate future actions based on the
predicted state [19]. MPC can handle complex and uncertain
environments by providing a structured approach to control.
On the other hand, the DRL component provides the ability to
learn from experience and optimize control performance over
time., It also can adapt to new situations and improve
performance over time.
The main drawback of MPC is the high computational
complexity, which can be tackled by using semi-accurate
models of the controlled process to provide predictions [20].
It should be mentioned that the predictive model's accuracy
directly impacts the MPC framework's performance. Utilizing
a DNN to predict the model provides a more accurate and
reliable representation of the system dynamics, thereby
enhancing the effectiveness of the MPC framework [21]. The
Long-Short-Term-Memory (LSTM) network, as a DNN, can
extract sequential features and handle complex dependencies,
making it ideal for predicting sequential processes [22].
Motivated by the considerations mentioned above, in this
paper, we propose an LSTM-based-MPC system that operates
as a deterministic policy within the Deep Deterministic Policy
Gradient (DDPG) network, providing a robust and efficient
solution for UAV path planning problem in unknown
environments. Integrating the LSTM-MPC solution into the
DDPG framework addresses the challenges posed by real-
time path planning and results in improved convergence speed
and reduced failure, offering a promising solution for path
planning problems in complex and uncertain environments.
The main contributions of this paper are as follows.
• Combining LSTM -MPC and DDPG algorithms to handle
the high dimensionality of the state space, the uncertainty and
variability of the obstacles' trajectories, and the real-time
constraints of the system.
• Implementation of the LSTM-MPC-based model as an
actor network in the DDPG framework
• Defining a predicting pool for predicting future state and
corresponding actions
The rest of the paper is structured as follows. Section 2
outlines the path planning problem. Section 3 describes the
proposed LSTM-MPC DDPD method. Section 4 presents the
experiments carried out to assess the algorithm's performance.
Concluding remarks are given in Section 5.
II. PROBLEM FORMULATION AND PRELIMINARIES
This paper proposes a novel method for path planning for
UAVs in unknown environments with static and dynamic
obstacles. The problem is safe path planning in case of limited
knowledge of the environment. Path planning aims to find the
optimal path in considering obstacle avoidance. The UAV is
A. Problem definition
The environment is modeled as a Markov Decision
Process. The UAV is equipped with a LIDAR for obstacle
avoidance and a GPS for positioning. The GPS sensor
provides precise navigation and localization capabilities,
enabling the UAV to maintain its position and navigate to the
target point with high accuracy. The LiDAR sensor, on the
other hand, offers real-time 3D mapping and obstacle
detection capabilities, enabling the UAV to perceive and
avoid dynamic obstacles present in the field. The UAV
dynamics are presented in [23], which is not repeated here for
brevity.
Here, the safe UAV path planning problem in an unknown
environment with static and dynamic obstacles is tackled with
limited knowledge of the environment.
B. The Markov Decision Process
The Markov Decision Process (MDP) is a well-established
mathematical framework for modeling decision-making
problems in the presence of uncertainty. MDP is defined by a
tuple ⟨S, A, P, R, γ ⟩, where S denotes a finite set of states, A
denotes a finite set of actions, P represents the state transition
probabilities as
" = P[S#$% = s | S# = s, A# = a]
p!!
R denotes the reward function as
" = E[R#| S# = s, A# = a ]
R!
and γ is the discount factor, which lies in the interval [0, 1]
and with a stage cost l(s, a).
(1)
(2)
Consider deterministic policy delivery of the control input
a = π(s), resulting in state distribution τ& . RL's goal is to
find the optimal policy π∗ by solving the minimization
*
problem π∗ ≔ arg min J(π) = E(![∑
)+,
l(s), π(s)))].
γ)
In RL, important quantities are the action-value function
Q∗(s, a) and value function V∗(s) associated with the optimal
policy π∗(s), which are defined by the Bellman equations
Q∗(s, a) = l(s, a) + γE [V∗(s#$%) | s, a]
V∗(s) = Q∗Ds, π∗(s)E = min
Q∗(s, a)
(3)
(4)
"
C. MDP formulation
1) State
The proper action is chosen based on the current state of
the UAV. The obstacle is cylindrical shape and unknown in
the environment. Moreover, the shape of the environment is a
rectangle. The state of the UAV is represented by a state
vector consisting of the position of the UAV in the world
frame, represented by (x, y, z), and the velocity of the UAV
along the X, Y, and Z axes, represented by (v-, v., v/).
For ease of navigation towards the target, the absolute
position of the UAV is transformed into its relative position
with respect to the target. The environment information is
gathered using Lidar distance sensors, with a scan angle range
of π and an angle of π/6 between each pair of rays. The
environment observations are divided into 7 sensors in the
horizontal plane and 7 in the vertical plane. The state
represented:
S = [x, y, z, v-, v., v/, φ, θ, ψ, x#, y#, z#, d0, ... , d0]
(5)
three-degree-of-freedom kinematic model
To simplify the description of the UAV's position and
is
motion, a
adopted in this study. The assumption is that the UAV
maintains a constant horizontal altitude, thus confining its
movement to the x-y plane. By disregarding the momentum
effects during flight and assuming a constant velocity v, the
position, and motion of the UAV are represented by the vector
ζ = [x, y, ψ].
Five variables represent the state of the UAV in 2D (x, y)
for its position in the world frame Dv-, v.E for its velocity
along the X and Y axes, and ψ for the angle between its first-
perspective direction and the line connecting the UAV to the
target.
The relative position between the UAV and the target can
be transformed to make it easier to reach the target. The
environment information is obtained using laser distance
sensors, which have a scan angle range of π and an angle
between each two laser rays of π/6. The observations are 7
sensors in the horizontal plane. And the state represented for
UAV in a simplified environment is as follows
S = [x# − x, y# − y, v-, v., v, ψ, d0, ... , d0]
(6)
2) Action
the control of the UAV is simplified to only two
commands - speed and yaw angle. The control vector of the
UAV is represented as a = [a1, a2] where a1 is the current
speed ratio to the maximum speed, with a range of values
between -1 and 1. a2 is a steering signal that determines the
desired yaw angle, with a range of values between -1 and 1.
3) Reward function
The reward function for the UAV in the given scenario is
a combination of four parts. It aims to guide the UAV to reach
the target area while ensuring its safety, defined as follows.
Distance Reward: The negative value of the distance between
the UAV and the target point is used as a penalty to encourage
the UAV to reach the target area. The UAV will receive a
positive reward if it reaches the target area. The relative
distances represent the difference between the present
location and the destination. We assume the difference
between the UAV and its target in the previous and current
stages, respectively.
d34! = d56789# − d:781;6!
−0.1 d34! > 0
1 d34! < 0
r% = V
Step Penalty: To make the UAV reach the target area as soon
as possible, a penalty of r< = −0.01 is given to the UAV at
each step.
Orientation Penalty: the negative value of the angle between
the UAV's first-perspective direction and the connection line
of the UAV and the target is taken as a penalty to help the
UAV approach the target in the direction towards the target.
It is considered r= = −0.01.
Obstacles Penalty: To keep the UAV away from obstacles,
first should define a safe distance to prevent collision with the
obstacles. When the distance between the UAV and the
nearest obstacle is less than the safe distance, the UAV
receives a penalty for the distance. If the UAV collides with
(7)
obstacles, it receives another penalty. Otherwise, it does not
receive any punishments if the distance exceeds the safe
distance.
r> = Z
−0.1 d!"?8 > 0
−1 collision
0 else
(8)
Therefore, the reward received by the UAV at the current
moment can be expressed as follows:
R = w%r% + w<r< + w=r= + w>r>
To mention more attention on collision avoidance to reduce
risk and have safe path planning and the optimal path, we
chose the weight of the w% and w> more than w< and w=
(9)
III. METHODOLOGY
A. Deep Deterministic Policy Gradients
Deep Deterministic Policy Gradients (DDPG) is a popular
DRL algorithm that combines elements of both value-based
and policy-based RL methods. It operates within the
framework of an actor-critic architecture where the actor
network is responsible for selecting actions based on the
current state of the environment. The critic network is used to
judge the value of the actions taken by the actor. The two
networks are trained simultaneously using the same set of
experiences collected by the agent during its interactions with
the environment. In order to overcome the problems of
correlation between samples in reinforcement learning, the
DDPG algorithm employs a replay buffer that stores
experience and random samples from this buffer when
the
updating
deterministic policy gradient theorem for Markov Decision
Processes (MDPs) with continuous action spaces, trains the
networks using stochastic gradient descent with mini-batches,
and updates the target networks using a soft update algorithm.
It is a visual illustration of the actor-critic architecture,
including the Q network and μ network, and their interactions
with the environment. The use of a target network and the
replay buffer are also depicted in Figure 1, highlighting their
role in improving the stability and sample efficiency of the
algorithm.
the networks. DDPG
is derived from
B. The Long Short-Term Memory Model Predictive Control
1) LSTM
LSTM is a Recurrent Neural Network (RNN) type that
features external recurrences from the outputs to the hidden
layer's inputs and internal recurrence between LSTM cells. In
each LSTM cell, a set of gating units regulates the information
flow, enabling the network to remember or forget information
based on a sequence of inputs [24]. The LSTM network
consists of an input layer, multiple hidden layers, and an
output layer. Its uniqueness lies in its memory cells in the
hidden layers, which allow data to be learned by maintaining
or adjusting the memory cell's state. The proposed LSTM
model was built using the deep learning toolbox in MATLAB.
To optimize the LSTM structure, learning parameters are
specified and summarized in Table 1. The set values for these
parameters were chosen based on recommendations from
MATLAB and previous research.
Table 1. The LSTM hyperparameters.
C. LSTM-MPC-DDPG
Parameter
Optimization algorithm
Initial learn rate
Hidden layer
Hidden unit
Max epochs
Value
Adam
0.01
3
200(3)
100
2) The Long Short-Term Memory Model Predictive
Control
The Long Short-Term Memory Model Predictive Control
(LSTM-MPC) is a novel control algorithm that combines the
strengths of Model Predictive Control (MPC) and LSTM
networks. The LSTM network models the state dynamics of a
system, while MPC is used to generate control actions based
on state predictions. LSTM-MPC aims to find an optimal
control sequence, u∗, that minimizes a cost function, J, over a
set of predicted states and control actions in real-time
environments.
The LSTM network predicts state dynamics based on the
current state and control actions. Given the initial states, s,,
and control actions, u, the LSTM network predicts the next
state, s{#$%}.
MPC generates control actions, u, based on predicted
states, s. The control actions are computed by minimizing the
cost function, J, over predicted states and control actions using
a quadratic program (QP). The predicted states and control
actions are inputs to the optimization problem, and the optimal
control actions are the outputs.
The algorithm offers several advantages, including
improved state prediction accuracy, handling unknown state
dynamics, and incorporating constraints on control actions
and states. On the other hand, it can face Several challenges
that can arise when using LSTM-MPC for path planning with
collision avoidance and considering unknown dynamic
obstacles. Some of these challenges include LSTM-MPC has
limitations, including sensor noise and measurement errors,
model uncertainty, computational complexity, nonlinearity
and non-convexity, and data efficiency. The optimized control
action may also be insufficient due to model mismatch,
nonlinear dynamics, unmodeled disturbances,
limited
prediction horizon, constraint violations, and real-time
requirements.
In this paper, The LSTM network and MPC algorithm are
trained together in an iterative process, with the LSTM
network improving its model dynamics based on the feedback
from the MPC algorithm and the MPC algorithm using the
improved LSTM model to make better control decisions.
After each iteration of the MPC algorithm, the predicted
following states and the following actual states can be
compared, and the difference between them can be used to
update the parameters of the LSTM network using an
optimization algorithm such as gradient descent. The training
goal is to minimize the prediction error between the actual and
predicted following states, thus improving the accuracy of the
LSTM model dynamics.
The proposed algorithm for RL in UAV path planning is
based on integrating DDPG and LSTM-MPC algorithms. The
integration of these two algorithms leverages their respective
strengths to provide a robust solution for real-time constraints
and unknown environments.
The integration of MPC and LSTM allows the algorithm
to make informed decisions in unknown environments by
combining the strengths of both algorithms. The MPC
component generates training data for the LSTM network by
repeatedly applying the policy to the system and collecting the
resulting states and actions. The LSTM network is trained
using this data to predict future states and actions. The MPC
component can then use the predictions made by the LSTM
network to make more informed decisions about which
actions to take in the future.
The LSTM-MPC component is utilized as a deterministic
policy, where the LSTM network is pre-trained using limited
knowledge of the environment map. The future state action
predictions generated by the LSTM-MPC are stored in a
"predicting pool." The predicted data in predicting pool will
be used to improve the training of the critic network. One
approach is to use the predicted data as a warm start for the
critic network by initializing the network parameters using the
estimated Q-values for each future state-action pair. This can
help to speed up the convergence of the network.
Additionally, the estimated Q-values can be used as target
values during the backpropagation step, allowing the network
to learn to predict better the quality of the actions taken by the
policy and make more informed decisions about which actions
to take the future. This approach can lead to improved
accuracy in the Q-value estimates and more efficient network
convergence. These estimated Q-values can be used as the
target values for the critic network during the backpropagation
step, where the loss is calculated as the mean-squared error
between the estimated Q-values and the actual Q-values.
Using the "predicting pool" for initialization combined
with warm starting further enhances
the algorithm's
efficiency. Using a "predicting pool" in the DDPG algorithm
provides several benefits that improve the performance and
efficiency of the algorithm.
• Speed up the learning process: By providing an initial
estimate of the expected return, the learning process can
be initiated from a better starting point. This reduces the
number of iterations required for convergence to an
optimal solution, thus speeding up the learning process.
• Improved accuracy of predictions: The data collected
from the "predicting pool" can be utilized to refine the
accuracy of predictions made by the LSTM-MPC (Long
Short-Term Memory Model Predictive Control), which
leads to improved performance of the DDPG algorithm.
• Better utilization of data: The "predicting pool" serves as
a repository for the data generated by the LSTM-MPC
predictions. This facilitates the better utilization of the
data and enables easy incorporation into the learning
process.
• Increased stability: By utilizing the data from the
"predicting pool" as supplementary information and
to
combining it with the observations from the environment
to estimate the TD (Temporal difference) error, the
algorithm's stability can be improved. The weight
assigned
the predicted data can be adjusted
dynamically based on its reliability, and the observed
data can serve as a backup to ensure stability and
accuracy.
In this work, the LSTM-MPC algorithm is utilized as a
function approximator in the actor network of the DDPG
framework for UAV path planning in the x-y plane with a
constant altitude. The cost function for UAV path planning is
formulated as a combination of several terms: the deviation of
the UAV's position from the target point, a collision
avoidance term based on the lidar data, and the magnitude of
the control inputs required to execute the path. The
optimization problem, defined as the minimization of this cost
function, is solved at each time step by the MPC algorithm to
determine the control inputs, which are treated as the
deterministic policy for the actor-network in the DDPG
framework. The LSTM network and MPC parameters are
updated over time as the system learns from its interactions
with the environment.
The cost function in the MPC algorithm for a quadrotor in
an x-y plane at a constant altitude can be formulated as a trade-
off between following the optimal path and avoiding
collisions. One possible formulation of the cost function could
be
JBCD(x, u) = w% bcx3(t + j) − x:(t + j)cb
<
+ w<c|Δu(t +
<
(10)
+ w=C5;EE4!4;9 (x)
j)|c
where x:(t + j) is the current state of the system (position
and velocity) based on the LSTM network at the (t + j)th
period based on the available measurements at the t th
sampling period, u is the control input, x3 is the desired state,
w% , w< , and w= are weighting factors that balance the
importance of following the desired state, minimizing control
effort, and avoiding collisions, respectively. More details
regarding the LSTM_MPC formulation can be found in [25].
The collision cost in the context of a quadrotor in the x-y
plane can be formulated as a measure of the distance between
the quadrotor and any potential obstacles in the environment.
the cost can be defined as the negative exponential of the
Euclidean distance between the quadrotor's current position
and the closest obstacle. Formally, the collision cost can be
defined as:
C5;EE4!4;9 = −eFG3(I,;K!)M
Where d(q, obs) is the Euclidean distance between the
quadrotor's position q and the closest obstacle, the negative
exponential ensures that the cost increases as the quadrotor
approaches an obstacle and approaches infinity as the
distance decreases to zero, encouraging the quadrotor to
avoid collisions.
(11)
This cost function can be added to the overall cost function
used in the MPC optimization problem, which may also
include other objectives such as reaching a target position,
tracking a desired trajectory, or minimizing control inputs.
The optimization problem is then solved at each time step to
determine the control inputs for the quadrotor, which can be
treated as the deterministic policy for the actor network in a
DDPG framework.
In order to evaluate the reward for each set of states,
action, and future state in the MPC-based deterministic policy,
it is necessary to incorporate the reward function into the MPC
optimization process. The reward function assigns a numerical
value to the quality of a given state-action-future state
combination. It serves as a means of reinforcing desirable
actions and discouraging undesirable ones. To this end, the
MPC optimization problem can be formulated as follows:
(12)
min J# = JBCD(x#, u#) + ∑ w4 R(s4, a4)
where J# is the objective function, w4 is the weight that
controls the relative importance of each term, R(s4, a4) is the
reward function, and the constraints represent operational
limitations and requirements for the UAV. Including the
reward function in the MPC optimization makes it possible
to evaluate the reward for each set of states, actions, and
future states. These rewards can then be stored in the
predicting pool, providing valuable information that can be
used to improve the accuracy of the LSTM network and the
performance of the MPC algorithm and the Actor-Critic
Network. Overall, incorporating the reward signal into the
MPC optimization process guides the UAV toward making
better decisions in unknown environments.
D. LSTM-MPC as function approximation
The LSTM-MPC actor network is trained to maximize the
expected cumulative reward through gradient descent. The
gradient of the expected cumulative reward with respect to the
network parameters (denoted as θ) is computed using the
chain rule of differentiation as
∇θJ(θ) = ∇θE[R|θ]
where J(θ) is the expected cumulative reward, E[R|θ] is the
expected cumulative reward given the current policy
(parameterized by θ ), and ∇θ denotes the gradient with
respect to the parameters θ. The gradient is estimated using
the experience gathered from the environment. The LSTM-
MPC actor network is updated after each episode or after a
batch of episodes to maximize the expected cumulative
reward.
(13)
The parameters of the LSTM network, theta, are trained
using gradient descent to minimize the expected cost over a
sequence of states and control inputs. In each iteration of the
MPC algorithm, the LSTM network uses the current state, x#,
and the past control inputs, u#G%, ... , u#G) , to predict the
control input for the next time step, u#. The predicted control
input, u# , is then used in the optimization problem to
determine the optimal control input, u∗. The parameters of the
LSTM network are updated using gradient descent as follows
θ = θ − α∇ (J(x, u∗ ), θ)
(14)
where α is the learning rate.
By iterating this process, the parameters of the LSTM
network converge to the optimal policy, π∗, that maps states
to control inputs to minimize the expected cost. The policy can
be used to control the system in real time. A further detailed
formulation can be found in [26].
1) Steps of the proposed algorithm
Step 1: Training of LSTM Network:
• Initialize the LSTM network using limited knowledge
of the environment.
• The LSTM network is initialized with parameters θ,.
The network's hidden state, h,, is initialized based on
the initial conditions of the system.
Step 2: Improvement of LSTM with Real-time Sensor Data:
• Use real-time data from sensors to update the network's
predictions continually.
• This allows the network to adapt to environmental
changes and continuously improve its predictions.
• Use backpropagation and gradient descent to update the
network parameters, w, to minimize the prediction
error.
Step 3: Use of LSTM to Predict the Environment and Control
Action:
• The LSTM network is used to predict the environment,
while the Model Predictive Control (MPC) is used to
determine the optimal control action. The LSTM
considers the MPC data and past data to predict the next
state.
• The control actions are generated by minimizing the
cost function, J, over a set of predicted states and
control actions, as described in the previous sections.
• LSTM uses MPC data to train and improve the MPC
network
Step 4: LSTM-MPC as Deterministic Policy Actor-Network:
• Use the LSTM-MPC network to determine the optimal
control actions for a given state.
• Use the data from the "predicting experience pool" to
warm-start the LSTM-MPC, improving the accuracy of
its predictions based on their reliability.
• To improve the real-time performance of the MPC,
efficient optimization algorithms and approximations
can be employed to reduce computational complexity.
• These algorithms can significantly improve the speed
and efficiency of the MPC, allowing it to make
predictions and choose actions in real time.
Step 9: Repeating Steps 2-8:
• Continuously repeat Steps 2 through 8 to improve the
MPC's performance.
The algorithm structure block diagram is shown in Figure 1.
IV. SIMULATION RESULTS AND SETTING
A. Experiment enviorment
In this scenario, the environment is a simplified 3D space
with dimensions of 200m x 200m x 50m. The target and initial
points of the UAV are randomly initialized in one of the
corners of the environment. Cylindrical Obstacles of different
sizes are randomly generated within the rest area. In order to
navigate this environment, the UAV uses its sensor data to
avoid obstacles and reach its target point. The environment
was chosen to be simplified to make the task of path planning
and obstacle avoidance more manageable. The safe distance
to the obstacle is 1.5m, and the max sensor length is 20m.
• Parametrized LSTM based on the θ to use gradient
B. Training
descent for updating the policy
Step 5: Predicting Pool:
• Use the LSTM-MPC network to predict future states
and corresponding control actions in a set MPC
horizon.
• Evaluate the rewards for each control action
• Store information in a new experience pool called the
"predicting pool."
Step 6: Collection of Experiences from the Environment:
• Interact with the environment by choosing actions and
collecting information about the current state, action,
reward, and next state.
• Store this information in a separate experience pool.
Step 7: Training of Critic Network:
• Use a critic network to estimate the value function for
each experience in the batch from the "experience
pool."
• Using the predicting states from the LSTM network for
more sample
• Calculate the target value for each experience, which is
the reward plus the estimated value of the next state.
• Train the critic network to predict the target value by
minimizing the mean squared error between the
prediction and the target.
• The "predicting pool" is used to initialize the value
function approximator, which can speed up the training
process and reduce the number of iterations required to
converge. (Warm start)
Step 8: Improvement of LSTM-MPC:
The proposed algorithm in this paper operates within the
MATLAB environment and utilizes a learning rate of 0.001
for its optimizer. The maximum number of iterations is set to
5000 to ensure network convergence, and the maximum
number of steps per iteration is set to 500. the experience pool
has a maximum capacity of 10N. The episode ends if the UAV
reaches the target area, collides with the obstacles, and the
number of training steps reaches the maximum. The soft
update factor τ is 0.001, and the exploration noise is set to 0.2.
the MPC horizon is set as 5 with time step 0.5 and minimum
batch size N = 256.
Figure 1. The diagram of the proposed algorithm.
In the training environment, there are five cylindrical
obstacles with a size of 5 x 50 and five cylindrical obstacles
with a size of 10 x 50. Figure 2 and Figure 3 show the training
data's success ratio and cumulative reward function. In the
initial training stage, the UAV operates randomly due to the
lack of accurate prediction, resulting in a low average reward.
However, the MPC-based deterministic policy shows a higher
average reward than the other two methods at the beginning
and the end of episodes, the proposed algorithm also
converges faster. The success rate represents the percentage of
successful target acquisitions.
C. Results
in
the
training
first evaluated
After 5000 episodes of
training
environment for DDPG, TD3, and the proposed algorithm,
they were tested in dynamic and static environments. The
proposed algorithm was
in a static
eenvironment, where obstacles were randomly placed in each
episode to assess the algorithm's ability to generalize. The
environment uses two different settings; E1 and E2. E1
consists of five cylindrical obstacles with dimensions of
20x50 and five with dimensions of 15x50. E2 consists of ten
obstacles with dimensions of 20x50 and ten with dimensions
of 5x50.
Figure 2. The success ratio of reaching the destination in the
training phase.
Figure 3. The comparison of the average reward of the algorithms
in the training phase.
The results of the proposed algorithm were compared to
those of the DDPG and TD3 algorithms after 3000 episodes.
As shown in Table 2, the proposed algorithm demonstrated
the highest success rate in all three settings. The advantage of
the proposed algorithm became increasingly apparent in more
complex environments with a higher number of obstacles. In
the more complex environment, E2, the success rate of the
proposed algorithm decreased less than two others.
Furthermore, The performance of the proposed algorithm,
DDPG, and TD3 algorithms was evaluated in terms of
cumulative step convergence. Results indicated that the
proposed algorithm demonstrated faster convergence speed
when compared to the TD3 and DDPG. Upon testing the
algorithms for 3000 episodes in the same environment, These
findings suggest that the proposed LSTM_MPC_DDPG
algorithm exhibits superior convergence and performance
compared to the TD3 and DDPG algorithms. Figure 4 and
Figure 5 show the paths generated in environments E1 and E2
based on the proposed algorithm, respectively, where the
black dashed line shows the safe zones around obstacles. As
seen, the UAV reaches the target area without collision with
obstacles using a short path.
Next, algorithms were tested in a dynamic environment. In
this scenario, obstacles move along the X -axis at different
speeds, which can test whether the UAV can make real-time
decisions in dynamic environments. Obstacles move at the
speed of v in the negative direction of the X-axis. DDPG,
TD3, and the proposed algorithm are tested for 3000 episodes
in 2 different speeds of obstacle. The results in different
dynamic environments are illustrated in Table 2. The success
rates of the three algorithms decrease as the speed of obstacles
increases. The success rate of the proposed algorithm is the
lowest.
Moreover, the success rate of our algorithm is much higher
than that of TD3. It is because the design of the predicting pool
network and MPC_LSTM as an actor-network structure
works. UAVs can perceive the changes in the surrounding
environment on the horizon by adding environmental
information changes to predicting pool inputs so that obstacles
can be avoided in time. The results show that the proposed
algorithm has strong adaptability to dynamic environments.
Table 2. Tests results under static environments and the impact of
different speeds of a dynamic obstacle in a dynamic environment
TD3
DDPG
E1
E2
V=15
V=10
m/s
m/s
78.15
85.2
21.75
14.3
0.1
0.5
1.2
3.1
90.25 85.25
14.15
8.5
0.6
1.5
1.7
4.01
93.35 86.26
13.74
6.65
0
0
2.56
4.25
80.5
10.1
9.4
2.3
85.7
8.2
6.1
2.71
93.4
6.3
0
3.02
SR (%)
CR (%)
LR (%)
AR
SR (%)
CR (%)
LR (%)
AR
SR (%)
CR (%)
LR (%)
AR
92.25
7.05
0.7
3.42
94.1
4.8
1.1
4.23
95.1
4.9
0
5.08
Success rate (SR): The percentage of successful target acquisitions.
Collision rate (CR): The percentage of collisions with obstacles.
Loss rate (LR): The percentage of getting lost in the map (without
collision).
Average reward (AR): The overall performance quality.
Proposed
Algorithm
ACKNOWLEDGMENTS
This research was partially supported by the European
Union's Horizon 2020 project Secure and Safe Multi-Robot
Systems (SESAME) under grant agreement no. 101017258.
For the purpose of open access, the author has applied a
Creative Commons Attribution 4.0 International (CC BY 4.0)
license to any Author Accepted Manuscript version arising
from this submission.
REFERENCES
[1] R. Raj, S. Kar, R. Nandan, and A. Jagarlapudi, "Precision agriculture
and unmanned aerial Vehicles (UAVs)," Unmanned Aerial Vehicle:
Applications in Agriculture and Environment, pp. 7-23, 2020.
[2] S. A. H. Mohsan, M. A. Khan, F. Noor, I. Ullah, and M. H. Alsharif,
"Towards the unmanned aerial vehicles (UAVs): A comprehensive
review," Drones, vol. 6, no. 6, p. 147, 2022.
[3] S. Park and Y. Choi, "Applications of unmanned aerial vehicles in
mining from exploration to reclamation: A review," Minerals, vol. 10,
no. 8, p. 663, 2020.
[4] D. Wang, "Indoor mobile-robot path planning based on an improved A*
algorithm," Journal of Tsinghua University Science and Technology,
vol. 52, no. 8, pp. 1085-1089, 2012.
[5] L. Li, T. Ye, M. Tan, and X.-j. Chen, "Present state and future
development of mobile robot technology research," Robot, vol. 24, no.
5, pp. 475-480, 2002.
[6] G. Hoffmann, S. Waslander, and C. Tomlin, "Quadrotor helicopter
trajectory tracking control," in AIAA guidance, navigation and control
conference and exhibit, 2008, p. 7410.
[7] R. Bohlin and L. E. Kavraki, "Path planning using lazy PRM," in
Proceedings 2000 ICRA. Millennium conference. IEEE international
conference on robotics and automation. Symposia proceedings (Cat. No.
00CH37065), 2000, vol. 1: IEEE, pp. 521-528.
[8] Y. K. Hwang and N. Ahuja, "A potential field approach to path
planning," IEEE transactions on robotics and automation, vol. 8, no. 1,
pp. 23-32, 1992.
[9] J. Bruce and M. Veloso, "Real-time randomized path planning for robot
navigation," in IEEE/RSJ international conference on intelligent robots
and systems, 2002, vol. 3: IEEE, pp. 2383-2388.
[10] G.-T. Tu and J.-G. Juang, "UAV Path Planning and Obstacle Avoidance
Based on Reinforcement Learning in 3D Environments," in Actuators,
2023, vol. 12, no. 2: MDPI, p. 57.
[11] B. G. Maciel-Pearson, L. Marchegiani, S. Akcay, A. Atapour-
Abarghouei, J. Garforth, and T. P. Breckon, "Online deep reinforcement
learning for autonomous UAV navigation and exploration of outdoor
environments," arXiv preprint arXiv:1912.05684, 2019.
[12] S. Faryadi and J. Mohammadpour Velni, "A reinforcement learning‐
based approach for modeling and coverage of an unknown field using a
team of autonomous ground vehicles, " International Journal of
Intelligent Systems, vol. 36, no. 2, pp. 1069-1084, 2021.
[13] S. Zhang, Y. Li, and Q. Dong, "Autonomous navigation of UAV in
multi-obstacle environments based on a Deep Reinforcement Learning
approach," Applied Soft Computing, vol. 115, p. 108194, 2022.
[14] B. Xin and C. He, "DRL-Based Improvement for Autonomous UAV
Motion Path Planning in Unknown Environments," in 2022 7th
International Conference on Control and Robotics Engineering
(ICCRE), 2022: IEEE, pp. 102-105.
[15] Y. Li and A. H. Aghvami, "Intelligent UAV Navigation: A DRL-QiER
International Conference on
ICC 2022-IEEE
Solution,"
Communications, 2022: IEEE, pp. 419-424.
in
[16] S. Gros and M. Zanon, "Reinforcement learning based on mpc and the
stochastic policy gradient method," in 2021 American Control
Conference (ACC), 2021: IEEE, pp. 1947-1952.
[17] S. Gros and M. Zanon, "Data-driven economic NMPC using
reinforcement learning," IEEE Transactions on Automatic Control, vol.
65, no. 2, pp. 636-648, 2019.
[18] M. L. Darby and M. Nikolaou, "MPC: Current practice and challenges,"
Control Engineering Practice, vol. 20, no. 4, pp. 328-342, 2012.
[19] A. B. Kordabad, W. Cai, and S. Gros, "MPC-based reinforcement
learning for economic problems with application to battery storage," in
2021 European Control Conference (ECC), 2021: IEEE, pp. 2573-2578.
Figure 4. The generated path by the proposed algorithm in the E1
environment.
Figure 5. The generated path by the proposed algorithm in the E2
environment.
V. CONCLUSION
can
algorithm. The LSTM-MPC
for unmanned aerial vehicles
This paper presents a novel method that leverages Deep
to facilitate autonomous path
Reinforcement Learning
planning
in complex
environments with multiple static and dynamic obstacles. The
proposed solution employs a deterministic policy based on the
LSTM-MPC architecture to enhance the performance of the
DDPG
predict
environmental features from observations, thereby addressing
the unpredictability and variability in these scenarios. The
method incorporates a "predicting pool" that stores the set of
state-action-reward data, which accelerates the performance
of the DDPG algorithm. The efficacy of the proposed
in simplified 3D-simulation
algorithm was evaluated
environments and compared with the DDPG and TD3
algorithms. The results demonstrated that the proposed
solution could effectively train UAVs for path planning in
complex environments with real-time dynamic obstacle
avoidance while reaching the target area promptly and safely
with higher performance indices than DDPG and TD3
algorithms.
[20] Z. Zhang, D. Zhang, and R. C. Qiu, "Deep reinforcement learning for
power system applications: An overview," CSEE Journal of Power and
Energy Systems, vol. 6, no. 1, pp. 213-225, 2019.
[21] H. Moumouh, N. Langlois, and M. Haddad, "A Novel Tuning approach
for MPC parameters based on Artificial Neural Network," in 2019 IEEE
15th International Conference on Control and Automation (ICCA),
2019: IEEE, pp. 1638-1643.
[22] Y. Jiao, Z. Wang, and Y. Zhang, "Prediction of air quality index based
on LSTM," in 2019 IEEE 8th Joint International Information
Technology and Artificial Intelligence Conference (ITAIC), 2019: IEEE,
pp. 17-20.
[23] B. Jiang, B. Li, W. Zhou, L.-Y. Lo, C.-K. Chen, and C.-Y. Wen, "Neural
network based model predictive control for a quadrotor UAV,"
Aerospace, vol. 9, no. 8, p. 460, 2022.
[24] A. Sherstinsky, "Fundamentals of recurrent neural network (RNN) and
long short-term memory (LSTM) network," Physica D: Nonlinear
Phenomena, vol. 404, p. 132306, 2020.
[25] J. Yan, P. DiMeo, L. Sun, and X. Du, "LSTM-Based Model Predictive
Control of Piezoelectric Motion Stages for High-speed Autofocus,"
IEEE Transactions on Industrial Electronics, 2022.
[26] W. Cai, A. B. Kordabad, H. N. Esfahani, A. M. Lekkas, and S. Gros,
"MPC-based reinforcement learning for a simplified freight mission of
autonomous surface vehicles," in 2021 60th IEEE Conference on
Decision and Control (CDC), 2021: IEEE, pp. 2990-2995.
|
|
http://arxiv.org/abs/2302.10668v2 | 2023-02-23T16:03:05 | 2023-02-21T13:37:07 | $PC^2$: Projection-Conditioned Point Cloud Diffusion for Single-Image 3D
Reconstruction | Reconstructing the 3D shape of an object from a single RGB image is a
long-standing and highly challenging problem in computer vision. In this paper,
we propose a novel method for single-image 3D reconstruction which generates a
sparse point cloud via a conditional denoising diffusion process. Our method
takes as input a single RGB image along with its camera pose and gradually
denoises a set of 3D points, whose positions are initially sampled randomly
from a three-dimensional Gaussian distribution, into the shape of an object.
The key to our method is a geometrically-consistent conditioning process which
we call projection conditioning: at each step in the diffusion process, we
project local image features onto the partially-denoised point cloud from the
given camera pose. This projection conditioning process enables us to generate
high-resolution sparse geometries that are well-aligned with the input image,
and can additionally be used to predict point colors after shape
reconstruction. Moreover, due to the probabilistic nature of the diffusion
process, our method is naturally capable of generating multiple different
shapes consistent with a single input image. In contrast to prior work, our
approach not only performs well on synthetic benchmarks, but also gives large
qualitative improvements on complex real-world data. | [
"Luke Melas-Kyriazi",
"Christian Rupprecht",
"Andrea Vedaldi"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10668v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10668v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CV",
"cs.AI",
"cs.LG"
] | 3
2
0
2
b
e
F
3
2
]
V
C
.
s
c
[
2
v
8
6
6
0
1
.
2
0
3
2
:
v
i
X
r
a
PC2: Projection-Conditioned Point Cloud
Diffusion for Single-Image 3D Reconstruction
Luke Melas-Kyriazi Christian Rupprecht Andrea Vedaldi
Visual Geometry Group, Department of Engineering Science, University of Oxford
{lukemk,chrisr,vedaldi}@robots.ox.ac.uk
https://lukemelas.github.io/projection-conditioned-point-cloud-diffusion
Figure 1. Projection-Conditioned Point Cloud Diffusion: Our model performs single-image 3D point cloud reconstruction by gradually
diffusing an initially random point cloud to align the with input image. Our model has been trained through simple, sparse COLMAP
supervision from videos.
Abstract
Reconstructing the 3D shape of an object from a single
RGB image is a long-standing and highly challenging prob-
lem in computer vision. In this paper, we propose a novel
method for single-image 3D reconstruction which generates
a sparse point cloud via a conditional denoising diffusion
process. Our method takes as input a single RGB image
along with its camera pose and gradually denoises a set of
3D points, whose positions are initially sampled randomly
from a three-dimensional Gaussian distribution, into the
shape of an object. The key to our method is a geometrically-
consistent conditioning process which we call projection con-
ditioning: at each step in the diffusion process, we project
local image features onto the partially-denoised point cloud
from the given camera pose. This projection conditioning
process enables us to generate high-resolution sparse ge-
ometries that are well-aligned with the input image, and
can additionally be used to predict point colors after shape
reconstruction. Moreover, due to the probabilistic nature
of the diffusion process, our method is naturally capable of
generating multiple different shapes consistent with a single
input image. In contrast to prior work, our approach not
only performs well on synthetic benchmarks, but also gives
large qualitative improvements on complex real-world data.
1. Introduction
Reconstructing the 3D structure of an object from a sin-
gle 2D view is a long-standing computer vision problem.
Given more than one view, it is possible to reconstruct an
object's shape using the tools of multiple-view geometry, but
1
Diffused Point CloudSingle Image InputProjection-Conditioned Point Cloud Diffusion Diffused & Colored Point CloudGaussianPoint Cloud
in the case of a single view the problem is highly ill-posed
and requires prior understanding of the possible shapes and
appearances of the objects.
Despite the difficulty of this task, humans are adept at us-
ing a range of monocular cues and prior knowledge to infer
the 3D structure of common objects from single views. For
example, when a person looks at a photograph of an object,
they can easily imagine what the shape of the backside of
the object may plausibly be. The ease with which humans
perform this task, and its relative difficulty for computer
vision systems, has attracted the attention of the research
community for nearly half a century [4, 5, 16, 24]. Moreover,
given the prevalence of single-view RGB image data in the
real world, the single-view reconstruction problem has prac-
tical applications in numerous areas, such as augmented and
virtual reality.
Over the past five years, a substantial body of research has
emerged around reconstruction via end-to-end deep learning
methods [11,14,18,20,26,36,46,47,49,50,53–57,59]. These
works are capable of predicting volumes from single images,
yet many remain limited to low-resolution geometries (e.g.
dense voxel grids), and thus have limited ability to recon-
struct the precise geometry of the input image. Some recent
works [9, 12, 37, 58] also utilize implicit representations and
radiance fields, which are capable of rendering novel views
with photographic quality but often suffer from other draw-
backs, such as an inability to reconstruct a distribution of
possible 3D shapes from a single input image.
In this work, we take inspiration from recent progress in
the generative modeling of 2D images using denoising diffu-
sion probabilistic models. In the domain of 2D images, we
have seen that diffusion models (e.g. Latent-Diffusion [38],
SDEdit [25], GLIDE [28], and DALL-E 2 [32]) can produce
remarkably high-fidelity image samples either from scratch
or when conditioned on textual inputs. They do so by learn-
ing complex priors over the appearances of common objects.
For example, GLIDE [28] is designed to conditionally in-
paint unseen regions in an image. We seek to bring these
advances to the domain of 3D reconstruction to conditionally
generate the shape of unseen regions of a 3D object.
In order to do so, we propose to use diffusion models for
single-image 3D reconstruction. Our approach represents
shapes as unstructured point clouds: we gradually denoise
a randomly-sampled set of points into a target shape condi-
tional on an input image and its corresponding viewpoint.
The key to our approach is a novel way of conditioning the
diffusion process to produce 3D shapes which are geometri-
cally consistent with the input images. Specifically, at each
iteration of the diffusion process, we project image features
directly onto the points of the partially-denoised point cloud.
When shape reconstruction is complete, we are also able to
use the same projection conditioning to predict point colors.
Our method differs from prior work in three major as-
pects: (1) our point cloud-based shape representation, (2)
our projection-conditioned diffusion model, and (3) our use
of projection conditioning to predict point colors in addition
to point shapes. Although these may seem separate from one
another, they are in fact directly linked: the order-agnostic
and unstructured nature of point clouds naturally lends itself
to the highly flexible nature of diffusion models. Without the
point cloud-based representation, our projection-conditioned
diffusion approach would be limited to coarse voxel-based
shape approximation.
Finally, due to its probabilistic nature, given a single input
image, our model is able to generate multiple plausible 3D
point clouds which are all consistent with the input. We
leverage this property by introducing a novel filtering step in
the sampling process, which helps to address the ill-posed
nature of the single-view 3D reconstruction problem. Specif-
ically, we generate multiple point clouds for a given input
image, and filter these point clouds according to how well
they match the input mask. Filtering enables us to bene-
fit from the diversity of our model's reconstructions in an
entirely automated fashion.
Experimentally, we not only perform competitively on
the synthetic ShapeNet benchmark, but we also move be-
yond synthetic data: we demonstrate high-quality qualitative
single-view reconstruction results on multiple categories in
the challenging, real-world Co3D [34] dataset.
We present this work as a first step toward using denoising
diffusion models for large-scale 3D reconstruction. Given
the success of scaling 2D diffusion models over the past
two years, our work demonstrates that 3D diffusion models
could represent a path toward large-scale 3D reconstruction
of complex objects from single-view images. To encourage
further research into diffusion models for 3D reconstruction,
we will release code and pretrained models on acceptance.
2. Related work
Single-View 3D reconstruction Originally, research on
3D reconstruction focused primarily on reconstruction from
multiple views using classical geometric techniques [6].
Most commonly, these methods map the input image into a
feature representation using a 2D convolutional network, and
then decode the features into a 3D representation using a 3D
convolutional network or a sequence model. This decoding
process generally requires the output 3D representation to
have a fixed and regular structure, such as a voxel grid.
One of the pioneering methods in this line of work was
3D-R2N2 [1], which encodes an input 2D image into a low
dimensional embedding using a standard 2D convolutional
network, process this embedding with a 3D-LSTM, and
then decode an output voxel grid with a 3D convolutional
network. [1] also introduced a standard set of views and
renders for evaluating single-view reconstruction methods
based on the ShapeNet dataset, which we use for evaluation
2
Figure 2. PC2 reconstructs a colored point cloud from a single input image along with its camera pose. The method contains two sub-parts,
both of which utilize our model projection conditioning method. First, we gradually denoise a set of points into the shape of an object. At
each step in the diffusion process, we project image features onto the partially-denoised point cloud from the given camera pose, augmenting
each point with a set of neural features. This step makes the diffusion process conditional on the image in a geometrically-consistent manner,
enabling high-quality shape reconstruction. Second, we predict the color of each point using a model based on the same projection procedure.
in this work (Sec. 4). LSM [13] processes images into feature
maps with a 2D network, unprojects these features into a 3D
voxel grid, and processes the grid with a 3D convolutional
network. Pix2Vox [54] and its successor Pix2Vox++ [55]
use a simple encoder-decoder architecture consisting of a
2D convolutional encoder and a 3D convolutional decoder
augmented with a multi-scale fusion module. Most recently,
LegoFormer [56] adopts a transformer-based approach. They
encode an image into a feature vector and decode a 323
dense voxel grid as a sequence of 512 4 × 4 blocks. For
this decoding they employ a non-autoregressive transformer-
based decoder with learned queries.
Additionally, over the past two years a new body of re-
search has emerged around differentiable rendering. Popu-
larized by NeRF [27], these methods learn implicit repre-
sentations of either radiance [27] or signed distance [51].
Although the vast majority of this work operates on the level
of single scenes with abundant multi-view data, a few recent
works have tackled the single-view setting [9, 12, 17, 37, 57].
Most relevant for this paper are Nerf-WCE [9] and Pix-
elNeRF [57], which concurrently developed methods for
single/few-view reconstruction, conditioning a NeRF on im-
age features from reference views. Both work well in the
few-view settings on datasets such as Co3D [35], but strong
results in the single-view setting remain elusive. We compare
qualitatively against NeRF-WCE in Sec. 4.
In this paper, we take an entirely different approach from
those above. We utilize the flexible machinery of denoising
diffusion probabilistic models for point cloud-based recon-
struction. Due to their probabilistic nature, diffusion models
enable us to capture the ambiguity of unseen regions while
also generating high-resolution point cloud-based shapes.
Below, we give an overview of the related literature on diffu-
sion models.
Diffusion Models Denoising diffusion probabilistic mod-
els are a class of generative models based on iteratively
reversing a Markovian noising process. Early work on
Category Global Cond.
airplane
table
0.197
0.156
PC2
0.473
0.290
Table 1. Motivating Experiment. Here, we show a small quan-
titative comparison on two categories from ShapeNet [1] which
motivates our projection conditioning method. The table shows
F-scores (higher is better). For the global conditioning approach,
the input image is first processed into a global feature vector using
a convolutional network [41], and this vector is used to condition a
denoising diffusion model. Relative to the global conditioning, our
projection conditioning is much more effectively able to reconstruct
object geometries.
diffusion models for image generation, inspired by ther-
modynamics, framed the problem as one of optimizing a
variational lower bound of a latent variable model [10].
Later work showed that this modeling paradigm is equiva-
lent to score-based generative modeling [43, 44], and can
also be seen as a discretization of a continuous process
based on stochastic differential equations [45]. Recent
work has explored faster/deterministic sampling for diffusion
models [19, 42, 52], class-conditional models [2, 44], text-
conditional models [28], and modeling in latent space [38].
Diffusion Models for Point Clouds Over this past year,
three applications of diffusion models for unconditional
point cloud generation have emerged. [22] and [60] pro-
posed similar generation setups, differing in their use of
a PointNet [30] and a Point-Voxel-CNN [60], respectively.
Most recently [23] uses a diffusion model followed by a
refinement model for the purpose of completing partial point
clouds. However, these three works only tackle the problem
of unconditional shape generation or completion and do not
address the question of how to reconstruct real-world images.
Additionally, they train only on synthetic datasets, whereas
we show results for complex real-world data.
3
Point CloudDiffusion ModelImage features are projected onto the point cloud at each iteration of the denoising diffusion process and for point color predictionDiffusedPoint CloudGaussianPoint CloudSingle-View RGB ImageInputPoint CloudDiffusion ModelPoint Cloud withProjection Conditioning Point Cloud withProjection Conditioning Partially-Denoised Point Cloud 1000DiffusionStepsDiffused & ColoredPoint Cloud Point CloudColoring ModelFigure 3. Examples of PC2 on real-world images from Co3D [34], along with intermediate steps in the diffusion process. The first column
shows input images, while the subsequent five columns show the evolution of the point cloud from a randomly sampled Gaussian to a final
shape over the course of the diffusion process. The following column shows the result of our coloring model applied to our reconstructed
shape. The final two columns show renders of our colored point cloud from two randomly sampled novel views, demonstrating that it is a
complete 3D shape. Our method is capable of reconstructing objects from real-world images with challenging viewpoints.
3. Method
In the following sections we describe our method. We
begin with an overview of denoising diffusion models, which
forms the foundation of our method. Next, we introduce our
novel conditioning scheme PC2. Finally, we describe our
filtering method PC2-FM, which utilizes the probabilistic
nature of diffusion to address the ill-posed nature of the
single-view 3D reconstruction problem.
3.1. Diffusion Models
Diffusion denoising probabilistic models are general-
purpose generative models inspired by stochastic differential
equations and non-equilibrium thermodynamics. Diffusion
denoising models are based on an iterative noising process,
which adds noise to a sample X0 ∼ q(X0) from a target
data distribution q(X0) over a series of steps. The stepsize
4
of each step of this process is given by a variance schedule
{βt}T
t=0:
q(Xt|Xt−1) = N (Xt; (cid:112)1 − βtXt−1, βtI)
Each q(Xt|Xt−1) is a Gaussian distribution, implemented
by using the the well-known reparameterization trick:
√
√
q(Xt|X0) =
̄αtX0 + (cid:15)
1 − ̄αt
where αt = 1 − βt, ̄αt = (cid:81)t
s=0 αs, and (cid:15) ∼ N (0, I).
In order to form a generative model, we consider the re-
verse diffusion process, which begins with a sample from
the noise distribution q(XT ) and then denoises over a se-
ries of steps to obtain a sample from the target distribution
q(X0). Confusingly, this reverse process is sometimes also
referred to as the "diffusion process." In order to reverse the
diffusion process, we learn the distribution q(Xt−1|Xt) us-
ing a neural network sθ(Xt−1|Xt) ≈ q(Xt−1|Xt). We can
With Color(Reference View)Single Image InputProjection-Conditioned Point Cloud Diffusion T = 1000 (Gaussian)T = 667 T = 334 T = 166 T = 0 (Final Model)Novel View 1 Novel View 2then (approximately) sample from q(X0) by starting with
a sample XT ∼ q(XT ) and then iteratively sampling from
q(Xt−1|Xt). When the sampling step size is sufficiently
small, q(Xt−1|Xt) is well approximated by an isotropic
Gaussian with a fixed small covariance. Thus, one only has
to predict the mean of q(Xt−1|Xt), which in practice is pa-
rameterized as predicting the noise (cid:15) with a neural network
sθ(Xt−1|Xt).
3.2. Point Cloud Diffusion Models
We consider 3D point cloud with N points as a 3N dimen-
sional object and learn a diffusion model sθ : R3N → R3N .
This network denoises the positions of a set of points from a
spherical Gaussian ball into a recognizable object. At a very
high level, at each step, we predict the offset of each point
from its current location, and we iterate this process to arrive
at a sample from our target distribution q(X0).
Concretely, the network is trained to predict the noise
(cid:15) ∈ R3N added in the most recent time step using an L2 loss
between the true and predicted noise values:
L = E(cid:15)∼N (0,I)
(cid:2)(cid:107)(cid:15) − sθ(Xt, t)(cid:107)2
2
(cid:3)
At inference time, a random point cloud XT ∼ N (0, I3N )
is sampled from a 3N -dimensional Gaussian and the reverse
diffusion process is run to produce a sample X0. At each
step, we recover the mean μθ,t of our approximation of
q(Xt−1|Xt) from the prediction sθ(Xt, t), and we use this
mean to sample from q(Xt−1|Xt).
3.3. Conditional Point Cloud Diffusion Models
We formulate 3D reconstruction as conditional genera-
tion: the target distribution is the conditional distribution
q(X0|I, V ) where I is an input image and V is the corre-
sponding camera view. The key question of this paper is
how exactly one should condition the model on the reference
image and camera view. The most immediate way of con-
ditioning would be to provide a global learned embedding
of the input image as an auxilliary input to the denoising
function sθ. This setup resembles prior work which used
encoder-decoder architectures conditioned on image embed-
dings to generate 3D shapes [1, 54, 55].
However, this approach is lacking in that it only promotes
a weak form of geometric consistency between the input
image and the reconstructed shape. Empirically, preliminary
experiments showed that it often generated plausible shapes,
but that these shapes did not always match the input image
from the given view (see Tab. 1).
This finding matches up precisely with the findings
of [48], who analyzed voxel-based methods which decode
from a global feature vector in a similar manner: they found
that these networks primarily performed a sort of coarse clas-
sification of the input image into a small number of shape
categories and then generated a generic object from that cat-
egory. Although coarse classification may produce adequate
results in a highly curated synthetic setting such as ShapeNet,
it will inevitably fail to capture the complexity of objects
in real-world scenes. These insights led us to develop PC2,
a geometrically consistent method for locally-conditional
point cloud diffusion.
3.4. PC2: Projection-Conditional Diffusion Models
To address the geometric consistency issues observed
above, our method PC2 instead projects the image onto the
partially-denoised point at each step in the diffusion process.
We first process the image into a dense feature volume using
a standard 2D image model(e.g. a CNN or ViT [3]). Next,
before each diffusion step, we project these features onto
the point cloud, attaching a neural feature to each point.
Crucially, each point is augmented with a different neural
feature, as determined by its location in space relative to the
input camera and the input image.
Formally, let I ∈ RH×W ×C be the feature volume pro-
duced by our 2D image model applied to our input image,
where C is the number of feature channels. sθ is now a func-
tion R(3+C)N → R3N which predicts the noise (cid:15) from the
augmented point cloud X +
]. The projected
t
features X proj
= PVI (I, Xt) where
PVI is the projection function from camera view VI , I is the
input image, and Xt is the partially-noised point cloud.
are given by X proj
t = [Xt, X proj
t
t
One straight-forward approach to design PVI (I, Xt)
would be to simply project the 3D points on the image and
take the corresponding image features. However, this is
akin to assuming that the point cloud is transparent. Instead,
we found it beneficial to choose a projection function that
properly accounts for self-occlusion. We implement it by
rasterizing the points, assuming that they have some small,
non-zero radius ρ. That is, PVI is a rasterization proce-
dure [33]. Due to highly optimized rasterization routines in
modern software, this process is very efficient; it accounts
for a negligible fraction of training time and computation.
Full details about the rasterization process and the projected
information are provided in the supplementary material.
Finally, we find that we can apply exactly the same
projection-based conditioning to reconstruct object color
in addition to object shape.1 Specifically, we learn a separate
coloring network cθ : R(3+C)N → RCN , which takes as
input a point cloud augmented with projection condition-
ing, and outputs the colors of each point. Empirically, we
found that a single-step coloring model produced results
comparable to a diffusion model. To reduce computational
complexity, we hence utilize the single step model. :
1Learning a coloring network is beneficial compared to a simple projec-
tion of colors from the image to points because a coloring network could
learn to color an object backside differently from its front size (for example,
in the case of a teddy bear).
5
Category
[1]
[56]
[55]
PC2
PC2-FM
Samples
1
2
3
4
5
airplane
bench
cabinet
car
chair
display
lamp
loudspeaker
rifle
sofa
table
telephone
watercraft
0.225
0.198
0.256
0.211
0.194
0.196
0.186
0.229
0.356
0.208
0.263
0.407
0.240
0.215
0.241
0.308
0.220
0.217
0.261
0.220
0.286
0.364
0.260
0.305
0.575
0.283
0.266
0.266
0.317
0.268
0.246
0.279
0.242
0.297
0.410
0.277
0.327
0.582
0.316
0.473
0.305
0.203
0.359
0.290
0.232
0.300
0.204
0.522
0.205
0.270
0.331
0.324
Average
0.244
0.289
0.315
0.309
0.589
0.334
0.211
0.372
0.309
0.268
0.326
0.210
0.585
0.224
0.297
0.389
0.341
0.343
Table 2. Comparison of single-view 3D reconstruction performance
with prior work on ShapeNet-R2N2. F-Score is calculated using
a distance threshold of 0.01 [54]. Our method performs similarly
to prior work without filtering and outperforms prior work using
filtering (both PC2-FA and PC2-FM); this filtering step leverages
the method's ability to produce multiple reconstructions for a given
input image.
Category
PC2
PC2-FA PC2-FM Oracle
airplane
bench
cabinet
car
chair
display
lamp
loudspeaker
rifle
sofa
table
telephone
watercraft
Average
0.473
0.305
0.203
0.359
0.290
0.232
0.300
0.204
0.522
0.205
0.270
0.331
0.324
0.309
0.517
0.316
0.246
0.369
0.312
0.277
0.320
0.235
0.538
0.242
0.293
0.400
0.322
0.337
0.589
0.334
0.211
0.372
0.309
0.268
0.326
0.210
0.585
0.224
0.297
0.389
0.341
0.343
0.681
0.444
0.303
0.420
0.377
0.357
0.399
0.288
0.686
0.298
0.420
0.523
0.424
0.432
Table 3. Single-view 3D reconstruction performance on ShapeNet-
R2N2 for different levels of filtering. PC2 produces a single sample
for each input image. PC2-FM (see Sec. 3) uses 5 samples for
automated IoU -based filtering. The "Oracle" method evaluates
the upper bound of filtering: it computes the F -score of 5 samples
using the ground truth point cloud and chooses the best sample for
each input image. Filtering, both without object masks (PC2-FA)
and with masks (PC2-FM) improves results substantially, but does
not fully close the gap to the oracle.
Avg. F-Score
0.310
0.330
0.335
0.340
0.343
Table 4. Performance of PC2-FM on ShapeNet-R2N2 when filter-
ing different numbers of samples. There is a large improvement
(0.02 F -score) from a single sample (i.e., no filtering) to two sam-
ples. Performance continues to increase with diminishing returns.
3.5. PC2-FM and PC2-FA: Filtering for 3D Recon-
struction
Due to the ill-posed nature of the single-view 3D recon-
struction problem, there are many possible ground truth
shapes corresponding to each input image. Differently from
most prior works [54–56, 58], our model is inherently prob-
abilist, and thus admits sampling multiple different recon-
structions from a single input.
We take advantage of this property by proposing to gener-
ate multiple independent samples for each input image and
then filter these according to an automated criterion. Thus,
we are able to generate a diverse set of outputs and choose
the one which is "most plausible" for a given input image.
0 }N
In practice, we propose two simple criteria for filter-
ing, both of which involve the object silhouette. One of
these uses additional mask supervision, while the other does
not. In both cases, we begin by rendering each point cloud
{X (i)
i=1 from the input camera view V . We render the
points as balls with a small fixed radius, such that we obtain
the silhouette ˆM (i) of our point cloud sample.
With mask supervision (PC2-FM). We compare each sil-
houette ˆM with the object mask M , which is extracted au-
tomatically using Mask-RCNN [8]. We then calculate their
intersection-over-union IoU ( ˆM (i), M ) and select the sam-
ple with the highest IoU score.
Without mask supervision (PC2-FA). Rather than using
an object mask, we filter based on the mutual agreement
between our predictions. Specifically, we compute the IoU
of each prediction with all of the other predictions and select
the mask with the highest average IoU . In this way, we
are able to select high-quality masks without any additional
supervision.
Finally, we emphasize that our filtering approach is a
general one; the two methods explored here are by no means
comprehensive.
4. Experiments
We will first describe our datasets, model, and the imple-
mentation details. We then discuss and analyze our results.
ShapeNet. The ShapeNet Dataset is a collection of 3D
CAD models corresponding to categories in the WordNet
lexical database. Due to its synthetic nature, ShapeNet is the
standard dataset for quantitative evaluation of single-view
6
Figure 4. Comparison with NeRF-WCE [9] on the hydrants cate-
gory of Co3D [34]. The first column shows the reference image,
while the following three images show renders from a novel view
(sampled randomly from a circle). The second column shows a
render of the ground truth point cloud (obtained from COLMAP on
the entire video). The third and fourth columns show renders from
NeRF-WCE and our model. NeRF-WCE produces highly blurry
outputs due to its deterministic nature. By contrast, our model
produces realistic shapes from any viewpoint.
Figure 5. Diversity. The leftmost column shows a reference image
from the chair category of ShapeNet, chosen specifically for its
high shape ambiguity. The following images show generations
produced by our model for eight random seeds. We see that our
model is capable of producing significant variations in shape while
still matching the input image from the reference viewpoint.
7
Figure 6. Examples of reconstructions produced by our method
along with prior work on seven classes from the ShapeNet-R2N2
dataset [1]. The leftmost image in each row is the conditioning
image. Given the simplicity and synthetic nature of ShapeNet, all
models produce adequate results; however, our model produces
reconstructions with the highest level of detail. We perform partic-
ularly well on challenging categories such as airplane and rifle.
reconstruction methods. We use the subset of 13 ShapeNet
categories from 3D-R2N2 [1] along with their standard set
of camera viewpoints, renderings, and train-test splits, which
we collectively refer to as the ShapeNet-R2N2 benchmark.
For evaluation, we use the widely-adopted F-score metric
proposed by Tatarchenko [48]. See the supplementary mate-
rial for further details on the ShapeNet and evaluation.
Co3D. The Co3D dataset is a challenging dataset consist-
ing of multi-view images of real-world objects from com-
mon object categories. For training data, we use point clouds
generated from running COLMAP [39, 40] on each image
sequence. Through these experiment, we demonstrate that
our method is able to reconstruct real-world objects using
training data that is derived only from multi-view images
processed with COLMAP.
We show results for three categories: hydrants, teddy
bears, and toy trucks. Since there is no prior work on single-
view reconstruction of Co3D, we train a NeRF-WCE [9] as
Input(Reference View)Ground Truth Point Cloud (Novel View)NeRF-WCE(Novel View)Ours(Novel View)InputInput ViewNovelViewInput ViewNovelViewInput ViewNovelViewInput ViewNovelViewInputLegoFormerPix2Vox++OursInputLegoFormerPix2Vox++Oursa baseline and present qualitative results (Fig. 4).
Implementation Details. For our diffusion model sθ, we
adopt a Point-Voxel CNN (PVCNN) [21] based on its suc-
cess as described in [60]. This model processes a point
cloud Xt using two branches simultaneously: a point-based
branch which processes points individually and a voxel-
based branch which aggregates nearby points in a hierar-
chical manner. In this way, the network is able to understand
both the global and local structure of a point cloud.
We implement our model in PyTorch [29] and use the
PyTorch3D library [33] for rasterization during the projec-
tion conditioning phase. Our point-voxel diffusion model is
trained with batch size 16 for a total of 100,000 steps. For
feature extraction, we use MAE [7]. For optimization, we
use AdamW [15] with a β = (0.9, 0.999) and a learning rate
which is decayed linearly from 0.0002 to 0 over the course
of training. We use images of size 137 × 137px and point
clouds with 8192 points, because prior work computes the
F-Score metric using 8192 points. For our diffusion noise
schedule, we use a linear schedule with warmup in which
beta increases from 1 * 10−5 to 8 * 10−3. All experiments are
performed on a single GPU.
Quantitative Results.
In Tab. 2, we show results for the
13 classes in the widely-used ShapeNet-R2N2 benchmark.
Without filtering, PC2 performs on-par with prior work. Ex-
amining the performance across categories, we see that our
method performs better on categories with objects that have
fine details, such as rifle and airplane.
With filtering, which is only possible due to the proba-
bilistic nature of our conditional diffusion process, PC2-FM
consistently outperforms prior work; it improves upon the
state-of-the-art on the majority of the object categories and
on average.
Qualitative Results. Figure 3 and Fig. 4 show qualitative
results of our method on the real-world Co3D dataset. Fig-
ure 3 visually demonstrates the intermediate steps of the
diffusion process as well as the final coloring step. Figure 4
compares our generations to those from NeRF-WCE [9].
Since NeRF-WCE is deterministic, it struggles to model
highly uncertain regions, and produces blurry images for
novel views which are far from the reference view. By con-
trast, our method produces realistic object shapes that can be
viewed from any viewpoint. Relative to prior methods, our
method is able to generate shapes with a significantly finer
level of detail.
Many additional qualitative results are shown in the sup-
plementary material.
Diversity of Generations. One key benefit of our proba-
bilistic approach to 3D reconstruction is that we are able to
generate multiple plausible shapes for a given reference view,
as shown in Fig. 5 on the ShapeNet benchmark. This figure
contains eight generations with different random seeds for
three highly-ambiguous images in the chair category. Our
method produces meaningful variations in shape, while al-
ways remaining consistent with the input image from the
given view. This ability to sample makes it possible for us
to develop our filtering method, which we analyze below.
Filtering Analysis.
In Tab. 3, we compare the perfor-
mance of our two filtering methods against our single-sample
performance and an oracle. The oracle chooses the best sam-
ple for each input image according to its F -score; it provides
an upper-bound to the improvements attainable via filtering.
Our mask-free filtering method (PC2-FA) improves results
substantially and using masks (PC2-FM) improves them
further. However, gap between our method and the oracle
suggests that there remains room for further improvement;
this represents an interesting potential avenue for future
work.
In Tab. 4, we compare our performance when filtering
with different numbers of images. We find that using just two
images significantly improves results, and adding additional
images leads to further performance gains. Naturally, more
and more samples further increase the performance but with
diminishing returns.
Limitations. The primary limitation of our model is the
need for point cloud ground truth for training. As men-
tioned in the introduction, this data is more accessible than
commonly imagined, as it can be extracted from multi-view
images or videos. However, point clouds obtained from
these methods can be noisy; in Co3D, for example, many of
the ground-truth point clouds for the hydrant category con-
tain holes in locations that were not observed in the original
video sequence. We find that our method is relatively robust
to this type of noisy data, but we feel it is still important to
discuss this limitation.
5. Conclusions
In this paper, we have proposed PC2, a novel diffusion-
based method for single-view 3D shape reconstruction. Our
method iteratively reconstructs a shape by projecting image
features onto a partially-denoised point cloud during the dif-
fusion process. Empirically, our experiments demonstrate
the effectiveness of PC2 at both reconstructing geometry and
point color. Quantitatively, we outperform prior methods
on synthetic benchmarks. Qualitatively, we are able to re-
construct objects with high levels of detail from challenging
real-world images. With regard to future work, it would be
interesting to scale our method to larger datasets and models.
Given the success of scaling diffusion models of 2D images
(e.g., DALLE-2 [32]), we hope this work is a step along the
path to developing similar models for 3D reconstruction.
Ethics. We use the ShapeNet and CO3D datasets in a man-
ner compatible with their terms. The images do not con-
tain personal data. ShapeNet models are used in a man-
8
ner compatible with the Data Analysis Permission. Please
see https://www.robots.ox.ac.uk/ ̃vedaldi/
research/union/ethics.html for further informa-
tion on ethics.
Acknowledgments. L. M. K. is supported by the Rhodes
Trust. A. V. and C. R. are supported by ERC-UNION-
CoG-101001212. C. R.
is also supported by VisualAI
EP/T028572/1.
References
[1] Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin
Chen, and Silvio Savarese. 3D-R2N2: A unified approach
for single and multi-view 3D object reconstruction. In Proc.
ECCV, pages 628–644, 2016. 2, 3, 5, 6, 7
[2] Prafulla Dhariwal and Alexander Nichol. Diffusion models
beat gans on image synthesis. In Advances in Neural Informa-
tion Processing Systems, volume 34, pages 8780–8794, 2021.
3
[3] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov,
Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner,
Mostafa Dehghani, Matthias Minderer, Georg Heigold, Syl-
vain Gelly, et al. An image is worth 16x16 words: Trans-
arXiv preprint
formers for image recognition at scale.
arXiv:2010.11929, 2020. 5
[4] Richard Hartley and Andrew Zisserman. Multiple View Geom-
etry in Computer Vision. Cambridge University Press, 2000.
2
[5] Richard I. Hartley and Frederik Schaffalitzky. Reconstruction
from projections using grassmann tensors. In Proc. ECCV,
LNCS. Springer-Verlag, 2004. 2
[6] R. I. Hartley and A. Zisserman. Multiple View Geometry
in Computer Vision. Cambridge University Press, ISBN:
0521540518, second edition, 2004. 2
[7] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr
Doll ́ar, and Ross B. Girshick. Masked autoencoders are scal-
able vision learners. In Proc. CVPR, volume abs/2111.06377,
2021. 8
[8] Kaiming He, Georgia Gkioxari, Piotr Doll ́ar, and Ross B.
Girshick. Mask R-CNN. In Proc. ICCV, 2017. 6
[9] Philipp Henzler, Jeremy Reizenstein, Patrick Labatut, Ro-
man Shapovalov, Tobias Ritschel, Andrea Vedaldi, and David
Novotny. Unsupervised learning of 3d object categories from
videos in the wild. In Proceedings of the IEEE/CVF Confer-
ence on Computer Vision and Pattern Recognition (CVPR),
pages 4700–4709, June 2021. 2, 3, 7, 8
[10] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffu-
sion probabilistic models. arXiv:2006.11239, 2020. 3
[11] Wonbong Jang and Lourdes Agapito. Codenerf: Disentangled
neural radiance fields for object categories. In Proceedings of
the IEEE/CVF International Conference on Computer Vision,
pages 12949–12958, 2021. 2
[12] Wonbong Jang and Lourdes Agapito. CodeNeRF: Disentan-
In Proc.
gled neural radiance fields for object categories.
ICCV, 2021. 2, 3
[13] Abhishek Kar, Christian H ̈ane, and Jitendra Malik. Learning
a multi-view stereo machine. In Nips, pages 364–375, 2017.
3
[14] Hiroharu Kato and Tatsuya Harada. Learning view priors for
single-view 3d reconstruction. Proc. CVPR, 2019. 2
[15] Diederik P Kingma and Jimmy Ba. Adam: A method for
stochastic optimization. In ICLR, 2015. 8
[16] Erwin Kruppa. To determine an object from two perspectives
with inner orientation. H ̈older, 1913. 2
[17] Jon ́aˇs Kulh ́anek, Erik Derner, Torsten Sattler, and Robert
Babuˇska. ViewFormer: NeRF-free neural rendering from few
images using transformers. In Proc. ECCV, 2022. 3
[18] Chen-Hsuan Lin, Oliver Wang, Bryan C. Russell, Eli Shecht-
man, Vladimir G. Kim, Matthew Fisher, and Simon Lucey.
Photometric mesh optimization for video-aligned 3d object
reconstruction. In Proc. CVPR, June 2019. 2
[19] Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo
numerical methods for diffusion models on manifolds. In
International Conference on Learning Representations, 2021.
3
[20] Shichen Liu, Tianye Li, Weikai Chen, and Hao Li. Soft raster-
izer: A differentiable renderer for image-based 3d reasoning.
In Proceedings of the IEEE/CVF International Conference
on Computer Vision, pages 7708–7717, 2019. 2
[21] Zhijian Liu, Haotian Tang, Yujun Lin, and Song Han. Point-
voxel cnn for efficient 3d deep learning. In Conference on
Neural Information Processing Systems (NeurIPS), 2019. 8,
12
[22] Shitong Luo and Wei Hu. Diffusion probabilistic models for
3d point cloud generation. In Proceedings of the IEEE/CVF
Conference on Computer Vision and Pattern Recognition
(CVPR), June 2021. 3
[23] Zhaoyang Lyu, Zhifeng Kong, Xudong XU, Liang Pan,
and Dahua Lin. A conditional point diffusion-refinement
paradigm for 3d point cloud completion. In International
Conference on Learning Representations, 2022. 3
[24] S. J. Maybank. The angular velocity associated with the opti-
cal flow field arising from motion through a rigid environment.
Proc. R. Soc. Lond., 401, 1985. 2
[25] Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun
Wu, Jun-Yan Zhu, and Stefano Ermon. SDEdit: Guided image
synthesis and editing with stochastic differential equations. In
International Conference on Learning Representations, 2022.
2
[26] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Se-
bastian Nowozin, and Andreas Geiger. Occupancy networks:
Learning 3d reconstruction in function space. In Proceedings
of the IEEE/CVF Conference on Computer Vision and Pattern
Recognition, pages 4460–4470, 2019. 2
[27] B Mildenhall, PP Srinivasan, M Tancik, JT Barron, R Ra-
mamoorthi, and R Ng. Nerf: Representing scenes as neural
radiance fields for view synthesis. In European conference
on computer vision, 2020. 3
[28] Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav
Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and
Mark Chen. Glide: Towards photorealistic image generation
and editing with text-guided diffusion models. arXiv preprint
arXiv:2112.10741, 2021. 2, 3
9
[29] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer,
James Bradbury, Gregory Chanan, Trevor Killeen, Zeming
Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An
imperative style, high-performance deep learning library. Ad-
vances in neural information processing systems, 32, 2019.
8
[30] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas.
PointNet: Deep learning on point sets for 3d classification
and segmentation. In Proc. CVPR, pages 652–660, 2017. 3,
12
[31] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J
Guibas. PointNet++: Deep hierarchical feature learning on
point sets in a metric space. In Nips, pages 5099–5108, 2017.
12
[32] Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu,
and Mark Chen. Hierarchical text-conditional image genera-
tion with clip latents. arXiv preprint arXiv:2204.06125, 2022.
2, 8
[33] Nikhila Ravi, Jeremy Reizenstein, David Novotny, Taylor
Gordon, Wan-Yen Lo, Justin Johnson, and Georgia Gkioxari.
Accelerating 3d deep learning with pytorch3d. arXiv preprint
arXiv:2007.08501, 2020. 5, 8
[34] Jeremy Reizenstein, Roman Shapovalov, Philipp Henzler,
Luca Sbordone, Patrick Labatut, and David Novotny. Com-
mon objects in 3d: Large-scale learning and evaluation of
real-life 3d category reconstruction. In International Confer-
ence on Computer Vision, 2021. 2, 4, 7
[35] Jeremy Reizenstein, Roman Shapovalov, Philipp Henzler,
Luca Sbordone, Patrick Labatut, and David Novotny. Com-
mon Objects in 3D: Large-scale learning and evaluation of
real-life 3D category reconstruction. In Proc. CVPR, 2021. 3
[36] Konstantinos Rematas, Ricardo Martin-Brualla, and Vittorio
Ferrari. Sharf: Shape-conditioned radiance fields from a sin-
gle view. In International Conference on Machine Learning,
pages 8948–8958. PMLR, 2021. 2
[37] Konstantinos Rematas, Ricardo Martin-Brualla, and Vittorio
Ferrari. ShaRF: Shape-conditioned radiance fields from a
single view. In Proc. ICML, 2021. 2, 3
[38] Robin Rombach, Andreas Blattmann, Dominik Lorenz,
Patrick Esser, and Bj ̈orn Ommer. High-resolution image
synthesis with latent diffusion models, 2021. 2, 3
[39] Johannes Lutz Sch ̈onberger and Jan-Michael Frahm.
Structure-from-motion revisited. In Conference on Computer
Vision and Pattern Recognition (CVPR), 2016. 7
[40] Johannes Lutz Sch ̈onberger, Enliang Zheng, Marc Pollefeys,
and Jan-Michael Frahm. Pixelwise view selection for un-
structured multi-view stereo. In European Conference on
Computer Vision (ECCV), 2016. 7
[41] Karen Simonyan and Andrew Zisserman. Very deep convo-
lutional networks for large-scale image recognition. arXiv
preprint arXiv:1409.1556, 2014. 3
[42] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising
diffusion implicit models. arXiv:2010.02502, 2020. 3
[43] Yang Song and Stefano Ermon. Generative modeling by
estimating gradients of the data distribution. volume 32, 2019.
3
[44] Yang Song and Stefano Ermon.
Improved techniques for
training score-based generative models. volume 33, pages
12438–12448, 2020. 3
[45] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Ab-
hishek Kumar, Stefano Ermon, and Ben Poole. Score-based
generative modeling through stochastic differential equations.
In International Conference on Learning Representations,
2021. 3
[46] Xingyuan Sun, Jiajun Wu, Xiuming Zhang, Zhoutong Zhang,
Chengkai Zhang, Tianfan Xue, Joshua B Tenenbaum, and
William T Freeman. Pix3d: Dataset and methods for single-
image 3d shape modeling. In Proceedings of the IEEE Con-
ference on Computer Vision and Pattern Recognition, pages
2974–2983, 2018. 2
[47] Maxim Tatarchenko, Stephan R Richter, Ren ́e Ranftl, Zhuwen
Li, Vladlen Koltun, and Thomas Brox. What do single-
view 3d reconstruction networks learn? In Proceedings of
the IEEE/CVF Conference on Computer Vision and Pattern
Recognition, pages 3405–3414, 2019. 2
[48] Maxim Tatarchenko, Stephan R. Richter, Rene Ranftl,
Zhuwen Li, Vladlen Koltun, and Thomas Brox. What do
single-view 3d reconstruction networks learn? In Proc. CVPR,
June 2019. 5, 7
[49] Bram Wallace and Bharath Hariharan. Few-shot generaliza-
tion for single-image 3d reconstruction via priors. In Proceed-
ings of the IEEE/CVF International Conference on Computer
Vision, pages 3818–3827, 2019. 2
[50] Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei
Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh
models from single rgb images. In Proceedings of the Euro-
pean Conference on Computer Vision (ECCV), pages 52–67,
2018. 2
[51] Peng Wang, Lingjie Liu, Yuan Liu, Christian Theobalt, Taku
Komura, and Wenping Wang. NeuS: Learning neural implicit
surfaces by volume rendering for multi-view reconstruction.
arXiv.cs, abs/2106.10689, 2021. 3
[52] Daniel Watson, William Chan, Jonathan Ho, and Moham-
mad Norouzi. Learning fast samplers for diffusion models
by differentiating through sample quality. In International
Conference on Learning Representations, 2021. 3
[53] Yan Xia, Cheng Wang, Yusheng Xu, Yu Zang, Weiquan Liu,
Jonathan Li, and Uwe Stilla. Realpoint3d: Generating 3d
point clouds from a single image of complex scenarios. Re-
mote Sensing, 11(22), 2019. 2
[54] Haozhe Xie, Hongxun Yao, Xiaoshuai Sun, Shangchen Zhou,
and Shengping Zhang. Pix2vox: Context-aware 3d reconstruc-
tion from single and multi-view images. In Proceedings of
the IEEE/CVF International Conference on Computer Vision,
pages 2690–2698, 2019. 2, 3, 5, 6
[55] Haozhe Xie, Hongxun Yao, Shengping Zhang, Shangchen
Zhou, and Wenxiu Sun. Pix2vox++: multi-scale context-
aware 3d object reconstruction from single and multi-
International Journal of Computer Vision,
ple images.
128(12):2919–2935, 2020. 2, 3, 5, 6
[56] Farid Yagubbayli, Alessio Tonioni, and Federico Tombari.
Legoformer: Transformers for block-by-block multi-view 3d
reconstruction, 2021. 2, 3, 6
10
[57] Alex Yu, Vickie Ye, Matthew Tancik, and Angjoo Kanazawa.
pixelnerf: Neural radiance fields from one or few images.
In Proceedings of the IEEE/CVF Conference on Computer
Vision and Pattern Recognition, pages 4578–4587, 2021. 2, 3
[58] Alex Yu, Vickie Ye, Matthew Tancik, and Angjoo Kanazawa.
PixelNeRF: Neural radiance fields from one or few images.
In Proc. CVPR, 2021. 2, 6
[59] Zehao Yu, Jia Zheng, Dongze Lian, Zihan Zhou, and
Shenghua Gao. Single-image piece-wise planar 3d recon-
struction via associative embedding. In Proc. CVPR, June
2019. 2
[60] Linqi Zhou, Yilun Du, and Jiajun Wu. 3d shape generation
and completion through point-voxel diffusion. In Proceed-
ings of the IEEE/CVF International Conference on Computer
Vision (ICCV), pages 5826–5835, October 2021. 3, 8
11
6. Implementation Details
8. Additional Ablations
We include additional ablations omitted from the main
paper due to space constraints. These ablations were per-
formed on a subset of ShapeNet dataset consisting of only
the sofa category.
Mask Distance Function. We removed the 2D mask dis-
tance function described in Section 6. This change had a
small effect, reducing the F -score by 0.019 points, a relative
decrease of 9%. Qualitatively, the generated point clouds
were similar to those produced using the mask distance func-
tion.
Projection Method. We replaced the rasterization-based
projection described in Section 3.4 with a naive projection
that projects all points (including occluded points) onto the
image. This change was detrimental, reducing the F -score
by 0.081 points, a relative decrease of 40%. Qualitatively,
these point clouds were significantly worse than those with
the rasterization-based projection. These results suggest that
the rasterization-based projection is a key component of the
method.
9. Analysis of Failure Cases
Failure cases of our model are shown in Fig. 11. Note that
these are from the ShapeNet-R2N2 dataset, which combines
13 ShapeNet classes but does not permit the use of category
labels. In other words, the model is image-conditional, but
not class-conditional.
Examining these failure cases, we observe that our model
sometimes performs poorly on images with ambiguous cate-
gories. For example, in the 8th column of the 2nd row of the
figure, it appears that the model generates a chair rather than
a box. Similarly, in the 12th row of the 5th row of the figure,
the object seems to have generated a box rather than a couch.
These errors are most likely due to the fact that these cate-
gories all have instances which resemble rectangular prisms
from certain views.
It is also notable that on many of the challenging examples
on which our model struggles (e.g., the examples for the
watercraft category located in the last row of the figure),
other models also struggle to a similar degree.
Here, we provide additional details about the model and
projection procedure.
First, we discuss the Point-Voxel [21] model which is
used to process the partially-denoised point cloud at each
step of the diffusion process. As its name suggests, this
model processes a point cloud using two branches simul-
taneously: a point-based branch and voxel-based branch.
The point-based branch is a simple multi-layer perceptron
which is applied to each point independently, as in Point-
Net [30, 31] (without the global pooling in the final layer
of PointNet). The voxel-based branch first discretizes the
points into a coarse voxel grid of size 1283, which is fed
into a 3D U-Net. As in [21], the 3D U-Net consists of four
downsampling ("Set Abstraction") layers followed by four
upsampling ("Feature Propogation") layers. Due to this fine-
to-coarse-to-fine structure, the network is able to capture
both global and local shape information. Additionally, to
make the model aware of the current timestep of the diffu-
sion process, we concatenate an embedding of the current
timestep to the point features at the input to each layer.
Second, we discuss the implementation of the projec-
tion feature. We perform the projection by rasterizing the
point cloud from the given camera view. We utilize the
PointRasterizer class of PyTorch3D using a point ra-
dius of 0.0075 and 1 point per pixel. For each point in the
point cloud, if the point is rasterized onto a pixel in the input
image, we concatenate the image features corresponding to
the pixel onto that point's existing feature vector (which is
simply a sinusoidal positional embedding of its current posi-
tion) for input to the model. Additionally, we concatenate
the value of the (binary) object mask at the given pixel and a
two-dimensional vector pointing from the pixel to the closest
pixel in the mask (i.e. a two-dimensional distance function
corresponding to the mask region; this is the zero vector
inside the mask and a nonzero vector outside the mask). If a
pixel is not rasterized to a point (for example, because it is
occluded by another point), we concatenate a vector of zeros
in place of all the quantities above.
7. Additional Qualitative Examples
We provide additional qualitative examples of our method
in Figs. 7, 8 and 10 to 12. Figures 7 to 9 show examples of
reconstructions on additional categories of Co3D, includ-
ing hydrants, teddybears, glasses, remotes, motorcycles,
hairdryers, plants, and donuts. Fig. 10 contains a selec-
tion of the best reconstructions produced by our model for
each category of ShapeNet, as ranked by F-score. Fig. 12
contains random examples of reconstructions produced by
our model on ShapeNet. Finally, Fig. 11 shows a selection of
the worst examples produced by our model for each category
on ShapeNet, as ranked by F-score.
12
Figure 7. Additional qualitative examples. Examples from the hydrants category of Co3D. The first column in each row shows the input
image. The second and third columns show intermediate steps in the diffusion process. The fourth column shows the final reconstructed
point cloud with color. The remaining five rows show the final predicted point cloud from novel views.
13
Figure 8. Additional qualitative examples. Examples from the teddy bear category of Co3D. The first column in each row shows the input
image. The second and third columns show intermediate steps in the diffusion process. The fourth column shows the final reconstructed
point cloud with color. The remaining five rows show the final predicted point cloud from novel views.
14
Figure 9. Additional qualitative examples. Examples from six additional categories: glasses, remotes, motorcycles, hairdryers, plants, and
donuts.
15
InputMasked InputInput ViewNovel ViewInputMasked InputInput ViewNovel ViewFigure 10. Successful examples produced by our method along with prior work. The leftmost image in each set of images is the input
image. Note that there are no images in the last row of the right half of the figure because we show examples for all 13 ShapeNet-R2N2
classes (seven on the left and six on the right).
16
Figure 11. Failure cases of our method along with prior work. The leftmost image in each set of images is the input image. Note that there
are no images in the last row of the right half of the figure because we show examples for all 13 ShapeNet-R2N2 classes (seven on the left
and six on the right).
17
Figure 12. Random examples of our method along with prior work. The leftmost image in each set of images is the input image. Note that
there are no images in the last row of the right half of the figure because we show examples for all 13 ShapeNet-R2N2 classes (seven on the
left and six on the right).
18
|
|
http://arxiv.org/abs/2302.10667v1 | 2023-02-21T13:28:37 | 2023-02-21T13:28:37 | Reinforcement Learning in a Birth and Death Process: Breaking the
Dependence on the State Space | In this paper, we revisit the regret of undiscounted reinforcement learning
in MDPs with a birth and death structure. Specifically, we consider a
controlled queue with impatient jobs and the main objective is to optimize a
trade-off between energy consumption and user-perceived performance. Within
this setting, the \emph{diameter} $D$ of the MDP is $\Omega(S^S)$, where $S$ is
the number of states. Therefore, the existing lower and upper bounds on the
regret at time$T$, of order $O(\sqrt{DSAT})$ for MDPs with $S$ states and $A$
actions, may suggest that reinforcement learning is inefficient here. In our
main result however, we exploit the structure of our MDPs to show that the
regret of a slightly-tweaked version of the classical learning algorithm {\sc
Ucrl2} is in fact upper bounded by $\tilde{\mathcal{O}}(\sqrt{E_2AT})$ where
$E_2$ is related to the weighted second moment of the stationary measure of a
reference policy. Importantly, $E_2$ is bounded independently of $S$. Thus, our
bound is asymptotically independent of the number of states and of the
diameter. This result is based on a careful study of the number of visits
performed by the learning algorithm to the states of the MDP, which is highly
non-uniform. | [
"Jonatha Anselmi",
"Bruno Gaujal",
"Louis-Sébastien Rebuffi"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10667v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10667v1",
"@rel": "related",
"@type": "application/pdf"
}
] | [
"NeurIPS 2022 - 36th Conference on Neural Information Processing\n Systems, Nov 2022, New Orleans, United States"
] | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"stat.ML"
] | 3
2
0
2
b
e
F
1
2
]
G
L
.
s
c
[
1
v
7
6
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Reinforcement Learning in a Birth and Death
Process: Breaking the Dependence on the State Space
Jonatha Anselmi
[email protected]
Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP, LIG, 38000 Grenoble, France.
Bruno Gaujal
[email protected]
Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP, LIG, 38000 Grenoble, France.
Louis-Sébastien Rebuffi
[email protected]
Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP, LIG, 38000 Grenoble, France.
Abstract
In this paper, we revisit the regret of undiscounted reinforcement learning in
MDPs with a birth and death structure. Specifically, we consider a controlled
queue with impatient jobs and the main objective is to optimize a trade-off be-
tween energy consumption and user-perceived performance. Within this setting,
the diameter D of the MDP is Ω(SS), where S is the number of states. Therefore,
the existing lower and upper bounds on the regret at time T , of order O(√DSAT )
for MDPs with S states and A actions, may suggest that reinforcement learning is
inefficient here. In our main result however, we exploit the structure of our MDPs
to show that the regret of a slightly-tweaked version of the classical learning al-
gorithm UCRL2 is in fact upper bounded by ̃
(√E2AT ) where E2 is related to
O
the weighted second moment of the stationary measure of a reference policy. Im-
portantly, E2 is bounded independently of S. Thus, our bound is asymptotically
independent of the number of states and of the diameter. This result is based on
a careful study of the number of visits performed by the learning algorithm to the
states of the MDP, which is highly non-uniform.
1 Introduction
In the context of undiscounted reinforcement learning in Markov decision processes (MDPs), it has
been shown in the seminal work [11] that the total regret of any learning algorithm with respect to
an optimal policy is lower bounded by Ω(√DSAT ), where S is the number of states, A the number
of actions, T the time horizon and D the diameter of the MDP. Roughly speaking, the diameter is
the mean time to move from any state s to any other state s′ within an appropriate policy. In the
literature, several efforts have been dedicated to approach this lower bound. As a result, learning
algorithms have been developed with a total regret of ̃
(D√SAT ) in [3] and
O
even ̃
(√DSAT ) according to [22, 26]. These results may give a sense of optimality since the
O
lower bound is attained up to some universal constant. However, lower bounds are based on the
minimax approach, which relies on the worst possible MDP with given D, A and S. This means
that when a reinforcement learning algorithm is used on a given MDP, one can expect a much better
performance.
(DS√AT ) in [11], ̃
O
This is a corrected version of the NeurIPS 2022 publication (several typos in the proofs).
One way to alleviate the minimax lower bound is to consider structured reinforcement learning,
or equivalently MDPs with some specific structure. The exploitation of such structure may yield
more efficient learning algorithms or tighter regret analyses of existing learning algorithms. In this
context, a first example is to consider factored MDPs [6, 9], i.e., MDPs where the state space can
be factored into a number of components; in this case, roughly speaking, S = K n where n is the
number of "factors" and K is the number of states in each factor. The regret of learning algorithms
in factored MDPs has been analyzed in [21, 18, 25, 15] and it is found that the S term of existing
upper bounds can be replaced by nK. A similar approach is used in [8] to learn the optimal policy
in stochastic bandits with a regret that is logarithmic in the number of states. There is also a line
of research works that exploit the parametric nature of MDPs. Inspired by parametric bandits, a
d-linear additive model was introduced in [12], where it is shown that an optimistic modification of
Least-Squares Value Iteration, see [16], achieves a regret over a finite horizon H of ̃
(√d3H 3T )
O
where d is the ambient dimension of the feature space (the number of unknown parameters). In this
case, the regret does not depend on the number of states and actions and the diameter is replaced
by the horizon. A discussion about the inapplicability of this approach to our case is postponed to
Section 4.2.
Learning in Queueing Systems. The control of queueing systems is undoubtedly one of the main
application areas of MDPs; see, e.g., [17, Chapters 1–3] and [14]. Within the rich literature of
structured reinforcement learning however, few papers are dedicated to reinforcement learning in
queueing systems, see [23, Section 5], and this motivates us to examine the total regret in this
context. Typical control problems on queues have the following distinguishing characteristics:
1. No discount. Discounting costs or rewards is common practice in the reinforcement learning
literature, especially in Q-learning algorithms [20]. However, in queues one is typically interested
in optimizing with respect to the average cost.
2. Large diameter. Queueing systems are usually investigated under a drift condition that makes the
system stable, i.e., positive recurrent. This condition implies that some states are hard to reach.
In fact, for many queueing control problems, the diameter D is exponential in the size of the
state space. Even in the simple case of an M/M/1 queue with a finite buffer, or equivalently a
birth–death process with a finite state space and constant birth and death rates, the diameter is
exponential in the size of the state space.
3. Structured transition matrices. Queueing models describe how jobs join and leave queues, and
this yields bounded state transitions. As a result, MDPs on queues have sparse and structured
transition matrices.
The regret bounds discussed above and item 2 may suggest that the total regret of existing learning
algorithm, when applied to queueing systems, is large. However, they often work well in practice
and this bring us to consider the following question: When the underlying MDP has the structure of
a queueing system, do the diameter D or the number of states S actually play a role in the regret?
−
Our Contribution.
In this paper, we examine the previous question with respect to the class of
control problems presented in [1]. Specifically, an infinite sequence of jobs joins a service system
over time to receive some processing according to the first-come first-served scheduling rule; the
system can buffer at most S
1 jobs and in fact it corresponds to an M/M/1/S-1 queue. In addition,
each job comes with a deadline constraint, and if a job is not completed before its deadline, then
it becomes obsolete and is removed from the system. The controller chooses the server processing
speed and the objective is to design a speed policy for the server that minimizes its average energy
consumption plus an obsolescence cost per deadline miss. Although this may look quite specific,
this problem captures the typical characteristics of a controlled queue: i) the transition matrix has
the structure of a birth and death process with jump probabilities that are affine functions of the state
and ii) the reward is linear in the state and convex in the action. For any MDP in this class, defined
2); see Appendix B.3. Thus,
in full details in Section 3, we show that the diameter is D = Ω(SS
without exploiting the particular structure of this MDP, the existing lower and upper bounds do not
justify the reason why standard learning algorithms work efficiently here.
−
We provide a slight variation of the learning algorithm UCRL2, introduced in [11], and show in
our main result that the resulting regret is upper bounded by ̃
(√E2AT ) where E2 is a term that
O
depends on the stationary measure of a reference policy defined in Section 3.1. Importantly, E2
2
does not depend on S. Thus, efficient reinforcement learning can be achieved independently of the
number of states by exploiting the stationary structure of the MDP. Let us provide some intuition
about our result. First, one may think that any learning algorithm should visit each state a sufficient
number of times, which justifies why the diameter of an MDP appears in existing regret analyses.
However, this point of view does not take into account the fact that the value of an MDP is the scalar
product of the reward and the stationary measure of the optimal policy. If this stationary measure
is "highly non-uniform", then some states are rarely visited under the optimal policy and barely
contribute to the value. In this case, we claim that the learner may not need to visit the rare states
that often to get a good estimation of the value, and thus it may not need to pay for the diameter.
2 Reinforcement Learning Framework
A
We consider a unichain Markov Decision Process (MDP) M = (
S
S
the finite action space, P the transition probabilities and r the expected
is the finite state space,
reward function [17]. Let also S :=
is the set cardinality operator. The
model-based reinforcement learning problem consists in finding a learning algorithm, or learner,
that chooses actions to maximize a cumulative reward over a finite time horizon T . At each time
N, the system is in state st ∈ S
step t
. When
executing at, the learner receives a random reward rt(st, at) with mean r(st, at) and the system
moves, at time step t + 1, to state s′ with probability P (s′
st, at). The learning algorithm does not
know the MDP M except for the sets
and the learner chooses an action at ∈ A
, P, r) in discrete time where
and A :=
where
and
|A|
| * |
|S|
A
∈
,
|
S
.
A
For simplicity, in the following we consider weakly communicating MDPs. Since we will be inter-
ested in the long-run average cost, this will let us remove the dependence on the initial state for
several quantities of interest.
2.1 Undiscounted Regret
Given an MDP M , let Π :=
and let
π :
{
S → A}
denote the set of stationary and deterministic policies
ρ(M, π) := lim
→∞
T
1
T
t=1
X
T
E[r(st, π(st))]
(1)
denote the average reward induced by policy π. Since M has finite state and action spaces, we
notice that i) The limit in (1) always exists, ii) It does not depend on the initial state s0 when M is
unichain [17] and iii) The restriction to stationary and deterministic policies is not a loss of optimal-
ity [17, Theorem 8.4.5].
Let also ρ∗ := ρ∗(M ) := maxπ
Π ρ(M, π) be the optimal average reward.
Definition 2.1 (Regret). The regret at time T of the learning algorithm L is
∈
Reg(M, L, T ) := T ρ∗(M )
T
−
t=1
X
rt.
(2)
The regret 2 is a natural benchmark for evaluating the performance of a learning algorithm. In [11],
a universal lower bound on Reg(M, L, T ) has been developed in terms of the diameter of the under-
lying MDP.
Definition 2.2 (Diameter of an MDP). Let π :
s. Let T (s′
0 : st = s′
in which s′ is reached from s under π. Then, we say that the diameter of M is
be a stationary policy of M with initial state
be the random variable for the first time step
S → A
s0 = s
}
M, π, s) := min
≥
{
t
|
|
D(M ) := max
=s′ min
π:
s
S→A
E [T (s′
|
M, π, s)] .
It should be clear that the diameter of an MDP can be large if there exist states that are hard to
reach. Within the set of structured MDPs considered in this paper, this will be the case and we will
2). The following result shows that all learning algorithms have a regret that
show that D = Ω(SS
eventually increase with √D.
−
3
6
Theorem 2.3 (Universal lower bound [11]). For any learning algorithm L, any natural numbers
DSA, there is an MDP M with S states, A actions, and
S, A
diameter D such that for any initial state s
20 logA S, and T
10, D
≥
≥
≥
≥
In view of this result, the diameter of an MDP and its state space appear to be critical parameters for
evaluating the performance of a learning algorithm.
0.015√DSAT .
(3)
,
∈ S
E[Reg(M, L, T )]
2.2 The UCRL2 Algorithm
We now focus on UCRL2, a classical reinforcement learning algorithm introduced in [11] that is a
variant of UCRL [2]. While more efficient algorithms have been proposed for the general case (see
for example [3, 22]), we will show that UCRL2 already achieves a very low regret, namely ̃
(√AT ),
O
independent of S so using more refined algorithms can only bring marginal gains.
UCRL2 is based on episodes. For each episode k, let tk denote its start time. For each state s and
action a, let νk(s, a) denote the number of visits of (s, a) during episode k and let Nt(s, a) :=
Mk be the
#
{
confidence set of MDPs with transition probabilities ̃p and rewards ̃r that are "close" to the empirical
MDP at episode k, ˆpk and ˆrk, i.e., ̃p and ̃r satisfy
denote the number of visits of (s, a) until timestep t. Let
τ < t : sτ = s, aτ = a
}
(s, a),
∀
̃r(s, a)
|
−
ˆrk(s, a)
| ≤
rmax
s
7 log (2SAtk/δ)
1, Ntk(s, a)
}
{
2 max
(s, a),
∀
s, a)
̃p(
*|
k
ˆpk(
*|
−
s, a)
k1 ≤ s
14S log (2Atk/δ)
1, Ntk(s, a)
max
}
{
.
(4)
(5)
With these quantities, a pseudocode for UCRL2 is given in Algorithm 1. We notice that UCRL2
relies on Extended Value Iteration (EVI), that is a variant of the celebrated Value Iteration (VI) algo-
rithm [17]; for further details about EVI, we point the reader to [11, Section 3.1]. Let us comment on
how UCRL2 works. There are three main steps. First, at the start of each episode, UCRL2 computes
Algorithm 1: The UCRL2 algorithm.
Input: A confidence parameter δ
Output: .
∈
(0, 1),
and
.
A
S
1 Set t := 1 and observe s1
2 for episodes k = 1, 2, . . . do
3
Compute the estimates ˆr(s, a) and ˆpk(s′
s, a) as in (7).
Use "Extended Value Iteration" to find a policy ̃πk and an optimistic MDP ̃Mk ∈ Mk such
that
(6)
max
∈Mk,π
ρ( ̃Mk, ̃πk)
1
√tk
ρ(M ′, π)
M ′
−
|
≥
1, Ntk(st, ̃πk(st))
}
do
while νk(st, ̃πk(st)) < max
{
Choose action at = ̃πk(st), obtain reward rt and observe st+1;
νk(st, at) := νk(st, at) + 1;
t := t + 1;
4
5
6
7
8
end
9
10 end
the empirical estimates
ˆrk(s, a) :=
1
tk−
t=1 rt1
max
{
P
1, Ntk (s, a)
}
{
st=s,at=a
}
,
ˆpk(s′
|
s, a) :=
1
tk−
t=1
1
max
P
{
st=s,at=a,st+1=s′
1, Ntk(s, a)
}
{
}
(7)
of the reward and probability transitions, respectively, where 1E is the indicator function of E. Then,
it applies Extended Value Iteration (EVI) to find a policy ̃πk and an optimistic MDP ̃Mk ∈ Mk such
that (6) holds true. Finally, it executes policy ̃πk until it finds a state-action pair (s, a) whose count
within episode k is greater than the corresponding state-action count prior to episode k.
4
3 Controlled Birth and Death Processes for Energy Minimization
∈
M
M
[0, λmax] in a buffer of size S
Now, we focus on a specific class of MDPs that has been introduced in [1], which provides a rather
general example of a controlled birth and death process with convex costs on the actions and linear
rates. We will denote by
the set of MDPs with the structure described below. The MDPs
have been proposed to represent a Dynamic Voltage and Frequency Scaling (DVFS) processor
in
executing jobs with soft obsolescence deadlines. Here, jobs arrive according to a Poisson process
with rate λ
1. If the buffer is full and a job arrives, then the
job is rejected. Each job has a deadline and a size, i.e., amount of work, which are exponentially
[0, μmax] and one, respectively. Job deadlines and sizes
distributed random variables with rates μ
are all independent random variables. If a job misses its deadline, which is a real time constraint
activated at the moment of its arrival, it is removed from the queue without being served and a cost C
is paid. The processor serves jobs under any work-conserving scheduling discipline, e.g., first-come
first-served, with a processing speed that belongs to the finite set
. The objective is
to design a speed policy that minimizes the sum of the long term power dissipation and the cost
induced by jobs missing their deadlines. When the processor works at speed a
, it
processes a units of work per second while its power dissipation is w(a).
0, . . . , Amax}
0, . . . , Amax}
∈ {
−
∈
{
After uniformization, it is shown in [1] that this control problem can be modeled as an MDP in
discrete time with a "birth-and-death" transition matrix of size S. Specifically, we have an MDP
representing the number of jobs in the
, with s
0, . . . , S
M = (
}
A
system, and
representing the processor speed. Then, the transition
, with a
probabilities under policy π are given by
S
{
0, . . . , Amax}
, P, r) where
−
∈ A
∈ S
A
=
=
S
{
1
,
Pi,j(π) =
1
U λi
1
U (π(i) + iμ)
Pii
0
1 and j = i + 1
if i < S
−
if i > 0 and j = i
if j = i
otherwise,
1
−
1
−
1)μmax + Amax is a uniformization constant, Pii = 1
where U := λmax + (S
is the decaying arrival rate. We have replaced the constant arrival rate λ by
and λi := λ
a decaying arrival rate λi because we want to learn an optimal policy that does not exploit the buffer
size S
1; see [1] for further details. For conciseness, Figure 1 displays the transition diagram of
the Markov chain induced by policy π.
λi −
U (U
π(i))
μi
−
−
−
−
(cid:16)
(cid:17)
−
S
1
i
Pii
i
λi
U
i + 1
• • •
S
1
−
0
• • •
1
i
−
1
U (iμ + π(i))
Figure 1: Transition diagram of the Markov chain induced by policy π of an MDP in
.
M
Finally, the reward is a combination of C, the constant cost due to a departing job missing its
deadline and w(a), an arbitrary convex function of a, giving the energy cost for using speed a. The
immediate cost c(s, a) in state s under action a is a random variable whose value is w(a)/U + C
with probability sμ/U (missed deadline) and w(a)/U otherwise. To keep in line with the use of
rewards instead of costs, we introduce a bound on the cost, rmax := C + w(Amax)/μ so that the
reward in state s under action a is a positive and bounded random variable given by
r(s, a) := rmax −
c(s, a).
(8)
As in Section 2.1, ρ∗(M ) is the optimal average cost and ρ(M, π) is the average cost induced by
policy π, where π belongs to the set of deterministic and stationary policies Π. Since the underlying
5
Markov chain induced by any policy is ergodic, we observe that
S
1
−
ρ(M, π) =
E[r(s, π(s))]mπ
s ,
(9)
where mπ is the stationary measure under policy π. In [1], it has been shown that the optimal policy
is unique and will be denoted by π∗.
s=0
X
3.1 Properties of
M
In the following, we will use the "reference" (or bounding) policy π0(s) = 0 for all s
, which
thus assigns speed 0 to all states. This policy provides a stochastic bound on all policies in the
following sense. Let sπ
≤st denote the stochastic order [19];
t be the state under policy π and let
given two random variables X and Y on R+, we recall that X
≤st Y if P(X
s) for
s)
≥
≤
all s.
t ≤st sπ0
Π, sπ
Lemma 3.1. Consider an MDP in
0 ≤st sπ0
sπ
0 .
Proof. (sketch) The proof follows by a simple coupling argument between the two policies. Roughly
speaking, each time the Markov chain under π decreases from s to s
1 because of the speed π(s),
it stays in state s under policy π0.
. For all t and policy π
, provided that
P(Y
∈ S
M
−
≥
∈
t
P(sπ0
Therefore, P(sπ
measures are comparable, i.e.,
t ≥
s)
≤
s) for all s and t, which also implies that the respective stationary
t ≥
1
S
i=s mπ
−
i=s mπ0
−
S
1
.
i
Let us now consider H(s), the bias at state s of a policy π, defined by
P
i ≤
P
H(s) := Eπ
∞
(r (sπ
t , π(sπ
t ))
ρπ(M ))
−
sπ
0 = s
|
,
#
0
∀
≤
s
≤
S
−
1.
(10)
"
t=1
X
−
−
Let also ∂H(s) := H(s)
H(s
1) be the local variation of the bias.
The following result on the variations of the bias holds (see Appendix C.1):
Lemma 3.2. The local variation of the bias ∂H(s) is bounded:
∂H(s)
2rmaxeλ/μ(1 + log s) for all 1
1.
S
s
|
| ≤
≤
≤
−
∆(s) with ∆(s) :=
Both mπ0
and ∆ will play a major role in our analysis of the regret.
3.2 Applying UCRL2 in
M
We assume that the bounds λmax and μmax are fixed so that rmax is known to the learner. This is a
classical assumption, often replaced by assuming that rewards live in [0, 1].
rmax
2 log(2Atk)
In the remainder, we will apply UCRL2 over an MDP in
with a change in the confidence bounds
to take into account the support of P . The confidence bounds in (4) (resp. (5)) are replaced by
Mk only
contains matrices with the same support as P . Removing S in the confidence bounds does help to
reduce the regret. However, by using existing analysis, this only removes a factor √S in the regret
bound (for example, see [4]).
). We also impose that the confidence set
1,Ntk (s,a)
{
1,Ntk (s,a)
8 log(2Atk)
(resp.
M
max
max
r
q
}
{
}
Finally, note that UCRL2 does not benefit from the parametric nature of the MDPs in
).
essentially defined by three parameters (λ, μ and C) and the real convex function w(
*
M
, which is
4 Regret of UCRL2 on
M
Our objective is to develop an upper bound on the regret of the learning algorithm UCRL2 when
applied to MDPs in our class
. The driving idea is to construct a bound that exploits the structure
M
of the stationary measure of all policies, as they all make some states hard to reach, and to control
the number of visits to these states to get a new type of bound.
6
4.1 Main Result
The following theorem gives an upper bound on the regret that does not depend on the classical
parameters such as the size of the state space nor on global quantities such as the diameter of the
MDP nor the span of the bias of some policy. Instead, the regret bound below mainly depends on
the weighted second moment of the stationary measure of the reference policy π0, which is bounded
independently of the size of the state space.
We consider the policy πmax such that πmax(s) = Amax for all s and mmax its stationary measure.
Let us also recall that mπ0
for all s and that ∆ :
E2 := F E
−
*
is closely related to the second moment of the measure mπ0
(cid:2)
maximal reward.
is the stationary measure of the Markov chain under policy π0(s) = 0
R+ is a function bounding the local variations of the optimal bias. Let
max
1)
1. Here, E2
(∆(s+1)+rmax)2 and F :=
}
∈S
weighted by the bias variations and the
S →
(∆ + rmax)2
with f : s
f (s)−
mπ0
1,s(s
P
7→
f
(cid:3)
{
s
Theorem 4.1. Let M
. Define Qmax :=
∈ M
10D
mmax(S
1)
−
(cid:16)
2
log
(cid:17)
(cid:18)(cid:16)
10D
mmax(S
1)
−
4
.
(cid:19)
(cid:17)
E [Reg(M, UCRL2, T )]
≤
19
E2AT log (2AT )
p
+ 97rmaxD2SA max
{
Qmax, T 1/4
}
log2(2AT ).
(11)
Here, E2 ≤
60e2λ/μ r2
max
1 + λ2
μ2
, so that the regret satisfies
(cid:16)
E [Reg(M, UCRL2, T )] =
(cid:17)
rmaxeλ/μ
O
AT
s
1 +
(cid:18)
λ2
μ2
(cid:19)
log (AT )
!
.
Before giving a sketch of the proof, let us comment on the bound (11). Although the first term is of
order √T with a multiplicative constant independent of S - as desired - the second term, of order
T 1/4, contains very large terms. However, its interest lies in the novel approach used in the proof
that uses the stationary behavior of the algorithm.
4.2 Comparison with Other Bounds
Let us compare our upper bound with the ones existing in the literature, as we claim that ours is of
a different nature.
First, let us compare with the bound given in [11], which states that with probability 1
δ,
T
δ
≤
q
34DS
AT log
for any T > 1. For any M
, the diameter grows as
Reg(M, T )
SS (see Appendix B.3), thus this bound is very loose here. More recent works have improved this
bound by replacing the term D by the local diameter of the MDP [5]. In Appendix B.3, we show
that the local diameter grows again as SS for any M
, and thus these results do not yield
significant improvements. Other papers show that the diameter can be replaced by the span of the
bias, see [7, 26]. This has a big impact because the span of the bias, for any M
, is linear in S
(instead of SS for the diameter); see Appendix B.3. However, this is still not as good as the bound
given in Theorem 4.1, which is independent of S.
∈ M
∈ M
∈ M
(cid:0)
(cid:1)
−
*|
Now, let us compare with existing bounds for parametric MDPs, as mentioned in the introduction.
The d-linear additive model, d < S, introduced in [12] assumes that P (
,
)
i
where φ(s, a) is a known feature mapping and θ is an unknown measure on Rd. This form
s, a) implies that the transition kernel is of rank d. Unfortunately, this property does
of P (
not hold true in birth and death processes.
has almost
full rank under all policies. The linear mixture model introduced in [27] assumes instead that
Rd. This is more adapted to our case, which can be (almost)
P (s′
seen as a linear mixture model of dimension d = 3. The bound on the discounted regret of the algo-
γ)2 where γ is a discount factor. In contrast to
rithm proposed in [27] is Reg(M, T )
−
our work, this regret analysis holds for discounted problems, where we remark that both the diame-
2,
ter and the span are irrelevant. On the other hand, both are replaced by a term of the form (1
In fact, the kernel of any M
φ(s, a), θ(
*
h
d√T /(1
φ(s′
h
s, a) =
s, a) =
s, a), θ
, θ
i
∈ M
≤
∈
*|
|
|
γ)−
−
7
1. More recently, a regret bound of
which implies that the previous bound grows to infinity as γ
O(d√DT ) has been proven in [24] in the undiscounted case, that is the case considered in our work.
However, the algorithm presented in that reference highly depends on the diameter and is unsuitable
for MDPs with a birth and death structure.
↑
Finally, our bound depends on the second moment of the stationary measure of a reference policy,
i.e., E2, which can be bounded independently of the state space size. This is structurally different
from the ones existing in the literature. We believe that this structure holds as well in a class of
. In particular, if m is the stationary measure of some bounding/reference
MDPs much larger than
policy, and if the critical quantity Em [∆
f ] is small for a well chosen function f , then the regret
of a learning algorithm navigating the MDP should also be small. A deeper analysis is left as future
work.
M
*
4.3 Sketch of the Proof
P
E [Rin] + E [Rout] ,
∈Mk .
M /
Our proof for Theorem 4.1 is technical and is provided in the supplementary material. In this section,
we present the main ideas and its general structure. It initially relies on the regret analysis of UCRL2
developed in [11], and the differences are highlighted below. First, we consider the mean rewards
and split the regret into episodes to separately treat the cases where the true MDP is in the confidence
set of optimistic MDPs
r(s, a)) denote the regret
in episode k. This split can be written:
s,a νk(s, a)(ρ∗
−
Mk or not. Thus, let Rk :=
E [Reg(M, T )]
k Rk1M
∈Mk and Rout :=
≤
k Rk1
where Rin :=
To control Rout, we use, as in [11], the stopping criterion and the confidence bounds. This gives
E [Rout]
rmaxS, so that the regret due to episodes where the confidence regions fail will be
negligible next to the main terms. Then, when the true MDP belongs to the confidence region, we
use the properties of Extended Value Iteration (EVI) to decompose Rin into
P
P
≤
νk(s, a)( ̃rk −
r(s, a))
+
Xk,s,a
Rrewards
vk
̃Pk −
(cid:16)
Rbias
Xk
I
̃hk
+
vk
(cid:17)
Xk
(cid:16)
̃Pk −
I
dk + 2rmax
(cid:17)
REVI
νk(s, a)
√tk
,
Xk,s,a
where vk is the vector of the state-action counts νk's, ̃Pk and ̃hk are respectively the transition
}
}
|
matrix and the bias in ̃Mk under policy ̃πk, and dk is the profile difference between the last step of
EVI and the bias (see Appendix A.3).
{z
{z
{z
}
|
|
We now show how to handle Rrewards, REVI, Rbias. First, we deal with the terms that do not involve
the bias. Using the confidence bound on the rewards (see Appendix A.3.1:
νk(s, a)
Rrewards ≤
rmax2
2 log(2AT )
p
s,a
Xk X
max
1, Ntk(s, a)
}
{
.
(12)
Now, let us consider REVI. Since dk becomes arbitrarily small after enough iterations of EVI (see
Appendix A.1), for T
p
e8
2AT , we get
rmax2
2 log(2AT )
p
s,a
Xk X
νk(s, a)
max
1, Ntk (s, a)
}
{
.
(13)
The analysis of Rbias is different from the one in [11]: While in [11] the bias is directly bounded by
the diameter, we can use the variations of the bias to control the regret more precisely. Using Pk
and hk, i.e., the transitions and the bias in the true MDP under ̃πk, Rbias is further decomposed into:
Pk
I) ̃hk
Pk
hk
hk
vk
vk
p
+
+
.
̃Pk −
(cid:16)
̃hk −
(cid:17) (cid:16)
vk (Pk −
(cid:17)
Xk
Xk
(cid:16)
(cid:17)
Xk
̃Pk −
Rtrans
Rdiff
The term Rep can be treated in a similar manner as in [11] by bounding the bias terms with the
{z
}
diameter to apply an Azuma-Hoeffding inequality (see Appendix A.3.5). Here, we obtain
Rep
{z
{z
|
|
}
}
|
E [Rep]
≤
SAD rmax log2
8T
SA
.
(cid:19)
(cid:18)
8
≥
REVI ≤
||
+
̃Pk −
Pk||∞
Next, we show in A.3.2 that Rdiff does not contribute to the main term of the regret. This is one
of the hard point in our proof. First, linear algebra techniques are used to bound
by
rk||∞
). Each norm is then bounded using Hoeffding inequality.
D(2rmaxD
This introduces the special quantity Ntk (xk, πk(xk)) that yields to the worst confidence bound in
episode k. Then, an adaptation of McDiarmid's inequality to Markov chains is used to show that
tk)mmax(S
1)/2 with high probability, where mmax(S
1) is the
Ntk (xk, πk(xk))
(tk+1 −
1 under the uniform policy πmax(s) = Amax. This eventually implies
stationary measure of state S
−
that
E [Rdiff ]
96rmaxD2SA max
Qmax, T 1/4
log2(2AT ),
̃rk −
||
hk||∞
̃hk −
−
−
≥
||
≤
2
}
{
4
.
(cid:19)
where Qmax :=
10D
mmax(S
1)
−
log
10D
mmax(S
1)
−
(cid:18)(cid:16)
(cid:16)
(cid:17)
(cid:17)
Then, to deal with the main term Rtrans, we exploit the optimal bias. The unit vector being in the
kernel of ̃Pk −
Rtrans =
Pk, we can rewrite:
νk (s, ̃πk(s))
s, ̃πk(s)))
s, ̃πk(s))
(h∗(s′)
( ̃pk (s′
h∗(s))
p (s′
*
|
−
|
*
−
s
Xk X
Xs′
and, thus, using the confidence bound and the bounded variations of the bias,
Rtrans ≤
4
2 log (2AT )
p
s,a
Xk X
∆(s + 1)νk(s, a)
1, Ntk(s, a)
max
}
{
.
p
We can now aggregate Rtrans, Rrewards and REVI to compute the main term of the regret (see
Appendix A.3.4). Here, the key ingredient is to bound
(∆(s + 1) + rmax)νk(s, a)
max
{
independently of S. This is the second main difference with [11]. Instead of exploring the MDP
uniformly, we know that the algorithm will mostly visit the first states of the MDP, regardless of the
chosen policy. As shown in [11], for a fixed state s:
1, Ntk (s, a)
}
Xk,s,a
p
E
"
a
X
Xk
νk(s, a)
max
{
1, Ntk(s, a)
}
# ≤
p
3
E [NT (s)] A.
p
Now, instead of summing over the states, we can use properties of stochastic ordering to compare
the mean number of visits of a state with the probability measure mπ0
; here, we strongly rely on
the birth and death structure of the MDPs in
. For any non-negative non-decreasing function
f :
R+, we obtain
M
S →
Let us choose f : s
E2 := F E
7→
(∆ + rmax)2
mπ0
E
f (s)Nt(s)
≤
0
Xs
≥
1,s(s
{
0
Xs
≥
max
(∆(s+1)+rmax)2 and let F :=
}
1)
−
f
. Then,
*
P
t
f (s)mπ0
(s).
(14)
s f (s)−
1
≤
60e2λ/μr2
max. Define also
(cid:2)
E
(cid:3)
(∆(s) + rmax)νk(s, a)
"
s,a
Xk X
max
1, Ntk(s, a)
}
{
# ≤
In Appendix A.3.4, we further show that E2 ≤
main terms, we obtain
60e2λ/μr2
max
p
3
E2AT .
p
1 + λ2
μ2
(cid:16)
. Therefore, for the three
(cid:17)
E [Rtrans + Rrewards + REVI]
19
E2AT log (2AT )
≤
(15)
p
and we conclude our proof by combining all of these terms.
9
5 Conclusions
For learning in a class of birth and death processes, we have shown that exploiting the stationary
measure in the analysis of classical learning algorithms yields a K√T regret, where K only depends
on the stationary measure of the system under a well chosen policy. Thus, the dependence on the
size of the state space as well as on the diameter of the MDP or its span disappears. We believe that
this type of results can be generalized to other cases such as optimal routing, admission control and
allocation problems in queuing systems, as the stationary distribution under all policies is uneven
between the states.
References
[1] Jonatha Anselmi, Bruno Gaujal, and Louis Sébastien Rebuffi. Optimal Speed Profile of a
DVFS Processor under Soft Deadlines. Performance Evaluation, 152, December 2021.
[2] Peter Auer and Ronald Ortner. Logarithmic online regret bounds for undiscounted reinforce-
ment learning. In B. Schölkopf, J. Platt, and T. Hoffman, editors, Advances in Neural Informa-
tion Processing Systems, volume 19. MIT Press, 2006.
[3] Mohammad Gheshlaghi Azar, Ian Osband, and Rémi Munos. Minimax regret bounds for
reinforcement learning. In International Conference on Machine Learning, pages 263–272.
PMLR, 2017.
[4] Mohammad Gheshlaghi Azar, Ian Osband, and Rémi Munos. Minimax regret bounds for
reinforcement learning. In International Conference on Machine Learning, pages 263–272,
2017.
[5] Hippolyte Bourel, Odalric-Ambrym Maillard, and Mohammad Sadegh Talebi. Tightening ex-
ploration in upper confidence reinforcement learning. In Proceedings of the 37th International
Conference on Machine Learning, ICML'20. JMLR.org, 2020.
[6] Craig Boutilier, Richard Dearden, and Moisés Goldszmidt. Stochastic dynamic programming
with factored representations. Artif. Intell., 121(1–2):49–107, aug 2000.
[7] Ronan Fruit, Matteo Pirotta, Alessandro Lazaric, and Ronald Ortner. Efficient bias-span-
constrained exploration-exploitation in reinforcement learning. 02 2018.
[8] Nicolas Gast, Bruno Gaujal, and Kimang Khun. Reinforcement learning for Markovian ban-
dits: Is posterior sampling more scalable than optimism? Technical Report hal-03262006,
HAL-Inria, June 2021.
[9] Carlos Guestrin, Daphne Koller, Ronald Parr, and Shobha Venkataraman. Efficient solution
algorithms for factored MDPs. Journal of Artificial Intelligence Research, 19(1):399–468,
October 2003.
[10] Ilse C. F. Ipsen and Carl Dean Meyer. Uniform stability of markov chains. SIAM Journal on
Matrix Analysis and Applications, 15:1061–1074, 1994.
[11] T. Jaksch, R. Ortner, and P. Auer. Near-optimal regret bounds for reinforcement learning.
Journal of Machine Learning Research, 11(4):1563–1600, 2010.
[12] Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement
learning with linear function approximation. In Jacob Abernethy and Shivani Agarwal, editors,
Proceedings of Thirty Third Conference on Learning Theory, volume 125 of Proceedings of
Machine Learning Research, pages 2137–2143. PMLR, 09–12 Jul 2020.
[13] David A. Levin, Yuval Peres, and Elizabeth L. Wilmer. Markov chains and mixing times.
American Mathematical Society, 2008.
[14] Quan-Lin Li, Jing-Yu Ma, Rui-Na Fan, and Li Xia. An Overview for Markov Decision Pro-
cesses in Queues and Networks, pages 44–71. Springer Singapore, Singapore, 2019.
10
[15] Ian Osband and Benjamin Van Roy. Near-optimal reinforcement learning in factored MDPs.
In Proc. of the 27th Int. Conf. on Neural Information Processing Systems - Volume 1, NIPS'14,
pages 604–612, Montreal, Canada, December 2014. MIT Press.
[16] Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via random-
ized value functions. In Proceedings of the 33rd International Conference on International
Conference on Machine Learning - Volume 48, ICML'16, page 2377–2386. JMLR.org, 2016.
[17] Martin L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming.
Wiley Series in Probability and Statistics. Wiley, 1 edition, April 1994.
[18] Aviv Rosenberg and Yishay Mansour. Oracle-Efficient Reinforcement Learning in Factored
MDPs with Unknown Structure. arXiv:2009.05986 [cs, stat], September 2020.
[19] Moshe Shaked and J George Shanthikumar. Stochastic orders and their applications. Aca-
demic Pr, 1994.
[20] R. S. Sutton and A. G. Barto. Reinforcement Learning: An Introduction. MIT Press, Cam-
bridge, MA, 1998.
[21] Yi Tian, Jian Qian, and Suvrit Sra. Towards minimax optimal reinforcement learning in fac-
tored markov decision processes. In Proceedings of the 34th International Conference on Neu-
ral Information Processing Systems, NIPS'20, Red Hook, NY, USA, 2020. Curran Associates
Inc.
[22] Aristide Tossou, Debabrota Basu, and Christos Dimitrakakis. Near-optimal optimistic rein-
forcement learning using empirical bernstein inequalities, 2019.
[23] Neil Walton and Kuang Xu. Learning and information in stochastic networks and queues,
2021.
[24] Yue Wu, Dongruo Zhou, and Quanquan Gu. Nearly minimax optimal regret for learning
infinite-horizon average-reward mdps with linear function approximation. In Gustau Camps-
Valls, Francisco J. R. Ruiz, and Isabel Valera, editors, Proceedings of The 25th International
Conference on Artificial Intelligence and Statistics, volume 151 of Proceedings of Machine
Learning Research, pages 3883–3913. PMLR, 28–30 Mar 2022.
[25] Ziping Xu and Ambuj Tewari. Reinforcement learning in factored mdps: Oracle-efficient
algorithms and tighter regret bounds for the non-episodic setting.
In Hugo Larochelle,
Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Ad-
vances in Neural Information Processing Systems 33: Annual Conference on Neural Informa-
tion Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
[26] Zihan Zhang and Xiangyang Ji. Regret minimization for reinforcement learning by evaluating
the optimal bias function, 2019.
[27] Dongruo Zhou, Jiafan He, and Quanquan Gu. Provably efficient reinforcement learning for
discounted mdps with feature mapping. In Marina Meila and Tong Zhang, editors, Proceedings
of the 38th International Conference on Machine Learning, volume 139 of Proceedings of
Machine Learning Research, pages 12793–12802. PMLR, 18–24 Jul 2021.
11
The appendix is organized as follows: We first provide some insights on extended value iterations
useful in our construction of the regret.Then, the detailed proof of theorem 4.1 is given with bounds
on the five terms in our decomposition of the regret. A final appendix provides technical lemmas
about MDPs in
.
M
A Proof of Theorem 4.1
A.1 Extended value iteration
For each episode k, we use the extended value iteration algorithm described in [11] to compute
̃πk and ̃M
∈ Mk, an optimistic policy and MDP. The values we iteratively get are defined in the
following way:
u(k)
0 (s) = 0
u(k)
i+1(s) = max
a
∈A (
̃r(s, a) + max
p(
)
*
∈P
(s,a) (
p(s′)u(k)
i
(s′)
))
,
S
Xs
∈
(16)
where ̃r is the maximal reward from (4) and
(s, a) is the set of probabilities from (5).
Now, from [11, Theorem 7], we obtain the following lemma on the iterations of extended value
iteration.
Lemma A.1. For episode k, denote by i the last step of extended value iteration, stopped when:
max
s {
u(k)
i+1(s)
u(k)
i
(s)
} −
min
s {
u(k)
i+1(s)
u(k)
i
<
(s)
}
−
−
rmax
√tk
.
(17)
The optimistic MDP ̃Mk and the optimistic policy ̃πk that we choose are so that the gain is rmax
close to the optimal gain:
√tk −
P
̃ρk := min
s
ρ( ̃Mk, ̃πk, s)
≥
M ′
max
∈Mk,π,s′ ρ(M ′, π, s′)
−
rmax
√tk
.
Moreover from [17, Theorem 8.5.6]:
and when the optimal policy yields an irreducible and aperiodic Markov chain, we have that ̃ρk =
ρ( ̃Mk, ̃πk, s) for any s, so that we can define the bias:
u(k)
i+1(s)
u(k)
i
(s)
̃ρk
−
−
rmax
√tk
,
≤
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
̃hk(s0) = Es0
∞
( ̃r(st, at)
.
̃ρk)
#
−
"
t=0
X
By choosing iteration i large enough, from [17, Equation 8.2.5], we can also ensure that:
u(k)
i
(s)
(i
1) ̃ρk −
−
−
<
rmax
2√tk
,
̃hk(s)
(cid:12)
(cid:12)
(cid:12)
so that we can define the following difference
dk(s) :=
(s)
min
s
−
u(k)
i
(s)
̃hk(s)
min
s
−
−
(cid:16)
rmax
√tk
.
̃hk(s)
<
(cid:17)(cid:12)
(cid:12)
(cid:12)
A.2 Regret when M is out of the confidence bound
(cid:12)
(cid:12)
(cid:12)
u(k)
i
(cid:12)
(cid:12)
(cid:12)
Let us compute E[Reg], the expected regret. We will mainly follow the approach in [11, Section 4],
with a few tweaks. We start by splitting the regret into a sum over episodes and states.
We remind that r(s, a) is the overall mean reward and NT (s, a) the total count of visits. We also
define Rk(s) :=
r(s, a)) the regret at episode k induced by state s, with νk(s, a)
the number of visit of (s, a) during episode k.
a νk(s, a)(ρ∗
−
P
12
(18)
(19)
(20)
(21)
(22)
Let Rin :=
the split:
m
k=1 Rk(s)1M
s
P
P
∈Mk and Rout :=
E [Reg]
E [Rin] + E [Rout] .
P
P
m
k=1 Rk(s)1
s
M /
Now, let νk(s) =
M
For the terms out of the confidence sets, we have:
≤
a νk(s, a) and denote by
(t) the set of MDPs
∈Mk . We therefore have
(23)
t < tk+1.
Mk such that tk ≤
P
Rout ≤
rmax
rmax
≤
= rmax
= rmax
m
s
X
Xk=1
m
νk(s)1
M /
∈Mk
Ntk (s)1
M /
∈Mk using the stopping criterion
s
X
T
Xk=1
m
t=1
X
T
s
X
Xk=1
1tk=tNt(s)1
M /
∈M
(t) ≤
rmax
T
t=1
X
s
X
Nt(s)1
M /
∈M
(t)
1
M /
∈M
(t)
s
X
Nt(s)
rmax
≤
T
t=1
X
t1
(t).
M /
∈M
Taking the expectations:
t=1
X
E [Rout]
rmax
T
t=1
X
T
rmax
t=1
X
rmaxS.
≤
≤
≤
tP
M /
{
∈ M
(t)
}
tS
2t3 ≤
rmax
S
2t2
T
t=1
X
by Lemma B.1
(24)
Thus, we have dealt with the cases where the MDP M did not belong to any confidence set, for some
episodes. We now need to deal with the rest.
A.3 Regret terms when M is in the confidence bound
∈ Mk and deal with the terms in the confidence bound, so that we can omit
We now assume that M
the repetitions of the indicator functions. For each episode k, let Rin,k :=
We defined ̃πk the optimistic policy computed at episode k, now define ̃Pk := ( ̃pk(s′
s, ̃πk(s))) the
transition matrix of that policy on the optimistic MDP ̃Mk. Define also vk := (νk(s, ̃πk) the row
vector of visit counts during episode k. Following the same steps as in [11], we get the inequality
on the regret of episode k, assuming M
s Rk.
P
|
∈ Mk, using Lemma A.1:
Rin,k =
νk(s, a)(ρ∗
r(s, a))
−
s,a
X
s,a
X
s,a
X
≤
=
νk(s, a)( ̃ρk −
r(s, a)) + rmax
νk(s, a)( ̃ρk −
̃rk(s, a)) +
s,a
X
νk(s, a)
√tk
s,a
X
νk(s, a)( ̃rk −
r(s, a)) + rmax
νk(s, a)
√tk
.
s,a
X
Then with (19) and using the definition of the iterated values from EVI, we have for a given state s
and as := ̃πk(s):
so that:
( ̃ρk −
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
Rin,k ≤
̃rk(s, as))
−
Xs′
̃pk(s′
|
s, as)u(k)
i
(s′)
u(k)
i
−
(s)
!(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
vk
̃Pk −
(cid:16)
I
ui +
(cid:17)
s,a
X
νk(s, a)( ̃rk −
r(s, a)) + 2rmax
13
rmax
√tk
,
≤
νk(s, a)
√tk
.
s,a
X
Remember that for any state s:
for the optimist MDP, and:
|
dk(s)
| ≤
rmax
√tk
, where ̃hk is the bias of the average optimal policy
dk(s) :=
u(k)
i
(s)
min
x
−
(cid:16)
u(k)
i
(x)
̃hk(s)
min
x
−
.
̃hk(x)
(cid:17)
−
(cid:16)
. Therefore, in the first term, we can replace
(cid:17)
I
Notice that the unit vector is in the kernel of
ui by any translation of it. We get:
I
ui = vk
vk
̃Pk −
(cid:16)
(cid:17)
so that:
Rin ≤
s,a
Xk X
|
Rrewards
{z
νk(s, a)( ̃rk −
r(s, a))
+
̃Pk −
(cid:16)
̃Pk −
(cid:16)
(cid:17)
(cid:17)
̃hk + vk
I
vk
̃Pk −
(cid:16)
Rbias
I
̃hk
(cid:17)
Xk
̃Pk −
(cid:16)
I
dk.
(cid:17)
}
|
+
{z
vk
Xk
}
̃Pk −
(cid:16)
I
dk + 2rmax
(cid:17)
REVI
s,a
Xk X
νk(s, a)
√tk
.
Then, using the assumption on empirical rewards (4), as M
|
∈ Mk, and noticing that Ntk ≤
{z
tk:
}
Rrewards ≤
rmax2
2 log(2AT )
p
s,a
Xk X
νk(s, a)
max
1, Ntk(s, a)
}
{
.
(25)
For the term vk
vk
̃Pk −
(cid:16)
̃Pk −
I
I
dk, which does not appear in the analysis of [11], we obtain
(cid:17)
dk ≤
νk (s, ̃πk(s))
s, ̃πk(s))
dk(s′)
|
̃pk (
sup
s′
* k
−
*|
|
p
(cid:16)
(cid:17)
1sk1 *
νk (s, a)
√tk
s
X
2rmax
≤
≤
2rmax
s
X
s,a
X
νk (s, ̃πk(s))
√tk
≤
2rmax
νk(s, a)
max
1, Ntk(s, a)
}
{
,
s,a
X
p
tk ≤
νk(s, a)
where in the last inequality we used that max
regret term coming from the consequences and approximations of EVI satisfies
1, Ntk(s, a)
} ≤
{
T . Thus, for T
e2
2AT the
≥
REVI ≤
rmax2
2 log(2AT )
p
s,a
Xk X
max
1, Ntk (s, a)
}
{
.
(26)
Now, by defining Pk and hk the transition matrix and the bias of the optimistic policy ̃πk in the true
MDP M , we have the following decomposition of the middle term:
p
vk
Xk
(cid:16)
Overall:
|
̃Pk −
Rtrans
{z
Pk
hk
+
(cid:17)
Xk
Pk
vk
̃Pk −
(cid:16)
(cid:17) (cid:16)
̃hk −
hk
+
(cid:17)
Xk
vk (Pk −
I) ̃hk
.
}
|
Rdiff
{z
}
|
Rep
{z
}
Rin ≤
vk
Xk
(cid:16)
|
̃Pk −
Rtrans
{z
Pk
hk
+
(cid:17)
Xk
Pk
vk
̃Pk −
(cid:16)
Rdiff
̃hk −
(cid:17) (cid:16)
hk
+
(cid:17)
Xk
vk (Pk −
I) ̃hk
Rep
}
|
+ rmax4
{z
2 log(2AT )
}
|
{z
max
νk(s, a)
}
1, Ntk(s, a)
}
{
.
s,a
Xk X
p
REVI+Rrewards
{z
}
p
|
14
A.3.1 Bound on Rtrans
Let us deal with the first term Rtrans. To bound this term, we will use our knowledge of the bias in
the true MDP hk and on the control of the difference of the transition matrices, and for the second
term we will control the difference of the biases.
Notice that for a fixed state 0
s
S
−
≤
s, ̃πk(s)) hk(s′) =
≤
p (s′
|
Xs′
1:
Xs′
p (s′
|
s, ̃πk(s)) (hk(s′)
−
hk(s)) + hk(s).
The same is true for ̃pk, and knowing the MDP is a birth and death process:
Rtrans =
νk (s, ̃πk(s))
s
Xk X
Xs′
νk (s, ̃πk(s))
s
Xk X
Xs′
νk (s, ̃πk(s))
s
Xk X
4
2 log (2AT )
p
s,a
Xk X
=
≤
≤
( ̃pk (s′
( ̃pk (s′
|
|
*
*
s, ̃πk(s))
s, ̃πk(s))
p (s′
p (s′
|
|
−
−
s, ̃πk(s)))
s, ̃πk(s)))
*
*
hk(s′)
(hk(s′)
hk(s))
−
̃pk (
*|
* k
s, ̃πk(s))
p (
*|
−
s, ̃πk(s))
k1 sup
s′
∂hk(s)
∆(s + 1)νk(s, a)
1, Ntk (s, a)
max
}
{
,
where in the last inequality, we used the knowledge on the bounded variations of the bias from
Lemma 3.2, and that the optimistic MDP has transitions close to the true transitions.
p
A.3.2 Bound on Rdiff
We now deal with the term involving the difference of bias, Rdiff. For each episode k with policy πk,
denote by xk the state such that the confidence bounds are at their worst and denote by ak := πk(xk)
the corresponding action used at this state, so that Ntk (xk, ak) is minimal. We therefore have that
is maximal for episode k. The true MDP being within the confidence bounds,
max
log(2Atk)
1,Ntk (xk,ak)
with a triangle inequality:
q
}
{
̃Pk −
k
Pkk∞ ≤
4
s
and
2 log (2Atk)
1, Ntk(xk, ak)
}
{
max
,
̃rk −
k
rkk∞ ≤
2rmax
2 log (2Atk)
1, Ntk(xk, ak)
}
max
{
.
s
Then using Lemma C.6, and noticing that the bias ̃hk and the quantity
the same diameter D, using the same argument as in [11] (Equation (11)):
P
k
T
t=1
̃P t
k ̃rkk
is bounded by
̃hk −
k
hkk∞ ≤
12ThitrmaxD
s
2 log (2Atk)
1, Ntk(xk, ak)
}
{
max
.
(27)
Hence,
Rdiff ≤
s
X
νk (s, ̃πk(s))
( ̃pk (s′
|
*
s, ̃πk(s))
p (s′
|
−
s, ̃πk(s)))
*
( ̃hk(s′)
hk(s′))
−
̃pk (
s, ̃πk(s))
p (
*|
−
s, ̃πk(s))
̃hk −
hkk∞
k1 k
Xs′
νk (s, ̃πk(s))
*|
s
X
48D2rmax log (2AT ) Σ,
* k
≤
≤
where in the last inequality we have used (27) and that by definition of D, for S large enough
Thit := inf
∈S
s′
sup
s
∈S
Es τ πk
s′
ES
1 τ π0
0 ≤
−
≤
D,
15
and we called
Σ :=
tk+1−
1
1
{
1, Ntk(s, a)
}
st,at=s,a
}
max
{
.
1, Ntk(xk, ak)
}
max
{
s,a
X
Xk
t=tk
X
p
Ntk (s, a) for any state-action pair (s, a), so that we can rewrite,
p
By the choice of xk, Ntk (xk, ak)
with Ik := tk+1 −
≤
tk the length of episode k:
tk+1−
1
1
Σ
≤
s,a
X
Xk
t=tk
X
max
{
st,at=s,a
}
{
1, Ntk(xk, ak)
}
≤
4
Ik
max
1, Ntk(xk, ak)
}
{
Xk
.
, and I(T ) := max
Qmax, T 1/4
. We
Now define Qmax :=
10D
mmax(S
2
log
1)
10D
mmax(S
−
(cid:17)
(cid:18)(cid:16)
1)
−
(cid:19)
(cid:17)
split the sum depending on whether the episodes are shorter than I(T ) or not, and call K
number of such episodes. This yields:
(cid:8)
(cid:16)
Σ
K
≤
≤
II(T ) +
Ik
Xk,Ik >I(T )
max
1, Ntk(xk, ak)
}
{
.
Using the stopping criterion for episodes:
Σ
K
≤
≤
II(T ) +
Ik
Xk,Ik>I(T )
max
1, νk(xk, ak)
}
{
.
the event:
=
k s.t Ik > I(T ),
∀
(cid:26)
1
max
1, ν(xk, ak)
}
{
≤
2
mmax(S
.
1)Ik (cid:27)
−
Now denote by
E
E
By splitting the sum, using the above event, we get:
Σ
K
≤
≤
I I(T ) + 1
I I(T ) + 1
K
≤
≤
E
E
Xk,Ik>I(T )
K
(KT −
2
mmax(S
−
2
mmax(S
I )
≤
+ 1 ̄
E
1)
Ik
Xk,Ik>I(T )
+ 1 ̄
T.
E
1)
−
E [Σ]
≤
̄
E
(cid:0)
E [K
1
4T , so that when taking the expectation:
≤
(cid:1)
I ] I(T ) + E [(KT −
≤
4, I(T )
2
mmax(S
≥
K
≤
I)]
2
mmax(S
+
1)
1
4
.
1) and that
−
log 2 + 1
1
2:
4 ≤
E [Σ]
≤
E [KT ] I(T ) +
2SA log(2AT )I(T ).
−
1
4 ≤
We use Corollary C.8 to get P
Now using Lemma B.3, SA
≥
We therefore have that:
E [Rdiff]
≤
96rmaxSAD2I(T ) log2 (2AT ) .
A.3.3 Bound on the main terms: Exploiting the stochastic ordering
In Section 4.3 we have shown that:
Rtrans ≤
4
2 log (2AT )
p
s,a
X
∆(s + 1)νk(s, a)
1, Ntk(s, a)
max
}
{
.
To control this term as well as REVI (26) and Rrewards (25), we need to control the terms in the
sum in a way that does not make the parameters D or S appear, as this will be one of the main
p
16
I the
(cid:9)
≤
(28)
(29)
contributing terms. To do so, we need to sum over the episodes and take the expectation, so that
with Lemma B.4, we get:
E
"
s,a
X
Xk
νk(s, a)
max
{
1, Ntk(s, a)
}
# ≤
3E
p
3
≤
"
s,a
X
s
X
p
NT (s, a)
#
p
E [NT (s)] A by Jensen's inequality.
We will use the following lemma to carry on the computations:
Lemma A.2. Let mπ0 be the stationary measure of the Markov chain under policy π0, such that for
R+ be a non-negative non-decreasing function on the state
every state s: π0(s) = 0. Let f :
,
space. Then for any state s
S →
∈ S
E
s
Xs′
≥
f (s′)Nt(s′)
t
≤
f (s′)mπ0
(s′).
(30)
s
Xs′
≥
. For any state s′, define N mπ0
,π0
Proof. Let s
follows the initial distribution mπ0
instead of the policy determined by the algorithm UCRL2. Notice already that for any state s′:
(s′) the number of visits when the starting state
, and the MDP always executes the policy π0 at every timestep
∈ S
t
On the other hand, for x
∈ S
E
N mπ0
t
,π0
(s′)
= tmπ0
(s′)
(cid:20)
(cid:21)
, we have the stochastic ordering:
Nt(s′)
≤st
x
Xs′
≥
N mπ0
t
,π0
(s′),
x
Xs′
≥
so that for any non-negative non-decreasing function f , with the convention f (
−
x N mπ0
,π0
(f (x)
f (x
1))
1))
s′
t
≤st (f (x)
1)
s′
−
≥
and then summing the equation above for s
x Nt(s′)
≤st f (s
s′
s Nt(s′)
P
f (x
−
s N mπ0
S
−
1)
f (s
−
−
s′
≥
≥
t
x
P
P
(s′),
P
−
,π0
≥
1 and switching the sums yields:
1) = 0:
(s′)
(31)
′
s
Nt(s′)
[f (x)
x=s
X
s
Xs′
≥
which simplifies to:
≤
≤
−
N mπ0
t
f (x
1)]
−
≤st
−
s
Xs′
≥
′
s
,π0
(s′)
[f (x)
x=s
X
f (x
1)],
−
−
Nt(s′)[f (s′)
f (s
1)]
−
≤st
−
s
Xs′
≥
N mπ0
t
,π0
(s′)[f (s′)
f (s
1)].
−
−
s
Xs′
≥
Now summing with the second equation in (31), we get the following equation:
Nt(s′)f (s′)
≤st
s
Xs′
≥
N mπ0
t
,π0
(s′)f (s′).
s
Xs′
≥
Taking the expectation in this last inequality finishes the proof.
Now, we can conclude our bound on Rtrans. Since
E
"
s,a
X
Xk
(∆(s + 1) + rmax)
νk(s, a)
max
1, Ntk(s, a)
}
{
# ≤
p
3√A
(∆(s + 1) + rmax)
E [NT (s)],
0
Xs
≥
p
(32)
17
let f be a non-negative non-decreasing function over the state space, such that F :=
exists. Then by concavity:
0 f (s)−
1
s
≥
P
(∆(s + 1) + rmax)
E [NT (s)] = F
0
Xs
≥
p
1
F f (s)
0
Xs
≥
f (s)2(∆(s + 1) + rmax)2E [NT (s)]
p
f (s)2(∆(s + 1) + rmax)2E [NT (s)]
F f (s)
by concavity
f (s)(∆(s + 1) + rmax)2E [NT (s)]
F
0
Xs
≥
v
u
u
t
F
s
0
Xs
≥
T F
f (s)(∆(s + 1) + rmax)2mπ0(s) using Lemma A.2,
s
0
Xs
≥
≤
=
≤
so that overall, (32) becomes:
E
"
s,a
X
Xk
(∆(s + 1) + rmax)νk(s, a)
max
1, Ntk(s, a)
}
{
# ≤
p
3√AT F
f (s)(∆(s + 1) + rmax)2mπ0(s).
sXs
≥
0
(33)
This is the term mainly contributing to the regret.
A.3.4 Bound on the main terms: Introducing E2
Now, using Lemma B.5 which gives the stationary distribution of m0, we can compute the expecta-
tion under mπ0
of a well-chosen function f :
Lemma A.3. Choose the increasing function f : s
0(∆(s + 1) + rmax)2f (s)mπ0
(s) = E
and
mπ0
s
≥
P
E2 := F E
mπ0
(∆ + rmax)2
Proof. For F , we obtain:
(cid:2)
(cid:2)
≤
f
*
(cid:3)
{
−
1,s(s
7→
(∆ + rmax)2
max
1)
(∆(s+1)+rmax)2 . Then F
}
1 + λ2
f
μ2
(cid:16)
λ2
μ2
(cid:3)
1 +
60e2λ/μ r2
max
≤
*
.
(cid:18)
(cid:19)
(cid:17)
≤
60e2λ/μ r2
max
, so that:
(2eλ/μrmax)23
F
≤
S
1
−
s=0
X
S
12e2λ/μ r2
max
4 +
≤
2
−
s=2
X
1 + log(s + 1)
1)
1, s(s
max
{
−
} ! ≤
12e2λ/μ r2
max
3 +
S
1
−
s=2
X
1 + log(s + 1)
s(s
−
1) !
log(1 + 1/s)
s
! ≤
60e2λ/μ r2
max.
Using the following computations:
S
1
−
s=2
X
s(s
−
S
1)
(cid:18)
1
−
s
(S
(cid:19) (cid:18)
λ
−
s
1)μ
(cid:19)
= (S
2)(S
1)
−
−
= (S
2)(S
1)
−
−
= (S
2)(S
1)
−
−
λ
μ
≤
(cid:18)
2
1 +
(cid:19)
(cid:18)
18
S
s
3
2
−
−
s
1)μ
(cid:19)
λ
−
3
−
S
(S
(cid:19) (cid:18)
2 S
1)μ
(cid:19)
2
s=0 (cid:18)
X
1 +
(cid:18)
(S
1)μ
S
−
(cid:19)
3
,
S
s=2 (cid:18)
X
λ
−
λ
−
(S
(cid:18)
(S
(cid:18)
λ
(S
1)μ
(cid:19)
−
λ
s
1)μ
(cid:19)
3
−
s
(cid:19) (cid:18)
S
1)μ
(cid:19)
λ
−
(S
−
3
−
S
1
−
, we get:
and using that 1 + λ
μ ≤
1 + λ
(S
−
1)μ
1 +
(S
(cid:18)
so that finally
λ
−
1)μ
(cid:19)
(cid:16)
S
1
−
E
mπ0
(cid:17)
(∆ + rmax)2
(cid:2)
E
mπ0
(∆ + rmax)2
which concludes the proof.
(cid:2)
Finally (33) becomes:
λ2
μ2
λ2
μ2
f
f
*
*
(cid:3)
(cid:3)
≤
≤
1 +
(cid:18)
1 +
(cid:18)
1 +
(cid:19) (cid:18)
λ
−
(S
S
1
−
1)μ
(cid:19)
,
,
(cid:19)
E
"
s,a
X
Xk
(∆(s + 1) + rmax)νk(s, a)
max
1, Ntk(s, a)
}
{
# ≤
p
3
E2AT ,
p
E [Rtrans + Rrewards + REVI]
12
2E2AT log (2AT ).
≤
p
and thus:
In particular:
(34)
(35)
E [Rtrans + Rrewards + REVI]
132eλ/μrmax
≤
1 +
s(cid:18)
λ2
μ2
(cid:19)
AT log (2AT ).
(36)
A.3.5 Bound on Rep
It remains to deal with the following regret term:
vk (Pk −
I) ̃hk.
Rep =
Xk
∈Mk(t) ,
We will follow the core of the proof from [11]. Define Xt := (p(
where k(t) is the episode containing step t and ei the vector with i-th coordinate 1 and 0 for the
other coordinates.
st, at)
−
*|
est ) ̃hk(t)
1M
vk (Pk −
I) ̃hk =
tk+1−
1
t=tk
X
tk+1−
1
≤
t=tk
X
Xt + ̃hk(stk+1)
̃hk(stk )
−
Xt + Drmax.
By summing over the episodes we get:
Rep ≤
T
t=1
X
Xt + KT Drmax.
Notice that E [Xt|
number of episodes remains.
s1, a1, . . . , st, at] = 0, so that when taking the expectations, only the term in the
On the other side, using Lemma B.3, we get when taking the expectation:
E [Rep]
SA log2
≤
8T
SA
(cid:18)
*
(cid:19)
Drmax.
Assuming SA
≥
4, and using log(2)
1
2 :
≥
E [Rep]
≤
2rmaxSAD log(2AT ).
(37)
19
We can now gather the expected regret terms when the true MDP is within the confidence bounds.
Using (28), (35) and (37):
E [Rin]
≤
96rmaxSAD2I(T ) log2 (2AT ) + 12
2E2AT log (2AT ) + 2rmaxSAD log(2AT ),
which gives with (23) and (24), assuming that T
S2:
p
≥
E [Reg]
≤
97rmaxSAD2I(T ) log2 (2AT ) + 12
2E2AT log (2AT ).
which finally gives:
p
E [Reg]
≤
97rmaxSAD2I(T ) log2 (2AT ) + 19
E2AT log (2AT ).
B Technical Lemmas
B.1 Probability of the confidence bounds
p
This first lemma is from [11, Lemma 17] and adapted to our confidence bounds.
Lemma B.1. For t > 1, the probability that the MDP M is not within the set of plausible MDPs
Mt is bounded by:
P
M /
{
∈ M
(t)
}
<
S
2t3 .
Proof. Fix a state action pair (s, a), and n the number of visits of this pair before time t. Recall that
ˆp and ˆr are the empirical transition probabilities and rewards from the n observations. Knowing that
from each pair, there are at most 3 transitions, a Weissman's inequality gives for any εp > 0:
P
ˆp(
*|
{k
s, a)
p(
*|
−
s, a)
k1 ≥
εp} ≤
6 exp
nε2
p
2 !
.
−
So that for the choice of εp =
2
n log (16At4)
8
n log (2At), we get:
q
P
(k
s, a)
ˆp(
*|
p(
*|
−
s, a)
≤
q
k1 ≥ r
8
n
log (2At)
) ≤
3
8At4 .
We can do similar computations for the confidence on rewards, with a Hoeffding inequality:
P
{|
ˆr(s, a)
−
r(s, a)
| ≥
εr} ≤
2 exp
2nε2
r
r2
max (cid:19)
(cid:18)
2
n log (2At), so that:
−
,
and choosing εr = rmax
1
2n log (16At4)
rmax
≤
q
q
P
(|
ˆr(s, a)
−
r(s, a)
| ≥
rmax
r
2
n
log (2At)
) ≤
1
8At4 .
Now with a union bound for all values of n
0, 1,
∈ {
and
P
(k
s, a)
ˆp(
*|
p(
*|
−
s, a)
k1 ≥ s
P
(|
ˆr(s, a)
−
r(s, a)
| ≥
rmax
s
and finally, when summing over all state-action pairs, P
, t
1
, we get:
* * *
}
−
8 log (2At)
max
{
1, Nt(s, a)
} ) ≤
2 log (2At)
max
{
1, Nt(s, a)
M /
{
∈ M
} ) ≤
< S
(t)
}
2t3 .
3
8At3 ,
1
8At3 ,
20
B.2 Number of visits for an MDP in
M
This lemma is needed in the proof of Lemma C.7.
Lemma B.2 (Azuma-Hoeffding inequality). Let X1, X2, . . . be a martingale difference sequence
with
RD for all i and some R > 0. Then for all ε > 0 and n
N:
Xi| ≤
|
∈
n
P
(
i=1
X
Xi ≥
ε
) ≤
exp
ε2
2nDR
.
(cid:19)
−
(cid:18)
The two following lemmas are proved in [11, Appendix C.2 and Appendix C.3] respectively. Bound-
ing the number of episodes is notably useful to obtain equation (28).
Lemma B.3. Denote by Kt the number of episodes up to time t, and let t > SA. It is bounded by:
Kt ≤
SA log2
8t
SA
.
(cid:19)
(cid:18)
The following lemma is used to simplify regret terms, notably (29).
Lemma B.4. For any fixed state action pair (s, a) and time T , we have:
νk(s, a)
max
{
1, Ntk(s, a)
}
≤
p
Xk=1
3
NT +1(s, a),
p
B.3 Diameter and Span of MDPs in
M
For completeness, and to support the discussion in Section 4.2, the section details the behavior of
the diameter and the span of MDPs in
, as functions of S.
Under policy π0, it is possible to get en explicit expression for the stationary distribution of the
states.
Lemma B.5. Under the stationary policy π0, the stationary measure mπ0
by:
(s) of the MDP is given
M
mπ0
(s) =
s
−
1)μ
(S
(cid:17)
−
1) .
S
1
−
s
(S
λ
(cid:1) (cid:16)
(cid:0)
1 + λ
(S
−
1)μ
(cid:16)
(cid:17)
This lemma is shown in the proof of [1, Lemma 3.3].
First, it should be clear that under any policy π, the diameter of the MDP under π is extremely large
because the probability to move from state s to state s+1 is smaller and smaller as s grows. Actually,
this is also true for the local diameter, more precisely the expected time to go from s to s + 1 grows
extremely fast with s.
This discussion is formalized in the following result.
Lemma B.6. For any M
1, s) grow as SS
Dπ(s
−
∈ M
2.
−
and any policy π, the diameter Dπ as well as the local diameter
Proof. Under policy π, the following sequence of inequalities follows from the stochastic compari-
son with π0 and monotonicity under π0.
Dπ
τ π(0, S
1)
τ π0
(0, S
1)
τ π0
(S
−
−
where τ π(x, y) is the expected time to go from x to y under policy π.
−
≥
≥
≥
2, S
1),
−
Now, starting from S
the time to reach S
2, the Markov chain moves to S
−
1 is equal to 1 or moves to S
1 with probability p := λ/(U (S
3 with probability 1
1)) and
p. Therefore,
−
−
2 or S
−
−
−
−
21
(S
2, S
τ π0
−
bounded in turn by the inverse of the stationary measure of state S
B.5,
p times the return time to S
1) is bounded by 1
−
−
−
−
2 in the chain truncated at S
2,
2 in this chain . Using Lemma
−
τ π0
(S
2, S
1)
(1
−
≥
−
−
(S
p)
−
λ
2)μ
(S
2)
−
1 +
λ
(S
2)
−
(cid:18)
λ
μ −
2
(cid:19)
S
−
2
SS
(cid:17)
μ
λ
(cid:19) (cid:16)
= exp
(cid:18)
(S
2)μ
−
(cid:18)
(cid:19)
2(1 + o(1/S)).
−
(38)
(39)
As for the maximal local diameter, maxs Dπ(s
and the same argument as before applies.
−
1, s)
≥
maxs τ π0
(s
1, s)
−
≥
τ π0
(S
2, S
1)
−
−
−
(h∗(0)
Let us now consider the bias of the optimal policy in M . From [1], the bias h∗(s) is decreasing
and concave in s, with increments bounded by C. Therefore, its span, defined as span (h∗) :=
maxs h∗(s)
mins h∗(s), satisfies
h∗(1))S
−
≤
span (h∗)
(h∗(S
2)
−
−
h∗(S
−
1))S
C(S
1).
−
≤
≤
This implies that the span of the bias behaves as a linear function of S for all M .
C Generic Lemmas on Ergodic MDPs
C.1 Bound on the bias variations
In this subsection, we aim to prove Lemma 3.2, which plays a main role in the regret computations.
We consider here we are always in the true MDP M .
We first show a bound on hitting times that will be used to control the variations of the bias:
Lemma C.1. Let π be any policy. Consider the Markov chain with policy π and transitions P
starting from any state s. Denote by τs the random time to hit 0 from state s. Then:
Eτs ≤
mπ(0)−
1
U
π(i) + μi
.
s
i=1
X
Proof. We write the expected hitting time equations. Let e be the unit vector. We have the system:
with the extra equation τ0 = 0.
We will show the result by induction. Call μi := π(i) + μi. The system gives for s = S
Eτ = e + P Eτ ,
(40)
1:
−
so that:
Eτs = 1 + Eτs
μs
1
−
U
+ Eτs
−
1
μs
U
,
Eτs =
U
μs
+ Eτs
−
1.
Then with an induction, we want to prove the equation for s < S
1:
−
Eτs = Eτs
−
1 +
U
μs
S
1
−
′
s
Xs′=s
i=s+1
Y
λi
−
μi
1
,
(41)
where we recall that λs = λ(1
s
−
S
1 ).
−
22
For s < S
−
1, assume (41) is true for Eτs+1:
Eτs = 1 + Eτs+1
+ Eτs
λs
U
μs −
U
−
1
−
μs −
U
λs
+ Eτs
−
1
μs
U
λs
+ Eτs
−
1
μs
U
+ Eτs
λs
U
+
= 1 + Eτs
1
S
1
−
′
s
Xs′=s+1
i=s+1
Y
1
λi
−
μi
1
λi
−
μi
by gathering the τs terms
=
U
μs
+ Eτs
−
1 +
U
μs
= Eτs
−
1 +
U
μs
S
1
−
S
1
−
′
s
i=s+1
Y
′
s
Xs′=s+1
λi
−
μi
1
,
Xs′=s
the induction is therefore true, and by definition of mπ(0) we have: Eτs ≤
Lemma C.2. For any policy π, define for s
1, . . . , S
i=s+1
Y
1
the variation of the bias
Eτs
−
1+ U
μs
mπ(0)−
1.
∂H π(s) := H π(s)
−
H π(s
−
∈ {
−
}
∞
1) =
P t(s,
t=1
X
(cid:0)
λ
∆(s) := 2rmaxe
μ (1 + log s).
∂H π(s)
≤
P t(s
)
*
−
1,
)
*
−
r.
(cid:1)
)
Proof. We will use an optimal coupling, that is, a coupling such that the following infimum is
reached, as defined in [13].
P t(s
P t(s,
1,
)
}
*
(42)
(cid:13)
Let X and Y be Markov chains with the same transition matrix P and starting states X1 = s,
(cid:13)
([0, 1]) be a sequence
1. We couple X and Y in the following way: For t
Y1 = s
of independent random variables sampled uniformly on [0, 1]. We have:
= Y ) : (Xt, Yt) is a coupling of P t(s,
TV = inf
(cid:13)
(cid:13)
2, let Ut ∼ U
) and P t(s
P(X
1,
−
−
≥
−
−
{
)
*
*
*
.
Xt+1 =
Xt −
Xt
Xt + 1 if 1
1 if Ut ≤
if μXt ≤
−
μXt
Ut ≤
λXt ≤
1
Ut,
λXt
−
(43)
and define Yt+1 the same way from Yt. This coupling is optimal, but in particular we have from
(42), with δr := maxs,a,a′
r(s, a)
r(s
: :
|
(P t(s,
−
)
−
P t(s
1, a′)
|
1,
= Cμ+w(Amax)
U
))r
2P(Xt 6
≤
= Yt)δr.
−
As τs is the time needed for Xt to hit 0 starting from s, the coupling time is lower than τs:
−
*
*
so that summing over t gives:
and now using Lemma C.1:
P(Xt 6
= Yt)
≤
P (τs
0 > t) ,
→
∂H π(s)
2δrEτs,
≤
∂H π(s)
≤
2δrmπ(0)−
1
Finally, using mπ(0)−
1
mπ0
(0)−
1
λ
μ :
e
≤
≤
U
π(i) + μi
.
s
i=1
X
so that:
∂H π(s)
≤
2rmaxe
λ
μ
1
i
,
s
i=1
X
∂H π(s)
≤
2rmaxe
λ
μ (1 + log s) = ∆(s),
23
6
C.2 From bias variations to probability transition variations
The three first lemmas of this subsection are used in the proof of Lemma C.6. This lemma is needed
to obtain equation (27).
Lemma C.3. For a MDP with rewards r
E
[0, rmax] and transition matrix P , denote by Js(π, T ) :=
the expected cumulative rewards until time T starting from state s, under
∈
policy π. Let Dπ be the diameter under policy π. The following inequality holds: span (J(π, T ))
hP
rmaxDπ.
≤
T
t=0 r(st, π(st))
i
Proof. Let s, s′
π. Then:
∈ S
. Call τs
s′ the random time needed to reach state s′ from state s under policy
→
T
Js(π, T ) = E
"
r(st)
#
t=0
X
τs→s
′
1
−
= E
"
r(st)
+ E
#
t=0
X
rmaxE [τs
→
rmaxDπ + Js′(π, T ),
s′ ] + Js′ (π, T )
T
t=τs→s
X
r(st)
′
which proves the lemma.
≤
≤
Lemma C.4. Consider two ergodic MDPs M and M ′. For i
[0, rmax] and Pi be the
rewards and transition matrix of MDP Mi under policy πi, where both MDPs have the same state
and action spaces. Denote by gi the average reward obtained under policy πi in the MDP Mi. Then
the difference of the gains is upper bounded.
1, 2, let ri ∈
∈
g′
g
|
−
r′
r
−
k∞
+ rmaxDπk
P
−
P ′
k∞
.
| ≤ k
Proof. Define for any state s the following correction term b(s) := rmaxDπk
us show by induction that for T
0,
s)
p(
*|
−
p′(
*|
s)
k
. Let
≥
T
1
−
P ′
t(r + b).
T
1
−
t=0
X
P tr
≤
t=0
X
This is true for T = 0. Assume that the inequality is true for some T
0, then
≥
T
T
P tr
t=0
X
−
t=0
X
P ′
t(r + b) =
b + P
−
T
1
−
t=0
X
T
b + P ′
=
−
P tr
P ′
−
1
−
t=0
X
P tr
−
T
1
−
t=0
X
1
T
−
t=0
X
P ′
t(r + b)
P ′
t(r + b)
!
+ (P
P ′)
−
P tr
T
t=0
X
b + (P
P ′)
−
≤ −
P tr by induction hypothesis.
T
t=0
X
Notice that, for any state s:
(P
−
P ′)
T
t=0
X
P tr
(s)
!
In the same manner we show that:
≤ k
p(
s)
*|
−
rmaxDπk
p′(
*|
s)
k *
span (J(T ))
s)
p(
*|
−
p′(
*|
s)
k
by Lemma C.3
≤
= b(s).
P ′
t(r
b).
−
T
T
P tr
≥
t=0
X
t=0
X
24
Hence, as P ′ has non-negative coefficients, denoting by e the unit vector:
We can also show that:
T
T
P ′
tr
P tr
−
t=0
X
t=0
X
b
≤ k
T
t=0
X
k∞ (cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
∞
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
t
P ′
e
*
∞
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
=
b
k
k∞
(T + 1).
T
T
P ′
tr′
=
P ′
tr
−
P ′
t(r
r′)
−
r′
r
−
k∞
≤ k
(T + 1).
t=0
X
And therefore with a multiplication by
t=0
X
t=0
X
∞
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
, and with a triangle inequality:
1
T +1
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
∞
T
t=0 P tr
T
t=0 P ′
tr′
P
(cid:13)
(cid:13)
(cid:13)
where
∞
(cid:13)
(cid:13)
(cid:13)
P
g′
r′
r
−
k∞
+
b
k
k∞
,
| ≤ k
g
|
P ′
k∞
−
.
b
k
k∞
= rmaxDπk
−
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
T
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
−
P
and by taking the Cesáro limit
in
Lemma C.5. Let P be the stochastic matrix of an ergodic Markov chain with state space 1, . . . , S.
The matrix A := I
P has a block decomposition
−
then AS, of size (S
−
expected time to reach state S from state i.
(S
1)
−
×
1) is invertible and
k
1
S k∞
= supi
∈S
Ei τS, where Ei τS is the
A =
AS
c
(cid:18)
b
d
;
(cid:19)
A−
Remark that this lemma is true for any state in
.
S
Proof. (Ei τS)i is the unique vector solution to the system:
v(S) = 0
(
i
∀
= S, v(i) = 1 +
j
P (i, j)v(j)
∈S
eS, where ̃A is the matrix
P
We can rewrite this system of equations as: ̃Av = e
−
̃A :=
AS
0
(cid:18)
b
1
,
(cid:19)
e the unit vector and eS the vector with value 1 for the last state and 0 otherwise. Then
are invertible and we write:
A and AS
e
̃A−
1 =
1
A−
S
0
1
S b
A−
1
−
.
Thus, by computing ̃A−
and using that AS is an M-matrix and that its inverse has non-negative components,
supi
(cid:19)
= S, (Ei τS)i = A−
1
S e. By definition of the infinite norm
=
1
S k∞
eS), for i
Ei τS.
1(e
A−
−
(cid:18)
k
∈S
In the following lemma, we use the same notations as in Lemma C.4 with a common state space
.
}
1, . . . S
{
Lemma C.6. Let the biases h, h′ be the biases of the two MDPs verify their respective Bellman
equations with the renormalization choice h(S) = h′(S) = 0. Let sups
s′ be the worst
Es τs′ . We
∈S
expected hitting time to reach the state s′ with policy π, and call Thit := inf s′
have the following control of the difference:
Es τ π
sups
∈S
∈S
h
k
−
h′
k∞ ≤
2Thit(D′rmaxk
P
−
P ′
k∞
+
r
k
−
r′
k∞
)
Notice that although the biases are unique up to a constant additive term, the renormalization choice
does not matter as the unit vector is in the kernel of (P
P ′).
−
25
6
6
Proof. The computations in this proof follow the same idea as in the proof of [10, Theorem 4.2].
The biases verify the following Bellman equations r
P )h, and also the arbitrary
−
renormalization equations, thanks to the previous remark: h(S) = 0. Using the same notations as in
the proof of Lemma C.5, we can write the system of equations ̃Ah = ̃r
̃g, with ̃r and ̃g respectively
equal to r and g everywhere but on the last state, where their value is replaced by 0.
ge = (I
−
−
We therefore have that h = ̃A−
denoting dX := X
1( ̃r
−
X ′ for any vector or matrix X, we get:
̃g), and with identical computations, h′ = ̃A′
1
−
( ̃r′ −
̃g′). By
−
1(d ̃r
The previously defined block decompositions are:
dh =
−
̃A−
d ̃g + d ̃Ah′).
−
̃A−
1 =
For s < S, dh(s) =
using C.3:
−
1
A−
S
0
(cid:18)
eT
s A−
1
−
1
A−
S b
1
(cid:19)
and
d ̃A =
AS −
0
(cid:18)
A′S
b
b′
−
0
.
(cid:19)
S (dASh′ + d ̃r
d ̃g) and dh(S) = 0. Now by taking the norm and
−
(rmaxD′
k
Notice that
. Using Lemma C.4 and Lemma C.5,
and
dr
and taking the infimum for the choice of the state of renormalization implies the claimed inequality
for the biases.
dh
k
dASk∞ ≤ k
dASk∞
k
=
d ̃g
|
k
k
k∞ ≤ k
dP
k
k∞
A−
d ̃r
+
dg
d ̃r
k
d ̃g
|
+
).
k
k
|
|
,
1
S k∞
k ≤ k
C.3 A McDiarmid's inequality
Lemma C.7. Recall that mmax is the stationary measure of the Markov chain under policy πmax,
such that for every state s: πmax(s) = Amax.
Let k be an episode, and assume that the length of this episode Ik is at least I(T ) = 1 +
max
Qmax, T 1/4
, with Qmax :=
10D
mmax(S
at least 1
(cid:8)
1
4T :
(cid:9)
−
νk(xk, ak)
(cid:16)
≥
We will now prove Lemma C.7:
1)
−
(cid:17)
2
log
(cid:18)(cid:16)
1)Ik −
mmax(S
−
5D
Ik log Ik.
p
10D
mmax(S
1)
−
4
. Then, with probability
(cid:19)
(cid:17)
Proof. Let k be an episode such that Ik ≥
I(T ), and first consider it is of fixed length I. Denote
by ̊r the vector of reward equal to 1 if the current state is xk and 0 otherwise. Denote by ̊gπk the
gain associated to the policy πk for the transitions p and rewards ̊r, and similarly define ̊hπk the
bias, translated so that ̊hπk (S
1) = 0. Notice in that case, that if we denote by mk the stationary
λ
distribution under policy πk, that mmax(S
μ + 1.
Then:
mk(s) for any state s, assuming that S
1)
−
≤
−
≥
νk(xk, ak) =
=
=
tk+1−
1
u=tk
X
tk+1−
1
u=tk
X
tk+1−
1
u=tk
X
̊r(su)
̊gπk + ̊hπk (su)
p (
*|
−
D
su, πk(su)) , ̊hπk
using a Bellman's equation
E
̊gπk + ̊hπk (su)
−
̊hπk (su+1) + ̊hπk (su+1)
p (
*|
−
D
su, πk(su)) , ̊hπk
.
E
By Azuma-Hoeffding inequality B.2, following the same proof as in section 4.3.2 of [11], notice that
Xu = ̊hπk (su+1)
D:
form a martingale difference sequence with
su, πk(su)) , ̊hπk
p (
Xu| ≤
|
*|
−
D
E
Xu ≥
tk+1−
1
P
(
u=tk
X
1
I 5 .
) ≤
D
10I log I
p
26
Using that
̊hπk (stk )
(cid:12)
(cid:12)
(cid:12)
−
On the other hand:
≤
̊hπk (stk+1)
(cid:12)
(cid:12)
(cid:12)
νk(xk, ak)
D, with probability at least 1
1
I 2 :
−
tk+1−
1
≥
u=tk
X
̊gπk −
5D
I log I.
p
tk+1−
1
̊gπk = νk(sk, ak)mk(xk),
so that, using that mk(xk)
1), with probability at least 1
u=tk
X
mmax(S
≥
νk(xk, ak)
−
mmax(S
≥
1)I
−
−
5D
1
I 5 :
−
I log I.
We now use a union bound over the possible values of the episode lengths Ik, between I(T ) + 1 and
T :
p
P
νk(xk, ak) < mmax(S
n
1)Ik −
−
5D
Ik log Ik
p
1
I 5 ≤
T
XI=T 1/4+1
1
I 5
T
o
≤
≤
XI=I(T )+1
1
,
4T
so that we now have that with probability at least 1
νk(xk, ak)
mmax(S
≥
−
1
4T :
−
1)Ik −
5D
Ik log Ik.
p
We can show a corollary of Lemma C.7 that we will use for the regret computations:
Corollary C.8. For an episode k such that its length Ik is greater than I(T ),with probability at
least 1
1
4T :
−
νk(xk, ak)
mmax(S
2
≥
1)
−
Ik.
Proof. With Lemma C.7, it is enough to show that 5D√Ik log Ik ≤
1) =: B. By monotonicity, as Ik ≥
.
log Ik ≥
that B2 log B4
q
B2 log B4
−
B2 log
10D
mmax(S
that
Qmax = B2 log B4 we can show instead
Ik, i.e.
Ik
−
2
mmax(S
1)
≥
This last inequality is true, using that log x
(cid:1)
(cid:0)
log(2 log x) for x > 1. This proves the corollary.
≥
27
|
|
http://arxiv.org/abs/2302.10663v2 | 2023-02-23T15:18:23 | 2023-02-21T13:25:35 | RealFusion: 360° Reconstruction of Any Object from a Single Image | We consider the problem of reconstructing a full 360{\deg} photographic model
of an object from a single image of it. We do so by fitting a neural radiance
field to the image, but find this problem to be severely ill-posed. We thus
take an off-the-self conditional image generator based on diffusion and
engineer a prompt that encourages it to "dream up" novel views of the object.
Using an approach inspired by DreamFields and DreamFusion, we fuse the given
input view, the conditional prior, and other regularizers in a final,
consistent reconstruction. We demonstrate state-of-the-art reconstruction
results on benchmark images when compared to prior methods for monocular 3D
reconstruction of objects. Qualitatively, our reconstructions provide a
faithful match of the input view and a plausible extrapolation of its
appearance and 3D shape, including to the side of the object not visible in the
image. | [
"Luke Melas-Kyriazi",
"Christian Rupprecht",
"Iro Laina",
"Andrea Vedaldi"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10663v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10663v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CV",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CV",
"cs.AI",
"cs.LG"
] | 3
2
0
2
b
e
F
3
2
]
V
C
.
s
c
[
2
v
3
6
6
0
1
.
2
0
3
2
:
v
i
X
r
a
RealFusion
360◦ Reconstruction of Any Object from a Single Image
Luke Melas-Kyriazi
Iro Laina Christian Rupprecht Andrea Vedaldi
Visual Geometry Group, Department of Engineering Science, University of Oxford
{lukemk,iro,chrisr,vedaldi}@robots.ox.ac.uk
https://lukemelas.github.io/realfusion
Figure 1. RealFusion generates a full 360◦ reconstruction of any object given a single image of it (left column). It does so by leveraging
an existing diffusion-based 2D image generator. From the given image, it synthesizes a prompt that causes the diffusion model to "dream
up" other views of the object. It then extracts a neural radiance field from the original image and the diffusion model-based prior, thereby
reconstructing the object in full. Both appearance and geometry are reconstructed faithfully and extrapolated in a plausible manner (see
the textured and shaded reconstructions from different viewpoints).
Abstract
in the image.
We consider the problem of reconstructing a full 360◦
photographic model of an object from a single image of it.
We do so by fitting a neural radiance field to the image,
but find this problem to be severely ill-posed. We thus take
an off-the-self conditional image generator based on diffu-
sion and engineer a prompt that encourages it to "dream
up" novel views of the object. Using the recent DreamFu-
sion method, we fuse the given input view, the conditional
prior, and other regularizers in a final, consistent recon-
struction. We demonstrate state-of-the-art reconstruction
results on benchmark images when compared to prior meth-
ods for monocular 3D reconstruction of objects. Qualita-
tively, our reconstructions provide a faithful match of the
input view and a plausible extrapolation of its appearance
and 3D shape, including to the side of the object not visible
1. Introduction
We consider the problem of obtaining a 360◦ photo-
graphic reconstruction of any object given a single image
of it. The challenge is that a single image does not con-
tain sufficient information for 3D reconstruction. Without
access to multiple views, an image only provides weak ev-
idence about the 3D shape of the object, and only for one
side of it. Even so, there is proof that this task can be solved:
any skilled 3D artist can take a picture of almost any object
and, given sufficient time and effort, create a plausible 3D
model of it. The artist can do so by tapping into her vast
knowledge of the natural world and of the objects it con-
tains, making up for the information missing in the image.
1
To solve this problem algorithmically, one must then
marry visual geometry with a powerful statistical model of
the 3D world. The recent explosion of 2D image generators
like DALL-E [36], Imagen [42], and Stable Diffusion [40]
suggests that such models might not be far behind. By using
diffusion, these methods can solve highly-ambiguous gen-
eration tasks, obtaining plausible 2D images from textual
descriptions, semantic maps, partially-complete images, or
simply unconditionally from random noise. Clearly, these
models possess high-quality priors-if not of the 3D world,
then at least of the way it is represented in 2D images.
Hence, in theory, a 3D diffusion model trained on vast quan-
tities of 3D data should be capable of producing 3D recon-
structions, either unconditionally or conditioned on a 2D
image. However, training such a model is infeasible be-
cause, while one can access billions of 2D images [43], the
same cannot be said about 3D data.
The alternative to training a 3D diffusion model is to ex-
tract 3D information from an existing 2D model. A 2D im-
age generator can in fact be used to sample or validate mul-
tiple views of a given object; these multiple views can then
be used to perform 3D reconstruction. With early GAN-
based generators, authors showed some success for simple
data like faces and synthetic objects [3, 9, 12, 30, 31, 54].
With the availability of large-scale models like CLIP [34]
and, more recently, diffusion models, increasingly complex
results have been obtained. The most recent example is
DreamFusion [33], which generates high-quality 3D mod-
els from textual descriptions alone.
Despite these advances, the problem of single-image 3D
reconstruction remains largely unsolved. In fact, these re-
cent methods do not solve this problem. They either sample
random objects, or, like in the case of DreamFusion, start
from a textual description.
A problem in extending generators to reconstruction is
coverage (sometimes known as mode collapse). For exam-
ple, high-quality face generators based on GANs are usually
difficult to invert: they may be able to generate many differ-
ent high-quality images, and yet are usually unable to gen-
erate most images [1]. Conditioning on an image provides a
much more detailed and nuanced specification of the object
than, say, a textual description. It is not obvious if the gen-
erator model would be able to satisfy all such constraints.
In this paper, we study this problem in the context of
diffusion models. We express the object's 3D geometry and
appearance by means of a neural radiance field. Then, we
train the radiance field to reconstruct the given input image
by minimizing the usual rendering loss. At the same time,
we sample random other views of the object, and constrain
them with the diffusion prior, using a technique similar to
DreamFusion.
We find that, out of the box, this idea does not work well.
Instead, we need to make a number of improvements and
modifications. The most important change is to adequately
condition the diffusion model. The idea is to configure the
prior to "dream up" or sample images that may plausibly
constitute other views of the given object. We do so by en-
gineering the diffusion prompt from random augmentations
of the given image. Only in this manner does the diffu-
sion model provide sufficiently strong constraints to allow
meaningful 3D reconstruction.
In addition to setting the prompt correctly, we also add
some regularizers: shading the underlying geometry and
randomly dropping out texture (also similar to DreamFu-
sion), smoothing the normals of the surface, and fitting the
model in a coarse-to-fine fashion, capturing first the overall
structure of the object and only then the fine-grained details.
We also focus on efficiency and base our model on Instant-
NGP [29]. In this manner, we achieve reconstructions in the
span of hours instead of days if we were to adopt traditional
MLP-based NeRF models.
We assess our approach by using random images cap-
tured in the wild as well as existing benchmark datasets.
Note that we do not train a fully-fledged 2D-to-3D model
and we are not limited to specific object categories; rather,
we perform reconstruction on an image-by-image basis us-
ing a pretrained 2D generator as a prior. Nonetheless, we
can surpass quantitatively and qualitatively previous single-
including Shelf-Supervised Mesh
image reconstructors,
Prediction [58], which uses supervision tailored specifically
for 3D reconstruction.
More impressively, and more importantly, we obtain
plausible 3D reconstructions that are a good match for the
provided input image (Fig. 1). Our reconstructions are not
perfect, as the diffusion prior clearly does its best to explain
the available image evidence but cannot always match all
the details. Even so, we believe that our results convinc-
ingly demonstrate the viability of this approach and trace a
path for future improvements.
To summarize, we make the following contributions:
(1) We propose RealFusion, a method that can extract from
a single image of an object a 360◦ photographic 3D recon-
struction without assumptions on the type of object imaged
or 3D supervision of any kind; (2) We do so by leveraging
an existing 2D diffusion image generator via a new single-
image variant of textual inversion; (3) We also introduce
new regularizers and provide an efficient implementation
using InstantNGP; (4) We demonstrate state-of-the-art re-
construction results on a number of in-the-wild images and
images from existing datasets when compared to alternative
approaches.
2. Related work
Image-based reconstruction of appearnce and geometry.
Much of the early work on 3D reconstruction is based on
principles of multi-view geometry [11]. These classic meth-
2
ods use photometry only to match image features and then
discard it and only estimate 3D shape.
The problem of reconstructing photometry and geome-
try together has been dramatically revitalized by the intro-
duction of neural radiance fields (RFs). NeRF [26] in par-
ticular noticed that a coordinate MLP provides a compact
and yet expressive representation of 3D fields, and can be
used to model RFs with great effectiveness. Many variants
of NeRF-like models have since appeared. For instance,
some [24, 48, 50] use sign distance functions (SDFs) to
recover cleaner geometry. These approaches assume that
dozens if not hundreds of views of each scene are avail-
able for reconstruction. Here, we use them for single-image
reconstruction, using a diffusion model to "dream up" the
missing views.
Few-view reconstruction. Many authors have attempted
to improve the statistical efficiency of NeRF-like models, by
learning or incorporating various kinds of priors. Quite re-
lated to our work, NeRF-on-a-Diet [17] reduces the number
of images required to learn a NeRF by generating random
views and measuring their "semantic compatibility" with
the available views via CLIP embeddings [35], but they still
require several input views.
While CLIP is a general-purpose model learned on 2D
data, other authors have learned deep networks specifically
for the goal of inferring NeRFs from a small number of
views. Examples include IBRNet [51], NeRF-WCE [13],
PixelNeRF [60], NeRFormer [38], and ViewFormer [22].
These models still generally require more than one input
view at test time, require multi-view data for training, and
are often optimized for specific object categories.
Single-view reconstruction. Some authors have at-
tempted to recover full radiance fields from single im-
ages, but this generally requires multi-view data for train-
ing, as well as learning models that are specific to a spe-
cific object category. 3D-R2N2 [5], Pix2Vox [55, 55], and
LegoFormer [57] learn to reconstruct volumetric represen-
tation of simple objects, mainly from synthetic data like
ShapeNet [4]. More recently, CodeNeRF [19] predicts a
full radiance field, including reconstructing the photometry
of the objects. AutoRF [28] learns a similar autoencoder
specifically for cars.
Extracting 3D models from 2D generators. Several au-
thors have proposed to extract 3D models from 2D image
generators, originally using GANs [3, 9, 12, 30, 31, 54].
More related to our work, CLIP-Mesh [20] and Dream
Fields [16] do so by using the CLIP embedding and can
condition 3D generation on text. Our model is built on the
recent Dream Fusion approach [33], which builds on a sim-
ilar idea using a diffusion model as prior.
However, these models have been used as either pure
generators or generators conditioned on vague cues such as
Figure 2. Method diagram. Our method optimizes a neural ra-
diance field using two objectives simultaneously: a reconstruction
objective and a prior objective. The reconstruction objective en-
sures that the radiance field resembles the input image from a spe-
cific, fixed view. The prior objective uses a large pre-trained dif-
fusion model to ensure that the radiance field looks like the given
object from randomly sampled novel viewpoints. The key to mak-
ing this process work well is to condition the diffusion model on a
prompt with a custom token (cid:104)e(cid:105), which is generated prior to recon-
struction using single-image textual inversion. This diagram does
not display our coarse-to-fine training strategy or regularization
terms, both of which improve qualitative results.
class identity or text. Here, we build on similar ideas, but
we apply them to the case of single-view reconstruction.
Recently, the authors of [53] have proposed to directly
generate multiple 2D views of an object, which can then be
reconstructed in 3D using a NeRF-like model. This is also
reminiscent of our approach, but their model requires multi-
view data for training, is only tested on synthetic data, and
requires to explicitly sample multiple views for reconstruc-
tion (in our case they remain implicit).
Diffusion Models. Diffusion denoising probabilistic
models are a class of generative models based on iteratively
In vision, early
reversing a Markovian noising process.
works formulated the problem as learning a variational
lower bound [14], or framed it as optimizing a score-
based generative model [45, 46] or as the discretization
im-
of a continuous stochastic process [47].
provements includes the use of faster and deterministic
sampling [14, 25, 52], class-conditional models [7, 46],
text-conditional models [32], and modeling in latent
space [41].
Recent
3. Method
We provide an overview and notation for the background
material first (Sec. 3.1), and then discuss our RealFusion
method (Sec. 3.2).
3
Input ImageRenderReconstruction ViewNovel ViewPrompt with optimized embedding token <e>Reconstruction ObjectiveDiffusionModelPrior ObjectiveNovel ViewNovel ViewNovel ViewSingle-ImageTextual InversionDiffusionModelPrior ObjectiveDiffusionModelPrior ObjectiveDiffusionModelPrior Objectivestandard optimizer. Specifically, the RF is fitted to a dataset
D = {(I, π)} of images I with known camera parameters
by minimizing the L2 image reconstruction error
Lrec(σ, c; D) =
1
|D|
(cid:88)
(I,π)∈D
(cid:107)I − R(*; σ, c, π)(cid:107)2.
(2)
In order to obtain good quality results, one typically re-
quires a dataset of dozens or hundreds of views.
Here, we consider the case in which we are given ex-
actly one input image I0 corresponding to some (unknown)
camera π0. In this case, we can also assume any standard
viewpoint π0 for that single camera. Optimizing Eq. (2)
with a single training image leads to severe over-fitting: it
is straightforward to find a pair (σ, c) that has zero loss and
yet does not capture any sensible 3D model of the object.
Below we will leverage a pre-trained 2D image prior to (im-
plicitly) dream up novel views of the object and provide the
missing information for 3D reconstruction.
Diffusion models. A diffusion model draws a sample
from a probability distribution p(I) by inverting a pro-
cess that gradually adds noise to the image I. The diffu-
sion process is associated with a variance schedule {βt ∈
(0, 1)}T
t=1, which defines how much noise is added at each
time step. The noisy version of sample I at time t can then
1 − ̄αt(cid:15) where (cid:15) ∼ N (0, I), is a
be written It =
sample from a Gaussian distribution (with the same dimen-
sionality as I), αt = 1 − βt, and ̄αt = (cid:81)t
i=1 αi. One then
learns a denoising neural network ˆ(cid:15) = Φ(It; t) that takes as
input the noisy image It and the noise level t and tries to
predict the noise component (cid:15).
̄αtI +
√
√
In order to draw a sample from the distribution p(I),
one starts by drawing a sample IT ∼ N (0, I). Then, one
progressively denoises the image by iterated application of
Φ according to a specified sampling schedule [15, 25, 44],
which terminates with I0 sampled from p(I).
Modern diffusion models are trained on large collections
D(cid:48) = {I} of images by minimizing the loss
Ldiff(Φ; D(cid:48)) = 1
|D(cid:48)|
(cid:88)
√
||Φ(
̄αtI +
√
1 − ̄αt(cid:15), t) − (cid:15)||2.
I∈D(cid:48)
(3)
This model can be easily extended to draw samples from
a distribution p(x|e) conditioned on a prompt e. Condition-
ing on the prompt is obtained by adding e as an additional
input of the network Φ, and the strength of conditioning can
be controlled via classifier-free guidance [7].
DreamFusion and Score Distillation Sampling (SDS).
Given a 2D diffusion model p(I|e) and a prompt e, Dream-
Fusion extracts from it a 3D rendition of the corresponding
concept, represented by a RF (σ, c). It does so by randomly
sampling a camera parameter π, rendering a corresponding
view Iπ, assessing the likelihood of the view based on the
4
Figure 3. Examples demonstrating the level of detail of infor-
mation captured by the optimized embedding (cid:104)e(cid:105). Rows 1-
2 show input images and masks. The images are used to opti-
mize (cid:104)e(cid:105) via our single-image textual inversion process. Rows 3-5
show examples of 2D images generated using (cid:104)e(cid:105) in new prompts,
which we hope demonstrate the type of information encoded in
(cid:104)e(cid:105). Rows 6-7 show RealFusion's output, optimized using the
prompt "An image of a (cid:104)e(cid:105)".
3.1. Radiance fields and DreamFusion
Radiance fields. A radiance field (RF) is a pair of func-
tions (σ(x), c(x)) mapping a 3D point x ∈ R3 to an opac-
ity value σ(x) ∈ R+ and a color value c(x) ∈ R3. The RF
is called neural when these two functions are implemented
by a neural network.
The RF represents the shape and appearance of an object.
In order to generate an image of it, one renders the RF using
the emission-absorption model. Let I ∈ R3×H×W be an
image, so that I(u) ∈ R3 is the color of pixel u. In order
to compute I(u), one casts a ray ru from the camera center
through the pixel, interpreted as a point on the 3D image
plane (this implicitly accounts for the camera viewpoint π ∈
SE(3)). Then, one takes a certain number of samples (xi ∈
ru)i∈N , for indices N = {1, . . . , N } taken with constant
spacing ∆. The color is obtained as:
I(u) = R(u; σ, c) =
(cid:88)
i∈N
(Ti+1 − Ti)c(xi),
(1)
where Ti = exp(−∆ (cid:80)i−1
j=0 σ(xj)) is the probability that
a photon is transmitted from point xi back to the camera
sensor without being absorbed by the material.
Importantly, the rendering function R(u; σ, c) is differ-
entiable, which allows training the model by means of a
Illustration of the information contained in <e>:"A sketch of a <e>"Automatic MaskInput ImageRealFusionauto-prompt:"An image of a <e>""A davinci painting of a <e>"RealFusion:Novel View 1RealFusion:Novel View 2RealFusion:Novel View 3ewfLSDSLrecmodel p(Iπ|e), and updating the RF to increase the likeli-
hood of the generated view based on the model.
In practice, DreamFusion uses the denoiser network as a
frozen critic and takes a gradient step
∇(σ,c)LSDS(σ, c; π, e, t) =
(cid:104)
Et,(cid:15)
w(t)(Φ(αtI + σt(cid:15); t, e) − (cid:15)) * ∇(σ,c)I
(cid:105)
,
(4)
where I = R(*; σ, c, π). is the image rendered from a given
viewpoint π and prompt e. This process is called Score
Distillation Sampling (SDS).
Note that Eq. (4) differs from simply optimizing the
standard diffusion model objective because it does not in-
clude the Jacobian term for Φ. In practice, removing this
term both improves generation quality and reduces compu-
tational and memory requirements.
One final aspect of DreamFusion is essential for under-
standing our contribution in the following section: Dream-
Fusion finds that it is necessary to use classifier-free guid-
ance [7] with a very high guidance weight of 100, much
larger than one would use for image sampling, in order to
obtain good 3D shapes. As a result, the generations tend
to have limited diversity; they produce only the most likely
objects for a given prompt, which is incompatible with our
goal of reconstructing any given object.
3.2. RealFusion
Our goal is to reconstruct a 3D model of the object con-
tained in a single image I0, utilizing the prior captured in
the diffusion model Φ to make up for the missing informa-
tion. We will achieve this by optimizing a radiance field
using two simultaneous objectives: (1) a reconstruction ob-
jective Eq. (2) from a fixed viewpoint, and (2) a SDS-based
prior objective Eq. (4) on novel views randomly sampled
at each iteration. Figure 2 provides a diagram of the entire
system.
Single-image textual inversion as a substitute for al-
ternative views. The most important component of our
method is the use of single-image textual inversion as a sub-
stitute for alternative views. Ideally, we would like to condi-
tion our reconstruction process on multi-view images of the
object in I0, i.e. on samples from p(I|I0). Since these im-
ages are not available, we instead synthesize a text prompt
e(I0) specifically for our image I0 as a proxy for this multi-
view information.
Our idea, then, is to engineer a prompt e(I0) to provide
a useful approximation of p(I|I0). We do so by generating
random augmentations g(I0), g ∈ G of the input image,
which serve as pseudo-alternative-views. We use these aug-
mentations as a mini-dataset D(cid:48) = {g(I0)}g∈G and opti-
mize the diffusion loss Eq. (3) Ldiff(Φ(*; e(I0))) with respect
to the prompt e(I0), while freezing all other text embeddings
and model parameters.
In practice, our prompt is derived automatically from
templates like "an image of a (cid:104)e(cid:105)", where "(cid:104)e(cid:105)" (= e(I0))
is a new token introduced to the vocabulary of the text
encoder of our diffusion model (see Appendix A for de-
tails). Our optimization procedure mirrors and general-
izes the recently-proposed textual-inversion method of [10].
Differently from [10], we work in the single-image set-
ting and utilize image augmentations for training rather than
multiple views.
To help convey the intuition behind (cid:104)e(cid:105), consider an at-
tempt at reconstructing an image of a fish using the generic
text prompt "An image of a fish" with losses Eqs. (3)
and (4). In our experience, this often produces a reconstruc-
tion which looks like the input fish from the input view-
point, but looks like some different, more-generic fish from
the backside. By contrast, using the prompt "An image of a
(cid:104)e(cid:105)", the reconstruction resembles the input fish from all an-
gles. An example of exactly this case is shown in Figure 7.
Finally, Figure 3 demonstrates the amount of detail cap-
tured in the embedding (cid:104)e(cid:105).
Coarse-to-fine training.
In order to describe our coarse-
to-fine training methodology, it is necessary to first briefly
introduce our underlying RF model, a InstantNGP [29]. In-
stantNGP is a grid-based model which stores features at the
vertices of a set of feature grids {Gi}L
i=1 at multiple res-
olutions. The resolution of these grids is chosen to be a
geometric progression between the coarsest and finest reso-
lutions, and feature grids are trained simultaneously.
We choose a InstantNGP over a conventional MLP-
based NeRF due to its computational efficiency and training
speed. However, the optimization procedure occasionally
produces small irregularities on the surface of the object.
We find that training in a coarse-to-fine manner helps to al-
leviate these issues: for the first half of training we only op-
timize the lower-resolution feature grids {Gi}L/2
i=1 , and then
in the second half of training we optimize all feature grids
{Gi}L
i=1. Using this strategy, we obtain the benefits of both
efficient training and high-quality results.
Normal vector regularization. Next, we introduce a new
regularization term to encourage our geometry to have
smooth normals. The introduction of this term is motivated
by the observation that our RF model occasionally gener-
ated noisy-looking surfaces with low-level artifacts. To ad-
dress these artifacts, we encourage our RF to have smoothly
varying normal vectors. Notably, we perform this regular-
ization in 2D rather than in 3D.
At each iteration, in addition to computing RGB and
opacity values, we also compute normals for each point
along the ray and aggregate these via the raymarching equa-
5
Figure 4. Qualitative results. RealFusion reconstructions from a single input view. Each pair of columns shows the textured object and
the underlying 3D shape, as a shaded surface. Different pairs of columns show different viewpoints.
tion to obtain normals N ∈ RH×W ×3.1 Our loss is:
Our final objective then consists of four terms:
Lnormals = (cid:107)N − stopgrad(blur(N, k))(cid:107)2
(5)
∇σ,cL = ∇LSDS + λnormals * ∇Lnormals
where stopgrad is a stop-gradient operation and blur(*, k) is
a Gaussian blur with kernel size k (we use k = 9).
Although it may be more common to regularize normals
in 3D, we found that operating in 2D reduced the variance
of the regularization term and led to superior results.
Mask loss.
In addition to the input image, our model also
utilizes a mask of the object that one wishes to reconstruct.
In practice, we use an off-the-shelf image matting model to
obtain this mask for all images.
We incorporate this mask in a simple manner by adding a
simple L2 loss term on the difference between the rendered
opacities from the fixed reference viewpoint R(σ, π0) ∈
RH×W and the object mask M : Lrec,mask = ||O − M ||2
+ λimage * ∇Limage + λmask * ∇Lmask
(6)
where the top line in the equation above corresponds to our
prior objective and the bottom line corresponds to our re-
construction objective.
4. Experiments
4.1. Implementation details
Regarding hyperparameters, we use essentially the same
set of hyper-parameters for all experiments-there is no
per-scene hyper-parameter optimization.2. For our diffusion
model prior, we employ the open-source Stable Diffusion
model [41] trained on the LAION [43] dataset of text-image
pairs. For our InstantNGP [29] model, we use a model with
1Normals may be computed either by taking the gradient of the density
field or by using finite differences. We found that using finite differences
worked well in practice.
2There is one small exception to this rule, which is that for a few num-
ber of images where the camera angle was clearly at an angle higher than
15◦, we took a camera angle of 30 or 40deg.
6
Table 1. Quantitative comparison. We compare our method with
Shelf-Supervised [59] on seven object categories. The F-score and
CLIP-similarity metrics are designed to measure the quality of re-
construction shape and appearance, respectively. For both metrics,
higher is better. Metrics are averaged over three images per cate-
gory. Our method outperforms [59] in aggregate, despite the fact
that [59] uses a different category-specific model for each category.
F-score
CLIP-similarity
[59]
Ours
Backpack
Chair
Motorcycle
Orange
Skateboard
Teddybear
Vase
7.58
8.26
8.66
6.27
7.74
12.89
6.30
12.22
10.23
8.72
10.16
5.89
10.08
9.72
Mean
8.24
9.58
[59]
0.72
0.65
0.69
0.71
0.74
0.73
0.69
0.70
Ours
0.74
0.76
0.70
0.74
0.74
0.82
0.71
0.74
cludes the use of diffuse and textureless shading stochas-
tic throughout the course of optimization, after an initial
warmup period of albedo-only shading. Complete details
regarding this and other aspects of our training setup are
provided in the supplementary material.
4.2. Quantitative results
There are only few methods that attempt
to recon-
struct arbitrary objects in 3D. The most recent and best-
performing of these is Shelf-Supervised Mesh Predic-
tion [58], which we compare here. They provide 50 pre-
trained category-level models for 50 different categories in
OpenImages [23]. Since we aim to compute metrics using
3D or multi-view ground truth, we evaluate on seven cate-
gories in the CO3D dataset [39] with corresponding Open-
Images categories. For each of these seven categories, we
select three images at random and run both RealFusion and
Shelf-Supervised to obtain reconstructions.
We first test the quality of the recovered 3D shape in
Fig. 5. Shelf-Supervised directly predicts a mesh. We ex-
tract one from our predicted radiance fields using march-
ing cubes. CO3D comes with sparse point-cloud recon-
struction of the objects obtained using multi-view geome-
try. For evaluation, we sample points from the reconstructed
meshes and align them optimally with the ground truth point
cloud by first estimating a scaling factor and then using Iter-
ated Closest Point (ICP). Finally, we compute F-score with
threshold 0.05 to measure the distance between the pre-
dicted and ground truth point clouds. Results are shown
in Tab. 1.
In order to evaluate the quality of the reproduced appear-
ance, we also compare novel-view renderings from our and
their method (Tab. 1). Ideally, these renderings should pro-
Figure 5. Qualitative comparison with prior work. We show
the results of our method and the category-level method of [59]
on real-world images from the CO3D dataset [38]. Each pair of
rows show two novel views produced by [59] and our method. For
[59], we use category-specific models for each CO3D category
(in this case, motorcycles, cups, and backpacks). Despite not re-
quiring any category-specific information, our method is able to
reconstruct objects at a higher level of detail than [59].
Figure 6. A demonstration of multi-modal image reconstruc-
tion. Above, we see our method's ability to generate a diverse set
of object reconstructions given the same input image. In partic-
ular, the method produces different textures on the backsides of
the generated objects, despite all objects matching the input image
from the reference view.
16 resolution levels, a feature dimension of 2, and a maxi-
mum resolution of 2048, trained in a coarse-to-fine manner
as explained above.
The camera for reconstruction is placed looking at the
origin on a sphere of radius 1.8, at an angle of 15deg above
the plane. At each optimization step, we first render from
the reconstruction camera and compute our reconstruction
losses Lrec and Lrec,mask. We then render from a randomly
sampled camera to obtain a novel view, and use this view
for Lsds and Lnormals. We use λimage = 5.0, λmask = 0.5,
and λnormal = 0.5.
Regarding camera sampling, lighting, and shading, we
keep nearly all parameters the same as [33]. This in-
7
Figure 7. A visualization of the effect of single-image textual inversion on reconstruction quality. In each pair of rows, the top row
shows the result of utilizing a standard text prompt for our diffusion-model-based loss (e.g. "An image of a statue of a cat"). The bottom
row shows the result of utilizing a text prompt optimized for the input image in a fully-automatic manner; this textual inversion process
dramatically improves object reconstruction.
Figure 8. Effect of coarse-to-fine training. The top row of each
pair is generated by optimizing all levels of a multi-resolution 3D
feature grid from the first optimization step, whereas he bottom
row is optimized in a coarse-to-fine manner.
duce views that are visually close to the real views. In or-
der to test this hypothesis, we check whether the generated
views are close or not to the other views given in CO3D. We
then report the CLIP embedding similarity of the generated
images with respect to the closest CO3D view available (i.e.
the view with maximum similarity).
4.3. Qualitative results
Figure 9. Effect of normal smoothness on reconstruction qual-
ity. Each pair of rows show the reconstruction without and with
the normal smoothness regularization term equation 5. The regu-
larizer improves the visual appearance of surfaces and reduces the
number of irregularities on the surface of reconstructed objects. In
most cases, we also find that it helps to improve the overall realism
of the reconstructed shape.
sible solutions by repeating the reconstruction several times,
starting from the same input image. There is little variance
in the reconstructions of the front of the object, but quite a
large variance for its back, as expected.
Figure 4 shows additional qualitative results from multi-
ple viewpoints. Having a single image of an object means
that several 3D reconstructions are possible. Figure 6 ex-
plores the ability of RealFusion to sample the space of pos-
Figure 11 shows two typical failure modes of RealFu-
sion: in some cases the model fails to converge, and in oth-
ers it copies the front view to the back of the object, even if
this is not semantically correct.
8
to-fine optimization reduces the presence of low-level ar-
tifacts and results in smoother, visually pleasing surfaces.
Fig. 10 shows that using Stable Diffusion works signifi-
cantly better than relying on an alternative such as CLIP.
5. Conclusions
We have introduced RealFusion, a new approach to ob-
tain full 360◦ photographic reconstructions of any object
given a single image of it. Given an off-the-shelf diffusion
model trained using only 2D images and no special super-
vision for 3D reconstruction, as well as a single view of
the target object, we have shown how to select the model
prompt to imagine other views of the object. We have used
this conditional prior to learn an efficient, multi-scale radi-
ance field representation of the reconstructed object, incor-
porating an additional regularizer to smooth out the recon-
structed surface. The resulting method can generate plausi-
ble 3D reconstructions of objects captured in the wild which
are faithful to the input image. Future works include spe-
cializing the diffusion model for the task of new-view syn-
thesis and incorporating dynamics to reconstruct animated
3D scenes.
Ethics. We use the CO3D dataset in a manner compatible
with their terms. CO3D does not contain personal infor-
mation. Please see https://www.robots.ox.ac.
uk/ ̃vedaldi/research/union/ethics.html
for further information on ethics.
Acknowledgments. L. M. K. is supported by the Rhodes
Trust. A. V., I. L. and C.R. are supported by ERC-UNION-
CoG-101001212. C. R.
is also supported by VisualAI
EP/T028572/1.
References
[1] David Bau, Jun-Yan Zhu, Jonas Wulff, William S. Peebles,
Bolei Zhou, Hendrik Strobelt, and Antonio Torralba. Seeing
what a GAN cannot generate. In Proc. ICCV, 2019. 2
[2] Mathilde Caron, Hugo Touvron, Ishan Misra, Herv ́e J ́egou,
Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerg-
ing properties in self-supervised vision transformers.
In
Proc. ICCV, 2021. 15
[3] Eric R. Chan, Connor Z. Lin, Matthew A. Chan, Koki
Nagano, Boxiao Pan, Shalini De Mello, Orazio Gallo,
Leonidas J. Guibas, Jonathan Tremblay, Sameh Khamis,
Tero Karras, and Gordon Wetzstein. Efficient geometry-
aware 3D generative adversarial networks. In Proc. CVPR,
2022. 2, 3
[4] Angel X. Chang, Thomas A. Funkhouser, Leonidas J.
Guibas, Pat Hanrahan, Qi-Xing Huang, Zimo Li, Silvio
Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong
Xiao, Li Yi, and Fisher Yu. ShapeNet an information-rich 3d
model repository. arXiv.cs, abs/1512.03012, 2015. 3
[5] Christopher B. Choy, Danfei Xu, JunYoung Gwak, Kevin
Chen, and Silvio Savarese. 3d-r2n2: A unified approach
Figure 10. Comparing Stable Diffusion and CLIP priors.
Results from two different priors: Stable Diffusion [41] and
CLIP [34]. Stable Diffusion yields much higher-quality recon-
structions, capturing more plausible object shapes.
Figure 11. Failure cases. In the first two examples, the model
simply fails to properly reconstruct the object geometry, and pro-
duces a semi-transparent scene which lacks a well-defined geom-
etry. The third case is different in that the geometry is highly re-
alistic, but the texture paints two Pikachu faces, one on each side
of the object; this problem is sometimes called the Janus problem,
after the two-faced Roman god.
4.4. Analysis and Ablations
One of the key components of RealFusion is our use of
single-image textual inversion, which allows the model to
correctly imagine novel views of a specific object. Figure 7
shows that this component plays indeed a critical role in the
quality of the reconstructions. Without texual inversion, the
model often reconstructs the backside of the object in the
form of a generic instance from the object category. For ex-
ample, the backside of the cat statue in the top row of Fig. 7
is essentially a different statue of a more generic-looking
cat, whereas the model trained with textual inversion resem-
bles the true object from all angles.
Other components of the model are also significant.
Figure 9 shows that the normal smoothness regularizer
of Eq. (5) results in smoother, more realistic meshes and
reduces the number of artifacts. Figure 8 shows that coarse-
9
for single and multi-view 3d object reconstruction. In Proc.
ECCV, 2016. 3
[6] Kangle Deng, Andrew Liu, Jun-Yan Zhu, and Deva Ra-
manan. Depth-supervised NeRF: Fewer views and faster
training for free. In Proceedings of the IEEE/CVF Confer-
ence on Computer Vision and Pattern Recognition (CVPR),
June 2022. 13
[7] Prafulla Dhariwal and Alexander Nichol. Diffusion models
beat gans on image synthesis. In Advances in Neural Infor-
mation Processing Systems, volume 34, pages 8780–8794,
2021. 3, 4, 5
[8] Christiane Fellbaum. WordNet: An Electronic Lexical
Database. Bradford Books, 1998. 13
[9] Matheus Gadelha, Subhransu Maji, and Rui Wang. 3D shape
induction from 2D views of multiple objects. In arXiv, 2016.
2, 3
[10] Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patash-
nik, Amit H Bermano, Gal Chechik, and Daniel Cohen-
Or. An image is worth one word: Personalizing text-to-
image generation using textual inversion. arXiv preprint
arXiv:2208.01618, 2022. 5, 13
[11] R. I. Hartley and A. Zisserman. Multiple View Geometry
in Computer Vision. Cambridge University Press, ISBN:
0521540518, second edition, 2004. 2
[12] Philipp Henzler, Niloy J. Mitra, and Tobias Ritschel. Escap-
ing plato's cave using adversarial training: 3D shape from
unstructured 2D image collections. In Proc. ICCV, 2019. 2,
3
[13] Philipp Henzler, Jeremy Reizenstein, Patrick Labatut, Ro-
man Shapovalov, Tobias Ritschel, Andrea Vedaldi, and
David Novotny. Unsupervised learning of 3d object cate-
gories from videos in the wild. In Proceedings of the IEEE
Conference on Computer Vision and Pattern Recognition
(CVPR), 2021. 3
[14] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffu-
sion probabilistic models. In Proc. NeurIPS, 2020. 3
[15] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising dif-
In Advances in Neural Infor-
fusion probabilistic models.
mation Processing Systems, volume 33, pages 6840–6851,
2020. 4
[16] Ajay Jain, Ben Mildenhall, Jonathan T. Barron, Pieter
Abbeel, and Ben Poole. Zero-shot text-guided object gen-
eration with dream fields. In Proc. CVPR, 2022. 3
[17] Ajay Jain, Matthew Tancik, and Pieter Abbeel. Putting nerf
on a diet: Semantically consistent few-shot view synthesis.
In Proc. ICCV, 2021. 3
[18] Ajay Jain, Matthew Tancik, and Pieter Abbeel. Putting nerf
on a diet: Semantically consistent few-shot view synthe-
sis. In Proceedings of the IEEE/CVF International Confer-
ence on Computer Vision (ICCV), pages 5885–5894, October
2021. 13
[19] Wonbong Jang and Lourdes Agapito. CodeNeRF: Disentan-
In Proc.
gled neural radiance fields for object categories.
ICCV, 2021. 3
[20] Nasir Mohammad Khalid, Tianhao Xie, Eugene Belilovsky,
and Pop Tiberiu. CLIP-Mesh: Generating textured meshes
from text using pretrained image-text models. SIGGRAPH
Asia, 2022. 3
[21] Diederik P Kingma and Jimmy Ba. Adam: A method for
stochastic optimization.
2014. 12, 13
arXiv preprint arXiv:1412.6980,
[22] Jon ́aˇs Kulh ́anek, Erik Derner, Torsten Sattler, and Robert
Babuˇska. ViewFormer: NeRF-free neural rendering from
few images using transformers. In Proc. ECCV, 2022. 3
[23] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Ui-
jlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan
Popov, Matteo Malloci, Alexander Kolesnikov, Tom Duerig,
and Vittorio Ferrari. The open images dataset v4: Unified
image classification, object detection, and visual relationship
detection at scale. IJCV, 2020. 7
[24] Chen-Hsuan Lin, Chaoyang Wang, and Simon Lucey. SDF-
SRN: learning signed distance 3d object reconstruction from
static images. In Hugo Larochelle, Marc'Aurelio Ranzato,
Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin,
editors, Proc. NeurIPS, 2020. 3
[25] Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo
numerical methods for diffusion models on manifolds. In In-
ternational Conference on Learning Representations, 2021.
3, 4
[26] Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik,
Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. NeRF:
Representing scenes as neural radiance fields for view syn-
thesis. In Proc. ECCV, 2020. 3
[27] Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik,
Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. Nerf:
Representing scenes as neural radiance fields for view syn-
thesis. In ECCV, 2020. 13
[28] Norman M ̈uller, Andrea Simonelli, Lorenzo Porzi,
Samuel Rota Bul`o, Matthias Niessner,
and Peter
Kontschieder. Autorf: Learning 3d object radiance fields
from single view observations. CoRR, abs/2204.03593,
arXiv.cs. 3
[29] Thomas Muller, Alex Evans, Christoph Schied, and Alexan-
der Keller. Instant neural graphics primitives with a multires-
olution hash encoding. ACM Trans. Graph., 41(4):102:1–
102:15, July 2022. 2, 5, 6
[30] Thu Nguyen-Phuoc, Chuan Li, Lucas Theis, Christian
Richardt, and Yong-Liang Yang. HoloGAN: Unsupervised
learning of 3D representations from natural images. arXiv.cs,
abs/1904.01326, 2019. 2, 3
[31] Thu Nguyen-Phuoc, Christian Richardt, Long Mai, Yong-
Liang Yang, and Niloy J. Mitra. Blockgan: Learning 3d
object-aware scene representations from unlabelled images.
In Proc. NeurIPS, 2020. 2, 3
[32] Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav
Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and
Mark Chen. Glide: Towards photorealistic image generation
and editing with text-guided diffusion models. arXiv preprint
arXiv:2112.10741, 2021. 3
[33] Ben Poole, Ajay Jain, Jonathan T. Barron, and Ben Milden-
hall. Dreamfusion: Text-to-3d using 2d diffusion. arXiv.cs,
abs/2209.14988, 2022. 2, 3, 7, 12, 13, 14
[34] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya
Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry,
Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen
Krueger, and Ilya Sutskever. Learning transferable visual
models from natural language supervision, 2021. 2, 9
[35] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya
10
Density-Distance fields. In Proc. ECCV, 2022. 3
[49] Dor Verbin, Peter Hedman, Ben Mildenhall, Todd Zickler,
Jonathan T Barron, and Pratul P Srinivasan. Ref-nerf: Struc-
tured view-dependent appearance for neural radiance fields.
In 2022 IEEE/CVF Conference on Computer Vision and Pat-
tern Recognition (CVPR), pages 5481–5490. IEEE, 2022. 12
[50] Peng Wang, Lingjie Liu, Yuan Liu, Christian Theobalt, Taku
Komura, and Wenping Wang. NeuS: Learning neural im-
plicit surfaces by volume rendering for multi-view recon-
struction. arXiv.cs, abs/2106.10689, 2021. 3
[51] Qianqian Wang, Zhicheng Wang, Kyle Genova, Pratul P.
Srinivasan, Howard Zhou, Jonathan T. Barron, Ricardo
Martin-Brualla, Noah Snavely, and Thomas A. Funkhouser.
Ibrnet: Learning multi-view image-based rendering. In Proc.
CVPR, 2021. 3
[52] Daniel Watson, William Chan, Jonathan Ho, and Moham-
mad Norouzi. Learning fast samplers for diffusion models
In International
by differentiating through sample quality.
Conference on Learning Representations, 2021. 3
[53] Daniel Watson, William Chan, Ricardo Martin-Brualla,
Jonathan Ho, Andrea Tagliasacchi,
and Mohammad
Norouzi. Novel view synthesis with diffusion models.
arXiv.cs, abs/2210.04628, 2022. 3
[54] Jiajun Wu, Chengkai Zhang, Tianfan Xue, Bill Freeman, and
Josh Tenenbaum. Learning a probabilistic latent space of ob-
ject shapes via 3D generative-adversarial modeling. In Proc.
NeurIPS, 2016. 2, 3
[55] Haozhe Xie, Hongxun Yao, Shengping Zhang, Shangchen
Zhou, and Wenxiu Sun. Pix2vox++: Multi-scale context-
aware 3d object reconstruction from single and multiple im-
ages. Int. J. Comput. Vis., 128(12), 2020. 3
[56] Dejia Xu, Yifan Jiang, Peihao Wang, Zhiwen Fan, Humphrey
Shi, and Zhangyang Wang. Sinnerf: Training neural radiance
fields on complex scenes from a single image. 2022. 13
[57] Farid Yagubbayli, Alessio Tonioni, and Federico Tombari.
Legoformer: Transformers for block-by-block multi-view 3d
reconstruction. arXiv.cs, abs/2106.12102, 2021. 3
[58] Yufei Ye, Shubham Tulsiani,
and Abhinav Gupta.
CoRR,
Shelf-supervised mesh prediction in the wild.
abs/2102.06195, 2021. 2, 7
[59] Yufei Ye, Shubham Tulsiani, and Abhinav Gupta. Shelf-
supervised mesh prediction in the wild. In Computer Vision
and Pattern Recognition (CVPR), 2021. 7
[60] Alex Yu, Vickie Ye, Matthew Tancik, and Angjoo Kanazawa.
pixelnerf: Neural radiance fields from one or few images.
In Proceedings of the IEEE/CVF Conference on Computer
Vision and Pattern Recognition, pages 4578–4587, 2021. 3,
13
[61] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman,
and Oliver Wang. The unreasonable effectiveness of deep
features as a perceptual metric. In CVPR, 2018. 14
Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry,
Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen
Krueger, and Ilya Sutskever. Learning transferable visual
models from natural language supervision. In Proc. ICML,
volume 139, pages 8748–8763, 2021. 3
[36] Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott
Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya
arXiv
Sutskever.
Zero-shot
preprint arXiv:2102.12092, 2021. 2
text-to-image generation.
[37] Ren ́e Ranftl, Katrin Lasinger, David Hafner, Konrad
Schindler, and Vladlen Koltun. Towards robust monocular
depth estimation: Mixing datasets for zero-shot cross-dataset
transfer. arXiv:1907.01341, 2019. 14
[38] Jeremy Reizenstein, Roman Shapovalov, Philipp Henzler,
Luca Sbordone, Patrick Labatut, and David Novotny. Com-
mon objects in 3d: Large-scale learning and evaluation of
In International Con-
real-life 3d category reconstruction.
ference on Computer Vision, 2021. 3, 7
[39] Jeremy Reizenstein, Roman Shapovalov, Philipp Henzler,
Luca Sbordone, Patrick Labatut, and David Novotny. Com-
mon Objects in 3D: Large-scale learning and evaluation of
real-life 3D category reconstruction. In Proc. CVPR, 2021.
7
[40] Robin Rombach, Andreas Blattmann, Dominik Lorenz,
Patrick Esser, and Bj ̈orn Ommer. High-resolution image
synthesis with latent diffusion models. In IEEE Conference
on Computer Vision and Pattern Recognition, pages 10684–
10695, 2022. 2
[41] Robin Rombach, Andreas Blattmann, Dominik Lorenz,
Patrick Esser, and Bj ̈orn Ommer. High-resolution image syn-
thesis with latent diffusion models. In Proc. CVPR, 2022. 3,
6, 9, 12, 17
[42] Chitwan Saharia, William Chan, Saurabh Saxena, Lala
Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed
Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi,
Rapha Gontijo Lopes, et al. Photorealistic text-to-image
diffusion models with deep language understanding. arXiv
preprint arXiv:2205.11487, 2022. 2
[43] Christoph Schuhmann, Romain Beaumont, Richard Vencu,
Cade Gordon, Ross Wightman, Mehdi Cherti, Theo
Coombes, Aarush Katta, Clayton Mullis, Mitchell Worts-
man, et al. Laion-5b: An open large-scale dataset for
training next generation image-text models. arXiv preprint
arXiv:2210.08402, 2022. 2, 6
[44] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denois-
ing diffusion implicit models. In International Conference
on Learning Representations, 2020. 4
[45] Yang Song and Stefano Ermon. Generative modeling by es-
timating gradients of the data distribution. In Proc. NeurIPS,
2019. 3
[46] Yang Song and Stefano Ermon.
Improved techniques for
training score-based generative models. Advances in neural
information processing systems, 33:12438–12448, 2020. 3
[47] Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Ab-
hishek Kumar, Stefano Ermon, and Ben Poole. Score-based
generative modeling through stochastic differential equa-
tions. In Proc. ICLR, 2021. 3
[48] Itsuki Ueda, Yoshihiro Fukuhara, Hirokatsu Kataoka, Hi-
roaki Aizawa, Hidehiko Shishido, and Itaru Kitahara. Neural
11
A. Implementation Details
In this section, we provide full implementation details
which were omitted from the main text due to space con-
straints. Most of these details follow [33], but a few are
slightly modified.
Shading. We consider three different types of shading:
albedo, diffuse, and textureless. For albedo, we simply ren-
der the RGB color of each ray as given by our model:
I(u) = Iρ(u) = R(u; σ, c)
For diffuse, we also compute the surface normal n as the
normalized negative gradient of the density with respect to
u. Then, given a point light l with color lρ and an ambient
light with color la, we render
I(u) = Iρ(u) ◦ (lρ ◦ max(0, n *
l−u
||l−u|| + la))
For textureless, we use the same equation with Iρ(u) re-
placed by white (1, 1, 1).
For the reconstruction view, we only use albedo shad-
ing. For the random view (i.e. the view used for the prior
objectives), we use albedo shading for the first 1000 steps
of training by setting la = 1.0 and lρ = 0.0. Afterwards
we use la = 0.1 and lρ = 0.9, and we select stochastically
between albedo, diffuse, and textureless with probabilities
0.2, 0.4, and 0.4, respectively.
We obtain the surface normal using finite differences:
n =
1
2 * (cid:15)
I(u + (cid:15)x) − I(u − (cid:15)x)
I(u + (cid:15)y) − I(u − (cid:15)y)
I(u + (cid:15)z) − I(u − (cid:15)z)
where (cid:15)x = ((cid:15), 0, 0), (cid:15)y = (0, (cid:15), 0), and (cid:15)z = (0, 0, (cid:15))
Density bias. As in [33], we add a small Gaussian blob of
density to the origin of the scene in order to assist with the
early stages of optimization. This density takes the form
σinit(μ) = λ * e−||μ||2/(2ν2)
with λ = 5 and ν = 0.2.
Camera. The fixed camera for reconstruction is placed at
a distance of 1.8 from the origin, oriented toward the ori-
gin, at an elevation of 15◦ above the horizontal plane. For
a small number of scenes in which the object of interest
is clearly seen from overhead, the reconstruction camera is
placed at an elevation of 40◦.
The camera for the prior objectives is sampled randomly
at each iteration.
Its distance from the origin is sampled
uniformly from [1.0, 1.5]. Its azimuthal angle is sampled
uniformly at random from the 360◦ around the object. Its el-
evation is sampled uniformly in degree space from −10◦ to
90◦ with probability 0.5 and uniformly on the upper hemi-
sphere with probability 0.5. The field of view is uniformly
12
sampled between 40 and 70. The camera is oriented toward
the origin. Additionally, every tenth iteration, we place the
prior camera near the reconstruction camera:
its location
is sampled from the prior camera's location perturbed by
Gaussian noise with mean 0 and variance 1.
Lighting. We sample the position of the point light by
adding a noise vector η ∼ N (0, 1) to the position of the
prior camera.
View-Dependent Prompt. We add a view-dependent suf-
fix to our text prompt based on the location of the prior cam-
era relative to the reconstruction camera. If the prior camera
is placed at an elevation of above 60◦, the text prompt re-
ceives the suffix "overhead view." If it is at an elevation
below 0◦, the text receives "bottom view." Otherwise, for
azimuthal angles of ±30◦, ±30 − 90◦, or ±90 − 180◦ in
either direction of the reconstruction camera, it receives the
suffices "front view," "side view," or "bottom view," respec-
tively.
InstantNGP. Our InstantNGP parameterizes the density
and albedo inside a bounding box around the origin with
side length 0.75. It is a multi-resolution feature grid with 16
levels. With coarse-to-fine training, only the first 8 (lowest-
resolution) levels are used during the first half of training,
while the others are masked with zeros. Each feature grid
has dimensionality 2. The features from these grids are
stacked and fed to a 3-layer MLP with 64 hidden units.
Rendering and diffusion prior. We render at resolution
96px. Since Stable Diffusion [41] is designed for images
with resolution 512px, we upsample renders to 512px be-
fore passing them to the Stable Diffusion latent space en-
coder (i.e.
the VAE). We add noise in latent space, sam-
pling t ∼ U(0.02, 0.98). We use classifier-free guidance
strength 100. We found that results with classifier-free guid-
ance strength above 30 produced good results; below 30 led
to many more geometric deformities. Although we do not
backpropagate through the Stable Diffusion UNet for LSDS,
we do backpropagate through the latent space encoder.
Optimization. We optimize using the Adam [21] opti-
mizer with learning rate 1e − 3 for 5000 iterations. The
optimization process takes approximately 45 minutes on a
single V100 GPU.
Background model. For our background model, we use
a two-layer MLP which takes the viewing direction as in-
put. This model is purposefully weak, such that the model
cannot trivially optimize its objectives by using the back-
ground.
Additional regularizers. We additionally employ two
regularizers on our density field. The first is the orientation
loss from Ref-NeRF [49], also used in DreamFusion [33],
for which we use λorient = 0.01. The second is an entropy
loss which encourages points to be either fully transparent
or fully opaque: Lentropy = (w * log2(w) − (1 − w) * log2(1 −
t r a n s f o r m = T . Compose ( [
T . RandomApply ( [ T . R a n d o m R o t a t i o n ( d e g r e e s =10 ,
T . RandomResizedCrop ( i m a g e s i z e ,
T . RandomApply ( [ T . C o l o r J i t t e r ( 0 . 0 4 , 0 . 0 4 , 0 . 0 4 , 0 . 0 4 ) ] , p = 0 . 7 5 ) ,
T . R a n d om G r a ys c a l e ( p = 0 . 1 0 ) ,
T . RandomApply ( [ T . G a u s s i a n B l u r ( 5 ,
T . R a n d o m H o r i z o n t a l F l i p ( ) ,
( 0 . 1 , 2 ) ) ] , p = 0 . 1 0 ) ,
s c a l e = ( 0 . 7 0 , 1 . 3 ) ) ,
f i l l = 2 5 5 ) ] , p = 0 . 7 5 ) ,
] )
Figure 12. PyTorch code for the image augmentations used for single-image textual inversion.
w) where w is the cumulative sum of density weights com-
puted as part of the NeRF rendering equation (Equation 1).
Single-image textual inversion. Our single-image tex-
tual inversion step, which is a variant of textual inver-
sion [10], entails optimizing a token e introduced into the
diffusion model text encode to match an input image. The
key to making this optimization successful given only a sin-
gle image is the use of heavy image augmentations, shown
in Fig. 12. We optimize using these augmentations for a to-
tal of 3000 steps using the Adam optimizer [21] with image
size 512px, batch size 16, learning rate 5 * 10−4, and weight
decay 1 * 10−2.
The embedding e can be initialized either randomly,
manually (by selecting a token from the vocabulary that
matches the object), or using an automated method.
One automated method that we found to be successful
was to use CLIP (which is also the text encoder of the Sta-
ble Diffusion model) to infer a starting token to initialize
the inversion procedure. For this automated procedure, we
begin by considering the set of all tokens in the CLIP text
tokenizer which are nouns, according to the WordNet [8]
database. We use only nouns because we aim to reconstruct
objects, not reproduce styles or visual properties. We then
compute text embeddings for captions of the form "An im-
age of a (cid:104)token(cid:105)" using each of these tokens. Separately,
we compute the image embedding for the input image. Fi-
nally, we take the token whose caption is most similar to the
image embedding as initialization for our textual inversion
procedure.
We use the manual initialization method for the exam-
ples in the main paper and we use the automated initializa-
tion method for the examples in the supplemental material
(i.e. those included below).
B. Method diagram
We provide a diagram illustrating our method in Fig. 2.
C. Additional Qualitative Examples
In Fig. 13, we show additional examples of reconstruc-
tions from our model. We see that our method is often able
to reconstruct plausible geometries and object backsides.
D. Additional Comparisons
We provide additional comparisons to recent single-view
reconstruction methods on the lego scene from the synthetic
NeRF [27] dataset. We compare on the special test set cre-
ated by SinNeRF [56], which consists of 60 views very
close to the reference view. We emphasize that our method
is not tailored to this setting, whereas the other methods are
designed specifically for it. For example, some other meth-
ods work by warping the input image, which only performs
well for novel views close to the reference view.
Table 2. Novel view synthesis comparison. A comparison of
RealFusion against recent single-view reconstruction methods on
the task of novel view synthesis on the synthetic lego scene from
NeRF [27]. These numbers are computed on the test set rendered
by SinNeRF [56], which contains 60 views very close to the ref-
erence view. This is a setting highly favorable to methods that use
depth supervision, such as DS-NeRF and SinNeRF .
Depth?
PSNR
SSIM LPIPS
PixelNeRF [60]
DietNeRF [18]
DS-NeRF [6]
SinNeRF [56]
RealFusion
(cid:51)
(cid:51)
14.3
15.0
16.6
21.0
16.5
0.72
0.72
0.77
0.82
0.76
0.22
0.20
0.16
0.09
0.25
E. Text-to-Image-to-3D
In this section, we explore the idea of reconstructing a
3D object from a text prompt alone by first using the text
prompt to generate an image, and then reconstructing this
image using RealFusion.
We show examples of text-to-image-to-3D generation in
Fig. 14.
Compared to the one-step procedure of [33] (i.e.
text-
to-3D), this two-step procedure (i.e.
text-to-image-to-3D)
has the advantage that it may be easier for users to control.
Under our setup, users can first sample a large number of
images from a 2D diffusion model such as Stable Diffusion,
13
select their desired image, and then lift it to 3D using Real-
Fusion. It is possible that this setup could help help address
the issue of diversity of generation discussed in [33]. Addi-
tionally, tn this setting, we find that it is usually not neces-
sary to use single-image textual inversion, since the images
sampled in the first stage are already extremely well-aligned
with their respective prompts.
F. Analysis of Failure Cases
In Fig. 15, we show additional examples of failure cases
from our model. Below, we analyzed what we find to be our
three most common failure cases. The techniques we ap-
ply in RealFusion (single-image textual inversion, normals
smoothing, and coarse-to-fine training) make these failure
cases less frequent and less severe, but they still occur on
various images.
Neural fields lacking well-defined geometry. One fail-
ure case of our method consists of the generation of a semi-
transparent neural field which does not have a well-defined
geometry. These fields tend to look like the input image
when seen from the reference viewpoint, but do not resem-
ble plausible objects when seen from other viewpoints. We
note that this behavior is extremely common when using
CLIP as a prior model, but it occurs occasionally even when
using Stable Diffusion and LSDS.
Floaters. Another failure case involves "floaters," or dis-
connected parts of the scene which appear close to the cam-
era. These floaters sometimes appear in front of the refer-
ence view as to make the corresponding render look like the
input image. Without image-specific prompts, these floaters
are a very big issue, appearing in the majority of recon-
structions. When using image-specific prompts, the issue
of floaters is greatly (but not entirely) alleviated.
The Janus Problem. Named after the two-faced Roman
god Janus, the "Janus problem" refers to reconstructions
which have two or more faces. This problem arises because
the loss function tries to make the render of every view look
like the input image, at least to a certain extent.
Our use of view-specific prompting partially alleviates
this issue. For example, when we render an image of a
panda from the back, we optimize using the text prompt
"An image of a (cid:104)object(cid:105), back view", where "(cid:104)object(cid:105)" is
our image-specific token corresponding to the image of a
panda. However, even with view-specific prompting, this
problem still occurs. This problem is visible with the panda
in Fig. 14 (row 2). We note that this problem is not unique
to our method; it can also be seen with [33] (see Figure 9,
last row).
G. Unsuccessful Experiments and Regulariza-
tion Losses
In the process of developing our method, we exper-
imented with numerous ideas, losses, and regularization
terms which were not included in our final method because
they either did not improve reconstruction quality or did not
improve it enough to justify their complexity. Here, we
describe some of these ideas for the benefit of future re-
searchers working on this problem.
Using DM for reconstruction loss. One idea we tried in-
volved using the diffusion model within our reconstruction
objective as well as our prior objective. This involved a
modified version of LSDS in which we compared the noise
predicted by the diffusion model for our noisy rendered im-
age to the noise predicted by the diffusion model for a noisy
version of our input image. We found that with this loss we
were able to reconstruct the input image to a certain degree,
but that we did not match the exact input image colors or
textures.
Normals smoothing in 3D. Our normals smoothing term
operates in 2D, using normals rendered via the NeRF equa-
tion. We also tried different ways of smoothing normals in
3D. However, possibly due to our grid-based radiance field
and/or our finite difference-based normals computation, we
found that these regularization terms were all very noisy and
harmful to reconstruction quality.
Using monocular depth. We tried incorporating monoc-
ular depth predictions into the pipeline, using pre-trained
monocular depth networks such as MiDaS [37]. Specifi-
cally, we enforced that the depth rendered from the refer-
ence view matched the depth predicted by MiDaS for the in-
put image. We found that this additional depth loss in most
instances did not noticeably improve reconstruction quality
and in some cases was harmful. Nonetheless, these results
are not conclusive and future work could pursue other ways
of integrating these components.
Using LPIPS and SSIM reconstruction losses. We tried
using LPIPS [61] and SSIM losses in place of our L2 recon-
struction loss. We found that LPIPS performed similarly to
L2, but incurred additional computation and memory usage.
We found that SSIM without either L2 and LPIPS resulted
in worse reconstruction quality, but that it yielded fine re-
sults when combined with them. We did not include it in
our final objective for the sake of simplicity.
Rendering at higher resolutions. Since Stable Diffusion
operates on images of resolution 512px, it is conceivable
that rendering at higher resolution would be benefitial with
regard to the prior loss. However, we found no noticeable
difference in quality when rendering at higher resolutions
than 96px or 128px. For computational purposes, we used
resolution 96px for all experiments in the main paper.
14
Using DINO-based prior losses. Similarly to the CLIP
prior loss, one could imagine using other networks to en-
courage renders from novel views to be semantically sim-
ilar to the input image. Due to the widespread success of
the DINO [2] models in unsupervised learning, we tried
using DINO feature losses in addition to the Stable Diffu-
sion prior loss. Specifically, for each image rendered from
a novel view, we computed a DINO image embedding and
maximized its cosine similarity with the DINO image em-
bedding of the reference image. We found that this did not
noticeably improve or degrade performance. For purposes
of simplicity, we did not include it.
H. Links to Images for Qualitative Results
For our qualitative results, we primarily use images from
datasets such as Co3D. We also use a small number of im-
ages sourced directly from the web to show that our method
works on uncurated web data. We provide links to all of
these images on our project website.
15
Figure 13. Additional qualitative examples. This figure presents additional qualitative examples from our model. The first column shows
the input image. The second column shows the reconstruction from the reference viewpoint. The following columns show renders from
novel viewpoints, demonstrating that our model is able to reconstruct plausible object shapes.
16
Figure 14. Text-to-Image-to-3D. This figure presents examples from our model using images generated directly from text prompts using
Stable Diffusion [41]. The images were generated with the prompt "An image of a
" where the blank space is replaced by "deer",
"flamingo", "hen", "pencil drawing of a horse", "squirrel", "dolphin", and "unicorn", respectively. The results demonstrate that our
method is able to reconstruct plausible object shapes even from synthetic images.
17
Figure 15. Additional failure cases. This figure presents additional failure cases from our model. The first column shows the input image.
The second column shows the reconstruction from the reference viewpoint. The following columns show renders from novel viewpoints,
which make clear why these examples are failure cases. Note that some examples (for example, the panda bear in the second row and the
hamster in the last row) suffer from the Janus problem.
18
Figure 16. A visualization of the effect of single-image textual inversion on reconstruction quality. An expanded version of Figure
7 in the main paper showing the effect of single-image textual inversion on reconstruction quality. The top row in each pair of rows
shows reconstruction results using a standard text prompt, whereas the bottom row shows reconstruction results using single-image textual
inversion. The novel views are chosen to show the back side of the object; note how the examples without textual inversion look like
highly-generic versions of the objects in the input image.
19
Figure 17. An example of variation across random seeds for a challenging input image. As described in the main paper, our model is
able to generate multiple reconstructions for a given input image. For this figure, we apply our method (in a text-to-image-to-3D manner)
to a highly challenging image produced by Stable Diffusion from the text prompt "An image of an astronaut riding a horse." We run
reconstruction using two different seeds: one of these (top) yields a reasonable shape, whereas the other is a failure case that does not yield
a reasonable shape. This example both highlights the ability of our method to reconstruct highly challenging shapes and also demonstrates
how future work could aim to improve reconstruction consistency and quality.
20
|
|
http://arxiv.org/abs/2302.10655v1 | 2023-02-21T13:12:57 | 2023-02-21T13:12:57 | Density Ratio Estimation and Neyman Pearson Classification with Missing
Data | Density Ratio Estimation (DRE) is an important machine learning technique
with many downstream applications. We consider the challenge of DRE with
missing not at random (MNAR) data. In this setting, we show that using standard
DRE methods leads to biased results while our proposal (M-KLIEP), an adaptation
of the popular DRE procedure KLIEP, restores consistency. Moreover, we provide
finite sample estimation error bounds for M-KLIEP, which demonstrate minimax
optimality with respect to both sample size and worst-case missingness. We then
adapt an important downstream application of DRE, Neyman-Pearson (NP)
classification, to this MNAR setting. Our procedure both controls Type I error
and achieves high power, with high probability. Finally, we demonstrate
promising empirical performance both synthetic data and real-world data with
simulated missingness. | [
"Josh Givens",
"Song Liu",
"Henry W J Reeve"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10655v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10655v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "stat.ML",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"stat.ML",
"cs.LG",
"stat.ME"
] | 3
2
0
2
b
e
F
1
2
]
L
M
.
t
a
t
s
[
1
v
5
5
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Density Ratio Estimation and Neyman Pearson Classification with
Missing Data
Josh Givens
Song Liu
University of Bristol
Henry W J Reeve
Abstract
Density Ratio Estimation (DRE) is an important machine learning technique with many downstream
applications. We consider the challenge of DRE with missing not at random (MNAR) data. In this setting, we
show that using standard DRE methods leads to biased results while our proposal (M-KLIEP), an adaptation
of the popular DRE procedure KLIEP, restores consistency. Moreover, we provide finite sample estimation
error bounds for M-KLIEP, which demonstrate minimax optimality with respect to both sample size and
worst-case missingness. We then adapt an important downstream application of DRE, Neyman-Pearson
(NP) classification, to this MNAR setting. Our procedure both controls Type I error and achieves high
power, with high probability. Finally, we demonstrate promising empirical performance both synthetic data
and real-world data with simulated missingness.
1 INTRODUCTION
Density Ratio estimation (DRE) is the problem of estimating the ratio between two probability density functions
(PDFs). DRE's ability to characterise the relationship between two PDFs naturally lends itself to many appli-
cations such as outlier detection (Azmandian et al., 2012), Generative Adversarial Networks (GANs) (Nowozin
et al., 2016), and general binary classification. One issue with DRE is that it is especially sensitive to missing
data due to the large impact a "few key points" can have on the procedure (Liu et al., 2017). While there are a
vast number of DRE approaches (Sugiyama et al., 2008, 2010; Kanamori et al., 2009; Choi et al., 2021), none of
them explicitly account for the case of missing data. Some work has been done regarding the impact of missing
data on DRE (Josse et al., 2019), and while this work does explore a wide variety of missing data methods it
does so while assuming the data to be missing at random (MAR). There are many applications in which such
an assumption is unrealistic and the probability of an observation being missing depends in some way on the
value of the observation itself leading to missing not at random data (MNAR). For example, many measuring
instruments are more likely to err when attempting to measure more extreme values, while in questionnaires,
participants are less likely to answer a question if they deem their answer to be embarrassing or unfavourable.
In such a case, naively applying any classic DRE procedure leads to inconsistent estimations.
Classification is an area of statistic with strong ties to density ratio estimation and is also an area where missing
covariates are a common issue. In this paper, we focus on the links of DRE to a particular type of classification
problem called Neyman Pearson (NP) classification. NP classification allows the user to construct a classifier
with a fixed Type I error rate with high probability (Tong, 2013; Tong et al., 2018). This type of classification
has many natural applications as there are often cases where missclassification in one direction is far more
damaging than in the other (for example, disease diagnosis or fault detection). We would like to choose our
classifier to control the error in said direction. Taking missing data into consideration during NP classification is
vital. Without it, our classifier may no longer satisfy our Type I error constraint with high probability. Classic
NP classification works in two steps. First, we estimate the class density ratio between the two classes (hence
motivating the use of DRE), then we define the classification boundary of our classifier to be a level set of our
density ratio estimate, which leads to the satisfaction of our Type I error constraint with high probability (Tong,
2013). To our knowledge, no previous work has been done to make this second stage of NP classification robust
to MNAR data.
There is a large body of research into the phenomenon of MNAR data in more general cases (Sportisse et al.,
2020; Liu and De, 2015; Li et al., 2013; Seaman and White, 2011), however none of this work has explored its use
1
within DRE specifically. Work exists on MNAR data in the covariates of logistic regression (Ward et al., 2020),
a classification method with close ties to DRE. However, Ward et al.'s approach requires more direct knowledge
of the missing data distribution rather than just the probability of an observation being missing conditional on
its value.
Our main contributions are:
• We adapt KLIEP (Sugiyama et al., 2008), a classic DRE procedure, to the MNAR setting using an inverse
probability weighting approach before expanding this technique to any DRE whose objectives comprise
expectations of two different data sets. We give finite sample convergence results for our method and show
minimax rate optimality of this convergence when the conditional probability of being missing is known.
• We provide an adaptation to the NP classification procedure, allowing it to control Type I error even with
MNAR data and show finite sample power convergence results for our adaptation when the conditional
probability of being missing is known.
We also provide extensions to our DRE approaches, which allow us to deal with both partial missingness across
multiple dimensions and learning the missing pattern by querying a subset of the missing samples. Finally, we
assess and compare the efficacy of our proposed methods by testing them on various simulated and real-world
data with synthetic missingness.
2 MISSING DATA & DENSITY RATIO ESTIMATION
2.1 Motivation
Density Ratio Estimation (DRE) is a versatile tool with many downstream applications such as binary classifica-
tion (including NP classification, which we will discuss in Section 3.4), GANs (Nowozin et al., 2016; Ding et al.,
2020), and covariate shift (Sugiyama et al., 2008; Tsuboi et al., 2009). In DRE problems, we want to estimate
r∗ := p1/p0, with p1, p0 the PDFs for two distributions. DRE approaches estimate r∗ using IID samples from
these two distributions. Existing DRE approaches are designed to handle fully observed data sets. However,
when observations are missing, these approaches do not apply straightforwardly.
DRE requires two sets of observations. When two samples are collected at different times under different contexts,
they are especially susceptible to different missing patterns. An example is binary classification for diagnosing
an illness. In this setting, it is natural to expect that samples collected from healthy individuals and patients
will have different MNAR patterns due to privacy concerns.
Within this setting, using both data sets by simply discarding all missing values will lead to a biased classification
and degraded performance.
We aim to make DRE robust to Missing Not at Random (MNAR) datasets. In this setting, an observation's
probability of being missing depends upon that observation's true value and the MNAR pattern is different
between two samples. We formally introduce our problem set-up below.
2.2 Missing Data Framework
Let Z 1, Z 0 be two RVs taking values in measurable space (Z, BZ ) with densities (Radon Nikodym derivatives)
p1 and p0 respectively w.r.t. (with respect to) a measure μ on (Z, BZ ) and assume that p0 is strictly positive.
For ω ∈ {0, 1}, let X ω be a RV taking values in the measurable space (X , BX ) with X := Z ∪ {∅}, BX :=
σ(BZ ∪ {{∅}}) whose distribution is uniquely defined as follows:
P(X ω = ∅|Z ω) := φω(Z)
P(X ω = x|Z ω) := 1{Z ω = x}(1 − φω(Z ω)),
where φω : Z → [0, 1) is a measurable function. Here we take X = ∅ to represent the observation being missing
and thus φ(z) represents the probability of an observation being missing given its "true" value is z. Additionally,
ω be the density of X ω|X ω (cid:54)= ∅ w.r.t μ. Throughout, unless stated otherwise, we assume φ to be known.
let p(cid:48)
For ω ∈ {0, 1} and nω ∈ N we define {Z ω
i=1 to be IID copies of Z ω, X ω respectively and
abbreviate them by Dω := {Z ω
i=1. Finally we define, D := (D1, D0), D(cid:48) := (D(cid:48)
i=1 and {X ω
i }nω
i }nω
ω := {X ω
i=1, D(cid:48)
i }nω
i }nω
1, D(cid:48)
0).
2
2.3 Notations
Throughout we shall adopt the following two conventions for the purpose of brevity. Firstly, if X, Z, or any
other class-specific element is given without a sub/superscript specifying the class, the associated statement is
assumed to hold for both classes where all the elements within the statement have the same class. Secondly,
given a function h : Z → R we implicitly extend h to a function h : X → R by taking h(∅) := 0, unless stated
otherwise.
We now introduce some additional notation. For n ∈ N we let [n] := {1, . . . , n}. For a function h : Z → R we
take (cid:107)h(cid:107)∞:= supz∈Z |h(z)|. Finally, for a RV W in a product space W d and any j ∈ [d] define W (j) to be the
jth coordinate of W and W (−j) = {W (j(cid:48))}j(cid:48)(cid:54)=j. The Kullback-Leibler (KL) between two density functions with
p1 absolutely continuous w.r.t. p0 is defined as
KL(p1|p0) :=
(cid:90)
Z
p1(z) log
p1(z)
p0(z)
μ(dz).
2.4 DRE
The aim of DRE is to estimate r∗ : Z → [0, ∞) defined by r∗ := p1/p0. We will let H be the set of non-negative
measurable functions from Z to [0, ∞) and let G be some subset of H which we intend to use in our approximation
of r∗. Note that while r∗ ∈ H, G may or may not contain the "true" density ratio r∗. We say that G is correctly
specified if r∗ ∈ G and incorrectly specified otherwise. We now introduce a classic approach for estimating r∗
using D.
2.4.1 Kullback-Leibler Importance Estimation Procedure
First proposed in (Sugiyama et al., 2008), Kullback-Leibler Importance Estimation Procedure (KLIEP) is a
popular DRE procedure that minimises the KL divergence between p1 and r * p0. Specifically, it aims to solve
the following optimisation problem:
̃r := arg min
r∈G
subject to :
KL(p1|r * p0)
(cid:90)
r(z)p0(z)μ(dz) = 1.
Z
(1)
As KL-divergence is strictly for use with probability densities, we need to include the additional constraint that
r * p0 integrates out to 1 over Z.
Provided G is closed under positive scalar multiplication, we can re-write ̃r in terms of an unconstrained opti-
misation problem. Specifically, we have ̃r := N −1 * r0 where
r0 := argmax
r∈ ̄G
E[log r(Z 1)] − log E[r(Z 0)]
N := E[r0(Z 0)].
(2)
for some select ̄G ⊆ G = {a * g : a ∈ (0, ∞), g ∈ ̄G}. More details on this alongside the lemma that makes this
possible can be found in the Appendix A.1. Throughout we will be mostly interested in estimating r0 and as
such will refer to 2 as the population KLIEP objective. As we do not know the true distributions of Z 1, Z 0,
we must approximate these expectations with samples from corresponding distributions giving us the sample
KLIEP objective.
In the case of multi-dimensional real-valued data, Z = Rp, we can take ̄G = {rθ : Rp → [0, ∞)|θ ∈ Rd} where
rθ(z) := exp(θ(cid:62)f (z))
for some f : Rp → Rd (Tsuboi et al., 2009; Kanamori et al., 2010; Liu et al., 2017). We refer to this form as the
log-linear form. Under this form, our solution becomes ˆr = ˆN −1rˆθ where
(3)
1
n1
n1(cid:88)
i=1
θ(cid:62)f (Z 1
i ) − log
1
n0
n0(cid:88)
i=1
exp(θ(cid:62)f (Z 0
i ))
(4)
ˆθ :=argmax
θ∈Rd
n0(cid:88)
i=1
1
n0
ˆN :=
exp(θ(cid:62)f (Z 0
i ))
3
which gives us a convex optimisation problem.
We now define ̃θ as the minimiser of the population KLIEP objective under our log-linear model (i.e.
the
population analogue of (4)) allowing us to view ˆθ as an estimator for ̃θ. Indeed, with some mild restrictions on
f and for nmin := min{n0, n1} ≥ C0 log(1/δ), we have that w.p. 1 − δ
(cid:107)ˆθ − ̃θ(cid:107)≤
(cid:115)
C0 log(1/δ)
nmin
(5)
where C0 is a constant depending on f (Z0), f (Z1), ̃θ, d. Details of this result are found in Appendix A.2.
An additional bound for the accuracy of ˆN is given in the Appendix section A.2.1. However, as we will see in
applications such as NP classification, we only require the knowledge of r∗ up to strictly increasing transform
and so it is often unnecessary to estimate N .
Within this paper, we mostly focus on KLIEP however for completeness we also present the general class of
f -Divergence based density ratio estimators and describe some notable cases in Appendix B.1. We now go on
to adapt this procedure for use with MNAR data.
3 PROPOSED METHODS
In our setting we do not observe samples from Z and so cannot use (4) to approximate the population KLIEP
objective. Instead, we only have samples from X. The following result relates expectations of Z with expectations
of X.
Lemma 1. We have that p(cid:48) = C * (1 − φ) * p, for some C ∈ R. Hence, for any measurable function g : Z → R
E[g(Z)] = E
(cid:20) 1{X (cid:54)= ∅}
1 − φ(X)
(cid:21)
g(X)
.
(6)
For proof of this Lemma see Appendix A.3). This importance weighting technique is an approach that is already
used to tackle MNAR data contexts outside of DRE (Li et al., 2013; Seaman and White, 2011). From this
Lemma, we get that for some C (cid:48) ∈ R,
r(cid:48) :=
p(cid:48)
1
p(cid:48)
0
= C (cid:48) *
1 − φ1
1 − φ0 * r∗
Consequently, r(cid:48) is not proportional to r∗ when φ1 (cid:54)= φ0 with either non-constant. As a result, using KLIEP
with only the observed values of our MNAR data will be biased due to the fact it estimates r(cid:48) rather than r∗.
We now use this Lemma to inform our adapted estimation procedures.
3.1 KLIEP with Missing Data
We can now approximate the population KLIEP objective by replacing expectations in (2) with the important
weighted expectations in Lemma 1. This replacement modifies the sample KLIEP objective to work with D(cid:48) as
follows:
n1(cid:88)
1
n1
i (cid:54)= ∅}
1{X 1
1 − φ1(X 1
i )
log r(X 1
i ) − log
1
n0
n0(cid:88)
i=1
i (cid:54)= ∅}
1{X 0
1 − φ0(X 0
i )
r(X 0
i )
(7)
ˆr0 :=argmax
r∈ ̄G
ˆN :=
1
n0
n
(cid:88)
i=1
i=1
i (cid:54)= ∅}
1{X 0
1 − φ0(X 0
i )
ˆr0(X 0
i ) .
We refer to this approach as M-KLIEP and to (7) as the sample M-KLIEP objective. We now take, ˆθ(cid:48) to be the
estimated parameter when r takes the log-linear form (3). To show the efficacy of M-KLIEP, we prove that ˆθ(cid:48),
converges to ̃θ under mild conditions. Let meff ≡ meff (n0, n1, φ0, φ1) denote the effective sample size defined by
meff := min{n0 * (1 − (cid:107)φ0(cid:107)∞), n1 * (1 − (cid:107)φ1(cid:107)∞)}.
4
Theorem 2. Let ˆθ(cid:48) be defined as above. Assume that (cid:107)f (cid:107)∞≤ ∞ and σmin := Var(f (Z 0)) > 0. Then, there
0 ≥ 1, depending only on (cid:107)f (cid:107)∞, σmin, (cid:107) ̃θ(cid:107), and d, such that for any δ ∈ (0, 1/2] and
exists some constant C (cid:48)
meff (n0, n1, φ0, φ1) > C (cid:48)
0 * log(1/δ) we have
(cid:32)
(cid:115)
P
(cid:107)ˆθ − ̃θ(cid:107)>
C (cid:48)
0 log(1/δ)
meff (n0, n1, φ0, φ1)
(cid:33)
≤ δ.
Proof is given in Appendix A.4. This result shows that M-KLIEP, unlike applying KLIEP on only observed
values, does not suffer from the inconsistent ratio estimation problem we mentioned earlier.
The following result shows that this bound is minimax optimal w.r.t meff .
Theorem 3. Given any estimator ˆθ ≡ ˆθ(D(cid:48)) of ̃θ, and any (w0, w1) ∈ [0, 1]2, (n0, n1) ∈ N2 and δ ∈ (0, 1/4]
there exists distributions P0, P1 on X which satisfies the conditions of Theorem 2, with (cid:107)φω(cid:107)∞≤ wω such that
if D(cid:48)
for ω ∈ {0, 1} then
ω ∼ P nω
ω
(cid:32)
P
(cid:107)ˆθ − θ(cid:107)>
(cid:115)
1
2
∧
10 log(1/(4δ))
meff (n0, n1, φ0, φ1)
(cid:33)
≥ δ.
3.2 General Extension
While we have described the adaptation for KLIEP, this approach can be applied to any expectation-based DRE
procedure with the following form:
argmin
r∈G
h(E[g1(Z 1)], E[g0(Z 0)])
where h : Rd0 × Rd1 → R, gω : Z → Rdω . We can then approximate these expectations using Lemma 1 as we
did for KLIEP. An example of this with f -Divergence based DRE is given in the Appendix section B.1.1.
3.3 Extensions to Partial Missingness across Multiple Dimensions
We now extend our approaches to the case of partial missingness in multi-dimensional settings. Throughout this
section let d ∈ N and replace our original space Z for Z d (and similarly X with X d). We start off with the
assumption on our data missingness structure that for all j ∈ [d],
P(X (j) = ∅|Z, X (−j)) = φj(Z (j))
P(X (j) = x(j)|Z, X (−j)) = 1{Z (j) = x(j)}(1 − φj(Z (j)))
As such, the components are missing independently from one another with probabilities only depending on their
own true value. To further simplify proceedings, we assume a naive Bayes style condition. Namely we include
the restriction that for all j(cid:48) (cid:54)= j, Z (j(cid:48)) ⊥⊥ Z (j) so that (Z (j), X (j)) ⊥ (Z (j(cid:48)), X (j(cid:48))). This implies that
r∗ :=
d
(cid:89)
j=1
r∗
j
where
r∗
j :=
p(j)
1
p(j)
0
with p(j) be the p.d.f. of Z (j).
This allows us to separately estimate the density ratio over each dimension and then take the product to get
the joint density ratio (DR). Within each dimension, only data from that dimension is relevant (due to the
aforementioned independence) and so we can estimate the density ratio on each dimension using exclusively the
data from that dimension with our current methods.
3.4 NP Classification with Missing data
We now apply our adapted procedures to the problem of NP classification. First, we introduce NP classification.
5
NP classification constructs a classifier that strictly controls the miss-classification of one class while minimising
miss-classification in the other (Cannon et al., 2002; Scott and Nowak, 2005; Tong, 2013; Tong et al., 2018).
Specifically, in NP classification we aim to learn a classifier φ : Z → {0, 1} which solves the following constrained
optimisation problem
P(φ(Z 1) = 0)
min
φ
subject to: P(φ(Z 0) = 1) ≤ α.
(8)
We refer to the classifier which solves the above problem as the NP oracle classifier at level α and refer to class 0
as the error controlled class. From the Neyman-Pearson lemma, it can be shown that the classification boundary
of the oracle classifier is a level set of r∗ (Tong, 2013). This motivates the use of DRE to approximate r∗ and
in turn the oracle classifier. In contrast to hypothesis testing, we do not know the distribution of Z 0. As such,
there is no means of constructing a classifier that is guaranteed to satisfy (8). Instead, we create a classifier ˆφD
from our data D. This classifier has a small pre-specified probability of violating our Type I error constraint. In
other words for a given small δ > 0, and classification procedure ˆφD,
(cid:18)
P
(cid:12)
(cid:16) ˆφD(Z 0) = 1
P
(cid:12)
(cid:12)D
(cid:17)
(cid:19)
≤ α
≥ 1 − δ.
(9)
A procedure satisfying (9) is described in Tong et al. (2018). This procedure uses any density ratio estimate
alongside additional data from the error-controlled class to choose a classification threshold. The estimated
density ratio alongside the threshold is used for classification. As a result, different DRE approaches lead to
different NP classification procedures. More information on the details of this classification procedure can be
found in Appendix B.2.
As we know the optimal classifier comes from the true density ratio, we can assess the accuracy of various
DRE procedures by the efficacy of the associated NP classification procedure. We asses the efficacy of an NP
classification procedure ˆφD by the expected power which is defined as
(cid:20)
E
(cid:12)
(cid:16) ˆφD(Z 1) = 1
P
(cid:12)
(cid:12)D
(cid:17)(cid:21)
= P( ˆφD(Z 1) = 1).
We can also assess the efficacy of a classifier by it's Type II error which we define to be R1(φ) := P(φ(Z 0) = 1).
3.4.1 Adapting NP Classification to Missing Data
Current NP classification approaches require direct samples from Z 0 in order to select the appropriate classifi-
cation threshold. Therefore, we will need to adapt it for the MNAR setting.
We can again use Lemma 1 to approximate P(ˆr(Z 0) > C) using D(cid:48)
Specifically, if for any h : Z → R we define
0 and choose a threshold based on this.
W (C,h)
i
:=
i (cid:54)= ∅}
1{X 0
1 − φ0(X 0
i )
1{h(X 0
i ) > C}
] = P(h(Z 0) > C). We also introduce the effective sample size for class 0 defined by m0
then E[W (C,h)
eff :=
n0(1 − (cid:107)φ0(cid:107)∞). We now use this result to prove the key lemma that informs our adaptation to the threshold
selection within our NP classification algorithm.
i
Lemma 4. For a given measurable h : Z → R let's choose
1
n
(cid:88)
i∈[n]
W (C,h)
i
≤ α − ∆m0
eff ,δ
ˆCα,δ,h ≡ ˆCα,δ,h(D(cid:48)
0)
:= inf
C ∈ R :
(cid:115)
where ∆m0
eff ,δ :=
16 log(1/δ)
m0
eff
.
6
Then, for any δ ∈ (0, 1/2],
(cid:20)
P(h(Z 0) > ˆCα,δ,h | D(cid:48)) > α
P
(cid:21)
≤ δ.
Proof. Fix C ∗
of C we have that P(h(Z 0) > C ∗
α,h) ≤ α. Hence,
α,h := inf (cid:8)C ∈ R : P(h(Z 0) > C) ≤ α(cid:9). As P(h(Z 0) > C) is a decreasing right continuous function
(cid:104)
P
P(h(Z 0) > ˆCα,δ,h | D(cid:48)
0) > α
(cid:105)
= P( ˆCα,δ,h < C ∗
α,h)
1
n
≤ P
(cid:88)
α,h)
(C∗
i
W
i∈[n]
≤ α − ∆m0
eff ,δ
≤ δ,
where we used Lemma 11 from Appendix A.4 in the final step.
Therefore this gives rise to the following NP classification Algorithm 1. We will assume that we have access
to an additional n0 IID copies of X0 which we will label as X 0
however this is just for notational
convenience and the algorithm and associated theory adapts to any number of samples from X0. We now let
g : R → R be any strictly increasing function.
n0+1, . . . , X 0
2n0
Algorithm 1 Missing NP Classification Procedure
i }n0
1: Use {X 1
2: For i ∈ {1, . . . , n0} compute ˆri := g ◦ ˆr(X 0
i=1, {X 0
i }n1
i=1 to estimate g ◦ r∗ with g ◦ ˆr by any DRE procedure.
) and wi := 1{X 0
i+n0
i+n0
∈ Z}(1 − φ0(X 0
))−1 with g ◦ ˆr(∅) :=
i+n0
−∞.
3: Sort ˆr1, . . . , ˆrn0 in increasing order to get ˆr(1), . . . , ˆr(n0) with ˆr(i) ≤ ˆr(i+1) and associated w(1), . . . , w(n0).
4: Set i∗ = min{i ∈ {1, . . . , n0}| 1
n0
j=i w(j) ≤ α − ∆m0
eff ,δ}.
(cid:80)n0
5: Let ˆCα,δ,g◦ˆr(D(cid:48)) := ˆr(i∗) and define ˆφD(cid:48) by
ˆφD(cid:48)(z) := 1{g ◦ ˆr(z) > ˆCα,δ,g◦ˆr}
for all z ∈ Z.
We can freely introduce g within Algorithm 1 as the classifier produced is invariant to strictly increasing trans-
formations. Crucially we can do this without knowing g specifically and are only required to know g ◦ ˆr. This
added flexibility has many advantages, for example, we are now only required to learn r∗ up to a multiplicative
constant.
We now analyse the performance of Algorithm 1 in conjunction with M-KLIEP. To this end, define ˆφD(cid:48) as in
Algorithm 1 with ˆr = rˆθ(cid:48) as defined in Theorem 2. We now compare this with its population analogue ̃φ defined
by
for all z ∈ Z, where C ∗
̃φ(z) := 1{g ◦ r ̃θ(z) > C ∗
α,h is defined as in the proof of Lemma 4.
}
α,g◦r ̃θ
Theorem 5. Assume the conditions of Theorem 2 hold and let ˆφD(cid:48), ̃φ be defined as above. Further assume that
for all θ ∈ Rd, z ∈ Z, (cid:107)∇θg ◦ rθ(z)(cid:107)≤ L. Finally, suppose there exists positive constants B0, B1, γ0, γ1, a s.t. h
satisfies the following conditions
(cid:18)
P
h(Z 0) ∈ [C ∗
α,h, C ∗
α,h + ζ]
(cid:19)
(cid:18)
P
h(Z 0) ∈ [C ∗
α,h − ζ, C ∗
α,h + ζ]
(cid:19)
≥ B−1
0 ζ γ0
≤ B1ζ γ1 ,
7
for all ζ ∈ (0, B0a1/γ0]. Then there exists a constant C2 > 0 depending only on C (cid:48)
that for all δ ∈ (0, 1
2 ], with meff ≥ C2 log(1/δ), we have
0, B0, B1, γ0, γ1, a, and L such
where
P(|R1( ˆφD(cid:48)) − R1( ̃φ)|> ε(cid:48)) ≤ 2δ.
ε(cid:48) := C2
(cid:34)(cid:18) log(1/δ)
m0
eff
(cid:19) γ1+1
2γ0
∧ 1
2
+
(cid:18) log(1/δ)
meff
(cid:19) γ1+1
2 (cid:35)
.
Remark 1. If G is correctly specified and Z 1, Z 0 are continuous then the NP lemma gives us that ̃φ is the oracle
classifier (Tong, 2013). Hence we have shown convergence in Type II error to the oracle classifier in this case.
Remark 2. Taking g = log gives L = b under the constraints imposed in Theorem 2.
We have now fully adapted NP classification to the MNAR setting. Namely, we have proposed an algorithm
to construct an NP classifier using MNAR data and shown this classifier simultaneously control Type I error
with high probability while also converging to the oracle classifier when G is correctly specified. We test our
adaptations on some synthetic examples.
4 SYNTHETIC DATA EXAMPLES
Here we empirically evaluate our proposed methods alongside CC-KLIEP (naive Complete Case KLIEP) which
simply discards any missing value in the dataset and estimating the ratio using only observed data. Both M-
KLIEP and CC-KLIEP are tested on simulated datasets. Details on the data generating processes can be found
in Appendix C.
4.1 5-dimensional Correctly Specified Example
In this example we take both classes to have multivariate Gaussian distributions with the same variance. We
then induced MNAR missingness in class 0 and no missingness in class 1. We use the log-linear form for rθ with
f (z) = z so that G is correctly specified. 100 simulations of the above data generation procedure were run for
n0 = n1 with n0 ranging from 100 to 1, 500 and ̃θ estimated by M-KLIEP and CC-KLIEP. These simulations
were then used to estimate the mean square (Euclidean) distance (MSD) between our estimate, ˆθ(cid:48), and ̃θ for
both procedures. These estimates alongside 99% C.I.s (confidence intervals) were calculated which are presented
in Figure 1. In the plot we can see clear evidence of the complete case approach being asymptotically biased as
Figure 1: MSD between ˆθ(cid:48) and ̃θ for varying n with 99% C.I.s.
the error plateaus around 0.08 while the error under M-KLIEP converges to 0 as n0, n1 increase. We now go on
to illustrate the affect of our DRE procedure on NP classification.
8
200400600800100012001400Sample Size0.000.050.100.150.200.250.300.35Mean Square Distance (MSD)DRE ProcedureM-KLIEPCC-KLIEP4.2 Neyman Pearson Classification
For this example we take both classes to be 2-dimensional Gaussian mixtures. We then induce MNAR missingness
in class 0 and no missingness in class 1. M-KLIEP and CC-KLIEP are then used to estimate r∗ using the log-
linear form with f (x) = x again. NP classifiers were then fit using these estimators alongside the true r∗.
Figure 2: Scatter plot of D alongside classification boundaries produced from corresponding D(cid:48) via various
procedures. If Xi = ∅ then Zi is faded out.
Figure 2 shows one run of this experiment with n0 = n1 = 500. We see that M-KLIEP provides a good
approximation to the classifier that uses r∗ despite the model being incorrectly specified while CC-KLIEP is
biased due to the way it discards corrupted points.
Repeated Simulations
We now run 100 simulations of the above experiment for various n1 = n0 ranging from 100 to 1500. We then
use these to estimate the expected power of the procedures alongside 99% C.I.s . Figure 3 shows the results of
this experiment.
We see similar results to our correctly specified DRE experiment with the complete case approach performing
poorly. As we can see, despite our model not being able to encompass the true density ratio, our estimate density
ratio via M-KLIEP still gives a reasonable approximation to r∗ and therefore gives a good NP classification
procedure. Due to G being incorrectly specified, M-KLIEP never converges to the expected power using the true
DR. Additional synthetic experiments are given in Appendix D
Figure 3: Expected Power for varying n with 99% C.I.s
9
−4−20246x(1)−4−202468x(2)Class 1Class 0: 1 - nClass 0: n+1 - 2nDRE ProcedureTrue DRM-KLIEPCC-KLIEP200400600800100012001400Sample Size0.2000.2250.2500.2750.3000.3250.3500.375Expected powerDRE ProcedureTrue DRM-KLIEPCC-KLIEP5 REAL-WORLD DATASETS WITH SIMULATED MISSING-
NESS
We now go on to perform NP classification experiments with real-world data. To make this scenario more
realistic we will assume the φ to be unknown and aim to estimate them. We briefly tackle how to do this in the
section below.
5.1 Learning the Missingness Function
Thus far we have assumed φ is known. We now consider the challenge of learning φ by querying the latent values
Zi for a subset of our missing data.
Here we are motivated by settings in which we can send a small sub-sample of observations which erred (i.e. a
subset of {i ∈ [n] : Xi = ∅}) off for further investigation to obtain their respective true values Zi. Now we can
learn the missingness function φ by fitting a logistic regression with samples of (Zi, 1{Xi = ∅}) and treating
1{Xi = ∅} as the response variable.
As we have not observed Zi for every i ∈ [n], we cannot use a standard logistic regression to learn φ. However, we
can use an adaption of logistic regression designed to deal with miss-representative class proportions presented
in King and Zeng (2001). More details on this can be found in the Appendix in section B.3. We now try our
methods on real-world data to assess their efficacy.
5.2 Set-Up
We choose datasets and classification problems where the NP classification is properly motivated: One would
want to strictly control miss-classification for one class in these datasets. We have chosen 3 datasets which we
refer to as "Fire", "CTG", and "weather";
• CTG dataset: This data set contains 11 different summaries of Cardiotocography (CTG) data for 2126
foetuses where we take each foetus to be an observation. Alongside this is a classification of each foetus as
"Healthy", "Suspect", or "Pathologic". We aim to predict whether the foetus is classified as "Healthy" or
not. We take the error controlled class to be "Suspect" or "Pathologic".
• Fire dataset: This data set contains 62,630 readings of 12 atmospheric measures such as temperature,
humidity, and CO2 content. We aim to predict whether a fire is present. We take the presence of fire as
the error controlled class.
• Weather data: This data set contains 142,193 observations of 62 dimensions giving various weather
readings for a given day in a given location in Australia and whether it rained the following day. We aim
to predict whether it rains the following day. We take the occurrence of rain as the error controlled class.
In all cases, we artificially induce missing observations separately across each dimension and only in the non
error-controlled class. We construct each dimension-wise missing function φj, j ∈ [d] as φj(z) = (1+exp{τj(aj,0+
aj,1z)}) where aj,0, aj,1 ∈ [0, ∞) and τj ∈ {−1, 1}.
We constructed NP classifiers using M-KLIEP and CC-KLIEP under our naive Bayes framework introduced in
Section 3.3. For M-KLIEP we test both cases where φj is known and φj is learned. Estimating φj is done using
the method described in Section 5.1 and each φj is estimated separately using only data from that dimension.
We also estimate the density ratio using the fully observed data via standard KLIEP as a benchmark.
The power of the NP classifiers produced with these DRE procedures was then calculated on fully observed
testing data. We repeat this process multiple times with new random test/train splits and τj at each iteration
to estimate the pseudo expected power and corresponding 95% C.I.s. We apply this technique at different target
Type I errors and varying aj,0 to construct datasets with different missing proportions. Additional detail is given
in Appendix E.2.
5.3 Results
In Figure 4 we see that in both the Fire and Weather data, M-KLIEP significantly outperforms CC-KLIEP
for all values of α. For the CTG data we see significant out-performance for α ∈ [0.1, 0.25] and comparable
10
(a) CTG Dataset.
(b) Fire Dataset.
(c) Weather Dataset.
Figure 4: Out of sample power with pseudo 95% C.I.s for various different target Type I errors.
(a) CTG Dataset.
(b) Fire Dataset.
(c) Weather Dataset
Figure 5: Out of sample power with pseudo 95% C.I.s for various φ with varying missing proportions.
performance in the extremes. Surprisingly, we see that M-KLIEP performs equally well when φ is either learned
or known. Further, M-KLIEP perform comparably with KLIEP run on fully observed datasets. In Figure 5 we
see that M-KLIEP outperforms CC-KLIEP for larger missingness proportions. As we would expect, the more
missing points, the worse CC-KLIEP performs. For the Fire and CTG data we see no loss in performance when
learning φ. For the Weather data, an increase in the missing proportion leads to a decrease in performance of
M-KLIEP using a learned φ. Remarkably, there is no performance loss when running M-KLIEP using the true
φ in all datasets.
Results from additional experiments comparing with an iterative imputation approach are given in Appendix
section E.3.1.
6 DISCUSSION & CONCLUSIONS
DRE is a widely used machine learning technique with a diverse range of applications. In this paper we have
shown that, when data is MNAR, naively performing DRE by discarding all missing observations can lead to
inaccurate estimates of the density ratio functions. We have proposed a novel procedure M-KLIEP as well as
adaptations to a broad family of DRE procedures to account for the MNAR phenomenon when the missingness
structure is known. For M-KLIEP we have presented finite sample bounds under a commonly used parametric
form showing convergence at rate
meff where meff is the effective sample size. We have then extended these
approaches in multiple ways to partial missingness across multiple dimensions under the naive Bayes framework.
Finally, we have presented a technique to estimate missing patterns from data by querying the true values of a
few missing observations.
√
We then studied a downstream application of DRE in NP classification. We have adapted NP classification to
MNAR data settings and shown that our adaptation ensures satisfaction of our Type I error constraints with
high probability. We have also provided finite sample convergence results for the expected power of our NP
classification procedure and hence shown that it converges to the optimal power under certain conditions.
11
0.050.100.150.200.250.30Fixed Type 1 Error0.550.600.650.700.750.800.85Out of Sample PowerKLIEP (full dataset)M-KLIEP (known φj)M-KLIEP (estimated φj)CC-KLIEP0.050.100.150.200.250.30Fixed Type 1 Error0.30.40.50.60.70.80.9Out of Sample PowerKLIEP (full dataset)M-KLIEP (known φj)M-KLIEP (estimated φj)CC-KLIEP0.050.100.150.200.250.30Fixed Type 1 Error0.00.10.20.30.40.50.60.7Out of Sample PowerKLIEP (full dataset)M-KLIEP (known φj)M-KLIEP (estimated φj)CC-KLIEP0.00.20.40.60.8Proportion of Values Missing0.640.660.680.700.72Out of Sample PowerM-KLIEP (known φj)M-KLIEP (estimated φj) CC-KLIEP0.00.20.40.60.8Proportion of Values Missing0.30.40.50.60.7Out of Sample PowerM-KLIEP (known φj)M-KLIEP (estimated φj) CC-KLIEP0.00.20.40.60.8Proportion of Values Missing0.100.150.200.250.300.350.40Out of Sample PowerM-KLIEP (known φj)M-KLIEP (estimated φj) CC-KLIEPWe have shown all these adaptations to work well in practice on simulated data and applied them to real world
data with known and unknown synthetic missing patterns. In particular, our adapted NP classifier using M-
KLIEP has been shown to negate losses in accuracy/power incurred by MNAR phenomenon in most cases. We
briefly explore the societal impact of our work in Appendix F.
A natural extension of this work would be relaxing the naive Bayes assumption required for the handling partial
missingness (Section 3.3) to a more realistic set-up where dependencies are properly modelled and accounted for.
This extension would enable applications in areas where the naive Bayes framework is unrealistic such as image
classification. Another possible direction would be exploring the set-up where the missing pattern is known to
only belong to some class as discussed in Sportisse et al. (2020). This approach could be further expanded using
a Bayesian framework by assigning of some prior belief on the missing pattern. Finally, our adaptation to NP
classification could be extended further by adapting it to the case of partial missingness in both classes.
Acknowledgements
Josh Givens was supported by a PhD studentship from the EPSRC Centre for Doctoral Training in Computa-
tional Statistics and Data Science (COMPASS).
References
Azmandian, F., Dy, J. G., Aslam, J. A., and Kaeli, D. R. (2012). Local kernel density ratio-based feature
selection for outlier detection. Journal of Machine Learning Research, 25:49–64.
Cannon, A., Howse, J., Hush, D., and Scovel, C. (2002). Learning with the neyman-pearson and min-max
criteria. Los Alamos National Laboratory, Tech. Rep. LA-UR, pages 02–2951.
Choi, K., Liao, M., and Ermon, S. (2021). Featurized density ratio estimation. In de Campos, C. and Maathuis,
M. H., editors, Proceedings of the Thirty-Seventh Conference on Uncertainty in Artificial Intelligence, volume
161 of Proceedings of Machine Learning Research, pages 172–182. PMLR.
de Campos, D. A., Bernardes, J., Garrido, A., de s ́a, J. M., and Pereira-leite, L. (2000). Sisporto 2.0: a program
for automated analysis of cardiotocograms. The Journal of maternal-fetal medicine, 9 5:311–8.
Ding, X., Wang, Z. J., and Welch, W. J. (2020). Subsampling generative adversarial networks: Density ratio
estimation in feature space with softplus loss. IEEE Transactions on Signal Processing, 68:1910–1922.
Goldberg, S. B., Bolt, D. M., and Davidson, R. J. (2021). Data missing not at random in mobile health research:
Assessment of the problem and a case for sensitivity analyses. J Med Internet Res, 23(6):e26749.
Josse, J., Prost, N., Scornet, E., and Varoquaux, G. (2019). On the consistency of supervised learning with
missing values. arXiv preprint arXiv:1902.06931, pages 1–43.
Kanamori, T., Hido, S., and Sugiyama, M. (2009). A least-squares approach to direct importance estimation.
Journal of Machine Learning Research, 10(48):1391–1445.
Kanamori, T., Suzuki, T., and Sugiyama, M. (2010). Theoretical analysis of density ratio estimation. IEICE
Transactions, 93-A:787–798.
King, G. and Zeng, L. (2001). Logistic regression in rare events data. Political Analysis, 9(2):137–163.
Kl ́en, R., Visuri, M., and Vuorinen, M. (2010). On jordan type inequalities for hyperbolic functions. Journal of
Inequalities and Applications, 2010:1–14.
Kohler, J. M. and Lucchi, A. (2017). Sub-sampled cubic regularization for non-convex optimization. In ICML.
Li, L., Shen, C., Li, X., and Robins, J. M. (2013). On weighting approaches for missing data. Statistical Methods
in Medical Research, 22(1):14–30. PMID: 21705435.
Liu, S., Takeda, A., Suzuki, T., and Fukumizu, K. (2017). Trimmed density ratio estimation. In Guyon, I.,
Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in
Neural Information Processing Systems, volume 30. Curran Associates, Inc.
12
Liu, Y. and De, A. (2015). Multiple imputation by fully conditional specification for dealing with missing data
in a large epidemiologic study. International Journal of Statistics in Medical Research, 4:287–295.
Nowozin, S., Cseke, B., and Tomioka, R. (2016). f-GAN: Training generative neural samplers using variational
divergence minimization. Advances in Neural Information Processing Systems, pages 271–279.
Padgett, C. R., Skilbeck, C. E., and Summers, M. J. (2014). Missing data: The importance and impact of
missing data from clinical research. Brain Impairment, 15(1):1–9.
Rutkowski, L. (2011). The impact of missing background data on subpopulation estimation. Journal of Educa-
tional Measurement, 48(3):293–312.
Scott, C. and Nowak, R. (2005). A neyman-pearson approach to statistical learning. IEEE Transactions on
Information Theory, 51(11):3806–3819.
Seaman, S. R. and White, I. R. (2011). Review of inverse probability weighting for dealing with missing data.
Statistical methods in medical research, 22(3):278–295.
Sportisse, A., Boyer, C., and Josse, J. (2020). Imputation and low-rank estimation with missing not at random
data. Statistics and Computing, 30(6):1629–1643.
Sugiyama, M., Suzuki, T., and Kanamori, T. (2010). Density ratio estimation: A comprehensive review. RIMS
Kokyuroku, pages 10–31.
Sugiyama, M., Suzuki, T., Nakajima, S., Kashima, H., Von B ̈unau, P., and Kawanabe, M. (2008). Direct
importance estimation for covariate shift adaptation. Annals of the Institute of Statistical Mathematics,
60(4):699–746.
Tong, X. (2013). A plug-in approach to neyman-pearson classification. Journal of Machine Learning Research,
14(92):3011–3040.
Tong, X., Feng, Y., and Li, J. J. (2018). Neyman-pearson classification algorithms and np receiver operating
characteristics. Science Advances, 4(2):eaao1659.
Tropp, J. (2015). An introduction to matrix concentration inequalities. Foundations and Trends® in Machine
Learning, 8.
Tsuboi, Y., Kashima, H., Hido, S., Bickel, S., and Sugiyama, M. (2009). Direct density ratio estimation for
large-scale covariate shift adaptation. Journal of Information Processing, 17:138–155.
Tsybakov, A. B. (2009). Introduction to Nonparametric Estimation. Springer: Paris.
Ward, R. C., Axon, R. N., and Gebregziabher, M. (2020). Approaches for missing covariate data in logistic
regression with MNAR sensitivity analyses. Biometrical Journal, 62(4):1025–1037.
A ADDITIONAL PROOFS
Here we prove key results from the paper however before we do we need to first introduce some additional
ω to refer to the density of X ω with w.r.t. the measure ν where ν is the unique measure on
notation. We let p(cid:48)(cid:48)
Z ∪ {∅} s.t. (such that) ν(A) = μ(A) for any A ∈ BZ and ν({∅}) = 1. For square matrices A, B ∈ Rd×d we
take A (cid:23) B to mean that A − B is positive semi-definite and define λmin(A) to be the smallest eigenvalue of A.
A.1 KLIEP Objective Simplification
Lemma 6. Let G be closed under positive scalar scalar multiplication so that for all r ∈ G, a > 0, ar ∈ G.
Define ̃r to be the solution of the constrained optimisation problem
min
r∈G
subject to :
KL(p1|rp0)
(cid:90)
r(z)p0(z)μ(dz) = 1.
Z
13
Then we can re-write the solution to the above optimisation problem as ̃r := N −1 * r0 where
r0 := argmax
r∈ ̄G
E[log r(Z 1)] − log E[r(Z 0)]
N := E[r0(Z 0)]
where ̄G is ̄G ⊆ G s.t. for any r ∈ ̄G, there exists r0 ∈ ̄G, a > 0 s.t. a * r0 = r.
Proof. We have that
argmin
r∈G
KL(p1|rp0) =
(cid:90)
Z
p1(z) log
p1
rp0(z)
= argmin
E[log
p1(Z 1)
r(Z 1)p0(Z 1)
]
r∈G
= argmin
r∈G
= argmax
r∈G
E[log p1(Z 1)] − E[log p0(Z 1)] − E[log r(Z 1)]
E[log r(Z 1)].
As such we can re-write the optimisation problem as
E[log r(Z 1)]
min
r∈G
subject to : E[r(Z 0)] = 1.
To simplify this further we now show that
{r ∈ G|E[r(Z 0)] = 1} = {E[r(Z 0)]−1r|r ∈ G}.
To this end let r ∈ G, then as G is closed under positive scalar multiplication, E[r(Z 0)]−1r ∈ G. Hence, as
E (cid:2)E[r(Z 0)]−1r(Z 0)(cid:3) = 1, we have that E[r(Z 0)]−1r ∈ {r ∈ G|E[r(Z 0)] = 1}. As the other inclusion is trivial, we
have shown equality between the two sets of functions.
From this we can now re-write the optimisation as
argmax
E[r(Z0)]−1r∈{E[r(Z0)]−1r|r∈G}
=
argmax
E[r(Z0)]−1r∈{E[r(Z0)]−1r|r∈G}
E[log(E[r(Z 0)]−1r(Z 1))]
E[log r(Z 1)] − log E[r(Z 0)]
which gives the desired result.
Remark 3. We can take ̄G s.t. for any r ∈ ̄G, a(cid:48) > 0, if r, a(cid:48)r ∈ G then a(cid:48) = 1. Hence for certain choices of G
we can choose ̄G so that r0 is unique
A.2 KLIEP Finite Sample Proofs
Before we can prove Theorem 9 there are a few simple results we need first. The first is a generalisation of
Bernstein bounds to random vectors presented in Kohler and Lucchi (2017).
Lemma 7 (Kohler and Lucchi (2017)). Let W1, . . . , Wn be IID copies of a non-negative random vector W over
Rd with E[W ] = μ. Now let b, σ > 0 be s.t. (cid:107)W (cid:107)≤ b a.s. and E[(cid:107)W (cid:107)2] ≤ σ2. Then for any ε < σ2
b
P
(cid:32)(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
1
n
n
(cid:88)
i=1
Wi − μ
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:33)
≤ ε
≥ 1 − e1/4 exp
(cid:27)
(cid:26)
−
nε2
8σ2
We also need a Lemma bounding true and sample covariance in terms of the eigen-space
14
Lemma 8. Let W be a RV over Rd with (cid:107)W (cid:107)≤ b a.s. and let W1 . . . , Wn to be IID copies of W . Define the
sample covariance of {Wi}i∈[n] by
(cid:100)Var(W ; {Wi}i∈[n]) :=
1
n
n
(cid:88)
i=1
WiW (cid:62)
i −
(cid:33) (cid:32)
(cid:32)
1
n
n
(cid:88)
i=1
Wi
1
n
n
(cid:88)
i=1
Wi
(cid:33)(cid:62)
then provided σmin ≤ 4b2
(cid:18)
λmin((cid:100)Var(W ; {Wi}i∈[n]) ≥
P
(cid:19)
λmin(Var(W ))
1
2
≥ 1 − (d + e1/4) exp
(cid:111)
(cid:110) σminn
32b2
where σmin := λmin(Var(W )).
Proof. Define the centred RVs Y1, . . . , Yn by Yi := Wi − E[Wi] and the random matrices Rn, Sn by
1
n
(cid:32)
Sn :=
Rn :=
n
(cid:88)
i=1
YiY (cid:62)
i
1
n
n
(cid:88)
i=1
Yi
(cid:33) (cid:32)
(cid:33)(cid:62)
1
n
n
(cid:88)
i=1
Yi
so that Rn − Sn = (cid:100)Var(Y1, . . . , Yn) = (cid:100)Var(W1, . . . , Wn).
Firstly we use the matrix Chernoff inequalities (Tropp, 2015) to get that
(cid:18)
P
λmin(Sn) ≥
3
4
(cid:19)
(cid:26)
σmin
≥ 1 − d exp
−
(cid:27)
a(cid:48)σminn
b2
where a(cid:48) := 3/4 log(3/4) + 1/4.
Now note that for any x ∈ Rd λmax(xx(cid:62)) = (cid:107)x(cid:107)2 so that λmax(Rn) = (cid:107) 1
n
provided σmin ≤ 4b2,
(cid:80)n
i=1 Yi(cid:107)2. Additionally, by Lemma 7,
(cid:18)
λmax(Rn) ≤
P
(cid:19)
(cid:32)
(cid:107)
= P
1
4
σmin
1
n
n
(cid:88)
i=1
Yi(cid:107)<
√
1
2
(cid:33)
σmin
≥ 1 − e1/4 exp
(cid:110)
−
(cid:111)
σminn
32b2
Taking the intersection of these two events we get that w.p. at least 1 − (d + e1/4) exp{ −σminn
32b2 }
λmin((cid:100)Var(Y1, . . . , Yn)) = λmin(Sn − Rn)
≥ λmin(Sn) − λmax(Rn)
1
4
σmin −
σmin
≥
=
λmin(Var(W ))
3
4
1
2
We can now use this to state and prove our theorem giving finite sample bounds for the estimation error of
KLIEP.
Theorem 9. Define rθ as in (3) and the population and empirical losses L, ˆL by
L(θ) := −E[log(rθ(Z 1)] + log E[rθ(Z 0)]
ˆL(θ, D) := −
1
n1
n1(cid:88)
i=1
log(rθ(Z 1
i )) + log
1
n0
n0(cid:88)
i=1
rθ(Z 0
i ).
15
Let ̃θ, ˆθ be the minimisers of these respective losses. Now assume that (cid:107)f (cid:107)∞< ∞ and λmin(Var(f (Z 0))) :=
σmin > 0. Then we have that for any δ < 1
2 and nmin ≥ C0 log(1/δ),
(cid:107)ˆθ(cid:48) − ̃θ(cid:107)≤
P
(cid:115)
C0 log(1/δ)
nmin
≥ 1 − δ
with C0 a constant depending upon (cid:107)f (cid:107)∞, σmin, d, ̃θ.
Proof. We firstly show that ˆL is a convex function for θ for any sample D ∈ Z n0,n1.
The first term is linear in θ so clearly convex. For the second term, note that it can be written as g ◦ hD0(θ)
with g : Rn0 → R, h : Rd → Rn0 given by
hD0 (θ) =
)
θ(cid:62)f (x0
1)
...
θ(cid:62)f (x0
n0
n0(cid:88)
g(w) = log
exp{wi}
Now again for any D0, h is linear in θ and therefore convex additionally g is convex and non-decreasing therefore
g ◦ h is convex.
Now we state some important bounds which we will use in our proof. If we let b := (cid:107)f (cid:107)∞ M := exp{(cid:107) ̃θ(cid:107)b} then
for any z ∈ Z,
i=1
• 1/M ≤ r ̃θ(z) ≤ M
• (cid:107)∇r ̃θ(z)(cid:107)≤ bM
•
(cid:13)
(cid:13)
(cid:13) ≤ b
∇r ̃θ(z)
r ̃θ(x)
(cid:13)
(cid:13)
(cid:13)
Finally we need to bound the minimum eigenvalue of the Hessian of the empirical loss function. To this end
note that for any ̄θ ∈ Bη( ̃θ) := {θ ∈ Rd|(cid:107) ̃θ − θ(cid:107)≤ η},
∇2
θ
ˆL( ̄θ; D) :=
(cid:23)
(cid:23)
1
n2
0
1
n2
0
(cid:80)
(cid:80)
i,j r ̄θ(Z 0
i )[f (Z 0
i )r ̄θ(Z 0
(cid:80)
1
n2
0
i,j r ̄θ(Z 0
i ) − f (Z 0
(cid:80)
i,j M −22e−2ηb[f (Z 0
1
n2
0
i,j[f (Z 0
1
n2
0
i,j e2ηbr ̃θ(Z 0
i ) − f (Z 0
(cid:80)
i,j r ̃θ(Z 0
1
n2
0
(cid:80)
1
M 2e4ηb
i ) − f (Z 0
j )](cid:62)
i ) − f (Z 0
i )r ̄θ(Z 0
j )][f (Z 0
i )}
j )][f (Z 0
i )r ̃θ(Z 0
j )
i ) − f (Z 0
j )][f (Z 0
i )r ̃θ(Z 0
j )
j )](cid:62)
i ) − f (Z 0
j )](cid:62)
=:
2
M 2e4ηb
(cid:100)Var(f (Z 0); D0)
(cid:98)E[r ̃θ(Z 0); D0]2
where, for square matrices A, B we take A (cid:23) B, to mean A − B is positives semi-definite.
Thus if we define 0 < σmin := λmin(Var[f (Z 0)]) then Lemma 8 tells us that, provided 1
4 σmin < 1,
(cid:18)
P
λmin((cid:100)Var(f (Z 0); D0)) ≥
(cid:19)
1
2
σmin
≥ 1 − (d + e1/4) exp
(cid:26)
−
1
8
(cid:16) σmin
(cid:17)
4b2 ∧ 1
(cid:27)
n
Additionally if we let μ2 := E[r ̃θ(Z 0)] we can use Lemma 7 to get that,
(cid:18)
(cid:98)E[r ̃θ(Z 0); D0] ≤
P
(cid:19)
3
2
μ2
≥ 1 − e1/4 exp
(cid:26)
−
(cid:18) μ2
2
(cid:19)
4M 2 ∧ 1
1
8
(cid:27)
n0
16
Thus for any given ̄θ ∈ Bη( ̃θ) w.p.
P
λmin(∇2
θ
(cid:124)
ˆL( ̄θ; D)) ≥
(cid:123)(cid:122)
:=A
4σmin
9M 2e4ηbμ2
2
(cid:125)
≥ 1 − (d + 2e1/4) exp
(cid:26)
−
1
8
(cid:18) μ2
2
4b2 ∧
(cid:19)
σmin
4b2 ∧ 1
(cid:27)
n0
(10)
Now we have these bounds we can continue with the main body of the proof. For some η > 0, define ˆθ(cid:48) to be
the solution to the following constrained optimisation problem
min
θ∈Bη( ̃θ)
ˆL(θ; D)
While, ˆθ(cid:48) is a purely theoretical quantity, we know that when (cid:107)ˆθ(cid:48) − ̃θ(cid:107)≤ 1, ˆθ = ˆθ(cid:48) and so we can use it to get
finite sample bounds for ˆθ.
By the necessary KKT conditions, we know that there exists μ∗ > 0 s.t.
in turn giving us that
∇θ ˆL(ˆθ(cid:48)) + μ∗(ˆθ(cid:48) − ̃θ) = 0
0 = (cid:104)ˆθ(cid:48) − ̃θ, ∇θ ˆL(ˆθ(cid:48)) + μ∗(ˆθ(cid:48) − ̃θ)(cid:105)
= (cid:104)ˆθ(cid:48) − ̃θ, ∇θ ˆL(ˆθ(cid:48))(cid:105) + μ∗(cid:107)(ˆθ(cid:48) − ̃θ)(cid:107)2
= (cid:104)ˆθ(cid:48) − ̃θ, ∇θ ˆL( ̃θ) + ∇2
θ
ˆL( ̄θ)(ˆθ(cid:48) − ̃θ)(cid:105) + μ∗(cid:107)(ˆθ(cid:48) − ̃θ)(cid:107)2.
Using multidimensional MVT over each coordinate with ̄θ some point in the hypercube with opposite corners
given by ̃θ, ˆθ(cid:48) (which is a subset of Bη( ̃θ). We then get that
(cid:107)ˆθ(cid:48) − ̃θ(cid:107)2λmin(∇2
θ
ˆL( ̄θ)) ≤ (ˆθ(cid:48) − ̃θ)(cid:62)∇2
θ
ˆL( ̄θ)(ˆθ(cid:48) − ̃θ) + μ∗(cid:107)(ˆθ(cid:48) − ̃θ)(cid:107)2
Therefore we have that
= (cid:104) ̃θ − ˆθ(cid:48), ∇θ ˆL( ̃θ)(cid:105)
≤ (cid:107)ˆθ(cid:48) − ̃θ(cid:107)(cid:107)∇θ ˆL( ̃θ)(cid:107)
.
(cid:107)ˆθ(cid:48) − ̃θ(cid:107) ≤
1
λmin(∇2
θ
ˆL( ̄θ))
(cid:107)∇θ ˆL( ̃θ)(cid:107).
Hence if A from (10) holds with our given ̄θ ∈ Bη( ̃θ) we have that
(cid:107)ˆθ(cid:48) − ̃θ(cid:107) ≤
9M 2e4ηbμ2
2
4σmin
(cid:107)∇θ ˆL( ̃θ)(cid:107)
a.s. .
From now on we will work on the event A so that bounding (cid:107)ˆθ − ̃θ(cid:107) simply requires us to bound (cid:107)∇θ ˆL( ̃θ)(cid:107).
17
As ∇θL( ̃θ) = 0 we have
(cid:107)∇θ ˆL( ̃θ)(cid:107) = (cid:107)∇θ ˆL( ̃θ) − ∇θL( ̃θ)(cid:107)
−
1
n1
n1(cid:88)
i=1
∇θr ̃θ(Z 1
i )
r ̃θ(Z 1
i )
+
(cid:20) ∇θr ̃θ(Z 1)
r ̃θ(Z 1)
(cid:80)n0
1
n0
(cid:21)
−
E[∇θr ̃θ(Z 0)]
μ2
(cid:13)
i=1 ∇θr ̃θ(Z 0
i )
(cid:13)
(cid:13)
(cid:80)n0
i=1 r ̃θ(Z 0
i )
(cid:13)
n1(cid:88)
(cid:21)
(cid:20) ∇θr ̃θ(Z 1)
r ̃θ(Z 1)
−
1
n1
1
n0
i=1
∇θr ̃θ(Z 1
i )
r ̃θ(Z 1
i )
=
(cid:13)
(cid:13)
(cid:13)
(cid:13)
E
≤
E
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:124)
+
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:125)
(cid:123)(cid:122)
:=I1
E[∇θr ̃θ(Z 0)]
̃θ(Z
E[r0
)]
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:124)
−
(cid:80)n0
i=1 ∇θr ̃θ(Z 0
i )
(cid:80)n0
i=1 r ̃θ(Z 0
i )
1
n0
1
n0
(cid:123)(cid:122)
:=I2
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:125)
We now go on to bound I1, I2, using using generalised Hoeffding bounds.
We first introduce some additional notation to allow us to proceed. Define RVs W1, W2 and constants μ1, μ2 as
follows
μ1 := E[∇θrθ(Z 0)]
μ2 := E[r ̃θ(Z 0)]
W1 :=
W2 :=
1
n0
1
n0
n0(cid:88)
i=1
n0(cid:88)
i=1
∇θr ̃θ(Z 0
i )
r ̃θ(Z 0
i )
Then we have
I2 :=
=
≤
−
(cid:13)
(cid:13)
(cid:13)
(cid:13)
μ1
μ2
(cid:13)
W1
(cid:13)
(cid:13)
W2
(cid:13)
(cid:107)μ1W2 − μ2W1(cid:107)
μ2W2
(cid:107)μ1 − W1(cid:107)
μ2
+
|μ2 − W2|(cid:107)μ1(cid:107)
μ2W2
Thus to have
it is sufficient to have
I1 + I2 <
4εσmin
9M 2e4ηbμ2
2
,
I1 <
(cid:107)μ1 − W1(cid:107) <
|μ2 − W2| <
,
2εσmin
9M 2e4ηbμ2
2
εσmin
9M 2e4ηbμ2
εσmin
18M 2e4ηb(cid:107)μ1(cid:107)
,
provided ε < 9M 2e4ηbμ2(cid:107)mu1(cid:107)
again.
σmin
. Furthermore we can get probabilities on each of these events using Lemma 7 once
18
These probabilities are
(cid:18)
P
I1 <
2εσmin
9M 2e4ηbμ2
2
εσmin
9M 2e4ηbμ2
εσmin
18M 2e4ηb(cid:107)μ1(cid:107)
(cid:19)
(cid:19)
(cid:19)
≥ 1 − e1/4 exp
≥ 1 − e1/4 exp
≥ 1 − e1/4 exp
(cid:18)
(cid:18)
(cid:18)
(cid:26)
(cid:26)
(cid:26)
−
−
−
1
8
1
8
1
8
min
4ε2σ2
81b2M 4e8ηbμ4
2
ε2σ2
81b2M 6e8ηbμ2
2
ε2σ2
min
(cid:19)
324M 6e8ηb(cid:107)μ1(cid:107)2 ∧ 1
min
(cid:27)
n0
(cid:19)
(cid:27)
∧ 1
n1
(cid:19)
(cid:27)
∧ 1
n0
(cid:107)μ1 − W1(cid:107)≤
(cid:18)
P
(cid:18)
P
|μ2 − W2|≤
Therefore using unions bounds and taking η = (cid:107) ̃θ(cid:107) we have that
P((cid:107)ˆθ(cid:48) − ̃θ(cid:107)≤ ε) ≥ P
(cid:18)
(cid:107)∇θ ˆL( ̃θ)(cid:107)≤
εσmin
M 4e4(cid:107) ̃θ(cid:107)b
(cid:19)
, A
≥ 1 − α exp (cid:8)−C(ε2 ∧ γ)nmin
(cid:9)
where
α := d + 5e1/4
(cid:40)
C :=
min
1
8
γ :=
1
8C
min
,
4σ2
min
81b2M 4e8(cid:107) ̃θ(cid:107)bμ4
2
(cid:27)
(cid:26) μ2
σmin
2
4b2 , 1
4b2 ,
ε2σ2
81b2M 6e8(cid:107) ̃θ(cid:107)bμ2
2
min
,
ε2σ2
324M 6e8(cid:107) ̃θ(cid:107)b(cid:107)μ1(cid:107)2
min
(cid:41)
As ˆL is convex for any sample we know that if ˆθ(cid:48) is in the interior of B1( ̃θ) then ˆθ(cid:48) = ˆθ. Therefore, for any
0 < ε < η the same result holds replacing ˆθ(cid:48) with ˆθ.
hence now gives us that for log(α/δ)
Cnmin
≤ γ ∧ (cid:107) ̃θ(cid:107) w.p. 1 − δ
(cid:107)ˆθ − ̃θ(cid:107)≤
(cid:115)
log(α/δ)
Cnmin
If we assume δ ≤ 1
(log(α)+1) log(1/δ)
(cid:107) ̃θ(cid:107)∧γ
w.p. 1 − δ,
2 then log(α/δ) ≤ (log(α) + 1) log(1/δ). Therefore we have that provided nmin ≥
(cid:115)
(cid:107)ˆθ − ̃θ(cid:107)≤
(log(α) + 1) log(1/δ)
Cnmin
.
Finally, taking C0 := log(α)+1
min{C,(cid:107) ̃θ(cid:107),γ}
gives our desired result.
A.2.1 Bound on KLIEP Normalising Constant
We now give a finite sample bound for the normalising constant calculated in KLIEP
Corollary 10. Define N ∗, ˆN to be
N ∗ := E[r ̃θ(Z 0)]
1
m0
ˆN :=
m0(cid:88)
i=1
rˆθ(Z 0
i )
with ˆθ, ̃θ, r ̃θ defined as before. Then we have that for δ ∈ (0, 1/2], provided nmin > CN log(1/δ),
(cid:107)N ∗ − ˆN (cid:107)≤
P
(cid:115)
CN log(1/δ)
nmin
≥ 1 − δ
with CN a constant depending upon C0, b, (cid:107) ̃θ(cid:107).
19
Proof. We condition upon the same events we condition upon in Theorem 9. Specifically for δ ∈ (0, 1/2], provided
nmin > 2C0 log(1/δ), w.p. at least 1 − δ the following two conditions hold:
(cid:107)ˆθ − ̃θ(cid:107) ≤
(cid:115)
C0 log(1/δ)
nmin
|μ2 − W2| <
εσmin
18M 2e4ηb(cid:107)μ1(cid:107)
with ε = (cid:112)C0 log(α/δ). The first conditions implies
|r ̃θ(z) − rˆθ(z)| ≤ e(cid:107) ̃θ(cid:107)b
(cid:115)
2C0 log(1/δ)
nmin
Therefore we have that
|N ∗ − ˆN | ≤
≤
(cid:12)
(cid:12)
E[r ̃θ(Z 0)] −
(cid:12)
(cid:12)
(cid:12)
(cid:115)
C1 log(1/δ)
nmin
1
n0
n
(cid:88)
i=1
r ̃θ(Z 0
i )
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
+
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1
n0
n0(cid:88)
i=1
rˆθ(Z 0
i ) −
1
n0
n0(cid:88)
i=1
(cid:12)
(cid:12)
r ̃θ(Z 0
(cid:12)
i )
(cid:12)
(cid:12)
(cid:115)
+ e(cid:107) ̃θ(cid:107)b
C0 log(1/δ)
nmin
with
C1 :=
σmin
(cid:112)C (cid:48)
0(log(α) + 1)
18M 2e4(cid:107) ̃θ(cid:107)b(cid:107)μ1(cid:107)
Taking CN = (
√
C0 + e(cid:107) ̃θ(cid:107)b
√
C1)2 gives our desired result.
A.3 Proof of Lemma 1
Proof. Throughout, unless stated otherwise, all integrals are taken w.r.t. μ (note that for any integral over some
subset A of Z this is equivalent to taking the integral w.r.t ν.)
First we prove that
p(cid:48)(cid:48)(z) = (1 − φ(x))p(z)
for μ almost every z ∈ Z. by showing that for all A ∈ BZ
P(X ∈ A) =
(cid:90)
A
(1 − φ(x))p(x)ν(dx)
Indeed
(cid:90)
A
(1 − φ(x))p(x)dx = E[1{Z ∈ A}(1 − φ(Z))]
= E[1{Z ∈ A}] − E[1{Z ∈ A}1{X = ∅}] by definition of φ(Z)
= E[1{Z ∈ A}1{X (cid:54)= ∅}] by linearity of expectation
= P(Z ∈ A, X (cid:54)= ∅)
= P(Z ∈ A, X = Z)
= P(X ∈ A)
We now have that for any A ∈ BZ ,
P(X ∈ A|X (cid:54)= ∅) = P(X (cid:54)= ∅)−1P(X ∈ A)
= P(X (cid:54)= ∅)−1
= P(X (cid:54)= ∅)−1
(cid:90)
A
(cid:90)
A
p(cid:48)(cid:48)(x)ν(dx)
(1 − φ(x)p(x)μ(dx)
20
and so p(cid:48) = P(X (cid:54)= ∅)−1 * (1 − φ) * p.
We also have that p can be extended to a density over X by taking p(∅) = 0. This combined with the above
result gives us that
p(x)
p(cid:48)(cid:48)(x)
:=
1{x (cid:54)= ∅}
1 − φ(x)
for ν almost every x ∈ X .
Hence we can use importance weighting to get our desired result.
A.4 Proof M-KLIEP Finite Sample Bounds
Lemma 11. Let W, V be two RVs over Rd with p.d.f.s pW pV w.r.t. some measure ν. Assume that g := pW
is
pV
well defined and g(w) ≤ α for all w ∈ Rd. Finally suppose that (cid:107)W (cid:107), (cid:107)V (cid:107)≤ b a.s. Then we have that for any
0 < ε < b
P
(cid:18)(cid:12)
(cid:12)
(cid:12)
(cid:12)
E[W ] −
1
n
g(V )V
(cid:19)
≤ ε
(cid:12)
(cid:12)
(cid:12)
(cid:12)
≥ 1 − e1/4 exp
(cid:27)
(cid:26)
−
ε2n
8αb2
Proof. This proof is a direct corollary of Lemma 7 First we clearly have that (cid:107)g(V )V (cid:107)≤ αb a.s.. Second we have
that
E((cid:107)g(V )V (cid:107)2) = E[g(V )2(cid:107)V (cid:107)2]
= E[g(W )(cid:107)W 2(cid:107)]
≤ αE[(cid:107)W (cid:107)2]
≤ ab2.
Hence as E[g(V )V − E[W ]] = 0, we can use the Bernstein inequality to get
P
(cid:18)(cid:12)
(cid:12)
(cid:12)
(cid:12)
E[W ] −
(cid:12)
(cid:12)
g(V )V )
(cid:12)
(cid:12)
1
n
(cid:19)
≤ ε
≥ 1 − e1/4 exp
(cid:27)
(cid:26)
−
ε2n
8αb
Remark 4. If we want to remove the requirement that ε < b we can re-write this as
P
(cid:18)(cid:12)
(cid:12)
(cid:12)
(cid:12)
E[W ] −
1
n
g(V )V
(cid:19)
≤ ε
(cid:12)
(cid:12)
(cid:12)
(cid:12)
≥ 1 − e1/4 exp
(cid:26)
−
(cid:18) ε2
(cid:27)
(cid:19) n
8α
b2 ∧ 1
Lemma 12. Let W, V be two RVs over Rd, with densities pW , pV respectively s.t. (cid:107)W (cid:107), (cid:107)V (cid:107)< b a.s.. Assume
that g := pW
: Rd → Rp is well defined with g(w) < α for all w ∈ Rd. . Let V1, . . . , Vn be IID copies of V . Now
pV
define the importance weighted sample covariance by of W estimated by {Vi}i∈[n]
(cid:100)Var(W ; {Vi}i∈[n]) :=
(cid:32)
1
n
n
(cid:88)
i=1
g(Vi)ViV (cid:62)
i
(cid:33)
1
n
(cid:88)
i∈[n]
(cid:32)
g(Vi)
−
1
n
n
(cid:88)
i=1
g(Vi)Vi
(cid:33) (cid:32)
1
n
n
(cid:88)
i=1
(cid:33)(cid:62)
g(Vi)Vi
then provided σmin ≤ 4b2
(cid:18)
λmin((cid:100)Var(W ; {Vi}i∈[n]) ≥
P
(cid:19)
1
2
σmin
≥ 1 − (d + 2e1/4) exp{
a(cid:48)σminn
αb2
}
where a(cid:48) := (2−
32
√
3)2
and σmin := λmin(Var(W )).
21
Proof. Define the centred RVs Y1, . . . , Yn by Yi := Vi − E[Wi] and the random matrices Rn, Sn by
Sn :=
Rn :=
an :=
1
n
(cid:32)
n
(cid:88)
i=1
g(Vi)YiY (cid:62)
i
1
n
n
(cid:88)
i=1
g(Vi)Yi
(cid:33) (cid:32)
1
n
n
(cid:88)
i=1
(cid:33)(cid:62)
g(Vi)Yi
1
n
(cid:88)
i∈[n]
g(Vi)
so that anRn − Sn = (cid:100)Var(W ; {Yi}i∈[n]).
(cid:100)Var(W ; {Vi}i∈[n]).
Firstly we can use the matrix Chernoff inequalities (Tropp, 2015), alongside the fact that E[Sn] = Var(W ) and
λmax( 1
Simple algebraic manipulation gives us that anRn − Sn =
i ) ≤ αb2
n g(Vi)YiY (cid:62)
n to get
(cid:32)
P
λmin(Sn) ≥
√
3
2
(cid:33)
σmin
≥ 1 − d exp
(cid:110)
−
(cid:111)
aσminn
αb2
Now note that for any x ∈ Rd λmax(xx(cid:62)) = (cid:107)x(cid:107)2 so that λmax(Rn) = (cid:107) 1
use vector Bernstein bounds to get that provided σmin ≤ 4b2
n Yi(cid:107)2. Hence, as E[g(Vi)Yi] = 0, we can
(cid:18)
λmax(Rn) ≤
P
(cid:19)
= P
σmin
1
4
(cid:32)(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
1
n
n
(cid:88)
i=1
g(Vi)Yi
≥ 1 − e1/4 exp
(cid:110)
−
<
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
σminn
32αb2
(cid:33)
√
σmin
1
2
(cid:111)
.
Finally by Lemma 11,
(cid:32)
P
an ≥
(cid:33)
√
3
2
≥ 1 − e1/4 exp
(cid:40)
(2 −
√
(cid:41)
3)2n
32α
Taking the intersection of these three events we get that w.p. at least 1 − (d + 2e1/4) exp
(cid:110)
−
λmin((cid:100)Var(W ; {(Vi, g(Vi))}i∈[n]) = λmin(anSn − Rn)
(cid:16) a(cid:48)σmin
b2 ∧ 1
(cid:111)
(cid:17) n
8α
where a(cid:48) := (2−
3)2
√
4
≥
=
≥ λmin(anSn) − λmax(Rn)
= anλmin(Sn) − λmax(Rn)
√
√
3
2
1
2
3
2
σmin −
1
4
σmin
λmin(Var(W ))
We can now state the Lemma which gives rise to Theorem 9.
Lemma 13. Let rθ take the log-linear form and for for θ ∈ Rd define and L, ˆL(cid:48) by
i (cid:54)= ∅}
1{X 1
1 − φ1(X 1
i )
n0(cid:88)
i (cid:54)= ∅}
1{X 0
1 − φ0(X 0
i )
L(θ) := −E[rθ(Z 1)] + log E[rθ(Z 0)] ˆL(cid:48)(θ; D(cid:48)) := −
1
n1
1
n0
+ log
n1(cid:88)
i=1
i=1
log rθ(X 1
i )
rθ(X 0
i ).
22
Finally, define the constant ̃θ and the RV ˆθ, by
̃θ := argmax
L(θ)
θ∈Rd
ˆθ := argmax
ˆL(cid:48)(θ, D(cid:48)).
θ∈Rd
Now suppose that (cid:107)φ0(cid:107)∞< 1, (cid:107)φ1(cid:107)∞< 1, (cid:107)f (cid:107)∞< ∞ and additionally let σmin := λmin(Var(f (Z 0))) > 0
Then we have that for any δ < 1
2 and meff min ≥ C (cid:48)
0 log(1/δ),
(cid:107)ˆθ(cid:48) − ̃θ(cid:107)≤
P
(cid:115)
C (cid:48)
0 log(1/δ)
meff
≥ 1 − δ
where C (cid:48)
0 a constant depending upon (cid:107)f (cid:107)∞, σmin, d, (cid:107) ̃θ(cid:107).
Proof. Firstly we define the population version of ˆL(cid:48) by L(cid:48) as follows
L(cid:48)(θ) = E
(cid:20) 1{X 1 (cid:54)= ∅}
1 − φ1(X 1)
(cid:21)
log r(X 1)
− log E
(cid:20) 1{x0 (cid:54)= ∅}
1 − φ0(X 0)
(cid:21)
.
Then from Lemma 1 we have that L(θ) = L(cid:48)(θ). As a result we can re-define ̃θ to be
̃θ := argmin
L(cid:48)(θ)
θ∈Rd
i=1) is linear in θ
For proof of convexity we note that again the term involving D
and the second term is convex for the same reason as ˆL is with the caveat that we replace g : Rn0 → R by
D0 : Rn0 → R defined by
g(cid:48)
(cid:48)+ (our sample from {X 1
i }n1
g(x) = log
n
(cid:88)
i=1
wi exp{xi} where
w0
i :=
i (cid:54)= ∅}
1{x0
1 − φ0(x0
i )
.
As each wi > 0, this modified log-sum-exp is also convex by the same argument which makes the unmodified
log-sum-exp function convex. That is,
∇2
xg(cid:48)
D0 (z) =
diag(u)(1(cid:62)u) − uu(cid:62)
(1(cid:62)u)2
where ui = w0
i exp(zi). If we then let v ∈ Rn0, we get
v(cid:62)∇2
xg(cid:48)
D0 (z) =
=
v(cid:62)diag(u)v(1(cid:62)u) − v(cid:62)uu(cid:62)v
(1(cid:62)u)2
i ui)((cid:80)n1
((cid:80)n0
i=1 v2
i=1 ui) − ((cid:80)n0
(1(cid:62)u)
i=1 viui)
> 0
where the final inequality is given by the Cauchy-Schwartz inequality.
For ease of notation we define b := (cid:107)f (cid:107)∞ and M := exp (cid:107) ̃θ(cid:107)b. We now aim to bound λmin(∇2
θ
ˆL(cid:48)( ̄θ)) from below.
23
To this end we have
∇2
θ
ˆL(θ; D) :=
(cid:23)
(cid:23)
(cid:80)
(cid:80)
i w0
i,j w0
i )r ̄θ(X 0
j r ̄θ(X 0
(cid:80)
1
n2
i,j M −2e−2ηbw0
1
n2
0
1
n2
0
(cid:80)
1
n2
i,j w0
(cid:80)
1
n2
0
1
M 2e4ηb
i ) − f (X 0
j )](cid:62)
j )[f (X 0
j r ̄θ(X 0
i w0
i,j w0
i ) − f (X 0
j [f (X 0
i w0
j r ̄θ(X 0
i w0
i,j e2ηbw0
i ) − f (X 0
j [f (X 0
i w0
(cid:80)
1
j r ̃θ(X 0
i w0
n0
(cid:21)
i ) − f (X 0
j )][f (X 0
i )r ̄θ(X 0
j )
j )][f (X 0
i )r ̄θ(X 0
j )
i ) − f (X 0
j )][f (X 0
i )r ̃θ(X 0
j )
i,j w0
j )](cid:62)
i ) − f (X 0
j )](cid:62)
=:
2
M 4e4ηb
(cid:20)
f (Z 0); D(cid:48)
(cid:100)Var0
1, {w0
i=1
i }n0
(cid:21)(cid:19)2
(cid:18)
(cid:98)E(cid:48)
(cid:20)
r ̃θ(Z 0); D(cid:48)
1
where, for square matrices A, B we take A (cid:23) B, to mean A − B is positives semi-definite. We can then bound
(cid:100)Var0 and (cid:98)E(cid:48) similarly to before to get that
(cid:18)
P
P
λmin((cid:100)Var(f (Z), D(cid:48)
E(cid:48)(cid:20)
(cid:18)
r ̃θ(Z 0); D(cid:48)
≤
(cid:21)
1
1)) ≥
(cid:19)
1
2
σmin
≥ 1 − (d + 2e1/4) exp{−
(cid:19)
E[r ̃θ(X 0)]
3
2
≥ 1 − e1/4 exp
(cid:26)
−
(cid:16) μ2
4M 2 ∧ 1
(cid:18) a(cid:48)σmin
(cid:19) n0(1 − φ0
max)
}
b2 ∧ 1
(cid:17) n0(1 − φ0
max)
8
(cid:27)
8
where again σmin := λmin(Var(f (Z 0)), μ2 := E[r ̃θ(Z 0)].
Therefore we have that
P
λmin(∇2
θ
(cid:124)
ˆL(cid:48); (θ; D(cid:48))) ≥
(cid:123)(cid:122)
:=A(cid:48)
4σmin
9M 2e4ηbμ2
2
(cid:125)
≥ 1 − (d + 3e1/4) exp
(cid:26)
−
(cid:18) μ2
4M 2 ∧
a(cid:48)σmin
b2 ∧ 1
(cid:19) n0(1 − φ0
max)
(cid:27)
8
(11)
We now have all the bounds required to continue with the main body of the proof. Let ˆθ(cid:48) be defined as the
solution to the following constrained optimisation problem.
ˆL(θ, D(cid:48))
min
θ∈Bη( ̃θ)
By and identical argument to Theorem 9 we then get that
(cid:107)ˆθ(cid:48) − ̃θ(cid:107)≤
1
λmin(∇2
θ
ˆL(cid:48)( ̄θ))
(cid:107)∇θ ˆL(cid:48)( ̃θ)(cid:107).
for some ̄θ ∈ Bη( ̃θ).
Hence if A(cid:48) from (11) holds with our given ̄θ ∈ Bη( ̃θ) we have that
a.s. .
(cid:107)∇θ ˆL( ̃θ)(cid:107)
(cid:107)ˆθ(cid:48) − ̃θ(cid:107) ≤
9M 2e4ηbμ2
2
4σmin
From now on we will work on the event A so that bounding (cid:107)ˆθ − ̃θ(cid:107) simply requires us to bound (cid:107)∇θ ˆL( ̃θ)(cid:107).
We further get that (cid:107)∇θ ˆL(cid:48)( ̃θ)(cid:107)≤ I (cid:48)
1 + I (cid:48)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
i (cid:54)= ∅}
1{X 1
∇θr ̃θ(X 1
i )
1 − φ1(X 1
r ̃θ(X 1
i )
i )
(cid:13)
1{X 0
i (cid:54)=∅}
i ) ∇θr ̃θ(X 0
(cid:13)
i )
1−φ0(X 0
(cid:13)
(cid:13)
1{X 0
i (cid:54)=∅}
(cid:13)
i ) r ̃θ(X 0
i )
(cid:13)
1−φ0(X 0
2 where
(cid:20) ∇θr ̃θ(Z 1)
r ̃θ(Z 1)
E[∇θr ̃θ(X 0)]
E[r ̃θ(X 0)]
i=1
(cid:80)n0
i=1
(cid:80)n0
i=1
I (cid:48)
2 =
I (cid:48)
1 =
1
n1
n1(cid:88)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
1
n0
1
n0
−
−
E
(cid:21)
.
24
Define RVs W (cid:48)
1, W (cid:48)
2
W (cid:48)
1 :=
W (cid:48)
2 :=
1
n0
1
n0
(cid:88)
i∈[n0]
(cid:88)
i∈[n0]
i (cid:54)= ∅}
1{X 0
1 − φ0(X 0
i )
i (cid:54)= ∅}
1{X 0
1 − φ0(X 0
i )
∇θr ̃θ(X 0
i )
r ̃θ(X 0
i )
and μ1 := E[∇θr ̃θ(Z 0)]. We can then bound I (cid:48)
2 to get
I (cid:48)
2 :=≤
(cid:107)μ1 − W (cid:48)
1(cid:107)
μ2
+
2|(cid:107)μ1(cid:107)
|μ2 − W (cid:48)
μ2W (cid:48)
2
Thus to have
it is sufficient to have
1 + I (cid:48)
I (cid:48)
2 <
4σmin
ε9M 2e4ηbμ2
2
,
I (cid:48)
1 <
(cid:107)μ1 − W (cid:48)
1(cid:107) <
|μ2 − W (cid:48)
2| <
provided ε < 9M 2e4ηbμ2(cid:107)mu1(cid:107)
σmin
.
The probabilities for these events are
,
2εσmin
9M 2e4ηbμ2
2
εσmin
9M 2e4ηbμ2
εσmin
18M 2e4ηb(cid:107)μ1(cid:107)
,
.
(cid:18)
P
I (cid:48)
1 <
2εσmin
9M 2e4ηbμ2
2
εσmin
9M 2e4ηbμ2
εσmin
18M 2e4ηb(cid:107)μ1(cid:107)
(cid:19)
(cid:19)
(cid:19)
≥ 1 − e1/4 exp
≥ 1 − e1/4 exp
≥ 1 − e1/4 exp
(cid:18)
(cid:18)
(cid:18)
(cid:26)
(cid:26)
(cid:26)
−
−
−
1
8
1
8
1
8
min
4ε2σ2
81b2M 4e8ηbμ4
2
ε2σ2
81b2M 6e8ηbμ2
2
ε2σ2
min
(cid:18)
P
(cid:107)μ1 − W (cid:48)
1(cid:107)≤
(cid:18)
P
|μ2 − W (cid:48)
2|≤
(cid:19)
(cid:19)
∧ 1
∧ 1
(cid:27)
n1(1 − φ1
max)
(cid:27)
n0(1 − φ0
max)
(cid:19)
324M 6e8ηb(cid:107)μ1(cid:107)2 ∧ 1
min
(cid:27)
n0(1 − φ0
max)
Therefore by the same argument as Theorem 9 we get
P((cid:107)ˆθ − ̃θ(cid:107)≤ ε) ≥ P
(cid:16)
(cid:107)∇θ ˆL( ̃θ)(cid:107)≤
M 4e4ηb , A(cid:48)(cid:17)
≥ 1 − α(cid:48) exp (cid:8)−C (cid:48) (cid:0)ε2 ∧ γ(cid:1) meff
εσmin
(cid:9) .
where
α(cid:48) := d + 6e1/4
(cid:40)
C (cid:48) :=
min
1
8
γ(cid:48) :=
1
8C
min
4σ2
min
81b2M 4e8(cid:107) ̃θ(cid:107)bμ4
2
(cid:26) a(cid:48)μ2
2
M 2 ,
σmin
4b2 , 1
,
ε2σ2
81b2M 6e8(cid:107) ̃θ(cid:107)bμ2
2
min
,
ε2σ2
324M 6e8(cid:107) ̃θ(cid:107)b(cid:107)μ1(cid:107)2
min
(cid:41)
(cid:27)
25
By an identical argument to the proof of Theorem 9 in Section A.2 this gives us that for us that for δ ≤ 1
2 ,
provided meff ≥ log(α(cid:48)) log(1/δ)
then
γ(cid:48)∧(cid:107) ̃θ(cid:107)
(cid:107) ̃θ − ˆθ(cid:107)≤
P
(cid:115)
log(α(cid:48)) log(1/δ)
C (cid:48)meff
≥ 1 − δ.
Now taking C (cid:48)
0 :=
log(α(cid:48))
min{C(cid:48),(cid:107) ̃θ(cid:107),γ(cid:48)}
gives our desired result.
A.4.1 Bound on Normalisation term in M-KLIEP
Corollary 14. Define N ∗, ˆN (cid:48) to be
N ∗ := E[r ̃θ(Z 0)]
1
m0
ˆN :=
m0(cid:88)
i=1
i (cid:54)= ∅}
1{X 0
1 − φ0(x0
i )
rˆθ(cid:48)(X 0
i )
with ˆθ(cid:48), ̃θ, r ̃θ defined as before. Then we have that for δ ∈ (0, 1/2], provided nmin > C (cid:48)
N log(1/δ),
(cid:107)N ∗ − ˆN (cid:107)≤
P
1
1 − (cid:107)φ0(cid:107)∞
(cid:115)
C (cid:48)
N log(1/δ)
meff
≥ 1 − δ
Proof. We work assuming the same events hold as in Theorem 2. Crucially we have that for δ ∈ (0, 1/2], provided
meff ≥ C (cid:48)
0 log(1/δ), w.p. at least 1 − δ the following two events hold
(cid:107)ˆθ − ̃θ(cid:107) ≤
(cid:115)
2C (cid:48)
0 log(1/δ)
nmin
|μ2 − W (cid:48)
2| <
εσmin
18M 2e4ηb(cid:107)μ1(cid:107)
We will refer to these inequalities as A and B respectively. A then implies,
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1{x (cid:54)= ∅}
1 − φ0(x)
r ̃θ(x) −
1{x (cid:54)= ∅}
1 − φ0(x)
rˆθ(z)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
≤
1
1 − (cid:107)φ0(cid:107)∞
e(cid:107) ̃θ(cid:107)b
(cid:115)
C (cid:48)
0 log(1/δ)
nmin
Therefore A and B together give
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:115)
|N ∗ − ˆN (cid:48)| ≤
≤
C (cid:48)
1
with
E[r ̃θ(Z 0)] −
1
n0
n
(cid:88)
i=1
r ̃θ(Z 0
i )
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
+
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1
n0
n0(cid:88)
i=1
rˆθ(cid:48)(Z 0
i ) −
1
n0
n0(cid:88)
i=1
(cid:12)
(cid:12)
r ̃θ(Z 0
(cid:12)
i )
(cid:12)
(cid:12)
log(1/δ)
meff
+
1
1 − (cid:107)φ0(cid:107)∞
e(cid:107) ̃θ(cid:107)b
(cid:115)
C (cid:48)
0 log(1/δ)
meff
C1 :=
σmin
(cid:112)C (cid:48)
0(log(α) + 1)
18M 2e4(cid:107) ̃θ(cid:107)b(cid:107)μ1(cid:107)
.
Therefore, taking C (cid:48)
N = ((cid:112)C (cid:48)
0 + exp{(cid:107) ̃θ(cid:107)b}(cid:112)C (cid:48)
1)2 gives our desired result.
A.5 M-KLIEP Lower Bound
For each ζ ∈ (0, ∞) let's define a density fζ of a measure supported on [0, 1] by
fζ(y) =
ζeζy
eζ − 1
,
for y ∈ [0, 1], and fζ(y) = 0 for y /∈ [0, 1]. In addition, let f0 denote the uniform density on [0, 1].
26
Lemma 15. For all ζ ∈ [0, 2] we have
Proof. Given any ζ ∈ (0, 2] we have
KL(f0, fζ) ≤
ζ 2
20
.
KL(f0, fζ) =
(cid:90) 1
0
log
(cid:19)
(cid:18) eζ − 1
ζeζy
dy = log
(cid:27)
(cid:26) sinh(ζ/2)
(ζ/2)
(cid:18)
≤ log
1 +
(cid:19)
ζ 2
20
≤
ζ 2
20
,
where the penultimate inequality uses the bound (Kl ́en et al., 2010, Lemma 3.3 (i)). The case where ζ = 0 is
immediate.
√
2] × [0, 1/(cid:112)2(d − 1)]d−1, take X 0 = Z 0 ∼ P0 and Cd :=
Let P0 be the uniform distribution on Ad := [0, 1/
(cid:112)2d * (d − 1)d−1. Moreover, given ζ ∈ [0, 2], w1 ∈ [0, 1] and τ ∈ {0, 1} we write P1(ζ, w1, τ ) for the distribution
on X 1 = (X 1
2z1) on Ad, and choosing
φ1 so that φ1(z) = w1 for all z ∈ [0, 1]d. We write P n0,n1(ζ, w1, τ ) for the joint distribution on D(cid:48) := (D(cid:48)
0, D(cid:48)
1)
where D(cid:48)
Lemma 16. Given ζ ∈ [0, 2], n1 ∈ N and w1 ∈ [0, 1] we have
j )j∈[d] constructed by choosing Z 1 with density (zj)j∈[d] (cid:55)→ Cd * fτ *ζ(
1 ∼ P1(ζ, w1, τ )n1.
0 ∼ P n0
0
and D(cid:48)
√
KL (cid:8)P n0,n1(ζ, w1, 0), P n0,n1 (ζ, w1, 0)(cid:9) ≤
n1(1 − w1)ζ 2
20
.
Proof. We have
KL {P1(ζ, w1, 0), P1(ζ, w1, 1)} =
(cid:90)
log
(cid:19)
(cid:18) dP1(ζ, w1, 0)
dP1(ζ, w1, 1)
(cid:33)
√
(cid:16)
Cd * f0(
dP1(ζ, w1, 0)
2 * z1)
(cid:17)
dz1
(cid:90)
Ad
(cid:90)
= (1 − w1) *
= (1 − w1) *
log
log
[0,1]
(cid:32)
Cd * f0(
Cd * fζ(
(cid:19)
(cid:18) f0(y)
fζ(y)
X
√
√
2 * z1)
2 * z1)
f0(y)dy
= (1 − w1) * KL(f0, fζ) ≤
(1 − w1) * ζ 2
20
,
where we used Lemma 15 in the final step. Hence, by the product rule for Kullback-Leibler divergence (Tsybakov,
2009, Chapter 2) we have
KL (cid:8)P n0,n1 (ζ, w1, 0), P n0,n1(ζ, w1, 0)(cid:9)
= n0 * KL (P0, P0) + n1 * KL {P1(ζ, w1, 0), P1(ζ, w1, 1)} ≤
n1(1 − w1)ζ 2
20
.
We are now ready to complete the proof of Theorem 3.
√
(cid:55)→
Proof of Theorem 3. We assume, without loss of generality, that n1w1 ≤ n0w0. Suppose Z 0 ∼ P0 and Z 1 has
2], τ ∈ {0, 1} then the density ratio between the
density (zj)j∈[d]
densities of Z 1 and Z 0 is proportional to eθ(ζ,τ )(cid:62)z on [0, 1]d where θ(ζ, τ ) = (
2 * τ * ζ, 0, . . . , 0)(cid:62) ∈ Rd, and
hence (cid:107)θ(ζ, τ )(cid:107)≤ 1. Next, we convert ˆθ = (ˆθj)j∈[d] into an estimator ˆτ by ˆτ = 1{ˆθj > ζ/
2}. Consequently, for
τ ∈ {0, 1} we have
2 * z1) for some ζ ∈ [0, 1/
2 * fτ *ζ(
√
√
√
√
(cid:107)ˆθ − θ(ζ, τ )(cid:107)2 ≥ |ˆθ1 − ζτ |≥
ζ
√
2
* 1{ˆτ (cid:54)= τ }.
27
Hence, by (Tsybakov, 2009, Theorem 2.2(iii)) for at least one τ ∈ {0, 1} we have
min
τ ∈{0,1}
P
D(cid:48)∼P n0 ,n1 (ζ,w1,τ )
(cid:26)
(cid:107)ˆθ − θ(ζ, τ )(cid:107)2≥
(cid:27)
ζ
√
2
1
4
P
D(cid:48)∼P n0,n1 (ζ,w1,τ ) (ˆτ (cid:54)= τ ) ≥
(cid:18)
* exp
−
n1(1 − w1)ζ 2
20
(cid:19)
.
≥ min
τ ∈{0,1}
To complete the proof we take
(cid:40)(cid:115)
ζ := min
20 log(1/(4δ))
min{n0(1 − w0), n1(1 − w1)}
,
1
√
2
(cid:41)
.
A.6 Proof of Missing NP Classifier Finite Sample Bounds
Before we can proof this result we need to state a (relatively trivial) result on conditional probabilities.
Lemma 17. Let X, Y be RVs on measurable space (Z, BZ ) and define events F ∈ σ(X), and E0, E1 ∈ BZ .
Suppose that F ∩ E0 ⊆ E1 then
P(F ∩ {E[1E0Y |X] > E[1E1 Y |X]}) = 0.
Proof. Define the event C := {E[1E0Y |X] > E[1E1 Y |X]} then by construction, as F ∩ C ∈ σ(X), this gives
E[1E0∩F ∩CY ] = E[E[1E0Y |X]1F ∩C]
≥ E[E[1E1Y |X]1F ∩C]
= E[1E1∩F ∩CY ]
where equality holds throughout if and only if P(F ∩ C) = 0. Alternatively, as F ∩ E0 ⊆ E1 we have that
F ∩ E0 ∩ C ⊆ F ∩ E1 ∩ C so that
E[1F ∩C∩E0Y ] ≤ E[1F ∩C∩E1Y ].
Therefore equality holds and P(F ∩ C) = 0.
We can now go on to prove Theorem 5
Proof of Theorem 5. This proof is adapted from Tong (2013).
For notational simplicity we define functions ˆh, ̃h : Z → R by
so that R1( ˆφ), R1( ̃φ) can be re-written as
Define events G0, G1 by
ˆh(z) := g ◦ rˆθ
̃h(z) := g ◦ r ̃θ
ˆφ = P(ˆh(Z 1) ≤ ˆCα,δ,ˆh)
̃φ = P( ̃h(Z 1) ≤ C ∗
α, ̃h)
G0 := { ̃h(Z 0) > C ∗
G1 := { ̃h(Z 0) ≤ C ∗
α, ̃h, ˆh(Z 0) ≤ ˆCα,δ,ˆh}
α, ̃h, ˆh(Z 0) > ˆCα,δ,ˆh}
28
We now have that
R1( ˆφ) − R1( ̃φ) = E
(cid:104)
1G0 ∪ G1
(cid:12)
(cid:12)
(cid:12)
̃h(Z 0) − C ∗
α, ̃h
(cid:105)
(cid:12)
(cid:12)
(cid:12)
+ 2C ∗
α, ̃h(P( ̃h(Z 0) ≥ C ∗
α, ̃h) − P(ˆh(Z 0) ≥ ˆCα,δ,ˆh))
For ease of notation we will define ∆m0
eff ,δ as in Lemma 4, that is,
∆m0
eff ,δ :=
(cid:115)
16 log(1/δ)
m0
eff
Now define 2 events E0, E1 as follows
E0 := {(cid:107)ˆθ − ̃θ(cid:107)≤ ε(cid:48)(cid:48)}
E1 := {P(ˆh(X 0)) ≥ ˆCα,δ,ˆh|D(cid:48)) ≥ α − 2∆m0
eff ,δ}
where
(cid:115)
ε(cid:48)(cid:48) :=
C (cid:48)
0 log(1/δ)
meff
.
Theorem 2 and Lemma 4 give us that both these events occur w.p. 1 − δ so that P(E0 ∩ E1) ≥ 1 − 2δ. We now
aim to show that,
E0 ∩ E1 ⊆ {R1( ˆφ) − R1( ̃φ) < ε(cid:48)}.
We immediately have that
E1 ⊆ {P( ̃h(Z 0) ≥ C ∗
α, ̃h) − P(ˆh(Z 0) ≥ ˆCα,δ,ˆh|D(cid:48)) ≤ 2∆δ,meff }
Additionally, we note that as (cid:107)∇θg ◦ rθ(z)(cid:107)≤ L for all z, θ, so that
E0 ⊆ {sup
z∈Z
(cid:107) ̃h(z) − ˆh(z)(cid:107)2≤ ε(cid:48)(cid:48)L}.
We now aim to bound ˆCα,δ,g above. Taking the intersection of these two events we get that
E0 ∩ E1 ⊆ {P( ̃h(Z 0) ≥ ˆCα,δ,ˆh − ε(cid:48)(cid:48)L| ˆCα,δ,ˆh) ≥ α − 2∆m0
eff ,δ}
On the other hand, the lower bound on our condition gives that 2∆m0
eff ,δ > a,
2∆m0
eff ,δ ≤ P[C ∗
α, ̃h < ̃h(Z 0) ≤ C ∗
α, ̃h + (2B0∆m0
= P[ ̃h(X 0) ≤ C ∗
= P[ ̃h(X 0) ≤ C ∗
α, ̃h + (2B0∆m0
α, ̃h + (2B0∆m0
eff ,δ)1/γ0]
eff ,δ)1/γ0 ] − P[ ̃h(X 0) ≤ C ∗
eff ,δ)1/γ0 ] − (1 − α).
α, ̃h]
Combining these two results we get that
E0 ∩ E1 ⊆ {P[ ̃h(X 0) ≥ C ∗
α, ̃h + (2B0∆m0
eff ,δ)1/γ0] ≤ α − 2∆m0
eff ,δ ≤ P[ ̃h(X 0) ≥ ˆCα,δ, ̃h − ε(cid:48)L| ˆCα,δ,ˆh]},
and hence, E0 ∩ E1 ⊆ { ˆCα,δ,g < C ∗
α, ̃h
+ ε(cid:48)(cid:48)L + (2B0∆m0
eff ,δ)1/γ0} which implies that
E0 ∩ E1 ⊆ {C ∗
α, ̃h ≤ ̃h(X 0) ≤ C ∗
α, ̃h + 2ε(cid:48)(cid:48)L + (2B0∆m0
eff ,δ)1/γ0} =: G(cid:48)
0.
We can now use this to bound the expectation. Indeed using Lemma 17 we have that
E0 ∩ E1 ⊆ {E[1{G0}| ̃h(Z 0) − C ∗
α, ̃h| |D(cid:48)] ≤ E[1{G(cid:48)
0}| ̃h(Z 0) − C ∗
α, ̃h||D(cid:48)]}
29
We we also have
with
E[1{G(cid:48)
0}| ̃h(Z 0) − C ∗
α, ̃h||D(cid:48)] ≤
(cid:16)
2ε(cid:48)(cid:48)L + (2B0∆m0
≤ B2(2ε(cid:48)(cid:48)L + (2B0∆m0
eff ,δ)1/γ0
P(G(cid:48)
0)
eff ,δ)1/γ0)γ1+1
(cid:17)
B2 := min
(cid:26)
1
B0aγ1/γ0
(cid:27)
, B1
where the final step uses our probability lower bound.
By an identical argument again
E0 ∩ E1 ⊆ {E[1G1| ̃h(Z 0) − C ∗
α, ̃h| |D(cid:48)] ≤ B2(2ε(cid:48)(cid:48)L + (2B0∆m0
eff ,δ)1/γ0)γ1+1}
and so we get
E0 ∩ E1 ⊆ {R1( ˆφ) − R1( ̃φ) ≤ 2B2(2ε(cid:48)(cid:48)L + (2B0∆m0
eff ,δ)1/γ0)γ1+1 + 2C ∗
α, ̃h∆δ,m0
eff
}.
Taking C2 := 4B2(L ∨ B0)(γ1 + 1) + 2C ∗
α, ̃h
therefore gives E0 ∩ E1 ⊆ {R1( ˆφ) − R1( ̃φ) ≤ ε(cid:48)} and hence,
P(R1( ˆφ) − R1( ̃φ) ≤ ε) ≤ P(R1( ˆφ) − R1( ̃φ) ≤ ε, E0 ∩ E1)
= P(E0 ∩ E1)
= 1 − 2δ.
B SUPPLEMENTARY METHODS
B.1 f -Divergence based DRE
We now present another example DRE which relates to the f -Divergence. First we state the following theorem
on which these approaches are built
Theorem 18. Let f : (0, ∞) → R be convex and lower-semicontinuous function and define f (cid:48) : R+ → R to be
the derivative of f . Firstly, there exists unique f ∗ : A → R with A ⊆ R by
Secondly,
f ∗(t) := sup
ut − f (u)
u∈(0,∞)
argmin
T ∈T
E[T (Z 1)] − E[f ∗(T (Z 0))] = T ∗
where, T ∗ := f (cid:48) ◦ r∗ and T is some set of non-negative functions containing T ∗.
As a direct result of this, for any set of positive real values functions G containing r∗ we have that
r∗ := argmax
r∈G
E[f (cid:48)(r(Z 1))] − E[f ∗(f (cid:48)(r(Z 0))]
We can then approximate this using D to get
1
n1
n1(cid:88)
i=1
f (cid:48)(r(Z 1
i )) −
1
n0
n0(cid:88)
i=1
f ∗(f (cid:48)(r(Z 0
i )))
30
Note that while we have theoretical guarantees of consistency in the case of correctly specified G, we have much
less justification for this approach in the case of incorrectly specified G. This is simply because from a heuristic
perspective, we have no idea if
̃r := argmax
E[f (cid:48)(r(Z 1))] − E[f ∗(f (cid:48)(r(Z 0)))]
r∈G
is sensible approximation of r∗ when G is miss-specified. As a result, one could argue that KLIEP is a more
principled approach as in the objective we are approximating we choose some notion of the "closest" r ∈ G to
r∗.
We now go on to expand this process in the case of 2 popular choice of f
JS-Divergence
If we take f (u) := u log(u) − (u + 1) log (cid:0) 1+u
corresponding f (cid:48) : (0, ∞) → R, f ∗ : (log(2), ∞) → R are then given by
2
(cid:1) then the associated f -divergence is the JS-Divergence. The
f (cid:48)(t) := log
(cid:19)
(cid:18) 2t
1 + t
f ∗(t) := − log(2 − exp(t))
giving us that
r∗ := argmax
E[f (cid:48)(r(Z 1))] − E[f ∗(f (cid:48)(r(Z 0)))]
r∈G
= argmax
r∈G
= argmax
r∈G
E
E
(cid:20)
log
(cid:18) 2r(Z 1)
1 + r(Z 1)
(cid:19)(cid:21)
(cid:20)
log
(cid:18) r(Z 1)
(cid:19)(cid:21)
1 + r(Z 1)
(cid:18)
(cid:18)
(cid:20)
(cid:20)
log
log
+ E
+ E
(cid:19)(cid:21)
(cid:19)(cid:21)
2
1 + r(Z 0)
1
1 + r(Z 0)
for correctly specified G. The form that our approximation for this take is highly similar to the form of the
logistic regression approach and is in fact identical when n1 = n0. The only difference being that this approach
adjusts for the class imbalance directly in the estimator while the logistic regression approach adjusts for it after
the fact.
KL-Divergence
If we take f (t) := t log(t) then the corresponding f -divergence is the KL-divergence. This choice of f has
corresponding f ∗ : R → R, f (cid:48) : (0, ∞) → R defined by
f ∗(t) := exp{t − 1}
f (cid:48)(t) := 1 + log(t).
Thus we get that
r∗ := argmax
E[f (cid:48)(r(X 1))] − E[f ∗(f (cid:48)(r(X 0)))]
r∈G
= argmax
E[log(r(X 1))] − E[r(X 0)].
r∈G
Note the objective of this estimator differs from KLIEP as E[r(X 0)] is not logged.
B.1.1 Adaptations to MNAR Data
Adapting this to work with D(cid:48) simply equates to modifying the objective to be
1
n1
n0(cid:88)
i=1
1{X 1
i (cid:54)= ∅}
1 − φ1(X 1
i )
f (cid:48)(X 1
i ) −
1
n0
n0(cid:88)
i=1
1{X 0
i (cid:54)= ∅}
1 − φ0(X 0
i )
f ∗(f (cid:48)(X 0
i )).
31
B.2 Original Neyman-Pearson Classification
We now describe the Neyman-Pearson classification procedure laid out in (Tong et al., 2018). This procedure is
describe in Algorithm 2 and constructs a classifier from our data. We assume we have n0 additional copies of Z 0
which we label Z 0
however the algorithm adapts to any number of samples from either distribution.
We also let g : R → R be any strictly increasing function. Note that the classifier produced by the algorithm
n0+1, . . . , Z 0
2n0
Algorithm 2 Neyman-Pearson Classification Procedure
i }n0
i }n1
i=1, {Z 0
i=1 to estimate r∗ with ˆr by any DRE procedure.
1: Use {Z 1
2: Set i∗ = min{i ∈ {1, . . . , n0}|P(W ≥ i) ≤ δ} where W ∼ Binomial(n0, 1 − α)
3: For i ∈ {1, . . . , n0} compute ˆri := g ◦ ˆr(Z 0
n0+i)
4: Sort ˆr1, . . . , ˆrn0 in increasing order to get ˆr(1), . . . , ˆr(n0) with ˆr(i) ≤ ˆr(i+1)
5: Define ˆCα,δ,g◦ˆr := ˆr(i∗)
6: Define the classifier ˆφD by
ˆφD(z) = 1{g ◦ ˆr(z) > Cα,δ,g◦ˆr}
for all z ∈ Z.
does not depend on g.
Proposition 19. Algorithm 2 constructs a Neyman-Pearson classifier satisfying Equation (9).
Proof. As the algorithm does not depend on g we take g as the identity in the proof. We adapt the proof given
in (Tong et al., 2018). Let ˆr ∈ H and define A to be the event
A := {P( ˆφD(Z 0) = +|D) > α}.
We then aim to show that P(A|ˆr) ≤ δ. To this end let C ∗
α,ˆr := inf{C ∈ R|P(ˆr(Z 0) > C|ˆr) ≤ α}.
Now as P(ˆr(Z 0) > C|ˆr) is a right continuous decreasing function we have that P(ˆr(Z 0) > Cα,ˆr|ˆr) ≤ α.
Thus we can re-write A
A = { ˆC < C ∗}
= {ˆr(i∗) < C ∗}
= {i∗ or more ofˆˆr1, . . . , ˆrn0 are less than C ∗}
n0(cid:88)
= {
i=1
Bi ≥ i∗} where Bi := 1{ˆri < C ∗}.
Hence we have
P(A|ˆr) = P(
n0(cid:88)
Bi ≥ i∗|ˆr).
i=1
n0+1, . . . , Z 0
As Z 0
that q := P(Bi = 1) ≤ 1 − α. If we now define W (cid:48) ∼ Binomial(n0, q), W ∼ Binomial(n0, 1 − α) we get that.
are independent, we have that B1, . . . , Bn0 are independent given ˆr. Furthermore, we have
2n0
P(A|ˆr) = P(W (cid:48) ≥ i∗)
≤ P(W ≥ i∗)
≤ δ by definition of i∗.
as q ≤ 1 − α
Finally, as P(A|ˆr) ≤ δ for all non-negative measurable ˆr we have that P(A) ≤ δ.
32
B.3 Logistic Regression Re-adjustment
Here we describe how to use the adjusted logistic regression described in King and Zeng (2001) to learn the φ
under the scenario presented in Section 5.1.
First define I = {i ∈ [n]|zi is observed} so that for i ∈ I either Xi (cid:54)= ∅ or we have queried Zi. We then refer
to {(Wi, Zi)}i∈I as our set of fully observed samples. These fully observed samples will have disproportionally
few Wi = 1 however {Zi|Wi = 1, i ∈ I}, {Zi|Wi = 0, i ∈ I} still give exact samples from Z|W = 1, Z|W = 0
respectively. King and Zeng (2001) propose a re-adjustment to logistic regression specifically for this case in
which the true proportion each response are different to the proportion in your given data.
Let ˆβ0, ˆβ1 be the logistic regression estimators for the coefficients of the intercept and slope respectively from
our fully observed samples. Now let ˆτ be some consistent estimate of P(W = 1) and ˆτI =
. Now
define
1{Wi=1}
|I|
(cid:80)
i∈I
0 = ˆβ0 − log
ˆβ(cid:48)
(cid:27)
(cid:26) (1 − ˆτ )ˆτI
ˆτ (1 − ˆτI
Then ˆβ(cid:48)
ˆτ =
0 and ˆβ1 are consistent estimates of the logistic regression parameters. In our case we will simply take
i∈[n] wi=1
n
. This allows us to simplify and get
(cid:80)
where n1 = (cid:80)
i∈[n]
1{wi = 1} and m = (cid:80)
i∈I
ˆβ(cid:48)
0 = ˆβ0 − log {m/n1}
1{wi = 1} that is, the number of observations we have queried.
C SYNTHETIC EXPERIMENT DETAILS
C.1 5-dimensional Correctly Specified Case
For setting we take Z1, Z0 to have PDFs defined by
p1(z) = N (z; μ1, I)
p0(z) = N (z; μ0, I)
with μ0 = 0, μ1 = (0.1, 0.1, 0.1, 0.1, 0.1)(cid:62) and where N (z; μ, Σ) is the PDF of a multivariate normal distribution
1{x(cid:62)a > 0}, φ0 = 0 where a = (1, 1, 1, 1, 1)(cid:62).
with mean μ and variance Σ evaluated at z. We take φ1(x) = 1
2
To estimate the density ratio, we use rθ(x) := exp{θ(cid:62)x} making the model correctly specified with "true"
parameter ̃θ := −μ1.
for given n ∈ N, n IID samples are drawn from both X 0 and X 1. M-KLIEP and
CC-KLIEP are then fit using gradient simple gradient descent to obtain parameter estimates. This process is
repeated 100 times for each n and with n ∈ {100, 200, 300, . . . , 1500}.
C.2 Mixed Gaussian Neyman-Pearson Case
For this experiment we take Z 1 and Z 0 to be 2-dimensional Gaussian mixtures with the following densities
(cid:19)
(cid:19)
(cid:18)
(cid:18)
(cid:19)
(cid:19)
p1(z) =
p0(z) =
1
2
1
2
N
z;
(cid:18)
N
z;
(cid:18)0
0
(cid:19)
(cid:18)1
0
, I
+
(cid:19)
, I
+
N
z;
(cid:18)
N
z;
1
2
1
2
(cid:18)−1
4
(cid:19)
(cid:18)0
4
, I
(cid:19)
, I
Now let φ1 = 0.91Z(cid:62)a>2(Z) where a = (0, 1)(cid:62), φ0 = 0 and define X 1, X 0 on R2 ∪ {∅} as before. For given
n ∈ N we generate n samples from X 0, X 1 and use these to estimate ̃r by both M-KLIEP and CC-KLIEP. An
additional Z 0 = X 0 and these used to produce a classifier via Algorithm 2 with α = δ = 0.1. These samples are
also used to produce a classifier via Algorithm 2 with ˆr replaced by r∗, the true density ratio. One instance of
this procedure with n = 500 is presented in Figure 2
To estimate the power of the produced classifiers, 1,000,000 samples from Z 1 are produced and the proportion
classified as 1 recorded. This process is then repeated for 100 times for each n ∈ {100, 200, 300, . . . , 1500}. The
estimated powers of the classifiers produced from these iterations is then used to estimate the expected power
of the procedures alongside 99% confidence intervals
33
Figure 6: The expected power of the Naive Bayes NP classifier for various levels of correlation between features.
D ADDITIONAL SYNTHETIC EXPERIMENTS
D.1 Naive Bayes Assumption Test
We wanted to test the effect of our Naive Bayes assumption on our ability to estimate the density ratio. For this
experiment we take Z0, Z1 to be distributed as follows:
(cid:18)(cid:18)0
0
(cid:18)(cid:18)1
2
(cid:18)1 ρ
ρ 1
(cid:18)1 ρ
ρ 1
Z1 ∼ N
Z0 ∼ N
(cid:19)(cid:19)
(cid:19)(cid:19)
(cid:19)
(cid:19)
,
,
for varying ρ ∈ [0, 1]. To test our Naive Bayes assumption alongside our M-KLIEP approach we also induced
non-uniform missingness separately in the features of the class 0 data. The missingness functions used were
1(x) = 0.8 * 1 {x > 0}, φ1
φ1
100 samples from X0, X1 were then generated, a density ratio fit through the Naive Bayes assumption, and then
100 more samples from X0 (equivalent to Z0) were used to produce an NP classifier. Figure 6 shows you the
average power of the classifier alongside 95% C.I.s from 100 montecarlo simulations.
2(x) = 0.8 * 1 {x < 0} and then no missingness for class 0 i.e. φ0
1 ≡ φ0
2 ≡ 0.
As we can see the Naive Bayes approaches only start seriously deviating from the performance of the true density
at around ρ = 0.5 We also reassuringly see that M-KLIEP consistently outperforms CC-KLIEP.
34
0.00.20.40.60.8Correlation0.50.60.70.8Out of Sample PowerM-KLIEPCC-KLIEPTrue DRFigure 7: Expected power of NP classifier when used in conjunction with multiple DRE approaches for varying
sample size. In this case our model is misspecified.
D.2 Differing Variance Misspecified Test
We have tried an additional misspecified case set up as follows
Z1 ∼ N
Z0 ∼ N
(cid:19)
(cid:18)(cid:18)0
0
(cid:19)
(cid:18)(cid:18)1
1
,
,
(cid:18)1
0
(cid:18)1
0
(cid:19)(cid:19)
0
1
(cid:19)(cid:19)
0
2
We then introduced complete missingness in class 1 with φ1(x) = 0.8 * 1 {x1 > 0} and no missingness in class
0 (φ0 ≡.) We then used the log-linear form for our density ratio estimate with f (x) = x which leads to an
incorrectly specified model (f (x) = (x(cid:62), x2(cid:62)
)(cid:62) would lead to a correctly specified model.)
For various values of n, we then generate n samples from X0, X1 and a density ratio was then fit using M-KLIEP
and CC-KLIEP. An additional n samples from X0 (equivalent to Z0) were used to produce an NP classifier.
Figure 7 shows one simulation in this case alongside the classification boundaries produced. We can see that with
this misspecified parametric boundary our model will always approximate the true boundary relatively crudely
however we can clearly see that the M-KLIEP boundary is a more sensible approximation than the CC-KLIEP
boundary
Figure 8 shows you the estimated expected power of the classifiers produced alongside 95% C.I.s from 100
montecarlo simulations (where 1,000,000 additional samples from Z1 were used to estimate the power of the
classifier in each simulation.) This definitively shows M-KLIEP has better performance than CC-KLIEP. While
M-KLIEP does perform worse than the true classification boundary this decrease is not drastic.
35
250500750100012501500Sample Size0.300.350.400.45Out of Sample PowerKLIEP MissKLIEP NaiveTrue RFigure 8: Scatter plot of D alongside classification boundaries produced from corresponding D(cid:48) via various
procedures. If Xi = ∅ then Zi is faded out.
36
−4−20246x(1)−4−202468x(2)Class 1Class 0: 1 - nClass 0: n+1 - 2nDRE ProcedureTrue DRM-KLIEPCC-KLIEPFigure 9: Expected power of NP classifier produced via various DRE techniques for varying levels of misspecifi-
cation. We take misspecification to be 2 ∗ ρ.
D.3 Varying Misspecificaiton Level
In this experiment we wanted to examine the effect of the level of misspecification on our model. To do this we
let Z1, Z0 have pdfs defined as follows
(cid:18)
p1(z) = (1 − ρ)N
z;
p0(z) =
(cid:18)
N
z;
(cid:19)
(cid:18)1
0
1
2
(cid:19)
(cid:18)0
0
(cid:19)
, I
(cid:19)
(cid:18)
, I
+ ρN
z;
(cid:19)
(cid:18)2
0
(cid:19)
, I
for various ρ ∈ [0, 0.5]. We then introduced complete missingness in class 1 with φ1(x) = 0.8 * 1 {x1 > 0} and
no missingness in class 0 (φ0 ≡.) We then used the log-linear form for our density ratio estimate with f (x) = x
which leads to an incorrectly specified model for ρ > 0 with larger values of ρ leading to greater levels of
misspecification.
We then generate 100 samples from X0, X1 and a density ratio was fit using M-KLIEP and CC-KLIEP. An
additional 100 samples from X0 (equivalent to Z0) were used to produce an NP classifier. Figure 9 shows
you the average power of the classifier alongside 95% C.I.s from 100 montecarlo simulations (where 1,000,000
additional samples from Z1 were used to estimate the power of the classifier in each simulation.)
E REAL WORLD EXPERIMENT DETAILS
Here we give additional information on the experiments performed on the real world data. We start off by
describing each of the three datasets.
37
0.00.20.40.60.81.0Misspecification level0.350.400.450.50Out of Sample PowerKLIEP MissKLIEP NaiveTrue RE.1 Datasets
E.1.1 CTG
Foetal Cardiotocograms (CTGs) measure the babies heart function during labour. These are then used by doctors
and nurses and then used as a diagnostic tool to assess the foetus' health. In our data-set we have numerical
summaries of foetal CTGs which alongside the diagnoses of one of "normal", "suspect", or "pathologic" that
doctors ascribed to associated foetuses. We aim to create an automated diagnosis procedure which will determine
from the summaries whether the foetus is "normal" (class 1) and therefore needs no additional attention/
intervention, or one of "suspect" or "pathologic" (Class 0) to and hence needing further follow up. It is clear
that NP classification as a well suited classification procedure to this paradigm as we would like to strictly control
the probability of miss-classifying a "suspect" or "pathologic" baby as "normal".
The data is taken from: https://archive.ics.uci.edu/ml/datasets/cardiotocography and was first presented in
de Campos et al. (2000).
This data contains observations of 2129 foetuses, 1655 from class 1 and 474 from class 0. From the data we
select 10 features which we describe below
We split the data as follows, 237 & 1555 samples from Class 0 & 1 to fit ˆr, 237 samples from Class 0 are used to
fit the threshold of the classifier, and 100 samples from Class 1 are used to estimate the power of the classifier.
When φ are learned we query 10 missing samples from each feature.
E.1.2 Fire
For multiple different fires and non-fires, various different environmental readings were taken such as Tempera-
ture, Humidity and CO2 concentration. The aim of this is to be able to classify whether or not a fire is present to
create a sort of IOT (internet of things) smoke detector to detect the presence of fire. Again NP classification is
clearly a good fit as falsely detecting a fire is far less damaging than missing a fire. As such, we take the presence
of fire as our error controlled class (Class 0) as we want to strictly control the probability of not detecting a fire
which is present. This data is taken from: https://www.kaggle.com/datasets/deepcontractor/smoke-detection-
dataset.
This dataset consists of 62,630 observations of 12 features. The observations consist of 17,873 observations
from Class 1 and 44,757 from Class 0. Before carrying out any of our procedures we perform minimal feature
manipulation by trimming extreme values for some of the features as described below:
• TVOC(ppb), eCO2(ppm): Values are trimmed to not exceed 1000.
• PM1.0, PM2.5: Values are trimmed to not exceed 1.
• NC0.5, NC2.5: Values are trimmed to not exceed 5.
E.1.3 Weather
A dataset containing various weather reading for different days in Australia collected with the aim of using the
previous days weather to predict whether there is a chance on the following day. We want to be able to choose
what we mean by a "chance" in terms of the probability of our classifier correctly predicting rain when it is
present therefore motivating the use of NP classification. As such we take the event of rain the following day to be
our error controlled class (Class 0.) This data is taken from: https://www.kaggle.com/datasets/jsphyg/weather-
dataset-rattle-package.
This dataset consists of 142,193 observations of 20 features. The observations consist of 110,316 observations
from Class 1 and 31,877 from Class 0.
Before carrying out any of our procedures we perform minimally feature manipulation by trimming extreme
values for some of the features. Factor variables are split into indicator variables for each of the possible
outcomes, with one outcome having no indicator to avoid redundancy. Continuous features are trimmed to be
within 5 IQR (inter-quartile range) of the median. This data manipulation lead to a total of 62 dimensions in
our final data.
38
E.2 Experimental Designs
For each of the datasets, the same overall experimental design is used. Firstly data is randomly split into train
(Class 0 & 1)/calibrate (Class 0)/test (Class 1) datasets of sizes given below. Any missing values originally in
the data set are then imputed using simple mean imputation. Next the data is normalised to reduce the risk
of numerical precision issues within our algorithms. The Class 0 training data is then corrupted along each
dimension using φj of the form φj(z) := (1 + exp{τj(a0,j + a1,jz)})−1. This φj is then estimated by querying
points as described in Section 5.1. The density ratio is then fit by M-KLIEP, CC-KLIEP on the training data.
Alongside this, we also fit the density ratio using M-KLIEP with the true φj and KLIEP with the original
non-corrupted training data as benchmarks. A classifier is then constructed from these estimated density ratios
using the calibration data by the procedure described in Algorithm 2 with given α, δ. The testing data is then
used to estimate the power of these classifiers.
Multiple iterations of this process are performed with random train/calibrate/test splits (of fixed size) and
random τj ∈ {−1, 1} for each iteration. The estimated powers from these iterations are then used to calculate
the pseudo expected power and 95% C.I.s
For experiment 1, we vary α ∈ {0.05, 0.1, 0.15, 0.2, 0.25, 0.3} with δ = 0.05, aj,0 = −μj/σj, aj,1 = 1/σj where
μj, and σj are the sample mean and variance of feature j.
For experiment 2 this process is repeated with varying aj,1 with α = 0.1, δ = 0.05, aj,1 = σj. The aj,0 are chosen
to produce the following proportions of missing values for each feature: {0.1, 0.2, 0.3, . . . , 0.9}.
Dataset specific experimental design information can be found below
E.2.1 Dataset specific experimental design
CTG The size of the data splits are as follows, Class 0 train = 237, Class 1 train = 1555, Class 0 calibrate =
237, and Class 1 test 100.We query 10 missing samples from each feature when learning φj. For both experiments
1,000 iterations are run.
Fire The sample sizes of the data splits are as follows, Class 0 train = 20, 000, Class 1 train = 12, 873, Class
0 calibrate = 24, 757, and Class 1 test = 5, 000. We query 50 missing samples from each feature when learning
φj. For both experiments, 100 iterations are run.
Weather The size of the data splits are as follows, Class 0 train = 15, 000, Class 1 train = 100, 316, Class 0
calibrate = 16, 877, and Class 1 test = 10, 000. We query 50 missing samples from each feature when learning
φj. For experiment 1, 100 iterations are run; for experiment 2, 30 iterations are run.
E.3 Additional Missing Data Approaches
imputation approach implemented using the
We also compared our approached to an iterative
sklearn.impute.IterativeImputer module in Python using the default estimator BayesianRidge(). For
fair comparison, this imputed data was then used to perform Naive Bayes DRE to make it comparable to our
approach. Results of these additional experiments are given in figures 10 & 11 and described below.
E.3.1 Additional Results
Here we present the same results as the paper but with the iterative imputation method included. Figure 10
shows the out of sample power of various NP classifiers for varying Type I error we can see that the additional
iterative imputation method seems to perform comparably or worse than our method for each data set
Figure 11 shows the out of sample power of various NP classifiers for varying levels of missingness. Here we see
that as the level of missingness increases, the iterative imputation method degrades significantly leading it to
perform significantly worse than our approach. It does however consistently perform better than the complete
case approach
39
(a) CTG Dataset.
(b) Fire Dataset.
(c) Weather Dataset.
Figure 10: Out of sample power with pseudo 95% C.I.s for various different target Type I errors with iterative
imputation approach included.
(a) CTG Dataset.
(b) Fire Dataset.
(c) Weather Dataset
Figure 11: Out of sample power with pseudo 95% C.I.s for various φ and varying missing proportions with
iterative imputation approach included.
F SOCIETAL IMPACT
We now briefly discuss the societal impact of our work. As we have shown, ignoring MNAR data can lead to
degradation in performance. Perhaps worse than this however is that, without taking account of our MNAR
structure, use of the original NP classification procedure won't guarantee our desired Type I error with high
probability. This could lead to classifiers which perform far worse on our error controlled class than estimated.
The impact of this could be serious in the case of say disease detection where we believe our classifier to be
detecting a far higher proportion of diseased individuals than it truly is. The impact of MNAR data on analysis
has been explored before in more general settings (Rutkowski, 2011; Padgett et al., 2014; Goldberg et al., 2021)
with the key takeaway always being that ignoring the structure of the missingness can negatively impact your
results and lead to false inference.
40
0.050.100.150.200.250.30Fixed Type 1 Error0.550.600.650.700.750.800.85Out of Sample PowerKLIEP (full dataset)M-KLIEP (known φj)M-KLIEP (estimated φj)CC-KLIEPMICE0.050.100.150.200.250.30Fixed Type 1 Error0.30.40.50.60.70.80.9Out of Sample PowerKLIEP (full dataset)M-KLIEP (known φj)M-KLIEP (estimated φj)CC-KLIEPMICE0.050.100.150.200.250.30Fixed Type 1 Error0.00.10.20.30.40.50.60.7Out of Sample PowerKLIEP (full dataset)M-KLIEP (known φj)M-KLIEP (estimated φj)CC-KLIEPMICE0.00.20.40.60.8Proportion of Values Missing0.640.660.680.700.72Out of Sample PowerM-KLIEP (known φj)M-KLIEP (estimated φj) CC-KLIEPMICE0.00.20.40.60.8Proportion of Values Missing0.30.40.50.60.7Out of Sample PowerM-KLIEP (known φj)M-KLIEP (estimated φj) CC-KLIEPMICE0.00.20.40.60.8Proportion of Values Missing0.100.150.200.250.300.350.40Out of Sample PowerM-KLIEP (known φj)M-KLIEP (estimated φj) CC-KLIEPMICE |
|
http://arxiv.org/abs/2302.10639v1 | 2023-02-21T12:57:12 | 2023-02-21T12:57:12 | Conditioning Hierarchical Reinforcement Learning on Flexible Constraints | Safety in goal directed Reinforcement Learning (RL) settings has typically
been handled through constraints over trajectories and have demonstrated good
performance in primarily short horizon tasks (goal is not too far away). In
this paper, we are specifically interested in the problem of solving temporally
extended decision making problems such as (1) robots that have to clean
different areas in a house while avoiding slippery and unsafe areas (e.g.,
stairs) and retaining enough charge to move to a charging dock; (2) autonomous
electric vehicles that have to reach a far away destination while having to
optimize charging locations along the way; in the presence of complex safety
constraints. Our key contribution is a (safety) Constrained Planning with
Reinforcement Learning (CoP-RL) mechanism that combines a high-level
constrained planning agent (which computes a reward maximizing path from a
given start to a far away goal state while satisfying cost constraints) with a
low-level goal conditioned RL agent (which estimates cost and reward values to
move between nearby states). A major advantage of CoP-RL is that it can handle
constraints on the cost value distribution (e.g., on Conditional Value at Risk,
CVaR, and also on expected value). We perform extensive experiments with
different types of safety constraints to demonstrate the utility of our
approach over leading best approaches in constrained and hierarchical RL. | [
"Yuxiao Lu",
"Pradeep Varakantham",
"Arunesh Sinha"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10639v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10639v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.AI",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.AI",
"cs.LG"
] | Conditioning Hierarchical Reinforcement Learning on Flexible Constraints
Yuxiao LU1 , Pradeep VARAKANTHAM1 , Arunesh SINHA2
1Singapore Management University
2Rutgers University
[email protected], [email protected], [email protected]
3
2
0
2
b
e
F
1
2
]
I
A
.
s
c
[
1
v
9
3
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
Safety in goal directed Reinforcement Learning
(RL) settings has typically been handled through
constraints over trajectories and have demonstrated
good performance in primarily short horizon tasks
In this paper, we
(goal is not too far away).
are specifically interested in the problem of solv-
ing temporally extended decision making problems
such as (1) robots that have to clean different areas
in a house while avoiding slippery and unsafe areas
(e.g., stairs) and retaining enough charge to move to
a charging dock; (2) autonomous electric vehicles
that have to reach a far away destination while hav-
ing to optimize charging locations along the way; in
the presence of complex safety constraints. Our key
contribution is a (safety) Constrained Planning with
Reinforcement Learning (CoP-RL) mechanism that
combines a high-level constrained planning agent
(which computes a reward maximizing path from a
given start to a far away goal state while satisfying
cost constraints) with a low-level goal conditioned
RL agent (which estimates cost and reward values
to move between nearby states). A major advantage
of CoP-RL is that it can handle constraints on the
cost value distribution (e.g., on Conditional Value
at Risk, CVaR, and also on expected value). We
perform extensive experiments with different types
of safety constraints to demonstrate the utility of
our approach over leading best approaches in con-
strained and hierarchical RL.
1 Introduction
Reinforcement Learning (RL) is a framework to represent de-
cision learning problems in environments that have an un-
derlying (Partially Observable) Markov Decision Problem,
(PO-)MDP. Deep Reinforcement Learning [Franc ̧ois-Lavet et
al., 2018; Hernandez-Leal et al., 2019] approaches have been
shown to solve large and complex decision making problems.
For RL agents to be relevant in the day-to-day activities of
humans, they would need to handle a wide variety of tempo-
rally extended tasks while being safe. A few examples of such
multi-level tasks are: (a) planning and searching for valuable
targets by robots in challenging terrains (e.g., disaster prone
areas) while navigating safely and preserving battery to reach
a safe spot; (b) for autonomous electric vehicles to travel long
distances in minimum time, they would need to optimize the
position of recharge locations along the way to ensure the ve-
hicle is not left stranded; (c) cleaning robots to clean a house,
while avoiding slippery and unsafe areas (e.g., stairs) and re-
taining enough charge to move to a charging dock. The fol-
lowing key challenges need to be addressed together in the
above mentioned problems of interest:
• Solving temporally extended decision making problems
in the presence of uncertainty.
• Considering safety constraints over cost value distribu-
tion, that is associated with the execution policy.
Existing research in solving temporally extended decision
making problem has focused on hierarchical RL methods to
handle long horizon multi-level tasks [Nachum et al., 2018;
Zhang et al., 2020; Kim et al., 2021; Levy et al., 2017]. While
all these approaches are able to solve long horizon decision
making tasks, they are unable to deal with safety constraints.
On the other hand, most existing research in handling tra-
jectory based safety constraints has focused on constrained
RL [Satija et al., 2020; Chow et al., 2017; Sim ̃ao et al., 2021;
Gattami et al., 2021] approaches, where constraints are en-
forced on expected value of the cost value distribution. A re-
cent method that has considered percentile based constraints
is WCSAC [Yang et al., 2021]. Unfortunately, all these con-
strained RL approaches are typically only able to solve short
horizon problems where the goal is not too far away.
We address the need to bring together these two threads of
research on hierarchical RL and constrained RL, which have
mostly progressed independently of each other.
Contributions: To that end, we propose a new Constrained
Planning with Reinforcement Learning (CoP-RL) approach,
where there is a hierarchy of decision models: (a) The lower
level employs goal conditioned RL to learn reward and cost
estimates to move between two given states (origin and a local
(b) The upper level is a
goal) that are near to each other.
constrained planner that builds on Informed RRT* [Gammell
et al., 2014] to identify the best policy to get from a given start
state to a goal state that is typically "far" away from the start
state. This is achieved while ensuring overall cost constraints
(representative of safety and other measures) are enforced.
There are multiple key contributions with regards to CoP-
RL. First, we provide a constrained planning approach that
is extremely scalable for long horizon tasks. Second, we
are able to handle both percentile and expected constraints
on cost distribution. Third, the design of enforcing the con-
straints at the upper-level planner allows fast re-computation
of polices in case the constraint threshold changes. Finally,
as shown in our extensive comparisons on benchmark prob-
lems, CoP-RL outperforms leading approaches across path
planning, constrained MDPs and hierarchical RL.
Related Work: Constrained Reinforcement Learning uses
the Constrained Markov Decision Process (CMDP) to max-
imize a reward function and satisfy constraints rather than
designing policy through the reward function only [Satija
et al., 2020; Achiam et al., 2017; Gattami et al., 2021;
Chow et al., 2017; Tessler et al., 2018; Liang et al., 2018;
Chow et al., 2018]. WCSAC [Yang et al., 2021] extends Soft
Actor-Critic and considers a certain level of CVaR from the
distribution as a safety measure to judge the constraint sat-
isfaction. Using an abstract model [Sim ̃ao et al., 2021] to
learn policies can autonomously find tradeoffs between per-
formance and safety. As far as we know and from bench-
marking work [Ray et al., 2019], there is no constrained RL
designed for long-horizon tasks, and even for short-horizon
task all current approaches need to be retrained if the con-
straint thresholds changes.
Hierarchical Reinforcement Learning (HRL) address the
long standing problem of learning, planning, and represent-
ing knowledge at multiple levels of abstraction [Kulkarni et
al., 2016]. The problem could be formulated with the frame-
work of MDP and semi-MDP (SMDP) [Sutton et al., 1999].
The MAXQ decomposition is the prototype of HRL and it
decomposes the value function of a target MDP into a addi-
tive mixture of value functions of smaller MDPs [Dietterich,
2000]. Benefiting from off-policy RL algorithms, a num-
ber of recent methods such as HIRO [Nachum et al., 2018],
HRAC [Zhang et al., 2020], and HIGL [Kim et al., 2021]
propose a hierarchy where both lower and upper level are
RL learners and the higher level specifies sub-goals [Kael-
bling, 1993] for the lower level RL. However, it's hard to add
safety or resource constraints to such HRL with both levels
as RL agents because to enforce constraints the higher level
policy must also generate constraint thresholds for the lower-
level agent, while also ensuring the budget used by invoking
the lower-level agent multiple times does not exceed the total
cost budget. Also, the lower-level policy should be able to
maximize reward for any given cost threshold in the different
invocations by the upper level. However, both these tasks are
not practicable with the existing results in constrained RL.
Closer to our method, SORB [Eysenbach et al., 2019] em-
ploys a planner at the higher level that uses a graph-based
path-planning algorithm (Dijkstra's algorithm), where the
whole continuous state is discretized to yield a massive graph.
SORB achieves better success rate in complex maze environ-
ments compared to other HRL techniques but cannot enforce
constraint and has high computational cost due to a large
graph. We present a thorough comparison of our Constrained
Informed RRT* to SORB's planner in Section 3.2. Options
or skills learning coupled with a higher level policy of choos-
ing options is another approach [Eysenbach et al., 2018;
Kim et al., 2019] in HRL. CoP-RL can be viewed as learning
primitive skills of reaching local goals, and the simplicity of
this lower task as well as of the planner makes our approach
scalable and flexible. Additional related work on constrained
planning and model based RL are in the appendix.
2 Problem Formulation
In problems of interest, we have an agent that is interact-
ing with an environment. The agent observes its current
s ∈ S, where S ⊂ Rn is a continuous state space. The
initial state so for each episode is sampled according to a
specified distribution and the agent seeks to reach goal state
sG. The agent's action a ⊂ Rn is continuous. The episode
terminates as soon as the agent reaches the goal, or after
T steps, whichever occurs first. The agent earns immediate
rewards, rt(st, sG, at) and separately also incurs immediate
costs, ct(st, sG, at) when acting in each time step t.
V π(so, sG) and V π
c (so, sG) refer to the cumulative undis-
counted reward and cost respectively for reaching goal state,
sG from origin state, so following policy π. The typical opti-
mization in constrained RL [Achiam et al., 2017] is:
V π(so, sG)
max
π
s.t. V π
(1)
where expectation over random policy and environment spec-
ifies the value functions:
c (s0, sG) ≤ K
V π(so, sG) = E(cid:2)
c (so, sG) = E(cid:2)
V π
T
(cid:88)
t=0
T
(cid:88)
rt(st, sG, at)|so
ct(st, sG, at)|so
(cid:3)
(cid:3)
(2)
t=0
However, in the above, the constraint is only on the ex-
pected cost value and is not always suitable to represent con-
straints on safety. For instance, to ensure an autonomous
electric vehicle is not stranded on a highway, we need a
constraint that ensures the chance of that happening is low
and we cannot ensure that with an expected cost constraint.
Therefore, we consider another type of the cost constraint in
which we require that the CVaR [Rockafellar et al., 2000]
of the cost distribution (given by the bold font random vari-
able Vπ
c (so, sG)) is less than a threshold. We skip writing
so, sG when implied. Intuitively, Value at Risk, V aRα rep-
resents the minimum value for which the chance of violating
the constraint (i.e., Vπ
c > k) is less than α.
V aRα(Vπ
c ) = inf{k | P r(Vπ
Conditional VaR, CV aRα intuitively refers to the expecta-
tion of values that are more than the V aRα, i.e.,
c ) = E[Vπ
c ≥ V aRα(Vπ
CV aRα(Vπ
c > k) ≤ α}
c | Vπ
c )]
When using this variant of the cost constraint (referred to also
as percentile based constraint), we replace the threshold con-
straint in optimization (1) with
CV aRα(Vπ
(3)
for a given α. Note that α = 1 is completely risk-neutral, i.e.,
CV aR1(Vπ
c , and α close to 0 is completely
risk-averse.
c ) = E[Vπ
c ] = V π
c ) ≤ K
3 Approach
Overall, our approach maximizes the long-term reward satis-
fying the percentile cost constraint in Eq. (3); we can also eas-
ily consider expected cost by setting α = 1. As stated earlier,
our approach referred to as Constrained Planning with Rein-
forcement Learning (CoP-RL) employs a lower-level learn-
ing agent and an upper-level planning agent. The upper-level
agent is constructed using a constrained planning algorithm,
whereas the lower-level agent is constructed using a goal-
conditioned [Kaelbling, 1993] off-policy RL agent which di-
rectly interacts with the environment. Through its interac-
tions with the environment, the lower-level agent learns re-
ward and cost estimates between states that are "near" to each
other. Then, the upper-level agent uses reward and cost esti-
mates provided by the lower-level agent to compute a policy
to get to the main goal while satisfying the cost constraints.
3.1 Lower Level Agent
As we care about cost distribution (due to cost constraint in
Eq. (3)) , we need to estimate the distribution of Vπ
c for the π
that maximizes expected V π(s, s(cid:48)) for nearby s, s(cid:48). While it
would suffice to use a standard RL method to maximize ex-
pected V π(s, s(cid:48)), it is known from literature that learning the
distribution of Vπ and then calculating expected value leads
to better estimates [Eysenbach et al., 2019]. Thus, we use
distributional RL for both reward and cost distribution esti-
mation. Distributional RL learns a policy ˆπ and in the pro-
cess maintains a network that represents the distribution of
Q which we describe next; after that we show how to derive
V, Vc from the learned policy ˆπ.
Distributional value functions: We use distributional
RL [Bellemare et al., 2017] to estimate the distribution of
the reward random variable Q [Eysenbach et al., 2019]. In
distributional RL, the possible Q value estimates are assumed
to be one of N discrete values. The distribution of Q is rep-
resented by Qθ (neural network parameterized by θ), which
takes as input s, a and outputs a vector [p1, . . . , pN ] where pi
is the probability of Q value taking the ith discrete value. We
write r(s, sg, a) = i to mean that the immediate reward takes
the ith discrete value, with rounding used for reward values
returned in between the equispaced discrete values. We also
abuse notation in the distributional RL setting to use Q(*, *, *)
to represent a vector of probabilities instead of a scalar num-
ber. Let the function f denotes as accumulated right shift
as f ([p1, . . . , pN ], 1) = [0, p1, . . . , pN −1, pN −1 + pN ] and
recursively f ([p1, . . . , pN ], i) = f (f ([p1, . . . , pN ], i − 1), 1).
Given action a in state s that leads to a state s(cid:48) and the current
Qθ(s, sg, a) = [p1, . . . , pN ], a target Qt is defined as
Qt(s, sg, a) =
(cid:26) [1, 0, 0, ..., 0]
[f ([p1, . . . , pN ], i)
s(cid:48) = sg
s(cid:48) (cid:54)= sg ∧ r(s, sg, a) = i
(4)
Note that adding a positive number to a distribution is same
as shifting the distribution by that number, but due to fi-
nite representation, we accumulate the probability in the
this accumulation and the rounding
last bin (see Fig. 1);
of r to discrete values form the two sources of represen-
tation error in distributional RL [Bellemare et al., 2017;
Figure 1: An illustration of updating the distributional Q value with
N = 7 and r(s, sg, a) = 2.
Eysenbach et al., 2019]. Then we update Qθ by minimizing
the KL-divergence:
DKL(Qt||Qθ)
min
θ
(5)
The above approach yields a trained policy ˆπ. For training,
we choose nearby start and goal states at random throughout
the state space, ensuring that the local estimates generalize to
any nearby start and goal in the whole state space.
We then use the technique in [Schaul et al., 2015] to get
the distributional value function estimate of the policy ˆπ, as
described next. Again we represent the distribution of reward
Vˆπ as a neural network V w that outputs a vector of proba-
bility. The fixed learned policy ˆπ allows us to estimate V w
directly by minimizing the KL divergence between a target
V t(s, s(cid:48)) = Qθ(s, s(cid:48), a), a ∼ ˆπ(*|s, s(cid:48)) and the current V w:
DKL(V t||V w)
min
θ
(6)
We optimize the above by storing experiences sampled ac-
cording to ˆπ is a replay buffer and sampling mini-batches to
minimize the loss above, analogous to supervised learning.
Once the vector of probabilities V w is obtained, we can ob-
tain expected V by calculating the expectation. For our spe-
cific problems in path planning, reward r is set to be −1 for
V such that the learned reward value function −V reflects
the estimated length of the shortest path (considering impen-
etrable obstacles) from so to sg as done in [Kaelbling, 1993;
Eysenbach et al., 2019]. In particular, we assume that −V
is learned accurately and prove the following result, which is
needed for the analysis of the higher level agent.
Lemma 1. Considering obstacles, the shortest path length
between two points, as learned by −V , is a distance metric.
Next, for costs, we note that we performed the reward es-
timation without considering the costs. This is because in
our approach the lower-level agent does not enforce the con-
straints. However, the lower level agent does estimate the
local costs. Again, similar to above learning of V w, the fixed
learned policy ˆπ allows us to estimate the vector of proba-
bility V w
function directly by minimizing the KL divergence
c
between the target V t
c (same as in Equation 4 but with c in-
stead of r and action a ∼ ˆπ) and the current V w
c :
min
θ
DKL(V t
c ||V w
c )
(7)
Algorithm 1: ConstrainedRRT* (so, sG, V, Vc, K)
1 V ← {so}, E ← ∅ , Ssoln ← ∅, T = (V, E)
2 for iteration = 1 ... N do
3
rbest ← minσ∈Ssoln{−Rσ} ∪ {∞}
srand ← Sample(so, sG, rbest)
snearest ← Nearest(T , srand)
snew ← Steer(snearest, srand, min(rRRT ∗, η))
Snear ← Near(T , snew, min(rRRT ∗, η))
smin ← snearest
rmin ← −R(smin) − V (snearest, snew)
for ∀snear ∈ Snear do
if Valid edge(T , snear, snew, Vc, K) then
rnew ← −R(snear) − V (snear, snew)
if rnew < rmin then
smin ← snear, rmin ← rnew
if Valid edge(T , smin, snew, Vc, K) then
V ← V ∪ {snew} , E ← E ∪ {(smin, snew)}
for ∀snear ∈ Snear do
if Valid edge(T , snew, snear, Vc, K) then
rnear ← −R(snear)
rnew ← −R(snew) − V (snew, snear)
if rnew < rnear then
sparent ←Parent(snear)
E ← E\{(sparent, snear)}
V ← V ∪ {snew}
E ← E ∪ {(snew, snear)}
if InGoalRegion(snew) then
Form σ by tracking parents of snew
Ssoln ← Ssoln ∪ {σ}
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 return T
3.2 Upper Level Agent
Once the lower-level RL training is complete, we obtain a
local goal-conditioned value function for any origin and local
goal state that are near to each other. In this section, we use
the learned expected value V and cost random variable Vc
(removing superscripts for notation ease). First, we formulate
the upper-level optimal constrained planning problem.
• S ⊂ Rn is the state space of the environment. so ∈ S
is the start/origin state and sg is the goal state, where sg
might not be near so.
• Sf ree is the set of states that are not in any obstacle.
• σ : [0, 1] → Sf ree is a sequence of states (a path) with
σ(0) = so and σ(1) = sg. Σ is the set of all paths. In
practice, every path is represented by a discrete number
of states {σ(xi)}i∈[n] for 0 = x0 < x1 < ... < xn−1 <
xn = 1 and some positive integer n (n can be different
for different paths). Given the discrete representation, the
path traversed between σ(xi) and σ(xi+1) is determined
by the lower-level agent's policy.
• Every path σ ∈ Σ provides a reward Rσ and incurs
a cost Cσ. We define the reward for each segment
(σ(xi), σ(xi+1)) of a path as V (σ(xi), σ(xi+1)) where
V is the local goal-conditioned value function learned by
the lower-level agent. Similarly, the cost incurred for seg-
ment (σ(xi), σ(xi+1)) is Vc(σ(xi), σ(xi+1)). Thus, for
a path σ represented using n + 1 states
Rσ =
Cσ =
n−1
(cid:88)
i=0
n−1
(cid:88)
i=0
V (σ(xi), σ(xi+1))
Vc(σ(xi), σ(xi+1))
(8)
(9)
The optimal constrained planning problem is to search for
the optimal path, σ∗ (∈ argmaxσ∈Σ Rσ) connecting so to sg
subject to a cost threshold K, i.e., CV aRα(Cσ∗ ) ≤ K. As
−V is the shortest distance considering obstacles (see text
before Lemma 1), the above optimization is essentially find-
ing the shortest path measured in distance −V from so to sG
avoiding all obstacles and within the cost constraint K.
With regards to planning, our approach has immediate ad-
vantages over the state-of-the-art SORB, which also employs
a planner at the upper level and RL at lower level. SORB [Ey-
senbach et al., 2019]) distributes nodes in the entire state
space, constructs a complete graph and then computes short-
est path using Dijkstra's algorithm. However, such an ap-
proach has multiple fundamental limitations:
• No prior knowledge of the state space (obstacles etc.),
start state and goal state, which can result in bad distri-
bution of nodes in the state space.
• In addition, due to the coarse discretization such an ap-
proach can result in a non-optimal path between start and
goal state [Karaman and Frazzoli, 2011].
• Construction of complete graph yields a complexity of
O(N 2) for Dijkstra's algorithm for N nodes.
Hence, a classical path finding approach with the large con-
structed graph does not scale and as a result SORB is subop-
timal in many cases (as shown in our experiments).
Thus, an online planning method that samples and grows
a tree from the given start to the goal state is more suited as
the upper-level planner, and hence we provide Constrained-
RRT*, which builds on the Informed-RRT* [Gammell et al.,
2014] planning algorithm to handle constraints.
Informed-
RRT* builds upon RRT* [Karaman and Frazzoli, 2011],
which works by constructing a tree whose root is the start
state and iteratively growing the tree by randomly sampling
new points as nodes till the tree reaches the goal. In informed
RRT*, as an informed heuristic, the sampling is restricted to
a specially constructed ellipsoid and further refinement of the
best solution so far continues till a fixed number of iterations.
However, both Informed-RRT* and RRT* do not take con-
straints into account.
Algorithm Description: We propose Constrained RRT* (Al-
gorithm 1), which builds on Informed RRT* to handle the
cost constraint. The pseudocode is provided in Algorithm 1.
We search for the optimal path σ∗ to a planning problem by
incrementally building a tree T in the state space S. The tree,
T consists of a set of nodes, V (⊂ S), and edges E (⊂ S × S.
A candidate state snew is chosen (line 6) to be added
to the treeT by sampling srand (line 4) within an ellipse
with focal points as so and sG and axis lengths as rbest and
Figure 2: Constrained RRT* example. The red square is a high cost region. The center of the dashed circle (of radius min(rRRT ∗, η)) is the
new sampled state that is a candidate to add to the tree with root O. The states in the dashed circle are "near" based on the low-level agent's
value estimates. (a) When the planner tries to extend the tree to include state C, the edge (O, C) is not valid because C is not within the dashed
circle. Although both A and B are within the circle, the path from O to C via B is better as V (O,B) +V (B,C) < V (O,A) +V (A,C) using
low-level agent's V function. Hence, edge (B, C) is added to the tree. (b) When trying to extend to a new state E, E is "near" from C and D,
but the edge (C, E) is not valid because of Vc(O, B) +Vc(B, C) +Vc(C, E) > K. (c) A path (O, B, C, D, E, G, goal) that does not violate the
cost constraints is found. (d) As the number of sampled states increases, a better path (O, B, I, D, E, G, goal) is found. During execution, the
lower-level agent is guided by this sequence of the waypoints in the best path found.
best − r2
(cid:112)r2
min, where rbest (line 3) is the length of the cur-
rent best solution in Ssoln or infinite if Ssoln is empty1 .In
case srand is far from the nearest node snearest in T (line 5),
then the Steer function in line 6 chooses a point snew within
the min(rRRT ∗, η) distance ball centered at snearest that is
also the closest to srand. This hyper-parameter η accounts
for the fact that our distance estimates are precise only lo-
cally. The rewiring radius, rRRT ∗ = γRRT ∗(log n/n)1/d,
where n is the current number of nodes sampled, is described
in [Karaman and Frazzoli, 2011]. Then, if the candidate edge
(snearest, snew) is valid then other nodes (set Snear in line
7) that are within distance min(rRRT ∗, η) of snew are con-
sidered as possible connections to snew. The node smin (line
10-14) that results in shortest path (highest reward) is con-
nected to snew in line 16, if the edge is valid.
Here, we take a detour to explain how we determine the
validity of edges. An edge is valid if and only if adding it
does not result in a (partial) path that violates the cost con-
straint. The key insight is that this validity can be determined
by computing the convolution of the distributions associated
with the (partial) path and the current Vc. By providing the
definition of Valid edge (T , s, s(cid:48), Vc, K) in Algorithm 2 and
doing the Valid edge checks in lines 11, 15 and 18 of the Con-
strained RRT* algorithm, we ensure that any path output by
the overall algorithm will satisfy the cost constraints. In the
pseudocode of Valid edge (T , s, s(cid:48), Vc, K), Vc represents a
random variable (and so does result). Then, the addition in
line 3 of Valid edge is a convolution operation (recall that the
distribution of a sum X + Y of two random variables X, Y
is found by a convolution [Ross, 2014]). An example planner
run is shown in Fig. 6.
Coming back to the main Constrained RRT* algorithm, we
explore further the possible edges to be added to the tree. In
particular, in the loop in lines 17-25 (1) the edge is created
only if it is valid, (2) an edge is created from a vertex in
Snear that can be connected to snew along a path with min-
imum distance (highest reward), and (3) new edges are cre-
1It suffices to sample srand ∈ Sf ree as done in RRT*, the heuris-
tic ellipse restriction in Informed RRT* speeds up convergence.
Algorithm 2: Valid edge (T , s, s(cid:48), Vc, K)
1 result ← Vc(s, s(cid:48))
2 while s.parent do
3
result ← result + Vc(s.parent, s)
s ← s.parent
4
5 if CV aRα(result) ≤ K then
6
return True
7 return False
ated from snew to vertices in Snear, if the path through snew
has lower distance (higher reward) than the path through the
current parent; in this case, the edge linking the vertex to its
current parent is deleted, to maintain the tree structure.
In comparison to the O(N 2) complexity of the planning
algorithm in SORB, the Complexity of Constrained RRT* is
O(N log N ). This allows for scaling to larger graphs.
Theoretical Results: The RRT* algorithm in literature sat-
isfies two properties: probabilistic completeness and asymp-
totic optimality. Intuitively, probabilistic completeness says
that as number of samples n → ∞ RRT* finds a feasible
path if it exists and asymptotic optimality says that as num-
ber of samples n → ∞ RRT* finds the optimal path with the
highest reward. The technical definition is long and we re-
fer the reader to [Karaman and Frazzoli, 2011] for the same.
Unsurprisingly, asymptotic optimality implies probabilistic
completeness [Karaman and Frazzoli, 2011]. In this paper,
due to the presence of constraints, we redefine asymptotic op-
timality as the optimal path that also satisfies the given cost
constraints (details in appendix). We show that our changes
(Valid Edge) still preserves the redefined asymptotic optimal-
ity for Constrained RRT*.
Lemma 2. Let d be the dimension of the space S , μ(Sf ree)
denotes the Lebesgue measure (i.e., volume) of the obstacle-
free space, and τd be the volume of the unit Euclidean norm
ball in the d-dimensional space. The Constrained Informed
RRT* in Algorithm 1 preserves the redefined asymptotic opti-
(cid:1)1/d
mality of RRT* with γRRT ∗ ≥ (2(1 + 1/d))1/d(cid:0) μ(Sf ree)
.
τd
Figure 3: The complex point maze environment. The wall obstacles
are in black. The environment on right has hazardous red circles.
Figure 4: Success rate vs Dif-
ficulty
Figure 5: Negated reward vs
Difficulty
The proof of above involves constructing a sequence of
paths σn converging to the optimal path σ∗ and then a cov-
ering of σn with norm balls. It is shown that with enough
samples the algorithm will have a path through these balls
in the cover and hence will be close to σn. The final result
is based on convergence of σn to σ∗ and existence of such
algorithm generated path through the balls for every n.
4 Experiments
In this part, we show that our method outperforms baselines
in complex long-horizon environments. More specifically,
we evaluate our method on a number of complex point maze
environments which have been used as a benchmark in RL
navigation tasks [Eysenbach et al., 2019; Zhang et al., 2020;
Nachum et al., 2018]. These maps include obstacles (im-
penetrable) and hazards (high cost but penetrable). We com-
pare against SAC-Lagrangian (SAC-lag) [Yang et al., 2021;
Stooke et al., 2020], WCSAC [Yang et al., 2021], SORB [Ey-
senbach et al., 2019], and Goal-conditioned RL (GRL) [Kael-
bling, 1993]. SORB and GRL are not designed to enforce
constraints, so they can get higher reward but suffer from con-
straint violations. We show our results in the main paper for
two maze environments, and hyperparameter settings and ad-
ditional results on other environments are in Appendix ??.
2D Navigation with Obstacles
4.1
The first environment is complex point maze environment of
Figure 3(a), which has obstacles (walls), but no hazards (thus,
no cost constraints). The start point is randomly set in the en-
vironment while the goal is set 69ν away from the start where
ν is the difficulty level. As the reward r(s, s(cid:48), a) = −1 for
each step, the agent needs to reach the goal using the short-
est path that avoids the wall obstacles. Because the distance
between the start and goal increases as ν increase, the length
of each trajectory is limited to 40, 60, 80, 100 for difficulty
levels 0.3, 0.5, 0.7, 0.9 respectively. We compare our method
with goal-conditioned RL and SORB at different difficulty
levels. For a fair comparison, both the number of nodes for
SORB and number of iterations for our method are set as
1000. For each experiment, we run 100 trials with different
seeds. We compare (a) the percentage of times agent reaches
the goal; and (b) the negated reward (i.e., the path length).
In Figure 4, we observe that the success rate of our method
CoP-RL is 100% and outperforms SORB with larger margin
as the difficulty level increases. In Figure 5, we show all tri-
als' negated reward (lower is better) for goal-conditioned RL,
Figure 6: Trajectory examples for static cost in the complex environ-
ment. (a)-(c) show the trajectories generated by GRL, SORB, and
CoP-RL with cost limit K = 4. (d)-(f) show the trajectories with
K = 7 and (g)-(i) show the trajectories with K = 10. GRL gets
stuck in a corner and SORB goes directly through hazards without
considering cost. CoP-RL goes deeper into the hazard to obtain a
better solution for higher cost limits K.
SORB, and our method. We observe that not only the aver-
age negated reward (path length) but also the upper bound and
lower bound outperform SORB at different difficulty levels.
2D Navigation with Obstacles and Hazards
4.2
In this section, we evaluate our method in the point maze en-
vironment of Figure 3(b), where there are two hazards set in
the top left room and bottom left room. The agent starts ran-
domly in the bottom left room and the goal is randomly set
in the top right room. The trajectory length will be longer if
the agent tries to avoid the hazardous area. We show results
for static costs as well as for stochastic costs at different risk
levels. It is worth noting that we don't need to retrain our
lower-level RL policy for different cost threshold, K.
Static Cost: In this environment, the agent incurs a cost c = 1
for each step in the hazardous area, otherwise c = 0. We eval-
uate our method with different cost limits K shown with CoP-
RL-4, CoP-RL-7, and CoP-RL-10 in Figure 7 and Figure 8.
In Figure 7, the bars provide the path length (negated re-
ward) to reach the goal (plotted on primary Y-axis) and the
Table 1: Different metrics for evaluating performance in the envi-
ronment with stochastic cost: expected cost (EC), cost-CVaR-0.9
(C0.9), cost-CVaR-0.5 (C0.5), cost-CVaR-0.1 (C0.1), and expected
negated reward (ENR)
EC C0.9
C0.5
C0.1
ENR
%
CoP-RL-0.9
CoP-RL-0.5
CoP-RL-0.1
SORB
7.90
6.68
6.47
8.06
8.47
7.31
7.06
8.97
10.20
9.20
8.86
11.54
14.67
13.22
12.11
15.14
47.83
48.58
48.60
52.98
16%
11%
7%
30.5%
Figure 7: Success rate and average negated reward of our method,
SORB, and GRL. Only successful trials are counted for reward.
Figure 8: Boxplot of cost in evaluation for static risk after training.
purple dots indicate the success rate (plotted on secondary
Y-axis). For average negated reward (path length), we only
consider the successful trials for all algorithms. We have the
following key observations from Figure 7 :
• Our method reaches the goal with a high success rate un-
der different cost limits with nearly 100% success.
• Even though our method considers cost constraints, it is
able to outperform SORB (which does not consider the
cost constraint) not only in success rate but also in the
length of the trajectory (average negated reward).
• The success rate of GRL (goal-conditioned RL) is less
than 20% but for average negated reward we only count
the successful trials, hence the negated reward for goal-
conditioned RL is better (lower) than our method.
• WCSAC and SAC-Lagrangian, both non-hierarchical RL
techniques that consider cost constraints, have nearly 0%
success rate in this long-horizon task and we don't con-
sider them as baselines in further experiments.
The minimum, maximum and mean cost for the different
algorithms are shown in Figure 8. With increasing cost limit,
the upper bound, lower bound, and median of the total cost
increase for our algorithm. This is to be expected as the path
in the hazardous area increases and therefore potentially the
error in computation of Vc can increase. The proportion of
trajectories that exceed the cost limit K = 4, 7, 10 is 4%,
6%, 6% respectively. Examples of paths produced by differ-
ent approaches are shown in Figure 6.
Stochastic Cost: In this environment, the agent incurs a cost
c which is uniformly sampled from {0, 1, 2} for each step
in the hazardous area, otherwise c = 0. Therefore, the total
cost of n steps inside the hazard follows a multinomial dis-
tribution. In safety-critical domains, a worst-case cost guar-
Figure 9: Boxplot of cost evaluation for stochastic risk after training
antee is preferred over the average cost bound [Yang et al.,
2021]. To achieve this, we use Conditioned Value-at-Risk
(CVaR [Rockafellar et al., 2000]) instead of the expected
value of cost to threshold the safety of a policy. We set cost
limit K = 10 for all α, that is, the expectation of the cost of
the worst α ∗ 100% cases should be lower than K. We eval-
uate our method with different α shown with CoP-RL-0.9,
CoP-RL-0.5, and CoP-RL-0.1. All of the experiments are run
100 times with different seeds.
In Table 1, the results show that our method CoP-RL with
α = 0.9 and 0.5 satisfy the corresponding CVaR bound
(columns Cα shows the estimated average costs of the worst
α∗100% trajectories) while CoP-RL violates the CVaR bound
(K = 10) slightly with the tight level α = 0.1 because of our
use of vectors to represent and discretize a long-tailed multi-
nomial distribution which introduces approximation error. As
α decreases, our method will be more risk-averse so that the
expected cost decreases, the percentage of trajectories that
exceed the cost limit K decreases (last column), and the ex-
pected negated reward increases. The statistical properties of
the total cost incurred by our method under different risk level
α is shown in Figure 9.
5 Conclusion
In this paper, we introduced a hierarchical constrained plan-
ning with reinforcement learning approach. The RL agent is
utilized to find paths between any two "nearby" states. The
constrained planning on the other hand utilizes the RL agent
to reach far away goal states from starting states, while satis-
fying various types of constraints. We were able to demon-
strate the better scalability, theoretical soundness and em-
pirically utility of our approach, Cop-RL, over existing ap-
proaches for Constrained RL and Hierarchical RL.
References
[Achiam et al., 2017] Joshua Achiam, David Held, Aviv
Tamar, and Pieter Abbeel. Constrained policy optimiza-
In International conference on machine learning,
tion.
pages 22–31. PMLR, 2017.
[Bellemare et al., 2017] Marc G Bellemare, Will Dabney,
and R ́emi Munos. A distributional perspective on rein-
forcement learning. In International Conference on Ma-
chine Learning, pages 449–458. PMLR, 2017.
[Chow et al., 2017] Yinlam
Mohammad
and Marco Pavone.
Janson,
Ghavamzadeh, Lucas
Risk-constrained reinforcement learning with percentile
risk criteria. The Journal of Machine Learning Research,
18(1):6070–6120, 2017.
Chow,
[Chow et al., 2018] Yinlam Chow, Ofir Nachum, Edgar
Duenez-Guzman, and Mohammad Ghavamzadeh. A
lyapunov-based approach to safe reinforcement learning.
Advances in neural information processing systems, 31,
2018.
[Dietterich, 2000] Thomas G Dietterich. Hierarchical re-
inforcement learning with the maxq value function de-
composition. Journal of artificial intelligence research,
13:227–303, 2000.
[Eysenbach et al., 2018] Benjamin Eysenbach, Abhishek
Gupta, Julian Ibarz, and Sergey Levine. Diversity is all
you need: Learning skills without a reward function. arXiv
preprint arXiv:1802.06070, 2018.
[Eysenbach et al., 2019] Ben Eysenbach, Russ R Salakhut-
dinov, and Sergey Levine. Search on the replay buffer:
Bridging planning and reinforcement learning. Advances
in Neural Information Processing Systems, 32, 2019.
[Franc ̧ois-Lavet et al., 2018] Vincent Franc ̧ois-Lavet, Peter
Henderson, Riashat Islam, Marc G Bellemare, Joelle
Pineau, et al. An introduction to deep reinforcement learn-
ing. Foundations and Trends® in Machine Learning, 11(3-
4):219–354, 2018.
[Gammell et al., 2014] Jonathan D Gammell, Siddhartha S
Srinivasa, and Timothy D Barfoot. Informed rrt*: Optimal
sampling-based path planning focused via direct sampling
of an admissible ellipsoidal heuristic. In 2014 IEEE/RSJ
International Conference on Intelligent Robots and Sys-
tems, pages 2997–3004. IEEE, 2014.
[Gattami et al., 2021] Ather Gattami, Qinbo Bai, and Vaneet
Aggarwal. Reinforcement learning for constrained markov
decision processes. In International Conference on Artifi-
cial Intelligence and Statistics, pages 2656–2664. PMLR,
2021.
[Hernandez-Leal et al., 2019] Pablo Hernandez-Leal, Bilal
Kartal, and Matthew E Taylor. A survey and critique
of multiagent deep reinforcement learning. Autonomous
Agents and Multi-Agent Systems, 33(6):750–797, 2019.
[Kaelbling, 1993] Leslie Pack Kaelbling.
Learning to
In IJCAI, volume 2, pages 1094–8. Cite-
achieve goals.
seer, 1993.
[Karaman and Frazzoli, 2011] Sertac Karaman and Emilio
Frazzoli. Sampling-based algorithms for optimal motion
planning. The international journal of robotics research,
30(7):846–894, 2011.
[Kim et al., 2019] Taesup Kim, Sungjin Ahn, and Yoshua
Bengio. Variational temporal abstraction. Advances in
Neural Information Processing Systems, 32, 2019.
[Kim et al., 2021] Junsu Kim, Younggyo Seo, and Jinwoo
Shin. Landmark-guided subgoal generation in hierarchi-
cal reinforcement learning. Advances in Neural Informa-
tion Processing Systems, 34:28336–28349, 2021.
[Kulkarni et al., 2016] Tejas
Karthik
Narasimhan, Ardavan Saeedi, and Josh Tenenbaum.
Hierarchical deep reinforcement
Integrating
temporal abstraction and intrinsic motivation. Advances
in neural information processing systems, 29, 2016.
Kulkarni,
learning:
D
[Levy et al., 2017] Andrew Levy, George Konidaris, Robert
Platt, and Kate Saenko. Learning multi-level hierarchies
with hindsight. arXiv preprint arXiv:1712.00948, 2017.
[Liang et al., 2018] Qingkai Liang, Fanyu Que, and Ey-
tan Modiano. Accelerated primal-dual policy optimiza-
arXiv preprint
tion for safe reinforcement
arXiv:1802.06480, 2018.
learning.
[Nachum et al., 2018] Ofir Nachum, Shixiang Shane Gu,
Honglak Lee, and Sergey Levine. Data-efficient hierar-
chical reinforcement learning. Advances in neural infor-
mation processing systems, 31, 2018.
[Ray et al., 2019] Alex Ray, Joshua Achiam, and Dario
Amodei. Benchmarking safe exploration in deep rein-
forcement learning. arXiv preprint arXiv:1910.01708, 7:1,
2019.
[Rockafellar et al., 2000] R Tyrrell Rockafellar, Stanislav
Uryasev, et al. Optimization of conditional value-at-risk.
Journal of risk, 2:21–42, 2000.
[Ross, 2014] Sheldon M Ross.
Introduction to probability
models. Academic press, 2014.
[Satija et al., 2020] Harsh Satija, Philip Amortila, and Joelle
Pineau. Constrained markov decision processes via back-
ward value functions. In International Conference on Ma-
chine Learning, pages 8502–8511. PMLR, 2020.
[Schaul et al., 2015] Tom Schaul, Daniel Horgan, Karol
Gregor, and David Silver. Universal value function ap-
In International conference on machine
proximators.
learning, pages 1312–1320. PMLR, 2015.
[Sim ̃ao et al., 2021] Thiago D Sim ̃ao, Nils Jansen, and
Matthijs TJ Spaan. Alwayssafe: Reinforcement learning
without safety constraint violations during training.
In
Proceedings of the 20th International Conference on Au-
tonomous Agents and MultiAgent Systems. International
Foundation for Autonomous Agents and Multiagent Sys-
tems, 2021.
[Stooke et al., 2020] Adam Stooke, Joshua Achiam, and
Pieter Abbeel. Responsive safety in reinforcement learn-
In International Con-
ing by pid lagrangian methods.
ference on Machine Learning, pages 9133–9143. PMLR,
2020.
[Sutton et al., 1999] Richard S Sutton, Doina Precup, and
Satinder Singh. Between mdps and semi-mdps: A frame-
work for temporal abstraction in reinforcement learning.
Artificial intelligence, 112(1-2):181–211, 1999.
[Tessler et al., 2018] Chen Tessler, Daniel J Mankowitz, and
Shie Mannor. Reward constrained policy optimization.
arXiv preprint arXiv:1805.11074, 2018.
[Yang et al., 2021] Qisong Yang, Thiago D Sim ̃ao, Simon H
Tindemans, and Matthijs TJ Spaan. Wcsac: Worst-case
soft actor critic for safety-constrained reinforcement learn-
ing. In AAAI, pages 10639–10646, 2021.
[Zhang et al., 2020] Tianren Zhang, Shangqi Guo, Tian Tan,
Xiaolin Hu, and Feng Chen. Generating adjacency-
constrained subgoals in hierarchical reinforcement learn-
ing. Advances in Neural Information Processing Systems,
33:21579–21590, 2020.
|
|
http://arxiv.org/abs/2302.10637v1 | 2023-02-21T12:52:12 | 2023-02-21T12:52:12 | A Survey of Trustworthy Federated Learning with Perspectives on
Security, Robustness, and Privacy | Trustworthy artificial intelligence (AI) technology has revolutionized daily
life and greatly benefited human society. Among various AI technologies,
Federated Learning (FL) stands out as a promising solution for diverse
real-world scenarios, ranging from risk evaluation systems in finance to
cutting-edge technologies like drug discovery in life sciences. However,
challenges around data isolation and privacy threaten the trustworthiness of FL
systems. Adversarial attacks against data privacy, learning algorithm
stability, and system confidentiality are particularly concerning in the
context of distributed training in federated learning. Therefore, it is crucial
to develop FL in a trustworthy manner, with a focus on security, robustness,
and privacy. In this survey, we propose a comprehensive roadmap for developing
trustworthy FL systems and summarize existing efforts from three key aspects:
security, robustness, and privacy. We outline the threats that pose
vulnerabilities to trustworthy federated learning across different stages of
development, including data processing, model training, and deployment. To
guide the selection of the most appropriate defense methods, we discuss
specific technical solutions for realizing each aspect of Trustworthy FL (TFL).
Our approach differs from previous work that primarily discusses TFL from a
legal perspective or presents FL from a high-level, non-technical viewpoint. | [
"Yifei Zhang",
"Dun Zeng",
"Jinglong Luo",
"Zenglin Xu",
"Irwin King"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10637v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10637v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CR"
] | 3
2
0
2
b
e
F
1
2
]
G
L
.
s
c
[
1
v
7
3
6
0
1
.
2
0
3
2
:
v
i
X
r
a
A Survey of Trustworthy Federated Learning
with Perspectives on Security, Robustness, and
Privacy
1
Yifei Zhang∗, Dun Zeng∗, Jinglong Luo∗, Zenglin Xu† Irwin King†
Abstract-Trustworthy artificial intelligence (AI) technology has revolutionized daily life and greatly benefited human society. Among
various AI technologies, Federated Learning (FL) stands out as a promising solution for diverse real-world scenarios, ranging from risk
evaluation systems in finance to cutting-edge technologies like drug discovery in life sciences. However, challenges around data
isolation and privacy threaten the trustworthiness of FL systems. Adversarial attacks against data privacy, learning algorithm stability,
and system confidentiality are particularly concerning in the context of distributed training in federated learning. Therefore, it is crucial
to develop FL in a trustworthy manner, with a focus on security, robustness, and privacy. In this survey, we propose a comprehensive
roadmap for developing trustworthy FL systems and summarize existing efforts from three key aspects: security, robustness, and
privacy. We outline the threats that pose vulnerabilities to trustworthy federated learning across different stages of development,
including data processing, model training, and deployment. To guide the selection of the most appropriate defense methods, we
discuss specific technical solutions for realizing each aspect of Trustworthy FL (TFL). Our approach differs from previous work that
primarily discusses TFL from a legal perspective or presents FL from a high-level, non-technical viewpoint.
Index Terms-Trustworthy Federated Learning, Privacy, Robustness, Security
(cid:70)
1 INTRODUCTION
1.1 From Trustworthy AI
Learning
to Trustworthy Federated
Trustworthy AI has recently received increased attention
due to the need to avoid the adverse effects that AI could
have on people [248, 202, 124, 190, 171]. There have been
ongoing efforts to promote trustworthy AI, so that people
can fully trust and live in harmony with AI technologies.
Among various AI technologies [258, 189, 253, 256, 259, 257,
44, 43, 42, 45], Federated Learning (FL) stands out due to the
demand for data privacy and data availability in distributed
environments. The core idea of FL is to generate a col-
laboratively trained global learning model without sharing
the data owned by the distributed clients [238, 172, 255].
Since its introduction in 2016 [138], FL has been widely
used in various areas, including finance [93], health [165],
business, and entertainment. However, FL is vulnerable to
adversarial attacks that are mainly focused on impairing
the learning model or violating data privacy, posing signifi-
cant threats to FL in safety-critical environments. Therefore,
people increasingly expect FL to be private, reliable, and
socially beneficial enough to be trusted. In this survey, we
• Yifei Zhang and Irwin King was with the Department of Computer
Science and Engineering, The Chinese University of Hong Kong, ShaTin,
N.T., Hong Kong SAR, China. Email: {yfzhang,king}@cse.cuhk.hk
• Zeng Dun was with the University of Electronic Science and Technology
•
of China and Peng Cheng Lab. Email: [email protected]
Jinglong Luo and Zenglin Xu was Harbin Institute of Technol-
ogy, Shenzhen and Peng Cheng Lab Email:
[email protected] and
[email protected]
Yifei Zhang Dun Zeng and Jinglong Luo contribute equally. Corresponding
Authors are Zengling Xu and Irwin King
provide a summary of these efforts from the perspective of
Trustworthy Federated Learning (TFL).
The trustworthiness of the system is based on the con-
cept of "trust," which makes the system "worthy" of being
relied on. Trust can be defined as "the relationship between
a trustor and a trustee: the trustor trusts the trustee." In
the context of TFL, we define the trustee as the FL models
or systems, and the trustor as the participants in FL, users,
and regulators. From the perspective of software develop-
ment, an FL model is trustworthy if it is free of threats
in different development stages of an FL model (i.e., data
processing, model training, and deployment), with three
key aspects of trustworthiness, as we will discuss later. We
define TFL as being safe and private for processing personal
data (Privacy), stable and robust for training the model
(Robustness), and confidential and correct for deploying
systems (Security), as shown in Fig. 1(a).
1.2 Framework of Trustworthy Federated Learning
Federated learning offers a more versatile approach to
dealing with distributed data. It differs from traditional
centralized machine learning in several ways, such as data
isolation, communication, non-IID distribution, and others.
These characteristics make FL unique and require different
trustworthiness practices compared to general AI and other
learning types [124, 248]. To provide a better understanding
of our TFL framework, we will begin by briefly describing
potential threats in the different stages of FL
• Data Processing. In the data processing stage, threats
arise from potential information leakage and malicious
attacks on the data. For instance, malicious actors can
2
(a) The development stage of TFL.
(b) Aspects in TFL
Figure 1: The overall framework of Trustworthy Federated Learning (TFL).
Figure 2: Threats in different stages of Trustworthy Federated Learning.
Table 1: The proposed taxonomy of Trustworthy Federated Learning
Data Processing
Model Traing
Deployment
Treats
Defense
Treats
Defense
Treats
Defense
Security
Privacy
Information Leakage
• Data & Label Leakage [177,
261, 270]
• Membership Leakage
[59,
130, 139, 150, 149, 160, 186]
• Properties Leakage
[9, 67,
139]
• Cryptography-
based
Methods
[146, 5, 154, 105, 145,
205, 206, 175, 153, 119,
35, 53, 25, 107, 108]
• Anonymization
Methods
70, 188, 222, 52, 262]
[130, 202,
Gradient Inversion Attack [74,
261, 242, 237, 270]
• Cryptography-based
Methods
[19, 134,
55, 11, 228, 83, 8, 245,
251, 47, 264]
Deployment Security
• Data security
• Model security
• Cryptography-
based
Methods
[91, 79, 66, 37, 174,
125, 168, 100, 142, 169,
34, 163, 97, 271, 164]
Training Phase Privacy Leakage
• Data & Label Leakage [177,
261, 270]
• Membership Leakage
[59,
130, 139, 150, 149, 160, 186]
• Properties Leakage
[9, 67,
139]
• DP-based methods [4, 86, 95,
132, 131, 266]
• Perturbation-based
Method [85, 128, 214]
Inference attack
• Query-based
[9, 67, 139]
attack
• Model-based attack
[186, 140]
• DP-based methods [139, 270]
• Perturbation-based
Method [215, 32, 64]
Robustness
Non-IID Data [265, 94]
Data Poisoning[81, 10,
200, 62, 15, 207]
• Label Flipping At-
tack [15]
• Poisoning Sample At-
tack [81, 10]
• Optimization-based
Methods [117, 104, 208,
166, 3, 167]
• Knowledge-based Meth-
ods [98, 181, 272, 112]
Model Poisoning
• Backdoor Attack [10, 39,
207, 81, 221, 71]
• Byzantine Attack [63, 13,
173]
• Robust Aggregation [18,
82, 220, 40, 236, 114, 218,
157, 158]
• Byzantine Detection [147,
116, 223, 63, 260]
• Hybrid Mechanism [159,
28, 84, 263, 270]
N/A
N/A
conduct data poisoning attacks [39, 111, 6] in FL. They
may modify the labels of training samples with a spe-
cific class, resulting in poor performance of the model
on this class.
• Model Training. During the model training process, a
malicious participant in FL can perform model poison-
ing attacks [219, 221, 18] by uploading designed model
parameters. The global model may have low accuracy
due to the poisoned local updates. In addition to model
poisoning attacks, Byzantine faults [18] are also com-
mon issues in distributed learning, where the parties
may behave arbitrarily and upload random updates.
• Deployment and Inference. After the model is learned,
inference attacks [186, 140, 150] can be conducted on
it if it is published. The server may infer sensitive
information about the training data from the exchanged
model parameters. For example, membership inference
attacks [186, 150] can infer whether a specific data
record was used in the training. It is worth noting that
inference attacks may also occur in the learning process
by the FL manager, who has access to the local updates
of the parties.
Then we briefly explain the three key core aspects of
trustworthiness and its associated defense methods (Ta-
ble 1).
• Privacy. Privacy refers to how private data within FL
can be protected to prevent it from being leaked. It
is crucial to guarantee the privacy of FL data and
model parameters, which are considered confidential
information belonging to their owners, and to prevent
any unauthorized use of the data that can directly or
indirectly identify a person or household. This data cov-
ers a wide range of information, including names, ages,
genders, face images, fingerprints, etc. Commitment to
privacy protection is an essential factor in determining
Threats in Trustworthy FL Data Preprocessing Data Poisoning Label Flipping Attack Poisoning Samples Attack Out of Distribution None-IID Data Data Secuity Deployment Inference Attack Query Invasion Attack Model Invasion Attack Deployment Security Data Security Model Security Model Training Model Poisoning Backdoor Attack Byzantine Attack Training Privacy Leakage Data & Label Leakge Membership Leakage Properties Leakage Communication Eavesdropping Parameter Eavesdropping Gradient Eavesdroppingthe trustworthiness of an FL system. This is not only
because of the data value but also because of regulatory
and legal requirements.
• Robustness. Robustness refers to the ability of FL to
remain stable under extreme conditions, particularly
those created by attackers. This is essential because real
environments where FL systems are deployed are usu-
ally complex and volatile. Robustness is a vital factor
that affects the performance of FL systems in empirical
environments. The lack of robustness may also cause
unintended or harmful behavior by the system, thereby
diminishing its trustworthiness.
• Security. Security refers to the protective measures
taken to prevent unauthorized users from gaining ac-
cess to data. The core of security is to ensure that unau-
thorized users cannot access sensitive data. Therefore,
the security of FL aims to ensure the confidentiality
and correctness of computational data. Specifically, this
data includes training and prediction data, intermediate
parameters, and the results of the trained model. Un-
like privacy, which targets individuals, security focuses
more on systems, institutions, and the public interest.
It is worth noting that previous works on FL [238, 232] often
use the terms privacy and security indiscriminately and re-
fer to them as privacy-preserving federated learning (PPFL).
However, these two concepts have different guarantees for
TFL, and we aim to clarify the distinction between them. In
TFL, security guarantees the confidentiality and correctness
of the system. Protection is necessary to ensure that attackers
cannot access the internal TFL, such as weight, gradients,
and other sensitive information. On the other hand, privacy
in TFL indicates how private information within FL can
be protected to prevent it from being leaked. Some studies
have found that private information, such as data records,
proprieties, and membership, can be retrieved from the
weight and gradient. Thus, privacy guarantees that even if
attackers can access the internal TFL, such as weight, model,
gradients, etc., private information can still be preserved.
Our survey focuses on providing technical solutions for
each aspect of TFL in different development stages. This
perspective sets it apart from recent related works, such
as government guidelines [187] that suggest building TFL
systems through laws and regulations or reviews [24, 187]
that discuss TFL realization from a high-level, non-technical
perspective. Our main contributions are:
• We present a synopsis of threats and defense ap-
proaches for the core aspects of TFL (i.e., privacy, ro-
bustness, and security) in different development stages
of FL (i.e., data processing, model training, and de-
ployment) to provide a general picture of the field of
Trustworthy Federated Learning.
• We discuss the challenges of trustworthiness in FL,
clarify existing gaps, identify open research problems,
and indicate future research directions.
In the remaining sections, we organize the survey as
follows: In Section 2, we provide an overview of existing
threats in the TFL system to help readers understand the
risks involved in building a TFL system from a software
development perspective. In Section 3, we detail the aspect
of security, which ensures the confidentiality and correct-
3
ness of computational data in TFL. In Section 4, we de-
tail the aspect of robustness, which makes a TFL system
robust to the noisy perturbations of inputs and enables it
to make trustworthy decisions. In Section 5, we present
the dimension of privacy, which guarantees a TFL system
avoids leaking any private information.
IN
FEDERATED
TRUSTWORTHY
2 THREATS
LEARNING
Potential threats exist in all phases of federal
learning,
harming the trustworthiness of the system. The distribute
nature of FL makes it vulnerable to information leakage
and adversarial attack. In this section, we summarize and
compare the existing studies on FL threats according to the
aspects considered in Section 1.
2.1 Threats in Data Processing of Federated Learning
One main vulnerable stage of FL is the data processing. At
this stage, raw data is cleaned, processed, and transformed
into features that can be accepted by machine learning
model. Due to the distributed nature of federated learning,
Non-iid data and information leakage are common treats
in unprotected FL environment. Meanwhile, malicious can
to harm the model by sending poisoned data during data
processing. In what follows, we summarize the potential
threats in the data processing phase.
Information Leakage. Information leakage exists in the data
processing stages even if there is no direct data exchange
in FL. In federal learning, although data is not directly
involved in communication, the exchanged model param-
eters and gradients still contain private information. In the
absence of data protection (e.g., encryption, perturbation, or
anonymization), a direct exchange of model and gradient
derived from the local data causes privacy leaks. A number
of studies show that the raw record, membership, and prop-
erties can be inferred from weight and gradients [270, 261].
Non-IID Data. Due to distributed setting of FL, the data
are preserved on isolated devices/institutions and cannot be
centralized. Hence, the data samples are generated in vari-
ous devices/institutions where the source distributions can
be None Independent and Identically Distributed (None-
IID) in many ways [94]. A number of studies [265, 268]
have indicated that the performance drop of FL in Non-IID
settings is inevitable. The divergence of local updates [265]
continues to accumulate, slowing down the model conver-
gence and weakening model performance.
Data Poisoning Attack. Data poisoning occurs during the
data pre-processing step. The adversary adds a number of
data samples to the training set with goal of miss classify
the target label. The label-flipping attack [15] is a common
example. It does not change the data properties, but make
the the target labels to another class. For instance, hostile
users can poison their data by replacing all labels of "apple"
with labels of "banana". As a result, the trained classifier
cannot correctly categorize "apple" and it will incorrectly
expect "apple" to be "banana". Gu et al. [81] design another
practical poisoning attack called backdoor attacks. In this
scenario, an attacker can alter specific features or subsec-
tions of the original training dataset to implant backdoors
into the model, so that the model responds according to
the adversary's intent if the input contains the backdoor
features. This kind of attack is difficult to identify as the per-
formance of the poisoned model with clean inputs remains
mostly unchanged. Note that any FL clients are capable of
launching a data poisoning attack. The impact on the FL
model is dependent on the frequency of the engagement of
clients in attacks and the quantity of tainted training data.
2.2 Threats in Model Training of Federated Learning
Model Poisoning Attack. Model poisoning attacks are in-
tended to poison local updates before they are communi-
cated to the server or to implant hidden backdoors inside
the global model [10]. Because models are continuously
updated, it is believed that model poisoning attacks more
effective compared to data poisoning attacks. Depending on
the objectives of the attack, there are two types of poisoning-
based attacks (i.e., untargeted and targeted attacks). In tar-
geted model poisoning, the adversary seeks to induce the
FL model to misclassify a collection of specified inputs with
high probability. The poisoned updates can be injected via
manipulating the training process or generated by incorpo-
rating hidden backdoors [18]. Bagdasaryan et al. [10] shows
the simple single-shot attack could be sufficient to harm
the FL model. In untargeted attack poisoning, the adver-
sary seeks to undermine the performance of the FL model.
In a byzantine attack [63, 13, 173], the adversary players
change their outputs to have the same distribution as the
right model updates in order to evade detection. It behaves
completely arbitrarily to diminish model performance.
Privacy Leakage and Communication Eavesdropping. In-
formation leakage and communication eavesdropping are
common issue during the training process, especially during
weight and gradient updates. It is important to note that in-
formation leakage is a privacy threat, whereas communica-
tion eavesdropping is a security threat. In FL, three types of
data must be transferred between clinets and server: weight,
gradients, and final model. Each of these data formats
contains sensitive information about the training datasets
that can be intercepted and utilized to reveal sensitive infor-
mation [68, 240]. Clients communicate gradients/weights to
the server, which collects them and returns them to clients
for model updating in gradient/weight-update-based FL
systems [131]. Gradients are commonly calculated in deep
neural network models by back-propagating throughout the
whole network. Specifically, the gradient is compute via the
current layer activation and the error propagate fromt the
loss. in the same way, the local model weight is update using
the gradients compute form the local dataset. As a result,
weight updating, gradient updating, and final model) may
contain sensitive details about local data [192, 161].
2.3 Threats in Development of Federated Learning
Inference Phase Data Security. In the phase of deployment
or inference, the task initiator usually deploys the carefully-
trained model to the cloud server to provide prediction ser-
vices and get the related payment. The model parameters, as
the intellectual property of the model owner, need to be ef-
fectively protected in order to continuously generate value.
4
However, the curious cloud server may steal the model
parameters during the deployment process. Furthermore,
to accomplish the prediction task, users need to upload
their data, which may contain sensitive information such
as gender, age, health status, etc. being exposed to the cloud
server. A lot of work [91, 79, 66, 37, 174, 125, 168, 100, 142,
169, 34, 163, 97, 271, 164] emerged in order to address data
leakage in the inference phase, and we will describe these
studies in detail afterwards.
Inference Phase Attack. The inference phase focuses on
determining how to provide the query service to consumers,
and it is also vulnerable to inference attack [185, 140]. This
kind of attack is launched in the inference phase after the
model has been trained, which is usually referred to as an
evasive or exploratory attack. In general, the purpose of
an inference attack is to produce inaccurate predictions or
collect information about the model's attributes rather than
to alert the trained model. The threat during the inference
phase is mostly associated with the final model, which
is either published to clients or provided as an API for
external users. There are two key threats associated with
inference attacks: (1) Model-based attacks and (2) Query-
based attacks. Attackers have access to the model parame-
ters and thus the query results as well as any intermediate
computations, they can extract sensitive information about
the participants' training datasets [68, 249].
3 SECURITY
In this section, TFL is introduced from a security perspec-
tive, and we refer to these studies as Secure Federation
Learning (SFL). Specifically, SFL guarantee the confidential-
ity and integrity of data and model during FL training and
inference by employing secure computing include Secure
Multi-Party Computation (SMPC) [234, 235] and Homomor-
phic Encryption (HE) [152, 60, 2]. In Section 3.1, We first
analyze the threats that exist in SFL and give a formal
definition of SFL based on this. Subsequently the secure
computing techniques used to address the threats present
in SFL are presented in Section 3.2. Finally, we provide an
overview of SFL research works in terms of data security,
model security, and system security in Section 3.3.
3.1 The Definition of Secure Federated Learning
In this section, we describe the threat models present in the
FL training and prediction process and give the definition
of SFL based on these threat models. Specifically, there are
different threats to FL in different scenarios. These threats
can be abstracted into different threat models. An SFL
algorithm is secure under a certain threat model means that
it can resist all attacks under that threat model.
The threat model of SFL can be divided into a semi-
honest (passive) model and a malicious (active) model ac-
cording to the system's tolerance to the adversary's capa-
bilities. Specifically, under the assumption of a semi-honest
model, the adversary will perform operations according to
the protocol but tries to mine the private data of other
participants through the information obtained in the process
of executing the SFL protocol. And the security of SFL
under the semi-honest model requires that the user's private
information is not available to the adversary. Unlike the
semi-honest model, in the malicious model the adversary
will violate the protocol in order to obtain private data. The
security of SFL under the malicious model also requires that
the user's private data is not available to the adversary. In
addition, the security strengths of the SFL algorithms, sorted
from weak to strong, are: abort, fair, and guaranteed output
delivery (GOD). In detail, abort means that the security
detects malicious behavior and terminates the protocol. Fair-
ness means that the dishonest participant can get the output
when and only when the honest participant gets the output
result in the secure computing protocol. The GOD means
that the dishonest participant cannot prevent the honest
participant from obtaining the output during protocol exe-
cution. Furthermore, the threat model of SFL can be divided
into honest-majority and dishonest-majority according to
the percentage of participants controlled by the adversary in
the system. Specifically, the number of adversary-controlled
participants in the honest majority model is less than half of
the total number of participants. In contrast, in the dishonest
majority model, the number of participants controlled by the
adversary is greater than or equal to half of the total number
of participants. Based on the threat model of SFL, we give
the following definition of SFL.
Definition 3.1. The training process of FL can be seen as a
function of m-ary functionality, denoted by
f : ({0, 1}∗)m → ({0, 1}∗)m.
(1)
Specifically, f is a random process mapping string se-
quences of the form x = (x1, . . . , xm) into sequences of
random variables, f1(x), . . . , fm(x) such that, for every
i, the i-th party Pi who initially holds an input xi,
wishes to obtain the i-th element in f (x1, . . . , xm) which
is denoted by fi(x1, . . . , xm). The inference process of
FL can be seen as a function of one-ary functionality,
denoted by
g : {0, 1}∗ → {0, 1}∗.
(2)
Specifically, g is a random process mapping string se-
quences of the form y into sequences of random vari-
ables, g(y), such that the client C who initially holds
an input y wishes to obtain the g(y). We call an FL
algorithm as an SFL algorithm if it can complete the
calculation of the training or inference process under a
given threat model.
3.2 Defense Methods in Secure Federate Learning
In this section, we introduce the defense techniques com-
monly used in the SFL algorithms, such as SMPC, HE,
and Trusted Execution Environment (TEE). Accordingly,
SFL algorithms using different secure computing techniques
will have different characteristics. For example, the SMPC-
based secure computing algorithm can theoretically realize
any computation, but it needs to spend a lot of commu-
nication costs. Conversely, the HE-based secure computing
algorithm can implement addition and multiplication op-
erations without any communication costs, but it requires
huge computational overhead.
5
3.2.1 Secure Multi-Party Computation
Secure Multi-Party Computation (SMPC) originated from
the millionaire problem proposed in [234]. The goal of
SMPC is to allow a group of mutually untrusted data
owners to work together on the computation of a func-
tion under the condition that the confidentiality of their
independent data is not compromised. The main techniques
currently implementing the SMPC protocol include Garbled
Circuit (GC) [235], Oblivious Transfer (OT) [162], and Secret
Sharing (SS) [183]. All these techniques have limitations
and usually require a combination with other techniques to
construct efficient SFL algorithms. For example, in spite of,
GC can theoretically enable secure computation of arbitrary
functions in constant rounds, but transmitting the complete
encrypted circuit will result in high communication costs.
In contrast, while SS can achieve secure computation at a
lower communication cost, it requires a larger number of
communication rounds for complex operations.
Oblivious Transfer. Oblivious transfer (OT) is proposed
in [162]. As a very important primitive in cryptography, OT
not only can implement the SMPC protocol independently
but also can integrate with other technologies to complete
the construction of the SMPC protocol. There are generally
two parties in the OT protocol namely, the sender and the
receiver. The goal of the OT protocol is to enable the receiver
to obtain certain information from the sender obliviously on
the premise that the sender and receiver's respective private
information is not leaked.
Garbled Circuit. Garbled circuit (GC) is a two-party SMPC
protocol proposed in [234]. The two parties in the GC are
called garbler and evaluator. Suppose the input information
of the garbler is x, and the input information of the evalu-
ator is y. The main idea of GC is to convert computational
functions into boolean circuits. In the obfuscation stage, the
garbler converts the Boolean circuit corresponding to the
calculation function into a garbled circuit and sends the gar-
bled circuit and the random input label corresponding to x
to the evaluator. The evaluator executes the OT protocol by
interacting with the garbler and obtains the corresponding
random input label of y. The evaluator decrypts the garbled
circuit using the random input tag to get the calculation
result. Finally, the evaluator sends the decrypted calculation
result to the garbler. Since the garbled circuit and the ran-
dom input label of x are random values for the calculator,
they do not contain any information of x, and the security of
the OT protocol used ensures that the information of y will
not be leaked to the obfuscator. Therefore, the obfuscation
circuit ensures that both parties involved in the calculation
can obtain the calculation result without revealing their
respective input data.
Secret Sharing. Secret sharing (SS) is a technique inde-
pendently proposed by Shamir [183] and Blackly [17] with
its full name called (t, n)-threshold secret sharing schemes,
where n is the number of parties and t is a threshold value.
The security of SS requires that any less than t parties
cannot obtain any secret information jointly. As a special
case of secret sharing, (2, 2)-additive secret sharing contains
two algorithms: Shr(*) and Rec(*, *). Let ([u]0, [u]1) be the
additive share of any u on ZL. Shr(u) → ([u]0, [u]1) is used
to generate the share by randomly selecting a number r from
f ([x1], [x2], * * * , [xn]) → [f (x1, x2, * * * , xn)], where ∀x ∈ X , x1, x2, * * * , xn → [x1], [x2], * * * , [xn].
ZL, letting [u]0 = r, and computing [u]1 = (u − r) mod L.
Note that due to the randomness of r, neither a single [u]0
nor [u]1 can be used to infer the original value of u. The
algorithm Rec([u]0, [u]1) → u is used to reconstruct the
original value from the additive shares, which can be done
by simply calculating ([u]0 + [u]1) mod L. The additive
secret-sharing technique has been widely used to construct
SMPC protocols for ML operations [146, 205, 206, 175].
GMW [80] represents a function as a Boolean circuit and
uses the value of XOR-based SS. Compared with addition
secret sharing, "XOR" is used instead of addition and
"AND" is used instead of multiplication in GMW.
3.2.2 Homomorphic Encryption
Homomorphic encryption (HE) makes the operation of
plaintext and ciphertext satisfy the homomorphic property,
i.e., it supports the operation of ciphertext on multiple data,
and the result of decryption is the same as the result of the
operation of the plaintext of data. Formally, we have
(3)
Homomorphic encryption originated in 1978 when Rivest
et al. [170] proposed the concept of privacy homomorphism.
However, as an open problem, it was not until 2009, when
Gentry proposed the first fully homomorphic encryption
scheme [75] that the feasibility of computing any function
on encrypted data was demonstrated. According to the type
and number of ciphertext operations that can be supported,
homomorphic encryption can be classified as partial ho-
momorphic encryption (PHE), somewhat homomorphic en-
cryption (SHE), and fully homomorphic encryption (FHE).
Specifically, PHE supports only a single type of ciphertext
homomorphic operation, mainly including additive homo-
morphic encryption (AHE) and multiplicative homomor-
phic encryption (MHE), represented by Paillier [152], and
ElGamal [60], respectively. SHE supports infinite addition
and at least one multiplication operation in the ciphertext
space and can be converted into a fully homomorphic
encryption scheme using bootstrapping [2] technique. The
construction of FHE follows Gentry's blueprint, i.e., it can
perform any number of addition and multiplication opera-
tions in the ciphertext space. Most of the current mainstream
FHE schemes are constructed based on the lattice difficulty
problem, and the representative schemes include BGV [22],
BFV [21, 61], GSW [76], CGGI [50], CKKS [48], etc.
3.2.3 Trusted Execution Environment
A Trusted Execution Environment (TEE) [193] enables a
certain part of the federated learning process into a trusted
environment in the cloud, whose code can be attested and
verified. It provides several properties which guarantee that
codes could be executed faithfully and privately. In detail,
the confidentiality of TEEs guarantees the program process
execution is secret, and the state of code is private; while the
integrity of TEE ensures that the code's execution cannot be
affected. In addition, the measurement of TEE provides the
remote party with proof of the code being executed and its
starting state.
The main function of TEE in SFL is to reduce the at-
tack surface of adversaries. For external adversaries, TEE
6
prevents them from stealing training data and intermediate
results of the model training process. For internal adver-
saries, such as servers and participants, TEE can prevent
collusion attacks, model reversal attacks, backdoor attacks,
etc., between them. Furthermore, TEE can be used to protect
the model parameter information.
3.3 Secure Federated Learning Works
In this section, we categorize the SFL-related works in
terms of data security, model security, and system security.
The specific roadmap is as follows. First, in data security,
we give an overview of SFL algorithms that only protect
data security. This type of algorithm is generally applied
in the training phase. To balance security and efficiency,
they protect only part of the training process and we refer
to it as partially secure federated training (PSFT). Next,
in model security, we review SFL algorithms that protect
both model and data security. These algorithms enable fully
secure federated training (FSFT) while supporting secure
federated inference (SFI). Finally, we review representative
security systems in SFL.
3.3.1 Data Security
Here, we present an overview of the SFL algorithms that
only protects data security, i.e., PSFT. Specifically, We catego-
rize the PSFT algorithms according to the different defense
techniques used in them. As a class of SFL algorithms, PSFT
protects part of the federal training process. In detail, the
PSFT algorithm completes the training process by protecting
the user's local model gradients. The pipeline of PSFT is
shown in Fig. 3.
SMPC-based PSFT. The SMPC-based PSFT algorithms
low computational cost and
have the advantage of
communication volume. However, they usually requires
more communication rounds and leaks the aggregation
parameters to the server. As a well-known work, Bonawitz
et al. [19] proposes the first SMPC-based PSFT algorithm
by using the Diffie-Hellman key exchange protocol
[54]
it can protect the local
and secret sharing. Specifically,
parameters under
(malicious) model
the semi-honest
by three(four) rounds of communication, when there
are participants dropped in each round. On top of that,
Mandal et al. [134] reducing the communication cost by
using non-interactive key generation and L-regular graphs.
Subsequently, Bell et al. [12] demonstrated that each client
only needs to share the public key and encrypted share with
some of the clients to accomplish secure aggregation. Based
on this finding, they further reduce the communication
there are
and computation costs.
In addition to this,
that use
some SMPC-based PSFT algorithms [55, 11]
multiple non-colluding aggregation servers to protect local
parameters. Specifically, participants send the shares of
local parameters to the corresponding aggregation servers
to achieve secure aggregation. Unlike [19] which considers
user dropouts, this type of work focuses on how to reduce
the amount of communication transmitted by participants.
As the first work, Dong et al. [55] proposes to reduce the
communication volume by using a quantization approach.
Inspired by this, Beguier and Tramel [11] further reduces
the communication and computational cost of the PSFT
7
Figure 3: The pipeline of partially secure federated training.
algorithm by fusing techniques such as model sparsification,
model quantization, and error compensation, making the
communication of the PSFT algorithm comparable to or
lower than FedAvg.
HE-based PSFT. Compared with the SMPC-based PSFL
algorithms, the HE-based PSFT algorithms have the ad-
vantage of additionally ensuring that the global model
parameters are not leaked to the curious server. This ad-
vantage further reduces the risk of data leakage during
the model training phase. Although, the HE-based PSFT
algorithms provides strong security guarantees but adds
significant computational and communication overheads.
Specifically, directly using HE algorithms, such as Paillier
cryptosystem to implement security parameter aggregation,
causes its computational cost to account for 80% and in-
creases communication by more than 150 times [245]. To
reduce the computation and communication overhead of
the HE-based PSFT algorithms, Aono et al. [8] proposes
a packetized computation, which effectively improves the
computation and communication efficiency by encrypting
multiple plaintexts after encoding them into one large in-
teger while guaranteeing the correctness of ciphertext com-
putation. Subsequently, Zhang et al. [245] further reduces
the computation and communication overhead of HE-based
PSFT algorithms by encrypting the quantized gradients after
packing them by deflating, cutting, and quantizing them in
advance. In addition, [228, 83, 251] designs HE-based PSFT
algorithms with verifiable features by introducing bilinear
aggregation signatures, homomorphic hashing, etc., which
effectively prevents malicious servers from corrupting or
forging aggregation results.
TEE-based PSFT. Unlike SMPC and HE, which achieve
security assurance for FL at the algorithm level, TEE uses
hardware isolation to reduce the risk of data leakage [247,
47, 41, 143]. Specially, the TEE effectively reducing the attack
surface of adversaries in the FL system as well as preventing
collusive attacks by participants in the FL system. The main
problems faced by TEE in the construction of SFL systems
include the lack of storage space and vulnerability to side-
channel attacks. To address these problems, Cheng et al.
[47] adopts the "Separation of power" approach to alleviate
the problem of insufficient TEE memory by using multiple
TEEs as aggregation servers to complete the aggregation of
model parameters. At the same time, participants shuffle the
parameters by random permutation before uploading them,
effectively preventing TEE from side-channel attacks. In
addition, Chen et al. [41] uses TEE to protect the integrity of
the FL training process and prevent malicious participants
from tampering with or delaying the local training process.
Furthermore, TEE can also provide additional model protec-
tion for FL algorithms, making the trained model accessible
only to the task initiator after the FL task ends [247].
Figure 4: The pipeline of fully secure federated training.
In addition to this, some PSFT algorithms consider sce-
narios in which participants' data are divided according to
features. In this setting, [73, 225] design PSFT algorithms
about linear regression and xgboost based on SMPC. [87,
46, 38, 65, 102, 233, 49, 254] consider the design of the
PSFT algorithms by using HE. Specifically, [87, 233] propose
PSFT algorithms on logistic regression. [46, 38, 65] propose
the PSFT algorithm about tree-based model. [102, 49, 254]
design PSFT algorithms about neural network. Further-
more, Chamani and Papadopoulos [29] uses TEE to design
PSFT algorithm. [90, 69, 217, 36] further improve the security
of PSFT algorithms by fusing SMPC and HE. Recently, Liu
et al. [129] provides an overview of federal learning algo-
rithms by features.
In general, PSFT algorithms based on different technolo-
gies have their own characteristics. Specifically, the SMPC-
based PSFT algorithms have good computational efficiency
and can solve the user dropout problem using SS, making
them more suitable for scenarios where the participants are
mobile devices. In contrast, the HE-based PSFT algorithm is
more suitable for scenarios where participants have stable
communication and strong computational power. Furter-
more, TEE can provide stronger hardware protection on top
of the algorithm protection. Although, the good efficiency
of PSFT makes it possible to train complex models, how-
ever, PSFT leaks global parameters to users or aggregation
servers. This may compromise the confidentiality of the data
to some extent.
3.3.2 Model Security
In the following, we present an overview of SFL algorithms
that can protect both model and data security.
Fully Secure Federated Learning. Compared to the PSFT
algorithms, which can only provide partial protection, FSFT
algorithms achieve complete protection of the federation
training process. Specifically, they convert the basic opera-
tions in machine learning such as matrix multiplication, and
activation functions into corresponding secure operations
using secure computing techniques. The FSFT algorithms
usually adopts an architecture of outsourced computing,
whose security relies on the assumption of non-collusion
among the outsourced computing servers. In detail, the data
and model owner first encrypts the data and model and
sends it to the cloud servers. Then, the cloud servers the use
the encrypted data and model interactions to complete the
FL training process to obtain the encrypted model param-
eters. The pipeline of FSFT is shown in Fig. 4. We classify
the work of FSFT according to the number of servers. A
summary of the FSFT algorithms is shown in Table 2.
Under the two server architecture, SecureML [146] first
introduces SS technology into model training for machine
learning, and designed a secure SGD algorithm for semi-
honest models by fusing GC. The effectiveness of SecureML
is demonstrated by secure training of linear regression,
logistic regression, and fully connected neural network on
MNIST. Subsequently, Quotient [5] is designed by convert-
ing the original neural network into a three-valued neu-
ral network, i.e., the parameters contain only {−1, 0, 1}.
The efficiency of SecureML is improved by a factor of
13 while maintaining the model performance. In addi-
tion, ABY2.0 [154] reduces the communication overhead of
the online phase of the secure multiplication operator by
proposing new SS semantics. On top of this, the overall
efficiency of SecureML has been improved by up to 6.1
times. Furthermore, Kelkar et al. [105] achieves security
computation of the exponential operator by transforming
SS between different semantics and completes the training
of Poisson regression.
Under a three-server architecture, ABY3 [145] designs
the FSFT algorithm under both semi-honest and malicious
settings by fusing SS and GC. By optimizing the secure
multiplication operator and the conversion protocol be-
tween SS and GC, the efficiency of SecureML is greatly
improved. Experimental results show that
[145] is 55,000
times faster than [146] in secure neural network train-
ing. Subsequently, Blaze [153] optimized ABY3 by propos-
ing new SS semantics in a three-server architecture and
achieved an efficiency improvement of up to 2,610 times.
Unlike with ABY3 which uses three computational servers,
SecureNN [205] designs secure FSFT under a semi-honest
model by introducing an auxiliary service server. With the
assistance of the auxiliary server, SecureNN greatly reduces
the communication and computation overhead caused by
HE or OT in the preprocessing phase of FSFT under the
two-service architecture. Experimental results show that
secure neural networks trained using SecureNN over LAN
and WAN are 79 and 553 times faster than SecureML,
respectively. Subsequently, Falcon [206] is designed by fus-
[205] and [145]. By implementing
ing the techniques of
secure computation of batch normalization functions, [206]
can accomplish secure training of complex neural network
models including VGG16. In addition, ARIANN [175] also
designs the FSFT algorithm by using the auxiliary server
model. However, by resorting to the function secret sharing
technique, ARIANN greatly optimizes the online efficiency
of SecureNN nonlinear operations, i.e., achieves secure com-
parison operations with only one round of communica-
tion in the online phase. Under a four-server architecture,
Privpy [119] improves the efficiency of multiplicative online
computation greatly by introducing replicated 2-out-of-4-
SS. Furthermore,
[25, 35, 53, 107] improve the efficiency
or security of the FSFT, respectively.
In summary, the FSFT algorithms achieve complete
8
protection of the training process compared to the PSFT
Algorithm. Specifically, all sensitive data in the training
process including intermediate parameters are effectively
protected by the FSFT algorithms. Meanwhile, by using
outsourced computing, they are making full use of the
computing resources of the cloud server and reduce the
local computing of the participants. Although the efficiency
of FSFT algorithms have been greatly improved in recent
years, however, they are still very slow and cannot complete
most deep learning training tasks in a reasonable time.
Therefore, they are suitable for simple training tasks with
high security.
Secure Federated Inference (SFI). The SFI algorithms allow
prediction tasks to be completed while protecting the secu-
rity of the model provider's model and the user's prediction
data. Specifically, they convert the operations in the predic-
tion process, such as matrix multiplication and activation
functions, into secure operations through secure computing
techniques. They often adopt a client-server architecture. In
detail, the model provider first deploys the model encrypted
or publicly to a cloud server to provide inference services.
Users with inference needs send the encrypted inference
samples to the cloud servers. Then, the cloud server com-
pletes the inference task on the encrypted model and data,
and returns the inference results to the user. The pipeline of
SFI is shown in Fig. 5. We also classify the SFI algorithm by
the number of servers. A summary of the SFI algorithms is
shown in Table 3.
Under one server architecture, CryptoDL [79] and Cryp-
toNets [91] implemented deep convolutional neural net-
works for secure prediction on MNIST using HE. By using
polynomials to approximate nonlinear activation functions,
such as ReLU, Sigmoid, etc., they achieve the expected
prediction performance of 99% on MNIST. Subsequently,
to address the problem that HE is difficult to achieve
secure computation of nonlinear operations, Fenner and
Pyzer-Knapp [66] proposes a way of server-user interaction.
Specifically, the server first completes the linear computa-
tion of SFI in the ciphertext state and sends the computation
result to the user. The user decrypts and then completes the
nonlinear computation in the plaintext state and sends the
computed result encrypted to the server. THE-X [37], also
adopts the same server-user interactive computation and
uses linear neural networks to achieve the approximation of
nonlinear operations, such as softmax and layer-norm. After
optimization, THE-X achieves the first secure inference of
BERT-tiny. Under two server architecture, DeepSecure [174]
uses GC to achieve secure prediction and avoids polynomial
approximation computation. Although [174] uses a bina-
rized neural network to optimize communication efficiency,
the communication overhead is still huge. As one of the
most famous working SFI, MiniONN [125] is designed by
integrating HE and GC. By exploiting the advantages of
different techniques, i.e., HE for linear computation and
GC for nonlinear computation, MiniONN greatly improves
the overall efficiency of the SFI algorithm. Received inspi-
ration from MiniONN Gazelle [100], also designes the SFI
algorithm by combing HE and GC and additionally im-
proved the computational efficiency of HE by using single
instruction, multiple data (SIMD). In addition, Delphi [142]
Table 2: Fully Secure Federated Train Algorithms
9
No. of Servers
Security Model
Semi-honest Malicious
Secure Defense Methods
Model
Dataset
References
2
2
2
2
3
3/4
3
3
3
4
4
4
4
3/4
4
D
D
D
D
H
H
H
H
H
H
H
H
H
H
H
(cid:56)
(cid:56)
(cid:56)
(cid:56)
Abort
(cid:56)
Abort
(cid:56)
Fairness
Fairness
(cid:56)
GOD
GOD
GOD
GOD
GC/OT/SS/HE
GC/OT/SS
GC/OT/SS/HE
GC/OT/SS/HE
GC/OT/SS
SS
SS
SS
SS
GC/SS
SS
SS
SS
SS
GC/SS
FC [146]
FC [5]
FC [154]
PR [105]
FC [145]
LeNet[205]
VGG16 [206]
VGG16 [175]
FC [153]
FC [119]
FC [35]
FC [53]
FC [25]
LR [107]
LeNet [108]
MNIST
MNIST
MNIST
Smoking and Cancer
MNIST
MNIST
Tiny ImageNet
Tiny ImageNet
Parkinson
MNIST
MNIST
MNIST
MNIST
MNIST
MNIST
SecureML [146]
QUOTINENT [5]
ABY2.0 [154]
Kelkar et al. [105]
ABY3 [145]
SecureNN [205]
FALCON [206]
ARIANN [175]
BLAZE [153]
PrivPy [119]
Trident [35]
Fantastic Four [53]
FLASH [25]
SWIFT [107]
Tetrad [108]
1 "(cid:56)" denotes not support; "H" denotes honest majority; "D" denotes dishonest majority; "LR" denotes logistic regression; "PR" denotes
Poisson regression; "FC" denotes a fully connected neural network.
2 For the accuracy of the network structure, it is recommended to refer to the original paper. When work is performed on multiple
models and datasets, we list only the most complex models and datasets in their experiments. Different works may tailor the network
structure or dataset according to the characteristics of the designed FSFT algorithm, such as replacing the loss function, reducing the
number of samples, etc. For the accuracy of the experiments, it is recommended to refer to the original paper.
Figure 5: The pipeline of secure federated inference.
improves the efficiency of the SFI algorithm by transferring
the computation on HE in Gazelle to be done offline and
introducing neural architecture search (NAS) to optimize
the preprocessing. It is worth mentioning that Delphi is one
of the earlier works that tried to accelerate SFI computation
using GPUs. Furthermore, XONN [169] reduces the com-
munication overhead by introducing model pruning and se-
cret sharing techniques based on DeepSecure. Subsequently,
Cryptflow2 [163] optimizes the communication efficiency
of the nonlinear activation function of the SFI algorithm
using OT and the first ResNet50 and DenseNet121 security
predictions were implemented by using Cryptflow2. Unlike
existing SFI algorithms, which all use the same bit-width
integers for computation, SIRNN [164] uses shorter bit-
widths for part of the computation, further reducing the
SFI algorithm communication cost, and designing a non-
uniform bit-width SFI algorithm in a two-server architec-
ture. Experimental results show that SIRNN can effectively
support secure inference for Heads [176]. As the state-of-the-
art work in a two-server architecture, Cheetah [97] avoids
the expensive rotation operation under the SIMD packing
technique by cleverly constructing the mapping between
plaintext and ciphertext, and improves the computation
and communication efficiency of the linear layer of SFI
algorithm. Besides, Cheetah also optimizes the nonlinear
computation of SFI algorithm by using slient-OT [231].
Under
three server architecture, Chameleon [168]
optimizes the communication in the offline phase of
the SFI algorithm and the conversion efficiency of GC
and SS in the online phase by introducing an assistance
server. Furthermore, through consistency detection and fair
reconstruction protocols, Astra [34] implements a secure SFI
algorithm under the malicious model. Through different
forms of secret-sharing techniques Astra optimizes the
communication efficiency of the online phase of the secure
multiplication operator.
Overall, SFI algorithms are well suited for Machine
Learning as a Service (MLaaS) scenarios as they protect
sensitive data during model deployment and inference.
Currently, they have been able to implement inference tasks
for complex deep models in a reasonable time. In the design
of algorithms, the technical route of simultaneously using
multiple secure computing techniques to enhance the effi-
ciency of SFI algorithms is gradually becoming mainstream.
In addition, SFI algorithms are further enhanced effectively
through the incorporation of methods such as model quan-
tization and the interaction computation between client and
server.
3.3.3 Secure System
With the rapid development of SFL, corresponding SFL
systems have emerged one after another. They efficiently
support secure training or prediction tasks by integrating
different SFL algorithms. In this section, we select some
representative ones from them to introduce according to
the maturity of the system and the amount of users, etc.
A summary of the SFL systems is shown in Table 4.
CrypTFlow [109] is an open-source SFL system under
the Microsoft Research EzPC [31] project. By using [109]
users can convert Tensorflow and ONNX models into SFL
models. The CrypTFlow focuses on SFI tasks, and uses
the security operators in SecureNN [205]. In addition,
CrypTFlow can implement secure SFI algorithms under
malicious models, by using TEE, i.e., SGX. CrypTen [106]
is an SFL system built on PyTorch to efficiently support
FSFLT and SFI. By integrating with the generic PyTorch
API, CrypTen lowers the barrier to use the SFL system,
enabling machine learning researchers to easily experiment
with machine learning models using secure computing
techniques. PySyft [273] is OpenMined's open SFL system
that provides secure and private data science in Python.
PySyft supports both PSFLT, FSFLT, and SFI. In detail, the
private data is decoupled from model training and inference
by leveraging secure computing techniques such as SMPC
and HE in Pysyft. FATE1 is an SFL open-source project
initiated by Webank's AI Department. By implementing
multiple secure computing protocols, FATE can effectively
support PSFLT, FSFLT, and SFI. Furthermore, With the
help of highly modular and flexible scheduling system,
FATE has good performance and availability. SecretFlow 2
is a unified programming framework initiated by Ant for
privacy-preserving data intelligence and machine learning.
It provides an abstract device layer consisting of ordinary
devices and secret devices, whereas cryptographic devices
consist of cryptographic algorithms such as SMPC, HE, TEE,
and hardware devices. With a device layer containing secret
devices and a workflow layer that seamlessly integrates
data processing, model training, and hyperparameter tun-
ing, SecretFlow enables efficient SFT and SFI. Rosetta3 is
a TensorFlow-based SFL system. Specifically, by overload-
ing TensorFlow's API, Rosetta allows converting traditional
TensorFlow-based algorithm code to SFL algorithm code
with minimal changes. The current version of Rosetta inte-
grates multiple SFL algorithms to support SFT and SFI. TF-
encrypted4 is also a TensorFlow-based SFL system. Unlike
Rosetta, TF Encrypted makes the system easier to use by
leveraging the Keras API. By integrating the relevant SFL
algorithms of SMPC and HE, TF Encrypted can effectively
support SFT and SFI. CryptGPU [198] and Piranha [213] are
10
two SFL systems that support GPU-accelerated computing
and achieve the desired results. CryptGPU implements GPU
acceleration of the SFL system by integer decomposition
and then uses a submodule of the floating-point Kernel ac-
celerated computational decomposition in Pytorch. Piranha,
on the other hand, implements the integer Kernel directly
on the GPU to support accelerated computation of the SFL
system. PaddleFL5 is an open-source SFL system based on
PaddlePaddle6. With PaddlePaddle's large-scale distributed
training and Kubernetes' elastic scheduling capability for
training tasks, PaddleFL can be easily deployed based on
full-stack open-source software.
In summary, the current SFL systems are designed
to provide an easy-to-use conversion tool
for non-
cryptography, distributed systems, or high-performance
computing professionals. For the sake of the usage habits
of machine learning researchers, existing SFL systems are
usually developed on mainstream machine learning frame-
works such as Tensorflow7 or Pytorch8. Specifically, through
overloading the APIs of these deep learning frameworks,
the SFL systems can convert a machine learning algorithm
code to SFL algorithm code with only minor changes.
federated learning (RFL)
4 ROBUSTNESS
focuses on defending
Robust
against threats to model performance during the model
training process. Compared with SFL techniques that guar-
antee the correctness of computing results and protect the
system from external attackers, RFL considers the threats
from internal. More specifically, there are three main threats
in RFL, which can not be defended in SFL techniques.
Firstly, Non-IID data samples collected by decentralized
and inaccessible FL clients could influence the performance
of the federated learning model. Furthermore, Byzantine
problems may happen to unreliable clients, causing these
clients to upload poisoned or failed local models to the
server. Moreover, vulnerable clients could be manipulated
by human attackers, and then inject backdoors into FL
models. Because these threats happen in the data processing
or model training procedure in local clients, the above
process can not be prevented by SFL techniques. Hence,
additional techniques to guarantee the model performance
in a federated learning system and prevent internal attacks
are required, which can be summarized as robust federated
learning.
In the background, robustness is a vital component in
trustworthy machine learning [204], as conventional ma-
chine learning models are vulnerable to various failures or
attacks. When it comes to distributed machine learning sys-
tems, it also suffers unreliable clients and lossy communica-
tion channels. Federated learning (FL), as a new distributed
learning paradigm with privacy-preserving requirements,
will face the same even worse vulnerability in different
ways. In this section, we focus on the robust techniques in
the global aggregation stage on the FL server and discuss
the main challenges in RFL that differ from a centralized and
1. FATE: https://github.com/FederatedAI/FATE.
2. SecretFlow: https://github.com/secretflow/secretflow.
3. Rosetta: https://github.com/LatticeX-Foundation/Rosetta.
4. TF-encrypted: https://github.com/tf-encrypted/tf-encrypted.
5. PaddleFL: https://github.com/PaddlePaddle/PaddleFL.
6. PaddlePaddle: https://www.paddlepaddle.org.cn.
7. TensorFlow: https://tensorflow.google.cn.
8. Pytorch: https://pytorch.org.
11
No. of Servers
Security Model
Semi-honest Malicious
Secure Defense Methods
Model
Dataset
References
Table 3: Secure Federated Inference Algorithms
1
1
1
1
2
2
2
2
2
2
2
2
3
3
D
D
D
D
D
D
D
D
D
D
D
D
H
H
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
Fairness
HE
HE
HE
HE
GC
GC/OT/SS/HE
GC/OT/SS/HE
GC/OT/SS/HE
GC/OT/SS
HE/OT/SS
HE/OT/SS
OT/SS
GC/OT/SS
GC/OT/SS
Shallow CNN
Shallow CNN
GP
BERT-tiny
Shallow CNN
Shallow CNN
Shallow CNN
ResNet-32
Shallow CNN
DenseNet-121
DenseNet-121
Heads [176]
Shallow CNN
SVM
MNIST
MNIST
P. falciparum
MNLI
Smart-sensing
CIFAR-10
CIFAR-10
CIFAR-100
CIFAR-10
ImageNet
ImageNet
SCUT Head [156]
MNIST
MNIST
CryptoDL [91]
CryptoNets [79]
Fenner and Pyzer-Knapp [66]
THE-X [37]
DeepSecure [174]
MiniONN [125]
Gazelle [100]
Delphi [142]
XONN [169]
Cryptflow2 [163]
Cheetah [97]
SIRNN [164]
Chameleon [168]
Astra [34]
1 "(cid:56)" denotes not support; "H" means honest-majority; "D" means dishonest-majority.
2 For the accuracy of the network structure, it is recommended to refer to the original paper. When work is performed on multiple models and
datasets, we list only the most complex models and datasets in their experiments. Different works may tailor the network structure or dataset
according to the characteristics of the designed FSFT algorithm, such as replacing the loss function, reducing the number of samples, etc. For
the sake of the accuracy of the experiments, it is recommended to refer to the original paper.
Table 4: Summary of SFL System
Techniques
PSFT
FSFT
SFI GPU
Frameworks
Systems
SMPC
SMPC/TEE
SMPC/HE/TEE
SMPC
SMPC
SMPC/HE
SMPC/HE
SMPC/HE/TEE
SMPC
SMPC
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:33)
(cid:33)
(cid:33)
(cid:56)
(cid:56)
(cid:56)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:33)
(cid:33)
(cid:56)
(cid:56)
(cid:33)
(cid:33)
Tensorflow
Tensorflow
Tensorflow
Pytorch
Pytorch
Tensorflow/pytorch
Tensorflow/pytorch
Tensorflow/pytorch
PaddlePaddle
NA
CrypTFlow [109]
Rosetta
TF-encrypted
CrypTen [106]
CryptGPU [198]
Pysyft [273]
FATE
SecretFlow
PaddleFL
Piranha [213]
"(cid:33)" denotes supported; "(cid:56)" denotes not supported; "NA" denotes not adopted.
distributed data center. We put little attention to the robust
system techniques because they have been summarised in
the literature [182, 115, 20]. We categorize the threats to
robustness FL into three classes (Non-IID issues, Byzantine
problems, and targeted attacks) and discuss the defenses
against them respectively. In detail, we focus on the robust-
ness to Non-IID data issues in Section 4.1, the robustness
to Byzantine problems in Section 4.2, and the robustness to
targeted attacks in Section 4.3.
4.1 Robustness to Non-IID Data
The vital methods of addressing the Non-IID data chal-
lenges are to improve the ability of FL algorithms against
model divergence in local training and global aggregation
procedures. With the rapid increase of research interest in
FL, FL algorithms for Non-IID issues have been proposed
in recent years. Furthermore, a review paper [268] provides
its category about FL on Non-IID data from the categories
of Non-IID scenario and system view perspectives. In this
section, we provide a different view to categorize the FL
algorithms towards Non-IID data issues from a technical
view.
Non-IID Data Issue. Due to the privacy regulations that
forbid the FL server from directly manipulating the local
privacy data samples, the data samples are collected alone in
various devices/institutions where the source distributions
can be Non-IID in many ways [94]. Hence, Non-IID data
issues are a fundamental challenge in RFL, which results in
model performance degradation compared with distributed
learning with IID data. These issues commonly exist in FL
applications, which further motivate the research against
model performance degradation with Non-IID data.
Concretely, Non-IID data issues influence the model
training performance of FL by causing the divergence of
local updates [265]. Although the authors claim that Fe-
dAvg [137] could solve the Non-IID data issue to some
extent, studies [265, 94, 101] have indicated that the per-
formance drop of FL in Non-IID settings is inevitable. Af-
ter each round of federated synchronization, local models
share the same parameters but converge to different local
optimums due to the heterogeneity in local data distri-
butions. Consequently, the divergence of uploaded local
update directions causes worse global aggregation results.
This divergence usually continues to accumulate during the
FL, slowing down the model convergence and weakening
model performance. In detail, the scenarios of Non-IID
clients can be categorized into several parties [101].
• Feature Distribution Skew. The marginal distribution
of label P(x) varies across clients. In a handwriting
recognition task, the same words written by different
users may differ in stroke width, slant, etc
• Label Distribution Skew. The marginal distribution of
label P(y) may vary across clients. For instance, clients'
data are tied to personal preferences - customers only
buy certain items on an online shopping website.
• Feature Concept Skew. The condition distributions
P(x|y) vary across clients, and P(y) is the same. For
instance, the images of items could vary widely at
different times and with different illumination. Hence,
the data samples with the same label could look very
different.
• Label Concept Skew. The condition distributions
P(y|x) vary across clients and P(x) is the same. Sim-
ilar feature representations from different clients could
have different labels because of personal preferences,
and the same sentences may reflect different sentiments
in language text.
In real-world settings, the data distribution of clients can
be the hybrid case of the above scenarios. Furthermore,
the number of data samples may be unbalanced among
clients as well. Overall, the Non-IID data issue is a basic
threat to model performance. Hence, the RFL approaches to
guarantee the performance of the FL model is important.
RFL against Non-IID Data. Training a robust shared global
model for an FL system is the most important target to
achieve in RFL. For example, FedAvg aims to train a shared
model on decentralized privacy datasets, where the shared
model shall generalize all distributions of all datasets. How-
ever, it could be hard with decentralized Non-IID data.
To overcome the Non-IID data, the basic idea of FL for a
shared model is to reduce the inconsistency among clients
with Non-IID data. Moreover, depending on the problem
formulation and targets, we broadly categorize them into
optimization-based and knowledge-based methods. In this
section, we focus on the robustness of the shared global
model in the literature, where most approaches could be
implemented on personalized FL at the same time.
We note that personalized FL [197] is another solution for
Non-IID data issues, which trains personalized models for
heterogeneous clients. Personalized FL is robust to Non-IID
data issues in most cases, because personalized models usu-
ally are derived from the global model via fine-tuning [118,
196, 96] or knowledge transferring [16, 123, 88]. Hence, the
personalized model naturally fits the local distributions and
inherits the robustness of the global model [118]. As the
robustness of the global model also affects the inherited per-
sonalized models, we focus on the techniques for training a
robust global model in the section.
the
The
idea
basic
Typically,
techniques.
Optimization-based Methods.
of
optimization-based methods is to reduce the divergence
local updates via distributed convex/non-convex
of
optimization
proposed
optimization-based methods are based on the optimization
framework of FedAvg, and further implement various
frameworks
In detail,
from different motivations.
FedProx [117] adds a proximal
term on the client
update procedure to restrict their updates to be close.
SCAFFOLD [104] uses control variates (variance reduction)
for the "client drift" in its local updates.
to correct
FedNova [208] implements a normalized averaging method
that eliminates objective inconsistency while preserving fast
error convergence. Reddi et al. [166] propose a generalized
FedAvg named FedOPT including client optimization and
server optimization procedure. Then, FedOPT derives
12
FedADAGRAD, FedYOGI, and FedADAM by specializing
in global optimizer on the server side. FedDyn [3] proposes
a solution for a fundamental dilemma, in that the minima
of the local-device level empirical loss are inconsistent with
those of the global empirical loss. Furthermore, Reisizadeh
et al.
[167] propose FLRA, a general Byzantine-robust
federated optimization approach against distribution
shifts in samples located in different clients. In summary,
optimization-based methods usually are flexible with
promising convergence analysis.
Knowledge-based Methods. Differing from the optimiza-
tion formulations, knowledge-based approaches for Non-
IID issues are motivated by knowledge-transferring tech-
niques. The main drawback of such approaches is the re-
quirement of a proxy dataset on the FL server. For instance,
Jeong et al. [98] introduces knowledge distillation and
proposed federated distillation (FD). FD exchanges model
outputs as opposed to FL based on exchanging model pa-
rameters. FedKD [181] presents several advanced FD appli-
cations harnessing wireless channel characteristics and/or
exploiting proxy datasets, thereby achieving even higher
accuracy than FL. Li and Wang [112] demonstrate the model
heterogeneity problems in FL, where the models differ in
clients. Then, federated model distillation (FedMD), based
on transfer learning and knowledge distillation, enables FL
for independently designed models. Knowledge distillation
usually depends on a proxy dataset, making it imprac-
tical unless such a prerequisite is satisfied. In the above
approaches, the quality of the proxy dataset also affects
the performance of the FL model, which make knowledge-
based approaches unreliable in real applications. To solve
that, FedGEN [272] implements a data-free knowledge dis-
tillation approach to address heterogeneous FL, where the
server learns a lightweight generator to ensemble user infor-
mation in a data-free manner, which is then broadcasted to
users, regulating local training using the learned knowledge
as an inductive bias.
Clustering-based Methods. Clustering-based methods ad-
dress Non-IID data issues via cluster clients with similar
data distributions. Clustering-based methods are usually
orthogonal with optimization and knowledge-based algo-
rithms. Hence, we can run federated optimization algo-
rithms among the clients in the same cluster, which is
also known as clustered federated learning (CFL). CFL is
presented in [178], which recursively bi-partition clients
into two conflict clients clusters according to the gradients.
The clustering-based methods are based on the following
assumption 4.1.
Assumption 4.1 (Clustered Federated Learning [178]). There
exists a partitioning C = {c1, . . . , cK}, (cid:83)K
k=1 ck =
{1, . . . , N } (N ≥ K ≥ 2) of the client population, such
that every subset of clients ck ∈ C satisfies the distri-
bution learning assumption (i.e., the data distribution
among these clients is similar).
The key component of clustering-based methods is
the algorithm to privacy-respectively distinguish the data
distribution of clients and then conduct clustering on
these clients. CFL works [191, 57, 155, 211, 226] clusters
clients using K-means clustering based on client parameters.
CFL [178, 179] separates clients into two partitions, which
13
procedure. A subset of clients may be corrupted by an
adversary or random failure during the FL. These clients
may upload poison local updates to the server. The fed-
erated optimization procedure will be ruined if the server
unconsciously aggregates these poisoned updates. In this
section, an untargeted attack is a specific scenario of the
Byzantine problem (clients that may behave abnormally, or
even exhibit arbitrary and potentially adversarial behavior).
That is, the behavior of a subset of clients is arbitrary as
defined in Definition 4.1. Considering there are p Byzantine
clients in an FL system, the affection of the Byzantine attacks
on distributed learning can be described as follows:
w = w − Λ(∆w1, . . . , ̃∆w1, . . . , ̃∆wp, . . . , ∆wK),
(4)
̃∆w denotes the gradients from Byzantine clients.
where
The Byzantine gradients may cause the optimization di-
rection deviates from the global optimum. Hence, effective
Byzantine-robust FL approaches are urgently needed to
guarantee the model performance of FL. The FL server could
not observe the process that happened on the client side
including data processing and client local training. Hence,
the information for the server to determine the identity
of clients is only the uploaded local updates. Based on
that observation, the Byzantine-robust FL that defends the
Byzantine problem could be categorized into (1) Robust
aggregation, (2) Byzantine detection, and (3) Hybrid mech-
anism.
Definition 4.1. [Byzantine client [110, 18]] A Byzantine client
can upload arbitrary local updates to the server
(cid:40)
∆wi =
∗,
∇Fi(wi; Di),
if the i-th client is Byzantine,
otherwise,
(5)
where "*" represents arbitrary values and Fi represents
client i's objective function.
Robust Aggregation. The main goal of robust aggregation
approaches is to mitigate the influence of Byzantine clients
on global aggregation. Robust aggregation techniques are ef-
fective in traditional data center distributed machine learn-
ing. A robust aggregation scheme assumes that the poisoned
local model updates are geometrically far from benign ones.
Hence, methods in the literature aim to build a robust aggre-
gation rule that can mitigate the impacts of malicious attacks
to a certain degree. For example in distributed learning,
Krum [18] and Bulyan [82] select the local updates with
the smallest Euclidean distances to the remaining ones and
aggregate them to update the global model. Medoid and
Marginal Median [220] select a subset of clients as a repre-
sentative set and uses its update to estimate the true center.
GeoMed [40] estimates the center based on the local updates
without distinguishing the malicious from the normal ones.
Trimmed Mean and Median [236] remove the biggest and
smallest values and take the average and median of the re-
maining ones as the aggregated value for each of the model
parameters among all the local model updates. Depending
on their aggregation techniques, there are implicit voting
majority rules in several methods [18, 82, 236], that is, a
certain local model update away from others should follow
the majority direction. Consequently, they may fail when the
number of Byzantine clients is too large. Hence, they have
(a) Federated learning with benign clients.
(b) Federated learning with unreliable clients.
Figure 6: The illustration of threats in RFL.
are congruent. FL+HC [23] uses local updates to produce
hierarchical clustering. IFCA [78]/HypCluster [135] implic-
itly clusters clients by broadcasting different models to them
and allowing them to choose which cluster to join based
on local empirical loss (hypothesis-based clustering). For
the model updating method, CFL [23, 178, 179] utilizes
FedAvg to train cluster models for each cluster during
the cluster model updating procedure, ignoring the fact
that knowledge from one cluster may help the learning of
other clusters. IFCA conducts parameters-sharing in feature
extractor layers and trains personalized output layers via
FedAvg. In addition, FedGSP [244] assigns clients to ho-
mogeneous clusters to minimize the overall distribution
divergence among clusters, and increases the degree of
parallelism by reassigning more clusters in each round. This
idea was further extended to a hierarchical cloud-edge-end
FL framework for 5G empowered industries, namded a
FedGS, to improve industrial FL performance on non-IID
data [122].
Overall, current CFL methods focus on how to cluster
clients better mostly. They learn federated model within
client cluster alone and isolated. However, how to enables
the federated learning process more efficient across clusters
is another open problem in CFL.
4.2 Robustness to Byzantine Problem
The failures that happen on the client side may damage the
efficiency of the FL system, which can be summarized as
the Byzantine problem (the models uploaded from clients
are unreliable). In this section, we review the Byzantine
problem in FL and summarise the defenses against them.
FL server is susceptible to malicious clients as a distributed
learning paradigm due to the inaccessibility of clients' local
training data and the uninspectable local training processes
as shown in Fig. 6(b). In this case, the server cannot be
sure whether the clients are honest and benign. The Byzan-
tine problems usually happen during the client update
Server...w!w!Δw"w!=w+Aggregate(Δw"+⋯+Δw#)...Δw#Data ProcessLocalUpdateGlobalAggregateServer...Δ$w#Δw"w!=w+Aggregate(Δ/w"+⋯+Δw#)Data PoisoningModel PoisoningPoisonedGlobalAggregate...w!w!a theoretical break point, indicating the maximum number
of Byzantine clients that can be defended as summarised in
Table 5. Overall, robust distributed learning approaches are
proposed based on the assumption that the data samples are
IID in clients, which conflicts with real-world FL. Besides,
the Non-IID scenarios would cause updates to diverge,
making the geometric-based robust approaches fail.
Other robust aggregation techniques mitigate the in-
fluence of Byzantine clients via adding regularization
terms [114, 147, 223]. Li et al. [114] enhance the robustness
against Byzantine attacks via adding an additional l1-norm
regularization on the cost function. Zeno+ [223] estimates
the descent of the loss value in asynchronous SGD and
declines the Byzantine clients' contribution via penalty term.
Mu ̃noz-Gonz ́alez et al. [147] proposes Adaptive Federated
Averaging (AFA) to estimate the quality of the client's
updates and dynamically adjust its averaging weights.
Regularization-based methods provide robust analysis un-
der the general cases in optimization and the performance
usually is better than geometric-based methods.
In summary, mitigating the influence of poisoned local
updates on global optimization procedures is the main idea
of robust aggregation approaches. Most of the above robust
aggregation schemes suffer from significant performance
degradation when a relatively large proportion of clients are
compromised, or data among clients is highly Non-IID. Fur-
thermore, recently proposed poisoning attacks [63, 13, 173]
for FL can bypass these robust aggregation algorithms. Mo-
tivated by these new challenges, the Byzantine-robust fed-
erated optimization approaches have been proposed [218,
157, 158], which reveals the further challenges for robust
aggregation techniques. From an application view, most
of the Byzantine-robust federated optimization approaches
assume failure modes without generality. The complex and
unpredictable threats [133] in FL motivate further studies on
general Byzantine robustness, which is an open problem.
Byzantine Detection. Byzantine detection schemes are to
identify and exclude malicious local updates so that Byzan-
tine clients will not damage the FL system. Depending on
the detection rules of such approaches, we further categorize
these methods as validation-based methods and gradient-
based methods. For validation-based methods, Error Rate-
based Rejection (ERR) rejects local updates that would
decrease the global model's accuracy. Loss Function-based
Rejection (LFR) [63] ranks the model's credibility according
to the loss decrease. For gradient-based methods, Li et al.
[116] use a variational autoencoder (VAE) to capture model-
update statistics and distinguish malicious clients from be-
nign ones accordingly. Zhang et al. [260] observe that the
model updates from a client in multiple iterations are incon-
sistent and propose FLDetector [260] to check their model-
updates consistency. Recently, BytoChain [121] introduces a
Byzantine resistant secure blockchained federated learning
framework, which executes heavy verification workflows in
parallel and detects byzantine attacks through a byzantine
resistant consensus Proof-of-Accuracy (PoA). In summary,
Byzantine detection is compatible with most federated op-
timization algorithms. Hence, they are more robust than
Robust-aggregation schemes. Thus, byzantine detection is a
promising direction for exploring robust federated learning.
14
However, these approaches require extra calculation on the
server and client [260, 260, 116], or additional public data on
the server [63].
Hybrid Mechanism. Other works combine the above
schemes and propose a hybrid defense mechanism. Di-
verseFl [159] trains a bootstrapping model for each client us-
ing some of the client's local data and compares the trained
model with her submitted local model update to examine
the local training process. FLTrust [28] trains a bootstrap-
ping model on a public dataset and uses cosine similarities
between local model updates and the trained bootstrapping
model to rank the model's credibility. CoMT [84] couples the
process of teaching and learning and thus produces directly
a robust prediction model despite the extremely pervasive
systematic data corruption. FedInv [263] conducts a privacy-
respecting model inversion [270] to the local updates and
obtains a dummy dataset. Then, FedInv scores and clusters
local model updates by Wasserstein distance of the dummy
dataset and removes those updates that are far from others.
Hybrid mechanism robust federated learning approaches
smartly preserve the advantages of both robust aggregation
and Byzantine detection techniques, however, usually con-
sume more resources. Hence, the resource-efficient robust
approach is also an open problem in applications.
4.3 Robustness to Targeted Attacks
In targeted attacks, the attackers usually could manipulate
the learning process of multiple clients and inject specific
backdoors into the FL model. In this way. the FL model will
output unexpected results on specific inputs with trigger,
while the model performance on clean data is normal. Thus,
attacks with specific targets are more dangerous threats to
RFL. The most discussed targeted attack in the literature
is backdoor attacks [10, 81, 207], which can be further
enhanced by Sybil attacks [56, 71] in FL. The backdoors in
the trained model could be triggered at any time and make
the model output unexpected results during the inference
stage. The Sybil attacks could manipulate the model training
process to control the behaviors of the FL model (backdoor
FL models are easier). In this section, we introduce the
targeted attacks in FL and review the proposed solutions
in the literature.
Backdoor Attacks. An adversary can conduct complex at-
tacks (e.g., both data poisoning and model poisoning) to im-
plant a backdoor trigger into the learned model. Usually, the
model will behave normally on clean data, while predicting
a target class if the trigger appears. The backdoor attacks
in FL are carried out by adversary clients with smartly
organized data/model poisoning attacks. Bagdasaryan et al.
[10] introduce semantic backdoors in FL that cause the
model to misclassify even unmodified inputs. Edge-case
backdoors [207] force a model to misclassify on seemingly
easy inputs that are however unlikely to be part of the
training, or test data, i.e., they live on the tail of the input
distribution. Badnet [81] lets Byzantine clients inject label-
flipped data samples with specific backdoor triggers into the
training datasets. Xie et al. [221] propose DBA (distributed
backdoor attack), which decomposes a global trigger pattern
into separate local patterns and embeds them into the train-
ing set of different adversarial parties respectively. Liu et al.
Table 5: Summary of representative defenses
Category
Type
Method
Technique
Break Point
Robust Aggregation
Geometric-based
Regularization-based
Validation-based
Gradient-based
Byzantine Detection
Hybrid Mechanism
Euclidean distance
Geometric median
Geometric median
Coordinate-wise median
Krum + trimmed median
Inner-product validation
Gradient similarity
Loss regularization
Global validation
Loss feed-back
Gradient similarity
Krum[18]
BGD [40]
Xie et al. [220]
Yin et al. [236]
Bulyan [82]
Zeno++ [223]
AFA[147]
RSA[114]
ERR&LFR [63]
Baffle[7]
FoolsGold [71]
FLDetector[260] Gradient consistency
Li et al. [116]
CoMT [84]
FLTrust [28]
FedInv [263]
DiverseFl [159]
Sun et al. [195]
CRFL [224]
(K-2)/2K
NA
NA
K/2
(K-3)/4K
NA
NA
NA
NA
NA
NA
NA
NA
Anomaly detection
NA
Collaborative teaching
Global fine-tuning
NA
Gradient-based clustering NA
NA
Filter update
NA
Clipping and DP
NA
Clipping and smoothing
Non-IID Data
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
15
Robust to threats
Byzantine Problem Targeted Attacks
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:56)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:56)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
(cid:56)
(cid:56)
(cid:33)
(cid:33)
(cid:33)
(cid:33)
"(cid:33)" denotes supported, and "(cid:56)" denotes not supported or not studied.
[127] propose a two-phase backdoor attack, which includes
a preliminary phase for a whole population distribution
inference attack and generates a well-crafted dataset and
the later injected backdoor attacks would benefit from the
crafted dataset. If an attacker could inject c, fake partici-
pants, into the FL system, the FL may suffer from Sybil
attack [56, 71]. A single Sybil attacker could launch arbitrary
attacks by influencing the fake participants. For example,
Sybil clients contribute updates towards a specific poisoning
objective [71], which achieves targeted attacks (inject back-
doors) and untargeted attacks (ruin model performance).
In summary, backdoor attacks are a well-designed combi-
nation of poisoning attacks from adversaries. Its form and
target could vary in real-world applications, which makes it
hard to be detected and defend.
Defense. The main idea of defending against backdoor
attacks is to prevent the formulation of backdoor triggers in
model training, as the backdoor attacks can be considered
to add an implicit predicting task into the model without
noticing and use a trigger to launch a such predicting task in
the inference stage. Compared with the defense approaches
against the Byzantine problem, targeted attacks are harder
to defend as the adversaries may not damage the model
performance on clean datasets. Based on the observation
that backdoor attackers are likely to produce updates with
large norms, several studies are proposed to defend against
backdoor attacks by manipulating those suspicious gradi-
ents. For example, Sun et al. [195] suggests using norm
thresholding and differential privacy (clipping updates) to
defend against backdoor attacks. CRFL [224] exploits clip-
ping and smoothing on model parameters to control the
global model smoothness. A sample-wise robustness certifi-
cation on backdoors with limited magnitude is proved in the
paper. The above techniques clip gradients from all clients
to destroy the backdoor tasks. However, the hidden cost is
the loss of performance of model training. The targeted at-
tacks are basically conducted via model poisoning and data
poisoning. Hence, previously discussed robust aggregation
methods and Byzantine detection schemes could defend
against backdoor attacks to some extent. Based on that,
BaFFLe [7] utilizes data information feedback from multi-
ple clients for uncovering model poisoning and detecting
backdoor attacks.
5 PRIVACY
A privacy attack in federated learning (FL) aims to expose
personal information about users who are participating in
the machine learning task. This not only endangers the
privacy of the data used to train the machine learning
models, but also the individuals who voluntarily share
their personal information. Initially, it was believed that FL
was a distributed machine learning paradigm that could
protect personal information. However, the learning process
is vulnerable to real-world applications and faces a wide
range of attacks. Despite the fact that private data is never
shared, exchanged models are prone to remembering the
private information of the training dataset. In this section,
we present a taxonomy that aims to simplify the under-
standing of different privacy attacks, as shown in Table 6.
5.1 Privacy Threats in Trustworthy Federated Learning
5.1.1 Data & Label Leakage
In the context of Federated Learning, the data and label
attack is also commonly referred to as the reconstruction
attack. The goal of these attacks is to recover the dataset of
a client who participates in an FL task. The attacks typically
aim to generate the original training data samples and their
corresponding labels. The most common data types that can
be targeted by these attacks are images or plain text, which
often contain private information owned by the parties.
Gradient-based Data Leakage. In a gradient-based Feder-
ated Learning (FL) training procedure, as described in [113,
239], selected clients share their gradients with the federated
server in communication rounds. However, model gradients
may cause a significant amount of privacy leakage as they
are derived from the participants' private training datasets.
By observing, altering, or listening in on gradient updates
during the training process, an adversary (e.g., participants
or eavesdroppers) can infer private data using gradients
obtained via the training datasets [270, 261].
16
Table 6: A Summary of the Relationship between Privacy Treats and the Existing Methods
Privacy Threats
Data & Label Leakage
Membership Leakage
Proporties Leakage
Parameter Updating
[113, 239, 270, 261]
Gradient Updating
Training Phase
[138, 230, 92, 212, 241]
[202, 139, 92]
Inference Phase
Individual Proporties
[186, 140]
[209, 250]
Population Proporties
[144, 141, 229, 269, 33]
Defense Methods
Diff. Privacy
Perturbation
Anonymization
Local Diff. Privacy Global Diff. Privacy
Additive
Multiplicative
[14, 180, 203]
[4, 58, 148]
[215, 228, 270]
[30, 72, 99]
[188, 222]
[139, 148, 194]
[86, 148]
[77, 86, 95]
[32, 64]
[52, 180, 192]
[266, 267]
[139, 148, 201]
[128, 214, 270]
[64, 167]
[52, 180, 192]
To obtain the training inputs and labels, an optimization
algorithm designed by Zhu et al. [270] first creates a dummy
dataset made up of fictitious samples and labels. Dummy
gradients are then obtained using standard forward and
backward propagation on the fictitious dataset. The learn-
ing process is accomplished by minimizing the difference
between the fake gradient and the real gradient. By using
this approach, the attacker can infer the training samples
and labels with a limited number of training rounds.
Zhao et al. [261] expanded on the attack proposed
in [270] by utilizing the relationship between the ground-
truth labels and the gradient signs.
Weight-Based Data Leakage.
In weight-based Federated Learning (FL) frameworks, as
described in [138], selected clients share their local model
parameters with the federated server in communication
rounds. Multiple participants have access to the aggregated
parameters that the server calculates. A weight update can,
therefore, expose the provided data to adversarial partic-
ipants or eavesdroppers [230]. Malicious participants can
calculate the differences between FL models in different
update rounds by repeatedly saving the parameters.
Xu et al. [230] showed that the model weight can be
trained to reveal sensitive information by controlling spe-
cific participants during the training phase. In addition,
Hitaj et al. [92] offer a Generative Adversarial Network
(GAN)-based active attack for recovering training images,
where the key to training the GAN is employing the global
model as a discriminator. The attacker misleads the target
client to release more information about the target label.
Furthermore, Wang et al. [212] have altered the GAN ar-
chitecture to a multitask GAN.
Apart from GAN-based attacks, Yuan et al. [241] focus
on reconstructing text via model parameters in natural lan-
guage processing tasks, especially for language modeling.
5.1.2 Membership Leakage
Membership inference is a technique used to determine
whether a given data sample was part of the training
dataset [120, 130]. For instance, it can be used to identify
whether a particular patient's records were used to train a
classifier for a specific disease.
Traing Phase Membership Leakage. The work by Shokri
et al. [186] focused on the membership inference attack
against privacy leakage in machine learning, where an in-
ference model is trained to determine whether a given data
sample belongs to the training dataset.
Recent studies have identified the gradients and em-
bedding layers as the two areas facing privacy leakage in
membership inference attacks [139]. It has been shown that
the embedding of a deep learning network can expose the
locations of words in the training data through non-zero
gradients, allowing an adversary to conduct a membership
inference attack. To address this issue, Hitaj et al. [92]
evaluated membership inference attacks against generative
models, revealing that many models based on boundary
equilibrium GANs or deep GANs are vulnerable to privacy
leaks.
Inference Phase Membership Leakage During the infer-
ence phase, Fredrikson et al. [68] developed an inversion
method for retrieving private information, revealing that it
can expose user-level information.
In a similar vein, Melis et al. [140] investigated mem-
bership privacy leakage during the inference phase, demon-
strating that deep learning models can disclose the place-
ments of words in a batch. In this case, inference attacks are
primarily responsible for privacy leaks when attackers can
only access model query outputs, such as those returned by
a machine learning-as-a-service API [202].
Furthermore, Shokri et al. [186] explored privacy leak-
age during the inference phase by examining the inference
membership attack against model query results. In this ap-
proach, an inference model is trained to distinguish between
training and non-training data samples.
5.1.3 Property Inference Attack
This type of attack aims to determine whether an unrelated
property of a client or the FL task population is present in
the FL model, with the objective of acquiring a characteristic
that should not be shared. For example, consider a machine
learning model designed to detect faces. An attack might
attempt to infer whether training images contain faces with
blue eyes, even though this characteristic is unrelated to the
primary goal of the model.
Property on Population Distribution. This type of attack
aims to infer the distribution of a feature in a group of
clients. Wang et al. [209] propose a set of passive attacks
using stochastic gradient descent that can be used to infer
the label in each training round. To accomplish this, the at-
tacker needs to possess internal knowledge as well as partial
external knowledge, which includes information about the
number of clients, the average number of labels, and the
number of data samples per label.
Truex et al. [202] extended this approach to a broader
context, demonstrating its data-driven nature and high
transferability.
In a more general FL setting, Zhang et al. [250] propose
a passive attack with limited knowledge to infer the distri-
bution of sensitive features in the training datasets.
Property on Individual Distribution. Attackers may at-
tempt to infer the presence of an unrelated property in target
clients. With stochastic gradient descent, Mo et al. [144]
propose a formal evaluation process to measure the leak of
such properties in deep neural networks. Both passive and
active property inference attacks have been created by Melis
et al. [141] using internal knowledge, with multitasking
learning used to power the active attack [252]. In a regular
FL setting, Xu and Li [229] propose two attacks, passive and
active, with the active attack leveraging CycleGAN [269]
to reconstruct gradients using the target attribute. Chase
et al. [33] suggest a poisoning attack to infer properties,
which requires partial internal information to modify the
target client's dataset and external knowledge. Finally, in
an unusual FL environment using blockchain-assisted HFL,
Shen et al. [184] propose an active attack.
5.2 Privacy Defences Method for Trustworthy FL
5.2.1 Differential Privacy
Differential Privacy (DP) allows for information leakage
while carefully limiting the harm to people whose private
data is stored in a training set. In essence, it hides a person's
personal information by introducing random noise. This
type of noise is proportional to the largest modification that
a single person can make to the output. It should be noted
that DP makes the assumption that the adversary has any
external knowledge.
Definition 5.1 (Differential Privacy [172]). A database access
mechanism, M, preserves (cid:15)-DP if for all neighboring
databases x, y and each possible output of M, repre-
sented by S, it holds that:
P [M(x) ∈ S] ≤ e(cid:15)P [M(y) ∈ S].
If, on the other hand, for 0 < δ < 1 it holds that:
P [M(x) ∈ S] ≤ e(cid:15)P [M(y) ∈ S] + δ,
(6)
(7)
then the mechanism possesses the property of ((cid:15), δ)-
DP, also known as approximate DP. In other words, DP
specifies a "privacy budget" given by (cid:15) and δ. The way
in which it is spent is given by the concept of privacy
loss. The privacy loss allows us to reinterpret both, (cid:15) and
δ in a more intuitive way:
• (cid:15) limits the quantity of privacy loss permitted, that is,
our privacy budget.
• δ is the probability of exceeding the privacy budget
given by (cid:15) so that we can ensure that with probability
1 − δ, the privacy loss will not be greater than (cid:15).
and there are mainly two types of DP (i.e., Global Differen-
tial Privacy and Local Differential Privacy)
Global Differential Privacy Methods. The global differen-
tial privacy scheme has been widely used in many federated
learning (FL) methods [136, 51, 58, 77, 85, 86]. Geyer et al.
[77] presented an FL framework based on global differ-
ential privacy by incorporating the Gaussian mechanism
to protect client datasets. Specifically, the global model is
obtained by randomly selecting different clients at each
training round [77]. The server then adds random noise
to the aggregated global model, which prevents adversary
17
clients from inferring the private information of other clients
from the global model.
However, this framework is vulnerable to malicious
servers since they have access to clean model updates
from the participants. To address this issue, Hao et al. [86]
proposed adding noise to the local gradients instead of the
aggregated model. Following this paradigm, [77] proposed
a differential privacy-based privacy-preserving language
model at the user level, which achieved comparative per-
formance while preserving privacy. However, one challenge
of this method is the trade-off between privacy and utility,
as differential privacy inevitably incurs high computation
costs.
Overall, the global differential privacy method has an
advantage in preserving privacy at a limited cost to model
performance. This is because differential privacy is applied
to the entire dataset with limited noise, guaranteeing a good
statistical distribution.
Local Differential Privacy Methods. Various federated
learning (FL) approaches have employed the local differ-
ential privacy mechanism [14, 27, 126, 132, 148, 180, 194,
194, 203, 210, 216, 266, 267]. The first attempt to combine
local differential privacy scheme with deep neural networks
was proposed by Abadi et al. [1]. This privacy-preserving
method involves two operations: clipping the norm of up-
dating gradients to limit sensitive information in the data,
and injecting noise into clipped gradients. However, this
method was not applied to FL systems.
[267] investigated local differential privacy and evalu-
ated both efficiency and privacy loss in the setting of FL,
ignoring the impact of local differential privacy on model
performance. Bhowmick et al. [14] designed a local differen-
tial privacy-based method that is free from reconstruction
attacks. This approach employs local differential privacy
to protect the privacy of samples on the client side and
to ensure the privacy of the global model on the server
side. In mobile edge computing, Lu et al. [132] proposed
asynchronous FL, which adopts local differential privacy
for local model updates. In the Internet-of-Things, Cao
et al. [27] designed an FL framework with local differential
privacy as its privacy utility. Truex et al. [203] scaled the
local differential privacy approach to large-scale network
training. In the field of natural language processing, Wang
et al. [210] used a local differential privacy FL framework
for industrial-level text mining tasks and showed that it can
guarantee data privacy while maintaining model accuracy.
In summary, due to the nature of local differential
privacy methods, they offer a stronger privacy guarantee
compared to global differential privacy-based FL methods.
5.2.2 Perturbation Methods
They are an alternative approach to provide defenses
against privacy attacks that are not based on DP. Its main
aim is to introduce noise to the most vulnerable components
of the federated learning, such as shared model parameters
or the local dataset of each client, to reduce the amount of
information an attacker can extract. There are mainly two
types of perturbation methods (i.e., additive based Methods
and multiplicative based Methods)
Additive Perturbation Methods. Additive perturbation-
based FL methods are a popular class of privacy-preserving
techniques in FL [30, 64, 77, 86, 95, 128, 201, 214, 228]. These
methods aim to incorporate random noise into the weight
updates or gradient updates to prevent private information
leakage during training. While some methods add noise to
the model parameters [85, 86, 201, 228], others add noise to
the gradient updates [85, 86, 201, 228].
One challenge with these methods is to balance the
privacy guarantee with the model's accuracy. To address
this challenge, Chamikara et al. [30] propose a lossless
data perturbation method that maintains model accuracy
while providing a strong privacy guarantee. In this method,
random noise is added to the data, rather than the model or
gradients.
Other studies, such as Hu et al. [95] and Liu et al. [128],
focus on designing personalized FL models that add noise
to intermediate updates or data attributes to ensure privacy.
However, one limitation of additive perturbation methods
is that they may not be a lossless solution and can affect the
model's performance. Additionally, these methods are vul-
nerable to noise reduction attacks, which can compromise
the privacy of the data [103].
Multiplicative Perturbation Methods. Multiplicative per-
turbation is an alternative method to adding random noise
to data in perturbation-based machine learning. This tech-
nique transforms the original data into some space [30, 32,
64, 72, 99, 246], and has been adapted for use in the context
of the Internet of Things (IoT) in federated learning (FL)
systems. Several studies have explored the use of multiplica-
tive perturbation to preserve data privacy in FL, including
Chamikara et al. [30] and Jiang et al. [99].
In particular, Jiang et al. [99] present an FL method
for IoT objects that employs independent Gaussian ran-
dom projection to perturb the data of each object, while
Chamikara et al. [30] propose a multiplicative perturbation
mechanism in fog devices. However, it should be noted that
the latter method may be vulnerable to insider attackers, i.e.
honest but curious servers.
Other studies have used multiplicative perturbations to
obfuscate the stochastic gradient update and protect the
gradients from curious attackers. For example, Gade and
Vaidya [72] explore the use of this method to protect the
gradients in FL systems. Additionally, Chang et al. [32]
and Zhang et al. [246] propose a multiplicative perturbation
method for weight update-based FL frameworks, which is
applied to local weights with the aim of preventing gradient
leakage to servers.
Overall, perturbation-based FL methods that use mul-
tiplicative perturbation offer stronger privacy guarantees
compared to those using additive perturbation, as it is more
difficult to reconstruct the original data in this case.
5.2.3 Anonymization-based Method
While perturbation-based methods are often considered to
be strong privacy preservation techniques, some works [151,
77] argue that they can still degrade data utility. As a
result, anonymization-based methods have been presented
to address this concern [188, 52, 222, 262].
For instance, Song et al. [188] adopt a GAN-based FL
framework with anonymization schemes to protect against
user-level privacy attacks.
18
Similarly, Choudhury et al. [52] propose an anonymiza-
tion method for FL that aims to improve both data utility
and model performance. This approach involves a global
anonymization mapping process for predicting the de-
ployed FL model. Their evaluation shows that this method
provides stronger privacy preservation and model perfor-
mance compared to DP-based FL methods.
In summary, anonymization-based methods provide
strong privacy preservation without sacrificing data utility,
and can outperform DP-based methods in terms of FL
performance. Therefore, they offer a promising alternative
to perturbation-based methods for privacy-preserving FL.
6 CHALLENGES AND FUTURE DIRECTIONS
6.1 Secure of Federated Learning
Although SFL is currently receiving a lot of attention and
making impressive progress in both academia and industry,
there are still many challenges that need to be addressed.
In this section, we summarize the main challenges currently
faced by the SFL algorithm. Based on these challenges, some
research directions that we consider valuable are proposed.
• Designing more adaptable PSFT algorithms. The cur-
rent PSFT algorithm is usually customized for "Fe-
dAvg". In order to accommodate more complex data
distributions in FL, more aggregation algorithms have
been developed, such as "FedPox" [117], "SCAF-
FOLD" [104]. How to customize the PSFT algorithm for
these new aggregation algorithms is worthy of future
research.
• Design of SFL algorithms for adaptive protection. The
objects protected by existing SFL algorithms are usu-
ally deterministic. Specifically, the PSFT algorithm only
protects the security of local model parameters, but ex-
poses the complete global parameters and final model
results. The FSFT and SFI algorithms protect the com-
plete data and model security but greatly reduce the
overall efficiency of the algorithm. However, the data
and model parameters that need to be protected are
often different at different stages or in different applica-
tion scenarios. It makes sense to design an efficient SFL
algorithm that can protect the data and models in the
FL system accurately according to the requirements.
• How to better integrate secure computing techniques
into SFL systems? The current SFL algorithm is usually
designed to apply safe computation directly. Only the
feature of using the same training data for multiple
iterations in the machine learning training process is
exploited in Kelkar et al. [105] to improve the efficiency
of secure multiplication. How to combine more features
of machine learning algorithms in the training and
prediction process to optimize the efficiency of SFL
algorithms is a direction worth investigating in the
future.
• How to perform better engineering optimization of SFL
algorithms? The reason for the use of secure computing
techniques makes it difficult for the SFL algorithm to
be directly compatible with the current mainstream
machine learning frameworks. This leads to the fact
that existing engineering optimization methods for ma-
chine learning cannot be applied to the SFL algorithm.
Only a relatively small amount of work has considered
engineering optimization of SFL algorithms, such as
using GPUs to accelerate FSFT training. How to make
more use of engineering optimization to improve the
efficiency of SFL algorithms deserves to be investigated
in the future.
6.2 Robustness of Federated Learning
Robust federated learning cares about the trustworthiness
of model training performance. By reviewing the robust
techniques in robust federated learning, we conclude the
challenges and the feasible future directions as follows:
• Non-IID Data issues commonly exist in real-world
federated learning scenarios, which makes the lo-
cal gradients geometrically diverse. Consequently,
the geometric-based robust distributed learning ap-
proaches fail to maintain the robustness of federated
learning. Distinguishing the gradients from Byzantine
clients or Non-IID clients would be an open problem
for future studies on robust aggregation techniques.
• From the perspective of defense against targeted at-
tacks, the researchers observed that the norm of the poi-
soned gradients is usually large. Hence, the commonly
used approaches are conducting gradient-clipping or
gradient-noising. The possibly model training perfor-
mance degeneration is unavoidable due to the gradient-
clipping/noising on benign gradients. Therefore, an-
other open problem in robust federated learning is to
keep the model training performance while defending
against potential attacks.
• In real-world applications, the failure, and attack modes
are various. Besides, the threat modes are unknown
to the server and can be different over time, which
further motivates the study of general robust federated
learning approaches.
• Despite a few FL benchmarks [26, 199] and frame-
works [227, 243, 89] having been proposed, we lack
a standard benchmark to verify the robust ability of
proposed FL approaches, which is future work for the
FL community.
6.3 Privacy of Trustworthy Federated Learning
Despite the tremendous growth of privacy-preserving FL
in recent years, this research area still poses significant
challenges and offers opportunities for developing existing
frameworks and creating new methods to enhance both
data privacy and utility. Some open research problems and
directions are highlighted below:
• Privacy-preserving mechanisms in FL have a trade-
off between effectiveness and efficiency. Therefore, it is
crucial to comprehend usage scenarios under different
privacy requirements and study how to optimize the
deployment of defense mechanisms.
• Data memorization is a major challenge that requires
serious attention since neural network-based federated
learning may overfit and memorize sensitive infor-
mation. Anonymizing the data and model can be a
potential solution to this issue. Hence, we believe that
developing an effective mechanism for anonymizing
19
training datasets is an essential way to ensure privacy
preservation in FL.
• Developing hybrid approaches for privacy methods in
FL by combining various security techniques such as
encryption is advantageous. This is because different
defense strategies offer significant advantages in differ-
ent areas, and it is appropriate to leverage their benefits
to advance existing frameworks.
Overall, TFL is a thriving research field with numerous ap-
proaches and applications. This survey aims to summarize
existing advances and trends in TFL, with the goal of facil-
itating and advancing future TFL research and implemen-
tation. From a technical perspective, this survey provides
a roadmap for building TFL systems. It begins by defining
TFL and presents a general picture of the vulnerabilities in
the available literature associated with trustworthiness in
FL. The survey then reviews recent improvements in TFL
regarding security, robustness, and privacy. It explains the
threats, summarizes the known defense mechanisms for
establishing trustworthy FL in each aspect, and suggests
potential future research routes for these elements. We con-
clude that the study of TFL is a must-have in trustworthy
AI due to its importance. There are still several challenges
to be addressed and directions to be explored to identify
additional threats or vulnerabilities of TFL and appropri-
ate mechanisms to make it a resilient and robust learning
paradigm against those threats.
REFERENCES
[1] M. Abadi, A. Chu, I. Goodfellow, H. B. McMahan,
I. Mironov, K. Talwar, and L. Zhang. Deep learning
In Proceedings of the 2016
with differential privacy.
ACM SIGSAC conference on computer and communica-
tions security, pages 308–318, 2016.
In Proceedings of the 40th
S. Abney. Bootstrapping.
annual meeting of the Association for Computational Lin-
guistics, pages 360–367, 2002.
[2]
[3] D. A. E. Acar, Y. Zhao, R. M. Navarro, M. Mattina,
P. N. Whatmough, and V. Saligrama. Federated learn-
In 9th Inter-
ing based on dynamic regularization.
national Conference on Learning Representations, ICLR
2021, Virtual Event, Austria, May 3-7, 2021. OpenRe-
view.net, 2021. URL https://openreview.net/forum?
id=B7v4QMR6Z9w.
[4] N. Agarwal, A. T. Suresh, F. X. X. Yu, S. Kumar,
cpsgd: Communication-efficient
and B. McMahan.
and differentially-private distributed sgd. Advances in
Neural Information Processing Systems, 31, 2018.
[5] N. Agrawal, A. Shahin Shamsabadi, M. J. Kusner, and
A. Gasc ́on. Quotient: two-party secure neural network
training and prediction. In Proceedings of the 2019 ACM
SIGSAC Conference on Computer and Communications
Security, pages 1231–1247, 2019.
S. Alfeld, X. Zhu, and P. Barford. Data poisoning at-
tacks against autoregressive models. In Proceedings of
the AAAI Conference on Artificial Intelligence, volume 30,
2016.
S. Andreina, G. A. Marson, H. M ̈ollering, and
G. Karame. Baffle: Backdoor detection via feedback-
In 2021 IEEE 41st Inter-
based federated learning.
[7]
[6]
[8]
national Conference on Distributed Computing Systems
(ICDCS), pages 852–863. IEEE, 2021.
Y. Aono, T. Hayashi, L. Wang, S. Moriai, et al. Privacy-
preserving deep learning via additively homomorphic
encryption. IEEE Transactions on Information Forensics
and Security, 13(5):1333–1345, 2017.
[9] G. Ateniese, G. Felici, L. V. Mancini, A. Spognardi,
A. Villani, and D. Vitali. Hacking smart machines
with smarter ones: How to extract meaningful data
arXiv preprint
from machine learning classifiers.
arXiv:1306.4447, 2013.
[10] E. Bagdasaryan, A. Veit, Y. Hua, D. Estrin, and
V. Shmatikov. How to backdoor federated learning.
In International Conference on Artificial Intelligence and
Statistics, pages 2938–2948. PMLR, 2020.
[12]
[11] C. Beguier and E. W. Tramel. Safer: Sparse secure
arXiv preprint
aggregation for federated learning.
arXiv:2007.14861, 2020.
J. H. Bell, K. A. Bonawitz, A. Gasc ́on, T. Lepoint,
and M. Raykova. Secure single-server aggregation
In Proceedings of
with (poly) logarithmic overhead.
the 2020 ACM SIGSAC Conference on Computer and
Communications Security, pages 1253–1269, 2020.
[13] A. N. Bhagoji, S. Chakraborty, P. Mittal, and S. Calo.
Analyzing federated learning through an adversarial
In International Conference on Machine Learning,
lens.
pages 634–643. PMLR, 2019.
[14] A. Bhowmick, J. Duchi, J. Freudiger, G. Kapoor, and
R. Rogers.
Protection against reconstruction and
its applications in private federated learning. arXiv
preprint arXiv:1812.00984, 2018.
[15] B. Biggio, B. Nelson, and P. Laskov. Poisoning at-
tacks against support vector machines. arXiv preprint
arXiv:1206.6389, 2012.
I. Bistritz, A. Mann, and N. Bambos. Distributed
distillation for on-device learning. Advances in Neural
Information Processing Systems, 33:22593–22604, 2020.
[16]
[17] G. R. Blakley. Safeguarding cryptographic keys.
In
Managing Requirements Knowledge, International Work-
shop on, pages 313–313, 1979.
[18] P. Blanchard, E. M. El Mhamdi, R. Guerraoui, and
J. Stainer. Machine learning with adversaries: Byzan-
tine tolerant gradient descent. Advances in Neural
Information Processing Systems, 30, 2017.
[19] K. Bonawitz, V. Ivanov, B. Kreuter, A. Marcedone,
H. B. McMahan, S. Patel, D. Ramage, A. Segal, and
K. Seth. Practical secure aggregation for privacy-
preserving machine learning. In proceedings of the 2017
ACM SIGSAC Conference on Computer and Communica-
tions Security, pages 1175–1191, 2017.
Ingerman, V.
[20] K. Bonawitz, H. Eichner, W. Grieskamp, D. Huba,
J. Koneˇcn `y,
A.
S. Mazzocchi, B. McMahan, et al. Towards federated
learning at scale: System design. Proceedings of Machine
Learning and Systems, 1:374–388, 2019.
Ivanov, C. Kiddon,
[21] Z. Brakerski. Fully homomorphic encryption without
modulus switching from classical gapsvp. In Annual
Cryptology Conference, pages 868–886. Springer, 2012.
[22] Z. Brakerski, C. Gentry, and V. Vaikuntanathan. (lev-
eled) fully homomorphic encryption without boot-
strapping. ACM Transactions on Computation Theory
20
(TOCT), 6(3):1–36, 2014.
[23] C. Briggs, Z. Fan, and P. Andras. Federated learning
with hierarchical clustering of local updates to im-
prove training on non-iid data. In 2020 International
Joint Conference on Neural Networks (IJCNN), pages 1–
9. IEEE, 2020.
[24] M.-E. Brunet, C. Alkalay-Houlihan, A. Anderson, and
R. Zemel. Understanding the origins of bias in word
In International conference on machine
embeddings.
learning, pages 803–811. PMLR, 2019.
[25] M. Byali, H. Chaudhari, A. Patra, and A. Suresh.
framework for privacy-
Flash: Fast and robust
preserving machine learning. Proceedings on Privacy
Enhancing Technologies, 2:459–480, 2020.
[26] S. Caldas, S. M. K. Duddu, P. Wu, T. Li, J. Koneˇcn `y,
H. B. McMahan, V. Smith, and A. Talwalkar. Leaf:
arXiv preprint
A benchmark for federated settings.
arXiv:1812.01097, 2018.
[27] H. Cao, S. Liu, R. Zhao, and X. Xiong.
Ifed: A
novel federated learning framework for local differ-
Inter-
ential privacy in power internet of things.
national Journal of Distributed Sensor Networks, 16(5):
1550147720919698, 2020.
[28] X. Cao, M. Fang, J. Liu, and N. Z. Gong. Fltrust:
Byzantine-robust federated learning via trust boot-
In ISOC Network and Distributed System
strapping.
Security Symposium (NDSS), 2021.
J. G. Chamani and D. Papadopoulos. Mitigating
leakage in federated learning with trusted hardware.
arXiv preprint arXiv:2011.04948, 2020.
[29]
[30] M. A. P. Chamikara, P. Bertok, I. Khalil, D. Liu, and
S. Camtepe. Privacy preserving distributed machine
learning with federated learning. Computer Communi-
cations, 171:112–125, 2021.
[31] N. Chandran, D. Gupta, A. Rastogi, R. Sharma, and
S. Tripathi. Ezpc: programmable and efficient secure
two-party computation for machine learning. In 2019
IEEE European Symposium on Security and Privacy (Eu-
roS&P), pages 496–511. IEEE, 2019.
Shejwalkar, R.
[32] H. Chang, V.
and
A. Houmansadr. Cronus: Robust and heterogeneous
collaborative learning with black-box knowledge
transfer. arXiv preprint arXiv:1912.11279, 2019.
[33] M. Chase, E. Ghosh, and S. Mahloujifar.
Shokri,
Prop-
arXiv preprint
erty inference from poisoning.
arXiv:2101.11073, 2021.
[34] H. Chaudhari, A. Choudhury, A. Patra, and A. Suresh.
Astra: high throughput 3pc over rings with applica-
In Proceedings of the 2019
tion to secure prediction.
ACM SIGSAC Conference on Cloud Computing Security
Workshop, pages 81–92, 2019.
[35] H. Chaudhari, R. Rachuri, and A. Suresh. Trident: Ef-
ficient 4pc framework for privacy preserving machine
learning. arXiv preprint arXiv:1912.02631, 2019.
[36] C. Chen, J. Zhou, L. Wang, X. Wu, W. Fang, J. Tan,
L. Wang, A. X. Liu, H. Wang, and C. Hong. When
homomorphic encryption marries secret sharing: Se-
cure large-scale sparse logistic regression and applica-
In Proceedings of the 27th ACM
tions in risk control.
SIGKDD Conference on Knowledge Discovery & Data
Mining, pages 2652–2662, 2021.
[37] T. Chen, H. Bao, S. Huang, L. Dong, B. Jiao, D. Jiang,
H. Zhou, and J. Li.
The-x: Privacy-preserving
transformer inference with homomorphic encryption.
arXiv preprint arXiv:2206.00216, 2022.
[38] W. Chen, G. Ma, T. Fan, Y. Kang, Q. Xu, and Q. Yang.
Secureboost+: A high performance gradient boosting
tree framework for large scale vertical federated learn-
ing. arXiv preprint arXiv:2110.10927, 2021.
[39] X. Chen, C. Liu, B. Li, K. Lu, and D. Song. Targeted
backdoor attacks on deep learning systems using data
poisoning. arXiv preprint arXiv:1712.05526, 2017.
[40] Y. Chen, L. Su, and J. Xu. Distributed statistical
machine learning in adversarial settings: Byzantine
gradient descent. Proceedings of the ACM on Mea-
surement and Analysis of Computing Systems, 1(2):1–25,
2017.
[41] Y. Chen, F. Luo, T. Li, T. Xiang, Z. Liu, and J. Li. A
training-integrity privacy-preserving federated learn-
ing scheme with trusted execution environment. In-
formation Sciences, 522:69–79, 2020.
[42] Y. Chen, H. Guo, Y. Zhang, C. Ma, R. Tang, J. Li,
and I. King. Learning binarized graph representations
with multi-faceted quantization reinforcement for top-
k recommendation. In SIGKDD, 2022.
[43] Y. Chen, M. Yang, Y. Zhang, M. Zhao, Z. Meng, J. Hao,
and I. King. Modeling scale-free graphs with hy-
perbolic geometry for knowledge-aware recommen-
dation. In WSDM, pages 94–102, 2022.
[44] Y. Chen, Y. Yang, Y. Wang, J. Bai, X. Song, and I. King.
Attentive knowledge-aware graph convolutional net-
works with collaborative guidance for personalized
recommendation. In ICDE, 2022.
[45] Y. Chen, Y. Fang, Y. Zhang, and I. King. Bipartite
graph convolutional hashing for effective and efficient
top-n search in hamming space. In WWW, 2023.
[46] K. Cheng, T. Fan, Y. Jin, Y. Liu, T. Chen, D. Papadopou-
los, and Q. Yang. Secureboost: A lossless federated
IEEE Intelligent Systems, 36(6):
learning framework.
87–98, 2021.
[47] P.-C. Cheng, K. Eykholt, Z. Gu, H. Jamjoom, K. Ja-
yaram, E. Valdez, and A. Verma. Separation of powers
in federated learning (poster paper). In Proceedings of
the First Workshop on Systems Challenges in Reliable and
Secure Federated Learning, pages 16–18, 2021.
J. H. Cheon, A. Kim, M. Kim, and Y. Song. Ho-
momorphic encryption for arithmetic of approximate
In International conference on the theory and
numbers.
application of cryptology and information security, pages
409–437. Springer, 2017.
[48]
[49] T.-H. Cheung, W. Dai, and S. Li. Fedsgc: Federated
In
simple graph convolution for node classification.
International Workshop on Federated and Transfer Learn-
ing for Data Sparsity and Confidentiality in Conjuncation
with IJCAI, 2021.
I. Chillotti, N. Gama, M. Georgieva, and M. Izabach-
ene. Faster fully homomorphic encryption: Bootstrap-
ping in less than 0.1 seconds. In international conference
on the theory and application of cryptology and information
security, pages 3–33. Springer, 2016.
[50]
21
tial privacy-enabled federated learning for sensitive
health data. arXiv preprint arXiv:1910.02578, 2019.
[52] O. Choudhury, A. Gkoulalas-Divanis, T. Salonidis,
I. Sylla, Y. Park, G. Hsu, and A. Das. A syntactic
approach for privacy-preserving federated learning.
In ECAI 2020, pages 1762–1769. IOS Press, 2020.
[53] A. Dalskov, D. Escudero, and M. Keller. Fantastic
four:{Honest-Majority}{Four-Party} secure computa-
tion with malicious security. In 30th USENIX Security
Symposium (USENIX Security 21), pages 2183–2200,
2021.
[54] W. Diffie and M. E. Hellman. New directions in
cryptography. In Democratizing Cryptography: The Work
of Whitfield Diffie and Martin Hellman, pages 365–390.
2022.
[55] Y. Dong, X. Chen, L. Shen, and D. Wang. Eastfly: Effi-
cient and secure ternary federated learning. Computers
& Security, 94:101824, 2020.
J. R. Douceur. The sybil attack. In International work-
shop on peer-to-peer systems, pages 251–260. Springer,
2002.
[56]
[57] M. Duan, D. Liu, X. Ji, Y. Wu, L. Liang, X. Chen, Y. Tan,
and A. Ren. Flexible clustered federated learning for
IEEE Transactions
client-level data distribution shift.
on Parallel and Distributed Systems, 2021.
[58] A. Dubey and A. Pentland. Differentially-private fed-
erated linear bandits. Advances in Neural Information
Processing Systems, 33:6003–6014, 2020.
[59] C. Dwork and M. Naor. On the difficulties of disclo-
sure prevention in statistical databases or the case for
differential privacy. Journal of Privacy and Confidential-
ity, 2(1), 2010.
[60] T. ElGamal. A public key cryptosystem and a sig-
IEEE
nature scheme based on discrete logarithms.
transactions on information theory, 31(4):469–472, 1985.
J. Fan and F. Vercauteren. Somewhat practical fully
homomorphic encryption. Cryptology ePrint Archive,
2012.
[61]
[62] M. Fang, G. Yang, N. Z. Gong, and J. Liu. Poisoning
attacks to graph-based recommender systems. In Pro-
ceedings of the 34th annual computer security applications
conference, pages 381–392, 2018.
[63] M. Fang, X. Cao, J. Jia, and N. Gong. Local model poi-
soning attacks to {Byzantine-Robust} federated learn-
In 29th USENIX Security Symposium (USENIX
ing.
Security 20), pages 1605–1622, 2020.
[64] Y. Feng, X. Yang, W. Fang, S.-T. Xia, and X. Tang.
Practical and bilateral privacy-preserving federated
learning. 2020.
[65] Z. Feng, H. Xiong, C. Song, S. Yang, B. Zhao, L. Wang,
Z. Chen, S. Yang, L. Liu, and J. Huan. Securegbm:
In 2019 IEEE
Secure multi-party gradient boosting.
International Conference on Big Data (Big Data), pages
1312–1321. IEEE, 2019.
[66] P. Fenner and E. Pyzer-Knapp. Privacy-preserving
gaussian process regression–a modular approach to
the application of homomorphic encryption. In Pro-
ceedings of the AAAI Conference on Artificial Intelligence,
volume 34, pages 3866–3873, 2020.
[51] O. Choudhury, A. Gkoulalas-Divanis, T. Salonidis,
I. Sylla, Y. Park, G. Hsu, and A. Das. Differen-
[67] M. Fredrikson, E. Lantz, S. Jha, S. Lin, D. Page, and
T. Ristenpart. Privacy in pharmacogenetics: An {End-
to-End} case study of personalized warfarin dosing.
In 23rd USENIX Security Symposium (USENIX Security
14), pages 17–32, 2014.
[68] M. Fredrikson, S. Jha, and T. Ristenpart. Model inver-
sion attacks that exploit confidence information and
basic countermeasures. In Proceedings of the 22nd ACM
SIGSAC conference on computer and communications se-
curity, pages 1322–1333, 2015.
[69] F. Fu, H. Xue, Y. Cheng, Y. Tao, and B. Cui. Blindfl:
Vertical federated machine learning without peeking
into your data. In Proceedings of the 2022 International
Conference on Management of Data, pages 1316–1330,
2022.
[70] C. Fung, J. Koerner, S. Grant, and I. Beschastnikh.
Dancing in the dark: Private multi-party machine
arXiv preprint
learning in an untrusted setting.
arXiv:1811.09712, 2018.
[71] C. Fung, C. J. Yoon, and I. Beschastnikh. The lim-
itations of federated learning in sybil settings.
In
23rd International Symposium on Research in Attacks,
Intrusions and Defenses (RAID 2020), pages 301–316,
2020.
[72] S. Gade and N. H. Vaidya. Privacy-preserving dis-
tributed learning via obfuscated stochastic gradients.
In 2018 IEEE Conference on Decision and Control (CDC),
pages 184–191. IEEE, 2018.
[73] A. Gasc ́on, P. Schoppmann, B. Balle, M. Raykova,
J. Doerner, S. Zahur, and D. Evans. Secure linear
IACR
regression on vertically partitioned datasets.
Cryptol. ePrint Arch., 2016:892, 2016.
J. Geiping, H. Bauermeister, H. Dr ̈oge, and M. Moeller.
Inverting gradients-how easy is it to break privacy
in federated learning? Advances in Neural Information
Processing Systems, 33:16937–16947, 2020.
[74]
[75] C. Gentry. A fully homomorphic encryption scheme.
Stanford university, 2009.
[76] C. Gentry, A. Sahai, and B. Waters. Homomorphic
encryption from learning with errors: Conceptually-
simpler, asymptotically-faster, attribute-based.
In
Annual Cryptology Conference, pages 75–92. Springer,
2013.
[77] R. C. Geyer, T. Klein, and M. Nabi. Differentially
private federated learning: A client level perspective.
arXiv preprint arXiv:1712.07557, 2017.
[78] A. Ghosh, J. Chung, D. Yin, and K. Ramchandran. An
efficient framework for clustered federated learning.
Advances in Neural Information Processing Systems, 33:
19586–19597, 2020.
[79] R. Gilad-Bachrach, N. Dowlin, K. Laine, K. Lauter,
M. Naehrig, and J. Wernsing. Cryptonets: Applying
neural networks to encrypted data with high through-
put and accuracy. In International conference on machine
learning, pages 201–210. PMLR, 2016.
[80] O. Goldreich, S. Micali, and A. Wigderson. How to
play any mental game, or a completeness theorem
for protocols with honest majority. In Providing Sound
Foundations for Cryptography: On the Work of Shafi Gold-
wasser and Silvio Micali, pages 307–328. 2019.
[81] T. Gu, B. Dolan-Gavitt, and S. Garg. Badnets: Iden-
tifying vulnerabilities in the machine learning model
supply chain. arXiv preprint arXiv:1708.06733, 2017.
22
[82] R. Guerraoui, S. Rouault, et al. The hidden vulnera-
bility of distributed learning in byzantium. In Interna-
tional Conference on Machine Learning, pages 3521–3530.
PMLR, 2018.
[83] X. Guo, Z. Liu, J. Li, J. Gao, B. Hou, C. Dong, and
T. Baker. V eri fl: Communication-efficient and fast
IEEE
verifiable aggregation for federated learning.
Transactions on Information Forensics and Security, 16:
1736–1751, 2020.
[84] Y. Han and X. Zhang. Robust federated learning via
In Proceedings of the
collaborative machine teaching.
AAAI Conference on Artificial Intelligence, volume 34,
pages 4075–4082, 2020.
[85] M. Hao, H. Li, X. Luo, G. Xu, H. Yang, and S. Liu.
Efficient and privacy-enhanced federated learning for
IEEE Transactions on
industrial artificial intelligence.
Industrial Informatics, 16(10):6532–6542, 2019.
[86] M. Hao, H. Li, G. Xu, S. Liu, and H. Yang. Towards
efficient and privacy-preserving federated deep learn-
ing. In ICC 2019-2019 IEEE international conference on
communications (ICC), pages 1–6. IEEE, 2019.
[87] S. Hardy, W. Henecka, H. Ivey-Law, R. Nock, G. Pa-
trini, G. Smith, and B. Thorne. Private federated
learning on vertically partitioned data via entity reso-
lution and additively homomorphic encryption. arXiv
preprint arXiv:1711.10677, 2017.
[88] C. He, M. Annavaram, and S. Avestimehr. Group
knowledge transfer: Federated learning of large cnns
at the edge. Advances in Neural Information Processing
Systems, 33:14068–14080, 2020.
[89] C. He, S. Li, J. So, X. Zeng, M. Zhang, H. Wang,
X. Wang, P. Vepakomma, A. Singh, H. Qiu,
Fedml: A research library and benchmark
et al.
arXiv preprint
for
arXiv:2007.13518, 2020.
federated machine learning.
[90] D. He, R. Du, S. Zhu, M. Zhang, K. Liang, and S. Chan.
Secure logistic regression for vertical federated learn-
ing. IEEE Internet Computing, 26(2):61–68, 2021.
[91] E. Hesamifard, H. Takabi, and M. Ghasemi. Cryptodl:
arXiv
Deep neural networks over encrypted data.
preprint arXiv:1711.05189, 2017.
[92] B. Hitaj, G. Ateniese, and F. Perez-Cruz. Deep models
under the gan: information leakage from collabora-
In Proceedings of the 2017 ACM
tive deep learning.
SIGSAC conference on computer and communications se-
curity, pages 603–618, 2017.
[93] M. Househ, E. Borycki, and A. Kushniruk. Multi-
ple Perspectives on Artificial Intelligence in Healthcare.
Springer, 2021.
[94] K. Hsieh, A. Phanishayee, O. Mutlu, and P. Gibbons.
The non-iid data quagmire of decentralized machine
learning. In International Conference on Machine Learn-
ing, pages 4387–4398. PMLR, 2020.
[95] R. Hu, Y. Guo, H. Li, Q. Pei, and Y. Gong. Personalized
IEEE
federated learning with differential privacy.
Internet of Things Journal, 7(10):9530–9539, 2020.
[96] Y. Huang, L. Chu, Z. Zhou, L. Wang, J. Liu, J. Pei, and
Y. Zhang. Personalized cross-silo federated learning
on non-iid data. In AAAI, pages 7865–7873, 2021.
[97] Z. Huang, W.-j. Lu, C. Hong, and J. Ding. Cheetah:
Lean and fast secure two-party deep neural network
inference. IACR Cryptol. ePrint Arch., 2022:207, 2022.
arXiv:1910.03581, 2019.
23
[98] E. Jeong, S. Oh, H. Kim, J. Park, M. Bennis, and
S.-L. Kim. Communication-efficient on-device ma-
chine learning: Federated distillation and augmen-
arXiv preprint
tation under non-iid private data.
arXiv:1811.11479, 2018.
[99] L. Jiang, R. Tan, X. Lou, and G. Lin. On lightweight
privacy-preserving collaborative learning for internet-
In Proceedings of the international
of-things objects.
conference on internet of things design and implementation,
pages 70–81, 2019.
[100] C. Juvekar, V. Vaikuntanathan, and A. Chandrakasan.
{GAZELLE}: A low latency framework for secure
In 27th USENIX Security
neural network inference.
Symposium (USENIX Security 18), pages 1651–1669,
2018.
[101] P. Kairouz, H. B. McMahan, B. Avent, A. Bellet,
M. Bennis, A. N. Bhagoji, K. Bonawitz, Z. Charles,
G. Cormode, R. Cummings, et al. Advances and
open problems in federated learning. Foundations and
Trends® in Machine Learning, 14(1–2):1–210, 2021.
[102] Y. Kang, Y. He,
J. Luo, T. Fan, Y. Liu, and
Q. Yang. Privacy-preserving federated adversarial do-
main adaptation over feature groups for interpretabil-
ity. IEEE Transactions on Big Data, 2022.
[103] H. Kargupta, S. Datta, Q. Wang, and K. Sivakumar.
On the privacy preserving properties of random data
In Third IEEE international
perturbation techniques.
conference on data mining, pages 99–106. IEEE, 2003.
[104] S. P. Karimireddy, S. Kale, M. Mohri, S. Reddi, S. Stich,
and A. T. Suresh. Scaffold: Stochastic controlled av-
In International Con-
eraging for federated learning.
ference on Machine Learning, pages 5132–5143. PMLR,
2020.
[105] M. Kelkar, P. H. Le, M. Raykova, and K. Seth. Secure
In 31st USENIX Security Sympo-
poisson regression.
sium (USENIX Security 22), pages 791–808, 2022.
[106] B. Knott, S. Venkataraman, A. Hannun, S. Sengupta,
M. Ibrahim, and L. van der Maaten. CrypTen: Secure
multi-party computation meets machine learning. In
Proc. NeurIPS, 2021.
[107] N. Koti, M. Pancholi, A. Patra, and A. Suresh.
{SWIFT}: Super-fast and robust {Privacy-Preserving}
machine learning. In 30th USENIX Security Symposium
(USENIX Security 21), pages 2651–2668, 2021.
[108] N. Koti, A. Patra, R. Rachuri, and A. Suresh. Tetrad:
actively secure 4pc for secure training and inference.
arXiv preprint arXiv:2106.02850, 2021.
[109] N. Kumar, M. Rathee, N. Chandran, D. Gupta, A. Ras-
togi, and R. Sharma. Cryptflow: Secure tensorflow
In 2020 IEEE Symposium on Security and
inference.
Privacy (SP), pages 336–353. IEEE, 2020.
[110] L. Lamport, R. Shostak, and M. Pease. The byzantine
In Concurrency: the works of leslie
generals problem.
lamport, pages 203–226. 2019.
[111] B. Li, Y. Wang, A. Singh, and Y. Vorobeychik. Data
poisoning attacks on factorization-based collaborative
filtering. Advances in neural information processing sys-
tems, 29, 2016.
[112] D. Li and J. Wang.
Fedmd: Heterogenous feder-
arXiv preprint
ated learning via model distillation.
[113] H. Li and T. Han. An end-to-end encrypted neural
network for gradient upda tes transmission in feder-
ated learning. arXiv preprint arXiv:1908.08340, 2019.
[114] L. Li, W. Xu, T. Chen, G. B. Giannakis, and Q. Ling.
Rsa: Byzantine-robust stochastic aggregation methods
for distributed learning from heterogeneous datasets.
In Proceedings of the AAAI Conference on Artificial Intel-
ligence, volume 33, pages 1544–1551, 2019.
[115] Q. Li, Z. Wen, Z. Wu, S. Hu, N. Wang, Y. Li, X. Liu, and
B. He. A survey on federated learning systems: vision,
hype and reality for data privacy and protection. IEEE
Transactions on Knowledge and Data Engineering, 2021.
[116] S. Li, Y. Cheng, W. Wang, Y. Liu, and T. Chen. Learning
to detect malicious clients for robust federated learn-
ing. arXiv preprint arXiv:2002.00211, 2020.
[117] T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar,
and V. Smith. Federated optimization in heteroge-
neous networks. Proceedings of Machine Learning and
Systems, 2:429–450, 2020.
[118] T. Li, S. Hu, A. Beirami, and V. Smith. Ditto: Fair
and robust federated learning through personaliza-
In International Conference on Machine Learning,
tion.
pages 6357–6368. PMLR, 2021.
[119] Y. Li and W. Xu. Privpy: General and scalable privacy-
In Proceedings of the 25th
preserving data mining.
ACM SIGKDD International Conference on Knowledge
Discovery & Data Mining, pages 1299–1307, 2019.
[120] Z. Li and Y. Zhang. Label-leaks: Membership infer-
ence attack with label. arXiv preprint arXiv:2007.15528,
2020.
[121] Z. Li, H. Yu, T. Zhou, L. Luo, M. Fan, Z. Xu, and
G. Sun. Byzantine resistant secure blockchained feder-
ated learning at the edge. IEEE Network, 35(4):295–301,
2021.
[122] Z. Li, Y. He, H. Yu, J. Kang, X. Li, Z. Xu, and D. Niy-
ato. Data heterogeneity-robust federated learning via
group client selection in industrial iot. IEEE Internet
Things J., 9(18):17844–17857, 2022.
[123] T. Lin, L. Kong, S. U. Stich, and M. Jaggi. Ensemble
distillation for robust model fusion in federated learn-
ing. Advances in Neural Information Processing Systems,
33:2351–2363, 2020.
[124] H. Liu, Y. Wang, W. Fan, X. Liu, Y. Li, S. Jain, Y. Liu,
A. K. Jain, and J. Tang. Trustworthy ai: A compu-
tational perspective. arXiv preprint arXiv:2107.06641,
2021.
[125] J. Liu, M. Juuti, Y. Lu, and N. Asokan. Oblivious neu-
ral network predictions via minionn transformations.
In Proceedings of the 2017 ACM SIGSAC conference on
computer and communications security, pages 619–631,
2017.
[126] R. Liu, Y. Cao, M. Yoshikawa, and H. Chen. Fedsel:
Federated sgd under local differential privacy with
top-k dimension selection. In International Conference
on Database Systems for Advanced Applications, pages
485–501. Springer, 2020.
[127] T. Liu, X. Hu, and T. Shu. Technical report: Assisting
backdoor federated learning with whole population
knowledge alignment. arXiv preprint arXiv:2207.12327,
2022.
[128] X. Liu, H. Li, G. Xu, R. Lu, and M. He. Adaptive
privacy-preserving federated learning. Peer-to-Peer
Networking and Applications, 13(6):2356–2366, 2020.
[129] Y. Liu, Y. Kang, T. Zou, Y. Pu, Y. He, X. Ye, Y. Ouyang,
Y.-Q. Zhang, and Q. Yang. Vertical federated learning.
arXiv preprint arXiv:2211.12814, 2022.
[130] H. Lu, C. Liu, T. He, S. Wang, and K. S. Chan. Sharing
models or coresets: A study based on membership
inference attack. arXiv preprint arXiv:2007.02977, 2020.
[131] S. Lu, Y. Zhang, and Y. Wang. Decentralized federated
In 2020 54th
learning for electronic health records.
Annual Conference on Information Sciences and Systems
(CISS), pages 1–5. IEEE, 2020.
[132] Y. Lu, X. Huang, Y. Dai, S. Maharjan, and Y. Zhang.
Differentially private asynchronous federated learn-
ing for mobile edge computing in urban informatics.
IEEE Transactions on Industrial Informatics, 16(3):2134–
2143, 2019.
[133] L. Lyu, H. Yu, and Q. Yang. Threats to federated
arXiv preprint arXiv:2003.02133,
learning: A survey.
2020.
[134] K. Mandal, G. Gong, and C. Liu. Nike-based fast
privacy-preserving highdimensional data aggregation
IEEE T Depend Secure; Technical
for mobile devices.
Report; University of Waterloo: Waterloo, ON, Canada,
pages 142–149, 2018.
[135] Y. Mansour, M. Mohri, J. Ro, and A. T. Suresh. Three
approaches for personalization with applications to
arXiv preprint arXiv:2002.10619,
federated learning.
2020.
[136] Y. Mao, C. You, J. Zhang, K. Huang, and K. B. Letaief.
A survey on mobile edge computing: The commu-
IEEE communications surveys &
nication perspective.
tutorials, 19(4):2322–2358, 2017.
[137] B. McMahan, E. Moore, D. Ramage, S. Hampson, and
B. A. y Arcas. Communication-efficient learning of
In Artificial
deep networks from decentralized data.
intelligence and statistics, pages 1273–1282. PMLR, 2017.
[138] B. McMahan, E. Moore, D. Ramage, S. Hampson, and
B. A. y Arcas. Communication-efficient learning of
In Artificial
deep networks from decentralized data.
intelligence and statistics, pages 1273–1282. PMLR, 2017.
[139] H. B. McMahan, D. Ramage, K. Talwar, and L. Zhang.
language
Learning differentially private recurrent
models. arXiv preprint arXiv:1710.06963, 2017.
[140] L. Melis, C. Song, E. De Cristofaro, and V. Shmatikov.
Exploiting unintended feature leakage in collabora-
tive learning. In 2019 IEEE symposium on security and
privacy (SP), pages 691–706. IEEE, 2019.
[141] L. Melis, C. Song, E. De Cristofaro, and V. Shmatikov.
Exploiting unintended feature leakage in collabora-
tive learning. In 2019 IEEE symposium on security and
privacy (SP), pages 691–706. IEEE, 2019.
[142] P. Mishra, R. Lehmkuhl, A. Srinivasan, W. Zheng,
and R. A. Popa. Delphi: A cryptographic inference
service for neural networks. In 29th USENIX Security
Symposium (USENIX Security 20), pages 2505–2522,
2020.
[143] F. Mo and H. Haddadi. Efficient and private federated
In Proc. EuroSys Conf., Dresden,
learning using tee.
Germany, 2019.
24
[144] F. Mo, A. Borovykh, M. Malekzadeh, H. Haddadi,
and S. Demetriou. Layer-wise characterization of
latent information leakage in federated learning. arXiv
preprint arXiv:2010.08762, 2020.
[145] P. Mohassel and P. Rindal. ABY3: A mixed protocol
framework for machine learning. In Proc. CCS, pages
35–52, 2018.
[146] P. Mohassel and Y. Zhang. SecureML: A system for
scalable privacy-preserving machine learning. In IEEE
Symposium on Security and Privacy, pages 19–38, 2017.
[147] L. Mu ̃noz-Gonz ́alez, K. T. Co, and E. C. Lupu.
learning
arXiv preprint
Byzantine-robust
through adaptive model averaging.
arXiv:1909.05125, 2019.
federated machine
[148] M. Naseri, J. Hayes, and E. De Cristofaro. Toward
robustness and privacy in federated learning: Exper-
imenting with local and central differential privacy.
arXiv e-prints, pages arXiv–2009, 2020.
[149] M. Nasr, R. Shokri, and A. Houmansadr. Machine
learning with membership privacy using adversarial
regularization. In Proceedings of the 2018 ACM SIGSAC
conference on computer and communications security,
pages 634–646, 2018.
[150] M. Nasr, R. Shokri, and A. Houmansadr. Comprehen-
sive privacy analysis of deep learning: Passive and
active white-box inference attacks against centralized
In 2019 IEEE symposium on
and federated learning.
security and privacy (SP), pages 739–753. IEEE, 2019.
[151] K. L. Ng, Z. Chen, Z. Liu, H. Yu, Y. Liu, and Q. Yang.
A multi-player game for studying federated learning
incentive schemes. In Proceedings of the Twenty-Ninth
International Conference on International Joint Confer-
ences on Artificial Intelligence, pages 5279–5281, 2021.
[152] P. Paillier. Public-key cryptosystems based on com-
posite degree residuosity classes. In International con-
ference on the theory and applications of cryptographic
techniques, pages 223–238. Springer, 1999.
[153] A. Patra and A. Suresh. Blaze: Blazing fast privacy-
Cryptology ePrint
preserving machine learning.
Archive, 2020.
[154] A. Patra, T. Schneider, A. Suresh, and H. Yalame.
{ABY2. 0}: Improved {Mixed-Protocol} secure {Two-
Party} computation. In 30th USENIX Security Sympo-
sium (USENIX Security 21), pages 2165–2182, 2021.
[155] W. Pedrycz. Federated fcm: Clustering under privacy
IEEE Transactions on Fuzzy Systems,
requirements.
2021.
[156] D. Peng, Z. Sun, Z. Chen, Z. Cai, L. Xie, and L. Jin.
Detecting heads using feature refine net and cascaded
In 2018 24th International
multi-scale architecture.
Conference on Pattern Recognition (ICPR), pages 2528–
2533. IEEE, 2018.
[157] K. Pillutla, S. M. Kakade, and Z. Harchaoui. Robust
arXiv preprint
aggregation for federated learning.
arXiv:1912.13445, 2019.
[158] A. Portnoy, Y. Tirosh, and D. Hendler. Towards feder-
ated learning with byzantine-robust client weighting.
Applied Sciences, 12(17):8847, 2022.
[159] S. Prakash and A. S. Avestimehr. Mitigating byzan-
arXiv preprint
tine attacks in federated learning.
arXiv:2010.07541, 2020.
[160] A. Pustozerova and R. Mayer.
Information leaks
In Proceedings of the Network
in federated learning.
and Distributed System Security Symposium, volume 10,
2020.
[161] Y. Qu, L. Gao, T. H. Luan, Y. Xiang, S. Yu, B. Li, and
G. Zheng. Decentralized privacy using blockchain-
IEEE
enabled federated learning in fog computing.
Internet of Things Journal, 7(6):5171–5183, 2020.
[162] M. O. Rabin. How to exchange secrets with oblivious
transfer. Cryptology ePrint Archive, 2005.
[163] D. Rathee, M. Rathee, N. Kumar, N. Chandran,
D. Gupta, A. Rastogi, and R. Sharma. Cryptflow2:
In Proceedings of
Practical 2-party secure inference.
the 2020 ACM SIGSAC Conference on Computer and
Communications Security, pages 325–342, 2020.
[164] D. Rathee, M. Rathee, R. K. K. Goli, D. Gupta,
R. Sharma, N. Chandran, and A. Rastogi. Sirnn: A
In 2021 IEEE
math library for secure rnn inference.
Symposium on Security and Privacy (SP), pages 1003–
1020, 2021.
[165] R. Rau, R. Wardrop, and L. Zingales. The Palgrave
Handbook of Technological Finance. Springer, 2021.
[166] S. Reddi, Z. Charles, M. Zaheer, Z. Garrett, K. Rush,
J. Koneˇcn `y, S. Kumar, and H. B. McMahan.
arXiv preprint
Adaptive federated optimization.
arXiv:2003.00295, 2020.
[167] A. Reisizadeh, F. Farnia, R. Pedarsani, and A. Jad-
babaie. Robust federated learning: The case of affine
distribution shifts. Advances in Neural Information
Processing Systems, 33:21554–21565, 2020.
[168] M. S. Riazi, C. Weinert, O. Tkachenko, E. M. Songhori,
T. Schneider, and F. Koushanfar. Chameleon: A hybrid
secure computation framework for machine learning
In Proceedings of the 2018 on Asia con-
applications.
ference on computer and communications security, pages
707–721, 2018.
[169] M. S. Riazi, M. Samragh, H. Chen, K. Laine, K. Lauter,
and F. Koushanfar. {XONN}:{XNOR-based} oblivi-
ous deep neural network inference. In 28th USENIX
Security Symposium (USENIX Security 19), pages 1501–
1518, 2019.
[170] R. L. Rivest, L. Adleman, M. L. Dertouzos, et al. On
data banks and privacy homomorphisms. Foundations
of secure computation, 4(11):169–180, 1978.
[171] M.-A. Rizoiu, T. Graham, R. Zhang, Y. Zhang, R. Ack-
land, and L. Xie. # debatenight: The role and influence
of socialbots on twitter during the 1st 2016 us presi-
dential debate. In Proceedings of the international AAAI
conference on web and social media, volume 12, 2018.
[172] N. Rodr ́ıguez-Barroso, D.
Jim ́enez-L ́opez, M. V.
Luz ́on, F. Herrera, and E. Mart ́ınez-C ́amara. Survey
on federated learning threats: concepts, taxonomy on
attacks and defences, experimental study and chal-
lenges. Information Fusion, 90:148–173, 2023.
[173] D. Rong, Q. He, and J. Chen. Poisoning deep learn-
ing based recommender model in federated learning
scenarios. arXiv preprint arXiv:2204.13594, 2022.
[174] B. D. Rouhani, M. S. Riazi, and F. Koushanfar. Deepse-
cure: Scalable provably-secure deep learning. In Pro-
ceedings of the 55th annual design automation conference,
pages 1–6, 2018.
25
[175] T. Ryffel, P. Tholoniat, D. Pointcheval, and F. Bach. Ar-
iaNN: Low-interaction privacy-preserving deep learn-
ing via function secret sharing. Proc. on Privacy En-
hancing Technologies, 2022(1):291–316, 2020.
[176] O. Saha, A. Kusupati, H. V. Simhadri, M. Varma, and
P. Jain. Rnnpool: efficient non-linear pooling for ram
constrained inference. Advances in Neural Information
Processing Systems, 33:20473–20484, 2020.
[177] A. Sannai. Reconstruction of training samples from
loss functions. arXiv preprint arXiv:1805.07337, 2018.
[178] F. Sattler, K.-R. M ̈uller, and W. Samek. Clustered
federated learning: Model-agnostic distributed mul-
IEEE
titask optimization under privacy constraints.
transactions on neural networks and learning systems, 32
(8):3710–3722, 2020.
[179] F. Sattler, K.-R. M ̈uller, T. Wiegand, and W. Samek. On
the byzantine robustness of clustered federated learn-
ing. In ICASSP 2020-2020 IEEE International Conference
on Acoustics, Speech and Signal Processing (ICASSP),
pages 8861–8865. IEEE, 2020.
[180] M. Seif, R. Tandon, and M. Li. Wireless federated
learning with local differential privacy. In 2020 IEEE
International Symposium on Information Theory (ISIT),
pages 2604–2609. IEEE, 2020.
[181] H. Seo, J. Park, S. Oh, M. Bennis, and S.-L. Kim.
arXiv preprint
Federated knowledge distillation.
arXiv:2011.02367, 2020.
[182] M. Shafique, M. Naseer, T. Theocharides, C. Kyrkou,
O. Mutlu, L. Orosa, and J. Choi. Robust machine learn-
ing systems: Challenges, current trends, perspectives,
and the road ahead. IEEE Design & Test, 37(2):30–57,
2020.
[183] A. Shamir. How to share a secret. Communications of
the ACM, 22(11):612–613, 1979.
[184] M. Shen, H. Wang, B. Zhang, L. Zhu, K. Xu, Q. Li,
and X. Du. Exploiting unintended property leakage in
blockchain-assisted federated learning for intelligent
edge computing. IEEE Internet of Things Journal, 8(4):
2265–2275, 2020.
[185] R. Shokri, M. Stronati, C. Song, and V. Shmatikov.
Membership inference attacks against machine learn-
In 2017 IEEE symposium on security and
ing models.
privacy (SP), pages 3–18. IEEE, 2017.
[186] R. Shokri, M. Stronati, C. Song, and V. Shmatikov.
Membership inference attacks against machine learn-
In 2017 IEEE symposium on security and
ing models.
privacy (SP), pages 3–18. IEEE, 2017.
[187] N. A. Smuha. The eu approach to ethics guidelines
for trustworthy artificial intelligence. Computer Law
Review International, 20(4):97–106, 2019.
[188] M. Song, Z. Wang, Z. Zhang, Y. Song, Q. Wang, J. Ren,
and H. Qi. Analyzing user-level privacy attack against
IEEE Journal on Selected Areas in
federated learning.
Communications, 38(10):2430–2444, 2020.
[189] Z. Song, Z. Meng, Y. Zhang, and I. King.
Semi-
supervised multi-label learning for graph-structured
In Proceedings of the 30th ACM International
data.
Conference on Information & Knowledge Management,
pages 1723–1733, 2021.
[190] Z. Song, Y. Zhang, and I. King. Towards an op-
timal asymmetric graph structure for robust semi-
In Proceedings of the
supervised node classification.
28th ACM SIGKDD Conference on Knowledge Discovery
and Data Mining, pages 1656–1665, 2022.
P. Mittal, and T. Rabin. Falcon: Honest-majority ma-
liciously secure framework for private deep learning.
arXiv preprint arXiv:2004.02229, 2020.
26
[191] M. Stallmann and A. Wilbik. Towards federated clus-
tering: A federated fuzzy c-means algorithm (ffcm).
arXiv preprint arXiv:2201.07316, 2022.
[192] L. Su and J. Xu. Securing distributed gradient descent
in high dimensional statistical learning. Proceedings
of the ACM on Measurement and Analysis of Computing
Systems, 3(1):1–41, 2019.
[193] P. Subramanyan, R. Sinha, I. Lebedev, S. Devadas, and
S. A. Seshia. A formal foundation for secure remote
execution of enclaves. In Proceedings of the 2017 ACM
SIGSAC Conference on Computer and Communications
Security, pages 2435–2450, 2017.
[194] L. Sun, J. Qian, and X. Chen. Ldp-fl: Practical private
aggregation in federated learning with local differen-
tial privacy. arXiv preprint arXiv:2007.15789, 2020.
[195] Z. Sun, P. Kairouz, A. T. Suresh, and H. B. McMahan.
Can you really backdoor federated learning? arXiv
preprint arXiv:1911.07963, 2019.
[196] C. T Dinh, N. Tran, and J. Nguyen. Personalized fed-
erated learning with moreau envelopes. Advances in
Neural Information Processing Systems, 33:21394–21405,
2020.
[197] A. Z. Tan, H. Yu, L. Cui, and Q. Yang. Towards
personalized federated learning. IEEE Transactions on
Neural Networks and Learning Systems, 2022.
[198] S. Tan, B. Knott, Y. Tian, and D. J. Wu. Cryptgpu:
Fast privacy-preserving machine learning on the gpu.
In 2021 IEEE Symposium on Security and Privacy (SP),
pages 1021–1038. IEEE, 2021.
[199] J. O. d. Terrail, S.-S. Ayed, E. Cyffers, F. Grimberg,
C. He, R. Loeb, P. Mangold, T. Marchand, O. Marfoq,
E. Mushtaq, et al. Flamby: Datasets and benchmarks
for cross-silo federated learning in realistic healthcare
settings. arXiv preprint arXiv:2210.04620, 2022.
[200] V. Tolpegin, S. Truex, M. E. Gursoy, and L. Liu. Data
poisoning attacks against federated learning systems.
In European Symposium on Research in Computer Secu-
rity, pages 480–501. Springer, 2020.
[201] A. Triastcyn and B. Faltings. Federated learning with
In 2019 IEEE Interna-
bayesian differential privacy.
tional Conference on Big Data (Big Data), pages 2587–
2596. IEEE, 2019.
[202] S. Truex, L. Liu, M. E. Gursoy, L. Yu, and W. Wei. De-
mystifying membership inference attacks in machine
IEEE Transactions on Services
learning as a service.
Computing, 2019.
[203] S. Truex, L. Liu, K.-H. Chow, M. E. Gursoy, and
W. Wei. Ldp-fed: Federated learning with local dif-
In Proceedings of the Third ACM
ferential privacy.
International Workshop on Edge Systems, Analytics and
Networking, pages 61–66, 2020.
[204] K. R. Varshney. Trustworthy machine learning and
artificial intelligence. XRDS: Crossroads, The ACM
Magazine for Students, 25(3):26–29, 2019.
[205] S. Wagh, D. Gupta, and N. Chandran. SecureNN: 3-
Party secure computation for neural network training.
Proc. Priv. Enhancing Technol., 2019(3):26–49, 2019.
[206] S. Wagh, S. Tople, F. Benhamouda, E. Kushilevitz,
[207] H. Wang, K. Sreenivasan, S. Rajput, H. Vishwakarma,
S. Agarwal, J.-y. Sohn, K. Lee, and D. Papailiopou-
los. Attack of the tails: Yes, you really can backdoor
federated learning. Advances in Neural Information
Processing Systems, 33:16070–16084, 2020.
[208] J. Wang, Q. Liu, H. Liang, G. Joshi, and H. V. Poor.
Tackling the objective inconsistency problem in het-
erogeneous federated optimization. Advances in neural
information processing systems, 33:7611–7623, 2020.
[209] L. Wang, S. Xu, X. Wang, and Q. Zhu. Eavesdrop the
composition proportion of training labels in federated
learning. arXiv preprint arXiv:1910.06044, 2019.
[210] Y. Wang, Y. Tong, and D. Shi. Federated latent dirichlet
allocation: A local differential privacy based frame-
work. In Proceedings of the AAAI Conference on Artificial
Intelligence, volume 34, pages 6283–6290, 2020.
[211] Y. Wang, M. Jia, N. Gao, L. Von Krannichfeldt, M. Sun,
and G. Hug. Federated clustering for electricity con-
IEEE Transactions on
sumption pattern extraction.
Smart Grid, 13(3):2425–2439, 2022.
[212] Z. Wang, M. Song, Z. Zhang, Y. Song, Q. Wang, and
H. Qi. Beyond inferring class representatives: User-
level privacy leakage from federated learning.
In
IEEE INFOCOM 2019-IEEE Conference on Computer
Communications, pages 2512–2520. IEEE, 2019.
[213] J.-L. Watson, S. Wagh, and R. A. Popa. Piranha:
A {GPU} platform for secure computation.
In 31st
USENIX Security Symposium (USENIX Security 22),
pages 827–844, 2022.
[214] K. Wei, J. Li, M. Ding, C. Ma, H. H. Yang, F. Farokhi,
S. Jin, T. Q. Quek, and H. V. Poor. Federated learn-
ing with differential privacy: Algorithms and per-
IEEE Transactions on Information
formance analysis.
Forensics and Security, 15:3454–3469, 2020.
[215] W. Wei, L. Liu, M. Loper, K.-H. Chow, M. E. Gursoy,
S. Truex, and Y. Wu. A framework for evaluating client
In European
privacy leakages in federated learning.
Symposium on Research in Computer Security, pages
545–566. Springer, 2020.
[216] M. Wu, D. Ye, J. Ding, Y. Guo, R. Yu, and M. Pan.
Incentivizing differentially private federated learning:
A multidimensional contract approach. IEEE Internet
of Things Journal, 8(13):10639–10651, 2021.
[217] Y. Wu, S. Cai, X. Xiao, G. Chen, and B. C. Ooi. Privacy
preserving vertical federated learning for tree-based
models. arXiv preprint arXiv:2008.06170, 2020.
[218] Z. Wu, Q. Ling, T. Chen, and G. B. Giannakis. Fed-
erated variance-reduced stochastic gradient descent
IEEE Transac-
with robustness to byzantine attacks.
tions on Signal Processing, 68:4583–4596, 2020.
[219] X. Xiao, G. Wang, and J. Gehrke. Differential privacy
via wavelet transforms. IEEE Transactions on knowledge
and data engineering, 23(8):1200–1214, 2010.
and I. Gupta.
[220] C. Xie, O. Koyejo,
alized byzantine-tolerant
arXiv:1802.10116, 2018.
sgd.
arXiv
Gener-
preprint
[221] C. Xie, K. Huang, P.-Y. Chen, and B. Li. Dba: Dis-
tributed backdoor attacks against federated learning.
In International Conference on Learning Representations,
2019.
cal rates. In International Conference on Machine Learn-
ing, pages 5650–5659. PMLR, 2018.
27
[222] C. Xie, O. Koyejo, and I. Gupta. Slsgd: Secure and effi-
cient distributed on-device machine learning. In Joint
European Conference on Machine Learning and Knowledge
Discovery in Databases, pages 213–228. Springer, 2019.
[223] C. Xie, S. Koyejo, and I. Gupta. Zeno++: Robust
fully asynchronous sgd. In International Conference on
Machine Learning, pages 10495–10503. PMLR, 2020.
[224] C. Xie, M. Chen, P.-Y. Chen, and B. Li. Crfl: Certifiably
robust federated learning against backdoor attacks.
In International Conference on Machine Learning, pages
11372–11382. PMLR, 2021.
[225] L. Xie, J. Liu, S. Lu, T.-H. Chang, and Q. Shi. An
efficient learning framework for federated xgboost
using secret sharing and distributed optimization.
ACM Transactions on Intelligent Systems and Technology
(TIST), 13(5):1–28, 2022.
[226] M. Xie, G. Long, T. Shen, T. Zhou, X. Wang, J. Jiang,
and C. Zhang. Multi-center federated learning. arXiv
preprint arXiv:2005.01026, 2020.
[227] Y. Xie, Z. Wang, D. Chen, D. Gao, L. Yao, W. Kuang,
Y. Li, B. Ding, and J. Zhou. Federatedscope: A com-
prehensive and flexible federated learning platform
via message passing. arXiv preprint arXiv:2204.05011,
2022.
[228] G. Xu, H. Li, S. Liu, K. Yang, and X. Lin. Verifynet:
Secure and verifiable federated learning. IEEE Transac-
tions on Information Forensics and Security, 15:911–926,
2019.
[229] M. Xu and X. Li. Subject property inference attack
In 2020 12th International
in collaborative learning.
Conference on Intelligent Human-Machine Systems and
Cybernetics (IHMSC), volume 1, pages 227–231. IEEE,
2020.
[230] X. Xu, J. Wu, M. Yang, T. Luo, X. Duan, W. Li, Y. Wu,
and B. Wu.
Information leakage by model weights
on federated learning. In Proceedings of the 2020 Work-
shop on Privacy-Preserving Machine Learning in Practice,
pages 31–36, 2020.
[231] K. Yang, C. Weng, X. Lan, J. Zhang, and X. Wang.
Ferret: Fast extension for correlated ot with small com-
munication. In Proceedings of the 2020 ACM SIGSAC
Conference on Computer and Communications Security,
pages 1607–1626, 2020.
[232] Q. Yang, Y. Liu, T. Chen, and Y. Tong. Federated ma-
chine learning: Concept and applications. ACM Trans-
actions on Intelligent Systems and Technology (TIST), 10
(2):1–19, 2019.
[233] S. Yang, B. Ren, X. Zhou, and L. Liu.
Paral-
lel distributed logistic regression for vertical feder-
ated learning without third-party coordinator. arXiv
preprint arXiv:1911.09824, 2019.
[234] A. C. Yao. Protocols for secure computations. In 23rd
annual symposium on foundations of computer science (sfcs
1982), pages 160–164. IEEE, 1982.
[235] A. C.-C. Yao. How to generate and exchange secrets.
In Annual Symposium on Foundations of Computer Sci-
ence, pages 162–167, 1986.
[236] D. Yin, Y. Chen, R. Kannan, and P. Bartlett. Byzantine-
robust distributed learning: Towards optimal statisti-
[237] H. Yin, A. Mallya, A. Vahdat, J. M. Alvarez, J. Kautz,
See through gradients: Image
and P. Molchanov.
batch recovery via gradinversion. In Proceedings of the
IEEE/CVF Conference on Computer Vision and Pattern
Recognition, pages 16337–16346, 2021.
[238] X. Yin, Y. Zhu, and J. Hu. A comprehensive survey of
privacy-preserving federated learning: A taxonomy,
review, and future directions. ACM Computing Surveys
(CSUR), 54(6):1–36, 2021.
[239] C. Yu, H. Tang, C. Renggli, S. Kassing, A. Singla,
D. Alistarh, C. Zhang, and J. Liu. Distributed learning
In International Conference
over unreliable networks.
on Machine Learning, pages 7202–7212. PMLR, 2019.
[240] H. Yu, S. Yang, and S. Zhu. Parallel restarted sgd with
faster convergence and less communication: Demysti-
fying why model averaging works for deep learning.
In Proceedings of the AAAI Conference on Artificial Intel-
ligence, volume 33, pages 5693–5700, 2019.
[241] X. Yuan, X. Ma, L. Zhang, Y. Fang, and D. Wu.
Beyond class-level privacy leakage: Breaking record-
IEEE Internet of
level privacy in federated learning.
Things Journal, 9(4):2555–2565, 2021.
[242] K. Yue, R. Jin, C.-W. Wong, D. Baron, and H. Dai.
Gradient obfuscation gives a false sense of security
in federated learning. arXiv preprint arXiv:2206.04055,
2022.
[243] D. Zeng, S. Liang, X. Hu, and Z. Xu. Fedlab: A flexible
federated learning framework. CoRR, abs/2107.11621,
2021. URL https://arxiv.org/abs/2107.11621.
[244] S. Zeng, Z. Li, H. Yu, Y. He, Z. Xu, D. Niyato, and
H. Yu. Heterogeneous federated learning via grouped
In Database Systems
sequential-to-parallel training.
for Advanced Applications - 27th International Confer-
ence, DASFAA 2022,, volume 13246, pages 455–471.
Springer, 2022.
[245] C. Zhang, S. Li, J. Xia, W. Wang, F. Yan, and Y. Liu.
{BatchCrypt}: Efficient homomorphic encryption for
{Cross-Silo} federated learning.
In 2020 USENIX
Annual Technical Conference (USENIX ATC 20), pages
493–506, 2020.
[246] C. Zhang, Y. Liu, L. Wang, Y. Liu, L. Li, and N. Zheng.
Joint intelligence ranking by federated multiplicative
update. IEEE Intelligent Systems, 35(4):15–24, 2020.
[247] C. Zhang, J. Xia, B. Yang, H. Puyang, W. Wang,
R. Chen, I. E. Akkus, P. Aditya, and F. Yan. Citadel:
Protecting data privacy and model confidentiality for
In Proceedings of the ACM
collaborative learning.
Symposium on Cloud Computing, pages 546–561, 2021.
[248] H. Zhang, B. Wu, X. Yuan, S. Pan, H. Tong, and
J. Pei. Trustworthy graph neural networks: Aspects,
methods and trends. arXiv preprint arXiv:2205.07424,
2022.
[249] J. Zhang, Z. Zhang, X. Xiao, Y. Yang, and M. Winslett.
Functional mechanism: regression analysis under dif-
ferential privacy. arXiv preprint arXiv:1208.0219, 2012.
[250] W. Zhang, S. Tople, and O. Ohrimenko. Leakage of
dataset properties in {Multi-Party} machine learning.
In 30th USENIX Security Symposium (USENIX Security
21), pages 2687–2704, 2021.
28
preprint arXiv:1806.00582, 2018.
[266] Y. Zhao, J. Zhao, M. Yang, T. Wang, N. Wang, L. Lyu,
D. Niyato, and K.-Y. Lam. Local differential privacy-
based federated learning for internet of things. IEEE
Internet of Things Journal, 8(11):8836–8853, 2020.
[267] H. Zheng, H. Hu, and Z. Han. Preserving user privacy
for machine learning: local differential privacy or fed-
erated machine learning? IEEE Intelligent Systems, 35
(4):5–14, 2020.
[268] H. Zhu, J. Xu, S. Liu, and Y. Jin. Federated learning on
non-iid data: A survey. Neurocomputing, 465:371–390,
2021.
[269] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired
image-to-image translation using cycle-consistent ad-
versarial networks. In Proceedings of the IEEE interna-
tional conference on computer vision, pages 2223–2232,
2017.
[270] L. Zhu, Z. Liu, and S. Han. Deep leakage from
gradients. Advances in neural information processing
systems, 32, 2019.
[271] W. Zhu, M. Wei, X. Li, and Q. Li. Securebinn: 3-
party secure computation for binarized neural net-
In European Symposium on Research
work inference.
in Computer Security, pages 275–294. Springer, 2022.
[272] Z. Zhu, J. Hong, and J. Zhou. Data-free knowledge
distillation for heterogeneous federated learning.
In
International Conference on Machine Learning, pages
12878–12889. PMLR, 2021.
[273] A. Ziller, A. Trask, A. Lopardo, B. Szymkow,
B. Wagner, E. Bluemke, J.-M. Nounahon, J. Passerat-
Palmbach, K. Prakash, N. Rose, et al. Pysyft: A library
In Federated Learning
for easy federated learning.
Systems, pages 111–139. Springer, 2021.
[251] X. Zhang, A. Fu, H. Wang, C. Zhou, and Z. Chen. A
privacy-preserving and verifiable federated learning
scheme. In ICC 2020-2020 IEEE International Conference
on Communications (ICC), pages 1–6. IEEE, 2020.
[252] Y. Zhang and Q. Yang. A survey on multi-task
IEEE Transactions on Knowledge and Data
learning.
Engineering, 2021.
[253] Y. Zhang and H. Zhu. Doc2hash: Learning discrete
latent variables for documents retrieval. In Proceedings
of the 2019 Conference of the North American Chapter
of the Association for Computational Linguistics: Human
Language Technologies, Volume 1 (Long and Short Pa-
pers), June 2019. doi: 10.18653/v1/N19-1232. URL
https://aclanthology.org/N19-1232.
[254] Y. Zhang and H. Zhu. Additively homomorphical
encryption based deep neural network for asymmet-
rically collaborative machine learning. arXiv preprint
arXiv:2007.06849, 2020.
[255] Y. Zhang and H. Zhu. Additively homomorphical
encryption based deep neural network for asymmet-
rically collaborative machine learning. arXiv preprint
arXiv:2007.06849, 2020.
[256] Y. Zhang and H. Zhu. Discrete wasserstein autoen-
coders for document retrieval. In ICASSP 2020-2020
IEEE International Conference on Acoustics, Speech and
Signal Processing (ICASSP), pages 8159–8163. IEEE,
2020.
[257] Y. Zhang, H. Zhu, Z. Meng, P. Koniusz, and I. King.
Graph-adaptive rectified linear unit for graph neural
In Proceedings of the ACM Web Conference
networks.
2022, pages 1331–1339, 2022.
[258] Y. Zhang, H. Zhu, Z. Song, P. Koniusz, and I. King.
Costa: Covariance-preserving feature augmentation
In Proceedings of the
for graph contrastive learning.
28th ACM SIGKDD Conference on Knowledge Discovery
and Data Mining, pages 2524–2534, 2022.
[259] Y. Zhang, H. Zhu, Z. Song, P. Koniusz, and I. King.
Spectral feature augmentation for graph contrastive
learning and beyond. arXiv preprint arXiv:2212.01026,
2022.
[260] Z. Zhang, X. Cao, J. Jia, and N. Z. Gong. Fldetector:
Defending federated learning against model poison-
ing attacks via detecting malicious clients. In Proceed-
ings of the 28th ACM SIGKDD Conference on Knowledge
Discovery and Data Mining, pages 2545–2555, 2022.
[261] B. Zhao, K. R. Mopuri, and H. Bilen.
idlg: Im-
proved deep leakage from gradients. arXiv preprint
arXiv:2001.02610, 2020.
[262] B. Zhao, K. Fan, K. Yang, Z. Wang, H. Li, and Y. Yang.
Anonymous and privacy-preserving federated learn-
IEEE Transactions on
ing with industrial big data.
Industrial Informatics, 17(9):6314–6323, 2021.
[263] B. Zhao, P. Sun, T. Wang, and K. Jiang.
Fedinv:
Byzantine-robust federated learning by inversing lo-
cal model updates. 2022.
[264] K. Zhao, W. Xi, Z. Wang, J. Zhao, R. Wang, and
Z. Jiang. Smss: Secure member selection strategy in
federated learning. IEEE Intelligent Systems, 35(4):37–
49, 2020.
[265] Y. Zhao, M. Li, L. Lai, N. Suda, D. Civin, and V. Chan-
arXiv
dra. Federated learning with non-iid data.
|
|
http://arxiv.org/abs/2302.10636v2 | 2023-05-25T22:19:58 | 2023-02-21T12:50:05 | $ω$PAP Spaces: Reasoning Denotationally About Higher-Order,
Recursive Probabilistic and Differentiable Programs | We introduce a new setting, the category of $\omega$PAP spaces, for reasoning
denotationally about expressive differentiable and probabilistic programming
languages. Our semantics is general enough to assign meanings to most practical
probabilistic and differentiable programs, including those that use general
recursion, higher-order functions, discontinuous primitives, and both discrete
and continuous sampling. But crucially, it is also specific enough to exclude
many pathological denotations, enabling us to establish new results about both
deterministic differentiable programs and probabilistic programs. In the
deterministic setting, we prove very general correctness theorems for automatic
differentiation and its use within gradient descent. In the probabilistic
setting, we establish the almost-everywhere differentiability of probabilistic
programs' trace density functions, and the existence of convenient base
measures for density computation in Monte Carlo inference. In some cases these
results were previously known, but required detailed proofs with an operational
flavor; by contrast, all our proofs work directly with programs' denotations. | [
"Mathieu Huot",
"Alexander K. Lew",
"Vikash K. Mansinghka",
"Sam Staton"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10636v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10636v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.PL",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.PL",
"cs.LG",
"cs.LO"
] | ωPAP Spaces: Reasoning Denotationally About
Higher-Order, Recursive Probabilistic and
Differentiable Programs
Mathieu Huot∗, Alexander K. Lew∗, Vikash K. Mansinghka, and Sam Staton
3
2
0
2
y
a
M
5
2
]
L
P
.
s
c
[
2
v
6
3
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Abstract-We introduce a new setting, the category of ωPAP
spaces, for reasoning denotationally about expressive differen-
tiable and probabilistic programming languages. Our semantics is
general enough to assign meanings to most practical probabilistic
and differentiable programs, including those that use general
recursion, higher-order functions, discontinuous primitives, and
discrete and continuous sampling. But crucially, it is also specific
enough to exclude many pathological denotations, enabling us
to establish new results about differentiable and probabilistic
programs. In the differentiable setting, we prove general correct-
ness theorems for automatic differentiation and its use within
gradient descent. In the probabilistic setting, we establish the
almost-everywhere differentiability of probabilistic programs'
trace density functions, and the existence of convenient base
measures for density computation in Monte Carlo inference. In
some cases these results were previously known, but required
detailed proofs of an operational flavor; by contrast, all our
proofs work directly with programs' denotations.
I. INTRODUCTION
This paper introduces a new setting, the category of ωPAP
spaces, for reasoning denotationally about expressive prob-
abilistic and differentiable programs, and demonstrates its
utility in several applications. The ωPAP spaces are built
using the same categorical machinery [1] that underlies the
ω-quasi-Borel spaces [2] and the ω-diffeological-spaces [3, 4],
two other recent proposals for understanding higher-order,
recursive probabilistic and differentiable programs. The key
difference is that instead of taking the measurable maps (as in
ωQbs) or the smooth maps (as in ωDiff) as the primitives in our
development, we instead use the functions that are piecewise
analytic under analytic partition, or PAP [5].
Whereas the smooth functions exclude many primitives used
in practice (e.g., < : real → real → B), and the measurable
functions admit many pathological examples from analysis
(the Cantor function, the Weierstrass function, space-filling
curves), the PAP functions manage to exhibit very few patholo-
gies while still including nearly all primitives exposed by to-
day's differentiable and probabilistic programming languages.
As a result, our semantics can interpret most differentiable
and probabilistic programs that arise in practice, and can be
used to provide short denotational proofs of many interesting
properties. As evidence for this claim, we use our semantics
to establish new results (and give new, simplified proofs of old
results) about the correctness of automatic differentiation, the
*Equal contribution
979-8-3503-3587-3/23/$31.00 ©2023 IEEE
convergence of automatic-differentiation gradient descent, and
the supports and densities of recursive probabilistic programs.
A. A "Just-Specific-Enough" Semantic Model
In denotational accounts of deterministic and probabilis-
tic programming languages, deterministic programs typically
denote functions and probabilistic programs typically denote
measure kernels. But what kinds of functions and kernels?
The more specific our answer to that question, the more
we can hope to prove-purely denotationally-about our lan-
guages. For example, consider the question of commutativity:
is it the case that, whenever x does not occur free in s,
Jlet x = t in let y = s in uK = Jlet y = s in let x = t in uK?
In the probabilistic setting, this amounts to asking whether
iterated integrals can always be reordered. If our semantics
interprets programs as arbitrary measure kernels, then there
is no obvious answer, because Fubini's theorem, which jus-
tifies the interchange of iterated integrals, does not apply
unconditionally. But by interpreting an expressive probabilistic
language using only the s-finite kernels, Staton [6] was able
to prove commutativity denotationally, using the specialization
of Fubini's theorem to the s-finite case.
Unfortunately, in the quest for semantic models with con-
venient properties, we may end up excluding programs that
programmers might write in practice. For example, in [3],
all programs are interpreted as smooth functions, enabling
an elegant semantic account of why automatic differentia-
tion algorithms work (even in the presence of higher-order
functions). But to achieve this nice theory, all non-smooth
primitives (including, e.g., the function λx.λy.x < y) were
excluded from the language under consideration. As a result,
the theory has little to say about the behavior of automatic
differentiation on non-smooth programs.
In this work, our aim is to find a "just specific enough"
semantic model of expressive probabilistic and differentiable
programming languages: specific enough to establish interest-
ing properties via denotational reasoning, but general enough
to include nearly all programs of practical interest. Like the
recently introduced quasi-Borel predomains [2], our model
covers most probabilistic and differentiable programs that
can be expressed in today's popular languages: it supports
general recursion, higher-order functions, discrete and contin-
uous sampling, and a broad class of primitive functions that
includes nearly all the mathematical operations exposed by
cant or : R - > R
cant or x =
i f x <= 1/ 3 t hen
cant or ( 3 * x)
el se i f x < 2/ 3 t hen
x * x
el se
cant or ( 3 * x – 2)
Fig. 1. A program that diverges on the 1
3 -Cantor set, but halts elsewhere in
(0, 1). The characteristic function of the 1
3 -Cantor set is not PAP, so a naively
defined interpretation of "partial PAP functions into R" as PAP functions into
R + 1 would not suffice to interpret a language with general recursion. Our
definition of partial ωPAP maps in Section II resolves the issue.
comprehensive libraries for scientific computing and machine
learning (such as numpy and scipy). But crucially, it also
excludes many pathological functions and kernels that cannot
be directly implemented in practice, such as the characteristic
function of the Cantor set (whose construction involves an
infinite limit that programs cannot compute in finite time).
As a result, it is often possible to establish that a desirable
property holds of all ωPAP maps between two spaces, and to
then conclude that it holds of all programs of the appropriate
type, without reasoning inductively about their construction or
their operational semantics.
The starting point in our search for a semantic model is Lee
et al. [5]'s notion of piecewise analyticity under analytic
partition (or PAP). The PAP functions are a particularly well-
behaved subset of the functions between Euclidean spaces,
and [5] makes a compelling argument that they are "specific
enough" in the sense we describe above. For example, even
though they are not necessarily differentiable, PAP functions
admit a generalized notion of derivative, as well as a gen-
eralized chain rule that can be used to give a denotational
justification of automatic differentiation. These nice properties
do not hold for slight generalizations of PAP, e.g. the class of
almost-everywhere differentiable functions.
Nevertheless, a reasonable worry is that PAP functions may
be too narrow a semantic domain: do all programs arising in
practice really denote PAP functions, or does the definition
assume properties that not all programs enjoy? Lee et al. [5]
establish that in a first-order language with PAP primitives
and conditionals, all programs denote PAP functions. But real-
world programs use many additional features, such as higher-
order functions, general recursion, and probabilistic effects.
In the presence of these features, do terms of first-order type
still denote PAP functions? Consider the program in Fig. 1,
for example: it uses recursion to define a partial function that
diverges on the 1
3 -Cantor set, and halts on its complement.
But we know that the (total) indicator function for the 1
3 -
Cantor set is not PAP. This may seem like reason to doubt
that [5]'s proposal can be cleanly extended to the general-
recursive setting.
Fortunately, however, it can: in Section II, we extend the
definition of PAP to cover partial and higher-order functions.
The resulting class of functions, the ωPAP maps, suffice to
interpret all recursive, higher-order programs in an expressive
call-by-value PCF, with a type of real numbers and PAP
primitives (Theorem II.2). The ωPAP category also supports
a strong monad of measures (Definition IV.5), enabling an
interpretation of continuous sampling and soft conditioning,
features common in modern probabilistic languages.
To be clear, existing semantic frameworks can interpret sim-
ilarly expressive languages (e.g., [2]). Our value proposition
is that the ωPAP domain usefully excludes certain patholog-
ical denotations that other settings allow. After defining our
semantics in Section II, we devote the remainder of the paper
to presenting evidence for this claim: new results (and new
proofs of old results) that follow cleanly from denotational
reasoning about ωPAP spaces and maps.
B. Differentiable Programming and Automatic Differentiation
Our first application of our semantics is to the study of
automatic differentiation (AD), a family of techniques for
mechanically computing derivatives of user-defined functions.
It has found widespread use in machine learning and related
disciplines, where practitioners are often interested in using
gradient-based optimization algorithms, such as gradient de-
scent, to fit model parameters to data. Languages with support
for automatic differentiation are often called "differentiable
programming languages," even if it may be the case that some
programs do not denote everywhere-differentiable functions.
When applied to straight-line programs built from differ-
entiable primitives (without if statements, loops, and other
control flow), AD has a straightforward justification using the
chain rule. But in the presence of more expressive program-
ming constructs, AD is harder to reason about: some programs
encode partial or non-differentiable functions, and even when
programs are differentiable, AD can fail to compute their true
derivatives at some inputs.
Our ωPAP semantics gives a clean account of the class of
partial functions that recursive, higher-order programs built
from "AD-friendly" primitives can express. In Section III, we
use this characterization to establish guarantees about AD's
behavior when applied to such programs:
• We define a generalized notion of derivative, based on
[5]'s intensional derivatives, and establish that every first-
order ωPAP map is intensionally differentiable.
• We adapt Huot et al. [3]'s denotational correctness proof
of AD to prove that AD correctly computes intensional
derivatives of all programs with first-order type, even if
they use recursion and discontinuous primitives (Theo-
rem III.4). This result is stronger than Mazza and Pagani
[7]'s, which follows as a straightforward corollary. But
the main benefit over their development is the simplicity
of our proof, which mirrors Huot et al. [3]'s quite closely
despite the greatly increased complexity of our language.
• Using this characterization of what AD computes, we
further prove the novel result that intensional gradient de-
scent (which optimizes a differentiable function but using
gradients computed by AD) converges with probability
1, if initialized with a randomized initial location and a
randomized learning rate (Theorem III.8). This implies
that gradient descent can be safely applied to recursive
programs with conditionals so long as they denote differ-
entiable functions, even if AD (which can disagree with
the true derivative at some inputs) is used to compute
gradients. Interestingly, if either the initial location or the
learning rate is not randomized, a.s.-convergence is not
guaranteed, and we present counterexamples of PyTorch
programs that denote differentiable functions but cause
PyTorch's gradient descent
implementation to diverge
(Propositions III.6 & III.7).
Taken together, these results give a characterization of the
behavior of AD in real systems like PyTorch and Tensorflow,
even when they are applied to non-differentiable or recursive
programs.
C. Probabilistic Programming
Probabilistic programming languages extend determinis-
tic languages with support for random sampling and soft
conditioning, making them an expressive representation both
for probability distributions and for general (unnormalized)
measures. Many probabilistic programs are intended to model
some aspect of the world, and many questions of interest
can be posed as questions about the expectations of cer-
tain functions under (normalized versions of) these models.
Probabilistic programming languages often come with tools
for automatically running inference algorithms that estimate
such posterior expectations. But the machinery for inference
may make assumptions about
the programs the user has
written-for example, that the program has a density with
respect to a well-behaved reference measure, or that its density
is differentiable. Our next application of our semantics is to the
problem of verifying that such properties hold for any program
in an expressive probabilistic language.
In Section IV, we extend the core language from Section II
to include the sample and score commands. This requires
changing our monad of effects, which in Section II covered
only divergence, to also interpret randomness and condition-
ing. We consider two different strong monads on ωPAP: one
interprets probabilistic programs as s-finite measures (fol-
lowing [2]), and the other as weighted sampling procedures
(following [8, 9]). In each case, we can prove interesting
properties of all probabilistic programs by working just with
the class of ωPAP maps they denote:
• Interpreting programs as weighted samplers, we prove
that almost-surely terminating probabilistic programs
have almost-everywhere differentiable weight functions
(Theorem IV.1). This has been previously shown by Mak
et al. [9], but our proof is substantially simpler, with no
need for [9]'s stochastic symbolic execution technique.
Our theorem is also slightly stronger, covering some
programs that do not almost surely halt, and ruling out
some pathological a.e.-differentiable weight functions.
• Interpreting probabilistic programs as ωPAP measures,
we prove that all programs of type Rn denote dis-
tributions supported on a countable union of smooth
submanifolds of Rn, and thus admit convenient densities
with respect to a particular class of reference measures
(Theorem IV.3).
Besides being interesting in their own right, these results
have consequences for the practical design and implementation
of probabilistic programming systems.
The first result is relevant to the application of gradient-
least)
based inference algorithms, which often require (at
almost-everywhere differentiability to be sound.
The second result is relevant for the automatic computation
of densities or Radon-Nikodym derivatives of probabilistic
programs, key ingredients in higher-level algorithms such as
importance sampling and MCMC. To see why, suppose a user
has constructed two closed probabilistic programs of type Rn,
p and q, and wishes to use q as an importance sampling
proposal for p. If JpK is absolutely continuous with respect
to JqK (JpK ≪ JqK), such an importance sampler does exist,
but implementing it requires computing importance weights:
at a point x ∼ JqK, we must compute dJpK
dJqK (x). If JpK and JqK
were both absolutely continuous with respect to the Lebesgue
measure on Rn, we could compute probability density func-
tions ρp and ρq for JpK and JqK respectively, and then compute
the importance weight as the ratio of these densities. But not
all programs denote measures that have densities with respect
to the Lebesgue measure.1 Our result gives us an alternative
to the Lebesgue measure: we can compute the density of JpK
(and JqK) with respect to the Hausdorff measures over the
manifolds on which they are supported. (Indeed, computing
densities with respect to Hausdorff measures has previously
been proposed by Radul and Alexeev [10]; our result is that,
unlike the Lebesgue base measure, this choice does not exclude
any possible programs a user might write, because every
program is absolutely continuous with respect to such a base
measure.)
D. Summary
• We present the category of ωPAP spaces (Section II),
a new setting suitable for a denotational treatment of
higher-order, recursive differentiable or probabilistic pro-
gramming languages. It supports sound and adequate
semantics of a call-by-value PCF with a type of real
numbers and a very expressive class of primitives.
• To demonstrate that our semantics enables denotational
reasoning about a broad class of interesting program
properties, we present new results (and new, much-
simplified proofs of old results) about differentiable (Sec-
tion III) and probabilistic (Section IV) programs.
II. ωPAP SEMANTICS
This section develops the ωPAP spaces, and shows how
to use them to interpret a higher-order, recursive language
1Consider, e.g., the program that samples u ∼ Unif(0, 1), and returns
(u, u) ∈ R2. Because it is supported only on a 1-dimensional line segment
within the plane, it has no density function with respect to the Lebesgue
measure in the plane. That is, there is no nonnegative function ρ such that
the probability of an event E ⊆ R2 is equal to
RRR2 1E(x, y) * ρ(x, y)dxdy.
with conditionals and discontinuous primitives. Our starting
point is [5]'s definition of piecewise analyticity under ana-
lytic partition (PAP), a property of some functions defined
on Euclidean spaces. The ωPAP construction significantly
extends Lee et al. [5]'s definition to cover partial and higher-
order functions between Euclidean or other spaces. The ωPAP
setting is general enough to interpret almost all primitives
encountered in practice, but restricted enough to allow precise
denotational reasoning.
A. ωPAP Spaces
We first recall a standard definition from analysis:
Definition II.1 (analytic function). If the Taylor series of a
smooth function f : U → V (for U ⊆ Rn, V ⊆ Rm) converges
pointwise to f in a neighborhood around x, we say f is
analytic at x. An analytic function is a function that is analytic
at every point in its domain.
When a subset of Rn can be carved out by finitely many
analytic inequalities, we call it an analytic set [5].
Definition II.2 (analytic set [5]). We call a set A ⊆ Rn an
analytic set if there exists a finite collection {gi}i∈I of analytic
functions into R, with open domain U ⊆ Rn, such that
A = {x ∈ U | ∀i ∈ I.gi(x) ≤ 0}.
(This definition is simpler than in [5], but is equivalent.)
Lee et al. [5]'s key definition was the class of PAP functions,
which are piecewise analytic:
Definition II.3 (PAP function [5]). For U ⊆ Rn and V ⊆ Rm,
we call f : U → V piecewise analytic under analytic partition
(PAP) if there is a countable family {(Ai, fi)}i∈I such that:
1) the sets Ai are analytic and form a partition of U ;
2) each fi : Ui → Rm is an analytic function defined on
an open domain Ui ⊇ Ai;
3) when x ∈ Ai, fi(x) = f (x).
In our development, PAP functions will play, at first order,
the role that smooth functions play in the construction of
diffeological spaces [11], and that measurable functions play
in the construction of quasi-Borel spaces [12]. The change to
PAP is essential: many primitives exposed by languages like
TensorFlow and PyTorch fail to be smooth at some inputs,
but virtually none fail to be PAP. And while PAP functions
are all measurable, they helpfully exclude many pathological
measurable functions, making it possible to prove stronger
results through denotational reasoning.
The development that follows generalizes PAP functions to
cover higher-order and partial maps, using recently developed
categorical techniques [1, 2, 4] (see Appx. B).2 First, we
introduce a term for the valid domains of PAP functions.
Definition II.4 (c-analytic set). A set A ⊆ Rn is c-analytic if
the inclusion A ֒→ Rn is PAP.3
Definition II.5 (ωPAP space). An ωPAP space is a triple
(|X|, PX, ≤X ), where (|X|, ≤) is an ωcpo and PX is a family
of sets of functions, called plots in X. For each c-analytic set
A, we have P A
X ⊆ |X|A. Plots have to satisfy the following
closure conditions:
• Every map from R0 to |X| is a plot in X.
• If φ ∈ |X|A is a plot in X and f : A′ → A is a PAP
function, then φ ◦ f is a plot in X.
• Suppose the c-analytic sets Aj ⊆ A form a countable par-
tition of the c-analytic set A, with inclusions ij : Aj → A.
If φ ◦ ij is a plot in X for every j, then φ is a plot in X.
X under the pointwise
• Whenever (αi)i is an ω-chain in P A
order, (
i αi)(x) :=
i(αi(x)) defines a plot in P A
X .
W
W
Definition II.6 (ωPAP map). An ωPAP map f : X → Y
is a Scott-continuous function between the underlying ωcpos
(|X|, ≤X) and (|Y |, ≤Y ), such that if φ ∈ P A
X, f ◦ φ ∈ P A
Y .
We now look at several examples of ωPAP-spaces. Our
first example establishes that PAP functions between Euclidean
spaces are a special case of ωPAP maps.
Example II.1. Any subset A ⊆ Rn can be given the structure
of an ωPAP-space (A, PA, =) where for every c-analytic set
C, the plots P C
A are given by
P C
A := {f : C → A | f is a PAP function}.
Next, we construct products, coproducts, and exponential
ωPAP spaces, which will be useful for interpreting the tuples,
sums, and function types of our language.
Example II.2 (Products). Given ωPAP spaces X and Y ,
define X × Y to be their product as ωcpo's, with plots
hf, gi ∈ P A
X×Y whenever f ∈ P A
X and g ∈ P A
Y .
More generally, given ωPAP spaces Xi for i ∈ I, we can
i∈I Xi by their product as ωcpos, with plots f ∈
whenever each projection πi ◦ f ∈ P A
Xi
define
P A
.
Q
Qi∈I Xi
Example II.3 (Coproducts). Let I be a countable index set,
i Xi is again an
and Xi a ωPAP space for each i ∈ I. Then
i |Xi|, and the partial order
ωPAP space, with carrier set
inherited from each Xi (elements of different spaces Xi and
F
i |Xi| is a plot
Xj are not comparable). A function f : A →
if there exists a countable partition {Aj}j of A into c-analytic
sets, such that for each j, there is a plot fj : Aj → Xkj ,
where kj ∈ I, such that on Aj, f (x) = inkj fj(x), i.e., if the
preimage of each Xi under f is a c-analytic set for each i.
F
F
Example II.4 (Exponentials). Let X and Y be ωPAP spaces.
Then X ⇒ Y is again a ωPAP space, with carrier set
ωPAP(X, Y ),
the set of ωPAP-morphisms from X to Y .
g(x). A function
for all x, f (x) ≤Y
f ≤X⇒Y
f : A → |X ⇒ Y | is a plot if uncurry f : A × X → Y is
an ωPAP morphism.
g iff
B. Core Calculus
2Full paper with appendices is available at https://arxiv.org/abs/2302.10636 .
3Equivalently, A is c-analytic if and only if it is equal to a countable union
of (possibly overlapping) analytic subsets of Rn (Cor. B.9).
We present our core calculus in Figure 2. It is a simple
call-by-value variant of PCF (e.g. as in Abramsky and Mc-
Cusker [13]), with ground types B for Booleans and real
for real numbers. It is parameterized by a set of primitives
f representing PAP functions, including analytic functions
such as +, ∗, exp, tan and comparison operators such as >, =.
The language also includes constants c for each real c and
true, false for Booleans. The typing rules and operational
semantics are standard, and given in Appendices A-A and A-B.
We will use realn as sugar for the n-fold product real×. . .×
real. We denote by ⋆ the unique inhabitant of the type 1.
types
1
real
τ ::=
|
|
| B
|
|
t ::=
τ1 × τ2
τ1 → τ2
unit type
real numbers
booleans
product
function
terms
⋆ | c | f (t1, . . . , tn)
ht1, t2i
let hx1, x2i = t1 in t2
if t1 then t2 else t3
| x
|
|
|
|
| λx.t | t s
| μf.λx.t
variable
unit/constants/ops
pair constructor
pair elimination
conditionals
function abstraction/app.
recursive function
Fig. 2. Types and terms of our language
constructs present in [2, 4]. Overall, (L, return, ≫=) forms a
(commutative) monad.
Proposition II.1. (L, return, ≫=) is a (strong, commutative)
monad on the category of ωPAP-spaces and morphisms.
We can now interpret types and terms of our language. The
semantics of types and terms is given in Fig. 3. A context
Γ = (x1 : τ1, . . . , xn : τn) is interpreted as the product space
JΓK def=
n
i=1JτiK. Substitution is given by the usual Kleisli
composition of effectful programs [14].
Q
J1K
JrealK
JBK
Jhτ1, τ2iK
Jτ1 → τ2K
def= ({⋆}, P1, =)
def= (R, PR, =)
def= (1 + 1, P1+1, =)
def= Jτ1K × Jτ2K
def= Jτ1K ⇒ LJτ2K
JxK(ρ)
J⋆K(ρ)
JcK(ρ)
Jf (t1, . . . , tn)K(ρ)
def= return ρ(x)
def= return ⋆
def= return c
def= Jt1K(ρ) ≫= (λx1.Jt2K(ρ)
≫= . . . ≫= (λxn.
f (x1, . . . , xn)))
def= Jt1K(ρ) ≫= (λx.Jt2K(ρ) ≫=
(λy.return (x, y)))
def= return λv.JtK(ρ[x 7→ v])
C. Denotational semantics
Jht1, t2iK(ρ)
We give a denotational semantics to our language using
ωPAP spaces and maps. A program Γ ⊢ t : τ is interpreted
as an ωPAP map JtK : JΓK → LJτ K, for a suitable partiality
monad L that we now define.
For an ωPAP space Y , we define the space LY as follows.
• The underlying set is |LY | := |Y | ⊔ {⊥}.
• The order structure is given by ∀x ∈ |Y |, ⊥ ≤LY x and
∀x, x′ ∈ |Y |, x ≤LY x′ iff x ≤Y x′.
• Plots are given by
P A
LY := {g : A → |Y | ⊔ {⊥} | ∃B ⊆ A c-analytic;
g−1(|Y |) = B and g|B ∈ P B
Y }
The intuition for P A
LY is that the partial ωPAP maps into Y
are defined on c-analytic sets of inputs, but the region on which
they are not defined need not satisfy any special property. This
is how we account for the example from Fig. 1; although it
is undefined on the 1
3 -Cantor set (which is not c-analytic), its
domain (the complement of the 1
3 -Cantor set) is c-analytic.
We also have (natural) ωPAP-morphisms, that we can write
using lambda-calculus notation as
• returnX : X → LX given by λx.inl x
• ≫=X,Y
: LX × (X ⇒ LY ) → LY given by
λ(x, g).match x with inr ⊥ 7→ inr ⊥, inl x 7→ g(x)
where inl, inr are respectively left and right injections (as set
functions, they are not ωPAP-morphisms).
L extends to ωPAP maps f : X → Y by setting Lf :
LX → LY to equal inl ◦ f on all inputs inl x and setting
Lf (inr ⊥) = inr ⊥. This definition is inspired by similar
Jλx : τ.tK(ρ)
Jlet hx1, x2i = t1in def= Jt1K(ρ) ≫=(λv.Jt2K(ρ[x1 7→ π1v,
t2K
Jt1 t2K(ρ)
Jif t1then t2
else t3K(ρ)
Jμf.λx.tK(ρ)
x2 7→ π2v]))
def= Jt1K(ρ) ≫=(λf.Jt2K(ρ) ≫= f )
def
= Jt1K(ρ) ≫= λb.if b then Jt2K(ρ)
else Jt3K(ρ)
def= return
i∈N fi
where f0 = λx.inr ⊥, fi+1 = λv.JtK(ρ[f 7→ fi, x 7→ v])
W
Fig. 3. Denotational semantics in ωPAP. Blue and bold indicate syntactic
and mathematical keywords, respectively.
Our denotational semantics in ωPAP is sound and adequate
w.r.t. our (standard) operational semantics (Appendix A-B).
Theorem II.2. The denotational semantics of our language is
sound and adequate.
Proof sketch. We show that ωPAP spaces and morphisms are
a category of ω-concrete sheaves on a concrete site, as defined
in Matache et al. [1], and use their development. More details
are given in Appendix B.
III. REASONING ABOUT DIFFERENTIABLE PROGRAMS
Our first application of our semantics is to the problem of
characterizing the behavior of automatic differentiation on the
terms of our language. Automatic differentiation is a program
transformation intended to convert programs representing real-
valued functions into programs representing their derivatives.
Program
automatic
differentiation
/ Program
denotational
semantics
Smooth
function
denotational
semantics
/ Smooth
function
mathematical
differentiation
Program
automatic
differentiation
/ Program
denotational
semantics
ωPAP
function
intensional
differentiation
denotational
semantics
ωPAP
function
Fig. 4. Common approach to the correctness of AD, e.g. [3].
Fig. 5. Our approach to the correctness of AD.
When all programs denote smooth functions, this informal
specification can easily be made precise; for example, Figure 4
illustrates the correctness property that Huot et al. [3] prove
for forward-mode AD in a higher-order language with smooth
primitives. Their proof is elegant and compositional, relying
on logical relations defined over the denotations of open terms.
In our setting, not all programs denote smooth functions,
and even when they do, standard AD algorithms can return
incorrect results, in ways that depend on exactly how the
smooth function in question was expressed as a program. For
example, Mazza and Pagani [7] define a program SillyId =
λx : R.if x = 0 then 0 else x, that denotes the identity
function (with derivative λx.1), but for which AD incorrectly
computes a derivative of 0 when x = 0. Because two
extensionally equal programs can have different derivatives as
computed by AD, it may seem unclear how any proof strategy
based on Figure 4, relating the syntactic operation of AD to the
semantic operation of derivative-taking, could apply. Indeed,
in showing their correctness result for AD, Mazza and Pagani
[7] had to develop new operational techniques for reasoning
about derivatives of traces of recursive, branching programs.
Our ωPAP semantics lets us take a different route, illustrated
in Figure 5. Like Huot et al. [3], we work directly with the
denotations of terms, which in our setting, are ωPAP maps.
But we do not attempt to assign a unique derivative to each
ωPAP function; instead, we define a relation on ωPAP maps
that characterizes when one is an intensional derivative [5]
of another. Our correctness proof, which follows exactly the
structure of Huot et al. [3]'s, then establishes that AD produces
a program denoting an (not the) intensional derivative of the
original program's denotation (Theorem III.4).
All ωPAP maps have intensional derivatives, so there is no
need to restrict the correctness result to only the differentiable
functions. But when an ωPAP map is differentiable in the stan-
dard sense, its intensional derivatives agree almost everywhere
with its true derivative. Thus, reasoning denotationally, we are
able to recover Mazza and Pagani [7]'s result: AD is almost
everywhere correct. Interestingly, this almost-everywhere cor-
rectness result is not sufficient to prove the convergence of
randomly initialized gradient descent, even for programs with
differentiable denotations (Proposition III.6).
A. Correctness of Automatic Differentiation
Terms in our language denote ωPAP maps X → LY , and
so to speak of correct AD in our language, we need some
notion of derivative that applies to such maps. We begin by
recalling Lee et al. [5]'s notion of intensional derivative, then
lift it to our setting:
Definition III.1 (intensional derivative [5]). Let f : U → V
be an ωPAP map, with c-analytic domain U ⊆ R and V ⊆ R
(seen as ωPAP spaces). Then an ωPAP map g : U → R is an
intensional derivative of f if there exists a countable family
{(Ai, fi)}i∈I such that:
• the sets Ai are analytic and form a partition of U ;
• the functions fi : Ui → R are analytic with open domain
Ui ⊇ Ai; and
• for x ∈ Ai, f (x) = fi(x) and g(x) = d
dx fi(x).
Definition III.2 (lifted intensional derivative). Let f : U →
LV be an ωPAP map, with c-analytic domain U ⊆ R and
V ⊆ R (seen as ωPAP spaces). Then an ωPAP map g : U →
LR is a lifted intensional derivative of f if it is defined on
exactly the inputs that f is, and restricted to this common
domain, g is an intensional derivative of f .
(These definitions can be straightforwardly extended to the
multivariate case, where U ⊆ Rn and V ⊆ Rm, and our full
correctness theorem does cover such functions. But here we
demonstrate the reasoning principles in the simpler univariate
setting. Of course, a program of type real → real may still
be defined in terms of multivariate primitives.)
We now establish that AD, applied to terms with a free
: real, computes these lifted
parameter θ : real ⊢ t
intensional derivatives. It does so in two steps:
• First, we apply a macro D (defined in Fig. 6) to t, yielding
a term θ : real × real ⊢ D(t) : real × real. This new
term operates not on a single real, but on a dual number,
which intuitively stores both a value and its (intensional)
derivative with respect to an external parameter.
• Then, θ : real ⊢ let θ = hθ, 1i in let hx, dx
dθ i =
dθ is output as the lifted intensional derivative
D(t) in dx
of JtK.
The key hurdle in showing the correctness of this AD proce-
dure is establishing that the macro D is correctly propagating
intensional dual numbers. To show this compositionally, and
in a way that exploits our denotational framework, we first
define for each type τ a relation Vτ between pairs of ωPAP
plots in Jτ K and in JD(τ )K. It captures more precisely the
properties that the dual numbers flowing through our program
should have.
(cid:15)
(cid:15)
/
(cid:15)
(cid:15)
/
(cid:15)
(cid:15)
/
(cid:15)
(cid:15)
o
o
/
/
/
o
/
o
/
o
/
o
/
o
/
o
/
o
/
o
/
o
D(real) def= real × real D(τ1 × τ2) def= D(τ1) × D(τ2)
def= τ (τ = 1, B) D(τ1 → τ2) def= D(τ1) → D(τ2)
D(τ )
D(x)
D(⋆)
D(c : real)
D(c : B)
D(f (t1, . . . , tn))
D(λx.t)
D(t s)
D(ht1, t2i)
D(let hx1, x2i = t in s)
D(μf.t)
D(if t1 then t2 else t3)
def= x
def= ⋆
def= hc, 0i
def= c
def= fD(D(t1), . . . , D(tn))
def= λx.D(t)
def= D(t) D(s)
def= hD(t1), D(t2)i
def= let hx1, x2i = D(t)
in D(s)
def
= μf.D(t)
def= if D(t1) then D(t2)
else D(t3)
Fig. 6. AD macro for our higher-order recursive language
Definition III.3 (correct dual-number intensional derivative at
A ⊆ R). Let τ be a type and let f : A → Jτ K, for some
c-analytic subset A ⊆ R. Then we say f ′ : A → JD(τ )K is
a correct dual-number intensional derivative of f if (f, f ′) ∈
Vτ (A), where Vτ (A) is defined inductively:
• Vreal(A) = {(f, f ′) | f ′(x) = (f (x), g(x)) for some
intensional derivative g of f }.
• Vτ (A) = {(f, f ′) | f = f ′} for τ ∈ {1, B}.
• Vτ1×τ2(A) = {(f, f ′) | (πi ◦ f, πi ◦ f ′) ∈ Vτi(A) for
i = 1, 2}.
• Vτ1→τ2 (A) = {(f, f ′)
|
∀(g, g′) ∈ Vτ1(A),
(λx.f (x)(g(x)), λx.f ′(x)(g′(x))) ∈ Vτ2(A)}.
Readers may recognize V as defining a (semantic) logical
relation; its definition at product and function types is com-
pletely standard, so only at ground types did we make any real
choices. For partial functions, we need to extend the definition:
Definition III.4 (correct lifted dual-number intensional deriva-
tive at A ⊆ R). Let τ be a type and let f : A → LJτ K, for some
c-analytic subset A ⊆ R. Then we say f ′ : A → LJD(τ )K
is a correct lifted dual-number intensional derivative of f if
f and f ′ are defined (i.e., not ⊥) on the same domain and,
restricted to this common domain, f ′ is a correct dual-number
intensional derivative of f .
We are now in a position to state more precisely what it
would mean for the D macro to correctly propagate dual num-
bers. In particular, the macro transforms terms Γ ⊢ t : τ into
their correct dual-number translations D(Γ) ⊢ D(t) : D(τ ),
the specification for which is given below.
LJD(τ2)K is a correct dual-number translation of f if, for
all c-analytic A, and all pairs (g, g′) ∈ Vτ1 (A), fD ◦ g′ is a
correct lifted dual-number intensional derivative of f ◦ g.
We assume that each primitive f : τ1 → τ2 in our language
is equipped with a built-in correct dual-number translation
fD, which the definition of D in Figure 6 uses. Because the
primitives are translated correctly, so are whole programs:
Lemma III.1 (Correctness of D macro (limited)). For any
term Γ ⊢ t : τ , JD(t)K : JD(Γ)K → JD(τ )K is a correct dual-
number translation of JtK.
Proof Sketch. This is the Fundamental Lemma of our logical
relations proof, and can be obtained using general machin-
ery [15], after verifying several properties of our particular
setting:
• Vreal(A) is closed under piecewise gluing: if {Ai}i∈I is
a countable partition of A, and (f |Ai , f ′|Ai) ∈ Vreal(Ai)
for each i ∈ I, then (f, f ′) ∈ Vreal(A). This follows
from our definition of intensional derivative.
• Vreal(A)
is closed under restriction:
if (f, f ′) ∈
Vreal(A), and A′ ⊆ A is c-analytic, then (f |A′ , f ′|A′ ) ∈
Vreal(A′). This also follows easily from our definition.
• The lifted dual-number intensional derivatives are closed
under least upper bounds: if {(fn, f ′
n)}n∈N is a sequence
n : A → LJR × RK a correct lifted dual-
with each f ′
number intensional derivative of f : A → LR, and with
n∈N f ′
fn ≤ fn+1 and f ′
n
is a correct lifted dual-number intensional derivative of
n∈N fn. This is more involved, but its proof mirrors
the one that establishes LR as an ωPAP space in the
W
first place: we explicitly construct representations of
the lubs in question as piecewise functions, satisfying
Definition III.2.
n+1 for each n ∈ N, then
n ≤ f ′
W
The overall correctness theorem follows easily:
apply Lemma
Theorem III.2 (Correctness of AD Algorithm (limited)). For
any term θ : real ⊢ t : real, the ωPAP map λθ.Jlet hx, dx
dθ i =
D(t) in dx
dθ K((θ, 1)) is a lifted intensional derivative of JtK.
III.1,
Proof. We
from
setting
Definition III.5 to (λθ.θ, λθ.(θ, 1)). This
that
(JtK, λθ.JD(t)K(θ, 1)) are defined on the same domain, and on
that domain A, their restrictions are in Vreal(A). This implies
that on that domain, λθ.π2(JD(t)K((θ, 1))) is an intensional
derivative of JtK, from which the result follows by unfolding
the definition of J*K on let expressions.
(g, g′)
implies
This result, which we achieved via denotational reasoning,
immediately implies the result of Mazza and Pagani [7]:
Corollary III.3. If θ : real ⊢ t : real denotes a total
differentiable function, then the set of input points on which
the AD algorithm fails has measure zero.4
Definition III.5 (correct dual-number translation). Let τ1 and
τ2 be types, and let f : Jτ1K → LJτ2K. Then fD : JD(τ1)K →
4Mazza and Pagani [7] prove a slightly stronger result, and we can also
show something slightly stronger; see Prop. C.17.
Proof. Because JtK is total, it is PAP and AD computes an
intensional derivative of JtK. Intensional derivatives are almost
everywhere equal to true derivatives [5].
Using more complex logical predicates, we can prove
correctness for multivariate functions (see Appx. C). In the
multivariate setting, forward-mode AD typically computes
Jacobian-vector products; for us, it computes lifted intensional
Jacobian-vector products.
Definition III.6 (lifted intensional Jacobian). Let f : U → LV
be an ωPAP map, with U ⊆ Rn c-analytic and V ⊆ Rm. An
ωPAP map g : U → LRm×n is an intensional Jacobian of f
if it is defined (i.e., not ⊥) exactly when f is, there exists a
countable analytic partition {Ai}i∈I of its domain, and there
exist analytic functions fi : Ui → Rm with open domains
Ui ⊇ Ai such that when x ∈ Ai, f (x) = fi(x) and g(x) =
Jfi(x), where J is the Jacobian operator.
:
real, . . . , xn
Theorem III.4 (Correctness of AD (full)). For any term
realm, and
real
x1
:
:
any vector v ∈ Rn,
the ωPAP map λθ.let x =
JD(t)K((θ1, v1), . . . , (θn, vn)) in (π2x1, . . . , π2xm) is equal
to g(θ) * v for some intensional Jacobian g of JtK.
⊢
t
AD, this may not be the case, even if f is differentiable: we
proved only that AD computes intensional derivatives, which
may disagree with true derivatives on a measure-zero set of
inputs.
Intuitively, it may seem as though we can avoid the measure-
zero set of inputs on which AD may be incorrect by randomly
selecting an initial point x0. Indeed, similar arguments have
been made informally in the literature [7]. But this turns out
not to be the case:
Proposition III.6. Let ǫ > 0. There exists a program P such
that JP K : R → R satisfies the condition of Theorem III.5, and
yet, for all x0 ∈ R, the gradient descent method diverges to
−∞, when the gradients are computed with AD.
Proof sketch. Let P be the closed program defined by the
following code, where lr is our chosen learning rate ǫ.
# Recursive helper
def g(x, n):
if x > 0:
return ((x - n)*(x - n))/(lr * 2)
return x / lr + n*n / (2*lr)
if x == 0:
else:
return g(x+1, n+1)
B. Optimization of Differentiable Programs with AD-
computed Derivatives
Our characterization of AD's behavior, proven in the pre-
vious section, can be used to establish the correctness of
algorithms that use the results of AD. In optimization, for
example, a very common technique for minimizing a differ-
entiable function f : Rd → R is gradient descent. Starting at
an initial point x0 ∈ Rd, for a set step size ǫ > 0, we iterate
the following update:
xt+1 := xt − ǫ∇f (xt).
(1)
If the step size ǫ is too large, we cannot hope to converge
on an answer. To ensure that a small-enough step size can be
found, we need to know that f 's gradient changes slowly:
Definition III.7. A differentiable function f : Rd → R is
L-smooth if for all x, y ∈ Rd
k∇f (x) − ∇f (y)k ≤ Lkx − yk.
When f is L-smooth, it is well known that ǫ can be chosen
small enough for gradient descent to converge (albeit not
necessarily to a global minimum):
Theorem III.5 (e.g. [16]). Let f be L-smooth, bounded below,
L . Then, for any initial x0 ∈ Rd, following the
and 0 < ǫ < 2
method from Equation 1, the gradient of f tends to 0:
∇f (xt) = 0
lim
t→∞
and the function f monotonically decreases on values of the
sequence {xt}t, that is for all t ∈ N, f (xt+1) ≤ f (xt).
However, this theorem assumes that the true gradient of f
is used to make each update. When gradients are obtained by
def P(x):
return g(x,0)
One can show that JP K = x 7→ x2
2ǫ and satisfies the conditions
of Theorem III.5, yet gradient descent will diverge to −∞
initial points x0. The full explanation is given in
for all
Appendix D-A.
The proof applies to an idealized setting where gradient
descent is run with real numbers, rather than floating-point
numbers, but in our experiments, PyTorch did diverge on
this program. Similar counterexamples can be constructed for
some variants of the gradient descent algorithm, e.g. when the
learning rate is changing according to a schedule.
Likewise, it is easy to derail the algorithm when the learning
rate ǫ is random but the initial point x0 is fixed.
Proposition III.7. Let x0 be a fixed initial point. Then there
exists a program P such that JP K : R → R satisfies the
conditions of Theorem III.5, and ∇JP K(x0) 6= 0, and yet, for
all ǫ > 0, the gradient descent method yields xt = x0 for all
t, when the gradients are computed with AD.
Proof. Simply choose P (x) = if x = x0 then (x0)2 else x2,
for which AD will give the intentional derivative 0 at x0.
The counterexamples constructed for the proofs above are
tied to a specific learning rate or to a specific initialization.
It is therefore reasonable to think that by randomizing both
quantities, one might be able to almost surely avoid such
counter-examples. Thankfully, this is the case.
Theorem III.8 (Convergence of GD with intensional deriva-
tives). Let f be PAP, bounded below, L-smooth. Let (ǫ, x0)
be drawn randomly from a continuous probability distribution
Γ ⊢ e : real
Γ ⊢ score e : 1
Γ ⊢ sample : real
Fig. 7. Type system of the probabilistic part of the language
L ) × Rd. Then when gradient descent com-
supported on (0, 2
putes gradients using AD, the true gradient tends to 0 with
probability 1:
∇f (xt) = 0.
lim
t→∞
Furthermore, with probability 1, the function f (x) monotoni-
cally decreases: f (xt+1) ≤ f (xt).
The proof is given in Appendix D-B.
IV. REASONING ABOUT PROBABILISTIC PROGRAMS
PAP functions were originally developed in Lee et al. [5]
to reason about automatic differentiation, so perhaps it
is
not surprising that their generalization to ωPAP was useful,
in the previous section, for characterizing AD's behavior. In
this section, we show that the ωPAP semantics also makes
it nice to reason about probabilistic programs: by excluding
pathological deterministic primitives, we also prevent many
pathologies from arising in the probabilistic setting, enabling
clean denotational arguments for several nice properties.
To reason about probabilistic programs, we must extend
our core calculus (Figure 2) with the standard effectful opera-
tions exposed by probabilistic programming languages (PPLs):
sample samples a real from the uniform distribution on (0, 1),
and score r reweights program traces (to implement soft
constraints). Their typing rules are given in Figure 7.
The language needs no new types, but the semantics change:
instead of interpreting our language with the monad L, which
models divergence, we must use a new monad that also tracks
probabilistic computation. In Section IV-A, we introduce a
monad of weighted samplers [8], which can informally be
seen as deterministic functions from a source of randomness
to output values. We use this monad to reason about the de-
terministic weight functions that some probabilistic program-
ming systems use during inference, presenting a new (much
simplified) proof of Mak et al. [9]'s result that almost-surely-
terminating probabilistic programs have almost-everywhere
differentiable weight functions. In Section IV-B, we introduce
a commutative monad of measures, which can be seen as
a smaller version of V ́ak ́ar et al. [2]'s monad of measures,
excluding those measures which can't be defined using ωPAP
deterministic primitives. We use this smaller monad to prove
that all definable measures in our language are supported on
countable unions of smooth manifolds. This implies that they
have densities with respect to a particular well-behaved class
of base measures, and we close by briefly discussing the
implications for PPL designers.
A. Almost-Everywhere Differentiability of Weight Functions
First, we define a monad S of weighted samplers, that
interprets programs as partial ωPAP maps from a space Ω of
random seeds to a space of weighted values. Intuitively, the
measure represented (or "targeted") by a sampler of weighted
pairs (x, w) is the one that assigns measure E[w * 1A(x)] to
each measurable set A. But this semantics does not validate
many important program equivalences, like commutativity,
intuitively because it exposes "implementation details" of
weighted samplers, that can differ even for samplers targeting
the same measure. This is intentional: our first goal is to prove
a property of these "implementation details," one that inference
algorithms automated by PPLs might rely on.
First, we fix our source of randomness Ω to be the lists of
reals, ⊔i∈NRi (which is an ωPAP space, see Example II.3).
We then define our monad:
Definition IV.1 (monad of weighted samplers). Let S be the
monad (S, returnS, ≫=S), defined as follows:
• SX := Ω ⇒ L((X + 1) × [0, ∞) × Ω)
• returnS
• ≫=S
X,Y := λm.λk.λr.m(r) ≫=L(λ(x?, w, r′).match x?
inl x →
X := λx.λr.inl(inl x, 1, r)
→ inl
with {inr
k(x)(r′) ≫=L λ(y?, v, r′′).inl (y?, w * v, r′′)}.
(x?, 0, r′)
|
JsampleK(ρ) def= λr.match r with{
() → inl (inr ⋆, 0, r)
| (r1, r2:n) → inl (inl r1, 1, r2:n)}
Jscore tK(ρ) def= JtK(ρ) ≫=(λw.λr.inl(inl ⋆, 0 ∨ w, r))
Jμf.λx.tK(ρ) def= return
i∈N fi
W
where f0 = λx.λr.inr ⊥, fi+1 = λv.JtK(ρ[f 7→ fi, x 7→ v])
Fig. 8. Updated semantics for new monad S of effects
This monad interprets a probabilistic program as a partial
function mapping lists of real-valued random samples, called
traces, to: (1) the output values they possibly induce in X (or
inr ⋆ if the input trace does not contain enough samples to
complete execution of the program), (2) a weight in [0, ∞),
and (3) a remainder of the trace, containing any samples not
yet used. The return of the monad consumes no randomness,
and successfully returns its argument with a weight of 1. The
≫= of the monad runs its continuation on the random numbers
remaining in the trace after its first argument has executed,
and multiplies the weights from both parts of the computation.
Figure 8 gives the semantics of sample and score, as well as
updated semantics for μf.t (the only change is that the bottom
element, from which least fixed points are calculated, is now
the bottom element of SX rather than LX). The sample
command fails to produce a value when given an empty trace,
but otherwise consumes the first value in the trace and returns
it. The score command consumes no randomness, and uses
its argument (if non-negative) as the weight.
One way to use a weighted sampler is to run it, contin-
ually providing longer and longer lists of uniform random
numbers until a value from X (and an associated weight) is
generated. But many probabilistic programming systems also
expose more sophisticated inference algorithms. Gradient-
based methods, such as Hamiltonian Monte Carlo or Langevin
ascent, attempt to find executions with high weights by per-
forming hill-climbing optimization or MCMC over the space
of traces, guided by a program's weight function.
Definition IV.2 (weight function). For any p ∈ |S X|, define
its weight function wp : ⊔i∈N[0, 1]i → [0, ∞), as follows:
• When p(r) = inr ⊥, wp(r) = 0.
• When p(r) = inl (x, v, r′) for r′ non-empty, wp(r) = 0.
• When p(r) = inl (x, v, ()), wp(r) = v.
The weight function can be viewed as a density with
respect to a particular base measure on traces; scaling the
base measure by this density yields an unnormalized measure,
and the normalized version of this measure, which is a
probability distribution placing high mass on traces that lead
to high weights, is called the posterior over traces. Inference
algorithms like HMC are designed to generate samples ap-
proximately distributed according to this posterior.
Using our definition of the weight function, we can re-
cover Mak et al. [9]'s result about the almost-everywhere
differentiability of weight functions, a convenient property
when reasoning about gradient-based inference:
Theorem IV.1. Probabilistic programs that almost surely halt
have almost-everywhere differentiable weight functions.
Proof. Let ⊢ t : X be a program. Almost-sure termination im-
plies that for almost all inputs r ∈ ⊔i∈N[0, 1]i, JtK(r) 6= inr ⊥.
Restricted to the intersection of ⊔i∈N[0, 1]i with JtK's domain,
its weight function wJtK is ωPAP,5 and thus almost-everywhere
differentiable. Almost all of almost all of ⊔i∈N[0, 1]i is almost
all of ⊔i∈N[0, 1]i, concluding the proof.
We note that the proof only uses the fact that for almost
all r ∈ ⊔i∈N[0, 1]i, JtK(r) 6= inr ⊥-which is strictly weaker
than almost-sure termination. Almost-sure termination can fail
even though a program halts on any finite trace of random
numbers. Some probabilistic context-free grammars, for ex-
ample, do not always surely halt, but as they execute, they
consume an unbounded amount of randomness, so that when
provided a finite trace, they will eventually halt with an error.
Our proof shows that such programs, although they do not
almost surely halt, do have almost-everywhere differentiable
weight functions. As such, our result is slightly stronger than
that of Mak et al. [9], and followed immediately from the
interpretation of probabilistic programs in the ωPAP category.
B. Existence of Convenient Base Measures for Monte Carlo
We now wish to prove a result not about the intensional
properties of probabilistic programs (like their weight func-
tions), but the extensional properties of the measures that
programs denote. To do so, we construct a final monad in
which to interpret our language: a commutative monad of
measures, similar to that of V ́ak ́ar et al. [2].
Definition IV.3 (ωPAP space of measure weights). Define W
to be the ωPAP space with:
• |W| = R≥0 ∪ {∞}, the extended non-negative reals;
• w ≤W v when v = ∞ or when w < v < ∞.
W whenever φ : A → W is measurable.
• φ ∈ P A
Note that although many maps into W exist, very few maps
exist out of W, because its ωPAP diffeology is so permissive:
any measurable function is a plot.
Following ́Scibior et al. [8], measures can be seen as
equivalence classes of samplers that behave the same way
as integrators. Given a weighted sampler p ∈ |SX|, we can
define the integrator it represents:
Definition IV.4 (integrator associated to a sampler). We
define ωPAP maps IntX : SX → (X ⇒ W) ⇒ W
sending samplers to their associated integrators: IntX p =
λf.
Dom(αp) ΛΩ(dr)f (αp(r)), where
R
• ΛΩ is a Lebesgue base measure over |Ω|, assigning to
i∈N Λi({x |
each measurable subset A ⊆ Ω the value
(i, x) ∈ A}) (where Λi is the Lebesgue measure on Ri).
• αp : Ω → LX is an ωPAP map that on input r,
returns inr ⊥ if any of the following hold: r is empty;
6∈ [0, 1]|r|−1; p(r2:|r|) returns inr⊥; or
r1 < 0; r2:|r|
p(r2:|r|) returns inl (x, v, r′) and either r′ is non-empty,
x = inr ⋆, or v < r1. Otherwise, p(r2:|r|) must return
inl (inl x,
, ), and αp also returns inl x.
P
• Dom(αp) is the domain of the partial map αp.
Then, following V ́ak ́ar et al. [2], we take the measures to
be those integrators that lie in the image of Int:
Definition IV.5 (monad of measures). The monad M of
measures is defined by:
• MX is the image of SX under IntX . It is a subobject
of (X ⇒ W ) ⇒ W and inherits its order.
• returnM
• ≫=M
X := λx.λf.f (x).
X,Y := λm.λk.λf.m(λx.k(x)(f )).
JsampleK(ρ) def= λf.
R
Jscore tK(ρ) def= λf.JtK(ρ)(λw.(0 ∨ w) * f (⋆))
Jμf.λx.tK(ρ) def= return
[0,1] f (x)dx
i∈N fi
where f0 = λx.λf.0, fi+1 = λv.JtK(ρ[f 7→ fi, x 7→ v])
W
Fig. 9. Updated semantics for new monad M of effects
5Under our semantics, JtK is an ωPAP morphism from 1 (the empty context)
to SJτ K for any closed term t. Elements of SJτ K are themselves ωPAP
morphisms from Ω to L((Jτ K + 1) × R≥0 × Ω) - so t denotes such a
map. Now consider post-composing this map with the ωPAP map sending
⊥ to ⊥, and (x, v, r) to v when r is empty and 0 otherwise. The result is
an ωPAP map from Ω to LR≥0. We next precompose this map with the
inclusion ⊔i[0, 1]i → Ω, to obtain an ωPAP map from
i[0, 1]i to LR≥0,
equal to the weight function for JtK everywhere on its domain.
F
This monad is a submonad of the continuation monad [2],
and so the return and ≫= are inherited. The sample
command is interpreted as the uniform measure on [0, 1], and
the score t command as a measure on a one-point space, with
a certain total mass given by t. Our semantics under M (Fig. 9)
is related to the one from the previous section (Fig. 8) in that
for any closed term ⊢ t : X, IntX (JtKS) = JtKM. Using this,
we can establish this lemma about the definable measures:
Lemma IV.2. Let ⊢ t : realn. Then, there exists a partial
ωPAP function ft : Ω ⇀ Rn such that JtK = ft∗ΛΩ.
That
is, any probabilistic program returning reals must
arise as a well-behaved transformation of "input randomness"
represented by Ω. This is not particularly surprising, of course,
because a probabilistic program is defined by specifying an
(ωPAP) transformation of input randomness, but it highlights
the way we will use our ωPAP semantics to establish general
properties of the measures denoted by probabilistic programs.
The proof is given in Appendix E-A.
In particular, we will characterize the definable measures
as absolutely continuous with respect to a particular class
of base measures. We first recall some relevant definitions
from differential geometry, starting with the smooth manifolds,
a well-studied generalization of Euclidean spaces; common
examples include lines, spheres, and tori.
Definition IV.6. A smooth manifold M is a second-countable
Hausdorff topological space together with a smooth atlas: an
open cover U together with homeomorphisms (φU : U →
Rn)U∈U called charts such that φV ◦ φ−1
U is smooth on its
domain of definition for all U, V ∈ U. A function f : M →
N between manifolds is smooth if φV ◦ f ◦ φ−1
U is smooth
for all charts φU , φV of M and N . When there's a global
bound K on the local dimensions n of a smooth manifold, it's
well known by a theorem of Whitney that the manifold can
be embedded as a submanifold of an Euclidean space, that is
its topology is given by restricting the standard one from the
surrounding Euclidean space.
There is a natural measure on smooth manifolds that gener-
alizes the Lebesgue measure on Euclidean spaces, and matches
our intuitive notions of area and volume on curved spaces.
Definition IV.7. The k-Hausdorff measure on a metric space
(X, d) is defined as
H k
(S) := lim
δ→0
inf
(Ui)i∈N n
∞
X
i=1
k
diam(Ui)
| S ⊆
∞
[
i=1
Ui, diam(Ui) < δo
x, y ∈ U } and
where diam(U ) := sup {d(x, y)
diam(∅) := 0. The Hausdorff dimension is then defined as
dimHaus(S) := inf{k | H k(S) = 0}.
|
The Hausdorff measure computes the sizes of sets S in a
dimension-dependent way:
• The 0-Hausdorff measure counts the points in S.
• The 1-Hausdorff measure sums the lengths of curves
within a set. It will be infinite on surfaces, and 0 on
sets of isolated points.
• The 2-dimensional Hausdorff measure sums the areas of
surfaces, and will be infinite on volumes and 0 on curves.
• More generally, the k-Hausdorff measure will quantify
k-dimensional volumes.
For smooth manifolds, the Hausdorff dimension matches
the intuitive notion of dimension, e.g. a sphere in R3 has
Hausdorff dimension 2 , a path on such a sphere will have
Hausdorff dimension 1, and an open of Rn has dimension
n. We now define our class of s-Hausdorff measures, which
measure the sizes of sets by measuring the d-dimensional
volumes of their intersections with d-dimensional manifolds,
for every d:
Definition IV.8 (s-Hausdorff measure on Rn). An s-Hausdorff
measure on Rn is a measure μ that decomposes as
μ(A) =
n
Xd=0
H d(A ∩ M d)
where each M d is a countable union
smooth manifolds M d
i .
i M d
i of d-dimensional
S
Our main result in this section is a construction assigning
an s-Hausdorff measure B(t) to every closed probabilistic
program ⊢ t : realn, such that JtK has a density w.r.t. B(t).
Theorem IV.3. Any closed probabilistic program ⊢ t : realn
admits an s-Hausdorff measure B(t) on Rn such that
• JtK has a density (possibly infinite) ρt w.r.t B(t);
• if μ is another s-Hausdorff measure w.r.t. which JtK has
a density, then that density is JtK-a.e. equal to ρt.
• if t2 has the same type and Jt1K ≪ Jt2K (where ≪ denotes
absolute continuity) then B(t1) ≪ B(t2); and
• there is a set A ⊆ Rn such that 1A is a density of B(t1)
with respect to B(t2).
Finally,
In particular, this means that a sensible design decision
for a PPL is to always compute densities of probabilistic
programs p with respect to an s-Hausdorff base measure B(p).
In order to compute Radon-Nikodym derivatives between
multiple programs, the theorem implies we can separately
compute their densities and then take the ratio, so long as we
also include a "support check" (of the sort described by [10]).
the class of s-
Hausdorff measures seems appropriate to serve as base mea-
sures, as for each s-Hausdorff measure, there is a closed prob-
abilistic program whose posterior distribution has a strictly
positive density w.r.t that measure. This means that we cannot
'carve out' any mass from the s-Hausdorff measure, and that
the underlying supporting manifolds faithfully represent the
possible supports of posterior distributions of probabilistic
programs.
the following result shows that
Theorem IV.4. Assume that the language has all partial PAP
functions as primitives. Then, for every n ∈ N and every s-
Hausdorff measure μ, there exists a program ⊢ t : realn such
that JtK and μ are mutually absolutely continuous.
The proofs are given at the end of Appendix E-B.
V. RELATED WORK AND DISCUSSION
Summary. We introduced the category of ωPAP spaces and
used it as a denotational model for expressive higher-order
recursive effectful languages. We first looked at a determin-
istic language with conditionals and partial PAP functions,
which we argued covers almost all differentiable programs
that can be implemented in practice. We showed that AD
computes correct intentional derivatives in such an expressive
setting, extending Lee et al. [5]'s result, and recovering the
fact that AD computes derivatives which are correct almost-
everywhere. Next, we showed that gradient descent on pro-
grams implementing differentiable functions can be soundly
used with intentional derivatives, as long as both the learning
rate and the initialization and randomized. We then looked at
applications in probabilistic programming. After introducing
a strong monad capturing traces of probabilistic programs,
we gave a denotational proof that the trace density function
of every probabilistic program is almost everywhere differen-
tiable. Finally, we defined a commutative monad of measures
on ωPAP, and proved that all programs denote measures
with densities with respect to some s-Hausdorff measures. As
such, we argued that the s-Hausdorff measures form a set of
convenient base measures for density computations in Monte
Carlo inference, and showed that every closed probabilistic
program has a density w.r.t. some s-Hausdorff measure.
Together, these results demonstrate the value of denotational
reasoning with a "just-specific-enough" model
like ωPAP.
Results previously established in the literature by careful
operational reasoning, such as Theorem IV.1, follow almost
immediately after setting up the definitions the right way. And
we have also shown new theorems, such as Theorem IV.3, by
applying methods from analysis to characterize the restricted
class of denotations in our semantic domain.
Semantics of higher-order differentiable programming. We
continue a recent line of work on giving denotational seman-
tics for higher-order differentiable programming in functional
languages. Our semantics and logical relations proof builds
on insights proposed in the smooth setting in Huot et al.
[3], and takes inspiration from V ́ak ́ar [4] for the treatment
of recursion. In this work, we considered a simple forward-
mode AD translation, but a whole body of work focused
their attention on provably correct and efficient reverse-mode
AD algorithms on higher-order languages [7, 17, 18, 19, 20].
We believe our correctness result could be adapted to a
reverse-mode AD algorithm, perhaps following the neat ideas
developed in Krawiec et al. [20], Radul et al. [21], or Smeding
and V ́ak ́ar [22], but we leave this for future work. There are
also more synthetic approaches to studying differentiation in a
more purely categorical tradition, sometimes called synthetic
differential geometry [23]. Some of these approaches are
particularly appealing from a theoretical point of view [24, 25],
but their precise relations with AD and its implementations
remains to be further studied.
Semantics of differentiable programming with non-smooth
functions. Our work directly builds on and extends Lee et al.
[5]'s setting to a higher-order recursive language. As is shown
in Lee et al. [26], when moving beyond the differentiable set-
ting, there are many seemingly reasonable classes of functions
that behave pathologically in subtle ways, usually preventing
compositional reasoning. ωPAP spaces combine the advantage
of restricting to PAP functions at first-order with expressive
power provided by abstract categorical constructions, which
conservatively extend the first-order setting. Bolte and Pauwels
[27] investigated a similar problem as Lee et al. [5] on a more
restricted first-order language, but proved a convergence of
gradient descent result in their setting. It would be interesting
to see if some of the ideas developed in Chizat and Bach
[28] could be adapted to prove some convergence of stochastic
gradient descent when AD is used on programs denoting PAP
functions, thus going beyond the setting of neural networks.
Semantics of probabilistic programming. Our commutative
monad of measures takes clear inspiration from Staton [6] and
V ́ak ́ar et al. [2], adding an extra step in the recent search of
semantic models for higher-order probabilistic programming
[12, 29]. In particular, our work refines the model of V ́ak ́ar
et al. [2] by restricting to PAP functions, instead of merely
measurable ones, but keeping its essential good properties for
interpreting probabilistic programs. By doing so, our work is
closer in spirit to Freer and Roy [30]'s study of computable
properties for higher-order probabilistic languages. Our monad
for tracking traces of probabilistic programs is similar to what
is presented in Lew et al. [31], giving a denotational version of
similar work that focus on operational semantics, such as Mak
et al. [9]. Our result about densities and s-Hausdorff measures
has some of its foundations based on the careful study of
s-finite measures and kernels from V ́ak ́ar and Ong [32]. It
would be interesting to see if the work of Lew et al. [33]
could be extended to a non-differentiable setting with PAP
primitives, proving that an AD algorithm on a probabilistic
language yields unbiased gradient estimates, perhaps using the
estimator derived in Lee et al. [34] for non-smooth functions.
Disintegration and base measure. Our result on base mea-
sures for probabilistic programs is related to the literature on
symbolic disintegration [35, 36, 37], which has also had to
wrestle with the problem of finding base measures with respect
to which expressive programs have densities. Our approach
builds on the idea presented by Radul and Alexeev [10]:
we extend the Hausdorff base measures to s-Hausdorff base
measures, and prove that they suffice for ensuring all programs
have densities. We leave open the question of characterizing
exactly the class of densities on s-Hausdorff measures that
arise from probabilistic programs, and the investigation of the
closure of these measures under least upper bounds.
ACKNOWLEDGMENT
We have benefited from discussing this work with many
friends and colleagues, Wonyeol Lee, Faustyna Krawiec,
Michele Pagani, Sean Moss, and the Oxford group. We are also
grateful to anonymous referees for their very helpful feedback.
This material is based on work supported by the NSF Graduate
Research Fellowship under Grant No. 1745302. Our work
is also supported by a Royal Society University Research
Fellowship, the ERC BLAST grant, the Air Force Office of
Scientific Research (Award No. FA9550–21–1–0038), and the
DARPA Machine Common Sense and SAIL-ON projects.
REFERENCES
246, 2013.
[1] C. Matache, S. Moss, and S. Staton, "Concrete categories
and higher-order recursion: With applications including
probability, differentiability, and full abstraction," in Pro-
ceedings of the 37th Annual ACM/IEEE Symposium on
Logic in Computer Science, 2022, pp. 1–14.
[2] M. V ́ak ́ar, O. Kammar, and S. Staton, "A domain theory
for statistical probabilistic programming," Proceedings of
the ACM on Programming Languages, vol. 3, no. POPL,
p. 36, 2019.
[3] M. Huot, S. Staton, and M. V ́ak ́ar, "Correctness of
automatic differentiation via diffeologies and categorical
gluing." in FoSSaCS, 2020, pp. 319–338.
[4] M. V ́ak ́ar, "Denotational correctness of foward-mode
automatic differentiation for iteration and recursion,"
arXiv preprint arXiv:2007.05282, 2020.
[5] W. Lee, H. Yu, X. Rival, and H. Yang, "On correct-
ness of automatic differentiation for non-differentiable
functions," Advances in Neural Information Processing
Systems, vol. 33, pp. 6719–6730, 2020.
[6] S. Staton, "Commutative semantics for probabilistic pro-
gramming," in European Symposium on Programming.
Springer, 2017, pp. 855–879.
[7] D. Mazza and M. Pagani, "Automatic differentiation
the ACM on Programming
in PCF," Proceedings of
Languages, vol. 5, no. POPL, pp. 1–27, 2021.
[8] A. ́Scibior, O. Kammar, M. V ́ak ́ar, S. Staton, H. Yang,
Y. Cai, K. Ostermann, S. K. Moss, C. Heunen, and
Z. Ghahramani, "Denotational validation of higher-order
Bayesian inference," Proceedings of the ACM on Pro-
gramming Languages, vol. 2, no. POPL, p. 60, 2017.
[9] C. Mak, C.-H. L. Ong, H. Paquet, and D. Wagner,
"Densities of almost surely terminating probabilistic pro-
grams are differentiable almost everywhere," Program-
ming Languages and Systems, vol. 12648, p. 432, 2021.
[10] A. Radul and B. Alexeev, "The base measure problem
and its solution," in International Conference on Artificial
Intelligence and Statistics.
PMLR, 2021, pp. 3583–
3591.
[11] J. Baez and A. Hoffnung, "Convenient categories of
smooth spaces," Transactions of the American Mathe-
matical Society, vol. 363, no. 11, pp. 5789–5825, 2011.
[12] C. Heunen, O. Kammar, S. Staton, and H. Yang, "A
convenient category for higher-order probability theory,"
in 2017 32nd Annual ACM/IEEE Symposium on Logic
in Computer Science (LICS).
IEEE, 2017, pp. 1–12.
[13] S. Abramsky and G. McCusker, "Call-by-value games,"
in Computer Science Logic: 11th International Work-
shop, CSL'97 Annual Conference of the EACSL Aarhus,
Denmark, August 23–29, 1997 Selected Papers 11.
Springer, 1998, pp. 1–17.
[14] E. Moggi, "Notions of computation and monads," Infor-
mation and computation, vol. 93, no. 1, pp. 55–92, 1991.
[15] S.-y. Katsumata, "Relating computational effects by TT-
lifting," Information and Computation, vol. 222, pp. 228–
[16] B. T. Polyak, "Introduction to optimization. optimization
software," Inc., Publications Division, New York, vol. 1,
p. 32, 1987.
[17] A. Brunel, D. Mazza, and M. Pagani, "Backpropaga-
tion in the simply typed lambda-calculus with linear
the ACM on Programming
negation," Proceedings of
Languages, vol. 4, no. POPL, pp. 1–27, 2019.
[18] M. V ́ak ́ar and T. Smeding, "CHAD: Combinatory ho-
momorphic automatic differentiation," ACM Transactions
on Programming Languages and Systems (TOPLAS),
vol. 44, no. 3, pp. 1–49, 2022.
and A.
[19] M. Huot
correct,
automatic differentiation," 2022.
https://arxiv.org/abs/2212.09801
functional,
purely
Shaikhha,
efficient
"Denotationally
reverse-mode
[Online]. Available:
[20] F. Krawiec, S. P. Jones, N. Krishnaswami, T. Ellis,
R. A. Eisenberg, and A. W. Fitzgibbon, "Provably cor-
rect, asymptotically efficient, higher-order reverse-mode
automatic differentiation." Proc. ACM Program. Lang.,
vol. 6, no. POPL, pp. 1–30, 2022.
[21] A. Radul, A. Paszke, R. Frostig, M. J. Johnson, and
D. Maclaurin, "You only linearize once: Tangents trans-
pose to gradients," Proceedings of the ACM on Program-
ming Languages, vol. 7, no. POPL, pp. 1246–1274, 2023.
[22] T. J. Smeding and M. I. V ́ak ́ar, "Efficient dual-numbers
reverse ad via well-known program transformations,"
Proceedings of the ACM on Programming Languages,
vol. 7, no. POPL, pp. 1573–1600, 2023.
[23] J. R. B. Cockett and G. S. Cruttwell, "Differential struc-
ture, tangent structure, and SDG," Applied Categorical
Structures, vol. 22, no. 2, pp. 331–417, 2014.
[24] R. Cockett, G. Cruttwell, J. Gallagher, J.-S. P. Lemay,
B. MacAdam, G. Plotkin, and D. Pronk, "Reverse deriva-
tive categories," arXiv preprint arXiv:1910.07065, 2019.
[25] R. Blute, T. Ehrhard, and C. Tasson, "A convenient
differential category," arXiv preprint arXiv:1006.3140,
2010.
[26] W. Lee, X. Rival, and H. Yang, "Smoothness analysis
for probabilistic programs with application to optimised
variational inference," Proceedings of the ACM on Pro-
gramming Languages, vol. 7, no. POPL, pp. 335–366,
2023.
[27] J. Bolte and E. Pauwels, "A mathematical model for
automatic differentiation in machine learning," Advances
in Neural Information Processing Systems, vol. 33, pp.
10 809–10 819, 2020.
[28] L. Chizat and F. Bach, "On the global convergence of
gradient descent for over-parameterized models using
optimal transport," Advances in neural information pro-
cessing systems, vol. 31, 2018.
[29] T. Ehrhard, M. Pagani, and C. Tasson, "Measurable
cones and stable, measurable functions: a model for
probabilistic higher-order programming," Proceedings of
the ACM on Programming Languages, vol. 2, no. POPL,
pp. 1–28, 2017.
[46] B. Mityagin, "The zero set of a real analytic function,"
Mathematical Notes, vol. 107, no. 3, pp. 529–530, 2020.
[30] C. E. Freer and D. M. Roy, "Computable de finetti
measures," Annals of Pure and Applied Logic, vol. 163,
no. 5, pp. 530–546, 2012.
[31] A. K. Lew, M. F. Cusumano-Towner, B. Sherman,
M. Carbin, and V. K. Mansinghka, "Trace types and de-
notational semantics for sound programmable inference
in probabilistic languages," Proceedings of the ACM on
Programming Languages, vol. 4, no. POPL, pp. 1–32,
2019.
[32] M. V ́ak ́ar and L. Ong, "On s-finite measures and ker-
nels," arXiv preprint arXiv:1810.01837, 2018.
[33] A. K. Lew, M. Huot, S. Staton, and V. K. Mansinghka,
"ADEV: Sound automatic differentiation of expected
values of probabilistic programs," Proceedings of the
ACM on Programming Languages, vol. 7, no. POPL, pp.
121–153, 2023.
[34] W. Lee, H. Yu, and H. Yang, "Reparameterization gradi-
ent for non-differentiable models," in Advances in Neural
Information Processing Systems, 2018, pp. 5553–5563.
[35] C.-c. Shan and N. Ramsey, "Exact Bayesian inference by
symbolic disintegration," in Proceedings of the 44th ACM
SIGPLAN Symposium on Principles of Programming
Languages, 2017, pp. 130–144.
[36] K. Cho and B. Jacobs, "Disintegration and Bayesian
inversion via string diagrams," Mathematical Structures
in Computer Science, vol. 29, no. 7, pp. 938–971, 2019.
[37] P. Narayanan and C.-c. Shan, "Symbolic disintegration
with a variety of base measures," ACM Transactions
on Programming Languages and Systems (TOPLAS),
vol. 42, no. 2, pp. 1–60, 2020.
[38] B. Jacobs, Categorical logic and type theory. Elsevier,
1999.
[39] J. C. Mitchell and A. Scedrov, "Notes on sconing and re-
lators," in International Workshop on Computer Science
Logic. Springer, 1992, pp. 352–378.
[40] S.-y. Katsumata, "A semantic formulation of TT-lifting
and logical predicates for computational metalanguage,"
in International Workshop on Computer Science Logic.
Springer, 2005, pp. 87–102.
[41] S. MacLane and I. Moerdijk, Sheaves in geometry and
Springer
logic: A first introduction to topos theory.
Science & Business Media, 2012.
[42] A. Carboni and P. Johnstone, "Connected limits, familial
representability and Artin glueing," Mathematical Struc-
tures in Computer Science, vol. 5, no. 4, pp. 441–459,
1995.
[43] P. T. Johnstone, S. Lack, and P. Soboci ́nski, "Quasito-
poses, quasiadhesive categories and Artin glueing," in
International Conference on Algebra and Coalgebra in
Computer Science. Springer, 2007, pp. 312–326.
[44] P. T. Johnstone, Sketches of an elephant: A topos theory
compendium. Oxford University Press, 2002, vol. 2.
[45] O. Kammar and D. McDermott, "Factorisation systems
for logical relations and monadic lifting in type-and-
effect system semantics," Electronic notes in theoretical
computer science, vol. 341, pp. 239–260, 2018.
APPENDIX A
LANGUAGE
A. Type System
The type-system for the deterministic language (Section III)
is given in Figure 10.
Γ ⊢ x : τ
(x : τ ∈ Γ)
Γ, x : τ1 ⊢ t : τ2
Γ ⊢ λx : τ1.t : τ1 → τ2
Γ ⊢ c : τ
(c ∈ Cτ )
Γ ⊢ t1 : τ1 → τ2
Γ ⊢ t2 : τ1
Γ ⊢ t1t2 : τ2
Γ ⊢ t1 : τ1
Γ ⊢ t1 : τ2
Γ ⊢ ht1, t2i : τ1 × τ2
Γ ⊢ ⋆ : 1
Γ ⊢ t : τ1 × τ2
Γ, x1 : τ1, x2 : τ2 ⊢ s : τ
Γ ⊢ let hx1, x2i = t in s : τ
Γ ⊢ t1 : B
Γ ⊢ t2 : τ
Γ ⊢ if t1 then t2 else t3 : τ
Γ ⊢ t3 : τ
Γ, f : τ1 → τ2 ⊢ t : τ1 → τ2
Γ ⊢ μf : τ1 → τ2.t : τ1 → τ2
Fig. 10. Type system of the deterministic part of the language. Cτ denotes
the set of primitives of type τ .
B. Operational semantics
Values are given by the following grammar
v ::= x | c | f | λx.t | μf.t | hv1, v2i | ⋆
A big step-semantics is given in Figure 11.
c ⇓ c
t2 ⇓ λx.t
t1 ⇓ v1
t2t1 ⇓ v2
t[v1/x] ⇓ v2
∀i, ti ⇓ vi
t ⇓ f
t(t1, . . . , tn) ⇓ f (v1, . . . , vn)
t1 ⇓ true
t2 ⇓ v
if t1 then t2 else t3 ⇓ v
t1 ⇓ false
t3 ⇓ v
if t1 then t2 else t3 ⇓ v
t ⇓ hv1, v2i
t2[v1/x1, v2/x2] ⇓ v
let hx1, x2i = t in t2 ⇓ v
t[μf.t/f ] ⇓ v
μf.t ⇓ v
Fig. 11. Big step operational semantics of the deterministic part of the
language
APPENDIX B
SOUND AND ADEQUATE DENOTATION
Definition B.1 (Reproduced from [1]). A concrete category is
a category C with a terminal object 1 such that the functor
C(1, −) : C → Set is faithful.
Example B.1. Let OpenCont be the category whose objects
are open subsets U of Rn (for all n ∈ N), and whose
morphisms U → V are continuous functions. R0 is a terminal
object, and OpenCont(R0, −) simply sends an open set
to its underlying set, and sends a continuous function to its
underlying function. Therefore, OpenCont(R0, −) is faithful
and OpenCont is concrete.
Definition B.2 (Reproduced from [1]). A concrete site (C, J )
is a small concrete category C with an initial object 0, together
with a coverage J , which specifies for each object c a set J (c)
of families of maps with codomain c . We call such a family
{fi : ci → c}i∈I ∈ J (c) a covering family and say it covers
c. The coverage must satisfy the following axioms.
1) For every map h : d → c in C, if {fi : ci → c}i∈I covers
c, then there is a covering family {gj : dj → d}j∈I ′ of
d such that every h ◦ gj factors through some fi.
i∈I Im(|fi|) = |c|.
2) If {fi : ci → c}i∈I covers c, then
3) the initial object 0 is covered by the empty set.
4) The identity is always covering
5) If {fi : ci → c}i∈I ∈ J (c) and {gij : cij → ci}j∈Ji ∈
J (ci) for each i, then {fi ◦ gij : cij → c}i∈I,j∈Ji ∈
J (c).
S
Example B.2 (Cartesian spaces and smooth maps). CartSp
is a concrete site, where {fi : Ui → V }i is a covering family
i fi(Ui) = V , i.e. the images of the fi cover the codomain
if
V in the usual sense.
S
Example B.3. Similarly to CartSp, OpenCont is a con-
: Ui → V }i is a covering family if
crete site, where {fi
i fi(Ui) = V , i.e. the images of the fi cover the codomain
V in the usual sense. Its initial object is the empty set.
S
Example B.4 (Standard Borel spaces). The category Sbs has
objects the Borel subsets of R and morphisms the measurable
functions between these objects. It is a concrete site where the
coverage contains the countable sets of inclusions functions
{Ui → U }i such that U =
i Ui and the Ui are disjoint.
Definition B.3 (Reproduced from [1]). A concrete sheaf X
on a concrete site (C, J ) is a set |X|, together with, for each
object c ∈ C, a set P c
X of functions |c| → |X|, such that
S
X contains all the constant functions;
• each P c
• for any map h : d → c ∈ C, and any g ∈ P c
composite function g ◦ |h| : |d| → |X| is in P d
X ;
X , the
• for each function g : |c| → |X| and each covering family
X , then g : |c| →
{fi : ci → c}i∈I , if each g ◦ |fi| ∈ P ci
|X| ∈ P c
X.
1) Concrete sites and sheaves: Our proof of soundness and
adequacy uses reusable machinery developed by Matache et al.
[1]. Their framework requires establishing various properties;
for convenience, in this section, we reproduce the relevant
definitions, and recall the theorem that we will use.
A morphism α : X → Y between concrete sheaves is a
function α : |X| → |Y | that preserves the structure, namely if
g ∈ P c
X , then α ◦ g ∈ P c
Y .
Example B.5. Let Cont be the category defined as follows.
Its objects are pairs (X, PX ) where for each open U ⊆ Rn,
P U
X ⊆ X U is closed under the following axioms:
• Constant functions are in P U
X
X and g : V → U is continuous, then f ◦g ∈ P V
• If f ∈ P U
X
• If {Ui}i∈N is an open cover of an open U , and for all i,
fi ∈ P Ui
X , such that for all i, j ∈ N2, fi and fj agree on
Ui ∩ Uj, then f : U → X defined by x ∈ Ui 7→ fi(x), is
an element of P U
X .
Its morphisms X → Y are functions α : X → Y such that
α ◦ f ∈ P U
X . Then, Cont is a category of
concrete sheaves on the concrete site OpenCont.
Y whenever f ∈ P U
Example B.6. Diffeological spaces and Quasi-Borel spaces
are examples of categories of concrete sheaves and morphisms
between concrete sheaves. Other examples are given in Baez
and Hoffnung [11].
sheaves: To
2) ω-Concrete
the
concrete-sheaf structure will not be sufficient
in general.
Instead of evoking what is to my knowledge the yet-to-be-
formalised theory of enriched sheaves over the category of
ωcpo's, we continue with the setting from Matache et al. [1].
recursion,
interpret
Definition B.4 (Reproduced from [1]). An ω-concrete sheaf on
a site (C, J ) is a concrete sheaf X together with an ordering
≤X on |X| that equips X with the structure ofωcpo, such that
each P c
X is closed under pointwise suprema of chains with
respect to the pointwise ordering. A morphism α : X → Y of
ω-concrete sheaves is a continuous function between ωcpo's,
α : |X| → |Y |, that is also a morphism of concrete sheaves.
ω-concrete sheaves form a category ωConc(C, J ), which
is a Cartesian-closed category with binary coproducts [1].
Example B.7. The category of ω-diffeological spaces [4] and
of ω-Quasi-Borel spaces [2] are examples of categories of
ω-concrete sheaves.
3) Partiality: admissible monos and a partiality monad: To
model recursion, we first need to define a (strong) partiality
monad L on ωConc(C, J ). There are many choices for
the lifting of the plots, so we parametrize the definition of
partiality monad by a class M of monomorphisms from the
site (C, J ), which we call admissible monos.
Recall that, in any category, monos with the same codomain
are preordered. If m1 : d1 c, m2 : d2 → c then m1 ≤ m2
iff there exists f : d1 → d2 such that m2 ◦ f = m1
We write Sub(c) for the poset quotient of the set of monos
with codomain c. For any class M of monos, we write
SubM(c) for the full subposet of Sub(c) whose elements have
representatives in M.
Definition B.5 (Reproduced from [1]). A class M of admis-
sible monos for a concrete site (C, J ) consists of, for each
object c ∈ C, a set of monos M(c) with codomain c satisfying
the following conditions
1) For all c ∈ C, 0 → c ∈ M(c)
2) M contains all isomorphisms
3) M is closed under composition
4) All pullbacks of M-maps exist and are again in M (This
makes SubM a functor Cop → Set).
5) For each c, the function SubM(c) → Set(|c|, {0, 1})
is componentwise injective and order-reflecting, and the
image of SubM is closed under suprema of ω-chains
6) Given an increasing chain in SubM(c), (cn c)n∈N,
denote its least upper bound by c∞ c. Then the
closure under precomposition (with any morphism) of
the set {cn c∞}n∈N contains a covering family of
c∞.
Now, given a class M of admissible monos, we can define
a partiality monad LM on the category of ω-concrete sheaves:
Definition B.6 (Reproduced from [1]). We define the strong
partiality monad LM associated to the class of admissible
monos M as
• |LMX| = |X| ⊔ {⊥}
• ∀x ∈ |X|, ⊥ ≤LMX x
• ∀x, x′ ∈ |X|, x ≤LMX x′ iff x ≤X x′
• P c
|c| → |X| ⊔ {⊥} | ∃c′ c ∈
LMX = {g :
M(c) s.t. g−1(|X|) = Im(|c′|) and g|Im(|c′|) ∈ P c′
X }
The strong monad structure is exactly the same as the maybe
monad on Set.
Proposition B.1 ([1]). LM : ωConc(C, J ) → ωConc(C, J )
is a strong monad.
4) Soundness and adequacy: Matache et al. [1] defined a
language PCFv, a call-by-value variant of PCF. It has product,
sum types, and a recursion operator similar to ours, and
is presented as a fine-grained call-by-value language. This
language is essentially equivalent to our language, except
that we have extra base types real and B, and more basic
primitives involving these types. Our conditional is definable
using their sum types. They give their language a standard
call-by-value operational semantics, which translates directly
to an operational semantics for our language. In summary, even
though their theorem is stated for PCFv, it directly applies to
our language, without needing further changes or extra proofs,
as long as we also interpret our base types and primitives in
the model, as in standard [14].
Theorem B.2 ([1]). A concrete site with a class of admissible
monos, (C, J , M), is a sound and adequate model of PCFv
in ωConc(C, J ).
Having recalled the general setting of ω-concrete sheaves,
we now show how ωPAP is an instance of this general
construction. To do so, we will show define the category
cP AP and show it is a concrete-site (which is the one for
ωPAP) in Section B-6. We will define a set of admissible
monos for cP AP in Section B-7. In order to achieve this, we
will need a key technical proposition (Proposition B.4) and a
few other technical lemmas, proved in Section B-5.
5) C-analytic sets: The definition of c-analytic sets does
not require that the analytic sets that make up a c-analytic
set be disjoint. Still, it turns out that it is always possible to
partition a c-analytic set into countably many pairwise disjoint
analytic sets.
Lemma B.3. Definition II.2 of analytic sets is equivalent to
the following definition from Lee et al. [34].
A ⊆ Rn is an analytic set if there exists finite collections
: U +
j }j∈J of analytic functions
: U −
i → R}i∈I and {g+
{g−
i
on open domains, such that
j
A =
x ∈
(cid:8)
(cid:0)
∩i∈I U −
i
∩
∩j∈J U +
j
(cid:0)
(cid:1)
∀j ∈ J.g+
j (x) > 0
| ∀i ∈ I.g−
i (x) ≤ 0,
(cid:1)
(cid:9)
Proof.
• U :=
is a finite
intersection of open sets and is open, and we can restrict
(cid:1)
each analytic function to U .
∩j∈J U +
j
∩i∈I U −
i
∩
(cid:0)
(cid:0)
(cid:1)
• Given g : U → R, the inequality g(x) > 0 can be
changed to the inequality f (x) ≤ 0 where f : V → R
defined by f (x) = −g(x), and V := U ∩ {x ∈
U | g(x) 6= 0} is open.
We use Lee et al. [34]'s definition in the rest of the appendix.
Proposition B.4. For any c-analytic set A, there exists a
countable collection of pairwise disjoint analytic sets {Bi}i∈N
such that A = ∪i∈NBi.
This is an important property, and most of this section is
devoted to proving the proposition.
Let {Ai}i∈N be a countable set of analytic subsets of Rn.
Each analytic set Ai is associated with an open domain Ui
and a finite number Ji of analytic functions {fij}j∈[1,...,Ji],
so that Ai = {x ∈ Ui | ∀j.fij ≤ 0}. Because any open set is a
countable union of open balls in Rn, we can assume without
loss of generality that the Ui are open balls.
Definition B.7. A simple analytic set is a set A = {x ∈
Bǫ(x0) | ∀i ≤ I.g+
i (x) > 0 ∧ ∀j ≤ J.g−
i (x) ≤ 0}, for natural
numbers I and J and some 0 < ǫ ≤ ∞ and x0 ∈ Rn.
Lemma B.5. The complement of any simple analytic set is a
finite union of pairwise disjoint simple analytic sets.
Proof. A point x can fail to be in a simple analytic set A for
I + J + 1 mutually exclusive reasons, each of which applies
to a simple analytic set of points:
1) If ǫ < ∞, it can fail to lie in Bǫ(x0). The set of points
1 (x) = ǫ − ||x −
outside Bǫ(x0) is simple analytic: let h−
x0||2 and consider {x ∈ Rn | h−
1 (x) ≤ 0}.
2) (For each 1 ≤ i ≤ I.) It can lie within Bǫ(x0), and
n (x) > 0 for all n < i, but fail to satisfy
n (x) for n < i, and
i (x). Then the set of all such points is
satisfy g+
g+
i (x) > 0. Let h+
h−
1 (x) = g+
{x ∈ Bǫ(x0) | ∀n < i.h+
n (x) > 0 ∧ h−
n (x) = g+
1 (x) ≤ 0}.
i (x) > 0 for all i ≤ I, and satisfy g−
3) (For each 1 ≤ j ≤ J.) It can lie within Bǫ(x0), and
n (x) ≤ 0
j (x) ≤ 0. Let h+
i (x) =
n (x) for all n < j, and
j (x). Then the set of all points to which
satisfy g+
for all n < j, but fail to satisfy g−
g+
n (x) = g−
i (x) for all i ≤ I, h−
I+1(x) = g−
h+
this reason applies is {x ∈ Bǫ(x0) | ∀i ≤ I +1.h+
0 ∧ ∀n < j.h−
n (x) ≤ 0}.
i (x) >
The union of these simple analytic sets is the complement
of A.
Corollary B.6. If A1, . . . , An are simple analytic sets, then
∪i≤nAi is a finite union of disjoint analytic sets.
Proof. We have ∪Ai = ∩Ai = ∩(∪m≤Mi Bim), where
{Bim}m≤Miis a representation of Ai's complement as a dis-
joint union of finitely many simple analytic sets. Distributing,
this is in turn equal to ∪m1≤M1 * * * ∪mn≤Mn (∩i≤nBimi ).
Each element of this large union is analytic, because it is the
intersection of n analytic sets. Furthermore, these analytic sets
are pairwise disjoint: any pair will disagree on mi for some
i, and so the intersection will include disjoint sets Bimi and
i. Because these two sets are disjoint, the
Bim′
overall intersections will be disjoint.
, for mi 6= m′
i
Corollary B.7. If A1, . . . , An are simple analytic sets, then
An \ ∪i<nAi is a finite union of disjoint analytic sets, each
of which is a finite intersection of simple analytic sets.
Proof. An \ ∪i<nAi = An ∩ (∪i<nAi), and by the previous
corollary, the right-hand term can be rewritten as a finite union
of disjoint analytic sets ∪i<mBi. The intersection is then equal
to ∪i<mAn ∩ Bi. Each element of this finite union is analytic
because analytic sets are closed under intersection. They are
also disjoint since the Bi are disjoint.
Lemma B.8. Let A = ∪n∈NAn be a countable union of simple
analytic sets An. Then there are countably many pairwise
disjoint analytic sets {Bm}m∈N such that A = ∪m∈NBm.
Proof. Consider the countably many disjoint sets A′
(∪i<kAi). Each A′
union of pairwise disjoint sets, by the previous corollary.
k = Ak \
k can itself be expressed as a countable
Corollary B.9. Every c-analytic set A can be written as a
countable disjoint union of analytic sets.
Proof. Any open domain U can be expressed as a countable
in a countable union of
union of open balls. Therefore,
arbitrary analytic sets, any analytic set A with a complicated
open domain U can be replaced by countably many analytic
sets with open-ball domains (and the same defining inequal-
ities as A). We conclude with Lemma B.8, using the fact
that a countable family of countable families is a countable
family.
Next, we show a corollary that will be useful in the next
section.
Corollary B.10. An inclusion U ⊆ V of c-analytic sets U, V
is a PAP function U → V .
Proof. By Corollary B.9, we can write U =
i∈N Ai and
j∈N Bj where the Ai and Bj are analytic sets. Analytic
V =
sets are closed under intersection, so {Ai ∩ Bj}i∈N,j∈N is a
countable partition of U into analytic sets. Hence, {(Ai ∩
F
F
Bj, id)}i∈N,j∈N is a piecewise representation of the inclusion
U V .
Finally, we show a few closure properties of c-analytic sets.
Lemma B.11. If f : U → V is analytic and A ⊆ V is
analytic, then f −1(A) is analytic.
Proof. By definition, A = {x ∈ (
∀i.g+
i , g−
g+
i (x) > 0 ∧ ∀j.g−
j . Thus,
i X +
j ) |
j (x) ≤ 0} for some analytic functions
i ) ∩ (
j X −
T
T
f −1(A)
(
\i
= {x ∈ f −1
X +
i ) ∩ (
X −
j )
|
\j
(cid:16)
i (f (x)) > 0 ∧ ∀j.g−
∀i.g+
f −1(X +
i ) ∩ (
j (f (x)) ≤ 0}
j )) |
f −1(X −
(cid:17)
= {x ∈ (
\i
∀i.(g+
\j
i ◦ f )(x) > 0 ∧ ∀j.(g−
As f is analytic, it is continuous and so the sets f −1(X +
i )
and f −1(X −
j ) are open. And again, as f is analytic, so are
the functions g+
j ◦ f )(x) ≤ 0}
i ◦ f and g−
j ◦ f .
Corollary B.12. If f : U → V is PAP and A ⊆ V is c-
analytic, then f −1(A) is c-analytic.
Proof. By Corollary B.9, we can write A =
for analytic sets Ai. Thus, f −1(A) = f −1(
i∈N Ai
i∈N Ai) =
i∈N f −1(Ai) and it is sufficient to show that each f −1(Ai)
F
F
is c-analytic.
F
f is PAP so there exists a partition U =
i∈N Bi where
Bi are analytic sets and analytic functions fi : Ui → Rn such
F
i∈N f −1
that f |Bi = fi. Therefore, f −1(A) =
(A)∩Bi. Each
f −1
(A) is analytic by Lemma B.11, and so each f −1
(A) ∩ Bi
i
is analytic. This means f −1(A) is indeed c-analytic.
F
i
i
6) Category cPAP:
Definition B.8 (cPAP). We call cPAP the category whose
objects are c-analytic sets and whose morphisms are PAP
functions between them. Composition is given by the usual
composition of functions.
Lemma B.13. cPAP is a concrete category.
Proof.
• cPAP has a terminal object. The analytic set R0
is terminal.
• The functor hom(1, −) : cP AP → Set is faithful. The
functor is the identity on morphisms.
Proposition B.14. cPAP is a concrete site, where the cover-
ings for a c-analytic set U are given by countable c-analytic
partitions of U , i.e., {(Ui)i | ∪iUi = U ∧∀i 6= j, Ui∩Uj = ∅}.
Proof. First, note that our definition for the coverings is a well-
defined, as inclusions are PAP functions by Corollary B.10.
We now show that the given coverings satisfy the 5 axioms
of a concrete site.
1) Suppose we have a cPAP morphism g : C → D, and
a c-analytic partition {Di}i∈I of D. Then we wish to
find a partition of C so that g can be represented as a
piecewise gluing of functions with codomains Di. First,
note that since they are objects of cPAP, each Di can be
further partitioned into countably many distinct analytic
subsets {Dij}j∈Ji, Dij ⊆ Di. Furthermore, because g is
a morphism, it has a PAP representation {(Ck, gk)}k∈K
for analytic subsets Ck ⊆ C and analytic functions gk.
For each i, j, k define Cijk = {c ∈ Ck | gk(c) ∈ Dij}:
since gk is an analytic function and Dij is an analytic
set, Cijk is analytic. Define g∗
ijk to be the restriction
of gk to Cijk. Then {(Cijk, g∗
ijk)}i∈I,j∈Ji,k∈K is a
piecewise representation of g in which each piece's
codomain is Di for some i.
2) Let {fi
: ci → c}i∈I be a covering of c. Then
i∈I Im(|fi|) = |c|. This follows from the definition
of partition.
S
3) The initial object 0 is covered by the empty set.
4) The identity is always covering.
5) Let {fi : ci → c}i∈I be a covering of c and {gij : cij →
ci}j∈Ji be a cover of ci for each i. Then {fi ◦ gij :
cij → c}i∈I,j∈Ji ∈ J (c). This also follows from the
definition of partition, and the fact that a countable union
of countable sets is countable.
Lemma B.15. cPAP is a subcanonical site.
Proof. Let X be a representable presheaf on cPAP. Then,
up to natural isomorphism, X maps a c-analytic set A to
cPAP(A, B) for some fixed c-analytic set B. Consider a
covering family {(Ai)}i∈I for A, and a compatible collection
of plots φi ∈ X(Ai), which can be identified (via the natural
isomorphism) with cPAP morphisms φi
: Ai → B. Then
we must show that there is a unique φ ∈ X(A) whose
restriction to each Ai is φi. To see this, note that each φi
has a PAP representation {(Aij , φij )}j∈Ji. By the definition
of a covering family on cPAP, the Ai are disjoint, and so
is a PAP representation; the φ we are
{(Aij, φij )}i∈I,j∈Ji
looking for is the function it represents.
7) Admissible monos for cPAP: As an admissible set of
monos, we choose those given by the monos defined on an
c-analytic subset of their domain of definition. More formally,
we define MP AP for cPAP as follows:
MP AP (B) = {m : A B | A ∼= A′, A′ is a
c-analytic subset of B}
Proposition B.16. MP AP is an admissible class of monos.
Proof.
1) For all c ∈ C, 0 → c ∈ MP AP (c): the empty-set
is c-analytic.
2) MP AP contains all isomorphisms: clear.
3) MP AP is closed under composition: clear.
4) All pullbacks of MP AP -maps exist and are again in
MP AP : this amounts to showing that the preimage B :=
f −1(A) for a PAP function f and a c-analytic set A is
c-analytic. This is true by Corollary B.12.
S
5) For each c, the function SubM(c) → Set(|c|, {0, 1})
is componentwise injective and order-reflecting, and
the image of SubM is closed under suprema of ω-
chains: the function is the identity on sets, and is thus
injective and order-reflecting. Given an omega chain
{Ai ⊆ B}i∈N, we have i < j ⇒ Ai ⊆ Aj . Let
i∈N Ai ⊆ B. It is a countable union of c-analytic
A :=
sets and is thus a c-analytic set.
6) Given an increasing chain in SubM(c), (cn c)n∈N,
denote its least upper bound by c∞ c. Then the
closure under precomposition (with any morphism) of
the set (cn c∞)n∈N contains a covering family of
c∞: as shown in the previous point, c∞ is c-analytic
i∈N Ai where the Ai are
and by Corollary B.9, c∞ =
analytic sets. Note that the intersection of two analytic
sets is an analytic set, and therefore the intersection of
a c-analytic set with an analytic set is c-analytic. Thus,
(cn ∩ Ai c∞)n∈N,i∈N is a covering family of c∞
that is contained in the closure by precomposition of
(cn c∞)n∈N.
F
A. Soundness and adequacy
We can now prove Theorem II.2:
Theorem B.17. ωPAP has products, coproducts, exponentials
and L : ωPAP → ωPAP is a strong lifting monad.
Proof. It follows directly from the fact that we have seen that
ωPAP is a category of ω-concrete sheaves for the concrete
site cP AP (Proposition B.14), and L is obtained from an
admissible class of monos on cP AP (Propositions B.16 and
B.1), by Proposition 7.5 in Matache et al. [1].
Proof of Theorem II.2. We apply theorem B.2 to the con-
crete site (P AP, JP AP , MP AP ) with the admissible class of
monos MP AP .
APPENDIX C
CORRECTNESS OF AD
A. Fibrations for logical relations
Roughly, fibrations offer a useful and unifying point of
view for reasoning about generalized predicates on a category.
Indeed, the functor p : Gl → C from a glueing/sconing
category [39] to the base category is an example of nice
fibration. This justifies to study a categorical version of logical
relations using fibrations. We follow closely this point of view
developed in [15, 40].
1) Fibrations: We recall some basic facts from the theory
of fibrations [38].
Definition C.1 (Reproduced from [38]). Let p : E → B be
a functor. A morphism f : X → Y ∈ E is Cartesian over
u : I → J ∈ B if pf = u and every g : Z → Y ∈ E for
which pg = u ◦ w for some w : pZ → I, there is a unique
h : Z → X ∈ E above w with f ◦ h = g.
Definition C.2 (Reproduced from [38]). A fibration is a func-
tor p : E → B such that for every Y ∈ E and u : I → pY ∈ B,
there is a Cartesian morphism f : X → Y ∈ E above u. It is
also called fibred category or category (fibred) over B.
Example C.1. Let Pred be the category whose objects are
pairs (X, S) of a set X and a subset S ⊆ X, and morphisms
(X, S) → (Y, T ) are functions f : X → Y such that f (S) ⊆
T . Let p : Pred → Set be the functor that forgets the subsets
S. It is a fibration.
Proposition C.1. (Change-of-base, [38]) Let p : B → B be a
fibration and K : A → B be a functor. Form the pullback in
Cat:
A ×B E
❴
K ∗(p)
A
K
E
p
/ B
In this situation, the functor K ∗(p) is also a fibration.
Example C.2. Consider the functor K : Set × Set → Set
that sends a pair of sets to their product. In this case,
BRel
❴
K ∗(p)
Set × Set
K
Pred
p
/ Set
The main goal of this section is to show Theorem III.2. To
do so, we apply the categorical machinery of fibrations for
logical relations developed in [15]. They build on the well-
known theory of fibrations [38]. As we follow their recipe
closely, we recall the minimal amount of fibration theory in
Section C-A needed to understand their machinery, which
we also reproduce in Section C-A2 for convenience. We
finally use the machinery of fibrations for logical relations
in Section C-B to prove Theorem III.2, our correctness result
on AD.
BRel is a category of
functions that preserve a binary
relation. An object in BRel is a binary relation S ⊆ X × Y ,
and a morphism S ⊆ X × Y → R ⊆ X2 × Y2 is a function
f : X×Y → X2×Y2 such that for all (x, y) ∈ S, f (x, y) ∈ R.
Proposition C.2. (Composition, [38]) Let p : E → B and
r : B → A be fibrations. Then rp : E → A is also a fibration,
in which f ∈ E is a Cartesian morphism iff f is a Cartesian
morphism for p and p(f ) is is a Cartesian morphism for r.
For each I ∈ A one obtains a fibration pI
(rp)−1(I) → BI = r−1(I) by restriction.
: EI =
✤
/
/
(cid:15)
(cid:15)
(cid:15)
(cid:15)
/
✤
/
/
(cid:15)
(cid:15)
(cid:15)
(cid:15)
/
Definition C.3 (Reproduced from [38]). Given a fibration p :
E → B, the fibre category over I ∈ B is the subcategory EI
of E whose objects are above I and morphisms above idI .
Definition C.4. p : E → B is an opfibration if pop : Eop → Bop
is a fibration.
Example C.3. p : Pred → Set is an opfibration.
2) Fibrations for logical relations for effectful languages:
We now recall the setting of fibrations for logical relations
from [15].
Definition C.5 (Reproduced from [15]). A partial order
bifibration with fibrewise small products is a faithful functor
p : E → B such that
• p is a fibration
• p is an opfibration
• each fibre category is a partial order
• each fibre category has small products, and the inverse
image functors (necessarily) preserve them
Definition C.6. A fibration for logical relations over a bi-CCC
B is a partial order bifibration p : E → B with fibrewise small
products such that E is a bi-CCC and p strictly preserves the
bicartesian-closed structure.
Proposition C.3 ([15]). The pullback of a fibration for logical
relations along a finite product preserving functor is a fibration
for logical relations.
In particular, the usual subscone fibration is recovered as a
change of base along the functor B(1, −) : B → Set.
Definition C.7 (Reproduced from [15]). Let p : E → B be
a functor. Given X, Y ∈ E, and f : pX → pY , we write
*
f : X *→ Y to denote the following proposition: ∃
f : X →
Y.p(
*
f ) = f . We say that f has a lift (in E).
The setting of Katsumata [15] works for fairly general
languages with effects. One way to describe them is in terms
of algebraic operations, or equivalently in terms of generic
effects.
Definition C.8 (Reproduced from [15]). Let C be a category
and T a strong monad on it. Given objects C, D f C, a (D, C)
algebraic operation or generic effect for is a morphism C →
T D.
A lambda-calculus with effect is parametrized by a set of
base types and (effectful) primitives, each having an arity and
coarity, describing the number and types of arguments and
return values. This is encapsulated as a signature:
Definition C.9 (Reproduced from [15]). A λc-signature Σ is
a tuple (B, K, O, ar, car : K
O → GT ype(B)) where B is
a set of base types, K a set of effect-free constants, O a set of
S
algebraic operations, and GT ype(B) the set of ground types
on B. ar, car are the arity and co-arity functions.
Definition C.10 (Reproduced from [15]). Let Σ be a signa-
ture. A λc(Σ)-structure is a tuple A = (B, T, A, a) where B
is a bi-CCC, T a strong monad on B, A a functor B → B.
In other words, a λc(Σ)-structure gives an interpretation of
the base types and primitives of the language. Note that we
can always extend A to a structure preserving functor AJ−K :
Gtype(B) → B.
We now recall the main theorems from [15]:
Definition C.11 (Reproduced from [15]). A property over a
λc(Σ)-structure A is a pair (V, C) of functors V, C : B → E
such that p ◦ V = A and p ◦ C = T ◦ A
That is, a property is the choice for any base type b ∈ B
of a predicate V b in the category of predicates E over values
of type b, and of a predicate Cb over computations T (Ab) of
type b. The question of interest is then whether all programs
preserve the property, which is answered with the following
theorem.
Theorem C.4 (Logical relations, [15]). Let Σ be a signature,
A = (B, T, A, a) be an λc(Σ)-structure, p : E → B be a
fibration for logical relations and (V, C) be a property over
A. If the property satisfies the following conditions
• for all b ∈ B, return has a lift
• for all k ∈ K, AJkK has a lift
• for all o ∈ O, JoK has a lift
then for all well-typed terms x1 : b1, . . . , xn : bn ⊢ t : b, AJtK
lifts to the total category.
3) Fibrations for logical relations for effectful languages
with recursion: So far, we have reviewed the way to use fibra-
tions for logical relations for higher-order effectful languages,
but not for languages with recursion. We review this next.
Definition C.12 (Reproduced from [15]). An ωcpo-enriched
bi-CCC is a bi-CCC C such that each homset is an ωcpo,
and the composition, tupling (−, −), cotupling [−, −] and
currying λ(−) of the bi-CC structure on C are all monotone
and continuous.
Definition C.13 (Reproduced from [15]). A pseudo-lifting
monad on an ωcpo-enriched bi-CC category B is a monad
on the underlying non-enriched category such that it has
its component at I,
an algebraic operation bt such that
btI : 1 → T I, is the least morphism.
Definition C.14 (Reproduced from [15]). An ωcpo-enriched
λc(Σ)-structure is a tuple (B, T, A, a) such that B is an ωcpo-
enriched bi-CCC, T is a pseudo-lifting monad over B and
(B, T, A, a) is a λc(Σ)-structure.
Definition C.15 (Reproduced from [15]). We call X ∈ E
above T I ∈ B admissible if
• ⊥pX : 1 *→ X
• for all Y ∈ E and ω-chain fi ∈ B(pY, pX) such that
fi : Y *→ X, we have
∞
i=0 fi : Y *→ X.
Theorem C.5 (Logical relations for language with recursion,
[15]). Let Σ be a signature, A = (B, T, A, a) an ωcpo-
enriched λc(Σ)-structure, p : E → B a fibration for logical
F
relations and (V, C) be a property over A. If the property
satisfies
are natural transformations F → F ′
subsheaves.
that restrict
to the
• the conditions of Theorem C.4
• for all b ∈ B, Cb is admissible
Then for all well-typed terms of the language with iteration,
x1 : b1, . . . , xn : bn ⊢ t : b we have AJtK :
*→ Cb.
i V bi
B. Correctness of AD
Q
We will show correctness of AD (Theorem III.4) via the the-
ory of fibrations for logical relations. The goal is to construct
a category of predicates on ωPAP and to encode correctness
of AD as a predicate preservation property. To construct such
a fibrations for logical relations, we obtain one by pulling
back another one along a product preserving functor. There
are several possibilities that give us different sort of predicates
on ωPAP spaces. One constraint is that we need to be able
to interpret our choice of logical predicate for AD as such
a predicate, and make sure all of our constants are predicate
preserving. This is in particular non-trivial when dealing with
constants involving coproducts, such as <: real × real → B
as the booleans are interpreted as the coproduct 1 + 1. Lastly,
we need to make sure that our choice of predicate for base
types is closed under lubs of ω-chains.
We organize this section as follows. First, we construct
a suitable category of predicates on ωPAP × ωPAP (i.e. a
fibration for logical relations). Second, we construct a property
(Definition C.11) on this category of predicates. Note that
the fact that derivatives are not unique any more is what
will make this logical relation more complex. Lastly, we will
show the correctness of AD by combining these elements and
Theorem C.5.
1) A fibration for logical relations on ωPAP × ωPAP:
Definition C.16. We define the category Inj, a subcategory
of cP AP , whose objects are c-analytic sets and morphisms
are PAP injections.
Lemma C.6. Inj is a site, with coverage J where coverings
are given as in cPAP.
Proof. The proof for the case of cPAP carries through to this
restricted setting.
Definition C.17. We define Sh(Inj) to be the category of
sheaves on the site Inj.
Lemma C.7. Sh(Inj) is a Grothendieck topos, and in par-
ticular it is Cartesian-closed, complete and co-complete.
Proof. This is standard sheaf theory, see e.g. MacLane and
Moerdijk [41].
By a subsheaf P of F , we mean a sheaf F such that for all
c-analytic set A, P (A) ⊆ F (A), and P (f ) is the restriction
of F (f ) for all morphisms f .
Definition C.18. We denote by Sub(Sh(Inj)) the category
whose objects are pairs of sheaves (P, F ) of Sh(Inj), where
P is a subsheaf of F , and morphisms (P, F ) → (P ′, F ′)
Lemma C.8. The second projection (P, F )
7→ F is a
fibrations for logical relations p : Sub(Sh(Inj)) → Sh(Inj).
Proof. As Sh(Inj) has pullbacks, it is a fibration. It is clearly
faithful. By the theory of glueing ([39, 42, 43, 44]), as
Sub(Sh(Inj)) is a CCC and has an epi-mono factorisation
system, Sub(Sh(Inj)) is a CCC, has finite colimits, and p
preserves the CCC-structure. In addition, each fibre category
is a partial order and has small products. It remains to show
that cod is an opfibration and that p preserves coproducts.
By Lemma 4.6 in Kammar and McDermott [45], it suffices
to show that monos are closed under coproducts, as we
already have the other conditions for having a factorization
system for logical relations. The arrow category on Sh(Inj)
is cocomplete, as Sh(Inj) is (it is a topos). As Sh(Inj) is a
topos, it has a epi-mono factorization system, and therefore it
has image factorization. Therefore, the category of monos is
a reflective subcategory of the arrow category. As such, it is
cocomplete, and in particular it has coproducts. So monos are
closed under coproducts, and we conclude by Lemma 4.6 in
Kammar and McDermott [45], as said above.
Q
We now define the functor F : ωPAP × ωPAP →
Sub(Sh(Inj)) given by F (X, Y ) = X ×
i∈N Y , where
i∈N Y forgets that it is an ω-concrete sheaf on the site
X ×
cP AP , and only remembers that it is in particular a sheaf on
the site Inj. It is a product preserving functor, and therefore,
by Proposition C.3, the pullback of p : Sub(Sh(Inj)) →
Sub(Sh(Inj)) along F is a fibration for logical relations. We
denote this pullback by π : Gl :→ ωPAP × ωPAP.
Q
Remark C.1. Before moving on, let us say a few words on
this category of predicates Gl. One reason why we defined
the category of sheaves Sub(Sh(Inj)) is that the property
we will define for the correctness of AD will not be a concrete
subsheaf, and this excludes directly using subobjects on ωPAP
as the fibration for logical relations of interest. Secondly, the
base type B is interpreted as a coproduct, and if we simply
choose the category of presheaves on Inj, primitives like >
will not lift, for a similar reason to the one presented in
V ́ak ́ar [4]. We could have chosen sheaves on cP AP instead.
This would not change much, but this is a bit overkill for
our purpose and simply adds some unnecessary complexity.
Thirdly, we do seem to need to have the property indexed
by all c-analytic sets A. One reason is that the fact that we
have partial functions forces the definition of a lift for LR, as
well as for R. A second reason is that the non-uniqueness of
intentional derivatives creates a technical complication: being
a correct intentional derivative at a point is essentially non-
informative, so we cannot use the same trick as we did in the
smooth case. That is, the problem is that the input space R is
smaller than Rn, and the quantification only shows that h is
'correct' on a set of at most the size of R inside Rn, which
is Lebesgue-negligible. This problem disappears when we can
show that h is correct on each open of an open cover of its
domain.
2) A property for the correctness of AD:
Definition C.19. Let f : A ⊆ Rn → R a PAP function.
Given any intentional derivative g : A → Rn of f , we call
πi ◦ g : A → R an i-th partial intentional derivative of f .
We write hoti for the vector in Rn that consist only of zeros,
except it has a single 1 at the i-th position. Given any dual-
number intentional representation g : A × Rn → R2 of f ,
define the PAP function gi : A → R2 given by
gi(x) = g(x, hoti)
is called an i-th partial dual-number intentional repre-
gi
sentation of f , and its second component is an i-th partial
intentional derivative of f . We write ∂i
DN Rf for the set of
i-th partial dual-number intentional representations of f .
We extend the definition of ∂i
i by setting ∂i
Definition C.20. Let V (R) := (R,
each c-analytic set A, we have
DN Rf = {λx.0} for any i > n.
i∈N R× R, VR) where for
Q
DN Rf to all natural numbers
VR(A) = {(f : A → R, (gi : A → R2)i∈N) |
f, g PAP, and gi ∈ ∂i
DN Rf }
Likewise, let C(R) := (LR, L(
each c-analytic set A, we have
Q
i∈N R × R), CR) where for
CR(A) = {(f : A → LR, g : A → L(
R × R)) |
Dom(f ) = Dom(g) and
Yi∈N
Let V (B) = (B,
A, we have
∀i.(
f , ^Lπi ◦ g) ∈ VR(Dom(f ))}
i∈N B, VB) where for each c-analytic set
e
Q
VB(A) = {f : A → B, g : A →
B | ∀i, πi ◦ g = f }
equalizer of B ×
canonical map VB B ×
Q
i∈N B, which exists in any topos and the
i∈N B is a mono.
Let us now look a bit more into what morphisms preserving
Q
the property look like.
Definition C.21. Let V (Rk) := (Rk, (
where for each c-analytic set A, we have
Q
i∈N R × R)k, VRk )
VRk (A) = {(f : A → Rk, g : A → (
R × R)k) |
∀1 ≤ j ≤ k, (πjf, πjg) ∈ VR(A)}
Yi∈N
Let f : Rn → LR represent a PAP function. We define V (f )
i∈N R × R)k →
i∈N R × R) is ωPAP, and such that for any c-analytic set
to be pairs of functions (f, h), where h : (
L(
A, and any (g1, g2) ∈ VRk (A), (f ◦ g1, h ◦ g2) ∈ CR(A).
Q
Q
This means that given a PAP functions g1, . . . , gn : A →
R, h will send i-th partial
intentional representations of
each of the gi to i-th partial intentional representations of
f ◦ hg1, . . . , gni. Note that if A ⊆ Rk, this will be trivially
satisfied for any i > k.
Let us now see how we will interpret and a lift primitive
t : real2 → real of our language. This interpretation will only
be required for the correctness proof. We set JtKωPAP×ωPAP =
i∈NJD(t)K). In other words, we make countably many
(JtK,
copies of the semantics of the AD-translation of t. We can
now more generally show that every primitive of the language,
whose semantics is interpreted in ωPAP × ωPAP following the
example above, will lift to Gl.
Q
Lemma C.10. Every primitive of the language has a lift in
Gl.
Finally, to satisfy the conditions of Theorem C.5, we need
to show that for each base B, C(B) is admissible.
Lemma C.11. C(B) and C(R) are admissible.
Yi∈N
3) Correctness of AD:
i∈N B), CB) where for each c-
Lemma C.12. ωPAP is an ωcpo-enriched bi-CCC.
Let C(B) = (LB, L(
analytic set A, we have
Q
CB(A) = {(f : A → LB, g : A → L(
B)) |
Yi∈N
Dom(f ) = Dom(g) and
∀i.(
f , ^Lπi ◦ g) ∈ VB(Dom(f ))}
Lemma C.9. We have defined a property for our language.
e
Q
Q
i∈N R2, B ×
i∈N R2, LR × L
Proof. The only thing to show is that VR, CR, VB, CB are sub-
i∈N B, LB ×
sheaves of R ×
i∈N B respectively. It is immediate for the C's once we
L
Q
have shown the result for the V 's. For VR, it amounts to
showing two things. First, whether partial intentional deriva-
tives restrict to a subset of the domain of a function, which is
evidently true. Second, whether partial intentional derivatives
glue if they agree on their intersection, which as for usual
derivatives, is true as well. For VB, it is immediate as it is an
Q
Proof. Each homset
is an ωcpo by forgetting the PAP-
structure. For composition and coproducts, it is immediate as
lubs are taken point-wise. For products, if f =
i fi and
i(fi, gi). Finally,
g =
W
if fi : X × Y → Z, for currying we have (
fi)(x, y) =
λ(fi)(x)(y). As lubs are taken pointwise,
λ(fi)(x))(y). This means that
i gi, then (f, g) = (
λ(fi)(x)(y) = (
fi(x, y) =
i gi) =
i fi,
W
W
W
W
W
W
λ(fi). The monotonicity part is similar.
W
we have
W
λ(
fi) =
W
W
In summary, it follows from the fact that the forgetful func-
W
tor ωPAP → ωCPO preserves and reflects limits, coproducts,
exponentials, and the ωcpo-structure.
Lemma C.13. Let f : A ⊆ Rn → R be PAP. Then h :
A × Rn → R2 is a dual-number representation of f iff for all
natural number i, h(x, hoti) is an i-th partial dual number
representation of f .
Theorem C.14. For any x1 : real, . . . , xn : real ⊢ t : real,
JtKωPAP×ωPAP has a lift.
APPENDIX D
FAILURE AND CONVERGENCE OF GRADIENT DESCENT
Proof. We have done all the work in the previous subsections.
We simply check the condition to apply Theorem C.5.
First, note that we indeed have a semantics in ωPAP×ωPAP,
i∈NJD(t)K), extending what
given by JtKωPAP×ωPAP := (JtK,
we have seen in Section C-B2. Then,
Q
• We have defined a fibrations for logical-relations π :
Gl → ωPAP × ωPAP in Section C-B1.
• We have defined a property (V, C) in Gl in Section C-B2.
• We check that x 7→ return(x) lifts, but this is immedi-
ate.
• Each primitive has a lift, by Lemma C.10.
• ωPAP is an ωcpo-enriched bi-CCC by Lemma C.12.
• L is a pseudo-lifting monad. It means that we have an
algebraic element ⊥A : 1 → LA that is interpreted in
LA as the bottom element. This is true by construction.
• C(R) and C(B) are admissible, by Lemma C.11.
Corollary C.15 (Correctness of AD (limited)). For any term
x1 : real, . . . , xn : real ⊢ t : real, the PAP function JD(t)K :
A × Rn → R × R is a dual-number intentional representation
of JtK : A ⊆ Rn → R.
Proof. Let x1 : real, . . . , xn : real ⊢ t : real. By Theo-
rem C.14, JtKωPAP×ωPAP has a lift. Consider the c-analytic set
Rn and the pair
(idRn , λx.
(πk(x), [i = k]π′
i(x)))
Yi≤k≤n Yi∈N
where, by convention, πi(x) = π′
i(x) = 0 whenever i > n.
We use Iverson brackets, [i = k], which equals to 1 when the
condition is satisfied, and 0 otherwise. This pair is an element
of VRk (Rn). This means that
JtK,
(cid:16)
Yi≤k≤n Yi∈N
JD(t)K ◦
λx.
(cid:0)
(πk(x),
Y1≤k≤n
∈ CR(Rn)
[i = k]π′
i(x))
(cid:1)(cid:17)
This simplifies a bit more, and by the definition of CR(Rn),
this means that for all i, JD(t)K(x, hoti) is an i-th intentional
partial representation of JtK. By Lemma C.13, this means that
JD(t)K is a dual-number intentional representation for JtK, as
desired.
With the same proof, Theorem C.14 gives us directly the
stronger result at all ground types:
Corollary C.16 (Correctness of AD (full)). For any term well-
typed term Γ ⊢ t : τ of ground type τ in a ground context Γ,
the PAP function JD(t)K : A × Rn → R × R is a dual-number
intentional representation of JtK : A ⊆ Rn → R.
Proposition C.17.
A. Failure of gradient descent for PAP functions
Proof. Let ǫ > 0. Let P be the closed program defined by the
following code, where lr is our chosen learning rate ǫ.
# Recursive helper
def g(x, n):
if x > 0:
return ((x - n) * (x - n)) / (lr * 2)
if x == 0:
else:
return x / lr + n*n / (2*lr)
return g(x+1, n+1)
def P(x) = g(x,0)
This can easily be written in our language with recursion and
conditionals, but it would slightly impact readability.
JP K is PAP, and by inspection, we see that JP K = x 7→ x2
2ǫ .
This is proved by simple induction on N for the recursive
function g defining P . Let us now show that f := JP K satisfies
the hypothesis of Theorem III.5 and is strictly convex:
• f is strictly convex: this is well-known for the x2 function
• f is bounded below: f ≥ 0
• f is L-smooth for some L:
−
=
1
ǫ
2y
2ǫ
(x − y)
∇f (x) − ∇f (y) =
And therefore f is 1
2x
2ǫ
ǫ -smooth.
This means that for all 0 < ǫ′ < 2
= 2ǫ, gradient descent on
f with rate ǫ′ converges to the global minimum of f , which
is at 0 at 0. Now, let us see that this is not the case when we
use the intentional derivatives for f computed by AD, in the
case ǫ′ := ǫ.
1
ǫ
PAP function P ′
(x+⌊|x|⌋+1)−(⌊|x|⌋+1)
ǫ
Applying our standard AD macro to P , we obtain a
ǫ when x ∈ R>0, and
when x ∈ R<0 − {−n | n ∈ N}, and
ǫ for x ∈ {−n | n ∈ N}. Note that ∇JP K(x) 6= JP ′K(x)
1
exactly when x ∈ {−n | n ∈ N}.
returns x
that
Let x0 ∈ R be any initialization for the gradient descent
algorithm. Then, after one step of gradient descent, we obtain
x1 := x0 − ǫ × P ′(x0). If x0 > 0, then JP ′(x0)K = x0
ǫ and
thus x1 = 0. When x0 < 0 is not an integer, JP ′(x0K = x0
ǫ
as thus x1 = 0 as well. Finally, when x0 < 0 is an integer,
JP ′(x0)K = 1
ǫ and therefore x1 = x0 − 1. In any case, x1 is a
non-positive integer, and for x2 we'll always have x2 = x1−1.
Therefore, xt → −∞ as t → ∞.
A similar program P can be constructed when the learning
rate is non-fixed. The recursive program inside P 's definition
simply calls ǫ(n) instead of using ǫ, and the analysis will be
very similar, except that x1 will not necessarily be an integer
when x0 is a non-positive integer, but this happens for almost
no x0.
B. Almost-sure convergence of Gradient Descent
Proof. Given a fixed intentional derivative ∇f of f ,
Fint(ǫ, x) = (ǫ, x − ǫ∇xf ). Let Ftrue(ǫ, x) = (ǫ, x − ǫ∇∗
let
xf )
where ∇∗
f . We restrict the domain of Ftrue and Fint to (0, 2
For δ > 0 and t ∈ N, we define
xf is the true gradient of the differentiable function
L ) × Rd.
X ∗
t,δ := {(ǫ, x0) ∈ (0,
2
L
)×Rd | |∇∗f (π2F t
true(ǫ, x0))| ≤ δ}
where gt is the t-fold composition of a function g with itself.
As f is L-smooth, ∇∗f is locally L-Lipschitz and thus con-
tinuous. Therefore, by the first conclusion of Theorem III.5,
for any δ > 0,
occur for finitely many ǫ (at most n). Thus, J(Ftrue)ǫ,x has
max rank n + 1 almost everywhere. Denote by R this set.
f being PAP, F is PAP as well. Therefore, Ftrue is almost
everywhere analytic, and denote this set C. Let N = R ∩ C.
Note that N c is a null-set. On N , F is F ∈ C1 and its Jacobian
is invertible. Therefore, by the implicit function theorem, the
result is locally true around any point x ∈ N . This means,
for all x ∈ N , there exists a neighborhood Ux of x such that
F −1
true(A) ∩ Ux is a null-set. We can use a countable cover
{Ui}i∈N of N of such neighborhoods, and thus
∞
[t=0
X ∗
t,δ = (0,
2
L
) × Rd
We define similarly, for any δ > 0,
Xt,δ := {(ǫ, x0) ∈ (0,
2
L
) × Rd |
|∇∗f (π2F t
int(ǫ, x0))| ≤ δ}
We will show by induction on t ∈ N that Xt,δ and X ∗
t,δ only
differ by a null-set, i.e. that there exists null-sets Nt,δ and
Mt,δ such that Xt,δ ∩ N c
t,δ. This implies that
t,δ = X ∗
t,δ ∩ M c
∞
[t=0
∞
Xt,δ ⊇
Xt,δ ∩ Nt,δ
=
[t=0
∞
[t=0
∞
X ∗
t,δ ∩ Mt,δ
⊇ (
X ∗
t,δ) ∩ ((0,
∞
) × Rd −
Mt,δ)
2
L
[t=0
∞
) × Rd −
Mt,δ)
[t=0
[t=0
2
L
= (0,
= (0,
2
L
) × Rd ∩ ((0,
2
L
) × Rd −
∞
[t=0
Mt,δ
As a countable union of negligible sets is negligible, this
L ) × Rd up to a negligible
means that
set, as desired.
S
∞
t=0 Xt,δ equals (0, 2
By induction on t ∈ N, we show the following property:
∀A ⊆ (0,
2
L
) × Rd measurable of measure 0,
{(ǫ, x) | F t
true(ǫ, x) ∈ A} is measurable with measure 0
true is the identity and it's obvious. Let t ∈ N such
If t = 0, F t
L ) × Rd be of measure
that the property holds. Let A ⊆ (0, 2
0. To use the induction hypothesis, it suffices to show that
F −1
true(A) has measure 0. The Jacobian matrix of Ftrue is an
(n + 1) × (n + 1) matrix, given by
J(Ftrue)ǫ,x =
1
Jxf T
(cid:18)
0T
n
In − ǫHxf (cid:19)
where In is the n × n identity matrix, 0n the zero vector in
Rn, Hxf is the Hessian matrix of f , and (−)T is the transpose
operation.
The rank of J(Ftrue)ǫ,x is lower bounded by one plus the
rank of In − ǫHfx. The latter is strictly less than n exactly
when 1
ǫ is an eigenvalue of Hxf . For a fixed x, this can only
true(A) = F −1
F −1
⊆ F −1
true(A) ∩ (N ∪ N c)
(
true(A) ∩
[i∈N
(cid:2)
true(A) ∩ Ui
F −1
Ui) ∪ N c
(cid:3)
∪ Z
(cid:3)
⊆
(cid:2) [i
true(A) is measurable as A is, and as null-sets are closed
true(A) has measure
F −1
under countable unions, this shows that F −1
0, which concludes the induction.
Now, we show by induction on t ∈ N that for almost all
(ǫ, x0) ∈ (0, 2
L ) × Rd,
true(ǫ, x0) = F t
F t
int(ǫ, x0)
Once again, the base case is immediate. Let t ∈ N such that
the property holds. As ∇f is an intentional derivative of f , for
almost all x ∈ R, we have that ∇xf = ∇∗
xf . Therefore, for
almost all (ǫ, x), we have that Ftrue(ǫ, x) = Fint(ǫ, x). Let
A be the set of points on which they differ. By the previous
proposition, F −1
true and
F t+1
int may differ only on the set F −1
true(A), which has measure
0. This concludes the induction.
true(A) has measure 0. Therefore, F t+1
true(ǫ, x0) and F t
true(ǫ, x0) or π2F t
As a corollary of what we have just shown, we have
that for almost all (ǫ, x0), xt is the same, whether it was
obtained from true or AD-computed gradients. Indeed, xt is
either π2F t
int(ǫ, x0), and we have shown
that F t
true(ǫ, x0) agree almost everywhere.
Therefore f (xt=1) ≤ f (xt) remains true almost-everywhere
for all t, as a countable union of negligible sets is negligible.
Finally, if f is strongly convex, then {xt}t will reach the
global minimum. As xt is the same, whether it was obtained
from true or AD-computed gradients, for almost all (ǫ, x0),
this means that gradient-descent with AD-computed gradients
will also almost surely converge to the global minimum.
APPENDIX E
S-HAUSDORFF MEASURES
A. Monad of measure on ωPAP
The goal of this section is to give the key steps in the
proof of Theorem IV.2. These are the following. We adapt
the proof technique used in V ́ak ́ar et al. [2]. We define an
expectation operator IntX : SX → (X → W) → W). We
show that it is a well-defined ωPAP-morphism, and natural
in X. Next, we show that ωPAP admits a proper orthogonal-
factorization system, extending the known result on categories
of concrete sheaves to this category of ω-concrete sheaves.
Using a theorem from Kammar and McDermott [45], we show
that the image of Int induces a strong monad M on ωPAP.
This monad is easily shown to be commutative.
Lemma E.4. Let f : U ⊆ Rn → Rm be real analytic on
a connected open U . Let k be the maximal rank of f on U .
Then V := {x ∈ U | rank(f (x)) = k} is
Using this, we can show Lemma IV.2.
Proof. JtKM in the new measure semantics is given by
IntRn ◦ JtKS. By definition, this means it is the integrator
f (αJtKS(x))ΛΩ(dx), which can be seen as the push-
λf.
forward of ΛΩ by the function αJtKS, defined by the second
point in Definition IV.4. This function is an ωPAP morphism
Ω → L(Rn), i.e. a partial ωPAP function ft : Ω ⇀ Rn such
that JtK = ft∗ΛΩ.
R
B. Pushforward of PAP functions
In this section, we prove the following Theorem:
Theorem E.1. Let f : U → Rn be the total restriction of
a partial ωPAP morphism to its domain U ⊆ Rm. Let λ be
the restriction of the Lebesgue measure to U . Then f∗λ has a
density w.r.t. some s-Hausdorff measure μ on Rn.
It is the core technical theorem that is required to prove
Theorem IV.3. To prove Theorem E.1, we will first prove a
restricted form of it:
Theorem E.2. Let f : U ⊆ Rn → Rm be real analytic on a
connected open U . Then there is an integer k such that f (U )
i∈N Mi of smooth
is contained is a countable union M :=
submanifolds Mi of Rm of dimension k, up to a set of k-
Hausdorff measure 0. Furthermore, f∗λ has a density w.r.t.
the k-Hausdorff measure on M .
S
Before proving the theorem, we need a few other technical
lemmas.
0≤k≤m
i .μk
i∈N f k
Lemma E.3. Let μ =
some non-negative measurable functions f k
i
{∞}, and such that μk
dimensional submanifold M k
measure given by the (μk
i ∈ MRm for
: Rm → R+ ∪
i is the k-Hausdorff measure on some k-
i of Rm. Let B be the s-Hausdorff
i ). Then μ has a density w.r.t. B.
P
P
i
S
P
i . As the f k
i M k
i∈N 1x∈M k
Proof. Let Xk =
i and μk be the k-Hausdorff measure
.f k
i are non-negative
on Xk. Let gk =
and can take the value ∞, the limit exists and therefore the
gk are measurable. By construction, we have the equality
i = gk.μk for all 0 ≤ k ≤ m. This follows
from the simpler equality f1.ν|A + f2.ν|B = (f1 + f2).ν|A∪B
P
which is also valid for countable unions, given that the μk
i
are all restrictions of the k-Hausdorff measure. Therefore
μ =
i∈N f k
i .μk
1≤k≤m gk.μk.
P
Let g = g0 + 1x6∈X0(g1 + 1x6∈X1(g2 + 1x6∈X2(. . . +
1x6∈Xm−1gm))). g is clearly measurable and non-negative (with
the convention that 0.∞ = 0 here). For all i < k, Xi is
H k negligible. Thus gk.μk = gk.μk|Xk−Xi = (1x6∈Xigk).μk.
From this fact, we deduce that
1≤k≤m gk.μk = g.B, and
therefore conclude that μ = g.B, i.e. that μ has a density
w.r.t. B.
P
• open,
• dense in U ,
• and λ(U − V ) = 0.
Proof. Let's first show V is open. Given a coordinate system
for U and V , for any x ∈ V , denote by G(x) the matrix
for Txf in these bases. By hypothesis, G(x) has at least
an invertible k × k sub-matrix, and this is a characterisation
of rank. Then denote by H : Mn×m(R) → R : A 7→
B k×k submatrix of A |det(B)|. H is continuous as the de-
terminant is, and V = (HG)−1(R − {0}) is thus open. Let's
P
show V is dense. Note that this is not true in general for
smooth functions. Pick a base for U and V again, and let
G(x) the matrix for Txf in these bases. Thus x 7→ G(x) is
also real analytic.
Let p ∈ ̄V − V . Pick a k × k submatrix B of matrices in
Mn×m(R), then let HB : Mn×m(R) → R be the determinant
of that submatrix. Assume HBG is 0 on a open neighbourhood
WB of p for all B. Then W = ∩WB is a finite intersection of
opens and thus is open, and W ∩ V 6= ∅ as by assumption p is
in the boundary of V . But that's a contradiction as we know
that for some B and any x in the intersection, HBG(x) 6= 0.
Therefore, there is a B such that HBG is not 0 at some point
x in a neighbourhood WB on p. As f is analytic, so is df ,
and so is G. The determinant is a polynomial function of its
arguments, it is thus real analytic, and thus so is HB. As HBG
is analytic and non-identically 0 on WB, it must be non-zero
on a dense subset of WB. Let's assume that the closure ̄V
is not all of U . We obtain a contradiction by picking a point
close to ̄V that would end up in one of the WB. In more
detail, assume by ways of contradiction that U − ̄V 6= ∅. Let
p ∈ U − ̄V . Let g : U → R+ be defined as g(x) = d(x, ̄V ).
By assumption, as ̄V is closed, we have g(p) > 0. Also, note
that g is continuous. As k is the maximal ranked reached by
f , ̄V 6= ∅. Thus, there exists y ∈ ̄V such that g(y) = 0.
As U is connected (and thus path connected, as an open of
a Euclidean space), there is a continuous path c : [0, 1] → U
such that c(0) = y and c(1) = p. The composition g ◦ c is
continuous and so there a point x ∈ ̄V − V such that c(t) = x
and g(x) = 0 for some t0 < 1. By compactness of [0, 1], let's
choose the biggest such t0, which exists as c(1) = p 6∈ ̄V .
For all t > t0, we therefore have g(c(t)) > 0. However, by
the result above, there is a dense open subset W of a WB, a
neighbourhood of x, such that W ⊆ V . By density of W , this
means that c(t) = 0 on c−1(WB)∩[t0, 1] 6= ∅, a contradiction.
We will now prove that X := U − V has Lebesgue measure
0. For a fixed k × k matrix B of any n × m matrix, consider
the same analytic function HB as above. Then gB := G; HB :
U → R is analytic. Using the theorem from Mityagin [46],
it is either the 0 function or the preimage of 0 has Lebesgue
B ({0}).
measure 0. We can write X =
As f has rank k somewhere, not every gB is the 0 analytic
function, and thus X is contained in a Lebesgue measure 0
B k×k submatrix g−1
T
set, and therefore has Lebesgue measure 0.
Lemma E.5. Let f : A → C where A ⊆ Rn is λ-measurable,
and let U ⊆ A be λ-measurable. Assume that λ(A − U ) = 0.
Then f∗λ = (f |U )∗λ.
Proof.
f∗λ(S) = λ(f −1(S))
= λ(f −1(S) ∩ A)
= λ(f −1(S) ∩ (A − U + U ))
= λ((f −1(S) ∩ (A − U )) ∪ (f −1(S) ∩ U ))
≤ λ(f −1(S) ∩ (A − U )) + λ(f −1(S) ∩ U )
≤ λ(A − U ) + λ|U (f −1(S)
= 0 + λ|U (f −1(S))
= (f |U )∗λ(S)
As the other inequality is obvious, we showed that f∗λ(S) =
(f |U )∗λ(S).
Lemma E.6. Let f : U ⊆ Rn → Rm be real analytic on a
connected open U . Further, assume f has constant rank. Then
f (U ) is a countable union of manifolds.
Proof. As f has constant rank, by the constant rank theorem,
f is locally of the form (x1, . . . , xn) 7→ (x1, . . . , xk, 0, . . . , 0).
More precisely, around any x ∈ U , there is a neighbour-
hood W of x and smooth diffeomorphisms φ : Rm →
Rm, ψ : Rn → Rn such that g(x1, . . . , xn) := φ ◦ f |W ◦
ψ(x1, . . . , xn) = (x1, . . . , xk, 0, . . . , 0).
If k = m, Rk = φ ◦ f |W ◦ ψ(Rn) is a k-dimensional
smooth manifold. If k < m, let π : Rm → Rm−k given
by π(x1, . . . , xm) = (xk+1, . . . , xm). π is an orthogonal
projection and therefore a submersion. By the submersion
theorem, π−1(0) = φ◦f |W ◦ψ(Rn) is a k-dimensional smooth
manifold. Therefore, as φ is a diffeomorphism, f |W (W ) =
f |W ◦ ψ(Rn) = φ−1(π−1(0)) is also a k-dimensional smooth
manifold.
Now consider the open cover of U given by {Wx | x ∈ U }
where Wx is a neighbourhood of x as above. As opens
of Euclidean spaces are Lindel ̈of spaces, we can extract a
countable open sub-cover {Wxn | xn ∈ U }n∈N of U . From
what we just proved, for each n, f (Wxn ) is a k-dimensional
manifold. Thus, F (V ) =
n∈N f (Wxn ) is a countable union
of k-dimensional manifolds.
S
Proof of Theorem E.2. Let k be the maximal rank of f on U .
Let V := {x ∈ U | rank(f (x)) = k}. Let's first show that it
is sufficient to show the result for f |V .
By Lemma E.4, V is open and dense in U , and U − V
has Lebesgue measure 0. By Lemma E.5, f∗λ = (f |V )∗λ,
so we reduced the second statement to showing it for (f |V ).
In addition, by Sard's theorem, f (U − V ) has k-Hausdorff
measure 0. Therefore, it is sufficient to prove the theorem for
f |V , which we call f again.
Now, write V =
i Vi where the Vi are the connected
components of V . On each connected component Vi, f |Vi ver-
ifies the hypothesis of Lemma E.6. Thus f (Vi) is a countable
F
union of k-dimensional manifolds for each Vi. As Euclidean
spaces are locally connected spaces with a countable basis, the
same holds for V . Therefore, V has at most countably many
connected components Vi. A countable union of countable
sets is countable, and we finished proving the first part of
the theorem.
Finally, it remains to show that f∗λ has a density w.r.t. the
k-Hausdorff measure on f (V ). By Lemma E.3, it is sufficient
to show it for each (f |W )∗λ, f (W ), where W is as constructed
above. First, let's show that it is also sufficient to restrict to the
case where W is contained in a compact set. There exists a
countable cover Ki of compact sets of Rn that cover W (e.g.
by taking closed spheres of radius 1 at points with rational
coordinates). Each Wi := Ki ∩ W is thus compact in W .
Assume for now that we have proved that (f |Wi )∗λ has a
A hi(x)dHk(x)
density w.r.t. f (W ), i.e. that (f |Wi )∗λ(A) =
for some measurable function hi : f (W ) → R+ ∪ {∞}. Then,
R
f∗λ(A) =
(f |Wi )∗λ(A)
Xi∈N
=
Xi∈N ZA
hi(x)dHk(x)
=
ZA
(
Xi∈N
hi(x))dHk(x)
where the last equality holds by the Fubini-Tonelli theorem as
hi ≥ 0. h :=
i h is measurable, and we are done.
P
So we can now assume that W is contained in a compact
set. As f is analytic, it is locally Lipschitz and is thus Lipschitz
on W , as W is contained in a compact set. What's more, As
f has rank k, its Jacobian matrix Jx at every point x has rank
k. A standard result in linear algebra asserts that JxJ T
x also
has rank k and therefore the correction term JW f (x) is non-
JW f (x) is therefore measurable
zero for all x. Let g(x) :=
and non-negative. By the co-area formula, we have
1
f∗λ(A) = λ(f −1(A))
=
=
=
1.dλ
Zf −1(A)
g(x)JW f (x).dλ
Zf −1(A)
Zf (W ) (cid:16) Zf −1(y)
g(x)dHn−k(x)
(cid:17)
dHk(y)
=
h(y)dHk(y)
Zf (W )
f −1(y) g(x)dHn−k(x) is measurable and non-
where h(y) :=
negative, yet possibly infinite.
R
Lemma E.7. Let A be an analytic set. There is an open U ⊆
A such that λ(A − U ) = 0.
Proof. Let A = ∩iX +
sets. Write X −
loss of generality, assume that none of the g−
j as in the definition of analytic
j )−1({0}). Without
j are the constant
j = Xj ⊔Zj where Zj = (g−
i ∩ ∩j X −
0 function. Then, U := ∩iX +
i ∩ ∩jXj is clearly open and
U ⊆ A. Let's now show that A − U has Lebesgue measure
0. It suffices to show that this is the case for each Zj, as
they cover A − U . However, by Mityagin [46]'s result, g−
j
is either the 0 function or the preimage of 0 has Lebesgue
measure 0. This shows that the Zj have Lebesgue measure 0,
as desired.
F
Theorem E.8. Let f : A → Rm be PAP. Then f∗λ has a
density w.r.t. an s-Hausdorff measure μ on Rm.
Proof. Let f : A → Rm be PAP. A is c-analytic, so we can
i∈N Ai where each Ai is analytic and (fi, Ai)
write it as A =
is a PAP representation for f . By Lemma E.7, for each i ∈ N,
there is an open Ui ⊆ Ai such that λ(Ai − Ui) = 0. By
Lemma E.5, it is thus sufficient to consider the case where fi
is defined on an open set Ui. Any open V ⊆ Rn can always be
i∈N Vi for a countable family of connected
written as V =
opens Vi. Applying this to the Ui, we have a countable family
of analytic functions fi,j : Ui,j → Rm defined on connected
opens Ui,j, where fi,j is the restriction of fi to Ui,j, and
j ∈ N. By theorem E.2, for each (i, j) ∈ N2, there exists an
l mki,j
integer 0 ≤ ki,j ≤ m such that (fi,j)∗λ =
,
where each f ki,j
: Rm → R+ ∪ {∞} is measurable, and each
mki,j
is the ki,j -Hausdorff measure on some ki,j-submanifold
l
M i,j
of Rm. Therefore,
l
l∈N f ki,j
P
F
l
l
f∗λ =
(fi,j)∗λ
Xi,j
=
=
=
l mki,j
f ki,j
l
Xi,j Xl∈N
X0≤k≤m X{(i,j) | ki,j =k} Xl
nmk
f k
n
X0≤k≤m Xn
l mki,j
f ki,j
l
where in the last equality we simply re-index the countable
sum. We can now conclude by Lemma E.3 that f∗λ has a
density w.r.t. some s-Hausdorff measure.
Finally, we can prove Theorem IV.3.
Proof. Let ⊢ t : realn. By Lemma IV.2, there exists an ωPAP
morphism f : Ω → LRn such that f∗ΛΩ = JtK. As Ω is
a coproduct, by the universal property of the coproduct, f
decomposes as a family of ωPAP morphisms fi : Ri → LRn.
By definition of the lifting monads, the fi represent PAP
: Ai → Rn where each Ai is c-analytic. By
functions fi
Theorem E.8, each fi∗λ has a density w.r.t. an s-Hausdorff
measure μi on Rn, i.e. fi∗λ = gi.μi for some non-negative
measurable function gi : Rn → R+ ∪ {∞}. Therefore
JtK = f∗ΛΩ =
fi∗λ =
gi.μi
Xi∈N
Xi∈N
And we conclude that this last formula has a density w.r.t.
some base measure on Rn by Lemma E.3. We proved the first
point in the theorem.
For the second point, let g be the density of JtK w.r.t. μ, and
d H d(− ∩
f the density of JtK w.r.t. B(t). Write B(t) =
M d).
P
By induction on d in [0, n], we show that g(x) = f (x) for
all x ∈ M d, except for a H d-null set.
• Base case d = 0: Let x ∈ M 0. JtK(x) = (g.μ)(x) =
g(x)JtK(x) = (f.B(t))(x) = f (x)
• Inductive case n ≥ d > 0.
i<d M i).
2) For any H d measurable A ⊆ M d, we have:
1) For all i < d, M i is a H d-null set, and therefore
it suffices to show the result for Sd := M d −
(
S
JtK(A) = g.μ(A) =
A∩Sd f (x)H d(dx) There-
JtK(A) = f.B(t)(A) =
− g(x)H d(dx) are
fore the integrators/measures
R
equal as measures on Sd, and therefore f (x) = g(x)
R
for all x on Sd except on a H d null set.
A∩Sd g(x)H d(dx)
R
S
d M d)c. ThenJtK(Z) = f.B(t)(Z) = 0. Let
Let Z = (
d Cd where Cd is the H d-null set in Sd on which f
C =
and g disagree. Then JtK(C) = 0 and thus JtK(Z ∪ C) =
0. As the set of points on which f and g disagree is
contained in Z ∪ C, we are done.
S
For the third point, by definition of base measures, B(t) =
d H d(−∩M d). By the way we constructed B(t), the density
ρt satisfies ρt(x) > 0 for every x in M d, except at an H d-
P
null set. Let A be such that B(t2)(A) = 0. Then, by the
positive density ρt2 of Jt2K w.r.t. the base measure B(t2), we
also have Jt2K(A) = 0. Therefore, Jt1K(A) = 0 using the
assumption of absolute continuity. Finally, using the first point
in Theorem IV.3, we conclude that B(t1)(A) = 0.
P
P
i<d(M ′i ∪M i) and A :=
For the fourth point, this follows from general properties
d H d(− ∩ M d) and
of s-Hausdorff measures. Let μ1 =
d H d(− ∩ M ′d) be two s-Hausdorff measure such
μ2 =
that μ1 ≪ μ2. As they are σ-finite measures, by the Radon-
Nikodym theorem we can write μ1 = g.μ2. Let Sd := M d \
d Sd. Let B ⊆ A∩M d. We have
μ1(B) = H d(B ∩ M d), as for each i < d, H i(B ∩ M i) ≤
S
H i(A ∩ M d ∩ M i) = H i(∅) = 0, and for each i > d, H i(B ∩
M i) ≤ H i(M d) = 0. Likewise, μ2(B) = H d(B ∩ M ′d). As
μ1(B) = g.μ2(B), we have proved that the measures H d(− ∩
M d) and g.H d(− ∩ M ′d ∩ A) are the same measures when
restricted to A ∩ M d, and therefore g(x) = 1 for H d almost
d A ∩ M d is measurable and
all x ∈ M d ∩ A. As A =
μ1(Ac) = 0, we conclude that the ωPAP morphism 1A : A →
S
W is a density for μ1 w.r.t. μ2.
S
To conclude, we prove Theorem IV.4.
Proof. By a theorem of Whitney (refined by Morrey and
Grauert), all (finite-dimensional, second-countable, Hausdorff,
without boundary) smooth manifolds admit a (unique) analytic
structure, and two smooth manifolds are diffeomorphic iff
they are analytic-equivalent. Our case is even simpler, as
we consider embedded submanifolds of Rn. Let M be a
smooth submanifold of Rn of dimension d. There exists a
tubular envelope U ⊆ Rn of M , and a smooth projection
p : U → Rn such that M = p(U ). This means that
p∗λ|U and H d on M are mutually absolutely continuous.
By reasoning in local coordinates, using analytic charts, we
see that p is locally a linear projection, and is thus analytic,
and therefore PAP. Now let μ be an arbitrary s-Hausdorff
measure on Rn, and {M k
i }i∈N,0≤k≤n be a support for μ.
Let pi,k : Ui,k → Rn be analytic projections such that
i , where i ∈ N, 0 ≤ k ≤ n. Every open set
p(Ui,k) = M k
U ⊆ Rn is diffeomorphic to a bounded open V of radius
at most 1, and the diffeomorphism and its inverse can be
chosen to be analytic functions. Let φi,k : Vi,k → Ui,k be such
diffeomorphisms. Let (Wi,k)i∈N,0≤k≤n be the same opens as
the (Vi,k)i∈N,0≤k≤n, but translated to be disjoint, which is
always possible as the (Vi,k)i∈N,0≤k≤n have radius at most 1
and there are countably many of them. Let ti,k : Wi,k → Vi,k
be the associated translations, which are linear and therefore
i∈N,0≤k≤n Wi,k. Then the function
analytic. Let W =
f : W → Rn defined by x ∈ Wi,j 7→ ti,k; φi,k; pi,k is analytic,
and f∗λ and μ are mutually absolutely continuous.
F
|
|
http://arxiv.org/abs/2302.10633v1 | 2023-02-21T12:44:59 | 2023-02-21T12:44:59 | Generalization Bounds for Adversarial Contrastive Learning | Deep networks are well-known to be fragile to adversarial attacks, and
adversarial training is one of the most popular methods used to train a robust
model. To take advantage of unlabeled data, recent works have applied
adversarial training to contrastive learning (Adversarial Contrastive Learning;
ACL for short) and obtain promising robust performance. However, the theory of
ACL is not well understood. To fill this gap, we leverage the Rademacher
complexity to analyze the generalization performance of ACL, with a particular
focus on linear models and multi-layer neural networks under $\ell_p$ attack
($p \ge 1$). Our theory shows that the average adversarial risk of the
downstream tasks can be upper bounded by the adversarial unsupervised risk of
the upstream task. The experimental results validate our theory. | [
"Xin Zou",
"Weiwei Liu"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10633v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10633v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"stat.ML"
] | 3
2
0
2
b
e
F
1
2
]
G
L
.
s
c
[
1
v
3
3
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Journal of Machine Learning Research 24 (2023) 1-54
Submitted 7/22; Revised 12/22; Published 2/23
Generalization Bounds for Adversarial Contrastive Learning
Xin Zou
School of Computer Science
Wuhan University
Wuhan, Hubei, China
Weiwei Liu∗
School of Computer Science
Wuhan University
Wuhan, Hubei, China
Editor: Joan Bruna
[email protected]
[email protected]
Abstract
Deep networks are well-known to be fragile to adversarial attacks, and adversarial training
is one of the most popular methods used to train a robust model. To take advantage
of unlabeled data, recent works have applied adversarial training to contrastive learning
(Adversarial Contrastive Learning; ACL for short) and obtain promising robust performance.
However, the theory of ACL is not well understood. To fill this gap, we leverage the
Rademacher complexity to analyze the generalization performance of ACL, with a particular
focus on linear models and multi-layer neural networks under (cid:96)p attack (p ≥ 1). Our theory
shows that the average adversarial risk of the downstream tasks can be upper bounded by
the adversarial unsupervised risk of the upstream task. The experimental results validate
our theory.
Keywords: Robustness, Adversarial learning, Contrastive learning, Rademacher complex-
ity, Generalization bound.
1 Introduction
Deep neural networks (DNNs) have achieved state-of-the-art performance in many fields.
However, several prior works (Szegedy et al., 2014; Goodfellow et al., 2015) have shown that
DNNs may be vulnerable to imperceptibly changed adversarial examples, which causes a
lot of focus on the robustness of the models (Madry et al., 2018; Mao et al., 2020; Li et al.,
2022).
One of the most popular approaches to achieving adversarial robustness is adversarial
training, which involves training the model with samples perturbed to maximize the loss on
the target model (Goodfellow et al., 2015; Madry et al., 2018; Zhang et al., 2019). Schmidt
et al. (2018) show that adversarial robust generalization requires a larger amount of data,
while Yin et al. (2019); Awasthi et al. (2020) show that the Rademacher Complexity of
adversarial training is strictly larger in theory than that of natural training, which implies
that we need more data for adversarial training.
∗. Corresponding Author.
©2023 Xin Zou and Weiwei Liu.
License: CC-BY 4.0, see https://creativecommons.org/licenses/by/4.0/. Attribution requirements are provided
at http://jmlr.org/papers/v24/22-0866.html.
Zou and Liu
Since the labeled data is limited and expensive to obtain, one option would be to use
large-scale unlabeled data and apply self-supervised learning (Gidaris et al., 2018; Noroozi
and Favaro, 2016), an approach that trains the model on unlabeled data in a supervised
manner by utilizing self-generated labels from the data itself. Contrastive Learning (CL)
(Chen et al., 2020; He et al., 2020), which aims to maximize the feature similarity of similar
pairs and minimize the feature similarity of dissimilar ones, is a popular self-supervised
learning technique.
Recently, Kim et al. (2020); Ho and Vasconcelos (2020); Jiang et al. (2020) apply
adversarial training in CL and achieve state-of-the-art model robustness. They find that if
adversarial training is conducted on the upstream contrastive task, the trained model will be
robust on the downstream supervised task. However, their results are all empirical and lack
theoretical analysis. To fill this gap, we here present a theoretical analysis of adversarial
contrastive learning through the lens of Rademacher complexity, with a particular focus
on linear models and multi-layer neural networks. Our theoretical results show that the
average adversarial risk of the downstream tasks can be upper bounded by the adversarial
unsupervised risk of the upstream task; this implies that if we train a robust feature extractor
on the upstream task, we can obtain a model that is robust on downstream tasks.
The remainder of this article is structured as follows: §2 introduces some related works
in this field. §3 provides some basic definitions and settings that will be used in the following
sections. §4 presents our first part's main results, which show a connection between the
robust risk for the upstream task and the robust risk for the downstream tasks. §5 shows
our second part's results, it outlines our bounds for linear models and multi-layer neural
networks by bounding the Rademacher complexity of each hypothesis class. §6 shows some
experimental results that verify our theory; finally, the conclusions are presented in the last
section.
2 Related Work
Adversarial Robustness. Szegedy et al. (2014) show that DNNs are fragile to impercep-
tible distortions in the input space. Subsequently, Goodfellow et al. (2015) propose the fast
gradient sign method (FGSM), which perturbs a target sample towards its gradient direction
to increase the loss and then uses the generated sample to train the model in order to
improve the robustness. Following this line of research, Madry et al. (2018); Moosavi-Dezfooli
et al. (2016); Kurakin et al. (2017); Carlini and Wagner (2017) propose iterative variants
of the gradient attack with improved adversarial learning frameworks. Besides, Ma et al.
(2022) analyze the trade-off between robustness and fairness, Li and Liu (2023) study the
worst-class adversarial robustness in adversarial training. For the theoretical perspective,
Montasser et al. (2019) study the PAC learnability of adversarial robust learning, Xu and Liu
(2022) extend the work of Montasser et al. (2019) to multiclass case and Yin et al. (2019);
Awasthi et al. (2020) give theoretical analysises to adversarial training by standard uniform
convergence argumentation and giving a bound of the Rademacher complexity. Our work is
quite different from Yin et al. (2019); Awasthi et al. (2020), firstly, they just analyze the
linear models and two-layer neural networks, but we consider linear models and multi-layer
deep neural networks; secondly, they consider the classification loss, which is much easier to
analyze than our contrastive loss.
2
Generalization Bounds for Adversarial Contrastive Learning
Contrastive Learning. Contrastive Learning is a popular self-supervised learning
paradigm that attempts to learn a good feature representation by minimizing the feature
distance of similar pairs and maximizing the feature distance of dissimilar pairs (Chen
et al., 2020; Wang and Liu, 2022). SimCLR (Chen et al., 2020) learns representations by
maximizing the agreement between differently augmented views of the same data, while
MoCo (He et al., 2020) builds large and consistent dictionaries for unsupervised learning
with a contrastive loss. From the theoretical perspective, Saunshi et al. (2019) first presents
a framework to analyze CL. We generalize their framework to the adversarial CL. The key
challenging issues in this work are how to define and rigorously analyze the adversarial
CL losses. Moreover, we further analyze the Rademacher complexity of linear models and
multi-layer deep neural networks composited with a complex adversarial contrastive loss.
Neyshabur et al. (2015) show an upper bound of the Rademacher complexity for neural
networks under group norm regularization. In fact, the Frobenius norm and the (cid:96)1,∞-norm
in our theoretical analysis are also group norms, while the settings and proof techniques
between Neyshabur et al. (2015) and our work are quite different: (1) they consider the
standard setting while we consider a more difficult adversarial setting; (2) they consider
the Rademacher complexity of neural networks with size 1 output layer, while we consider
the case that the neural network is composited with a complex contrastive learning loss;
(3) they prove their results by reduction with respect to the number of the layers, while
motivated by the technique of Gao and Wang (2021), we use the covering number of the
neural network to upper bound the Rademacher complexity in the adversarial case.
Adversarial Contrastive Learning. Several recent works (Kim et al., 2020; Ho and
Vasconcelos, 2020; Jiang et al., 2020) apply adversarial training in the contrastive pre-
training stage to improve the robustness of the models on the downstream tasks, achieving
good robust performance in their experiments. Our work attempts to provide a theoretical
explanation as to why models robustly trained on the upstream task can be robust on
downstream tasks.
3 Problem Setup
We introduce the problem setups in this section.
3.1 Basic Contrastive Learning Settings
We first set up some notations and describe the contrastive learning framework.
Let X ∈ Rm be the domain of all possible data points, this paper assumes that X is
bounded. Contrastive learning assumes that we get the similar data in the form of pairs
(x, x+), which is drawn from a distribution Dsim on X 2, and k independent and identically
distributed (i.i.d.) negative samples x−
k drawn from a distribution Dneg on X .
Given the training set S = {(xi, x+
i=1, we aim to learn a representation f from
F that maps similar pairs (x, x+) into similar points (f (x), f (x+)), while at the same time
keeping f (x−
k ) away from f (x), where F is a class of representation functions
f : X → Rn.
1 , x−
i1, . . . , x−
2 , . . . , x−
ik)}M
i ), * * * , f (x−
i , x−
Latent Classes. Let C denote the set of all latent classes (Saunshi et al., 2019) that
are all possible classes for points in X ; for each class c ∈ C , moreover, the probability Dc
3
Zou and Liu
over X captures the probability that a point belongs to class c. The distribution on C is
denoted by ρ.
To formalize the similarity among data in X , assume we obtain i.i.d. similar data
points x, x+ from the same distribution Dc, where c is randomly selected according to the
distribution ρ on latent classes C. We can then define Dsim and Dneg as follows:
Definition 1 (Dsim and Dneg, Saunshi et al., 2019) For unsupervised tasks, we define
the distribution of sampling similar samples Dsim(x, x+) and negative sample Dneg(x−) as
follows:
Dsim(x, x+) = E
c∼ρ
Dc(x)Dc(x+), Dneg(x−) = E
c∼ρ
Dc(x−).
Supervised Tasks. For supervised tasks, we focus on the tasks in which a representation
function f will be tested on a (k + 1)-way supervised task T consisting of distinct classes
{c1, c2, . . . , ck+1} ⊆ C, while the labeled data set of task T consists of M i.i.d. examples
drawn according to the following process: A label c ∈ {c1, . . . , ck+1} is selected according to
a distribution DT , and a sample x is drawn from Dc. The distribution of the labeled pair
(x, c) is defined as: DT (x, c) = DT (c)Dc(x).
3.2 Evaluation Metric for Representations
We evaluate the quality of a representation function f with reference to its performance on
a multi-class classification task T using a linear classifier.
Consider a task T = {c1, . . . , ck+1}. A multi-class classifier for T is a function g : X −→
Rk+1, the output coordinates of which are indexed by the classes c in task T .
Let {g(x)y − g(x)y(cid:48)}y(cid:48)(cid:54)=y be a k-dimensional vector of differences in the coordinates
of the output of the classifier g. The loss function of g on a point (x, y) ∈ X × T is
defined as (cid:96)({g(x)y − g(x)y(cid:48)}y(cid:48)(cid:54)=y). For example, one often considers the standard hinge
loss (cid:96)(v) = max{0, 1 + maxi{−vi}} and the logistic loss (cid:96)(v) = log2(1 + (cid:80)
i exp(−vi)) for
v ∈ Rk.
The supervised risk of classifier g is defined as follows:
Lsup(T , g) :=
(cid:16)
(cid:104)
(cid:96)
E
(x,c)∼DT
{g(x)c − g(x)c(cid:48)}c(cid:48)(cid:54)=c
(cid:17)(cid:105)
.
The risk Lsup(T , g) of classifier g on task T measures the quality of the outputs of
g, take the hinge loss as an example, our goal is to get a classifier that has much higher
confidence for the true class (i.e., the value g(x)c) than others (i.e., the values g(x)c(cid:48) for
c(cid:48) (cid:54)= c), so we want all the differences g(x)c − g(x)c(cid:48) for c (cid:54)= c(cid:48) to be as large as possible. If
(cid:54)= c, of course, (cid:96) on (x, c) is not smaller than 1;
g wrongly classifies x, i.e., arg max
g(x)c(cid:48)
however, even thought g correctly classifies x, the loss value can not decrease to zero unless
g(x)c − g(x)c(cid:48) ≥ 1 for all c(cid:48) (cid:54)= c.
Let {ci}k+1
i=1 = {c1, . . . , ck+1} be a set of classes from C. Given the matrix W ∈ R(k+1)×n,
we have g(x) = W f (x) as a classifier that composite the feature extractor g and linear
classifier W . The supervised risk of f is defined as the risk of g when the best W is chosen:
c(cid:48)
Lsup(T , f ) :=
inf
W ∈R(k+1)×n
Lsup(T , W f ).
4
Generalization Bounds for Adversarial Contrastive Learning
When training a feature extractor f on the upstream task, we do not make predictions
on the examples, so we can't define the risk of the feature extractor f as we do for the
classifier g. Our goal on the upstream task is to train a feature extractor that can perform
well on the downstream tasks, so we consider the potential of the feature extractor here, i.e.,
the minimal possible classification risk of a linear classifier on the feature extracted by f . So
we define the risk of the feature extractor f as above by taking the infimum over all linear
classifiers.
Definition 2 (Mean Classifier, Saunshi et al., 2019) For a function f and task T =
{c1, . . . , ck+1}, the mean classifier is W μ, whose cth row is the mean μc := E
[f (x)] and
x∼Dc
we define Lμ
sup(T , f ) := Lsup(T , W μf ).
Since Lsup(T , f ) involves taking infimum over all possible linear classifiers, it is difficult to
analyze Lsup(T , f ) and establish connections between the risk of the unsupervised upstream
task and Lsup(T , f ). We introduce the mean classifier to bridge them by bounding average
Lμ
sup(T , f ) over the tasks with the risk of the unsupervised upstream risk (for more details,
please refer to §4).
Definition 3 (Average Supervised Risk) The average supervised risk for a function f
on (k + 1)-way tasks is defined as:
Lsup(f ) :=
E
{ci}k+1
i=1 ∼ρk+1
[Lsup({ci}k+1
i=1 , f )|ci (cid:54)= cj]
Given the mean classifier, the average supervised risk for a function f is defined as follows:
Lμ
sup(f ) :=
E
{ci}k+1
i=1 ∼ρk+1
[Lμ
sup({ci}k+1
i=1 , f )|ci (cid:54)= cj].
In contrastive learning, the feature extractor is trained as a pretrained model to be
used on downstream tasks. There may be many different downstream tasks such as binary
classification tasks with classes {c1, c2} ⊆ C and many other multi-class classification tasks,
so here we consider the average error of Lμ
sup(T , f ) over all possible tasks T sampled from
ρk+1 as the final performance measure of a feature extractor f .
3.3 Contrastive Learning Algorithm
We denote k as the number of negative samples used for training and (x, x+) ∼ Dsim,
(x−
1 , . . . , x−
k)∼Dk
neg.
Definition 4 (Unsupervised Risk) The unsupervised risk is defined as follows:
Lun(f ) := E[(cid:96)({f (x)T (f (x+) − f (x−
i ))}k
i=1)].
(cid:110)
Given M samples
j1, . . . , x−
jk)
of unsupervised risk is defined as follows:
(xj, x+
j , x−
(cid:111)M
j=1
from Dsim × Dk
neg, the empirical counterpart
(cid:98)Lun(f ) :=
1
M
M
(cid:88)
j=1
(cid:96)({f (xj)T (f (x+
j ) − f (x−
ji))}k
i=1).
5
Zou and Liu
In the contrastive learning upstream task, we want to learn a feature extractor f such that
f maps examples from the same class to similar features and makes the features of examples
from different classes far away from each other. So for the examples (x, x+, x−
k ), we
want f (x)T f (x+) to be as large as possible while f (x)T f (x−
i ), i = 1, . . . , k to be as small as
possible. The loss (cid:96) we defined before elegantly captures the aim of contrastive learning, if
we set vi = f (x)T f (x+) − f (x)T f (x−
i=1) will yield
large f (x)T f (x+) and small f (x)T f (x−
i ), i = 1, . . . , k. So optimizing over Lun(f ) can reach
our goal for contrastive learning.
i ), minimizing (cid:96)({f (x)T (f (x+) − f (x−
1 , . . . , x−
i ))}k
Following Saunshi et al. (2019), the unsupervised risk can be described by the following
equation:
Lun(f ) =
E
i ∼ρk+1
c+,c−
x,x+∼D2
E
c+ ,x−
i ∼D
[(cid:96)({f (x)T (f (x+) − f (x−
i ))}k
i=1)].
c−
i
The Empirical Risk Minimization (ERM) algorithm is used to find a function (cid:98)fERM ∈
(cid:98)Lun(f ) that minimizes the empirical unsupervised risk. The function (cid:98)fERM can be
arg min
f ∈F
subsequently used for supervised linear classification tasks.
3.4 Adversarial Setup
A key question in adversarial contrastive learning is that of how to define the adversary
sample in contrastive learning. From a representation perspective, one can find a point (cid:101)x
that is close to x and keeps the feature f ((cid:101)x) both as far from f (x+) as possible and as close
to the feature of some negative sample f (x−) as possible. Inspired by this intuition, we
define the Contrastive Adversary Sample as follows:
Definition 5 (U-Contrastive Adversary Sample) Given a neighborhood U(x) of x, x+ ∼
Dc+, x−
for i = 1, . . . , k, we define the U-Contrastive Adversary Sample of x as fol-
lows:
i ∼ Dc−
i
(cid:101)x := arg sup
x(cid:48)∈U (x)
E
x+∼Dc+ ,x−
i ∼D
c−
i
[(cid:96)({f (x(cid:48))T (f (x+) − f (x−
i ))}k
i=1)].
In this article, we suppose that the loss function (cid:96) is convex. By the subadditivity of
sup, we have, ∀f ∈ F:
E
x+∼Dc+
x−
i ∼D
c−
i
sup
x(cid:48)∈U (x)
[(cid:96)({f (x(cid:48))T(f (x+)−f (x−
i ))}k
i=1)] ≤ E
(cid:96)({f (x(cid:48))T(f (x+)−f (x−
i ))}k
i=1)].
[ sup
x(cid:48)∈U (x)
x+∼Dc+
x−
i ∼D
c−
i
(1)
In the following sections, we analyze the theoretical properties of the right-hand side of
(1), which can be easily optimized in practice by Adversarial Empirical Risk Minimization
(AERM).
The U-Adversarial Unsupervised Risk and its surrogate risk can be defined as below.
Definition 6 (U-Adversarial Unsupervised Risk) Given a neighborhood U(x) of x, the
U-Adversarial Unsupervised Risk of a presentation function f is defined as follows:
(cid:101)Lun(f ) := E
c+,c−
i
∼ρk+1
E
x∼Dc+
[ sup
x(cid:48)∈U (x)
E
x+∼Dc+
x−
i ∼D
c−
i
[(cid:96)({f (x(cid:48))T (f (x+) − f (x−
i ))}k
i=1)]].
(2)
6
Generalization Bounds for Adversarial Contrastive Learning
Moreover, the surrogate risk of (2) is as follows:
(cid:101)Lsun(f ) = E
c+,c−
i
∼ρk+1
E
x,x+∼D2
x−
i ∼D
c−
i
c+
sup
x(cid:48)∈U (x)
(cid:96)({f (x(cid:48))T (f (x+) − f (x−
i ))}k
i=1).
By (1), we have (cid:101)Lun(f ) ≤ (cid:101)Lsun(f ) for any f ∈ F. The Adversarial Supervised Risk of a
classifier g for a task T is defined as follows:
(cid:101)Lsup(T , g) :=
E
(x,c)∼DT
[ sup
x(cid:48)∈U (x)
(cid:96)({g(x)c − g(x)c(cid:48)}c(cid:48)(cid:54)=c)].
The Adversarial Supervised Risk of a representation function f for a task T is defined as
follows:
(cid:101)Lsup(T , f ) :=
inf
W ∈R(k+1)×n
(cid:101)Lsup(T , W f ).
(3)
For the mean classifier, we define:
sup(T , f ) := (cid:101)Lsup(T , W μf )
(cid:101)Lμ
The Average Adversarial Supervised Risk for a representation function is as defined
below.
Definition 7 (Average U-Adversarial Supervised Risk)
(cid:101)Lsup(f ) :=
E
{ci}k+1
i=1 ∼ρk+1
[(cid:101)Lsup({ci}k+1
i=1 , f )|ci (cid:54)= cj].
For the mean classifier, we have the following:
(cid:101)Lμ
sup(f ) :=
E
{ci}k+1
i=1 ∼ρk+1
[(cid:101)Lμ
sup({ci}k+1
i=1 , f )|ci (cid:54)= cj].
4 Theoretical Analysis for Adversarial Contrastive Learning
This section presents some theoretical results for adversarial contrastive learning.
4.1 One Negative Sample Case
Let τ = P
c,c(cid:48)∼ρ2
[c = c(cid:48)], σ be an M -dimensional Rademacher random vector with i.i.d. en-
tries, define (gf )|S = (gf (z1), . . . , gf (zM )) and RS(G) :=
E
σ∼{±1}M
G := {gf (x, x+, x−
1 , . . . , x−
k ) = sup
(cid:96) (cid:0){f (x(cid:48))T (f (x+) − f (x−
i ))}k
i=1
x(cid:48)∈U (x)
(cid:34)
sup
f ∈F
(cid:10)σ, (gf )|S
(cid:1) |f ∈ F},
(cid:35)
(cid:11)
where
let (cid:98)f ∈
arg min
f ∈F
(cid:98)(cid:101)Lsun(f ) where (cid:98)(cid:101)Lsun(f ) is the empirical counterpart of (cid:101)Lsun(f ), we have:
7
Zou and Liu
Theorem 8 (The proof can be found in the Appendix A.1) Let (cid:96) : Rk −→ R be bounded
by B. Then, for any δ ∈ (0, 1),with a probability of at least 1 − δ over the choice of the
training set S = {(xj, x+
j , x−
j )}M
(cid:101)Lsup( (cid:98)f ) ≤ (cid:101)Lμ
((cid:101)Lsun(f ) − τ (cid:96)(0)) +
j=1, for any f ∈ F:
1
1 − τ
sup( (cid:98)f ) ≤
1
1 − τ
AGM ,
where
AGM = O(
RS(G)
M
+ B
(cid:115)
log 1
δ
M
).
(4)
Remark 9 Theorem 8 shows that when the hypothesis class F is rich enough to contain
some f with low surrogate adversarial unsupervised risk, the empirical minimizer of the
surrogate adversarial unsupervised risk will then obtain good robustness on the supervised
downstream task.
1
Note that we can take f = (cid:98)f in the upper bound of Theorem 8 and get a bound (cid:101)Lsup( (cid:98)f ) ≤
1−τ ((cid:101)Lsun( (cid:98)f ) − τ (cid:96)(0)) + 1
1−τ AGM . Then we can see that if the output of AERM (i.e., (cid:98)f )
achieves small unsupervised adversarial risk, then (cid:98)f is a robust feature extractor such that it
can achieve good robustness after fine-tuning on the downstream tasks.
Theorem 8 gives a relationship between the robustness of the contrastive (upstream)
task and the robustness of the downstream classification tasks and explains why adversarial
contrastive learning can help improve the robustness of the downstream task, as shown
empirically in Kim et al. (2020); Ho and Vasconcelos (2020); Jiang et al. (2020).
4.2 Blocks of Similar Points
Saunshi et al. (2019) show a refined method that operates by using blocks of similar data
and determine that the method achieves promising performance both theoretically and
empirically. We adapt this method to adversarial contrastive learning.
1 , . . . , x+
b
from c+ ∼ ρ and b
negative i.i.d. samples from c− ∼ ρ. The block adversarial contrastive learning risk is as
follows:
Specifically, we sample (b + 1) i.i.d. similar samples x, x+
(cid:101)Lblock
sun (f ) := E
(cid:34)
(cid:32)
(cid:96)
sup
x(cid:48)∈U (x)
f (x(cid:48))T
(cid:32) (cid:80)b
i=1 f (x+
i )
b
−
(cid:80)b
i=1 f (x−
i )
b
(cid:33)(cid:33)(cid:35)
,
and its empirical counterpart is as follows:
block
sun (f ) :=
(cid:98)(cid:101)L
1
M
(cid:34)
M
(cid:88)
i=1
(cid:96)
sup
x(cid:48)∈U (xi)
(cid:32)
f (x(cid:48))T
(cid:32) (cid:80)b
j=1 f (x+
ij)
b
(cid:80)b
j=1 f (x−
ij)
b
−
(cid:33)(cid:33)(cid:35)
,
Theorem 10 (The proof can be found in the Appendix A.2) For any f ∈ F, we
have:
(cid:101)Lsup(f ) ≤
1
1 − τ
(cid:16)
(cid:17)
sun (f ) − τ (cid:96)(0)
(cid:101)Lblock
≤
(cid:16)
1
1 − τ
(cid:101)Lsun(f ) − τ (cid:96)(0)
(cid:17)
.
Remark 11 Theorem 10 shows that using blocks of similar data yields a tighter upper
bound for the adversarial supervised risk than in the case for pairs of similar data. Theorem
10 implies that using the blocks in adversarial contrastive learning may improve the robust
performance of the downstream tasks; this will be verified by the empirical results in §6.
8
Generalization Bounds for Adversarial Contrastive Learning
4.3 Multiple Negative Sample Case
This subsection extends our results to k negative samples. To achieve this, more definitions
are required. Let [k] denote the set {1, 2, . . . , k}.
Definition 12 We define a distribution D over the supervised tasks as follows: First,
sample k + 1 classes (allow repetition) c+, c−
k ∼ ρk+1, conditioned on the event that
c−
i
(cid:54)= c+, ∀i ∈ [k]. Then, set the task T as the set of distinct classes in {c+, c−
1 , . . . , c−
1 , . . . , c−
k }.
Definition 13 The Average U-Adversarial Supervised Risk of a representation function
f ∈ F over D is defined as follows:
(cid:101)Lsup(f ) := E
T ∼D
(cid:105)
(cid:104)
(cid:101)Lsup(T , f )
.
Let Edistinct be the event such that {c+, c−
1 , . . . , c−
k } is distinct and p =
P
1 ,...,c−
k )∼D
(c+,c−
For any f ∈ F, we have (The proof can be found in the Appendix A.3):
(cid:101)Lsup(f ) ≤
(cid:101)Lsup(f )
p
.
[Edistinct].
(5)
From (5), we can turn to analyze the relation between (cid:101)Lsup(f ) and (cid:101)Lsun(f ) in the
multiple negative sample case. Our Theorem 16 handles (cid:101)Lsup(f ) instead of (cid:101)Lsup(f ).
Assumption 14 Assume that ∀I1, I2 ⊆ [d] such that I1 ∪ I2 = [d], (cid:96) satisfies the following
inequations:
(cid:96)({vi}i∈I1) ≤ (cid:96)({vi}i∈[d]) ≤ (cid:96)({vi}i∈I1) + (cid:96)({vi}i∈I2),
(cid:96)({vi}i∈I2) ≤ (cid:96)({vi}i∈[d]) ≤ (cid:96)({vi}i∈I1) + (cid:96)({vi}i∈I2).
(6)
(7)
Proposition 15 (The proof can be found in the Appendix A.4) The hinge loss and
the logistic loss satisfy Assumption 14.
If C is finite, we obtain a simple (and informal) bound of (cid:101)Lsup( (cid:98)f ), for the more complex
case that allows infinite C and the formal form of Theorem 16 (Theorem 32), please refer to
the Appendix A.5.
Theorem 16 (The proof can be found in the Appendix A.6) Suppose C is finite, for
any c ∈ C, ρ(c) > 0, and (cid:96) satisfies Assumption 14. Then, with a probability of at least 1 − δ
over the choice of the training set S, ∀f ∈ F:
(cid:101)Lsup( (cid:98)f ) ≤ α(ρ)
(cid:16)
(cid:101)Lsun(f ) + AGM
(cid:17)
− β.
9
Zou and Liu
5 Generalization Bounds for Example Hypothesis Classes
This section presents a concrete analysis of the Rademacher complexity for linear hypothesis
class and multi-layer neural networks based on covering number (Wainwright, 2019, Definition
5.1). We first introduce some definitions and required lemmas.
Lemma 17 (Wainwright, 2019, Lemma 5.7, volume ratios and metric entropy)
Consider a pair of norms (cid:107) * (cid:107) and (cid:107) * (cid:107)(cid:48) on Rd, and let B and B(cid:48) be their corresponding unit
balls (i.e. B = {θ ∈ Rd|(cid:107)θ(cid:107) ≤ 1}, with B(cid:48) similarly defined). The δ-covering number of B in
the (cid:107) * (cid:107)(cid:48)-norm then obeys the following bounds (Wainwright, 2019, Lemma 5.7):
(cid:18) 1
δ
(cid:19)d vol(B)
vol(B(cid:48))
≤ N (δ; B, (cid:107) * (cid:107)(cid:48)) ≤
B + B(cid:48))
vol( 2
δ
vol(B(cid:48))
,
where we define the Minkowski sum A + B := {a + b : a ∈ A, b ∈ B}, vol(B) := (cid:82) 1{x ∈ B}dx
is the volume of B based on the Lebesgue measure, and N (δ; B, (cid:107) * (cid:107)(cid:48)) is the δ-covering number
of B with respect to the norm (cid:107) * (cid:107)(cid:48).
Lemma 18 (The proof can be found in the Appendix A.7) Let Bp(r) be the p-norm
ball in Rd with radius r. The δ-covering number of Bp(r) with respect to (cid:107) * (cid:107)p thus obeys the
following bound:
N (δ; Bp(r), (cid:107) * (cid:107)p) ≤
1 +
(cid:18)
(cid:19)d
.
2r
δ
Definition 19 (Wainwright, 2019, Definition 5.16, sub-Gaussian process) A collec-
tion of zero-mean random variables {Xθ, θ ∈ T} is a sub-Gaussian process with respect to a
metric ρX on T if:
E[eλ(Xθ−X
(cid:101)θ)] ≤ e
λ2ρ2
X (θ,(cid:101)θ)
2
, ∀θ, (cid:101)θ ∈ T, λ ∈ R.
It is easy to prove that the Rademacher process (Wainwright, 2019, §5.2) satisfies the
condition in Definition 19 with respect to the (cid:96)2-norm.
Lemma 20 (Wainwright, 2019, the Dudley's entropy integral bound) Let {Xθ, θ ∈
T} be a zero-mean sub-Gaussian process with respect to the induced pseudometric ρX from
Definition 19. Then, for any δ ∈ [0, D], we have:
(cid:34)
E
sup
θ,(cid:101)θ∈T
(Xθ − X
(cid:35)
(cid:101)θ)
≤ 2E
sup
γ,γ(cid:48)∈T
ρX (γ,γ(cid:48))≤δ
(Xγ − Xγ(cid:48))
+ 32J (δ/4; D).
(8)
Here, D = supθ,(cid:101)θ∈T ρX (θ, (cid:101)θ) and J (a; b) = (cid:82) b
u-covering number of T in the ρX -metric.
a
(cid:112)lnNX (u; T)du, where NX (u; T) is the
Remark 21 Given θ0 ∈ T, since E [Xθ0] := E [(cid:104)θ0, σ(cid:105)] = 0, we have:
(cid:20)
E
Xθ
sup
θ∈T
(cid:21)
= E
(cid:20)
sup
θ∈T
(cid:21)
(Xθ − Xθ0)
(cid:34)
≤ E
10
sup
θ,(cid:101)θ∈T
(Xθ − X
.
(9)
(cid:35)
(cid:101)θ)
Generalization Bounds for Adversarial Contrastive Learning
Combining (8) with (9), we have:
E
(cid:20)
(cid:21)
Xθ
sup
θ∈T
≤ 2E
sup
γ,γ(cid:48)∈T
ρX (γ,γ(cid:48))≤δ
(Xγ − Xγ(cid:48))
+ 32J (δ/4; D),
which can be used to draw the upper bound of RS(G) by establishing a connection between the
Rademacher process and the Rademacher complexity of the hypothesis classes when proper
norm is chosen. For more details, please refer to the Appendix, details are in the proof of
Theorem 22, Theorem 24 and Theorem 26.
To make Theorem 8 and Theorem 16 concrete, we need to upper bound RS(G). Assume
that loss (cid:96) is a non-increasing function; for example, hinge loss and logistic loss satisfy this
(cid:96) (cid:0)f (x(cid:48))T (f (x+) − f (x−))(cid:1) |f ∈ F}. Since (cid:96) is
assumption. Let G = {gf (x, x+, x−) = sup
x(cid:48)∈U (x)
non-increasing, we have:
(cid:26)
(cid:18)
G =
(cid:96)
min
x(cid:48)∈U (x)
(cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1)
(cid:19)
(cid:27)
|f ∈ F
.
Let H =
(cid:26)
min
x(cid:48)∈U (x)
(cid:0)f (x(cid:48))T (f (x+) − f (x−))(cid:1) |f ∈ F
(cid:27)
. Suppose (cid:96) is η-Lipschitz. By the
Ledoux-Talagrand contraction inequality (Ledoux and Talagrand, 2013), we have:
RS(G) ≤ ηRS(H).
(10)
Thus, we only need to upper bound RS(H). Let (cid:107)A(cid:107)a,b be the (cid:96)b-norm of the (cid:96)a-norm
i=1. Let X be a matrix
It is easy to see that
of the rows of A. Consider the training set S = {(xi, x+
i )}M
whose ith row is xi. We define X + and X − in a similar way.
∀p ≥ 1, ∀i = 1, . . . , M , (cid:107)xi(cid:107)p ≤ (cid:107)X(cid:107)p,∞.
i , x−
5.1 Linear Hypothesis Class
Let F = {f : x −→ W x|W ∈ Rn×m, |||W |||p ≤ w}. To simplify notations, ∀p ≥ 1 and 1
let
p + 1
p∗ = 1,
P = max(cid:8)(cid:107)X(cid:107)p,∞, (cid:107)X +(cid:107)p,∞, (cid:107)X −(cid:107)p,∞
(cid:9) , P ∗ = max(cid:8)(cid:107)X(cid:107)p∗,∞, (cid:107)X +(cid:107)p∗,∞, (cid:107)X −(cid:107)p∗,∞
(cid:9) .
(11)
We then have ∀p ≥ 1,
∀i = 1, . . . , M , (cid:107)xi(cid:107)p, (cid:107)x+
i (cid:107)p, (cid:107)x−
i (cid:107)p ≤ P.
We now present the upper bound of RS(H) under (cid:107) * (cid:107)r attack.
Theorem 22 (RS(H) under (cid:107) * (cid:107)r attack for linear models) Consider the (cid:96)r attack,
i.e. let U(x) = {x(cid:48)|(cid:107)x(cid:48) − x(cid:107)r ≤ (cid:15)}. We then have:
RS(H) = O
(cid:16)
[P P ∗ + (cid:15)R∗s(r∗, p, m)]
(cid:104)
ms(p∗, p, m)w2
√
(cid:105)(cid:17)
,
M
where s(p, q, n) := n
(11).
max
(cid:110) 1
p − 1
q , 1
q − 1
p
(cid:111)
, 1
p + 1
p∗ = 1, 1
r + 1
r∗ = 1, and R∗ is defined similarly to
11
Zou and Liu
The proof can be found in the Appendix A.8.
Remark 23 Combining Theorem 22 with (4), we have:
AGM = O
[P P ∗ + (cid:15)R∗s(r∗, p, m)] mηs(p∗, p, m)w2 + B
√
M
(cid:113)
log 1
δ
.
(12)
5.2 Multi-layer Neural Network
In this section, we analyze fully connected multi-layer neural networks.
Suppose that X ⊆ Rm. Let F = {Wdσ(Wd−1σ(* * * σ(W1x))) | |||Wl||| ≤ Ml, l = 1, . . . , d},
where |||*||| is the norm of the matrix and σ(*) is an elementwise L-Lipschitz function with
σ(0) = 0 and Wl ∈ Rhl×hl−1, where hd = n, h0 = m. Assume (cid:96) is η-Lipschitz and non-
increasing. From (10), we need only to bound the Rademacher complexity of H.
We here consider two cases of the matrix norm |||*|||. Let U(x) = {x(cid:48)|(cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15)} for
some p ≥ 1.
5.2.1 Frobenius-norm Case.
We first consider using the Frobenius-Norm in the definition of the multi-layer neural
networks hypothesis class F.
Theorem 24 (RS(H) under (cid:107) * (cid:107)p attack for NNs under |||*|||F constraint) Let U(x) =
{x(cid:48)|(cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15)} (i.e. consider the (cid:96)p attack), σ(0) = 0 with Lipschitz constant L and let
F = (cid:8)Wdσ(Wd−1σ(* * * σ(W1x)))(cid:12)
l , l = 1, . . . , d(cid:9). We then have:
(cid:12)|||Wl|||F ≤ M F
RS(H) = O
(cid:118)
(cid:117)
(cid:117)
(cid:116)
√
√
d
M
,
hlhl−1K
d
(cid:88)
l=1
(13)
where
where
BF
X,(cid:15) = Ld−1
M F
l max
(cid:110)
1, m
d
(cid:89)
l=1
K = 2BF
X,(cid:15) * (cid:0)BF
X + + BF
X −
(cid:1) ,
1
2 − 1
p
(cid:111)
((cid:107)X(cid:107)p,∞ +(cid:15)) , BF
X = Ld−1
M F
l max
(cid:110)
1, m
d
(cid:89)
l=1
1
2 − 1
p
(cid:111)
(cid:107)X(cid:107)p,∞.
The proof can be found in the Appendix A.9.
Remark 25 Combining Theorem 24 with (4), we have:
(cid:115)
AGM = O
Kη
(cid:115)
.
log 1
δ
M
+ B
d (cid:80)d
l=1 hlhl−1
M
12
Generalization Bounds for Adversarial Contrastive Learning
5.2.2 (cid:96)1,∞-norm Case
We consider the (cid:107) * (cid:107)1,∞ norm constraint.
Theorem 26 (RS(H) under (cid:107) * (cid:107)p attack for NNs under (cid:107) * (cid:107)1,∞ constraint) Let U(x) =
{x(cid:48)|(cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15)} (i.e. consider the (cid:96)p attack), σ(0) = 0 with Lipschitz constant L; moreover,
let F =
(cid:110)
Wdσ(Wd−1σ(* * *σ(W1x)))(cid:12)
(cid:12)(cid:107)Wl(cid:107)1,∞≤M 1,∞
(cid:111)
, l=1, . . . ,d
. We then have:
l
RS(H) = O
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
l=1
hlhl−1
(cid:112)
dK0K1
√
M
,
where
where
K0 = 2B1,∞
X,(cid:15) * (cid:0)B(cid:48)
X + + B(cid:48)
X −
(cid:1) , K1 =
K0
2
(cid:16)
+ B(cid:48)
X,(cid:15) *
X + + B1,∞
B1,∞
X −
(cid:17)
,
B(cid:48)
X,(cid:15) = Ld−1
B1,∞
X,(cid:15) = Ld−1
d
(cid:89)
l=1
d
(cid:89)
l=1
hlM 1,∞
l m1− 1
p ((cid:107)X(cid:107)p,∞ + (cid:15)) , B(cid:48)
X = Ld−1
d
(cid:89)
l=1
hlM 1,∞
l m1− 1
p (cid:107)X(cid:107)p,∞,
M 1,∞
l
((cid:107)X(cid:107)p,∞ + (cid:15)) , B1,∞
X = Ld−1
d
(cid:89)
l=1
M 1,∞
l
(cid:107)X(cid:107)p,∞.
The proof can be found in the Appendix A.10.
Remark 27 Combining Theorem 26 with (4), we have:
(cid:115)
AGM = O
η
dK0K1
(cid:80)d
l=1 hlhl−1
M
+ B
(cid:115)
.
log 1
δ
M
Remark 28 Our bound has important implications for the design of regularizers for adver-
sarial contrastive learning. To achieve superior robust performance on the downstream tasks,
the usual approach is to make (cid:107)X(cid:107)p,∞ small. For example, Pytorch scales the images to
tensors with entries within the range [0, 1]. Moreover, Theorem 24 shows that we can take
the norms of the layers as the regularizers to reduce the adversarial supervised risk.
In our analysis for the Rademacher complexity, we consider models with norm-constrained
weights, which means that the hypothesis class is uniformly Lipschitz, although the Lipschitz
constant may be large (the product of maximal weight norms for the layers). One may
wonder what will happen if we remove the constrains on the norm of the weights. For
simplicity, let's consider a hypothesis class H ⊆ {±1}X for binary classification, we have:
(cid:34)
RS(H) = E
σσσ
sup
h∈H
(cid:35)
σih(xi)
,
1
n
n
(cid:88)
i=1
where σ1, . . . , σn ∈ {±1} are i.i.d. uniform random variables. We can regard σ1, . . . , σn as
random labels that we need to fit by hypothesis from H, so we can interpret RS(H) as the
13
Zou and Liu
Attack
PGD
FGSM
(cid:15)
0.01
0.02
0.01
0.02
Type
Clean
Adv
Clean
Adv
Clean
Adv
Clean
Adv
0
75.73
67.67
53.11
46.71
74.42
67.28
54.28
45.93
λ
0.002
74.8
69.25
55.72
48.17
76.13
68.79
54.29
45.94
0.05
74.5
68.59
55.73
48.17
76.12
68.8
54.28
45.92
0.2
75.67
67.65
55.72
48.16
76.11
68.8
66.68
55.64
Table 1: Results of experiments on the regularizer. In this table, we list the clean accuracy
(Clean) and adversarial accuracy (Adv) of the mean classifier under the PGD
and FGSM attack with (cid:15) = 0.01 and (cid:15) = 0.02. λ is chosen from {0, 0.002, 0.05, 0.2},
and λ = 0 indicates no regularizer.
ability of H to fit random ±1 binary labels. Now let H be the neural network, if we do
not constrain the norm of the weights, theoretically, the universal approximation theorem
(Maiorov and Pinkus, 1999) tells us that neural networks can fit any continuous function
on a bounded input space, which means that in this case RS(H) ≈ 1, leading to vacuous
bounds in the binary classification case; experimentally, Zhang et al. (2017) show that deep
neural networks easily fit random labels.
From another perspective, to derivate an upper bound for RS(H) by covering number,
we need to find a δ-covering set for H under some metric ρ(*, *). If the weights of the layers
are not bounded, we can not cover H by a finite subset of H, the δ-covering number of H
under ρ(*, *) will be infinite, which means that Lemma 20 does not hold. So it is difficult to
go beyond the Lipschitz network.
6 Experiments
In this section, we conduct several experiments to support our theory. We emphasize
that we are not proposing a method to try to get better robustness on the downstream tasks,
we do the experiments to verify our two claims from our theoretical results: (1) As shown in
Remark 11, using the blocks may improve the robust performance; (2) As shown in Remark
28, using the norms of the layers of the neural networks as the regularizer may help improve
the robust performance.
Data sets. We use two data sets (Krizhevsky and Hinton, 2009) in our experiments: (1)
the CIFAR-10 data set and (2) the CIFAR-100 data set. CIFAR-10 contains 50000/10000
train/test images with size 32 × 32, which are categorized into 10 classes. CIFAR-100
contains 50000/10000 train/test images with size 32 × 32, which are categorized into 100
classes.
Model. We use a neural network with two convolutional layers and one fully connected
layer. Following He et al. (2020), we use the Stochastic Gradient Descent (SGD) optimizer
14
Generalization Bounds for Adversarial Contrastive Learning
(a) Influence on clean accuracy
(b) Influence on adversarial accuracy
Figure 1: The effect of block size on the accuracy. In the figure, we show the clean accuracy
and the adversarial accuracy of the mean classifier under PGD and FGSM attack
with (cid:15) = 0.01 and (cid:15) = 0.02. The block size is choosen from {1, 2, 4, 6, 8, 10}. (a)
The influence on the clean accuracy; (b) The influence on the adver-
sarial accuracy.
with momentum 0.9 but set the weight decay to be 5 × 10−4 and the learning rate to be
0.001.
Evaluation of robustness. For representation f , we first calculate (cid:98)uc = 1
i=1 f (xi)
to estimate the c-th row of the mean classifier, where x1, . . . , xnc are the data points with
label c in our training set. Denote (cid:99)W μ as the estimator of W , we use the robustness of the
classifier (cid:99)W μf as an evaluation of the robustness of f on the downstream task.
nc
(cid:80)nc
We show the results for CIFAR-10 here; the results for CIFAR-100 can be found in the
Appendix B.
6.1 Improvement from the regularizer
Inspired by our bound (13) in Theorem 24 and Theorem 8, the adversarial supervised risk
can be upper bounded by the sum of the adversarial unsupervised loss and AGM , which is
related to the maximal Frobenius-norm of the network layers. We choose to simultaneously
optimize the contrastive upstream pre-train risk and the Frobenius norm of the parameters
of the model. We set the norm of the parameters for the layers as a regularizer and test the
performance of the mean classifier; here, W μ is calculated by averaging all features of the
training data set as done in Nozawa et al. (2020). We use a hyper-parameter λ to balance
the trade-off of the the contrastive upstream pre-train risk and the Frobenius norm of the
parameters of the model. We choose to minimize the following regularized empirical risk:
L(f ) = (cid:98)(cid:101)Lsun(f ) + λN (f )
(14)
where N (f ) is a regularizer that constrains the Frobenius norm of the parameters of the
model f , here we choose N (f ) = (cid:80)d
l=1 |||Wl|||F where |||Wl|||F is the Frobenius norm of the
15
1246810block size556065707580clean accuracy(%)pgd-0.01pgd-0.02fgsm-0.01fgsm-0.021246810block size45505560657075adv accuracy(%)pgd-0.01pgd-0.02fgsm-0.01fgsm-0.02Zou and Liu
parameters for the l-th layer of f and:
(cid:98)(cid:101)Lsun(f )=
1
M
M
(cid:88)
j=1
max
x(cid:48)
j ∈U (xj )
(cid:96)({f (x(cid:48)
j)T(f (x+
j )−f (x−
ji))}k
i=1).
More details about our algorithm are in Algorithm 1.
Algorithm 1: The AERM algorithm for adversarial contrastive learning
Input
(cid:110)
(cid:111)M
: The training data set S =
j1, . . . , x−
jk)
neg; the hyper-parameter λ in (14); the adversarial perturbation
sampled from
Dsim × Dk
U; learning rate α; the total iteration number T ;
(xj, x+
j , x−
j=1
1 initialize θ0 to be randomized parameters;
2 t ← 0;
3 while t < T do
4
randomly sample a batch of data with size N : B ⊆ S ;
(cid:101)B ← ∅;
for (x, x+, x−
1 , . . . , x−
calculate adversarial example
k ) in B do
(cid:16)(cid:8)fθt(x(cid:48))T (cid:0)fθt(x+) − fθt(x−
i )(cid:1)(cid:9)k
(cid:17)
;
i=1
1 , . . . , x−
k )};
(cid:96)
̃x ∈ arg sup
x(cid:48)∈U (x)
(cid:101)B ← (cid:101)B ∪ {( ̃x, x+, x−
(cid:80)
end
L(fθt) = 1
N
θt+1 ← θt − α∇θtL(fθt);
t ← t + 1;
( ̃x,x+,x−
5
6
7
8
9
10
11
12
13 end
1 ,...,x−
k )∈ (cid:101)B (cid:96)
(cid:16)(cid:8)fθt( ̃x)T (cid:0)fθt(x+) − fθt(x−
i )(cid:1)(cid:9)k
i=1
(cid:17)
+ λN (fθt);
Output : The feature extractor fθT ∈ F that tries to minimize (14);
The results are shown in Table 1. From Table 1, we can see that the F -norm regularizer
can improve the adversarial accuracy (the prediction performance of a model on adversarial
examples generated by attacker) of the mean classifier, which is in line with our Theorem 24.
6.2 Effect of block size
To verify Theorem 10, we analyze the effect of block size on the adversarial accuracy of the
mean classifier. Figure 1 presents the results for clean accuracy and adversarial accuracy,
respectively. From Figure 1, we can see that a larger block size will yield better adversarial
accuracy. The results are consistent with Theorem 10: as the block size grows, Theorem 10
shows that we are optimizing a tighter bound, which leads to better performance as shown
in Figure 1.
16
Generalization Bounds for Adversarial Contrastive Learning
7 Conclusion
This paper studies the generalization performance of adversarial contrastive learning. We
first extend the contrastive learning framework to the adversarial case, then we upper bound
the average adversarial risk of the downstream tasks with the adversarial unsupervised risk
of the upstream task and an adversarial Rademacher complexity term. Furthermore, we
provide the upper bound of the adversarial Rademacher complexity for linear models and
multi-layer neural networks. Finally, we conduct several experiments and the experimental
results are consistent with our theory.
Acknowledgments and Disclosure of Funding
This work is supported by the National Natural Science Foundation of China under Grant
61976161.
17
Zou and Liu
Appendix A. Proofs
In this section, we display the proofs of our theorems, lemmas and corollaries. For reading
convenience, we will restate the theorem before proving.
A.1 Proof of Theorem 8
In the below, we present some useful lemmas that will be used in the proofs of our main
theorems.
Lemma 29 For any f ∈ F, we have:
(cid:101)Lsup(f ) ≤ (cid:101)Lμ
sup(f ) ≤
1
1 − τ
((cid:101)Lun(f ) − τ (cid:96)(0)) ≤
1
1 − τ
((cid:101)Lsun(f ) − τ (cid:96)(0)).
(A.1)
Remark 30 (cid:98)(cid:101)Lsun(f ) denotes the empirical (cid:101)Lsun(f ) and (cid:98)f ∈ arg min
f ∈F
(cid:98)(cid:101)Lsun(f ). Applying
Lemma 29 to (cid:98)f shows that, if we can train a robust feature extractor with low surrogate
adversarial unsupervised risk, we can obtain a robust classifier with low adversarial supervised
risk on the downstream task.
Lemma 31 Let (cid:96) : Rk −→ R be bounded by B. Then, for any δ ∈ (0, 1), with a probability of
at least 1 − δ over the choice of the training set S = {(xj, x+
j=1,
for any f ∈ F:
j=1 = {zj}M
j1, . . . , x−
jk)}M
j , x−
where AGM = O( RS (G)
M + B
{gf (x, x+, x−
1 , . . . , x−
k ) = sup
x(cid:48)∈U (x)
(cid:101)Lsun( (cid:98)f ) ≤ (cid:101)Lsun(f ) + AGM ,
(cid:113) log 1
M ), RS(G) :=
(cid:96) (cid:0){f (x(cid:48))T (f (x+) − f (x−
E
σ∼{±1}M
i ))}k
δ
i=1
(cid:34)
(cid:35)
(cid:11)
(cid:10)σ, (gf )|S
sup
f ∈F
(cid:1) |f ∈ F}, where σ is an M -
, and G :=
dimensional Rademacher random vector with i.i.d. entries and (gf )|S = (gf (z1), . . . , gf (zM )).
Proof [Proof of Lemma 29] By the definition of (cid:101)Lsup(T , f ), i.e., (3), it's obvious that
(cid:101)Lsup(f ) ≤ (cid:101)Lμ
sup(f ), so we only need to prove the second part of (A.1). From definition (2),
we have, ∀f ∈ F:
(cid:101)Lun(f ) =
E
c+,c−∼ρ2
sup
x(cid:48)∈U (x)
E
x+∼Dc+
x−∼Dc−
(cid:0)(cid:96) (cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1)(cid:1)
E
x∼Dc+
(cid:40)
(cid:34)
(cid:96) (cid:0)f (x(cid:48))T (μc+ − μc−)(cid:1)
(cid:35)(cid:41)
(i)
≥
E
c+,c−∼ρ2
E
x∼Dc+
(ii)
= (1 − τ )
E
c+,c−∼ρ2
sup
x(cid:48)∈U (x)
(cid:34)
(cid:40)
E
x∼Dc+
(cid:96) (cid:0)f (x(cid:48))T (μc+ − μc−)(cid:1)
sup
x(cid:48)∈U (x)
(cid:41)
c+ (cid:54)= c−
+ τ (cid:96)(0),
(cid:35) (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(A.2)
where (i) comes from the convexity of (cid:96) and Jensen's Inequality, and (ii) comes from the
property of conditional expectations. Then we have:
18
Generalization Bounds for Adversarial Contrastive Learning
E
c+,c−∼ρ2
(cid:40)
(cid:34)
E
x∼Dc+
(cid:40)
(cid:96) (cid:0)f (x(cid:48))T (μc+ − μc−)(cid:1)
sup
x(cid:48)∈U (x)
(cid:41)
(cid:35) (cid:12)
(cid:12)
c+ (cid:54)= c−
(cid:12)
(cid:12)
(cid:12)
(cid:34)
sup
x(cid:48)∈U (x)
(cid:96) (cid:0)f (x(cid:48))T (μc+ − μc−)(cid:1)
(cid:35)
(i)
=
E
c+,c−∼ρ2
DT (c+) E
x∼Dc+
(cid:34)
+ DT (c−) E
x∼Dc−
(cid:40)
(ii)
=
E
c+,c−∼ρ2
DT (c+) E
x∼Dc+
(cid:34)
sup
x(cid:48)∈U (x)
(cid:34)
sup
x(cid:48)∈U (x)
(cid:96) (cid:0)f (x(cid:48))T (μc− − μc+)(cid:1)
(cid:41)
c+ (cid:54)= c−
(A.3)
(cid:35) (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:96) (cid:0)g(x(cid:48))c+ − g(x(cid:48))c−
(cid:35)
(cid:1)
+ DT (c−) E
x∼Dc−
sup
x(cid:48)∈U (x)
(cid:96) (cid:0)g(x(cid:48))c− − g(x(cid:48))c+
(cid:1)
c+ (cid:54)= c−
(cid:41)
,
(cid:35) (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
where T = {c+, c−}, g(x) =
μT
c+f (x)
μT
c−f (x)
= W μf (x) and (i) comes from the symmetry of
c+, c−; (ii) is directly from some linear algebras. From (A.3) we know that:
E
c+,c−∼ρ2
(cid:40)
(cid:34)
E
x∼Dc+
(cid:40)
sup
x(cid:48)∈U (x)
(cid:34)
(i)
=
E
c+,c−∼ρ2
E
c∼DT
E
x∼Dc
sup
x(cid:48)∈U (x)
(cid:96)
(cid:35) (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:16)(cid:8)g(x(cid:48))c − g(x(cid:48))c(cid:48)
(cid:96) (cid:0)f (x(cid:48))T (μc+ − μc−)(cid:1)
c+ (cid:54)= c−
(cid:41)
(cid:9)
c(cid:48)(cid:54)=c
(cid:41)
(cid:17)
(cid:35) (cid:12)
(cid:12)
c+ (cid:54)= c−
(cid:12)
(cid:12)
(cid:12)
(ii)
=
E
c+,c−∼ρ2
(cid:34)
(cid:101)Lsup
(cid:0)(cid:8)c+, c−(cid:9) , W μf (cid:1)
(cid:35)
(cid:12)
(cid:12)
c+ (cid:54)= c−
(cid:12)
(cid:12)
(cid:12)
(cid:34)
(iii)
=
E
c+,c−∼ρ2
(cid:101)Lμ
sup
(cid:0)(cid:8)c+, c−(cid:9) , f (cid:1)
(cid:35)
(cid:12)
(cid:12)
c+ (cid:54)= c−
(cid:12)
(cid:12)
(cid:12)
(iv)
= (cid:101)Lμ
sup(f ),
(A.4)
where (i) is due to the tower property of expectation;(ii) is obvious by the definition of
(cid:101)Lsup(T , g); (iii) comes from the definition of (cid:101)Lμ
sup(T , f ) and (iv) is from the definition of
(cid:101)Lμ
sup(f ). Combine (A.2) with (A.4), we conclude that:
(cid:101)Lun(f ) ≥ (1 − τ )(cid:101)Lμ
sup(f ) + τ (cid:96)(0), ∀f ∈ F.
So we have:
(1 − τ )(cid:101)Lsup(f ) + τ (cid:96)(0) ≤ (1 − τ )(cid:101)Lμ
sup(f ) + τ (cid:96)(0) ≤ (cid:101)Lun(f ), ∀f ∈ F.
(A.5)
Rearranging (A.5) yields (A.1).
19
Zou and Liu
Proof [Proof of Lemma 31] Denote (x, x+, x−
Mohri et al. (2012), we have: With probability at least 1 − δ
set S,
1 , * * * , x−
k ) by z, then by the Theorem 3.3 in
2 over the choice of the training
(cid:20) 1
B
E
z
(cid:21)
gf (z)
≤
1
M
M
(cid:88)
i=1
1
B
gf (zi) +
2
M
RS(
G
B
) + 3
which is equivalent to:
(cid:115)
log 4
δ
M
,
(cid:101)Lsun(f ) ≤ (cid:98)(cid:101)Lsun(f ) +
2
M
RS(G) + 3B
(cid:115)
log 4
δ
M
, ∀f ∈ F.
(A.6)
(cid:101)Lsun(f ), since E
S
(cid:20)
(cid:98)(cid:101)Lsun(f )
(cid:21)
= (cid:101)Lsun(f ) and (cid:96) is bounded by B, Hoeffding's
Let f ∗ = arg min
f ∈F
inequality tells us that: ∀f ∈ F, ∀t ∈ R:
(cid:21)
(cid:20)
(cid:98)(cid:101)Lsun(f ) − (cid:101)Lsun(f ) ≥ t
P
≤ e− 2M t2
B2 .
Set t = B
(cid:113) log 2
δ
2M , we have: ∀f ∈ F, with probability at least 1 − δ
2 ,
(cid:98)(cid:101)Lsun(f ) − (cid:101)Lsun(f ) ≤ B
(cid:115)
log 2
δ
2M
.
(A.7)
Combine (A.6) with (A.7), the union bound tells us that: ∀f ∈ F, with probability at least
1 − δ over the choice of the training set S,
(cid:101)Lsun( (cid:98)f )
(i)
≤ (cid:98)(cid:101)Lsun( (cid:98)f ) + O
RS(G)
M
+ B
(cid:115)
log 1
δ
M
(ii)
≤ (cid:98)(cid:101)Lsun(f ∗) + O
RS(G)
M
+ B
(cid:115)
log 1
δ
M
(iii)
≤ (cid:101)Lsun(f ∗) + O
RS(G)
M
+ B
(cid:115)
log 1
δ
M
(iv)
≤ (cid:101)Lsun(f ) + O
RS(G)
M
+ B
(cid:115)
,
log 1
δ
M
where (i) comes from (A.6);(ii) is directly from the fact that (cid:98)(cid:101)Lsun( (cid:98)f ) ≤ (cid:98)(cid:101)Lsun(f ∗), which
is from the definition of (cid:98)f ;(iii) is a result of (A.7) and (iv) is obvious by the definition of f ∗.
Theorem 8 Let (cid:96) : Rk −→ R be bounded by B. Then, for any δ ∈ (0, 1),with a probability of
at least 1 − δ over the choice of the training set S = {(xj, x+
j=1, for any f ∈ F:
j , x−
(cid:101)Lsup( (cid:98)f ) ≤ (cid:101)Lμ
sup( (cid:98)f ) ≤
1
1 − τ
((cid:101)Lsun(f ) − τ (cid:96)(0)) +
j )}M
1
1 − τ
AGM .
Proof From Lemma 29 we know that:
(cid:101)Lsup( (cid:98)f ) ≤ (cid:101)Lμ
sup( (cid:98)f ) ≤
1
1 − τ
((cid:101)Lun( (cid:98)f ) − τ (cid:96)(0)) ≤
1
1 − τ
((cid:101)Lsun( (cid:98)f ) − τ (cid:96)(0)),
Then Lemma 31 directly yields the result we need.
20
Generalization Bounds for Adversarial Contrastive Learning
A.2 Proof of Theorem 10
Theorem 10 For any f ∈ F, we have:
(cid:101)Lsup(f ) ≤
1
1 − τ
(cid:16)
(cid:17)
sun (f ) − τ (cid:96)(0)
(cid:101)Lblock
≤
(cid:16)
1
1 − τ
(cid:101)Lsun(f ) − τ (cid:96)(0)
(cid:17)
.
Proof By the convexity of (cid:96) and Jensen's inequality, we have: ∀x(cid:48), x+
i , x−
i :
(cid:32)
(cid:96)
f (x(cid:48))T
(cid:32) (cid:80)b
i=1 f (x+
i )
b
−
(cid:80)b
i=1 f (x−
i )
b
(cid:33)(cid:33)
(cid:32)
= (cid:96)
1
b
b
(cid:88)
i=1
f (x(cid:48))T (cid:0)f (x+
i ) − f (x−
i )(cid:1)
(cid:33)
≤
1
b
b
(cid:88)
i=1
Take maximization about x(cid:48) both sides, we have:
(cid:96) (cid:0)f (x(cid:48))T (cid:0)f (x+
i ) − f (x−
i )(cid:1)(cid:1) .
(cid:32)
(cid:96)
sup
x(cid:48)∈U (x)
f (x(cid:48))T
(cid:32) (cid:80)b
i=1 f (x+
i )
b
(cid:33)(cid:33)
(cid:80)b
i=1 f (x−
i )
b
−
≤
≤
1
b
1
b
(cid:34) b
(cid:88)
(cid:96)(cid:0)f (x(cid:48))T(cid:0)f (x+
i )−f (x−
(cid:35)
i )(cid:1)(cid:1)
sup
x(cid:48)∈U (x)
i=1
(cid:34)
b
(cid:88)
i=1
sup
x(cid:48)∈U (x)
(cid:96)(cid:0)f (x(cid:48))T(cid:0)f (x+
i )−f (x−
(cid:35)
i )(cid:1)(cid:1)
.
Taking expectations both sides yields:
(cid:101)Lblock
sun (f ) = E
x,x+
i ,x−
i
(cid:34)
(cid:32)
(cid:96)
sup
x(cid:48)∈U (x)
f (x(cid:48))T
(cid:32) (cid:80)b
i=1 f (x+
i )
b
−
(cid:80)b
i=1 f (x−
i )
b
(cid:33)(cid:33)(cid:35)
≤ E
x,x+
i ,x−
i
(cid:40)
1
b
(cid:34)
= E
x,x+,x−
sup
x(cid:48)∈U (x)
(cid:34)
b
(cid:88)
i=1
(cid:96) (cid:0)f (x(cid:48))T (cid:0)f (x+
i ) − f (x−
i )(cid:1)(cid:1)
sup
x(cid:48)∈U (x)
(cid:35)(cid:41)
(cid:96) (cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1)
(cid:35)
= (cid:101)Lsun(f ),
which proves the second inequality. For the first inequality, we have, ∀f ∈ F:
21
(cid:101)Lblock
sun (f ) =
E
c+,c−∼ρ2
Zou and Liu
(cid:34)
(cid:32)
sup
x(cid:48)∈U (x)
(cid:96)
f (x(cid:48))T
(cid:32) (cid:80)b
i=1 f (x+
i )
b
−
(cid:80)b
i=1 f (x−
i )
b
(cid:33)(cid:33)(cid:35)
sup
x(cid:48)∈U (x)
(cid:34)
(cid:32)
(cid:32) (cid:80)b
f (x(cid:48))T
i=1 f (x+
i )
b
(cid:96)
E
x+
i ∼Db
c+
x−
i ∼Db
c−
(cid:32)
(cid:32) (cid:80)b
f (x(cid:48))T
i=1 f (x+
i )
b
(cid:96)
sup
x(cid:48)∈U (x)
E
x+
i ∼Db
c+
x−
i ∼Db
c−
(cid:80)b
i=1 f (x−
i )
b
−
(cid:80)b
i=1 f (x−
i )
b
−
(cid:33)(cid:33)(cid:35)
(cid:33)(cid:33)
E
i ∼Db+1
x,x+
c+
x−
i ∼Db
c−
E
x∼Dc+
E
x∼Dc+
(i)
≥ E
c+,c−∼ρ2
(ii)
≥ E
c+,c−∼ρ2
(iii)
=
E
c+,c−∼ρ2
(cid:40)
(cid:34)
E
x∼Dc+
(cid:96) (cid:0)f (x(cid:48))T (μc+ − μc−)(cid:1)
sup
x(cid:48)∈U (x)
(cid:35)(cid:41)
(iv)
= (1 − τ )(cid:101)Lμ
sup(f ) + τ (cid:96)(0),
where (i) and (ii) are directs result of Jensen's Inequality and convexity of maximization
function and (cid:96); (iii) is from the linearity of expectation and the last equality follows the
same argumentation as in (A.4), which proves the Theorem.
A.3 Proof of (5)
Proof For any f ∈ F, we have:
(cid:101)Lsup(f ) = E
T ∼D
(cid:104)
(cid:101)Lsup(T , f )
(cid:105) (i)
= p E
T ∼D
(cid:104)
(cid:101)Lsup(T , f )
(cid:12)
(cid:12)
(cid:12)Edistinct
(cid:105)
+(1−p) E
T ∼D
(cid:12)
(cid:104)
(cid:12)
(cid:101)Lsup(T , f )
(cid:12)
(cid:105)
̄Edistinct
(cid:104)
≥ p E
T ∼D
(cid:101)Lsup(T , f )
where Edistinct is the event that {c+, c−
= p (cid:101)Lsup(f ),
1 , . . . , c−
(cid:12)
(cid:12)
(cid:12)Edistinct
(cid:105) (ii)
k } is distinct and p =
P
1 ,...,c−
k )∼D
(c+,c−
[Edistinct]
and (i) is from the property of conditional expectation and (ii) comes from the definition of
(cid:101)Lsup(f ).
A.4 Proof of Proposition 15
Proposition 15 The hinge loss and the logistic loss satisfy Assumption 14.
Proof Since I1 and I2 are symmetric, We only need to prove (6). For the Hinge Loss:
(cid:26)
(cid:96) ({vi}i∈I1) = max
0, 1 + max
i∈I1
{−vi}
(cid:27) (i)
≤ max
(cid:26)
0, 1 + max
i∈[d]
{−vi}
(cid:27)
= (cid:96) (cid:0){vi}i∈[d]
(cid:1) ,
22
Generalization Bounds for Adversarial Contrastive Learning
where (i) is from the fact that I1 ⊆ [d], so the first inequality is proved, for the second one:
(cid:96) (cid:0){vi}i∈[d]
(cid:1) = max
(cid:26)
0, 1 + max
i∈[d]
(cid:27)
(cid:26)
{−vi}
= max
(cid:27)
0, 1 + max
i∈I1∪I2
{−vi}
,
where the last equality is directly from the definition of I1 and I2.
1. if
1 + max
i∈I1∪I2
have:
{−vi} ≤ 0, then (cid:96) ({vi}i∈I1∪I2) = 0, since Hinge Loss is non-negative, we
(cid:96) ({vi}i∈I1∪I2) = 0 + 0 ≤ (cid:96) ({vi}i∈I1) + (cid:96) ({vi}i∈I2) .
2. if 1 + max
i∈I1∪I2
{−vi} > 0
(a) if 1 + max
i∈I1
have:
{−vi} ≤ 0, then (cid:96) ({vi}i∈I1) = max
(cid:26)
(cid:27)
0, 1 + max
i∈I1
{−vi}
= 0. So we
(cid:96) ({vi}i∈I1∪I2) = max
0, 1 + max
i∈I1∪I2
{−vi}
= max
0, 1 + max
i∈I2
{−vi}
(cid:26)
(cid:27)
(cid:26)
(cid:27)
= 0 + (cid:96) ({vi}i∈I2) = (cid:96) ({vi}i∈I1) + (cid:96) ({vi}i∈I2) .
(b) if 1 + max
i∈I2
{−vi} ≤ 0, by the same discussion of (a), we have:
(cid:96) ({vi}i∈I1∪I2) ≤ (cid:96) ({vi}i∈I1) + (cid:96) ({vi}i∈I2) .
(c) if 1 + max
i∈I1
{−vi} > 0 and 1 + max
i∈I2
{−vi} > 0,
(cid:96) ({vi}i∈I1∪I2) = max
0, 1+ max
i∈I1∪I2
{−vi}
≤ max
0, 1+max
i∈I1
{−vi}+1+max
i∈I2
{−vi}
(cid:26)
(cid:27)
(cid:26)
(cid:27)
(cid:26)
≤ max
0, 1 + max
i∈I1
(cid:27)
(cid:26)
{−vi}
+ max
(cid:27)
0, 1 + max
i∈I2
{−vi}
= (cid:96) ({vi}i∈I1) + (cid:96) ({vi}i∈I2) .
So the second inequality is proved. For the Logistic Loss:
(cid:96) ({vi}i∈I1) = log2
1 +
e−vi
≤ log2
1 +
(cid:88)
i∈I1
= (cid:96) (cid:0){vi}i∈[d]
(cid:1) .
(cid:88)
e−vi
i∈[d]
23
Zou and Liu
So the first inequality is proved. For the second one:
(cid:96) ({vi}i∈I1∪I2) = log2
1 +
(cid:88)
i∈I1∪I2
e−vi
≤ log2
1 +
e−vi +
(cid:88)
i∈I1
(cid:88)
i∈I2
e−vi
≤ log2
1 +
(cid:88)
i∈I1
= log2
1 +
(cid:88)
i∈I1
e−vi +
(cid:88)
e−vi +
(cid:88)
e−vi
(cid:88)
e−vi
i∈I2
i∈I1
i∈I2
e−vi
1 +
(cid:88)
e−vi
i∈I2
= log2
1 +
(cid:88)
i∈I1
e−vi
+ log2
1 +
(cid:88)
i∈I2
e−vi
= (cid:96) ({vi}i∈I1) + (cid:96) ({vi}i∈I2) ,
which proves the second inequality.
A.5 Proof of Theorem 32
We here introduce some further notations, which will be used in our main results. For a
tuple (c+, c−
i = c+} and Q as the set of distinct classes
[I + (cid:54)= ∅], while (cid:96)N ((cid:126)0)
in (c+, c−
k ), we define I + := {i ∈ [k]|c−
k ). We define pmax(T ) := maxc DT (c), τk :=
1 , . . . , c−
1 , . . . , c−
P
c+,c−
i ∼ρk+1
is defined as the loss of the N -dimensional zero vector. Let T be a task sample from
distribution D and ρ+(T ) be a distribution of c+ when (c+, c−
k ) are sampled from
ρk+1 conditioned on Q = T and I + = ∅ and ρ+
1 , . . . , c−
ρ+(T )(c).
min(T ) := min
c∈T
Theorem 32 Assume that (cid:96) satisfies Assumption 14. With a probability of at least 1 − δ
over the choice of the training set S, for any f ∈ F, we have:
E
T ∼D
≤
(cid:20) ρ+
min(T )
pmax(T )
(cid:16)
1
1 − τk
(cid:101)Lsup(T , (cid:98)f )
(cid:101)Lsun(f ) + AGM
−
(cid:21)
sup(T , (cid:98)f )
(cid:101)Lμ
(cid:21)
≤ E
T ∼D
(cid:17)
(cid:20) ρ+
min(T )
pmax(T )
τk
1 − τk
E
i ∼ρk+1
c+,c−
(cid:104)
(cid:105)
(cid:96)|I +|((cid:126)0)|I + (cid:54)= ∅
,
(A.8)
where |I +| is the cardinality of set I +.
Before proceeding with the proof of Theorem 32, we introduce some useful lemmas.
Lemma 33 For any T sampled from D, we have: ρ+(T )(c) ≥ ρ+
min(T )
pmax(T ) DT (c), ∀c ∈ T .
Lemma 34 Assume that f satisfies Assumption 14. For any f ∈ F, we have:
(1 − τk) E
T ∼D
(cid:20) ρ+
min(T )
pmax(T )
(cid:21)
(cid:101)Lsup(T , f )
≤ (1 − τk) E
T ∼D
(cid:20) ρ+
min(T )
pmax(T )
(cid:21)
(cid:101)Lμ
sup(T , f )
≤ (cid:101)Lsun(f ) − τk
E
i ∼ρk+1
c+,c−
(cid:104)
(cid:96)|I +|((cid:126)0)|I + (cid:54)= ∅
(cid:105)
.
24
Generalization Bounds for Adversarial Contrastive Learning
Proof [Proof of Lemma 33] By the definition of ρ+(T ) and ρ+
min(T ), we can find that:
So we have:
∀c ∈ T , ρ+
min(T ) ≤ ρ+(T )(c).
∀c ∈ T ,
ρ+(T )(c)
ρ+
min(T )
≥ 1.
By the definition of pmax(T ), we have:
∀c ∈ T ,
DT (c)
pmax(T )
≤ 1.
Combine (A.9) and (A.10), we have:
∀c ∈ T , ρ+(T )(c) ≥
ρ+
min(T )
pmax(T )
DT (c).
Proof [Proof of Lemma 34] By the definition of (cid:101)Lsun(f ), we have:
c+,c−
x,x+∼D2
i ∼D
(cid:16)(cid:8)f (x(cid:48))T (cid:0)f (x+) − f (x−
i )(cid:1)(cid:9)k
i=1
(cid:35)
(cid:17)
(cid:34)
(cid:96)
sup
x(cid:48)∈U (x)
c−
i
(cid:101)Lsun(f ) =
=
(i)
≥
(ii)
≥
E
i ∼ρk+1
c+ ;x−
(cid:34)
E
i ∼ρk+1
c+,c−
x∼Dc+
E
x+∼Dc+
x−
i ∼D
c−
i
E
i ∼ρk+1
c+,c−
x∼Dc+
sup
x(cid:48)∈U (x)
E
i ∼ρk+1
c+,c−
x∼Dc+
(cid:96)
sup
x(cid:48)∈U (x)
(cid:34)
sup
x(cid:48)∈U (x)
(cid:96)
(cid:16)(cid:8)f (x(cid:48))T (cid:0)f (x+) − f (x−
i )(cid:1)(cid:9)k
i=1
(cid:17)
(cid:96)
E
x+∼Dc+
x−
i ∼D
c−
i
(cid:16)(cid:8)f (x(cid:48))T (cid:0)f (x+) − f (x−
i )(cid:1)(cid:9)k
i=1
(cid:17)
(cid:18)(cid:110)
f (x(cid:48))T (cid:16)
μc+ − μc−
i
(cid:19)(cid:35)
(cid:17)(cid:111)k
i=1
(cid:44) R1,
(cid:35)
(A.9)
(A.10)
(A.11)
where (i), (ii) is from the Jensen's inequality and convexity of (cid:96). Then we analyze lower
bound of R1:
25
Zou and Liu
(cid:34)
sup
x(cid:48)∈U (x)
(cid:96)
(cid:18)(cid:110)
f (x(cid:48))T (cid:16)
μc+ − μc−
i
(cid:17)(cid:111)k
i=1
(cid:35)
(cid:19) (cid:12)
(cid:12)
I + = ∅
(cid:12)
(cid:12)
R1
(i)
= (1 − τk)
E
i ∼ρk+1
c+,c−
x∼Dc+
(cid:34)
+ τk
E
i ∼ρk+1
c+,c−
(cid:96)
sup
x(cid:48)∈U (x)
(cid:18)(cid:110)
f (x(cid:48))T (cid:16)
μc+ − μc−
i
(cid:17)(cid:111)k
i=1
(cid:35)
(cid:19) (cid:12)
(cid:12)
I + (cid:54)= ∅
(cid:12)
(cid:12)
(ii)
≥ (1 − τk)
E
i ∼ρk+1
c+,c−
x∼Dc+
(cid:34)
(cid:96)
sup
x(cid:48)∈U (x)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼Q,c(cid:54)=c+
(cid:35)
I + = ∅
(cid:17) (cid:12)
(cid:12)
(cid:12)
(cid:12)
x∼Dc+
(A.12)
(cid:34)
+ τk
E
i ∼ρk+1
c+,c−
(cid:96)
sup
x(cid:48)∈U (x)
(cid:18)(cid:110)
f (x(cid:48))T (cid:16)
μc+ − μc−
i
(cid:17)(cid:111)k
i=1
(cid:35)
(cid:19) (cid:12)
(cid:12)
I + (cid:54)= ∅
(cid:12)
(cid:12)
(iii)
≥ (1 − τk)
E
i ∼ρk+1
c+,c−
x∼Dc+
x∼Dc+
(cid:34)
(cid:96)
sup
x(cid:48)∈U (x)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼Q,c(cid:54)=c+
(cid:35)
(cid:17) (cid:12)
(cid:12)
I + = ∅
(cid:12)
(cid:12)
+ τk
E
i ∼ρk+1
c+,c−
(cid:20)
(cid:12)
(cid:12)
(cid:96)|I +|((cid:126)0)
I + (cid:54)= ∅
(cid:12)
(cid:12)
(cid:21)
,
where (i) comes from the property of conditional expectation, (ii) is a result of the fact that
Q ⊆ [k] and (cid:96) satisfies Assumption 14 and (iii) is from the fact that [|I +|] ⊆ [k] and (cid:96) satisfies
(cid:34)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼Q,c(cid:54)=c+
(cid:35)
(cid:17) (cid:12)
(cid:12)
I + = ∅
(cid:12)
(cid:12)
, we
Assumption 14. Let R2 =
have:
E
i ∼ρk+1
c+,c−
x∼Dc+
(cid:96)
sup
x(cid:48)∈U (x)
(cid:34)
R2 =
E
i ∼ρk+1
c+,c−
sup
x(cid:48)∈U (x)
(cid:96)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼Q,c(cid:54)=c+
(cid:35)
(cid:17) (cid:12)
(cid:12)
I + = ∅
(cid:12)
(cid:12)
x∼Dc+
(i)
= E
T ∼D
E
i ∼ρk+1
c+,c−
x∼Dc+
(ii)
= E
T ∼D
E
c+∼ρ+(T )
x∼Dc+
(cid:34)
(cid:96)
sup
x(cid:48)∈U (x)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼Q,c(cid:54)=c+
(cid:35)
Q = T , I + = ∅
(cid:17) (cid:12)
(cid:12)
(cid:12)
(cid:12)
(A.13)
(cid:34)
(cid:96)
sup
x(cid:48)∈U (x)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼T ,c(cid:54)=c+
(cid:35)
(cid:17)
,
where (i) is from the tower property of expectation and (ii) is directly obtained by the
(cid:34)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
(cid:17)
c∼T ,c(cid:54)=c+
, we have:
(cid:35)
definition of ρ+(T ). Let R3 =
E
c+∼ρ+(T )
x∼Dc+
(cid:96)
sup
x(cid:48)∈U (x)
26
Generalization Bounds for Adversarial Contrastive Learning
R3 =
E
c+∼ρ+(T )
x∼Dc+
(i)
≥
ρ+
min(T )
pmax(T )
(cid:34)
(cid:96)
sup
x(cid:48)∈U (x)
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼T ,c(cid:54)=c+
(cid:35)
(cid:17)
(cid:34)
(cid:96)
sup
x(cid:48)∈U (x)
E
c+∼DT
x∼Dc+
(cid:16)(cid:8)f (x(cid:48))T (μc+ − μc)(cid:9)
c∼T ,c(cid:54)=c+
(cid:35)
(cid:17)
(A.14)
(ii)
=
ρ+
min(T )
pmax(T )
(cid:101)Lμ
sup(T , f )
(iii)
≥
ρ+
min(T )
pmax(T )
(cid:101)Lsup(T , f ),
where (i) is directly from Lemma 33;(ii) and (iii) are from the definition of (cid:101)Lμ
(cid:101)Lsup(T , f ), respectively. Combing (A.11) (A.12) (A.13) and (A.14) yields:
sup(T , f ) and
(1 − τk) E
T ∼D
(cid:20) ρ+
min(T )
pmax(T )
(cid:21)
(cid:101)Lsup(T , f )
≤ (1 − τk) E
T ∼D
(cid:20) ρ+
min(T )
pmax(T )
(cid:21)
(cid:101)Lμ
sup(T , f )
≤ (cid:101)Lsun(f ) − τk
E
i ∼ρk+1
c+,c−
(cid:105)
(cid:104)
(cid:96)|I +|((cid:126)0)|I + (cid:54)= ∅
.
Equipped with the above lemmas, now we can turn to the proof of Theorem 32.
Proof [Proof of Theorem 32] From Lemma 31 we know that with probability at least 1 − δ
over the choice of the training set S, ∀f ∈ F:
Combing this with Lemma 34 directly yields (A.8).
(cid:101)Lsun( (cid:98)f ) ≤ (cid:101)Lsun(f ) + AGM .
A.6 Proof of Theorem 16
Theorem 16 Suppose C is finite. For any c ∈ C, ρ(c) > 0, and (cid:96) satisfies Assumption 14.
Then, with a probability of at least 1 − δ over the choice of the training set S, ∀f ∈ F:
(cid:101)Lsup( (cid:98)f ) ≤ α(ρ)
(cid:16)
(cid:101)Lsun(f ) + AGM
(cid:17)
− β,
where α(ρ) = 1
1−τk
pmax(T )
ρ+
min(T )
max
|T |≤k+1
T distinct
is a positive constant depending on ρ and
β = α(ρ)τk
E
i ∼ρk+1
c+,c−
(cid:104)
(cid:96)|I +|((cid:126)0)|I + (cid:54)= ∅
(cid:105)
.
Proof Since C is finite and ρ(c) > 0 for any c ∈ C, we can see that:
1
α(1 − τk)
=
min
|T |≤k+1,T distinct
(cid:27)
(cid:26) ρ+
min(T )
pmax(T )
> 0.
(A.15)
27
Zou and Liu
By Theorem 32 and the definition of (cid:101)Lsup(f ), we have: ∀f ∈ F, with probability at least
1 − δ over the choice of the training set S,
1
α(1 − τk)
(cid:101)Lsup( (cid:98)f )
(i)
= E
T ∼D
(cid:20)
1
α(1 − τk)
(cid:101)Lsup(T , (cid:98)f )
(cid:21) (ii)
≤ E
T ∼D
(cid:20) ρ+
min(T )
pmax(T )
(cid:21)
(cid:101)Lsup(T , (cid:98)f )
(iii)
≤
(cid:16)
1
1 − τk
(cid:101)Lsun(f ) + AGM
(cid:17)
−
τk
1 − τk
E
i ∼ρk+1
c+,c−
(cid:104)
(cid:96)|I +|((cid:126)0)|I + (cid:54)= ∅
(cid:105)
,
where (i) is from the definition of (cid:101)Lsup( (cid:98)f );(ii) is from (A.15) and (iii) is from Theorem 32.
Rearranging yields the result.
A.7 Proof of Lemma 18
Lemma 18 Let Bp(r) be the p-norm ball in Rd with radius r. The δ-covering number of
Bp(r) with respect to (cid:107) * (cid:107)p thus obeys the following bound:
N (δ; Bp(r), (cid:107) * (cid:107)p) ≤
(cid:18)
1 +
(cid:19)d
,
2r
δ
where N (δ; B, (cid:107) * (cid:107)) is the δ-covering number of B with respect to the norm (cid:107) * (cid:107).
Proof Set (cid:107) * (cid:107), (cid:107) * (cid:107)(cid:48) in Lemma 17 to be (cid:107) * (cid:107)p, we have:
N (δ; Bp(1), (cid:107) * (cid:107)p) ≤
Bp(1) + Bp(1)(cid:1)
vol (cid:0) 2
δ
vol (Bp(1))
=
(cid:1) Bp(1)(cid:1)
vol (cid:0)(cid:0)1 + 2
δ
vol (Bp(1))
(cid:19)d
(cid:18)
(i)
≤
(cid:18)
1 +
(cid:19)d vol (Bp(1))
vol (Bp(1))
2
δ
=
1 +
,
2
δ
where (i) is true because Bp(1) ⊂ Rd. Now suppose that {x1, * * * , xN } is the minimal
δ-covering of Bp(1), then:
∀x ∈ Bp(1), ∃xi ∈ {x1, * * * , xN } s.t.(cid:107)x − xi(cid:107)p ≤ δ.
So we have:
∀rx ∈ Bp(r), ∃rxi ∈ {rx1, * * * , rxN } s.t.(cid:107)rx − rxi(cid:107)p ≤ rδ.
So {rx1, * * * , rxN } is a rδ-covering of Bp(r), so we have:
N (rδ; Bp(r), (cid:107) * (cid:107)p) ≤ N (δ; Bp(1), (cid:107) * (cid:107)p) ≤
(cid:18)
1 +
(cid:19)d
.
2
δ
Letting δ
r take place of δ, we have N (δ; Bp(r), (cid:107) * (cid:107)p) ≤ (cid:0)1 + 2r
δ
(cid:1)d .
28
Generalization Bounds for Adversarial Contrastive Learning
A.8 Proof of Theorem 22
Theorem 22 Let U(x) = {x(cid:48)|(cid:107)x(cid:48) − x(cid:107)r ≤ (cid:15)} (i.e. consider the (cid:96)r attack). We then have :
RS(H) = O
(cid:16)
[P P ∗ + (cid:15)R∗s(r∗, p, m)]
(cid:104)
ms(p∗, p, m)w2
√
(cid:105)(cid:17)
,
M
where s(p, q, n) := n
(11).
max
(cid:110) 1
p − 1
q , 1
q − 1
p
(cid:111)
, 1
p + 1
p∗ = 1, 1
r + 1
r∗ = 1, and R∗ is defined similarly to
Before giving the proof of the theorem, we introduce some lemmas will be used in our proof.
Lemma 35 For any x ∈ Rn,0 < p2 ≤ p1, we have: (cid:107)x(cid:107)p1 ≤ (cid:107)x(cid:107)p2 ≤ n
1
p2
− 1
p1 (cid:107)x(cid:107)p1.
Proof [Proof of Lemma 35] Firstly, we prove (cid:107)x(cid:107)p1 ≤ (cid:107)x(cid:107)p2. For any x ∈ Rn, suppose
ai = |xi|, lep f (p) = ((cid:80)n
i=1 ap
i )
p . In order to prove (cid:107)x(cid:107)p1 ≤ (cid:107)x(cid:107)p2, it suffices to prove that:
∀ai ≥ 0, i = 1, 2, . . . , n, f (p) is non-increasing on (0, 1].
1
1. if ai = 0, ∀i, f is a constant function, so f is non-increasing.
2. if ∃i, ai (cid:54)= 0, suppose {ai|ai (cid:54)= 0} has K elements, without loss of generality, suppose
{ai|ai (cid:54)= 0} = {a1, a2, * * * , aK} and a1 = max
1≤k≤K
{ak}, then we have:
0 <
(cid:19)p
(cid:18) ak
a1
≤ 1,
(cid:19)p
K
(cid:88)
k=1
(cid:18) ak
a1
≥ 1, ln
(cid:19)p(cid:33)
(cid:32) K
(cid:88)
k=1
(cid:18) ak
a1
≥ 0, k = 1, 2, . . . , K.
(A.16)
1
p = a1
(cid:16)(cid:80)K
k=1
(cid:16) ak
a1
(cid:17)p(cid:17) 1
p = a1exp{ 1
p ln
(cid:16)(cid:80)K
k=1
(cid:16) ak
a1
(cid:17)p(cid:17)
},
We can write f (p) = ((cid:80)n
(cid:16) ak
a1
(cid:16)(cid:80)K
k=1
i=1 ap
i )
(cid:17)p(cid:17)
p ln
let g(p) = 1
, by the monotone property of composite functions, to
prove f (p) is non-increasing, it suffices to prove g(p) is non-increasing.Taking derivation
of g yields:
(cid:17)(cid:105)
(cid:16) ak
a1
(cid:17)p
ln
−
(cid:16)(cid:80)K
k=1
p2
(cid:17)p(cid:17)
(cid:16) ak
a1
.
g(cid:48)(p) =
(cid:80)K
k=1
(cid:17)p
(cid:104)(cid:16) ak
a1
p (cid:80)K
k=1
ln
(cid:16) ak
a1
(cid:17)p
(cid:80)K
(cid:104)(cid:16) ak
a1
p (cid:80)K
From (A.16) we know that
ln
(cid:16) ak
a1
g(cid:48)(p) ≤ 0, so g is non-increasing, which means that (cid:107)x(cid:107)p1 ≤ (cid:107)x(cid:107)p2, ∀x ∈ Rn.
≤ 0 and
k=1
p2
k=1
k=1
ln
(cid:16)(cid:80)K
(cid:17)p(cid:17)
(cid:16) ak
a1
(cid:17)(cid:105)
(cid:16) ak
a1
(cid:17)p
≥ 0, so we have
Nextly, we prove that (cid:107)x(cid:107)p2 ≤ n
i=1 |xi|p2(cid:1) p1
p1
p2 = (cid:0) 1
((cid:80)n
n
i=1 |xi|p2)
p1
p2 is convex. By Jensen's Inequality we know that:
p1
p2 .Since p2 ≤ p1, i.e. p1
p2
h(t) = t
p2 * n
(cid:80)n
1
p2
− 1
p1 (cid:107)x(cid:107)p1. By the definition of (cid:107) * (cid:107)p, we have: (cid:107)x(cid:107)p1
p2 =
≥ 1, we know the function
∀λi s.t. λi ≥ 0 and
n
(cid:88)
i=1
λi = 1, ∀ti ∈ R : h
(cid:33)
λiti
≤
(cid:32) n
(cid:88)
i=1
n
(cid:88)
i=1
λih(ti).
(A.17)
29
Zou and Liu
Set λ1 = λ2 = * * * = λn = 1
n , ti = |xi|p2, i = 1, 2, . . . , n in (A.17), we have:
(cid:33) p1
p2
|xi|p2
(cid:32)
1
n
n
(cid:88)
i=1
≤
1
n
n
(cid:88)
i=1
(|xi|p2)
p1
p2 =
1
n
n
(cid:88)
i=1
|xi|p1.
Multiplying both sides by n
p1
p2 yields (cid:0) 1
n
(cid:80)n
p2 * n
i=1 |xi|p2(cid:1) p1
−1 * (cid:107)x(cid:107)p1
p1.
p1
p2
(cid:107)x(cid:107)p1
p2 ≤ n
p1
p2 ≤ 1
n
(cid:80)n
i=1 |xi|p1 * n
p1
p2 , i.e.
Taking both sides the p1th power yields (cid:107)x(cid:107)p2 ≤ n
1
p2
− 1
p1 (cid:107)x(cid:107)p1.
Lemma 36 Suppose that ∃A, B ∈ R+ s.t. A(cid:107)x(cid:107)p ≤ (cid:107)x(cid:107)q ≤ B(cid:107)x(cid:107)p (p, q ≥ 1) for any
x ∈ Rn, then ∀W ∈ Rm×n: |||W |||p ≤ B
Proof [Proof of Lemma 36] If we have A(cid:107)x(cid:107)p ≤ (cid:107)x(cid:107)q ≤ B(cid:107)x(cid:107)p, then:
A |||W |||q.
|||W |||p = max
(cid:107)x(cid:107)p≤1
(cid:107)W x(cid:107)p
(i)
≤ max
(cid:107)x(cid:107)p≤B
(cid:107)W x(cid:107)p
(ii)
≤ max
(cid:107)x(cid:107)p≤B
1
A
(cid:107)W x(cid:107)q = max
(cid:107)x(cid:107)p≤1
B
A
(cid:107)W x(cid:107)q =
B
A
|||W |||q,
where (i) is from the fact that (cid:107)x(cid:107)q ≤ B(cid:107)x(cid:107)p, which means that {x|(cid:107)x(cid:107)p ≤ 1} ⊆ {x|(cid:107)x(cid:107)q ≤ 1}
and (ii) is from the condition that A(cid:107)x(cid:107)p ≤ (cid:107)x(cid:107)q.
Lemma 37 For any p, q ≥ 1, then ∀W ∈ Rm×n: |||W |||q ≤ nmax{ 1
p − 1
q , 1
q − 1
p }|||W |||p.
Remark 38 If we denote nmax{ 1
s(p, q, n)|||W |||p.
p − 1
q , 1
q − 1
p } by s(p, q, n), then we have: ∀W ∈ Rm×n, |||W |||q ≤
Proof
[Proof of Lemma 37] We discuss it in two cases.
1. If p ≤ q, by Lemma 35, we have: ∀x ∈ Rn, (cid:107)x(cid:107)q ≤ (cid:107)x(cid:107)p ≤ n
we know that ∀W ∈ Rm×n, |||W |||q ≤ n
1
p − 1
q |||W |||p.
1
p − 1
q (cid:107)x(cid:107)q. By Lemma 36,
2. If p ≥ q, by Lemma 35, we have: ∀x ∈ Rn, (cid:107)x(cid:107)p ≤ (cid:107)x(cid:107)q ≤ n
1
p − 1
q (cid:107)x(cid:107)q ≤ (cid:107)x(cid:107)p ≤ (cid:107)x(cid:107)q.
n
1
q − 1
p (cid:107)x(cid:107)p, i.e.
By Lemma 36, we know that ∀W ∈ Rm×n, |||W |||q ≤ n
1
q − 1
p |||W |||p.
So we conclude that ∀W ∈ Rm×n, |||W |||q ≤ nmax{ 1
p }|||W |||p.
Now we turn to bound the Rademacher complexity of H, where
p − 1
q − 1
q , 1
(cid:26)
H =
h(x, x+, x−) = min
x(cid:48)∈U (x)
(cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1) |f ∈ F
(cid:27)
,
F = {f : x −→ W x|W ∈ Rn×m, |||W |||p ≤ w}.
30
Generalization Bounds for Adversarial Contrastive Learning
Let
H0 = (cid:8)h(x, x+, x−) = f (x)T (cid:0)f (x+) − f (x−)(cid:1) |f ∈ F(cid:9)
(cid:110)
(x, x+, x−) −→ xT W T W (x+ − x−)(cid:12)
(cid:12)W ∈ Rn×m, |||W |||p ≤ w
(cid:111)
.
=
[Proof of Theorem 22] Firstly, we drop the complicated and unwieldy min operate
Proof
by directly solving the minimization problem.
h(x, x+, x−) = min
f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1) = min
(cid:107)δ(cid:107)r≤(cid:15)
(cid:107)x(cid:48)−x(cid:107)r≤(cid:15)
(W (x + δ))T (cid:0)W x+ − W x−(cid:1)
= xT W T W (x+ − x−) + min
(cid:107)δ(cid:107)r≤(cid:15)
δT W T W (x+ − x−)
(i)
= xT W T W (x+ − x−) − (cid:15)(cid:107)W T W (x+ − x−)(cid:107)r∗,
where (i) is from Holder's Inequality and taking the value of δ that can get equality. Define:
H1 =
Hw
0 =
Hw
1 =
(cid:110)
(x, x+, x−) −→ (cid:107)W T W (x+ − x−)(cid:107)r∗
(cid:12)
(cid:12)W ∈ Rn×m, |||W |||p ≤ w
(cid:111)
,
(cid:110)
(x, x+, x−) −→ xT A(x+ − x−)(cid:12)
(cid:110)
(x, x+, x−) −→ (cid:107)A(x+ − x−)(cid:107)r∗
(cid:12)A ∈ Rm×m, |||A|||p ≤ w
(cid:111)
,
(cid:12)
(cid:12)A ∈ Rm×m, |||A|||p ≤ w
(cid:111)
.
Since ∀W ∈ Rn×m s.t. |||W |||p ≤ w, we have:
(cid:12)
(cid:12)
(cid:12)W T W (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)p
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(i)
(cid:12)
(cid:12)
(cid:12)W T (cid:12)
(cid:12)
(cid:12)
≤ (cid:12)
(cid:12)p * |||W |||p = |||W |||p∗ * |||W |||p
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(ii)
≤ s(p∗, p, m)|||W |||2
p ≤ s(p∗, p, m)w2,
where 1
Lemma 37. So we have:
p + 1
p∗ = 1 and (i) comes from the Submultiplicativity of matrix norm and (ii) is from
(cid:110)
W
(cid:12)
(cid:12)
(cid:12)|||W |||p ≤ w
(cid:111)
(cid:110)
W
⊆
(cid:12)
(cid:12)
(cid:12)
(cid:12)W T W (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)p ≤ s(p∗, p, m)w2(cid:111)
.
And since W T W is positive semi-definite, it's easy to see that:
(cid:110)
W T W
(cid:12)
(cid:12)
(cid:12)
(cid:12)W T W (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)p ≤ s(p∗, p, m)w2(cid:111)
⊆
(cid:110)
A
(cid:12)
(cid:12)
(cid:12)|||A|||p ≤ s(p∗, p, m)w2(cid:111)
.
So we have:
H0 =
⊆
⊆
(cid:110)
(x, x+, x−) −→ xT W T W (x+ − x−)(cid:12)
(cid:110)
(x, x+, x−) −→ xT W T W (x+ − x−)(cid:12)
(cid:110)
(x, x+, x−) −→ xT A(x+ − x−)(cid:12)
(cid:12)W ∈ Rn×m, |||W |||p ≤ w
(cid:12)
(cid:12)
(cid:12)W ∈ Rn×m, (cid:12)
(cid:12)
(cid:12)
(cid:12)W T W (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)A ∈ Rm×m, |||A|||p ≤ s(p∗, p, m)w2(cid:111)
(cid:111)
(cid:12)p ≤ s(p∗, p, m)w2(cid:111)
= Hs(p∗,p,m)w2
0
.
31
Zou and Liu
Similarly, H1 ⊆ Hs(p∗,p,m)w2
1
. Given the training set S = {(xi, x+
i , x−
i )}M
i=1, we have:
(cid:40)
RS(H) = E
σ
sup
|||W |||p≤w
(i)
≤ E
σ
(cid:40)
sup
|||W |||p≤w
M
(cid:88)
i=1
M
(cid:88)
i=1
σi
σi
(cid:2)xT
i W T W (x+
i − x−
i ) − (cid:15)(cid:107)W T W (x+
i − x−
(cid:41)
i )(cid:107)r∗(cid:3)
(cid:2)xT
i W T W (x+
i − x−
i )(cid:3)
(cid:41)
(cid:40)
+ (cid:15) E
σ
sup
|||W |||p≤w
M
(cid:88)
i=1
(cid:2)−σi(cid:107)W T W (x+
i − x−
(cid:41)
i )(cid:107)r∗(cid:3)
(cid:41)
(A.18)
(ii)
= E
σ
(cid:40)
sup
|||W |||p≤w
M
(cid:88)
i=1
σi
(cid:2)xT
i W T W (x+
i − x−
i )(cid:3)
(cid:40)
+ (cid:15) E
σ
sup
|||W |||p≤w
M
(cid:88)
i=1
(cid:2)σi(cid:107)W T W (x+
i − x−
(cid:41)
i )(cid:107)r∗(cid:3)
(iii)
= RS(H0) + (cid:15) RS(H1)
(iv)
≤ RS(Hs(p∗,p,m)w2
0
) + (cid:15) RS(Hs(p∗,p,m)w2
1
),
where σ is a Random Vector whose elements are i.i.d. Rademacher Random Variables and
(i) comes from the subadditivity of sup function;(ii) is from the fact that −σi has the same
distribution as σi, ∀i = 1, 2, . . . , M ; (iii) is by the definition of RS(H0) and RS(H1) and (iv) is
from the monotone property of Rademacher Complexity and the fact that H0 ⊆ Hs(p∗,p,m)w2
and H1 ⊆ Hs(p∗,p,m)w2
0 and
1 . For RS(Hw
Hw
i=1, define the
(cid:96)2-norm for a function in Hw
. Secondly, we upper bound the Rademacher Complexity of Hw
0 ): Given the training set S = {(xi, x+
i=1 = {(zi)}M
i , x−
i )}M
1
0
0 as:
∀h ∈ Hw
0 , (cid:107)h(cid:107)2 :=
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
i=1
[h(zi)]2,
Define Hw
(h(z1), h(z2), . . . , h(zM ))
vh = (h(z1), h(z2), . . . , h(zM )) be the corresponding vector in Hw
, we have that for any h ∈ Hw
0 (S), we have:
0 (S) =
0
0 and
(cid:12)
(cid:12)h ∈ Hw
(cid:12)
(cid:111)
(cid:110)
(cid:107)h(cid:107)2 = (cid:107)vh(cid:107)2.
So we know that any δ-covering of Hw
functional space, corresponds to a δ-covering of Hw
Euclidean Space, i.e.
0 ((cid:8)h1, h2, * * * , hN (cid:9)) with respect to (cid:96)2 norm in the
0 (S) with respect to the (cid:96)2 norm in the
h1(z1)
h1(z2)
...
h1(zM )
,
h2(z1)
h2(z2)
...
h2(zM )
, * * * ,
hN (z1)
hN (z2)
...
hN (zM )
.
32
Generalization Bounds for Adversarial Contrastive Learning
So we have:
N (δ; Hw
0 (S), (cid:107) * (cid:107)2) = N (δ; Hw
0 , (cid:107) * (cid:107)2) .
(A.19)
By the definition of Rademacher Complexity, we know that RS(Hw
of the Rademacher Process with respect to Hw
0 (S), which is E[
0 ) is just the expectation
Xθ]. To use Lemma
sup
θ∈Hw
0 (S)
20, we must show that Rademacher Process is a sub-Gaussian Process with respect to
some metric ρX . Denote the Euclidean metric by ρ2, we have: for Rademacher Process
{Xθ, θ ∈ T}, ∀θ, (cid:101)θ ∈ T and λ ∈ R:
(cid:104)
E
eλ(Xθ−X
(cid:101)θ)(cid:105) (i)
= E
(cid:104)
eλ((cid:104)σ,θ(cid:105)−(cid:104)σ,(cid:101)θ(cid:105))(cid:105)
= E
(cid:104)
eλ((cid:104)σ,θ−(cid:101)θ(cid:105))(cid:105) (ii)
≤
(cid:104)
eλσi(θi−(cid:101)θi)(cid:105)
M
(cid:89)
i=1
E
σi
(iii)
≤
M
(cid:89)
i=1
λ2(θi−(cid:101)θi)2
2
e
λ2
2
= e
(cid:80)M
i=1(θi−(cid:101)θi)2
λ2
2 ρ2
X (θ,(cid:101)θ),
= e
where σ is a Random Vector whose elements are i.i.d. Rademacher Random Variables and
(i) is from the definition of Rademacher Process; (ii) is from the expectation property of i.i.d.
random variables and (iii) is from Example 2.3 in Wainwright (2019). So we proved that
the Rademacher Process is a sub-Gaussian Process with respect to the Euclidean metric ρ2.
So by Lemma 20 and (9), we know that: ∀δ ∈ (0, D],
RS(Hw
0 ) = E[
sup
θ∈Hw
0 (S)
(cid:34)
Xθ] ≤ E
sup
θ,(cid:101)θ∈Hw
0 (S)
(Xθ −X
(cid:35)
(cid:101)θ)
≤ 2E
(Xγ −Xγ(cid:48))
sup
γ,γ(cid:48)∈Hw
0 (S)
ρX (γ,γ(cid:48))≤δ
+32J (δ/4; D),
where
D =
sup
θ,θ(cid:48)∈Hw
0 (S)
(cid:107)θ − θ(cid:48)(cid:107)2 ≤ 2 sup
θ∈Hw
0 (S)
(cid:107)θ(cid:107)2 = 2 sup
h∈Hw
0
(cid:107)h(cid:107)2 = 2 sup
h∈Hw
0
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
i=1
[h(zi)]2
√
(i)
≤ 2
M sup
|||A|||p≤w
1≤i≤M
√
(iii)
≤ 2
M sup
|||A|||p≤w
1≤i≤M
|xT
i A(x+
i − x−
i )|
√
(ii)
≤ 2
M sup
|||A|||p≤w
1≤i≤M
(cid:107)xi(cid:107)p∗(cid:107)A(x+
i − x−
i )(cid:107)p
(A.20)
(cid:107)xi(cid:107)p∗|||A|||p(cid:107)x+
i − x−
i (cid:107)p
√
(iv)
≤ 4
M P ∗P w,
(cid:112)lnN (u; Hw
and J (a; b) = (cid:82) b
0 , (cid:107) * (cid:107)2)du. Where (i) is from
a
the definition of f ; (ii) is from the Holder's Inequality; (iii) is a result of properties of matrix
norm and (iv) is from the definition of P ∗ and P . Similar to the discussion of upper bound
0 (S), (cid:107) * (cid:107)2)du = (cid:82) b
(cid:112)lnN (u; Hw
a
33
Zou and Liu
for D, for all h1, h2 ∈ Hw
0 , we have:
(cid:107)h1 − h2(cid:107)2 =
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
[h1(zi) − h2(zi)]2 ≤
√
M sup
1≤i≤M
|h1(zi) − h2(zi)|
√
i=1
M sup
1≤i≤M
√
M sup
1≤i≤M
=
(i)
≤
|xT
i (A1 − A2)(x+
i − x−
i )|
(cid:107)xi(cid:107)p∗ |||A1 − A2|||p(cid:107)x+
i − x−
i (cid:107)p
(A.21)
√
(ii)
≤ 2
M P ∗P |||A1 − A2|||p,
where A1, A2 are the matrices corresponding to h1, h2, respectively and (i) is from the
same argument as (ii), (iii) in (A.20) and (ii) is from the definition of P ∗ and P . Suppose
NA = (cid:8)A1, * * * , AN (cid:9) is a
with respect to |||*|||p ,
i.e.:
(cid:12)
(cid:12)
(cid:12)|||A|||p ≤ w
-covering of SA =
δ
2P P ∗
A
(cid:110)
(cid:111)
M
√
(cid:12)
(cid:12)
(cid:12)A − Aj(cid:12)
(cid:12)
(cid:12)
∀A ∈ SA , ∃Aj ∈ NA, s.t. (cid:12)
(cid:12)p ≤
(cid:12)
(cid:12)
(cid:12)
(cid:12)
δ
2P P ∗
√
.
M
Combine this with (A.21), let A be the matrix corresponding to h and Aj be the matrix
corresponding to hj and let Nh = (cid:8)h1, h2, * * * , hN (cid:9), we have:
∀h ∈ Hw
0 , ∃hj ∈ Nh, s.t. (cid:107)h − hj(cid:107)2 ≤ 2
√
M P ∗P
δ
2P P ∗
√
M
= δ.
So Nh is a δ-covering of Hw
0 with respect to (cid:107) * (cid:107)2 , so we have:
N (δ; Hw
0 , (cid:107) * (cid:107)2) ≤ N (
δ
2P P ∗
√
M
; SA, |||*|||p).
By Lemma 18, we know that:
N (δ; Hw
0 , (cid:107) * (cid:107)2) ≤ N (
δ
2P P ∗
√
M
(cid:32)
; SA, |||*|||p) ≤
1 +
√
M
(cid:33)m2
4P P ∗w
δ
.
(A.22)
So we have:
J (0; D) =
(cid:90) D
0
(cid:113)
ln N (u; Hw
0 , (cid:107) * (cid:107)2)du
(cid:90) D
(i)
≤
0
(cid:118)
(cid:117)
(cid:117)
(cid:116)m2ln
(cid:32)
1 +
√
M
(cid:33)
du
4P P ∗w
u
(cid:115)
(cid:90) D
4P P ∗w
u
P P ∗wD 4√
M
0
√
(ii)
≤ m
= 4m
√
M
√
du = 2m
P P ∗w 4√
M
(cid:90) D
u− 1
2 du
0
(iii)
≤ 8mP P ∗w
√
M ,
where (i) is from (A.22); (ii) is because that for any x ≥ 0, ln(1 + x) ≤ x and (iii) is from
(A.20). So take δ −→ 0+, we have:
RS(Hw
0 ) ≤ 32J (0; D) ≤ 256mP P ∗w
√
M .
34
Generalization Bounds for Adversarial Contrastive Learning
For RS(Hw
define Hw
have:
1 (S) =
(cid:110)
1 ): The same as RS(Hw
(h(z1), h(z2), . . . , h(zM ))
0 ), we consider (cid:96)2 norm for a function h ∈ Hw
1 and
, by similar argument in (A.19), we
(cid:111)
(cid:12)
(cid:12)h ∈ Hw
(cid:12)
1
N (δ; Hw
1 (S), (cid:107) * (cid:107)2) = N (δ; Hw
1 , (cid:107) * (cid:107)2) .
By the definition of Rademacher Complexity, we know that RS(Hw
of the Rademacher Process with respect to Hw
1 (S), which is E[
1 ) is just the expectation
Xθ]. By Lemma 20
sup
θ∈Hw
1 (S)
and (9), we know that: ∀δ ∈ (0, D],
RS(Hw
1 ) = E[
sup
θ∈Hw
1 (S)
sup
θ,(cid:101)θ∈Hw
1 (S)
(Xθ − X
(cid:34)
Xθ] ≤ E
(cid:35)
(cid:101)θ)
≤ 2E
(Xγ − Xγ(cid:48))
sup
γ,γ(cid:48)∈Hw
1 (S)
ρX (γ,γ(cid:48))≤δ
+32J (δ/4; D),
where
D =
sup
θ,θ(cid:48)∈Hw
1 (S)
(cid:107)θ − θ(cid:48)(cid:107)2 ≤ 2 sup
θ∈Hw
1 (S)
(cid:107)θ(cid:107)2 = 2 sup
h∈Hw
1
(cid:107)h(cid:107)2 = 2 sup
h∈Hw
1
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
i=1
[h(zi)]2
√
(i)
≤ 2
M sup
|||A|||p≤w
1≤i≤M
(cid:107)A(x+
i − x−
i )(cid:107)r∗
√
(ii)
≤ 2
M sup
|||A|||p≤w
1≤i≤M
|||A|||r∗(cid:107)x+
i − x−
i (cid:107)r∗
√
(iii)
≤ 4
M R∗
sup
|||A|||p≤w
|||A|||r∗
√
(iv)
≤ 4
M R∗
sup
|||A|||p≤w
s(r∗, p, m)|||A|||p ≤ 4wR∗s(r∗, p, m)
√
M ,
(cid:112)lnN (u; Hw
(A.23)
and J (a; b) = (cid:82) b
1 , (cid:107) * (cid:107)2)du. Where (i) is from
a
the definition of f ; (ii) is a result of the properties of matrix norm; (iii) is from the definition
of R∗ and (iv) comes from Lemma 37. Similar to the discussion of upper bound for D, for
all h1, h2 ∈ Hw
1 (S), (cid:107) * (cid:107)2)du = (cid:82) b
(cid:112)lnN (u; Hw
a
1 , we have:
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
i=1
√
=
M sup
1≤i≤M
(cid:107)h1 − h2(cid:107)2 =
[h1(zi) − h2(zi)]2 ≤
√
M sup
1≤i≤M
|h1(zi) − h2(zi)|
(cid:107)(A1 − A2)(x+
i − x−
i )(cid:107)r∗
√
(i)
≤
M sup
1≤i≤M
|||A1 − A2|||r∗(cid:107)x+
i − x−
i (cid:107)r∗
√
(ii)
≤ 2
M R∗|||A1 − A2|||r∗
(iii)
≤ 2R∗s(r∗, p, m)
√
M |||A1 − A2|||p,
(A.24)
where A1, A2 are the matrices corresponding to h1, h2, respectively and (i) from the properties
of matrix norm and (ii) is from the definition of R∗ and (iii) comes from Lemma 37. Suppose
NA = (cid:8)A1, * * * , AN (cid:9) is a
with respect to
|||*|||p , i.e.:
(cid:12)
(cid:12)
(cid:12)|||A|||p ≤ w
-covering of SA =
2R∗s(r∗,p,m)
A
(cid:110)
(cid:111)
M
√
δ
(cid:12)
(cid:12)
(cid:12)A − Aj(cid:12)
(cid:12)
(cid:12)
∀A ∈ SA , ∃Aj ∈ NA, s.t. (cid:12)
(cid:12)p ≤
(cid:12)
(cid:12)
(cid:12)
(cid:12)
35
δ
2R∗s(r∗, p, m)
√
.
M
Zou and Liu
Combine this with (A.24), let A be the matrix corresponding to h and Aj be the matrix
corresponding to hj and let Nh = (cid:8)h1, h2, * * * , hN (cid:9), we have:
∀h ∈ Hw
1 , ∃hj ∈ Nh, s.t. (cid:107)h − hj(cid:107)2 ≤ 2R∗s(r∗, p, m)
√
M
δ
2R∗s(r∗, p, m)
√
= δ.
M
So Nh is a δ-covering of Hw
1 with respect to (cid:107) * (cid:107)2 , so we have:
N (δ; Hw
1 , (cid:107) * (cid:107)2) ≤ N (
δ
2R∗s(r∗, p, m)
√
M
; SA, |||*|||p).
By Lemma 18, we know that:
N (δ; Hw
1 , (cid:107) * (cid:107)2) ≤ N (
δ
2R∗s(r∗, p, m)
(cid:32)
√
M
; SA, |||*|||p) ≤
1 +
4R∗s(r∗, p, m)w
δ
√
M
(cid:33)m2
.
(A.25)
So we have:
J (0; D) =
(cid:90) D
0
(cid:113)
ln N (u; Hw
1 , (cid:107) * (cid:107)2)du
(cid:118)
(cid:117)
(cid:117)
(cid:116)m2ln
(cid:32)
1 +
(cid:90) D
(i)
≤
0
4R∗s(r∗, p, m)w
u
√
(cid:33)
M
du
(ii)
≤ m
(cid:115)
(cid:90) D
0
4R∗s(r∗, p, m)w
√
u
M
du = 2m(cid:112)R∗s(r∗, p, m)w 4√
M
(cid:90) D
0
u− 1
2 du
= 4m(cid:112)R∗s(r∗, p, m)wD 4√
M
(iii)
≤ 8mR∗s(r∗, p, m)w
√
M ,
where (i) is from (A.25); (ii) is because that for any x ≥ 0, ln(1 + x) ≤ x and (iii) is from
(A.23). So take δ −→ 0+, we have:
RS(Hw
1 ) ≤ 32J (0; D) ≤ 256mR∗s(r∗, p, m)w
√
M .
Combine upper bounds of RS(Hw
0 ) and RS(Hw
1 ) with (A.18), we have:
RS(H) ≤ RS(Hs(p∗,p,m)w2
0
) + (cid:15) RS(Hs(p∗,p,m)w2
)
1
√
≤ 256mP P ∗s(p∗, p, m)w2
M + (cid:15) 256mR∗s(r∗, p, m)s(p∗, p, m)w2
√
M
= 256m s(p∗, p, m)w2
√
(cid:16)
= O
(P P ∗ + (cid:15)R∗s(r∗, p, m))
m s(p∗, p, m)w2
(cid:17)(cid:17)
.
M
M (P P ∗ + (cid:15)R∗s(r∗, p, m))
√
(cid:16)
36
Generalization Bounds for Adversarial Contrastive Learning
A.9 Proof of Theorem 24
Theorem 24 Let U(x) = {x(cid:48)|(cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15)} (i.e. consider the (cid:96)p attack), σ(0) = 0 with
Lipschitz constant L and let F = (cid:8)Wdσ(Wd−1σ(* * * σ(W1x)))(cid:12)
l , l = 1, . . . , d(cid:9). We
then have:
(cid:12)|||Wl|||F≤M F
RS(H) = O
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
hlhl−1K
√
√
d
M
,
where K = 2BF
X,(cid:15) * (cid:0)BF
X + + BF
X −
l=1
(cid:1), where
BF
X,(cid:15) = Ld−1
M F
l max
(cid:110)
1, m
d
(cid:89)
l=1
1
2 − 1
p
(cid:111)
((cid:107)X(cid:107)p,∞ +(cid:15)) , BF
X = Ld−1
M F
l max
(cid:110)
1, m
d
(cid:89)
l=1
1
2 − 1
p
(cid:111)
(cid:107)X(cid:107)p,∞.
Lemma 39 If x∗
Before giving the proof, we firstly introduce some useful lemmas.
(cid:12)
i(cid:107)p ≤ (cid:15)(cid:9), then for 1
r∗ + 1
(cid:12)(cid:107)xi − x(cid:48)
(cid:111)
(cid:110)
1, m1− 1
i ∈ U(xi) = (cid:8)x(cid:48)
(cid:107)x∗
r − 1
((cid:107)X(cid:107)p,∞ + (cid:15)) .
i (cid:107)r∗ ≤ max
i
p
r = 1, we have:
Proof
[Proof of Lemma 39] We divide it into two cases.
r∗ = 1
1. If p ≥ r∗, then by Holder's Inequality with 1
p + 1
s , we have:
(cid:107)x∗
i (cid:107)r∗ ≤ sup (cid:107)1(cid:107)s * (cid:107)x∗
i (cid:107)p = (cid:107)1(cid:107)s * (cid:107)x∗
i (cid:107)p = m
1
s (cid:107)x∗
i (cid:107)p = m1− 1
r − 1
p (cid:107)x∗
i (cid:107)p,
where the equality holds when all the entries are equal.
2. If p < r∗, by Lemma 35, we have (cid:107)x∗
i (cid:107)r∗ ≤ (cid:107)x∗
i equals to one and the others equal to zero.
of the entries of x∗
i (cid:107)p, where the equality holds when one
Then we have:
(cid:107)x∗
i (cid:107)r∗ ≤ max
≤ max
(cid:110)
1, m1− 1
r − 1
p
(cid:110)
1, m1− 1
r − 1
p
(cid:111)
(cid:111)
(cid:107)x∗
i (cid:107)p ≤ max
(cid:110)
1, m1− 1
r − 1
p
(cid:111)
((cid:107)xi(cid:107)p + (cid:107)xi − x∗
i (cid:107)p)
((cid:107)X(cid:107)p,∞ + (cid:15)) .
Lemma 40 Let A ∈ Rm×n, b ∈ Rn, then we have: (cid:107)A * b(cid:107)2 ≤ |||A|||F * (cid:107)b(cid:107)2.
Proof
[Proof of Lemma 40] Let Ai be the rows of A, i = 1, 2, . . . , m, we have:
(cid:107)A * b(cid:107)2 =
(cid:118)
(cid:117)
(cid:117)
(cid:116)
m
(cid:88)
i=1
(Aib)2
(cid:118)
(cid:117)
(cid:117)
(cid:116)
m
(cid:88)
(i)
≤
i=1
(cid:107)Ai(cid:107)2
2 * (cid:107)b(cid:107)2
2 =
(cid:118)
(cid:117)
(cid:117)
(cid:116)
m
(cid:88)
i=1
(cid:107)Ai(cid:107)2
2 *
where (i) is from Holder's Inequality.
37
(cid:113)
(cid:107)b(cid:107)2
2 = |||A|||F * (cid:107)b(cid:107)2,
Zou and Liu
Lemma 41 Suppose σ is a L-Lipschitz function, then the elementwise vector map corre-
sponding to σ is also L-Lipschitz with respect to (cid:107) * (cid:107)2.
Proof
[Proof of Lemma 41]
(cid:107)σ(x) − σ(y)(cid:107)2 =
(i)
≤
(cid:118)
(cid:117)
(cid:117)
(cid:116)
n
(cid:88)
i=1
(cid:118)
(cid:117)
(cid:117)
(cid:116)
n
(cid:88)
i=1
(σ(x)i − σ(y)i)2 =
(cid:118)
(cid:117)
(cid:117)
(cid:116)
n
(cid:88)
i=1
(σ(xi) − σ(yi))2
L2(xi − yi)2 = L
(cid:118)
(cid:117)
(cid:117)
(cid:116)
n
(cid:88)
(xi − yi)2 = L * (cid:107)x − y(cid:107)2,
i=1
where (i) is because σ is L-Lipschitz.
Now we can turn to the proof of Theorem 24.
Proof
[Proof of Theorem 24] In this case, let U(x) = (cid:8)x(cid:48)(cid:12)
(cid:12)(cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15)(cid:9), we have:
F = (cid:8)x −→ Wdσ(Wd−1σ(* * * σ(W1x))) (cid:12)
(cid:12) |||Wl|||F ≤ M F
l , l = 1, . . . , d(cid:9) ,
(cid:26)
H =
h(x, x+, x−) = min
x(cid:48)∈U (x)
(cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1) |f ∈ F
(cid:27)
.
l = (cid:8)Wl ∈ Rhl×hl−1(cid:12)
(cid:12)|||Wl|||F ≤ M F
l
Let SF
and define:
(cid:9) , l = 1, 2, . . . , d. Let CF
l be the δl-covering of SF
l
(cid:110)
F c =
f c : x −→ W c
d σ (cid:0)W c
d−1σ (* * * σ(W c
1 x))(cid:1) (cid:12)
(cid:12)W c
(cid:12)
l ∈ CF
l , l = 1, 2, . . . , d
(cid:111)
⊆ F,
(cid:26)
Hc =
hc(x, x+, x−) = min
x(cid:48)∈U (x)
(cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1) |f ∈ F c
(cid:27)
⊆ H.
Similar to the proof of Theorem 22, we know that the Rademacher Process is a sub-Gaussian
Process with respect to the Euclidean metric, which induces the (cid:96)2 norm.
Given the training set S = {(xi, x+
i , x−
i )}M
i=1
(cid:44) {zi}M
i=1, define the (cid:96)2-norm for a function
in H as:
∀h ∈ H, (cid:107)h(cid:107)2 :=
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
[h(zi)]2.
i=1
(cid:111)
(cid:110)
(h(z1), h(z2), . . . , h(zM ))
(cid:12)
(cid:12)
, we have that for any h ∈ H and vh =
(cid:12)h ∈ H
Define H(S) =
(h(z1), h(z2), . . . , h(zM )) be the corresponding vector in H(S), we have (cid:107)h(cid:107)2 = (cid:107)vh(cid:107)2. So we
know that any δ-covering of H ((cid:8)h1, h2, * * * , hN (cid:9)) with respect to (cid:96)2 norm in the functional
space, corresponds to a δ-covering of H(S) with respect to the (cid:96)2 norm in the Euclidean
Space, i.e.
h1(z1)
h1(z2)
...
h1(zM )
,
, * * * ,
hN (z1)
hN (z2)
...
hN (zM )
.
h2(z1)
h2(z2)
...
h2(zM )
38
Generalization Bounds for Adversarial Contrastive Learning
So we have:
N (δ; H(S), (cid:107) * (cid:107)2) = N (δ; H, (cid:107) * (cid:107)2) .
By the definition of Rademacher Complexity, we know that RS(H) is just the expectation
of the Rademacher Process with respect to H(S), which is E[ sup
θ∈H(S)
Xθ].
So by Lemma 20 and (9), we know that: ∀δ ∈ (0, D]:
RS(H) = E[ sup
θ∈H(S)
Xθ] ≤ E
(cid:34)
(Xθ −X
sup
θ,(cid:101)θ∈H(S)
(cid:35)
(cid:101)θ)
≤ 2E
sup
γ,γ(cid:48)∈H(S)
(cid:107)γ(cid:48)−γ(cid:107)2≤δ
(Xγ −Xγ(cid:48))
+ 32J (δ/4; D),
where
D = sup
(cid:107)θ − θ(cid:48)(cid:107)2 ≤ 2 sup
θ∈H(S)
θ,θ(cid:48)∈H(S)
(cid:107)θ(cid:107)2 = 2sup
h∈H
(cid:107)h(cid:107)2 = 2sup
h∈H
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
i=1
[h(zi)]2 ≤ 2
√
|h(zi)|,
M sup
h∈H
1≤i≤M
(A.26)
and J (a; b) = (cid:82) b
a
(cid:112)lnN (u; H(S), (cid:107) * (cid:107)2)du = (cid:82) b
(cid:112)lnN (u; H, (cid:107) * (cid:107)2)du.
a
For any f ∈ F, x ∈ X , let xl be the output of x passing through the first l − 1 layers, we
have:
(cid:107)f (x)(cid:107)2 = (cid:107)Wdσ(Wd−1xd−1)(cid:107)2
(i)
≤ |||Wd|||F *(cid:107)σ(Wd−1xd−1)(cid:107)2
(ii)
= |||Wd|||F *(cid:107)σ(Wd−1xd−1)−σ(0)(cid:107)2
(iii)
≤ LM F
d (cid:107)Wd−1xd−1(cid:107)2 ≤ * * * ≤ Ld−1
d
(cid:89)
l=2
M F
l (cid:107)W1x(cid:107)2 ≤ Ld−1
d
(cid:89)
l=1
M F
l (cid:107)x(cid:107)2
(iv)
≤ Ld−1
d
(cid:89)
l=1
M F
l max
(cid:110)
1, m
1
2 − 1
p
(cid:111)
(cid:107)x(cid:107)p ≤ Ld−1
M F
l max
(cid:110)
1, m
d
(cid:89)
l=1
1
2 − 1
p
(cid:111)
(cid:107)X(cid:107)p,∞,
where (i) is from Lemma 40; (ii) is from the fact that σ(0) = 0; (iii) comes from the assumption
d and (iv) is attained by setting r = r∗ = 2 in the
that σ is L-Lipschitz and |||Wd|||F ≤ M F
proof of Lemma 39.
To simplify the notations, we define:
BF
X,(cid:15) = Ld−1
M F
l max
(cid:110)
1, m
d
(cid:89)
l=1
So we have:
Similarly, we have:
1
2 − 1
p
(cid:111)
((cid:107)X(cid:107)p,∞ +(cid:15)) , BF
X = Ld−1
M F
l max
(cid:110)
1, m
d
(cid:89)
l=1
1
2 − 1
p
(cid:111)
(cid:107)X(cid:107)p,∞.
∀x ∈ X , f ∈ F, (cid:107)f (x)(cid:107)2 ≤ BF
X .
(A.27)
∀x ∈ X , f ∈ F, ∀ (cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15), (cid:107)f (x(cid:48))(cid:107)2 ≤ BF
X,(cid:15).
(A.28)
39
Zou and Liu
For any h ∈ H, z ∈ X 3, let x∗ = arg min
(cid:107)x(cid:48)−x(cid:107)p≤(cid:15)
of x∗ passing through the first l − 1 layers, we have:
f (x(cid:48))T (f (x+) − f (x−)) and let xl be the output
|h(z)| = |
inf
(cid:107)x(cid:48)−x(cid:107)p≤(cid:15)
f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1) | = |f (x∗)T (cid:0)f (x+) − f (x−)(cid:1) |
≤ (cid:107)f (x∗)(cid:107)2 * (cid:107)f (x+) − f (x−)(cid:107)2
(i)
≤ BF
X,(cid:15) * (BF
X + + BF
X −),
where (i) is from (A.27) and (A.28). So we have:
√
(i)
≤ 2
D
M sup
h∈H
1≤i≤M
√
|h(zi)| ≤ 2
M BF
X,(cid:15) * (BF
X + + BF
X −) (cid:44)
√
M K,
(A.29)
where (i) is from (A.26). Now, we need to find the smallest distance between H and Hc, i.e.
sup
h∈H
inf
hc∈Hc
(cid:107)h − hc(cid:107)2.
i ), i = 1, 2, . . . , M , given h and hc such that |||Wl − W c
l |||F ≤ δl, l = 1, 2, . . . , d,
√
M max
1≤i≤M
|h(zi) − hc(zi)|. For any
i , x−
By the discussion in (A.26), we have (cid:107)h − hc(cid:107)2 ≤
zi = (xi, x+
we have:
|h(zi)−hc(zi)| = (cid:12)
(cid:12)
i)T (cid:0)f (x+
i ) − f (x−
f (x(cid:48)
inf
i−xi(cid:107)p≤(cid:15)
(cid:107)x(cid:48)
i )(cid:1)− inf
(cid:107)x(cid:48)
i−xi(cid:107)p≤(cid:15)
f c(x(cid:48)
i)T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1) (cid:12)
(cid:12).
Let x∗
i = arg inf
(cid:107)x(cid:48)
i−xi(cid:107)p≤(cid:15)
and let
f (x(cid:48)
i)T (cid:0)f (x+
i ) − f (x−
i )(cid:1) and xc
f c(x(cid:48)
i)T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1),
i = arg inf
(cid:107)x(cid:48)
i−xi(cid:107)p≤(cid:15)
yi =
(cid:26) xc
i
x∗
i
Then we have:
i )T (cid:0)f (x+
f (x∗
otherwise
i ) − f (x−
i )(cid:1) ≥ f c(xc
i )T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1)
.
|h(zi) − hc(zi)| = |f (x∗
i )T (cid:0)f (x+
i ) − f (x−
i )(cid:1) − f c(xc
i )T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1) |
(i)
≤ |f (yi)T (cid:0)f (x+
= |f (yi)T (cid:0)f (x+
i ) − f (x−
i ) − f (x−
+ f c(yi)T (cid:0)f (x+
i )(cid:1) − f c(yi)T (cid:0)f c(x+
i )(cid:1) − f c(yi)T (cid:0)f (x+
i ) − f (x−
i )(cid:1) |
i ) − f c(x−
i )(cid:1)
i ) − f (x−
i )(cid:1) − f c(yi)T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1) |
(ii)
≤ | (f (yi) − f c(yi))T (cid:0)f (x+
i ) − f (x−
i )(cid:1) |
i ) − f c(x+
+ |f c(yi)T (cid:0)f (x+
i )(cid:1) | + |f c(yi)T (cid:0)f (x−
i ) − f c(x−
i )(cid:1) |
(iii)
≤ (BF
X + + BF
X −)(cid:107)f (yi) − f c(yi)(cid:107)2 + BF
+ BF
i )(cid:107)2,
i ) − f c(x−
X,(cid:15)(cid:107)f (x−
X,(cid:15)(cid:107)f (x+
i ) − f c(x+
i )(cid:107)2
(A.30)
40
Generalization Bounds for Adversarial Contrastive Learning
where (i) is easily verified by the definition of yi; (ii) is from the triangle inequality and (iii)
is from (A.27) and (A.28).
Define ga
b (*) as:
Then we have:
b (y) = Wbσ (Wb−1σ (* * * Wa+1σ (W c
ga
a * * * σ(W c
1 y)))) .
(cid:107)f (yi) − f c(yi)(cid:107)2 = (cid:107)g0
= (cid:107)g0
d(yi) − gd
d(yi) − g1
d(yi)(cid:107)2
d(yi) + g1
d(yi) − g2
d(yi) + * * * + gd−1
(yi) − gd
d(yi)(cid:107)2
d
(i)
≤ (cid:107)g0
d(yi) − g1
d(yi)(cid:107)2 + * * * + (cid:107)gd−1
(yi) − gd
d(yi)(cid:107)2,
d
where (i) is from the triangle inequality.
Then we calculate (cid:107)gl−1
d
(yi) − gl
d(yi)(cid:107)2, l = 1, 2, . . . , d:
(cid:107)gl−1
d
(yi) − gl
d(yi)(cid:107)2 = (cid:107)Wdσ
(cid:16)
(cid:17)
gl−1
d−1(yi)
− Wdσ
(cid:16)
gl
d−1(yi)
(cid:17)
(cid:107)2
(i)
≤ |||Wd|||F * (cid:107)σ
(cid:16)
(cid:17)
gl−1
d−1(yi)
− σ
(cid:16)
(cid:17)
gl
d−1(yi)
(cid:107)2
d−1(yi) − gl
d−1(yi)(cid:107)2 ≤ * * *
(ii)
≤ LM F
(iii)
≤ Ld−l *
d (cid:107)gl−1
d
(cid:89)
M F
j
* (cid:107)Wlσ
(cid:16)
(cid:17)
gl−1
l−1(yi)
− W c
l σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)2
(A.31)
j=l+1
= Ld−l *
d
(cid:89)
j=l+1
M F
j
* (cid:107) (Wl − W c
l ) σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)2
(iv)
≤ Ld−l *
d
(cid:89)
M F
j
* δl * (cid:107)σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)2,
j=l+1
where (i) is from Lemma 40; (ii) comes from the assumption that σ is L-Lipschitz and
|||Wd|||F ≤ M F
b (*) and (iv) is from Lemma 40 and the choice
of hc when h is fixed, which means that |||Wl − W c
d ; (iii) is from the definition of ga
l |||F ≤ δl.
Next, we upper bound (cid:107)σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)2:
(cid:16)
(cid:107)σ
gl−1
l−1(yi)
(cid:17)
(cid:107)2 = (cid:107)σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
− σ(0)(cid:107)2
(i)
≤ L * (cid:107)gl−1
l−1(yi)(cid:107)2 = L * (cid:107)W c
l−1σ
(cid:16)
gl−2
l−2(yi)
(cid:17)
(cid:107)2
(ii)
(cid:12)
≤ L * (cid:12)
(cid:12)
(cid:12)W c
(cid:12)
(cid:12)
l−1
(cid:12)
(cid:12)
(cid:12)
(cid:12)F * (cid:107)σ
(cid:12)
(cid:12)
(cid:16)
gl−2
l−2(yi)
(cid:17)
(cid:107)2
(iii)
≤ L M F
l−1(cid:107)σ
(cid:16)
(cid:17)
gl−2
l−2(yi)
(cid:107)2
≤ * * * ≤ Ll−1 *
l−1
(cid:89)
j=1
M F
j
* (cid:107)yi(cid:107)2,
41
(A.32)
Zou and Liu
where (i) is because σ is L-Lipschitz; (ii) is from Lemma 40 and (iii) is because (cid:12)
(cid:12)
(cid:12)
(cid:12)W c
(cid:12)
(cid:12)
M F
l−1
l−1.
From (A.31) and (A.32) we have:
(cid:12)
(cid:12)
(cid:12)
(cid:12)F
(cid:12)
(cid:12)
≤
(cid:107)gl−1
d
(yi) − gl
d(yi)(cid:107)2 ≤ Ld−1
(i)
≤ Ld−1
where (i) is from Lemma 39.
Similarly:
(cid:81)d
(cid:81)d
j=1 M F
j
M F
l
j=1 M F
j
M F
l
δl(cid:107)yi(cid:107)2
δl max
(cid:110)
1, m
1
2 − 1
p
(cid:111)
((cid:107)X(cid:107)p,∞ + (cid:15)) = BF
X,(cid:15)
δl
M F
l
,
(cid:107)gl−1
d
(cid:107)gl−1
d
(x+
i ) − gl
d(x+
i )(cid:107)2 ≤ Ld−1
≤ Ld−1
(x−
i ) − gl
d(x−
i )(cid:107)2 ≤ Ld−1
≤ Ld−1
(cid:81)d
(cid:81)d
(cid:81)d
(cid:81)d
j=1 M F
j
M F
l
j=1 M F
j
M F
l
j=1 M F
j
M F
l
j=1 M F
j
M F
l
δl(cid:107)x+
i (cid:107)2
δl max
(cid:110)
1, m
δl(cid:107)x−
i (cid:107)2
δl max
(cid:110)
1, m
1
2 − 1
p
1
2 − 1
p
(cid:111)
(cid:111)
(cid:107)X +(cid:107)p,∞ = BF
X +
(cid:107)X −(cid:107)p,∞ = BF
X −
δl
M F
l
,
δl
M F
l
.
Combining the above with (A.30) yields:
|h(zi) − hc(zi)| ≤ (cid:0)BF
(cid:1) (cid:16)
(cid:107)g0
d(yi) − g1
d(yi)(cid:107)2 + * * * + (cid:107)gd−1
d
(yi) − gd
d(yi)(cid:107)2
X + + BF
X −
(cid:16)
+ BF
X,(cid:15)
(cid:107)g0
d(x+
i ) − g1
d(x+
i )(cid:107)2 + * * * + (cid:107)gd−1
d
(cid:16)
+ BF
X,(cid:15)
(cid:107)g0
d(x−
i ) − g1
d(x−
i )(cid:107)2 + * * * + (cid:107)gd−1
d
(x+
i ) − gd
d(x+
i )(cid:107)2
(x−
i ) − gd
d(x−
i )(cid:107)2
(cid:17)
(cid:17)
(cid:17)
= (BF
X + + BF
X −)BF
X,(cid:15)
d
(cid:88)
l=1
δl
M F
l
+ BF
X,(cid:15)BF
X +
d
(cid:88)
l=1
δl
M F
l
+ BF
X,(cid:15)BF
X −
d
(cid:88)
l=1
δl
M F
l
= 2BF
X,(cid:15)(BF
X + + BF
X −)
d
(cid:88)
l=1
δl
M F
l
= K
d
(cid:88)
l=1
δl
M F
l
.
So (cid:107)h − hc(cid:107)2 =
√
M max
1≤i≤M
|h(zi) − hc(zi)| ≤
√
M (cid:80)d
l=1
Kδl
M F
l
. Let δl = M F
l δ
√
M
dK
, we have:
(cid:107)h − hc(cid:107)2 ≤
√
M
d
(cid:88)
l=1
K
M F
l
*
M F
l δ
√
M
dK
≤ δ.
Then: ∀h ∈ H, ∃hc ∈ Hc s.t. (cid:107)h − hc(cid:107)2 ≤ δ, which means that sup
h∈H
choosing δl = M F
l δ
√
M
dK
.
inf
hc∈Hc
(cid:107)h − hc(cid:107)2 ≤ δ when
42
Generalization Bounds for Adversarial Contrastive Learning
So Hc is a δ-covering of H, and N (δ; H, (cid:107) * (cid:107)2) ≤ |Hc| = (cid:81)d
l , |||*|||F ) ≤
l | = N ( M F
l δ
√
M
1 + 2dK
δ
(cid:17)hl×hl−1
; SF
know that |CF
dK
(cid:16)
M
√
l=1 |CF
. So we have:
l |. By Lemma 18 we
N (δ; H, (cid:107) * (cid:107)2) ≤ |Hc| =
(cid:32)
|CF
l | ≤
1 +
√
2dK
δ
M
d
(cid:89)
l=1
(cid:33)(cid:80)d
l=1 hl*hl−1
.
(A.33)
So we can conclude that:
J (0; D) =
(cid:90) D
0
(cid:112)ln N (u; H, (cid:107) * (cid:107)2)du
(cid:90) D
(i)
≤
0
(cid:118)
(cid:117)
(cid:117)
(cid:116)
(cid:32) d
(cid:88)
(cid:33)
(cid:32)
hl * hl−1
ln
1 +
√
2dK
u
M
(cid:33)
du
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
(ii)
≤
l=1
hl * hl−1
(cid:115)
(cid:90) D
0
√
2dK
u
M
du =
l=1
(cid:118)
(cid:117)
(cid:117)
(cid:116)2dK
d
(cid:88)
l=1
hl * hl−1
(cid:90) D
4√
M
u− 1
2 du
0
(cid:118)
(cid:117)
(cid:117)
(cid:116)2dKD
= 2
d
(cid:88)
l=1
hl * hl−1
4√
M
√
(iii)
≤ 2
(cid:118)
(cid:117)
(cid:117)
2
(cid:116)
d
(cid:88)
l=1
hl * hl−1
√
√
M ,
dK
where (i) is from (A.33); (ii) comes from the fact that ln(1 + x) ≤ x, ∀x ≥ 0 and (iii) comes
from (A.29).
Since we shows that RS(H) ≤ 2E
δ −→ 0+, we have:
sup
γ,γ(cid:48)∈H(S)
(cid:107)γ(cid:48)−γ(cid:107)2≤δ
(Xγ − Xγ(cid:48))
+ 32J (δ/4; D) before, take
RS(H) ≤ 32J (0; D) ≤ 64
√
(cid:118)
(cid:117)
(cid:117)
2
(cid:116)
d
(cid:88)
l=1
hl * hl−1
√
√
dK
M = O
A.10 Proof of Theorem 26
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
√
√
dK
M
.
hl * hl−1
l=1
Theorem 26 Let U(x) = {x(cid:48)|(cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15)} (i.e. consider the (cid:96)p attack), σ(0) = 0 with Lip-
(cid:111)
schitz constant L; moreover, let F =
.
, l=1, . . . ,d
We then have:
(cid:110)
Wdσ(Wd−1σ(* * *σ(W1x)))(cid:12)
(cid:12)(cid:107)Wl(cid:107)1,∞≤M 1,∞
l
RS(H) = O
where
K0 = 2B1,∞
X,(cid:15) * (cid:0)B(cid:48)
X + + B(cid:48)
X −
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
hlhl−1
(cid:112)
dK0K1
√
M
,
l=1
(cid:1) , K1 =
K0
2
(cid:16)
+ B(cid:48)
X,(cid:15) *
X + + B1,∞
B1,∞
X −
(cid:17)
,
43
Zou and Liu
where
B(cid:48)
X,(cid:15) = Ld−1
B1,∞
X,(cid:15) = Ld−1
d
(cid:89)
l=1
d
(cid:89)
l=1
hlM 1,∞
l m1− 1
p ((cid:107)X(cid:107)p,∞ + (cid:15)) , B(cid:48)
X = Ld−1
d
(cid:89)
l=1
hlM 1,∞
l m1− 1
p (cid:107)X(cid:107)p,∞,
M 1,∞
l
((cid:107)X(cid:107)p,∞ + (cid:15)) , B1,∞
X = Ld−1
d
(cid:89)
l=1
M 1,∞
l
(cid:107)X(cid:107)p,∞.
Before giving the proof, we firstly introduce some useful lemmas.
Lemma 42 Let A ∈ Rm×n, b ∈ Rn, then we have: (cid:107)A * b(cid:107)∞ ≤ (cid:107)A(cid:107)1,∞ * (cid:107)b(cid:107)∞.
Proof
[Proof of Lemma 42] Let Ai be the rows of A, i = 1, 2, . . . , m, we have:
(cid:107)A * b(cid:107)∞ = max
1≤i≤m
|Aib|
(i)
≤ max
1≤i≤m
((cid:107)Ai(cid:107)1 * (cid:107)b(cid:107)∞) = (cid:107)A(cid:107)1,∞ * (cid:107)b(cid:107)∞,
where (i) is from the Holder's Inequality.
Lemma 43 Let A ∈ Rm×n, b ∈ Rn, then we have:
(cid:107)A * b(cid:107)1 ≤ (cid:107)A(cid:107)∞,1 * (cid:107)b(cid:107)1 ≤ m(cid:107)A(cid:107)1,∞ * (cid:107)b(cid:107)1.
Proof
[Proof of Lemma 43] Let Ai be the rows of A, i = 1, 2, . . . , m, we have:
(cid:107)A * b(cid:107)1 =
(i)
≤
|Aib|
m
(cid:88)
i=1
m
(cid:88)
i=1
((cid:107)Ai(cid:107)∞ * (cid:107)b(cid:107)1) = (cid:107)A(cid:107)∞,1 * (cid:107)b(cid:107)1,
where (i) is from the Holder's Inequality. And we have:
(cid:107)A(cid:107)∞,1 = (cid:107) ((cid:107)A1(cid:107)∞, * * * , (cid:107)Am(cid:107)∞) (cid:107)1
(i)
≤ (cid:107) ((cid:107)A1(cid:107)1, * * * , (cid:107)Am(cid:107)1) (cid:107)1
(ii)
≤ m(cid:107) ((cid:107)A1(cid:107)1, * * * , (cid:107)Am(cid:107)1) (cid:107)∞ = m(cid:107)A(cid:107)1,∞,
where (i) is from the fact that (cid:107)x(cid:107)∞ ≤ (cid:107)x(cid:107)1 and (ii) is the from the fact that for all
x ∈ Rm, (cid:107)x(cid:107)1 ≤ m(cid:107)x(cid:107)∞. So we have: (cid:107)A * b(cid:107)1 ≤ (cid:107)A(cid:107)∞,1 * (cid:107)b(cid:107)1 ≤ m(cid:107)A(cid:107)1,∞ * (cid:107)b(cid:107)1.
Lemma 44 Suppose σ is a L-Lipschitz function, then the elementwise vector map corre-
sponding to σ is also L-Lipschitz with respect to (cid:107) * (cid:107)∞.
Proof
[Proof of Lemma 44]
(cid:107)σ(x) − σ(y)(cid:107)∞ = max
1≤i≤n
|σ(x)i − σ(y)i| = max
1≤i≤n
|σ(xi) − σ(yi)|
(i)
≤ max
1≤i≤n
L|xi − yi| = L * (cid:107)x − y(cid:107)∞,
44
Generalization Bounds for Adversarial Contrastive Learning
where (i) is because σ is L-Lipschitz.
Now we can turn to the proof of Theorem 26.
Proof
[Proof of Theorem 26] In this case, let U(x) = (cid:8)x(cid:48)(cid:12)
(cid:12)(cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15)(cid:9), we have:
F =
(cid:110)
x −→ Wdσ(Wd−1σ(* * * σ(W1x))) (cid:12)
(cid:12) (cid:107)Wl(cid:107)1,∞ ≤ M 1,∞
l
, l = 1, . . . , d
(cid:111)
,
(cid:26)
H =
h(x, x+, x−) = min
x(cid:48)∈U (x)
(cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1) |f ∈ F
(cid:27)
.
(cid:110)
Wl ∈ Rhl×hl−1(cid:12)
(cid:12)(cid:107)Wl(cid:107)1,∞ ≤ M 1,∞
l
(cid:111)
, l = 1, 2, . . . , d. Let C1,∞
l
be the δl-covering
l =
Let S1,∞
of S1,∞
l
and define:
(cid:110)
F c =
f c : x −→ W c
d σ (cid:0)W c
d−1σ (* * * σ(W c
1 x))(cid:1) (cid:12)
(cid:12)W c
(cid:12)
l ∈ C1,∞
l
, l = 1, 2, . . . , d
(cid:111)
⊆ F,
(cid:26)
Hc =
hc(x, x+, x−) = min
x(cid:48)∈U (x)
(cid:0)f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1)(cid:1) |f ∈ F c
(cid:27)
⊆ H.
Similar to the proof of Theorem 22, we know that the Rademacher Process is a sub-Gaussian
Process with respect to the Euclidean metric, which induces the (cid:96)2 norm.
i , x−
Similar to the proof of Theorem 24, given the training set S = {(xi, x+
(cid:44) {zi}M
i )}M
i=1
i=1,
define the (cid:96)2-norm for a function in H as:
∀h ∈ H, (cid:107)h(cid:107)2 :=
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
i=1
[h(zi)]2.
(cid:110)
Define H(S) =
Theorem 24, we have:
(h(z1), h(z2), . . . , h(zM ))
(cid:12)
(cid:12)
(cid:12)h ∈ H
(cid:111)
, with the same argument as in proof of
and
N (δ; H(S), (cid:107) * (cid:107)2) = N (δ; H, (cid:107) * (cid:107)2) ,
RS(H) = E[ sup
θ∈H(S)
Xθ].
So by Lemma 20 and (9), we know that: ∀δ ∈ (0, D]:
RS(H) = E[ sup
θ∈H(S)
Xθ] ≤ E
(cid:34)
sup
θ,(cid:101)θ∈H(S)
(Xθ −X
(cid:35)
(cid:101)θ)
≤ 2E
(Xγ −Xγ(cid:48))
sup
γ,γ(cid:48)∈H(S)
(cid:107)γ(cid:48)−γ(cid:107)2≤δ
+32J (δ/4; D),
where
D = sup
(cid:107)θ − θ(cid:48)(cid:107)2 ≤ 2 sup
θ∈H(S)
θ,θ(cid:48)∈H(S)
(cid:107)θ(cid:107)2 = 2sup
h∈H
(cid:107)h(cid:107)2 = 2sup
h∈H
(cid:118)
(cid:117)
(cid:117)
(cid:116)
M
(cid:88)
i=1
[h(zi)]2 ≤ 2
√
and J (a; b) = (cid:82) b
a
(cid:112)lnN (u; H(S), (cid:107) * (cid:107)2)du = (cid:82) b
a
(cid:112)lnN (u; H, (cid:107) * (cid:107)2)du
45
|h(zi)|,
M sup
h∈H
1≤i≤M
(A.34)
Zou and Liu
Then for any f ∈ F, x ∈ X , let xl be the output of x passing through the first l − 1
layers, we have:
(cid:107)f (x)(cid:107)∞ = (cid:107)Wdσ(Wd−1xd−1)(cid:107)∞
(i)
≤ (cid:107)Wd(cid:107)1,∞ * (cid:107)σ(Wd−1xd−1)(cid:107)∞
(ii)
= (cid:107)Wd(cid:107)1,∞ * (cid:107)σ(Wd−1xd−1) − σ(0)(cid:107)∞
(iii)
≤ LM 1,∞
d
(cid:107)Wd−1xd−1(cid:107)∞ ≤ * * *
≤ Ld−1
d
(cid:89)
M 1,∞
l
l=2
(cid:107)W1x(cid:107)∞ ≤ Ld−1
M 1,∞
l
(cid:107)x(cid:107)∞
(iv)
≤ Ld−1
d
(cid:89)
l=1
= Ld−1
d
(cid:89)
l=1
M 1,∞
l
(cid:107)x(cid:107)p ≤ Ld−1
d
(cid:89)
l=1
M 1,∞
l
(cid:107)X(cid:107)p,∞,
d
(cid:89)
M 1,∞
l max (cid:8)1, m−p(cid:9) (cid:107)x(cid:107)p
l=1
where (i) is from Lemma 42; (ii) is from the fact that σ(0) = 0; (iii) comes from the
assumption that σ is L-Lipschitz and |||Wd|||1,∞ ≤ M 1,∞
and (iv) is attained by setting
r = 1, r∗ = ∞ in the proof of Lemma 39.
To simplify the notations, we define:
d
B1,∞
X = Ld−1 *
d
(cid:89)
l=1
M 1,∞
l
* (cid:107)X(cid:107)p,∞, B(cid:48)
X = Ld−1 *
B1,∞
X,(cid:15) = Ld−1 *
d
(cid:89)
l=1
So:
M 1,∞
l
* ((cid:107)X(cid:107)p,∞ + (cid:15)) , B(cid:48)
X,(cid:15) = Ld−1 *
(cid:33)
hl * M 1,∞
l
m1− 1
p * (cid:107)X(cid:107)p,∞
(cid:33)
hl * M 1,∞
l
m1− 1
p * ((cid:107)X(cid:107)p,∞ + (cid:15)) .
(cid:32) d
(cid:89)
l=1
(cid:32) d
(cid:89)
l=1
∀x ∈ X , f ∈ F, (cid:107)f (x)(cid:107)∞ ≤ B1,∞
X .
Similarly, we have:
Similarly,
∀x ∈ X , f ∈ F, ∀ (cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15), (cid:107)f (x(cid:48))(cid:107)∞ ≤ B1,∞
X,(cid:15) .
(A.35)
(cid:107)f (x)(cid:107)1 = (cid:107)Wdσ(Wd−1xd−1)(cid:107)1
(i)
≤ hd * (cid:107)Wd(cid:107)1,∞ * (cid:107)σ(Wd−1xd−1)(cid:107)1
(ii)
= hd * (cid:107)Wd(cid:107)1,∞ * (cid:107)σ(Wd−1xd−1) − σ(0)(cid:107)1
(iii)
≤ hd * L * M 1,∞
d
(cid:107)Wd−1xd−1(cid:107)1 ≤ * * *
d
(cid:89)
≤ Ld−1
hlM 1,∞
l
(cid:107)W1x(cid:107)1 ≤ Ld−1
d
(cid:89)
l=1
hlM 1,∞
l
(cid:107)x(cid:107)1
l=2
(cid:32) d
(cid:89)
(iv)
≤ Ld−1
(cid:33)
hlM 1,∞
l
(cid:110)
1, m1− 1
p
(cid:111)
max
(cid:107)x(cid:107)p
= Ld−1
l=1
(cid:33)
hlM 1,∞
l
(cid:32) d
(cid:89)
l=1
m1− 1
p (cid:107)x(cid:107)p ≤ Ld−1
(cid:33)
hlM 1,∞
l
(cid:32) d
(cid:89)
l=1
m1− 1
p (cid:107)X(cid:107)p,∞,
46
Generalization Bounds for Adversarial Contrastive Learning
where (i) is from Lemma 43; (ii) is from the fact that σ(0) = 0; (iii) comes from the
assumption that σ is L-Lipschitz and |||Wd|||1,∞ ≤ M 1,∞
and (iv) is attained by setting
r = ∞, r∗ = 1 in the proof of Lemma 39.
d
So we know that:
Similarly, we have:
∀x ∈ X , f ∈ F, (cid:107)f (x)(cid:107)1 ≤ B(cid:48)
X .
(A.36)
∀x ∈ X , f ∈ F, ∀ (cid:107)x(cid:48) − x(cid:107)p ≤ (cid:15), (cid:107)f (x(cid:48))(cid:107)1 ≤ B(cid:48)
X,(cid:15).
(A.37)
For any h ∈ H, z ∈ X 3, let x∗ = arg min
(cid:107)x(cid:48)−x(cid:107)p≤(cid:15)
of x∗ passing through the first l − 1 layers, we have:
f (x(cid:48))T (f (x+) − f (x−)) and let xl be the output
|h(z)| = |
inf
(cid:107)x(cid:48)−x(cid:107)p≤(cid:15)
f (x(cid:48))T (cid:0)f (x+) − f (x−)(cid:1) | = |f (x∗)T (cid:0)f (x+) − f (x−)(cid:1) |
≤ (cid:107)f (x∗)(cid:107)∞ * (cid:107)f (x+) − f (x−)(cid:107)1
where (i) is from (A.35) and (A.36). So we get:
(i)
≤ B1,∞
X,(cid:15) * (B(cid:48)
X + + B(cid:48)
X −),
√
(i)
≤ 2
D
M sup
h∈H
1≤i≤M
√
|h(zi)| ≤ 2
M B1,∞
X,(cid:15) * (B(cid:48)
X + + B(cid:48)
X −) (cid:44)
√
M K0,
(A.38)
where (i) is from (A.34). Now, we need to find the smallest distance between H and Hc, i.e.
sup
h∈H
inf
hc∈Hc
(cid:107)h − hc(cid:107)2.
By the discussion in (A.34), we have (cid:107)h − hc(cid:107)2 ≤
zi = (xi, x+
we have:
i ), i = 1, 2, . . . , M , given h and hc such that (cid:107)Wl −W c
i , x−
√
M max
1≤i≤M
|h(zi) − hc(zi)|. For any
l (cid:107)1,∞ ≤ δl, l = 1, 2, . . . , d,
|h(zi)−hc(zi)| = (cid:12)
(cid:12)
inf
i−xi(cid:107)p≤(cid:15)
(cid:107)x(cid:48)
f (x(cid:48)
i)T (cid:0)f (x+
i ) − f (x−
i )(cid:1)− inf
(cid:107)x(cid:48)
i−xi(cid:107)p≤(cid:15)
f c(x(cid:48)
i)T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1) (cid:12)
(cid:12).
Let x∗
i = arg inf
(cid:107)x(cid:48)
i−xi(cid:107)p≤(cid:15)
and let
f (x(cid:48)
i)T (cid:0)f (x+
i ) − f (x−
i )(cid:1) and xc
f c(x(cid:48)
i)T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1),
i = arg inf
(cid:107)x(cid:48)
i−xi(cid:107)p≤(cid:15)
yi =
(cid:26) xc
i
x∗
i
i )T (cid:0)f (x+
f (x∗
otherwise
i ) − f (x−
i )(cid:1) ≥ f c(xc
i )T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1)
.
47
Zou and Liu
Then we have:
|h(zi) − hc(zi)| = |f (x∗
i )T (cid:0)f (x+
i ) − f (x−
i )(cid:1) − f c(xc
i )T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1) |
(i)
≤ |f (yi)T (cid:0)f (x+
= |f (yi)T (cid:0)f (x+
i ) − f (x−
i ) − f (x−
+ f c(yi)T (cid:0)f (x+
i )(cid:1) − f c(yi)T (cid:0)f c(x+
i )(cid:1) − f c(yi)T (cid:0)f (x+
i ) − f (x−
i )(cid:1) |
i ) − f c(x−
i )(cid:1)
i ) − f (x−
i )(cid:1) − f c(yi)T (cid:0)f c(x+
i ) − f c(x−
i )(cid:1) |
(ii)
≤ | (f (yi) − f c(yi))T (cid:0)f (x+
i ) − f (x−
i )(cid:1) |
i ) − f c(x+
+ |f c(yi)T (cid:0)f (x+
i )(cid:1) | + |f c(yi)T (cid:0)f (x−
i ) − f c(x−
i )(cid:1) |
(iii)
≤ (B(cid:48)
X + + B(cid:48)
X −)(cid:107)f (yi) − f c(yi)(cid:107)∞ + B(cid:48)
+ B(cid:48)
i )(cid:107)∞,
i ) − f c(x−
X,(cid:15)(cid:107)f (x−
X,(cid:15)(cid:107)f (x+
i ) − f c(x+
i )(cid:107)∞
(A.39)
where (i) is easily verified by the definition of yi; (ii) is from the triangle inequality and (iii)
is from (A.36) and (A.37). Again we define ga
b (*) as:
b (y) = Wbσ (Wb−1σ (* * * Wa+1σ (W c
ga
a * * * σ(W c
1 y)))) .
Then:
(cid:107)f (yi) − f c(yi)(cid:107)∞ = (cid:107)g0
= (cid:107)g0
d(yi) − gd
d(yi) − g1
d(yi)(cid:107)∞
d(yi) + g1
d(yi) − g2
d(yi) + * * * + gd−1
(yi) − gd
d(yi)(cid:107)∞
d
(i)
≤ (cid:107)g0
d(yi) − g1
d(yi)(cid:107)∞ + * * * + (cid:107)gd−1
(yi) − gd
d(yi)(cid:107)∞,
d
where (i) is from the triangle inequality.
Then we calculate (cid:107)gl−1
d
(yi) − gl
d(yi)(cid:107)∞, l = 1, 2, . . . , d:
(cid:107)gl−1
d
(yi) − gl
d(yi)(cid:107)∞ = (cid:107)Wdσ
(cid:16)
(cid:17)
gl−1
d−1(yi)
− Wdσ
(cid:16)
gl
d−1(yi)
(cid:17)
(cid:107)∞
(i)
≤ (cid:107)Wd(cid:107)1,∞ * (cid:107)σ
(cid:16)
(cid:17)
gl−1
d−1(yi)
− σ
(cid:16)
(cid:17)
gl
d−1(yi)
(cid:107)∞
(ii)
≤ LM 1,∞
d
(cid:107)gl−1
d−1(yi) − gl
d−1(yi)(cid:107)∞ ≤ * * *
(iii)
≤ Ld−l *
d
(cid:89)
j=l+1
M 1,∞
j
* (cid:107)Wlσ
(cid:16)
(cid:17)
gl−1
l−1(yi)
− W c
l σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)∞
(A.40)
= Ld−l *
d
(cid:89)
j=l+1
M 1,∞
j
* (cid:107) (Wl − W c
l ) σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)∞
(iv)
≤ Ld−l *
d
(cid:89)
j=l+1
M 1,∞
j
* δl * (cid:107)σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)∞,
48
Generalization Bounds for Adversarial Contrastive Learning
where (i) is from Lemma 42; (ii) comes from the assumption that σ is L-Lipschitz and
(cid:107)Wd(cid:107)1,∞ ≤ M 1,∞
b (*) and (iv) is from Lemma 42 and the
choice of hc when h is fixed, which means that (cid:107)Wl − W c
; (iii) is from the definition of ga
l (cid:107)1,∞ ≤ δl.
d
Next, we upper bound (cid:107)σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)∞:
(cid:16)
(cid:17)
gl−1
l−1(yi)
(cid:107)σ
(cid:107)∞ = (cid:107)σ
(cid:16)
(cid:17)
gl−1
l−1(yi)
− σ(0)(cid:107)∞
(i)
≤ L * (cid:107)gl−1
l−1(yi)(cid:107)∞
= L * (cid:107)W c
l−1σ
(cid:16)
gl−2
l−2(yi)
(cid:17)
(cid:107)∞
(ii)
≤ L * (cid:107)W c
l−1(cid:107)1,∞ * (cid:107)σ
(cid:16)
gl−2
l−2(yi)
(cid:17)
(cid:107)∞
(A.41)
(iii)
≤ L M 1,∞
l−1 (cid:107)σ
(cid:16)
gl−2
l−2(yi)
(cid:17)
(cid:107)∞ ≤ * * * ≤ Ll−1 *
l−1
(cid:89)
j=1
M 1,∞
j
* (cid:107)yi(cid:107)∞,
where (i) is because σ is L-Lipschitz; (ii) is from Lemma 42 and (iii) is because (cid:107)W c
M 1,∞
l−1 .
(A.40) and (A.41) show that:
l−1(cid:107)1,∞ ≤
(cid:81)d
(cid:81)d
j=1 M 1,∞
j
M 1,∞
l
j=1 M 1,∞
j
M 1,∞
l
δl(cid:107)yi(cid:107)∞
δl ((cid:107)X(cid:107)p,∞ + (cid:15)) = B1,∞
X,(cid:15)
δl
M 1,∞
l
,
(cid:107)gl−1
d
(yi) − gl
d(yi)(cid:107)∞ ≤ Ld−1
(i)
≤ Ld−1
where (i) is from Lemma 39.
Similarly, we have:
(cid:107)gl−1
d
(cid:107)gl−1
d
(x+
i ) − gl
d(x+
i )(cid:107)∞ ≤ Ld−1
≤ Ld−1
(x−
i ) − gl
d(x−
i )(cid:107)∞ ≤ Ld−1
≤ Ld−1
(cid:81)d
(cid:81)d
j=1 M 1,∞
j
M 1,∞
l
j=1 M 1,∞
j
M 1,∞
l
(cid:81)d
(cid:81)d
j=1 M 1,∞
j
M 1,∞
l
j=1 M 1,∞
j
M 1,∞
l
49
δl(cid:107)x+
i (cid:107)∞
δl (cid:107)X +(cid:107)p,∞ = B1,∞
X +
δl
M 1,∞
l
,
δl(cid:107)x−
i (cid:107)∞
δl (cid:107)X −(cid:107)p,∞ = B1,∞
X −
δl
M 1,∞
l
.
Zou and Liu
Combine the above with (A.39):
|h(zi) − hc(zi)| ≤ (cid:0)B(cid:48)
(cid:1) (cid:16)
(cid:107)g0
d(yi) − g1
d(yi)(cid:107)∞ + * * * + (cid:107)gd−1
d
(yi) − gd
d(yi)(cid:107)∞
X + + B(cid:48)
X −
(cid:16)
+ B(cid:48)
X,(cid:15)
(cid:107)g0
d(x+
i ) − g1
d(x+
i )(cid:107)∞ + * * * + (cid:107)gd−1
d
(cid:16)
+ B(cid:48)
X,(cid:15)
(cid:107)g0
d(x−
i ) − g1
d(x−
i )(cid:107)∞ + * * * + (cid:107)gd−1
d
(x+
i ) − gd
d(x+
i )(cid:107)∞
(x−
i ) − gd
d(x−
i )(cid:107)∞
(cid:17)
(cid:17)
(cid:17)
=
√
So (cid:107)h − hc(cid:107)2 =
= (B(cid:48)
X + + B(cid:48)
X −)B1,∞
X,(cid:15)
d
(cid:88)
l=1
δl
M 1,∞
l
+ B(cid:48)
X,(cid:15)B1,∞
X +
d
(cid:88)
δl
M 1,∞
l
+ B(cid:48)
X,(cid:15)B1,∞
X −
d
(cid:88)
l=1
δl
M 1,∞
l
(cid:104)
B1,∞
X,(cid:15) (B(cid:48)
X + + B(cid:48)
X −) + B(cid:48)
X,(cid:15)(B1,∞
X + + B1,∞
X − )
l=1
(cid:105) d
(cid:88)
l=1
δl
M 1,∞
l
(cid:44) K1
d
(cid:88)
l=1
δl
M 1,∞
l
.
M max
1≤i≤M
|h(zi) − hc(zi)| ≤
√
M (cid:80)d
l=1
K1δl
M 1,∞
l
. Let δl = M 1,∞
√
l
dK1
δ
M
, then:
(cid:107)h − hc(cid:107)2 ≤
√
M
d
(cid:88)
l=1
K1
M 1,∞
l
*
δ
M 1,∞
l
√
dK1
M
≤ δ,
which means that: ∀h ∈ H, ∃hc ∈ Hc s.t. (cid:107)h − hc(cid:107)2 ≤ δ, so we have sup
h∈H
when choosing δl = M 1,∞
√
.
l
dK1
δ
M
So Hc is a δ-covering of H, and N (δ; H, (cid:107) * (cid:107)2) ≤ |Hc| = (cid:81)d
; S1,∞
M
l
| = N ( M 1,∞
, (cid:107) * (cid:107)1,∞) ≤
1 + 2dK1
δ
(cid:16)
√
√
l
l=1 |C1,∞
(cid:17)hl×hl−1
.
l
l
dK1
δ
M
know that: |C1,∞
This means:
inf
hc∈Hc
(cid:107)h − hc(cid:107)2 ≤ δ
|. By Lemma 18 we
N (δ; H, (cid:107) * (cid:107)2) ≤ |Hc| =
(cid:32)
|C1,∞
l
| ≤
1 +
√
2dK1
δ
M
d
(cid:89)
l=1
(cid:33)(cid:80)d
l=1 hl*hl−1
.
(A.42)
So we can conclude that:
J (0; D) =
(cid:90) D
0
(cid:112)ln N (u; H, (cid:107) * (cid:107)2)du
(cid:90) D
(i)
≤
0
(cid:118)
(cid:117)
(cid:117)
(cid:116)
(cid:32) d
(cid:88)
(cid:33)
(cid:32)
hl * hl−1
ln
1 +
√
2dK1
u
M
(cid:33)
du
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
(ii)
≤
l=1
hl * hl−1
(cid:115)
(cid:90) D
0
√
2dK1
u
M
du =
l=1
(cid:118)
(cid:117)
(cid:117)
(cid:116)2dK1
d
(cid:88)
l=1
hl * hl−1
(cid:90) D
4√
M
u− 1
2 du
0
(cid:118)
(cid:117)
(cid:117)
(cid:116)2dK1D
= 2
d
(cid:88)
l=1
hl * hl−1
4√
M
√
(iii)
≤ 2
(cid:118)
(cid:117)
(cid:117)
2
(cid:116)
d
(cid:88)
l=1
hl * hl−1
(cid:112)
dK0K1
√
M ,
where (i) is from (A.42); (ii) comes from the fact that ln(1 + x) ≤ x, ∀x ≥ 0 and (iii) comes
from (A.38).
50
Generalization Bounds for Adversarial Contrastive Learning
(a) Influence on clean accuracy
(b) Influence on adversarial accuracy
Figure B.1: The effect of block size on the accuracy. In the figure, we show the clean accuracy
and the adversarial accuracy of the mean classifier under PGD and FGSM attack
with (cid:15) = 0.01 and (cid:15) = 0.02. The block size is choosen from {1, 2, 4, 6, 8, 10}.
(a) The influence on the clean accuracy; (b) The influence on the
adversarial accuracy.
Since we shows that RS(H) ≤ 2E
δ −→ 0+, we have:
sup
γ,γ(cid:48)∈H(S)
(cid:107)γ(cid:48)−γ(cid:107)2≤δ
(Xγ − Xγ(cid:48))
+ 32J (δ/4; D) before, take
RS(H) ≤ 32J (0; D) ≤ 64
√
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
2
l=1
hl * hl−1
(cid:112)
dK0K1
√
M = O
(cid:118)
(cid:117)
(cid:117)
(cid:116)
d
(cid:88)
l=1
hl * hl−1
(cid:112)
dK0K1
√
M
.
Appendix B. Extra Experimental Results
In this section, we present our experimental results for CIFAR-100. The basic settings are
the same as §6.
B.1 Improvement from Regularizer
Table B.1 shows that the F -norm regularizer helps to improve the adversarial robustness of
the model, which agrees with our Theorem 24.
51
1246810block size8283848586878889clean accuracy(%)pgd-0.01pgd-0.02fgsm-0.01fgsm-0.021246810block size7476788082adv accuracy(%)pgd-0.01pgd-0.02fgsm-0.01fgsm-0.02Zou and Liu
Attack
PGD
FGSM
(cid:15)
0.01
0.02
0.01
0.02
Type
Clean
Adv
Clean
Adv
Clean
Adv
Clean
Adv
0
84.07
78.49
81.87
73.01
84.61
78.70
80.47
72.45
0.002
85.65
79.55
81.91
73.05
84.53
78.64
80.48
72.45
λ
0.005
85.48
79.39
81.93
73.07
84.95
79.18
80.39
72.36
0.01
85.52
79.41
82.08
73.16
84.58
78.70
80.44
72.41
0.02
58.53
79.44
81.97
73.07
84.55
78.63
82.09
73.87
Table B.1: Results of experiments on the regularizer on data set CIFAR-100. In this table,
we list the clean accuracy (Clean) and adversarial accuracy (Adv) of the mean
classifier under the PGD and FGSM attack with (cid:15) = 0.01 and (cid:15) = 0.02. λ is
chosen from {0, 0.002, 0.005, 0.01, 0.02}, and λ = 0 indicates no regularizer.
B.2 Effect of Block Size
Figure B.1 records the influence of block size on the clean accuracy and the adversarial
accuracy of the model, from which we can see that a larger block size will yield better
adversarial accuracy.
References
Pranjal Awasthi, Natalie Frank, and Mehryar Mohri. Adversarial learning guarantees for
linear hypotheses and neural networks. In ICML, volume 119, pages 431–441, 2020.
Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural networks.
In SP, pages 39–57, 2017.
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple
framework for contrastive learning of visual representations. In ICML, volume 119, pages
1597–1607, 2020.
Qingyi Gao and Xiao Wang. Theoretical investigation of generalization bounds for adversarial
learning of deep neural networks. Journal of Statistical Theory and Practice, 15(2):51,
2021.
Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning
by predicting image rotations. In ICLR, 2018.
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing
adversarial examples. In ICLR, 2015.
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast
for unsupervised visual representation learning. In CVPR, pages 9726–9735, 2020.
52
Generalization Bounds for Adversarial Contrastive Learning
Chih-Hui Ho and Nuno Vasconcelos. Contrastive learning with adversarial examples. In
NeurIPS, 2020.
Ziyu Jiang, Tianlong Chen, Ting Chen, and Zhangyang Wang. Robust pre-training by
adversarial contrastive learning. In NeurIPS, 2020.
Minseon Kim, Jihoon Tack, and Sung Ju Hwang. Adversarial self-supervised contrastive
learning. In NeurIPS, 2020.
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images.
2009.
Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. Adversarial examples in the physical
world. In ICLR, 2017.
Michel Ledoux and Michel Talagrand. Probability in Banach Spaces:
isoperimetry and
processes. Springer Science & Business Media, 2013.
Boqi Li and Weiwei Liu. Wat: Improve the worst-class robustness in adversarial training,
2023.
Xiyuan Li, Xin Zou, and Weiwei Liu. Defending against adversarial attacks via neural
dynamic system. In NeurIPS, 2022.
Xinsong Ma, Zekai Wang, and Weiwei Liu. On the tradeoff between robustness and fairness.
In NeurIPS, 2022.
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian
Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
Vitaly Maiorov and Allan Pinkus. Lower bounds for approximation by MLP neural networks.
Neurocomputing, 25(1-3):81–91, 1999.
Chengzhi Mao, Amogh Gupta, Vikram Nitin, Baishakhi Ray, Shuran Song, Junfeng Yang,
and Carl Vondrick. Multitask learning strengthens adversarial robustness. In ECCV,
pages 158–174, 2020.
Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of Machine
Learning. Adaptive computation and machine learning. MIT Press, 2012.
Omar Montasser, Steve Hanneke, and Nathan Srebro. VC classes are adversarially robustly
learnable, but only improperly. In COLT, pages 2512–2530, 2019.
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: A simple
and accurate method to fool deep neural networks. In CVPR, pages 2574–2582, 2016.
Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-based capacity control in
neural networks. In COLT, volume 40, pages 1376–1401, 2015.
Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving
jigsaw puzzles. In ECCV, volume 9910, pages 69–84, 2016.
53
Zou and Liu
Kento Nozawa, Pascal Germain, and Benjamin Guedj. Pac-bayesian contrastive unsupervised
representation learning. In UAI, volume 124, pages 21–30, 2020.
Nikunj Saunshi, Orestis Plevrakis, Sanjeev Arora, Mikhail Khodak, and Hrishikesh Khan-
deparkar. A theoretical analysis of contrastive unsupervised representation learning. In
ICML, volume 97, pages 5628–5637, 2019.
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry.
Adversarially robust generalization requires more data. In NeurIPS, pages 5019–5031,
2018.
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J.
Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
Martin J. Wainwright. High-dimensional statistics: A non-asymptotic viewpoint, volume 48.
Cambridge University Press, 2019.
Zekai Wang and Weiwei Liu. Robustness verification for contrastive learning. In ICML,
pages 22865–22883, 2022.
Jingyuan Xu and Weiwei Liu. On robust multiclass learnability. In NeurIPS, 2022.
Dong Yin, Kannan Ramchandran, and Peter L. Bartlett. Rademacher complexity for
adversarially robust generalization. In ICML, volume 97, pages 7085–7094, 2019.
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Under-
standing deep learning requires rethinking generalization. In ICLR, 2017.
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P. Xing, Laurent El Ghaoui, and Michael I.
Jordan. Theoretically principled trade-off between robustness and accuracy. In ICML,
volume 97, pages 7472–7482, 2019.
54
|
|
http://arxiv.org/abs/2302.10631v3 | 2023-05-31T13:35:17 | 2023-02-21T12:44:12 | FedST: Secure Federated Shapelet Transformation for Time Series
Classification | This paper explores how to customize time series classification (TSC) methods
with the help of external data in a privacy-preserving federated learning (FL)
scenario. To the best of our knowledge, we are the first to study on this
essential topic. Achieving this goal requires us to seamlessly integrate the
techniques from multiple fields including Data Mining, Machine Learning, and
Security. In this paper, we systematically investigate existing TSC solutions
for the centralized scenario and propose FedST, a novel FL-enabled TSC
framework based on a shapelet transformation method. We recognize the federated
shapelet search step as the kernel of FedST. Thus, we design a basic protocol
for the FedST kernel that we prove to be secure and accurate. However, we
identify that the basic protocol suffers from efficiency bottlenecks and the
centralized acceleration techniques lose their efficacy due to the security
issues. To speed up the federated protocol with security guarantee, we propose
several optimizations tailored for the FL setting. Our theoretical analysis
shows that the proposed methods are secure and more efficient. We conduct
extensive experiments using both synthetic and real-world datasets. Empirical
results show that our FedST solution is effective in terms of TSC accuracy, and
the proposed optimizations can achieve three orders of magnitude of speedup. | [
"Zhiyu Liang",
"Hongzhi Wang"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.10631v3",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.10631v3",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | Noname manuscript No.
(will be inserted by the editor)
FedST: Secure Federated Shapelet Transformation for Time
Series Classification
Zhiyu Liang * Hongzhi Wang
3
2
0
2
y
a
M
1
3
]
G
L
.
s
c
[
3
v
1
3
6
0
1
.
2
0
3
2
:
v
i
X
r
a
Received: date / Accepted: date
Abstract This paper explores how to customize time
series classification (TSC) methods with the help of
external data in a privacy-preserving federated learn-
ing (FL) scenario. To the best of our knowledge, we
are the first to study on this essential topic. Achiev-
ing this goal requires us to seamlessly integrate the
techniques from multiple fields including Data Mining,
Machine Learning, and Security. In this paper, we sys-
tematically investigate existing TSC solutions for the
centralized scenario and propose FedST, a novel FL-
enabled TSC framework based on a shapelet transfor-
mation method. We recognize the federated shapelet
search step as the kernel of FedST. Thus, we design a
basic protocol for the FedST kernel that we prove to be
secure and accurate. However, we identify that the basic
protocol suffers from efficiency bottlenecks and the cen-
tralized acceleration techniques lose their efficacy due
to the security issues. To speed up the federated pro-
tocol with security guarantee, we propose several opti-
mizations tailored for the FL setting. Our theoretical
analysis shows that the proposed methods are secure
and more efficient. We conduct extensive experiments
using both synthetic and real-world datasets. Empiri-
cal results show that our FedST solution is effective in
terms of TSC accuracy, and the proposed optimizations
can achieve three orders of magnitude of speedup.
Keywords Time series classification * Federated
Learning * Time series features * Time series shapelets
Zhiyu Liang.
Harbin Institute of Technology, Harbin, China
E-mail: [email protected]
Hongzhi Wang.
Harbin Institute of Technology, Harbin, China
E-mail: [email protected]
1 Introduction
Time series classification (TSC) aims to predict the
class label for given time series samples. It is one of
the most important problem for data analytics, with
applications in various scenarios [82, 24,78].
Despite the impressive performance existing TSC al-
gorithms have been achieving [7, 39, 2, 79,68,84, 22, 83],
they usually make an ideal assumption that the user
has free access to enough labeled data. However, it is
quite difficult to collect and label the time series for
real-world applications.
For instance, small manufacturing businesses mon-
itor their production lines using sensors to analyze the
working condition. Since the data sequences related to
specific conditions, e.g., a potential failure of an in-
strument, are usually rare pieces located in unknown
regions of the whole monitoring time series, the users
have to manually identify the related pieces for label-
ing, which can be expensive due to the need of pro-
fessional knowledge. As a consequence, it is costly for
these businesses to benefit from the advanced TSC so-
lutions, as they have no enough labeled data to learn
accurate models.
To deal with the problem, a natural idea is to enrich
the local training data by gathering the labeled samples
from external data sources, e.g., the other businesses
that run the same instrument. However, it has been
increasingly difficult for organizations to combine their
data due to privacy concerns [90,86].
1.1 Motivation
Is it possible to develop accurate TSC methods with
the help of external datasets in a privacy-preserving
2
Zhiyu Liang, Hongzhi Wang
Fig. 1: Example of enabling federated learning to enrich
the training time series data. A business who owns some
training time series samples (blue) collaborates with the
partners who have additional training samples (green)
to jointly build the TSC model. They follow some secure
protocols to avoid disclosing their private training data.
manner? A recent concept, named Federated Learn-
ing (FL) [63], provides us an inspiration [53]. FL aims
to enable multiple businesses to jointly train a model
without revealing their private data to each other. An
example of using FL to enrich the training time series
data is shown in Figure 1. However, although many FL
solutions have been studied in the literature [90,47, 95,
40,61], their main focus is the training of the general
models, including tree models [89,29,27,3,19,48], lin-
ear models [74,70,16,5,91], and neural networks [63,
80,65,64,11,1,30], which have limitations for the TSC
problem.
First, the tree-based and linear classifiers are shown
weak in capturing the temporal patterns for classifying
time series [7], while the accuracy of neural networks
usually relies on the hyper-parameter tunning, which is
still a challenging problem in the FL scenario. Second,
many real-world TSC applications [31,93,78,76] expect
the classification decisions to be explainable, e.g., the
users know why a working condition is determined as
a fault. However, the time series sample usually has a
large number of data points (e.g., 537 on average for
the 117 fixed-length datasets of the UCR Archive [21]),
which are taken as independent variables by the general
models. The explanation can be much complex with so
much input variables.
Facing the above limitations, we propose to specifi-
cally design FL solutions for the TSC problem. The ba-
sic idea is to extend the customized centralized TSC ap-
proaches to the federated setting. To achieve this goal,
we have proposed FedTSC [53], a brand new FL system
tailored for TSC, and demonstrated its utility in VLDB.
In this paper, we elaborate on the design ideas and es-
sential techniques of a main internal of the system, i.e.,
the novel Federated Shapelet Transformation (FedST)
Fig. 2: Illustration of the shapelet-based features. A
shapelet is a salient subsequence that represents the
shape unique to certain classes. With a few shapelets
of high distinguishing ability, each time series sam-
ple is transformed into a low-dimensional feature vec-
tor representing how similar (distant) the sample is
to these shapelets. The classification is made and ex-
plained based on the few features rather than the abun-
dant datapoints of the raw time series. In this example,
the time series similar to shapelet 1 (orange) and dis-
tant to shapelet 2 (blue) are classified into class 1 and
vice versa.
framework. We design FedST based on the centralized
shapelet transformation method due to the following
benefits.
First, the shapelet transformation method not only
achieves competitive accuracy over existing centralized
TSC approaches [7], but also serves as an essential com-
ponent of the ensemble classifier named HIVE-COTE
2.0, which is currently state-of-the-art centralized TSC
model [68]. Second, the method adopts the shapelet-
based features rather than the raw time series as the
input of the classification models. The features repre-
sent the similarity between the time series and a set of
shapelets (i.e., the salient subsequences), which can be
order-of-magnitude less in number compared to the raw
data points and very intuitive to understand [35]. Thus,
building classifiers on top of the shapelet-based features
can simplify the explanation. Third, the shapelets used
to transform the raw time series can be extracted in
an anytime manner to flexibly balance the classifiation
accuracy and the efficiency (see Section 4.2), which are
beneficial for practical utility. Figure 2 is an illustration
of the shapelet-based features.
1.2 Challenges and contributions
Although it is practical to extend the centralized ap-
proach to the federated setting, it is unexplored how to
achieve both security and efficiency during the feder-
Local time series samplesPP1...External time series samplesSecure protocolsExternal time series samplesTSC modelAn unseen time series samplepredictWhich class the sample belongs to?DDDDDDDDDDDDDDDDboundryDistance to shapelet1Distance to shapelet2Series belongs to class 1Series belongs to class 2FedST: Secure Federated Shapelet Transformation for Time Series Classification
3
ated shapelet search (FedSS) step, which is the kernel
of the FedST framework (see Section 4.2 in detail).
The goal of the federated shapelet search is to jointly
utilize the distributed labeled time series data to find
the shapelets with the highest quality for distinguishing
the classes. To ensure security of the federated com-
putation, a natural idea is to extend the centralized
shapelet search using secure multi-party computation
(MPC) [92,20,41, 42]. Following that, we first develop
ΠF edSS−B, the basic protocol to achieve FedSS. Bene-
fiting from MPC, we show that this protocol is secure
and effective.
However, by our analysis, the basic protocol suf-
fers from low efficiency due to the high overhead in-
curred by MPC during the shapelet distance computa-
tion and the shapelet quality measurement stages. Al-
though there are acceleration techniques in the central-
ized scenario [72,43,93,77], we prove that these meth-
ods are insecure in the FL setting and thus to be unfea-
sible. Consequently, we propose acceleration methods
tailored for the FL setting with security guarantee to
tackle the efficiency bottlenecks of ΠF edSS−B.
For shapelet distance computation, we identify the
Euclidean norm computation as the efficiency bottle-
neck, so we propose a speed-up method based on a novel
secure dot-product protocol. For quality measurement,
we first design an optimization to reduce the duplicated
time-consuming interactive operations with secure sort-
ing. Then, we propose to further boost the efficiency
through an acceptable trade-off of classification accu-
racy. We show both theoretically and empirically the
effectiveness of these techniques.
3. We conduct extensive experiments to evaluate our
solutions, which has three major observations. (1)
Our FedST offers superior accuracy comparable to
the non-private approach. (2) Each of our proposed
acceleration approaches is individually effective, and
they together bring up to three orders of magnitude
of speedup. (3) The proposed trade-off method pro-
vides up to 8.31x speedup over our well-optimized
protocol while guaranteeing comparable accuracy.
We further demonstrate the interpretabiltiy and flex-
ibiltiy of our our framework.
Organization. We introduce the preliminaries in Sec-
tion 3. We propose the FedST framework and talk about
the FedST kernel, i.e., federated shapelet search, in Sec-
tion 4. The basic protocol of the federated shapelet
search is presented and analyzed in Section 5. We elab-
orate on the acceleration methods tailored for the two
efficiency bottlenecks of the basic protocol in Section 6
and 7, respectively. We show experimental results in
Section 8. We illustrate how to incorporate differential
privacy to further enhance the security in Section 9 and
conclude this paper in Section 10.
2 Related Work
Our work is related to federated learning, feature-based
time series classification, and privacy protection.
Contributions. We summarize our contributions as
follows.
2.1 Federated Learning
1. We investigate the customized FL solution for time
series classification. In particular, we propose FedST,
the first shapelet-based FL method which extends
the centralized shapelet transformation to the feder-
ated scenario to make use of its advantages in terms
of accuracy, interpretability and flexibility.
2. We present ΠF edSS−B, a basic federated protocol
for the FedST kernel, i.e., the federated shapelet
search, which adopts MPC to achieve security. We
analyze the protocol in terms of security, effective-
ness, and efficiency. We identify the efficiency bottle-
necks of ΠF edSS−B and the invalidity of the central-
ized speed-up techniques due to the security issue.
To boost the protocol efficiency, we propose accel-
eration methods tailored for the FL setting, which
are theoretically secure and are more scalable and
efficient than the basic protocol.
Recently, there have been numerous works that dedi-
cate to the federated learning of the general models, in-
cluding the linear models [74,70, 16, 5, 91], the tree mod-
els [89,29,27,3,19,48], and the neural networks [63,80,
65,64,11,1,94,30]. However, none of them achieve the
same goal as our solution, because these general mod-
els have limitations in tackling the TSC problem [7] in
terms of accuracy and interpretability. There are also
FL solutions designed for specific tasks [65,57, 87, 37,
58,51,85,73,50,17,81]. These methods target scenarios
that are completely different from ours. As a result,
we propose to tailor FL method for TSC. In specific,
we contribute to proposing the secure FedST frame-
work to take advantage of the shapelet transformation
in terms of accuracy, interpretability and flexibility, and
addressing the security and efficiency issues within the
framework.
4
Zhiyu Liang, Hongzhi Wang
2.2 Feature-based Time Series Classification
Instead of directly building classifiers upon the raw time
series, transforming the time series into low-dimensional
or sparse feature vectors can not only achieve competi-
tive classification accuracy, but also simplify the expla-
nation.
In summary, there are three types of TSC meth-
ods based on different explainable features, i.e., the
shapelet-based methods [93,72,35,12,34,46,52] that de-
termine the class labels based on the localized shapes,
the interval-based methods [66,13,68] that classify the
time series based on the statistics at some specific time
ranges, and the dictionary-based approaches [45,44,69,
67] that utilize the pattern frequency as features. These
types of methods can be complement with each other to
contribute to state-of-the-art accuracy [55,6,68]. This
work focuses on developing a novel framework with
a series of optimization techniques taking advantage
of the shapelet-based approaches, while we would like
to present our contributions [53] of enabling FL for
interval-based and dictionary-based TSC in the future.
Shapelet-based TSC is first proposed by [93]. In the
early works, the shapelets are discovered in a company
with a decision tree training, where a shapelet is found
at each tree node to determine the best split of the
node [93,72,54]. To benefit from the other classifiers,
a shapelet transformation framework [35] is proposed
that decouples the shapelet discovery from the decision
tree training and produces a transformed dataset that
can be used in conjunction with any classifier. Several
works are raised to speedup the shapelet search [93, 43,
72,77] and improve the shapelet quality [12].
Another line of works dedicate to jointly learning
the shapelets and the classifiers [34,52,59,46,60,28,36].
However, the learning-based methods are much more
complex because they incur several additional hyperpa-
rameters that highly affect the accuracy. Besides, they
are inflexible due to the coupling of the shapelet and
classifier, and cannot run in the anytime fashion to
trade off the classification accuracy and the efficiency.
Based on the above discussions, we take advantage
of the shapelet transformation method [35,12,6] to de-
velop our FL solution. Nevertheless, our work differs
from existing studies because we carefully consider the
security and efficiency issues in a brand new FL sce-
nario.
2.3 Privacy Protection
Data privacy is one of the most essential problems in
FL [90,49,40]. Several techniques have been studied by
existing works. Secure Multi-Party Computation [92]
is a general framework that offers secure protocols for
many arithmetic operations [20, 41,42]. These opera-
tions are efficient for practical utility [4, 18,48,70, 50,
89] under the semi-honest model that most FL works
consider, while they can also be extended to the mali-
cious model through zero-knowledge proofs [32].
Homomorphic Encryption (HE) is another popular
technique in FL [19,29,58, 94, 89], which allows a sim-
ple implementation of the secure addition. However, HE
does not support some complex operations (e.g., divi-
sion and comparison). The encryption and decryption
are also computationally intensive [89, 29].
Compared to the solutions based on MPC and HE
which aim to protect the intermediate information dur-
ing the federated computation, an orthogonal line of
works adopt the Differential Privacy (DP) to protect
the privacy for the outputs, such as the parameters of
the learned models. It works by adding noises to the
private data [87,88,56,51,75] to achieve a trade-off be-
tween the precision and the degree of privacy for a tar-
get function. Thus, DP can usually complement with
MPC and HE.
In this paper, we mainly adopt MPC to ensure no in-
termediate information is disclosed during the complex
computations of FedST, because it provides the pro-
tocols for the required arithmetic operations. We also
illustrate that the private data can be further protected
with privacy guarantee by incorporating DP.
3 Preliminaries
This section presents the preliminaries, including the
target problem of the paper and the two building blocks
of the proposed FedST, i.e., the shapelet transformation
and the secure multi-party computation.
3.1 Problem Statement
Time series classification (TSC) is the problem of creat-
ing a function that maps from the space of input time
series samples to the space of class labels [7]. A time
series (sample) is defined as a sequence of data points
T = (t1, . . . , tp, . . . , tN ) ordered by time, where tp is
the observation at timestamp p, and N is the length.
The class label y is a discrete variable with C possible
values. i.e., y ∈ {c}C
c=1 where C ≥ 2.
Typically, TSC is achieved by using a training data
set T D = {(Tj, yj)}M
j=1 to build a model that can out-
put either predicted class values or class distributions
for previously unseen time series samples, where the in-
stance (Tj, yj) represents the pair of the j-th time series
sample and the corresponding label.
FedST: Secure Federated Shapelet Transformation for Time Series Classification
5
Specifically, in this paper we target the TSC prob-
lem in a federated setting, denoted as the FL-enabled
TSC problem defined as follows.
Definition 1 (FL-enabled TSC problem) Given a
party P0 (named initiator) who owns a training data
set T D0 and n − 1 partners P1, . . . , Pn−1 (named par-
ticipants) who hold the labeled series T D1, . . . , T Dn−1
collected from the same area (e.g., monitoring the same
type of instruments), where T Di = {(T i
j=1, the
goal of the problem is to coordinate the parties to build
TSC models M for the initiator P0 without revealing
the local data T D0, . . ., T Dn−1 to each other.
j)}Mi
j , yi
Note that every party in the group can act as the ini-
tiator to benefit from the federated learning. For ease of
exposition, we denote (cid:80)n−1
i=0 T Di =
T D. Ideally, the performance of M should be lossless
compared to that of the model trained in a centralized
scenario using the combined data T D.
i=0 Mi = M and (cid:83)n−1
Similar to previous FL works [89,29,30,51,85], we
consider the semi-honest model where each party fol-
lows the protocols but may try to infer the private infor-
mation from the received messages, while our method
can be extended to the malicious model through zero-
knowledge proofs [32]. Unlike existing FL works that
usually conditionally allow disclosure of some private
data [29,58], we adopt a stricter security definition [89,
70] to ensure no intermediate information is disclosed.
Definition 2 (Security) Let F be an ideal function-
ality such that the parties send their data to a trusted
party for computation and receive the final results from
the party. Let Π be a real-world protocol executed
by the parties. We say that Π securely realizes F if
for each adversary A attacking the real interaction,
there exists a simulator S attacking the ideal inter-
action, such that for all environments Z, the quantity
| Pr[REAL(Z, A, Π, λ) = 1]−Pr[IDEAL(Z, S, F, λ) =
1]| is negligible (in λ).
Intuitively, the simulator S must achieve the same
effect in the ideal interaction as the adversary A achieves
in the real interaction. In this paper, we identify the
ideal functionality as the federated search of the high-
quality shapelets, which is the kernel of the proposed
FedST framework (see Section 4.2 in detail). Therefore,
we contribute to design secure and efficient protocols to
achieve the functionality in the real FL scenario.
The federated setting in this paper is similar to the
horizontal and cross-silo FL [40,61] because the data
are horizontally partitioned across a few businesses and
each of them has considerable but insufficient data.
However, unlike the mainstream FL solutions that usu-
ally rely on a trust server [37,94,62], we remove this
dependency considering that identifying such a party
can cause additional costs [58]. Besides, the security
definition we adopt is stricter than many existing FL
works as mentioned above. Therefore, our setting can
be more practical but challenging.
3.2 Shapelet Transformation
Time series shapelets are defined as representative sub-
sequences that discriminate the classes. Denote S =
(s1, . . . , sL) a shapelet generated from T D = {(Tj, yj)}M
and the length of Tj is N , where L ≤ N . Let Tj[s, l] de-
note the subseries of Tj = (tj,1, . . . , tj,N ) that starts at
the timestamp s and has length l, i.e.,
j=1
Tj[s, l] = (tj,s, . . . , tj,s+l−1), 1 ≤ s ≤ N − l + 1,
(1)
the distance between the shapelet and the j-th time se-
ries is defined as the minimum Euclidean norm (ignore
the square root) between S and the L-length subseries
of Tj, i.e.,
dTj ,S =
min
p∈{1,...,N −L+1}
||S − Tj[p, L]||2.
(2)
By definition, dTj ,S reflects the similarity between a
localized shape of Tj and S, which is a class-specific fea-
ture. The quality of S can be measured by computing
the distances to all series in T D, i.e., DS = {dTj ,S}M
j=1,
and evaluating the differences in distribution of the
distances between class values {yj}M
j=1. The state-of-
the-art method of shapelet quality measurement is to
use the Information Gain (IG) with a binary strat-
egy [12]. Each distance dTj ,S ∈ DS is considered as
a splitting threshold, denoted as τ . The threshold is
and Dτ,R
used to partition the dataset DS into Dτ,L
S ,
such that Dτ,L
S =
DS \ Dτ,L
S . The quality of S is the maximum informa-
tion gain among the thresholds, i.e.,
S = {dTj ,S|dTj ,S ≤ τ }M
j=1 and Dτ,R
S
H(DS) − (H(Dτ,L
S ) + H(Dτ,R
S )),
QIG(S) = max
∀τ
where
H(D) = −(p log2 p + (1 − p) log2(1 − p)),
(3)
(4)
|D|
is the fraction of samples in D that belongs
p = |Dy(S)|
to the class of the sample generating S, y(S) ∈ {c}C
and Dy(S) = {dTj ,S|yj = y(S)}M
c=1
j=1.
In shapelet transformation, a set of candidates are
randomly sampled from the possible subsequences of
T D. After measuring the quality of all candidates, the
K subsequences with the highest quality are chosen
as the shapelets, which are denoted as {Sk}K
k=1. The
6
Zhiyu Liang, Hongzhi Wang
shapelets are used to transform the original dataset T D
into a newly tabular dataset of K features, where each
attribute represents the distance between the shapelet
and the original series, i.e., D = {(Xj, yj)}M
j=1 where
Xj = (dTj ,S1, . . . , dTj ,SK ). The unseen series are trans-
formed in the same way for prediction. D can be used in
conjunction with any classifier, such as the well-known
intrinsically interpretable decision tree and logistic re-
gression [71].
3.3 Secure Multiparty Computation
Secure multiparty computation (MPC) [92] allows par-
ticipants to compute a function over their inputs while
keeping the inputs private. In this paper, we utilize the
additive secret sharing scheme for MPC [20] since it of-
fers the protocols of the common arithmetic operations
applicable to practical situations [18,50]. It performes
in a field Zq for a prime q. We denote a value x ∈ Zq
that is additively shared among parties as
⟨x⟩ = {⟨x⟩0, . . . , ⟨x⟩n−1},
(5)
where ⟨x⟩i is a random share of x hold by party Pi.
Suppose x is a private value of Pi. To secretly share
x, Pi randomly chooses ⟨x⟩j ∈ Zq and sends it to Pj(j ̸=
i). Then, Pi sets ⟨x⟩i = x − (cid:80)
j⟨x⟩j mod q. To re-
construct x, all parties reveal their shares to compute
x = (cid:80)n−1
i=0 ⟨x⟩i mod q. For ease of exposition, we omit
the modular operation in the rest of the paper.
Under the additive secret sharing scheme, a function
z = f (x, y) is computed by using a MPC protocol that
takes ⟨x⟩ and ⟨y⟩ as input and outputs the secret shared
⟨z⟩. In this paper, we mainly use the following MPC
protocols as building blocks:
(a) Addition: ⟨z⟩ = ⟨x⟩ + ⟨y⟩
(b) Multiplication: ⟨z⟩ = ⟨x⟩ * ⟨y⟩
(c) Division: ⟨z⟩ = ⟨x⟩/⟨y⟩
(d) Comparison: ⟨z⟩ = ⟨x⟩
(e) Logarithm: ⟨z⟩ = log2(⟨x⟩)
We refer readers to [9,15,14,4] for the detailed im-
?
< ⟨y⟩ : ⟨1⟩ : ⟨0⟩
plementation of the operations.
In addition, given the result ⟨b⟩ = ⟨x⟩
?
< ⟨y⟩ : ⟨1⟩ :
⟨0⟩, the smaller one of two values ⟨x⟩, ⟨y⟩ can be se-
curely assigned to ⟨z⟩, as:
(f) Assignment: ⟨z⟩ = ⟨b⟩ * ⟨x⟩ + (1 − ⟨b⟩) * ⟨y⟩.
With the assignment protocol, it is trivial to per-
form the maximum, minimum, and top-K computation
for a list of secret shares by sequentially comparing and
swapping the adjacent elements in the list using the se-
cure comparison and assignment protocols.
Fig. 3: An illustration of the FedST framework.
4 Solution Overview
This section overviews our FL-enabled TSC framework,
which is a key component of our FedTSC system [53]
and is built based on the centralized shapelet transfor-
mation [35,12,6]. We provide the framework overview
in Section 4.1. Then, we identify the FedST kernel in
Section 4.2.
4.1 FedST Framework
Overall, FedST has two stages: (1) federated shapelet
search; (2) federated data transformation and classifier
training. The two stages are illustrated in Figure 3.
In the first stage, all parties jointly search for the K
best shapelets {Sk}K
k=1 from a candidate set SC.
Note that P0 requires the found shapelets to explain
the shapelet-based features, so the shapelet candidates
in SC are only generated by P0 to ensure the local time
series of the participants cannot be accessed by the ini-
tiator. This may raise a concern that the shapelets will
be missed if they do not occur in T D0. Fortunately,
since the high-quality shapelets are usually highly re-
dundant in the training data, it is shown enough to find
them by checking some randomly sampled candidates
rather than all possible subsequences [6,33]. Hence, it
is feasible to generate SC by P0 in our cross-silo setting
where each business has considerable (but insufficient)
data. We also verify this issue in Section 8.2 and 8.5.
In stage two, the time series data T Di in each party
is transformed into the K dimensional secretly shared
Party PP00(Initiator )Party PP11(Participant)Party PPnn−11(Participant)SSSS(TT1100,yy1100)(TT2200, yy2200)TTDD00ffffffaaaaaaSS∈SSSSTTDD11TTDD11(TT1111,yy1111)⟨DD00⟩Classifier⟨DD11⟩(TT11nn−11,yy11nn−11)TTDDnn−11TTDDnn−11⟨DDnn−11⟩*Stage 1(FedSTkernel)Stage 2SS11SSKKShapelets......⟨DDSS11⟩⟨QQIIII⟩⟨DDSS00⟩⟨DDSSnn−11⟩⟨QQFF⟩ORTTDD11TTDDnn−11CandidateGeneration*DistanceComputationShapeletRetrieval*QualityMeasurement*QualityMeasurement*DistanceComputationDataTransformationDataTransformationClassifierTrainingClassifierTrainingShapeletRetrievalLocal ComputationPrivacyPreservationFederatedComputationBasic Distance(Sec. 5.1) Retrieval(Sec. 5.1)Our Optimized Distance (Sec. 6)Our Trade-off (Sec. 7.2)Basic IG(Sec. 5.1) Our Optimized IG (Sec. 7.1)Identical DataFedST: Secure Federated Shapelet Transformation for Time Series Classification
7
tabular data as:
⟨Di⟩ = {(⟨Xi
j⟩, ⟨yi
j⟩)}Mi
j=1, ∀i ∈ {0, . . . , n − 1},
(6)
where
⟨Xi
j⟩ = (⟨dT i
j ,S1 ⟩, . . . , ⟨dT i
j ,SK ⟩).
Then, a standard classifier is built over the joint
(7)
secretly shared data set ⟨D⟩ = (cid:83)n−1
i=0 ⟨Di⟩.
Note that there is always a trade-off between secu-
rity and accuracy/interpretability in FL. To achieve a
good balance, FedST ensures only P0 learns the shapelets
and classifiers, while nothing else can be revealed to the
parties. This degree of privacy has been shown practi-
cal by many FL systems [29,30,89]. Additionally, we
illustrate in Section 9 that we can further enhance the
security by incorporating differential privacy [26], guar-
anteeing that the revealed outputs leak limited informa-
tion about the private training data.
4.2 FedST Kernel: Federated Shapelet Search
The transformed data set ⟨D⟩ is a common tabular data
set with continuous attributes, which can be used in
conjunction with any standard classifier. Consequently,
any classifier training protocol built for secretly shared
data (e.g., [70,3,96,18]) can be seamlessly integrated
into our framework. Nevertheless, there exists no pro-
tocol that tackles the orthogonal problem of federated
shapelet search and data transformation. Further, the
data transformation is to compute the distances be-
tween each training series and shapelet, which is just a
subroutine of the shapelet search. Thus, the key tech-
nical challenge within our FedST is to design secure
and efficient protocols to achieve the federated shapelet
search (Stage 1 in Figure 3), which becomes the kernel
part of FedST.
Formally, we define the functionality of the feder-
ated shapelet search, FF edSS, as follows.
Definition 3 (Federated shapelet search, FF edSS)
Given the time series datasets distributed over the par-
ties, i.e., T D0, . . . , T Dn−1, and the shapelet candidates
SC generated from T D0, the goal of FF edSS is to search
for the K best shapelets {Sk|Sk ∈ SC}K
k=1 for P0 by
leveraging the distributed data sets.
To realize FF edSS under the security defined in Def-
inition 2, a straightforward thought is to design secu-
rity protocols by extending the centralized method to
the FL setting using MPC. Following this, we present
ΠF edSS−B (Section 5.1), the protocol that achieves our
basic idea. We show the protocol is secure and effec-
tive (Section 5.2), but we identify that it suffers from
low efficiency due to the high communication overhead
incurred by MPC and the failure of the pruning tech-
niques due to the security issue (Section 5.3).
To tackle the efficiency issue, we propose secure ac-
celeration techniques tailored for the FL setting that
dramatically boost the protocol efficiency by optimiz-
ing the two bottlenecked processes of ΠF edSS−B, i.e.,
the distance computation (Section 6) and the quality
measurement (Section 7). Experiment results show that
each of these techniques is individually effective and
they together contribute to three orders of magni-
tude of speedup (Section 8.3).
Besides, since the evaluation of each shapelet candi-
date is in a randomized order and independent from the
others, FedSS can perform in an anytime fashion [6,33].
That is, the user announces a time contract, so that the
evaluation stops once the running time exceeds the con-
tract, and only the assessed candidates are considered
in the following steps. Since this strategy relies only
on the publicly available running time, it is feasible in
the FL setting [53] to flexibly balance the accuracy and
efficiency. We verify this issue in Section 8.5.
5 Basic protocol ΠF edSS−B
We now introduce the basic protocol ΠF edSS−B, which
is extended from the centralized shapelet search us-
ing MPC to protect the intermediate information (Sec-
tion 5.1). We discuss the protocol in terms of security,
effectiveness, and efficiency in Section 5.2, and analyze
the bottlenecks of the protocol in Section 5.3.
5.1 Protocol Description
ΠF edSS−B is outlined in Algorithm 1. The parties jointly
assess the quality of each candidate and then select the
K best as the shapelets. The algorithm performs in
three steps. First, the parties compute the distance be-
tween the samples and each candidate (Lines 2-8). Sec-
ond, the parties evaluate the quality of the candidate
over the secretly shared distances and labels (Lines 9).
Finally, the parties jointly retrieve the K candidates
with the highest quality and reveal the shares of the
indices to P0 to recover the selected shapelets (Lines
10-11). These three steps are described as follows.
Distance Computation. Since the candidates are lo-
cally generated by P0, the distance between the samples
of P0 and the candidates can be locally computed. Af-
ter that, P0 secretly shares the results to enable the
subsequent steps (Lines 3-5).
8
Zhiyu Liang, Hongzhi Wang
Algorithm 1: Basic Protocol ΠF edSS−B
j , yi
Input: T Di = {(T i
j )}Mi
j=1, i = 0, . . . , n − 1: local
datasets
SC: A set of shapelet candidates locally
generated by P0
K: the number of shapelets
Output: {Sk}K
k=1: shapelets revealed to P0
1 for S ∈ SC do
2
for i ∈ {0, . . . , n − 1} do
if i == 0 then
for j ∈ {1, . . . , M0} do
P0 locally computes dT 0
j ,S and
secretly shares the result among all
parties
else
for j ∈ {1, . . . , Mi} do
All parties jointly compute ⟨dT i
j ,S⟩
All parties jointly compute the quality ⟨QIG(S)⟩
over the secretly shared distances and labels
All parties jointly find the K candidates with the
highest quality and reveal the indices {⟨Ik⟩}K
to P0
k=1
3
4
5
6
7
8
9
10
11 return {Sk = SCIk }K
k=1
To compute the distances between the samples of
each participant Pi and the candidates (Lines 6-8), the
MPC operations have to be adopted. For example, to
j ,S, Pi and P0 secretly share T i
j and S re-
compute dT i
spectively. Next, the parties jointly compute each Eu-
j [p, L]||2⟩ using MPC. At last, the
clidean norm ⟨||S, T i
parties jointly determine the shapelet distance ⟨dT i
j ,S⟩
by Eq. 2 using the secure minimum operation (see Sec-
tion 3.3).
Quality Measurement. Based on Eq 3, to compute
the IG quality of S ∈ SC (Line 9), we need to securely
partition the dataset DS using each threshold τ and
compute the number of samples belonging to each class
c (c ∈ {1, . . . , C}) for DS, Dτ,L
S . We achieve
it over the secretly shared distances and labels by lever-
aging the indicating vector defined as follows.
S , and Dτ,R
Definition 4 (Indicating Vector) Given a dataset
D = {xj}M
j=1 and a subset A ⊆ D, we define the in-
dicating vector of A, denoted as γA⊆D, as a vector of
size M whose j-th (j ∈ {1, . . . , M }) entry represents
whether xj is in A, i.e., γA⊆D[j] = 1 if xj ∈ A, and 0
otherwise.
For example, for D = {x1, x2, x3} and A = {x1, x3},
the indicating vector of A is γA⊆D = (1, 0, 1). Suppose
that γA1⊆D and γA2⊆D are the indicating vectors of
A1 and A2, respectively, we have
γA1⊆D * γA2⊆D = |A1 ∩ A2|,
(8)
where |A1∩A2| is the cardinality of A1∩A2. Specifically,
we have γA1⊆D * 1 = |A1|.
With the indicating vector, we securely compute
⟨QIG(S)⟩ as follows.
At the beginning, P0 generates a vector of size C to
indicate the class of S, i.e.,
γy(S) = γ{y(S)}⊆{c}C
c=1
,
and secretly shares the vector among all parties.
Next, for each splitting threshold
⟨τ ⟩ ∈
n−1
(cid:91)
{⟨dT i
j ,S⟩}Mi
j=1,
(9)
(10)
i=0
the parties jointly compute the secretly shared vector
⟨γL⟩ = ⟨γDτ,L
⟨γR⟩ = ⟨γDτ,R
S ⊆DS
S ⊆DS
⟩,
⟩ = 1 − ⟨γL⟩,
(11)
where
⟨γDτ,L
S ⊆DS
[j]⟩ = ⟨dT i
j ,S⟩
?
< ⟨τ ⟩, j ∈ {1, . . . , M }.
(12)
Meanwhile, each party Pi secretly shares the vector
γi
c⊆T Di to indicate its samples that belong to each
class c. Denote the indicating vectors of all parties as
T Di
⟨γc⟩ = (⟨γ0
T D0
c ⊆T D0 ⟩, . . . , ⟨γn−1
T Dn−1
c ⊆T Dn−1 ⟩),
(13)
which indicates the samples in DS that belong to class
c, i.e.,
⟨γc⟩ = ⟨γT Dc⊆T D⟩ = ⟨γDS,c⊆DS ⟩.
(14)
As such, the parties compute the following statistics
using MPC:
⟨|DSτ,L|⟩ = ⟨γL⟩ * 1,
⟨|DSτ,R|⟩ = |DS| − ⟨|DSτ,L|⟩,
⟨|DS,y(S)|⟩ = ⟨γy(S)⟩ * (⟨γ1⟩ * 1, . . . , ⟨γC⟩ * 1),
⟨|Dτ,L
S,y(S)|⟩ = ⟨γy(S)⟩ * (⟨γ1⟩ * ⟨γL⟩, . . . , ⟨γC⟩ * ⟨γL⟩),
S,y(S)|⟩ = ⟨γy(S)⟩ * (⟨γ1⟩ * ⟨γR⟩, . . . , ⟨γC⟩ * ⟨γR⟩).
⟨|Dτ,R
(15)
Given the statistics in Equation 15 and the public value
|DS| = M , the parties can jointly compute ⟨QIG(S)⟩
by Eq. 3.
Shapelet Retrieval. Given the quality of the candi-
dates in secret shares, the parties jointly retrieve the
indices of the K best shapelets (Line 10) by securely
comparing the adjacent quality values and then swap-
ping the values and the corresponding indices based on
the comparison results (see Section 3.3). The indices are
output to P0 to recover the jointly selected shapelets
(Line 11).
FedST: Secure Federated Shapelet Transformation for Time Series Classification
9
Fig. 4: Throughputs (#operations per second) of differ-
ent MPC operations executed by three parties. Secure
addition is much more efficient than the others because
it is executed without communication [15].
Fig. 5: Illustration of the Euclidean norm pruning and
its information disclosure.
5.2 Protocol Discussion
5.3 Bottleneck Analysis
This section analyzes ΠF edSS−B in terms of security,
effectiveness, and efficiency.
Security. The security of ΠF edSS−B is guaranteed by
the following Theorem:
Theorem 1 ΠF edSS−B is secure under the security de-
fined in Definition 2.
Proof (Proof Sketch) In ΠF edSS−B, all joint computa-
tions are executed using MPC. With the indicating vec-
tor, the secure computations are data-oblivious. An ad-
versary learns no additional information. The security
follows.
Effectiveness. We discuss the protocol effectiveness in
terms of classification accuracy. ΠF edSS−B is directly
extended from the centralized approach by using the
secret-sharing-based MPC operations, which have con-
siderable computation precision [15,14,4]. Therefore, it
is expected that the accuracy of FedST has no difference
from the centralized approach. The experiment results
in Section 8.2 validate this issue.
Efficiency. As shown in Figure 4, the secret-sharing-
based MPC is usually bottlenecked by communication
rather than computation. Therefore, it is more indica-
tive to analyze the efficiency by considering the com-
plexity of only the interactive operations, including the
secure multiplication, division, comparison, and loga-
rithm operations. We follow this metric for efficiency
analysis in the paper.
ΠF edSS−B in Algorithm 1 takes O(|SC| * M N 2) for
distance computation. The quality measurement has a
complexity of O(|SC| * M 2). Securely finding the top-
K candidates has a complexity of O(|SC| * K). Since
K is usually a small constant, the total complexity of
ΠF edSS−B can be simplified as O(|SC| * (M N 2 + M 2)).
As discussed in Section 5.2, ΠF edSS−B is secure and
effective to enable federated shapelet search. However,
the basic protocol has expensive time cost in the FL
setting for both distance computation and quality mea-
surement steps, which bottleneck the efficiency of the
protocol. Two major reasons are as below.
Reason I. Heavy Communication Overhead. As
discussed in Section 5.2, ΠF edSS−B takes O(|SC|*M N 2)
and O(|SC * |M 2) expensive interactive operations to
compute the distance and measure the quality for all
candidates, which dominate in the complexity. There-
fore, the efficiency of ΠF edSS−B is bottlenecked by the
first two steps, i.e., distance computation and quality
measurement.
Reason II. Failure of Acceleration Techniques.
Even using only local computation, repeatedly comput-
ing the distance and quality for all candidates are time-
consuming [93]. To tackle this, existing studies pro-
pose pruning strategies for acceleration [72, 43,93,77].
Unfortunately, the pruning techniques are inevitably
data-dependent, which violates the security of Defini-
tion 2 that requires the federated computation oblivi-
ous. Thus, we have to abandon these acceleration strate-
gies in the FL setting. We show the security issue in
Theorem 2 and Theorem 3.
Theorem 2 Protocol ΠF edSS−B is insecure under the
security defined in Definition 2 if using the Euclidean
norm pruning strategies proposed in [43] and [77].
Proof (Proof Sketch) Figure 5 illustrates the Euclidean
norm pruning. The basic idea is to maintain a best-so-
far Euclidean norm at each timestamp p ∈ {1, . . . , N −
LS + 1}, and incrementally compute the sum of the
squared differences between each pair of data points
j [p, LS]||2 (left). Once the sum
when computing ||S − T i
/ R J & |