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.11956v1 | 2023-02-23T12:10:59 | 2023-02-23T12:10:59 | An Adam-enhanced Particle Swarm Optimizer for Latent Factor Analysis | Digging out the latent information from large-scale incomplete matrices is a
key issue with challenges. The Latent Factor Analysis (LFA) model has been
investigated in depth to an alyze the latent information. Recently, Swarm
Intelligence-related LFA models have been proposed and adopted widely to
improve the optimization process of LFA with high efficiency, i.e., the
Particle Swarm Optimization (PSO)-LFA model. However, the hyper-parameters of
the PSO-LFA model have to tune manually, which is inconvenient for widely
adoption and limits the learning rate as a fixed value. To address this issue,
we propose an Adam-enhanced Hierarchical PSO-LFA model, which refines the
latent factors with a sequential Adam-adjusting hyper-parameters PSO algorithm.
First, we design the Adam incremental vector for a particle and construct the
Adam-enhanced evolution process for particles. Second, we refine all the latent
factors of the target matrix sequentially with our proposed Adam-enhanced PSO's
process. The experimental results on four real datasets demonstrate that our
proposed model achieves higher prediction accuracy with its peers. | [
"Jia Chen",
"Renyu Zhang",
"Yuanyi Liu"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11956v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11956v1",
"@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.NE"
] | An Adam-enhanced Particle Swarm Optimizer
for Latent Factor Analysis
Jia Chen
School of Cyber Science and Technology
Beihang University
Beijing, China
[email protected]
Renyu Zhang
School of Cyber Science and Technology
Beihang University
Beijing, China
[email protected]
Yuanyi Liu*
School of Cyber Science and Technology
Beihang University
Beijing, China
[email protected]
Abstract- Digging out the latent information from large-scale incomplete matrices is a key issue with challenges. The Latent
Factor Analysis (LFA) model has been investigated in depth to an alyze the latent information. Recently, Swarm Intelligence-related
LFA models have been proposed and adopted widely to improve the optimization process of LFA with high efficiency, i.e., the Particle
Swarm Optimization (PSO)-LFA model. However, the hyper-parameters of the PSO-LFA model have to tune manually, which is
inconvenient for widely adoption and limits the learning rate as a fixed value. To address this issue, we propose an Adam-enhanced
Hierarchical PSO-LFA model, which refines the latent factors with a sequential Adam-adjusting hyper-parameters PSO algorithm.
First, we design the Adam incremental vector for a particle and construct the Adam-enhanced evolution process for particles. Second,
we refine all the latent factors of the target matrix sequentially with our proposed Adam-enhanced PSO's process. The experimental
results on four real datasets demonstrate that our proposed model achieves higher prediction accuracy with its peers.
Keywords-High-dimensional and Incomplete (HDI) Matrix, Latent Factor Analysis (LFA) model, Adam algorithm, Particle
Swarm Optimization (PSO) algorithm.
I. INTRODUCTION
With the smart applications and services becoming more complex and more widespread, there have generated and
accumulated massive of High-Dimensional and Incomplete (HDI) data [1-7]. These data involve extremely useful latent
information for analyzing the features of real entities and their relationships. Digging out the latent information from the HDI
data is a challenging and interesting issue, which can help the smart applications and services provide better recommendation
to the customers.
To analyze the HDI data effectively, the Latent Factor Analysis (LFA) model has been widely investigated [8-11]. The LFA
model focuses on analyzing the latent factors of involved entities, which can represent the relationships between two entities
and the latent characteristics of entities. The input data of an LFA model is generally an HDI matrix. The LFA model maps the
target HDI matrix into a low-dimensional latent factor space, builds a low rank approximate matrix based on the already known
HDI data, and resolves the unknown data in the approximate matrix via the iterative optimization process [12-17].
The iterative optimization process is quite important in LFA analysis, which is widely used together with optimization
algorithms, such as the SGD, Adam, AdaGrad and AdaDelta etc. [18-21]. Among them, SGD is the most classical algorithm with
high prediction accuracy. However, SGD algorithm needs to tune learning rate value for various datasets. To adjust the learning
rate adaptively, the Adam, AdaGrad and AdaDelta algorithms are adopted recently. Although they obtain relatively high
accuracy w/o tunning learning rate manually, much running time is needed to adjust the learning rate in each optimization
iteration.
To further improve the optimization process, Luo et al.[22-25] introduce the Swarm Intelligence algorithms into the LFA
model analysis. In this field, they have proposed a series of state-of-the-art models, i.e., the Particle Swarm Optimization (PSO)-
LFA models, the Differential Evolution (DE)-LFA models, and the Beetle Antennae Search (BAS)-LFA models. Among them,
the Hierarchical Position-transitional Particle Swarm Optimization-based LFA (HPL) model is an outstanding one, which
optimizes the latent factors with two innovative PSO algorithms sequentially [24]. First, the Position-transitional Particle Swarm
Optimization-based LFA (PLFA) model is adopted to optimize latent factors fast with adjusting the SGD's learning rate
adaptively [22]. Second, the Mini-Batch PSO (MPSO) algorithm is adopted to refine the latent factors, which can achieve higher
accuracy with acceptable additional time cost. However, the HPL model has to tune PSO's hyper-parameters for refining the
latent factors of various datasets. That causes two problems. One is consuming lots of tunning time for various datasets, The
other is the hyper-parameters can't be changed during the optimization process.
To resolve these two problems, we propose an Adam-enhanced HPL (ADHPL) model to refine the latent factors with
adjusting the PSO's hyper-parameters adaptively. The proposed model first constructs a new gradient vector with the particle's
velocity increment. Then, it adopts Adam to construct the first and second moment gradient vectors and update each particle
with Adam algorithm. Last, the ADHPL model refines the latent factors with Adam-adjusting PSO algorithm. Our main
contributions are listed as follows:
a) An ADHPL model. We incorporate the Adam-enhanced PSO evolution algorithm into the PSO's refinement process of HPL.
Thereby, the proposed model refines all the latent factors w/o presetting the hyper-parameters. Compared with HPL, the
proposed model obtains higher prediction accuracy with almost the same time cost.
Corresponding author: Yuanyi Liu.
b) An Adam-enhanced PSO's evolution algorithm. The classical PSO model updates each particle's velocity and position
iteratively based on its velocity increment. We replace it with the designed Adam incremental vector and construct the Adam-
enhanced evolution process for particles. The designed vector is based on the particle's velocity increment vector. Thereby,
the proposed parametric adaptive evolution algorithm can simulate the evolution scheme of PSO effectively.
Section II describes the related definitions and algorithms. Section III proposes our innovative ADHPL model. Section IV
describes experimental data and results. Finally, Section V concludes this paper and plans for the future work.
II. PRELIMINARIES
First, we summarize the mainly adopted symbols in Table I. Then we review the working mechanisms of an SGD-based
LFA model, an ADAM algorithm and an HPL model.
A. An LFA Model for HiDS Matrices
Let Z|U|×|I| represents an HiDS matrix, which denotes the relationships between two large entity sets U and I. Each element
zu,i∈Z represents a specific relationship value between two specific entities u∈U and i∈I. Besides, Zun denotes the unknown
entity set of Z while Zkn denotes the known entity set. For an HiDS matrix, the number of entities in Zkn is much smaller than in
Zun, |Zkn|≪|Zun|.
To predict Zun, an LFA model constructs a F-rank approximate matrix Ẑ=PQT, where P|U|×F and Q|I|×F denote the F-
dimensional latent factor matrices for U and I, respectively. Then, an objective function estimating the Euclidean distance
between Z and Ẑ is given as [26-32], which is usually combined with linear biases for P and Q, and an L2-norm-based
regularization item. The objective function is formulated as:
(1)
where bu and ci denote the specific bias vector for U and I, λ is regularization constant, respectively. Because (1) is non-convex
and not analytically solvable, an LFA model commonly adopts SGD to optimize its latent factor set {P, Q, b, c} with the preset
gradient iteratively.
Recently, the PSO-related LFA models becomes popular, which incorporates the classical PSO algorithm into LFA's
optimization process. Among them, the HPL model is an outstanding one. Thereby, we select it as the basic model.
A. An HPL Model
An HPL model has a two-layer structure. The first layer adopts a PLFA model to pre-train latent factors, which adjusting
SGD's learning rate by a P2SO algorithm. Then the second layer refines latent factors with a Mini-batch PSO (MPSO) algorithm.
It separates all the latent factors into (|U|+|I|) mini-batch groups and optimize each group with PSO algorithm sequentially.
For each group [pu,bu], ∀u∈|U|, the MPSO algorithm constructs a swarm consisting of S particles. Each particle's initial
position vector xu
s(0) consists of a vector nearby or
TABLE I. MAINLY ADOPTED SYMBOLS WITH THEIR DESCRIPTIONS
Symbol
Description
b, bu Bias vector of large entity set U, and its u-th element.
s (τ) s-th particle's position with b and c at the τ-th iteration.
s (τ) s-th particle's velocity with b and c at the τ-th iteration.
Bias vector of large entity set I, and its i-th element.
Fitness function of the PSO algorithm.
bu
s (τ), cu
s (τ), ċu
ḃu
c, ci
F(∙)
F, f Max and active dimension number of the LF space.
ğ(τ)
h̆ s
m(τ)
m̂ (τ)
S, s Max particle number in a particle swarm and the active one.
P, pu,f An LF matrix for U, and its element in u-th row and f-column.
Best position vector at the τ-th iteration in a particle swarm.
The s-th particle's historical best position vector.
The moving averages of gradient ∇ε(τ).
The corrected moving averages of gradient ∇ε(τ).
pu
ṗu
pu
s (τ), qu
s (τ), q̇ u
Q, qf,i An LF matrix for I, and its element in f-th row and i-column.
The u-th row vector of matrix P.
s-th particle's position with pu and qi at the τ-th iteration.
s-th particle's velocity with pu and qi at the τ-th iteration.
s (τ)
s (τ)
The i-th row vector of matrix Q.
qi
Τ, τ Max iteration count of optimization algorithm, the current iteration.
U, u
I, i
s (τ), vu
xu
Large entity set one and its active element.
Large entity set two and its active element.
s-th particle's position and velocity vector consisting of [pu, bu] at
the τ-th iteration.
s-th particle's position and velocity vector consisting of [qi, ci] at
the τ-th iteration.
s(τ), vi
xi
s(τ)
s (τ)
()====−−−++++,,2,,,12222,,111,,,2.2uiknuiknFuiuffiuizZfFFuffiuizZffεPQzpqbcλpqbcbc
Z, zu,i
An HiDS matrix consists of the relationship value for two entity
sets U and I, and each element in Z.
Zkn, Zun Known and unknown entry set in Z.
Ẑ, ẑu,i The approximation matrix of Z, and each element in Ẑ.
∇εu,i(∙)
Γ, Λ
ε()
η, λ
A partial derivative operator of the objective function to a specific
relationship element between the u-th and the i-th entities.
Training dataset and testing dataset of Z.
Objective function estimating the distance between Z and Ẑ.
Learning rate and regularization constant for a LFA model.
equal to [pu,bu]. Each particle's position xu
s(τ) and velocity vectors vu
s(τ) at the τ-th iteration are represented as:
s (τ), b u
s (τ) denote the velocity of pu, bu at the τ-th iteration for the s-th particle,
where p u
denote their
corresponding velocities. Then, the MPSO algorithm updates each [pu, bu] with traditional PSO and obtain the next iteration
value. Velocity vu
s(τ+1) at the (τ+1)-th iteration is updated as:
and
(2)
(3)
where γ1 and γ2 are the two acceleration coefficients. rd1 and rd2 are two random parameters between [0, 1], respectively. Then,
the position xu
s(τ+1) of each [pu, bu] is updated as:
To measure the accuracy of all the updated positions, the fitness function is constructed as:
(4)
With (5), each particle's updated fitness value is compared with its historical best one. The comparison formula at the (τ+1)-
th iteration is given as:
(5)
Then, the global best position ğu(τ+1) can be updated as:
(6)
(7)
With the above evolution process, the total |U| [pu, bu] are refined sequentially to resolve the pre-mature problem in the
PSO-LFA model. After all the |U| mini-batch [pu, bu] are refined, the |I| mini-batch [qi, ci] are refined sequentially. The HPL
model achieves the balance of prediction accuracy and running efficiency.
B. An Adam Algorithm
The working mechanism of Adam is to adjust the instant learning rate at each iteration by calculating the ratio of moving
averages of the gradient ∇ε(τ) and the squared moving averages of the gradient ∇ε(τ)2. Specifically, at the (τ+1)-th iteration, the
moving averages m(τ+1) and the squared moving averages v(τ+1) are calculated as:
where β1 and β2 is the exponential decay rate parameter of m and v at the previous iteration, respectively. At the first iteration,
m(0) and v(0) are initialized to 0 according to [18]. Besides, β1 and β2 are commonly set as 0.9 and 0.999 as in [18]. Then the
corrected parameters m̂ (τ+1) and v̂ (τ+1) are formulated as:
(8)
With the updated m̂ (τ+1) and v̂ (τ+1), the partial derivative operator ∇ε(τ+1) can be updated as:
(9)
==()(),(),()(),(),uuuuuussssssττbτtτbτxpvp()usτp()usbτ()()()()+=+−+−=+−+−11221122(1)()()()()()(),()()(),()()(),(),uuuussssuusuuuuusssssuuussτωτγrdττγrdττωτbτγrdττbτγrdττbτvvhxgxphpgp+=++(1)()(1),uuusssτττxxv()()()+=−−−++,2221,1(1).22uiknusuiuiuiuuzZλFxτzqbcbpp()()+++=11(1), if (1)(),(1)(), otherwise,uuusssususτFτFτττxxhhh()++=+1(1)(1)argmin(1).usuusττFτhgh+=+−+=+−11222(1)()(1)(),(1)()(1)(),mτβmτβετvτβvτβετ+=+−+=+−12ˆ(1)(1)/(1),ˆ(1)(1)/(1),mτmτβvτvτβ
where α denotes the step-size setting, ψ denotes a parameter avoiding denominator becoming zero. Then, each parameter in the
objective function updates with ∇ε iteratively.
The above Adam algorithm has been widely adopted in deep learning, graph learning and HiDS matrices analysis. The
Adam algorithm improves the accuracy w/o tunning the learning rate manually. Thereby, we incorporate Adam into an HPL
model. The proposed ADHPL model does not only adjusts the hyper-parameters automatically, but also promotes the prediction
accuracy.
(10)
III. METHODOLOGY
An ADHPL model first reconstructs each particle's velocity updating formula with Adam, then apply the Adam-MPSO
algorithm to refine the latent factors in the HiDS matrices. The specific working mechanism is introduced in detail as described
the next two sub-sections.
A. Construct the Adam incremental vector for a particle
The first job is to construct a (F+1)-dimensional gradient vector ∇ε(τ), which is the base incremental element for the Adam-
and each particle's best position
adjusting velocity. To do so, we adopt the combination of the global best position
in (3) as the (F+1)-dimensional gradient vector ∇ε(τ). The ∇ε(τ) can be represented as:
(11)
Note that the constructed gradient vector ∇ε(τ) equals to the incremental velocity vector between vu
s(τ) in (3).
Thereby, the ∇ε(τ) can also represent the particle's velocity evolution during two adjacent iterations. Next, we build the first
and second moment moving average parameters gradient vectors m(τ+1) and v(τ+1). The formulas can be reformulated from
(8) as:
s(τ+1) and vu
The corrected parameters m̂ (τ+1) and v̂ (τ+1) are given as:
(12)
(13)
By adding (13) into (10), we reformulate the gradient ∇ε(τ+1) in the next iteration with m(τ), v(τ) and ∇ε(τ) as:
With the above (F+1)-dimensional gradient vector ∇ε(τ) and ∇ε(τ+1) consists of particle swarm's global best position and
each particle's best position, we can update the particles' velocity and positions with Adam. Besides, the constructed
incremental vector uses the PSO's original incremental elements, which can remain the PSO's characteristics.
(14)
+=+++ˆˆ(1)(1)/((1)),aaεταmτvτψ()uτg()usτh()()=−+−=−+−1212()(()())(()())()(),()()(),().uuuusssuuussuuussετrdττrdττrdττbτrdττbτhxgxhpgp()()()()+=+−−=+−+−+=+−−=+−+−111112222,21222(1)()(1)()()()()(1),()()(1)()(1)()()()()(1).()()uusuussuiuusuussτβτβετrdττβτβrdτττβτβετrdττβτβrdττmmgxmhxvvgxvhx()()()()()()+=+−=−+=−+−+−+=+−=−+=−+−+−1111112222222212ˆ(1)(1)/(1)()/(1)()()/(1)()()()(),ˆ(1)(1)/(1)()/(1)()()/(1)()()()().uuuussuuuussττββτβετβτβrdττrdττττββτβετβτβrdττrdττmmmmgxhxvvvvgxhx()()()()()()−++=−++−+−+−=−+−+−+11222111222212()/(1)()(1)()/(1)()()/(1)()()()().()/(1)()()()()uuuussuuuussβτβετεταβτβετψαβτβrdττrdττβτβrdττrdττψmvmgxhxvgxhxB. Refine the latent factors in MPSO with Adam
We construct ADHPL model by updating all the particles' positions with Adam in the MPSO algorithm. All the preset
hyper-parameters are substituted with the Adam incremental vector. First, we construct and initialize the particle swarms for
each mini-batch group [pu, bu], ∀u∈|U| and [qi,ci], ∀i∈|I| consisting of S particles. For a specific s-th particle, the velocity vu
(0) and position xu
s(0) are both initialized as a vector nearby the vector [pu, bu]. Besides, the first and second moment moving
average parameters m(0) and v(0) are preset. Second, we set velocity vu
s(τ+1) as ∇ε(τ+1), which substitutes the formula in (3).
We represent the new formula as:
s
(15)
With the updated velocity vu
s(τ+1), the new position of the s-th particle xu
s(τ+1) is updated as:
(16)
Based on the above update scheme, each [pu, bu] is updated with Adam until reaches the convergence conditions. After
refining all the |U| [pu, bu], the ADHPL model continues refining all the |I| [qi,ci] until reaches the convergence conditions.
C. Algorithm Design and Analysis
With the above latent factor refining process, we can construct an ADHPL model. It can be seen as a sequential Adam-PSO
refining process for all the latent factors in the target HDI matrix. The workflow of the ADHPL model is depicted in Fig. 1.
First, all the pre-trained latent factors are grouped by rows and columns. Thereby, all the latent factors are separated as the
|U| row groups and |I| column groups. Each row group contains a latent factor pair [pu, bu], and each column group contains a
latent factor pair [qi, ci].
Second, for each [pu, bu], ∀u≤|U|, we perform the Adam-PSO to refine the latent factors while fixing the others. Each refined
latent factor is transferred back to P, b.
Third, for each [qi, ci], ∀i≤|I|, we perform the Adam-PSO to refine the latent factors while fixing the others. Each refined
latent factor is transferred back to Q, c.
Finally, after all the groups in {P, Q, b, c} have been refined on training dataset once, calculate RMSE value on validation
dataset. If the model converges on validation dataset, stop the refinement process and evaluate its RMSE value on testing dataset,
otherwise continue refinement.
Based on the above steps, the proposed ADHPL model can refine all the latent factors in a target HiDS matrix sequentially
with Adam-adjusting PSO algorithm.
A. General Settings
IV. EXPERIMENTAL RESULTS AND ANALYSIS
Evaluation Protocol. To compare our proposed model's prediction accuracy and efficiency with some state-of-the-art
models, we choose RMSE to measure the prediction accuracy. We choose the CPU running time cost to measure the models'
efficiency. We perform all the experiments on a workstation that has a 32GB RAM and a 3.91 GHz Xeon CPU. The formulas
of RMSE are given as:
where Λ represents the testing set disjoint with the training and validation sets.
Dataset. We adopt four datasets ML10M[33], Flixster[34],
+=+=++(1)(1)(1),(1),uuusssτεττbτvp()()()()()()+=++=+++−+−−=++−+−+−112122122(1)()(1)()(1)()()()()()1[(),()].()()()()()1uuuussssuuuussuussuuuussττττεταβτrdττrdττβpτbτβτrdττrdττψβxxvxmgxhxvgxhx(),2,,1ˆ().uiuiuirRMSErr=−
Fig.1 Flow Chart of the ADHPL Model
Douban[35] and ExtEpinion[36] to perform our models. We divide each dataset as training, validation and testing sub-datasets,
which are 70%, 10% and 20%, respectively.
Model Settings. We adopt the SGD-based LFA, Adam-based LFA, PLFA with biases, A2BAS-PLFA[37], HPL and SGDE-
PLFA models as the comparison models. The dimension of LF space f is set as 20. The regularization coefficient is preset the
same value for all the involved models. All the other hyper-parameters are set as the original settings.
B. Performance comparison
The lowest RMSE value and Friedman rank of all the involved models on four datasets are given in Table II. The time cost
is given in Table III.
1) Comparison of prediction accuracy
From Table II, we summarize the ADHPL model achieves relatively higher prediction accuracy compared with its peers.
Two specific conclusions can be summarized as follows:
a) The Adam-HPL's prediction accuracy evaluated by RMSE is the highest of all the involved models, except for the SGDE-
PLFA. For instance, the ADHPL's RMSE on ExtEpinion equals to 0.5279, which is 0.25% lower than SGDE-PLFA's 0.5292,
1.16% lower than HPL's 0.5341, and even much lower than other models. The ADHPL's RMSE on Flixster equals to 0.8599,
which is 0.13% lower than SGDE-PLFA's 0.8610, 0.19% lower than A2BAS-PLFA's 0.8615, and much lower than other
models.
One exception is the SGDE-PLFA model. Our proposed ADHPL outperforms two datasets compared with SGDE-PLFA,
performs equally well on one dataset, and performs worse on one dataset. For instance, on ML10M, the ADHPL's RMSE
value equals to 0.7840, which is 0.04% higher than the SGDE-PLFA's 0.7837, while this value is lower than all the others.
Besides, on Douban, the ADHPL performs as well as SGDE-PLFA, while they all outperform the others.
b) The ADHPL's prediction accuracy gain is statistically significant compared with its peers. The Win/Loss results are recorded
in the next-to-last row of Table II, from which we can observe that the ADHPL and SGDE-PLFA both
TABLE II. COMPARISON RESULTS IN RMSE, INCLUDING WIN/LOSS COUNTS STATISTIC AND FRIEDMAN TEST, WHERE * INDICATES THE MODEL HAS A
LOWERE RMSE THAN THE COMPARISON MODELS.
Test Cases
SGD-based LFA
ExtEpinion
Flixster
Douban
ML10M
Win/Loss
F-rank
0.7358
0.9433
0.7176
0.7872
4/0
6.25
Adam-based
LFA
0.7342
0.9464
PLFA with
Biases
0.5361
0.8720
0.7213
0.7901
4/0
6.75
0.7076
0.7854
4/0
5.0
A2BAS-PLFA
SGDE-PLFA
HPL
0.5327
0.8615
0.7063
0.7843
4/0
3.25
0.5292
0.8610
0.7027*
0.7837*
3/1
1.5
0.5341
0.8656
0.7028
0.7850
4/0
3.75
ADHPL
0.5279*
0.8599*
0.7027*
0.7840
--
1.5
* A lower Friedman rank value indicates higher rating prediction accuracy.
Dataset
SGD-based LFA Adam-based LFA PLFA with Biases A2BAS PLFA
SGDE-PLFA
HPL
Adam HPL
TABLE III. COMPARISON RESULTS IN TIME COST
ML10M
ExtEpinion
Flixster
Douban
874
1152
451
1193
891
4331
3393
2064
157
369
91
340
115
1462
331
298
280
700
212
541
249
438
222
476
235
426
252
482
win the others on all the datasets. The Friedman test results are recorded in the last row of Table II. Both ADHPL and SGDE-
PLFA's F-rank value equal to 1.5, which is much less than other models.
2) Comparison of computational efficiency
From Table III, we summarize three conclusions of the ADHPL model's time cost:
a) It costs much less than the SGD-based LFA and Adam-based LFA. For instance, the ADHPL costs only 482s on Douban,
which is 59.6% lower than SGD-based LFA's 1193s, 76.65% lower than Adam-based LFA's 2064s.
b) It costs about the same amount of time with other Swarm Intelligence-related LFA models, i.e., A2BAS-PLFA, HPL and
SGDE-PLFA. Furthermore, they all cost considerably more time than PLFA model. The reason is that they all refine the
latent factors after the PLFA model convergences. However, the extra time of about a hundred seconds is worthy for
promoting the prediction accuracy.
According to the above analysis, we conclude that the ADHPL model obtains superiority in terms of prediction accuracy,
while convergences relatively fast.
V. CONCLUSIONS
This paper focuses on refining the latent factors with an Adam-enhanced HPL model. In this model, we design a base
gradient with particle's velocity increment. With the proposed gradient, we propose an Adam-PSO algorithm, which can remain
the characteristics of PSO w/o tunning PSO's hyper-parameters. Using this algorithm, we construct the ADHPL model to refine
the latent factors sequentially with row and column sub-groups. The experimental results from four industrial datasets verify
its high prediction accuracy. In future, we plan to investigate an ensemble model with various Swarm Intelligence-related LFA
models, which can dynamically schedule these models considering various situations or datasets.
REFERENCES
[1] X. Luo, Z. Liu, L. Jin, Y. Zhou and M. Zhou, "Symmetric Nonnegative Matrix Factorization-Based Community Detection Models and Their Convergence
Analysis," IEEE Transactions on Neural Networks and Learning Systems, vol. 33, no. 3, pp. 1203-1215, March 2022.
[2] D. Wu, X. Luo, M. Shang, Y. He, G. Wang and X. Wu, "A Data-Characteristic-Aware Latent Factor Model for Web Services QoS Prediction," IEEE
Transactions on Knowledge and Data Engineering, vol. 34, no. 6, pp. 2525-2538, June 2022.
[3] D. Wu, Q. He, X. Luo, M. Shang, Y. He and G. Wang, "A Posterior-Neighborhood-Regularized Latent Factor Model for Highly Accurate Web Service
QoS Prediction," IEEE Transactions on Services Computing, vol. 15, no. 2, pp. 793-805, 1 March 2022.
[4] X. Luo, Y. Zhou, ZG. Liu, and MC. Zhou*, "Fast and Accurate Non-negative Latent Factor Analysis on High-dimensional and Sparse Matrices in
Recommender Systems," IEEE Transactions on Knowledge and Data Engineering, doi: 10.1109/TKDE.2021.3125252.
[5] X. Luo, H. Wu, and ZC. Li*, "NeuLFT: A Novel Approach to Nonlinear Canonical Polyadic Decomposition on High-Dimensional Incomplete Tensors,"
IEEE Transactions on Knowledge and Data Engineering, doi: 10.1109/TKDE.2022.3176466.
[6] X. Luo, H. Wu, Z. Wang, JJ. Wang, and DY. Meng*, "A Novel Approach to Large-Scale Dynamically Weighted Directed Network Representation,"
IEEE Transactions on Pattern Analysis and Machine Intelligence, doi: 10.1109/TPAMI.2021.3132503.
[7] X. Shi, Q. He, X. Luo, Y. Bai and M. Shang, "Large-Scale and Scalable Latent Factor Analysis via Distributed Alternative Stochastic Gradient Descent
for Recommender Systems," IEEE Transactions on Big Data, vol. 8, no. 2, pp. 420-431, 1 April 2022.
[8] D. Wu, M. Shang, X. Luo and Z. Wang, "An L1-and-L2-Norm-Oriented Latent Factor Model for Recommender Systems," IEEE Transactions on Neural
Networks and Learning Systems, doi: 10.1109/TNNLS.2021.3071392.
J. Chen, Y. Yuan, R. Tao, J. Chen, T. R. and X. Luo, "Hyper-Parameter-Evolutionary Latent Factor Analysis for High-Dimensional and Sparse Data
from Recommender Systems," Neurocomputing, vol. 421, pp. 316-328, Jan. 2021.
[9]
[10] D. Chen, S. Li, D. Wu and X. Luo, "New Disturbance Rejection Constraint for Redundant Robot Manipulators: An Optimization Perspective," IEEE
Transactions on Industrial Informatics, vol. 16, no. 4, pp. 2221-2232, 2020.
[11] H. Wu, X. Luo, and MC. Zhou. "Discovering Hidden Pattern in Large-scale Dynamically Weighted Directed Network via Latent Factorization of Tensors,"
In Proc. of the 17th IEEE Int. Conf. on Automation Science and Engineering (CASE 2021) (Regular), doi: 10.1109/CASE49439.2021.9551506.
[12] X. Wang, Q. Kang, M. Zhou, L. Pan, A. Abusorrah, Multiscale Drift Detection Test to Enable Fast Learning in Non-stationary Environments, IEEE
Transactions on Cybernetics, vol. 51, no. 7, pp. 3483-3495, Jul. 2021.
[13] X. Luo, Z. You, S. Li, Y. Xia and H. Leung, "Improving Network Topology-Based Protein Interactome Mapping via Collaborative Filtering," Knowledge-
Based Systems, vol. 90, pp. 23-32, 2015.
[14] X. Luo, MC. Zhou, S. Li, Y. Xia, ZH. You, Q. Zhu, and H. Leung, "Incorporation of Efficient Second-order Solvers into Latent Factor Models for
Accurate Prediction of Missing QoS Data," IEEE Transactions on Cybernetics, vol. 48, no. 4, pp. 1216-1228, 2017.
[15] X. Luo, H. Wu, H. Yuan and M. Zhou, "Temporal pattern-aware QoS prediction via biased non-negative latent factorization of tensors," IEEE
Transactions on Cybernetics, vol. 50, no. 5, pp. 1798-1809, 2019.
[16] Q. Deng, Q. Kang, L. Zhang, M. Zhou, "An Objective Space-based Population Generation to Accelerate Evolutionary Algorithms for Large-scale Many-
objective Optimization," IEEE Transactions on Evolutionary Computation, doi: 10.1109/TEVC.2022.3166815, 2022.
[17] X. Luo, M. Shang and S. Li, "Efficient extraction of non-negative latent factors from high-dimensional and sparse matrices in industrial applications,"
IEEE 16th International Conference on Data Mining, vol. 51, pp. 311-319, 2016.
[18] D. Wu, and X. Luo*, "Robust Latent Factor Analysis for Precise Representation of High-dimensional and Sparse Data," IEEE/CAA Journal of Automatica
Sinica, vol. 8, no. 4, pp. 796-805, 2021.
[19] H. Wu, X. Luo, MC. Zhou, "Advancing non-negative latent factorization of tensors with diversified regularizations," IEEE Transactions on Services
Computing, vol. 15, no. 3, pp. 1334-1344, 1 May-June 2022.
[20] Z. Liu, X. Luo, Z. Wang, "Convergence analysis of single latent factor-dependent, nonnegative, and multiplicative update-based nonnegative latent factor
models," IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 4, pp. 1737-1749, 2020.
[21] M. Shang, Y. Yuan, X. Luo, MC. Zhou, "An α-β-divergence-generalized recommender for highly accurate predictions of missing user preferences,"
IEEE Transactions on Cybernetics, vol. 52, no. 8, pp. 8006-8018, Aug. 2022.
[22] X. Luo, Y. Yuan, S. Chen, N. Zeng, and Z. Wang, "Position-Transitional Particle Swarm Optimization-incorporated Latent Factor Analysis," IEEE
Transactions on Knowledge and Data Engineering, vol. 34, no. 8, pp. 3958-3970, 1 Aug. 2022.
[23] L. Xin, Y. Yuan, M. Zhou, Z. Liu and M. Shang, "Non-negative latent factor model based on β-divergence for recommender systems," IEEE Transactions
on Systems, Man, and Cybernetics: Systems, vol. 51, no. 8, pp. 4612-4623, 2019.
[24] J. Chen, X. Luo and M. Zhou, "Hierarchical Particle Swarm Optimization-Incorporated Latent Factor Analysis for Large-Scale Incomplete Matrices,"
IEEE Transactions on Big Data, doi: 10.1109/TBDATA.2021.3090905.
[25] J. Chen, R. Wang, D. Wu and X. Luo, "A Differential Evolution-Enhanced Position-Transitional Approach to Latent Factor Analysis," IEEE Transactions
on Emerging Topics in Computational Intelligence, 2022, doi: 10.1109/TETCI.2022.3186673.
[26] X. Luo, Z. Liu, S. Li, M. Shang and Z. Wang, "A Fast Non-Negative Latent Factor Model Based on Generalized Momentum Method," IEEE Transactions
on Systems, Man, and Cybernetics: Systems, vol. 51, no. 1, pp. 610-620, Jan. 2021.
[27] X. Luo, M. Zhou, S. Li, M. Shang, "An inherently non‐negative latent factor model for high‐dimensional and sparse matrices from industrial applications".
IEEE Transactions on Industrial Informatics, vol. 14, no. 5, pp. 2011‐2022, 2018.
[28] X. Luo, Z. Wang and M. Shang, "An Instance-Frequency-Weighted Regularization Scheme for Non-Negative Latent Factor Analysis on High-
Dimensional and Sparse Data," IEEE Transactions on Systems,
[29] Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3522-3532, Jun. 2021.
[30] H. Wu, X. Luo, M. Zhou, M. J. Rawa, K. Sedraoui and A. Albeshri, "A PID-incorporated Latent Factorization of Tensors Approach to Dynamically
Weighted Directed Network Analysis," in IEEE/CAA Journal of Automatica Sinica, vol. 9, no. 3, pp. 533-546, March 2022.
[31] D. Wu, Y. He, X. Luo, MC. Zhou, "A latent factor analysis-based approach to online sparse streaming feature selection," IEEE Transactions on Systems,
Man, and Cybernetics: Systems, vol. 52, no. 11, pp. 6744-6758, Nov. 2022.
[32] H. Wu, X. Luo, "Instance-Frequency-Weighted Regularized, Nonnegative and Adaptive Latent Factorization of Tensors for Dynamic QoS Analysis," In
Proc. of the 2021 IEEE Int. Conf. on Web Services, doi: 10.1109/ICWS53863.2021.00077.
[33] H. Wu, X. Luo and MC. Zhou, "Neural Latent Factorization of Tensors for Dynamically Weighted Directed Networks Analysis," In Proc. of the 2021
IEEE Int. Conf. on Systems, Man, and Cybernetics (SMC2021), doi: 10.1109/SMC52423.2021.9659145.
[34] J.-A Konstan, B.-N. Miller, D. Maltz, J. L Herlocker, L.-R Gordon, and J. Riedl, "Grouplens: applying collaborative filtering to usenet news,"
Communications of the ACM, vol. 40, no. 3, pp. 77-87, 1997.
[35] J. Mohsen, and E. Martin, "A Matrix Factorization Technique with Trust Propagation for Recommendation in Social Networks," in Proc. of the 4th ACM
Conf. on Recommender Systems, Barcelona, Spain, 2010, pp. 135-142.
[36] H. Ma, I. King, and M.-R Lyu, "Learning to Recommend with Social Trust Ensemble," in Proc. of the 32nd Int. ACM SIGIR Conf. on Research and
Development in Information Retrieval, Boston, MA, USA, Jul. 2009, pp. 203-210.
[37] P. Massa, and P. Avesani, "Trust-aware Recommender Systems," in Proc. of the 1st ACM Conf. on Recommender Systems, Minneapolis, MN, USA,
Oct. 2007, pp. 17-24.
[38] Y. Liu, J. Chen and D. Wu, "An Adam-adjusting-antennae BAS Algorithm for Latent Factor Analysis Refinement", arXiv e-prints, 2022.
|
|
http://arxiv.org/abs/2302.11954v1 | 2023-02-23T12:03:59 | 2023-02-23T12:03:59 | A Dynamic-Neighbor Particle Swarm Optimizer for Accurate Latent Factor
Analysis | High-Dimensional and Incomplete matrices, which usually contain a large
amount of valuable latent information, can be well represented by a Latent
Factor Analysis model. The performance of an LFA model heavily rely on its
optimization process. Thereby, some prior studies employ the Particle Swarm
Optimization to enhance an LFA model's optimization process. However, the
particles within the swarm follow the static evolution paths and only share the
global best information, which limits the particles' searching area to cause
sub-optimum issue. To address this issue, this paper proposes a
Dynamic-neighbor-cooperated Hierarchical PSO-enhanced LFA model with two-fold
main ideas. First is the neighbor-cooperated strategy, which enhances the
randomly chosen neighbor's velocity for particles' evolution. Second is the
dynamic hyper-parameter tunning. Extensive experiments on two benchmark
datasets are conducted to evaluate the proposed DHPL model. The results
substantiate that DHPL achieves a higher accuracy without hyper-parameters
tunning than the existing PSO-incorporated LFA models in representing an HDI
matrix. | [
"Jia Chen",
"Yixian Chun",
"Yuanyi Liu",
"Renyu Zhang",
"Yang Hu"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11954v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11954v1",
"@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.NE"
] | A Dynamic-Neighbor Particle Swarm
Optimizers for Accurate Latent Factor Analysis
Jia Chen
School of Cyber Science and Technology,
Beihang University
Beijing, China
[email protected]
Yuanyi Liu
School of Cyber Science and Technology,
Beihang University
Beijing, China
[email protected]
Xianchun Yi
School of Cyber Science and Technology,
Beihang University
Beijing, China
[email protected]
Renyu Zhang*
School of Cyber Science and Technology,
Beihang University
Beijing, China
[email protected]
Yang Hu*
School of Cyber Science and Technology,
Beihang University
Beijing, China
[email protected]
Abstract-High-Dimensional and Incomplete (HDI) matrices, which usually contain a large amount of valuable latent information,
can be well represented by a Latent Factor Analysis (LFA) model. The performance of an LFA model heavily rely on its optimization
process. Thereby, some prior studies employ the Particle Swarm Optimization (PSO) to enhance an LFA model's optimization
process. However, the particles within the swarm follow the static evolution paths and only share the global best information, which
limits the particles' searching area to cause sub-optimum issue. To address this issue, this paper proposes a Dynamic-neighbor-
cooperated Hierarchical PSO-enhanced LFA (DHPL) model with two-fold main ideas. First is the neighbor-cooperated strategy,
which enhances the randomly chosen neighbor's velocity for particles' evolution. Second is the dynamic hyper-parameter tunning.
Extensive experiments on two benchmark datasets are conducted to evaluate the proposed DHPL model. The results substantiate
that DHPL achieves a higher accuracy without hyper-parameters tunning than the existing PSO-incorporated LFA models in
representing an HDI matrix.
Keywords-Latent Factor Analysis, Particle Swarm Optimization, High-dimensional and Incomplete Matrix, Dynamic Neighbor
Cooperation.
I. INTRODUCTION
In recent years, a large amount of High-Dimensional and Incomplete (HDI) matrices are generated and accumulated rapidly
by the network services, industrial applications, and big-data-related information systems[1-2]. These HDI matrices contain many
unknown useful latent information, and their data are extremely incomplete. This means the HDI matrices are difficult to extract
and analyze, while they are worthy to analyze[3-7]. How to extract the latent information from HDI matrices and analyze them
accurately has become a popular research issue[8-11].
According to previous studies[12-21], the Latent Factor Analysis (LFA) model process the HDI matrices efficiently. An LFA
model first maps two high-dimensional entities involved in the target HDI matrix to a low-dimensional latent factor space. Second,
it adopts the latent factors to construct a low rank approximation of the HDI matrix and corresponding objective function to
measure the error between the original HDI matrix and its approximation. Third, the optimization algorithm is used to
approximate the optimal latent factors by minimizing the objective function. Previous research works have demonstrated that the
stochastic gradient descent (SGD) algorithm can optimize the latent factors in an LFA model accurately[22-24]. Some classical
algorithms are proposed to improve the learning rate self-adaption of SGD algorithm[25-28]. Duchi et al.[25] propose the AdaGrad
algorithm to adjust the learning rate by calculating the sum squares of gradients. Zeiler et al.[26] propose the AdaDelta algorithm,
which uses the decaying average of all past squared gradients to adjust the learning rate. García-Galán et al.[28] propose the Adam
algorithm to adjust the learning rate with the exponentially decaying average and the exponentially decaying square average of
past stochastic gradients. These algorithms can effectively optimize the latent factors adaptively via improving the SGD
algorithm. However, these optimization process costs much more time for adjusting the learning rate at each iteration.
To address this issue, Luo et al.[3] incorporates the classical Particle Swarm Optimization (PSO) algorithm into the
optimization process of an LFA model. The PSO algorithm has been proven as an effective method in processing the large-scale
data[29-31]. Luo et al. propose a position-transitional PSO-based LFA model, which uses the dynamic PSO algorithm to adjust the
SGD's learning rate. To further improve accuracy of the PSO-based LFA model, Chen et al.[29] propose a hierarchical PSO-LFA
(HPL) model, which refines the latent factors have been optimized by previous model with a newly proposed Mini-batch PSO
(MPSO) algorithm and achieves higher accuracy. However, when the PSO algorithm refines the latent factors, each particle
evolves following its particular path and only the global best information shares within the swarm. This work mechanism limits
the particle swarm's searching area and causes the sub-optimum issue.
This research is supported by the CAAIHuawei MindSpore Open Fund under Grant CAAIXSJLJJ-2021-035A. (Corresponding author: Y. Hu, R. Zhang)
To expand the searching area and share more information among the particles, this work proposes a Dynamic-neighbor-
cooperated Hierarchical PSO-enhanced LFA (DHPL) model, which improves the accuracy and self-adaption of an HPL model.
The paper makes the following contributions:
a) A neighbor-cooperated MPSO algorithm. The neighbor particle's velocities are randomly added into the MPSO's evolution,
which injects the disturbance into the original particle update process.
b) Adjust the hyper-parameters in the MPSO algorithm dynamically. Linearly decreasing inertia weight algorithm is adoptd to
adjust hyper-parameters ω, γ1, and γ2 in MPSO.
Empirical studies on two HDI matrices demonstrate that the proposed DHPL model outperforms the state-of-the-art LFA
models.
This paper is structured as follows. Section II gives the preliminaries. Section III shows the methods. Section IV provides
and analyses the empirical results. Finally, section V summarizes the algorithm proposed and discusses future work.
In this section, we first define the notations and formulas required in the paper. Then, we recall the fundamental models
II. PRELIMINARIES
adopted in the paper.
A. Notation
The notations used in this paper are listed in Table I below.
B. Problem Setup
1) An HDI Matrix
We use U and I to denote the large entity sets of users and items. Let us assume that R|U|×|I| represents a HDI matrix when
|RΛ|≪|RΓ|. Given an entry ru,i denote the relationship value, where u∈U and i∈I.
2) An LFA Model
We assume that R̂ =PQT denotes the estimation of low-dimensional latent factors for R. The latent feature matrices of U and
I are defined by P|U|×f and Q|I|×f , respectively. Euclidean distance is the objective function to estimate the difference
between R̂ and R. Furthermore, in order to improve its generalization ability and mitigate the magnitude effect, this work
integrates a regularization term and linear bias. Therefore, an objective function is given as follow:
where bu and ci represent linear biases for u and i, f represents the dimension of LF space, respectively [32, 33]. The regularization
coefficient parameter is λ.
According to (1), the latent factors {P, Q, b, c} are updated iteratively with SGD[34, 35] as follows:
(1)
(2)
where m and (m-1) denote the m-th and (m-1)-th iteration, η represents the learning rate.
Notation
U, I
u, i
R, ru,i
R̂ , r̂ u,i
RΛ , RΓ
P, pu,f
pu
Q,qf,i
qi
TABLE I.
NOTATION MEANING AND DESCRIPTION
Description
Involved entity sets.
An element of U and I.
An |U|× |I| HDI matrix and its single element.
R's rank-f approximation, and its single element.
Known and unknown entry sets of R, and |RΛ|≪|RΓ|.
An |U|×f latent factor matrix for U, and its single element.
The u-th row vector of P.
A f×|I| latent factor matrix for I, and its single element.
The i-th row vector of Q.
,,2,,,R12222,,R111(,,,)()2(),2uiuifuiukkiuirkffukkiuirkkPQrpqbcpqbc====−−−++++bc,11,,,,11,,,,11,11,,(1,2,...,):(),(),(),(),uimmmukukuiukmmmkikiuikimmmuuuiummmiiuiirRkfpppqqqbbbccc−−−−−−−−=−=−=−=−
b, bu
c, ci
f
σ
λ
η
V1, V2
yk(n), lk(n)
l rd1(n), l rd2(n)
yu
k (n), lu
k (n)
yi
k(n), l i
k (n)
k (n), qi
pu
k(n)
k (n), q̇ i
ṗu
k(n)
bu
k (n), ci
k(n)
k (n), ċ i
ḃ u
k(n)
K, k
D, d
γ1, γ2, γ3
r1, r2, r3
p̃k
g̃
A vector of bias for U, and its u-th single element.
A vector of bias for I, and its i-th single element.
Dimension of the LF space.
A generalized loss function defined on RΛ.
A regulation parameter for SGD-based LFA model.
A learning rate parameter for SGD-based LFA model.
Two particle vector sub-spaces. V1 consists of latent factors in P and b, and V2 consists of latent factors in Q and c.
The k-th particle's velocity, position at the n-th iteration.
The k-th particle's position of neighbors at the n-th iteration.
The k-th particle's velocity and position with the u-th parameter subset [pu,bu]⊂S1 at the n-th iteration.
The k-th particle's velocity and position with the i-th parameter subset [qi,ci]⊂S2 at the t-th iteration.
Position of k-th particle with pu in V1, qi in V2 at n-th iteration.
Velocity of k-th particle with pu in V1, qi in V2 at n-th iteration.
Position of k-th particle with bu in V1, with ci in V2 at the t-th iteration, respectively.
Velocity of k-th particle with bu in V1, with ci in V2 at the t-th iteration, respectively.
Max number of particles and its k-th single element.
Dimension number of particles, and its d-th single element.
Three acceleration coefficients for the PSO algorithm.
Three uniform random parameters for PSO algorithm.
Historical best position vector of the k-th particle.
The best position vector in the particle swarm.
Vectorization of P, Q.
C. An HPL Model
The HPL model contains a two-layer structure and focuses on the second refinement layer. The second layer uses the pre-
trained latent factors as input and refines them to achieve the higher accuracy, which solves the problem of premature
convergence efficiently. The refinement algorithm is a Mini-Batch PSO (MPSO) algorithm which refines all the latent factors
sequentially. For each latent factor, a specific particle swarm is constructed and optimized. The swarm is firstly constructed by
mapping latent factors in two sub-vectors, which are defined as follows:
where V is the particle vector space. It is divided into two mini-batch sub-vectors V1 and V2, respectively. With (3), the MPSO
constructs the |U| swarms containing K particles to optimize each sub-vector [pu, bu],∀u∈U, and |I| swarms with K particles to
optimize each sub-vector [qi, ci], ∀i∈I, which are represented by the following equations:
(3)
(4-a)
(4-b)
k (n), ḃu
where ṗu
k-th particle of qi
k(n) and ci
The update equation can be denoted as:
k (n) are the velocities of k-th particle of pu
k (n) and bu
k(n) at the t-th iteration. The specific yu
k (n) at the t-th iteration. q̇ i
k(n) are the velocities of
k (n) are updated with the PSO algorithm independently.
k(n) and ċi
k (n) and lu
(5)
where p̃k is historical best position vector of k-th particle, and g̃ is the best position vector in the whole particle swarm. The
following fitness function is used for yu
k (n) and lu
k (n):
With (6), the historical best position p̃u
k (n) and the global best position g̃(n) at the t-th iteration is updated. With the above
process, the swarm evolution for each [pu, bu] or [qi, ci] continues independently till g̃(n) converges or the maximum iteration
count reaches. Based on the MPSO algorithm, the HPL model refines the latent factors with considerable time cost. In this
paper, we design the dynamic-neighbor-cooporated algorithm and incorporate it into the HPL model, then use the linearly
decreasing inertia weight strategy to adjust the hyper-parameters in the HPL model.
(6)
,PQ12,,,,,,,TTTTVPVPQVQ===bbcc(),,(),,uuuuuukkkkkknbnb==lpyp(),,(),,iiiiiikkkkkkncnc==lqyq()()()()()()()()()()()112211111,1,uuukkkkukuuukkknnrnnrnnnnn=−+−−−+−−−=−+yypygllly(),222,()1()+.22uiuuiuiuiuuruFrqbcb=−−−+pp
III. PROPOSED APPROACH
We propose a DHPL model, which incorporates the dynamic neighbor-cooperated MPSO algorithm and linearly decreasing
inertia weight strategy into HPL. In this section, we focus on the dynamic neighbor-cooperated MPSO algorithm and linearly
decreasing inertia weight strategy.
A. A Dynamic Neighbor-Cooperated MPSO Algorithm
In the standard PSO algorithm, each particle updates the current velocity and position based on its latest position and
velocity, its historical best position, and the global best position in the particle swarm. A particle's current velocity and position
don't only dependent on itself but is also influenced by the whole swarm. Inspired by the global information sharing strategy,
we add the velocity information of neighbors into the velocity update formula of PSO algorithm. Use a specific row vector u
as an example, the update formulas for each particle's current velocity and position are presented as below:
(7)
where lrd1(n) and lrd2(n) represent two randomly selected neighbors. We add their latest velocities into the velocity update
formula. Thereby, the velocities of neighbors can be shared at each iteration and more global information are transfered to
aovid the premature convergence at sub-optimum. Then, the particle's historical local best position is updated as follows:
(8)
The global best position can be updated after calculating all the particles' local best positions, which is formulated as:
(9)
Furthermore, each particle's velocity is limited in a proper range. Maximum and minimum values of the paticle's velocity
are constrained as follows:
(10)
where βmax and βmin denote the upper and lower ratio of velocity. In our work, the above dynamic neighbor-coorperated PSO
updated formulas are incorporated into the MPSO algorithm, thereby constructing the DHPL model. The newly proposed DHPL
model adopts the following two fitness functions:
(11-a)
(11-b)
where |∙|abs represents the absolute value of a given value. We adopt the (11-a) as the fitness function for evaluation protocol
RMSE, and (11-b) as the fitness function for evaluation protocol MAE.
B. Linearly decreasing inertia weight strategy
The hyper-parameters in the MPSO algorithm are tunned manually, which can be updated with the proper algorithm.
Because Shi et.al. has proven that the linearly decreasing weight strategy can promote the local earching ability [36]. We adopt
the linearly decreasing weight strategy in our proposed DHPL model. We adjust the hyper-parameters with the linearly
decreasing inertia weight strategy, which are formulated as:
where ωmax and ωmin are the maximal and minimal values of the inertia weight parameters, G represents the maximum number
of training iterations. γmax and γmin denote the maximal and minimal values of two acceleration coefficients.
(12)
()()()11223312()(1)(1)(1)(1)(1)(1)(1),()(1)(),uuukkkkukrdrduuukkknnrnnrnnrnnnnn=−+−−−+−−−+−−−=−+yyplgllllly()()(),if ()(1),()(1),otherwise.uukkkkknFnFnnn−=−yyppp()()()=argmin().kknnFnpgpmaxmaxminmin(), ()(),()(), ()(),uuukkkukuuukkknifnnnnifnn=lylylyl(),2221,()()+,uiuiuiuiuurRuFrqbcb=−−−+pp(),2,()+,uiuiuiuiiirRuFrpbcc=−−−+qqmaxmaxmin1maxmaxmin2minmaxmin()/,()/,()/,nGnGnG=−−=−−=−−C. Algorithm Procedure and Time Cost analysis
Based on the above analysis, we design the DHPL model. As shown in Algorithm 1, we calculate the time cost of each row
vector in the dynamic neighbor-coorperated MPSO algorithm, which can be calculated as follows:
(13)
Thereby, the time cost of the dynamic neighbor-coorperated MPSO algorithm can be calculated as the M times of the
optimization for each row vector and column vector, which can be calculated as follows:
ALGORITHM: each row vector optimization
Input: U, I, RΛ
Operation
Initialize: N = Maximum number of iterations
Initialize: P|U|×f, Q|I|×f, b, c
Initialize: λ, f, D = f + 1, K = Particle number
for u to |U|:
k , g̃u
Initialize: p̃u
Initialize: yk, lk
while n ≤ N and not converge
for k=1 to K
for d=1 to D
Computing yk, lk according to (7)
end for
for u=1 to |RΛ(U)|
Computing F1(lu k) according to (11)
end for
if F1(lu
p̃u
end if
if F1(lu
k ) < F1(p̃u
k ) < F1(g̃u)
k = lu
k
k )
g̃u = lu
k
end if
end for k
end while
[pu, bu] = g̃u
end for
Output: P|U|×f, b
Cost
Θ(1)
Θ(|U|+|I|+f)
Θ(1)
×|U|
Θ(1)
Θ(K×D)
×N
×K
×D
Θ(1)
--
×RΛ(U)
Θ(f)
--
Θ(1)
Θ(1)
--
Θ(1)
Θ(1)
--
--
--
Θ(1)
--
Based on (14), we have the time cost of the whole DHPL model as follows:
(14)
(15)
where TPLFA and KPLFA represent the number of iterations and particles in PLFA model. From (15), it is obvious that the
algorithm is linear in complexity and can be used in practice. Besides, its time cost is similar with the HPL model. The next
section focuses on describing the experiments and analyzing the experimental results.
IV. EXPERIMENTAL RESULTS AND ANALYSIS
A. Experimental Settings
Datasets. ML10M[37] and Flixster[38] are chosen as the experimental datasets. We adopt 70%-10%-20% train-validation-
test settings.
Evaluation Protocol. In this paper, we choose RMSE and MAE as our evaluation protocols. All experiments are performed
on a MacBook pro with a 2.6 GHz Intel core CPU and 16 GB RAM. The formulas of RMSE and MAE are given as follows:
where τ represents the testing set disjoint with the training and validation sets.
Model Settings. We compared the DHPL model with various methods, including SGD-based LFA, Adam-based LFA,
()1.CRNKf=().DNCRNKfM=()(),DPLFAPLFADNPLFAPLFACCCRTKfRTKfM−=+=+(),,2,,,,ˆˆ,,uiuiuiuiuiuirRrRRMSErrMAErr=−=−
(a) RMSE on ML10M (b) RMSE on Flixste
Fig. 1. RMSE of DHPL as K increases.
(a) MAE on ML10M (b) MAE on Flixster
Fig. 2. MAE of DHPL as K increases.
(a) Iterations on ML10M (b) Iterations on Flixster
Fig.3. Converging iteration countS of DHPL as K increases.
(a) Time Cost on ML10M (b) Time Cost on Flixster
Fig. 4. Time cost of DHPL as K increases.
PLFA with biases and HPL. In this work, we set the hyper-parameters of Adam and HPL as the values has been widely used
in previous studies. The regularization coefficient λ is tuned for each dataset.
B. Result comparison
This sub-section compares the DHPL's performance with various swarm size, and the performance compared with other
models.
1) Comparison of swarm size
The Swarm size K influences the performance of DHPL. We perform a series of experiments to analyze the performance
of the DHPL model with K∈{5, 10, 15, 20, 25, 30} on ML10M and Flixster. Fig. 1 and Fig. 2 depict DHPL's RMSE and MAE
with various K, respectively. Fig. 3 and Fig. 4 depict the converging iteration counts with various K, respectively. For HPL and
SGDE-PLFA, their involved PLFA model and the refinement process both converge with
TABLE II.
COMPARISON RESULTS IN RMSE/MAE, INCLUDING WIN/LOSS COUNTS STATISTIC AND FRIEDMAN TEST
Dataset
SGD-based LFA
Adam-based LFA
PLFA with Biases
ML10M
Flixster
Win/Loss
F-rank
0.7872/
0.6069
0.9433/
0.6653
2/0
5
0.7901/
0.6087
0.9464/
0.6661
2/0
4
0.7854/
0.6044
0.8720/
0.6512
2/0
3
HPL
0.7851/
0.5998
0.8656/
0.6394
2/0
2
TABLE III.
COMPARISON RESULTS IN TIME COST
Dataset
ML10M
Flixster
SGD-based LFA
Adam-based LFA
PLFA with Biases
874
451
891
3393
157
91
HPL
249
222
DHPL
0.7845/
0.6009
0.8613/
0.6299
--
1
DHPL
262
154
the same termination criterion as others, i.e., the error difference of two adjacent iterations is smaller than 10-4. From the results
depicted from these figures, we conclude the following key findings:
a) The accuracy of the DHPL model is insensitive to K. In Fig. 1, the standard deviations of DHPL's RMSE on ML10M
and Flixster are 6.30E-5 and 4.82E-4, respectively. In Fig. 2, the standard deviations of DHPL's MAE on ML10M and
Flixster are 2.96E-4 and 1.45E-4, respectively.
b) The DHPL model convergencs fast. For instance, a DHPL model converges less than 8 iterations for RMSE with all the
K values, which is depicted in Fig. 3(a). Obviously seen from Fig. 3(b), the DHPL model converges at 5 iterations with all
the K values.
c) Time cost varies linearly with the amount of K. For instance, when RMSE is chosen, on ML10M, the time cost increases
linearly from 105.39 to 341.13 seconds with K increasing from 5 to 30. On Flixster, the similar situation can be observed
from Fig. 4(b).
Since the accuracy of DHPL is insensitive to K, and its CPU running time is linearly proportional to K, we select a small K
value for the next experiments, i. e., five.
2) Model Performance Analysis
This sub-section compares the performance of DHPL with all the involved models. The lowest RMSE/MAE and Friedman
Rank are recorded in Table II. Time cost is recorded in Table III. According to the experimental results, we have the following
findings:
a) A DHPL model's prediction is higher than that of its peers. For instance, as shown in Table II, the RMSE with K=5 is
0.8613 on Flixster, which is 8.99% lower than Adam's 0.9464, 1.23% lower than PLFA's 0.8720, and 0.5% lower than
HPL's 0.8656, respectively. Besides, the DHPL has the lowest F-rank value among its peers, which indicates it has the best
prediction accuracy.
b) A DHPL model's time cost is much lower than SGD-based model and Adam-based model, while its time cost is
similar to HPL. Obviously seen from Table III, the proposed DHPL consumes 262 seconds on ML10M, which is about
5.22% higher than HPL's 249 seconds. While on Flixster, DHPL consumes 154 seconds to converge, which is about 30.63%
lower than HPL's 222 seconds. Note that the PLFA model is the first layer of both HPL and DHPL, thereby its time cost is
the lowest among the involved models.
From the above analysis, we conclude that the DHPL model can achieve higher accuracy with a little more time.
V. CONCLUSIONS
In this work, we propose a Dynamic-neighbor-cooperated PSO-enhanced LFA (DHPL) model. This model has two
characteristics. One is incorporating the velocities of two randomly selected neighbors into the MPSO's iterative optimization
process, the other is adopting the linearly decreasing inertia weight strategy to tune the hyper-parameters. With these two
innovative approaches, the proposed DHPL model can expand the searching area and share more information among the
particles, which increases the accuracy effectively. Empirical studies on two HDI matrices demonstrate that the proposed DHPL
model outperforms the state-of-the-art LFA models.
In future, we will investigate the method of choosing the neighbors, discuss the influence on the number of neighbors, and
incorporate some more state-of-the-art algorithms for tunning the hyper-parameters in DHPL model automatically.
REFERENCES
[1] X. Luo, W. Qin, A. Dong, K. Sedraoui and M. Zhou, "Efficient and high-quality recommendations via momentum-incorporated parallel stochastic
gradient descent-based learning," IEEE/CAA Journal of Automatica Sinica, vol. 8, no. 2, pp. 402-411, 2021.
[2] D. Chen, S. Li, D. Wu and X. Luo, "New disturbance rejection constraint for redundant robot manipulators: an optimization perspective," IEEE
Transactions on Industrial Informatics, vol. 16, no. 4, pp. 2221-2232, 2020.
[3] X. Luo, Y. Yuan, S. Chen, N. Zeng and Z. Wang, "Position-Transitional Particle Swarm Optimization-incorporated Latent Factor Analysis," IEEE
Transactions on Knowledge and Data Engineering, doi: 10.1109/TKDE.2020.3033324.
[4] S. Chou, J. Jang and Y. Yang, "Fast Tensor Factorization for Large-Scale Context-Aware Recommendation from Implicit Feedback," IEEE Transactions
on Big Data, vol. 6, no. 1, pp. 201-208, March 2020.
[5] X. Luo, M. Zhou, S. Li, D. Wu, Z. Liu and M. Shang, "Algorithms of Unconstrained Non-negative Latent Factor Analysis for Recommender Systems,"
IEEE Transactions on Big Data, vol. 7, no. 1, pp. 227-240, Mar. 2021.
[6] D. Wu, X. Luo, M. Shang, Y. He, G. Wang and M. Zhou, "A Deep Latent Factor Model for High-Dimensional and Sparse Matrices in Recommender
Systems," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 7, pp. 4285-4296, Jul. 2021.
[7] X. Luo, D. Wang, M. Zhou and H. Yuan, "Latent Factor-Based Recommenders Relying on Extended Stochastic Gradient Descent Algorithms," IEEE
Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 2, pp. 916-926, Feb. 2021.
[8] X. Luo, M. Shang and S. Li, "Efficient Extraction of Non-negative Latent Factors from High-Dimensional and Sparse Matrices in Industrial Applications,"
2016 IEEE 16th International Conference on Data Mining, pp. 311-319, 2016.
[9] X. Luo, Z. Wang and M. Shang, "An instance-frequency-weighted regularization scheme for non-negative latent factor analysis on high-dimensional and
sparse data," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3522-3532, 2021.
[10] H. Wu, X. Luo and M. Zhou, "Advancing non-negative latent factorization of tensors with diversified regularizations schemes," IEEE Transactions on
Services Computing, vol. 15, no. 3, pp. 1334-1344, 1 May-June 2022.
[11] Z. Liu, X. Luo and Z. Wang, "Convergence analysis of single latent factor-dependent, nonnegative, and multiplicative update-based nonnegative latent
factor models," IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 4, pp. 1737-1749, Apr. 2021.
[12] J. Chen, X. Luo and M. Zhou, "Accurate Latent Factor Analysis via Particle Swarm Optimizers," 2021 IEEE International Conference on Systems, Man,
and Cybernetics, 2021, pp. 2930-2935, doi: 10.1109/SMC52423.2021.9659218.
[13] X. Luo, M. Zhou, Z. Wang, Y. Xia and Q. Zhu, "An effective QoS estimating scheme via alternating direction method‐based matrix factorization," IEEE
Transactions on Services Computing, vol. 12, no. 4, pp. 503‐518, Nov. 2019.
[14] X. Luo, M. Zhou, S. Li and M. Shang, "An inherently non‐negative latent factor model for high‐dimensional and sparse matrices from industrial
applications". IEEE Transactions on Industrial Informatics, vol. 14, no. 5, pp. 2011‐2022, 2018.
[15] J. Wu, L. Chen, Y. Feng, Z. Zheng, M Zhou and Z. Wu, "Predicting quality of service for selection by neighborhood‐based collaborative filtering," IEEE
Transactions on Systems, Man, and Cybernetics: Systems, vol. 43, no. 2, pp. 428‐439, 2013.
[16] Y. Koren and R. Bell, "Advances in collaborative-filtering," Recommender Systems Handbook, F. Ricci, L. Rokach, B. Shapira, and P. B. Kantor, Eds.
New York, USA: Springer, 2011, pp. 145-186.
[17] X. Luo, W. Qin, A. Dong, K. Sedraoui and M. Zhou, "Efficient and High-quality Recommendations via Momentum-incorporated Parallel Stochastic
Gradient Descent-Based Learning," IEEE/CAA Journal of Automatica Sinica, vol. 8, no. 2, pp. 402-411, Feb. 2021.
[18] X. Luo, Z. Wang and M. Shang, "An Instance-Frequency-Weighted Regularization Scheme for Non-Negative Latent Factor Analysis on High-
Dimensional and Sparse Data," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3522-3532, Jun. 2021.
[19] D. Wu, M. Shang, X. Luo and Y. He, "A data-characteristic-aware latent factor model for web service QoS prediction," IEEE Transactions on Knowledge
and Data Engineering, 2020, doi: 10.1109/TKDE. 2020.3014302.
[20] D. Wu, M. Shang, X. Luo and Z. Wang, "An L1-and-L2-Norm-Oriented Latent Factor Model for Recommender Systems," IEEE Transactions on Neural
Networks and Learning Systems, doi: 10.1109/TNNLS.2021.3071392.
[21] D. Wu, Q. He, X. Luo, M. Shang and G. Wang, "A posterior-neighborhood-regularized latent factor model for highly accurate web service QOS
prediction," IEEE Transactions on Services Computing, doi: 10.1109/TCST.2019.2963017.
[22] X. Luo, M. Zhou, S. Li, M. Shang, "An inherently non‐negative latent factor model for high‐dimensional and sparse matrices from industrial applications".
IEEE Transactions on Industrial Informatics, vol. 14, no. 5, pp. 2011‐2022, 2018.
[23] Y. Koren, R. Bell, and C. Volinsky, "Matrix factorization techniques for recommender systems," IEEE Computer, vol. 42, no. 8, pp. 30‐37, August 2009.
[24] G. Takács, I. Pilászy, Bottyán Németh, and D. Tikky, "Scalable collaborative filtering approaches for large recommender systems," Journal of Machine
Learning Research, vol. 10, pp. 623‐656, 2009.
[25] J. Duchi, E. Hazan, and Y. Singer, "Adaptive subgradient methods for online learning and stochastic optimization," Journal of Machine Learning Research,
vol. 12, no. 7, pp. 2121-2159, 2011.
[26] M. Zeiler, "ADADELTA: An Adaptive Learning Rate Method," Computer Science, 2012.
[27] D. Li, C. Chen, Q. Lv, H. Gu, T. Lu, L. Shang, N. Gu, and M. Stephen, "AdaError: An Adaptive Learning Rate Method for Matrix Approximation-based
Collaborative Filtering," the 27th World Wide Web Conference, 2018, pp. 741-751.
[28] S. García-Galán, R. Prado, and J. Expósito, "Swarm Fuzzy Systems: Knowledge Acquisition in Fuzzy Systems and Its Applications in Grid Computing,"
IEEE Transactions on Knowledge and Data Engineering, vol. 26, no. 7, pp. 1791-1804, 2014.
[29] J. Chen, X. Luo and M. Zhou, "Hierarchical particle swarm optimization-incorporated latent factor analysis for large-scale incomplete matrices," IEEE
Transactions on Big Data, doi: 10.1109/TBDATA.2021.3090905
[30] Q. Wang, S. Chen, and X. Luo, "An adaptive latent factor model via particle swarm optimization," Neurocomputing, vol. 369, pp. 176-184, Dec. 2019.
[31] J. Chen, Y. Yuan, R. Tao, J. Chen, T. R. and X. Luo, "Hyper-parameter-evolutionary latent factor analysis for high-dimensional and sparse data from
recommender systems," Neurocomputing, vol. 421, pp. 316-328, Jan. 2021.
[32] X. Luo, Z. Liu, S. Li, M. Shang and Z. Wang, "A Fast Non-Negative Latent Factor Model Based on Generalized Momentum Method," IEEE Transactions
on Systems, Man, and Cybernetics: Systems, vol. 51, no. 1, pp. 610-620, Jan. 2021.
[33] X. Luo, Y. Yuan, M. Zhou, Z. Liu and M. Shang, "Non-Negative Latent Factor Model Based on β-Divergence for Recommender Systems," IEEE
Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 8, pp. 4612-4623, Aug. 2021.
[34] X. Luo, Y. Xia, Q. Zhu and Y. Li, "Boosting the K-Nearest-Neighborhood based incremental collaborative filtering," Knowledge-Based Systems, vol.
53, pp. 90-99, 2013.
[35] X. Luo, H. Liu, G. Gou, Y. Xia and Q. Zhu, "A Parallel Matrix Factorization-Based Recommender by Alternating Stochastic Gradient Decent,"
Engineering Applications of Artificial Intelligence, vol. 25, no. 7, 2012.
[36] Y. Shi and R. Eberhart, "Empirical study of particle swarm optimization," the 1999 Congress on Evolutionary Computation-CEC99, 1999, vol. 3, pp.
1945-1950.
[37] J. Mohsen and E. Martin, "A matrix factorization technique with trust propagation for recommendation in social networks," the 4th ACM Conference on
Recommender Systems, Barcelona, Spain, 2010, pp. 135‐142.
[38] H. Ma, I. King, and M. Lyu, "Learning to recommend with social trust ensemble," the 32nd Int. ACM SIGIR Conference on Research and Development
in Information Retrieval, Boston, MA, USA, Jul. 2009, pp. 203-210.
[39] J. Demšar, "Statistical comparisons of classifiers over multiple data sets," Journal of Machine Learning Research, vol. 7, no. 4, pp. 1-30, Janurary 2006.
[40] K. Gao, Z. Cao, L. Zhang, Z. Chen, Y. Han and Q. Pan, "A review on swarm intelligence and evolutionary algorithms for solving flexible job shop
scheduling problems," IEEE/CAA Journal of Automatica Sinica, vol. 6, no. 4, pp. 875-887, Jul. 2019.
[41] S. Gao, Y. Yu, Y. Wang, J. Wang, J. Cheng and M. Zhou, "Chaotic Local Search-Based Differential Evolution Algorithms for Optimization," IEEE
Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3954-3967, Jun. 2021.
[42] A. Khan, X. Cao, S. Li, V. Katsikis and L. Liao, "BAS-ADAM: an ADAM based approach to improve the performance of beetle antennae search
optimizer," IEEE/CAA Journal of Automatica Sinica, vol. 7, no. 2, pp. 461-471, Mar. 2020.
[43] Y. Cao, et al., "Comprehensive Learning Particle Swarm Optimization Algorithm with Local Search for Multimodal Functions," IEEE Transactions on
Evolutionary Computation, vol. 23, no. 4, pp. 718-731, Aug. 2019.
[44] W. Dong and M. Zhou, "Gaussian Classifier-Based Evolutionary Strategy for Multimodal Optimization," IEEE Transactions on Neural Networks and
Learning Systems, vol. 25, no. 6, pp. 1200-1216, Jun. 2014.
[45] G. Wei, Q. Wu and M. Zhou, "A Hybrid Probabilistic Multi objective Evolutionary Algorithm for Commercial Recommendation Systems," IEEE
Transactions on Computational Social Systems, vol. 8, no. 3, pp. 589-598, Jun. 2021.
|
|
http://arxiv.org/abs/2302.11953v2 | 2023-03-21T18:38:10 | 2023-02-23T12:02:49 | MFBE: Leveraging Multi-Field Information of FAQs for Efficient Dense
Retrieval | In the domain of question-answering in NLP, the retrieval of Frequently Asked
Questions (FAQ) is an important sub-area which is well researched and has been
worked upon for many languages. Here, in response to a user query, a retrieval
system typically returns the relevant FAQs from a knowledge-base. The efficacy
of such a system depends on its ability to establish semantic match between the
query and the FAQs in real-time. The task becomes challenging due to the
inherent lexical gap between queries and FAQs, lack of sufficient context in
FAQ titles, scarcity of labeled data and high retrieval latency. In this work,
we propose a bi-encoder-based query-FAQ matching model that leverages multiple
combinations of FAQ fields (like, question, answer, and category) both during
model training and inference. Our proposed Multi-Field Bi-Encoder (MFBE) model
benefits from the additional context resulting from multiple FAQ fields and
performs well even with minimal labeled data. We empirically support this claim
through experiments on proprietary as well as open-source public datasets in
both unsupervised and supervised settings. Our model achieves around 27% and
20% better top-1 accuracy for the FAQ retrieval task on internal and open
datasets, respectively over the best performing baseline. | [
"Debopriyo Banerjee",
"Mausam Jain",
"Ashish Kulkarni"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11953v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11953v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.IR",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.IR",
"cs.LG"
] | 3
2
0
2
r
a
M
1
2
]
R
I
.
s
c
[
2
v
3
5
9
1
1
.
2
0
3
2
:
v
i
X
r
a
MFBE: Leveraging Multi-Field Information of
FAQs for Efficient Dense Retrieval
Debopriyo Banerjee†, Mausam Jain†, Ashish Kulkarni
Rakuten Institute of Technology, Rakuten India Enterprise Pvt. Ltd.
{debopriyo.banerjee, mausam.jain, ashish.kulkarni}@rakuten.com
Abstract. In the domain of question-answering in NLP, the retrieval
of Frequently Asked Questions (FAQ) is an important sub-area which is
well researched and has been worked upon for many languages. Here, in
response to a user query, a retrieval system typically returns the relevant
FAQs from a knowledge-base. The efficacy of such a system depends on
its ability to establish semantic match between the query and the FAQs
in real-time. The task becomes challenging due to the inherent lexical
gap between queries and FAQs, lack of sufficient context in FAQ titles,
scarcity of labeled data and high retrieval latency. In this work, we pro-
pose a bi-encoder-based query-FAQ matching model that leverages mul-
tiple combinations of FAQ fields (like, question, answer, and category)
both during model training and inference. Our proposed Multi-Field Bi-
Encoder (MFBE) model benefits from the additional context resulting
from multiple FAQ fields and performs well even with minimal labeled
data. We empirically support this claim through experiments on propri-
etary as well as open-source public datasets in both unsupervised and
supervised settings. Our model achieves around 27% and 23% better
top-1 accuracy for the FAQ retrieval task on internal and open datasets,
respectively over the best performing baseline.
Keywords: Information Retrieval * FAQ Retrieval * Question-Answering
* Multi-field * BERT * Bi-encoder.
1
Introduction
Customer support (CS) is critical to any business and plays an important role in
customer retention, new customer acquisition, branding, and in driving a better
experience. In a typical online customer support setting, customers reach out
with their queries and are attended to by human agents. This requires busi-
nesses to hire and maintain a team of CS agents that scales as a function of the
query volume and the productivity of agents that, in turn, translates to oper-
ational cost for the business. Customer support automation [19] can help save
on this operational cost by providing automated responses to queries and by
improving support agent productivity. One of the ways businesses typically try
† These authors contributed equally to this work
2
Banerjee, Jain, Kulkarni
to achieve this is by automatically responding to customer queries from a repos-
itory of frequently asked questions (FAQs), thereby, insulating human agents
from high query volumes. The success of such a system, measured as the frac-
tion of customer queries that it automatically responds to, then depends on the
effectiveness of the user query to FAQ matching.
Given a collection of FAQs where, each FAQ is a multi-field tuple (cid:104)Q, A, C(cid:105)
of question Q, answer A, and question category C, the problem of FAQ retrieval
[24,6,25,9] is to retrieve the top-k FAQs in response to a user query q. Similar to
a typical retrieval problem, FAQ retrieval too suffers from the problem of lexical
gap between a user query expressed in natural language and the corresponding
matching FAQs. This is typically addressed by learning a relevance function
between user queries and FAQs using labeled query-FAQ pairs for supervision.
Unfortunately, such labeled data is often unavailable or scarce, especially in low-
resource settings like Japanese query-FAQ retrieval, which is the domain of our
interest. Curating large amounts of such labeled data through manual labeling
is often expensive and requires domain knowledge for labeling.
The main contributions of this paper are summarized as follows:
– We propose a bi-encoder based retrieval model - MFBE that leverages multi-
field information (question, answer and/or categories) in FAQs.
– We use different combinations of user query and FAQ fields to create an
extended set of pseudo-positive pairs for training.
– We employ multiple FAQ representations during inference for query-FAQ
scoring.
2 Related Work
Question answering [16,10] task has been the area of interest in NLP community
for a long time and shares the concepts of Information Retrieval (IR) where
relevant information from a corpus of documents is retrieved in response to a
search query. FAQ retrieval is an example of IR which is the focus of this work.
Traditional retrieval methods [23,12] mainly depend on lexical features for the
retrieval task which limits them to capture the semantics of the query. In order
to address the challenge of lexical gap between user queries and answers, there
is a body of work [3,17,29] that trains a semantic retrieval model from labeled
data in the form of user queries and matching responses. In recent years, there
has been an increasing research [8,14] on unsupervised learning techniques for
text-encoder training eliminating the need for annotated data. They propose
augmentation techniques based on paraphrases of input sentences to generate
positive and negative samples for an anchor that are then used to train the
retrieval model using a contrastive learning strategy [4].
The performance of FAQ retrieval task depends upon the (i) choice and
design of model architecture and (ii) retrieval and re-ranking algorithms used.
A combination of bi-encoder and cross-encoder is seen in [13,20], where the
authors start with an unsupervised setting with zero labelled data. Then they
iterate between bi-encoder and cross-encoder models generating more labelled
MFBE
3
Fig. 1: Example of an FAQ in Japanese Language (JA).
samples in each iteration. This gives a powerful text-encoder model along with
annotated dataset. The retriever and the re-ranker can also be jointly trained
with the goal of achieving mutual improvement [22].
Previous works [24,25,6] on FAQ retrieval problem focused on query-question
(q-Q) similarity using BM25 [23] and query-answer (q-A) similarity using BERT
[5], where the BERT model parameters are fine-tuned on FAQ question-answer
(Q-A) pairs. Sakata et al. [24] (close to our work) employ a two-stage method
where they first retrieve a set of FAQs based on q-Q similarity and then re-rank
these based on q-A similarity to obtain the final list of top-k FAQs as response.
Here, question (Q) and answer (A) are typically referred to as fields. Fields can
vary depending upon the dataset. For example, Wikipedia page title, content,
abstract, etc. have been considered as fields in [16].
Dutta et al. [6] propose a seq-2seq model for extracting keywords in user
queries to identify the intent of a user query for better retrieval of relevant
FAQs. Another close work by Assem et al. [2] uses two separate deep learning
architectures. They first learn latent lexical relationships between FAQ questions
and their paraphrases to generate top-k most relevant similar questions from the
collection. These top-k candidates are then fed to an LSTM-based architecture
that captures fine-grained differences in semantic context between FAQ questions
and their paraphrases thereby improving the accuracy@1. Liu et al. [15] discuss
the difficulty in determining the relevance of query-answer pairs due to their
heterogeneity in terms of syntax and semantics and propose to use synthetic data
for increasing the positive training examples. Tseng et al. [26] cites that existing
methods fail to attend to the global information specifically about an FAQ task
and propose a graph convolution network-based method to cater to all relations
of question and words to generate richer embeddings. They also explore domain
specific knowledge graphs for improving question and query representations.
Some unsupervised sentence embedding methods that closely aligns with our
work are [14] and [8], which are based on contrastive learning using augmentation
techniques. Alternate representations of input sentences provide strong positives
to the model. [11] is a self-supervised fine-tuning of BERT, which redesigned the
contrastive learning objective to account for different views of the input sentence.
4
Banerjee, Jain, Kulkarni
3 FAQ Retrieval for User Queries
FAQs are a pre-defined list of question-answer pairs available on web portals
(e.g., banking, e-commerce, telecom, etc.) that help in addressing user queries
without human intervention. In some cases, FAQs are also associated with some
hierarchical categories or tags. Fig. 1 shows a sample FAQ that consists of ques-
tion (or title), answer (or description) and hierarchical categories. In this paper,
we mainly focus on improving the retrieval of FAQs conditioned on user queries
using a neural text encoder [7]. In general, neural text encoders can be cate-
gorized into two types: bi-encoders [18] and cross-encoders [28]. Bi-Encoder
(BE): It consists of two encoder branches (with optional weight sharing), where
two sentences Sa and Sb are independently passed through each branch, result-
ing into two sentence embeddings fa and fb respectively. Their similarity can
then be computed using a distance metric like cosine or dot-product of fa and
fb.
Cross-Encoder (CE): The two sentences are first concatenated and then passed
through an encoder. The resulting embedding vector is input to a classification
head that is typically implemented as a shallow feed forward network. Here, com-
putation of similarity between the two input sentences is modelled as a binary
classification task with 1 (0) indicating as similar (not similar).
Generally, cross-encoders outperform bi-encoders in performance by lever-
aging the mutual attention among all the words in the concatenated sentence,
but they also suffer from high inference latency. The bi-encoder architecture is
inherently suited for the FAQ retrieval task as it allows for pre-computation and
indexing of sentence embeddings of the FAQs before-hand, which is not possible
with cross-encoders. We introduce Multi-Field Bi-Encoders (MFBE) with the
aim of improving the performance of bi-encoders for the FAQ retrieval task by
leveraging additional context from FAQ titles, description and categories. In this
section, we first explain the notations, followed by our proposed approach.
Notations - Let F = {Fi}N
i=1 be the set of FAQs, where each FAQ Fi consists
of a 3-tuple (cid:104)Q, A, C(cid:105) of question (or title) Q, answer (or description) A and
categories (or tags) C. We define M = {Q, A, QA, QC, CA, QCA} as the set of
fields, where, each field m ∈ M is obtained by concatenating one or more of Q, A
or/and C. Let Ms = {Q, QC} ⊂ M be a subset of fields present in M and Q be
the set of all user queries. For a query q ∈ Q, let F and ̃F denote the matching
and non-matching FAQs, respectively, such that (q, F ) forms a matching query
FAQ pair and (q, ̃F ) corresponds to a non-matching pair. We denote the field
m (or ms) of an FAQ as F m (or F ms ). For example, the field QA of an FAQ
is denoted by F QA. In this case, for a query q, (q, F QA) and (q, ̃F QA) are the
matching and non-matching query FAQ pairs. We denote the text encoder as
E(*), which maps any text to a d-dimensional real-valued vector. For every FAQ
field F m
i ) = f m
i and stack them in a matrix Tm, where row
i in Tm corresponds to vector f m
. For a query q the corresponding embedding
i
is computed as E(q) = fq.
, we compute E(F m
i
MFBE
5
Fig. 2: Illustration of the working of MFBE model across different stages
- training, pre-computation and inference.
Proposed Approach - We propose to learn the relevance function rel(x, y; θ)
(where x ∈ {q, F ms }; when x = q, then y ∈ ∪m∈M Fm, else y ∈ ∪m∈M \Ms F m)
using a pre-trained neural language model [7] as the text encoder with θ as the
model parameters.
As shown in Fig. 2, MFBE consists of Language-agnostic BERT Sentence
Embedding (LaBSE) [7] model as text encoder in two branches with shared
weights.
We compute the similarity between a query q and an FAQ field F m using the
cosine-similarity, i.e., sim(q, F m) = cosineSim(fq, f m). As mentioned in [9], the
similarity function should be decomposable and facilitate the pre-computation of
representations of the FAQs. L2, inner product and cosine-similarity are some of
the widely used similarity functions that are decomposable in nature. We choose
cosine-similarity function, which is equivalent to inner product for normalized
vectors.
Training Stage - The goal is to learn a latent space following metric learning
[27], where matching query and FAQ pairs shall have smaller distance compared
to the non-matching pairs. Let Dtrain = {(xi, y+
i=1 be the train-
ing data that consists of N instances, where each instance contains one query or
an FAQ field xi ∈ {qi, F ms
i ∈ ∪m∈M F m
,
i
when xi = qi (or y+
), along with n non-
matching (negative) FAQ fields y−
i,j.
}, a matching (positive) FAQ field y+
i ∈ ∪m∈M \Ms F m
i
, when xi = F ms
i,1, . . . , y−
i,n)}N
i , y−
i
i
We employ the contrastive loss function (Eq. 1) for fine-tuning the parameters
of the MFBE.
L(xi, y+
i , y−
i,1, . . . , y−
i,n) = −log
esim(xi,y+
i )
j esim(xi,y−
i ) + (cid:80)
i,j )
esim(xi,y+
(1)
LaBSEPoolingContrastive LossTrainingDB (FAQ Embeddings)Pre-computationLaBSEPoolingLaBSELaBSEPoolingPoolingTop-k FAQsInference...Shared weightscached6
Banerjee, Jain, Kulkarni
We train three variants of unsupervised and supervised MFBE models -
MFBEunsup, MFBEsup, and MFBEsup∗ . Triplets used for each variant are as
follows:
tripletsunsup =
(cid:91)
ms∈Ms
{(F A, F ms, ̃F ms), (F ms, F A, ̃F ms)}
tripletssup =
(cid:91)
m∈M
{(q, F m, ̃F m), (F m, q, ̃F m)}
tripletssup∗ = tripletsunsup ∪ tripletsup
(2)
(3)
(4)
Positive and Negative FAQs - In FAQ datasets, positive examples are explic-
itly present from the manual annotation of query-FAQ, i.e., (q, F m) pairs. For
boosting the number of training samples, we consider both the pairs (F Q, F A)
and (F QC, F A) from an FAQ as proxy for (q, F m). But, negative examples are
not explicitly present. However, the choice of negative samples play a decisive
role in learning an effective text encoder. So, we consider Gold negatives [9], i.e.,
positive FAQs paired with other non-matching queries that appear in the train-
ing set. In order to make the training computation more efficient, we make use
of Gold FAQs from the same mini-batch as negatives, termed as in-batch neg-
atives [9]. In addition, we consider one negative FAQ sample for each matching
query-FAQ pair.
Pre-computation of FAQ Embeddings - After training the text-encoder
E(*), we use it to pre-compute and store Tm (Eq. 5) corresponding to the field m.
We use the best performing field mbest ∈ M (Eq. 6), in terms of Acc (accuracy@1,
Eq. 7), evaluated on the test set Dtest for the query-FAQ matching task.
Tm = (cid:2)f m
1 f m
2 . . . f m
N
(cid:3)T
where f m
i = E(F m
i ), for i = 1, 2, . . . , N .
mbest = arg max
m∈M
Acc(Dtest)
(5)
(6)
In Eq. 6, test set Dtest = {(q, F )|F ∈ F is a matching FAQ for query q ∈ Qtest},
where Qtest ⊂ Q. As each FAQ consists of different FAQ fields F m (∀m ∈ M ),
we define Acc(*) as below.
Acc(Dtest) =
1
|Qtest|
(cid:88)
q∈Qtest
1[{arg max
i
cosineSim(fq, f m
i )} ∩ gt(q) (cid:54)= Φ]
(7)
Here, gt(q) denotes the set of FAQ indexes present in the ground truth labels
corresponding to query q.
Inference - During inference stage, for a given query q, we first compute the
input query embedding fq. Then, we calculate cosine similarity scores of fq and
row vectors of Tmbest (which are pre-computed embeddings of FAQs) and return
the top-k candidates, sorted in descending order of their scores.
MFBE
7
Table 1: Datasets used in this paper. For open datasets queries are separated into
five folds. (JA=Japanese, EN=English)
Type
Name
Language #FAQs
#Queries #Avg. sentence length
Train Test Query FAQ-Q FAQ-A
Internal
IDS1
IDS2
IDS3
IDS4
Open
LocalGov
Stack-FAQ
COUGH
JA
JA
JA
JA
JA
EN
EN
795
510
1129
661
1786
125
7115
1782 825
139
481
152
528
145
505
749
1249
1201
28.5
28.6
14.9
17.6
26.1
73.3
74.4
24.8
31.3
33.1
33.4
31.1
55.7
76.5
166.6
514.6
473.8
471.8
357.2
513.8
711.7
4 Experiments, Implementation and Results
Datasets - We conduct experiments on both internal proprietary and open
datasets. Table 1 shows the list of datasets and their details used in this work.
Internal datasets - IDS1, IDS2, IDS3 and IDS4 are Japanese language com-
pany internal datasets related to e-commerce, leisure, communication and pay-
ment domains respectively. These are carefully prepared by majority voting by
five native Japanese speakers across query-FAQ annotations.
Open datasets - LocalGov, introduced in [24], is a Japanese language dataset
which is constructed from Japanese administrative municipality domain. Stack-
FAQ is described in [1] as an English language dataset prepared from threads
in StackExchange website concerning web apps domain. COUGH is another
English dataset [30] constructed by scraping data from 55 websites (like, CDC
and WHO) containing user queries and FAQs about Covid-19.
Implementation Details - We use single NVIDIA A100 GPU with 40G VRAM
for all experiments. In all our experiments, we set maximum sequence length as
256 (for training and testing) and batch size as 32 which are constrained by
the choice of GPU. For all datasets, the number of training epochs is set as 15.
The choice of optimizer, learning rate and embedding dimension follows from
[21] for all the experiments except for multi-domain fine-tuning experiments
(Table 4 last 4 rows) where learning rate is set as 2e − 7. We set weight decay
ω = 1e − 5 by employing grid search between 1e-1 and 1e-10 (reducing by 0.1x).
For each matching query-FAQ pair, we consider 10 negative FAQs (i.e., n=10
after experimenting with other values, such as 5, 10, and 20). All our baseline
experiments follow same settings as the proposed models and are initialized with
LaBSE checkpoint†. Code and relevant material of this work can be found here†.
Results and Discussion - We report accuracy@1 (Acc), mean reciprocal
rank @5 (MRR) and normalized discounted cumulative gain @5 (NDCG) and
compare our proposed models with multiple baselines, such as, BM25 (lexical
† https://huggingface.co/sentence-transformers/LaBSE/tree/main
† https://github.com/mausamsion/MFBE
8
Banerjee, Jain, Kulkarni
Table 2: Results on internal datasets.
IDS1
IDS2
IDS3
IDS4
Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG
23.5 29.8
29.9 38.6
41.5 51.7
30.6
40.1
20.5
36.0 43.2
36.0 48.4
47.5 55.9
30.3
35.8
34.6
38.2 47.3
49.3 59.2
46.7 57.9
31.7
41.7
37.0
35.9 46.0
51.0 59.0
46.9 57.9
31.8
40.4
35.3
Model
Baselines
BM25 [23]
LaBSE [7]
DPR [9]
Proposed
46.2
MFBEunsup 33.2 43.9
51.0 60.6
MFBEsup
62.4
59.2 66.4 66.8
MFBEsup∗
51.1 60.3
44.7
60.4 71.3 58.1
55.1
61.2 69.8
43.8
51.3 59.7
57.9 67.8
52.8
57.9 68.9 53.9
43.3
51.0 61.7
64.1 72.2
54.9
65.5 74.9 57.8
Table 3: Results on open datasets.
LocalGov
Stack-FAQ
COUGH
Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG
26.4 33.4
26.3 35.9
46.5 55.2
26.5
28.8
44.7
40.0 49.1
43.6 55.6
88.8 91.9
52.9
60.6
93.0
39.1 48.0
23.0 31.7
42.8 51.5
26.1
17.7
29.3
Model
Baselines
BM25 [23]
LaBSE [7]
DPR [9]
Proposed
54.9
MFBEunsup 53.8 63.5
61.3 72.0
MFBEsup
64.8
62.9 72.3 65.7
MFBEsup∗
85.9 91.0
92.8
98.0 98.8 99.0
98.5
96.5 98.0
46.0 57.7
35.5
53.1 65.2 40.3
37.7
50.1 61.0
feature-based IR model), LaBSE (heavy-weight dense multilingual text encoder),
and DPR (dense bi-encoder with independently learned encoders). Across all
baselines, we keep the train settings related to field combinations same as our
MFBEsup∗ model. From Table 2, BM25 is the worst performing model, because
of dependence on lexical features, hence fails to capture semantics among queries
and FAQs. MFBEsup∗ outperforms all baselines across different datasets. In Ta-
ble 3, we report 5-fold cross validation results. MFBEsup and MFBEsup∗ shows
the best performance across all the baselines. MFBEunsup, which has zero query
knowledge, performs better than DPR, which is the best performing baseline
of all, in two datasets out of three. Table 5 illustrates sample input query and
output top-1 prediction of DPR and MFBEunsup models where we see that DPR
fails to capture the semantic meaning of the input thus returning irrelevant re-
sponse.
Cross-domain - Table 4 shows the cross-domain results of MFBEsup∗ where
the model is trained on one dataset and evaluated on completely unknown ones
(zero-shot setting). For example, the first row corresponds to the case where
MFBEsup∗ is trained on IDS1 and evaluated on IDS2, IDS3, and IDS4. We
observe that the zero-shot performance of MFBEsup∗ is the best, when trained
on IDS1, compared to others. This is because IDS1 consists of a large number
of labelled user queries (nearly 1.7k) in the train split.
Multi-domain - Here MFBEsup∗ model is trained on all the internal datasets
IDS[1-4] denoted as IDS∗. The average drop in Acc is only 4%, compared to the
MFBE
9
Table 4: Results of cross- and multi-domain experiments using MFBEsup∗ model.
Model
IDS1
IDS2
IDS3
IDS4
Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG
-
Cross-domain
IDS1
IDS2
IDS3
IDS4
37.3 48.3
42.4 53.1
40.5 51.9
-
-
50.3
55.5
54.3
47.5 62.2
-
-
44.6 57.0
44.6 58.5
55.2
-
44.2
44.8
55.3 66.0
47.4 56.9
-
-
50.0 61.4
53.0
39.2
-
46.1
53.1 65.7
48.3 58.3
57.2 63.6
-
-
53.6
40.5
45.8
-
Multi-domain
IDS∗
55.5 64.2
65.5
62.6 71.2
54.8
55.3 66.2
50.8
59.3 67.9
50.8
Cross and Multi-domain
IDS∗
65.2
55.0 64.0
1
IDS∗
64.7
54.4 63.3
2
IDS∗
65.1
54.8 63.8
3
IDS∗
64.2
54.2 63.0
4
62.6 71.3
63.3 71.9
61.9 70.5
61.2 70.3
54.9
55.4
54.5
53.4
55.3 66.2
54.6 65.6
55.9 67.1
56.6 67.0
50.7
50.6
51.4
50.6
59.3 68.0
59.3 68.2
57.9 67.2
61.4 69.8
50.7
51.6
51.0
52.9
Table 5: Example input and outputs from COUGH (EN) and LocalGov (JA)
datasets of two baseline models and our MFBEsup∗ model. In all the examples,
MFBEsup∗ returns the most relevant response in top-1.
Input
Top FAQ (question) prediction
DPR
MFBEsup∗
Is personal protective equip-
ment sufficient to protect oth-
ers?
How should i adjust my feeling
during pendemic period?
Are there exemptions to who
has to wear a face covering?
Are cloth face coverings the
same as personal protective
equipment (PPE)?
I traveled and have been sick
ever since I got back. What
should I do?
During this time, it is impor-
tant to be S.M.A.R.T. about
staying active
国民年金の納付書を誤って捨てて
しまいました。 どうしたらいいで
しょうか?
【児童手当現況届】間違って記入
した場合は、 どうしたらいいです
か。
国民年金保険料を支払いたいので
すが納付書をなくしてしまいまし
た。
納税証明書が必要なのですが、 ど
こで入手できますか?
介護保険料の納付書を紛失してし
まった。 再交付してほしいのです
が?
納税証明書(法人市民税、 事業所
税を除く)を取得したい。
last row of Table 2. The model trained on IDS∗ is more robust across multiple
domains with better performance in some cases (e.g., IDS2), making it useful
for leveraging cross-domain knowledge.
Cross and Multi-domain - In this case, the model is first trained on IDS∗, then
fine-tuned on one dataset, and finally evaluated on all datasets. For example, the
sixth row corresponds to the case, where MFBEsup∗ is first trained on IDS∗, then
fine-tuned on IDS1 (denoted as IDS∗
1), and finally evaluated on all the datasets,
i.e., IDS[1-4] (same for the last three rows). There is no significant change in
performance when compared to results of fifth row because of prior exposure to
the corresponding datasets.
Ablation experiments - We train MFBEsup∗ , ∀m ∈ M (taking one at a time)
and varying the number of labelled queries. In figure 3-(a) and (b) we show the
performance of our model as FAQ field combinations are changed (which consis-
10
Banerjee, Jain, Kulkarni
Fig. 3: Ablation experiments with MFBEsup∗ model. (a) Variation across multi-field
combinations on internal datasets (b) Variation across multi-field combinations on
open datasets (c) Variation in the number of training query-FAQ pairs
tent at both training and testing). It is observed that using category information
adds noise and degrades performance which can be due to the inefficient usage of
this field. The category field has keywords and hierarchy which needs to be lever-
aged but in this work, for simplicity, we concatenated these keywords to other
input fields making it as a part of input string. The 'proposed' numbers are the
best numbers across all of our proposed models (as discussed in Table 2 and 3).
From figure 3-(c) it is observed that our MFBEsup∗ model is a good candidate
for the scenarios where there is less annotated data with the accuracy flattening
after around 300 query-FAQ pairs. This makes it suitable for bootstrapping to
new domains where there are FAQ documents and no or less query-FAQ pairs.
5 Conclusion
In this paper, we proposed MFBE, a bi-encoder based retrieval model that make
use of information from multiple fields in FAQs to improve the text embedding
quality and thus better sentence matching. We also create an extended set of
pseudo-positive training pairs by using various combinations of user-query and
FAQ fields. Then we use these multiple FAQ representations to make inference
on input queries. Our model outperforms the baselines by 27% and 23% (in
terms of accuracy@1) on internal and open-datasets, respectively. Cross-domain
experiment results for the MFBEsup∗ model over our internal datasets shows the
MFBE
11
potential of this kind of proposed approach to be useful in cold-start settings,
which is common in real-world scenarios. Also, multi-domain experiment proves
the possibility of multi-domain knowledge sharing using a single model which
performs good across most of the datasets it is trained on. We also do ablation on
semi-supervised setting (queries variation) and effect of FAQ field combinations.
References
1. Paraphrase-focused learning to rank for domain-specific frequently asked questions
retrieval. Expert Systems with Applications 91, 418–433 (2018)
2. Assem, H., Dutta, S., Burgin, E.: Dtafa: decoupled training architecture for efficient
faq retrieval. In: Proc. of the 2021 Annual Meeting of the Special Interest Group
on Discourse and Dialogue. pp. 423–430
3. Bian, N., Han, X., Chen, B., Sun, L.: Benchmarking knowledge-enhanced com-
monsense question answering via knowledge-to-text transformation. In: Proc. of
the 2021 AAAI Conf. on Artificial Intelligence. vol. 35, pp. 12574–12582
4. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for con-
trastive learning of visual representations. In: Proc. of the 2020 Intl. Conf. on
Machine Learning. pp. 1597–1607
5. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: BERT: Pre-training of deep
bidirectional transformers for language understanding. In: Proc. of the 2019 Conf.
of the NAACL: HLT, Vol. 1 (Long and Short Papers) (2019)
6. Dutta, S., Assem, H., Burgin, E.: Sequence-to-sequence learning on keywords for
efficient faq retrieval. arXiv preprint arXiv:2108.10019 (2021)
7. Feng, F., Yang, Y., Cer, D., Arivazhagan, N., Wang, W.: Language-agnostic BERT
sentence embedding. In: Proc. of the 2022 Annual Meeting of the Association for
Computational Linguistics. pp. 878–891
8. Gao, T., Yao, X., Chen, D.: SimCSE: Simple contrastive learning of sentence em-
beddings. In: Proc. of the 2021 Conf. on Empirical Methods in Natural Language
Processing. pp. 6894–6910
9. Karpukhin, V., Oguz, B., Min, S., Lewis, P., Wu, L., Edunov, S., Chen, D., Yih,
W.t.: Dense passage retrieval for open-domain question answering. In: Proc. of the
2020 Conf. on Empirical Methods in NLP. pp. 6769–6781
10. Khattab, O., Potts, C., Zaharia, M.: Relevance-guided supervision for OpenQA
with ColBERT. Transactions of the Assoc. for Computational Linguistics 9, 929–
944 (2021)
11. Kim, T., Yoo, K.M., Lee, S.g.: Self-guided contrastive learning for bert sentence
representations. arXiv preprint arXiv:2106.07345 (2021)
12. Kuzi, S., Zhang, M., Li, C., Bendersky, M., Najork, M.: Leveraging semantic and
lexical matching to improve the recall of document retrieval systems: A hybrid
approach. ArXiv abs/2010.01195 (2020)
13. Liu, F., Jiao, Y., Massiah, J., Yilmaz, E., Havrylov, S.: Trans-encoder: Unsuper-
vised sentence-pair modelling through self-and mutual-distillations. arXiv preprint
arXiv:2109.13059 (2021)
14. Liu, F., Vulić, I., Korhonen, A., Collier, N.: Fast, effective, and self-supervised:
Transforming masked language models into universal lexical and sentence encoders.
In: Proc. of the 2021 Conf. on Empirical Methods in NLP. pp. 1442–1459
15. Liu, L., Wu, Q., Chen, G.: Improving dense faq retrieval with synthetic training.
In: Proc. of the 7th IEEE Intl. Conf. on Network Intelligence and Digital Content.
pp. 304–308
12
Banerjee, Jain, Kulkarni
16. Liu, Y., Hashimoto, K., Zhou, Y., Yavuz, S., Xiong, C., Yu, P.: Dense hierarchi-
cal retrieval for open-domain question answering. In: Findings of the Assoc. for
Computational Linguistics: EMNLP 2021. pp. 188–200 (2021)
17. Manzoor, A., Jannach, D.: Towards retrieval-based conversational recommenda-
tion. CoRR abs/2109.02311 (2021)
18. Mazaré, P.E., Humeau, S., Raison, M., Bordes, A.: Training millions of personalized
dialogue agents. arXiv preprint arXiv:1809.01984 (2018)
19. Mesquita, T., Martins, B., Almeida, M.: Dense template retrieval for customer
support. In: Proc. of the 2022 Intl. Conf. on Computational Linguistics. pp. 1106–
1115
20. Qu, Y., Ding, Y., Liu, J., Liu, K., Ren, R., Zhao, W.X., Dong, D., Wu, H., Wang,
H.: Rocketqa: An optimized training approach to dense passage retrieval for open-
domain question answering. In: Proc. of the 2021 Conf. of the NAACL: HLT. pp.
5835–5847
21. Reimers, N., Gurevych, I.: Sentence-BERT: Sentence embeddings using Siamese
BERT-networks. In: Proc. of the 2019 Conf. on Empirical Methods in NLP and
the 9th Intl. Joint Conf. on NLP (EMNLP-IJCNLP). pp. 3982–3992
22. Ren, R., Qu, Y., Liu, J., Zhao, W.X., She, Q., Wu, H., Wang, H., Wen, J.R.:
Rocketqav2: A joint training method for dense passage retrieval and passage re-
ranking. In: Proc. of the 2021 Conf. on Empirical Methods in NLP. pp. 2825–2835
23. Robertson, S.E., Zaragoza, H.: The probabilistic relevance framework: BM25 and
beyond. Found. Trends Inf. Retr. 3(4), 333–389 (2009)
24. Sakata, W., Shibata, T., Tanaka, R., Kurohashi, S.: Faq retrieval using query-
question similarity and bert-based query-answer relevance. In: Proc. of the 2019
Intl. ACM SIGIR Conf. on Research and Development in Inf. Retr. pp. 1113–1116
25. Seo, J., Lee, T., Moon, H., Park, C., Eo, S., Aiyanyo, I.D., Park, K., So, A., Ahn,
S., Park, J.: Dense-to-question and sparse-to-answer: Hybrid retriever system for
industrial frequently asked questions. Mathematics 10(8) (2022)
26. Tseng, W.T., Wu, C.Y., Hsu, Y.C., Chen, B.: Faq retrieval using question-aware
graph convolutional network and contextualized language model. In: Proc. of the
2021 Asia-Pacific Signal and Information Processing Association Annual Summit
and Conference. pp. 2006–2012
27. Wohlwend, J., Elenberg, E.R., Altschul, S., Henry, S., Lei, T.: Metric learning
for dynamic text classification. In: Proc. of the 2019 Workshop on Deep Learning
Approaches for Low-Resource NLP. pp. 143–152
28. Wolf, T., Sanh, V., Chaumond, J., Delangue, C.: Transfertransfo: A transfer
learning approach for neural network based conversational agents. arXiv preprint
arXiv:1901.08149 (2019)
29. Yamada, I., Asai, A., Hajishirzi, H.: Efficient passage retrieval with hashing for
open-domain question answering. CoRR abs/2106.00882 (2021)
30. Zhang, X.F., Sun, H., Yue, X., Lin, S., Sun, H.: COUGH: A challenge dataset
and models for COVID-19 FAQ retrieval. In: Proc. of the 2021 Conf. on Empirical
Methods in NLP. pp. 3759–3769
|
|
http://arxiv.org/abs/2302.11950v1 | 2023-02-23T12:00:15 | 2023-02-23T12:00:15 | Evaluating the Efficacy of Skincare Product: A Realistic Short-Term
Facial Pore Simulation | Simulating the effects of skincare products on face is a potential new way to
communicate the efficacy of skincare products in skin diagnostics and product
recommendations. Furthermore, such simulations enable one to anticipate his/her
skin conditions and better manage skin health. However, there is a lack of
effective simulations today. In this paper, we propose the first simulation
model to reveal facial pore changes after using skincare products. Our
simulation pipeline consists of 2 steps: training data establishment and facial
pore simulation. To establish training data, we collect face images with
various pore quality indexes from short-term (8-weeks) clinical studies. People
often experience significant skin fluctuations (due to natural rhythms,
external stressors, etc.,), which introduces large perturbations in clinical
data. To address this problem, we propose a sliding window mechanism to clean
data and select representative index(es) to represent facial pore changes.
Facial pore simulation stage consists of 3 modules: UNet-based segmentation
module to localize facial pores; regression module to predict time-dependent
warping hyperparameters; and deformation module, taking warping hyperparameters
and pore segmentation labels as inputs, to precisely deform pores accordingly.
The proposed simulation is able to render realistic facial pore changes. And
this work will pave the way for future research in facial skin simulation and
skincare product developments. | [
"Ling Li",
"Bandara Dissanayake",
"Tatsuya Omotezako",
"Yunjie Zhong",
"Qing Zhang",
"Rizhao Cai",
"Qian Zheng",
"Dennis Sng",
"Weisi Lin",
"Yufei Wang",
"Alex C Kot"
] | 10.2352/EI.2023.35.7.IMAGE-276 | [
{
"@title": "doi",
"@href": "http://dx.doi.org/10.2352/EI.2023.35.7.IMAGE-276",
"@rel": "related",
"@type": null
},
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11950v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11950v1",
"@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"
] | Evaluating the Efficacy of Skincare Product: A Realistic Short-
Term Facial Pore Simulation
Ling Li1, Bandara Dissanayake2, Tatsuya Omotezako2, Yunjie Zhong1, Qing Zhang3, Rizhao Cai1, Qian Zheng4, Dennis Sng1, Weisi
Lin1, Yufei Wang5, Alex C Kot1;
1 Nanyang Technological University, Singapore; 2 The Procter & Gamble Company; 3 East China Normal University, China;
4 Zhejiang University, China; 5 China-Singapore International Joint Research Institute, China
3
2
0
2
b
e
F
3
2
]
V
C
.
s
c
[
1
v
0
5
9
1
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
Simulating the effects of skincare products on face is a po-
tential new way to communicate the efficacy of skincare products
in skin diagnostics and product recommendations. Furthermore,
such simulations enable one to anticipate his/her skin conditions
and better manage skin health. However, there is a lack of ef-
fective simulations today. In this paper, we propose the first sim-
ulation model to reveal facial pore changes after using skincare
products. Our simulation pipeline consists of 2 steps: training
data establishment and facial pore simulation. To establish train-
ing data, we collect face images with various pore quality indexes
from short-term (8-weeks) clinical studies. People often experi-
ence significant skin fluctuations (due to natural rhythms, exter-
nal stressors, etc.,), which introduces large perturbations in clin-
ical data. To address this problem, we propose a sliding window
mechanism to clean data and select representative index(es) to
represent facial pore changes. Facial pore simulation stage con-
sists of 3 modules: UNet-based segmentation module to localize
facial pores; regression module to predict time-dependent warp-
ing hyperparameters; and deformation module, taking warping
hyperparameters and pore segmentation labels as inputs, to pre-
cisely deform pores accordingly. The proposed simulation is able
to render realistic facial pore changes. And this work will pave
the way for future research in facial skin simulation and skincare
product developments.
Introduction
Consumers prefer smooth and flawless skin that makes them
look youthful and healthy. Skin texture plays a key role in the
perception of human facial beauty [1, 2]. However, skin texture
can appear rough and bumpy when facial pores enlarge. There are
various exogenous and endogenous factors, such as gender, race,
aging, and hormones that cause enlarged facial pores. Higher ca-
sual sebum levels in the nose and medial cheek area explain larger
pores observed from these areas [3, 4]. Skincare products for pore
care are widely available. Although there is a number of skin-
care diagnostic and recommendation capabilities available, to our
knowledge, there is a lack of effective simulations today that re-
flect true facial pore transformation using available skincare prod-
ucts. Therefore, this paper proposes a complete pipeline to sim-
ulate the facial pore changes across a short-term period. Tem-
poral analyses of changes in facial pores and simulation of these
changes are helpful for the consumers to dynamically understand
their skin and evaluate the potential benefit of skincare products.
Such a realistic simulation not only guides customers to buy the
right skincare products but also helps develop effective skincare
technologies. Additionally, facial pore simulation can play a role,
for example, in simulating the elongated effect of facial pores dur-
ing the aging process. It enriches aging signs and contributes to
the development of better aging models.
A realistic short-term simulation of the efficacy of skincare
products builds upon truthful clinical studies. Similar to [5], clin-
ical studies were conducted on 60 young Japanese females to re-
veal facial pore changes after applying specific skincare products
A and B (in product code). The eMR Pro devices, designed for
portable self-facial imaging with constant positioning and bright-
ness [5], were provided for participants to capture side-face im-
ages three times a day (morning after wake up; morning after face
wash; and evening after face wash). Facial pore changes correlate
with the initial skin condition, which varies among the 60 partic-
ipants. Following [6], various indexes are used to evaluate facial
pore condition and we observe large perturbations in the index
values due to daily skin fluctuations [5]. Based on this complex
clinical data, we expect first to select valuable index(es) that re-
flect facial pore changes before and after using skincare products,
regardless of different initial skin conditions. We further propose
a sliding window mechanism to reduce the data perturbations ef-
ficiently and get the data ready for training.
Our next step is to perform a facial pore simulation. To real-
istically simulate changes in facial pores while maintaining image
fidelity, we need to pay attention to three aspects: morphological
modification of all facial pores, precise control of the modifica-
tion to reflect the real changes, and the non-pore areas remain-
ing unchanged. Nowadays, GAN-based architectures [7, 8, 9]
are famous for generating high-quality images. However, these
methods have limitations in maintaining non-pore facial region
features. And the facial pore transformations after using skincare
products correlate with the initial condition, which is also chal-
lenging for GAN-based methods to capture such changes. From
Figure 1, we can see that GAN-based architecture is weak at sim-
ulating the detailed variation of facial pores (blurring effect in the
cheek area) and maintaining the non-pore facial features.
To address the above-mentioned challenges, we propose a
facial pore simulation model that consists of three modules: seg-
mentation module, regression module, and deformation module.
The segmentation module is to provide accurate spatial informa-
tion by detecting and localizing visible and enlarged facial pores.
Existing pore detection works [6, 10, 11, 12, 13, 14] take tradi-
tional approaches: setting threshold values carefully to segment
facial pore features. Clinical imaging devices, such as, Visia-CR
[6, 12] and Dermascore [11] are used to capture high-resolution
images at the same time to control lighting conditions and posture.
[10, 11, 12, 13, 14] are also limited to processing only small skin
regions instead of full faces due to the threshold mechanism. By
contrast, our UNet-based segmentation model is trained to learn
robust facial pore features and to detect visible and enlarged pores
in full side-face images. Our data-driven model detects pores with
different sizes & shapes, and it can handle images with different
lighting to a certain extent. In parallel, a random forest regres-
sion model is expected to learn the pattern of facial pore changes
over time from the training data and to further predict the time-
dependent warping hyperparameter. The warping hyperparame-
ter is to control the degree of facial pore deformation. Lastly, in
the deformation module, the local scaling warp method [33] is
modified to calculate a flow-field grid with taking pore segmenta-
tion labels and warping hyperparameters as inputs. The flow-field
grid assures that only facial pores are deformed, leaving the non-
pore facial region unchanged. The original input image is then
deformed accordingly to simulate facial pore changes after using
specific skincare products.
To summarize, the contributions of this work are as follows:
• We propose a suite of customized analytical tools to process
complex facial pore clinical data. We demonstrate that the
sliding window mechanism helps clean the data by reducing
perturbations due to significant skin fluctuations.
• We propose a facial pore simulation that consists of three
modules: segmentation module, regression module, and de-
formation module. We show that by incorporating facial
pore segmentation labels and predicted warping hyperpa-
rameters, the deformation module can precisely deform fa-
cial pores with accurate control, while leaving the rest of the
face unchanged.
• We propose a complete simulation pipeline that has two
steps:
training data establishment and facial pore sim-
ulation. Our results show that the simulation produces
high-quality images which demonstrate realistic facial pore
changes over time.
Related Work
Facial Pore detection
Facial pore detection is a challenging task as facial pores
are delicate with different shapes (circular or elongated) [12, 18]
& sizes (from 50 μm to 500 μm) [16].
It requires images to
be sharp enough to contain pore-level features. Existing works
[6, 11, 12, 13, 14, 15, 18, 19] require professional equipment to
capture high-quality facial skin in a fixed pose under consistent
light. [17, 19] only output the overall grading of facial pores. Tra-
ditional approaches are mainly used to detect facial pores: mark
pores on melanin layers derived from digital images [16, 20]; us-
ing the difference of Gaussian (DoG) filters [6]; based on Fast
fuzzy c-mean algorithm [14]. However, these methods are con-
strained to work on skin patches, and often perform poorly on
images with varied lighting. Our proposed UNet-based model is
capable of detecting skin pores on full side-face images with sat-
isfactory performance and addresses different lighting problems.
Figure 1: Sample results using a GAN-based method.
Face Simulation
Existing GAN-based works [21, 22, 23, 24, 25, 26] focus on
simulating the human face aging process. For instance, facial at-
tributes are used to guide wavelet-based GANs [24] to simulate
aging effect. [25] learns about people's age progression by un-
raveling subject-specific features and age-specific effects. Triple-
GAN [26] proposes to learn the interrelationships between differ-
ent age groups. Aging simulation is at a larger scale than simulat-
ing skin changes. To the best of our knowledge, no work has been
done to simulate the efficacy of skincare products on the face.
Methodology
Training Data Establishment
8-week clinical studies have been conducted on 60 young
Japanese females from 22 to 34 years old: they used product A
and/or B on the left/right side of their faces. Participants used
eMR Pro devices [5] connected to smartphones to capture side-
face images three times a day: morning after wake-up; morning
after face wash; evening after face wash. Various pore statistics
were measured using the method from [6]: pore count; total pore
area; mean pore area; pore shape; orientation; mean L*/a*/b*-
channel value in CIELAB color space. [5] examines the notice-
able fluctuations in the skin that people experience every day, es-
pecially with facial pores. We use similar approaches from [5]
to analyze these measured indexes while focusing on the 4-week
observation period with applying products A and B. Our dataset
consists of 12,531 images in total, and participants have different
initial skin conditions with diverse pore size scales (from grade
0 to grade 5) [18]. To observe the facial pore changes among
participants equally, we first normalize index value for every par-
ticipant. On each observation day, a mean value of each index
is computed to represent facial pore condition among the group.
This averaging operation is designed to consider the different ini-
tial skin conditions of 60 participants. Linear regression analysis
is then conducted to study index patterns before and after using
skincare products. Valuable index(es) are to be selected to repre-
sent facial pore changes. Considering people have different de-
grees of skin fluctuation across days, we propose a n-day sliding
window mechanism to reduce the data perturbations: gradually
group n-day values in 1-day steps and then remove extreme val-
ues by the n-day mean and standard deviation. In addition, we
observe that facial pore changes are developed slowly over the 4-
week period of using skincare products, and we propose to split
the 4-week observational duration into 3 discrete time windows to
investigate skincare efficacy. The cleaned dataset contains 3,025
images and each participant has multiple sets of images to reflect
their facial pore changes across time windows, which is used as
the training set to develop a facial pore simulation model.
GAN-based modelInputFigure 2: Pore Area total index analysis.
Facial Pore Simulation
UNet-based Facial Pore Segmentation
Pore segmentation labels lay the foundation for developing
a good simulation of facial pore changes. In contrast with exist-
ing threshold-based traditional works [6, 10, 11, 12, 13, 14], we
propose a deep learning-based data-driven model to detect visible
and enlarged facial pores on side-face images captured by smart-
phones. We use 9,506 out of 12,531 images as the segmentation
training set. It is time-consuming and labor-intensive if we were
to manually annotate facial pores. Additionally, the simulation
does not require exhaustive detection of facial pores. Hence, we
propose a new approach to generate satisfactory labels to improve
productivity. Inspired by [31], we use the Photocopy filter to ex-
tract facial details and then apply various post-processing opera-
tions to reduce excessive noise: morphological dilation and ero-
sion; setting thresholds for pore area, size [16], and shape [12, 18].
Lastly, the pore segmentation labels were manually checked and
the necessary refinements were made.
Witnessing the outstanding performance of UNet-based ar-
chitectures in medical image segmentation, we train a pore seg-
mentation model on 9,506 images using UNet [32] architecture.
By measuring the similarity between the predicted segmentation
label and the true segmentation label, the loss function penalizes
the model to learn in the optimal direction. We add cross entropy
loss and F1 score to form our loss function:
L = Cross Entropy + F1 Score.
(1)
Our selfie images are captured at 1920 x 1080 pixels. To avoid
large memory overhead over training, images are cropped into
patches with size of 256 x 256 with batch size of 24. RMSProp
optimization algorithm is used with learning rate = 1e-5, weight
decay = 1e-8, and momentum = 0.9.
Random Forest Regression
The regression module is to build up the relationship be-
tween the selected index and time window statistically. Our data
indicate that participants experience different facial pore transfor-
mations with varied initial skin conditions, making it challenging
to build an appropriate regression model. In addition, our data are
considerably large in size. Therefore, we exploit Random Forest
[28] as our regression model. Random Forest consists of a forest
Figure 3: Qualitative results of Facial Pore
Segmentation models.
of classifying decision trees: it selects a subset of data randomly
over training at each split and efficiently improves accuracy and
controls over-fitting by using average values based on all aggre-
gations [29, 30].
Facial Pore Deformation
Local scaling warp from [33] creates the possibility for pre-
cise manipulation. It achieves pixel-wisely manipulation by map-
ping points from input space to warping space without changing
the colors, and the mapping is computed by:
(cid:32)
fs(r) =
1 −
(cid:19)2
− 1
(cid:33)
a
r.
(cid:18) r
rmax
(2)
One minimum enclosing circle is found for each detected pore
and the radius of each enclosing circle is rmax. Variable r mea-
sures the distance between the target pixel and the center of the
enclosing circle, and parameter a controls the degree of deforma-
tion. Instead of implementing this method in an interactive man-
ner, a well-fit random forest regression model is trained to pre-
dict parameter a. Based on Equation 2, mappings for all detected
pores are gathered to compute a flow-field grid. Each size-2 vec-
tor in the flow-field grid is used to interpolate the corresponding
output value. The bilinear interpolation method is used here and
border values are used for out-of-bound grid locations. The face
deformation operation is also optimized and it takes only about
5-10 seconds to manipulate one full side-face image of size 1920
x 1080.
Results
Our complete simulation pipeline consists of 2 stages: train-
ing data establishment and facial pore simulation. First, we show
the analytical patterns of facial skin quality indexes over time.
Next, we present the evaluation for facial pore segmentation, ran-
dom regression, and facial pore simulation.
Training Data Establishment
Various indexes were measured in digital images. People's
skin fluctuates a lot within a day and/or from day to day, and
we can observe large data perturbations in pore quality index val-
ues. After careful analysis of the statistics, we observe that index
BaselineperiodObservation periodBaselineperiodObservation periodMorning after wake-upNormalized Index valueEvening after face washBaselineperiodObservation periodBaselineperiodObservation periodDayBaselineperiodObservation periodBaselineperiodObservation periodBaselineperiodObservation periodBaselineperiodObservation periodBaselineperiodObservation periodDayDayDayDayDayDayDayDayDayMorning after face washMorning after wake-upEvening after face washMorning after face washMorning after wake-upEvening after face washNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueMorning after face washNoSlidingWindow3-day SlidingWindow5-day SlidingWindowUNet-basedDoG- basedInputFigure 4: Qualitative result of Facial Pore Simulation.
Pore Area total demonstrates a jittery decreasing pattern across 3
time windows (shown in the first column in Figure 2), and this
pattern is consistent with the visual analysis by domain experts.
Index Pore Area total is then selected as the representative index
to reflect facial pore changes after skincare. With implementing
the sliding window mechanism in the observation period, outliers
are removed, and the data display fewer perturbations (shown
in the second and third columns of Figure 2). The 3-day slid-
ing window mechanism retains most data and it is then utilized
to clean the data. After splitting the 4 observation week into 3
time windows, we further investigate the changes in value of in-
dex Pore Area total. The box plot also shows a jittery decreasing
pattern in Figure 2, and it supports our observation.
Table 1: Qualitative Evaluation in Face Pore Segmentation
Metrics
Dice
IoU
Precision
Accuracy
UNet-based
0.6663
0.5139
0.6790
0.9936
DoG-based
0.4418
0.2851
0.4388
0.9896
Facial Pore Simulation
UNet-based Facial Pore Segmentation
A test set of 30 images is manually annotated for quantita-
tive evaluation of facial pore segmentation. These test images are
carefully selected from the cleaned facial pore simulation train-
ing set (consisting of 3,025 images), which considers different
facial pore conditions and lighting conditions. As existing works
are implemented in traditional threshold-based methods, we only
compare our UNet-based pore segmentation model with the DoG-
based method [6]. Multiple standard metric results in Table 1
show that the UNet-based segmentation model outperforms the
DoG-based methods by a large margin. Figure 3 shows the visual
comparison and we can conclude that our UNet-based segmenta-
tion model is capable of segmenting facial pores of different sizes
and shapes. The model is also performing well in facial cheek
area where we can observe specular effect in the first two input
images in Figure 3.
Random Forest Regression
Random forest regression is trained to learn the relationship
between metric Pore Area total and time windows. R2 Score and
Mean Average Error (MAE) are utilized here to evaluate regres-
sion performance. The results in Table 2 show the random forest
regression model fits well with low error.
Table 2: Random Forest Regression Analysis
Metrics
R2 Score
MAE
Time Window 1
0.9905
0.6344±2.20
Time Window 2
0.9941
0.6039±1.85
Time Window 3
0.9564
1.3498±5.12
Table 3: Quantitative Evaluation on Simulation Image Quality
Metrics
PIQE
NIQE
Simulation images
11.86
3.41
Facial Pore Deformation
As we have discussed previously, existing face simulation
methods focus on age regression and their evaluation metrics are
not applicable here. Similar to image super-resolution [34, 35],
face image quality is a significant factor to develop a high-quality
simulation system. In our dataset, side-face images are inevitably
misaligned even with using the eMR Pro devices [5]. In addition,
image registration methods do not work well for side-face images.
Therefore, we use No-Reference Image Quality Assessment (NR-
IQA) for evaluation: NIQE [36] and PIQE [37]. The detailed re-
sults in Table 3 indicate the high quality of the simulated images.
In Figure 4, we show qualitative results of our model simulating
the facial pore changes of 3 subjects after using skincare prod-
ucts. For each subject, the leftmost image shows the condition of
his skin before using skin care products. Real images shown in the
top row demonstrate his real skin condition after 10/20/30 days of
skincare. Correspondingly, the bottom row presents the simulated
skin condition of the facial pores for each time window (TW10,
TW20, TW30). As can be seen, our model captures the delicate
facial pore changes across the three time windows and modifies
the input image to reflect realistically his facial pore changes over
time. We can also observe that the model only modifies facial
pore appearance while leaving other facial features unchanged, as
shown in Figure 4.
Perception Study
We further conduct a perception study to evaluate our UNet-
based segmentation model and facial pore simulation model. To
be fair, we selected 40 images of facial pore segmentation results
with diverse pore conditions under different light conditions. Sim-
ilarly, 20 sets of simulation images were prepared.
We invited 30 respondents to this study: 15 women and 15
men, from ethnicity: Chinese and Indian. From the age range
graph in Figure 5, we can see that more than 90% of the respon-
Subject ASubject BSubject CTime Window:TW10TW20TW30TW10TW20TW30TW10TW20TW30Figure 5: Meta information of
respondents.
Figure 6: Respondents' Score on Facial
Pore Segmentation.
Figure 7: Respondents' Score on Facial
Pore Simulation.
dents are in their 20s, which is consistent with the young Japanese
participants in our clinical studies. In addition, we asked the re-
spondents to carefully self-assess their facial pore status with ref-
erence to a clinical standardized scale of pore size from [18]. The
pore size scale pie chart in Figure 5 shows that the facial pore sta-
tus is diverse among the 30 respondents, which shares a similar
distribution to our clinical study.
Facial Pore Segmentation
Respondents were to ask 3 questions when observing 40 pore
segmentation results:
* Q1: How do you observe the overall detection results?
(Choose one: Very Good; Good; Bad)
* Q2: Are there any incorrectly detected pores? (Choose one:
A few; Moderate; Many)
* Q3: Overall, how does the algorithm perform? (Choose one:
Very Good; Good; Fair; Poor; Very Poor)
The first and second questions are to evaluate the perfor-
mance of the UNet-based pore segmentation model in terms of
false negative and false positive respectively. Respondents an-
swered Q1 and Q2 for each image and grade the overall perfor-
mance in Q3 after viewing 40 images. As shown in Figure 6, 95%
of the responses show satisfaction with our pore detection results
(54% Very Good; 41% Good; and 5% Bad). In Q2, 60% of re-
sponses indicate there are a few false positives in segmentation
results and 35% indicate a moderate number of false positives.
Overall, more than 75% of the respondents feel good or very good
at facial pore segmentation, with no negative comments.
Facial Pore Simulation
Our simulation progressively predicts facial pore changes at
each time window. Respondents were invited to answer 3 ques-
tions by seeing 20 sets of images to evaluate each time window as
well as the entire process.
* Q1: Do the simulated images conform with the real im-
ages at TW10 (i.e., Time Window of 10-day using skin-
care)/TW20/TW30? (Choose one: Very Similar; Similar;
Different)
* Q2: Are you satisfied with the simulation of facial pore
changes over time? (Choose one: Very Satisfied; Satisfied;
Ambiguous; Unsatisfied; Very unsatisfied)
* Q3: Overall, how does the simulation perform? (Choose
one: Very Good; Good; Fair; Poor; Very Poor)
In Q1, respondents compared real and simulated images at
each time window and scored their similarity in terms of facial
pore condition only. And Q2 focused on whether the simulation
model captured the pattern of facial pore changes across time.
Respondents then graded the overall performance after viewing
20 sets of images in Q3. Figure 7 shows that more than 90% of
the responses vote that the simulated images are similar or very
similar to the real images at each time window. Over 80% of re-
spondents rate the simulated facial pore changes as satisfied or
very satisfied by looking at the 1-month duration. The bottom
plot from Figure 7 shows that 90% of the respondents (27 per-
sons) perceive that this simulation faithfully reflected the facial
pore changes over 4 weeks of skincare use.
Conclusion
In this paper, we present a realistic short-term facial pore
simulation model to evaluate the efficacy of skincare products.
We demonstrate that the sliding window mechanism is useful in
reducing data perturbations caused by daily fluctuations in skin.
The complex facial pore clinical data is then reorganized and pre-
pared for training. Moreover, to achieve a realistic simulation on
facial pores while maintaining image fidelity (i.e., the non-pore
facial areas remain unchanged), we propose a facial pore sim-
ulation that precisely localizes visible and enlarged facial pores
and further modify facial pores morphologically to reflect facial
pore changes after applying skincare product over a short-term.
Our method delivers promising results for facial pore segmenta-
tion and facial pore simulation.
Acknowledgements
This work was carried out at the Rapid-Rich Object Search
(ROSE) Lab, Nanyang Technological University (NTU), Singa-
pore. The research is supported in part by A*STAR under it's
A*STAR MBRC Strategic Positioning Fund (SPF) – A*STAR-
P&G Collaboration (Award APG2013/113) and in part by China-
Singapore International Joint Research Institute under Grant 206-
A018001. Any opinions, findings and conclusions or recommen-
dations expressed in this material are those of the author(s) and
do not reflect the views of the A*STAR.
50%,Male, 15 pax50%, Female, 15 paxGenderFemaleMaleGrade 04pax13.33%Grade 111pax36.67%Grade 27pax23.33%Grade 36pax20.00%Grade 41pax3.33%Grade 51pax3.33%Respondents Pore Size Scale Grade 0Grade 1Grade 2Grade 3Grade 4Grade 510pax18pax1pax1pax0.00%10.00%20.00%30.00%40.00%50.00%60.00%70.00%20-2425-2930-3435-39Number of RespondentAge ScopeAge Range0.00%0.00%16.67%73.33%3.33%0.00%10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%Very poorPoorFairGoodVery goodQuestion 3: Overall, how does the algorithm perform?Bad5%Good41%Very good54%Question 1: How do you observe the overall detection result?BadGoodVery goodMany5%Moderate35%A few60%Question 2: Are there any incorrectly detected pores?ManyModerateA few0.00%0.00%10.00%73.33%16.67%0.00%10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%Very poorPoorFairGoodVery goodQuestion 3: Overall, How does the simulation perform?71.33%57.17%51.17%24.83%36.33%42.00%3.83%6.50%6.83%0%20%40%60%80%100%TW10TW20TW30Question 1: Do the simulated image conform with the real image at TW10 / TW20 / TW30? Very similarSimilarDifferentVery unsatisfied1%Unsatisfied4%Ambiguous14%Satisfied44%Very satisfied37%Question 2: Are you satisfied with the simulation of facial pore changes over time?Very unsatisfiedUnsatisfiedAmbiguousSatisfiedVery satisfiedReferences
[1] B. Fink, K. Grammer, and R. Thornhill, "Human (Homo sapiens)
facial attractiveness in relation to skin texture and color.," Journal of
comparative psychology, 2001.
[19] F. Flament et al., 'An automatic procedure that grades some facial
skin structural signs: agreements and validation with clinical assess-
ments made by dermatologists', Int J Cosmet Sci, vol. 41, no. 5, pp.
472–478, Oct. 2019.
[2] S. Humphrey, S. Manson Brown, S. J. Cross, and R. Mehta, "Defin-
ing Skin Quality: Clinical Relevance, Terminology, and Assessment,"
Dermatol Surg, vol. 47, no. 7, pp. 974–981, Jul. 2021.
[20] Z. Wang and R. Li, 'Facial Pore Detection Based on Characteristics
of Skin Pigment Distribution', in 2019 IEEE International Confer-
ence on Image Processing (ICIP), Sep. 2019, pp. 4439–4443.
[3] S. J. Lee, J. Seok, S. Y. Jeong, K. Y. Park, K. Li, and S. J. Seo, "Facial
Pores: Definition, Causes, and Treatment Options," Dermatol Surg,
vol. 42, no. 3, pp. 277–285, Mar. 2016.
[21] C. Shi, J. Zhang, Y. Yao, Y. Sun, H. Rao, and X. Shu, 'CAN-GAN:
Conditioned-attention normalized GAN for face age synthesis', Pat-
tern Recognition Letters, vol. 138, pp. 520–526, Oct. 2020.
[4] E. Uhoda, C. Pi ́erard-Franchimont, L. Petit, and G. E. Pi ́erard, "The
Conundrum of Skin Pores in Dermocosmetology," DRM, vol. 210,
no. 1, pp. 3–7, 2005.
[22] X. Wu, Y. Zhang, Q. Li, Y. Qi, J. Wang, and Y. Guo, 'Face aging
with pixel-level alignment GAN', Appl Intell, vol. 52, no. 13, pp.
14665–14678, Oct. 2022.
[5] K. Miyamoto, B. Dissanayake, T. Omotezako, M. Takemura, G.
Tsuji, and M. Furue, "Daily Fluctuation of Facial Pore Area, Rough-
ness and Redness among Young Japanese Women; Beneficial Ef-
fects of Galactomyces Ferment Filtrate Containing Antioxidative
Skin Care Formula," Journal of Clinical Medicine, vol. 10, no. 11,
Art. no. 11, Jan. 2021.
[6] B. Dissanayake, K. Miyamoto, A. Purwar, R. Chye, and A. Mat-
subara, 'New image analysis tool for facial pore characterization
and assessment', Skin Research and Technology, vol. 25, no. 5, pp.
631–638, 2019.
[7] T. Karras, S. Laine, and T. Aila, 'A Style-Based Generator Architec-
ture for Generative Adversarial Networks'. arXiv, Mar. 29, 2019.
[8] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila,
'Analyzing and Improving the Image Quality of StyleGAN'. arXiv,
Mar. 23, 2020.
[9] T. Karras et al., 'Alias-Free Generative Adversarial Networks'. arXiv,
Oct. 18, 2021.
[10] Z. Wang, R. Li, and C. Bi, 'Image-based facial pore detection and
visualization in skin health evaluation', J. Vis., 2019.
[11] G. Franc ̧ois, A. Maudet, D. McDaniel, F. Giron, and R. Bazin,
'Quantification of Facial Pores Using Image Analysis', Cosmetic
Dermatology, vol. 22, no. 9, pp. 457–465, 2009.
[12] S. I. Jang, E. J. Kim, and H. K. Lee, 'A method of evaluating fa-
cial pores using optical 2D images and analysis of age-dependent
changes in facial pores in Koreans', Skin Res Technol, vol. 24, no.
2, pp. 304–308, May 2018.
[13] J. Y. Sun, S. W. Kim, S. H. Lee, J. E. Choi, and S. J. Ko, 'Automatic
facial pore analysis system using multi-scale pore detection', Skin
Res Technol, vol. 23, no. 3, pp. 354–362, Aug. 2017.
[14] Q. Zhang and T. Whangbo, 'Skin Pores Detection for Image-
Based Skin Analysis', in Intelligent Data Engineering and Automated
Learning – IDEAL 2008, Berlin, Heidelberg, 2008, pp. 233–240.
[15] B. Kim, J. Choi, K. Park, and S. Youn, 'Sebum, acne, skin elasticity,
and gender difference - which is the major influencing factor for facial
pores?', Skin Res Technol, vol. 19, no. 1, pp. e45–e53, Feb. 2013.
[16] V. Carlos, C. Joan, and V. C. Rodrigo, 'Using Skin Melanin Layer
for Facial Pore Identification in RGB Digital Images', IJETAE, vol.
4, no. 8, Aug. 2014.
[17] F. Flament et al., 'Artificial Intelligence analysis of over half a mil-
lion European and Chinese women reveals striking differences in the
facial skin ageing process', Acad Dermatol Venereol, vol. 36, no. 7,
pp. 1136–1142, Jul. 2022.
[18] A. Shaiek et al., 'A new tool to quantify the geometrical characteris-
tics of facial skin pores. Changes with age and a making-up procedure
in Caucasian women', Skin Res Technol, vol. 23, no. 2, pp. 249–257,
May 2017.
[23] F. Makhmudkhujaev, S. Hong, and I. K. Park, 'Re-Aging GAN: To-
ward Personalized Face Age Transformation', presented at the Pro-
ceedings of the IEEE/CVF International Conference on Computer Vi-
sion, 2021, pp. 3908–3917.
[24] Y. Liu, Q. Li, and Z. Sun, 'Attribute-Aware Face Aging With
Wavelet-Based Generative Adversarial Networks', in Proceedings of
the IEEE/CVF Conference on Computer Vision and Pattern Recogni-
tion, pp. 11877–11886, 2019.
[25] H. Yang, D. Huang, Y. Wang, and A. K. Jain, 'Learning Face Age
Progression: A Pyramid Architecture of GANs', in Proceedings of
the IEEE Conference on Computer Vision and Pattern Recognition,
pp. 31–39, 2018.
[26] H. Fang, W. Deng, Y. Zhong, and J. Hu, 'Triple-GAN: Progres-
sive Face Aging With Triple Translation Loss', in Proceedings of the
IEEE/CVF Conference on Computer Vision and Pattern Recognition
Workshops, pp. 804–805, 2020.
[27] V. Martin, R. S ́eguier, A. Porcheron, and F. Morizot, 'Face aging
simulation with a new wrinkle oriented active appearance model',
Multimed Tools Appl, vol. 78, no. 5, pp. 6309–6327, Mar. 2019,
[28] L. Breiman, 'Random Forests', Machine Learning, vol. 45, no. 1,
pp. 5–32, Oct. 2001,
[29] M. Fernandez-Delgado, E. Cernadas, S. Barro, and D. Amorim, 'Do
we Need Hundreds of Classifiers to Solve Real World Classification
Problems?', p. 49.
[30] J. L. Speiser, M. E. Miller, J. Tooze, and E. Ip, 'A comparison of
random forest variable selection methods for classification prediction
modeling', Expert Systems with Applications, vol. 134, pp. 93–101,
Nov. 2019,
[31] S.-Y. Chen, W. Su, L. Gao, S. Xia, and H. Fu, 'Deep Generation of
Face Images from Sketches'. arXiv, Jun. 04, 2020.
[32] O. Ronneberger, P. Fischer, and T. Brox, 'U-Net: Convolutional Net-
works for Biomedical Image Segmentation'. arXiv, May 18, 2015.
[33] A. Gustafsson, 'Interactive Image Warping', p. 65.
[34] W. Zhang, Y. Liu, C. Dong, and Y. Qiao, 'RankSRGAN: Generative
Adversarial Networks With Ranker for Image Super-Resolution'.
[35] Q. Meng, S. Zhao, Z. Huang, and F. Zhou, 'MagFace: A Univer-
sal Representation for Face Recognition and Quality Assessment', in
2021 IEEE/CVF Conference on Computer Vision and Pattern Recog-
nition (CVPR), Nashville, TN, USA, Jun. 2021, pp. 14220–14229.
[36] A. Mittal, R. Soundararajan, and A. C. Bovik, 'Making a "Com-
pletely Blind" Image Quality Analyzer', IEEE Signal Process. Lett.,
vol. 20, no. 3, pp. 209–212, Mar. 2013,
[37] V. N, P. D, M. C. Bh, S. S. Channappayya, and S. S. Medasani,
'Blind image quality evaluation using perception based features', in
2015 Twenty First National Conference on Communications (NCC),
Feb. 2015, pp. 1–6.
|
http://arxiv.org/abs/2302.11947v1 | 2023-02-23T11:44:43 | 2023-02-23T11:44:43 | Real-Time Damage Detection in Fiber Lifting Ropes Using Convolutional
Neural Networks | The health and safety hazards posed by worn crane lifting ropes mandate
periodic inspection for damage. This task is time-consuming, prone to human
error, halts operation, and may result in the premature disposal of ropes.
Therefore, we propose using deep learning and computer vision methods to
automate the process of detecting damaged ropes. Specifically, we present a
novel vision-based system for detecting damage in synthetic fiber rope images
using convolutional neural networks (CNN). We use a camera-based apparatus to
photograph the lifting rope's surface, while in operation, and capture the
progressive wear-and-tear as well as the more significant degradation in the
rope's health state. Experts from Konecranes annotate the collected images in
accordance with the rope's condition; normal or damaged. Then, we pre-process
the images, design a CNN model in a systematic manner, evaluate its detection
and prediction performance, analyze its computational complexity, and compare
it with various other models. Experimental results show the proposed model
outperforms other techniques with 96.4% accuracy, 95.8% precision, 97.2%
recall, 96.5% F1-score, and 99.2% AUC. Besides, they demonstrate the model's
real-time operation, low memory footprint, robustness to various environmental
and operational conditions, and adequacy for deployment in industrial systems. | [
"Tuomas Jalonen",
"Mohammad Al-Sa'd",
"Roope Mellanen",
"Serkan Kiranyaz",
"Moncef Gabbouj"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11947v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11947v1",
"@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"
] | Real-Time Damage Detection in Fiber Lifting
Ropes Using Convolutional Neural Networks
Tuomas Jalonen, Mohammad Al-Sa'd, Senior Member, IEEE, Roope Mellanen, Serkan Kiranyaz, Senior Member,
IEEE, and Moncef Gabbouj, Fellow, IEEE
1
3
2
0
2
b
e
F
3
2
]
V
C
.
s
c
[
1
v
7
4
9
1
1
.
2
0
3
2
:
v
i
X
r
a
Abstract-The health and safety hazards posed by worn crane
lifting ropes mandate periodic inspection for damage. This task is
time-consuming, prone to human error, halts operation, and may
result in the premature disposal of ropes. Therefore, we propose
using deep learning and computer vision methods to automate
the process of detecting damaged ropes. Specifically, we present
a novel vision-based system for detecting damage in synthetic
fiber rope images using convolutional neural networks (CNN).
We use a camera-based apparatus to photograph the lifting
rope's surface, while in operation, and capture the progressive
wear-and-tear as well as the more significant degradation in
the rope's health state. Experts from Konecranes annotate
the collected images in accordance with the rope's condition;
normal or damaged. Then, we pre-process the images, design a
CNN model in a systematic manner, evaluate its detection and
prediction performance, analyze its computational complexity,
and compare it with various other models. Experimental results
show the proposed model outperforms other techniques with
96.4% accuracy, 95.8% precision, 97.2% recall, 96.5% F1-score,
and 99.2% AUC. Besides, they demonstrate the model's real-
time operation,
low memory footprint, robustness to various
environmental and operational conditions, and adequacy for
deployment in industrial systems.
Index Terms-Computer vision, damage detection, deep learn-
ing, fiber rope, industrial safety.
I. INTRODUCTION
T RADITIONAL industries are transitioning to smart man-
ufacturing under the Industry 4.0 paradigm [1], [2].
This transition allows the use of recent advances in artificial
intelligence and computer vision to increase productivity and
improve manufacturing safety [3], [4]. Nonetheless, lifting
heavy payloads is still a major health and safety hazard in
many manufacturing environments [5]. For example, cranes
such as the one shown in Fig. 1 can move objects weighing
several metric tons; hence, inspecting its ropes for damage is
paramount to prevent serious accidents, injuries, and additional
costs [6]. More specifically, lifting ropes are major points of
This work was funded by Konecranes Plc as part of Business Finland and
DIMECC Intelligent Industrial Data Program. (Corresponding author: Tuomas
Jalonen.)
Tuomas Jalonen and Moncef Gabbouj are with the Faculty of Information
Technology and Communication Sciences, Tampere University, 33720 Tam-
pere, Finland (e-mail: [email protected]; [email protected]).
Mohammad Al-Sa'd is with the Faculty of Medicine, University of Helsinki,
00014 Helsinki, Finland (e-mail: [email protected]) and the
Faculty of Information Technology and Communication Sciences, Tampere
University, 33720 Tampere, Finland [email protected]).
Roope Mellanen is with Konecranes Plc, 05830 Hyvink ̈a ̈a, Finland (e-mail:
[email protected]).
Serkan Kiranyaz is with the Department of Electrical Engineering, Qatar
University, 2713 Doha, Qatar (e-mail: [email protected]).
Fig. 1. The fiber rope cranes used in this work. Photos are published with
permission from Konecranes [7].
failure that require periodic inspection and replacement [8].
However, manual inspection procedures are labor intensive,
time consuming, subjective, and often require halting the
production process [9], [10], [11]. Therefore, we propose a
novel real-time damage detection system for synthetic fiber
lifting ropes based on deep learning and computer vision
techniques.
The main contributions of this paper are:
• Developing the first fiber lifting rope image dataset.
• Proposing a deep learning based system for detecting
damage in fiber lifting rope images.
• Designing an industrial solution that achieves high per-
formance with a light memory footprint.
Lifting ropes are commonly manufactured from steel wires
or lately using synthetic fibers such as polyethylene [12].
Synthetic lifting ropes have many benefits over traditional steel
wire ropes. For example, they demonstrate higher resistance
to corrosion, do not require greasing, and are easier to install
[13]. Moreover, despite their higher purchase price, synthetic
fiber ropes are lightweight which allows utilizing smaller
cranes; leading to cost reductions [14]. However, synthetic
ropes, just as steel wires, do suffer from wear-and-tear and
get damaged over time. Common damage types in fiber
ropes are: strand cuts, abrasion, melting, compression damage,
pulled strands and inconsistent diameter. In contrast to steel
wires which tend to break from the inside [15], synthetic
rope damages manifest on the rope's surface and can be
visually inspected by an expert [14]. Currently, monitoring
the condition of synthetic fiber ropes is performed manually by
inspectors following the ISO-9554 standard [9], [10]. Although
it
this procedure is cumbersome,
discontinuous in time, interrupts operation, and may result
in the premature disposal of ropes [11]. Therefore, automatic
is the standard practice,
2
damage detection by leveraging the recent advancements in
computer vision, image processing, and deep learning tech-
niques is needed [14]. On the one hand, image processing and
related feature extraction methods utilize expert knowledge
and attempt to characterize damage in rope images similar to
the ones identified by expert inspectors [16]. These techniques
generally perform well in a controlled environment, but they
poorly integrate the varying conditions and operations found in
a real-life setting e.g., noise, lighting conditions, oil residue,
and dust [17], [18]. On the other hand, deep learning tools
discard the notion of hand-crafted features by learning abstrac-
tions that maximize the detection of damaged ropes. In fact,
they yield discriminatory features without predisposition to
the standard markings and can accommodate a wider range of
environmental and/or operational conditions [17]. Therefore,
deep learning techniques are more suited to detect damage
in synthetic fiber rope images compared to engineering-based
feature extraction methods.
The construct of damage indicators in fiber ropes was first
articulated in [11] where changes in the rope's width and
length were found to be important. This particular finding was
verified in [19] using computer vision and thermal imaging;
however, explicit identification for damaged ropes was not
performed. In fact, detecting damage in synthetic fiber rope
images has received less attention in the literature compared
to steel wire cables. Fortunately, these detection techniques
are suitable for adoption due to the similarity between the
two problems; they both deal with detecting damaged yarns
or strands in rope images. For instance, the health condi-
tion of balancing tail ropes was monitored in [20] using a
convolutional neural network (CNN). The rope image was
to classify its
captured and then fed to the CNN model
health state as either normal, or if it suffers from one out
of eight common damage types. Moreover, a CNN-based
approach was designed in [21] to detect surface defects in
steel wire rope images. The model classified the acquired
images into normal, broken, or damaged, and achieved a
99.7% overall accuracy. The same problem was tackled in
[22] using support vector machines trained with texture-based
hand-crafted features. The proposed system achieved a 93.3%
classification accuracy and it was further improved in [23]
to reach 95.9%. Nonetheless, the limited sample size and the
reliance on hand-crafted features hampered robustness in noisy
environments. This was evidenced in [24] which showed that
the model accuracy drops to 80.5% when training/testing with
a different dataset. Moreover, the utility of CNNs combined
with image processing techniques was shown to increase the
accuracy of the model in [22] from 93.3% to 95.5% [18]. This
has motivated us to design a CNN-based solution for detecting
damage in synthetic fiber rope images. However, our proposed
solution will be developed to have both high performance and
low computational requirements, allowing for easy integration
into industrial systems and efficient deployment [25].
The rest of this paper is organized as follows: section
II describes our methodology for building the experimental
setup, collecting data, designing the damage detection system,
and evaluating its performance. Afterwards, we present and
discuss the system's performance and compare it to various
other models in section III. Finally, section IV concludes the
paper and suggests topics for future research.
II. METHODOLOGY
The proposed fiber
rope damage detection system is
overviewed in Fig. 2 and consists of the following stages:
1) Setup an experimental apparatus with a three-camera
circular array to photograph the ropes' surface area.
2) Collect the captured images and label them as normal
or damaged according to the ropes' health condition.
3) Preprocess the collected images to enhance contrast and
down-sample to reduce computational complexity.
4) Split the pre-processed images into train and test sets in
a 5-fold cross-validation fashion.
5) Train and test a classification model on the train and test
folds, respectively, and repeat for every data split.
6) Evaluate and analyze the model's fold-averaged perfor-
mance using various metrics.
The design process undertaken in this work is governed by
the following requirements:
• High performance in detecting damaged ropes and ro-
bustness to different environmental and operational con-
ditions.
• Lightweight for implementation and deployment.
• Remote sensing by neither interfering with the crane
operation nor the rope structure.
• Modularity to facilitate maintenance, upgrades, and com-
patibility with IoT and edge devices.
The remaining subsections discuss and detail each stage in the
proposed system.
A. Experimental setup
The experimental
setup was built and operated by
Konecranes and the following experiment was repeated for
three different synthetic fiber ropes; see Table I for the ropes'
properties. First, the crane illustrated in Fig. 1 was set to
continuously lift a payload of 5 metric tons in a controlled
setting. The payload lifting height was approximately 5 meters
and during a lifting cycle, the crane was stopped at the top
and bottom (payload resting on the floor). After that, a circular
camera array, comprised of three RGB cameras placed at
120° apart, was used to capture approximately 13 mm of the
lifting rope. The camera framerate was selected such that
subsequent rope images have roughly 1/3 spatial overlap,
resulting in 20 meters of rope being photographed during a
lifting cycle. Finally, the crane lifting and rope imaging steps
were repeated for weeks to cover the ropes' lifespan; from
new to unusable.
B. Data collection
The rope imaging experiment generated 4,984,000 high-
resolution photos; each being tagged with a timestamp and the
rope's imaged position. The raw photos were then screened for
duplicates by discarding images that examined the same rope
position. In other words, we ensured that images for the same
rope position would be distinct by capturing different health
3
Fig. 2. The proposed vision-based damage detection system for synthetic fiber lifting ropes. The system is comprised of the following stages: (1) experimental
setup with a three-camera circular array to capture rope images; (2) collection and annotation of the captured images; (3) preprocessing to enhance quality
and down-sampling to reduce complexity; (4) data splitting into 5-fold training and testing sets; (5) training/testing the proposed deep learning model; and
(6) evaluating and analyzing the system's performance and computational complexity.
TABLE I
THE FIBER LIFTING ROPE PROPERTIES.
Diameter
12 mm
Material
Ultra high molecule weight polyethylene
Type
Strength
Weight
Coating
12-strand braided rope
15.4 metric tons (ISO 2307)
8.8 kg / 100 meters
Abrasion and ultra-violet resistance
conditions. This is important to avoid cross-contamination in
data splits. After that, we selected 143,000 random samples
and experts from Konecranes labeled them as normal or
damaged according to the lifting rope health condition. Out
of those images, 10,000 samples were labeled as damaged.
Finally, to avoid data imbalance issues, we formed a balanced
dataset containing 20,000 samples; 10,000 images from each
class. The collected dataset is available from Konecranes and
it was used under license for this study1.
C. Preprocessing and data splitting
The annotated high-resolution rope images were down-
sampled to 256 × 256 × 3 pixels. After that, we enhanced
the photos' contrast via histogram equalization [26]; see Fig.
3 for a sample, and we standardized the pixel values to
range between 0 and 1. Finally, the pre-processed images
were randomly divided into five equally sized portions while
maintaining class balance (5-fold stratified cross-validation);
see stage 4 in Fig. 2. In other words, each split had 16,000
(8,000 damaged and 8,000 normal) and 4,000 (2,000 damaged
and 2,000 normal) images for training and testing, respectively.
Fig. 4 demonstrates samples of normal and damaged ropes
1Please contact Roope Mellanen at [email protected] for
data inquiry.
(a) Raw sample.
(b) Histogram equalized sample.
Fig. 3. Histogram equalization for an example rope image.
from the acquired dataset. By examining the images, one
notes a significant variation in the clarity of the rope's health
state and in the severity of the damage. For example, Fig.
4a conveys a more damaged rope when compared to the
one presented in Fig. 4e. However, the damage can also be
minuscule without clear visual indications as presented in Fig.
4d. Finally, the dirt and oil stains found in most rope images
present a challenge for any vision-based tool.
D. Proposed deep learning model
The collected rope images constitute an over-complete de-
scription for the rope as a whole; hence, the problem of dam-
age detection reduces to classifying each image independently.
We designed a lightweight CNN architecture to classify the
fiber lifting rope images, and we tested different variants to
find the best performing model.
The architecture design starts with a convolutional layer (3×3
kernel with ReLU activation) to extract preliminary feature
maps from the input images. After that, those initial features
are passed through a number of blocks each consisting of
the following sequential elements: (1) convolutional layer to
Experimental SetupData CollectionPreprocessing1Proposed Deep Learning ModelData SplittingTestTrainSplit 1Fold1Fold 2Fold 3Fold 4Fold 5Split 2Fold 1Fold 2Fold 3Fold 4Fold 5Split 3Fold 1Fold 2Fold 3Fold 4Fold 5Split 4Fold 1Fold 2Fold 3Fold 4Fold 5Split 5Fold 1Fold 2Fold 3Fold 4Fold 52345Performance Evaluation and Analysis64
(a) Damaged.
(b) Damaged.
(c) Damaged.
(d) Damaged.
(e) Damaged.
(f) Normal.
(g) Normal.
(h) Normal.
(i) Normal.
(j) Normal.
Fig. 4. Example images from the acquired dataset show significant variation in the severity and clarity of damages because of dirt and oil stains. The first
row (a)-(e) show damaged ropes while the second row (f)-(j) present some healthy samples.
extract features (3 × 3 kernel with ReLU activation), (2) Max
Pooling to down-sample the features (2 × 2 kernel), (3) and
dropout to regularize the network by reducing the neurons'
interdependent learning (0.4 rate). Finally, the learned ab-
stractions are flattened and passed through a dropout layer
(0.4 rate), a fully connected layer (20 nodes), another dropout
layer (0.2 rate), and lastly, a binary classification layer with a
Softmax activation function. In this work, 16 model variants
were generated from this architecture by altering the number
of blocks (1, 2, or 3), input image sizes (16 × 16, 32 × 32, or
64 × 64), and the input image color state (color or grayscale);
see Appendix A for the model variants' structure and Table II
for details on the variant that we selected for further analysis
and comparison.
The models' training was performed for 200 epochs using
an Adam optimizer [27] to minimize the cross-entropy loss
regularized by a weight decay to reduce overfitting [28], [29],
i.e.:
L = −y log(ˆy) − (1 − y) log(1 − ˆy) + λ||w||2
2 ,
(1)
where L denotes the regularized loss, y and ˆy are the true and
predicted labels, respectively, λ = 5 × 10−4 is the selected L2
regularization rate, and w is the network's weight matrix [28].
Moreover, the training batch size was set to 32 and to ensure
convergence the learning rate was decayed by [30]:
η(n) =
10−3
10−4
10−5
10−6
: n ≤ 120
: 120 < n ≤ 150
: 150 < n ≤ 180
: 180 < n ≤ 200
,
(2)
where η is the learning rate and n is the epoch number.
This training process was conducted for each model using the
train set in each data split (five training sets). Additionally,
TABLE II
THE CNN9 MODEL VARIANT ARCHITECTURE.
Block #
Layer
Information
Output shape
Parameters
-
1
2
-
Conv
Conv
MaxPool
Dropout
Conv
L2 Kernel reg. = 0.0005
Kernel = 3 × 3
Activation = ReLU
L2 Kernel reg. = 0.0005
Kernel = 3 × 3
Activation = ReLU
30 × 30 × 64
1,792
28 × 28 × 64
36,928
Pool = 2 × 2
14 × 14 × 64
Rate = 0.4
14 × 14 × 64
0
0
L2 Kernel reg. = 0.0005
Kernel = 3 × 3
Activation = ReLU
12 × 12 × 64
36,928
MaxPool
Pool = 2 × 2
Dropout
Flatten
Dropout
Dense
Dropout
Rate = 0.4
-
Rate = 0.4
Activation = ReLU
Rate = 0.2
Dense
Activation = Softmax
Total number of parameters
6 × 6 × 64
6 × 6 × 64
2,304
2,304
20
20
2
0
0
0
0
46,100
0
42
121,790
apart from the generated variants, we also trained the following
three baseline models for comparison; Zhou et al. (2019) [21],
Zhou et al. (2021) [18], and Schuler et al. (2022) [31]. Detailed
description on these models can be found in Appendixes B-D.
E. Performance evaluation and analysis
The trained models were evaluated using the test set in each
data split (five test sets). Their performance was analyzed
by various tools and metrics to quantify their fold-averaged
detection, prediction, and misclassification outcomes.
1) Classification: we quantified the models' classification
performance by accuracy, precision, recall, false positive rate
(FPR), and the F1-score, i.e.:
other words, given large enough training samples, if the Grad-
CAM and t-SNE show genuine learning and clear separability,
one may infer the model adequacy for unseen samples.
5
Accuracy =
T P + T N
T P + T N + F P + F N
,
Precision =
T P
T P + F P
,
Recall =
FPR =
T P
T P + F N
,
F P
F P + T N
,
F1-score = 2
(cid:18) Precision × Recall
Precision + Recall
(cid:19)
,
(3)
(4)
(5)
(6)
(7)
where T P , T N , F P , and F N are true positives, true neg-
atives, false positives, and false negatives, respectively (posi-
tive/negative denotes a damaged/normal rope).
Moreover, we used the area under the averaged receiver
operating curve (AUC) and confusion matrices to fully char-
acterize the classification quality. The AUC was computed by
averaging linearly interpolated receiver operating curves.
2) Prediction: we assessed the models' predictive capacity
using Gradient-weighted Class Activation Mapping (Grad-
CAM) which uses gradients of the last convolutional layer to
measure the relevance of the input image pixels for classifi-
cation [32]. Specifically, Grad-CAM yields a distribution with
high values for pixels that contributed more to the outcome.
Furthermore, we utilized t-Distributed Stochastic Neighbor
Embedding (t-SNE); a dimensionality reduction method that
clusters similar high dimensional samples and departs dissim-
ilar ones in two- or three-dimensional space [33]. In specific,
given an array of learned features x = [x1, x2, * * * , xN ], the
similarity between features i and j can be measured by:
pij =
pj|i + pi|j
2N
,
pj|i =
(cid:40) exp(−||xi−xj ||2/2σ2
i )
(cid:80)
k(cid:54)=i exp(−||xi−xk||2/2σ2
i )
0
(8)
(9)
: i (cid:54)= j
: i = j
,
i,j pij = 1, (cid:80)
where pij is a probabilistic measure for the similarity between
xi and xj, (cid:80)
j pj|i = 1, and σi is the adaptive
Gaussian kernel bandwidth. Now, t-SNE aims to learn the
two- or three-dimensional map y = [y1, y2, * * * , yN ] with
a probabilistic similarity qij that resembles pij, i.e. [33]:
qij =
(cid:80)
(1 + ||yi − yj||2)−1
k(cid:54)=l(1 + ||yk − yl||2)−1 .
(10)
The similarity matching between qij and pij in t-SNE is
maximized by minimizing the Kullback–Leibler divergence of
pij from qij via gradient descent, i.e.:
(cid:88)
i(cid:54)=j
min
yi
pij log
(cid:19)
.
(cid:18) pij
qij
(11)
Both the Grad-CAM and t-SNE help in characterizing the
models' predictive power when supplied with new data. In
3) Misclassification: visualizing the model's misclassified
samples is paramount for interpretability and for outlining
performance caps. Moreover, it enables a better understanding
for the model's weaknesses and for identifying human errors
in annotation. For example, by assuming some error in the
labeling process, the performance of a genuine model will be
limited, or capped, by the labels' quality.
F. Computational complexity
The complexity of the models was assessed by their total
number of trainable parameters, required input image size, the
models' memory size requirement, processing time, and their
processing rate (frame rate). We analyzed their computational
complexity by Monte-Carlo simulations where we fed the
models with 4,000 test samples, predicted their health state
(normal or damaged), and repeated the process ten times for
validation. Note that this process does not include the imaging,
data loading, nor preprocessing stages. It only quantifies the
models' inference complexity. We used an Apple MacBook
Pro with an ARM-based M1 Pro chip, 10-core CPU, integrated
16-core GPU, 16-core neural engine, and 16 GB of RAM.
The experiments' codes were written in Python 3.9.7 using
Tensorflow 2.7.0 and are publicly available.
III. RESULTS AND DISCUSSION
A. Model selection
The best model, out of the 16 generated variants, was
selected based on its ability to balance between precision
and recall with minimum computational requirements. By
examining the results in Table III, one notes that the model
variants CNN9 and CNN15 yield the highest 5-fold averaged
precision/recall balance (96.5% average). Besides, they are
the top-2 models in terms of accuracy, precision, F1-score,
and AUC. Nevertheless, due to the apparent disparity in
computational resources (input image sizes: 32 × 32 × 3 v.s.
64×64×3), we opted for model CNN9 and used it for further
analysis and comparison. Note that "Proposed CNN" refers to
the CNN9 variant in the remaining of this paper.
B. Performance analysis
Fig. 5 compares the training and testing accuracy/loss curves
(averaged over the data splits) of the proposed CNN to the
three baseline models. The results show the curves converging
successfully after epoch 150, and the learning rate decay,
scheduled at epoch 151, has ensured stability by suppress-
ing perturbation. This indicates that the training phase was
executed long enough and was not terminated prematurely.
Moreover, by examining the difference between the training
and testing accuracy/loss curves one notes that
the three
baseline models exhibit further overfitting when compared to
the proposed network, with Schuler et al. (2022) being the
extreme case, followed by Zhou et al. (2019), and lastly, Zhou
6
(a) Zhou et al. (2019).
(b) Zhou et al. (2021).
(c) Schuler et al. (2022).
(d) Proposed CNN.
Fig. 5. Comparing the models' training and testing accuracy/loss curves averaged over the data splits in solid/dotted lines.
TABLE III
THE PROPOSED CNN MODEL VARIANTS' TESTING PERFORMANCE IN
TERMS OF ACCURACY, PRECISION, RECALL, FNR, F1-SCORE, AND AUC.
THE RESULTS ARE SUMMARIZED BY THEIR 5-FOLD AVERAGED
PERCENTAGES, ± STANDARD DEVIATIONS, AND THE SELECTED BEST
MODEL VARIANT IS HIGHLIGHTED IN BOLD.
Variant #
Accuracy
Precision
Recall
FNR
F1-score
AUC
CNN1
CNN2
CNN3
CNN4
CNN5
CNN6
CNN7
CNN8
CNN9
CNN10
CNN11
CNN12
CNN13
CNN14
CNN15
CNN16
94.8 ± 0.4
93.9 ± 0.2
95.9 ± 0.7
4.1 ± 0.7
94.9 ± 0.4
98.4 ± 0.1
94.0 ± 0.5
93.8 ± 1.0
94.2 ± 0.8
5.8 ± 0.8
94.0 ± 0.4
98.1 ± 0.2
96.0 ± 0.4
95.8 ± 0.3
96.3 ± 0.8
3.7 ± 0.8
96.1 ± 0.4
99.1 ± 0.1
95.7 ± 0.3
95.2 ± 0.7
96.3 ± 0.5
3.7 ± 0.5
95.7 ± 0.3
99.0 ± 0.1
95.2 ± 0.2
95.0 ± 0.3
95.5 ± 0.5
4.5 ± 0.5
95.2 ± 0.2
98.5 ± 0.1
95.7 ± 0.3
95.1 ± 0.5
96.4 ± 0.1
3.6 ± 0.1
95.8 ± 0.3
98.8 ± 0.1
94.3 ± 0.6
91.7 ± 1.5
97.5 ± 0.7
2.5 ± 0.7
94.5 ± 0.5
98.6 ± 0.1
96.4 ± 0.3
95.8 ± 0.4
97.0 ± 0.4
3.0 ± 0.4
96.4 ± 0.3
99.0 ± 0.2
96.4 ± 0.5
95.8 ± 0.5
97.2 ± 0.8
2.8 ± 0.8
96.5 ± 0.5
99.2 ± 0.1
96.1 ± 0.3
95.5 ± 0.2
96.9 ± 0.6
3.1 ± 0.6
96.2 ± 0.3
99.1 ± 0.2
95.0 ± 0.1
94.6 ± 0.5
95.5 ± 0.4
4.5 ± 0.4
95.0 ± 0.1
98.4 ± 0.1
95.9 ± 0.2
95.2 ± 0.5
96.7 ± 0.5
3.3 ± 0.5
95.9 ± 0.2
98.8 ± 0.2
95.4 ± 0.5
93.7 ± 1.0
97.3 ± 0.8
2.7 ± 0.8
95.4 ± 0.4
98.9 ± 0.1
96.2 ± 0.4
95.9 ± 0.6
96.5 ± 0.4
3.5 ± 0.4
96.2 ± 0.4
99.0 ± 0.2
96.5 ± 0.3
95.8 ± 0.5
97.2 ± 0.3
2.8 ± 0.3
96.5 ± 0.3
99.1 ± 0.2
96.4 ± 0.2
94.9 ± 0.4
98.0 ± 0.5
2.0 ± 0.5
96.4 ± 0.2
99.2 ± 0.1
et al. (2021). We argue that this is caused by the unnecessary
high number of parameters which hinder generalization.
The models' testing performance for detecting damaged
rope images is demonstrated in Table IV and Fig. 6. The
measures in Table IV show that the Zhou et al. (2021) model
has the highest recall at 97.9%, which is the most important
metric in order to prevent accidents. However, its precision,
at 90.3%, is relatively low suggesting that the model labels
most rope images as damaged, making it unpractical for a
real-life setting. Moreover, both the Schuler et al. (2022)
and the proposed models yield similar recall levels (97.1%
and 97.2%, respectively). Nevertheless, the proposed CNN
results in higher accuracy, precision, and F1-score with 2.3,
4.2, and 2.2 percentage point gains, respectively. In addition,
it demonstrates a better precision/recall trade-off, which is
reflected by the averaged ROC curve in Fig. 6 along with
its AUC value (99.2%). Finally, the results suggest that the
Zhou et al. (2019) and Schuler et al. (2022) models are not
the best in any of the six metrics.
Fig. 6. The models' 5-fold averaged ROC curves alongside their computed
AUC values. The corner portion is magnified to ease visualization.
C. Computational complexity analysis
Table V summarizes the complexity analysis results which
indicate that the proposed model is the fastest one requiring
approximately 19 milliseconds per input image and running
in real-time at 54 fps. Nonetheless, it is important to note
that Zhou et al. (2019) and (2021) models are comparatively
fast, but the Schuler et al. (2022) operates below real-time
the listed prediction speeds could be
at 12 fps. Besides,
the
further improved by running them in C++. However,
most notable and important difference is the proposed model's
lighter memory footprint. In specific, our model accepts small-
sized images and requires less disk space for storage. These
advantages can lead to savings in equipment and operational
costs, improve latency, and mitigate privacy issues by not using
cloud services.
D. The Grad-CAM and t-SNE analysis
The Grad-CAM and t-SNE results are depicted in Figs. 7
and 8, respectively. In Fig. 7, we generated the Grad-CAM
heatmap for two example images showing damaged ropes that
were correctly classified by the proposed model. The results
show that our CNN model is indeed focusing on the intuitively
relevant parts of the input image, which are the broken strands.
One also notes that the network does not focus on the ropes'
oil and dirt residue as demonstrated in Fig. 7b. This suggests
genuine learning by the model and robustness to environmental
0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0.00.20.40.60.81.0False positive rate0.00.20.40.60.81.0True positive rateProposed CNN, AUC = 0.992Zhou et al. (2019), AUC = 0.971Zhou et al. (2021), AUC = 0.986Schuler et al. (2022), AUC = 0.987TABLE IV
THE MODELS' TESTING PERFORMANCE IN TERMS OF T P , T N , F P , AND F N PRESENTED IN A CONFUSION MATRIX FASHION, ALONG WITH THEIR
ACCURACY, PRECISION, RECALL, FNR, AND F1-SCORE. THE CONFUSION MATRIX ENTRIES ARE ACCUMULATED FROM THE 5-FOLDS, THE REMAINING
RESULTS ARE SUMMARIZED BY THEIR 5-FOLD AVERAGE PERCENTAGES, ± STANDARD DEVIATIONS, AND THE BEST OUTCOMES ARE SHOWN IN BOLD.
7
Zhou et al. (2019)
Zhou et al. (2021)
Schuler et al. (2022)
Proposed CNN
T N
F N
F P
T P
8,641
355
1,359
9,645
8,933
215
1,067
9,785
9,107
293
893
9,707
9,570
281
430
9,719
Accuracy
Precision
Recall
FNR
F1-score
AUC
91.4 ± 2.7
87.7 ± 3.1
96.4 ± 2.5
3.6 ± 2.5
91.9 ± 2.6
97.1 ± 2.4
93.6 ± 1.7
90.3 ± 3.5
97.9 ± 1.0
2.2 ± 1.0
93.9 ± 1.53
98.6 ± 0.1
94.1 ± 1.1
91.6 ± 2.2
97.1 ± 1.0
2.9 ± 1.0
94.3 ± 0.9
98.7 ± 0.2
96.4 ± 0.5
95.8 ± 0.5
97.2 ± 0.8
2.8 ± 0.8
96.5 ± 0.5
99.2 ± 0.1
TABLE V
THE MODELS' COMPUTATIONAL COMPLEXITY IN TERMS OF THEIR TOTAL NUMBER OF PARAMETERS, INPUT IMAGE SIZE REQUIREMENT, MODEL SIZE,
AVERAGE PROCESSING TIME ± STANDARD DEVIATION IN MILLISECONDS, AVERAGE PROCESSING RATE IN FPS, AND AVERAGE TRAINING TIME PER
EPOCH ± STANDARD DEVIATION IN SECONDS.
Zhou et al. (2019)
Zhou et al. (2021)
Schuler et al. (2022)
Proposed CNN
No. of parameters
Image size
Model size
12.8 M
3.57 KB
154 MB
498 K
7.46 KB
6.28 MB
371 K
2.84 KB
18.5 MB
122 K
2.84 KB
1.73 MB
Processing time
20.7 ± 4.2 ms
20.1 ± 4.2 ms
82.7 ± 18.0 ms
18.7 ± 3.6 ms
Processing rate
48.3 fps
49.8 fps
12.1 fps
53.5 fps
Training time per epoch
17.7 ± 0.39 s
18.3 ± 0.11 s
183.4 ± 4.47 s
14.8 ± 0.06 s
(a) Example 1.
(b) Example 2.
Fig. 7. The proposed CNN Grad-CAM heatmaps for two correctly classified
damaged ropes. The heatmaps indicate the model's adequacy by focusing on
the pixels that are relevant for detecting damage. We used the model's last
convolutional layer features as input to the Grad-Cam algorithm.
and operational conditions. However, it is important to note
that the CNN still slightly focuses on the image background.
Moreover, the t-SNE results in Fig. 8 demonstrate good class
separation, but they also show a need for verifying some
ground-truth labels. In specific, the t-SNE shows few rope
images labeled as normal within the damaged rope support.
E. Misclassifications
Two example prediction errors by our CNN are presented
in Fig. 9. The rope in Fig. 9a is labeled as damaged, but
Fig. 8. The proposed CNN t-SNE results showing good separation between
the two classes. We used the model's last layer features (FC[20] in Table A.1)
as input to the t-SNE algorithm.
predicted as normal, while the one in Fig. 9b is labeled as
normal, but predicted as damaged. Such instances pose a
challenge for the system because they are clearly in between
the two classes; they are slightly worn with a few broken
strings, but strictly not damaged, according to our experts.
Despite that, these ropes are not likely to break at these spots
and they would be classified as damaged after more wear.
Moreover, the similarities between the two images suggest
0.00.20.40.60.81.00.00.20.40.60.81.0NormalDamaged8
(a) True: Damaged, Predicted: Normal.
(b) True: Normal, Predicted: Damaged.
Fig. 9. Two example misclassification samples by the proposed CNN.
possible annotation errors which may prevent the proposed
model from reaching its full potential. Nonetheless, human
errors are expected, and the model outcome still shows good
potential and applicability.
IV. CONCLUSIONS
Damaged lifting ropes are a major safety hazard in manufac-
turing, cargo loading/unloading, and construction because they
can lead to serious accidents, injuries, and financial losses. The
visual inspection of damage in synthetic lifting ropes is a time-
consuming task, interrupts operation, and may result in the
premature disposal of ropes. Therefore, combining computer
vision and deep learning techniques is intuitive for automation
and advancement.
This work presents a novel vision-based deep learning so-
lution for detecting damage in fiber lifting rope images. First,
we built a three-camera circular array apparatus to photograph
the rope's surface. Afterward, the rope surface images were
collected in a database, annotated by experts, preprocessed
to improve contrast, and split into train and test sets in a
5-fold cross-validation fashion. Moreover, we systematically
designed a CNN-based model to classify damaged rope im-
ages, evaluated its detection and prediction performance using
various tools, and compared it to three different baseline mod-
els. Additionally, we analyzed its computational complexity in
terms of processing time and memory footprint. In summary,
the results indicated various performance and computational
advantages for using the proposed system when compared
to similar solutions. Specifically, the system testing yielded
96.4% accuracy, 95.8% precision, 97.2% recall, 96.5% F1-
score, 99.2% AUC, and a significant generalization capability.
Besides, it runs at 54 fps, occupies 1.7 MB in memory, and
requires low-resolution input images; thus, making the pro-
posed system a real-time lightweight solution. The developed
system was also found robust to various environmental and
operational conditions e.g., oil residue and dust.
The proposed model's main drawback is not determining
the rope health state as a whole but assessing each image
individually. Besides, the system's output is binary and does
not directly communicate the rope's health condition. These
limitations propose extending the developed solution in various
ways such as: (1) collecting a larger training dataset with
different rope sizes and types to improve generalization; (2)
investigating other machine learning solutions and techniques;
(3) including the cost of the imaging apparatus in the design
process, e.g., using cheaper cameras; (4) extending the model's
output to multiple classes e.g., normal, worn, and damaged,
or to a continuous score indicating the rope's health condition
(regression); and (5) incorporating the proposed solution to
automate or recommend spare-part ordering.
ACKNOWLEDGMENT
We would like to thank Konecranes and Juhani Kerovuori
for their collaboration on this project.
APPENDIX A
THE PROPOSED MODEL VARIANTS
Table A.1 summarizes the proposed CNN model variants'
architecture for implementation. The variants were generated
by altering the number of blocks, input image sizes, and input
image color state.
APPENDIX B
THE ZHOU ET AL. (2019) AND (2021) MODELS
The proposed damage detection solution was compared to
the Zhou et al. (2019) [21] and Zhou et al. (2021)2 [18]
models in terms of performance and computational require-
ments. These models were originally designed to detect surface
damage in steel wire rope images with high performance.
Although the rope material is different from our experiments
(steel v.s. fiber), these detection models are still suitable for
adoption due to the similarity between the two problems; they
both deal with detecting damaged yarns or strands in rope
images. The Zhou et al. (2019) and (2021) architectures accept
grayscale input images of size 64×64 and 96×96, and produce
outputs of size 3 and 2, respectively. In this work, we changed
the Zhou et al. (2019) output shape to 2 in order to match our
problem definition, and we added six dropout layers (0.5 rate)
to mitigate overfitting. Moreover, we increased the Zhou et al.
(2021) original two dropout rates to 0.6 and added three more
dropout layers to avoid overfitting.
APPENDIX C
THE SCHULER ET AL. (2022) MODEL
The proposed damage detection solution was also compared
to the Schuler et al. (2022)3 [31] model; a highly efficient
CNN-based classifier. The Schuler et al. (2022) model was
designed in a clever manner to reduce the number of required
parameters while maintaining high performance; the accuracy
drop was 2% for a 55% reduction in parameters when tested
on the CIFAR-10 dataset [31]. Therefore, we opted for this
architecture for comparison because it is aligned with our
design requirements; high efficiency and performance. The
Schuler et al. (2022) model accepts colored input images
of size 32 × 32 × 3, and in this work, we used its original
implementation. Nonetheless, we reduced its output size from
10 to 2 in order to match our problem definition, and added
dropout layers (0.4 rate) to minimize overfitting.
2The adopted Zhou et al. (2021) model is named WRIPDCNN1 in [18].
3The adopted Schuler et al. (2022) model is named kDenseNet-BC L100
12ch in [31].
9
TABLE A.1
THE PROPOSED CNN MODEL VARIANTS' STRUCTURE. N C[k × k] DENOTES A CONVOLUTIONAL LAYER WITH N KERNELS EACH OF SIZE k × k,
MP[k × k] IS MAX POOLING WITH A k × k KERNEL, D[k] IS DROPOUT WITH RATE k, AND FC[N ] IS A FULLY CONNECTED LAYER WITH N NODES. THE
SELECTED MODEL VARIANT (CNN9) IS HIGHLIGHTED IN BOLD.
Variant #
Input Image Size
Preliminary
First Block
Second Block
Third Block
Fully Connected
CNN1
CNN2
CNN3
CNN4
CNN5
CNN6
CNN7
CNN8
CNN9
CNN10
CNN11
CNN12
CNN13
CNN14
CNN15
CNN16
16x16x1
16x16x1
16x16x3
16x16x3
32x32x1
32x32x1
32x32x1
32x32x3
32x32x3
32x32x3
64x64x1
64x64x1
64x64x1
64x64x3
64x64x3
64x64x3
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
-
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
-
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
-
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
-
-
-
-
-
-
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
-
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
-
-
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
-
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
-
-
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
-
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
-
-
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
64C[3x3]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
64C[3x3]-MP[2x2]-D[0.4]
Flatten-D[0.4]-FC[20]-D[0.2]-Output[2]
APPENDIX D
BASELINE TRAINING AND EVALUATION SETTINGS
The baseline models' training followed the same procedure
described in section II-D using the train set in each data split
(five training sets), but with no weight decay. Besides, their
performance was evaluated using the test set in each data split
(five test sets) and quantified by the measures described in
section II-E. Note that the Schuler model has caused out-of-
memory issues when trained with a batch size above 32 using
the equipment described in section II-F.
REFERENCES
[1] Z. Liu, K. Xie, L. Li, and Y. Chen, "A paradigm of safety management in
industry 4.0," Systems Research and Behavioral Science, vol. 37, no. 4,
pp. 632–645, 2020.
[2] I. Ahmed, G. Jeon, and F. Piccialli, "From Artificial Intelligence to
Explainable Artificial Intelligence in Industry 4.0: A Survey on What,
How, and Where," IEEE Transactions on Industrial Informatics, vol. 18,
no. 8, pp. 5031–5042, 2022.
[3] Z. Xu and J. H. Saleh, "Machine learning for reliability engineering and
safety applications: Review of current status and future opportunities,"
Reliability Engineering & System Safety, vol. 211, p. 107530, 2021.
[4] T. Jalonen, F. Laakom, M. Gabbouj, and T. Puoskari, "Visual Product
Tracking System Using Siamese Neural Networks," IEEE Access, vol. 9,
pp. 76 796–76 805, 2021.
[5] J. Lee, I. Phillips, and Z. Lynch, "Causes and prevention of mobile crane-
related accidents in South Korea," International Journal of Occupational
Safety and Ergonomics, pp. 469–478, 2020.
[6] Konecranes, "Smart cranes by Konecranes," Steel Times International,
vol.
[Online]. Available:
32, Nov
https://www.proquest.com/scholarly-journals/smart-cranes-konecranes/
docview/2376650666/se-2
2019.
43,
no.
8,
p.
[7] KONECRANES, KONECRANES S-Series Crane: The new standard in
lifting. [Online]. Available: https://www.konecranes.com/sites/default/
files/2020-12/S series crane flyer en Konecranes 2019 0.pdf
[8] I. Mupende, F. Lukasch, and P. Tonnier, "Experiences with Fibre Ropes
as Hoist Ropes in Crane Applications," innoTRAC Journal, vol. 1, pp.
9–18, Dec. 2020.
[9] ISO 9554:2019 Fibre ropes - General specifications, Sustainable
[Online]. Available: https://www.iso.org/
Development Goals Std.
standard/72077.html
[10] A. Schmieder and M. Golder, "Investigating the Lifetime of Fibre
Ropes," innoTRAC Journal, vol. 1, pp. 1–8, Dec. 2020.
[11] S. Falconer, A. Gromsrud, E. Oland, and G. Grasmo, "Preliminary
Results on Condition Monitoring of Fiber Ropes using Automatic Width
and Discrete Length Measurements," in Annual Conference of the PHM
Society, vol. 9, no. 1, 2017.
[12] M. Yousri, G. Jacobs, and S. Neumann, "Impact of fiber versus steel
ropes on the lifetime of crane winches," Modeling, Identification and
Control, vol. 41, no. 3, pp. 129–139, 2020.
[13] G. P. Foster, "Advantages of Fiber Rope Over Wire Rope," Journal of
Industrial Textiles, vol. 32, no. 1, pp. 67–75, 2002.
[14] E. Oland, R. Schlanbusch, and S. Falconer, "Condition Monitoring
Technologies for Synthetic Fiber Ropes-a Review," International Journal
of Prognostics and Health Management, vol. 8, no. 2, 2017.
[15] R. Schlanbusch, E. Oland, and E. R. Bechhoefer, "Condition Monitoring
Technologies for Steel Wire Ropes–A Review," International Journal of
Prognostics and Health Management, vol. 8, no. 1, 2017.
[16] P. Zhou, G. Zhou, Z. Zhu, Z. He, X. Ding, and C. Tang, "A Review
of Non-Destructive Damage Detection Methods for Steel Wire Ropes,"
Applied Sciences, vol. 9, no. 13, 2019.
[17] X. Huang, Z. Liu, X. Zhang, J. Kang, M. Zhang, and Y. Guo, "Surface
damage detection for steel wire ropes using deep learning and computer
vision techniques," Measurement, vol. 161, p. 107843, 2020.
[18] P. Zhou, G. Zhou, H. Wang, D. Wang, and Z. He, "Automatic Detection
of Industrial Wire Rope Surface Damage Using Deep Learning-Based
Visual Perception Technology," IEEE Transactions on Instrumentation
and Measurement, vol. 70, pp. 1–11, 2021.
[19] S. Falconer, E. Nordg ̊ard-Hansen, and G. Grasmo, "Computer vision
and thermal monitoring of HMPE fibre rope condition during CBOS
testing," Applied Ocean Research, vol. 102, p. 102248, 2020.
[20] P. Zhou, G. Zhou, Z. Zhu, C. Tang, Z. He, W. Li, and F. Jiang, "Health
Monitoring for Balancing Tail Ropes of a Hoisting System Using a
Convolutional Neural Network," Applied Sciences, vol. 8, no. 8, 2018.
[21] Z. Ping, Z. Gongbo, L. Yingming, and H. Zhenzhi, "Surface defect
detection for wire ropes based on deep convolutional neural network,"
in 2019 14th IEEE International Conference on Electronic Measurement
Instruments (ICEMI), 2019, pp. 855–860.
[22] P. Zhou, G. Zhou, Z. He, C. Tang, Z. Zhu, and W. Li, "A novel texture-
based damage detection method for wire ropes," Measurement, vol. 148,
p. 106954, 2019.
[23] P. Zhou, G. Zhou, Y. Li, Z. He, and Y. Liu, "A Hybrid Data-Driven
Method for Wire Rope Surface Defect Detection," IEEE Sensors Jour-
nal, vol. 20, no. 15, pp. 8297–8306, 2020.
[24] G. Zhang, Z. Tang, J. Zhang, and W. Gui, "Convolutional Autoencoder-
Based Flaw Detection for Steel Wire Ropes," Sensors, vol. 20, no. 22,
2020.
10
[25] M. Verhelst and B. Moons, "Embedded Deep Neural Network Process-
ing: Algorithmic and Processor Techniques Bring Deep Learning to IoT
and Edge Devices," IEEE Solid-State Circuits Magazine, vol. 9, no. 4,
pp. 55–65, 2017.
[26] W. A. Mustafa and M. A. Kader, "A Review of Histogram Equalization
Techniques in Image Enhancement Application," Journal of Physics:
Conference Series, vol. 1019, p. 012026, June 2018.
[27] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization,"
[Online]. Available: https:
arXiv preprint arXiv:1412.6980, 2014.
//doi.org/10.48550/arXiv.1412.6980Focustolearnmore
[28] Z. Zhang and M. Sabuncu, "Generalized Cross Entropy Loss for Training
Deep Neural Networks with Noisy Labels," in Advances in Neural
Information Processing Systems, S. Bengio, H. Wallach, H. Larochelle,
K. Grauman, N. Cesa-Bianchi, and R. Garnett, Eds., vol. 31. Curran
Associates, Inc., 2018. [Online]. Available: https://proceedings.neurips.
cc/paper/2018/hash/f2925f97bc13ad2852a7a551802feea0-Abstract.html
[29] T. Van Laarhoven, "L2 regularization versus batch and weight normal-
ization," arXiv preprint arXiv:1706.05350, 2017.
[30] R. Ge, S. M. Kakade, R. Kidambi, and P. Netrapalli, "The Step
Decay Schedule: A Near Optimal, Geometrically Decaying Learning
Rate Procedure For Least Squares," in Advances in Neural Information
Processing Systems, H. Wallach, H. Larochelle, A. Beygelzimer,
F. d'Alch ́e-Buc, E. Fox, and R. Garnett, Eds., vol. 32. Curran
Associates, Inc., 2019. [Online]. Available: https://proceedings.neurips.
cc/paper/2019/file/2f4059ce1227f021edc5d9c6f0f17dc1-Paper.pdf
[31] J. P. Schwarz Schuler, S. Roman ́ı, M. Abdel-nasser, H. Rashwan,
and D. Puig, "Grouped Pointwise Convolutions Reduce Parameters in
Convolutional Neural Networks," Mendel, vol. 28, pp. 23–31, 06 2022.
[32] 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," in Proceedings of the IEEE International
Conference on Computer Vision (ICCV), Oct. 2017, pp. 618–626. [On-
line]. Available: https://openaccess.thecvf.com/content iccv 2017/html/
Selvaraju Grad-CAM Visual Explanations ICCV 2017 paper.html
[33] L. van der Maaten and G. Hinton, "Visualizing data using t-SNE,"
Journal of Machine Learning Research, vol. 9, no. 86, pp. 2579–2605,
2008. [Online]. Available: https://jmlr.org/papers/v9/vandermaaten08a.
html
Tuomas Jalonen received the B.Sc. and M.Sc.
degrees in mechanical engineering from Tampere
University, Finland, in 2017 and 2019, respectively.
He is currently pursuing the Ph.D. degree with the
Faculty of Information Technology and Commu-
nication Sciences of Tampere University, Finland.
His research interest includes the development of
machine learning applications for manufacturing.
Mohammad Al-Sa'd (Senior Member, IEEE) re-
ceived his B.Sc. and M.Sc. degrees in Electrical En-
gineering from Qatar University, Qatar, in 2012 and
2016 respectively, and his PhD degree in Electrical
Engineering and Computing Sciences from Tampere
University, Finland, in 2022. He specialized in signal
processing and he is currently pursuing his postdoc-
toral fellowship at the Department of Neuroscience,
University of Helsinki, Finland. He has served as
a technical reviewer for several journals, including
IEEE transactions on signal processing, digital signal
processing, signal processing, biomedical signal processing and control, and
IEEE Access. His research interests include time-frequency signal theory,
machine learning, electroencephalogram analysis and processing, information
flow and theory, signal modeling, and optimization.
Roope Mellanen received the B.Sc. and M.Sc.
degrees in automation from Tampere University of
Technology, Finland, in 2016 and 2018, respectively.
He is currently working as a Research Specialist
for Konecranes Corporation. His research interest
includes machine learning, computer vision, and
signal processing and analytics.
Serkan Kiranyaz (Senior Member, IEEE) is a
Professor with Qatar University, Doha, Qatar. He
published two books, five book chapters, more than
80 journal articles in high impact
journals, and
100 articles in international conferences. He made
contributions on evolutionary optimization, machine
learning, bio-signal analysis, computer vision with
applications to recognition, classification, and signal
processing. He has coauthored the articles which
have nominated or received the "Best Paper Award"
in ICIP 2013, ICPR 2014, ICIP 2015, and IEEE
Transactions on Signal Processing (TSP) 2018. He had the most-popular
articles in the years 2010 and 2016, and most-cited article in 2018 in IEEE
Transactions on Biomedical Engineering. From 2010 to 2015, he authored
the 4th most-cited article of the Neural Networks journal. His research team
has won the second and first places in PhysioNet Grand Challenges 2016
and 2017, among 48 and 75 international teams, respectively. His theoretical
contributions to advance the current state of the art in modeling and repre-
sentation, targeting high long-term impact, while algorithmic, system level
design and implementation issues target medium and long-term challenges
for the next five to ten years. He in particular aims at investigating scientific
questions and inventing cutting-edge solutions in "personalized biomedicine"
which is in one of the most dynamic areas where science combines with
technology to produce efficient signal and information processing systems.
Moncef Gabbouj (Fellow Member, IEEE) received
the B.S. degree from Oklahoma State University,
Stillwater, OK, USA, in 1985, and the M.S. and
Ph.D. degrees from Purdue University, in 1986 and
1989, respectively, all in electrical engineering. He
is a Professor of signal processing with the Depart-
ment of Computing Sciences, Tampere University,
Tampere, Finland. He was an Academy of Finland
Professor from 2011 to 2015. His research inter-
ests include big data analytics, multimedia content-
based analysis, indexing and retrieval, artificial in-
telligence, machine learning, pattern recognition, nonlinear signal and image
processing and analysis, voice conversion, and video processing and coding.
Dr. Gabbouj is a member of the Academia Europaea and the Finnish Academy
of Science and Letters. He is the past Chairman of the IEEE CAS TC on DSP
and the Committee Member of the IEEE Fourier Award for Signal Processing.
He served as an Associate Editor and the Guest Editor of many IEEE, and
international journals and a Distinguished Lecturer for the IEEE CASS. He
is the Finland Site Director of the NSF IUCRC funded Center for Visual and
Decision Informatics (CVDI) and leads the Artificial Intelligence Research
Task Force of the Ministry of Economic Affairs and Employment funded
Research Alliance on Autonomous Systems (RAAS).
|
|
http://arxiv.org/abs/2302.11944v3 | 2023-10-16T15:08:43 | 2023-02-23T11:41:21 | Counterfactual Situation Testing: Uncovering Discrimination under
Fairness given the Difference | We present counterfactual situation testing (CST), a causal data mining
framework for detecting discrimination in classifiers. CST aims to answer in an
actionable and meaningful way the intuitive question "what would have been the
model outcome had the individual, or complainant, been of a different protected
status?" It extends the legally-grounded situation testing of Thanh et al.
(2011) by operationalizing the notion of fairness given the difference using
counterfactual reasoning. For any complainant, we find and compare similar
protected and non-protected instances in the dataset used by the classifier to
construct a control and test group, where a difference between the decision
outcomes of the two groups implies potential individual discrimination. Unlike
situation testing, which builds both groups around the complainant, we build
the test group on the complainant's counterfactual generated using causal
knowledge. The counterfactual is intended to reflect how the protected
attribute when changed affects the seemingly neutral attributes used by the
classifier, which is taken for granted in many frameworks for discrimination.
Under CST, we compare similar individuals within each group but dissimilar
individuals across both groups due to the possible difference between the
complainant and its counterfactual. Evaluating our framework on two
classification scenarios, we show that it uncovers a greater number of cases
than situation testing, even when the classifier satisfies the counterfactual
fairness condition of Kusner et al. (2017). | [
"Jose M. Alvarez",
"Salvatore Ruggieri"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11944v3",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11944v3",
"@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.CY",
"cs.LG"
] | Counterfactual Situation Testing: Uncovering Discrimination under Fairness
given the Difference
JOSE M. ALVAREZ, Scuola Normale Superiore, University of Pisa, Italy
SALVATORE RUGGIERI, University of Pisa, Italy
We present counterfactual situation testing (CST), a causal data mining framework for detecting individual discrimination in a dataset
of classifier decisions. CST answers the question "what would have been the model outcome had the individual, or complainant, been
of a different protected status?" in an actionable and meaningful way. It extends the legally-grounded situation testing of Thanh
et al. [62] by operationalizing the notion of fairness given the difference of Kohler-Hausmann [38] using counterfactual reasoning.
In standard situation testing we find for each complainant similar protected and non-protected instances in the dataset; construct
respectively a control and test group; and compare the groups such that a difference in decision outcomes implies a case of potential
individual discrimination. In CST we avoid this idealized comparison by establishing the test group on the complainant's counterfactual
generated via the steps of abduction, action, and prediction. The counterfactual reflects how the protected attribute, when changed,
affects the other seemingly neutral attributes of the complainant. Under CST we, thus, test for discrimination by comparing similar
individuals within each group but dissimilar individuals across both groups for each complainant. Evaluating it on two classification
scenarios, CST uncovers a greater number of cases than ST, even when the classifier is counterfactually fair.
CCS Concepts: • Computing methodologies → Classification; Machine learning.
Additional Key Words and Phrases: discrimination discovery, structural causal models, counterfactual fairness
1 INTRODUCTION
Automated decision making (ADM) is becoming ubiquitous and its societal discontents clearer [4, 19, 31]. There is a
shared urgency by regulators [21, 65] and researchers [37, 57] to develop frameworks that can asses these classifiers
for potential discrimination based on protected attributes such as gender, race, or religion. Discrimination is often
conceived as a causal claim on the effect of the protected attribute over an individual decision outcome [24, 30]. It is, in
particular, a conception based on counterfactual reasoning-what would have been the model outcome if the individual,
or complainant, were of a different protected status?-where we "manipulate" the protected attribute of the individual.
Kohler-Hausmann [38] calls such conceptualization the counterfactual causal model of discrimination (CMD).
Several frameworks for proving ADM discrimination are based on CMD [38]. Central to these frameworks is defining
"similar" instances to the complainant; arranging them based on their protected status into control and test groups; and
comparing the decision outcomes of these groups to detect the effect of the protected attribute. Among the available
tools [12, 41, 52], however, there is a need for one that is both actionable and meaningful. We consider a framework
to be actionable if it can rule out random circumstances for the individual discrimination claim as often required by
courts (e.g., [23, 24, 45]), and meaningful if it can account for known links between the protected attribute and all other
attributes when manipulating the former as often demanded by social scientists (e.g., [11, 34, 61]).
In this paper we present counterfactual situation testing (CST), a causal data mining framework for detecting instances
of individual discrimination in the dataset used by a classifier. It combines (structural)1 counterfactuals [46, 47] with
situation testing [62, 70]. Counterfactuals answer to counterfactual reasoning and are generated via structural causal
models. Under the right causal knowledge, counterfactuals reflect at the individual level how changing the protected
attribute affects other seemingly neutral attributes of a complainant. Situation testing is a data mining method, based
1Not to be confused with counterfactual explanations [64] from the XAI literature, which are not based on structural causal models. Other works like [33]
use "structural" to differentiate counterfactuals from counterfactual explanations. In this paper, counterfactuals are structural.
1
3
2
0
2
t
c
O
6
1
]
L
M
.
t
a
t
s
[
3
v
4
4
9
1
1
.
2
0
3
2
:
v
i
X
r
a
Alvarez and Ruggieri
on the homonymous legal tool [7, 54]. For each complainant, under some search algorithm and distance function for
measuring similarity, it finds and compares a control and test group of similar protected and non-protected instances
in the dataset, where a difference between the decision outcomes of the groups implies potential discrimination.
CST follows the situation testing pipeline with the important exception that it constructs the test group around the
complainant's counterfactual instead of the complainant.
An illustrative example. Consider the scenario in Fig. 1 (used later in Section 4.1) where a bank uses a classifier
to accept or reject ( ˆY ) individual loan applications based on annual salary (X1) and account balance (X2). Suppose a
female applicant (A = 1) with x1 = 35000 and x2 = 7048 gets rejected and files for discrimination. The bank is using
non-sensitive information to calculate ˆY , but according to Fig. 1 there is also a known link between A and {X1, X2} that
questions the neutrality of such information. Under situation testing, we would find a number of female (protected)
and male (non-protected) instances with similar characteristics to the complainant. The resulting control and test
groups to be compared would both have similar X1 and X2 to the complainant. On one hand, comparing multiple
instances allows to check whether the complainant's claim is an isolated event or representative of an unfavorable
pattern toward female applicants by the model (i.e., actionability). On the other hand, knowing what we know about
A and its influence, would it be fair to compare the similar female and male instances? As argued by previous works
[32, 38], the answer is no. This idealized comparison takes for granted the effect of gender on annual salary and account
balance. Under counterfactual situation testing, instead, we would generate the complainant's counterfactual under the
causal knowledge provided, creating a "male" applicant with a higher x1 = 50796 and x2 = 13852, and use it rather
than the complainant to find similar male instances. The resulting control and test groups would have different X1
and X2 between them. This disparate comparison embodies fairness given the difference, explicitly acknowledging the
lack of neutrality when looking at X1 and X2 based on A (i.e., meaningfulness). Here, the control group represents the
observed factual world while the test group the hypothetical counterfactual world of the complainant.
In addition, with counterfactual situation testing we propose an actionable extension to counterfactual fairness by
Kusner et al. [39], which remains the leading causal fairness framework [41]. A classifier is counterfactually fair when
the complainant's and its counterfactual's decision outcomes are the same. These are the same two instances used by
CST to construct, respectively, the control and test groups, which allows to equip this fairness definition with measures
for uncertainty. Hence, CST links counterfactual fairness claims with notions of statistical significance. Further, by
looking at the control and test groups rather than the literal comparison of the factual versus counterfactual instances,
CST evaluates whether the counterfactual claim is representative of similar instances. Hence, CST detects cases of
individual discrimination that are also counterfactually fair, capturing the realistic scenario where a deployed model
tends to discriminate when asked to evaluate a borderline instance multiple times.
Based on two case studies using synthetic and real data, we evaluate the CST framework using a k-nearest neighbor
implementation, k-NN CST, and compare it to its situation testing counterpart, k-NN ST [62], as well as to counterfactual
fairness [39]. Here, k denotes the number of instances we wish to find for each control and test groups. The experiments
show that CST detects a higher number of individual cases of discrimination across the different k sizes. Further, the
results also show that individual discrimination can occur even when the model is counterfactually fair. The results
hold when dealing with multiple protected attributes as well as different implementation parameters.
Our main contributions with CST are: (1) a meaningful and actionable framework for detecting individual discrimi-
nation; (2) a first operationalization of fairness given the difference for discrimination analysis; and (3) an actionable
extension of counterfactual fairness equipped with confidence intervals. With this in mind, Section 2 explores the role
2
Counterfactual Situation Testing
of causal knowledge in CST. Section 3 presents the CST framework and its k-NN implementation, while Section 4
showcases CST via two classification scenarios. Section 5 concludes the paper.
1.1 Related Work
We position CST with current works along the goals of actionability and meaningfulness. Regarding actionability,
when proving discrimination, it is important to insure that the framework accounts for sources of randomness in the
decision process. Popular non-algorithmic frameworks-such as natural [26] and field [8] experiments, audit [22] and
correspondence [9, 53] studies-address this issue by using multiple observations to build inferential statistics. Similar
statistics are sometimes asked in court for proving discrimination (e.g., [23, Section 6.3]). Few algorithmic frameworks,
instead, address this issue due to model complexity preventing formal inference [5]. An exception are data mining
frameworks for discrimination discovery [48, 58] that operationalize the non-algorithmic notions, including situation
testing [62, 70]. These frameworks (e.g., [2, 25, 51]) keep the focus on comparing multiple control-test instances for
making individual claims, providing evidence similar to that produced by the quantitative tools used in court [38].
To the best of our knowledge, it remains unclear if the same can be said about existing causal fair machine learning
methods [41] as these have yet to be used beyond academic circles.
Regarding meaningfulness, situation testing and the other methods have been criticized for their handling of the
counterfactual question behind the causal model of discrimination [32, 34, 38]. In particular, these actionable methods
take for granted the influence of the protected attribute on all other attributes. This can be seen, e.g., in how situation
testing constructs the test group, which is equivalent to changing the protected attribute while keeping everything else
equal. Such approach goes against how most social scientists interpret the protected attribute and its role as a social
construct when proving discrimination [11, 28, 55, 61]. It is in that regard where structural causal models [46] and
their ability for conceiving counterfactuals (e.g., [13, 69]), including counterfactual fairness [39], have an advantage.
What the criticisms on counterfactuals [32, 34] overlook here is that generating counterfactuals, as long as the causal
knowledge is properly specified, accounts modeling-wise for the effects of changing the protected attribute on all other
observed attributes. A framework like counterfactual fairness, relative to situation testing and these other methods,
is more meaningful in its handling of protected attributes. The novelty in CST is bridging these two lines of work,
borrowing the actionability aspects from situation testing and the meaningful aspects from counterfactual fairness.
2 CAUSAL KNOWLEDGE FOR DISCRIMINATION
Counterfactual situation testing requires access to the dataset of decision records of interest, D, and the algorithmic
decision-maker that produced it, b (). Let D contain the set of relevant attributes X , the set of protected attributes
A, and the decision outcome ˆY = b (X ). We describe D as a collection of n tuples, each (xi, ai,
yi ) representing the
(cid:98)
ith individual profile, with i ∈ [1, n]. ˆY is binary with ˆY = 1 denoting the positive outcome (e.g., loan granted). For
illustrative purposes, we assume a single binary A with A = 1 denoting the protected status (e.g., female), though we
relax this assumption in the experiments of Section 4.2. We also require causal knowledge in the form of a structural
causal model that describes the data generating model behind D. We view this requirement as an input space for experts
as these models are a convenient way for organizing assumptions on the source of the discrimination, facilitating
stakeholder participation and supporting collaborative reasoning about contested concepts [44].
3
Alvarez and Ruggieri
2.1 Structural Causal Models and Counterfactuals
A structural causal model (SCM) [46] M = {S, PU} describes how the set of p variables W = X ∪ A is determined based
on corresponding sets of structural equations S and latent variables U with prior distribution PU. Each Wj ∈ W is
assigned a value through a deterministic function fj ∈ S of its causal parents Wpa ( j ) ⊆ W \ {Wj } and noise variable
U j with distribution P (U j ) ∈ PU. Formally, for Wj ∈ W we have that Wj ← fj (Wpa ( j ), U j ), indicating the flow of
information in terms of child-parent or cause-effect pairs. We consider the associated causal graph G = (V, E), where
a node Vj ∈ V represents a Wj variable and a directed edge E ( j,j ′ ) ∈ E a causal relation.
We make two assumptions on M common within the causal fairness literature [41]. First, we assume causal sufficiency,
meaning there are no hidden common causes in M, or confounders. Second, we assume G to be acyclical, which turns
G into a directed acyclical graph (DAG), allowing for no feedback loops. We write M under these assumptions as:
M = (S, PU ), S = {Wj ← fj (Wpa ( j ), U j )}
p
j=1, PU = P (U1) × * * * × P (Up )
(1)
where these assumptions are necessary for generating counterfactuals. The causal sufficiency assumption is particularly
deceitful as it is difficult to both test and account for a hidden confounder [18, 40, 43]. The risk of a hidden confounder
is a general problem to modeling fairness. Here, the dataset D delimits our context. We expect it to contain all relevant
information used by the decision-maker b ().
Input from several stakeholders is needed to derive (1). We see it as a necessary collaborative effort: before we
implement CST, we first need to agree over a worldview for the discrimination context. Based on D, a domain-expert
motivates a causal graph G. A modelling-expert then translates this graphical information into a SCM M, making model
specification decisions on S. We do not cover this process here, but this is how we envision the initial implementation
stage of counterfactual situation testing.
For a given SCM M we want to run counterfactual queries to build the test group for a complainant. Counterfactual
queries answer to what would have been if questions. In CST, we wish to ask such questions around the protected
attribute A, by setting A to the non-protected status α using the do-operator do (A := α) [46] to capture the individual-
level effects A has on X according to (1). Let XCF denote the set of counterfactual variables obtained via the three step
procedure by Pearl et al. [47]. Abduction: for each prior distribution P (Ui ) that describes Ui , we compute its posterior
distribution given the evidence, or P (Ui | X, A). Action: we intervene A by changing its structural equation to A := α,
which gives way to a new SCM M′. Prediction: we generate the counterfactual distribution P (XCF
A←α (U ) | X, A) by
propagating the abducted P (Ui | X, A) through the revised structural equations in M′.
Note that generating counterfactuals and, thus, CST, unlike, e.g., counterfactual explanations [64] and discrimination
frameworks like the FlipTest [10], does not require a change in the individual decision outcome. It is possible for
(cid:98)Y = (cid:98)Y CF after manipulating A. We include a working example on generating counterfactuals in the Appendix.
2.2 Conceiving Discrimination
The legal setting of interest is indirect discrimination under EU law. It occurs when an apparently neutral practice
disadvantages individuals that belong to a protected group. Following [27], we focus on indirect discrimination for
three reasons. First, unlike disparate impact under US law [6], the decision-maker can still be liable for it despite
lack of premeditation and, thus, all practices need to consider potential indirect discrimination implications. Second,
many ADM models are not allowed to use the protected attribute as input, making it difficult for regulators to use the
4
Counterfactual Situation Testing
direct discrimination setting. Third, we conceive discrimination as a product of a biased society where b () continues to
perpetuate the bias reflected in D because it cannot escape making a decision based on X to derive ˆY .
We view the indirect setting as the one that best describes how biased information can still be an issue for an ADM
that never uses the protected attribute. Previous causal works [13, 36, 50] have focused more on whether the paths
between A and ˆY are direct or indirect. Here, the causal setting is much simpler. We know that b () only uses X , and
are more interested in how information from A is carried by X and how can we account for these links using causal
knowledge. That said, this does not mean that CST cannot be implemented in other discrimination settings. We simply
acknowledge that it was developed with the EU legal framework in mind. Proxy discrimination [63], e.g., is one setting
that overlaps with the one we have considered.
Finally, we note that an open legal concern for CST is detecting algorithmic discrimination for various protected
attributes, or |A| > 1. Two kinds of discrimination, multiple and intersectional, can occur. Consider, e.g., a black female
as the complainant. On what protected attribute is she being potentially discriminated on? In multiple discrimination,
we would need to detect separately whether the complainant was discriminated as a black and female individual. In
intersectional discrimination, we would instead need to detect simultaneously if the complainant was discriminated
as a black-female individual. Only multiple discrimination is currently recognized by EU law, which is an issue as
an individual can be free from multiple discrimination but fall victim of intersectional discrimination [68]. CST can
account operationally for both scenarios.
2.3 Fairness given the Difference: the Kohler-Hausmann Critique
Here, we make the case-very briefly-that the causal knowledge required for CST makes it a meaningful framework
with respect to situation testing [62, 70] and other tools [52] for detecting discrimination. The reference work is
Kohler-Hausmann [38]. We refer to the phrase fairness given the difference,2 which best captures her overall critique
toward the causal model of discrimination, as the Kohler-Hausmann Critique (KHC). CST aims to be meaningful by
operationalizing the KHC. It builds the test group on the complainant's counterfactual, letting XCF reflect the effects of
changing A instead of assuming X = XCF . This is because we view the test group as a representation of the hypothetical
counterfactual world of the complainant.
As argued by [38] and others before [11, 61], it is difficult to deny that most protected attributes, if not all of them,
are social constructs. That is, these attributes were used to classify and divide groups of people in a systematic way that
conditioned the material opportunities of multiple generations [42, 55]. Thus, recognizing A as a social constructs means
recognizing that its effects can be reflected in seemingly neutral variables in X . It is recognizing that A, the attribute,
cannot capture alone the meaning of belonging to A and that we might, as a minimum, have to link it with other
attributes to better capture this, such as A → X where A and X change in unison. These attributes summarize the
historical processes that fairness researchers are trying to address today and should not be treated lightly.3
The notion of fairness given the difference centers on how A is treated in the counterfactual causal model of discrimi-
nation (CM). The critique goes beyond the standard manipulation concern [3] in which A is an inmutable attribute.
Instead, granted that we can or, more precisely, have to manipulate A for running a discrimination analysis, the critique
goes against how most discrimination frameworks operationalize such manipulation. The KCH emphasizes that when
A changes, X should change as well.
2A phrase by Kohler-Hausmann during a panel discussion at NeurIPS 2021 workshop on 'Algorithmic Fairness through the Lens of Causal Reasoning.
3A clear example of this would be the use of race by US policy makers during the early post-WWII era. See, e.g., the historical evidence provided by
Rothstein [56] (for housing), Schneider [60] (for narcotics), and Adler [1] (for policing).
5
Alvarez and Ruggieri
Based on KHC, we consider two types of manipulations that summarize existing frameworks. The ceteris paribus
(CP), or all else equal, manipulation in which A changes but X remains the same. Examples of it include situation
testing [62, 70] but also, e.g., the famous correspondence study by Bertrand and Mullainathan [9]. The mutatis mutandis
(MM), or changing what needs to be changed, manipulation in which X changes when we manipulate A based on some
additional knowledge, like a structural causal model, that explicitly links A to X . Counterfactual fairness [39], e.g, uses
this manipulation. The MM is clearly preferred over the CP manipulation when we view A as a social construct.
3 COUNTERFACTUAL SITUATION TESTING
The objective of CST is to construct and compare a control and test group for each c protected individual, or complainant,
yc ) ∈ D denote the tuple of interest on which the individual
in D in a meaningful and actionable way. Let (xc, ac,
(cid:98)
discrimination claim focuses on, where c ∈ [1, n]. We assume access to the ADM b (), the dataset D, and a structural
causal model M describing the discrimination context.
There are three key inputs to consider: the number of instances per group, k; the similarity distance function of choice,
d; and the strength of the evidence for rejecting the discrimination claim, α. A fourth key input that we fix in this paper
is the search algorithm of choice, φ, which we set as the k-nearest neighbors algorithm (k-NN) [29]. We do so as the
k-NN is intuitive, easy to implement, and commonly used by existing situation testing frameworks. We discuss the CST
implementation used in Section 3.4, including the choice of d.
3.1 Building Control and Test Groups
For complainant c, the control and test groups are built on the search spaces and search centers for each group. The
search spaces are derived and, thus, delimited by D: we are looking for individuals that have gone through the same
decision process as the complainant. The search centers, however, are derived separately: the one for the control group
comes from D, while the one for the test group comes from the corresponding counterfactual dataset DCF . The test
search center represents the what would have been if of the complainant under a mutatis mutandis (MM) manipulation
of the protected attribute A that motivates the discrimination claim.
Definition 3.1 (Search Spaces). Under a binary A, where A = 1 denotes the protected status, we partition D into the
control search space Dc = {(xi, ai,
yi ) ∈ D : ai = 1} and the test search space Dt = {(xi, ai,
(cid:98)
yi ) ∈ D : ai = 0}.
(cid:98)
Definition 3.2 (Counterfactual Dataset). The counterfactual dataset DCF represents the counterfactual mapping of
each instance in the dataset D, with known decision maker b () and SCM M, via the abduction, action, and prediction
steps [47] when setting a binary A to the non-protected value, or do(A := 0).
To obtain DCF , we consider an SCM M, as in (1), where A has no causal parents, or is a root node, A affects only
the elements of X considered by the expert(s), and ˆY = b (X ). Therefore, when generating the counterfactuals on A
(Section 2.1), under the indirect discrimination setting (Section 2.2), the resulting XCF in DCF should reflect an MM
manipulation (Section 2.3). Under this structural representation, if A changes then X changes too. See, e.g., Fig. 1 and
Fig. 3. The counterfactual dataset represents the world that the complainants would have experienced under A = 0
given our worldview. All three definitions extend to |A| > 1.
Definition 3.3 (Search Centers). For a complainant c, we use xc from the tuple of interest (xc, ac, ˆyc ) ∈ D as the
from the tuple of interest's generated counterfactual
control search center for exploring Dc ⊂ D, and use xCF
(xCF
c
) ∈ DCF as the test search center for exploring Dt ⊂ D.
, ˆyCF
c
, aCF
c
c
6
Counterfactual Situation Testing
Given the factual D and counterfactual DCF datasets, we construct the control and test groups for c using the k-NN
algorithm under some distance function d (x, x ′) to measure similarity between two tuples x and x ′. We want each
group or neighborhood to have a size k. For the control group (k-ctr) we use the (factual) tuple of interest (xc, ac, ˆyc ) ∈ D
as search center to explore the protected search space Dc :
k-ctr = {(xi, ai,
yi ) ∈ Dc : rankd (xc, xi ) ≤ k }
(cid:98)
(2)
where rankd (xc, xi ) is the rank position of xi among tuples in Dc with respect to the ascending distance d from xCF
.
c
For the test group (k-tst) we use the counterfactual tuple of interest (xCF
) ∈ DCF as search center to explore
c
the non-protected search space Dt :
yCF
c
(cid:98)
, aCF
c
,
k-tst = {(xi, ai,
yi ) ∈ Dt : rankd (xCF
c
(cid:98)
, xi ) ≤ k }
(3)
where rankd (xCF
, xi ) is the rank position of xi among tuples in Dt with respect to the ascending distance d from xCF
.
c
We use the same distance function d for each group. Neither A nor ˆY are used for constructing the groups. Both (2) and
(3) can be expanded by including additional constraints, such as a maximum allowed distance.
c
c
The choice of search centers (Def. 3.3) is what operationalizes fairness given the difference for counterfactual
situation testing, making it a meaningful framework for testing individual discrimination. To build k-ctr and k-tst using,
respectively, xc and xCF
is a statement on how we perceive within group ordering as imposed by the protected attribute
A. This is because the search centers must reflect the A-specific ordering of the search spaces that each center targets. Let
us consider our illustrative example from Section 1. If being a female (A = 1) in this society imposes certain systematic
limitations that hinder xc , then comparing c to other female instances in the protected search space preserves the group
ordering prescribed by X |A = 1 as all instances involved experience A in the same way. Therefore, given our worldview,
the generated counterfactual male instance for c should then reflect the group ordering prescribed by X |A = 0. We
expect xc ≠ xCF
as the test search center would allow us
to compare c to other male tuples in the non-protected search space without having to reduce A to a phenotype.
given what we know about the effects of A on X . Using xCF
c
c
One way to look at the previous statement is by considering the notion of effort. If being female requires a higher
individual effort to achieve the same xc , then it is fair to compare c to other female instances. However, it is unfair
to compare c to other male instances without adjusting for the extra effort not incurred by the male instances for
being males. The counterfactual xCF
individual fairness [20] notions.
should reflect said adjustment. See [14, 15] on a similar, more formal critique on
c
3.2 Detecting Discrimination
For a complainant c, we compare the control and test groups by looking at the difference in proportion of negative
decision outcomes, or Δp = pc − pt , such that:
|{(xi, ai,
pc =
yi ) ∈ k-ctr : ˆyi = 0}|
(cid:98)
k
|{(xi, ai,
pt =
yi ) ∈ k-tst : ˆyi = 0}|
(cid:98)
k
(4)
where pc and pt represents the count of tuples with a negative decision outcome ( ˆY = 0), respectively, in the control
and test group. Note that only ˆY is used for deriving the proportions. We compute Δp for all protected tuples in D
regardless of the their decision outcome ˆY .
CST has the option to include or exclude the search centers when calculating (4). If we exclude them, then pc and pt
are counted in pc and pt , leading to a denominator in both of k + 1.
remain as is; if we include them, then ˆyc and ˆyCF
c
7
Alvarez and Ruggieri
We add this option to be able to compare CST against standard situation testing [62, 70], which excludes the search
centers, and counterfactual fairness [39], which only uses the search centers.
Since Δp is a proportion comparison, it is known to be asymptotically normally distributed, which allows to build
Wald confidence intervals (CI) around it [62]. Let zα/2 be the 1 − α/2 quantile of the standard normal distribution N for
a significance level of α (or, conversely, a confidence level (1 − α) * 100%). We write the two-sided CI for Δp of c as:
[Δp − wα, Δp + wα ], with wα = zα/2
√︂ pc (1 − pc ) − pt (1 − pt )
k
(5)
The confidence interval (5) responds to the hypothesis that there is individual discrimination, providing a measure
of certainty on Δp through a range of possible values. For a given claim, if the CI contains the minimum accepted
deviation τ, we cannot reject the hypothesis of no discrimination with (1 − α) * 100% confidence. In other words, the null
hypothesis H0 : π = τ cannot be rejected in favor of the alternative hypothesis H1 : π > τ, where π is the true difference
in proportion of negative decision outcomes. τ, with a default choice of τ = 0, represents the minimum amount of
difference between pc and pt that we need to observe to claim individual discrimination. The overall choice of α and τ
will depend on the context of the discrimination claim. It can be motivated, for instance, by legal requirements (set, e.g.,
by the court [62]), or technical requirements (set, e.g., via power analysis [16]), or both.
Definition 3.4 (Individual Discrimination). There is potential4 individual discrimination toward the complainant c if
Δp = pc − pt > τ, meaning the negative decision outcomes rate for the control group is greater than for the test group
by some minimum deviation τ ∈ R+.
We do not view Def. 3.4 as a matter of individual versus group fairness. When we test whether b () discriminates
against c, we inevitably pass judgement onto the classifier b () in fear that this behaviour has happened before. In D we
have more than one potential discrimination claim to consider under CST, allowing to draw individual-level conclusions
while motivating group-level ones. If b () discriminated against c, it also discriminated against what c represents in
terms of membership to A.
Definition 3.5 (Confidence on the Individual Discrimination Claim). The Wald CI (5) gives a measure of certainty on
Δp, which is (asymptotically) normally distributed. For a significance level α, we are (1 − α)% confident on Δp. The
claim is said to be statistically valid if the Wald CI excludes τ. This is a statistical inference extension of Def. 3.4.
The many-to-many comparison behind Δp is what makes counterfactual situation testing an actionable framework
for testing individual discrimination. Here, the notion of repetition and its relation to representativeness and certainty
concerns is important. For proving individual discrimination a single comparison is not enough [23, Sec. 6.3]. This is
because we want to ensure, one, that the individual claim is representative of the population, and two, be certain about
the individual claim. Implicit to both concerns is finding a pattern of unfavorable decisions against the protected group
to which the individual complainant belongs to, i.e., discrimination.
Ideally, we would repeat the decision process multiple times for the discriminatory pattern to become apparent.
This is not possible in practice. Back to our illustrative example from Section 1, we cannot ask the female complainant
to apply multiple times to the same bank. We instead can look at other similar instances under the same process.
This is what pc and pt (4) and Def. 3.4 represent. Similarly, if the bank's b () is shown to discriminate against the
female complainant, what rules out that it has not done it before or that this one time was an exception? Again, we
4Or prima facie. In practice, discrimination needs to be argued against/for. CST alone, as with any other discrimination analysis tool, cannot claim to
prove discrimination. It can, however, provide evidence against/for a discrimination case [52].
8
Counterfactual Situation Testing
cannot repeat the decision process until we are certain of the individual discrimination claim. We instead can assume a
theoretical distribution of comparisons with π to account for potential randomness in what we detect from the single
point estimate that is Δp. This is what the CI (5) and Def. 3.5 represent.
3.3 Connection to Counterfactual Fairness
There is a clear link between CST and counterfactual fairness [39]. A decision maker is counterfactually fair if it outputs
the same outcome for the factual tuple as for its counterfactual tuple, where the latter is generated based on the
abduction, action, and prediction steps and the intervention on the protected attribute.5 The factual (xc, ac, ˆyc ) and
counterfactual (xCF
) tuples for c used in CST are also the ones used for counterfactual fairness. We view CST,
when including the search centers, as an actionable extension of counterfactual fairness.
, ˆyCF
c
, aCF
c
c
Proposition 3.6 (On Actionable Counterfactual Fairness). Counterfactual fairness does not imply nor it is
implied by Individual Discrimination (Def. 3.4).
We present a sketch of proof to Prop. 3.6 the in Appendix. Intuitively, it is possible to handle borderline cases where
the tuple of interest and its counterfactual both get rejected by b (), though the latter is close to the decision boundary.
The model b () would be considered counterfactually fair, but would that disprove the individual discrimination claim?
CST, by constructing the control and test groups around this single comparison, accounts for this actionability concern.
CST further equips counterfactual fairness with confidence intervals. Previous works have addressed uncertainty in
counterfactual fairness [35, 59], but with a focus on the structure of the SCM M. We instead address certainty on the
literal comparison that motivates the counterfactual fairness definition.
3.4 An Implementation: k-NN CST
Finally, we propose an implementation to our counterfactual situation testing framework. We already defined the
search algorithm φ as the k-NN algorithm. We define as the similarity measure d the same distance function between
two tuples, d (x, x ′), used in the k-NN situation testing implementation (k-NN ST) [62]. We do so because we want
to compare our implementation, k-NN CST, against its standard counterpart, k-NN ST. We summarize the current
algorithmic CST implementation in the Appendix. Let us define the distance between two tuples as:
d (x, x ′) =
(cid:205)|X |
i=1 di (xi − x ′
i )
|X |
(6)
where (6) averages the sum of the per-attribute distances across X . A lower (6) implies a higher similarity between
the tuples x and x ′. Here, di equals the overlap measurement (ol) if the attribute Xi is categorical; otherwise, it
equals the normalized Manhattan distance (md) if the attribute Xi is continuous, ordinal, or interval. We define each
md (xi, xi′ ) = |xi − xi′ |/(max(X ) − min(X )), and ol (xi, xi′ ) = 1 if xi = xi′ and 0 otherwise. CST can handle non-
normalized attributes but, unless specified, we normalize them to insure comparable per-attribute distances. The choice
of (6) is not restrictive. In subsequent works we hope to explore other distance options like , e.g., heterogeneous distance
functions [67], as well as probability-based options, e.g., propensity score weighting [51].
CST is, above all, a framework for detecting discrimination. The choice of d as well as φ are specific to the implemen-
tation of CST. What is important is that the test group is established around the complainant's counterfactual while the
control group, like in other discrimination frameworks, is established around the complainant.
5Formally, P ( ˆYA←a (U ) = y | X , A) = P ( ˆYA←a′ (U ) = y | X , A), where the left side is the factual A = a and the right side the counterfactual A = a′.
9
Alvarez and Ruggieri
A
X1
X2
(cid:98)Y
A ← UA
X1 ← f1 (A) + U1
X2 ← f2 (X1, A) + U2
M
(cid:98)Y = b (X1, X2)
Fig. 1. The causal knowledge with corresponding SCM M and DAG G behind our (illustrative example) loan application dataset. Let
A denote an individual's gender, X1 annual salary, X2 bank balance, and (cid:98)Y the loan decision based on the bank's ADM b ().
4 EXPERIMENTS
We now showcase the counterfactual situation testing (CST) framework via its k-NN implementation using synthetic
(Section 4.1) and real (Section 4.2) datasets. We contrast it to its situation testing counterpart (k-NN ST) [62], and to
counterfactual fairness (CF) [39]. Here, for the structural equations S we assume additive noise. This is a convenient but
not necessary assumption that simplifies the abduction step when generating the counterfactuals.6 We use a significance
level of α = 5%, a minimum deviation of τ = 0.0, and a set of k group sizes in {15, 30, 50, 100} for CST runs that include
and exclude the search centers. Also for comparison, we define individual discrimination as Δp > τ (Def. 3.4) for a
single protected attribute. We still, though, demonstrate the use of confidence intervals (Def. 3.5) and how it would
affect the final results. Finally, we assume M and G in both ADM scenarios.7
4.1 An Illustrative Example
We create a synthetic dataset D based on the scenario in Fig. 1. It is a modified version of Karimi et al. [33, Fig. 1], where
we include the protected attribute gender A. Here, gender directly affects both an individual's annual salary X1 and bank
balance X2, which are used by the bank's ADM b () for approving ((cid:98)Y = 1) or rejecting ((cid:98)Y = 0) a loan application. We
generate D for n = 5000 under A ∼ Ber(0.45) with A = 1 if the individual is female and A = 0 otherwise, and assume:
X1 ← (−$1500) * Poi(10) * A + U1; X2 ← (−$300) * X2 (4) * A + (3/10) * X1 + U2; and (cid:98)Y = 1{X1 + 5 * X2 > 225000} with
U1 ∼ $10000 * Poi(10) and U2 ∼ $2500 * N (0, 1). Here, D represents a known biased scenario.8 With A we introduce a
systematic bias onto the relevant decision attributes for female applicants.
To run CST we first generate the counterfactual dataset DCF based on the intervention do (A := 0), or what would
have happened had all loan applicants been male? Comparing D to DCF already highlights the unwanted systematic
effects of A. This can be seen, for instance, in Fig. 2 by the rightward shift experienced in X2 for all female applicants
when going from the factual to the counterfactual world. The loan rejection rate for females drops from 60.9% in D to
38.7% in DCF , which is now closer to the loan rejection rate of 39.2% experienced by males in both worlds. We run CST
for all k sizes. Results are shown in Table 1, where w/o refers to "without search centers" for CST.
Does b () discriminate against female applicants? As Table 1 shows, all three methods detect a number of individual
discrimination cases. On one hand, the bank clearly uses information that is neutral and needed for approving a loan
request; on the other hand, this information is tainted by the effects of gender on such information and the bank, in
turn, continues to perpetuate biases against women in this scenario. The results show how these neutral provisions are
harmful toward female applicants, and uncover potential individual discrimination cases.
6Formally, we assume S = {Wj ← fj (Wpa ( j ) ) + U j }
7The code and data are available at https://github.com/cc-jalvarez/counterfactual-situation-testing.
8Such "penalties", e.g., capture the financial burdens female professionals face in the present after having been discouraged in the past from pursuing
high-paying, male-oriented fields [17].
p
j =1 for W = X ∪ A.
10
Counterfactual Situation Testing
Fig. 2. Left. Account balance (X2) distribution for females in the factual D and counterfactual DCF datasets. Right. A comparison
on X2 of the ST and CST (w/o) control group (ctr) versus the ST (tst-st) and CST (w/o) (tst-cf) test groups for five randomly chosen
complainants detected by both methods, showing the fairness given the difference behind CST as tst-st is closer to ctr than tst-cf.
Table 1. Number (and %) of detected individual discrimination cases for the illustrative example based on gender.
Method
CST (w/o)
ST [62]
CST
CF [39]
k = 0
0
0
0
376 (22%)
k = 15
288 (16.8%)
55 (3.2%)
420 (24.5%)
376 (22%)
k = 30
313 (18.3%)
65 (3.8%)
434 (25.4%)
376 (22%)
k = 50
342 (20%)
84 (5%)
453 (26.5%)
376 (22%)
k = 100
395 (23.1%)
107 (6.3%)
480 (28%)
376 (22%)
CST relative to situation testing (ST). Here, consider the CST version without the search centers as ST excludes
them. What is clear from Table 1 is that CST finds more individual discrimination cases than ST for all k sizes. For
k = 50, e.g., CST (w/o) detects 20% while ST just 5%. These results highlight the impact of operationalizing fairness given
the difference, as the main difference between the two frameworks is how each individual test group is constructed
based on the choice of search center. The control group is constructed the same way for both ST and CST.
The choice of the test search centers is what sets CST apart from ST. Note that ST performs an idealized comparison.
Consider, e.g., the tuple (x1 = 35000, x2 = 7948, a = 1) as the complainant c. With c as the test search center, the most
similar male profiles to the complainant under any distance d would be tuples similar to (x1 = 35000, x2 = 7948, a = 0).
CST, conversely, performs a more flexible comparison under fairness given the difference. With the corresponding
2 = 13852, aCF = 0) as the test search center, the most similar male profiles to the
counterfactual tuple (xCF
complainant under the same d would be tuples similar to the counterfactual itself. Hence, the test group we construct
1 = 50796, xCF
under CST will probably not be similar to the one we construct under ST nor to the same control group we construct
for both ST and CST. Fig. 2, for instance, shows clearly this result for k = 15. We randomly chose five complainants that
were discriminated by b () according to both ST and CST and plot the distribution of X2 for the control group (ctr), the
ST test group (tst-st), and the CST test group (tst-cf). In this scenario, all 55 ST cases are also detected by CST.
yc = 0 becomes
(cid:98)
CST relative to counterfactual fairness (CF). Here, consider the CST version including the search centers (though
CST w/o is of interest also), as these represent the instances used by CF. We define CF discrimination as a case where
the factual
= 1 after the intervention of A. Under this definition, we detect 376 cases of CF
discrimination in D, or 22% of female applicants. CF is independent from k as the framework applies only to the
individual comparison of the factual and counterfactual tuples for complainant c. Table 1 show that CST detects a
higher number of individual discrimination cases for each k size (while CST w/o only passes CF at k = 100). In fact, in
this scenario, all cases detected by CF are contained in CST.
yCF
c
(cid:98)
11
Alvarez and Ruggieri
What sets CST apart from CF is twofold. First, CST equips the CF comparison with certainty measures. This point
is illustrated in Table 2 where we show individual cases of discrimination detected by both CF and CST along with
confidence intervals (CI) (5) provided by the CST framework. Second, CST detects cases of individual discrimination
that are counterfactually fair. This point is illustrated in Table 3 where we show individual cases that pass CF but still
exhibit a discriminatory pattern when looking at Δp. Such results highlight why legal stakeholder require multiple
comparisons to insure that c's experience is representative of the discrimination claim.
Table 2. Subset of individual discrimination cases detected
by both CST (k = 15) and CF with CI under α = 5%
Table 3. Subset of individual discrimination cases detected
by CST (k = 15) but not by CF with CI under α = 5%.
Comp. (ID)
44
55
150
203
218
pc
1.00
0.81
1.00
1.00
0.56
pt
0.00
0.00
0.94
0.88
0.00
Δp
1.00*
0.81*
0.06
0.13
0.56*
CI (α = 5%)
[1.00, 1.00]
[0.65, 0.97]
[-0.04, 0.16]
[-0.01, 0.26]
[0.36, 0.77]
Comp. (ID)
5
147
435
1958
2926
pc
0.06
0.50
0.38
0.13
0.75
pt
0.0
0.0
0.0
0.0
0.0
Δp
0.06
0.5*
0.38*
0.13
0.75*
CI (α = 5%)
[-0.04, 0.16]
[0.29, 0.71]
[0.18, 0.58]
[-0.01, 0.26]
[0.57, 0.93]
Confidence in results. Finally, notice that Tables 2 and 3 include cases where τ = 0 falls within the individual CI.
We detected these cases under Δp > τ (Def. 3.4). Under α = 5%, we would reject these cases as individual discrimination
claims with confidence level of 95% since the minimum deviation is covered by the CIs (Def. 3.5). These are cases with
small Δp's that are too close to call. We denote those statistically significant cases with the asterisk on Δp.
4.2 Law School Admissions
Based on the Law School Success example popularized by Kusner et al. [39, Fig. 2] using US data from the Law School
Admission Council survey [66], we create an admissions scenario to a top law school. We consider as protected attributes
an applicant's gender, male/female, (G) and race, white/non-white, (R). We add an ADM b () that considers the applicant's
undergraduate grade-point average (UGPA) and law school admissions test scores (LSAT) for admission. If an applicant is
successful, (cid:98)Y = 1; otherwise (cid:98)Y = 0. We summarize the scenario in Fig. 3. For b (), we use the median entry requirements
for the top US law school to derive the cutoff ψ .9 The cutoff is the weighted sum of 60% 3.93 over 4.00 in UGPA and 40%
46.1 over 48 LSAT, giving a total of 20.8; the maximum possible score under b () is 22 for an applicant. The structural
equations follow (1), as in [39], with bU and bL denoting the intercepts; β1, β2, λ1, λ2 the weights; and U GPA ∼ N and
LSAT ∼ Poi. the probability distributions.
G
R
UGPA
LSAT
(cid:98)Y
M
← UR
← UG
R
G
U GPA ← bU + β1 * R + λ1 * G + U1,
LSAT ← exp{bL + β2 * R + λ2 * G + U2},
(cid:98)Y = 1{(0.6 * U GPA + 0.4 * LSAT ) > ψ }
Fig. 3. The causal knowledge with corresponding SCM M and DAG G behind the law school admissions dataset, with R denoting
race (R = 1 for non-white) and G denoting gender (G = 1 for female).
9That being Yale University Law School: https://www.ilrg.com/rankings/law/index/1/asc/Accept
12
Counterfactual Situation Testing
The dataset D contains n = 21790 applicants, 43.8% are females and 16.1% are non-whites. Despite the ADM b ()
being externally imposed by us for the purpose of illustrating the CST framework, under b () only 1.88% of the female
applicants are successful compared to 2.65% of the male applicants; similarly, only 0.94% of the non-white applicants
are successful compared to 2.58% of the white applicants. Therefore, is b () discriminatory toward non-white and female
applicants? We run CST along with ST and CF for each protected attribute. We generate the counterfactual dataset
DCF for each R–what would have been the outcome had all applicants been white?–and G–what would have been the
outcome had all applicants been male?–and present the results, respectively, in Table 4 and Table 5. Both tables show
CST detecting more individual cases of discrimination than ST and CF.
Table 4. Number (and %) of individual discrimination cases for the law school admissions scenario based on race.
Method
CST (w/o)
ST [62]
CST
CF [39]
k = 0
0
0
0
231 (6.59%)
k = 15
256 (7.3%)
33 (0.94%)
286 (8.16%)
231 (6.59%)
k = 30
309 (8.81%)
51 (1.45%)
309 (8.81%)
231 (6.59%)
k = 50
337 (9.61%)
61 (1.74%)
337 (9.61%)
231 (6.59%)
k = 100
400 (11.41%)
64 (1.83%)
400 (11.41%)
231 (6.59%)
Table 5. Number (and %) of individual discrimination cases in for the law school admissions scenario based on gender.
Method
CST (w/o)
ST [62]
CST
CF [39]
k = 0
0
0
0
56 (0.59%)
k = 15
78 (0.82%)
77 (0.81%)
99 (1.04%)
56 (0.59%)
k = 30
120 (1.26%)
101 (1.06%)
129 (1.35%)
56 (0.59%)
k = 50
253 (2.65%)
229 (2.4%)
267 (2.80%)
56 (0.59%)
k = 100
296 (3.10%)
258 (2.71%)
296 (3.10%)
56 (0.59%)
A similar analysis of Tables 4 and 5 for CST (w/o) versus ST and CST versus CF as in Section 4.1 follows. What the
results here highlight, though, is how the two versions of CST compare to each other. In both tables, as k increases,
CST (w/o) catches on to CST in the number of cases. This is likely related to how the observations for female/male and
non-white/white are distributed in the dataset; though, it also relates to the fact that the difference in size between the
groups in each version is just one instance: k versus k + 1. We should observe the same trend in Table 1 if we continued
to increase k. These results show that the different runs of CST can eventually reach the same conclusions under a
certain k size. In practice, it means that we could implement one of the two versions of CST without compromising the
number of detected individual discrimination cases, though further research is needed.
5 CONCLUSION
We presented counterfactual situation testing (CST), a new framework for detecting individual discrimination in a
dataset of classifier decisions. Compared to other methods, CST uncovers more cases even when the classifier is
counterfactually fair. It also equips counterfactual fairness with uncertainty measures. CST acknowledges the pervasive
effects of the protected attribute by comparing individual instances in the dataset that are observably different in the
factual world but hypothetically similar in the counterfactual world. Thus, the results are not too surprising as CST
operationalizes fairness given the difference, which is a more flexible take on similarity between individuals for testing
discrimination than the standard, idealized comparison of two individuals that only differ on their protected status.
13
Alvarez and Ruggieri
Implementation. CST is, above all, a framework for detecting discrimination that advocates for building the test
group on the generated counterfactual of the complainant. How similarity is defined, e.g., obviously conditions the
implementation. We presented a k-NN version with d as (6); other implementations are possible and still loyal to CST
as long as the construction of the control and test groups follows fairness given the difference.
Similarly, detecting discrimination is a difficult, context-specific task. That is why for CST we emphasized the role of
the expert in constructing the causal graph necessary for generating the counterfactual instances. Indeed, this step
could be optimized using, e.g., causal discovery methods [49], but proving discrimination is time consuming and should
remain as such given its sensitive role in our society. Further, we are aware that, e.g., the experimental setting could be
pushed further by considering higher dimensions or more complex causal structures. What is the point in doing so,
though, if that is not the case with current ADM tools being deployed and audited in real life like the recent Dutch
scandal [31]? Proving discrimination is not a problem exclusive to (causal) modeling. With CST we wanted to create a
framework aware of the multiple angles to the problem of proving discrimination. The cases we have tackled here are
intended to showcase what is possible implementation-wise.
Limitations. As future work, promising directions include extending the framework to cases where causal sufficiency
does not hold, which is a common risk, and to cases where the decision maker b () is non-binary or of a specific type
(e.g., a decision tree). Here, we have also focused on tabular data. Future work should push CST further into more
complex datasets to explore the scalability and robustness of the framework.
Research Ethics. In this work we used anonymized benchmark (and synthetic) data designed for public use,
complying with applicable legal and ethical rules. We disclosed all details of our method in line with the transparency
mandates of the ACM Code of Ethics.
ACKNOWLEDGMENTS
Many thanks to Alejandra Bringas and Ioanna Papageorgiou from NoBIAS for their legal commentary. This work has
received funding from the European Union's Horizon 2020 research and innovation program under Marie Sklodowska-
Curie Actions (grant agreement number 860630) for the project "NoBIAS - Artificial Intelligence without Bias". This
work reflects only the authors' views and the European Research Executive Agency (REA) is not responsible for any
use that may be made of the information it contains.
REFERENCES
[1]
[2] Aniya Aggarwal, Pranay Lohia, Seema Nagar, Kuntal Dey, and Diptikalyan Saha. 2018. Automated Test Generation to Detect Individual Discrimination
Jeffrey S Adler. 2019. Murder in New Orleans: the creation of Jim Crow policing. University of Chicago Press.
in AI Models. CoRR abs/1809.03260 (2018).
Joshua D Angrist and Jörn-Steffen Pischke. 2008. Mostly Harmless Econometrics. Princeton University Press.
Julia Angwin, Jef Larson, Surya Mattu, and Lauren Kirchner. 2016. Machine Bias. ProPublica (2016).
[3]
[4]
[5] Susan Athey and Guido W Imbens. 2019. Machine learning methods that economists should know about. Annual Review of Economics 11 (2019),
685–725.
[6] Solon Barocas and Andrew D Selbst. 2016. Big data's disparate impact. California Law Review 104, 3 (2016), 671–732.
[7] Marc Bendick. 2007. Situation Testing for Employment Discrimination in the United States of America. Horizons stratégiques 3, 5 (2007), 17–39.
[8] Marianne Bertrand and Esther Duflo. 2017. Field Experiments on Discrimination. Handbook of Economic Field Experiments 1 (2017), 309–393.
[9] Marianne Bertrand and Sendhil Mullainathan. 2004. Are Emily and Greg More Employable than Lakisha and Jamal? A Field Experiment on Labor
Market Discrimination. The American Economic Review 94, 4 (2004), 991–1013.
[10] Emily Black, Samuel Yeom, and Matt Fredrikson. 2020. FlipTest: fairness testing via optimal transport. In FAT*. ACM, 111–121.
[11] Eduardo Bonilla-Silva. 1997. Rethinking Racism: Toward a structural interpretation. American Sociological Review (1997), 465–480.
[12] Alycia N. Carey and Xintao Wu. 2022. The Causal Fairness Field Guide: Perspectives From Social and Formal Sciences. Frontiers Big Data 5 (2022),
892837.
14
Counterfactual Situation Testing
[13] Silvia Chiappa. 2019. Path-Specific Counterfactual Fairness. In AAAI. AAAI Press, 7801–7808.
[14] Evgenii Chzhen, Christophe Denis, Mohamed Hebiri, Luca Oneto, and Massimiliano Pontil. 2020. Fair regression with Wasserstein barycenters. In
NeurIPS.
[15] Evgenii Chzhen and Nicolas Schreuder. 2022. A minimax framework for quantifying risk-fairness trade-off in regression. The Annals of Statistics 50,
4 (2022), 2416–2442.
Jacob Cohen. 2013. Statistical power analysis for the behavioral sciences. Routledge.
[16]
[17] Caroline Criado-Perez. 2019. Invisible Women. Vintage.
[18] Alexander D'Amour. 2019. On Multi-Cause Causal Inference with Unobserved Confounding: Counterexamples, Impossibility, and Alternatives.
CoRR abs/1902.10286 (2019).
Jeffrey Dastin. 2018. Amazon scraps secret AI recruiting tool that showed bias against women. Reuters (2018).
[19]
[20] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard S. Zemel. 2012. Fairness through awareness. In ITCS. ACM, 214–226.
[21] European Commission. 2021. The Artificial Intelligence Act. https://artificialintelligenceact.eu/. Accessed on January 2nd, 2023.
[22] Michael Fix and Raymond J. Struyk. 1993. Clear and Convincing Evidence: Measurement of Discrimination in America. Urban Institute Press.
[23] European Union Agency for Fundamental Rights and Council of Europe. 2018. Handbook on European non-discrimination law. https://fra.europa.eu.
Downloaded in 2023..
[24] S. R. Foster. 2004. Causation in antidiscrimination law: Beyond intent versus impact. Houston Law Review 41, 5 (2004), 1469–1548.
[25] Sainyam Galhotra, Yuriy Brun, and Alexandra Meliou. 2017. Fairness testing: testing software for discrimination. In ESEC/SIGSOFT FSE. ACM,
498–510.
[26] Claudia Goldin and Cecilia Rouse. 2000. Orchestrating Impartiality: The Impact of "Blind" Auditions on Female Musicians. American Economic
Review 90, 4 (September 2000), 715–741.
[27] Philipp Hacker. 2018. Teaching fairness to artificial intelligence: Existing and novel strategies against algorithmic discrimination under EU law.
Common Market Law Review 55, 4 (2018).
[28] Alex Hanna, Emily Denton, Andrew Smart, and Jamila Smith-Loud. 2020. Towards a critical race methodology in algorithmic fairness. In FAT*.
ACM, 501–512.
[29] Trevor Hastie, Robert Tibshirani, Jerome H Friedman, and Jerome H Friedman. 2009. The elements of statistical learning: data mining, inference, and
prediction. Vol. 2. Springer.
James J Heckman. 1998. Detecting Discrimination. Journal of Economic Perspectives 12, 2 (1998), 101–116.
[30]
[31] Melissa Heikkila. 2022. Dutch scandal serves as a warning for Europe over risks of using algorithms. POLITICO (2022).
[32] Lily Hu and Issa Kohler-Hausmann. 2020. What's sex got to do with machine learning?. In FAT*. ACM, 513.
[33] Amir-Hossein Karimi, Bernhard Schölkopf, and Isabel Valera. 2021. Algorithmic Recourse: from Counterfactual Explanations to Interventions. In
FAccT. ACM, 353–362.
[34] Atoosa Kasirzadeh and Andrew Smart. 2021. The Use and Misuse of Counterfactuals in Ethical Machine Learning. In FAccT. ACM, 228–236.
[35] Niki Kilbertus, Philip J. Ball, Matt J. Kusner, Adrian Weller, and Ricardo Silva. 2019. The Sensitivity of Counterfactual Fairness to Unmeasured
Confounding. In UAI (Proceedings of Machine Learning Research, Vol. 115). AUAI Press, 616–626.
[36] Niki Kilbertus, Mateo Rojas-Carulla, Giambattista Parascandolo, Moritz Hardt, Dominik Janzing, and Bernhard Schölkopf. 2017. Avoiding
[37]
[38]
Discrimination through Causal Reasoning. In NIPS. 656–666.
Jon M. Kleinberg, Jens Ludwig, Sendhil Mullainathan, and Cass R. Sunstein. 2019. Discrimination in the Age of Algorithms. CoRR abs/1902.03731
(2019).
Issa Kohler-Hausmann. 2018. Eddie Murphy and the Dangers of Counterfactual Causal Thinking about Detecting Racial Discrimination. Nw. UL
Rev. 113 (2018), 1163.
[39] Matt J. Kusner, Joshua R. Loftus, Chris Russell, and Ricardo Silva. 2017. Counterfactual Fairness. In NIPS. 4066–4076.
[40] Christos Louizos, Uri Shalit, Joris M. Mooij, David A. Sontag, Richard S. Zemel, and Max Welling. 2017. Causal Effect Inference with Deep
Latent-Variable Models. In NIPS. 6446–6456.
[41] Karima Makhlouf, Sami Zhioua, and Catuscia Palamidessi. 2020. Survey on Causal-based Machine Learning Fairness Notions. CoRR abs/2010.09553
(2020).
[42] Ron Mallon. 2007. A field guide to social construction. Philosophy Compass 2, 1 (2007), 93–108.
[43] Lawrence C McCandless, Paul Gustafson, and Adrian Levy. 2007. Bayesian sensitivity analysis for unmeasured confounding in observational
studies. Statistics in Medicine 26, 11 (2007), 2331–2347.
[44] Deirdre Mulligan. 2022. Invited Talk: Fairness and Privacy. https://www.afciworkshop.org/afcp2022. At the NeurIPS 2022 Workshop on Algorithmic
Fairness through the Lens of Causality and Privacy..
[45] Thomas B Nachbar. 2021. Algorithmic fairness, algorithmic discrimination. Florida State University Law Review 48 (2021), 50.
Judea Pearl. 2009. Causality: Models, Reasoning, and Inference (2nd ed.). Cambridge University Press.
[46]
[47]
Judea Pearl, Madelyn Glymour, and Noicholas P. Jewell. 2016. Causal Inference in Statistics: A Primer. John Wiley & Sons.
[48] Dino Pedreschi, Salvatore Ruggieri, and Franco Turini. 2008. Discrimination-aware data mining. In KDD. ACM, 560–568.
[49]
[50] Drago Plecko and Elias Bareinboim. 2022. Causal Fairness Analysis. CoRR abs/2207.11385 (2022).
Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. 2017. Elements of Causal Inference: Foundations and Learning Algorithms. The MIT Press.
15
Alvarez and Ruggieri
[51] Bilal Qureshi, Faisal Kamiran, Asim Karim, Salvatore Ruggieri, and Dino Pedreschi. 2020. Causal inference for social discrimination reasoning. J.
Intell. Inf. Syst. 54, 2 (2020), 425–437.
[52] Andrea Romei and Salvatore Ruggieri. 2014. A multidisciplinary survey on discrimination analysis. Knowl. Eng. Rev. 29, 5 (2014), 582–638.
[53] Dan-Olof Rooth. 2021. Correspondence testing studies. IZA World of Labor 58 (2021).
[54]
Isabelle Rorive. 2009. Proving Discrimination Cases: The Role of Situation Testing. Centre for Equal Rights and MPG (2009). https://ec.europa.eu/
migrant-integration/library-document/proving-discrimination-cases-role-situation-testing_en
[55] Evan K. Rose. 2022. A Constructivist Perspective on Empirical Discrimination Research. Working Manuscript (2022). https://ekrose.github.io/files/
constructivism.pdf
[56] Richard Rothstein. 2017. The Color of Law: A Forgotten History of How our Government Segregated America. Liveright Publishing.
[57] Salvatore Ruggieri, José M. Álvarez, Andrea Pugnana, Laura State, and Franco Turini. 2023. Can We Trust Fair-AI?. In AAAI. AAAI Press,
15421–15430.
[58] Salvatore Ruggieri, Dino Pedreschi, and Franco Turini. 2010. Data mining for discrimination discovery. ACM Trans. Knowl. Discov. Data 4, 2 (2010),
9:1–9:40.
[59] Chris Russell, Matt J. Kusner, Joshua R. Loftus, and Ricardo Silva. 2017. When Worlds Collide: Integrating Different Counterfactual Assumptions in
Fairness. In NIPS. 6414–6423.
[60] Eric C Schneider. 2008. Smack: Heroin and the American city. University of Pennsylvania Press.
[61] Maya Sen and Omar Wasow. 2016. Race as a bundle of sticks: Designs that estimate effects of seemingly immutable characteristics. Annual Review
of Political Science 19, 1 (2016), 499–522.
[62] Binh Luong Thanh, Salvatore Ruggieri, and Franco Turini. 2011. k-NN as an implementation of situation testing for discrimination discovery and
prevention. In KDD. ACM, 502–510.
[63] Michael Carl Tschantz. 2022. What is Proxy Discrimination?. In FAccT. ACM, 1993–2003.
[64] Sandra Wachter, Brent Mittelstadt, and Chris Russell. 2017. Counterfactual explanations without opening the black box: Automated decisions and
the GDPR. Harv. JL & Tech. 31 (2017), 841.
[65] White House. 2022. Blueprint for an AI Bill of Rights. https://www.whitehouse.gov/ostp/ai-bill-of-rights/. Accessed on January 2nd, 2023.
[66] Linda F Wightman. 1998. LSAC national longitudinal bar passage study. Law School Admission Council.
[67] D. Randall Wilson and Tony R. Martinez. 1997. Improved Heterogeneous Distance Functions. J. Artif. Intell. Res. 6 (1997), 1–34.
[68] Raphaële Xenidis. 2020. Tuning EU equality law to algorithmic discrimination: Three pathways to resilience. Maastricht Journal of European and
Comparative Law 27, 6 (2020), 736–758.
[69] Ke Yang, Joshua R. Loftus, and Julia Stoyanovich. 2021. Causal Intersectionality and Fair Ranking. In FORC (LIPIcs, Vol. 192). Schloss Dagstuhl -
Leibniz-Zentrum für Informatik, 7:1–7:20.
[70] Lu Zhang, Yongkai Wu, and Xintao Wu. 2016. Situation Testing-Based Discrimination Discovery: A Causal Inference Approach. In IJCAI. IJCAI/AAAI
Press, 2718–2724.
16
Counterfactual Situation Testing
A SUPPLEMENTARY MATERIAL
A.1 Working example for generating counterfactuals
We present a simple working example for counterfactual generation. Given the assumptions we undertake for (1) plus
p
the additional assumption of an additive noise model (ANM)-i.e., S = {X j ← fj (Xpa ( j ) ) + U j }
j=1-the generating
procedure is straightforward. The ANM assumption is also assumed in Section 4 for the classification scenarios. It is
a common model specification assumption that allows to identify more easily the non-random parts of the equation.
Suppose we have the following structural causal model M and corresponding directed acyclical graph G:
X2
X1
X3
M
X1 ← U1
X2 ← α * X1 + U2
X3 ← β1 * X1 + β2 * X2 + U3
where U1, U2, U3 represent the latent variables, X1, X2, X3 the observed variables, and α, β1, β2 the coefficient for the
causal effect of, respectively, X1 → X2, X1 → X3, and X2 → X3. Suppose we want to generate the counterfactual for
X3, i.e., XCF
, had X1 been equal to x1 ∈ X1. In the abduction step, we estimate U1, U2, and U3 given the evidence or
what is observed under the specified structural equations:
3
ˆU1 = X1
ˆU2 = X2 − α * X1
ˆU3 = X3 − β1 * X1 + β2 * X2
We can generalize this step for (1) as U j = X j − fj (Xpa ( j ) ) ∀X j ∈ X . This step is an individual-level statement on the
residual variation under SCM M. It accounts for all that our assignment functions fj , which are at the population
level, cannot explain, or the error terms. In the action step, we intervene X1 and set all of its instances equal to x1 via
do (X1 := x1) and obtaining the intervened DAG G′ and SCM M′:
X2
do (x1)
X3
X1 = x1
X2 ← α * x1 + U2
X3 ← β1 * x1 + β2 * X2 + U3
M′
where no edges come out from X1 as it has been fixed to x1. Finally, in the prediction step, we combine these two steps
to calculate XCF
under the set of ˆU and the intervened M′:
3
3 ← β1 * x1 + β2 * X2 + ˆU3
XCF
← β1 * x1 + β2 * (α * x1 + ˆU2) + ˆU3
which is done for all instances in X3. This is what is done at a larger scale, for example, in [33] and [47], and also in this
paper. The same three steps can apply to X2 (also for X1, though it would be trivial as it is a root note).
We can view this approach as a frequentist
10 one for generating counterfactuals, in particular, with regard to the
Abduction step. A more Bayesian approach is what is done by [39] where they use a Monte Carlo Markov Chain
(MCMC) to draw ˆU by updating its prior distribution with the evidence X to then proceed with the other two steps. In
10This is not a formal distinction, but based on talks with other researchers in counterfactual generation. Such a distinction, to the best of our knowledge,
remains an open question.
17
Section 4.2, we used both approaches for generating the counterfactuals and found no difference in the results. We only
present in this paper the first approach as it is less computationally expensive.
A.2 Sketch of Proof for Proposition 3.6
Alvarez and Ruggieri
yCF
yc = (cid:98)
c
(cid:98)
yc = 0) and assume the generated counterfactual is (xCF
(cid:98)
yCF
c = 0).
Consider the factual tuple (xc, ac = 1,
(cid:98)
Since
, this is a case where counterfactual fairness holds. However, the decision boundary of the model b () can
be purposely set such that the k-nearest neighbors of xc are all within the decision ˆY = 0, and less than 1 − τ fraction of
are within the decision ˆY = 0. This leads to a Δp > 1 − (1 − τ) = τ, showing that there
the k-nearest neighbors of xCF
but the sets of k-nearest
is individual discrimination. The other way can be shown similarly by assuming
c = 0,
, aCF
c
c
yCF
yc ≠ (cid:98)
c
(cid:98)
neighbors have rates of negative decisions whose difference is lower than τ.
B ALGORITHMS FOR K-NN CST IMPLEMENTATION
We present the relevant algorithms for the k-NN CST implementation (Section 3.4). The algorithm 1 performs CST while
algorithm 2 returns the indices of the top-k tuples with respect to the search centers based on the distance function d.
Notice that the main difference in algorithm 1 when creating the neighborhoods is that the search centers are drawn
from the factual dataset for the control group D and the counterfactual dataset DCF for the test group. Further, notice
that we use the same c (i.e., index) for both as these two data-frames have the same structure by construction.
Algorithm 1: run_CST
: D, DCF , k
Input
Output : [pc − pt ]
prot _condition ← D [:, prot _attribute ] == prot _value
Dc ← D [prot _condition]
Dt ← D [¬ prot _condition]
prot _idx ← Dc .index .to_list ( );
di f f _list = [ ]
for c, row ∈ prot _idx do
// get protected (control) search space
// get non-protected (test) search space
// get idx for all complainants
// idx of the top-k tuples for control group
// idx of the top-k tuples for test group
res_1 ← get _top_k ( D [c, :], Dc, k );
res_2 ← get _top_k ( DCF [c, :], Dt , k );
pc ← sum ( D [res1, target _attribute ] == negative_outcome ) / len (res_1)
pt ← sum ( D [res2, target _attribute ] == negative_outcome ) / len (res_2)
di f f _list [c ] ← pc − pt
end
return di f f _list
Algorithm 2: get_top_k
:t , t _set , k
Input
Output : [indices ]
(idx, dist ) ← k_N N (t, t _set, k + 1);
if without search centers then
remove (t, idx, dist );
end
idx ′ ← sort (idx, dist );
return idx ′
Received 10 May 2023; revised 5 September 2023; accepted 20 September 2023
18
// run k-NN algorithm with k + 1
// remove the center t from idx
// sort idx by the distance
|
|
http://arxiv.org/abs/2302.11940v1 | 2023-02-23T11:38:55 | 2023-02-23T11:38:55 | Uncertainty Guided Ensemble Self-Training for Semi-Supervised Global
Field Reconstruction | Recovering a globally accurate complex physics field from limited sensor is
critical to the measurement and control in the aerospace engineering. General
reconstruction methods for recovering the field, especially the deep learning
with more parameters and better representational ability, usually require large
amounts of labeled data which is unaffordable. To solve the problem, this paper
proposes Uncertainty Guided Ensemble Self-Training (UGE-ST), using plentiful
unlabeled data to improve reconstruction performance. A novel self-training
framework with the ensemble teacher and pretraining student designed to improve
the accuracy of the pseudo-label and remedy the impact of noise is first
proposed. On the other hand, uncertainty-guided learning is proposed to
encourage the model to focus on the highly confident regions of pseudo-labels
and mitigate the effects of wrong pseudo-labeling in self-training, improving
the performance of the reconstruction model. Experiments include the pressure
velocity field reconstruction of airfoil and the temperature field
reconstruction of aircraft system indicate that our UGE-ST can save up to 90%
of the data with the same accuracy as supervised learning. | [
"Yunyang Zhang",
"Zhiqiang Gong",
"Xiaoyu Zhao",
"Wen Yao"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11940v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11940v1",
"@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"
] | Uncertainty Guided Ensemble Self-Training for Semi-Supervised Global Field
Reconstruction
Yunyang Zhang, Zhiqiang Gong, Xiaoyu Zhao, Wen Yao∗
Defense Innovation Institute, Chinese Academy of Military Science, Beijing, China
3
2
0
2
b
e
F
3
2
]
G
L
.
s
c
[
1
v
0
4
9
1
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
Recovering a globally accurate complex physics field from limited sensor is critical to the measurement and
control in the aerospace engineering. General reconstruction methods for recovering the field, especially the
deep learning with more parameters and better representational ability, usually require large amounts of
labeled data which is unaffordable. To solve the problem, this paper proposes Uncertainty Guided Ensemble
Self-Training (UGE-ST), using plentiful unlabeled data to improve reconstruction performance. A novel self-
training framework with the ensemble teacher and pretraining student designed to improve the accuracy of
the pseudo-label and remedy the impact of noise is first proposed. On the other hand, uncertainty-guided
learning is proposed to encourage the model to focus on the highly confident regions of pseudo-labels and
mitigate the effects of wrong pseudo-labeling in self-training, improving the performance of the reconstruction
model. Experiments include the pressure velocity field reconstruction of airfoil and the temperature field
reconstruction of aircraft system indicate that our UGE-ST can save up to 90% of the data with the same
accuracy as supervised learning.
Keywords: Semi-supervised learning, Global physics field reconstruction, Ensemble teacher,
Uncertainty-guided learning, Pre-training student
1. Introduction
Fast and accurate acquisition of global physics field in aerospace engineering is of great significance for stable
operation of monitoring system, smooth control of the process. Since aircraft systems are required to operate in
severe environments, the direct measurement of global physics field is extremely difficult. Therefore, developing
reconstruction of the global physics field based on sensor observations is essential for the measurement and
control in the aerospace engineering [1, 2]. Traditional reconstruction methods, including principal component
regression, partial least squares (PLS) regression, support vector machine (SVM), and artificial neural network
(ANN) [3, 4, 5, 6, 7], is usually data-driven. However, these methods are limited by the complexity of aircraft
systems, these methods are typical shallow methods with limited representational ability which can no longer
be adequate for reconstructing global fields from a limited number of sensors in high-dimensional nonlinear
complex physics, such as fluid dynamics [8], thermodynamics [9], electromagnetism [10], and solid mechanics
[11].
∗Corresponding author
Preprint submitted to Journal of LATEX Templates
February 24, 2023
Deep learning with multiple layers has shown their potential in strong high-dimensional nonlinear problems.
It can automatically learn abstract and subtle features from large amounts of data, and already demonstrated
their good performance applying to physics field reconstruction [1]. Generally, the good performance is highly
depended on plentiful labeled data. However, obtaining plentiful training samples for the current task is
impossible. Although massive amounts of data are accumulated during industrial processes, these data are
mostly unlabeled and cannot be used directly under supervised paradigms. Therefore, it is significance for
industrial processes to efficiently utilize these abundant unlabeled data to improve reconstruction performance.
The semi-supervised learning (SSL) method can use only limited labeled and abundant unlabeled data to
train the model, and has been successfully applied in computer vision [12], natural language processing [13],
and other fields. SSL methods can be loosely classified into consistency based SSL and pseudo-label based
SSL [14, 15, 16]. The former SSL is mainly based on the smoothness assumption, which is not reasonable
for regression probem, and therefore cannot be applied in such a typical regression problem of global field
reconstruction. On the contrary, the pseudo-label based SSL, such as self-training method [17, 18] which
employ the teacher model to label the abundant unlabeled data and provides the student model for training,
is flexible and not constrained by specific assumptions. Since self-training is well adapted to the task at hand,
this paper mainly focuses on the self-training global physics field reconstruction.
Despite the good performance of the self-training method, it still mainly suffers from overfitting and noise
interference. Especially in the reconstruction problem, the noise in the pseudo-label has a serious erosion on
the prediction. Therefore, the unsolved question is how to avoid the effect of inaccurate pseudo-labeling
on the model performance?
To address the problem, this paper firstly improves the accuracy of the pseudo-label so as to reduce the
damage of the pseudo-label noise on the performance of the student model. Specifically, this paper using
ensemble teacher to jointly guide the training of student models. The errors in pseudo-label created by a
single teacher model can be mitigated by the "collective voting" of multiple teacher models, resulting in high-
quality pseudo-labels. Secondly, the student model is guided to concentrate on the ground truth or the areas
without noise, thereby eliminating noise interference and improving the performance of the student model.
During the training, the uncertainty in the pseudo-label is quantified based on the ensemble teacher, which
is further used as a guided information of noise in the pseudo-label. Based on uncertainty guided learning,
the student model ignores the noise region in the pseudo-label during the training process, thus avoiding the
propagation and accumulation of noise between the teacher and student model. Then, in order to further
reduce the interference of noise to the student model, pre-training student separates the pseudo-label from the
labeled data during the training. So that the noise in the pseudo-label can be "forgetten", and the student
model is forced to focus on the ground-truth to obtain higher performance.
Based on the above strategy, Uncertainty Guided Ensemble Self-Training (UGE-ST) is proposed in this
paper, including ensemble teacher, uncertainty guided learning and pre-training student. The innovations of
this paper are summarized as follows:
1. This paper proposes a novel self-training framework designed to improve the reconstruction accuracy of
2
unlabeled training data with the ensemble teacher and pre-training student that reduce the damage of
the pseudo-label noise on the student model.
2. This paper proposes uncertainty-guided learning for self-training to improve the performance of the
model, which uses the uncertainty as the guided information of the student and supervises the learning
process by reducing the effects of noise pseudo label.
3. Two physics field reconstruction problems verify the effectiveness of the proposed method. Experiments
show that the proposed UGE-ST in this paper is able to substantially improve model performance with
limited labeled data, and is in an advanced position compared to supervision and other semi-supervised
methods.
The layout of this paper is given as follows.
In Section II, the problem definition and the self-training
framework are shortly overviewed. Then, the proposed UGE-ST are illustrated in detail, including ensemble
teacher, uncertainty guided learning and pre-training student. After that, the effectiveness and feasibility of
proposed approach are demonstrated in two case in Section III. Finally, conclusion is made.
2. Methods
2.1. Problem Definition
Consider an two-dimensional discretized physical field Γ described by the governing partial differential
equations:
̇wx = f (wx, t; θ) , x ∈ Γ
(1)
where wx is the state vector in point x of physical field Γ that depends on parameters θ and time t; f represents
the nonlinear function that governs the physical field Γ.
In practice, due to the complexity of the physical system, the state w of the whole system is usually
unavailable. But the state of system on limited points can be observed by the sensors. We denote a(t; θ) as
the observed state at time t. The purpose of physical field reconstruction is to reconstruct a complete state
w(t; θ) of physical field from a limited observed state a(t; θ),
w(t; θ) = F (a(t; θ))
(2)
where a(t; θ) = {ay, y ∈ Λ ⊆ Γ}, Λ is the set of observed points; F is the required reconstruction model
which is deep neural network in this paper.
It is worth mentioning that, although the physical system is
time-dependent, the reconstruction model only relies on the observed state at the current step for predicting
the system states.
In order to construct the deep reconstruction model, we take the limited observation state a(t; θ) as the
input of model and the complete state w(t; θ) as the output of model.
3
Figure 1: Self-training method.
2.2. Self-training Framework
Generally, the performance of the deep learning model is significantly influenced by the amount of labeled
data that is manually annotated. However, collecting large amounts of data is labor-intensive and time-
consuming. Semi-supervised learning is considered a promising technology to mitigate the demand for label
data, thereby reducing the cost of deep learning model applications in practical engineering.
and abundant unlabeled data Dul = {(xul
Semi-supervised learning aims to generalize from a combination set of limited labeled data Dl = {(xl
i)}N
i=1
i=1, where M (cid:29) N . Self-training is a classic semi-supervised
learning method based on the idea of pseudo-label. The main steps are divided into two steps, as shown in
i , yul
i )}M
i, yl
the Fig. 1:
1. Firstly, a small amount of labeled data Dl is used to train the teacher model M T with L1 loss, which is
formulated as:
Lsup =
1
|Dl|
(cid:88)
xl∈Dl
1
HW
HW
(cid:88)
i=0
(cid:12)
(cid:12)yl
i − ˆyT
i
(cid:12)
(cid:12)
(3)
where yl
i and ˆyT
i represent the ground truth and the prediction of teacher model, W and H represent
the width and height of physical field.
2. Secondly, training the student model M S through the teacher model M T . The teacher model M T is
used to predict the unlabeled data Dul, and the predictions are adopted as the pseudo-label of unlabeled
data. At the same time, labeled data is combined with pseudo-label to train the student model. The
constraint can be formulated as:
Lsemi =
1
|Dl|
(cid:88)
xl∈Dl
1
HW
+
1
|Dul|
(cid:88)
xul∈Dul
1
HW
HW
(cid:88)
i=0
HW
(cid:88)
i=0
(cid:12)
(cid:12)yl
i − ˆyS
i
(cid:12)
(cid:12)
(cid:12)
(cid:12)yp
i − ˆyS
i
(cid:12)
(cid:12)
4
(4)
Step 2Step 1labeled datalDTeacher ModelTMPredictionsˆTyPredictionsˆTyGround truthlyGround truthlysup011ˆlllHWiixDilTLyyDHW==−Teacher ModelTMTeacher ModelTMunlabeled dataulDlabeled datalDlabeled datalDunlabeled dataulDunlabeled dataulDGround truthlys001111ˆˆllululHWHWemiiiiixDixulSipSDllLyyyyDHWDHW===−+−Pseudo-labelpyPseudo-labelpyPredictionsˆSyPredictionsˆSyStudent ModelSMStudent ModelSMwhere ˆyS
i
is the prediction of student model.
Discussion about self-training. Unlike the consistency regularization method, the self-training method does
not depend on the smoothness assumption and is simple and versatile. However, the student model is trained
based on the pseudo-label predicted by the teacher model. When there is a large noise in the pseudo-label,
the performance of the student model is affected.
In order to avoid the influence of false label noise on the student model, we improve the self-training
method in two aspects. The direct idea is to improve the accuracy of pseudo labels as much as possible so that
the noise in pseudo labels is as small as possible to avoid noise's influence on the performance degradation of
student models. Another idea is to prevent the effect of noise in pseudo labels on student model as much as
possible when the accuracy of pseudo labels is determined.
Figure 2: Uncertainty guided ensemble self-training method.
2.3. Uncertainty Guided Ensemble Self-Training
This paper proposes UGE-ST including ensemble teacher, uncertainty guided learning, and pre-training
student to improve the performance of reconstruction. The pre-training student and the uncertainty-guided
5
Step 2Step 1Ground truthlyGround truthlysup011ˆlllHWiixDilTLyyDHW==−Pseudo-labelpyPseudo-labelpyPredictionsˆSyPredictionsˆSyStudent ModelSMStudent ModelSMunlabeled dataulDunlabeled dataulDUncertainty weight1()pWNormU=−Step 3Student ModelSMStudent ModelSMStudent ModelSM()un011ˆululHWiixDilSupLWiyyDHW==−sup011ˆlllHWiixDilSLyyDHW==−Ensemble TeachereTMEnsemble TeachereTMPredictionsˆeTyPredictionsˆeTylabeled datalDlabeled datalDEnsemble TeachereTMEnsemble TeachereTMUncertaintypUUncertaintypUlabeled datalDlabeled datalDGround truthlyGround truthlyPredictionsˆSyPredictionsˆSylearning improve the performance of the student model by avoiding the influence of noise in pseudo-label as
much as possible. While the ensemble teachers directly improve the accuracy of pseudo-label, further enhances
the performance of the student model. The proposed method framework is shown in Fig. 2. Compared with
the basic self-training method, our method consists of three steps:
1. Firstly, a small amount of labeled data Dl is used to train the ensemble teacher model M eT with L1
loss, which is formulated in Eq. 3.
2. Secondly, similar with basis self-training, the student model M S is trained by the ensemble teacher M eT .
The predictions of the ensemble teacher M eT on the unlabeled data Dul are adopted as the pseudo-label.
Then, the uncertainty of the pseudo-label is quantified and normalized as weights to be multiplied with
pseudo-label supervision constraint, getting the uncertainty-guided learning constraint Lun.
3. Thirdly, a small amount of labeled data Dl is employed to re-train the student model M S with L1 loss.
2.3.1. Ensemble teacher
Ensemble learning is a classic idea in deep learning, which combines multiple weakly supervised models in
order to obtain a better and more comprehensive, strongly supervised model. The potential idea of ensemble
learning is that even if a weak model gets a wrong prediction, other models can correct the error. Generally
speaking, the performance of the model obtained by ensemble learning is better than that of a single model.
Due to the scarcity of labeled data for teacher model training, the performance of a single teacher model
is poor, resulting in large pseudo-label noise. Here we combine ensemble learning with self-training, using
ensemble learning to train and combine multiple teacher models to obtain a more accurate pseudo-label.
Specifically, We first initialize multiple teacher models (cid:8)M T
1 , M T
2 , * * * , M T
n
(cid:9). Multiple teacher models
are trained by labeled data Dl follow the supervised loss as shown in Eq. 3 to obtain ensemble teachers
(cid:9). The unlabeled data Dul is predicted by ensmeble teachers M eT acquiring results
M eT = (cid:8)M T
(cid:8)ˆyeT
T (Dul). Then, average multiple predictions to obtain pseudo-label yp for
1 , ˆyeT
i = Mi
1 , M T
2 , * * * , ˆyeT
n
(cid:9), where ˆyeT
2 , * * * , M T
n
the unlabeled data as follows:
2.3.2. Uncertainty guided learning
yp = mean (cid:0)ˆyeT
i
(cid:1) , i = 1, 2, ..., n
(5)
Although using ensemble teachers can improve the accuracy of pseudo-label, noise still exists and affects
the training of student model. We expect to filter out the noise in the pseudo-label so that the student model
can learn more areas with low or no noise. Here we propose using uncertainty to guide student model training.
Uncertainty can reflect the noise in the model prediction results, usually, the area with large noise is also
(cid:9) can be obtained for the same sample by
uncertain. Since multiple different predictions (cid:8)ˆyeT
1 , ˆyeT
ensemble teachers M eT , we naturally use variance to measure the uncertainty of pseudo-label yp predicted by
2 , * * * , ˆyeT
n
the teacher model as follows:
Up = var (cid:0)ˆyeT
i
(cid:1) , i = 1, 2, ..., n
(6)
Then, this study normalizes the uncertainty Up into range (0, 1), and weight the pixel value according to the
uncertainty of each pixel in the pseudo-label. Among them, regions with larger uncertainty are given smaller
6
weights, and areas with smaller uncertainty are given larger weights. The large weights force the model to
learn more areas with smaller noise, while the smaller weights ignore regions with larger noise, thus avoiding
the influence of noise on the model during the learning process. This paper defines the uncertainty weights as
follows:
In the end, combining uncertainty weights and pseudo-label loss to obtain uncertainty guided learning loss:
W = 1 − N orm(Up)
(7)
Lun =
1
|Dul|
(cid:88)
xul∈Dul
1
HW
HW
(cid:88)
i=0
W (i) (cid:12)
(cid:12)yp
i − ˆyS
i
(cid:12)
(cid:12)
(8)
2.3.3. Pre-training student
The training of neural networks relies on empirical risk minimization. The more data used for training,
the more consistent the distribution of datasets with that of all data, and the closer the empirical risk is to
the expected risk. When the amount of data is small, the empirical risk effect is not ideal because empirical
risk minimization tends to bring about overfitting. Therefore, it is necessary to expand the dataset so that
the training data distribution is as consistent as possible with the full data distribution. Although the self-
training introduces a large amount of pseudo-label data, the presence of noise in the pseudo-label mistake the
distribution with that of the real data, which eventually causes the empirical risk minimization to fail.
In order to avoid the interference of pseudo-label, this paper proposes a two-stage approach to train the
student model, namely pre-training student. The idea is to exploit the catastrophic forgetting phenomenon
in neural networks. First, the student model M S is pre-trained using pseudo-label yp, and the loss function
is shown as Eq. 9. The student model M S is then retrained using a small amount of labeled data Dl, the
constraint can be formulated as:
Lsup =
1
|Dl|
(cid:88)
xl∈Dl
1
HW
HW
(cid:88)
i=0
(cid:12)
(cid:12)yl
i − ˆyS
i
(cid:12)
(cid:12)
(9)
3. Experiments
In this section, the effectiveness of the proposed STP method was verified through its application to two
study cases. The first case is the airfoil velocity and pressure field reconstruction, and the second is the
electronic devices temperature field reconstruction. In order to demonstrate the superiority of the proposed
UGE-ST, the fully and semi supervised learning methods based on deep learning is implemented to compare
performance, where the semi supervised methods include Mean teacher [19], co-training[20], and the vanilla
self-training [18], and the rest remains unified.
3.1. Airfoil velocity and pressure field reconstruction
3.1.1. Background and experimental setting
Reconstructing the pressure and velocity field of airfoil based on the finite sensors is significant to the
design of the airfoil. This section adopts airfoil data [21] to verify the validity of proposed method. The
7
convolutional neural network (CNN) is employed to implement the proposed UGE-ST method. CNN is the
popularly deep learning model, which is widely used in computer vision [22, 23]. Compared with Multilayer
Perceptron (MLP), CNN with smaller parameters has the ability to process spatial information. Thus it is
suitable for processing regular physical field data. Here we adopt U-net [24] as the backbone of model. U-net
is an effective CNN structure for image-to-image regression. It can capture the overall and detailed features
of the image, and has the advantages of multi-scale fusion and processing large images.
Figure 3: Voronoi tessellation and global pressure field.
To use a CNN framework, the sparse observation data needs to be projected into an image in an appropriate
manner. Similar to [1], this paper maps local measurements to the spatial domain via Voronoi tessellation [25]
as shown in the left of Fig. 3. The grey dots in the figure indicate the placed sensors. Compared with the
form of sparse measurement as input directly, voronoi tessellation can retain the spatial information of the
sensor measurement points. Besides, the output of deep learning model is the global velocity or pressure field
of airfoil as shown in the right of Fig. 3.
In this case, a total of 1200 labeled data and 800 unlabeled data are generated using finite element sim-
ulation. In order to fully verify the applicability of the proposed method, we divides the labeled data into
different scale partition protocols include 25, 50, 100, 200, 400, and 800. In addition, 400 labeled samples are
set aside as test data.
In order to evaluate the performance of methods, we employ the Mean Absolute Error (MAE) as the
evaluation metric, which is expressed as:
MAE =
1
N
N
(cid:88)
i=1
|ˆyi − yi|
(10)
where yi is the ground truth, ˆy is the prediction, N is the number of samples.
All experiments are implemented based on the Pytorch framework. The model training is completed on
a high-performance computer server, and its computing resource allocation is Intel(R) Xeon(R) Gold 6242
CPU @ 2.80 GHz, Nvidia GTX 3090 GPU with 24GB vRAM, and 500 GB RAM. We initialize the weights
of whole network randomly and train the models with AdamW optimizer. In order to ensure the fairness,
the parameters of the optimizer used in experiments are consistent. The initial learning rate is η = 0.001.
Besides, Cosine Annealing Warm Restarts scheduler is selected as our learning rate policy. In all experiments,
the epoch is fixed as 100, the batch size is set to 8 for both labeled and unlabeled samples.
8
Voronoi tessellationGlobal pressure field3.1.2. Prediction Results and Analysis
Table 1: Performance comparison under different number of labeled data for the airfoils velocity and pressure field.
Number of labeled data
25
50
100
200
400
800
Pressure
2.350 0.745 0.599 0.442 0.402 0.376
Supervision
x-axis velocity 0.543 0.170 0.105 0.087 0.072 0.065
y-axis velocity 0.128 0.508 0.034 0.024 0.021 0.020
Pressure
14.71 6.510 2.570 1.091 0.853 0.890
Mean teacher
x-axis velocity 2.049 0.684 0.297 0.155 0.139 0.127
y-axis velocity 0.842 0.391 0.125 0.059 0.056 0.042
Pressure
2.495 0.875 0.745 0.614 0.515 0.443
Co-training
x-axis velocity 0.549 0.168 0.118 0.105 0.093 0.095
y-axis velocity 0.138 0.056 0.035 0.027 0.024 0.027
Pressure
2.298 0.714 0.531 0.385 0.347 0.337
Self-training
x-axis velocity 0.538 0.161 0.097 0.079 0.063 0.059
y-axis velocity 0.125 0.048 0.029 0.021 0.017 0.017
Pressure
1.637 0.690 0.425 0.298 0.277 0.281
UGE-ST(Ours)
x-axis velocity 0.429 0.121 0.064 0.047 0.037 0.042
y-axis velocity 0.128 0.032 0.019 0.014 0.013 0.013
The prediction results concerning MAE are tabulated in Tab. 1, and the main purpose is to compare
the prediction performances of different methods. The results shows that the proposed UGE-ST significantly
exceeds the supervised baseline and other semi-supervised methods regardless of the number of labels. Taking
pressure field prediction as an example, the performance of UGE-ST surpass the supervised baseline by 30%,
29%, 33%, 31%, and 25%, under 25, 100, 200, 400, and 800 labeled data respectively. Compared with the
self-training, UGE-ST acquired 29%, 20%, 23%, 20%, and 17% improvements, respectively. As for the velocity
in x and y axis, our method also achieves a better performance. Besides, the results also shows that the number
of labeled data affects the model prediction accuracy, and the performance of all models decays significantly
with decreasing of labels number.
It is worth mentioning that other semi-supervised methods, such as Mean teacher and Co-training, achieve
poor prediction accuracy, even worse than the supervised baseline. The reason is that such end-to-end methods
receive poor performance during the training process's early stage, further spoilt pseudo-label with large noise.
As the iterative learning process proceeds, the noise in the pseudo-label accumulates, disrupting the learning
process of the model and eventually leading to a degradation of the model's performance. The self-training
is a two-stage training approach, in which the teacher model is first trained with labeled data, and then the
student model is guided by the teacher model. As the trained teacher model contains less noise than that
in the early training stage, the performance degradation caused by error accumulation is mitigated. In other
9
words, although there is still noise affecting the student model, this two-stage training approach ensures the
performance of student is theoretically not lower than that of the teacher model. And our method can further
improve the performance of the teacher model with the help of ensemble learning on the base of self-training,
while avoiding the noise in the teacher model to affect the learning of the student model by the uncertainty
guided learning and the pre-training student.
Figure 4: Visualization of predictions and errors for pressure field.
The predictions and errors visualization of supervision, self-training and UGE-ST for the pressure field
are shown in Fig. 4. As seen from that, all three methods can predict the trend of the pressure field, and
our approach can achieve less error. As shown in row six of Fig. 4, the predictions of the self-training and
10
PredictionsErrorsUE-ST(Ours)SupervisionSelf-trainingPredictionsPredictionsPredictionsErrorsErrorsErrorssupervised methods have large errors around the airfoil, while our approach suppresses the errors well.
3.2. Electronic devices temperature field reconstruction
3.2.1. Background and experimental setting
The normal work of aircraft systems highly depends on the stable environment temperature and heat
dissipation is essential to guarantee the working environment due to the internally generated heat. Thermal
management of aircraft systems is an effective way to guarantee the proper working environment. Temperature
field reconstruction [26] is a base task to obtain the real-time working environment of aircraft systems, which
is adopt to verify the performance of our method.
Figure 5: Sensors location and temperature field.
To verify the generality of the proposed method, in this case we employ another classical neural network,
viz. MLP, to implement our UGE-ST. The temperature field data is shown in the Fig. 5. The grey dots in
the figure indicate the placed sensors. MLP directly accepts sparse observations of the temperature field as
model inputs while outputting the temperature value of points in the whole field. The temperature field data
size used in this paper is 200 ∗ 200, the number of placed sensors are 20, and we construct a MLP with 5 layers
whose structure is shown in the Tab. 2 .
Layers
Input layer
Hidden layer 1
Hidden layer 2
Hidden layer 3
Output layer
Table 2: The structure of MLP.
Number of neurons
20
128
1280
4800
40000
In this case, a total of 1500 labeled data and 2000 unlabeled data are generated using finite element
simulation. Similar to the first study case, we divides the labeled data into different scale partition protocols
include 25, 50, 100, 200, 500, and 1000. Besides, 500 labeled samples are set aside as test data.
This section also uses MAE as the evaluation metric. All experimental settings are consistent with the first
case, except that the epoch is set to 80.
11
Temperature fieldElectronic components layout3.2.2. Prediction Results and Analysis
The prediction results concerning MAE are tabulated in Tab. 3, and the main purpose is to test the
generalization and superiority of our method. The results shows that the proposed UGE-ST significantly
exceeds other methods in different cases. The performance of UGE-ST surpass the supervised baseline by 33%,
35%, 36%, 30%, 25%, and 24%, under 25, 50, 100, 200, 500, and 1000 labeled data, respectively. Compared
with the self-training, UGE-ST acquired 31%, 29%, 25%, 17%, 20%, and 14% improvements, respectively.
Besides, the results also shows that with the decrease of labeled data numbers, the gain obtained by our
method is increasing. In another words, our method can also achieve competitive results in the case of few
shot.
From the perspective of changes in the number of labeled data, our method achieves an accuracy of 6.018e-
03 with 100 samples, lower than 6.948e-03 acquired by the supervised method under 1000 samples. The
observation shows that our approach can greatly reduce the amount of labeled data required for training with
the same performance. The proposed method can save ten times the number of samples in some cases and at
least two times the number of samples.
The predictions and errors visualization of supervision, self-training and UGE-ST for the temperature field
are shown in Fig. 6. Although supervision and self-training can predict the trend of the temperature field, large
errors still exist. In comparison, the proposed method can outstandingly reduce the error in these regions. As
shown in row six of Fig. 6, the predictions of the self-training and supervised methods have large errors in the
lower left corner, while our approach suppresses the errors well.
Table 3: Performance comparison under different number of labeled data for the temperature field.
Number of labeled data
25
50
100
200
500
1000
Supervision
1.718e-02
1.224e-02
9.403e-03
7.887e-03
7.241e-03
6.948e-03
Mean teacher
2.178e-02
1.974e-02
1.315e-02
1.033e-02
9.225e-03
6.779e-03
Co-training
2.085e-02
1.207e-02
8.550e-03
6.717e-03
6.124e-03
6.580e-03
Self-training
1.654e-02
1.120e-02
8.054e-03
6.624e-03
6.786e-03
6.087e-03
UGE-ST(Ours)
1.146e-02 7.942e-03 6.018e-03 5.529e-03 5.431e-03 5.262e-03
3.3. Ablation Studies
This section conducts the ablation studies to exhibit the roles of ensemble teachers, uncertainty guided
learning and pre-training student. All the experiments are run based on the temperature field reconstruction
task with 200 labeled data.
3.3.1. The influence of ensemble teachers number
The effect of the ensemble teachers is shown in Fig. 7. We set the number of ensemble teachers to 1
(means no ensemble), 2, 3, and 5, respectively. Pseudo-label means the prediction provided by the ensemble
teachers. PT student represent the pre-training student model supervised by the ensemble teachers but without
12
Figure 6: Visualization of predictions and errors for temperature field
13
UE-ST(Ours)SupervisionSelf-trainingPredictionsPredictionsPredictionsErrorsErrorsErrorsuncertainty guided learning. UGE-ST is the model trained only with labeled data based on the pre-training
student.
The results indicate that with the increase of ensemble teachers number, the accuracy of pseudo-label is
significantly improved, further leading to the performance increase of PT student. Although the UGE-ST
is trained based on PT student, the performance is slightly improved. The reason is that this paper uses
pseudo-label and labeled data to train the model successively, which reduces the influence of noise on the
student model and also reduces the impact of pseudo-label on the final performance of the student model. We
finally chose the ensemble number of 3 to balance the accuracy and training cost.
Figure 7: MAE changes with the number of ensemble teachers
3.3.2. The influence of pre-training student
The effect of the pre-training is shown in Tab. 4. We set the ensemble number to 1 to avoid the influence of
ensemble teachers. Pseudo-label means the prediction provided by the one teacher. PT student represent the
pre-training student model supervised by the one teacher but without uncertainty guided learning. UGE-ST is
the model trained only with labeled data based on the PT student. The results show that the method of pre-
training student can well avoid the influence of noise in pseudo-label to the student model. In comparison, the
MAE of self-training which combine labeled data and pseudo-label is 6.624e-03, while our method is 5.763e-03.
Table 4: The influence of the pre-training student.
models Pseudo-label
Self-training PT student UGE-ST
MAE
7.887e-03
6.624e-03
7.647e-03
5.763e-03
14
3.3.3. The influence of uncertainty guided learning
The influence of uncertainty guided learning is shown in Tab. 5. PT student and UGE-ST achieve better
performance when guided by uncertainty. It is worth noting that the gain of PT student from uncertainty
guided learning is greater than that of UGE-ST. The pre-training also causes this phenomenon; the impact
of the pseudo-label on the final performance of the student model is damped due to the successive training of
pseudo-label and labeled data.
Table 5: The influence of uncertainty guided learning under different number of ensemle teachers.
Number of ensemle teachers
2
3
5
w/o uncertainty
PT student
6.926e-03
6.750e-03
6.365e-03
UGE-ST
5.641e-03
5.538e-03
5.531e-03
w/ uncertainty
PT student
6.4e-03
6.446e-03
6.243e-03
UGE-ST
5.618e-03
5.529e-03
5.434e-03
4. Conclusion
In this paper, we propose a semi-supervised method, uncertainty-guided integrated self-training (UGE-
ST), which aims to improve the reconstruction performance with few labeled data. UGE-ST consists of
ensemble teachers, uncertainty-guided learning, and pre-trained students. The ensemble teachers employ
ensemble learning to construct multiple teacher models to guide the training of student models jointly and the
"collective voting" of the ensemble teachers to mitigate the pseudo-label errors generated by individual teacher
models, resulting in the accurate pseudo-label. Uncertainty-guided learning is based on ensemble teachers to
quantify the uncertainty in pseudo-label, forcing students to learn regions with less noise in pseudo-label and
avoiding the propagation and accumulation of noise in the student. Pre-trained student train the student
model separately using pseudo-labeled and labeled data, enabling the student model to forget the noise in
the pre-learned pseudo-label. Experiments show that the uncertainty-guided ensemble self-training method
proposed in this paper can substantially improve the reconstruction performance of the global physics field
with limited labeled data.
Conflict of interest statement
On behalf of all authors, the corresponding author states that there is no conflict of interest.
Replication of results
The code of the proposed method is publicly available at https://github.com/meitounao110/UGE-ST
15
References
[1] K. Fukami, R. Maulik, N. Ramachandra, K. Fukagata, K. Taira, Global field reconstruction from sparse
sensors with voronoi tessellation-assisted deep learning, Nature Machine Intelligence 3 (11) (2021) 945–
951.
[2] W. Yan, D. Tang, Y. Lin, A data-driven soft sensor modeling method based on deep learning and its
application, IEEE Transactions on Industrial Electronics 64 (5) (2016) 4237–4245.
[3] K. Pearson, Liii. on lines and planes of closest fit to systems of points in space, The London, Edinburgh,
and Dublin philosophical magazine and journal of science 2 (11) (1901) 559–572.
[4] H. Wold, Estimation of principal components and related models by iterative least squares, Multivariate
analysis (1966) 391–420.
[5] Q. Jiang, X. Yan, H. Yi, F. Gao, Data-driven batch-end quality modeling and monitoring based on
optimized sparse partial least squares, IEEE Transactions on Industrial Electronics 67 (5) (2019) 4098–
4107.
[6] W. Yan, H. Shao, X. Wang, Soft sensing modeling based on support vector machine and bayesian model
selection, Computers & chemical engineering 28 (8) (2004) 1489–1498.
[7] K. Desai, Y. Badhe, S. S. Tambe, B. D. Kulkarni, Soft-sensor development for fed-batch bioreactors using
support vector regression, Biochemical Engineering Journal 27 (3) (2006) 225–239.
[8] D. Kochkov, J. A. Smith, A. Alieva, Q. Wang, M. P. Brenner, S. Hoyer, Machine learning–accelerated com-
putational fluid dynamics, Proceedings of the National Academy of Sciences 118 (21) (2021) e2101784118.
[9] Q. Hernandez, A. Badias, D. Gonzalez, F. Chinesta, E. Cueto, Deep learning of thermodynamics-aware
reduced-order models from data, Computer Methods in Applied Mechanics and Engineering 379 (2021)
113763.
[10] V. Puzyrev, Deep learning electromagnetic inversion with convolutional neural networks, Geophysical
Journal International 218 (2) (2019) 817–832.
[11] E. Haghighat, M. Raissi, A. Moure, H. Gomez, R. Juanes, A physics-informed deep learning framework
for inversion and surrogate modeling in solid mechanics, Computer Methods in Applied Mechanics and
Engineering 379 (2021) 113741.
[12] Y. Zhang, Z. Gong, X. Zheng, X. Zhao, W. Yao, Semi-supervision semantic segmentation with uncertainty-
guided self cross supervision, arXiv preprint arXiv:2203.05118.
[13] C.-I. Lai, Y.-S. Chuang, H.-Y. Lee, S.-W. Li, J. Glass, Semi-supervised spoken language understanding
via self-supervised speech and language model pretraining, in: ICASSP 2021-2021 IEEE International
Conference on Acoustics, Speech and Signal Processing (ICASSP), IEEE, 2021, pp. 7468–7472.
16
[14] J. E. Van Engelen, H. H. Hoos, A survey on semi-supervised learning, Machine Learning 109 (2) (2020)
373–440.
[15] D. Berthelot, N. Carlini, I. Goodfellow, N. Papernot, A. Oliver, C. A. Raffel, Mixmatch: A holistic
approach to semi-supervised learning, Advances in neural information processing systems 32.
[16] X. Zhai, A. Oliver, A. Kolesnikov, L. Beyer, S4l: Self-supervised semi-supervised learning, in: Proceedings
of the IEEE/CVF International Conference on Computer Vision, 2019, pp. 1476–1485.
[17] Y. Zou, Z. Yu, X. Liu, B. Kumar, J. Wang, Confidence regularized self-training, in: Proceedings of the
IEEE/CVF International Conference on Computer Vision, 2019, pp. 5982–5991.
[18] L. Yang, W. Zhuo, L. Qi, Y. Shi, Y. Gao, St++: Make self-training work better for semi-supervised
semantic segmentation, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern
Recognition, 2022, pp. 4268–4277.
[19] A. Tarvainen, H. Valpola, Mean teachers are better role models: Weight-averaged consistency targets
improve semi-supervised deep learning results, Advances in neural information processing systems 30.
[20] A. Blum, T. Mitchell, Combining labeled and unlabeled data with co-training, in: Proceedings of the
eleventh annual conference on Computational learning theory, 1998, pp. 92–100.
[21] N. Thuerey, K. Weissenow, L. Prantl, X. Hu, Deep learning methods for reynolds-averaged navier–stokes
simulations of airfoil flows, AIAA Journal 58 (1) (2020) 25–36.
[22] Z. Gong, P. Zhong, W. Hu, Statistical loss and analysis for deep learning in hyperspectral image classifi-
cation, IEEE transactions on neural networks and learning systems 32 (1) (2020) 322–333.
[23] Z. Gong, P. Zhong, Y. Yu, W. Hu, S. Li, A cnn with multiscale convolution and diversified metric for
hyperspectral image classification, IEEE Transactions on Geoscience and Remote Sensing 57 (6) (2019)
3599–3618.
[24] O. Ronneberger, P. Fischer, T. Brox, U-net: Convolutional networks for biomedical image segmentation,
in: International Conference on Medical image computing and computer-assisted intervention, Springer,
2015, pp. 234–241.
[25] G. Vorono ̈ı, New applications of continuous parameters to the theory of quadratic forms, Z. Reine Angew.
Math 134 (1908) 198.
[26] X. Chen, Z. Gong, X. Zhao, W. Zhou, W. Yao, A machine learning modelling benchmark for temperature
field reconstruction of heat-source systems, arXiv preprint arXiv:2108.08298.
17
|
|
http://arxiv.org/abs/2302.11939v6 | 2023-10-15T05:07:17 | 2023-02-23T11:37:39 | One Fits All:Power General Time Series Analysis by Pretrained LM | Although we have witnessed great success of pre-trained models in natural
language processing (NLP) and computer vision (CV), limited progress has been
made for general time series analysis. Unlike NLP and CV where a unified model
can be used to perform different tasks, specially designed approach still
dominates in each time series analysis task such as classification, anomaly
detection, forecasting, and few-shot learning. The main challenge that blocks
the development of pre-trained model for time series analysis is the lack of a
large amount of data for training. In this work, we address this challenge by
leveraging language or CV models, pre-trained from billions of tokens, for time
series analysis. Specifically, we refrain from altering the self-attention and
feedforward layers of the residual blocks in the pre-trained language or image
model. This model, known as the Frozen Pretrained Transformer (FPT), is
evaluated through fine-tuning on all major types of tasks involving time
series. Our results demonstrate that pre-trained models on natural language or
images can lead to a comparable or state-of-the-art performance in all main
time series analysis tasks, as illustrated in Figure 1. We also found both
theoretically and empirically that the self-attention module behaviors
similarly to principle component analysis (PCA), an observation that helps
explains how transformer bridges the domain gap and a crucial step towards
understanding the universality of a pre-trained transformer.The code is
publicly available at https://github.com/DAMO-DI-ML/One_Fits_All. | [
"Tian Zhou",
"PeiSong Niu",
"Xue Wang",
"Liang Sun",
"Rong Jin"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11939v6",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11939v6",
"@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"
] | 3
2
0
2
t
c
O
5
1
]
G
L
.
s
c
[
6
v
9
3
9
1
1
.
2
0
3
2
:
v
i
X
r
a
One Fits All:
Power General Time Series Analysis by Pretrained LM
Tian Zhou∗ Peisong Niu∗ Xue Wang∗ Liang Sun Rong Jin†
{tian.zt,niupeisong.nps,xue.w,liang.sun,jinrong.jr}@alibaba-inc.com
Abstract
Although we have witnessed great success of pre-trained models in natural language
processing (NLP) and computer vision (CV), limited progress has been made for
general time series analysis. Unlike NLP and CV where a unified model can be
used to perform different tasks, specially designed approach still dominates in each
time series analysis task such as classification, anomaly detection, forecasting, and
few-shot learning. The main challenge that blocks the development of pre-trained
model for time series analysis is the lack of a large amount of data for training.
In this work, we address this challenge by leveraging language or CV models,
pre-trained from billions of tokens, for time series analysis. Specifically, we refrain
from altering the self-attention and feedforward layers of the residual blocks in the
pre-trained language or image model. This model, known as the Frozen Pretrained
Transformer (FPT), is evaluated through fine-tuning on all major types of tasks
involving time series. Our results demonstrate that pre-trained models on natural
language or images can lead to a comparable or state-of-the-art performance in
all main time series analysis tasks, as illustrated in Figure 1. We also found both
theoretically and empirically that the self-attention module behaviors similarly
to principle component analysis (PCA), an observation that helps explains how
transformer bridges the domain gap and a crucial step towards understanding
the universality of a pre-trained transformer. The code is publicly available at
https://github.com/DAMO-DI-ML/One_Fits_All.
1
Introduction
Time series analysis is a fundamental problem Hyndman & Athanasopoulos (2021) that has played an
important role in many real-world applications Wen et al. (2022), such as retail sales forecasting Böse
et al. (2017); Courty & Li (1999) , imputation of missing data for economic time series Friedman
(1962) anomaly detection for industrial maintenance Gao et al. (2020), and classification of time
series from various domain Ismail Fawaz et al. (2019). Numerous statistical and machine learning
methods have been developed for time series analysis in the past. Inspired by its great success
in natural language processing and computer vision Vaswani et al. (2017); Devlin et al. (2019);
Dosovitskiy et al. (2021); Rao et al. (2021), transformer has been introduced to various time series
tasks with promising results Wen et al. (2023), especially for time series forecasting Lim et al. (2021);
Zhou et al. (2022, 2021); Wu et al. (2021); Nie et al. (2022).
We have recently witnessed the rapid development of foundation models in NLP. The key idea is to
pre-train a large language model from billions of tokens to facilitate model training for downstream
tasks, particularly when we have a few, sometimes even zero, labeled instances. Another advantage of
∗ Equal contribution
† Corresponding authors
37th Conference on Neural Information Processing Systems (NeurIPS 2023).
Figure 1: Model performance comparison on various tasks.
foundation models is that they provide a unified framework for handling diverse tasks, which contrasts
conventional wisdom where each task requires a specially designed algorithm. However, so far, little
progress has been made to exploit pre-trained or foundation models for time series analysis. One main
challenge is the lack of the large amount of data to train a foundation model for time series analysis.
The largest data sets for time series analysis is less than 10GB Godahewa et al. (2021), which is much
smaller than that for NLP. To address this challenge, we propose to leverage pre-trained language
models for general time series analysis. Our approach provides a unified framework for diverse time
series tasks, such as classification, anomaly detection, forecasting, and few-shot or zero-shot learning.
As shown in Figure 1, using the same backbone, our approach performs either on-par or better than
the state-of-the-art methods for all main time series analysis tasks. Besides extensive empirical
studies, we also investigate why a transformer model pre-trained from the language domain can be
adapted to time series analysis with almost no change. Our analysis indicates that the self-attention
modules in the pre-trained transformer acquire the ability to perform certain non-data-dependent
operations through training. These operations are closely linked to principal component analysis
over the input patterns. We believe it is this generic function performed by the self-attention module
that allows trained transformer models to be so-called universal compute engine Lu et al. (2022)
or general computation calculator Giannou et al. (2023). We support our claims by conducting an
empirical investigation of the resemblance in model behaviors when self-attention is substituted with
PCA, and by providing a theoretical analysis of their correlation.
Here we summarize our key contributions as follows:
1. We propose a unified framework that uses a frozen pre-trained language model to achieve a
SOTA or comparable performance in all major types of time series analysis tasks supported
by thorough and extensive experiments, including time series classification, short/long-term
forecasting, imputation, anomaly detection, few-shot and zero-sample forecasting.
2. We found, both theoretically and empirically, that self-attention performs a function similar
to PCA, which helps explain the universality of transformer models.
3. We demonstrate the universality of our approach by exploring a pre-trained transformer
model from another backbond model (BERT) or modality (computer vision) to power the
time series forecasting.
The remainder of this paper is structured as follows. Section 2 briefly summarizes the related work.
Section 3 presents the proposed detailed model structure. In Section 4, we conduct a thorough and
extensive evaluation of the performance of cross-modality time series analysis using our proposed
method in seven main time series analysis tasks compared to various SOTA baseline models. Section 5
2
GPT2-backboneTimesNetPatchTSTETSformerLightTSDLinearStationaryFEDformerAutoformerInformerReformerLong-term ForecastingShort-term ForecastingAnomaly DetectionImputationClassification74.00Zero-shotFew-shot87.000.040.3016.0011.500.4020.500.2276.0065.002.1034.002.201.4016.500.1480.0069.001.3026.00presents various ablation studies, and Section 6 demonstrates the universality of our proposed method
using pre-trained models with another structure or pre-trained from another modality. In Section 7,
we provide a theoretical explanation of the connection between self-attention and PCA. Finally, in
Section 8, we discuss our results and future directions. Due to space limit, more extensive discussion
of related work, experimental results, and theoretical analysis are provided in the Appendix.
2 Related Work
In this section, we provide short reviews of literature in the areas of time series analysis, in-modality
transfer learning, and cross-modality knowledge transfer learning. We postpone the discussion of
works for end-to-end time series analysis to Appendix B, due to the limited space.
In-modality Transfer Learning through pre-trained models
In recent years, a large number of
research works have verified the effectiveness of the pre-trained model from NLP, CV to Vision-
and-Language (VL). Latest studies for NLP focus on learning contextual word embeddings for
downstream tasks. With the increase of computing power, the very deep transformer models have
shown powerful representation ability in various language tasks. Among them, BERT Devlin et al.
(2019) uses transformer encoders and employs masked language modeling task that aims to recover
the random masked tokens within a text. OpenAI proposed GPT Radford & Narasimhan (2018)
that trains transformer decoders on a large language corpus and then fine-tunes on task-specific data.
GPT2 Radford et al. (2019) is trained on larger datasets with much more parameters and can be
transferred to various downstream tasks. Since transformer models can adapt to various inputs, the
idea of pre-training can also be well adapted to visual tasks. DEiT Touvron et al. (2021) proposed a
teacher-student strategy for transformers with convolution neural networks (CNNs) as the teacher
model and achieves competitive performance. BEiT Bao et al. (2022) converts images as visual
tokens and successfully uses the BERT model in CV. However, because of the insufficient training
sample, there is little research on pre-trained models on general time series analysis that cover all
major tasks like CV or NLP domain.
Cross-modality knowledge transfer Since transformers can handle different modal tasks through
tokenizing the inputs to embeddings, it is also an interesting topic whether the transformers have
universal representation ability and can be used for transferring between various domains. The VL
pre-trained model VLMo Bao et al. (2021) proposed a stagewise pre-training strategy that utilizes
frozen attention blocks pre-trained by image-only data to train the language expert. One of the
most related works which transfer knowledge from a pre-trained language model to other domains
is Lu et al. (2022), which studies the strong performance of a frozen pre-trained language model
(LM) compared to an end-to-end transformer alternative learned from other domains' data. Another
relative work for knowledge transfer to the time series is the Voice2series Yang et al. (2021), which
leverages a pre-trained speech processing model for time series classification and achieves superior
performance. To the best of our knowledge, no previous research has investigated cross-modality
knowledge transfer for the time series forecasting task, let alone general time series analysis.
3 Methodology
3.1 Model Structure
The architecture we employ is depicted in Figure 2. We utilize parameters from NLP pretrained
transformer models for time series analysis, with a focus on the GPT2 model Radford et al. (2019).
We also experiment with other models, such as BERT Devlin et al. (2019) and BEiT Bao et al. (2022),
to further demonstrate that the universal performance of cross-domain knowledge transfer exists in a
wide range of pre-trained models.
Frozen Pretrained Block Our architecture retains the positional embedding layers and self-attention
blocks from the pre-trained models. As self-attention layers and FFN (Feedforward Neural Networks)
contain the majority of learned knowledge from pre-trained language models, we opt to freeze the
self-attention blocks while fine-tuning.
Positional Embeddings and Layer Normalization To enhance downstream tasks with minimal
effort, we fine-tune the positional embeddings and layer normalization layer, which is considered a
3
Figure 2: Model architecture. Pre-trained parameters are transferred to the time series forecasting tasks.
Self-attention and Feedforward layers in the transformer blocks are frozen while only the embedding layer,
normalization layers, and output layer require training.
standard practiceLu et al. (2022); Houlsby et al. (2019). As a result, we retrain these components
during fine-tuning.
Input Embedding Given our goal of applying the NLP pre-trained model to various tasks and a
new modality, we must redesign and train the input embedding layer. This layer is responsible for
projecting the time-series data to the required dimensions of the specific pre-trained model. To
accomplish this, we use linear probing, which also reduces the number of parameters required for
training.
Normalization Data normalization is crucial for pre-trained models across various modalities. In
addition to the layer norm utilized in pre-trained LM, we also incorporate a simple data normalization
block, reverse instance norm Kim et al. (2022), to further facilitate knowledge transfer. This
normalization block simply normalizes the input time series using mean and variance, and then adds
them back to the output.
Patching To extract local semantic information, we utilize patching Nie et al. (2022) by aggregating
adjacent time steps to form a single patch-based token. Patching enables a significant increase
in the input historical time horizon while maintaining the same token length and reducing infor-
mation redundancy for transformer models. In our architecture, we apply patching after instance
normalization.
4 Main Time Series Analysis Tasks
Our proposed method excels in various downstream time series analysis tasks through fine-tuning. To
demonstrate the effectiveness of our approach, we conduct extensive experiments on major types of
downstream tasks, including time series classification, anomaly detection, imputation, short/long-term
forecasting and few-shot/zero-shot forecasting. To ensure a fair comparison, we use GPT2-backbone
FPT and adhere to the experimental settings of TimesNet Wu et al. (2023). Due to the space limit,
only the summarized results are presented below except zero-shot forecasting. Full experimental
results of the other six downstream tasks can be found in Appendix D.3, D.2, D.7, H.6, H.7, H.8, H.9
respectively.
Baselines We select representative baselines and cite their results from Wu et al. (2023), which
includes the most recent and quite extensive empirical studies of time series. The baselines in-
clude CNN-based models: TimesNet Wu et al. (2023); MLP-based models: LightTS Zhang et al.
(2022) and DLinear Zeng et al. (2023); Transformer-based models: Reformer Kitaev et al. (2020),
Informer Zhou et al. (2021), Autoformer Wu et al. (2021), FEDformer Zhou et al. (2022), Non-
stationary Transformer Liu et al. (2022), ETSformer Woo et al. (2022), PatchTST Nie et al. (2022).
Besides, N-HiTS Challu et al. (2022) and N-BEATS Oreshkin et al. (2019) are used for short-term
forecasting. Anomaly Transformer Xu et al. (2021) is used for anomaly detection. XGBoost Chen &
Guestrin (2016), Rocket Dempster et al. (2020), LSTNet Lai et al. (2018), LSSL Gu et al. (2021),
4
Instance Norm + PatchingPositional EmbeddingsInput EmbeddingOutput Linear LayerFrozenTransformer BlocksMulti-Head AttentionAdd & Layer NormFeed ForwardAdd & Layer Norm❄""❄"×"Pretrained ParamsFine-tune!Frozen❄Pyraformer Liu et al. (2021), TCN Franceschi et al. (2019) and Flowformer Huang et al. (2022) are
used for classification.
4.1 Main Results
Overall, as shown in Figure 1, GPT2-backbone FPT outperforms other models in most tasks, including
long/short-term forecasting, classification, anomaly detection, imputation, and fow-shot/zero-short
forecasting. This confirms that time series tasks can also take advantage of cross-modality transferred
knowledge. In the following, we use GPT2(K) to represent GPT2-backbone with first K Layers.
4.2
Imputation
Setups We conduct experiments on six popular real-world datasets, including 4 ETT datasets Zhou
et al. (2021) (ETTh1, ETTh2, ETTm1, ETTm2), Electricity and Weather, where the data-missing is
common. Following the settings of TimesNet, different random mask ratios ({12.5%, 25%, 37.5%,
50%}) of time points are selected for the evaluation on various proportions of missing data.
Results The results are shown in Table 1 that GPT2(3) FPT achieves the best performance on most
datasets. Particularly, compared to the previous SOTA TimesNet, GPT2(3) FPT yields a relative
11.5% MSE reduction on ETTh1,and a 4.1% MSE reduction on average on six benchmark datasets.
It verifies that the proposed method can also effectively mine temporal patterns of incomplete time
series.
Table 1: Imputation task. We randomly mask {12.5%, 25%, 37.5%, 50%} time points of 96-length time series.
The results are averaged from 4 different mask ratios. Black: best, Red: second best. Appendix H.8 shows the
full results.
Methods
GPT2(3)
DLinear
MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
Stationary Autoformer
FEDformer
ETSformer
PatchTST
TimesNet
Reformer
Informer
LightTS
ETTm1 0.028 0.105 0.027 0.107 0.047 0.140 0.120 0.253 0.104 0.218 0.093 0.206 0.062 0.177 0.036 0.126 0.051 0.150 0.071 0.188 0.055 0.166
ETTm2 0.021 0.084 0.022 0.088 0.029 0.102 0.208 0.327 0.046 0.151 0.096 0.208 0.101 0.215 0.026 0.099 0.029 0.105 0.156 0.292 0.157 0.280
0.069 0.173 0.078 0.187 0.115 0.224 0.202 0.329 0.284 0.373 0.201 0.306 0.117 0.246 0.094 0.201 0.103 0.214 0.161 0.279 0.122 0.245
ETTh1
0.048 0.141 0.049 0.146 0.065 0.163 0.367 0.436 0.119 0.250 0.142 0.259 0.163 0.279 0.053 0.152 0.055 0.156 0.337 0.452 0.234 0.352
ETTh2
0.090 0.207 0.092 0.210 0.072 0.183 0.214 0.339 0.131 0.262 0.132 0.260 0.130 0.259 0.100 0.218 0.101 0.225 0.222 0.328 0.200 0.313
ECL
Weather 0.031 0.056 0.030 0.054 0.034 0.055 0.076 0.171 0.055 0.117 0.052 0.110 0.099 0.203 0.032 0.059 0.031 0.057 0.045 0.104 0.038 0.087
Average 0.047 0.127 0.049 0.132 0.060 0.144 0.197 0.309 0.123 0.228 0.119 0.224 0.112 0.229 0.056 0.142 0.061 0.151 0.165 0.273 0.134 0.240
4.3 Time Series Classification
Setups To evaluate the model's capacity for high-level
representation learning, we employ sequence-level clas-
sification. Specifically, we follow the same setting as
TimesNet: For classification, 10 multivariate UEA clas-
sification datasets Bagnall et al. (2018) are selected for
evaluation, including gesture, action, audio recognition
medical diagnosis and other practical tasks.
Results As shown in Figure 3, GPT2(6) FPT achieves
an average accuracy of 74.00%, surpassing all baselines
including TimesNet (73.60%). Specifically, compared to
recent published patch-transformer-based models Nie et al.
(2022) , GPT2(6) FPT surpasses it by a large margin 9.0%
which shows the prior NLP transfer knowledge can indeed
help in time series representation.
4.4 Time Series Anomaly Detection
Figure 3: Model comparison in classi-
fication. The results are averaged from
10 subsets of UEA. Appendix H.6 shows
the full results.
Setups Detecting anomalies in time series is vital in industrial applications, ranging from health mon-
itoring to space & earth exploration. We compare models on five commonly used datasets, including
https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams 20112014
https://www.bgc-jena.mpg.de/wetter/
5
AverageAccuracy(%)XGBoostDLinearPatchTSTTCNLightTS.FEDformerPyraformerLSSLETSformerAutoformerReformerLSTNetTransformerInformerRocketStationaryFlowformerTimesNetGPT2(6)66.0067.5067.9070.3070.4070.7070.8070.9071.0071.1071.5071.8071.9072.1072.5072.7073.0073.6074.00SMDSu et al. (2019), MSLHundman et al. (2018), SMAPHundman et al. (2018), SWaTMathur &
Tippenhauer (2016) and PSMAbdulaal et al. (2021). To perform a fair comparison, only the classical
reconstruction error is used for all baseline models to the make the setting the same as TimesNet.
Results Table 2 demonstrates that GPT2(6) FPT also achieves the best performance with the averaged
F1-score 86.72%, surpassing previous SOTA method TimesNet by 1.7%. Thus, in addition to its
proficiency in representing complete sequences for classification purposes, GPT2(6) FPT is capable
of detecting infrequent anomalies within time series.
Table 2: Anomaly detection task. We calculate the F1-score (as %) for each dataset. ∗. in the Transformers
indicates the name of ∗former. Black: best, Red: second best. Appendix H.7 shows the full results.
Methods
GPT2(6)
Ours
SMD
MSL
SMAP
SWaT
PSM
86.89
82.45
72.88
94.23
97.13
TimesNet* PatchTS. ETS. FED. LightTS DLinear Stationary Auto. Pyra. Anomaly.** In.
Re. LogTrans. Trans.
84.61
81.84
69.39
93.02
97.34
84.62
78.70
68.82
85.72
96.08
83.13 85.08
85.03 78.57
69.50 70.76
84.91 93.19
91.76 97.23
82.53
78.95
69.21
93.33
97.15
77.10
84.88
69.26
87.52
93.55
84.72
77.50
71.09
79.88
97.29
85.11 83.04
79.05 84.86
71.12 71.09
92.74 91.78
93.29 82.08
85.49
83.31
71.18
83.10
79.40
81.65 75.32
84.06 84.40
69.92 70.40
81.43 82.80
77.10 73.61
76.21
79.57
69.97
80.52
76.74
76.60
79.56
78.68
69.70
80.37
76.07
76.88
86.72
Average
* We reproduce the results of TimesNet by https://github.com/thuml/Time-Series-Library.
** We replace the joint criterion in Anomaly Transformer with reconstruction error for fair comparison.
84.26 82.57
82.87 84.97
82.46
84.23
82.08
82.79
85.24
80.50
78.83 77.31
4.5 Long-term Forecasting
Setups Eight popular real-world benchmark datasets Wu et al. (2023), including Weather, Traffic
, Electricity, ILI , and 4 ETT datasets (ETTh1, ETTh2, ETTm1, ETTm2), are used for long-term
forecasting evaluation. Additional information regarding the discussion on the input length setting
can be found in the appendix H.10.
Results As shown in Table 3, GPT2(6) FPT achieves comparable performance with PatchTST and
outperforms other baselines. Specifically, compared with recent published SOTA method TimesNet,
GPT2(6) FPT yields a relative 9.3% average MSE reduction.
Table 3: Long-term forecasting task. All the results are averaged from 4 different prediction lengths, that is {24,
36, 48, 60} for ILI and {96, 192, 336, 720} for the others. Black: best, Red: second best. Appendix D.3 shows
the full results.
Methods
GPT2(6)
FEDformer
MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
Stationary Autoformer
ETSformer
PatchTST
TimesNet
Reformer
Informer
LightTS
DLinear
Weather 0.237 0.270 0.259 0.287 0.271 0.334 0.261 0.312 0.249 0.300 0.309 0.360 0.225 0.264 0.288 0.314 0.338 0.382 0.634 0.548 0.803 0.656
0.427 0.426 0.458 0.450 0.542 0.510 0.491 0.479 0.423 0.437 0.440 0.460 0.413 0.430 0.570 0.537 0.496 0.487 1.040 0.795 1.029 0.915
ETTh1
0.346 0.394 0.414 0.427 0.439 0.452 0.602 0.543 0.431 0.447 0.437 0.449 0.330 0.379 0.526 0.516 0.450 0.459 4.431 1.729 6.736 2.191
ETTh2
ETTm1 0.352 0.383 0.400 0.406 0.429 0.425 0.435 0.437 0.357 0.378 0.448 0.452 0.351 0.387 0.481 0.456 0.588 0.517 0.961 0.734 0.799 0.671
ETTm2 0.266 0.326 0.291 0.333 0.293 0.342 0.409 0.436 0.267 0.334 0.305 0.349 0.255 0.315 0.306 0.347 0.327 0.371 1.410 0.810 1.479 0.915
1.925 0.903 2.139 0.931 2.497 1.004 7.382 2.003 2.169 1.041 2.847 1.144 1.443 0.798 2.077 0.914 3.006 1.161 5.137 1.544 4.724 1.445
0.167 0.263 0.192 0.295 0.208 0.323 0.229 0.329 0.166 0.263 0.214 0.327 0.161 0.253 0.193 0.296 0.227 0.338 0.311 0.397 0.338 0.422
0.414 0.294 0.620 0.336 0.621 0.396 0.622 0.392 0.434 0.295 0.610 0.376 0.390 0.264 0.624 0.340 0.628 0.379 0.764 0.416 0.741 0.422
ILI
ECL
Traffic
Average 0.516 0.407 0.596 0.433 0.662 0.473 1.303 0.616 0.562 0.436 0.701 0.489 0.446 0.386 0.633 0.465 0.757 0.511 1.836 0.871 2.081 0.954
4.6 Short-term Forecasting
Setups To fully evaluate different algorithms in forecasting tasks, we also conduct short-term
forecasting (with relatively short forecasting horizon) experiments on M4 Makridakis et al. (2018),
contains marketing data of various frequencies.
Results The results in Table 4 show that the performance of GPT2-backbone (6) FPT is superior to
advanced Transformer-based and MLP-based models, and comparable to TimesNet and N-BEATS.
4.7 Few-shot Forecasting
The large language model (LLM) has demonstrated remarkable performance in both few-shot and
zero-shot learning settings Brown et al. (2020); OpenAI (2023). It can be argued that few-shot and
http://pems.dot.ca.gov
https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html
6
Table 4: Short-term forecasting task on M4. The prediction lengths are in [6, 48] and results are weighted
averaged from several datasets under different sample intervals. Black: best, Red: second best. Appendix H.9
shows the full results.
Methods GPT2(6) TimesNet PatchTST N-HiTS N-BEATS ETSformer LightTS DLinear FEDformer Stationary Autoformer
Informer Reformer
SMAPE 11.991
1.600
MASE
OWA
0.861
11.829
1.585
0.851
12.059
1.623
0.869
11.927
1.613
0.861
11.851
1.599
0.855
14.718
2.408
1.172
13.525
2.111
1.051
13.639
2.095
1.051
12.840
1.701
0.918
12.780
1.756
0.930
12.909
1.771
0.939
14.086
2.718
1.230
18.200
4.223
1.775
zero-shot learning also represent the ultimate tasks for a universal time series forecasting model. To
extensively evaluate the representation power of the GPT2(6) for time series analysis, we conduct
experiments under few-shot and zero-shot learning settings.
Similar to traditional experimental settings, each time series is split into three parts: training data,
validation data, and test data. For few-shot learning, only a certain percentage (10%, 5%) timesteps
of training data are used.
The results of 10% few-shot learning are shown in Table 5. Compared to TimesNet, DLinear,
PatchTST and other methods, GPT2(6) FPT achieves the best performance. Traditionally, CNN-
based and single MLP-based models are considered more data-efficient for training and suitable
for few-shot learning methods. In comparison to convolution-based TimesNet and MLP-based
DLinear models, GPT2(6) FPT demonstrates a relative average MSE reduction of 33.3% and 13.5%
respectively. We add a comparison with traditional algorithms (ETS, ARIMA, NaiveDrift) in the
Appendix D.5 as well, and GTP2(6)FPT also surpass all those traditional methods.
Table 5: Few-shot learning task on 10% data. All the results are averaged from 4 different prediction lengths
({96, 192, 336, 720}). Black: best, Red: second best. Appendix D.2 shows the detailed results of 10% and 5%
data.
Methods
GPT2(6)
Autoformer
MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
FEDformer
ETSformer
Stationary
PatchTST
TimesNet
Reformer
Informer
LightTS
DLinear
Weather 0.238 0.275 0.279 0.301 0.301 0.283 0.284 0.324 0.241 0.279 0.300 0.342 0.318 0.322 0.317 0.359 0.289 0.322 0.597 0.494 0.545 0.469
0.590 0.524 0.869 0.628 0.691 0.599 0.638 0.561 0.633 0.542 0.701 0.596 0.914 0.639 1.179 0.833 1.375 0.877 1.199 0.808 1.249 0.833
ETTh1
ETTh2
0.397 0.421 0.479 0.465 0.608 0.538 0.466 0.475 0.415 0.431 0.488 0.499 0.461 0.454 0.893 0.713 2.655 1.159 3.871 1.512 3.485 1.485
ETTm1 0.464 0.441 0.676 0.537 0.411 0.429 0.721 0.605 0.501 0.466 0.802 0.628 0.797 0.577 0.979 0.714 0.970 0.704 1.192 0.820 1.425 0.856
ETTm2 0.293 0.335 0.319 0.353 0.316 0.368 0.463 0.488 0.296 0.343 1.341 0.930 0.332 0.366 0.447 0.487 0.987 0.755 3.369 1.439 3.977 1.586
0.176 0.269 0.323 0.392 0.180 0.280 0.346 0.428 0.180 0.269 0.431 0.478 0.443 0.479 0.659 0.617 0.441 0.488 1.194 0.890 0.965 0.768
0.440 0.309 0.951 0.535 0.496 0.371 0.663 0.425 0.430 0.305 0.749 0.446 1.453 0.815 1.913 0.936 1.247 0.684 1.534 0.811 1.550 0.821
ECL
Traffic
Average 0.371 0.367 0.556 0.458 0.429 0.409 0.511 0.472 0.385 0.376 0.687 0.559 0.674 0.522 0.912 0.665 1.137 0.712 1.850 0.967 1.888 0.974
4.8 Zero-shot forecasting
This task is used to evaluate the cross datasets adaption ability of our proposed algorithm, i.e. how
well a model is able to perform on dataset A (without any training data from A) when it is trained
from dataset B.
The results are summarized in Table 6. The GPT2(6) FPT model consistently outperforms all recent
state-of-the-art transformer and MLP-based time series forecasting methods. Compared to recently
published state-of-the-art MLP-based method Dlinear, convolution-based method Timesnet, and
transformer-based method Patchtst, GPT2(6)FPT demonstrates a relative average metric reduction
of 13.1%,13.6% and 7.3%, respectively. Also, the proposed method is comparable to N-BEATS
without any meta-learning design and outperforms N-BEATS in the ELECTR dataset. We attribute
this to the knowledge transfer capability from the FPT model.
5 Ablations
In this section, we conduct several ablations on model selection and effectiveness of pre-training. The
detailed results are shown in Appendix H. We introduce several variants, GPT2(0) FPT, GPT2(6)
without freezing and GPT2(6) without pre-training.
Model Selection We separately analyze the number of GPT2 layers and the fine-tuning parameters
selection. The results in Appendix H show that GPT2 with 6-layers is a sound choice compared
to full or few layers and partially freezing can avoid catastrophic forgetting, enabling fine-tuning
without overfitting.
7
Table 6: Zero-shot learning results. Dataset-specific metrics aggregated over each dataset. A lower value
indicates better performance. The source dataset of M3, Tourism, Electricity are M4. For M4, the source data
for N-BEATS is FRED, and M3 for other models. Black: best, Red: second best, Violet: third best. Appendix
D.7 shows full results.
Methods
Metric
M4
sMAPE
M3
sMAPE
TOURISM ELECTR
N D × 100
MAPE
Average
N-BEATS
DLinear
TimesNet
PatchTST
ETSformer
LightTS
Stationary
FEDformer
Autoformer
Informer
Reformer
GPT2(6)
11.70
15.33
13.55
13.22
27.74
13.62
13.32
15.04
20.02
19.04
14.09
13.12
12.44
14.03
14.17
13.06
16.03
17.90
15.29
13.53
15.87
15.82
13.37
13.06
18.82
28.51
28.84
27.10
180.40
66.99
43.75
31.55
40.39
35.82
25.48
22.14
17.8
17.6
19.3
17.3
44.2
19.6
22.0
18.4
33.9
21.2
21.6
17.2
15.19
18.86
18.96
17.67
67.09
29.52
23.59
19.63
27.54
22.97
18.63
16.38
Effectiveness of Pre-training The results are shown in Table 7, GPT2(6) FPT outperforms both
GPT2(0) FPT and GPT2-random-initialized, suggesting that GPT2 with pre-training parameters
can achieve improvement on times series tasks. Besides, GPT2(6) FPT performs better than GPT2-
unfrozen, demonstrating that partially freezing also helps. Also, results in Appendix H.2 show
that random initialized GPT2(6) with freezing performs poorly and the pre-trained knowledge is
instrumental for time series tasks.
Table 7: Ablation study on 10% data. All the results are averaged from 4 different prediction lengths. No Freeze
represents GPT2(6) without freezing, No Pretrain represents GPT2(6) without pre-training. Black: best.
Methods
GPT2(6)
GPT2(0)
No Freeze
No Pretrain
MSE MAE MSE MAE MSE MAE MSE MAE
Weather
ETTh1
ETTh2
0.237
0.427
0.346
0.270
0.426
0.394
0.263
0.874
0.666
0.297
0.647
0.559
0.273
0.753
0.447
0.302
0.596
0.451
0.277
1.326
0.502
0.305
0.743
0.479
6 Exploring Transfer Learning from others: The Unexceptional Nature of
GPT2-based-FPT
We also present experiments on BERT-backbond FPT Devlin et al. (2019) model and the image-
pretrained BEiT-backbone FPT model Bao et al. (2022) to illustrate the generality of pre-trained
models for cross-domain knowledge transferring. The results in Table 8 demonstrate that the ability
of knowledge transfer is not exclusive to GPT2-based pre-trained language models. Subsequently,
our theoretical analysis will shed light on the universality of this phenomenon.
Table 8: Results of frozen pretrained transformer variants on 5% ETTh2 and ETTm2. All the results are averaged
from 4 different prediction lengths. Black: best. Appendix H.5 shows the full results.
Methods
GPT2(6)
DLinear
MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
Autoformer
FEDformer
PatchTST
BERT(6)
BEiT(6)
ETTh2
ETTm2
0.400
0.308
0.433
0.346
0.452
0.318
0.451
0.357
0.459
0.315
0.454
0.357
0.827
0.399
0.615
0.426
0.439
0.314
0.448
0.352
0.441
0.381
0.457
0.404
0.470
0.388
0.489
0.433
7 Training/Inferencing Cost
Analysis of computational cost is helpful for investigating the practicality of the LLM-based model.
The results can be found in table 9. Each baseline model comes in two variants, featuring model
8
Table 9: Training parameters and Training/Inference Cost Comparison
Model
Training Params Training Params Percentages Training Time for 1 step(s)
Inference Time for 1 Batch(s)
FEDformer-32
TimesNet-32
PatchTST-32
FEDformer-768
TimesNet-768
PatchTST-768
GPT-2(3)-768
GPT-2(6)-768
44k
2M
543K
33M
42M
20M
4M
4M
100
100
100
100
100
100
6.12
4.6
0.889
0.747
0.043
0.208
5.723
0.457
0.093
0.104
0.170
0.302
0.022
0.056
2.162
0.123
0.032
0.054
hidden dimensions of 32 and 768, which align with GPT-2's specifications. Furthermore, the majority
of the baseline models consist of three layers. We assessed the computational cost using a batch from
ETTh2 (with a batch size of 128) on a 32G V100 GPU.
The results indicate that GPT-2(3) has substantially enhanced time efficiency and reduced parameter
quantity compared to baselines with the same model dimension. This was a surprise since we initially
anticipated that this large language model might be slower. However, we surmise that the efficient
optimization of huggingface's GPT model implementation primarily accounts for such a significant
improvement in time costs. Furthermore, GPT-2(3) and GPT-2(6) demonstrate a mere 6.12% and
4.60% proportion of learnable parameters among the overall parameter size, respectively.
8 Towards Understanding the Universality of Transformer: Connecting
Self-Attention with PCA
The observation, i.e. we can directly use a trained LM for time series forecasting without having
to modify its model, makes us believe that the underlying model is doing something very generic
and independent from texts despite it being trained from text data. Our analysis aims to show that
part of this generic function can be related to PCA, as minimizing the gradient with respect to the
self-attention layer seems to do something similar to PCA. In this section, we take the first step
towards revealing the generality of self-attention by connecting the self-attention with principal
component analysis (PCA). Moreover, when coming the question of why fine-tuning is restricted to
the embedding layer and layer norm, following our hypothesis that the pre-trained LM as a whole
performs something generic, partially fine-tuning any of its components may break the generic
function and lead to relatively poor performance for time series analysis.
For each layer, we calculate and perform statistical analysis of the pairwise token similarity values.
Specifically, we denote each output feature map with shape of (b, n, d), where b is the batch size,
n is the number of tokens, and d is the dimension of each token feature. We calculate the cosine
similarity, and the resulting pairwise similarity matrix of shape (b, n, n). Next we count the number
of occurrences of similarity values within each interval as a simple statistical analysis.
Our analysis is motivated by the observation that the within-layer token similarity increases with
deeper layers in transformer. We report the layer-wise average token cosine similarity on ETTh2
dataset in Figure 4 (a, c), where we mix weights from pre-trained LM with weights randomly sampled
from Gaussian distribution. Here we summarize our observations: a) in a randomly initialed GPT2
(6) model, the token similarity is low among all layers (0.1 − 0.2); b) when gradually switched to the
pretrained GPT2 model, the token similarity significantly increases in the deep layers and eventually
reaches more than 0.9 in the last layer. One potential explanation for the increasing token similarity
is that all the token vectors are projected into the low-dimensional top eigenvector space of input
patterns. To verify this idea, we further conduct experiments where we replace the self-attention
module with PCA and find token similarity patterns remain unchanged according to Figure 4 (b),
which further justifies the potential connection between PCA and self-attention.
To build the theoretical connection between PCA and self-attention, we first analyze the gradi-
ent structure of self-attention. Let X = (x1, . . . , xN )⊤ ∈ RN ×D be the input pattern, and
let f (X) = (f1(X), . . . , fN (x))⊤ : RN ×D (cid:55)→ RN ×D be the function for self-attention, i.e.,
fi(X) = softmax(XAX ⊤)X where A = WQW ⊤
K ∈ RD×D.
9
Figure 4: (a, c) The performance and token similarity within samples with respect to each layer with different
random mixed ratio. Pre-trained parameters are mixed with random initial parameters according to certain
proportions. (b) Token similarity within samples when replacing the attention with PCA.
Lemma 8.1. Let
the Jacobian J =
(cid:104) ∂fi(X)
∂xj
(cid:105)N
i,j=1
input pattern,
then we have
(cid:12)
(cid:12)xj − (cid:80)N
(cid:12)
|J|2 ≤ |A|2
(cid:12)
2
(cid:12)
(cid:12)
(cid:80)N
i=1
+ |A|2
2
(cid:80)N
(cid:0)Pi,i + 1
(cid:80)N
i̸=j Pi,j
∆ = |A|2
i Axk) .
This lemma reveals an important gradient structure of J. The proof of essentially follows the analysis
in Kim et al. (2021), and we include it in Appendix G for completeness.
k=1 Pi,kxk
and Pi,j =
j=1 |xi|2
(cid:80)N
represent
(cid:1) (cid:12)
(cid:12)xi − (cid:80)N
(cid:12)
2
the gradient f (X) w.r.t
the
j=1 Pi,jxj
+ ∆ where
2
(cid:12)
(cid:12)
(cid:12)
exp(x⊤
k=1 exp(x⊤
i Axj )
Using the gradient structure revealed in Lemma 8.1, we can connect self-attention with PCA. In
order to minimize the norm of gradient |J|2, we essentially need to make (cid:80)N
j=1 Pi,jxj|2
small. When A is small and all the input patterns are centered at 0 (i.e. (cid:80)N
i=1 xi = 0), we have
(cid:80)N
i=1 |xi − X ⊤XAxi|2.
i=1 |xi − X ⊤Pi,:|2 ≈ (cid:80)N
i=1 |xi − (cid:80)N
The theorem below shows that A minimizing the objective (cid:80)N
largest m eigenvectors of X ⊤X where m is the rank of A.
Theorem 1. Let WQ and WK be matrices of size D × m. Let λ1 ≥ λ2 ≥ ... ≥ λD be the
eigenvalues of X ⊤X ranked in descending order, and let vi ∈ RD, i = 1, . . . , D be the corresponding
eigenvectors. The optimal solution A∗ that minimizes (cid:80)N
i=1 |xi − X ⊤XAxi|2 is given by A =
(cid:80)m
i=1 |xi − X ⊤XAxi|2 contains the
1
λi
viv⊤
i .
i=1
The proof of Theorem 1 can be found in Appendix G. Following Theorem 1, through the training of
pushing gradient to zero, self-attention learns to perform a function closely related to PCA.
9 Conclusions
In this paper, we developed a foundation model for time series analysis, based on pre-trained model
from NLP or CV, that can (a) facilitate the model training for downstream tasks, and (b) provide
unified framework for diverse time series analysis tasks. Our empirical studies show that the proposed
method performs on par or better than the state-of-the-art approaches on almost all time series tasks.
We also examine the universality of transformer by connecting self-attention with PCA, an important
step towards understanding how generative models work in practice. On the other hand, we do
recognize some limitations of our work: the zero-shot performance of our approach is still behind
N-beat on several datasets, and our analysis of the generality of transformer is still in the early stage.
Moving forward, we plan to improve the performance of our approach by exploiting the parameter
efficient fine-tuning approaches which usually introduce additional structures into the pre-trained
model for better adaption. To better understand the universality of transformer, we also plan to
examine it from the viewpoint of n-gram language model, an approach that is taken by Elhage et al.
(2021); Olsson et al. (2022). In Appendix F, we include our initial analysis along this direction.
10
Random添加(label是反的)Random Ratio 100%Random Ratio 90%Random Ratio 80%Random Ratio 40%Random Ratio 20%Random Ratio 0%(b) Token Similarity: PCA as Attention(c) Token Similarity: Different Replace RatiosReplace Ratio (%)(a) Performance: Different Replace RatiosAcknowledgement
We would like to express our sincere gratitude to Ziqing Ma, Qingsong Wen, Mengni Ye, and Tao
Yao for their valuable suggestions and proofreading assistance throughout the development of this
paper. Their insightful feedback and attention to detail greatly improved the quality and clarity of our
work.
References
Abdulaal, A., Liu, Z., and Lancewicki, T. Practical approach to asynchronous multivariate time
series anomaly detection and localization. In Proceedings of the 27th ACM SIGKDD conference
on knowledge discovery & data mining, pp. 2485–2494, 2021.
Bagnall, A., Dau, H. A., Lines, J., Flynn, M., Large, J., Bostrom, A., Southam, P., and Keogh, E. The
uea multivariate time series classification archive, 2018. arXiv preprint arXiv:1811.00075, 2018.
Bao, H., Wang, W., Dong, L., Liu, Q., Mohammed, O. K., Aggarwal, K., Som, S., and Wei, F.
Vlmo: Unified vision-language pre-training with mixture-of-modality-experts. arXiv preprint
arXiv:2111.02358, 2021.
Bao, H., Dong, L., Piao, S., and Wei, F. BEit: BERT pre-training of image transformers.
In
International Conference on Learning Representations, 2022.
Böse, J.-H., Flunkert, V., Gasthaus, J., Januschowski, T., Lange, D., Salinas, D., Schelter, S., Seeger,
M., and Wang, Y. Probabilistic demand forecasting at scale. Proceedings of the VLDB Endowment,
10(12):1694–1705, 2017.
Box, G. E. and Jenkins, G. M. Some recent advances in forecasting and control. Journal of the Royal
Statistical Society. Series C (Applied Statistics), 17(2):91–109, 1968.
Box, G. E. and Pierce, D. A. Distribution of residual autocorrelations in autoregressive-integrated
moving average time series models. Journal of the American statistical Association, 65(332):
1509–1526, 1970.
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam,
P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T. J., Child, R.,
Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray,
S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D.
Language models are few-shot learners. ArXiv, abs/2005.14165, 2020.
Challu, C., Olivares, K. G., Oreshkin, B. N., Garza, F., Mergenthaler, M., and Dubrawski, A. N-hits:
Neural hierarchical interpolation for time series forecasting. arXiv preprint arXiv:2201.12886,
2022.
Chen, T. and Guestrin, C. Xgboost: A scalable tree boosting system. KDD '16, 2016.
Chung, J., Gulcehre, C., Cho, K., and Bengio, Y. Empirical evaluation of gated recurrent neural
networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
Courty, P. and Li, H. Timing of seasonal sales. The Journal of Business, 72(4):545–572, 1999.
Dempster, A., Petitjean, F., and Webb, G. I. ROCKET: Exceptionally fast and accurate time series
classification using random convolutional kernels. Data Mining and Knowledge Discovery, 34(5):
1454–1495, 2020.
Devlin, J., Chang, M., Lee, K., and Toutanova, K. BERT: pre-training of deep bidirectional trans-
formers for language understanding. In Proceedings of the 2019 Conference of the North Ameri-
can Chapter of the Association for Computational Linguistics: Human Language Technologies
(NAACL-HLT), Minneapolis, MN, USA, June 2-7, 2019, pp. 4171–4186, 2019.
Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani,
M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16
words: Transformers for image recognition at scale. In 9th International Conference on Learning
Representations (ICLR), Austria, May 3-7, 2021, 2021.
11
Elhage, N., Nanda, N., Olsson, C., Henighan, T., Joseph, N., Mann, B., Askell, A., Bai, Y., Chen, A.,
Conerly, T., DasSarma, N., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Jones, A.,
Kernion, J., Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J., McCandlish, S.,
and Olah, C. A mathematical framework for transformer circuits. Transformer Circuits Thread,
2021. https://transformer-circuits.pub/2021/framework/index.html.
Franceschi, J.-Y., Dieuleveut, A., and Jaggi, M. Unsupervised scalable representation learning for
multivariate time series. Advances in neural information processing systems, 32, 2019.
Friedman, M. The interpolation of time series by related series. J. Amer. Statist. Assoc, 1962.
Gao, J., Song, X., Wen, Q., Wang, P., Sun, L., and Xu, H. RobustTAD: Robust time series anomaly
detection via decomposition and convolutional neural networks. KDD Workshop on Mining and
Learning from Time Series (KDD-MileTS'20), 2020.
Giannou, A., Rajput, S., Sohn, J.-y., Lee, K., Lee, J. D., and Papailiopoulos, D. Looped Transformers
as Programmable Computers. arXiv e-prints, art. arXiv:2301.13196, January 2023. doi: 10.48550/
arXiv.2301.13196.
Godahewa, R., Bergmeir, C., Webb, G. I., Hyndman, R. J., and Montero-Manso, P. Monash time
series forecasting archive. In Neural Information Processing Systems Track on Datasets and
Benchmarks, 2021.
Gu, A., Goel, K., and Ré, C. Efficiently modeling long sequences with structured state spaces. arXiv
preprint arXiv:2111.00396, 2021.
Hochreiter, S. and Schmidhuber, J. Long short-term memory. Neural computation, 9(8):1735–1780,
1997.
Houlsby, N., Giurgiu, A., Jastrzebski, S., Morrone, B., De Laroussilhe, Q., Gesmundo, A., Attariyan,
M., and Gelly, S. Parameter-efficient transfer learning for nlp. In International Conference on
Machine Learning, pp. 2790–2799. PMLR, 2019.
Huang, Z., Shi, X., Zhang, C., Wang, Q., Cheung, K. C., Qin, H., Dai, J., and Li, H. Flowformer:
A transformer architecture for optical flow. In Computer Vision–ECCV 2022: 17th European
Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XVII, pp. 668–685. Springer,
2022.
Hundman, K., Constantinou, V., Laporte, C., Colwell, I., and Soderstrom, T. Detecting spacecraft
anomalies using lstms and nonparametric dynamic thresholding. In Proceedings of the 24th ACM
SIGKDD international conference on knowledge discovery & data mining, pp. 387–395, 2018.
Hyndman, R. and Athanasopoulos, G. Forecasting: Principles and Practice. OTexts, Australia, 3rd
edition, 2021.
Ismail Fawaz, H., Forestier, G., Weber, J., Idoumghar, L., and Muller, P.-A. Deep learning for time
series classification: a review. Data Mining and Knowledge Discovery, 33(4):917–963, 2019.
Kim, H., Papamakarios, G., and Mnih, A. The lipschitz constant of self-attention. In International
Conference on Machine Learning, pp. 5562–5571. PMLR, 2021.
Kim, T., Kim, J., Tae, Y., Park, C., Choi, J.-H., and Choo, J. Reversible instance normalization for
accurate time-series forecasting against distribution shift. In International Conference on Learning
Representations, 2022.
Kitaev, N., Kaiser, L., and Levskaya, A. Reformer: The efficient transformer. arXiv preprint
arXiv:2001.04451, 2020.
Lacoste-Julien, S., Schmidt, M., and Bach, F. A simpler approach to obtaining an o (1/t) convergence
rate for the projected stochastic subgradient method. arXiv preprint arXiv:1212.2002, 2012.
Lai, G., Chang, W.-C., Yang, Y., and Liu, H. Modeling long-and short-term temporal patterns with
deep neural networks. In The 41st international ACM SIGIR conference on research & development
in information retrieval, pp. 95–104, 2018.
12
Lim, B., Arık, S. Ö., Loeff, N., and Pfister, T. Temporal fusion transformers for interpretable
multi-horizon time series forecasting. International Journal of Forecasting, 2021.
Liu, S., Yu, H., Liao, C., Li, J., Lin, W., Liu, A. X., and Dustdar, S. Pyraformer: Low-complexity pyra-
midal attention for long-range time series modeling and forecasting. In International conference
on learning representations, 2021.
Liu, Y., Wu, H., Wang, J., and Long, M. Non-stationary transformers: Exploring the stationarity in
time series forecasting. In Advances in Neural Information Processing Systems, 2022.
Lu, K., Grover, A., Abbeel, P., and Mordatch, I. Frozen pretrained transformers as universal
computation engines. Proceedings of the AAAI Conference on Artificial Intelligence, 36(7):
7628–7636, Jun. 2022.
Makridakis, S., Spiliotis, E., and Assimakopoulos, V. The m4 competition: Results, findings,
conclusion and way forward. International Journal of Forecasting, 34(4):802–808, 2018.
Mathur, A. P. and Tippenhauer, N. O. Swat: A water treatment testbed for research and training on
ics security. In 2016 international workshop on cyber-physical systems for smart water networks
(CySWater), pp. 31–36. IEEE, 2016.
Nie, Y., Nguyen, N. H., Sinthong, P., and Kalagnanam, J. A time series is worth 64 words: Long-term
forecasting with transformers. ArXiv, abs/2211.14730, 2022.
Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T., Mann, B., Askell, A.,
Bai, Y., Chen, A., Conerly, T., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Johnston,
S., Jones, A., Kernion, J., Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J.,
McCandlish, S., and Olah, C. In-context learning and induction heads. Transformer Circuits Thread,
2022. https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html.
OpenAI. Gpt-4 technical report. ArXiv, abs/2303.08774, 2023.
Oreshkin, B. N., Carpov, D., Chapados, N., and Bengio, Y. N-beats: Neural basis expansion analysis
for interpretable time series forecasting. arXiv preprint arXiv:1905.10437, 2019.
Oreshkin, B. N., Carpov, D., Chapados, N., and Bengio, Y. Meta-learning framework with applica-
tions to zero-shot time-series forecasting. In Proceedings of the AAAI Conference on Artificial
Intelligence, number 10, pp. 9242–9250, 2021.
Radford, A. and Narasimhan, K. Improving language understanding by generative pre-training. 2018.
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Language models are
unsupervised multitask learners. 2019.
Rao, Y., Zhao, W., Zhu, Z., Lu, J., and Zhou, J. Global filter networks for image classification.
Advances in Neural Information Processing Systems (NeurIPS), 34, 2021.
Su, Y., Zhao, Y., Niu, C., Liu, R., Sun, W., and Pei, D. Robust anomaly detection for multivariate
time series through stochastic recurrent neural network. In Proceedings of the 25th ACM SIGKDD
international conference on knowledge discovery & data mining, pp. 2828–2837, 2019.
Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., and Jégou, H. Training data-efficient
image transformers & distillation through attention. In International Conference on Machine
Learning, pp. 10347–10357. PMLR, 2021.
Vardi, G., Yehudai, G., and Shamir, O. On the optimal memorization power of relu neural networks.
arXiv preprint arXiv:2110.03187, 2021.
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser Lukasz, and
Polosukhin, I. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
Wang, P., Wang, X., Wang, F., Lin, M., Chang, S., Li, H., and Jin, R. Kvt: k-nn attention for boosting
vision transformers. In Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel,
October 23–27, 2022, Proceedings, Part XXIV, pp. 285–302. Springer, 2022.
13
Wang, T. and Isola, P. Understanding contrastive representation learning through alignment and
uniformity on the hypersphere. ArXiv, abs/2005.10242, 2020.
Wen, Q., Yang, L., Zhou, T., and Sun, L. Robust time series analysis and applications: An industrial
perspective. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and
Data Mining, pp. 4836–4837, 2022.
Wen, Q., Zhou, T., Zhang, C., Chen, W., Ma, Z., Yan, J., and Sun, L. Transformers in time series: A
survey. In International Joint Conference on Artificial Intelligence(IJCAI), 2023.
Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf,
R., Funtowicz, M., Davison, J., Shleifer, S., von Platen, P., Ma, C., Jernite, Y., Plu, J., Xu, C.,
Scao, T. L., Gugger, S., Drame, M., Lhoest, Q., and Rush, A. M. Transformers: State-of-the-
art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods
in Natural Language Processing: System Demonstrations, pp. 38–45, Online, October 2020.
Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020.
emnlp-demos.6.
Woo, G., Liu, C., Sahoo, D., Kumar, A., and Hoi, S. Etsformer: Exponential smoothing transformers
for time-series forecasting. arXiv preprint arXiv:2202.01381, 2022.
Wu, H., Xu, J., Wang, J., and Long, M. Autoformer: Decomposition transformers with auto-
correlation for long-term series forecasting. In Advances in Neural Information Processing Systems
(NeurIPS), pp. 101–112, 2021.
Wu, H., Hu, T., Liu, Y., Zhou, H., Wang, J., and Long, M. Timesnet: Temporal 2d-variation
modeling for general time series analysis. In The Eleventh International Conference on Learning
Representations, 2023. URL https://openreview.net/forum?id=ju_Uqw384Oq.
Xu, J., Wu, H., Wang, J., and Long, M. Anomaly transformer: Time series anomaly detection with
association discrepancy. arXiv preprint arXiv:2110.02642, 2021.
Yang, C.-H. H., Tsai, Y.-Y., and Chen, P.-Y. Voice2series: Reprogramming acoustic models for time
series classification. In International Conference on Machine Learning, pp. 11808–11819, 2021.
Yun, C., Chang, Y.-W., Bhojanapalli, S., Rawat, A. S., Reddi, S., and Kumar, S. O (n) connections
are expressive enough: Universal approximability of sparse transformers. Advances in Neural
Information Processing Systems, 33:13783–13794, 2020.
Zeng, A., Chen, M., Zhang, L., and Xu, Q. Are transformers effective for time series forecasting?
2023.
Zhang, T., Zhang, Y., Cao, W., Bian, J., Yi, X., Zheng, S., and Li, J. Less is more: Fast mul-
tivariate time series forecasting with light sampling-oriented mlp structures. arXiv preprint
arXiv:2207.01186, 2022.
Zhou, H., Zhang, S., Peng, J., Zhang, S., Li, J., Xiong, H., and Zhang, W. Informer: Beyond efficient
transformer for long sequence time-series forecasting. In Proceedings of AAAI, 2021.
Zhou, T., Ma, Z., Wen, Q., Wang, X., Sun, L., and Jin, R. FEDformer: Frequency enhanced
decomposed transformer for long-term series forecasting. In Proc. 39th International Conference
on Machine Learning (ICML 2022), 2022.
14
A Visualization
In order to clarify the representation ability more clearly, Figure 5 provides showcases of imputation,
long-term forecasting and few-shot forecasting. Especially for few-shot learning, GPT2(6) can
accurately forecast, while TimesNet and DLinear fail in this task.
Figure 5: Visualization of imputation, long-term forecasting and few-shot forecasting.
B Related Works
We have presented a novel general time series analysis model in this paper, and to the best of our
knowledge, there has been limited work on similar comprehensive methods for time series analysis.
The most closely related field is time series forecasting, where transformer models have gained
widespread popularity. Therefore, our focus in this related work will primarily be on introducing the
end-to-end time series forecasting method.
Time series forecasting models can be roughly divided into three categories, ranging from the classic
ARIMA models to the most recent transformer models. The first generation of well-discussed models
can be dated back to auto-regressive family, such as ARIMA Box & Jenkins (1968); Box & Pierce
(1970) that follows the Markov process and recursively execute sequential forecasting. However,
it is limited to stationary sequences while most time series is non-stationary. Additionally, with
the bloom of deep neural networks, recurrent neural networks (RNNs), such as LSTM Hochreiter
& Schmidhuber (1997) and GRU Chung et al. (2014), were designed for sequential tasks. Yet the
recurrent model is inefficient for training and long-term dependencies are still under resolved.
Recently, transformer models have achieve great progress in NLP Vaswani et al. (2017); Devlin et al.
(2019); Radford et al. (2019) and CV Dosovitskiy et al. (2021); Bao et al. (2022) tasks. Also, a large
amount of transformer models are proposed to apply to time series forecasting Wen et al. (2023). In
the following, we briefly introduce several representative algorithms. Informer Zhou et al. (2021)
15
(a) Imputation on ETTh1 12.5%GPT2(3)TimesNetDLinear(b) Long-term forecasting on ETTm1GPT2(6)TimesNetDLinear(c) Few-shot forecasting on ETTh2GPT2(6)TimesNetDLinearproposes a probability sparse attention mechanism to deal with long-term dependencies. Autoformer
Wu et al. (2021) introduces a decomposition transformer architecture and replaces the attention
module with an Auto-Correlation mechanism. FEDformer Zhou et al. (2022) uses Fourier enhanced
structure to improve computational efficiency and achieves linear complexity. Similar to patching in
ViT Dosovitskiy et al. (2021), PatchTST Nie et al. (2022) employs segmentation of time series that
divide a sequence into patches to increase input length and reduce information redundancy. Besides,
a simple MLP-based model DLinear Zeng et al. (2023) outperforms most transformer models and it
validates channel-independence works well in time series forecasting. Recently, TimesNet Wu et al.
(2023) has treated time series as a 2D signal and utilized a convolution-based inception net backbone
to function as a comprehensive time series analysis model. This work is closely related to our tasks
in this paper.
C Dataset Details
In this section, we separately summarize dataset details long/short-term forecasting and few-shot/zero-
shot forecasting.
Datasets of Long-term Forecasting and Few-shot Learning The details of datasets are shown as
follows: 1) ETT datasets Zhou et al. (2021) contain electricity load of various resolutions (ETTh &
ETTm) from two electricity stations. 2) Weather contains 21 meteorological indicators of Germany
within 1 year; 3) Illness contains the influenza-like illness patients in the United States; 4) Electricity
dataset contains the electricity consumption; 5) Traffic dataset contains the occupation rate of freeway
system across the State of California. Table 10 summarizes details of feature statistics.
Similar to PatchTST Nie et al. (2022), Exchange is not contained. Zeng et al. (2023) shows that
simply repeating the last value in the look-back window can outperform or be comparable to the best
results. Also, ILI is not used for few-shot learning for the limited quantity that is hard to follow the
definition of few-shot.
Table 10: Dataset details of few-shot learning.
Dataset
Length Dimension
Frequency
ETTh
ETTm
Weather
ILI
Electricity
Traffic
17420
69680
52696
966
26304
17544
7
7
22
7
321
862
1 hour
15 min
10 min
7 days
1 hour
1 hour
Datasets of Short-term Forecasting and Zero-shot Learning The details of short-term forecasting
and zero-shot learning datasets are shown as follows: 1) M4 is a large and diverse dataset that contains
time series of various frequencies and fields, including business, financial and economic forecasting;
2) M3 is smaller than M4, but also contains time series from diverse domains and frequencies; 3)
TOURISM is the dataset of tourism activities with different frequencies and contains a much higher
fraction of erratic series compared with M4; 4) ELECTR represents the electricity usage monitoring
of 370 customers over three years. Table 6 summarizes details of the datasets and zero-shot mapping
between source and target.
D Experimental Details
All the deep learning networks are implemented in PyTorch and trained on NVIDIA V100 32GB
GPUs. We use the pre-trained models from Wolf et al. (2020) for experiments. For few-shot learning,
an early stopping counter is employed to stop the training process after three epochs if no loss
degradation on the valid set is observed. Plus, we convert the multivariate data into univariate data.
Specifically, we treat each feature of the sequence as a single time series. This is mainly for memory
efficiency after patching of GPT2(6) and previous works, DLinear and PatchTST, have proved the
effectiveness of channel-independence.
16
Table 11: Datasets and mapping details of zero-shot learning.
M3 Yearly
M3 Quarterly
M3 Monthly
M3 Others
M4 Yearly
M4 Quarterly
M4 Monthly
M4 Weekly
M4 Daily
M4 Hourly
TOURISM Yearly
TOURISM Quarterly
TOURISM Monthly
Dataset
Length Horizon
Mapping
M4
M3
645
756
1428
174
23000
24000
48000
359
4227
414
518
427
366
6
8
18
8
6
8
18
13
14
48
4
8
24
Yearly
Quarterly
Monthly
Monthly
-
-
-
-
-
-
-
-
-
-
Yearly
Quarterly
Monthly
Monthly
Monthly
Monthly
Yearly
Yearly
Quarterly Quarterly
Monthly Monthly
ELECTR
1311
168
Hourly
Monthly
D.1 Accuracy Metrics
For long-term/short-term forecasting and few-shot forecasting, we use mean square error (MSE)
and mean absolute error (MAE) as metrics. For zero-shot learning, mean absolute percentage error
(MAPE) is used for TOURISM; symmetric MAPE (sMAPE) is used for M3 and M4; normalized
deviation (ND) is used for ELECTR. All experiments are repeated 3 times and the mean of the metrics
is used in the final results.
D.2 Detailed Definition and Results for Few-shot and Long-term Forecasting
Task Definition Since Zeng et al. (2023) and Nie et al. (2022) have verified that channel-independence
works well for time series datasets, we treat each multivariate series as multiple independent univariate
series. Similar to traditional experimental settings, each time series is split into three parts: training
data, validation data, and test data. For the few-shot forecasting task, only a certain percentage (5%,
10%) timesteps of training data are used, and the other two parts remain unchanged. The evaluation
metrics remain the same as for classic multivariate time series forecasting. We repeat this experiment
3 times and report the average metrics in the following experiments.
Detail Experiment Tables for Few-shot Time-Series Forecasting in Table 12 and Table 13
17
W
1
h
T
T
E
2
h
T
T
E
1
m
T
T
E
2
m
T
T
E
L
C
E
Table 12: Few-shot learning results on 5% data. We use prediction length O ∈ {96, 192, 336, 720}.
A lower MSE indicates better performance, and the best results are highlighted in bold. '-' means
that 5% time series is not sufficient to constitute a training set.
Methods
GPT2(6)
GPT2(0)
DLinear
PatchTST
TimesNet
FEDformer Autoformer
Stationary
ETSformer
LightTS
Informer
Reformer
Metric MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
r 96
e
h
t
a
e
0.175 0.230 0.191 0.243 0.184 0.242 0.171 0.224 0.207 0.253 0.229 0.309 0.227 0.299 0.215 0.252 0.218 0.295 0.230 0.285 0.497 0.497 0.406 0.435
192 0.227 0.276 0.244 0.289 0.228 0.283 0.230 0.277 0.272 0.307 0.265 0.317 0.278 0.333 0.290 0.307 0.294 0.331 0.274 0.323 0.620 0.545 0.446 0.450
336 0.286 0.322 0.303 0.332 0.279 0.322 0.294 0.326 0.313 0.328 0.353 0.392 0.351 0.393 0.353 0.348 0.359 0.398 0.318 0.355 0.649 0.547 0.465 0.459
720 0.366 0.379 0.391 0.393 0.364 0.388 0.384 0.387 0.400 0.385 0.391 0.394 0.387 0.389 0.452 0.407 0.461 0.461 0.401 0.418 0.570 0.522 0.471 0.468
Avg. 0.263 0.301 0.282 0.314 0.263 0.308 0.269 0.303 0.298 0.318 0.309 0.353 0.310 0.353 0.327 0.328 0.333 0.371 0.305 0.345 0.584 0.527 0.447 0.453
0.543 0.506 0.825 0.638 0.547 0.503 0.557 0.519 0.892 0.625 0.593 0.529 0.681 0.570 0.952 0.650 1.169 0.832 1.483 0.91 1.225 0.812 1.198 0.795
96
192 0.748 0.580 1.220 0.778 0.720 0.604 0.711 0.570 0.940 0.665 0.652 0.563 0.725 0.602 0.943 0.645 1.221 0.853 1.525 0.93 1.249 0.828 1.273 0.853
336 0.754 0.595 1.852 0.965 0.984 0.727 0.816 0.619 0.945 0.653 0.731 0.594 0.761 0.624 0.935 0.644 1.179 0.832 1.347 0.87 1.202 0.811 1.254 0.857
720
-
Avg. 0.681 0.560 1.299 0.793 0.750 0.611 0.694 0.569 0.925 0.647 0.658 0.562 0.722 0.598 0.943 0.646 1.189 0.839 1.451 0.903 1.225 0.817 1.241 0.835
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
96
0.376 0.421 0.551 0.507 0.442 0.456 0.401 0.421 0.409 0.420 0.390 0.424 0.428 0.468 0.408 0.423 0.678 0.619 2.022 1.006 3.837 1.508 3.753 1.518
192 0.418 0.441 0.765 0.610 0.617 0.542 0.452 0.455 0.483 0.464 0.457 0.465 0.496 0.504 0.497 0.468 0.845 0.697 3.534 1.348 3.975 1.933 3.516 1.473
336 0.408 0.439 0.767 0.614 1.424 0.849 0.464 0.469 0.499 0.479 0.477 0.483 0.486 0.496 0.507 0.481 0.905 0.727 4.063 1.451 3.956 1.520 3.312 1.427
720
-
Avg. 0.400 0.433 0.694 0.577 0.827 0.615 0.439 0.448 0.463 0.454 0.441 0.457 0.47 0.489 0.470 0.457 0.809 0.681 3.206 1.268 3.922 1.653 3.527 1.472
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
96
0.386 0.405 0.582 0.512 0.332 0.374 0.399 0.414 0.606 0.518 0.628 0.544 0.726 0.578 0.823 0.587 1.031 0.747 1.048 0.733 1.130 0.775 1.234 0.798
192 0.440 0.438 0.632 0.536 0.358 0.390 0.441 0.436 0.681 0.539 0.666 0.566 0.750 0.591 0.844 0.591 1.087 0.766 1.097 0.756 1.150 0.788 1.287 0.839
336 0.485 0.459 0.767 0.584 0.402 0.416 0.499 0.467 0.786 0.597 0.807 0.628 0.851 0.659 0.870 0.603 1.138 0.787 1.147 0.775 1.198 0.809 1.288 0.842
720 0.577 0.499 1.334 0.742 0.511 0.489 0.767 0.587 0.796 0.593 0.822 0.633 0.857 0.655 0.893 0.611 1.245 0.831 1.200 0.799 1.175 0.794 1.247 0.828
Avg. 0.472 0.450 0.828 0.593 0.400 0.417 0.526 0.476 0.717 0.561 0.730 0.592 0.796 0.620 0.857 0.598 1.125 0.782 1.123 0.765 1.163 0.791 1.264 0.826
96
0.199 0.280 0.282 0.347 0.236 0.326 0.206 0.288 0.220 0.299 0.229 0.320 0.232 0.322 0.238 0.316 0.404 0.485 1.108 0.772 3.599 1.478 3.883 1.545
192 0.256 0.316 0.346 0.383 0.306 0.373 0.264 0.324 0.311 0.361 0.394 0.361 0.291 0.357 0.298 0.349 0.479 0.521 1.317 0.850 3.578 1.475 3.553 1.484
336 0.318 0.353 0.429 0.427 0.380 0.423 0.334 0.367 0.338 0.366 0.378 0.427 0.478 0.517 0.353 0.380 0.552 0.555 1.415 0.879 3.561 1.473 3.446 1.460
720 0.460 0.436 0.751 0.568 0.674 0.583 0.454 0.432 0.509 0.465 0.523 0.510 0.553 0.538 0.475 0.445 0.701 0.627 1.822 0.984 3.896 1.533 3.445 1.460
Avg. 0.308 0.346 0.452 0.431 0.399 0.426 0.314 0.352 0.344 0.372 0.381 0.404 0.388 0.433 0.341 0.372 0.534 0.547 1.415 0.871 3.658 1.489 3.581 1.487
0.143 0.241 0.147 0.246 0.150 0.251 0.145 0.244 0.315 0.389 0.235 0.322 0.297 0.367 0.484 0.518 0.697 0.638 0.639 0.609 1.265 0.919 1.414 0.855
96
192 0.159 0.255 0.163 0.260 0.163 0.263 0.163 0.260 0.318 0.396 0.247 0.341 0.308 0.375 0.501 0.531 0.718 0.648 0.772 0.678 1.298 0.939 1.240 0.919
336 0.179 0.274 0.182 0.278 0.175 0.278 0.183 0.281 0.340 0.415 0.267 0.356 0.354 0.411 0.574 0.578 0.758 0.667 0.901 0.745 1.302 0.942 1.253 0.921
720 0.233 0.323 0.239 0.329 0.219 0.311 0.233 0.323 0.635 0.613 0.318 0.394 0.426 0.466 0.952 0.786 1.028 0.788 1.200 0.871 1.259 0.919 1.249 0.921
Avg. 0.178 0.273 0.182 0.278 0.176 0.275 0.181 0.277 0.402 0.453 0.266 0.353 0.346 0.404 0.627 0.603 0.800 0.685 0.878 0.725 1.281 0.929 1.289 0.904
c 96
0.419 0.298 0.468 0.354 0.427 0.304 0.404 0.286 0.854 0.492 0.670 0.421 0.795 0.481 1.468 0.821 1.643 0.855 1.157 0.636 1.557 0.821 1.586 0.841
192 0.434 0.305 0.479 0.352 0.447 0.315 0.412 0.294 0.894 0.517 0.653 0.405 0.837 0.503 1.509 0.838 1.856 0.928 1.688 0.848 1.596 0.834 1.602 0.844
336 0.449 0.313 0.477 0.345 0.478 0.333 0.439 0.310 0.853 0.471 0.707 0.445 0.867 0.523 1.602 0.860 2.080 0.999 1.826 0.903 1.621 0.841 1.668 0.868
720
-
Avg. 0.434 0.305 0.474 0.350 0.450 0.317 0.418 0.296 0.867 0.493 0.676 0.423 0.833 0.502 1.526 0.839 1.859 0.927 1.557 0.795 1.591 0.832 1.618 0.851
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
i
f
f
a
r
T
Average 0.377 0.375 0.575 0.465 0.441 0.413 0.392 0.383 0.552 0.464 0.483 0.445 0.537 0.480 0.697 0.537 0.909 0.675 1.341 0.789 1.878 0.994 1.819 0.966
18
W
1
h
T
T
E
2
h
T
T
E
1
m
T
T
E
2
m
T
T
E
L
C
E
Table 13: Few-shot learning results on 10% data. We use prediction length O ∈ {96, 192, 336, 720}.
A lower MSE indicates better performance, and the best results are highlighted in bold. '-' means
that 10% time series is not sufficient to constitute a training set.
Methods
GPT2(6)
GPT2(0)
DLinear
PatchTST
TimesNet
FEDformer Autoformer
Stationary
ETSformer
LightTS
Informer
Reformer
Metric MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
r 96
e
h
t
a
e
0.163 0.215 0.190 0.240 0.171 0.224 0.165 0.215 0.184 0.230 0.188 0.253 0.221 0.297 0.192 0.234 0.199 0.272 0.217 0.269 0.374 0.401 0.335 0.380
192 0.210 0.254 0.243 0.284 0.215 0.263 0.210 0.257 0.245 0.283 0.250 0.304 0.270 0.322 0.269 0.295 0.279 0.332 0.259 0.304 0.552 0.478 0.522 0.462
336 0.256 0.292 0.270 0.305 0.258 0.299 0.259 0.297 0.305 0.321 0.312 0.346 0.320 0.351 0.370 0.357 0.356 0.386 0.303 0.334 0.724 0.541 0.715 0.535
720 0.321 0.339 0.348 0.359 0.320 0.346 0.332 0.346 0.381 0.371 0.387 0.393 0.390 0.396 0.441 0.405 0.437 0.448 0.377 0.382 0.739 0.558 0.611 0.500
Avg. 0.238 0.275 0.263 0.297 0.241 0.283 0.242 0.279 0.279 0.301 0.284 0.324 0.300 0.342 0.318 0.323 0.318 0.360 0.289 0.322 0.597 0.495 0.546 0.469
0.458 0.456 0.601 0.536 0.492 0.495 0.516 0.485 0.861 0.628 0.512 0.499 0.613 0.552 0.918 0.639 1.112 0.806 1.298 0.838 1.179 0.792 1.184 0.790
96
192 0.570 0.516 0.709 0.587 0.565 0.538 0.598 0.524 0.797 0.593 0.624 0.555 0.722 0.598 0.915 0.629 1.155 0.823 1.322 0.854 1.199 0.806 1.295 0.850
336 0.608 0.535 0.801 0.635 0.721 0.622 0.657 0.550 0.941 0.648 0.691 0.574 0.750 0.619 0.939 0.644 1.179 0.832 1.347 0.870 1.202 0.811 1.294 0.854
720 0.725 0.591 1.385 0.831 0.986 0.743 0.762 0.610 0.877 0.641 0.728 0.614 0.721 0.616 0.887 0.645 1.273 0.874 1.534 0.947 1.217 0.825 1.223 0.838
Avg. 0.590 0.525 0.874 0.647 0.691 0.600 0.633 0.542 0.869 0.628 0.639 0.561 0.702 0.596 0.915 0.639 1.180 0.834 1.375 0.877 1.199 0.809 1.249 0.833
96
0.331 0.374 0.539 0.495 0.357 0.411 0.353 0.389 0.378 0.409 0.382 0.416 0.413 0.451 0.389 0.411 0.678 0.619 2.022 1.006 3.837 1.508 3.788 1.533
192 0.402 0.411 0.675 0.555 0.569 0.519 0.403 0.414 0.490 0.467 0.478 0.474 0.474 0.477 0.473 0.455 0.785 0.666 2.329 1.104 3.856 1.513 3.552 1.483
336 0.406 0.433 0.718 0.580 0.671 0.572 0.426 0.441 0.537 0.494 0.504 0.501 0.547 0.543 0.507 0.480 0.839 0.694 2.453 1.122 3.952 1.526 3.395 1.526
720 0.449 0.464 0.732 0.605 0.824 0.648 0.477 0.480 0.510 0.491 0.499 0.509 0.516 0.523 0.477 0.472 1.273 0.874 3.816 1.407 3.842 1.503 3.205 1.401
Avg. 0.397 0.421 0.666 0.559 0.605 0.538 0.415 0.431 0.479 0.465 0.466 0.475 0.488 0.499 0.462 0.455 0.894 0.713 2.655 1.160 3.872 1.513 3.485 1.486
96
0.390 0.404 0.610 0.508 0.352 0.392 0.410 0.419 0.583 0.501 0.578 0.518 0.774 0.614 0.761 0.568 0.911 0.688 0.921 0.682 1.162 0.785 1.442 0.847
192 0.429 0.423 0.666 0.540 0.382 0.412 0.437 0.434 0.630 0.528 0.617 0.546 0.754 0.592 0.781 0.574 0.955 0.703 0.957 0.701 1.172 0.793 1.444 0.862
336 0.469 0.439 0.895 0.615 0.419 0.434 0.476 0.454 0.725 0.568 0.998 0.775 0.869 0.677 0.803 0.587 0.991 0.719 0.998 0.716 1.227 0.908 1.450 0.866
720 0.569 0.498 0.916 0.646 0.490 0.477 0.681 0.556 0.769 0.549 0.693 0.579 0.810 0.630 0.844 0.581 1.062 0.747 1.007 0.719 1.207 0.797 1.366 0.850
Avg. 0.464 0.441 0.772 0.577 0.411 0.429 0.501 0.466 0.677 0.537 0.722 0.605 0.802 0.628 0.797 0.578 0.980 0.714 0.971 0.705 1.192 0.821 1.426 0.856
96
0.188 0.269 0.283 0.344 0.213 0.303 0.191 0.274 0.212 0.285 0.291 0.399 0.352 0.454 0.229 0.308 0.331 0.430 0.813 0.688 3.203 1.407 4.195 1.628
192 0.251 0.309 0.353 0.384 0.278 0.345 0.252 0.317 0.270 0.323 0.307 0.379 0.694 0.691 0.291 0.343 0.400 0.464 1.008 0.768 3.112 1.387 4.042 1.601
336 0.307 0.346 0.420 0.422 0.338 0.385 0.306 0.353 0.323 0.353 0.543 0.559 2.408 1.407 0.348 0.376 0.469 0.498 1.031 0.775 3.255 1.421 3.963 1.585
720 0.426 0.417 0.553 0.491 0.436 0.440 0.433 0.427 0.474 0.449 0.712 0.614 1.913 1.166 0.461 0.438 0.589 0.557 1.096 0.791 3.909 1.543 3.711 1.532
Avg. 0.293 0.335 0.402 0.410 0.316 0.368 0.296 0.343 0.320 0.353 0.463 0.488 1.342 0.930 0.332 0.366 0.447 0.487 0.987 0.756 3.370 1.440 3.978 1.587
0.139 0.237 0.142 0.240 0.150 0.253 0.140 0.238 0.299 0.373 0.231 0.323 0.261 0.348 0.420 0.466 0.599 0.587 0.350 0.425 1.259 0.919 0.993 0.784
96
192 0.156 0.252 0.158 0.254 0.164 0.264 0.160 0.255 0.305 0.379 0.261 0.356 0.338 0.406 0.411 0.459 0.620 0.598 0.376 0.448 1.160 0.873 0.938 0.753
336 0.175 0.270 0.175 0.271 0.181 0.282 0.180 0.276 0.319 0.391 0.360 0.445 0.410 0.474 0.434 0.473 0.662 0.619 0.428 0.485 1.157 0.872 0.925 0.745
720 0.233 0.317 0.230 0.315 0.223 0.321 0.241 0.323 0.369 0.426 0.530 0.585 0.715 0.685 0.510 0.521 0.757 0.664 0.611 0.597 1.203 0.898 1.004 0.790
Avg. 0.176 0.269 0.176 0.270 0.180 0.280 0.180 0.273 0.323 0.392 0.346 0.427 0.431 0.478 0.444 0.480 0.660 0.617 0.441 0.489 1.195 0.891 0.965 0.768
c 96
0.414 0.297 0.478 0.368 0.419 0.298 0.403 0.289 0.719 0.416 0.639 0.400 0.672 0.405 1.412 0.802 1.643 0.855 1.157 0.636 1.557 0.821 1.527 0.815
192 0.426 0.301 0.481 0.363 0.434 0.305 0.415 0.296 0.748 0.428 0.637 0.416 0.727 0.424 1.419 0.806 1.641 0.854 1.207 0.661 1.454 0.765 1.538 0.817
336 0.434 0.303 0.488 0.365 0.449 0.313 0.426 0.304 0.853 0.471 0.655 0.427 0.749 0.454 1.443 0.815 1.711 0.878 1.334 0.713 1.521 0.812 1.550 0.819
720 0.487 0.337 0.537 0.386 0.484 0.336 0.474 0.331 1.485 0.825 0.722 0.456 0.847 0.499 1.539 0.837 2.660 1.157 1.292 0.726 1.605 0.846 1.588 0.833
Avg. 0.440 0.310 0.496 0.371 0.447 0.313 0.430 0.305 0.951 0.535 0.663 0.425 0.749 0.446 1.453 0.815 1.914 0.936 1.248 0.684 1.534 0.811 1.551 0.821
i
f
f
a
r
T
Average 0.371 0.367 0.521 0.447 0.413 0.401 0.385 0.376 0.556 0.458 0.511 0.472 0.687 0.559 0.674 0.522 0.912 0.665 1.137 0.712 1.850 0.967 1.888 0.974
19
D.3 Long-term Time-series Forecasting
Here we investigate whether our architecture performs consistently well with more training data.
Thus, we follow the classical experiment settings of Nie et al. (2022) and conduct experiments on full
data. The results are shown in Table 14. Overall, GPT2(6) FPT achieves comparable performance to
PatchTST, Dlinear and outperforms other baselines by a large margin. Compared with the second
best transformer-based baseline method FEDformer, GPT2(6) FPT yields an overall 18.7% relatively
MSE reduction. It verifies the effectiveness of NLP pretrained model in time series forecasting, not
limited to the few-shot setting.
Detail Experiment Table for Long-term Time-Series Forecasting in table 14
Table 14: Full results on full data. We use prediction length O ∈ {96, 192, 336, 720} for ILI and
O ∈ {24, 36, 48, 60} for others. A lower MSE indicates better performance. Black: best, Red:
second best.
Methods
GPT2(6)
GPT2(0)
DLinear
PatchTST
TimesNet
FEDformer Autoformer
Stationary
ETSformer
LightTS
Informer
Reformer
Metric MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
r 96
e
h
t
a
e
0.162 0.212 0.181
192 0.204 0.248 0.222
336 0.254 0.286 0.270
720 0.326 0.337 0.338
Avg 0.237 0.270 0.252
W
1
h
T
T
E
2
h
T
T
E
1
m
T
T
E
2
m
T
T
E
I
L
I
L
C
E
96
0.376 0.397 0.422
192 0.416 0.418 0.466
336 0.442 0.433 0.488
720 0.477 0.456 0.485
Avg 0.427 0.426 0.465
96
0.285 0.342 0.318
192 0.354 0.389 0.383
336 0.373 0.407 0.406
720 0.406 0.441 0.420
Avg 0.354 0.394 0.381
96
0.292 0.346 0.330
192 0.332 0.372 0.371
336 0.366 0.394 0.398
720 0.417 0.421 0.454
Avg 0.352 0.383 0.388
96
0.173 0.262 0.192
192 0.229 0.301 0.245
336 0.286 0.341 0.302
720 0.378 0.401 0.399
Avg 0.266 0.326 0.284
24
2.063 0.881 2.723
36
1.868 0.892 2.027
48
1.790 0.884 2.206
1.979 0.957 1.976
60
Avg 1.925 0.903 2.233
96
0.139 0.238 0.138
192 0.153 0.251 0.152
336 0.169 0.266 0.168
720 0.206 0.297 0.207
Avg 0.167 0.263 0.166
c 96
0.388 0.282 0.390
192 0.407 0.290 0.403
336 0.412 0.294 0.413
720 0.450 0.312 0.447
Avg 0.414 0.294 0.413
i
f
f
a
r
T
0.232
0.266
0.299
0.345
0.285
0.428
0.450
0.464
0.478
0.455
0.368
0.407
0.427
0.446
0.412
0.372
0.394
0.409
0.440
0.403
0.281
0.317
0.352
0.408
0.339
1.099
0.966
1.022
0.983
1.017
0.234
0.247
0.263
0.295
0.259
0.272
0.276
0.280
0.298
0.281
0.176 0.237 0.149 0.198 0.172 0.220 0.217 0.296 0.266 0.336 0.173 0.223 0.197 0.281 0.182 0.242 0.300 0.384 0.689 0.596
0.220 0.282 0.194 0.241 0.219 0.261 0.276 0.336 0.307 0.367 0.245 0.285 0.237 0.312 0.227 0.287 0.598 0.544 0.752 0.638
0.265 0.319 0.245 0.282 0.280 0.306 0.339 0.380 0.359 0.395 0.321 0.338 0.298 0.353 0.282 0.334 0.578 0.523 0.639 0.596
0.333 0.362 0.314 0.334 0.365 0.359 0.403 0.428 0.419 0.428 0.414 0.410 0.352 0.288 0.352 0.386 1.059 0.741 1.130 0.792
0.248 0.300 0.225 0.264 0.259 0.287 0.309 0.360 0.338 0.382 0.288 0.314 0.271 0.334 0.261 0.312 0.634 0.548 0.803 0.656
0.375 0.399 0.370 0.399 0.384 0.402 0.376 0.419 0.449 0.459 0.513 0.491 0.494 0.479 0.424 0.432 0.865 0.713 0.837 0.728
0.405 0.416 0.413 0.421 0.436 0.429 0.420 0.448 0.500 0.482 0.534 0.504 0.538 0.504 0.475 0.462 1.008 0.792 0.923 0.766
0.439 0.443 0.422 0.436 0.491 0.469 0.459 0.465 0.521 0.496 0.588 0.535 0.574 0.521 0.518 0.488 1.107 0.809 1.097 0.835
0.472 0.490 0.447 0.466 0.521 0.500 0.506 0.507 0.514 0.512 0.643 0.616 0.562 0.535 0.547 0.533 1.181 0.865 1.257 0.889
0.422 0.437 0.413 0.430 0.458 0.450 0.440 0.460 0.496 0.487 0.570 0.537 0.542 0.510 0.491 0.479 1.040 0.795 1.029 0.805
0.289 0.353 0.274 0.336 0.340 0.374 0.358 0.397 0.346 0.388 0.476 0.458 0.340 0.391 0.397 0.437 3.755 1.525 2.626 1.317
0.383 0.418 0.339 0.379 0.402 0.414 0.429 0.439 0.456 0.452 0.512 0.493 0.430 0.439 0.520 0.504 5.602 1.931 11.12 2.979
0.448 0.465 0.329 0.380 0.452 0.452 0.496 0.487 0.482 0.486 0.552 0.551 0.485 0.479 0.626 0.559 4.721 1.835 9.323 2.769
0.605 0.551 0.379 0.422 0.462 0.468 0.463 0.474 0.515 0.511 0.562 0.560 0.500 0.497 0.863 0.672 3.647 1.625 3.874 1.697
0.431 0.446 0.330 0.379 0.414 0.427 0.437 0.449 0.450 0.459 0.526 0.516 0.439 0.452 0.602 0.543 4.431 1.729 6.736 2.191
0.299 0.343 0.290 0.342 0.338 0.375 0.379 0.419 0.505 0.475 0.386 0.398 0.375 0.398 0.374 0.400 0.672 0.571 0.538 0.528
0.335 0.365 0.332 0.369 0.374 0.387 0.426 0.441 0.553 0.496 0.459 0.444 0.408 0.410 0.400 0.407 0.795 0.669 0.658 0.592
0.369 0.386 0.366 0.392 0.410 0.411 0.445 0.459 0.621 0.537 0.495 0.464 0.435 0.428 0.438 0.438 1.212 0.871 0.898 0.721
0.425 0.421 0.416 0.420 0.478 0.450 0.543 0.490 0.671 0.561 0.585 0.516 0.499 0.462 0.527 0.502 1.166 0.823 1.102 0.841
0.357 0.378 0.351 0.380 0.400 0.406 0.448 0.452 0.588 0.517 0.481 0.456 0.429 0.425 0.435 0.437 0.961 0.734 0.799 0.671
0.167 0.269 0.165 0.255 0.187 0.267 0.203 0.287 0.255 0.339 0.192 0.274 0.189 0.280 0.209 0.308 0.365 0.453 0.658 0.619
0.224 0.303 0.220 0.292 0.249 0.309 0.269 0.328 0.281 0.340 0.280 0.339 0.253 0.319 0.311 0.382 0.533 0.563 1.078 0.827
0.281 0.342 0.274 0.329 0.321 0.351 0.325 0.366 0.339 0.372 0.334 0.361 0.314 0.357 0.442 0.466 1.363 0.887 1.549 0.972
0.397 0.421 0.362 0.385 0.408 0.403 0.421 0.415 0.433 0.432 0.417 0.413 0.414 0.413 0.675 0.587 3.379 1.338 2.631 1.242
0.267 0.333 0.255 0.315 0.291 0.333 0.305 0.349 0.327 0.371 0.306 0.347 0.293 0.342 0.409 0.436 1.410 0.810 1.479 0.915
2.215 1.081 1.319 0.754 2.317 0.934 3.228 1.260 3.483 1.287 2.294 0.945 2.527 1.020 8.313 2.144 5.764 1.677 4.400 1.382
1.963 0.963 1.430 0.834 1.972 0.920 2.679 1.080 3.103 1.148 1.825 0.848 2.615 1.007 6.631 1.902 4.755 1.467 4.783 1.448
2.130 1.024 1.553 0.815 2.238 0.940 2.622 1.078 2.669 1.085 2.010 0.900 2.359 0.972 7.299 1.982 4.763 1.469 4.832 1.465
2.368 1.096 1.470 0.788 2.027 0.928 2.857 1.157 2.770 1.125 2.178 0.963 2.487 1.016 7.283 1.985 5.264 1.564 4.882 1.483
2.169 1.041 1.443 0.797 2.139 0.931 2.847 1.144 3.006 1.161 2.077 0.914 2.497 1.004 7.382 2.003 5.137 1.544 4.724 1.445
0.140 0.237 0.129 0.222 0.168 0.272 0.193 0.308 0.201 0.317 0.169 0.273 0.187 0.304 0.207 0.307 0.274 0.368 0.312 0.402
0.153 0.249 0.157 0.240 0.184 0.289 0.201 0.315 0.222 0.334 0.182 0.286 0.199 0.315 0.213 0.316 0.296 0.386 0.348 0.433
0.169 0.267 0.163 0.259 0.198 0.300 0.214 0.329 0.231 0.338 0.200 0.304 0.212 0.329 0.230 0.333 0.300 0.394 0.350 0.433
0.203 0.301 0.197 0.290 0.220 0.320 0.246 0.355 0.254 0.361 0.222 0.321 0.233 0.345 0.265 0.360 0.373 0.439 0.340 0.420
0.166 0.263 0.161 0.252 0.192 0.295 0.214 0.327 0.227 0.338 0.193 0.296 0.208 0.323 0.229 0.329 0.311 0.397 0.338 0.422
0.410 0.282 0.360 0.249 0.593 0.321 0.587 0.366 0.613 0.388 0.612 0.338 0.607 0.392 0.615 0.391 0.719 0.391 0.732 0.423
0.423 0.287 0.379 0.256 0.617 0.336 0.604 0.373 0.616 0.382 0.613 0.340 0.621 0.399 0.601 0.382 0.696 0.379 0.733 0.420
0.436 0.296 0.392 0.264 0.629 0.336 0.621 0.383 0.622 0.337 0.618 0.328 0.622 0.396 0.613 0.386 0.777 0.420 0.742 0.420
0.466 0.315 0.432 0.286 0.640 0.350 0.626 0.382 0.660 0.408 0.653 0.355 0.632 0.396 0.658 0.407 0.864 0.472 0.755 0.423
0.433 0.295 0.390 0.263 0.620 0.336 0.610 0.376 0.628 0.379 0.624 0.340 0.621 0.396 0.622 0.392 0.764 0.416 0.741 0.422
Average 0.516 0.407 0.573 0.0.431 0.562 0.436 0.446 0.386 0.596 0.433 0.701 0.489 0.757 0.511 0.633 0.465 0.662 0.473 1.303 0.616 1.836 0.871 2.081 0.954
20
D.4 Mean and STD for Few-shot Learning
Table 15 lists both mean and STD for GPT2(6), DLinear and PatchTST with 3 runs on 5% ETTh2 and
ETTm2. The results show a small variance in performance of GPT2(6) that represents the stability of
GPT2(6).
Table 15: A subset of results showing both Mean and STD on 5% datasets.
Methods
Metric
2 96
h
192
T
336
T
E
720
2 96
m
192
T
336
T
E
720
GPT2-backbone(6 Layers)
MAE
MSE
0.376 ± 0.0072
0.418 ± 0.0013
0.408 ± 0.0006
-
0.199 ± 0.0040
0.256 ± 0.0030
0.318 ± 0.0046
0.460 ± 0.0132
0.421 ± 0.0054
0.441 ± 0.0014
0.439 ± 0.0002
-
0.280 ± 0.0042
0.316 ± 0.0017
0.353 ± 0.0032
0.436 ± 0.0066
D.5 Comparison with Traditional Methods on Few-shot Learning
Since deep learning methods are more advantageous than traditional methods when applied to large
datasets. For few-shot learning, traditional methods should also consider. The results are shown in
Table 16 that GPT2(6) also achieves best performance.
Table 16: Comparison with traditional methods.
Methods
Metric
GPT2(6) 5%
GPT2(6) 10%
MSE MAE MSE MAE
ETS
ARIMA
NaiveDrift
MSE
MAE MSE MAE MSE MAE
96
192
96
192
0.376
0.418
0.386
0.440
0.421
0.441
0.405
0.438
0.331
0.402
0.390
0.429
0.374
0.411
0.404
0.423
2.954
10.226
52.237
186.445
0.742
1.212
2.689
4.654
0.481
0.585
0.693
0.710
0.443
0.495
0.547
0.557
0.764
1.560
1.539
2.869
0.561
0.785
0.913
1.215
2
h
T
T
E
1
m
T
T
E
D.6 Baselines with Instance Normalization
Instance normalization Kim et al. (2022) is a plug-in for time series for distribution shift. Most
baselines, such as Autoformer and FEDformer are not equipped with instance normalization. Thus,
for a fair comparison, we add the experiment, as in Table 17, for baselines w/o instance normalization
and GPT(6) can also perform superior.
Table 17: Comparison on 5% data. Autoformer and FEDformer are equiped with instance normaliza-
tion.
Methods
Metric
GPT2(6)
PatchTST
DLinear
Autoformer
Autoformer(Revin)
FEDformer
FEDformer(Revin)
MSE MAE MSE MAE MSE MAE MSE MAE MSE
96
192
0.199
0.256
0.280
0.316
0.206
0.264
0.288
0.324
0.236
0.306
0.326
0.373
0.232
0.291
0.322
0.357
0.224
0.296
2
m
T
T
E
MAE
0.300
0.343
MSE MAE MSE
0.229
0.294
0.320
0.361
0.223
0.288
MAE
0.298
0.336
D.7 Detailed Definition and Results of Zero-shot Learning
Task Definition Each experiment contains two distinct datasets, source, and target datasets. The
source dataset is used to train the model and then forecasts without fine-tuning in the target dataset.
The target dataset is split into non-overlapping historical and test sequences. We use the historical
sequence as input to the model, and the obtained output is used to calculate errors with the test
sequences. Besides meta-learning-based models like N-BEATS, evaluated models' parameters are
not allowed any adjustment using the forecasting phase. Also, same as Oreshkin et al. (2021), each
data set adopts a specific metric (M4: sMAPE; M3: sMAPE; TOURISM: MAPE; ELECTR: ND)
21
Detailed Results Here, we list detailed performance of zero-shot learning in Table 18, Table
19 and Table 20. For each dataset, we separately list the performance of models under diverse
frequency. Compared to the most recent published method DLinear, GPT2(6) performs superior
in most situations. Also, GPT2(6) does not use any information from the test data, but achieves a
comparable performance of meta-leaning based N-BEATS.
Table 18: Zero-shot performance on M4 (sMAPE).
Yearly Quarterly Monthly Others Average
(100k)
(48k)
(23k)
(24k)
(5k)
N-BEATS-FR
13.267
9.596
DLinear-M3
TimesNet-M3
PatchTST-M3
ETSformer-M3
LightTS-M3
Stationary-M3
FEDformer-M3
Autoformer-M3
Informer-M3
Reformer-M3
GPT(6)-M3
14.193
15.655
13.966
27.846
13.787
14.988
13.887
14.552
18.542
15.652
13.740
18.856
11.877
10.929
36.134
11.289
11.686
11.513
17.341
16.907
11.051
10.787
12.676
14.765
16.165
14.664
25.114
15.181
16.098
18.154
25.063
23.454
15.604
14.630
4.696
9.194
6.863
7.087
12.338
9.117
6.977
7.529
9.666
7.348
7.001
7.081
11.675
15.337
14.553
13.228
27.748
13.623
14.327
15.047
20.022
19.047
14.092
13.125
Table 19: Zero-shot performance on M3 (sMAPE).
Yearly Quarterly Monthly Others Average
(3003)
(1428)
(645)
(756)
(174)
N-BEATS-M4
N-BEATS-FR
DLinear-M4
TimesNet-M4
PatchTST-M4
ETSformer-M4
LightTS-M4
Stationary-M4
FEDformer-M4
Autoformer-M4
Informer-M4
Reformer-M4
GPT2(6)-M4
15.07
16.43
17.43
18.75
15.99
20.56
15.63
17.05
16.00
16.18
19.70
16.03
16.42
9.07
9.05
9.74
12.26
9.62
11.65
9.40
12.56
9.48
13.92
13.00
9.76
10.13
13.19
13.30
15.65
14.01
14.71
16.97
24.60
16.82
15.12
16.91
15.91
14.80
14.10
4.29
4.51
6.81
6.88
9.44
10.57
8.28
8.13
8.94
14.68
13.03
7.53
4.81
12.38
12.61
14.03
14.17
13.39
16.03
17.90
15.29
13.53
15.87
15.82
13.37
13.06
E Proof
In our numerical experiments, we obtain two interesting observations. First, the token similarity
within a sample is larger in pretrained LM. We report the layer-wise average token cosine similarity in
ETTh2 experiment in Figure 7. In particular, Figure 7 (a) shows that in a fine-tuned random initialed
GPT2(6) model, the token similarity is around 0.1-0.2 among different layers. When switching to the
frozen pre-trained GPT2-FPT model, the token similarity significantly increases in the deep layers
and eventually reaches more than 0.9 in the last layer. The ETTh2 dataset contains high volatility
hourly information related to the electricity transformer temperature. In this situation, higher token
similarity implies the high-frequency noise in the data is eased and only low-frequency information
will be reserved. In other words, after going through the pretrained GPT2-FPT model, the signal-noise
ratio is enhanced. We use the following theorem to characterize this behavior.
22
Table 20: Zero-shot performance on Tourism (MAPE).
Yearly Quarterly Monthly Average
(1311)
(518)
(427)
(366)
N-BEATS-M4
N-BEATS-FR
DLinear-M4
TimesNet-M4
PatchTST-M4
ETSformer-M4
LightTS-M4
Stationary-M4
FEDformer-M4
Autoformer-M4
Informer-M4
Reformer-M4
23.57
23.43
39.59
35.59
33.23
391.60
138.22
35.42
43.41
51.19
41.16
33.86
GPT2(6)-M4
27.17
14.66
14.45
18.30
19.22
19.27
35.56
16.28
35.15
19.88
34.95
30.98
16.85
16.21
19.32
20.47
24.76
30.54
27.57
50.47
25.34
65.58
28.39
31.47
33.92
23.71
21.92
18.82
19.46
28.51
28.84
27.10
180.40
66.99
43.75
31.55
40.39
35.82
25.48
22.14
E.1 Theorem E.1
Theorem E.1 (informal). We consider the self-attention for l-th query token. Let's assume the input
token xi are bounded with mean μ for i = 1, 2, ..., n. Under mild conditions, with high probability,
the output value token Vl converges to μWv on the order of O(n−1/2), where Wv is the parameter
matrix to compute the value token.
The Theorem E.1 describes the self-attention structure can efficiently make output value token Vl
converge its mean value μWv. In the time series forecasting task, each token represents several
adjacent points in a time series. When the time series has some periodical or translation invariant
structures, by comparing a given token with other tokens, one could have a higher chance to figure
out those invariant structures. This phenomenon is especially important in few-shot forecasting tasks.
Without enough token noise distillation ability, the model will more likely tend to overfit due to
insufficient training data.
We denote xi as i-th element of vector x, Wij as the element at i-th row and j-th column of matrix
W , and Wj as the j-th row of matrix W . Moreover, we denote xi as the i-th patch (token) of the
inputs with xi = Xi.
Before given the formal statement of the Theorem E.1, we first show the assumptions.
1. The token xi is the sub-gaussian random vector with mean μi and variance (σ2/d)I for
i = 1, 2, ..., n.
2. μ follows a discrete distribution with finite values μ ∈ V. Moreover, there exist 0 <
Kμi ∈ [ν2, ν4] for all i and
ν1, 0 < ν2 < ν4 such that a) ∥μi∥ = ν1, and b) μiWQW T
|μiWQW ⊤
j | ≤ ν2 for all μi ̸= μj ∈ V.
Kμ⊤
3. WV and WQW ⊤
ν5 and |(WQW ⊤
K are element-wise bounded with ν5 and ν6 respectively, that is, |W (ij)
K)(ij)| ≤ ν6, for all i, j from 1 to d.
V
| ≤
In the above assumptions, we ensure that for a given query patch, the difference between the clustering
center and noises are large enough to be distinguished.
Theorem E.2 (formal statement of Theorem E.1). Let patch xi be σ2-subgaussian random variable
with mean μi and all n patches follow the same clustering center of query l. Per Assumptions
aforementioned, when
d ≥ 3(ψ(δ, d) + ν2 + ν4), then with probability 1 − 5δ, we have
√
23
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:16) 1√
(cid:80)n
i=1 exp
(cid:80)n
j=1 exp
(cid:17)
k xi
d
xlWQW ⊤
(cid:16) 1√
d
xlWQW ⊤
Kxj
(cid:19)
xiWV
(cid:17)
(cid:21)
(cid:20)
+ 7
exp
(cid:18) ν2 − ν4 + ψ(δ, d)
√
d
− 1
∥μlWV ∥∞,
− μlWV
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)∞
≤ 4 exp
(cid:19)
(cid:18) ψ(δ, d)
√
d
σν5
(cid:115)
2
dn
log
(cid:19)
(cid:18) 2d
δ
where ψ(δ, d) = 2σν1ν6
(cid:113)
2 log (cid:0) 1
δ
(cid:1) + 2σ2ν6 log (cid:0) d
δ
(cid:1).
Proof. See the proof of Lemma 2 in Wang et al. (2022) with k1 = k = n.
■
E.2 Theorem E.4
We first give the formal statement of Theorem E.4.
Theorem E.3 (formal statement of Theorem E.4). Let gi ∈ Rd and yi ∈ RT be the feature
map vector and forecasting targets for the sample i = 1, 2, ..., N respectively, and we assume
i ⪰ σI for some σ > 0. We want to learn a matrix W ∈ Rd×T from the following
1
i=1 gig⊤
N
optimization problem:
(cid:80)N
W = arg min
1
2N
N
(cid:88)
i=1
∥W gi − yi∥2
2.
(1)
If we apply stochastic gradient descent with diminishing step sizes ηt = 1
t = ̃O(ε−1σ−1) steps to reach
N
(cid:88)
t
(cid:88)
N
(cid:88)
(cid:32)
(cid:33)
1
t
1
2N
j=1
i=1
1
2N
i=1
∥Wjgi − yi∥2
2
−
∥W ∗gi − yi∥2
2 ≤ ε,
(2)
σt at step t, we will need
where W ∗ is the optimal solution and Wj is the j step's solution and ̃O we suppress the logarithmic
dependence.
(cid:80)T
Proof. As we assume 1
i ⪰ σI, the hessian of optimization problem in (1) is also
N
positive definite, which is equivalent to the optimization problem in (1) is strongly convex with
parameter proportional to σ. Then via standard stochastic gradient decent analysis (e.g., section 3.1
in Lacoste-Julien et al. (2012)), we obtain:
i=1 gig⊤
1
t
(cid:32)
t
(cid:88)
j=1
1
2N
N
(cid:88)
i=1
(cid:33)
∥Wjgi − yi∥2
2
−
1
2N
N
(cid:88)
i=1
∥W ∗gi − yi∥2
2 ≤ O
(cid:19)
(cid:18) log t
σt
= ̃O(σ−1t−1).
(3)
Therefore, to reach ε optimization gap, we just need to set t = ̃O(σ−1ε−1).
■
The second observation is that for the pretrained GPT2-FPT model, the last transformer layer's
outputs, i.e., feature maps, are spread widely throughout the feature space. We report the t-SNE
visualization of the feature maps for GPT2-FPT and an end-to-end model PatchTST in Figure 8. In
Figure 8 (a) and (b), we color the samples chunked from the one single time series into the same
color and the same configuration of the T-SNE is applied. One may observe that the feature maps of
GPT2-FPT has less concentration compared to PatchTST. It implies the GPT2-FPT's feature maps
corresponding to different samples are more distinctive which eventually facilitates the learning ability
of the last MLP layer. Researchers Wang & Isola (2020) have found that contrastive learning-based
representation learning may result in a uniform distribution of training data, and such behavior plays
an important role in its good downstream task performance. We use the following theorem to justify
it.
Theorem E.4 (informal). Let gi and yi be the feature map vector and forecasting targets for the
sample i = 1, 2, ..., N respectively, and we assume 1
i ⪰ σI for some σ > 0. Under mild
N
conditions, if we train an MLP layer that maps feature maps to forecasting targets via the stochastic
gradient descent, the total step to reach some optimization tolerance is on the order of O(σ−1).
i=1 gig⊤
(cid:80)N
24
Figure 6: The performance and token similarity within samples with respect to each layer with
different random replace ratios. Pretrained parameters are replaced by random initial parameters
according to certain proportions.
Figure 7: The token similarity within samples with respect to each layer. (a) GPT2-noPretrain-model;
(b) GPT2-Pretrained-model; (c) Pretrained attention is replaced by PCA.
The Theorem E.4 considers the covariate matrix of feature maps being positive definite that indicates
the set of all feature maps {gi} spans the whole feature spaces, and the higher spread level gives a
larger σ. In this case, if we only want to learn an MLP layer, the problem reduces to a well-conditioned
least-squared regression problem. Then the fast convergence rate is achieved.
Efficiently learning the last MLP layer plays a very important role in time series forecasting and
can substantially impact the prediction performance. In Zeng et al. (2023), the authors show that
learning a single MLP layer can also bring very promising performance. In few-shot forecasting, the
pre-trained GPT2 model may still preserve highly diverse feature maps than end-to-end type models
and eventually leads to fast learning speed on the last MLP layer.
Another possible benefit of wide spared feature maps is enhancing the model memorization ability
when using a multi-layer decoder structure. In the literature on network memorization ability (e.g.,
Vardi et al. (2021); Yun et al. (2020)), the deep learning model tends to have better memorization
ability when feature maps are well separated. In forecasting tasks, capturing extreme or rare behavior
is very important. The pretrained GPT gains more capacity in the decoder to correctly forecast
uncommon time series.
F N-gram Explanation for Universality
Why does the proposed pretrained-frozen-model work so effectively? We have achieved state-of-
the-art performance in time series analysis using a language model that is mostly trained on natural
language data. The answer lies in the universality of the frozen structure, which includes attention
layers and Feed Forward layers. We can represent images and time series forecasting tasks as an
n-gram estimation problem, akin to text analysis, by employing a patching approach. This method
treats subsequences of time series or image patches as individual tokens. Central to sequential
prediction is the n-order Markov process, and a simple way to capture the n-order Markov process
is n-gram language model. To predict next token w0, we need to compute p(w0|w1, . . . , wn−1),
which can be further computed as p(w0w1 . . . wn−1)/p(w1 . . . wn−1). Hence, the core of n-gram
25
Replace添加Replace Ratio 100%Replace Ratio 80%Replace Ratio 60%Replace Ratio 40%Replace Ratio 20%Replace Ratio 0%Replace Ratio (%)(a) Random Initialization(b) Pretrained Parameters(c) PCA as AttentionFigure 8: The t-SNE visualization of sample feature maps for (a) GPT-backbone, (b) end-to-end-
PatchTST-model. (c) The token similarity within samples within different continuous sequence
lengths.
language model is to estimate the probability of observing a sequence of n tokens. When n is large,
most of n token sequences will not be observed from data, leading to the sparse data problem, a
common challenge faced by n-gram language model. As a result, a large body of research in n-gram
language model is focused on how to effectively estimate probability of having n-token sequences
even when they are NOT observed from data. We hypothesize that the transformer model pretrained
by GPT-2 essentially allows us to estimate p(w0w1 . . . wn−1) from observations of significantly
shorter token sequences. In this section, we will show that the function of estimating probabilities of
longer sequences from observation of shorter sequences is universal and is independent from domain
as long as data exhibit a skew distribution (e.g., follows a power law). We note that our work is closely
related to the discussion presented in Elhage et al. (2021); Olsson et al. (2022), where the authors
also connect the function of transformer to compute of n-grams. We however note that our key result
is to show the universality in computing probability of longer sequences from observations of shorter
sequences, which can't be found in any existing studies. Although the discussion is restricted to
discrete tokens, it should be generalized to continuous signals as we can always quantize continuous
signals into a finite number of discrete tokens, similar to what BEiT Bao et al. (2022) did.
To gain a better understanding, let's start by examining a "zero-layer" Transformer model. This model
operates by taking a token, embedding it, and transforming it back to produce logits that predict the
subsequent token. Because it cannot transfer information from other tokens, it relies solely on the
current token to predict the next one. Consequently, the optimal behavior of this model is to closely
resemble the bigram log-likelihood.
Then we move on to the so-called "attention-only" transformer, which doesn't have MLP layers.
As discussed in a recent work Elhage et al. (2021), one-layer attention-only Transformers can be
comprehended as a combination of a bigram model and multiple "skip-trigram" models (impacting
the probabilities of sequences "A. . . BC"). This can be intuitively understood as each attention head
having the ability to selectively attend from the current token ("B") to a previous token ("A") and
transfer relevant information to fine-tune the probability of potential subsequent tokens ("C"). Olsson
et al. (2022) further discusses a multi-layer transformer can do more complex n-gram estimation
using an induction heads mechanism. To be more precise, induction heads employ a straightforward
principle: the '[A][B] ... [A] → [B]' rule, which elevates the likelihood of generating the subsequent
token 'B' given the current token 'A' if there is a fuzzy match of the AB bigram in the historical
context. This rule seems to largely decouple A and B, which means they do not memorize a fixed
table of n-gram statistics. The rule [A][B] . . . [A] → [B] applies regardless of what A and B are,
which can abstract to new patterns.
Building upon these discussions, we are now prepared to substantiate the following argument: For
sequential data following a power law, there is a potentially universal solution to the final
estimation of n-gram probabilities. That's the reason behind the universality of pretrained LM's
performance in cross-domain tasks. For simplicity, we assume that n is so large that we are unable to
observe any occurrence of n-gram from data, and we only observe the occurrence of n′-grams with
n′ < n. We denote by sn
j appears
i the ith unique n-gram, and by the notation sn′
i if n′-gram sn′
j ∈ sn
26
(a) GPT2-backbone(b) PatchTST(c) Token similarityin sn
i , the ith n-gram. Let mn be the number of unique n-grams. According to the maximum entropy
model, our estimation of n-gram probabilities can be cast into the following optimization problem:
min (cid:80)mn
i=1 p(sn
i ) log p(sn
i )
bility of observing pattern sn′
j
For each constraint for (cid:98)p(sn′
tion problem as follows:
i:sn′
j ∈sn
i
p(sn
i ) = (cid:98)p(sn′
s. t. (cid:80)
from the data and j ∈ [mn′], n′ ∈ [n − 1].
j ), we introduce a Lagrangian dual variable λn′
j ) where (cid:98)p(sn′
minλ log
(cid:16)(cid:80)mn
i=1 exp
(cid:16)(cid:80)
(n′,j):sn′
j ∈sn
i
(cid:17)(cid:17)
λn′
j
− (cid:80)n−1
n′=1
(cid:80)mn′
j=1 λn′
j (cid:98)p(sn′
j ),
(cid:16)(cid:80)
where n-gram probability p(sn
(cid:80)mn
i=1 exp((cid:80)
λn′
j )
(n′,j):sn′
j ∈sn
i
j ) is given as p(sn
j ) = 1
Z(λ) exp
(n′,j):sn′
j ∈sn
i
(cid:17)
λn′
j
and Z(λ) =
j ) represents the proba-
j , and rewrite the optimiza-
In the case that all n-grams follow a power law, for each n′ ∈ [n − 1], we divide n′-gram into two
groups: the group Vn′ includes the high frequency n′-gram and the group Un′ including the low
frequency of n′-gram. For simplicity, we assume that the probability for all the high frequency
n′-grams are roughly αn′ ∈ [0, 1] and the probability for all the low frequency n′-grams are roughly
βn′ ∈ [0, 1]. By assuming that all the patterns in Vn′ and Un′ share similar appearance frequency, we
simplify the optimization problem by only introducing two dual variables for each n′-gram, i.e. λn′
a
for high-frequency patterns and λn′
for low-frequency patterns as follow Using these notations, we
b
have the optimization problem simplified as
minλ
where gn′ = (cid:80)
Furthermore, let qn′
and qn′
log((cid:80)mn
b I(sn′
+λn′
(cid:80)
n′=1
a I(sn′
λn′
j ∈sn
i
(cid:16)
a gn′ + λn′
λn′
i=1 exp((cid:80)n−1
j:sn′
j ∈ Un′))) − (cid:80)n−1
j ∈Vn′ (cid:98)p(sn′
sn′
a be the probability to observe a high frequency n′-gram appearing in any n-gram,
j ∈ Vn′)
(cid:17)
b hn′
,
j ∈Un′ (cid:98)p(sn′
j ).
sn′
hn′ = (cid:80)
j ) and
n′=1
b be the probability to observe a low frequency n′-gram appearing in any n-gram, we have
(cid:80)mn
i=1 exp((cid:80)n−1
(cid:81)n−1
j ∈ Vn′) + λn′
b exp(λn′
b I(sn′
b )) + O (cid:0)√
a I(sn′
λn′
a ))(1 + qn′
j ∈ Un′))
(cid:1) .
mn
n′=1
= mn
(cid:80)
j:sn′
j ∈sn
i
a exp(λn′
n′=1(1 + qn′
√
By skipping the term O(
(cid:16)
1 + qn′
(cid:80)n−1
minλ
n′=1 log
mn), we further simplify the optimization problem as
a exp(λn′
a )
(cid:17)
− + (cid:80)n−1
n′=1 log
(cid:16)
1 + qn′
b exp(λn′
b
(cid:17)
− λn′
b hn′,
which is equivalent to
(cid:16)
(cid:17)
1 + qn′
1 + qn′
a exp(λ)
(cid:17)
b exp(λ)
− λg′
n
− λh′
n.
a , qn′
b will only depend on statistics qn′
λa
n′ = minλ log
(cid:16)
λb
n′ = minλ log
λn′
a and λn′
b , gn′ and hn′. They are independent from the
detailed statistics (cid:98)p(sn′
j ) and how each n′-gram appears in different n-gram. Thus, this simple
analysis does indicate, to some degree, that the solution obtained from the maximum entropy model
can be universal, as long as n-grams follow skewed distributions like power law.
As illustrated by the above analysis, dual variables
We informally demonstrate that transformer models utilize attention mechanisms to perform a
sophisticated form of n-gram estimation, and the generation rule for such n-gram distributions could
be universal. This is how universality is achieved in our proposed cross-domain knowledge transfer.
However, we currently lack a concrete metric to evaluate the performance of knowledge transfer
between different domains, which requires further investigation. Nonetheless, in our experimental
study, we demonstrate that a transformer model (beit) Bao et al. (2022) trained on images can perform
well on cross-domain time series forecasting tasks.
27
G Connection between self-attention and Principle component analysis
Understand the Gradient Structure of Self-Attention
Let X = (x1, . . . , xN )⊤ ∈ RN ×D be the input pattern, and let f (X) = (f1(X), . . . , fN (x))⊤ :
RN ×D (cid:55)→ RN ×D be the function for self-attention, i.e.
fi(X) = softmax(XAX ⊤)X
where A = WQW ⊤
with respect to input pattern. The lemma below shows an important structure of J.
K ∈ RD×D. Let the Jacobian J =
i,j=1
represent the gradient f (X)
(cid:104) ∂fi(X)
∂xj
(cid:105)N
Lemma G.1.
|J|2 ≤ |A|2
(cid:80)N
i=1
(cid:0)Pi,i + 1
2
(cid:1) (cid:12)
(cid:12)xi − (cid:80)N
(cid:12)
j=1 Pi,jxj
(cid:12)
2
(cid:12)
(cid:12)
+ ∆
where
Pi,j =
∆ = |A|2
(cid:80)N
i̸=j Pi,j
(cid:12)
(cid:12)xj − (cid:80)N
(cid:12)
k=1 Pi,kxk
2
(cid:12)
(cid:12)
(cid:12)
+ |A|2
2
(cid:80)N
j=1 |xi|2
and
i Axj )
exp(x⊤
k=1 exp(x⊤
i Axk)
(cid:80)N
Proof. According to the analysis from the work, we have the gradient Ji,j = ∂fi(X)
is given by
xj
Ji,j = Pi,jI + X ⊤Qi (cid:0)XAδi,j + Ej,iXA⊤(cid:1) where Qi = diag(Pi,:) − Pi,:P ⊤
i,: Here Pi,: ∈
+ represents the i-th row of matrix P . We thus have
|J|2 ≤ (cid:80)N
≤ (cid:80)N
RN
i,j=1 |Ji,j|2
i,j=1 Pi,j + (cid:80)N
i=1 |X ⊤QiX|2|A|2 + (cid:80)N
(cid:18)
(cid:80)N
(cid:80)N
(cid:80)N
≤ N + |A|2
i=1
≤ N + |A|2
(cid:80)N
i=1
(cid:80)N
≤ |A|2
(cid:80)N
i=1
(cid:0)Pi,i + 1
2
(cid:12)
(cid:12)
j=1 Pi,j|xj|2 −
(cid:12)
(cid:12)
(cid:12)xj − (cid:80)N
(cid:12)
(cid:12)
(cid:12)
(cid:1) (cid:12)
(cid:12)xi − X ⊤Pi,:
2
j=1 Pi,j
i,j=1 |X ⊤QiEj,iX|2|A|2
(cid:80)N
2(cid:19)
+ |A|2
(cid:12)
(cid:12)
(cid:12)
j=1 Pi,jxj
2
(cid:80)N
i,j=1 Pi,j
k=1 Pi,kxk
(cid:12)
(cid:12)
(cid:12)
+ |A|2
N
(cid:88)
(cid:12)
(cid:12)x⊤
i
i,j=1 |X ⊤Qiejx⊤
i |
(cid:0)xj − X ⊤Pi,:
|A|2
2
N
(cid:88)
+
(cid:12)
(cid:12)
2
j=1
(cid:123)(cid:122)
:=∆
(cid:125)
+ N + |A|2
Pi,j
(cid:12)
(cid:12)xj − X ⊤Pi,:
|xi|2
i̸=j
(cid:124)
(cid:1)(cid:12)
(cid:12)
■
As indicated by Lemma 1, one of the key components in the upper bound of Jacobian is |xi −
(cid:80)N
j=1 Pi,jxj|2. Thus, through the optimization, we like to reduce the size of the gradient and
therefore may prefer to reduce the quantity to (cid:80)N
j=1 Pi,jxj|2. Hence, it will be interesting
to understand the choice of W Q and W K that leads to the minimization of (cid:80)N
j=1 Pi,jxj|2,
2
i=1 |xi −(cid:80)N
i=1 |xi −(cid:80)N
(cid:80)N
i=1
(cid:12)
(cid:12)xi − (cid:80)N
(cid:12)
j=1 Pi,jxj
(cid:12)
(cid:12)
(cid:12)
where ρ is introduced
i.e. the following optimization problem min
|A|F ≤ρ
to control the size of A.
Connection between Self-Attention and Principal Component Analysis
̄x
as
i=1
(cid:80)N
N x⊤
small, we
consider
Let
proximate Pi,j
i=1 |xi − X ⊤Pi,:|2 = (cid:80)N
the optimization problem in (G) when ρ is
N + 1
Pi,j ≈ 1
i Axj
(cid:12)
(cid:12)xi − ̄x − X ⊤XAxi
can ap-
X ⊤1/N .
We have
2 By assuming that all the input patterns are
i=1 |xi − X ⊤XAxi|2 = tr (cid:0)(I − X ⊤XA)2X ⊤X(cid:1) The
i=1 |xi − X ⊤XAxi|2 contains the largest
zero centralized, we have ̄x = 0 and (cid:80)N
theorem below shows that A minimizing the objective (cid:80)N
m eigenvectors of X ⊤X where m is the rank of A.
Theorem 2. Let WQ and WK be matrices of size D × m. Let λ1 ≥ λ2 ≥ ... ≥ λD be the
eigenvalues of X ⊤X ranked in descending order, and let vi ∈ RD, i = 1, . . . , D be the corre-
sponding eigenvectors. The optimal solution A∗ that minimizes (cid:80)N
i=1 |xi − X ⊤XAxi|2 is given by
Define
(cid:12)
(cid:12)
=
A = (cid:80)m
i=1
1
λi
viv⊤
i
Proof. Since WQ, WK ∈ RD×m where m < D, we know that A is a matrix of rank m. Hence,
we know min
k=m+1 λk We also know that by choosing A as
A
A = (cid:80)m
1
i=1
λi
i=1 |xi − X ⊤XAxi|2 ≥ (cid:80)N
i we have
viv⊤
(cid:80)N
28
(cid:80)N
i=1 |xi − X ⊤XAxi|2 = tr
(cid:16)(cid:0)I − (cid:80)m
i=1 viv⊤
i
(cid:1)2
X ⊤X
(cid:17)
= (cid:80)D
k=m+1 λk
Hence, the solution A for minimizing (cid:80)N
i=1 |xi − X ⊤XAxi|2 is essential a weighted combination
of top eigenvectors of X ⊤X. Since a small gradient will prefer a small quantity of (cid:80)N
i=1 |xi −
X ⊤XAxi|2, by minimizing through the self-attention layer, we essentially choose weight matrix
■
WQ and WK to be aligned with the principal directions of X ⊤X.
H Experiment Analysis and Other Key Results
H.1 Experiment analysis of GPT2-FPT model
In this section, we conduct experiments to analyze whether the self-attention frozen pre-trained
model improves performance compared with overall fine-tuning and random initialization. Firstly,
we compare GPT2(6) FPT with the same model without freezing (No Freeze) and random initial
model (No Pre-train). For the end-to-end paradigm No Pre-train GPT2-backbone (6 Layers), we
directly train all parameters of the model. We summarize the results in Table 21 and Table 22. Then
we analyze the performance of various layers to clarify our selection of GPT2(6) FPT.
Table 21: Model analysis results on 5% data. We use prediction length O ∈ {96, 192, 336, 720} for
ILI and O ∈ {24, 36, 48, 60} for others.
Methods
GPT2(6)
No Freeze
No Pretrain
Metric
MSE MAE MSE MAE MSE MAE
r 96
e
h
192
t
a
336
e
720
W
1 96
h
192
T
336
T
E
720
2 96
h
192
T
336
T
E
720
1 96
m
192
T
336
T
E
720
2 96
m
192
T
336
T
E
720
0.175
0.227
0.286
0.366
0.543
0.748
0.754
-
0.376
0.418
0.408
-
0.386
0.440
0.485
0.557
0.199
0.256
0.318
0.460
0.230
0.276
0.322
0.379
0.506
0.580
0.595
-
0.421
0.441
0.439
-
0.405
0.438
0.459
0.499
0.280
0.316
0.353
0.439
0.183
0.275
0.297
0.380
0.671
0.907
0.931
-
0.440
0.503
0.691
-
0.429
0.496
0.535
0.786
0.217
0.300
0.331
0.460
0.229
0.300
0.331
0.388
0.564
0.632
0.655
-
0.449
0.478
0.572
-
0.432
0.470
0.489
0.592
0.293
0.350
0.368
0.436
0.199
0.262
0.326
0.405
0.882
1.389
2.968
-
0.465
0.614
0.596
-
0.394
0.432
0.491
0.564
0.301
0.321
0.371
0.659
0.254
0.302
0.345
0.396
0.643
0.817
1.149
-
0.457
0.536
0.529
-
0.410
0.432
0.464
0.503
0.353
0.365
0.398
0.528
Fine-tune More Parameters Compared with fine-tuning all parameters, self-attention frozen pre-
trained model GPT2(6) FPT achieves better performance on most datasets and yields an overall
12.7% relative MSE reduction on 5% data and 11.5% relative MSE reduction on 10% data. It verifies
that frozen pre-trained attention layers are effective for time series forecasting.
Parameters Initialization Compared with the random initial model, self-attention frozen pre-trained
model GPT2(6) FPT achieves better performance on most datasets and yields an overall 21.2%
relative MSE reduction on 5% data and 14.3% relative MSE reduction on 10% data. It again suggests
that a model pre-trained on cross-domain data can achieve significant performance improvement in
time series forecasting.
The Number of GPT2 Layers For most transformer-based methods in time-series forecasting
Zhou et al. (2022); Wu et al. (2021); Nie et al. (2022), no more than 3 encoder layers are included.
However, most pre-trained models with at least 12 layers may suffer from overfitting in time series
forecasting. To better balance performance and computational efficiency, we test using various
numbers of layers on ETTh2. Additionally, we train a completely random initialized non-pretrained
GPT2 as a comparison. The results are shown in Figure 9, for both 5% and 10% data, the pre-trained
model is unable to do well with few layers but significantly outperforms non-pre-trained GPT2 with
more attention blocks transferred from NLP. It indicates that pre-trained attention layers produce
29
Table 22: No Pretrain and No Freeze results on 10% data. We use prediction length O ∈
{96, 192, 336, 720} for ILI and O ∈ {24, 36, 48, 60} for others.
Methods
GPT2(6)
No Freeze
No Pretrain
Metric
MSE MAE MSE MAE MSE MAE
r 96
e
h
192
t
a
336
e
720
W
1 96
h
192
T
336
T
E
720
2 96
h
192
T
336
T
E
720
1 96
m
192
T
336
T
E
720
2 96
m
192
T
336
T
E
720
0.163
0.210
0.256
0.321
0.458
0.570
0.608
0.725
0.331
0.402
0.406
0.449
0.390
0.429
0.469
0.569
0.188
0.251
0.307
0.426
0.215
0.254
0.292
0.339
0.456
0.516
0.535
0.591
0.374
0.411
0.433
0.464
0.404
0.423
0.439
0.498
0.269
0.309
0.346
0.417
0.168
0.238
0.289
0.398
0.605
0.713
0.747
0.945
0.369
0.464
0.420
0.535
0.429
0.463
0.510
0.780
0.243
0.307
0.337
0.471
0.221
0.286
0.318
0.383
0.532
0.579
0.586
0.688
0.394
0.455
0.439
0.515
0.430
0.446
0.470
0.591
0.311
0.352
0.364
0.440
0.175
0.244
0.301
0.390
0.680
0.738
0.893
2.994
0.422
0.482
0.540
0.564
0.385
0.426
0.506
0.576
0.244
0.318
0.409
0.473
0.229
0.287
0.325
0.378
0.560
0.602
0.641
1.169
0.433
0.466
0.496
0.519
0.401
0.421
0.455
0.505
0.315
0.363
0.412
0.450
a great benefit in time series forecasting. Also, the pre-trained model achieves better performance
between 3 and 9 layers. Thus GPT2 with 6 layers is chosen as our default architecture.
Figure 9: Comparison of pre-trained and non-pre-trained GPT2 with various layers on ETTh2. Color
represents various prediction length O ∈ {96, 192} and line style means different models .
H.2 No Pre-training but Freezing
For comprehensively ablation on pre-training and freezing strategies, we also add experiment for
random initialized GPT2(6) with freezing. The results in Table 23 shows that only input and output
modules can not work and pre-trained knowledge play an importance part in time series tasks.
Table 23: Ablation on random initialized model with freezing.
Methods
Metric
GPT2(6)
No Freeze
No Pretrain
No Pretrain + Freeze
MSE MAE MSE MAE MSE MAE MSE
2
h
T
T
E
96
192
0.376
0.418
0.421
0.441
0.440
0.503
0.449
0.478
0.465
0.614
0.457
0.536
0.540
0.721
30
MAE
0.497
0.580
H.3 Fine-Tuning Parameters Selection
In this section, we conduct ablation experiments to study which parameters are important to fine-tune.
Since the input embedding and output layers are randomly initialized for adapting to a new domain,
they must be trained. Then, we study adding layer normalization and positional embeddings to the list
of fine-tuning parameters. Table 24 shows the results that re-train parameters of layer normalization
and positional embeddings can bring certain benefits, especially in longer prediction lengths. Thus,
we follow the standard practice to re-train positional embeddings and layer normalization.
Table 24: Ablation by fixing positional embeddings or layer normalization on 5% ETTm1 and
ETTm2. Parameters of GPT2(6) are successively added to the list of fine-tuned parameters.
Methods
Input & Output
+ LN
+ POS
Metric
MSE MAE MSE MAE MSE MAE
1 96
m
192
T
336
T
E
720
2 96
m
192
T
336
T
E
720
0.395
0.444
0.510
0.607
0.198
0.261
0.336
0.473
0.410
0.438
0.472
0.517
0.282
0.324
0.377
0.444
0.392
0.436
0.495
0.564
0.198
0.263
0.322
0.457
0.409
0.435
0.467
0.503
0.279
0.325
0.356
0.435
0.386
0.440
0.485
0.557
0.199
0.256
0.318
0.460
0.405
0.438
0.459
0.499
0.280
0.316
0.353
0.436
H.4 Analysis of Data Volume
Results of few-shot learning show that GPT2(6) FPT shows SOTA performance in few-shot learning
tasks in which the model is trained on 5% data and 10% data. Plus, it has comparable performance
with the SOTA baselines PatchTST and Dlinear on full sample forecasting setting as well. This
phenomenon raises a question that how performance changes with an increase in data sample size.
Thus, we conduct experiments on various percentages P ∈ {5%, 10%, 20%, 50%, 80%, 100%} of
ETTh2. Figure 10 shows that the performance improvement for GPT2(6) FPT is almost flattened.
These results illustrate that such a cross-domain FPT model is extremely efficient in few-shot time
series forecasting and only requires a few fine-tuning samples to reach a SOTA performance. For
more complete data, end-to-end training models start to catch up, but still, a GPT2(6) FPT model can
be comparable to those SOTA end-to-end training algorithms.
Figure 10: Results on various percentages of ETTh2. Line color represents different models and line
style means various prediction lengths O ∈ {96, 192}.
31
H.5 Knowledge transfer with other Pre-trained Transformer Models
We investigate how other pre-trained transformer models perform and whether other domains can also
help. Another NLP pre-trained model BERT Devlin et al. (2019) and the CV pre-trained model BEiT
Bao et al. (2022) are trained on 5% ETTh2 and 5% ETTm2. Similar to GPT2, we only reserve 6
layers and freeze attention blocks. Our results are shown in Table 25 that BERT(6) FPT and BEiT(6)
FPT are comparable to PatchTST and remarkably surpass other baselines. We come to the conclusion
that the universality of our proposed architecture holds across other pre-trained-transformer models.
Moreover, the domain of successful knowledge transfer in time series forecasting is not limited to
natural language. Knowledge from the CV domain can also help, supported by BEiT's experimental
results.
Table 25: Results of frozen pretrained transformer variants on 5% ETTh2 and ETTm2. We use
prediction length O ∈ {96, 192, 336, 720}. A lower MSE indicates better performance. Black: best,
Red: second best, Violet: third best. '-' means that 5% time series is not sufficient to constitute a
training set.
Methods
Metric
96
ETTh2
192
336
ETTm2
720
96
192
336
720
GPT2-backbone(6 Layers)
BERT-backbond(6 Layers)
BEiT-backbond(6 Layers)
DLinearZeng et al. (2023)
PatchTSTNie et al. (2022)
FEDformerZhou et al. (2022)
AutoformerWu et al. (2021)
MSE 0.376 0.421 0.408
MAE 0.419 0.441 0.439
MSE 0.397 0.480 0.481
MAE 0.418 0.465 0.472
MSE 0.405 0.448 0.524
MAE 0.418 0.446 0.500
MSE 0.442 0.617 1.424
MAE 0.456 0.542 0.849
MSE 0.401 0.452 0.464
MAE 0.421 0.455 0.469
MSE 0.390 0.457 0.477
MAE 0.424 0.465 0.483
MSE 0.428 0.496 0.486
MAE 0.468 0.504 0.496
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0.199 0.256 0.318 0.460
0.280 0.316 0.353 0.436
0.222 0.281 0.331 0.441
0.300 0.335 0.367 0.428
0.208 0.272 0.331 0.452
0.291 0.326 0.362 0.433
0.236 0.306 0.380 0.674
0.326 0.373 0.423 0.583
0.206 0.264 0.334 0.454
0.288 0.324 0.367 0.483
0.299 0.290 0.378 0.523
0.320 0.361 0.427 0.510
0.232 0.291 0.478 0.533
0.322 0.357 0.517 0.538
H.6 Full Results of Classification
Table 26: Full results for the classification task. ∗. in the Transformers indicates the name of ∗former.
Methods
EthanolConcentration
FaceDetection
Handwriting
Heartbeat
JapaneseVowels
PEMS-SF
SelfRegulationSCP1
SelfRegulationSCP2
SpokenArabicDigits
UWaveGestureLibrary
Average
TCN
RNN
Classical methods
XGBoost Rocket LSTNet LSSL
28.9
31.1
52.8
66.7
53.3
24.6
75.6
72.7
98.9
98.4
68.8
86.1
84.6
90.8
52.2
55.6
100.0 95.6
88.4
85.9
70.3
70.9
39.9
65.7
25.8
77.1
98.1
86.7
84.0
52.8
100.0
87.8
71.8
45.2
64.7
58.8
75.6
96.2
75.1
90.8
53.3
71.2
94.4
72.5
43.7
63.3
15.8
73.2
86.5
98.3
84.6
48.9
69.6
75.9
66.0
Transformers
MLP
Trans. Re.
32.7
67.3
32.0
76.1
98.7
82.1
92.2
53.9
98.4
85.6
71.9
In.
31.6
31.9 31.6
68.4
68.6 67.0
36.7
27.4 32.8
74.6
77.1 80.5
96.2
97.8 98.9
82.7
82.7 81.5
84.0
90.4 90.1
56.7 53.3
50.6
97.0 100.0 99.6 100.0
85.9
85.6 85.6
71.1
71.5 72.1
Pyra. Auto. Station. FED. ETS. Flow. DLinear LightTS.
30.8
65.7
29.4
75.6
98.4
83.2
88.1
53.3
33.8
28.1
31.2
67.6
66.3
66.0
33.8
32.5
28.0
77.6
71.2
73.7
98.9
95.9
98.4
83.8
86.0
80.9
92.5
89.6
88.7
54.4
56.1
55.0
100.0 100.0 98.8
86.6
85.0
85.3
73.0
71.0
70.7
29.7
67.5
26.1
75.1
96.2
88.4
89.8
51.1
100.0
80.3
70.4
32.7
68.0
31.6
73.7
99.2
87.3
89.4
57.2
100.0
87.5
72.7
32.6
68.0
27.0
75.1
96.2
75.1
87.3
50.5
81.4
82.1
67.5
83.4
70.8
TimesNet GPT2(6)
35.7
68.6
32.1
78.0
98.4
89.6
91.8
57.2
99.0
85.3
73.6
34.2
69.2
32.7
77.2
98.6
87.9
93.2
59.4
99.2
88.1
74.0
H.7 Full Results of Anomaly Detection
H.8 Full Results of Imputation
H.9 Full Results of Short-term Forecasting
H.10
Input Length Setting Discussion
The consideration of input length is of great importance. It is widely believed that longer input lengths
have the potential to generate superior results. However, in practice, certain algorithms might fall
short in effectively utilizing long input signals due to overfitting issues either. Here, we conducted
long-term forecasting experiments by comparing our approach with the best reported values from
different baseline papers. This was done to avoid any biases stemming from selective tuning of
baseline parameters. While some may argue in favor of a fairer comparison using a fixed input length,
32
Table 27: Full results for the anomaly detection.
Methods
Metrics
SMD
R
P
F1
P
MSL
R
F1
P
SMAP
R
F1
P
GPT(6)
TimesNet*
PatchTST
ETSformer
FEDformer
LightTS
DLinear
Stationary
Autoformer
Pyraformer
88.89
87.91
87.26
87.44
87.95
87.10
83.62
88.33
88.06
85.61
Anomaly Transformer** 88.91
86.60
82.58
83.46
83.58
86.89
84.61
84.62
83.13
85.08
82.53
77.10
84.62
85.11
83.04
85.49
81.65
75.32
76.21
79.56
* We reproduce the results of TimesNet by https://github.com/thuml/Time-Series-Library.
** We replace the joint criterion in Anomaly Transformer with reconstruction error for fair comparison.
82.45
81.84
78.70
85.03
78.57
78.95
84.88
77.50
79.05
84.86
83.31
84.06
84.40
79.57
78.68
82.91
75.36
70.96
84.93
80.07
75.78
85.42
89.14
80.92
85.93
87.37
86.48
83.31
87.37
87.37
84.98
81.54
82.14
79.23
82.39
78.42
71.52
81.21
82.35
80.61
82.23
77.23
69.24
70.13
76.13
90.60
90.14
90.64
92.25
90.47
92.58
92.32
89.37
90.40
92.54
91.85
90.11
90.91
89.15
89.37
60.95
56.40
55.46
55.75
58.10
55.27
55.41
59.02
58.62
57.71
58.11
57.13
57.44
57.59
57.12
72.88
69.39
68.82
69.50
70.76
69.21
69.26
71.09
71.12
71.09
71.18
69.92
70.40
69.97
69.70
82.00
89.54
88.34
85.13
77.14
82.40
84.34
68.55
77.27
83.81
79.61
81.77
85.51
73.05
71.57
Informer
Reformer
LogTransformer
Transformer
92.20
90.75
91.10
90.02
90.17
91.98
80.91
68.03
89.85
87.92
72.51
70.29
72.50
68.67
68.84
SWaT
R
96.34
95.40
80.94
80.36
96.42
94.72
95.30
96.75
95.81
96.00
97.32
96.75
96.53
97.32
96.53
F1
94.23
93.02
85.72
84.91
93.19
93.33
87.52
79.88
92.74
91.78
83.10
81.43
82.80
80.52
80.37
P
98.62
98.51
98.84
99.31
97.31
98.37
98.28
97.82
99.08
71.67
68.35
64.27
59.93
63.06
62.75
PSM
R
95.68
96.20
93.47
85.28
97.16
95.97
89.26
96.76
88.15
96.02
94.72
96.33
95.38
98.00
96.56
F1
97.13
97.34
96.08
91.76
97.23
97.15
93.55
97.29
93.29
82.08
79.40
77.10
73.61
76.74
76.07
Avg F1
%
86.72
85.24
82.79
82.87
84.97
84.23
82.46
82.08
84.26
82.57
80.50
78.83
77.31
76.60
76.88
Table 28: Full results for the imputation task.
Methods
GPT2(3)
TimesNet
PatchTST
ETSformer
LightTS
DLinear
FEDformer
Stationary Autoformer
Informer
Reformer
Mask Ratio MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
1
m
T
T
E
2
m
T
T
E
1
h
T
T
E
2
h
T
T
E
L
C
E
12.5% 0.017 0.085 0.023 0.101 0.041 0.130 0.096 0.229 0.093 0.206 0.080 0.193 0.052 0.166 0.032 0.119 0.046 0.144 0.063 0.180 0.042 0.146
25% 0.022 0.096 0.023 0.101 0.044 0.135 0.096 0.229 0.093 0.206 0.080 0.193 0.052 0.166 0.032 0.119 0.046 0.144 0.063 0.180 0.042 0.146
37.5% 0.029 0.111 0.029 0.111 0.049 0.143 0.133 0.271 0.113 0.231 0.103 0.219 0.069 0.191 0.039 0.131 0.057 0.161 0.079 0.200 0.063 0.182
50% 0.040 0.128 0.036 0.124 0.055 0.151 0.186 0.323 0.134 0.255 0.132 0.248 0.089 0.218 0.047 0.145 0.067 0.174 0.093 0.218 0.082 0.208
0.028 0.105 0.027 0.107 0.047 0.140 0.120 0.253 0.104 0.218 0.093 0.206 0.062 0.177 0.036 0.126 0.051 0.150 0.071 0.188 0.055 0.166
Avg
12.5% 0.017 0.076 0.018 0.080 0.026 0.094 0.108 0.239 0.034 0.127 0.062 0.166 0.056 0.159 0.021 0.088 0.023 0.092 0.133 0.270 0.108 0.228
25% 0.020 0.080 0.020 0.085 0.028 0.099 0.164 0.294 0.042 0.143 0.085 0.196 0.080 0.195 0.024 0.096 0.026 0.101 0.135 0.272 0.136 0.262
37.5% 0.022 0.087 0.023 0.091 0.030 0.104 0.237 0.356 0.051 0.159 0.106 0.222 0.110 0.231 0.027 0.103 0.030 0.108 0.155 0.293 0.175 0.300
50% 0.025 0.095 0.026 0.098 0.034 0.110 0.323 0.421 0.059 0.174 0.131 0.247 0.156 0.276 0.030 0.108 0.035 0.119 0.200 0.333 0.211 0.329
0.021 0.084 0.022 0.088 0.029 0.102 0.208 0.327 0.046 0.151 0.096 0.208 0.101 0.215 0.026 0.099 0.029 0.105 0.156 0.292 0.157 0.280
Avg
12.5% 0.043 0.140 0.057 0.159 0.093 0.201 0.126 0.263 0.240 0.345 0.151 0.267 0.070 0.190 0.060 0.165 0.074 0.182 0.114 0.234 0.074 0.194
25% 0.054 0.156 0.069 0.178 0.107 0.217 0.169 0.304 0.265 0.364 0.180 0.292 0.106 0.236 0.080 0.189 0.090 0.203 0.140 0.262 0.102 0.227
37.5% 0.072 0.180 0.084 0.196 0.120 0.230 0.220 0.347 0.296 0.382 0.215 0.318 0.124 0.258 0.102 0.212 0.109 0.222 0.174 0.293 0.135 0.261
50% 0.107 0.216 0.102 0.215 0.141 0.248 0.293 0.402 0.334 0.404 0.257 0.347 0.165 0.299 0.133 0.240 0.137 0.248 0.215 0.325 0.179 0.298
0.069 0.173 0.078 0.187 0.115 0.224 0.202 0.329 0.284 0.373 0.201 0.306 0.117 0.246 0.094 0.201 0.103 0.214 0.161 0.279 0.122 0.245
Avg
12.5% 0.039 0.125 0.040 0.130 0.057 0.152 0.187 0.319 0.101 0.231 0.100 0.216 0.095 0.212 0.042 0.133 0.044 0.138 0.305 0.431 0.163 0.289
25% 0.044 0.135 0.046 0.141 0.061 0.158 0.279 0.390 0.115 0.246 0.127 0.247 0.137 0.258 0.049 0.147 0.050 0.149 0.322 0.444 0.206 0.331
37.5% 0.051 0.147 0.052 0.151 0.067 0.166 0.400 0.465 0.126 0.257 0.158 0.276 0.187 0.304 0.056 0.158 0.060 0.163 0.353 0.462 0.252 0.370
50% 0.059 0.158 0.060 0.162 0.073 0.174 0.602 0.572 0.136 0.268 0.183 0.299 0.232 0.341 0.065 0.170 0.068 0.173 0.369 0.472 0.316 0.419
0.048 0.141 0.049 0.146 0.065 0.163 0.367 0.436 0.119 0.250 0.142 0.259 0.163 0.279 0.053 0.152 0.055 0.156 0.337 0.452 0.234 0.352
Avg
12.5% 0.080 0.194 0.085 0.202 0.055 0.160 0.196 0.321 0.102 0.229 0.092 0.214 0.107 0.237 0.093 0.210 0.089 0.210 0.218 0.326 0.190 0.308
25% 0.087 0.203 0.089 0.206 0.065 0.175 0.207 0.332 0.121 0.252 0.118 0.247 0.120 0.251 0.097 0.214 0.096 0.220 0.219 0.326 0.197 0.312
37.5% 0.094 0.211 0.094 0.213 0.076 0.189 0.219 0.344 0.141 0.273 0.144 0.276 0.136 0.266 0.102 0.220 0.104 0.229 0.222 0.328 0.203 0.315
50% 0.101 0.220 0.100 0.221 0.091 0.208 0.235 0.357 0.160 0.293 0.175 0.305 0.158 0.284 0.108 0.228 0.113 0.239 0.228 0.331 0.210 0.319
0.090 0.207 0.092 0.210 0.072 0.183 0.214 0.339 0.131 0.262 0.132 0.260 0.130 0.259 0.100 0.218 0.101 0.225 0.222 0.328 0.200 0.313
Avg
r 12.5% 0.026 0.049 0.025 0.045 0.029 0.049 0.057 0.141 0.047 0.101 0.039 0.084 0.041 0.107 0.027 0.051 0.026 0.047 0.037 0.093 0.031 0.076
e
25% 0.028 0.052 0.029 0.052 0.031 0.053 0.065 0.155 0.052 0.111 0.048 0.103 0.064 0.163 0.029 0.056 0.030 0.054 0.042 0.100 0.035 0.082
h
t
37.5% 0.033 0.060 0.031 0.057 0.035 0.058 0.081 0.180 0.058 0.121 0.057 0.117 0.107 0.229 0.033 0.062 0.032 0.060 0.049 0.111 0.040 0.091
a
e
50% 0.037 0.065 0.034 0.062 0.038 0.063 0.102 0.207 0.065 0.133 0.066 0.134 0.183 0.312 0.037 0.068 0.037 0.067 0.053 0.114 0.046 0.099
0.031 0.056 0.030 0.054 0.060 0.144 0.076 0.171 0.055 0.117 0.052 0.110 0.099 0.203 0.032 0.059 0.031 0.057 0.045 0.104 0.038 0.087
Avg
W
we are starting to shift our focus towards pursuing more accurate algorithms that possess enhanced
capabilities for handling longer inputs. Instead of restricting the input length to a fixed small value, it
is pragmatic to tune both the input length and model parameters based on performance, as it is often
the primary concern in practical usage. Exploring the utilization of extremely long inputs, such as
Chatgpt or LLM, is among our future research directions.
33
Table 29: Full results of short-term forecasting.
Methods GPT2(6) TimesNet PatchTST N-HiTS N-BEATS ETSformer LightTS DLinear FEDformer Stationary Autoformer
Informer Reformer
y SMAPE 13.531
13.387
13.477
13.418
13.436
18.009
14.247
16.965
13.728
13.717
13.974
14.727
16.169
l
r
a
e
Y
MASE
OWA
3.015
0.793
2.996
0.786
y
l
r
e
t
r
a
u
Q
SMAPE 10.177
10.100
MASE
OWA
1.194
0.898
1.182
0.890
3.019
0.792
10.38
1.233
0.921
3.045
0.793
3.043
0.794
4.487
1.115
3.109
0.827
4.283
1.058
3.048
0.803
3.078
0.807
3.134
0.822
3.418
0.881
3.800
0.973
10.202
10.124
13.376
11.364
12.145
10.792
10.958
11.338
11.360
13.313
1.194
0.899
1.169
0.886
1.906
1.302
1.328
1.000
1.520
1.106
1.283
0.958
1.325
0.981
1.365
1.012
1.401
1.027
1.775
1.252
y SMAPE 12.894
l
h
t
n
o
M
MASE
0.956
0.897
OWA
s SMAPE
r
e
h
t
O
MASE
OWA
4.940
3.228
1.029
e SMAPE 11.991
g
a
r
e
v
A
MASE
1.600
OWA
0.861
12.670
12.959
12.791
12.677
14.588
14.014
13.514
14.260
13.917
13.958
14.062
20.128
0.933
0.878
4.891
3.302
1.035
0.970
0.905
4.952
3.347
1.049
0.969
0.899
5.061
3.216
1.040
0.937
0.880
4.925
3.391
1.053
1.368
1.149
7.267
5.240
1.591
1.053
0.981
1.037
0.956
15.880
6.709
11.434
4.953
3.474
1.487
1.102
1.012
4.954
3.264
1.036
1.097
0.998
6.302
4.064
1.304
1.103
1.002
5.485
3.865
1.187
1.141
1.024
2.614
1.927
24.460
32.491
20.960
33.355
5.879
8.679
11.829
12.059
11.927
11.851
14.718
13.525
13.639
12.840
12.780
12.909
14.086
18.200
1.585
0.851
1.623
0.869
1.613
0.861
1.599
0.855
2.408
1.172
2.111
1.051
2.095
1.051
1.701
0.918
1.756
0.930
1.771
0.939
2.718
1.230
4.223
1.775
34
|
|
http://arxiv.org/abs/2302.12653v1 | 2023-02-23T11:11:55 | 2023-02-23T11:11:55 | MesoGraph: Automatic Profiling of Malignant Mesothelioma Subtypes from
Histological Images | Malignant mesothelioma is classified into three histological subtypes,
Epithelioid, Sarcomatoid, and Biphasic according to the relative proportions of
epithelioid and sarcomatoid tumor cells present. Biphasic tumors display
significant populations of both cell types. This subtyping is subjective and
limited by current diagnostic guidelines and can differ even between expert
thoracic pathologists when characterising the continuum of relative proportions
of epithelioid and sarcomatoid components using a three class system. In this
work, we develop a novel dual-task Graph Neural Network (GNN) architecture with
ranking loss to learn a model capable of scoring regions of tissue down to
cellular resolution. This allows quantitative profiling of a tumor sample
according to the aggregate sarcomatoid association score of all the cells in
the sample. The proposed approach uses only core-level labels and frames the
prediction task as a dual multiple instance learning (MIL) problem. Tissue is
represented by a cell graph with both cell-level morphological and regional
features. We use an external multi-centric test set from Mesobank, on which we
demonstrate the predictive performance of our model. We validate our model
predictions through an analysis of the typical morphological features of cells
according to their predicted score, finding that some of the morphological
differences identified by our model match known differences used by
pathologists. We further show that the model score is predictive of patient
survival with a hazard ratio of 2.30. The code for the proposed approach, along
with the dataset, is available at: https://github.com/measty/MesoGraph. | [
"Mark Eastwood",
"Heba Sailem",
"Silviu Tudor",
"Xiaohong Gao",
"Judith Offman",
"Emmanouil Karteris",
"Angeles Montero Fernandez",
"Danny Jonigk",
"William Cookson",
"Miriam Moffatt",
"Sanjay Popat",
"Fayyaz Minhas",
"Jan Lukas Robertus"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12653v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12653v1",
"@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"
] | ||
http://arxiv.org/abs/2302.11917v1 | 2023-02-23T10:48:09 | 2023-02-23T10:48:09 | Diverse Policy Optimization for Structured Action Space | Enhancing the diversity of policies is beneficial for robustness,
exploration, and transfer in reinforcement learning (RL). In this paper, we aim
to seek diverse policies in an under-explored setting, namely RL tasks with
structured action spaces with the two properties of composability and local
dependencies. The complex action structure, non-uniform reward landscape, and
subtle hyperparameter tuning due to the properties of structured actions
prevent existing approaches from scaling well. We propose a simple and
effective RL method, Diverse Policy Optimization (DPO), to model the policies
in structured action space as the energy-based models (EBM) by following the
probabilistic RL framework. A recently proposed novel and powerful generative
model, GFlowNet, is introduced as the efficient, diverse EBM-based policy
sampler. DPO follows a joint optimization framework: the outer layer uses the
diverse policies sampled by the GFlowNet to update the EBM-based policies,
which supports the GFlowNet training in the inner layer. Experiments on ATSC
and Battle benchmarks demonstrate that DPO can efficiently discover
surprisingly diverse policies in challenging scenarios and substantially
outperform existing state-of-the-art methods. | [
"Wenhao Li",
"Baoxiang Wang",
"Shanchao Yang",
"Hongyuan Zha"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11917v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11917v1",
"@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"
] | 3
2
0
2
b
e
F
3
2
]
G
L
.
s
c
[
1
v
7
1
9
1
1
.
2
0
3
2
:
v
i
X
r
a
Diverse Policy Optimization for Structured Action Space
Wenhao Li
The Chinese University of Hong Kong, Shenzhen
Shenzhen, China
[email protected]
Shanchao Yang
The Chinese University of Hong Kong, Shenzhen
Shenzhen, China
[email protected]
ABSTRACT
Enhancing the diversity of policies is beneficial for robustness, ex-
ploration, and transfer in reinforcement learning (RL). In this paper,
we aim to seek diverse policies in an under-explored setting, namely
RL tasks with structured action spaces with the two properties of
composability and local dependencies. The complex action struc-
ture, non-uniform reward landscape, and subtle hyperparameter
tuning due to the properties of structured actions prevent existing
approaches from scaling well. We propose a simple and effective RL
method, Diverse Policy Optimization (DPO), to model the policies in
structured action space as the energy-based models (EBM) by fol-
lowing the probabilistic RL framework. A recently proposed novel
and powerful generative model, GFlowNet, is introduced as the
efficient, diverse EBM-based policy sampler. DPO follows a joint
optimization framework: the outer layer uses the diverse policies
sampled by the GFlowNet to update the EBM-based policies, which
supports the GFlowNet training in the inner layer. Experiments on
ATSC and Battle benchmarks demonstrate that DPO can efficiently
discover surprisingly diverse policies in challenging scenarios and
substantially outperform existing state-of-the-art methods.
KEYWORDS
Reinforcement Learning; Generative Model; Diversity; Robustness
ACM Reference Format:
Wenhao Li, Baoxiang Wang, Shanchao Yang, and Hongyuan Zha. 2023.
Diverse Policy Optimization for Structured Action Space. In Proc. of the
22nd International Conference on Autonomous Agents and Multiagent Systems
(AAMAS 2023), London, United Kingdom, May 29 – June 2, 2023, IFAAMAS,
18 pages.
1 INTRODUCTION
The history of human civilization can be seen as a chronicle of
creative capacity, i.e., the diversity of solutions to the same puz-
zle [63]. Counter-intuitively, a popular consensus in deep learning
with theoretical justifications [50] that most local optimas to a non-
convex optimization problem are very close to the global optimum
has led mainstream AI research to focus on finding a single local
∗Corresponding author
Proc. of the 22nd International Conference on Autonomous Agents and Multiagent Sys-
tems (AAMAS 2023), A. Ricci, W. Yeoh, N. Agmon, B. An (eds.), May 29 – June 2, 2023,
London, United Kingdom. © 2023 International Foundation for Autonomous Agents
and Multiagent Systems (www.ifaamas.org). All rights reserved.
Baoxiang Wang
The Chinese University of Hong Kong, Shenzhen
Shenzhen, China
[email protected]
Hongyuan Zha∗
The Chinese University of Hong Kong, Shenzhen,
Shenzhen Institute of AI and Robotics for Society
Shenzhen, China
[email protected]
solution to a given optimization problem, rather than on which
local optimum is dicovered [103]. It is no coincidence that most
methods in reinforcement learning (RL) are also designed to seek a
single reward-maximizing policy [59, 71, 76].
However, different local optima in the policy space can corre-
spond to strategies that differ in nature, which makes the above
consensus problematic in RL tasks where the environment is unsta-
ble. For example, in adaptive traffic signal control (ATSC) [81, 89, 90]
(conceptual diagram and more examples are included in Figure 1),
if two traffic flows are desired to reach the target points from the
departure points quickly, multiple control strategies with similar
average commuting times may exist due to the combinatorial na-
ture of traffic lights. The performance of a single policy obtained
by reward maximization is bound to be affected if the subsequent
traffic volumes on other sections of the road network associated
with the traveled section of that traffic change. Moreover, if our
goal is to discover a diverse set of policies, some of these may prove
more valuable than others in different situations.
Therefore, celebrating the diversity of policies is beneficial for
many RL applications. In addition to ATSC and the simple game
in Figure 1, these RL application areas include but are not limited
to conversation generation in intelligent customer service [41],
drug discovery in smart healthcare [67], and simulator design in
automated machine learning (AutoML) [86]. Furthermore, in addi-
tion to robustness, a set of diverse policies can also be useful for
exploration [66], transfer [38], and hierarchy [1] in RL.
There is no doubt that RL researchers have demonstrated their
creative ability in discovering diverse policies. The majority of the
literature has been done in the field of neuroevolution methods
inspired by Quality-Diversity (QD), which typically maintains a
collection of policies and adapts it using evolutionary algorithms to
balance the QD trade-off [16, 24, 45, 62, 65, 70]. In another part of
the work, intrinsic rewards have been used for learning diversity in
terms of the discriminability of different trajectory-specific quan-
tities [1, 18, 25, 26, 29, 72, 97], or have been used as a regularizer
when maximizing the extrinsic reward [23, 40, 55, 73, 100]. There
is also a small body of work that transforms the problem into a
Constrained Markov Decision Process (CMDP) [15, 75, 98, 103], or
implicitly induce diversity to learn policies that maximize the set
robustness to the worst-possible reward [38, 95].
This paper considers a more complex, realistic, less focused,
and under-explored setting, namely RL tasks with structured action
spaces. We define structured actions as actions with the following
Figure 1: Robustness of diverse policies in two non-stationary environments: (Left) the adaptive traffic signal control and
(Right) the predator-prey. In these tasks, diverse policies can quickly adapt to changes in the external environment.
two properties: composability, i.e., environmental actions consist of
a large number of atomic actions with complete functionality and
local dependencies, i.e., there are local physical or logical correlations
between atomic actions1. For example, in ATSC, the phases of all
traffic signals on all intersections in the entire road network must
be redetermined at certain intervals, and atomic actions are phases
of each signal and interact with each other through the physical
road network. In addition, for the predator-prey task in Figure 1,
the atomic actions are the decisions of each predator, and there is a
local spatial, logical association.
The high dimensionality of the RL agent's policy due to the com-
posability of structured actions prevents existing methods from
scaling well. Specifically, the combinability will make the underly-
ing reward landscape of the RL problem particularly non-uniform,
which may make QD-like methods require substantially large pop-
ulation sizes to fully explore the policy space and prevent the algo-
rithm from collapsing to visually identical policies [77, 103]. Also,
due to composability, the complex soft objective introduced by in-
trinsic reward or CMDP-driven methods will result in non-trivial
and subtle hyperparameter tuning [55, 65]. In addition, the existing
agents' policies are mainly parameterized categorical distributions
or Gaussian distributions. Their extension to structured actions
with independent assumptions on atomic actions will prevent the
agent from effectively using the structural information of environ-
mental actions to achieve an efficient search for the policy space.
We propose a simple and effective RL method, Diverse Policy
Optimization (DPO), to discover a diverse set of policies in tasks
with structured action spaces. We follow the probabilistic reinforce-
ment learning (PRL) framework [40] to transform reinforcement
learning problems under stochastic dynamics into variational in-
ference problems on probabilistic graphical models and model the
policies of RL agents as the energy-based models (EBM). The action
distribution induced by this EBM in a structured action space is
highly multimodal, and sampling from such a high-dimensional
distribution is intractable. To this end, we introduce a recently
proposed novel and powerful generative model, Generative Flow
Networks (GFlowNet) [4, 5, 33, 99], as the efficient diverse policy sam-
pler. GFlowNet can be regarded as amortized Monte-Carlo Markov
chains (MCMC), which gradually builds composable environmental
actions through the single but trained generative pass of "building
blocks (i.e., atomic actions)", so that the final sampled environmen-
tal actions obey a given energy-based policy distribution.
Notably, our method does not simply introduce the GFlowNet
to RL with structured action spaces. Since in the PRL framework,
with the update of the soft Q function, the energy-based policy
distribution is also constantly changing. This violates the assump-
tion of the fixed energy model in GFlowNet and makes DPO face
a more complex optimization problem. Therefore, we model DPO
as a joint optimization problem: the outer layer uses the diverse
policies sampled by the GFlowNet to update the soft Q function,
and the inner layer trains the GFlowNet through an EBM based
on the soft Q function (see Figure 3). Furthermore, a two-timescale
alternating optimization method is proposed to solve it efficiently.
We empirically validate DPO on ATSC tasks [2] where atomic ac-
tions have local physical dependencies, and more generally, Battle
scenarios [102] where atomic actions have logical local dependen-
cies. Experiments demonstrate that DPO can reliably and efficiently
discover surprisingly diverse strategies in all these challenging
scenarios and substantially outperform existing baselines. The con-
tributions can be summarized as follows:
(1) We propose a novel algorithm, Diverse Policy Optimization, for
discovering diverse policies for structured action spaces. The
GFlowNet-based sampler can efficiently sample diverse policies
from the high-dimensional multimodal distribution induced by
structured action spaces.
(2) We propose an efficient joint training framework to interleaved
optimize the soft-Q-function-based EBM and the reward-conditional
GFlowNet-based sampler.
(3) Our algorithm is general and effective across structured action
spaces with physical and logical local dependencies.
2 PRELIMINARIES AND NOTATIONS
The proposed DPO follows the PRL to model policies as a high-
dimensional multimodal energy-based probability distribution and
introduces GFlowNet to efficiently sample policies with diversity
from this distribution. Below, we briefly review the PRL and GFlowNet.
2.1 Probabilistic Reinforcement Learning
PRL aims to learn the maximum entropy optimal policy:
(st
e,at
e )∼ρπ
(cid:2)r (cid:0)st
e, at
e
(cid:1) + αH (cid:0)π (cid:0)* | st
e
(cid:1)(cid:1)(cid:3) ,
π ∗
ent = arg maxπ
∑︁
E
t
e ∈ Se and at
where st
e ∈ Ae denotes the state and action respec-
tively. The subscript e represents the "environment", which is used
to distinguish related concepts in RL from GFlowNets, and the α is
the coefficient to trade off between entropy and reward. Function
H denotes the entropy term. By defining the soft Q function as:
1In this paper, only pairwise relationships between atomic actions are considered.
Q∗
soft
e, at
(cid:0)st
e
(cid:1) := rt
e + Est +l
e ∼ρπ
(cid:2)(cid:205)∞
l=1
γ l (cid:0)r t +l
e
+ αH (cid:0)π ∗
ent
(cid:0)* | st +l
e
(cid:1) (cid:1)(cid:1)(cid:3) .
(1)
Increasedtraffic flowLandformchangesShort CommuteLong CommutePlan APlan BPlan AThe optimal maximum entropy policy can be proved as in [40]
π ∗
ent = exp
(cid:18) 1
α
(cid:16)
Q∗
soft
e, at
(cid:0)st
e
(cid:1) − V ∗
soft
(cid:0)st
e
(cid:1) (cid:17)(cid:19)
,
where the soft value function V ∗
soft is defined by
V ∗
soft
(cid:0)st
e
(cid:1) = α log
∫
exp
Ae
(cid:18) 1
α
Q∗
soft
(cid:0)st
e, a′
e
(cid:1)
(cid:19)
da′
e .
(2)
(3)
Thus the policy learning can be treated as the approximation to
the Boltzmann-like distribution of optimal Q function. Taking the
soft Q-Learning (SQL) [27] method as an example, it provides the
optimal Q is the fixed point of soft Bellman backup, which satisfies
the soft Bellman equation
(cid:1) = rt
(cid:104)
V ∗
(cid:16)
st +1
e
e, at
(cid:0)st
e
e + γEst +1
Q∗
(4)
(cid:17)(cid:105)
.
e ∼pse
soft
soft
Due to the infinite set of states and actions, it takes parameterized Q
and uses a function π as an approximate sampler of Boltzmann-like
distribution of Q. Specifically, it updates Q and π as:
minθ JQ (θ ) := Est
e,at
e,r t
e ,st +1
e ∼D
(cid:20)
1
2
(cid:16)
e + V ̄θ (cid:0)st +1
r t
e
(cid:1) − Qθ (cid:0)st
e, at
e
(cid:1)(cid:17)2(cid:21)
minφ Jπ (cid:0)φ; st
e
(cid:1) := KL
(cid:16)
πφ (cid:0)*|st
e
(cid:1) ∥ exp
(cid:16) 1
α
(cid:16)
Qθ (cid:0)st
e, *(cid:1) − V θ (st
e )
(cid:17)(cid:17) (cid:17)
where function V θ is denoted as
V θ (cid:0)st
e
(cid:1) := α log Ea′
e ∼qa′
e
(cid:20)
exp
(cid:18) 1
α
Qθ (cid:0)st
e, a′
e
(cid:1)
(cid:19)
/qa′
e (a′
e )
(cid:21)
,
,
,
(5)
(6)
and θ, ̄θ, φ denote the parameters of critic, target critic and policy
respectively; qa′ is an arbitrary policy distribution. The policy dis-
tribution induced by the EBM (i.e., the Boltzmann-like distribution
of Q) under structured action spaces is highly multimodal, and sam-
pling from such a high-dimensional distribution is intractable. In
this paper, DPO introduces a powerful generative model, Generative
Flow Networks (GFlowNet), as the efficient diverse policies sampler.
2.2 Generative Flow Networks
Generative flow networks, which are trainable generative policies,
model the generation or sampling process of composite objects
x ∈ X by a sequence of discrete actions that incrementally modify a
partially constructed object (state). Note that action and state here
do not refer to the concepts in RL [99]. In this paper, we model
actions in RL problems with structured action spaces as states in
GFlowNet, and actions in GFlowNet correspond to the atomic actions
that compose structured actions. In other words, the composite
object x generated by the GFlowNet is ae , and X is equivalent to Ae .
The partially constructed object and corresponding action sequence
space can be represented by a directed acyclic graph (DAG, See the
DAG consisting of traffic lights and roads in Figure 2) G = (Sg, Ag),
where the subscript g denotes the "GFlowNet". The vertices in Sg
are states and the edges in Ag are actions that modify one state
to another. The tails of incoming edges and the heads of outgoing
edges of a state are denoted as the parents and childrens, respectively.
The sampling process of the composite object ae starts from the
g and transits to the terminal state sn
initial state s0
g ∈ Ae , which is
a state without outgoing edges, after n ∈ (0,T ] steps and T is the
maximum length. Note that the same terminal state may correspond
to multiple action sequences.
g
g → s1
g → . . . → sn
A complete trajectory is a state sequence from a initial state
to a terimal state s0
g , where each transi-
tion st
g → st +1
is an action in Ag. A trajectory flow is a unnor-
malized density or a non-negative function, F : T → R≥0, on
the set of all complete trajectories T . The flow is called Markov-
ian if there exist distributions PF (*
| sg) over the children of
every non-terminal state sg and a constant Z , such that for any
complete trajectory τ we have PF (τ) = F (τ)/Z with PF (τ) =
(cid:16)
g | sn−1
sn
PF
is called a
g
forward policy, which is used to sample the composite object ae from
the density F . PT (ae ) then denotes the probability that a complete
trajectory sampled from PF terminates in ae .
(cid:16)
g | s0
s1
g
(cid:16)
g | s1
s2
g
(cid:16)
st +1
g
. . . PF
| st
g
. PF
PF
(cid:17)
(cid:17)
(cid:17)
(cid:17)
The problem we are interested in is fitting a Markovian flow to
a fixed energy function on Ae . Given an energy function E (ae ) :=
− log R(ae ) and the associated non-negative reward function (again,
not a reward in RL) Rg : Ae → R≥0, one seeks a Markovian flow F
such that the likelihood of a complete trajectory sampled from F
terminating in a given ae is proportional to Rg (ae ), i.e., PT (ae ) ∝
Rg (ae ). This F can be obtained by imposing the reward-matching
constraint: Rg (ae ) = (cid:205)
F (τ). The details of how
(cid:16)
g→...→sn
s0
g
to parameterize a GFlowNet and train a Markovian flow F that
satisfies the reward matching constraint will be explained soon.
g =ae
τ=
,sn
(cid:17)
3 DIVERSE POLICY OPTIMIZATION
This section proposes a simple and effective RL method, Diverse
Policy Optimization (DPO), to discover diverse policies in structured
action spaces. We follow the probabilistic reinforcement learning
(PRL) framework [40] to transform RL problems under stochas-
tic dynamics into variational inference problems on probabilistic
graphical models and model the policies of RL agents as EBMs. PRL
framework corresponds to a maximum entropy variant of reinforce-
ment learning or optimal control, where the optimal policy aims to
maximize the expected reward and maintain high entropy. Due to
the maximum entropy objective, some existing works [27, 28] have
proposed algorithms for low-dimensional continuous action spaces
to discover diverse policies based on this framework.
Our method is an instance of the maximum entropy actor-critic
algorithm in the PRL framework, which adopts a message-passing
approach and can produce lower-variance estimates. In addition, to
make the policy still scalable in the structured action space, we do
not use an explicit policy parameterization but fit only the message,
i.e., the Q-value function, similar to soft Q-learning [27]. Specifi-
cally, we opt for using general energy-based policies π (ae | se ) ∝
exp (−E (se, ae )) , where E is an energy function. Furthermore, we
set E (se, ae ) = − 1
α Qsoft (se, ae ), then the optimal maximum en-
tropy policy is an EBM that satisfies Equation (2).
However, The action distribution induced by this EBM in a struc-
tured action space is highly multimodal, and sampling from such a
high-dimensional distribution is intractable. Fortunately, the com-
posability and local dependencies of the structured action space
make generative flow networks naturally suitable for efficiently
sampling diverse and high-quality policies from it. And we only
need to set the energy function that needs to be fitted by the Markov-
ian flow F (ae ) (where the action ae corresponding to the composite
Figure 2: A GFlowNet iteratively constructs an composite object, e.g., a traffic light network. st represents the state of the
partially constructed object, at represents the action taken by the GFLowNet to transition to state st +1 = T (st , at ). The GFlowNet
take a 3-lights traffic network as input and determines an action to take. This process repeats until an exit action is sampled
or maximum light number is achieved and the sample is complete.
object x) to be (−1/α) *Qsoft (se, ae ), and its associated reward func-
tion Rg (ae ) to be set to exp ((1/α) * Qsoft (se, ae )), we can elegantly
introduce GFlowNet as an efficient and diverse sampler.
Nevertheless, the unreasonable part of the above modeling is
that there is no place left for the environment state se in the input
of the Markovian flow and the reward function. The reason is that
π in the PRL framework is a conditional distribution, but GFlowNet
is an unconditional sampler. To this end, we will introduce a variant
of GFlowNet, namely reward-conditional GFlowNet, to model the
policy of RL agents, and details will be explained shortly.
Since in the PRL framework, with the update of the Qsoft, the
energy-based policy distribution is also constantly changing. DPO
adopts a joint training framework where the EBM and the GFlowNet
are optimized alternately, similar with [99]: The energy function
serves as the negative log-reward function for the GFlowNet, which
is trained with the trajectory balance [54] objective to sample from
the evolving energy-based policies. In contrast, the energy function
is trained with soft Bellman backup, where the GFlowNet provides
diverse samples. The schematic diagram of RL based on reward-
conditional GFlowNet as the agent's policy and the joint training
framework are shown in Figure 3 and Algorithm 1.
In the following, we will explain the generation process of struc-
tured action, the parameterization and training of reward-conditional
GFlowNet, and its interleaved update with EBM, respectively.
3.1 Structured Action Generative Process
The framework of diverse policy optimization is introduced in
the previous section, and this section will describe the process
of generating structured actions based on the reward-conditional
GFlowNet. The local dependencies of structured actions indicate
that there may be two correlations between atomic actions: locally
physical and locally logical correlations. The former is a typical
graph, while the latter belongs to a typical set. For the unity of
the framework, this paper only considers the physical correlation
between atomic actions. It transforms the logical correlation into
the physical correlation without loss of generality.
Expressly, we assume that atomic actions with local logical cor-
relations have a fixed influence range with a radius d in Euclidean
space. An atomic action can then establish a physical correlation
Figure 3: The schematic diagram of RL based on GFlowNet
as the agent's policy and the joint training framework.
with others within its influence range. Of course, other types of
topologies, such as fully connected, star, hierarchical, etc., can also
be used in addition to adjacency topologies. This paper adopts the
adjacency topology to make a trade-off between efficiency and per-
formance. The experimental results also show that the algorithm
performance is not sensitive to the influence radius d.
In the structured action space, the action consists of N atomic
actions in K-dimensional discrete space, i.e., ae ∈ Ae ≜ [K]N ,
where [K] ≜ {0, . . . , K − 1}. ae could be a phase configuration of
N traffic lights, and each traffic light contains K phases or the joint
action of N predators, and each predator can go in K directions.
We model the generation or sampling of vectors in Ae by a reward-
conditional GFlowNet. The state space of GFlowNet is denoted as
(cid:111)
Sg, and we have Sg ≜ (cid:110)(cid:16)
g, . . . , sN
,
s1
g
where the void symbol ⊘ represents a yet unspecified atomic action.
The DAG structure on Sg is the N -th Cartesian power of the DAG
with states [K] ∪ ⊘, where [K] are children of ⊘. Concretely, the
g ∈ [K] ∪ ⊘, n = 1, . . . , N
| sn
(cid:17)
Light 1 Phase 2Light 2 Phase 4Light 3 Phase 2GFlowNet draw = "Add a new light connected to Light 2, and set light phase to Phase 3"Light 1 Phase 2Light 2 Phase 4Light 3 Phase 2 determines Light 4 Phase 3GFlowNet draw = "..."...Agent: Incrementally modify a partially constructed environment action with atomic actionsEnvironmentStructured action State Reward Conditional GFlowNet Energy-based Model Training with trajectorcy-balance loss Diverse SamplingTraining with soft Bellman backupExecutionTraining(cid:17)
(cid:16)
g, . . . , sN
children of a state sg =
s1
are vectors that can be obtained
g
from sg by changing any one atomic action sn
g from ⊘ to [K], and
its parents are states that can be obtained by changing a single
atomic action sn
g ∈ [K] to ⊘.
(cid:111)
Moreover, Ae is naturally identified with {sg ∈ Sg : |sg | = D }
g ∈ [K], n = 1, . . . , N
(cid:110)
g | sn
sn
where |sg | ≜ #
. Similarly, the initial
g ≜ (⊘, ⊘, . . . , ⊘), which means that the reward-
state is denoted as s0
conditional GFlowNet-based RL policy needs to take N steps to
sample a structured action, i.e., constructing a trajectory from s0
g to
ae ∈ Ae . The forward policy PF |e (*|sg, se ) of a reward-conditional
GFlowNet (will explained soon), extends from §2.2, is a distribution
over all paths to select a position with a void atomic action in sg
and a value k ∈ [K] to assign to this atomic action based on the
environmental state se ∈ Se . Thus the action space for a state sg
has size K (N − |sg |). Since k ≪ N , the action space of the forward
policy (same as the backward policy below) grows linearly with
the atomic actions increase, so DPO has a good scalability. Corre-
spondingly, the backward policy PB |e (*|sg, se ) is a distribution over
the |sg | paths to select a position with a nonvoid atomic action in sg.
More efficient generation. As we mentioned earlier, as an amor-
tized version of MCMC, GFlowNets can alleviate the mix-moding
problem [34, 69] of the MCMC method, thereby improving the sam-
pling efficiency of diverse samples. However, if the two modes are
close enough, the MCMC method will have higher sampling effi-
ciency because it only perturbs the previous sample slightly. How-
ever, GFlowNets, for this case, need to rebuild the entire structured
action sequentially, although only a minimal number of atomic ac-
tions have changed. To this end, we introduce a small trick: adding
a termination action in the action space. GFlowNets are trained to
successfully sample from two close modes by deciding to terminate
at different modes at different runs. Since the physical meaning
of the termination action is quite different from other actions, we
use a different output head to predict it separately, as shown in
Figure 4. Once the forward policy PF |e (*|sg, se ) decides to take the
termination action, the output of the other head will be ignored.
Experiments show that this small trick can significantly improve
the learning efficiency of the algorithm in some tasks.
3.2 GFlowNet Parameterization
After showing how to sample structured actions using the GFlowNet,
this section elaborates on how to parameterize it and train a Mar-
kovian flow F that satisfies the reward matching constraint. As
stated earlier, if we take the form of the GFlowNet in §2.2, there
will be no place for the environment state se in the forward policy
PF as well as in the backward policy PB. Thus, we use an extended
version of flow networks by conditioning each component on some
information, which is external to the flow network but influences
the terminating flows. In our setting, the external information is
RL's environmental state se . Since the external information se af-
fects the reward function Rg in §2.2, this conditional GFlowNet is
also called reward-conditional GFlowNet [5, Definition 29].
Since reward-conditional GFlowNets are defined using the same
components as the unconditional one, they inherit from all the
properties of the GFlowNet for all DAGs Ge = (Sg, Ag, Se ) and
flow functions Fe : T × Se → R≥0, where e represents the "en-
vironment" in RL again. In particular, we can directly extend no-
tions of §2.2 to reward-conditional GFlowNets with forward pol-
icy PF |e (*|sg, se ), backward policy PB |e (*|sg, se ), energy function
E (ae |e) := − log R (g|e)(ae |se ) and the associated non-negative re-
ward function Rg |e : Ae × Se → R≥0; The only difference is that
now every term explicitly depends of the conditioning variable,
environmental state se ∈ Se under the RL context.
In our experiments, we parameterize the forward and backward
policy with deep neural networks PF |e (θF ) and PB |e (θB) respec-
tively, and for convenience, we omit the input without introducing
ambiguity. As PF incrementally builds structured actions, its ac-
tion space gradually decreases, similar to the traveling salesman
problem (TSP) [64]. Considering the effectiveness of the pointer net-
work [84] in dealing with such problems, we introduce the modified
graph pointer network (GPN, [49]) as the forward and backward
policy (see Figure 2) to further model the structured information of
the action space. The forward process of the modified GPN can be
divided into the following three stages:
Environmental state encoding: In this stage, the i-th row of the
adjency matrix li and local observed information oi of each atomic
action are concatenated as si |e = [li ∥oi ], and then si |e is embedded
into a higher dimensional vector ̃si |e ∈ Rd by a shared feed-forward
network, where d is the hidden dimension. The context information
is then obtained by encoding all atomic actions' embeddings se via a
graph neural network (GNN, [37, 92]), where se = [ ̃s⊤
N |e ]⊤.
1|e
Each layer of the GNN is expressed as:
, . . . , ̃s⊤
(cid:19)
(cid:18)
,
(cid:111)
(7)
(cid:110)
sl−1
j |e
j ∈N (i)∪{i }
sl
i |e = γsl−1
i |e Θ + (1 − γ)φθ
1
|N (i)|
i |e ∈ Rdl is the l-th layer variable with l ∈ {1, . . . , L},
where sl
i |e = si |e , γ is a trainable parameter, Θ ∈ Rdl −1×dl is a trainable
s0
weight matrix, N (i) is the adjacency set of atomic action i, and φθ :
Rdl −1 → Rdl is the aggregation function [37], which is represented
by a neural network in our experiments.
GFlowNet state encoding: In this stage, we use the vectors point-
ing from the newly added atomic action to all others as the embed-
ding of sg, which is similar with Ma et al. [49]. Specifically, for the
newly added atomic action ̃si |e , suppose sE|i =
RN ×d is a matrix with identical rows ̃s1|e . We define sg = sL
(cid:104)
s⊤
i |g
, . . . , ̃s⊤
∈
i |e
i |e −sE|i =
∈ RN ×d . Then sg is passed into the GNN again
and the embedding of each atomic action after GFlowNet state
encoding is denoted as sL
Atomic action selection: The atomic action selector is based on
the Linear Transformer [35], which has the advantage of not suffer-
ing from the quadratic scaling in the input size. This architecture
relies on a linearized attention mechanism, defined as
g WQ K = sL
Q = sL
(cid:104)
̃s⊤
i |e
, . . . , s⊤
i |g.
N |g
(cid:105) ⊤
(cid:105) ⊤
g WV ,
g WK V = sL
(cid:0)ψ (Qk )⊤ ψ (cid:0)Kj (cid:1)(cid:1) Vj
ψ (Qk )⊤ ψ (cid:0)Kj (cid:1)
(cid:205)N
j=1
(cid:205)N
(8)
,
j=1
where ψ (*) is a non-linear feature map, and Q, K, and V are lin-
ear transformations of sL
g corresponding to the queries, keys, and
LinAttnk (sL
g ) =
Figure 4: The parameterized forward and backward policy based on the modified graph pointer network.
values respectively, as is standard with Transformers. The pointer
vector outputted by the Linear Transformer is first masked by the
mask m associated with the physical dependencies in structured
action space and is then passed to a softmax layer to generate a
distribution over the next candidate intersections. Similar to pointer
networks [84], the masked pointer vector ui is defined as:
( j)
u
i
=
(cid:40)
if j ≠ σ (k), ∀k < j,
( j)
u
i
−∞ otherwise,
(9)
( j)
where σ (k) denotes k-th processed atomic action and u
i
j-th entry of the vector ui .
is the
3.3 Reward-Conditional GFlowNet Training
After parameterizing the GFlowNet, we now describe how reward-
conditional GFlowNets could be trained toward matching a given
conditional reward. Recall from §2.2, §3 and §3.1, given a non-
negtive conditional reward function Rg |e : Ae × Se → R≥0, a
reward-conditional GFlowNet can be trained so that its terminating
probability distribution matches the associated energy-based model.
To be precise, the marginal likelihood that a trajectory sampled
from the forward policy PF |e (*|sg, se ) terminates at a given struc-
tured action is propotional to the action's soft Q value PT (ae |se ) ∝
exp ((1/α) * Qsoft (se, ae )), where ae ∈ Ae and se ∈ Se .
To train the parameters θF and θB of the reward-conditional
GFlowNet, we use the trajectory balance objective [54] that opti-
mizes the following objective along complete trajectories τ = (s0
g →
g → . . . → . . . → sn
s1
g ):
(cid:17)
2
(cid:16)
st +1
g
,
(cid:17)
R
PF
PB
(10)
, se ; θB
(cid:16)
sn
g |se
|st
g, se ; θF
(cid:16)
g |st +1g
st
LΘ (τ |se ) =
log
Z (se ; θZ ) (cid:206)n−1
t =0
(cid:17) (cid:206)n−1
t =0
where Θ ≜ {θF , θB, θZ }. The scalar function Z (*) is parametrized in
the log domain, as suggested by Malkin et al. [54]. With the trajec-
tory balance objective, we train the reward-conditional GFlowNet
with stochastic gradient Eτ∼πΘ (τ |se ) [∇ΘLΘ (τ |se )] with some train-
ing trajectory distribution πΘ (τ). Akin to RL settings, we take πΘ
to be the distribution over trajectories sampled from a tempered
version of current forward policy PF |e (*|sg, se ). That is, τ is sampled
with st +1
g, se ) starting from s0
e , mixed with a uniform
action policy to ensure πΘ has full support.
g ∼ PF |e (*|st
Learning about total flow Z . Experiments show that learning the
scalar function Z (*) end-to-end is very difficult. Since Z represents
the total flow in the entire flow network, many samples are required
for an accurate estimation. Unlike the original work of trajectory
balance [54], in our setting, the scalar function Z needs to condi-
tion on the external environmental state se thus has higher sample
complexity. Interestingly, since the target EBM of GFlowNets is
derived from the PRL framework in our method, Z has an addi-
tional physical meaning, i.e., the soft value function V ∗
(*) in §2.1.
soft
Since the soft value function is dependent on the soft Q value, Z
can be updated by a mechanism similar to the bootstrap learning
adopted by RL, thereby improving the sample efficiency. To this
end, in addition to end-to-end training of Z using Equation (10),
we estimate V ∗
(*) in the same way as in Haarnoja et al. [27] and
soft
fit Z to it. The experimental results show that this form of mixed
gradient update can improve the learning efficiency of Z.
3.4 Joint Training with EBM
Reward-conditional GFlowNets' training relies on a given func-
tion Rg |e (ae |sg, se ) to provide reward signals. However, in the PRL
framework, the energy-based policy distribution is also constantly
changing with the update of the soft Q function. Therefore, we
propose a joint training framework (Algorithm 1), where the EBM
and the reward-conditional GFlowNet are optimized alternately:
(1) GFlowNet updating step: the soft Q function serves as the
reward function for the GFlowNet, which is trained with the
trajectory balance objective to sample from the evolving EBM;
the EBM is trained with soft Q itera-
tion [27, §3.1] where the GFlowNet provides diverse samples.
Moreover, again inspired by soft Q-learning [27], we find it advan-
tageous to evaluate the forward policy, backward policy and total
flow function in (10) with a separate target network, where the
parameters ̄θF , ̄θB and ̄θZ are updated softly [44].
(2) EBM updating step:
4 EXPERIMENTS
In this section, we will empirically validate DPO on two RL prob-
lems with structured action space, which include ATSC tasks [2]
where atomic actions have physical local dependencies; and more
generally, Battle scenarios [102] where atomic actions have logical
local dependencies (see Appendix for more environment details). It
is worth noting that we did not use the population diversity (PD)
proposed by Parker-Holder et al. [65] or the modified PD proposed
by Zhou et al. [103] as one of the evaluation metrics. In our ex-
periments, we find that due to the high dimensionality and local
dependencies of structured actions, PD, a locality indicator, cannot
well reflect the diversity of policies. Therefore, we evaluate different
global metrics for different tasks to verify the diversity.
1234MLPCoordFeatureEmbedding12341234...GNN x L12341234...GNN x L=-Linear Transformer MaskSoftmax1234PoolSigmoid1234TerminateStateTopologyLinear Transformer Algorithm 1 Joint Training Framework of DPO
1: {θQ, θF , θB, θZ } ∼ some initialization distributions, assign tar-
get parameters { ̄θQ, ̄θF , ̄θB, ̄θZ }, D ← empty replay buffer;
4:
2: for each epoch until some convergence conditions do
for each timestep t until the maximum limitation do
3:
e ; θF );
e, rt
e, st +1
e
i=0 ∼ D.
Sample an structured action at
Save the new experience: D ← D ∪ (cid:8)(cid:0)st
Sample a minibatch: {(s (i)
EBM updating step:
e via PF |e (*|*, st
e, at
(i) )}N
e , a (i)
e , r (i)
e
, s ′
e
5:
6:
(cid:1) (cid:9);
Update θQ according to computed empirical gradient
in (5) and empirical soft values in (6);
GFlowNet updating step:
Update {θF , θB, θZ } with computed empirical gradient
of (10), update θZ with MSE loss with computed empirical
soft values additionally;
Update target parameters similar with Lillicrap et al. [44].
7:
8:
9:
10:
11:
4.1 Adaptive Signal Traffic Control
We choose the following algorithms as baselines, mainly including
the state-of-the-art methods for the ASTC task and for encouraging
policy diversity: Max-Pressure control (MP) where the phase com-
bination with the maximal joint pressure is enabled as described
in [9]; MPLight-implementation is based on the FRAP open source
implementation [101] along with the ChainerRL [22] DQN imple-
mentation and pressure sensing; DvD [65] is a population-based
RL method for effective diversity; SQL [27] method is the skeleton
of the proposed DPO, which can obtain diverse policies in the low-
dimensional continuous action space; Recent proposed RSPO [103]
transforms the problem of seeking diversity policies into a con-
strained Markov decision process.
Table 1: Performance (↓) on the ATSC benchmark.
MP
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
SQL
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
MPLight
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Ing. Reg. Col. Reg. DvD
22.06
59.64
86.02
197.23
5.46
20.19
0.8
0.38
Ing. Reg. Col. Reg. RSPO
58.32
67.65
116.29
205.44
30.01
26.45
1.15
2.06
Ing. Reg. Col. Reg. DPO
60.42
78.16
123.93
215.72
30.34
34.57
2.33
1.48
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
55.91
115.54
28.35
2.28
Ing. Reg. Col. Reg.
73.22
212.81
31.36
1.42
Ing. Reg. Col. Reg.
90.42
226.5
44.16
1.74
Ing. Reg. Col. Reg.
57.2
192.75
18.26
0.65
57.28
120.53
28.19
2.59
20.28
81.42
4.77
0.32
Figure 5: Learning curves of decay (↓) on the ATSC.
From the experimental results in Table 1 and Figure 5, it can
be seen that DPO achieves state-of-the-art (SOTA) performance
and convergence speed on two coordinated control tasks in TAPAS
Cologne and InTAS scenarios. It is worth noting that classical MP
methods based on heuristic rules and expert knowledge also show
good results. DPO can outperform the MP method through a rein-
forcement learning mechanism, showing its superiority in solving
the ATSC problem. While among the three algorithms that encour-
age policy diversity, the DvD performs the worst, which we believe
is due to the limitations of how it computes the distance between
two policies on complex problems. The other two algorithms, SQL
and RSPO, can show near-SOTA performance on small-scale prob-
lems, i.e., the TAPAS Cologne scenario where a structured action
consists of 8 atomic actions. However, in the larger-scale InTAS
scenario, its performance drops sharply, which shows that existing
algorithms that encourage policy diversity have certain limitations
when dealing with structured action spaces.
Figure 6: Comparison of policy diversity between DPO and
RSPO under the ATSC benchmark. Different colors repre-
sent different commute times.
Figure 6 shows the comparison of the policy diversity between
RSPO and DPO (see the appendix for more results). We ignore the
atomic action level, that is, the diversity of each traffic light's phase
selection strategy, but the diversity of the entire road network's traf-
fic control strategy. To this end, we calculate the average commute
time of the main road under multiple random seeds for different
algorithms in different scenarios. Furthermore, for visualization
convenience, we normalized each algorithm separately. Red indi-
cates longer commute time; otherwise, it is shown in blue. As seen
from the figure, DPO learns policies with sufficient diversity in
structured action spaces of different scales, but RSPO only shows
some effect in small-scale tasks.
024681012Episodes (x100)5075100125150175200225Delay (s)Ingolstadt RegionMPSQLMPLightDvDRSPODPO024681012Episodes (x100)255075100125150175Delay (s)Cologne RegionMPSQLMPLightDvDRSPODPOI-RSPODPORSPOCologneRSPODPOIngolstadt4.2 Battle Scenario
In the Battle scenario, the atomic action is each agent's action,
and we transform the logical correlation between each agent into
the physical correlation without loss of generality. Expressly, we
assume that atomic actions with local logical correlations have a
fixed influence range with a radius d = 4 in Euclidean space. In this
benchmark, we additionally select IDQN, the built-in algorithm in
the MAgent, and MFQ [93], the state-of-the-art algorithm on the
Battle as baselines.
Figure 7: Boxplot of average kill number (↑) and average
agent reward (↑) of 50 runs on Battle Game. Results compares
the average agent number of blue army killed by red army
(left part of each figure) and the average individual rewards
of each agent (right part of each figure) respectively.
We first train the IDQN in a self-play way and the blue agent
loads the checkpoint and fixes the model parameters. The red agent
is then trained with different algorithms, and the final result is
shown in Figure 7. It is worth noting that DvD, SQL, and RSPO are
less scalable. So in the Battle scenario, we combine independent
learning to obtain I-DvD, I-SQL, and I-RSPO variants. Independent
learning does not constrain the algorithm's performance, while the
IDQN algorithm also shows promising results. As seen from the
figure, the three algorithms that encourage policy diversity do not
show good results in large-scale structured action spaces, while
DPO can still stably approach the performance of SOTA.
Figure 8 shows the diversity of policies between I-RSPO and
DPO in the early and middle stages of the game (see appendix
for more results). As seen from the figure, the policies learned by
DPO show a variety of deployment strategies in the early stage;
in the middle stage, the enemy can be surrounded by different
formations to maximize the attack power. Although I-RSPO based
on independent learning shows a specific diversity at the individual
level, it is not easy to generate different policies as a whole.
Diverse policies are more difficult to be exploited by opponents in
competitive scenarios and can better adapt to changes in opponents'
policies. In order to verify the above point, we let the red agents
trained based on different algorithms compete against each other
and count the average winning rate. The results are shown in
Figure 9. As seen from the figure, DPO shows good robustness
against different opponents.
5 CLOSING REMARKS
In this paper, we aim to seek diverse policies in an under-explored
setting, namely RL tasks with structured action spaces with the com-
posability and local dependencies. The complex action structure,
non-uniform reward landscape, and subtle hyperparameter tun-
ing due to the structured actions prevent existing methods from
Figure 8: Comparison of policy diversity between DPO and
RSPO under the early and middle stages of the Battle.
Figure 9: The heatmap of the (Left) win ratio (↑) and (Right)
average steps to win (↓) among DPO and others of the testing
phase of the Battle benchmark.
scaling well. We propose a simple and effective method, Diverse
Policy Optimization (DPO), to model the policies in structured action
space as the energy-based models by following the probabilistic
RL framework. DPO adopts a joint training framework, where the
energy-based model, and the generative flow network, which is
introduced as the efficient, diverse EBM-based policy sampler, are
optimized alternately: The energy function serves as the negative
log-reward function for the GFlowNet, which is trained with the
trajectory balance objective to sample from the evolving energy-
based policies. In contrast, the energy function is trained with soft
Bellman backup, where the GFlowNet provides diverse samples.
Experiments demonstrate that the proposed DPO is both general
and practical across structured action spaces with physical and,
more generally, logical local dependencies.
Algorithms51015202530Kill_NumAlgorithms0.020.010.000.010.020.030.040.050.06Avg_RewardAlgorithms I-RSPOI-DvD I-SQLI-RSPOI-SQL I-DvDI-SQLI-DvDI-RSPOI-SQLI-DvDI-RSPOMFQAlgorithms61.461.661.862.062.262.462.6Kill_NumAlgorithmsDQNMFQMFQAlgorithms0.080.100.120.140.160.180.20Avg_RewardAlgorithmsDPODPODQN MFQ DPODPOI-DQNI-DQNI-RSPODPOEarly StageI-RSPODPOMid StageIDQNMFQI-DvDI-SQLI-RSPODPOIDQNMFQI-DvDI-SQLI-RSPODPO0.520.360.670.590.620.180.610.490.710.660.640.230.330.310.540.360.380.060.360.330.640.480.460.160.380.330.670.530.510.150.850.810.950.880.890.520.10.20.30.40.50.60.70.80.9win rateIDQNMFQI-DvDI-SQLI-RSPODPOIDQNMFQI-DvDI-SQLI-RSPODPO1531921271561251871261381151181181522532392032592463232482331962312373182302592082252413398889717471119100150200250300average steps to winACKNOWLEDGMENTS
This work was supported in part by Postdoctoral Science Foun-
dation of China (2022M723039), NSFC (62106213, 72150002), SSTP
(RCBS20210609104356063, JCYJ20210324120011032), and a grant
from Shenzhen Institute of Artificial Intelligence and Robotics for
Society.
REFERENCES
[1] Alver, S. and Precup, D. (2022). Constructing a good behavior basis for transfer
using generalized policy updates. In ICLR.
[2] Ault, J. and Sharon, G. (2021). Reinforcement learning benchmarks for traffic
signal control. In NeurIPS.
[3] Behrisch, M., Bieker, L., Erdmann, J. and Krajzewicz, D.
simulation of urban mobility: an overview. In SIMUL 2011.
(2011).
Sumo–
[4] Bengio, E., Jain, M., Korablyov, M., Precup, D. and Bengio, Y. (2021). Flow net-
work based generative models for non-iterative diverse candidate generation.
In NeurIPS.
[5] Bengio, Y., Deleu, T., Hu, E. J., Lahlou, S., Tiwari, M. and Bengio, E. (2021).
Gflownet foundations. arXiv preprint arXiv:2111.09266.
[6] Berner, C., Brockman, G., Chan, B., Cheung, V., Dębiak, P., Dennison, C.,
Farhi, D., Fischer, Q., Hashme, S., Hesse, C. et al. (2019). Dota 2 with large scale
deep reinforcement learning. arXiv preprint arXiv:1912.06680.
[7] Bester, C. J., James, S. D. and Konidaris, G. D. (2019). Multi-pass q-networks for
deep reinforcement learning with parameterised action spaces. arXiv preprint
arXiv:1905.04388.
[8] Chandak, Y., Theocharous, G., Kostas, J., Jordan, S. and Thomas, P. (2019).
Learning action representations for reinforcement learning. In ICML.
[9] Chen, C., Wei, H., Xu, N., Zheng, G., Yang, M., Xiong, Y., Xu, K. and Li, Z. (2020).
Toward a thousand lights: Decentralized deep reinforcement learning for large-
scale traffic signal control. In AAAI.
[10] Chen, H., Dai, X., Cai, H., Zhang, W., Wang, X., Tang, R., Zhang, Y. and Yu, Y.
(2019). Large-scale interactive recommendation with tree-structured policy
gradient. In AAAI.
[11] Conti, E., Madhavan, V., Petroski Such, F., Lehman, J., Stanley, K. and Clune, J.
(2018). Improving exploration in evolution strategies for deep reinforcement
learning via a population of novelty-seeking agents. In NeurIPS.
[12] Cully, A., Clune, J., Tarapore, D. and Mouret, J.-B. (2015). Robots that can adapt
like animals. Nature, 521 503–507.
[13] Delalleau, O., Peter, M., Alonso, E. and Logut, A. (2019). Discrete and contin-
uous action representation for practical rl in video games. arXiv preprint
arXiv:1912.11077.
[14] Delarue, A., Anderson, R. and Tjandraatmadja, C. (2020). Reinforcement learn-
ing with combinatorial actions: An application to vehicle routing. In NeurIPS.
[15] Derek, K. and Isola, P. (2021). Adaptable agent populations via a generative
model of policies. In NeurIPS.
[16] Duarte, M., Gomes, J., Oliveira, S. M. and Christensen, A. L. (2017). Evolution
of repertoire-based control for robots with complex locomotor systems. IEEE
Transactions on Evolutionary Computation, 22 314–328.
[17] Dulac-Arnold, G., Evans, R., van Hasselt, H., Sunehag, P., Lillicrap, T., Hunt, J.,
Mann, T., Weber, T., Degris, T. and Coppin, B. (2015). Deep reinforcement learn-
ing in large discrete action spaces. arXiv preprint arXiv:1512.07679.
[18] Eysenbach, B., Gupta, A., Ibarz, J. and Levine, S. (2019). Diversity is all you
need: Learning skills without a reward function. In ICLR.
[19] Fan, Z., Su, R., Zhang, W. and Yu, Y. (2019). Hybrid actor-critic reinforcement
learning in parameterized action space. In IJCAI.
[20] Farquhar, G., Gustafson, L., Lin, Z., Whiteson, S., Usunier, N. and Synnaeve, G.
(2020). Growing action spaces. In ICML.
[21] Fu, H., Tang, H., Hao, J., Lei, Z., Chen, Y. and Fan, C. (2019). Deep multi-agent
reinforcement learning with discrete-continuous hybrid action spaces. In IJCAI.
[22] Fujita, Y., Nagarajan, P., Kataoka, T. and Ishikawa, T. (2021). Chainerrl: A deep
reinforcement learning library. The Journal of Machine Learning Research, 22
3557–3570.
[23] Gangwani, T., Liu, Q. and Peng, J. (2019). Learning self-imitating diverse policies.
In ICLR.
[24] Gangwani, T., Peng, J. and Zhou, Y. (2021). Harnessing distribution ratio esti-
mators for learning agents with quality and diversity. In CoRL.
[25] Goyal, A., Sodhani, S., Binas, J., Peng, X. B., Levine, S. and Bengio, Y. (2020). Re-
inforcement learning with competitive ensembles of information-constrained
primitives. In ICLR.
[26] Gregor, K., Rezende, D. J. and Wierstra, D. (2016). Variational intrinsic control.
arXiv preprint arXiv:1611.07507.
[27] Haarnoja, T., Tang, H., Abbeel, P. and Levine, S. (2017). Reinforcement learning
with deep energy-based policies. In ICML.
[28] Haarnoja, T., Zhou, A., Abbeel, P. and Levine, S. (2018). Soft actor-critic: Off-
policy maximum entropy deep reinforcement learning with a stochastic actor.
In ICML.
[29] Hartikainen, K., Geng, X., Haarnoja, T. and Levine, S. (2020). Dynamical dis-
tance learning for semi-supervised and unsupervised skill discovery. In ICLR.
[30] Hausknecht, M. and Stone, P. (2015). Deep reinforcement learning in parame-
terized action space. arXiv preprint arXiv:1511.04143.
[31] He, J., Chen, J., He, X., Gao, J., Li, L., Deng, L. and Ostendorf, M. (2015). Deep
reinforcement learning with a natural language action space. arXiv preprint
arXiv:1511.04636.
[32] Hong, Z.-W., Shann, T.-Y., Su, S.-Y., Chang, Y.-H., Fu, T.-J. and Lee, C.-Y. (2018).
Diversity-driven exploration strategy for deep reinforcement learning.
In
NeurIPS.
[33] Jain, M., Bengio, E., Hernandez-Garcia, A., Rector-Brooks, J., Dossou, B. F.,
Ekbote, C. A., Fu, J., Zhang, T., Kilgour, M., Zhang, D. et al. (2022). Biological
sequence design with gflownets. In ICML.
[34] Jasra, A., Holmes, C. C. and Stephens, D. A. (2005). Markov chain monte carlo
methods and the label switching problem in bayesian mixture modeling. Statis-
tical Science, 20 50–67.
[35] Katharopoulos, A., Vyas, A., Pappas, N. and Fleuret, F. (2020). Transformers are
rnns: Fast autoregressive transformers with linear attention. In ICML.
[36] Khadka, S., Majumdar, S., Nassar, T., Dwiel, Z., Tumer, E., Miret, S., Liu, Y. and
Tumer, K. (2019). Collaborative evolutionary reinforcement learning. In ICML.
[37] Kipf, T. N. and Welling, M. (2016). Semi-supervised classification with graph
convolutional networks. arXiv preprint arXiv:1609.02907.
[38] Kumar, S., Kumar, A., Levine, S. and Finn, C. (2020). One solution is not all you
need: Few-shot extrapolation via structured maxent rl. In NeurIPS.
[39] Lehman, J. and Stanley, K. O. (2011). Evolving a diversity of virtual creatures
through novelty search and local competition. In GECCO.
[40] Levine, S. (2018). Reinforcement learning and control as probabilistic inference:
Tutorial and review. ArXiv, abs/1805.00909.
[41] Li, J., Monroe, W., Ritter, A., Jurafsky, D., Galley, M. and Gao, J. (2016). Deep
reinforcement learning for dialogue generation. In EMNLP.
[42] Li, W., Wang, X., Jin, B., Luo, D. and Zha, H. (2021). Structured cooperative rein-
forcement learning with time-varying composite action space. IEEE Transactions
on Pattern Analysis and Machine Intelligence.
[43] Li, Y., Song, J. and Ermon, S. (2017). Infogail: Interpretable imitation learning
from visual demonstrations. In NeurIPS.
[44] Lillicrap, T. P., Hunt, J. J., Pritzel, A., Heess, N., Erez, T., Tassa, Y., Silver, D. and
Wierstra, D. (2015). Continuous control with deep reinforcement learning. arXiv
preprint arXiv:1509.02971.
[45] Lim, B., Grillotti, L., Bernasconi, L. and Cully, A. (2022). Dynamics-aware
quality-diversity for efficient learning of skill repertoires. In ICRA.
[46] Liu, S., Lever, G., Merel, J., Tunyasuvunakool, S., Heess, N. and Graepel, T.
(2019). Emergent coordination through competition. In ICLR.
[47] Lobo, S. C., Neumeier, S., Fernandez, E. M. and Facchi, C. (2020). Intas–the in-
golstadt traffic scenario for sumo. arXiv preprint arXiv:2011.11995.
[48] Lupu, A.-S., Hu, H. and Foerster, J. N. (2021). Trajectory diversity for zero-shot
coordination. In AAMAS.
[49] Ma, Q., Ge, S., He, D., Thaker, D. and Drori, I. (2019). Combinatorial optimiza-
tion by graph pointer networks and hierarchical reinforcement learning. arXiv
preprint arXiv:1911.04936.
[50] Ma, T. (2021). Why do local methods solve nonconvex problems? Beyond the
Worst-Case Analysis of Algorithms 465.
[51] Mahajan, A., Samvelyan, M., Mao, L., Makoviychuk, V., Garg, A., Kossaifi, J.,
Whiteson, S., Zhu, Y. and Anandkumar, A. (2021). Reinforcement learning in fac-
tored action spaces using tensor decompositions. arXiv preprint arXiv:2110.14538.
[52] Mahajan, A., Samvelyan, M., Mao, L., Makoviychuk, V., Garg, A., Kossaifi, J.,
Whiteson, S., Zhu, Y. and Anandkumar, A. (2021). Tesseract: Tensorised actors
for multi-agent reinforcement learning. In ICML.
[53] Majumdar, S., Khadka, S., Miret, S., McAleer, S. and Tumer, K. (2020). Evolu-
tionary reinforcement learning for sample-efficient multiagent coordination. In
ICML.
[54] Malkin, N., Jain, M., Bengio, E., Sun, C. and Bengio, Y. (2022). Trajectory bal-
ance: Improved credit assignment in gflownets. arXiv preprint arXiv:2201.13259.
[55] Masood, M. A. and Doshi-Velez, F. (2019). Diversity-inducing policy gradient:
Using maximum mean discrepancy to find a set of diverse policies. arXiv preprint
arXiv:1906.00088.
[56] Masson, W., Ranchod, P. and Konidaris, G. (2016). Reinforcement learning with
parameterized actions. In AAAI.
[57] Merel, J., Hasenclever, L., Galashov, A., Ahuja, A., Pham, V., Wayne, G.,
Teh, Y. W. and Heess, N. (2019). Neural probabilistic motor primitives for
humanoid control. In ICLR.
[58] Metz, L., Ibarz, J., Jaitly, N. and Davidson, J. (2017). Discrete sequential predic-
tion of continuous actions for deep rl. arXiv preprint arXiv:1705.05035.
[59] Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G.,
Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G. et al. (2015). Human-
level control through deep reinforcement learning. nature, 518 529–533.
[60] Mouret, J.-B. and Clune, J. (2015). Illuminating search spaces by mapping elites.
arXiv preprint arXiv:1504.04909.
[61] Nieves, N. P., Yang, Y., Slumbers, O., Mguni, D. H. and Wang, J. (2021). Mod-
elling behavioural diversity for learning in open-ended games. In ICML.
[62] Nilsson, O. and Cully, A. (2021). Policy gradient assisted map-elites. In GECCO.
[63] Osborn, A. F. (1953). Applied imagination. Scribner's.
[64] Papadimitriou, C. H. (1977). The euclidean travelling salesman problem is np-
complete. Theoretical computer science, 4 237–244.
[65] Parker-Holder, J., Pacchiano, A., Choromanski, K. M. and Roberts, S. J. (2020).
Effective diversity in population based reinforcement learning. In NeurIPS.
[66] Peng, Z., Sun, H. and Zhou, B. (2020). Non-local policy optimization via
diversity-regularized collaborative exploration. arXiv preprint arXiv:2006.07781.
[67] Pereira, T., Abbasi, M., Ribeiro, B. and Arrais, J. P. (2021). Diversity oriented
deep reinforcement learning for targeted molecule generation. Journal of Chem-
informatics, 13.
[68] PIERROT, T., Macé, V., Sevestre, J.-B., Monier, L., Laterre, A., Perrin, N.,
Beguir, K. and Sigaud, O. (2021). Factored action spaces in deep reinforcement
learning.
https://openreview.net/forum?id=naSAkn2Xo46
[69] Pompe, E., Holmes, C. and Łatuszyński, K. (2020). A framework for adaptive
mcmc targeting multimodal distributions. The Annals of Statistics, 48 2930–2952.
[70] Pugh, J. K., Soros, L. B. and Stanley, K. O. (2016). Quality diversity: A new fron-
tier for evolutionary computation. Frontiers in Robotics and AI 40.
[71] Schulman, J., Wolski, F., Dhariwal, P., Radford, A. and Klimov, O. (2017). Proxi-
mal policy optimization algorithms. arXiv preprint arXiv:1707.06347.
[72] Sharma, A., Ahn, M., Levine, S., Kumar, V., Hausman, K. and Gu, S. (2020).
Emergent real-world robotic skills via unsupervised off-policy reinforcement
learning. arXiv preprint arXiv:2004.12974.
[73] Sharma, A., Gu, S., Levine, S., Kumar, V. and Hausman, K. (2020). Dynamics-
aware unsupervised discovery of skills. In ICLR.
[74] Sharma, M., Sharma, A., Rhinehart, N. and Kitani, K. M. (2019). Directed-info
gail: Learning hierarchical policies from unsegmented demonstrations using
directed information. In ICLR.
[75] Sun, H., Peng, Z., Dai, B., Guo, J., Lin, D. and Zhou, B. (2020). Novel policy
seeking with constrained optimization. arXiv preprint arXiv:2005.10696.
[76] Sutton, R. S. and Barto, A. G. (2018). Reinforcement learning: An introduction.
MIT press.
[77] Tang, Z., Yu, C., Chen, B., Xu, H., Wang, X., Fang, F., Du, S. S., Wang, Y. and
Wu, Y. (2021). Discovering diverse multi-agent strategic behavior via reward
randomization. In ICLR.
[78] Tavakoli, A., Pardo, F. and Kormushev, P. (2018). Action branching architectures
for deep reinforcement learning. In AAAI.
[79] Tennenholtz, G. and Mannor, S. (2019). The natural language of actions. In
ICML.
[80] Terry, J., Black, B., Grammel, N.,
Jayakumar, M., Hari, A.,
Santos, L. S., Dieffendahl, C., Horsch, C., Perez-Vicente, R. et al.
Pettingzoo: Gym for multi-agent reinforcement learning. In NeurIPS.
Sullivan, R.,
(2021).
[81] Van der Pol, E. and Oliehoek, F. A. (2016). Coordinated deep reinforcement
learners for traffic light control. Proceedings of learning, inference and control of
multi-agent systems (at NIPS 2016), 1.
[82] Varschen, C. and Wagner, P. (2006). Mikroskopische modellierung der person-
enverkehrsnachfrage auf basis von zeitverwendungstagebüchern. Integrierte
Mikro-Simulation von Raum-und Verkehrsentwicklung. Theorie, Konzepte, Modelle,
Praxis, 81 63–69.
[83] Vinyals, O., Babuschkin, I., Czarnecki, W. M., Mathieu, M., Dudzik, A.,
Chung, J., Choi, D. H., Powell, R., Ewalds, T., Georgiev, P. et al. (2019). Grand-
master level in starcraft ii using multi-agent reinforcement learning. Nature,
575 350–354.
[84] Vinyals, O., Fortunato, M. and Jaitly, N. (2015). Pointer networks. In NeurIPS.
[85] Wang, H. and Yu, Y. (2016). Exploring multi-action relationship in reinforcement
learning. In PRICAI.
[86] Wang, R., Lehman, J., Clune, J. and Stanley, K. O. (2019). Poet: open-ended co-
evolution of environments and their optimized solutions. GECCO.
[87] Wang, Z., Merel, J. S., Reed, S. E., de Freitas, N., Wayne, G. and Heess, N. (2017).
Robust imitation of diverse behaviors. In NeurIPS.
[88] Wei, E., Wicke, D. and Luke, S. (2018). Hierarchical approaches for reinforce-
ment learning in parameterized action space. arXiv preprint arXiv:1810.09656.
[89] Wei, H., Chen, C., Zheng, G., Wu, K., Gayah, V., Xu, K. and Li, Z. (2019).
Presslight: Learning max pressure control to coordinate traffic signals in arterial
network. In KDD.
[90] Wei, H., Zheng, G., Yao, H. and Li, Z. (2018). Intellilight: A reinforcement learn-
ing approach for intelligent traffic light control. In KDD.
[91] Xiong, J., Wang, Q., Yang, Z., Sun, P., Han, L., Zheng, Y., Fu, H., Zhang, T.,
Liu, J. and Liu, H. (2018). Parametrized deep q-networks learning: Reinforce-
ment learning with discrete-continuous hybrid action space. arXiv preprint
arXiv:1810.06394.
[92] Xu, K., Hu, W., Leskovec, J. and Jegelka, S. (2019). How powerful are graph
neural networks? In ICLR.
[93] Yang, Y., Luo, R., Li, M., Zhou, M., Zhang, W. and Wang, J. (2018). Mean field
multi-agent reinforcement learning. In ICML.
[94] Yang, Y., Wen, Y., Wang, J., Chen, L., Shao, K., Mguni, D. and Zhang, W. (2020).
Multi-agent determinantal q-learning. In ICML.
[95] Zahavy, T., Barreto, A., Mankowitz, D. J., Hou, S., O'Donoghue, B., Kemaev, I.
and Singh, S. (2021). Discovering a set of policies for the worst case reward.
ArXiv, abs/2102.04323.
[96] Zahavy, T., Haroush, M., Merlis, N., Mankowitz, D. J. and Mannor, S. (2018).
Learn what not to learn: Action elimination with deep reinforcement learning.
In NeurIPS.
[97] Zahavy, T., Hasidim, A., Kaplan, H. and Mansour, Y. (2020). Planning in hierar-
chical reinforcement learning: Guarantees for using local policies. In ALT.
[98] Zahavy, T., Schroecker, Y., Behbahani, F. M. P., Baumli, K., Flennerhag, S.,
Hou, S. and Singh, S. (2022). Discovering policies with domino: Diversity opti-
mization maintaining near optimality. ArXiv, abs/2205.13521.
[99] Zhang, D., Malkin, N., Liu, Z., Volokhova, A., Courville, A. and Bengio, Y.
(2022). Generative flow networks for discrete probabilistic modeling. In ICML.
In
[100] Zhang, Y., Yu, W. and Turk, G. (2019). Learning novel policies for tasks.
ICML.
[101] Zheng, G., Xiong, Y., Zang, X., Feng, J., Wei, H., Zhang, H., Li, Y., Xu, K. and
Li, Z. (2019). Learning phase competition for traffic signal control. In CIKM.
[102] Zheng, L., Yang, J., Cai, H., Zhou, M., Zhang, W., Wang, J. and Yu, Y. (2018). Ma-
gent: A many-agent reinforcement learning platform for artificial collective
intelligence. In AAAI.
[103] Zhou, Z., Fu, W., Zhang, B. and Wu, Y. (2022). Continuously discovering novel
strategies via reward-switching policy optimization. In ICLR.
Supplementary Material for
Diverse Policy Optimization for Structured Action Space
A RELATED WORKS
To the best of our knowledge, existing work on reinforcement learning rarely pursues both the quality as well as the diversity of optimal
policies in sequential decision problems with large-scale, structured action spaces. Therefore, this section will briefly review the work in
reinforcement learning focusing on the diversity of solutions and dealing with sequential decision problems with large-scale or structured
action spaces, respectively.
A.1 Diverse Solutions in RL
Most of the literature on this problem has been done in the field of neuroevolution methods inspired by Quality-Diversity (QD), seeking
to maximize the reward of a policy through approaches strongly motivated by natural biological processes. They typically work by
perturbing a policy and either computing a gradient (as in Evolution Strategies) or selecting the top-performing perturbations (as in Genetic
Algorithms). Neuroevolution methods comprise two leading families of algorithms: MAP-Elites [12, 60] and novelty search with local
competition [39]. These methods typically maintain a collection of policies and adapt it using evolutionary algorithms to balance the QD
trade-off [16, 24, 45, 62, 65, 70].
In another part of the work, intrinsic rewards have been used for learning diversity in terms of the discriminability of different trajectory-
specific quantities [1, 18, 25, 26, 29, 72, 97]. These methods are similar in principle to novelty search without a reward signal but instead focus on
diversity in behaviors defined by the states they visit. Other work implicitly induces diversity to learn policies that maximize the set robustness
to the worst-possible reward [38, 95], or uses diversity as a regularizer when maximizing the extrinsic reward [23, 40, 55, 73, 100]. There is also
a small body of work that transforms the problem of seeking diversity policies into a Constrained Markov Decision Process [15, 75, 98, 103].
In addition to getting policies with diversity in RL, some related work is encouraging policy diversity. In imitation learning, the problem
of imitating diverse behaviors from expert demonstrations has been addressed in previous studies [43, 57, 74, 87]. In these methods, diverse
behaviors are encoded in latent variables. However, these imitation learning methods assume the availability of observations of diverse
behaviors performed by experts. Encouraging agents to diversify their exploration in the early stages of RL has also received significant
attention in recent years [11, 32, 36, 46, 53, 66]. The diversity of policies in multi-agent reinforcement learning (MARL) is also crucial to
improve the agent's robustness and their ability to zero-shot cooperate [48, 61, 77, 94].
A.2 Structured or Large-Scale Actions
A large part of the current work on policy optimization for structured action spaces addresses one particular class of problems, namely,
parametric action space problems, in which the action space has a particular master-slave structure. The difficulty in solving the parameterized
action space lies in the heterogeneity of discrete master actions and continuous slave actions. Current methods either learn a continuous
parameter policy for each discrete action [7, 56, 91]; or discrete actions are output in parallel with continuous actions and employ gradient
post-processing techniques or improved value function networks to solve the master-slave action correspondence problem [19, 30]; or first,
generate discrete actions, then generate continuous parameters based on that action and design sophisticated gradient update schemes for
end-to-end training [6, 13, 88].
In contrast, there are fewer algorithms oriented towards structured action spaces in general, and in the tasks solved by these algorithms,
there are no explicit dependencies between atomic actions. Thus, existing approaches are either based on the assumption of independence of
the decomposed sub-actions [51, 78]; or they are based on the inductive bias to assign a conditional dependency structure to the decomposed
sub-actions and pick up the actions one by one through an autoregressive form based on recurrent neural networks, which are finally spliced
into the original actions [58, 68]. There are also a series of approaches that assume a game relationship between the decomposed sub-actions,
model each sub-action as an agent, and use MARL methods to solve them [21, 42, 52, 83, 93]. However, the field of MARL is still in the
preliminary exploration stage, and numerous theoretical problems remain unsolved. Thus modeling as a multi-agent problem will introduce
more new challenges.
To address the curse of dimensionality caused by (non-structured) large-scale action spaces, existing methods are based on the idea of
reshaping the action space and thus reducing the dimensionality, e.g., some works perform dimensionality reduction by clustering the
actions [8, 17, 31, 79, 85]. However, these approaches require the assumption that actions have dense semantic information, consist of natural
language, and cannot be applied to general high-dimensional tasks. Some works propose solutions for generic large-scale action spaces, such
as dividing the action space by using multiple hierarchical policies similar to a tree structure to reduce the action dimension of each layer of
the policy [10, 14, 96]; or gradually increasing the action space employing curriculum learning so that the policy only needs to be optimized
in a smaller action space in the early stage [20].
B TRAINING DETAILS
B.1 Environments
Adaptive Signal Traffic Control. This benchmark based on 2 well-established Simulation of Urban Mobility traffic simulator (SUMO) [3]
scenarios, namely, "TAPAS Cologne" (8 lights) [82] and "InTAS" (21 lights) [47], which describe traffic within a real-world city, Cologne
and Ingolstadt (Germany) respectively. There are 3 kinds of tasks in the original work [2], namely (a) controlling a single intersection, (b)
controlling multiple intersections along an arterial corridor, and (c) coordinated control of multiple intersections within a congested area.
We select the most complex coordinated control task (c) to demonstrate the advantage of DPO in finding diverse policies. In the coordinated
control task, the atomic action is the selection of the signal light's phase at each intersection, and the physical dependencies are the roads
between the intersections. The road network is shown in Figure 10.
Figure 10: The road networks of coordinated control task [2] for TAPAS Cologne [82] and InTAS [47] respectively.
Battle Scenario. This benchmark is based on the MAgent [102], a research platform for many-agent reinforcement learning. We selected
the competitive task, Battle, as the simulation environment to highlight the advantages of the diverse policies. In Battle, n agents learn to
fight against n enemies who have superior abilities than agents. (Figure 11). As the enemy's hit point is more than a single agent's damage,
agents must continuously cooperate to kill the enemy.
Figure 11: The snapshot of Battle in MAgent platform [102].
In our experiments on the ATSC and Battle benchmarks, all the environment settings, such as the definition of state, the definition of
reward, etc., as well as the evaluation metrics, are kept the same as in Ault and Sharon [2]2 and Terry et al. [80]3 respectively.
B.2 Methods
Random seeds. Except as mentioned in the text, all experiments were run for 5 random seeds each. Graphs show the average (solid line)
and std dev (shaded) performance over random seed throughout training. In the ATSC benchmark, the tables show the empirical mean of the
relevant evaluation metrics.
Hyperparameters. Table 2 shows the tuning range of hyperparameters used for all the experiments of our method and baselines. For all
hyperparameters that need to be tuned, we use the Bayesian hyperparameter search method in the wandb platform4 for parallel tuning.
During the parallel tuning, the platform will create a probabilistic model of a metric score as a function of the hyperparameters, and choose
parameters with high probability of improving the metric. Bayesian hyperparameter search method uses a Gaussian Process to model the
2https://github.com/Pi-Star-Lab/RESCO .
3https://github.com/Farama-Foundation/PettingZoo.
4https://wandb.ai/
relationship between the parameters and the model metric and chooses parameters to optimize the probability of improvement.
Hardware. The hardwares used in the experiment are a server with 128 cores, 128G memory and 4 NVIDIA GeForce RTX 1080Ti graphics
cards with 11G video memory, and a server with 128 cores, 256G memory and 2 NVIDIA GeForce RTX 3090 graphics cards with 24G video
memory.
The Code of Baselines. The code and license of baselines are shown in following list:
• IDQN [102]: https://github.com/geek-ai/MAgent, MIT License;
• MFQ [93]: https://github.com/mlii/mfrl, MIT License;
• Max-Pressure [9]: https://github.com/Pi-Star-Lab/RESCO, No License;
• MPLight [101]: https://github.com/Pi-Star-Lab/RESCO, No License;
• DvD [65]: https://github.com/jparkerholder/DvD_ES, Apache-2.0 license;
• SQL [27]: https://github.com/haarnoja/softqlearning, No License;
• RSPO [103]: https://github.com/footoredo/rspo-iclr-2022, No License.
Table 2: Hyperparameters of all methods used in experiments.
Name
Tuning Range
Name
number of GPN layers
hidden units of GPN
dropout of GPN layers
dropout of GPN attention layer
alpha of GPN
number of heads of GPN attention layer
use residual in GPN
norm layer in GPN
number of GAT layers (soft-Q)
hidden units of GAT (soft-Q)
dropout of GAT layers (soft-Q)
dropout of GAT attention layer (soft-Q)
alpha of GAT (soft-Q)
number of heads of GAT attention layer (soft-Q)
use residual in GAT (soft-Q)
norm layer in GAT (soft-Q)
learning rate of GPN
learning rate of Z
learning rate of GAT
Optimizers
Replay Buffer Size
γ
replay start size
minibatch size
max gradient norm
initial temperature (soft-Q)
temperature learning rate
soft update coefficient
GPN update ratio
number of GPN updates
3
{64, 128, 256}
0.6
0.5
(0, 1)
4
True
{Layernorm, Batchnorm}
3
{64, 128, 256}
0.6
0.5
(0, 1)
4
True
{Layernorm, Batchnorm}
(1e-5, 1e-3)
(1e-3, 1e-1)
(1e-5, 1e-3)
AdamW
1e6
(0.9, 0.99)
32
32
20
1.0
(1e-5, 3e-4)
(2e-3, 5e-1)
(2, 6)
(1, 10)
learning rate (IDQN)
training frequency (IDQN)
batch size (IDQN)
target update (IDQN)
memory size (IDQN)
learning rate (IDQN)
γ (IDQN)
learning rate (MFQ)
exploration decay (MFQ)
γ (MFQ)
batch size (MFQ)
memory size (MFQ)
batch size (MPLight)
γ (MPLight)
exploration decay (MPLight)
target update (MPLight)
demand shape (MPLight)
σ (DvD)
η (DvD)
hidden units (DvD)
ES-sensings (DvD)
K (SQL)
M (SQL)
KV (SQL)
alpha (RSPO)
λint
B
λint
R
Initial learning rate (RSPO)
Batch size (RSPO)
PPO epochs (RSPO)
(RSPO)
(RSPO)
Tuning Range
1e-3
5
256
1200
2e20
1e-4
0.99
1e-4
1.0 → 0.05, 2000
0.95
128
5e5
32
0.99
1.0 → 0.0, 220
500
1
(1e-4, 1e-2)
(1e-4, 1e-2)
{32, 64, 128}
{200, 300, 400}
(32, 100)
(32, 100)
50
(0.1, 1.5)
(0, 10)
(0, 1)
(1e-4, 1e-3)
{512, 1600, 6400}
(1, 10)
(a) DPO.
(b) Baselines.
Learning curves are smoothed by the exponential moving average technique with coefficient 0.6. Source code is available at this anonymous
code repository5, which is based on [49]6 and Zhang et al. [99]7.
5https://anonymous.4open.science/r/DPO.
6https://github.com/qiang-ma/graph-pointer-network.
7https://github.com/GFNOrg/EB_GFN.
C MORE RESULTS
Due to space constraints, we place some experimental results of the additional validation in the appendix section. These results consist of
three main sections: one is a comparison of three algorithms that encourage policy diversity, DvD, SQL, and RSPO, with their respective
independent learning variants; the second is ablation studies of the proposed DPO algorithm; Moreover, the third verify the robustness of
different algorithms in the ATSC benchmark task under out-of-distribution traffic flow. Before giving these additional experimental results,
we post the complete diversity visualization results here, as shown in Figure 12a, 12b, 13a and 13b.
(a) The Ingostadt scenario.
(b) The Cologne scenario.
Figure 12: Comparison of policy diversity among DPO and other baselines under two scenarios in ATSC benchmark. Different
colors represent different commute times.
In addition to visualizing the global diversity of strategies obtained by different algorithms, we also show the proposed DPO's policy
diversity at local intersections. In order to improve the interpretability of the visualization results, we selected the MP method based on
heuristic rules and expert knowledge as a comparison, and the results are shown in Figure 14. It can be seen from the figure that the strategy
output by the MP can better match the traffic flow, thereby reducing the average delay and other indicators. However, the DPO method does
not simply perform local optimization but considers global information. This makes the diversity policies obtained from the DPO achieve a
trade-off for allocating green light time at different times of a single intersection.
C.1 Independent Learning Variants
In the ATSC benchmark task, we find that the performance of the three algorithms DvD, SQL, and RSPO, which encourage policy diversity,
showed a significant degradation in large-scale structured action space. This is why in larger scale Battle scenarios, we directly use these
algorithms' corresponding independent learning variants. In this section, we further compare the DvD, SQL, and RSPO algorithms and their
independent learning variants I-DvD, I-SQL, and I-RSPO in the TAPAS Cologne and InTAS scenarios of the ATSC benchmark, and the results
are shown in Table 3a and 3b.
The table shows that using the independent learning variant in a larger structured action space can lead to a more considerable performance
improvement. However, the DvD algorithm still does not perform as well as expected. Independent learning encourages diversity of atomic
actions, which will also prevent I-SQL and I-RSPO from getting a better diversity of policies in the structured action space. To verify this, we
used the same visualization method as in the experimental part of the main text, and the final results are shown in Figure 15.
As can be seen from the figure, in the small-scale structured action space, the independent learning variant does not bring significant
performance improvement in terms of diversity; However, in the large-scale structured action space, the independent learning variant learns
policies with more significant diversity.
DPORSPOSQLDvDMPLightMPMPMPLightI-DvDI-SQLI-RSPODPO(a) The early stage.
(b) The middle stage.
Figure 13: Comparison of policy diversity among DPO and others under the early and middle stages of the Battle benchmark.
Table 3: Performance (↓) of independent learning variants on two scenarios of the ATSC benchmark.
I-DvD.
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
I-SQL
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
I-RSPO
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
SQL
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Col. Reg. DvD
50.16
108.43
22.50
2.12
Col. Reg.
28.39
93.48
6.74
0.55
Col. Reg. RSPO
23.46
88.81
5.95
0.49
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Col. Reg.
55.91
115.54
28.35
2.28
Col. Reg.
58.32
116.29
30.01
2.06
Col. Reg.
57.28
120.53
28.19
2.59
(a) Performance of independent learning variants (TAPAS Cologne).
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
SQL
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
I-DvD.
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
I-SQL
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
I-RSPO
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
(b) Performance of independent learning variants (InTAS).
Ing. Reg. DvD
74.58
215.07
32.48
1.45
Ing. Reg.
65.29
201.26
22.41
1.01
Ing. Reg. RSPO
86.59
215.25
39.76
1.58
Ing. Reg.
73.22
212.81
31.36
1.42
Ing. Reg.
67.65
205.44
26.45
1.15
Ing. Reg.
90.42
226.5
44.16
1.74
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
C.2 Ablation Study
In this section, we perform some ablation studies on the three critical implementations of the DPO algorithm, including the additional
soft value regression (denoted as S) task introduced to accelerate the training of total flow Z , the additionally expanded termination action
(denoted as T) to accelerate the training, and the action space design (denoted as P) of GFlowNet. For the last point, in the ATSC benchmark,
we analyze the impact of the road network-based GFlowNet's action space design on performance; In the Battle benchmark, we analyze the
impact of different physical topologies resulting from different influence ranges.
IDQNMFQI-DvDI-SQLI-RSPODPOIDQNMFQI-DvDI-SQLI-RSPODPOFigure 14: The arrival rate of traffic in a specific direction at an intersection in a main road and the proportion of green lights
generated by strategies output by different algorithms.
Table 4: Ablation studies of the proposed DPO under two scenarios of the ATSC benchmark.
Soft value regression Termination action
Physical dependencies
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
Ing.Reg
Trip Wait Queue
32.75
214.63
18.67
198.85
29.68
210.49
32.89
218.42
23.45
200.72
32.57
211.46
18.23
194.16
18.26
192.75
1.51
0.71
1.48
1.52
1.39
1.51
0.65
0.65
Delay
78.92
59.79
77.06
78.61
72.4
78.5
59.35
57.2
Epochs
/
∼2.6×
/
/
∼2×
/
∼2.6×
1×
Delay
57.6
23.23
61.53
60.99
30.26
58.76
20.22
20.28
Col.Reg
Trip Wait Queue
31.66
120.85
4.88
85.2
33.75
125.12
33.71
126.4
8.81
91.59
31.8
123.58
4.86
85.49
4.77
81.42
2.43
0.33
2.64
2.61
0.62
2.54
0.33
0.32
Epochs
/
∼3.5×
/
/
∼1.7×
/
∼3.2×
1×
We first analyze the performance of the DPO algorithm on the ATSC benchmark, and the results are shown in Table 4, Figure 16a and 16b.
As seen from the table, the soft value regression task plays a crucial role in the performance of the DPO. This is due to its operational
guidance for training total flow Z , and the accuracy of Z estimation directly determines the diversity of the sampled structured actions.
While the termination action and the road network-based GFlowNet's action space design have little impact, they can significantly improve
the convergence speed of the algorithm. Overall, the results of the ablation study are consistent with our previous conjecture.
The ablation studies on the DPO algorithm in the Battle benchmark task exhibited similar results, as shown in Table 5, Figure 16c and 16d.
In our experiments, instead of picking a different range of influence, an alternative approach is used, i.e., the nearest k agents are chosen for
implementation. As seen in Table 5, while choosing a more significant number of agents to form the physical dependencies provides a slight
performance improvement, it also slows down the convergence of the algorithm because of the resulting larger GFlowNet action space.
C.3 Robustness in ATSC benchmarks
As explained in the §1, diversity of policies can improve the robustness of algorithms in non-stationary environments. Therefore, this section
tests the robustness of different algorithms by perturbing the traffic distribution in the ATSC benchmark and verifies whether the diversity
(a) The Ingostadt scenario.
(b) The Cologne scenario.
Figure 15: Comparison of policy diversity among baselines and their independent learning variants under two scenarios in
ATSC benchmark. Different colors represent different commute times.
(a) The Ingostadt scenario.
(b) The Cologne scenario.
(c) The Battle scenario.
(d) The Battle scenario.
Figure 16: Ablation studies on the ATSC and Battle benchmarks, where S denotes the additional soft value regression task
introduced to accelerate the training of total flow Z , T) denotes the additionally expanded termination action accelerate the
training, and P denotes the action space design of the GFlowNet. N denotes algorithms without above three techaniques.
Table 5: Ablation studies of the proposed DPO under the Battle benchmark.
Soft value regression Termination action Avg. # Kills Avg. # Reward Avg. Epochs
✓
✓
20.1(±3.9)
61.3(±0.4)
20.6(±4.2)
62.1(± 0.1)
0.013(±0.02)
0.135(±0.08)
0.015(±0.02)
0.142(± 0.19)
/
∼3.7×
/
1×
✓
✓
# Nearest agents Avg. # Kills Avg. # Reward Avg. Epochs
3
4
5
6
61.3(±0.4)
62.1(± 0.1)
62.3(± 0.1)
58.6(± 0.1)
0.135(±0.08)
0.142(± 0.19)
0.146(± 0.23)
0.101(± 0.25)
∼1×
1×
∼1.7×
∼3.1×
policies are effective against the non-stationary factors in the environment. Specifically, for the TAPAS Cologne (8 lights, 5 main roads) and
InTAS (21 lights, 8 main roads) scenarios in the ATSC benchmark, we first randomly select 1 or 2 of the respective main roads, increase the
traffic flow by 10%, and train all the algorithms for 50 episodes (about 3% of the standard training sample size).
Since the DvD and MPLight algorithms have poor performance under ATSC and Battle benchmarks, we do not consider these two methods
here. Also, considering the poor scalability of SQL and RSPO under large-scale structured action spaces, we only verify the robustness of the
independent learning variants, i.e., I-SQL and I-RSPO. The average performance is shown in Table 6.
RSPOSQLDvDI-DvDI-SQLI-RSPOI-DvDI-SQLI-RSPODvDSQLRSPO0510152025303540Episodes (x100)5075100125150175200225Delay (s)Ingolstadt Region Ablation StudyNSTPS+TT+PS+PS+T+P0510152025303540Episodes (x100)20406080100120140160Delay (s)Cologne Region Ablation StudyNSTPS+TT+PS+PS+T+P0510152025303540Episodes (x200)4003002001000100200300400Delay (s)Battle Ablation Study (w/o P)NSTS+T0510152025303540Episodes (x200)4003002001000100200300400Delay (s)Battle Ablation Study (for P)3-NN4-NN5-NN6-NNTable 6: The robustness of different algorithms after perturbing the traffic distribution in the ATSC benchmark. we randomly
select 1 or 2 of the respective main roads, increase the traffic flow by 10%, and traine all the algorithms for 50 episodes (about
3% of the standard training sample size).
MP
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
I-RSPO
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Ing. Reg.
Col. Reg.
1 road
70.24
235.77
23.46
0.83
2 roads
85.9
272.82
26.18
0.88
Ing. Reg.
1 road
88.54
246.73
30.63
1.15
2 roads
97.46
261.9
32.23
1.22
1 road
26.83
92.02
5.59
0.39
2 roads
31.4
113.25
6.31
0.43
Col. Reg.
1 road
35.51
126.99
7.08
0.47
2 roads
39.62
132.55
7.48
0.51
I-SQL
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
DPO
Avg. Delay
Avg. Trip Time
Avg. Wait
Avg. Queue
Ing. Reg.
Col. Reg.
1 road
91.36
258.09
32.31
1.26
2 roads
101.04
286.68
35.73
1.39
Ing. Reg.
1 road
60.27
211.82
19.17
0.69
2 roads
72.77
245.41
22.91
0.824
1 road
38.31
134.58
7.36
0.52
2 roads
44.59
143.06
7.87
0.59
Col. Reg.
1 road
21.45
86.6
5.04
0.34
2 roads
25.37
102.87
5.87
0.42
As seen from the table, DPO can quickly achieve good performance using only a small number of samples for fine-tuning. The lack of
policy diversity in the other algorithms makes them have a significant performance gap with DPO.
|
|
http://arxiv.org/abs/2302.13782v1 | 2023-02-23T10:33:40 | 2023-02-23T10:33:40 | Neural networks for learning personality traits from natural language | Personality is considered one of the most influential research topics in
psychology, as it predicts many consequential outcomes such as mental and
physical health and explains human behaviour. With the widespread use of social
networks as a means of communication, it is becoming increasingly important to
develop models that can automatically and accurately read the essence of
individuals based solely on their writing. In particular, the convergence of
social and computer sciences has led researchers to develop automatic
approaches for extracting and studying "hidden" information in textual data on
the internet. The nature of this thesis project is highly experimental, and the
motivation behind this work is to present detailed analyses on the topic, as
currently there are no significant investigations of this kind. The objective
is to identify an adequate semantic space that allows for defining the
personality of the object to which a certain text refers. The starting point is
a dictionary of adjectives that psychological literature defines as markers of
the five major personality traits, or Big Five. In this work, we started with
the implementation of fully-connected neural networks as a basis for
understanding how simple deep learning models can provide information on hidden
personality characteristics. Finally, we use a class of distributional
algorithms invented in 2013 by Tomas Mikolov, which consists of using a
convolutional neural network that learns the contexts of words in an
unsupervised way. In this way, we construct an embedding that contains the
semantic information on the text, obtaining a kind of "geometry of meaning" in
which concepts are translated into linear relationships. With this last
experiment, we hypothesize that an individual writing style is largely coupled
with their personality traits. | [
"Giorgia Adorni"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.13782v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.13782v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.CL",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.CL",
"cs.AI",
"cs.LG"
] | Università degli Studi di Milano-Bicocca
Scuola di Scienze
Dipartimento di Informatica, Sistemistica e Comunicazione
Corso di Laurea in Informatica
3
2
0
2
b
e
F
3
2
]
L
C
.
s
c
[
1
v
2
8
7
3
1
.
2
0
3
2
:
v
i
X
r
a
RETI NEURALI
PER L'APPRENDIMENTO DEI
TRATTI DELLA PERSONALITÀ DAL
LINGUAGGIO NATURALE
Relatore:
Prof. Stella Fabio Antonio
Co-relatore: Dott. Marelli Marco
Relazione della prova finale di:
Giorgia Adorni
Matricola 806787
Anno Accademico 2017-2018
A mio padre, per il suo sostegno quotidiano.
Ad Elia, per tutto il supporto e l'amore dimostrato.
i
Ringraziamenti
Grazie al mio relatore Fabio Stella, per avermi trasmesso la sua passione e per avermi
fornito gli strumenti necessari per intraprendere questo percorso.
Grazie ai ragazzi del Laboratorio MAD (Models and Algorithms for Data & Text Mining),
per tutti i loro consigli.
ii
Abstract
La personalità è considerata come uno degli argomenti di ricerca più influenti in psicologia
poiché predittiva di molti esiti consequenziali come la salute mentale e fisica, ed è in grado
di spiegare il comportamento umano. Grazie alla diffusione dei Social Network come mezzo
di comunicazione, sta diventando sempre più importante sviluppare modelli che possano
leggere automaticamente e con precisione l'essenza di individui basandosi esclusivamente
sulla scrittura.
In particolare, la convergenza tra scienze sociali e informatiche ha portato i ricercatori a
sviluppare approcci automatici per estrarre e studiare le informazioni "nascoste" nei dati
testuali presenti in rete. La natura di questo progetto di tesi è altamente sperimentale, e la
motivazione alla base di questo lavoro è presentare delle analisi dettagliate sull'argomento,
in quanto allo stato attuale non esistono importanti indagini che si basino interamente su
testo in linguaggio naturale.
L'obiettivo è identificare un adeguato spazio semantico che permetta di definire sia la
personalità dell'oggetto a cui un determinato testo si riferisce, sia quella dell'autore. Punto
di partenza è un dizionario di aggettivi che la letteratura psicologica definisce come marker
dei cinque grandi tratti di personalità, i Big Five.
In questo lavoro siamo partiti dall'implementazione di reti neurali fully-connected come
base per capire come modelli semplici di Deep Learning possano fornire informazioni sulle
caratteristiche nascoste della personalità.
Infine, utilizziamo una classe di algoritmi distribuzionali inventati nel 2013 da Tomas
Mikolov, che consistono nell'utilizzo di una rete neurale convoluzionale in grado di im-
parare, in modo non supervisionato, i contesti delle parole. In questo modo costruiamo
un embedding in cui sono contenute le informazioni semantiche del testo, ottenendo una
sorta di "geometria del significato" in cui i concetti sono tradotti in relazioni lineari. Con
quest'ultimo esperimento ipotizziamo che uno stile di scrittura individuale sia in gran parte
accoppiato con i tratti della sua personalità.
iii
Indice
Ringraziamenti
Abstract
Introduzione
Motivazione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contributi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Contesto
1.1 Big Five . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Reti Neurali
2.1 Modello . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.1 Funzioni di attivazione . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Architetture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1 Layer fully-connected . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.2 Layer convoluzionali
. . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.3 Layer di pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.4 Batch Normalization . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii
iii
viii
ix
ix
1
1
5
5
6
7
7
8
9
9
2.3 Apprendimento . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.1 Funzione di costo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.2 Algoritmi di ottimizzazione . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.3 Paradigmi di apprendimento . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Train, Validation e Test Sets
. . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.1 Evaluation metric
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4.2 Overfitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
iv
3 Formulazione
17
3.1 Definizione del problema
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Descrizione del dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Calcolo della Ground Truth . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4.1 Natural Language Processing . . . . . . . . . . . . . . . . . . . . . . 18
4 Esperimenti e risultati
21
4.1 Spazi di rappresentazione . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 Esperimento 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2.1
Input Features
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2.3 Performance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 Esperimento 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.1
Input Features
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.3.3 Performance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4 Esperimento 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4.1
Input Features
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.4.3 Performance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.5 Esperimento 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.5.1
Input Features
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.5.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.5.3 Performance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5 Conclusioni
Riferimenti bibliografici
37
42
v
Elenco delle figure
2.1 Artificial Neuron Model
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Andamento di due funzioni di attivazione . . . . . . . . . . . . . . . . . . .
6
7
2.3 Visualizzazione di una matrice di confusione . . . . . . . . . . . . . . . . . . 16
3.1
Istogramma rappresentativo delle 30 parole più frequenti nel dizionario . . . 19
3.2 Visualizzazione del preprocessing . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1 Visualizzazione del modello bag-of-words . . . . . . . . . . . . . . . . . . . . 22
4.2 Visualizzazione delle training loss dei tre modelli
. . . . . . . . . . . . . . . 24
4.3 Visualizzazione del modello skip-gram . . . . . . . . . . . . . . . . . . . . . 26
4.4 Proiezione dell'embedding di Mikolov nello spazio 2-3 dimensionale, tramite
la tecnica di riduzione della dimensionalità (t-SNE) [38]
. . . . . . . . . . . 26
4.5 Esempio di architettura convoluzionale per la manipolazione del linguaggio
naturale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.6 Visualizzazione delle training RMSE dei modelli
. . . . . . . . . . . . . . . 30
4.7 Analisi della caratteristica Openness del "Modello 13" . . . . . . . . . . . . 35
4.8 Analisi della caratteristica Conscientiousness del "Modello 13"
. . . . . . . 35
4.9 Analisi della caratteristica Extraversion del "Modello 13" . . . . . . . . . . 35
4.10 Analisi della caratteristica Agreeableness del "Modello 13" . . . . . . . . . . 36
4.11 Analisi della caratteristica Neuroticism del "Modello 13" . . . . . . . . . . . 36
vi
Elenco delle tabelle
3.1 Esempio di dizionario OCEAN . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1 Confronto delle architetture di tre differenti modelli
. . . . . . . . . . . . . 23
4.2 Confronto dei risultati in termini di loss ottenuti dalle tre diverse reti
. . . 23
4.3 Confronto dei risultati in termini di Root Mean Squared Error delle archi-
tetture contro il modello basato sulla media di training . . . . . . . . . . . . 24
4.4 Confronto dei parametri della rete impostati per la realizzazione dell'embedding 27
4.5 Architetture implementate a partire dall'embedding 1 . . . . . . . . . . . . 28
4.6 Architetture implementate a partire dall'embedding 2 . . . . . . . . . . . . 28
4.7 Learning rate delle simulazioni effettuate nell'esperimento 2 . . . . . . . . . 29
4.8 Confronto dei risultati in termini di loss ottenuti nelle diverse reti con i due
diversi embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.9 Confronto dei risultati in termini di Root Mean Squared Error delle archi-
tetture sul test set
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.10 Architetture dei due modelli implementati a partire dall'embedding 3 . . . . 31
4.11 Confronto dei risultati in termini di loss ottenuti nell'implementazione dei
due modelli
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.12 Confronto dei risultati in termini di RMSE delle due architetture sul test set 32
4.13 Architetture implementate a partire dall'embedding 2 . . . . . . . . . . . . 33
4.14 Architetture implementate a partire dall'embedding 3 . . . . . . . . . . . . 33
4.15 Learning rate delle simulazioni effettuate nell'esperimento 2 . . . . . . . . . 33
4.16 Confronto delle loss ottenute nelle diverse reti con i due diversi embedding . 34
4.17 Confronto delle accuracy sul test set delle diverse architetture . . . . . . . . 34
vii
Introduzione
La personalità è un fattore chiave che influenza le interazioni, i comportamenti e le emozioni
delle persone. Al giorno d'oggi, essa viene considera come uno degli argomenti di ricerca
più influenti in psicologia.
La crescente immersione negli ambienti digitali e la diffusione dei social network come
mezzo di comunicazione, ha contribuito alla creazione di un enorme quantità di dati, anche
chiamati Big Data, aprendo la necessità allo sviluppo di modelli automatici in grado di
leggere con precisione l'essenza degli individui basandosi esclusivamente sulla scrittura.
L'esigenza di produrre analisi sempre più velocemente ha imposto lo sviluppo di
metodi meccanici per selezionare e interpretare i dati, favorendo la ricerca nel campo
dell'apprendimento automatico o Machine Learning [1].
Nello specifico, il Data Mining è un approccio che consiste nell'individuazione d'informa-
zioni significative tramite l'applicazione di algoritmi in grado di determinare le associazioni
"nascoste" tra di esse [2, 3].
Una sua forma particolare è il Text Mining, nell'ambito del quale si sono sviluppate
metodologie che consentono ai computer di confrontarsi con il linguaggio umano, di
elaborarlo e comprenderlo [4].
L'interesse nello studio delle informazioni digitali e le abilità necessarie per farlo non
sempre coincidono tra gli scienziati sociali. Di conseguenza, tale ricerca viene general-
mente affidata a scienziati e ingegneri informatici, facilitando la scoperta di modelli che
non sarebbe possibile individuare ed offrendo l'opportunità di instaurare collaborazioni
interdisciplinari.
La maggior parte degli attuali studi automatici di rilevamento della personalità si sono
concentrati sulla teoria dei Big Five come quadro per studiare le caratteristiche intrinseche
dell'essere umano [5]. Secondo questo modello esistono cinque dimensioni fondamentali
dei tratti, stabili nel tempo e condivisi a livello interculturale. Le cinque caratteristiche,
viii
note appunto come i "Grandi Cinque", sono Openness (apertura all'esperienza), Con-
scientiousness (coscienziosità), Extraversion (estroversione), Agreeableness (gradevolezza),
Neuroticism (nevroticismo), riconosciuti dall'acronimo OCEAN.
Sviluppare un modello accurato e aprire questa domanda di ricerca avrebbe implicazioni
significative in diversi ambiti della sociologia, ma non solo.
Struttura della tesi
Di seguito si passano in rassegna gli argomenti affrontati capitolo per capitolo.
Nel capitolo Contesto vengono introdotti i concetti teorici alla base del lavoro, in partico-
lare viene introdotta la teoria dei Big Five.
Nel capitolo Reti Neurali si descrivono le principali tecniche di Deep Learning, in parti-
colare soffermandosi sulle architetture adottate negli esperimenti.
Nel capitolo Formulazione viene definito il problema ed illustrati approcci e strumenti
risolutivi.
Nel capitolo Esperimenti e risultati viene presentata una panoramica degli esperimenti
effettuati e una relativa analisi dei risultati.
Nel capitolo Conclusioni vengono esposte le considerazioni finali.
Motivazioni
La natura di questo progetto di tesi è altamente sperimentale. Le motivazioni che hanno
portato alla realizzazione di questo lavoro sono la presentazione di analisi dettagliate
sull'argomento, in quanto allo stato attuale non esistono importanti indagini di questo tipo.
Contributi
I dati che verranno utilizzati per definire lo spazio semantico e testare la sua funzionalità
sono messi a disposizione da Yelp Dataset Challenge, che contiene 5 200 000 recensioni
relative a 174 000 attività commerciali di 11 aree metropolitane nel mondo.
ix
Capitolo 1
Contesto
Con il termine personalità si intende l'insieme delle caratteristiche psichiche e dei compor-
tamentali abituali - inclinazioni, interessi e passioni - che definiscono e differenziano
ogni individuo, nei vari contesti ed ambienti in cui la condotta umana si sviluppa [6, 7].
La tradizione di studi psicologici relativi alla personalità è una delle più rilevanti
della psicologia contemporanea, un campo in cui si susseguono studi empirici, teorici
e storici, volti a comprendere la natura dell'identità personale nel contesto biologico e
sociale di sviluppo. Essa tenta di spiegare le tendenze che sono alla base delle differenze
comportamentali, ed ogni gruppo di pensiero tenta di concettualizzare la personalità entro
modelli diversi - adoperando metodi, approcci, obiettivi e modalità d'analisi - anche
molto dissonanti fra loro.
Una significativa parte della psicologia che studia le differenze individuali, analizza e
valuta la personalità attraverso specifici test volti ad individuarne i tratti.
1.1 Big Five
Le teorie della personalità basate sui tratti definiscono la personalità come l'insieme delle
caratteristiche che stabiliscono il comportamento di una persona.
La teoria dei Grandi Cinque (o Big Five) risulta essere uno dei modelli più condivisi
e testati, sia a livello teorico che empirico. McCrae e Costa identificano cinque grandi
dimensioni in cui può essere suddivisa la personalità [8, 9]:
• L'apertura all'esperienza o "openness" (creativo/curioso vs. coerente/cauto) è intesa
come attitudine alla ricerca di stimoli culturali e di pensiero esterni al proprio
contesto ordinario. Essa riflette il grado di curiosità intellettuale, la creatività o
una preferenza per la novità; può inoltre essere percepita come imprevedibilità o
1
1 – Contesto
mancanza di concentrazione.
Individui con un'elevata apertura perseguono l'auto-realizzazione, cercando esperienze
intense ed euforiche. Viceversa, coloro che hanno una bassa apertura cercano di
ottenere soddisfazione attraverso la perseveranza.
• La coscienziosità o "conscientiousness" (organizzato vs. negligente) è una tendenza
caratterizzata dall'organizzazione, precisione e affidabilità. Un soggetto contraddi-
stinto da questa attitudine, preferisce un comportamento pianificato piuttosto che
spontaneo.
Spesso l'alta coscienziosità viene percepita come testardaggine e ossessione, mentre
la bassa coscienziosità è associata alla flessibilità e alla spontaneità, ma può anche
apparire come mancanza di affidabilità.
• L'estroversione o "extraversion" (estroverso/energetico vs. solitario/riservato) è intesa
come grado di entusiasmo negli atteggiamenti che si adottano e tendenza a cercare la
stimolazione in compagnia degli altri.
L'alta estroversione è spesso percepita come una ricerca di attenzioni e prepotenza. La
bassa estroversione causa una personalità riservata, riflessiva, che può essere avvertita
come distaccata.
• La gradevolezza o "agreeableness" (amichevole/compassionevole vs. provocatorio/-
distaccato) è indicata come quantità e qualità delle relazioni interpersonali che la
persona intraprende, orientate al prendersi cura dell'altro. È una tendenza ad essere
compassionevoli e collaborativi piuttosto che sospettosi e antagonisti.
L'alta gradevolezza è spesso vista come ingenuità o sottomissione. Le persone con
scarsa gradevolezza sono spesso competitive o sfidanti, e possono essere intese come
inaffidabili.
• Il nevroticismo o "neuroticism" (sensibile/nervoso vs. sicuro/fiducioso), è una misura
di resistenza a stress di tipo psicologico, come l'ansietà e l'irritabilità, ma si riferisce
anche al grado di solidità emotiva e di controllo degli impulsi.
Un'alta stabilità si manifesta in una personalità calma che però può essere vista come
poco interessante e indifferente. Una bassa stabilità esprime reattività e dinamicità
in individui che spesso possono essere percepiti come instabili o insicuri.
Queste dimensioni sono state individuate a partire da studi psico-lessicali, secondo cui le
cinque dimensioni corrisponderebbero alle macro-categorie più usate nel linguaggio per
descrivere le diversità fra individui.
2
1.1 – Big Five
Le regioni cerebrali che codificano i vari tratti di personalità sono spesso collegate alle
regioni responsabili della comunicazione verbale e scritta.
Un grande numero di prove di ricerca hanno supportato il modello a cinque fattori,
che sembra essere condiviso a livello interculturale - Cina, Giappone, Italia, Ungheria,
Turchia [10].
Le dimensioni di Big Five predicono accuratamente il comportamento e vengono
utilizzate sempre più spesso per aiutare i ricercatori a comprendere l'estensione dei disturbi
psicologici come ansia e depressione [11].
Uno dei vantaggi principali di questo approccio è che consente di concentrare l'attenzione
solo sulle dimensioni di base piuttosto che studiare centinaia di tratti.
3
4
Capitolo 2
Reti Neurali
Nel campo dell'apprendimento automatico, o machine learning, una rete neurale artifi-
ciale in inglese Artificial Neural Network (ANN), è un modello matematico basato sulla
semplificazione delle reti neurali biologiche [1].
Una rete neurale può essere considerata come un sistema dinamico avente la topologia
di un grafo orientato, i cui nodi modellano i neuroni in un cervello biologico, mentre gli
archi rappresentano le sinapsi (interconnessioni di informazioni).
Ogni connessione può trasmettere un segnale da un neurone artificiale a un altro, i
quali sono tipicamente aggregati in strati. Gli stimoli vengono ricevuti da un livello di nodi
d'ingresso, detto unità di elaborazione, che elabora il segnale e lo trasmette ad altri neuroni
ad esso collegati.
2.1 Modello
Le reti neurali possono essere viste come semplici modelli matematici che definiscono una
funzione f : X → Y .
La funzione di rete di un neurone f (x) è definita come una composizione di altre
funzioni gi(x), che possono a loro volta essere scomposte in altre funzioni.
Una rappresentazione ampiamente utilizzata per la descrizione di ANN tradizionali è
la somma ponderata, mostrata nell'equazione 2.1.
f (x) = K
(cid:19)
wixi + b
(cid:18) X
i
(2.1)
Ogni segnale in ingresso xi viene moltiplicato ad un corrispondente peso wi, che assume
valore positivo o negativo a seconda che si voglia eccitare o inibire il neurone. Il bias b varia
secondo la propensione del neurone ad attivarsi, influenzandone l'uscita. Inoltre, viene
5
2 – Reti Neurali
applicata una funzione predefinita K, detta anche funzione di attivazione, illustrata nella
seguente sezione.
Figura 2.1: Artificial Neuron Model
2.1.1 Funzioni di attivazione
Una funzione di attivazione è una componente fondamentale del modello. Essa consente
alla rete di imparare trasformazioni non lineari, in modo da essere in grado di calcolare
problemi non banali utilizzando un limitato numero di nodi.
Una delle funzioni più utilizzate è la sigmoide σ(x), la quale modella la frequenza degli
stimoli emessi, da neurone inattivo, σ(x) = 0, a neurone completamente saturo con una
frequenza di attivazione massima, σ(x) = 1.
σ(x) =
1
1 + e−x
(2.2)
Negli ultimi anni è diventata molto popolare la Rectified Linear Unit (ReLU) [12, 13,
14, 15], definita dalla seguente equazione:
f (x) = max(0, x) =
x se x > 0
0
altrimenti
(2.3)
Questa funzione azzera tutti i valori negativi, mentre ritorna invariati quelli positivi.
Essa viene utilizzata per la sua capacità di accelerare notevolmente il processo di
ottimizzazione, inoltre la sua implementazione risulta semplice ed efficiente.
6
2.2 – Architetture
(a) Sigmoide
(b) ReLU
Figura 2.2: Andamento di due funzioni di attivazione
2.2 Architetture
I neuroni vengono organizzati in una struttura detta architettura della rete. I dati, partendo
da un livello iniziale, chiamato layer di input, attraversano i multipli strati interni della
rete, gli hidden layer, raggiungendo l'ultimo livello detto layer di output.
Quando i collegamenti tra i neuroni formano una struttura senza cicli si parla di reti
feed-forward [16].
2.2.1 Layer fully-connected
Un'architettura molto comune nelle reti neurali è una struttura "densa", che utilizza layer
fully-connected, in cui tutti i neuroni del livello precedente sono collegati ad ogni neurone
dello strato successivo [17].
Lo scopo di un layer completamente connesso è imparare combinazioni non lineari di
feature ad alto livello provenienti dal layer precedente. Una struttura di questo tipo è
però caratterizzata da un numero di connessioni che cresce molto velocemente, causando
un accrescimento del numero di parametri che la rete deve apprendere. Questo comporta
un aumento del costo computazionale e un alto rischio di overfitting, approfondito nella
Sezione 2.4.2.
Per questo motivo questi vengono spesso sostituiti dai layer convoluzionali.
7
10.07.55.02.50.02.55.07.510.00.00.20.40.60.81.010.07.55.02.50.02.55.07.510.002468102 – Reti Neurali
2.2.2 Layer convoluzionali
Una rete neurale convoluzionale, in inglese Convolutional Neural Network (CNN), è una
classe di reti artificiali avanzate e feed-forward, composte da uno o più strati convoluzionali
seguiti da una serie di livelli completamente connessi [18].
Una convoluzione può essere considerata come una funzione a finestra scorrevole, detta
kernel o filtro, applicata a una matrice. Ogni livello applica filtri diversi, in genere centinaia
o migliaia, e combina i loro risultati. Durante la fase di addestramento, una CNN impara
automaticamente i valori dei suoi filtri in base all'attività che si desidera eseguire.
Due parametri che definiscono il comportamento di un layer convoluzionale sono lo
stride, che rappresenta il passo di convoluzione e viene utilizzato per ridurre le dimensioni
spaziali dell'output e il padding, che definisce il comportamento dei neuroni lungo i bordi
dei dati di input. Se viene scelto un padding valid, l'output contiene solo i neuroni la cui
regione di convoluzione è completamente contenuta nei dati; nel caso di padding same,
invece, l'output mantiene la stessa dimensione dell'input, utilizzando zero come valore per
i dati mancanti.
Le reti convoluzionali sono adatte per elaborare dati visivi e altri dati bidimensionali,
ed hanno mostrato ottimi risultati nel riconoscimento di immagini e nella manipolazione
del linguaggio naturale [19]. In quest'ultimo caso, l'input è costituito da frasi o documenti
rappresentati come una matrice, in cui ogni riga corrisponde a un token, in genere una
parola. Tipicamente, questi vettori sono dei word embeddings (rappresentazioni a bassa
dimensione) come word2vec [20], ma potrebbero anche essere vettori unici che indicizzano
la parola in un vocabolario.
Nel Natural Language Processing (NLP) utilizziamo filtri che scorrono su righe complete
della matrice (parole), pertanto, la loro "larghezza" è solitamente uguale alla quella della
matrice di input. L'altezza, o la dimensione della regione, può variare, ma le finestre
tipicamente scorrono su 2-5 parole per volta.
Risulta che le CNN applicate ai problemi di NLP funzionino abbastanza bene, un
esempio è il modello bag-of-words che è stato l'approccio standard per anni e ha portato a
risultati piuttosto buoni [21].
Le CNN sono più facili da addestrare e hanno molti meno parametri da stimare. Il
minor numero di connessioni e pesi di questa architettura, rende gli strati convoluzionali
relativamente economici in termini di memoria e potenza di calcolo necessari.
8
2.2 – Architetture
2.2.3 Layer di pooling
Il pooling è un processo alquanto comune nelle reti neurali, la cui funzione è ridurre progres-
sivamente la dimensionalità spaziale per diminuire la quantità di parametri e la complessità
computazionale della rete, mantenendo le informazioni più salienti e controllando anche
l'overfitting.
Il layer di pooling opera indipendentemente su ogni slice di profondità dell'input e lo
ridimensiona spazialmente, usando l'operazione MAX sul risultato di ogni filtro [22].
Una proprietà del pool è che fornisce una matrice di output a dimensione fissa - in
genere richiesta per la classificazione. Ciò consente di utilizzare frasi di dimensioni variabili
e filtri di dimensioni variabili, ma ottenere sempre le stesse dimensioni di output da inserire
in un classificatore.
2.2.4 Batch Normalization
Durante la fase di addestramento del modello, i parametri di ogni substrato vengono
ottimizzati al fine di minimizzare l'errore finale. Ad ogni iterazione, in ciascuno strato
avviene una variazione dell'output, corrispondente ad una variazione nei valori in ingresso
al livello successivo. Questo può rappresentare un problema per la rete, che deve adattare i
propri strati ad un continuo cambiamento nell'input.
Per aumentare la stabilità della rete neurale, velocizzare il training e migliorarne le
performance, generalmente viene applicata ad ogni strato una Batch Normalization [23], la
quale normalizza l'uscita di un precedente livello sottraendo il valore medio di un batch e
dividendo il risultato per la sua deviazione standard.
ˆx(k) =
x(k) − E[x(k)]
q
Var[x(k)]
(2.4)
L'applicazione di questa operazione ad ogni input potrebbe cambiare ciò che il layer può
rappresentare. Per questo motivo viene assicurato che la trasformazione inserita nella rete
possa rappresentare l'identità, in modo da poter annullare il potenziale effetto della Batch
Normalization, nel caso in cui fosse l'azione ottimale. Dunque viene prevista l'aggiunta di
due parametri - "deviazione standard" γ e "media" β - che la rete impara assieme ai
parametri del modello originale, come mostrato nell'equazione 2.5
y(k) = γ(k) ˆx(k) + β(k).
(2.5)
9
2 – Reti Neurali
La Batch Normalization può essere utilizzata sia su reti feed-forward, sia sulle reti
convoluzionali. In questo secondo caso, media e varianza vengono calcolate per ogni filtro.
2.3 Apprendimento
Per insegnare alla rete a risolvere un determinato problema, occorre una fase di addestra-
mento in cui vengono condotte una serie di osservazioni per stabilire quali valori assegnare
ad ogni parametro della rete e trovare un modello ottimale.
Questo processo di apprendimento viene strutturato come un problema di ottimizzazione
in cui lo scopo è minimizzare una funzione di costo, che misura la distanza tra una soluzione
particolare ed una ottima.
2.3.1 Funzione di costo
Una funzione di costo mappa un evento ad un numero reale, il quale ne rappresenta
intuitivamente il "costo".
Nella strategia adottata si utilizzeranno due diverse funzioni obiettivo: l'errore quadratico
medio per risolvere il problema di regressione, e la Softmax Cross Entropy per il compito
di classificazione. Mentre per la costruzione dell'embedding verrà applicata la Noise
Contrastive estimation.
Mean Squared Error
Per il task il cui compito è prevedere dei valori reali è comune calcolare lo scostamento tra
la quantità prevista dalla rete ( ˆY ) e i valori osservati Y (ground truth).
L'errore quadratico medio (MSE) di uno stimatore misura la media dei quadrati degli
errori, e viene calcolato come
MSE =
1
n
n
X
i=1
(Yi − ˆYi)2.
(2.6)
con n numero delle previsioni [24].
Softmax Cross Entropy
Softmax è una funzione di loss comunemente utilizzata per la classificazione. In particolare
viene applicata allo strato finale della rete ed addestrata in un regime di entropia incrociata
[25].
10
2.3 – Apprendimento
L'entropia incrociata è un indicatore che può essere utilizzato per misurare l'accuratezza
delle previsioni.
Date due variabili casuali discrete p e q definiamo l'entropia nel modo seguente:
H(p, q) = − X
x
p(x) log q(x)
(2.7)
in cui px è la "vera" probabilità o distribuzione, mentre qx è la distribuzione "innaturale"
ottenuta a partire dal modello corrente.
Nella pratica la Cross Entropy viene calcolata empiricamente ipotizzando l'equiproba-
bilità degli eventi, poiché p è ignota. Di conseguenza, è ridefinibile come segue
H(q) = −
1
N
X
x
log q(x)
(2.8)
dove N è il numero di eventi osservati.
L'obiettivo principale di questa funzione è rendere il risultato della Softmax campionata
uguale a quella vera. L'algoritmo si concentra sulla selezione di campioni specifici dalla
distribuzione data per ottenere la loss desiderata [26]. L'utilizzo della funzione Softmax ha
un effetto considerevole sulle prestazioni.
Noise Contrastive estimation
La stima contrastiva del rumore è una strategia utilizzata nell'ambito della modellazione
linguistica o per la generazione di word embedding dati in input dei corpus molto ampi.
La funzione obiettivo del modello skip-gram cerca di trovare rappresentazioni di parole
che siano utili per predire le parole circostanti, meglio chiamati contesti, in una frase o
in un documento. Data una sequenza di parole di addestramento, la funzione obiettivo
massimizza la probabilità media di log
1
T
T
X
X
t=1
−c≤j≤c,j /=0
log p(wt+j|wT )
(2.9)
dove c è la dimensione del contesto di training [20].
Nell'implementazione del modello word2vec, la formulazione standard dello skip-gram
definisce la precedente probabilità di log ricorrendo alla funzione Softmax:
pθ(wO|wI ) =
>vwI )
wO
exp(v0
w=1 exp(v0
w
PW
>vwI )
11
(2.10)
2 – Reti Neurali
dove vw e v0
w sono le rappresentazione vettoriali di input e output e W è il numero
delle parole del vocabolario [27].
In questo modo la previsione di una data parola a partire da un contesto risulta essere
un compito computazionalmente intenso, poiché vi sono operazione che coinvolgono l'intero
dizionario.
Di conseguenza, un alternativa alla funzione Softmax è l'applicazione della Noise
Contrastive estimation con campionamento negativo [28, 29]. Essa consente un allenamento
più veloce e rappresentazioni vettoriali migliori per le parole frequenti.
2.3.2 Algoritmi di ottimizzazione
Gli algoritmi di ottimizzazione sono necessari per minimizzare il risultato di una determinata
funzione obiettivo, la quale dipende dai parametri che il modello deve imparare durante
l'addestramento.
Vengono utilizzate varie strategie e algoritmi di ottimizzazione per aggiornare e calcolare
i valori appropriati e ottimali di tale modello, i quali influenzano fortemente l'efficacia del
processo di apprendimento.
L'entità dell'aggiornamento è determinata dal tasso di apprendimento η, in inglese
learning rate, che garantisce la convergenza al minimo globale, per superfici di errore
convesse, e ad un minimo locale, per superfici non convesse.
Stochastic Gradient Descent
La discesa del gradiente, in inglese Gradient Descent (GD), è un algoritmo iterativo per
l'ottimizzazione di funzioni [30].
Viene utilizzato principalmente per eseguire gli aggiornamenti dei pesi in un modello di
rete neurale nel seguente modo
θ = θ − η∇J(θ)
(2.11)
dove η rappresenta il tasso di apprendimento, ∇J(θ) è il gradiente della funzione di loss
J(θ) rispetto al parametro θ.
La tradizionale discesa gradiente, o Batch Gradient Descent (GD), calcola il gradiente
dell'intero set di dati, eseguendo un solo aggiornamento. Di conseguenza il processo di
addestramento può risultare lento e difficile da controllare per i set di dati che sono molto
grandi.
I problemi che si verificano con questo algoritmo vengono risolti applicando una sua
variante: la discesa stocastica del gradiente, in inglese Stochastic Gradient Descent (SGD).
Questa tecnica esegue un aggiornamento alla volta dei parametri per ognuno degli esempi
12
2.3 – Apprendimento
di training
θ = θ − η∇J(θ; x(i); y(i))
(2.12)
dove x(i) e y(i) sono le coppie di esempi usati per l'addestramento.
Questa tecnica risulta essere molto più veloce di quella classica. A causa dei frequenti
aggiornamenti, i parametri presentano un'alta varianza, inoltre la funzione loss oscilla tra
diverse intensità. Questo favorisce la scoperta di nuovi minimi locali, complicando però la
convergenza all'ottimo globale.
Adagrad
Adagrad è un metodo di apprendimento adattativo che aggiusta il learning rate sulla base
dei parametri [31] . In questo algoritmo, la dimensione degli aggiornamenti è grande per
parametri associati a caratteristiche poco ricorrenti e piccola per quelli più frequenti. Per
questo motivo viene considerato adatto alla gestione di dati sparsi.
Adagrad modifica il tasso di apprendimento generale η ad ogni istante di tempo t per
ogni parametro θ(i), sulla base dei gradienti che sono stati calcolati per θ(i).
Il vantaggio principale di questo metodo è che non è necessario regolare manualmente
la frequenza di apprendimento e nella maggior parte delle implementazioni viene usato un
valore predefinito - per esempio 0,001 - e lasciato invariato.
La principale debolezza consiste nell'accumulo dei "gradienti quadrati" nel denominatore,
finché ogni termine aggiunto è positivo [30]. Di conseguenza il tasso di apprendimento si
riduce fino al punto in cui l'algoritmo non è più in grado di acquisire ulteriori conoscenze.
2.3.3 Paradigmi di apprendimento
Gli algoritmi di apprendimento sono principalmente suddivisi in due categorie:
supervisionato - alla rete viene presentato un training set preparato da un "insegnante
esterno", composto da coppie significative di valori (input, output atteso).
Quando alla rete neurale viene fornito l'input dall'ambiente, l'insegnante calco-
la l'output desiderato corrispondente, addestrando la rete mediante un algoritmo
(tipicamente quello di back propagation [32]).
La rete impara a riconoscere la relazione incognita che lega le variabili di ingresso
e uscita, in modo da prevedere il valore di output per qualsiasi valore di ingresso,
basandosi solo su una casistica di corrispondenze (coppie input-output).
13
2 – Reti Neurali
non supervisionato - alla rete vengono presentati solo i valori di input, mentre non
sono messe a disposizione le informazioni di ritorno dell'ambiente sui valori obiettivo
che si vogliono ottenere in risposta o riguardo la correttezza dell'output fornito.
La rete è in grado di individuare da sola pattern, caratteristiche, similarità e re-
golarità statistiche nei dati di input, acquisendo la capacità di dividerli in cluster
rappresentativi che sviluppino delle rappresentazioni interne, senza usare confronti
con output noti.
In questo caso, gli algoritmi che modificano i pesi della rete fanno riferimento solo ai
dati contenuti nelle variabili di ingresso.
Questo è un tipo di apprendimento autonomo senza controllo esterno sull'errore. È
un approccio adatto per ottimizzare le risorse nel caso in cui non si conoscano a
priori i gruppi in cui dividere l'input.
2.4 Train, Validation e Test Sets
Per misurare le prestazioni di una rete neurale dopo la fase di apprendimento, viene creato
un test set formato da coppie non utilizzate per il training e validation set.
Vengono generalmente definiti:
• Training set - sul quale viene eseguito l'algoritmo di apprendimento.
• Validation set - viene utilizzato per regolare i parametri, selezionare le features e
prendere decisioni per quanto riguarda l'algoritmo di apprendimento.
• Test set - si utilizza per valutare le performance dell'algoritmo, ma non per prendere
decisioni su quale algoritmo di apprendimento o parametri utilizzare.
Una volta definiti i set, ci si concentrerà sul miglioramento delle prestazioni del training
e validation set.
Generalmente la dimensione del test set è un terzo di quella del training. Esso è
composto da input critici su cui la risposta della rete deve essere buona. Questo funziona
bene quando sono messi a disposizione un numero limitato di esempi, ma nell'era dei Big
Data, dove i problemi di apprendimento automatico consistono di più di un miliardo di
campioni, la frazione di dati allocati agli insiemi di sviluppo e test è ridotta, nonostante il
valore assoluto di esempi sia maggiore.
Vengono utilizzate diverse tecniche statistiche per valutare la bontà di un modello.
14
2.4 – Train, Validation e Test Sets
2.4.1 Evaluation metric
Le metriche di valutazione misurano le prestazioni di un modello, discriminando la bontà
dei risultati ottenuti. Vengono presi in considerazione diversi tipi di metriche per valutare i
modelli. La scelta della metrica dipende completamente dal tipo di modello e dal piano di
implementazione.
I modelli predittivi si distinguo in due principali categorie: si parla di regressione quando
l'output da prevedere è continuo, o di classificazione nel caso in cui l'output sia nominale
o binario.
Regressione
L'scarto quadratico medio, in inglese Root Mean Squared Error (RMSE), è la metrica di
valutazione più popolare utilizzata nei problemi di regressione. Questo parametro aiuta a
fornire risultati affidabili, mostrando correttamente la grandezza del termine di errore. La
metrica RMSE è definita dalla seguente equazione
RMSE =
s
PN
i=1(Yi − ˆYi)2
N
.
(2.13)
con ˆY quantità prevista dalla rete, Y i valori osservati e N numero delle previsioni.
Classificazione
Nei problemi di classificazione, in particolare quella binaria, gli output sono 0 o 1.
Una matrice di confusione, nota anche come matrice di errore, è una tabella 2 × 2,
generalizzabile ad una N × N per problemi ad N classi, che consente la visualizzazione
delle prestazioni di un algoritmo di apprendimento supervisionato.
Ogni colonna della matrice rappresenta le istanze previste di una classe mentre ciascuna
riga quelle osservate.
L'individuazione di falsi positivi (casi negativi identificati come positivi), falsi negativi
(casi positivi identificati come negativi), veri positivi (casi positivi correttamente identifi-
cati) e veri negativi (casi negativi correttamente identificati), mostrati nella Figura 2.3,
consentono un'analisi più dettagliata della semplice proporzione di classificazioni corrette.
È possibile estrarre da questa tabella le seguenti misure di performance:
15
2 – Reti Neurali
Figura 2.3: Visualizzazione di una matrice di confusione
• l'accuracy, o accuratezza, del modello, che consiste nella porzione rispetto al totale
delle previsioni corrette
True Positive + True Negative
True Positive + True Negative + False Positive + False Negative
(2.14)
• la precision, o precisione, cioè la porzione dei casi positivi identificati correttamente
True Positive
True Positive + False Positive
• la recall, ovvero la porzione dei casi positivi reali correttamente identificati
True Positive
True Positive + False Negative
(2.15)
(2.16)
2.4.2 Overfitting
L'overfitting è "la produzione di un'analisi che corrisponde esattamente a un particolare
insieme di dati o ne presenta forti similarità; può determinare l'impossibilità di adattamento
a nuovi dati o compromettere l'affidabilità delle predizioni sulle osservazioni future".
La rete neurale deve avere la capacità di comprensione del modello statistico dei
dati. In presenza di overfitting essa memorizza i dati del training set e non è quindi in
grado di generalizzare su nuovi dati. L'essenza di questo problema consiste nell'estrarre
inconsapevolmente parte della variazione residua (cioè il rumore) come se quella variazione
rappresentasse la sottostante struttura del modello [33].
Per ridurre la possibilità di overfitting esistono diverse tecniche, come la convalida
incrociata (Cross Validation), la regolarizzazione o l'early stopping, che consiste nell'utilizzo
di un validation set di coppie non usate nel training set per la misurazione dell'errore.
16
1010Classe previstaClasse osservataTrue PositiveTrue NegativeFalse PositiveFalse NegativeCapitolo 3
Formulazione
3.1 Definizione del problema
Partendo da materiale testuale presente in rete, in particolare un dataset messo a disposizio-
ne da Yelp Dataset Challenge contenente 5 200 000 reviews relative a 174 000 business di 11
aree metropolitane nel mondo, l'obiettivo è quello di estrarre da questi dati caratteristiche
di personalità.
Il nostro scopo è di identificare un adeguato spazio semantico che permetta di definire la
personalità dell'oggetto target a cui un determinato testo si riferisce.
3.2 Descrizione del dataset
Come punto di partenza, viene messo a disposizione un dizionario di 637 aggettivi, che la
letteratura psicologica definisce come marker dei cinque grandi tratti di personalità noti
come Big Five. In particolare, questo vocabolario associa ad ogni aggettivo un vettore di
cinque elementi in cui ogni elemento corrisponde al grado di presenza o assenza di una
determinata caratteristica.
Adjective
Active
Angry
Boring
. . .
0,053194
-0,004604
-0,069877
. . .
0,237406
-0,038453
-0,099754
. . .
OCEAN
0,365915
0,020755
-0,478821
. . .
0,116700
-0,294754
-0,236462
. . .
-0,058669
0,590114
0,118821
. . .
Tabella 3.1: Esempio di dizionario OCEAN
17
3 – Formulazione
3.3 Calcolo della Ground Truth
Per poter addestrare correttamente il modello è necessario avere una Ground Truth, ovvero
una label associata ad ogni input della rete. Senza questa informazione sarebbe impossibile
ottimizzare il modello e valutarne la validità.
Si procede eliminando dal dataset tutte le sentences non contenenti almeno uno degli
aggettivi presenti nel dizionario OCEAN. In seguito verranno utilizzati i dati contenuti
all'interno del vocabolario per creare una mappatura diretta tra ogni frase e il corrispondente
vettore di personalità, in cui ogni elemento sarà calcolato come la media del valore di ogni
aggettivo presente nel testo.
3.4 Preprocessing
Gli algoritmi di apprendimento automatico non sono in grado funzionare direttamente
con il testo non elaborato, è quindi necessario eseguire in primis un preprocessamento
del database di testi e in seguito convertire i dati in numeri, nello specifico, in vettori di
numeri.
Alla fine di questo processo il dataset ottenuto sarà suddiviso in tre corpora:
• 70% training set : contenente 4 351 900 reviews utilizzate dalla rete per l'apprendi-
mento;
• 10% validation set: contenente 621 700 reviews;
• 20% testing set: contenente 1 243 000 reviews.
La divisione dei tre dataset dovrà mantenere una buona distribuzione fra le diverse classi.
3.4.1 Natural Language Processing
Il Natural Language Processing (NLP) è un insieme di tecniche di computer science e
linguistica che ricorrono a dei calcolatori per analizzare il linguaggio umano.
Dal punto di vista sintattico, al dataset viene applicata la seguente serie di operazioni:
• Rottura della frase: dato un pezzo di testo vengono trovati i limiti della frase,
spesso contrassegnati da punti o altri segni di punteggiatura.
• Stemming: alcune parole vengono ridotte alla loro forma radice (ad esempio "argue,
argued, argues, arguing, and argus" sono mappati alla parola "argu").
18
3.4 – Preprocessing
• Segmentazione di parole: un blocco di testo o sentence viene separato in parole.
Per una lingua come l'inglese, questo è abbastanza banale, poiché le parole sono
solitamente separate da spazi.
Dal punto di vista semantico invece si interviene nel seguente modo:
• Semantica lessicale: tenta di comprendere il significato computazionale delle singole
parole nel loro contesto.
• Comprensione del linguaggio naturale: i blocchi di testo vengono convertiti in
rappresentazioni più formali e più facili da manipolare per i computer.
Ricorrendo, dove possibile, alle tecniche sopraelencate, è possibile costruire un dizionario
delle 60 000 parole più frequenti nel corpus di training, basato sulla frequenza assoluta di
una parola, avendo cura di eliminare tutti gli aggettivi presenti nel dataset OCEAN.
Figura 3.1: Istogramma rappresentativo delle 30 parole più frequenti nel dizionario
In questo modo non verrà influenzata la rete mostrando l'associazione tra gli aggettivi
e le label associate, ed il modello sarà "costretto" ad imparare il legame esistente tra il
contesto di una frase e il relativo valore del tratto di personalità.
Inoltre sarà necessario anche rimuovere tutte le stopwords relative alla lingua inglese,
ovvero parole considerate poco significative perché usate troppo frequentemente all'interno
delle frasi - per esempio gli articoli e le congiunzioni - filtrando i termini comuni e senza
uno specifico significato semantico dalle parole che trasportano vere informazioni.
19
'sn'tstafffoodserviceplacegoodgreatlikereallytimewouldgetonealwaysusalsolittlesuperevenwellgopeopleback'mcleangotcouldrestaurant'veWord index0100000200000300000400000500000Frequency3 – Formulazione
In seguito ogni parola del dizionario verrà codificata con un valore intero univoco,
mentre quelle non presenti, tra cui gli aggettivi mappati nel vocabolario OCEAN, verranno
indicizzati al valore "-1" e gli verrà associato il token "UNK" come mostrato nella Figura 3.2
Figura 3.2: Visualizzazione del preprocessing
20
the girl who took our order was friendlygirltookorder45334105 -1friendlyCapitolo 4
Esperimenti e risultati
La maggior parte degli attuali studi di previsione della personalità si sono concentrati
sull'applicazione di tecniche generali di apprendimento automatico per predire i tratti di
personalità Big Five. In particolare verranno utilizzate diverse strutture di rete, combinando
differenti domini.
4.1 Spazi di rappresentazione
Per affrontare questo problema di Text Mining, gli esperimenti si concentrano su due
principali metodi per l'estrazione delle caratteristiche del testo:
• Un approccio supervisionato, in cui viene utilizzato come strumento di generazione
di feature un vettore bag-of-words o brevemente BoW, una rappresentazione di testo
che descrive la presenza delle parole all'interno di un documento, in questo caso nel
dizionario delle occorrenze [21].
• Un approccio non supervisionato, in cui viene costruito un embedding, tramite
l'algoritmo word2vec di Tomas Mikolov [20]. Insegnando alla rete il significato delle
parole e la relazione tra di esse, è possibile rappresentare, sotto forma di vettori, le
mappature tra le parole e i contesti.
In seguito viene posta l'attenzione su tre diverse architetture neurali:
• Reti fully-connected;
• Reti neurali convoluzionali CNN;
• Classificatori multi-label binari.
21
4 – Esperimenti e risultati
4.2 Esperimento 1
4.2.1 Input Features
Nel primo approccio proposto, per rappresentare i dati testuali viene utilizzato il modello
bag-of-words, un tipo di descrizione semplificata, spesso utilizzata nell'elaborazione del
linguaggio naturale e nel campo dell'Information Retrivial (IR).
Sfruttando il dizionario delle occorrenze precedentemente costruito, il testo viene
modellato come fosse una "borsa di parole", in cui grammatica e ordine delle parole
vengono trascurate. Ogni frase viene ridotta ad un vettore in cui ogni elemento identifica
una parola del dizionario. Nella posizione corrispondente ad un determinato termine vi
sarà il valore 1 se la parola è contenuta nella frase, 0 altrimenti.
Il modello riguarda solo le parole conosciute, di conseguenza i vocaboli che compaiono
nel testo ma sono assenti nel dizionario vengono trascurati.
Figura 4.1: Visualizzazione del modello bag-of-words
4.2.2 Architettura della rete
Una volta estratte, le features posso essere passate in input alla rete neurale, che le elabora
calcolando le risposte dei neuroni dal livello di input verso il livello di output.
In questa prima strategia viene utilizzata una rete feed-forward con struttura densa o
fully-connected. Per i dettagli di queste architetture si rimanda alla Sezione 2.2.1.
Ad ogni livello viene applicata la funzione di attivazione non lineare ReLU, descritta
nella Sezione 2.1.1.
Inoltre, per accelerare l'apprendimento ed aumentare la stabilità della rete, viene
effettuata dopo ogni layer una Batch Normalization, definita nella Sezione 2.2.4.
Vengono presentate nella tabella 4.1 tre architetture implementate, con differenti strati
e numero di neuroni che caratterizza ciascuno.
22
foodis1well go preparedfood is well preparednetbox 1 00 110 4.2 – Esperimento 1
Layer Modello 1 Modello 2 Modello 3
Input
fc1
fc2
fc3
Output
60 000
300
200
-
5
60 000
300
200
100
5
60 000
100
50
20
5
Tabella 4.1: Confronto delle architetture di tre differenti modelli
Tutte le simulazioni sono state addestrate per 10 epoche: la fase di addestramento
viene in genere portata avanti fino a quando le performance sul test non producono alcun
miglioramento.
L'ottimizzatore scelto è Adagrad, introdotto nella Sezione 2.3.2, con learning rate 0,001.
Come funzione di loss è stato scelto l'errore quadratico medio, in inglese Mean Squared
Error (MSE), presentato nella Sezione 2.3.1. Mentre la metrica di valutazione utilizzata
per misurare le prestazioni predittive del modello è la Root Mean Squared Error (RMSE),
introdotta nella Sezione 2.4.1.
In ogni epoca si alternano una fase di training ed una fase di test in modo tale da
monitorare costantemente i miglioramenti o i peggioramenti del modello sul test set.
4.2.3 Performance
Prendendo in considerazione le tre diverse architetture implementate, vengono presentati i
risultati ottenuti in termini di loss.
Train loss Test loss Tempo di training
Modello 1
Modello 2
Modello 3
0,061
0,090
0,068
0,062
0,061
0,062
235 min
250 min
265 min
Tabella 4.2: Confronto dei risultati in termini di loss ottenuti dalle tre diverse reti
Per valutare l'efficacia di questi modelli, è fondamentale eseguire un analisi dettagliata,
in particolare ponendo l'attenzione sui valori di RMSE per ogni tratto di personalità.
Calcolando il valore medio assunto da ogni caratteristica durante la fase di addestramento,
è possibile stabilire qual è il valore di Root Mean Squared Error di un modello concettuale,
chiamato "Modello 0", che per ogni tratto predice sempre il suo valore medio.
23
4 – Esperimenti e risultati
Modelli
Root Mean Squared Error
N
E
O
A
C
Modello 1
Modello 2
Modello 3
Modello
Modello 0
Modello
Modello 0
Modello
Modello 0
0,148
0,145
0,147
0,141
0,147
0,233
0,227
0,224
0,226
0,227
0,226
0,307
0,224
0,213
0,225
0,213
0,225
0,262
0,251
0,218
0,251
0,208
0,262
0,373
0,351
0,318
0,341
0,305
0,348
0,546
Tabella 4.3: Confronto dei risultati in termini di Root Mean Squared Error delle
architetture contro il modello basato sulla media di training
Figura 4.2: Visualizzazione delle training loss dei tre modelli
Mettendo a confronto le due metriche, si nota che i modelli realmente implementati
imparano nella maggioranza dei casi a predire un valore con lo stesso errore commesso dai
modelli banali che calcolano la media. Risulta allora evidente che i risultati ottenuti non
siano ottimali.
Nonostante ciò, il terzo modello sembrerebbe essere leggermente migliore degli altri
due, in particolare confrontandolo con il corrispondente modello nullo si nota la presenza
di un piccolo margine di miglioramento.
La scarsa efficienza di questi modelli potrebbe dipendere dall'efficacia con cui vengono
codificate le feature in input alla rete. Infatti le limitazioni dell'approccio bag-of-words
24
00,250,50,7511250002500003750005000000modello 1modello 2modello 34.3 – Esperimento 2
derivano in parte dalla progettazione del vocabolario e della sua dimensione, che può
causare una scarsa "descrizione" del documento. Scartare l'ordine delle parole e ignorare
il contesto non consente di determinare la differenza tra le stesse parole disposte diversa-
mente, i sinonimi ecc. Inoltre, un tipo di rappresentazione sparsa risulta più difficile da
modellare quando si cercano modelli in grado di sfruttare poche informazioni in uno spazio
rappresentativo ampio, sia per ragioni computazionali (spazio e complessità temporale) sia
per ragioni di informazione.
4.3 Esperimento 2
Durante l'applicazione di tecniche di apprendimento automatico, tutte le "informazioni"
vengono rappresentate per mezzo di identificativi unici e discreti.
Nel caso dell'approccio BoW, la codifica utilizzata non fornisce alcuna informazione
utile al sistema riguardo le relazioni che possono sussistere tra i singoli elementi. Ciò
significa che quando sta elaborando i dati, il modello può sfruttare molto poco di ciò che
ha appreso su un determinato termine.
Inoltre la "raffigurazione" utilizzata nel precedente esperimento, ha portato alla creazione
di dati sparsi. Di conseguenza, per ottenere un modello di successo, un'alternativa valida
sarebbe quella di sfruttare modelli spaziali vettoriali, in inglese Vector Space Model (VSM),
per rappresentare le parole in uno spazio continuo [34, 35]. Questi metodi dipendono
dall'ipotesi distributiva, la quale afferma che le parole che appaiono negli stessi contesti
condividono lo stesso significato semantico [36].
4.3.1 Input Features
Nel secondo approccio, viene applicato l'algoritmo non supervisionato word2vec di Tomas
Mikolov [37]. Word2vec è un modello predittivo particolarmente efficiente dal punto di
vista computazionale per l'apprendimento degli embedding di parole a partire dal testo non
elaborato. Esso è basato su una rete neurale artificiale a due strati, addestrati a ricostruire
i contesti linguistici delle parole.
A partire dal corpus di testo, la rete prende in input un set formato dall'accoppiamento
di ogni parola target e i contesti in cui appare e restituisce un insieme di vettori che
rappresentano la distribuzione semantica delle parole nel testo.
Viene considerato come "contesto" l'insieme delle "parole a sinistra" e delle "parole alla
destra" dell'obiettivo, ovvero la finestra di dimensione 1 attorno all'elemento target. Ogni
coppia di destinazione del contesto viene trattata come se fosse una nuova osservazione,
incrementando le informazioni distribuzionali. Viene così prodotto uno spazio vettoriale di
25
4 – Esperimenti e risultati
diverse centinaia di dimensioni, in cui ogni parola univoca viene assegnata a un vettore
corrispondente nello spazio.
Per l'implementazione viene utilizzato il modello skip-gram, una versione di word2vec
che vuole predire le parole del contesto di origine (label) a partire dalle parole target
(features).
Figura 4.3: Visualizzazione del modello skip-gram
In questo tipo di apprendimento, i vettori si posizionano nello spazio in modo tale che
le parole che condividono contesti comuni nel corpo siano situate in stretta prossimità
l'una dell'altra. Un esempio interessante viene illustrato nella Figura 4.4(b) - si ponga
particolare attenzione alle parole "beautiful", "lovely", "chic", "trendy" ecc.. - in cui i
vocaboli semanticamente simili si trovano vicini dello spazio.
(a) Visualizzazione 2D
(b) Dettaglio di una visualizzazione 3D
Figura 4.4: Proiezione dell'embedding di Mikolov nello spazio 2-3 dimensionale, tramite la
tecnica di riduzione della dimensionalità (t-SNE) [38]
La funzione obiettivo utilizzata dalla rete per la costruzione dell'embedding viene
definita sull'intero set di dati, ed ottimizzata con la Stochastic Gradient Descent (SGD),
definita nella Sezione 2.3.2.
Nella seguente tabella vengono presentati i due embedding realizzati e i relativi
parametri.
26
i personally love crackers i personally love crackers (personally, i)(personally, love)([i, love], personally)i personally love crackers (love, personally)(love, crackers)([personally, crackers], love)clt4.3 – Esperimento 2
Embedding
Parameters
Embedding Size Num Sampled
Embedding 1
Embedding 2
40
250
20
50
Tabella 4.4: Confronto dei parametri della rete impostati per la realizzazione
dell'embedding
4.3.2 Architettura della rete
La rappresentazione spazio-vettoriale viene utilizzata come feature della modello che si
andrà a costruire. In questo secondo approccio verrà utilizzata un rete convoluzionale, in
cui ogni neurone è collegato solo a pochi neuroni vicini nel livello precedente, e lo stesso
insieme di pesi viene utilizzato per ogni neurone.
In questo tipo di rete, il modello di connessione locale e lo schema di peso condiviso pos-
sono essere interpretati come un filtro (o un insieme di filtri) che accettano un sottoinsieme
dei dati di input alla volta, ma vengono applicati all'intero input.
Uno strato convoluzionale è molto più specializzato ed efficiente di uno completamente
connesso.
Figura 4.5: Esempio di architettura convoluzionale per la manipolazione del linguaggio
naturale
Le operazioni eseguite da questi strati vengono trasformate in "moltiplicazioni" non
lineari tramite l'applicazione della funzione di attivazione ReLU, introdotta nella Sezio-
ne 2.1.1.
27
wouldwelikeasandwichword embeddinglayer di convoluzionecon più filtri e mappa delle featurelayer di poolinglayer fully connectedoutput4 – Esperimenti e risultati
Ad ogni livello convoluzionale viene applicata una Batch Normalization, definita nel-
la Sezione 2.2.4, utilizzata sull'input per il ridimensionamento delle funzionalità e la
normalizzazione batch nei livelli nascosti.
Dopo il primo strato convoluzionale viene inserito un layer di pooling, introdotto nella
Sezione 2.2.3, necessario per ridurre in modo efficace i campioni dell'output del livello
precedente, riducendo il numero di operazioni richieste per tutti i livelli successivi, ma
passando comunque le informazioni valide.
Come ultimo strato della rete viene scelto un layer fully-connected, definito nella
Sezione 2.2.1, corrispondente ad un'operazione lineare sul vettore di input del livello che
esegue una serie di trasformazioni sulla rappresentazione profonda al fine di emettere i
punteggi di ogni classe.
Layer Modello 4
Modello 5
Modello 6
conv1
mpool1
conv2
conv3
fcout
10×5, 10
18×18, 10
-
5×5, 150, same pad
4×4, stride 2, same pad
5×20, 100, same pad
1×20, 50,
1×1, 5
3×3, 100, same pad
3×20, 75, same pad
1×20, 50
Tabella 4.5: Architetture implementate a partire dall'embedding 1
Layer
conv1
mpool1
conv2
conv3
fc1
fc2
fc3
fcout
Modello 7
Modello 8
3×3, 100, stride 2, same pad
4×4, stride 2, same pad
3×63, 75, stride 2, same pad
1×32, 50, stride 2
-
1×32, 50, stride 2
1×32, 50, stride 2
1×1, 5
-
-
-
-
1×1, 100
1×1, 50
1×1, 20
1×1, 5
Tabella 4.6: Architetture implementate a partire dall'embedding 2
Vengono presentate nelle tabelle 4.5 e 4.6 le diverse configurazioni dei layer convoluzio-
nali delle architetture implementate per i due embedding.
L'input della rete è costituito da un numero di caratteristiche pari a n × p dove n è la
dimensione dell'embedding e p il numero delle parole di ogni sentence.
28
4.3 – Esperimento 2
Modelli
Learning Rate
Embedding 1
Embedding 2
Modello 4
Modello 5
Modello 6
Modello 7
Modello 8
0,001 0
0,000 1
0,005 0
0,005 0
0,000 1
Tabella 4.7: Learning rate delle simulazioni effettuate nell'esperimento 2
Come algoritmo di ottimizzazione viene scelto sempre Adagrad, illustrato nella Sezio-
ne 2.3.2, mentre il valore di learning rate settato per ogni modello viene mostrato nella
tabella 4.7.
Viene mantenuta anche in questa simulazione la funzione di costo MSE, approfondita
nella Sezione 2.3.1.
Nel caso del secondo embedding si è voluto provare anche un modello che sfruttasse
solo livelli di rete fully-connected, senza applicare alcuna convoluzione.
4.3.3 Performance
Prendendo in considerazione i due diversi embedding, vengono messe a confronto a confronto
le diverse architetture implementate, mostrando i risultati ottenuti in termini di loss.
Modelli
Train loss Test loss Tempo di training
Embedding 1
Embedding 2
Modello 4
Modello 5
Modello 6
Modello 7
Modello 8
0,061
0,052
0,042
0,038
0,058
0,058
0,060
0,060
0,057
0,117
200 min
310 min
540 min
225 min
250 min
Tabella 4.8: Confronto dei risultati in termini di loss ottenuti nelle diverse reti con i due
diversi embedding
Valutando le prestazioni su train e test set viene rilevato il "Modello 7" come il migliore
tra quelli proposti, presentando i valori di loss più bassi. Oltre a ciò, anche rispetto al
precedente approccio il "Modello 7" mostra una performance migliorata circa del 3%.
Vengono analizzati anche i valori di RMSE, relativi ad ogni tratto di personalità,
riassunti nella tabella 4.9, e viene inoltre visualizzata la curva RMSE nella Figura 4.6.
29
4 – Esperimenti e risultati
Modelli
Root Mean Squared Error
N
E
O
A
C
Embedding 1
Embedding 2
Modello 4 0,148
Modello 5 0,146
Modello 6 0,146
Modello 7 0,147
Modello 8 0,399
0,226
0,227
0,225
0,223
0,275
0,232
0,230
0,224
0,222
0,257
0,252
0,251
0,251
0,251
0,271
0,313
0,336
0,337
0,320
0,457
Tabella 4.9: Confronto dei risultati in termini di Root Mean Squared Error delle
architetture sul test set
Figura 4.6: Visualizzazione delle training RMSE dei modelli
4.4 Esperimento 3
Nel terzo approccio si decide di valutare una rappresentazione dell'input alternativa.
4.4.1
Input Features
Ricorrendo nuovamente al modello skip-gram, l'input della rete questa volta comprende il
set formato dall'accoppiamento tra gli aggettivi contenuti nel dizionario OCEAN e i loro
contesti.
La finestratura che si andrà a definire in torno al target sarà di dimensione 2 e considererà
le due parole a sinistra e le due parole a destra dell'aggettivo. La window non sarà più
30
0,20,80,400,62,557,5010modello 4modello 5modello 6modello 7modello 84.4 – Esperimento 3
quindi incentrata su ogni elemento della sentence. Dunque nell'embedding che si andrà a
costruire non verranno appresi i contesti di tutte le parole, ma solamente quelli di nostro
interesse, ovvero relativi agli aggettivi.
In questo esperimento viene realizzato un solo embedding, la cui dimensione è 250 e
con numero di etichette negative da campionare pari a 50 [28].
4.4.2 Architettura della rete
Viene utilizzato l'embedding estratto per costruire due modelli di reti neurali, le cui
architetture vengono presentate nella tabella 4.10. Come nel precedente esperimento si
ricorrerà alle reti convoluzionali; si rimanda alla Sezione 4.3.2 per i dettagli.
Layer
conv1
mpool1
conv2
conv3
conv4
fcout
Modello 9
Modello 10
7×5, 100, stride 2, same pad 3×3, 100, stride 2, same pad
4×4, stride 2, same pad
5×63, 75, stride 2, same pad 3×63, 75, stride 2, same pad
3×32, 50, stride 2, same pad
1×16, 25, stride 2
1×32, 50, stride 2
-
1×1, 5
Tabella 4.10: Architetture dei due modelli implementati a partire dall'embedding 3
L'algoritmo di apprendimento utilizzato è Adagrad, definito nella Sezione 2.3.2, con
learning rate 0,000 5 per il "Modello 9" e 0,005 per il "Modello 10". La funzione di loss
scelta è la MSE, introdotta nella Sezione 2.3.1.
4.4.3 Performance
Vengono presentati nella tabella 4.11 i valori ottenuti dalla funzione obiettivo dei due
modelli, mentre nella tabella 4.12 vengono riassunti i valori di RMSE per ogni tratto di
personalità.
Train loss Test loss Tempo di training
Modello 9
Modello 10
0,043
0,050
0,060
0,059
18 h
17 h
Tabella 4.11: Confronto dei risultati in termini di loss ottenuti nell'implementazione dei
due modelli
31
4 – Esperimenti e risultati
Modelli
Root Mean Squared Error
N
E
O
A
C
Modello 9
0,146
Modello 10 0,147
0,223
0,225
0,223
0,224
0,251
0,252
0,331
0,339
Tabella 4.12: Confronto dei risultati in termini di RMSE delle due architetture sul test set
Rispetto al precedente approccio non vengono ottenuti dei miglioramenti.
4.5 Esperimento 4
L'ultimo approccio provato riutilizza i precedenti metodi di estrazione di feature che hanno
ottenuto le migliori prestazioni per realizzare un modello predittivo di classificazione.
Nello specifico il problema viene trasformato in un compito di classificazione binaria
multi-label, in cui si cercano di predire cinque diverse etichette per ogni istanza.
Per ogni dimensione di personalità l'output della rete sarà "0", se il valore reale che
assume un determinato tratto è inferiore a 0, o "1" altrimenti.
Viene stabilito 0 come "punto di neutralità assoluta" perché corrisponde alla media dei
valori osservati in ognuna delle caratteristiche.
Adottando questo metodo, si assumerà di poter estrarre da questa funzione una misura
di polarità, positiva o negativa, che indicherà un tratto più o meno accentuato.
Il vantaggio effettivo di questo approccio consiste nella possibilità di valutare le perfor-
mance in modo standard, visualizzando le matrici di confusione e misurandone l'accuratezza,
argomenti trattati nella Sezione 2.4.1.
4.5.1 Input Features
Vengono utilizzati come ingresso della rete due embedding di Mikolov realizzati negli
esperimenti precedenti, ovvero l'"Embedding 2" e l'"Embedding 3".
4.5.2 Architettura della rete
Le reti che vengono realizzate sono molto simili a quelle precedentemente implementate; i
dettagli delle architetture vengono presentati nella tabella 4.13.
Ad ogni livello della rete viene applicata la stessa procedura degli esperimenti precedenti.
32
4.5 – Esperimento 4
Layer Modello 11 Modello 12 Modello 13
conv1
mpool1
conv2
conv3
conv4
fcout
3×3, 100
4×4
3×63, 75
1×32, 50
-
1×1, 10
5×3, 100
4×4
3×63, 75
1×32, 50
1×16, 25
1×1, 10
7×5, 100
4×4
5×63, 75
3×32, 50
1×16, 25
1×1, 10
Tabella 4.13: Architetture implementate a partire dall'embedding 2
In ogni livello convoluzionale della rete si utilizzano uno stride di dimensione 2 e padding
same, tranne che per l'ultimo livello convoluzionale con padding valid, per i dettagli si
consiglia di visitare la sezione 2.2.2.
Layer
conv1
mpool1
conv2
conv3
conv4
conv5
fcout
Modello 14
Modello 15
7×5, 100, stride 2, same pad 7×5, 100, stride 2, same pad
4×4, stride 2, same pad
4×4, stride 2, same pad
5×63, 75, stride 2, same pad 5×63, 75, stride 2, same pad
3×32, 50, stride 2, same pad 3×32, 50, stride 2, same pad
3×16, 25, stride 2, same pad
1×8, 16, stride 2
1×16, 25, stride 2
-
1×1, 10
Tabella 4.14: Architetture implementate a partire dall'embedding 3
In tutte le simulazioni l'ottimizzatore scelto è Adagrad, introdotto nella Sezione 2.3.2,
il valore di learning rate di ogni modello viene mostrato nella tabella 4.15.
Come funzione obiettivo viene utilizzata la Softamax Cross Entropy, presentata nella
Sezione 2.3.1.
Modelli
Learning Rate
Embedding 2
Embedding 3
Modello 11
Modello 12
Modello 13
Modello 14
Modello 15
0,000 1
0,000 5
0,000 5
0,000 5
0,000 5
Tabella 4.15: Learning rate delle simulazioni effettuate nell'esperimento 2
33
4 – Esperimenti e risultati
4.5.3 Performance
Prendendo in considerazione le diverse architetture implementate, vengono presentati i
risultati ottenuti in termini di loss.
Modelli
Train loss Test loss Tempo di training
Embedding 2
Embedding 2
Modello 11
Modello 12
Modello 13
Modello 14
Modello 15
3,275
3,297
3,444
3,350
3,230
3,455
3,459
3,458
3,459
3,454
20 h
30 h
40 h
20 h
60 h
Tabella 4.16: Confronto delle loss ottenute nelle diverse reti con i due diversi embedding
Come già detto, l'utilizzo di questo approccio consente una valutazione non più solo in
termini di loss ma se ne potrà analizzare anche l'accuratezza, introdotta nella Sezione 2.4.1.
Modelli
O
Train/Test Accuracy [%]
E
A
C
N
Embedding 2
Embedding 3
Modello 11 61/61
Modello 12 62/59
Modello 13 63/55
Modello 14 61/61
Modello 15 63/60
60/59
61/50
63/60
61/57
62/48
63/60
64/45
63/61
62/52
64/60
58/56
61/56
63/58
60/57
62/49
57/54
61/56
62/59
60/56
62/48
Tabella 4.17: Confronto delle accuracy sul test set delle diverse architetture
Il "Modello 13" sembrerebbe il migliore tra quelli proposti poiché presenta valori di
accuracy più alti e la differenza di prestazioni tra train e test set è una tra le più basse,
dimostrando minore propensione all'overfitting.
Viene presentata un analisi più dettagliata su questo modello, in particolare mostrando
il grafico dell'accuratezza, su train e test set, e le matrici di confusione calcolate per ogni
tratto di personalità.
Come si può vedere chiaramente dalle matrici di confusione, le caratteristiche Con-
scientiousness e Extraversion sono quelle che vengono predette nel modo peggiore.
34
4.5 – Esperimento 4
(a) Visualizzazione matrice di confusione
(b) Visualizzazione accuratezza su train e test
Figura 4.7: Analisi della caratteristica Openness del "Modello 13"
(a) Visualizzazione matrice di confusione
(b) Visualizzazione accuratezza su train e test
Figura 4.8: Analisi della caratteristica Conscientiousness del "Modello 13"
(a) Visualizzazione matrice di confusione
(b) Visualizzazione accuratezza su train e test
Figura 4.9: Analisi della caratteristica Extraversion del "Modello 13"
35
ObservedPredicted52% 48%42% 58%01010,540,510,640,570,602,557,5100train accuracy Otest accuracy OObservedPredicted94% 6%87% 13%01010,590,580,630,610,622,557,5100train accuracy Ctest accuracy C0101ObservedPredicted4% 96%2% 98%0,610,600,650,630,642,557,5100train accuracy Etest accuracy E4 – Esperimenti e risultati
(a) Visualizzazione matrice di confusione
(b) Visualizzazione accuratezza su train e test
Figura 4.10: Analisi della caratteristica Agreeableness del "Modello 13"
(a) Visualizzazione matrice di confusione
(b) Visualizzazione accuratezza su train e test
Figura 4.11: Analisi della caratteristica Neuroticism del "Modello 13"
36
ObservedPredicted010156% 44%37% 63%0,560,530,630,580,612,557,5100train accuracy Atest accuracy AObservedPredicted010164% 36%45% 55%0,550,530,630,580,602,557,5100train accuracy Ntest accuracy NCapitolo 5
Conclusioni
La natura di questo progetto di tesi è altamente sperimentale ed è volta a presentare analisi
dettagliate sull'argomento, in quanto allo stato attuale non esistono importanti indagini
che affrontino il problema dell'apprendimento dei tratti di personalità a partire da testo in
linguaggio naturale.
La domanda fondamentale che viene posta al fine di risolvere questo compito è quale sia
la metodologia adatta alla rappresentazione del testo. Durante la sperimentazione, infatti,
sono stati esaminati due principali approcci e ne è stata comparata l'efficacia.
Siamo partiti da una rappresentazione semplificata del testo ricorrendo al modello
bag-of-words. I risultati ottenuti sono sub-ottimali dal punto di vista della complessità.
Inoltre la codifica utilizzata non fornisce alcuna informazione utile al sistema riguardo le
relazioni che possono sussistere tra le parole di una frase.
In seguito è stata sfruttata una classe di algoritmi distribuzionali per insegnare alla
rete il significato e le relazioni sussistenti tra le parole. Sfruttando la versione skip-gram
dell'algoritmo word2vec di Tomas Mikolov vengono rappresentate sotto forma di vettori
le mappature tra parole e contesti nello spazio. Ricorrendo al secondo metodo i risultati
ottenuti dimostrano come utilizzare un embedding sia la tecnica di estrazione di features
più efficiente per filtrare le informazioni contenute in un testo.
È emerso che un'evoluzione di questo progetto potrebbe affacciarsi alla valutazione di
rappresentazioni alternative del testo, annotazioni, part-of-speech [39] e altre tecniche di
NLP, per approfondire e migliorare ulteriormente l'indagine.
37
5 – Conclusioni
Dal punto di vista delle architetture implementate, abbiamo iniziato dall'implementa-
zione di reti neurali fully-connected come base per capire come modelli semplici di Deep
Learning possano fornire informazioni sulle caratteristiche nascoste della personalità.
Infine, ci addentriamo nelle reti neurali convoluzionali molto più specializzate e efficiente
delle precedenti nell'ambito del Text Mining.
Sviluppi futuri di questo lavoro potrebbero valutare una procedura di apprendimento
alternativa, sfruttando altri modelli, quali le reti ricorrenti, per ottenere dei risultati più
efficaci.
La prima valutazione effettuata è definita come una regressione che tenta di prevedere
l'esatto valore reale per ogni tratto di personalità. Il problema presentato è estremamente
complesso, e le performance ottenute sono ancora lontane da quelle desiderate. Per questo
motivo viene eseguita una seconda valutazione che trasforma il nostro compito in un
problema di classificazione binaria multi-label. I risultati raggiunti questa volta, evincono
che ottimizzare la funzione di loss di un modello predittivo di regressione è molto più
difficoltoso rispetto ad ottimizzare una funzione di costo stabile come la Softmax. Questo è
evidente poiché il modello di regressione tenta di produrre un esatto valore per ogni input,
e i valori anomali predetti possono introdurre gradienti enormi.
38
Bibliografia
[1] Arthur L Samuel. «Some studies in machine learning using the game of checkers». In:
IBM Journal of research and development 3.3 (1959), pp. 210–229 (cit. alle pp. viii,
5).
[2] Soumen Chakrabarti et al. «Data mining curriculum: A proposal (Version 1.0)». In:
Intensive Working Group of ACM SIGKDD Curriculum Committee 140 (2006) (cit. a
p. viii).
[3] James Franklin. «The elements of statistical learning: data mining, inference and
prediction». In: The Mathematical Intelligencer 27.2 (2005), pp. 83–85 (cit. a p. viii).
[4] Ah-Hwee Tan et al. «Text mining: The state of the art and the challenges». In:
Proceedings of the PAKDD 1999 Workshop on Knowledge Disocovery from Advanced
Databases. Vol. 8. sn. 1999, pp. 65–70 (cit. a p. viii).
[5] Murray R Barrick e Michael K Mount. «The big five personality dimensions and job
performance: a meta-analysis». In: Personnel psychology 44.1 (1991), pp. 1–26 (cit. a
p. viii).
[6] Philip J Corr e Gerald Matthews. The Cambridge handbook of personality psychology.
Cambridge University Press Cambridge, 2009 (cit. a p. 1).
[7] Benjamin J Sadock, Virginia A Sadock e Pedro Ruiz. Comprehensive textbook of
psychiatry. lippincott Williams & wilkins Philadelphia, 2000 (cit. a p. 1).
[8] Lewis R Goldberg. «The structure of phenotypic personality traits.» In: American
psychologist 48.1 (1993), p. 26 (cit. a p. 1).
[9] Paul T Costa e Robert R McCrae. «The revised neo personality inventory (neo-pi-r)».
In: The SAGE handbook of personality theory and assessment 2.2 (2008), pp. 179–198
(cit. a p. 1).
39
BIBLIOGRAFIA
[10] Harry C. Triandis e Eunkook M. Suh. «Cultural Influences on Personality». In:
Annual Review of Psychology 53.1 (2002), pp. 133–160. doi: 10.1146/annurev.
psych.53.100901.135200. eprint: https://doi.org/10.1146/annurev.psych.53.
100901.135200 (cit. a p. 3).
[11] Lisa M Saulsman e Andrew C Page. «The five-factor model and personality disorder
empirical literature: A meta-analytic review». In: Clinical psychology review 23.8
(2004), pp. 1055–1085 (cit. a p. 3).
[12] Vinod Nair e Geoffrey E Hinton. «Rectified linear units improve restricted boltzmann
machines». In: Proceedings of the 27th International Conference on machine learning
(ICML-10). 2010, pp. 807–814 (cit. a p. 6).
[13] Richard Hahnloser et al. «Digital selection and analogue amplification coexist in a
cortex-inspired silicon circuit». In: 405 (lug. 2000), pp. 947–51 (cit. a p. 6).
[14] Richard Hahnloser e H. Sebastian Seung. «Permitted and Forbidden Sets in Symmetric
Threshold-Linear Networks». In: Advances in Neural Information Processing Systems.
A cura di T. Leen, T. Dietterich e V. Tresp. Vol. 13. MIT Press, 2000. url: https://
proceedings.neurips.cc/paper/2000/file/c8cbd669cfb2f016574e9d147092b5bb-
Paper.pdf (cit. a p. 6).
[15] Xavier Glorot, Antoine Bordes e Yoshua Bengio. «Deep sparse rectifier neural
networks». In: Proceedings of the fourteenth international conference on artificial
intelligence and statistics. 2011, pp. 315–323 (cit. a p. 6).
[16] Daniel Svozil, Vladimir Kvasnicka e Jiri Pospichal. «Introduction to multi-layer
feed-forward neural networks». In: Chemometrics and intelligent laboratory systems
39.1 (1997), pp. 43–62 (cit. a p. 7).
[17] Tara N Sainath et al. «Convolutional, long short-term memory, fully connected deep
neural networks». In: Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE
International Conference on. IEEE. 2015, pp. 4580–4584 (cit. a p. 7).
[18] Yoon Kim. «Convolutional neural networks for sentence classification». In: arXiv
preprint arXiv:1408.5882 (2014) (cit. a p. 8).
[19] Christopher D Manning, Christopher D Manning e Hinrich Schütze. Foundations of
statistical natural language processing. MIT press, 1999 (cit. a p. 8).
[20] Tomas Mikolov et al. «Distributed representations of words and phrases and their
compositionality». In: Advances in neural information processing systems. 2013,
pp. 3111–3119 (cit. alle pp. 8, 11, 21).
40
BIBLIOGRAFIA
[21] Hanna M Wallach. «Topic modeling: beyond bag-of-words». In: Proceedings of the
23rd international conference on Machine learning. ACM. 2006, pp. 977–984 (cit. alle
pp. 8, 21).
[22] Andrej Karpathy. «Cs231n convolutional neural networks for visual recognition». In:
Neural networks 1 (2016) (cit. a p. 9).
[23] Sergey Ioffe e Christian Szegedy. «Batch normalization: Accelerating deep network
training by reducing internal covariate shift». In: arXiv preprint arXiv:1502.03167
(2015) (cit. a p. 9).
[24] Zhou Wang e Alan C Bovik. «Mean squared error: Love it or leave it? A new look at
signal fidelity measures». In: IEEE signal processing magazine 26.1 (2009), pp. 98–117
(cit. a p. 10).
[25] Yichuan Tang. «Deep learning using linear support vector machines». In: arXiv
preprint arXiv:1306.0239 (2013) (cit. a p. 10).
[26] Weiyang Liu et al. «Large-Margin Softmax Loss for Convolutional Neural Networks.»
In: ICML. 2016, pp. 507–516 (cit. a p. 11).
[27] Chris Dyer. «Notes on noise contrastive estimation and negative sampling». In: arXiv
preprint arXiv:1410.8251 (2014) (cit. a p. 12).
[28] Tongliang Liu e Dacheng Tao. «Classification with noisy labels by importance
reweighting». In: IEEE Transactions on pattern analysis and machine intelligence
38.3 (2016), pp. 447–461 (cit. alle pp. 12, 31).
[29] Chockalingam Viswesvaran e Deniz S Ones. «Measurement error in "Big Five Factors"
personality assessment: Reliability generalization across studies and measures». In:
Educational and Psychological Measurement 60.2 (2000), pp. 224–235 (cit. a p. 12).
[30] Sebastian Ruder. «An overview of gradient descent optimization algorithms». In:
arXiv preprint arXiv:1609.04747 (2016) (cit. alle pp. 12, 13).
[31] John Duchi, Elad Hazan e Yoram Singer. «Adaptive subgradient methods for online
learning and stochastic optimization». In: Journal of Machine Learning Research
12.Jul (2011), pp. 2121–2159 (cit. a p. 13).
[32] S-I Horikawa, Takeshi Furuhashi e Yoshiki Uchikawa. «On fuzzy modeling using
fuzzy neural networks with the back-propagation algorithm». In: IEEE transactions
on Neural Networks 3.5 (1992), pp. 801–806 (cit. a p. 13).
41
BIBLIOGRAFIA
[33] Kenneth P Burnham e David R Anderson. Model selection and multimodel inference:
a practical information-theoretic approach. Springer Science & Business Media, 2003
(cit. a p. 16).
[34] Tomas Mikolov, Wen-tau Yih e Geoffrey Zweig. «Linguistic regularities in continuous
space word representations». In: Proceedings of the 2013 Conference of the North
American Chapter of the Association for Computational Linguistics: Human Language
Technologies. 2013, pp. 746–751 (cit. a p. 25).
[35] Katrin Erk e Sebastian Padó. «A structured vector space model for word meaning
in context». In: Proceedings of the Conference on Empirical Methods in Natural
Language Processing. Association for Computational Linguistics. 2008, pp. 897–906
(cit. a p. 25).
[36] Marco Baroni, Georgiana Dinu e Germán Kruszewski. «Don't count, predict! A
systematic comparison of context-counting vs. context-predicting semantic vectors».
In: Proceedings of the 52nd Annual Meeting of the Association for Computational
Linguistics (Volume 1: Long Papers). Vol. 1. 2014, pp. 238–247 (cit. a p. 25).
[37] Tomas Mikolov et al. «Efficient estimation of word representations in vector space».
In: arXiv preprint arXiv:1301.3781 (2013) (cit. a p. 25).
[38] Laurens van der Maaten e Geoffrey Hinton. «Visualizing data using t-SNE». In:
Journal of machine learning research 9.Nov (2008), pp. 2579–2605 (cit. a p. 26).
[39] Roger W Brown. «Linguistic determinism and the part of speech.» In: The Journal
of Abnormal and Social Psychology 55.1 (1957), p. 1 (cit. a p. 37).
42
|
|
http://arxiv.org/abs/2302.11905v1 | 2023-02-23T10:25:38 | 2023-02-23T10:25:38 | The Geometry of Mixability | Mixable loss functions are of fundamental importance in the context of
prediction with expert advice in the online setting since they characterize
fast learning rates. By re-interpreting properness from the point of view of
differential geometry, we provide a simple geometric characterization of
mixability for the binary and multi-class cases: a proper loss function $\ell$
is $\eta$-mixable if and only if the superpredition set $\textrm{spr}(\eta
\ell)$ of the scaled loss function $\eta \ell$ slides freely inside the
superprediction set $\textrm{spr}(\ell_{\log})$ of the log loss $\ell_{\log}$,
under fairly general assumptions on the differentiability of $\ell$. Our
approach provides a way to treat some concepts concerning loss functions (like
properness) in a ''coordinate-free'' manner and reconciles previous results
obtained for mixable loss functions for the binary and the multi-class cases. | [
"Armando J. Cabrera Pacheco",
"Robert C. Williamson"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11905v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11905v1",
"@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
3
2
]
G
L
.
s
c
[
1
v
5
0
9
1
1
.
2
0
3
2
:
v
i
X
r
a
THE GEOMETRY OF MIXABILITY
ARMANDO J. CABRERA PACHECO AND ROBERT C. WILLIAMSON
Abstract. Mixable loss functions are of fundamental importance in the
context of prediction with expert advice in the online setting since they
characterize fast learning rates. By re-interpreting properness from the
point of view of differential geometry, we provide a simple geometric char-
acterization of mixability for the binary and multi-class cases: a proper loss
function (cid:96) is η-mixable if and only if the superpredition set spr(η(cid:96)) of the
scaled loss function η(cid:96) slides freely inside the superprediction set spr((cid:96)log)
of the log loss (cid:96)log, under fairly general assumptions on the differentiability
of (cid:96). Our approach provides a way to treat some concepts concerning loss
functions (like properness) in a "coordinate-free" manner and reconciles
previous results obtained for mixable loss functions for the binary and the
multi-class cases.
1. Introduction
In the context of prediction with expert advice as described by Vovk in [Vov98]
and [Vov01], an information game is considered between three players: the
learner, n
N experts and nature. At each step t
N,
∈
∈
each expert makes a prediction which the learner is allowed to see,
the learner makes a prediction,
nature chooses an outcome,
for a fixed loss function (cid:96), the cumulative loss is calculated for the
learner and each of the experts.
•
•
•
•
The goal is to minimize the difference between the learner's loss and the best
expert's loss, which is often called the regret.
1.1. Mixable games and characterizations of mixable and fundamen-
tal loss functions. For a wide class of games, called η-mixable games for
η > 0, the Aggregating algorithm (see for example [Vov01]) ensures an optimal
bound for the regret (η−1 ln n) independent of the trial t. Since the mixability
of a game depends on the loss function (cid:96), a loss function (cid:96) is η-mixable if the
corresponding game is mixable. Since arguably the aggregating algorithm is
one of the most well founded and studied prediction algorithms, there is a
natural interest in understanding properties and characterizations of mixable
loss functions.
2
CABRERA PACHECO AND WILLIAMSON
Examples of mixable loss functions include the log loss, relative entropy for
binary outcomes [HKW98] and the Brier score [VZ09, vERW12]. Mixability
of a loss function (cid:96) is characterized by a "stronger convexity" of the super-
prediction set of (cid:96), which can be described as the convexity of the superpre-
diction set of (cid:96) after an "exponential projection" (see (1.3) below and [Vov15]
and [vERW12]). Unfortunately, this characterization of mixability lacks a
transparent geometric interpretation.
The main goal of this work is to provide such geometric interpretation. The
motivation stems from an observation made by Vovk in [Vov15]: a η-mixable
loss can be characterized as the positiveness of the infimum of the quotient of
the curvatures of the a strictly proper loss function (cid:96) and the log loss (cid:96)log for
binary outcomes. Here as usual, loss functions are defined on the 2-simplex ∆2
(see (1.1)). Moreover, he then proves that fundamentality (see Vovk [Vov15])
of a loss can be characterized as the finiteness of the supremum of the same
quotient of curvatures. These two results suggest that these properties are
geometric, meaning that they can be studied using differential geometry tools,
and in this regard, mixability and fundamentality should not depend on the
coordinates chosen to express them.
Loosely speaking, in convex geometry a convex set L is said to slide freely
inside a convex set K, if for any point x in the boundary of K, there is a
translation vector y such that the translation of L by y (i.e., the Minkowski
sum L + y, see (4.2)), intersects K at x, and L + y
K. We provide the
following geometric characterization of mixability and fundamentality, as a
geometric comparison to the log loss (see Figure 1). Let spr((cid:96)) denote the
superprediction set of a loss function (cid:96) (see (1.4)).
⊂
Theorem 1.1 (Informal statement). A continuously twice differentiable proper
loss function is η-mixable if and only there is η > 0 such that spr(η(cid:96)) slides
freely inside spr((cid:96)log). In addition, the same (cid:96) is fundamental if and only if
there exists γ > 0 such that spr((cid:96)log) slides freely inside spr(γ(cid:96)).
To obtain the previous theorem it is necessary to re-interpret properness
from a differential geometry point of view, which constitutes a big part of
this work. However, this technical effort pays off. In [vERW12], van Erven,
Reid and Williamson characterized η-mixable (differentiable) loss functions
for multi-class loss functions and moreover, related η to the Hessian of the
Bayes risk of (cid:96) and the log loss (see Definition 1.3), which is interpreted as
its curvature. By generalizing the tools developed here for the binary case, we
were able to obtain a multi-class analog result to Theorem 1.1 and to build a
bridge to the results in [vERW12].
THE GEOMETRY OF MIXABILITY
3
Figure 1. We abuse notation and denote the image of a loss
function (cid:96) by simply (cid:96). The figure shows how the superprediction
set of a translation of the scaling of (cid:96) slides freely inside the
∆2.
spr((cid:96)log). The bullet points are located at the image of p
∈
1.2. Description of results and structure of the article. Using the same
setting as [vERW12], we obtain a geometric characterization of η-mixable loss
functions in the sense of differential geometry. Loss functions are considered
to be maps (cid:96) : ∆n
≥0, which under the conditions assumed in this work,
give rise to submanifolds (cid:96)(relint(∆n)) of Rn whose geometric properties are
determined by (cid:96) (see the relevant precise definitions below). We first discuss
the case n = 2 (binary classification loss functions) since it is more instructive,
and then the case n
2. We summarize the main results as follows.
−→
Rn
≥
(1) We recast the notion of a (strictly) proper loss as a geometric property
of the loss itself rather than its superprediction set. That is, proper-
ness is no longer considered a parametrization dependent property,
it is a statement about the geometric properties of the "loss surface"
(cid:96)(relint(∆n)) (the boundary of the superprediction set). See lemmas 2.7
and 3.2.
(2) A geometric comparison is performed. For n = 2 in terms of the
curvature of the "loss curves" (see Section 1.5 below), and for n
2
in terms of the scalar second fundamental form of the "loss surfaces"
(see Section 3 and Appendix A), which measure how they curve inside
≥
•llog•l•ηlspr(ηl+y)•4
CABRERA PACHECO AND WILLIAMSON
Rn. The precise statements are given in Lemma 2.13 and Lemma 3.6.
Intuitively, these results tell us how the superprediction set of (cid:96) sits
inside the superprediction set of the log loss.
(3) Finally, we interpret our result from the point of view of convex analysis
to give a new characterization of mixability. More precisely, We show
that a (strictly) proper loss function (cid:96) is η-mixable if and only if the
superprediction set of (cid:96) slides freely (see Definition 4.11) inside the
superprediction set of the log loss.
As byproducts, we obtain a general way to define mixability with respect
to a fixed (strictly) proper loss function, further properties and consequences
for binary classification loss functions, particularly for composite losses and
canonical links, and a bridge to the results obtained in [vERW12].
Since we treat loss functions from the point of view of differential geometry
and convex geometry, a considerable background in these topics is needed. We
present this work as self-contained as possible and spend some time providing
the intuition and motivation for the results (and sometimes the background)
which naturally results in a longer exposition. In Section 2 we treat the binary
case, in Section 3 the multi-class case to obtain the geometric interpretation
of properness and mixability and perform the geometric comparison (in terms
of curvature). In Section 4 we make the connections to convex geometry and
obtain the geometric characterization of mixability in terms of the sliding freely
conditions of superprediction sets.
1.3. Setup. Here we summarize our setup, for more details see [vERW12].
Denote by [n] the set of natural numbers
. The set of probability
= n
distributions on a finite set
with
1, ..., n
{
}
N is given by
∈
n
Y
|Y|
(1.1)
∆n =
(p1, ..., pn)
(cid:40)
n
R
∈
pi = 1
(cid:41)
.
−
We note that ∆n is a manifold with (non-smooth) boundary of dimension
1. Moreover, ∆n is a hypersurface in Rn; we denote the interior (as
n
a manifold) of ∆n as int(∆n) which is the same set as the relative interior
relint(∆n) of ∆n. We define the standard parametrization of ∆n as the map
Φstd : ∆n−1
∆n given by
Rn−1
⊂
−→
i=1
(cid:88)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(1.2)
Φstd(t1, ..., tn−1) =
t1, ..., tn−1, 1
(cid:32)
−
ti
.
(cid:33)
In particular, when n = 2 the standard parametrization of ∆2 is the map
Φstd : [0, 1]
∆2 given by Φstd(t) = (t, 1
t).
−→
−
Definition 1.2. A loss function is a map (cid:96) : ∆n
each k
, k) : ∆n
, the map (cid:96)(
*
R is continuous.
∈ Y
−→
× Y −→
R≥0 such that for
n−1
i=1
(cid:88)
THE GEOMETRY OF MIXABILITY
5
Given a loss function (cid:96), p
, the value (cid:96)(p, k) represents the
∈
penalty of predicting p upon observing k. We define the partial losses of a loss
function (cid:96) as the maps (cid:96)i : ∆n
R≥0 given by (cid:96)i(p) = (cid:96)(p, i). A loss function
can be described in terms of its partial losses as
∈ Y
−→
∆n and k
n
(cid:96)(p, k) =
[[k = i]](cid:96)i(p).
Thus, we can identify a loss fuction (cid:96) with the map (cid:96) : ∆n
i=1
(cid:88)
mined by its partial losses
Rn
≥0 deter-
−→
(cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)) .
In this work we follow this convention unless stated otherwise. Note that this
way we can see a loss function (cid:96) as an embedding of int(∆n) into Rn
≥0 (assuming
enough properties on (cid:96)). We will see later that properness ensures the image
of this embedding to be a nice hypersurface of Rn with appealing geometric
properties. Under the assumption that the outcomes are distributed with
∆n, we make the below definitions following [vERW12, RW10].
probability p
Definition 1.3. Given a loss function (cid:96), we define the conditional risk as the
map L : ∆n
∆n
∈
×
−→
R as
L(p, q) :=
(cid:96)(q), p
(cid:105)
(cid:104)
,
and the associated conditional Bayes risk as the map L : ∆n
R given by
−→
L(p) := inf
q∈∆n
L(p, q) = inf
(cid:96)(q), p
(cid:105)
.
q∈∆n(cid:104)
Rn
≥0 is said to be proper if for any
Definition 1.4. A loss function (cid:96) : ∆n
p
∆n
−→
∈
for all q
only minimum of L(p,
∈
(cid:96)(p), p
(cid:104)
∆n. In other words, L(p,
(cid:96)(q), p
(cid:105)
(cid:105) ≤ (cid:104)
) has a minimum at p. When p is the
*
) we say that (cid:96) is strictly proper.
*
For our geometric considerations it will be useful to denote the image of ∆n
under (cid:96) by M(cid:96), and impose enough differentiability conditions on (cid:96) so that M(cid:96)
is (at least) a C 2-manifold. See Definitions 2.1 and 3.1 below.
We now recall the definition of mixability (see for example, Vovk [Vov15,
Rn be the η-exponential projection
vERW12]). For η > 0, let Eη : Rn
defined as
−→
(1.3)
Eη(y) := (e−ηy1, ..., e−ηyn).
A loss function (cid:96) is called η-mixable if the image of its superprediction set,
spr((cid:96)), given by
(1.4)
spr((cid:96)) :=
λ
{
∈
[0,
)n
|
∞
there is q
∈
∆n such that (cid:96)i(q)
λi for i
[n]
,
}
∈
≤
6
CABRERA PACHECO AND WILLIAMSON
is convex under the η-exponential projection, that is Eη(spr((cid:96)))
convex. We say that (cid:96) is mixable if (cid:96) is η-mixable for some η > 0.
⊂
[0, 1]n is
Definition 1.5. Let (cid:96) be a mixable loss function. The mixability constant of
(cid:96), η∗
(cid:96) , is defined as
η∗
(cid:96) := sup
η>0 {
η > 0
(cid:96) is η-mixable
}
.
|
1.4. Motivation. In this part we mainly discuss the case n = 2 since it is
more illustrative.
It has been made evident that there is a strong relation
between properness and mixability. Here we make this relation more explicit
and transparent from a geometric point of view. The basic motivation is as
follows. It is commonly understood that properness is a property that depends
on the parametrization of the boundary of the superprediction set of (cid:96) [Vov15].
It has been also shown that it is related to the "curvature" of the Bayes risk,
since it requires that the superprediction set remains convex under the η-
exponential projection given by (1.3) (with the standard parametrization of
the simplex ∆2) [BSS05, RW10, vERW12]. Mixability is considered to be a
stronger notion of convexity [Vov15], for some η > 0. The basic observation
in this work is that it is possible recast properness from a geometric point of
view, i.e., independent of the parametrization of ∆n. More precisely, we define
properness in terms of the loss function viewed as a map (cid:96) : ∆n
≥0 rather
than in terms of the superprediction set spr((cid:96)) (as it is usually defined). More
precisely, to determine whether a given (cid:96) is proper or not, it is not enough to
look at image (cid:96)(∆n) (as the boundary of spr((cid:96))) but rather how ∆n is mapped
into Rn
≥0 by (cid:96) - since we will be using tools of differential geometry, we will
assume C 2 differentiability (see Section 2). More precisely, restricting first to
n = 2 (see Lemma 2.7 below), a given loss function (cid:96) : ∆2
≥0 will be
(strictly) proper if and only if
−→
−→
Rn
R2
(1) the normal vector to (cid:96)(∆n) at (cid:96)(p) is equal to
and
p
p/
|
|
±
for all p
∈
int(∆2),
(2) the curvature (see Section 1.5 below) at any point (cid:96)(p) with respect to
int(∆2).
is strictly positive for all p
p
the unit normal vector n = p/
|
|
∈
As observed in Figure 2, spr((cid:96)1) = spr((cid:96)2), which implies that their bound-
aries coincide (as a set). In particular, this implies that it is possible to "pa-
rametrize" the boundary of (cid:96)2(∆2), ∂((cid:96)2(∆2)), in the same way as ∂((cid:96)1(∆2))
in order to have a proper loss. However, note that this changes the map (cid:96)2 and
hence from the point of view of this work, this is a different loss function. In
practice, one is given a loss function (cid:96) rather than a superprediction set spr((cid:96)),
THE GEOMETRY OF MIXABILITY
7
Figure 2. Consider the two loss functions given by (cid:96)1(p1, p2) =
log(p2)) and (cid:96)2(p1, p2) = (
(
log(p1)), for
log(p1),
−
−
∆2. Although spr((cid:96)1) = spr((cid:96)2), (cid:96)2 is not proper
p = (p1, p2)
since the normal vector at (cid:96)2(p) is not
for any p
log(p2),
−
∈
∆2.
−
p
p/
|
|
±
∈
therefore we look at losses as individual maps from ∆2 to R2
≥0 instead of look-
ing at their superpredictions sets and obtaining a proper loss by choosing a
convenient parametrization of ∂(spr((cid:96))).
Remark 1.6. Our strength by characterizing proper loss functions in this way
is that we will be able to apply techniques from differential geometry, however,
these considerations only work for loss functions which are sufficiently differ-
entiable. For a general set up, it is possible to characterize properness of a
loss function in a fairly simple way via the convexity of its superprediction set.
More precisely, the "loss surface" is the subgradient of the support function of
the superprediction set. This was thoroughly studied by Williamson and Cranko
in [WC22]. We briefly explore some connections to our work in Section 4. Al-
ternative approaches to extending and better understanding mixability include
[RFWM15] and [MW18].
1.5. Comments about the curvature of planar curves. The second con-
dition for (cid:96) to be proper mentioned above involves a condition on the curva-
ture of (cid:96)(int(∆2)). We now make this notion precise. Recall that if α(t) =
∆2••••l1l28
CABRERA PACHECO AND WILLIAMSON
Figure 3. For a regular curve α, at each point we have two
normal unit vectors.
(x1(t), x2(t)) is a C 2 curve with α(cid:48)(t) = (x(cid:48)
= (0, 0) for all t in its
domain, then its curvature can be seen a measurement of the variation of its
unit normal vector at each point. We define the canonical normal vector at
α(t), nc(t), as the unit normal vector in the direction obtained by rotating
α(cid:48)(t) 90◦ counterclockwise. Then, the signed curvature of κ at t is defined as
1(t), x(cid:48)
2(t))
.
±
2(t)
(1.5)
κα(t) :=
1(t)x(cid:48)
x(cid:48)(cid:48)
(x(cid:48)
x(cid:48)
1(t)x(cid:48)(cid:48)
2(t)
−
2(t)2)3/2
1(t)2 + x(cid:48)
The interpretation of this number is as follows: κα(t) is positive if α "curves"
in the direction of nc(t). However, note that at each point we have two normal
nc(t). Thus, nc(t) and κα depend on the direction of α (i.e., α(cid:48)), and
vectors:
their values differ by a negative sign. Thus, we can talk about the curvature
of α with respect to a chosen unit vector n (either choosing nc or
nc for
all points, assuming this is possible, which is the case for the curves we will
α . In the case when n = nc,
consider here, see Figure 3) and denote it by κ+
nc, then κ+
then κ+
κα. Since κα is invariant
α =
under reparametrizations (up to a sign), we can simply talk at the curvature
of α at a given point p in the image of α. In Section 2 we make precise our
choice in (2) above. For a summary of geometry of curves see Appendix A.
α = κα, and when n =
−
−
−
Going back to loss functions, suppose (cid:96) : ∆2
≥0 is a loss function.
Since ∆2 is a 1-manifold, any parametrization around a point (of its interior)
∆2 for some a < b. Thus,
can be assumed to be of the form Φ : (a, b)
Φ is a curve in
the local expression of (cid:96) under this parametrization
R2. By changing Φ around the same point, we are reparametrizing
(cid:96). Since
curvature is independent of coordinates (i.e., of the Φ used) up to a sign, we
can define the curvature of the loss curve (cid:96)(int(∆2)) with respect to a chosen
(cid:96) = (cid:96)
−→
−→
R2
⊂
R
(cid:101)
◦
(cid:101)
•−ncncα′•nc−ncα′(cid:54)
THE GEOMETRY OF MIXABILITY
9
unit normal vector (which will depend only on (cid:96)). To compute it from its
definition in (1.5), we need to choose a parametrization Φ, and as we will see,
many times it is convenient to take Φ = Φstd.
Remark 1.7. One could avoid part of the technical complications above by
choosing beforehand Φ = Φstd, as it is usually implicitly done, and then requir-
ing (cid:96)1 and (cid:96)2 to be monotone (cf. [BSS05, RW10, SAM66, Vov15]) – essentially,
this amounts to choosing "direction" for the admissible loss curves. Although
this approach is appealing since the curve parameter (t in our case) can be
directly interpreted as a probability, and moreover it simplifies calculations
since in this case the convention can be chosen so that the signed curvature
coincide with κ+ (see for example [Vov15]), when considering the multi-class
case, the notion of "direction" breaks down and it is not clear which properties
of M(cid:96) = (cid:96)(∆n) one should consider. The approach we consider here gives a
concrete logical path to a generalization to the multi-class case (see Section 3).
1.6. Reconciling this point of view with previous works. In this part
we explain how to "translate" the results we obtain here to previous results
regarding proper losses and mixability. We do this in particular with [RW10]
and [Vov15].
•
•
(cid:98)
(cid:101)
(cid:98)
η) and (cid:96)−1(
η in [RW10]
η) correspond to
(cid:96)2(t), respectively. Although the regularity assumption in [RW10]
(cid:98)
Reid–Williamson [RW10]. Let Φ = Φstd. The parameter
corresponds to the parameter t here, (cid:96)1(
(cid:96)1(t) and
is initially only differentiability of the partial losses, when discussing
the weight of a loss function they impose C 2 regularity. From Theo-
(cid:101)
rem 1 in [RW10], we see that a loss (cid:96) is proper if (in particular) (cid:96)(cid:48)
−1 > 0
and (cid:96)(cid:48)
0 < 0. We can heuristically say that (cid:96) goes from "right" to "left".
This means that in this case, κ+
(cid:96) (
η). The log loss in this case
η),
is (cid:96)log(
η)).
ln(
−
In [Vov15] the loss functions are defined as maps
Vovk [Vov15].
(cid:98)
(λ0(p), λ1(p)), with λ0 increasing and λ1 decreasing (infinite differ-
entiable). In this case, heuristically, losses go from "left" to "right"
so that κ+
λ (p) = κλ(p). To relate this convention to ours, we set
t, t). Then the parameter p in [Vov15] corresponds to
Φ(t) = (1
t and λ0 and λ1 correspond to
(cid:96)2. The log loss is then given by
ln(p)).
λ(p) = (
(cid:96)1 and
η) = (
η) =
ln(1
ln(1
κ(cid:96)(
p),
−
−
−
−
(cid:98)
(cid:98)
(cid:98)
(cid:98)
−
−
−
(cid:101)
Therefore, from our point of view, in previous works there is an implicit
choice of a parametrization of ∆2, particularly motivated to interpret the pa-
rameter as a probability. However, it is well known that sometimes this might
not be the case and a link function is needed [RW10] – this fits well with our
approach as a link function for us is a different choice of parametrization; this
will carefully explained in Section 2.7. In favor of the study of loss functions
(cid:101)
10
CABRERA PACHECO AND WILLIAMSON
using tools from differential geometry we are then motivated to eliminate this
choice of parametrization and consider (cid:96) as a map between manifolds (namely,
int(∆2) and (cid:96)(int(∆2)) as a submanifold of R2). Although picking a gen-
eral parametrization of ∆2 complicates the interpretation of the parameter, it
makes other properties of loss functions transparent. This approach has, to
the knowledge of the authors, never been explored. We remark that, however,
one can always set Φ = Φstd and reinterpret the results of this work as the
parameter being a probability. With this geometric characterization of loss
functions and properness at hand we continue to study mixability.
2. Properness and Mixability for Binary Classification
|
∈
−
⊂
R2
R2
(p1, p2)
{
≥0, where ∆2 =
Φ) is a map from some interval I
We first restrict our discussion to binary classification, i.e., setting n = 2.
Thus, we consider maps (cid:96) : ∆2
p1 + p2 =
−→
, with partial losses (cid:96)1(p) and (cid:96)2(p). In this case the standard parametriza-
1
}
tion of ∆2 is given by Φstd(t) = (t, 1
[0, 1]. When a parametrization
t) for t
∈
of ∆2, say Φ, is chosen, then the local expression of (cid:96) with respect to Φ
R to R2, that is, a curve in the
(
(cid:96) = (cid:96)
◦
plane R2.
Dating back to [HKW95, Vov98] it has been established that properness of
(cid:101)
a loss function imposes strong conditions on the first and second derivatives of
their partial losses. In [Vov15] these relations were expressed by means of the
curvature of the loss curve. Moreover, in [BSS05, RW10] properness is related
to the second derivative of its Bayes risk, which in a way can be interpreted
as its curvature. However, in these works there is always an implicit choice
of parametrization of ∆2, which in turn imposes certain restrictions on the
"admissible" loss functions, particularly making the results parametrization
dependent.
In this section, we first recast properness as a geometric prop-
erty which allows us to obtain results in a parametrization (or coordinate)
independent way.
Definition 2.1. An admissible loss function is a map (cid:96) : ∆2
that
−→
R2
≥0 such
(i) (cid:96)(int(∆2))
≥0 is a 1-manifold of class C 2,
(ii) there exists a differentiable map n : (cid:96)(int(∆2))
R2
⊂
n(cid:96)(p), where N (cid:96)(∆2) is the normal space of (cid:96)(∆2), and
n(p) belongs to R2
(iii) n(p) or
We denote the set of admissible loss functions as
>0 for all p
−
∈
→
int(∆2).
.
L
N (cid:96)(int(∆2)), n((cid:96)(p)) =
Remark 2.2. We give the following interpretation of the previous definition.
(i) simply says that the loss curve (once parametrized) is twice differentiable
(ii) prevents some "anomalies"
with continuous second partial derivatives.
on (cid:96), for example, (cid:96) can not be constant on a neighborhood of a point. (iii)
THE GEOMETRY OF MIXABILITY
11
defines a subfamily of loss curves which are not allowed to vary "too much".
This definition should be compared to the definition of loss functions in Section
2 in [Vov15].
∈ L
. Let n : (cid:96)(int(∆2))
N (cid:96)(int(∆2)) be the map
Definition 2.3. Let (cid:96)
that assigns to each (cid:96)(p) the normal vector to M(cid:96) at (cid:96)(p) that lies in R2
≥0.
We denote by κ+
) the signed curvature of α with respect to the unit normal
α (
*
≥0. We refer to κ+
belonging to R2
) as the curvature with respect to the unit
α (
*
normal vector pointing towards R2
≥0.
2.1. Proper losses.
→
L
Lemma 2.4. Suppose that (cid:96) in
is strictly proper, then the signed curvature
of the loss curve (cid:96)(∆2) has a sign. Moreover, its curvature, κ(cid:96), is positive with
respect to unit normal vector (field) pointing towards R2
Proof. Let p0
∈
around p0 = Φ(t0), for some t0
of ∆2
∆2 be a parametrization of ∆2
I, which we use to obtain a parametrization
∆2 around (p0, p0)1. We consider the local expression of L given by
int(∆2) and let Φ : I
−→
≥0.
⊂
R
∈
×
L(t, s) =
.
(cid:96)(Φ(s)), Φ(t)
(cid:105)
(cid:104)
Using strict properness we know that fixing t, the function
minimum at s = t (and it is the only one), that is
(cid:101)
L(t,
) achieves a
*
(2.2)
(2.1)
0 = ∂s
(cid:96)(cid:48)(t), Φ(t)
s=t =
L(t, s)
|
(cid:104)
s=t =
L(t, s)
0 < ∂ss
(cid:101)
|
(cid:105)
(cid:96)(cid:48)(cid:48)(t), Φ(t)
(cid:101)
(cid:105)
(cid:104)
To compute the sign of the signed curvature of (cid:96)(∆2) it is enough to deter-
(cid:96)(cid:48)
2(t). Without loss of generality, assuming
(cid:101)
(cid:96)(cid:48)
(cid:96)(cid:48)
1(t)Φ1(t) +
2(t)Φ2(t),
(cid:96)(cid:48)(cid:48)
(cid:96)(cid:48)(cid:48)
2(t)Φ2(t).
1(t)Φ1(t) +
=
(cid:101)
(cid:101)
(cid:101)
(cid:96)(cid:48)
1(t)
(cid:101)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:96)(cid:48)(cid:48)
2(t)
=
(cid:101)
(cid:101)
−
= 0 on this coordinate neighborhood we can write
mine the sign of
Φ2
(cid:101)
(cid:96)(cid:48)(cid:48)
2(t)
(cid:96)(cid:48)
1(t)
(cid:101)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:101)
(cid:101)
(cid:96)(cid:48)
(cid:96)(cid:48)
2(t) =
1(t)
−
(cid:101)
(cid:101)
(cid:101)
(cid:101)
=
=
(cid:96)(cid:48)(cid:48)
2(t)
(cid:96)(cid:48)(cid:48)
1(t)
−
(cid:34)−
(cid:101)
(cid:96)(cid:48)(cid:48)
2(t)Φ2(t) +
(cid:101)
(cid:96)(cid:48)(cid:48)(t), Φ(t)
(cid:105)
(cid:104)
(cid:101)
(cid:101)
(cid:96)(cid:48)
1(t)
Φ2(t)
(cid:101)
(cid:96)(cid:48)
1(t)
Φ2(t)
(cid:101)
(cid:104)
(cid:96)(cid:48)
1(t)Φ1(t)
Φ2(t) (cid:35)
(cid:101)
(cid:96)(cid:48)(cid:48)
1(t)Φ1(t)
(cid:105)
(cid:101)
> 0,
(cid:104)
(cid:105)
(cid:96)(cid:48)
1(t) = 0 for some t then
where we have used (2.1) and (2.2). Notice that if
(cid:96)(cid:48)
(cid:96)(cid:48)
necessarily
1 has a
2(t) = 0 by (2.1), which is impossible in
sign and this sign determines the sign of the signed curvature of (cid:96)(∆2).
(cid:101)
(cid:101)
1Notice that this particular choice of coordinates around (p0, p0) suffices since we want to
conclude something about the curvature of the curve loss (cid:96).
. Therefore
L
(cid:101)
(cid:101)
(cid:54)
12
CABRERA PACHECO AND WILLIAMSON
(cid:96)(cid:48)
1 and
For the second statement, notice that again using (2.1) we know that
(cid:96)(cid:48)
(cid:96)(cid:48)
1 > 0, then that means
2 have different signs (and they do not change). If
that the first coordinate increases and the second decreases, hence n(t) points
towards R2
(cid:96)(cid:48)
1 < 0, then we are in the opposite case and in this
(cid:101)
(cid:101)
case n(t) points to R2
(cid:101)(cid:96) < 0, thus the signed curvature with respect to
≥0 and κ
(cid:3)
(cid:101)
n(t) (the unit normal pointing towards R2
From the proof of the previous theorem we obtain the following corollary.
≥0) is positive.
(cid:101)(cid:96) > 0. If
≥0 and κ
−
(cid:101)
Corollary 2.5. Let (cid:96)
loss curve (cid:96)(∆2) at (cid:96)(p).
∈ L
. If (cid:96) is proper, then p
int(∆2) is normal to the
∈
Proof. It follows directly from (2.1), since for fixed p
a minimum at p.
∈
int(∆2),
(cid:96)(q), p
(cid:105)
(cid:104)
attains
(cid:3)
Lemma 2.6. In
, proper implies strictly proper.
L
Proof. Let p
∈
int(∆2), and suppose that there is p∗
= p in int(∆2), such that
(cid:96)(p∗), p
(cid:105)
(cid:104)
= inf
q∈∆2(cid:104)
(cid:96)(q), p
(cid:105)
.
Using (2.1), we see that p∗ is normal to (cid:96) at (cid:96)(p), and hence p and p∗ are parallel.
Since both belong to ∆2, it follows that p∗ = p, which is a contradiction. (cid:3)
Therefore, in what follows (as long as we stay within
and strictly proper interchangeably.
) we will use proper
L
Note that the converse of Lemma 2.4 does not hold. That is, there are (cid:96)
∈ L
which have positive signed curvature (with respect to the unit normal pointing
towards R2
≥0), but are not proper. Indeed let (cid:96) be defined as
ln(p2),
(cid:96)(p) = (
ln(p1)).
Taking the (standard) parametrization Φstd(t) = (t, 1
(cid:96) goes from left to right so n
curve
readily see that the (signed) curvature κ
normal to
−
(cid:101)(cid:96)(t) points towards R2
t) we see that the loss
≥0. Moreover, we can
(cid:101)(cid:96) is positive. However, Φstd(t) is not
(cid:96)(t), thus by Corollary 2.5, (cid:96) can not be proper.
(cid:96) at
−
−
(cid:101)
Therefore, we obtain the following characterization of proper losses in
(cid:101)
(cid:101)
Lemma 2.7. Let (cid:96)
loss curve (cid:96)(∆2) at (cid:96)(p) for all p
with respect to the normal vector pointing towards R2
(cid:96)(p) for p
. (cid:96) is strictly proper if and only if p is normal to the
int(∆2) and the signed curvature of (cid:96)(∆2)
≥0 is positive at all points
int(∆2).
∈ L
∈
.
L
∈
Proof. The "if" part is Lemma 2.4. For the "only if" part, let (cid:96)
that
be such
∈ L
(2.3)
np =
±
p
p
|
,
|
(cid:54)
THE GEOMETRY OF MIXABILITY
13
(2.4)
κ+
(cid:96) > 0,
where κ+
(cid:96)
towards R2
readily see that (2.3) implies that
is the signed curvature of (cid:96) with respect to the unit normal pointing
int(∆2) and let Φ be a parametrization around p. We
≥0. Let p
∈
∂s
s=t = 0,
L(t, s)
|
while (2.4) implies ∂ss
that fixing t,
Lemma 2.6, we conclude it is strictly proper.
(cid:101)
s=t > 0 by the proof of Lemma 2.4. This implies
|
L achieves its minimum at s = t. Then (cid:96) is proper and by
(cid:3)
L(t, s)
(cid:101)
(cid:101)
Remark 2.8. Notice that to check whether a given loss function (cid:96)
is
proper or not, it suffices to do it in any coordinate system. That is, given Φ,
we check conditions (2.3) and (2.4) for
(cid:96) = (cid:96)
∈ L
Φ.
◦
2.2. Mixable loss functions. We say that a loss function (cid:96) is fair if (cid:96)1(p)
as p
tation when using the standard parametrization, see [RW10]).
recall that a loss function (cid:96)
0
(1, 0) (this is motivated by the interpre-
In addition,
is proper if and only if
(0, 1) and (cid:96)2(p)
0 as p
→
→
→
→
(cid:101)
|p| can be chosen, and
∈ L
(i) n(cid:96)(p) = p
(ii) κ+
(cid:96) (p) > 0
for all p
int(∆2).
∈
Thus, a prototype of a fair proper loss function is shown in Figure 4.
Figure 4. Prototype of a mixable fair proper loss function.
))n()∆2••lΦ(a,b)⊂Rel=l◦Φ14
CABRERA PACHECO AND WILLIAMSON
Figure 5. Diagram depicting how convexity of Eη(spr((cid:96))) is
characterized by the principal curvatures of Eη
(cid:96)(int(∆2)).
◦
Recall from Section 1 that mixability is defined in terms of the superpredic-
tion set spr((cid:96)) of (cid:96). More precisely, for η > 0, consider the set
Eη(y1, y2) =
e−ηy1, e−ηy2
,
where Eη : R2
mixable if and only if Eη(spr((cid:96))) is convex.
≥0 −→
(cid:0)
[0, 1]2 is the exponential projection (1.3). Then, (cid:96) is η-
(cid:1)
Remark 2.9. We stress the fact that this definition depends on the superpre-
diction set of (cid:96) rather than on (cid:96) itself – two different loss functions with the
same superprediction set will be equally mixable. From our perspective, when
talking about mixability of the map (cid:96) (i.e., without making reference to the su-
perprediction set), we see that we can define it as follows. A loss (cid:96) is mixable
0.
if the 1-dimensional manifold Eη
We will adopt the latter version here. Although clearly these definitions are
equivalent, it is useful to have this at hand to relate mixability with properness.
For now on, when we say (cid:96) is mixable we mean in the latter way. See Figure 5.
(cid:96)(int(∆2)) has signed curvature κ+
Eη◦(cid:96) ≤
◦
Sln∆2••lΦ(a,b)⊂RelEηEη(Sl)(0,1)(0,0)(1,0)THE GEOMETRY OF MIXABILITY
15
We close this part by describing the log loss, which will play an important
role. Let (cid:96)log : ∆2
(2.5)
−→
Let Φ = Φstd. Then
R2, given by
(cid:96)log(p) = (
−
ln(p1),
−
ln(p2)) .
Since
(cid:96)(cid:48)
log(t) = (
(cid:101)
−
t−1, (1
(cid:101)
−
(cid:101)(cid:96)log(t) =
n
(cid:96)log(t) = (
ln(t),
ln(1
t)) .
−
−
−
t)−1), its canonical normal vector is
1
t2 + (1
−
(1
−
t)2
t)−1, t−1
.
The curvature with respect to
(cid:112)
R2
≥0, is then given by
n
−
−
(cid:0)
(cid:101)(cid:96)log(t), the normal vector pointing towards
(cid:1)
(2.6)
κ+
(cid:101)(cid:96)log
=
κ
(cid:101)(cid:96)log
=
−
t(1
(t2 + (1
t)
t)2)3/2 > 0.
−
−
When there is no risk of confusion with denote κ+
(cid:101)(cid:96)log
simply as κ+
log.
2.3. Mixability and curvature. Haussler, Kivinen and Warmuth in [HKW95]
gave a characterization of the mixability constant of a mixable proper binary
loss function (cid:96) in terms of the first and second derivatives of its partial losses.
We reprove this characterization from a geometric point of view, that is, inde-
pendent of the parametrization chosen for ∆n.
∈ L
Let (cid:96)
be proper and Φ a 1-chart parametrization2 of ∆2, then Eη(spr((cid:96)))
will be convex if and only if the curve γ(t) = E((cid:96)(Φ(t))) has negative curvature
with respect to the unit normal pointing towards R2
≥0. Since (cid:96) is proper we
can assume without loss of generality that κ(cid:96)(p) = κ+
(cid:96) (p) > 0. We are then
interested in computing the signed curvature of
g(t) = (g1(t), g2(t)) =
E(
(cid:96)1(t)), E(
(cid:96)2(t))
=
e−η(cid:101)(cid:96)1(t), e−η(cid:101)(cid:96)2(t)
,
and showing that κg
(cid:16)
0. We have
(cid:101)
(cid:17)
(cid:16)
(cid:101)
(cid:17)
≥
g(cid:48)
1(t) =
g(cid:48)(cid:48)
1 (t) =
η
−
1(t)e−η(cid:101)(cid:96)1(t)
(cid:96)(cid:48)
1(t)e−η(cid:101)(cid:96)1(t) + η2
(cid:96)(cid:48)(cid:48)
(cid:101)
1(t)2
(cid:96)(cid:48)
= ηe−η(cid:101)(cid:96)1(t)
(cid:101)
−
η
η
−
1(t)2e−η(cid:101)(cid:96)1(t)
(cid:96)(cid:48)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:101)
(cid:105)
(cid:101)
and
(cid:104)
η
−
2This means that the map Φ : D
g(cid:48)
2(t) =
(cid:101)
2(t)e−η(cid:101)(cid:96)2(t)
(cid:96)(cid:48)
∆2 is such that Φ(D) = ∆2.
(cid:101)
−→
16
CABRERA PACHECO AND WILLIAMSON
g(cid:48)(cid:48)
2 (t) =
η
−
2(t)e−η(cid:101)(cid:96)2(t) + η2
(cid:96)(cid:48)(cid:48)
2(t)2
(cid:96)(cid:48)
η
2(t)2e−η(cid:101)(cid:96)2(t)
(cid:96)(cid:48)
(cid:96)(cid:48)(cid:48)
2(t)
(cid:101)
,
= ηe−η(cid:101)(cid:96)2(t)
(cid:101)
−
(cid:104)
(cid:101)
(cid:105)
(cid:101)
and thus we have
3/2 κg(t)
2(t)2
1(t)2 + g(cid:48)
g(cid:48)
1(t)e−η(cid:101)(cid:96)1(t)ηe−η(cid:101)(cid:96)2(t)
(cid:96)(cid:48)
=
η
(cid:1)
(cid:0)
−
ηe−η(cid:101)(cid:96)1(t)
(cid:101)
−
=η2e−η(cid:101)(cid:96)1(t)e−η(cid:101)(cid:96)2(t)
η
2(t)2
(cid:96)(cid:48)
−
(cid:96)(cid:48)
2(t)
(cid:105)
2(t)e−η(cid:101)(cid:96)0(t)
(cid:96)(cid:48)
η
(cid:101)
−
(cid:105) (cid:16)
2(t)2 +
(cid:96)(cid:48)
(cid:96)(cid:48)
1(t)η
(cid:101)
(cid:104)
−
(cid:96)(cid:48)(cid:48)
2(t)
η
1(t)2
(cid:96)(cid:48)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:101)
(cid:104)
(cid:104)
(cid:96)(cid:48)
1(t)
(cid:101)
(cid:101)
−
(cid:96)(cid:48)
(cid:96)(cid:48)
(cid:96)(cid:48)
1(t)
1(t)(
2(t)
η
(cid:101)
(cid:101)
(cid:101)
(cid:17)
1(t)2
(cid:96)(cid:48)
(cid:96)(cid:48)
2(t)η
−
(cid:96)(cid:48)
2(t)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:105)
(cid:96)(cid:48)(cid:48)
(cid:96)(cid:48)
2(t)
1(t)
(cid:101)
=η2e−η(cid:101)(cid:96)1(t)e−η(cid:101)(cid:96)2(t)
(cid:96)(cid:48)
2(t)) +
(cid:101)
(cid:101)
−
(cid:105)(cid:105)
(cid:104)
(cid:104)
(cid:96)(cid:48)(cid:48)
(cid:96)(cid:48)
(cid:96)(cid:48)(cid:48)
(cid:96)(cid:48)
(cid:101)(cid:96) is positive,
1(t) is the sign of κ
2(t)
2(t)
1(t)
Note that the sign of
(cid:101)
(cid:101)
(cid:101)
(cid:101)
(cid:101)
(cid:96)(cid:48)
(cid:96)(cid:48)
2(t) < 0, thus the first term in brackets
1(t) > 0 and
then one can check that
(cid:101)
(cid:101)
(cid:101)
is necessarily negative. Thus by making η large κg(t) will become negative.
Then we want
(cid:101)
(cid:101)
(cid:96)(cid:48)
1(t)
−
(cid:101)(cid:96). If κ
(cid:101)
(cid:96)(cid:48)
2(t)) +
(cid:96)(cid:48)
1(t)(
(cid:96)(cid:48)(cid:48)
1(t)
(cid:101)
(cid:96)(cid:48)
2(t)
(cid:101)
(cid:96)(cid:48)(cid:48)
2(t)
(cid:96)(cid:48)
1(t)
(cid:96)(cid:48)
2(t)
(cid:96)(cid:48)
2(t)
(cid:101)
−
0,
(cid:101)
(cid:101)
η
.
that is,
(cid:101)
(cid:101)
(cid:101)
η
≤
−
(cid:96)(cid:48)(cid:48)
1(t)
(cid:105)
≥
−
(cid:104)
(cid:101)
(cid:101)
(cid:101)
(cid:101)
(cid:101)
(cid:96)(cid:48)
(cid:96)(cid:48)
(cid:96)(cid:48)(cid:48)
1(t)
2(t)
2(t)
−
(cid:96)(cid:48)
(cid:96)(cid:48)
(cid:96)(cid:48)
1(t)
1(t))(
2(t)
(cid:101)
(cid:101)
(cid:101)
−
(cid:101)
(
−
(cid:96)(cid:48)(cid:48)
1(t)
(cid:96)(cid:48)
2(t))
.
When considering the case when the signed curvature is negative, we have:
(cid:101)
is a proper loss function. Then, if (cid:96) is
Lemma 2.10. Suppose that (cid:96)
mixable, for any 1-chart parametrization Φ of ∆2, the mixability constant is
given by
(cid:101)
∈ L
(cid:101)
(cid:101)
η∗
(cid:96) =
(cid:96)(cid:48)
(cid:96)(cid:48)(cid:48)
1(t)
2(t)
(cid:96)(cid:48)
(cid:96)(cid:48)
2(t)(
1(t)
(cid:101)
(cid:101)
(cid:96)(cid:48)
2(t)
−
(cid:96)(cid:48)
1(t)
(cid:101)
−
(2.7)
inf
t∈Φ−1(int(∆2)) (cid:12)
(cid:12)
(cid:12)
Conversely, if (2.7) holds, then (cid:96) is mixable with mixability constant η∗
(cid:96) .
(cid:12)
(cid:101)
(cid:12)
(cid:101)
By the local nature of curvature, it would be possible to consider a "local
version" of Lemma 2.10, which would characterize a "local" notion of mixa-
bility. This alternative will not be pursued here.
(cid:101)
.
(cid:96)(cid:48)(cid:48)
1(t)
(cid:96)(cid:48)
2(t))(cid:12)
(cid:12)
(cid:101)
(cid:12)
(cid:12)
(cid:12)
(cid:101)
In [Vov15], Vovk observes that mixability for proper losses is equivalent
to a quotient of curvatures being bounded away from zero. For the reader's
convenience we prove this statement. To recover Vovk's statement observe that
the properties he imposes on the loss functions imply that κ+ is the signed
curvature (see Section 1.6).
THE GEOMETRY OF MIXABILITY
17
Lemma 2.11. A proper loss function (cid:96)
is mixable if and only if
∈ L
> 0,
inf
p
κ+
(cid:96) (p)
κ+
log(p)
where κ+
log denotes the curvature of (cid:96)log. Moreover, when this holds,
η∗
(cid:96) = inf
p
κ+
(cid:96) (p)
κ+
log(p)
> 0,
Proof. By Lemma 2.10, (cid:96) is proper with mixability constant η∗
if
(cid:96) > 0 if and only
η∗
(cid:96) =
(cid:96)(cid:48)(cid:48)
(cid:96)(cid:48)
2(t)
1(t)
(cid:96)(cid:48)
(cid:96)(cid:48)
1(t)(
2(t)
(cid:101)
(cid:101)
for any given 1-chart parametrization Φ. Setting Φ = Φstd and using (2.6), we
(cid:101)
Φ−1(int(∆2)),
have the following. For any t
inf
t∈Φ−1(int(∆2)) (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:96)(cid:48)
2(t))(cid:12)
(cid:12)
(cid:101)
(cid:12)
(cid:12)
(cid:12)
(cid:96)(cid:48)
2(t)
−
(cid:96)(cid:48)
1(t)
(cid:101)
−
(cid:101)
(cid:101)
(cid:101)
,
∈
1(t)2 +
(cid:96)(cid:48)
2(t)2
(cid:96)(cid:48)
3/2
1
(1−t)2 + 1
t2
1
t2
1
(1−t)2
3/2
(cid:17)
1
1
t2
(1−t)2
(cid:96)(cid:48)
1(t)
(cid:96)(cid:48)
2(t)
|
(cid:96)(cid:48)
1(t)(
(cid:96)(cid:48)
2(t))
|
−
(cid:17)
3/2 (cid:16)
(cid:17)
1
1
t2
(1−t)2
(cid:96)(cid:48)
1(t)
(cid:96)(cid:48)
1(t)(
(cid:101)
(cid:101)
(cid:101)
(cid:101)
(cid:96)(cid:48)
2(t))
|
−
(cid:96)(cid:48)(cid:48)
(cid:96)(cid:48)
1(t)
2(t)
(cid:96)(cid:48)
(cid:96)(cid:48)
1(t)(
2(t)
(cid:101)
(cid:101)
(cid:96)(cid:48)(cid:48)
(cid:96)(cid:48)
2(t)
1(t)
(cid:101)
(cid:101)
(cid:96)(cid:48)
2(t)
−
(cid:96)(cid:48)
1(t)
(cid:101)
(cid:96)(cid:48)
2(t)
−
(cid:101)
−
(cid:96)(cid:48)
(cid:96)(cid:48)
2(t)2
1(t)2 +
(cid:101)
(cid:101)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:96)(cid:48)
2(t))(cid:12)
(cid:12)
(cid:101)
(cid:12)
(cid:12)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:101)
(cid:12)
3/2 (cid:12)
(cid:16)
(cid:12)
(cid:12)
(cid:101)
(cid:12)
(cid:12)
(cid:17)
(cid:12)
2(t)2
(cid:96)(cid:48)
(cid:12)
t2 (cid:33)
(t)
(cid:101)
(t) (cid:32)
1(t)2 +
(cid:96)(cid:48)
(cid:101)
(1−t)2 + 1
1
(cid:101)
1(t)2
(cid:96)(cid:48)
(cid:101)
1 + t2
(1−t)2
(t)
(t)
(cid:101)
t2+(1−t)2
(cid:16)
t2(1−t)2
,
(t)
(t)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
= (cid:12)
(cid:12)
(cid:12)
(cid:101)
(cid:12)
(cid:12)
(cid:16)
κ+
(cid:12)
(cid:12)
(cid:101)(cid:96)
κ+
(cid:101)(cid:96)log
=
=
=
κ+
(cid:101)(cid:96)
κ+
(cid:101)(cid:96)log
κ+
(cid:101)(cid:96)
κ+
(cid:101)(cid:96)log
1
(1−t)2 + 1
t2
(cid:101)
(cid:101)
(cid:16)
3/2
(cid:96)(cid:48)
2(t)
|
3/2
(cid:101)
(cid:101)
(cid:17)
t
1−t
|
1
t2
1
(cid:101)
(cid:101)
(1−t)2
1(t)3(1 + t
(cid:96)(cid:48)
1−t)
|
(cid:101)
where we used that by properness
(cid:96)(cid:48)
2(t) =
t
1−t
(cid:96)(cid:48)
1(t) (see (2.1)).
−
Since κ+ is independent of the parametrization, we obtain the result.
(cid:3)
(cid:101)
(cid:101)
Remark 2.12. Lemma 2.11 exemplifies the usefulness of Φstd. The curvature
of (cid:96)log is easily computed with respect to the standard parametrization, by fixing
Φ = Φstd we can easily recognize when the curvature of (cid:96)log appears in our
computation. However, since curvature is a geometric quantity we know this
relation between curvatures will hold for any parametrization too.
18
CABRERA PACHECO AND WILLIAMSON
Using this point of view, the following observations enlighten why the weight
function in [BSS05] and in [RW10] basically encodes all the relevant informa-
tion in the binary case. Recall that given a proper loss function (cid:96), the weight
of (cid:96) (with respect to a local parametrization Φ of ∆2) is defined as
(2.8)
w(cid:96)Φ(t) =
(cid:96)(cid:48)
1(t)
Φ2(t)(cid:12)
(cid:12)
(cid:101)
(cid:12)
We stress that the weight depends on the coordinates Φ of ∆ that we use, and
(cid:12)
(cid:12)
hence we use the notation (cid:96)Φ. As observed in Remark 2.12, we sometimes set
Φ = Φstd (as it is done in [BSS05, RW10]) to be able to recognize some terms.
(cid:96)(cid:48)
2(t)
Φ1(t)(cid:12)
(cid:12)
(cid:101)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
=
.
be a proper loss and Φ a local parametrization of ∆2,
(cid:96)Φ its local expression and by w(cid:96)Φ be its weight. Then we have for
∈ L
Lemma 2.13. Let (cid:96)
denote by
any t
Φ−1(int(∆2)),
∈
(cid:101)
k+
(cid:101)(cid:96)Φ
(t) =
1
w(cid:96)Φ(t) |
Φ(cid:48)
1(t)
|
1
Φ1(t)2 + Φ2(t)2
3/2
(cid:19)
(cid:18)
and moreover, if λ is another proper loss,
(2.9)
κ+
(cid:101)(cid:96)Φ
κ+
(cid:101)λΦ
(t)
(t)
=
wλΦ(t)
(t)
w
(cid:101)(cid:96)Φ
.
In particular, when Φ = Φstd,
k+
(cid:101)(cid:96)std
(t) =
1
w(cid:96)std(t)
(t)
(2.10)
and if in addition, λ = (cid:96)log (with Φ = Φstd),
k+
(cid:101)(cid:96)std
κ+
(cid:101)(cid:96)log
R2
Proof. Let (cid:96) : ∆2
of ∆2 around p. Let us compute κ+
(cid:101)(cid:96)Φ
1
w(cid:96)std(t)
−→
t(1
(t)
−
=
1
1
t2 + (1
3/2
.
t)2
(cid:19)
−
(cid:18)
=
t)
w(cid:96)log(t)
w(cid:96)std(t)
.
≥2 be a proper loss and let Φ be any parametrization
(assuming w.l.o.g. that κ+
, which
(cid:101)(cid:96)Φ
= κ
(cid:101)(cid:96)Φ
means
(cid:96)(cid:48)
1 > 0 and Φ(cid:48)
(cid:96)(cid:48)
(cid:96)(cid:48)(cid:48)
1(t)
2(t)
1 < 0).
(cid:96)(cid:48)(cid:48)
1(t)
−
(cid:96)(cid:48)
(cid:96)(cid:48)
1(t)2
2(t)2 +
(cid:101)
(cid:101)
κ+
(cid:101)(cid:96)Φ
(t) =
(cid:101)
(cid:96)(cid:48)
2(t)
3/2
=
=
(cid:101)
(cid:16)
(cid:101)
(cid:96)(cid:48)
1(t)
(cid:101)
(cid:96)(cid:48)(cid:48)
2(t) +
(cid:18)
(cid:96)(cid:48)
1(t)
(cid:101)
Φ2(t)
(cid:101)
1
(cid:101)
(cid:96)(cid:48)
1(t)3
(cid:16)
(cid:101)
(cid:101)
(cid:17)
(cid:96)(cid:48)(cid:48)
1(t)
(cid:96)(cid:48)
1(t)
Φ1(t)
Φ2(t)
Φ1(t)2
Φ2(t)2
(cid:101)
(cid:101)
(cid:96)(cid:48)(cid:48)
1(t) + Φ2(t)
Φ1(t)
(cid:19) (cid:18)
(cid:96)(cid:48)(cid:48)
2(t)
−3/2
1(t)2 +
(cid:96)(cid:48)
1(t)2
(cid:96)(cid:48)
Φ1(t)2
(cid:101)
(cid:101)
Φ2(t)2 + 1
(cid:17) (cid:18)
(cid:19)
−3/2
(cid:19)
(cid:101)
(cid:101)
THE GEOMETRY OF MIXABILITY
19
Φ(cid:48)
1(t)
1(t) + Φ(cid:48)
(cid:96)(cid:48)
2(t)
(cid:96)(cid:48)
2(t)
(cid:101)
(cid:96)(cid:48)
1(t)
1(t)
Φ(cid:48)
Φ(cid:48)
(cid:101)
Φ1(t)
2(t)
Φ2(t)
−
Φ(cid:48)
1(t)
(cid:101)
−
Φ(cid:48)
2(t)
Φ1(t)
Φ2(t)
Φ(cid:48)
1(t)Φ2(t)
Φ(cid:48)
−
Φ2(t)
−3/2
Φ1(t)2
Φ2(t)2 + 1
(cid:19)
Φ1(t)2
Φ2(t)2 + 1
(cid:17) (cid:18)
(cid:96)(cid:48)
1(t)
(cid:101)
(cid:19) (cid:18)
Φ1(t)2 + Φ2(t)2
Φ2(t)2
(cid:19)
−3/2
−3/2
(cid:19) (cid:18)
2(t)Φ1(t)
(cid:19)
Φ2(t)2
Φ1(t)2 + Φ2(t)2
3/2
(cid:19)
(cid:19) (cid:18)
1(t)Φ2(t)
Φ(cid:48)
2(t)Φ1(t))
−
(cid:18)
1
Φ1(t)2 + Φ2(t)2
(cid:19)
3/2
3/2
(Φ(cid:48)
1(t)Φ2(t) + Φ(cid:48)
1(t)Φ1(t))
1
Φ1(t)2 + Φ2(t)2
(cid:18)
1
Φ1(t)2 + Φ2(t)2
(cid:19)
3/2
,
(cid:19)
(
−
Φ(cid:48)
1(t)) (Φ2(t) + Φ1(t))
(cid:18)
(cid:16)
(cid:18)
1
(cid:96)(cid:48)
1(t)3
1
(cid:101)
(cid:96)(cid:48)
1(t)3
1
(cid:101)
(cid:96)(cid:48)
1(t) (cid:18)
1
(cid:101)
(cid:96)(cid:48)
1(t) (cid:18)
(Φ(cid:48)
(cid:101)
(cid:96)(cid:48)
1(t)
Φ2(t)
(cid:101)
(cid:96)(cid:48)
1(t)
Φ2(t)
(cid:101)
1
Φ2(t)
=
−
=
−
=
−
=
=
=
=
1
Φ2(t)
−
−
Φ2(t)
(cid:96)(cid:48)
1(t)
1
(cid:101)
w(cid:96)Φ(t)
1
w(cid:96)Φ(t)
−
where we have used that by properness we know that
which implies
=
t from the third to the fourth equality, and that Φ(cid:48)
Φ(t)
(cid:96)(cid:48)(t), Φ(t)
= 0 ((2.1)),
(cid:104)
(cid:105)
by differentiating with respect to
1(t) + Φ(cid:48)
2(t) = 0 since
(cid:101)
∆2 from the third to last to the second to last equality.
(cid:96)(cid:48)(cid:48)(t), Φ(t)
(cid:105)
(cid:104)
(cid:96)(cid:48)(t), Φ(cid:48)(t)
(cid:105)
−(cid:104)
(cid:101)
(cid:101)
Notice that in the last equation of the previous string of equalities, the
(cid:96)(cid:48)
1 (or more precisely w(cid:96)Φ(t)) and the remaining terms
only term involving (cid:96) is
depend only on the parametrization Φ. Then we obtain
∈
(cid:101)
κ+
(cid:101)(cid:96)Φ
κ+
(cid:101)λΦ
(t)
(t)
=
wλΦ(t)
w(cid:96)Φ(t)
.
The remaining statements follow from setting Φ = Φstd and (2.6).
(cid:3)
Remark 2.14. Combining Lemma 2.11 and (2.10), we recover the characteri-
zation of the mixability constant in terms of the quotient of weights obtained by
van Erven–Reid–Williamson in [vERW12, Section 4.1]. However for the cor-
responding statement involving the quotient of second derivatives of the Bayes
risks, the fact that ∆2 has an affine parametrization is important. Indeed, this
relies on Corollary 3 in [RW10] that states that w(t) =
(t). In general, it
can be checked that
(cid:48)(cid:48)
L
−
(cid:48)(cid:48)
L
(t)
Φ(cid:48)(cid:48)
1(t)
Φ1(t)
−
(cid:20)
(cid:101)
(cid:48)
L
(t) =
(cid:21)
(cid:101)
Φ2(t)
−
1(t)2
(cid:96)(cid:48)
1 +
(cid:18)
(cid:101)
(cid:101)
Φ2(t)2
Φ1(t)2
(cid:19)
3/2
(cid:101)(cid:96)(t),
κ
20
CABRERA PACHECO AND WILLIAMSON
(cid:48)(cid:48)
L
−
(t) when Φ = Φstd. From the point of view of
which reduces to w(t) =
the present work, L (or a quotient of them) is not a good quantity to consider
since it strongly depends on coordinates. However, notice that if one restricts
(cid:48)(cid:48)
to affine parametrizations of ∆2 then
(cid:101)(cid:96)(t) and
L
hence in view of Lemma 2.13 restricting to a fixed affine parametrization of
∆2 will make quotients of the second derivative of the Bayes risk well behaved.
(cid:101)
1(t)2 and κ
(cid:96)(cid:48)
(t) depends on
(cid:101)
(cid:101)
Let us remark some points about Lemma 2.13.
•
•
•
−→
Let (cid:96) : ∆2
R be a given strictly proper, fair, loss function. Given
a parametrization, we obtain a weight w(cid:96)Φ given by (2.8), that is, the
weight depends on the parametrization.
The curvature of (cid:96) is independent of Φ up to a sign. However, when
defining κ+
(cid:96) we made the choice of the sign in a uniform way, thus
the curvature is independent of the parametrization for the family of
losses considered here. Then it follows that the quotient of curvatures
is independent of the parametrization and by (2.9), it also follows that
the quotient of weights is also independent of the coordinates (despite
the weights being coordinate dependent themselves).
A corresponding notion of weight in higher dimensions (for the multi-
class case) is way more complicated and it is unclear whether using
them would lead to successful results. One higher dimensional analog
of curvatures is readily seen to be the so called "principal curvatures"
of a hypersurface in Euclidean space (see Appendix A). This will be the
main motivation when dealing with the multi-class case (Section 3) Al-
ternative ways to characterize proper higher dimensional loss functions
have been studied in [WVR16].
−→
2.4. Geometric comparison of loss functions. Fix a proper, fair loss func-
tion λ : ∆2
R2. Given another proper, fair loss function (cid:96)
= λ, how might
we compare them? From the point of view of differential geometry, since
given p the normal vectors at λ(p) and (cid:96)(p) coincide, it is natural to look at
their curvatures. Motivated by Lemma 2.11, we impose (for the moment) the
condition
inf
p∈∆2
= 1.
κ+
(cid:96) (p)
κ+
λ (p)
κ+
λ (p) for all p
(cid:96) (p)
≥
∈
Note that this implies that κ+
∆2. We divide the
comparison in steps for clarity.
(1) Expressing λ(∆2) as a function. Note that since λ is proper and fair,
the normal vector to a point λ(p) can only be (1, 0) when p = (1, 0) (i.e.,
when evaluating λ at the boundary of ∆2). Thus, the set λ(int(∆2)) can
be expressed as a graph over the x-axis. To obtain an explicit expression
(cid:54)
THE GEOMETRY OF MIXABILITY
21
let Φ = Φstd. We use the fact that
infinity) is invertible. Then, we have that
λ1 : (0, 1)
−→
(0, l1) (where l1 could be
λ(int(∆2)) =
(cid:101)
(x, f (x))
x
|
∈
(0, l1)
}
{
λ−1
1 (x)).
where f (x) = λ2(
λ−1
1 (x), 1
(2) Translating and parametrizing (cid:96)(∆2). Let p0
(cid:96) (p0) >
κ+
R2 by
λ (p0), if such p0 does not exist then (cid:96) = λ. We define (cid:96)0 : ∆2
(cid:96)0(p) = (cid:96)(p) + [λ(p0)
(cid:96)(p0)], i.e., we translate (cid:96) so that it coincides with λ
at λ(p0). ((cid:96)0 is not fair anymore, however, the curvature is invariant under
translations.)
int(∆2) with κ+
−→
−
−
∈
(cid:101)
(cid:101)
(cid:96) (p0) > κ+
−
λ (p0), we know that around x0 the graph of
We now parametrize (cid:96)(∆2) as the graph of a function g defined on an
interval I0 around x0 (the x-coordinate of λ(p0)), "aligning" it with λ (we
can assume this interval to be maximal). We let g(x) = (cid:96)0
1)−1(x)). Since κ+
(cid:96)0
(
g is to the northeast of f .
(3) Comparison. If the graph of g is to the northeast of f on the whole I0,
(cid:101)
then we see that the superprediction set of (cid:96)0 is contained in that of λ. If
I0 such that f (x1) = g(x1),
this does not hold, it means that there is x1
0
and w.l.o.g. we can assume x1 > x0. Thus we know that g(x)
on [x0, x1] and g(x)
, i.e., the boundary of [x0, x1].
{
Define the second order operator which computes the curvature of the
graph (x, h(x)) (see (A.1)):
1)−1(x), 1
(cid:96)0
f (x) = 0 on
x0, x1
f (x)
2((
−
≥
−
∈
(cid:101)
}
L(h)(x) = κ+
h (x) =
1
(1 + h(cid:48)(x)2)3/2 h(cid:48)(cid:48)(x).
(cid:96) (p0) > κ+
λ (p0), we see that L(g
Since κ+
0 on [x0, x1]. The max-
imum principle now implies that the supremum of g
f is attained at
the boundary on [x0, x1], and hence we know that f (x) = g(x) on [x0, x1],
which is a contradiction. Thus the superprediction set (cid:96) is contained in
the superprediction set of λ (see Section 4).
f )
−
−
≥
More generally, if we assume instead that
inf
p∈∆2
κ+
(cid:96) (p)
κ+
λ (p)
= η,
for some η > 0, we see that (see Appendix A) that (cid:96)η(p) = η(cid:96)(p) satisfies
κ+
(p)
(cid:96)η
κ+
λ (p)
inf
p∈∆2
= 1.
That is, we can reproduce the previous analysis with (cid:96)η instead of (cid:96).
The previous discussion motivates right away a comparison between proper,
fair loss functions.
22
CABRERA PACHECO AND WILLIAMSON
Definition 2.15. Let λ : ∆2
call a base loss. We say that a proper, fair loss (cid:96) : ∆2
respect to λ if
−→
R2
≥0 be a proper, fair loss in
−→
, which we
R2 is mixable with
L
> 0.
inf
p∈∆2
κ+
(cid:96) (p)
κ+
λ (p)
2.5. Mixability and fundamentality as comparison to the log loss.
is proper and fair. Thus, in particular κ+
Now, suppose (cid:96)
∈
int(∆2). We want to think of mixability as a geometric comparison to the log
loss as suggested by Vovk in [Vov15] and give a detailed interpretation of this
comparison. We fix the standard parametrization of ∆2, Φ = Φstd : [0, 1]
∆2, given by
(cid:96) (p) > 0 for all p
∈ L
−→
The log loss in these coordinates is thus given by
Φ(t) = (t, 1
t).
−
(cid:96)log(t) = (
ln(t),
ln(1
t)),
−
−
−
and by (2.6), its curvature with respect to the unit normal pointing towards
R2
≥0 is given by
(cid:101)
κ+
(cid:101)(cid:96)log
(t) =
t(1
−
t)
t)2)3/2 .
(t)
(t2 + (1
(0, 1) and κ+
(cid:101)(cid:96)log
−
(t) > 0 for all t
Notice that κ+
(cid:101)(cid:96)log
Thus, clearly by Lemma 2.7, for any proper subinterval C of [0, 1] (cf. [Vov15,
Corollary 2]), we have
0 as t
0 or t
→
→
→
1.
∈
inf
t∈C
κ+
(cid:96) (t)
κ+
(t)
(cid:101)(cid:96)log
> 0.
Thus, whether a proper, fair loss function (cid:96) is mixable or not will depend of
the behavior of the quotient κ+
log(p) as p approaches (0, 1) and (1, 0).
More precisely, we have obtained the following.
(cid:96) (p)/κ+
Lemma 2.16. Let (cid:96)
∈ L
be a proper loss. Then (cid:96) is mixable if and only if
lim
p→(0,1)
lim
p→(1,0)
κ+
(cid:96) (p)
κ+
log(p)
κ+
(cid:96) (p)
κ+
log(p)
> 0, and
> 0.
Motivated by this we make the following definition.
, and Φ = Φstd be
Definition 2.17. Let (cid:96) be a proper, fair loss function in
the standard parametrization of ∆2. We say that is (cid:96) (B1, B2)-logarithmic at
L
THE GEOMETRY OF MIXABILITY
23
the boundary if
lim
t→0+
lim
t→1−
κ+
(cid:101)(cid:96)
κ+
(cid:101)(cid:96)log
κ+
(cid:101)(cid:96)
κ+
(cid:101)(cid:96)log
(t)
(t)
(t)
(t)
= B−1
1 > 0, and
= B−1
2 > 0.
Let us analyze what this means. Suppose that (cid:96) is proper and (B1, B2)-
(0, 1), using (2.10) in Lemma 2.13 and (2.8), we
logarithmic. Then for any t
have
∈
κ+
(cid:101)(cid:96)
κ+
(cid:101)(cid:96)log
(t)
(t)
=
1
w
(cid:101)(cid:96)std
(t)
t(1
1
−
t)
=
Notice that as t
0+,
→
and similarly,
B−1
1 = lim
t→0+
1
t
1
(cid:96)(cid:48)
1(t)
|
|
(cid:101)
= lim
t→0+ (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1
t
1
(cid:96)(cid:48)
1(t)(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1(t)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:101)
(cid:12)
((cid:96)log)(cid:48)
(cid:96)(cid:48)
1(t)
.
.
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
2(t)
(cid:101)
((cid:96)log)(cid:48)
(cid:96)(cid:48)
2(t)
B−1
2 = lim
t→1−
1
1
−
t
1
(cid:96)(cid:48)
2(t)
|
|
= lim
t→1− (cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
.
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
that is, we are only comparing the rate at which (cid:96)i, i = 1, 2, go to 0 (since
they do by fairness) with the rate at which the log loss does.
(cid:101)
(cid:101)
In [Vov15], Vovk defines a loss function λ∗ to be fundamental if given a
Z∞
(computable, proper, mixable) loss function λ and a data sequence in ζ
that is random under λ∗ with respect to a prediction algorithm F , then it is
is
random under λ with respect to F . He shows that a fair, mixable (cid:96)
fundamental if and only if (using the notation in [Vov15])
∈ L
∈
sup
p∈[0,1]
κ(cid:96)(p)
κlog(p)
<
.
∞
Since we have seen that mixability can be regarded as a comparison of
curvatures of the loss curve of (cid:96) and that of (cid:96)log and we have reinterpreted
fundamentabiliy as a comparison of (cid:96) and (cid:96)log near the boundary building on
Definition 2.15, we can easily come up with a notion of λ-fundamentality.
Definition 2.18. Let λ be a proper, fair loss function in
proper, fair loss function (cid:96)
is λ-fundamental if
. We say that a
L
(cid:96) is mixable with respect to λ, and
∈ L
•
24
CABRERA PACHECO AND WILLIAMSON
•
when Φ = Φstd, we have
lim
t→0+
lim
t→1−
κ+
(cid:101)(cid:96)
κ+
(cid:101)λ
κ+
(cid:101)(cid:96)
κ+
(cid:101)λ
(t)
(t)
(t)
(t)
<
∞
<
.
∞
Suppose now that a mixable loss function (cid:96)
exist η, γ > 0 such that
is fundamental. Then there
∈ L
κ+
(cid:96) (p)
κ+
log(p) ≤
γ,
η
≤
int(∆2). This implies that
η−1κ+
(cid:96) (p),
int(∆2), which readily implies (Appendix A) that
κ+
log(p) and κ+
γ−1κ+
log(p)
(cid:96) (p)
≥
≥
κ+
η(cid:96)(p)
≥
log(p) and κ+
κ+
log(p)
κ+
γ(cid:96)(p),
≥
int(∆2).
for all p
for all p
for all p
∈
∈
∈
Rephrasing the previous discussion we have obtained the following charac-
terization of fundamentality.
Theorem 2.19. A loss function (cid:96)
∈ L
numbers η, γ > 0, such that for any p
xp and yp in R2
≥0 such that
is fundamental if and only if there exist
int(∆2), there are translation vectors
∈
spr(η(cid:96) + xp)
spr((cid:96)log)
⊂
⊂
spr(γ(cid:96) + yp).
2.6. Constructing new mixable losses from previous. We now observe
how mixability helps us to construct new proper, fair and mixable functions
from previous proper, fair and mixable losses. We first define a family of loses
that will serve to illustrate the idea. We set Φ = Φstd and λ = (cid:96)log. Let a > 0
and define the loss function λa : ∆2
It can be readily checked that κ
−→
λa(p) = aλ(p).
(cid:102)λa(t) = a−1κ+
κ
(cid:102)λa(t)
κ+
λ (t)
it follows that λa is 1-mixable for a
1 and it is not if a > 1. Note that λa is
still proper and fair. Take then a < 1, we can readily see that there exists a
proper, fair an mixable loss function λ∗ such that
λ (t), thus since
R2
≥0
1
a
≤
=
,
λ = λa + λ∗.
THE GEOMETRY OF MIXABILITY
25
Indeed, λ∗ = λ
λa = λ1−a, which is fair, proper and 1-mixable.
This process works in a more general setting than scalings of λ. Consider
−
for example the spherical loss σ defined in coordinates by
σ(t) =
1
(cid:18)
t
√t2+(1−t)2
−
, 1 +
t
√t2+(1−t)2
.
(cid:19)
It can be easily checked that this is bounded, proper and fair and that κ
1. Thus
(cid:101)
(cid:101)σ(t) =
(t2 + (1
t(1
thus σ is 1-mixable. Thus, as before, there is a loss function (cid:96)∗ such that
λ = σ + (cid:96)∗. Moreover, the loss function given (in coordinates) by
t)2)3/2
t)
κ+
(cid:101)σ (t)
κ+
λ (t)
−
−
> 1,
=
(cid:96)∗(t) = λ(t)
σ(t) =
ln(t)
1 +
−
which can be seen to be unbounded, proper, fair and mixable.
−
−
−
−
−
(cid:18)
t
√t2+(1−t)2
,
ln(1
t)
1
t
√t2+(1−t)2
−
,
(cid:19)
We close this part with the following observation. Suppose that (cid:96) is a
proper, fair, mixable loss function with mixability constant η > 0. Then the
loss function (cid:96)η = η(cid:96) is 1-mixable. Thus, there exists a proper, fair, mixable
loss (cid:96)∗ such that
(cid:96)log = (cid:96)η + (cid:96)∗.
As we will see in Section 4, the previous observation can be interpreted from
the point of view of the superprediction sets of the involved loss functions and
convex geometry: spr(η(cid:96)) slides freely inside spr(λ) (see Theorem 4.23).
2.7. Composite losses and the canonical link. In this part we discuss
R be a
composite losses following [RW10]. Let us recall their setting. Let
V ⊂
set of prediction values. A link function is a continuous map ψ : [0, 1]
.
−→ V
Given a loss function
= R, if ψ is
(cid:37) :
−→
invertible, we define the composite loss (cid:37)ψ as
R and assuming
[0, 1]
} ×
0, 1
V
{
(cid:101)
(cid:37)ψ(y, v) =
(cid:37)(y, ψ−1(v)).
Definition 2.20. A composite loss
proper loss in the sense of [RW10].
(cid:101)
(cid:37)ψ is a proper composite loss if
(cid:101)
(cid:37) is a
(cid:101)
Recall that in [RW10], Φ = Φstd is implicitly assumed. Then, given a loss
(cid:37) (in the [RW10] sense), we can construct a loss function (cid:37) : ∆2
(cid:101)
−→
(cid:37)
◦
(cid:101)
Φ−1
std. Then, the composite loss
(cid:37)ψ can be expressed as
(cid:37)ψ(v) = (
(cid:37)
(cid:101)
= ((cid:37)
(cid:101)
(cid:37)
=
(cid:0)
◦
◦
◦
ψ−1)(v)
Φstd
◦
(Φstd
(cid:101)
ψ−1)(p)
ψ−1)
(p)
◦
(cid:1)
function
R2
≥0, by (cid:37) =
(cid:101)
26
CABRERA PACHECO AND WILLIAMSON
Φstd
Ψ−1 =
◦
(cid:37), that is
In other words, the composite loss
to the parametrization Φ = Φstd
of (cid:37) with respect to Φ by
(cid:37)ψ is the local expression of (cid:37) with respect
ψ−1 of ∆2. We denote the local expression
(cid:37) := (cid:37)
(cid:101)
To show how this reconciliation of terms work, we obtain a result similar to
(cid:37)ψ is given and it has
Corollary 12 in [RW10]. Suppose that a composite loss
(cid:98)
differentiable partial losses (i.e., the corresponding loss (cid:37) is in
), furthermore,
we assume that ψ is a diffeomorphism which in one dimension means it is
(cid:37)ψ is strictly proper if and only if (cid:37)
strictly monotonic. Then we know that
is strictly proper (by definition). This implies that p is normal to (cid:37)(∆2) at
int(∆2) and its curvature is positive (with respect to the unit
(cid:37)(p) for all p
∈
normal pointing towards R2
≥0). This means for all v
Ψ−1
L
(cid:101)
(cid:101)
(cid:98)
(cid:101)
(cid:37)
◦
◦
◦
,
∈ V
0 =
=
=
(cid:37)(cid:48)(v), Φ(v)
(cid:104)
(cid:105)
(cid:37)(cid:48)
(cid:37)(cid:48)
2(v)Φ2(v)
1(v)Φ1(v) +
(cid:98)
1(ψ−1(v))(ψ−1)(cid:48)(v)Φ1(v) +
(cid:37)(cid:48)
(cid:98)
(cid:98)
1(ψ−1(v))Φ1(v) +
(cid:37)(cid:48)
(cid:101)
2(ψ−1(v))(ψ−1)(cid:48)(v)Φ2(v)
(cid:37)(cid:48)
(cid:1)
(cid:101)
−
=
2(ψ−1(v))(1
(cid:37)(cid:48)
where we have used that ψ is a diffeomorphism and that Φ1 + Φ2 = 1 for all
parametrizations Φ of ∆2. Therefore, we have
(cid:37)(cid:48)
(cid:37)(cid:48)
1(ψ−1(v))
2(ψ−1(v))
2(ψ−1(v)),
(cid:37)(cid:48)
Φ1(v)),
Φ1(v)
−
=
(cid:101)
(cid:101)
(cid:101)
−
−
that is
(cid:0)
(cid:101)
ψ−1(v) =
(cid:101)
2(ψ−1(v))
(cid:37)(cid:48)
(cid:101)
(cid:37)(cid:48)
1(ψ−1(v)))
(
(cid:37)(cid:48)
2(ψ−1(v))
for all v
(cid:101)
Since we are working with valid reparametrizations the choice of Ψ will not
∈ V
.
(cid:101)
affect the curvature of (cid:37). Hence we obtain
Corollary 2.21. A composite loss
strictly proper and ψ satisfies
(cid:37)ψ is strictly proper if and only if (cid:37)
is
∈ L
ψ−1(v) =
(
for all v
R.
∈
2(ψ−1(v))
(cid:37)(cid:48)
(cid:101)
(cid:37)(cid:48)
2(ψ−1(v))
(cid:37)(cid:48)
1(ψ−1(v)))
−
(cid:101)
(cid:101)
(cid:101)
Remark 2.22. We have seen that whether a loss function (cid:96)
is strictly
proper or not, depends on whether conditions (2.3) and (2.4) hold or not. No-
tice that under a (admissible) change of coordinates, for example given by a link
ψ, (2.4) will not be modified. However, (2.3) might change (since in a way, we
are changing the "velocity" at which we move on (cid:96)(∆2)). Hence, Corollary 2.21
is giving us a way to define the set of admissible links (or reparametrizations
of ∆2) given a loss function (cid:96) and the standard parametrization of ∆2. In this
case, the new parametrization is given by Φ = Φstd
ψ−1.
∈ L
◦
THE GEOMETRY OF MIXABILITY
27
For applications, it is desired to be able to work with a given composite loss
(cid:37)ψ
2 . From our
R, so that
(cid:37)ψ, and moreover, to have convexity of the partial losses
point of view, we see
(cid:37) := (cid:37)
(Φstd
Φ = (cid:37)
(cid:101)
(cid:37)ψ
1 and
(cid:37)ψ as the local expression of some (cid:37) : ∆2
ψ−1 =
Let us work with the partial losses separately:
ψ−1) = ((cid:37)
ψ−1.
(cid:101)
−→
(cid:101)
Φstd)
(cid:37)
◦
◦
◦
◦
◦
◦
(cid:101)
(cid:98)
(cid:37)1(v) =
1(ψ−1(v))(ψ−1)(cid:48)(v)
(cid:37)(cid:48)
(cid:101)
(cid:98)
(cid:37)2(v) =
(cid:101)
2(ψ−1(v))(ψ−1)(cid:48)(v)
(cid:37)(cid:48)
d
dv
d
dv
Proceeding as in the proof of Lemma 2.4, properness implies
(cid:98)
(cid:101)
L(u, v)
0 = ∂v
v=u
|
(cid:37)(cid:48)
1(ψ−1(v))(ψ−1)(cid:48)(v)Φ1(u) +
=
(cid:101)
2(ψ−1(v))(ψ−1)(cid:48)(v)Φ2(u)
(cid:37)(cid:48)
s=u
|
or, equivalently,
(cid:101)
(cid:101)
0 =
(cid:37)(cid:48)
1(ψ−1(v))Φ1(v) +
(cid:37)(cid:48)
2(ψ−1(v))Φ2(v).
Therefore, we can define w as
(cid:101)
(cid:101)(cid:37)(Ψ−1(v)) =
w(v) := w
(cid:101)
2(ψ−1(v))
(cid:37)(cid:48)
Φ1(v)
=
1(ψ−1(v))
(cid:37)(cid:48)
Φ2(v)
,
−
(cid:37), we can rewrite the derivatives of the partial losses
(cid:101)
(cid:101)
(cid:101)(cid:37) is the weight of
(2.11)
where w
(cid:37) as
of
(cid:98)
w(v)Φ2(v)(ψ−1)(cid:48)(v),
−
(v) = w(s)Φ1(v)(ψ−1)(cid:48)(v).
(cid:101)
(cid:37)1
d
(v) =
dv
(cid:98)
(cid:37)2
d
dv
(cid:98)
Taking second derivatives we have
−
d2
(cid:37)1
dv2 (v) =
(cid:98)
d2
(cid:37)2
dv2 (v) =
(cid:98)
w(v)(ψ−1)(cid:48)(v)
(cid:48) Φ2(v)
w(v)(ψ−1)(cid:48)(v)
Φ(cid:48)
2(v),
−
(cid:2)
w(v)(ψ−1)(cid:48)(v)
(cid:3)
(cid:48) Φ1(v) +
(cid:2)
w(v)(ψ−1)(cid:48)(v)
(cid:3)
Φ(cid:48)
1(v).
(cid:2)
A way to guarantee both expressions are positive is as follows. Assume
w.l.o.g. that (ψ−1)(cid:48) > 0. Since we are assuming w > 0,
(cid:37)1
is decreasing (also we have Φ1 is increasing and Φ2 is decreasing). We readily
see that imposing
(cid:98)
(cid:37)2 is increasing and
(cid:98)
(cid:3)
(cid:3)
(cid:2)
w(v)(ψ−1)(cid:48)(v) = 1
28
CABRERA PACHECO AND WILLIAMSON
for all v
positive.
∈
R, is enough to guarantee both second derivatives to be strictly
Definition 2.23. Given (cid:37)
as the link defined by
∈ L
strictly proper, we define the canonical link ψ
(ψ−1)(cid:48)(v) =
ψ−1(v)
(cid:37)(cid:48)
2(ψ−1(v))
=
1
w(v)
,
, where w is defined in (2.11).
(2.12)
for v
∈ V
(cid:101)
The differential equation (2.12) can be seen as separable ordinary differential
equation, which is solvable for loss functions in
.
L
To give a geometric meaning, we look at the norm of the velocity of the loss
curve α(v) =
(cid:37)(v).
α(cid:48)(v)
|
2 = w(v)2(ψ−1)(cid:48)(v)2
|
Φ1(v)2 + Φ2(v)2
(cid:98)
By assuming w(s)(ψ−1)(cid:48)(s) = 1 and Φ = Ψ, we have
(cid:2)
(cid:3)
2 =
α(s)
|
|
Φ0(ψ−1(s))2 + Φ1(ψ−1(s))2
.
(cid:3)
(cid:2)
Thus the canonical link gives a parametrization of ∆2 such that
(cid:37) is a curve
such that its velocity vector at v coincides with the length of the vector
Φ(ψ−1(v)). In other words, it is a parametrization of the loss curve (cid:37)(int(∆2))
(cid:96)(int(∆2)), the tangent vector at the point has
such that for (cid:37)(p) =
length
. We close this discussion with a charcterization of the canonical
|
link.
(cid:98)
be a stxrictly proper loss function and ψ its canon-
Theorem 2.24. Let (cid:37)
ical link. The reparametrization of (cid:37) determined by its canonical link is a
parametrization of (cid:37)(int(∆2)) with weight equal to 1.
(cid:37)(v)
∈ L
p
|
∈
(cid:98)
(Φstd
Proof. Let
determined by the canonical link. Since
(cid:37) = (cid:37)
ψ−1) =
(cid:37)
◦
◦
◦
ψ−1 be the reparametrization of (cid:37)(int(∆2))
(cid:98)
(cid:37)(cid:48)
2(v) =
(cid:101)
2(ψ−1(v))(ψ−1)(cid:48)(v),
(cid:37)(cid:48)
for all v
∈ V
(2.13)
, and from Definition 2.23
(cid:98)
(cid:101)
2(ψ−1(v))) =
(cid:37)(cid:48)
ψ−1(v)
(ψ−1)(cid:48)(v)
,
for all v
∈ V
, we have
(cid:101)
2(v) = ψ−1(v).
(cid:37)(cid:48)
Thus w
(cid:98)(cid:37)(v) =
(cid:98)(cid:37)(cid:48)
2(v)
Φ1(v)
= 1.
(cid:98)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:3)
THE GEOMETRY OF MIXABILITY
29
3. Mixability for Multi-Class Classification
L
Now we focus our attention on multi-class classification loss functions, that
0 given by the partial losses
is, maps (cid:96) : ∆n
Rn
≥
−→
(cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)).
Our main goal is to interpret mixability as a geometric comparison of a given
loss function (cid:96) to the log loss, as we did for the binary case. As suggested by
the comments after Remark 2.11, the extra work of characterizing properness
and mixability in a geometric way (coordinate independent) will pay off since
to carry out the comparison we will look at the scalar second fundamental
forms of (cid:96)(int(∆n)) and (cid:96)log(int(∆n)). The scalar second fundamental form
measures how a Riemannian manifold curves inside an "ambient space", in
this case how (cid:96)(int(∆n)) curves inside Rn (see Appendix A for details).
The definition of
(Definition 2.1) can be extended to higher dimensions.
Definition 3.1. An admissible loss function is a map (cid:96) : ∆n
that
Rn
≥0 such
−→
(i) (cid:96)(int(∆n))
≥0 is a (n
(ii) there exists a differentiable map n : (cid:96)(int(∆n))
1)-manifold of class C 2,
Rn
−
⊂
n(cid:96)(p), where N (cid:96)(int((∆n)) is the normal space of (cid:96)(int((∆n)), and
>0 for all p
int(∆n).
n(p) belongs to Rn
(iii) n(p) or
We denote the set of admissible loss functions as
dimension is clear from context.
n, or simply
L
L
when the
−
∈
N (cid:96)(int(∆n)), n((cid:96)(p)) =
→
We fix the log loss and denote it for convenience by λ := (cid:96)log : ∆n
as the map
Rn
≥0,
−→
λ(p) = (
∆n.
ln(p1), ...,
ln(pn)),
−
−
for p = (p1, ..., pn)
Let (cid:96)
around p
parametrization Φ
∈ L
∈
∈
∆n of ∆n
n and consider a parametrization Φ : D
int(∆n). The local expression of the conditional risk (using the
Rn−1
−→
⊂
Φ of ∆n
×
×
∆n around (p, p)) is given by
L(t, s) =
(cid:96)(s), Φ(t)
(cid:105)
(cid:104)
n
=
(cid:96)k(s)Φk(t),
k=1
(cid:88)
(cid:101)
D and
(cid:96) = (cid:96)
Φ.
where t = (t1, ...tn−1), s = (s1, ..., sn−1)
(cid:101)
(cid:101)
∈
Imposing (cid:96) to be proper implies that when fixing t, s = t is a critical point
L(t,
◦
of
(cid:101)
), that is,
*
0 = ∂si
L(t,
s=t =
)
|
*
∂si
(cid:104)
(cid:96)(t), Φ(t)
(cid:105)
. Note that since the tangent space of M(cid:96) at
1, ..., n
1
}
(cid:96)(U ), is generated by
(cid:96)(t),
, we conclude that Φ(t) is a
∈ {
(cid:96)(t), ..., ∂sn−1
−
(cid:101)
∂s1
{
(cid:101)
(cid:96)(t)
}
(cid:101)
(cid:101)
(cid:101)
(cid:101)
(cid:101)
for all i
T
(cid:101)(cid:96)(t)
30
CABRERA PACHECO AND WILLIAMSON
normal vector. In other words, as before, we have
n((cid:96)(p)) =
,
p
p
|
|
±
for all p
int(∆n).
∈
The fact that
L(t,
) achieves a minimum at s = t (at interior points) is
*
equivalent to requiring that the Hessian, D2
L, is positive definite at s = t.
The Hessian of
(cid:101)
L(t,
) at s = t is given by
*
(cid:101)
(cid:101)
[D2
L]ij(t) = ∂sj si
L(t,
s=t =
)
|
*
∂2
sj si
(cid:104)
(cid:96)(t), Φ(t)
(cid:105)
.
(cid:101)
The next step is to relate [D2
L]ij(t) to the scalar second fundamental form
h of M(cid:96) = (cid:96)(∆n) (see Appendix A for its definition). More precisely, we
compute the h with respect to a local parametrization Φ of ∆n, i.e., we obtain
the matrix [hij] representing h. To do this we need to compute the second
derivatives of its parametrization
Φ (Appendix A). Since,
(cid:96) = (cid:96)
(cid:101)
(cid:101)
(cid:101)
◦
we have
∂si
(cid:96)(s) =
(cid:101)
(cid:96)(s) =
∂2
sj si
(cid:101)
∂si
(cid:16)
(cid:96)1(s), ..., ∂si
(cid:96)n−1(s)
(cid:101)
(cid:101)
(cid:96)1(s), ..., ∂2
sj si
∂2
sj si
(cid:17)
(cid:96)n−1(s)
The scalar second fundamental form (with respect to the normal vector point-
ing towards Rn
(cid:101)
≥0) is then given by
(cid:101)
(cid:101)
(cid:16)
(cid:17)
hij(s) = h(∂si
(cid:96)(s), ∂sj
(cid:96)(s)) =
(cid:101)
(cid:101)
=
=
=
(3.1)
∂2
sj si
(cid:104)
∂2
sj si
(cid:104)
(cid:96)(s), n(
(cid:96)(s),
(cid:101)
1
∂2
(cid:101)
sj si
Φ(s)
(cid:104)
|
1
Φ(s)
|
[D2
|
|
(cid:96)(s))
(cid:105)
Φ(s)
(cid:101)
Φ(s)
|
(cid:105)
|
(cid:96)(s), Φ(s)
(cid:105)
(cid:101)
L]ij(s),
−
1, thus if [D2
for i, j = 1, ..., n
L]ij(s) is positive definite, then the matrix
[hij](s) is positive definite. In this case its eigenvalues are strictly positive and
hence, the principal curvatures of M(cid:96) at (cid:96)(s) (see Appendix A), κ+
i (s) (with
(cid:101)
respect to the unit normal pointing towards Rn
≥0) are all positive. Therefore,
using a similar reasoning as we did in the case n = 2, we have obtained
the following geometric characterization of properness (by following the same
arguments as in Section 2).
(cid:101)
THE GEOMETRY OF MIXABILITY
31
Lemma 3.2. Let (cid:96)
∈ L
and the principal curvatures of M(cid:96) at (cid:96)(p), κ+
int(∆n).
positive for all p
i (p) (i = 1, .., n
−
n. (cid:96) is strictly proper if and only if n(cid:96)(p) =
p
|
|
1), are strictly
p/
±
∈
We briefly explain how the comparison of scalar second fundamental forms
will be performed. We follow a similar procedure as the one described in
Section 2.4 for the case n = 2.
(1) We establish that given a proper loss function (cid:96)
n, around every
int(∆n), (cid:96)(int(∆n)) can be parametrized as a graph of a func-
Rn such that
p∗
tion f defined on a neighborhood around some x∗
(x∗, f (x∗)) = (cid:96)(p∗). We do this explicitly for the log loss λ.
∈ L
∈
∈
(2) Since λ and (cid:96) are proper, the normal vector to λ(int(∆n)) and (cid:96)(int(∆n))
at λ(p∗) and (cid:96)(p∗), respectively, is p∗/
p∗
. Hence we can identify their
|
|
tangent spaces at these points. We do so and fix the parametrizations
given in step (1).
(3) By assuming η-mixability of (cid:96), we look at the principal curvatures of
Eη((cid:96)(int(∆n)) and prove an equivalent condition for them to be non-
negative with respect to normal vector field pointing towards Eη(spr((cid:96)))
(i.e., convexity). The condition to be satisfied is seen to be comparison
of the scalar second fundamental forms of λ and (cid:96) that we can recognize
by step (1).
(4) We interpret this comparison as follows. Since the tangent spaces to
(cid:96)(p∗) (and η(cid:96)(p∗)) and λ(p∗) coincide for the chosen point p∗, if we
translate (cid:96) to coincide to λ at p∗, call this tangent space H (and note it
can be indetified with the supporting plane of the loss functions at the
given point). Then if we express (locally) η(cid:96)(int(∆n)) and λ(int(∆n))
over H, the graph of η(cid:96)(int(∆n)) lies above the graph of λ(int(∆n)).
See Figure 6.
3.1. Representing proper loss functions as graphs over Euclidean
2),
spaces. When restricting to the set of admissible loss functions
we can represent losses as functions over Rn−1 (a similar approach was taken
in [vERW12]; the difference relies on the fact that here we are after the com-
parison of second fundamental forms), which allows us to represent geometric
quantities in a simple way. This will be useful to recognize these quantities
when comparing a proper loss function (cid:96) to the log loss λ, as we did for the
binary case in Section 2. Let (cid:96) : ∆n
n given by
≥0 be a proper loss in
n (n
≥
L
Rn
−→
(cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)) .
L
32
CABRERA PACHECO AND WILLIAMSON
Figure 6. Geometric interpretation of η-mixability.
Let Φ : ∆n−1
by
Rn−1
⊂
−→
∆n be the standard parametrization of ∆n given
n−1
Φ(s) = Φstd(s) =
s1, ..., sn−1, 1
−
(cid:32)
si
,
(cid:33)
i=1
(cid:88)
where s = (s1, ..., sn)
then given by
projection Π : Rn
(cid:101)
∈
(cid:96)(s) = ((cid:96)
∆n−1. The local expression of
Φ)(s), so that
n−1
≥0 as Π(y1, ..., yn) = (y1, ..., yn−1).
(cid:96)i(s) = ((cid:96)i
(cid:101)
◦
◦
R
(cid:96) in these coordinates is
Φ)(s). Also, we define the
∈
∈
0
≥0 × {
}
(x1, .., xn)
{
−1p, for p
|
(as regular as M(cid:96) is).
≥0 −→
Recall that properness implies that the normal vector of M(cid:96) = (cid:96)(∆n) at (cid:96)(p)
(cid:101)
int(∆n). As a consequence, the normal
can be chosen to be
p
|
Rn
, so that
vector is never parallel to the hyperplane
∈
int(∆n), M(cid:96) can be written as a graph over
around any point (cid:96)(p) with p
Rn
In general, the existence of this function
is guaranteed by the implicit function theorem, however, in our case we can
M(cid:96) is a map with
give an explicit description of it as follows. The function Π
|
int(∆n), therefore, the
injective derivative, say around (cid:96)(q) for a fixed q
inverse function theorem ensures the existence (and differentiability) of a local
−1
. This inverse map can be seen as a
inverse, which we can denote by Π
M(cid:96)
|
local parametrization of M(cid:96). Thus, the local expression of (cid:96) (viewed as a map
from ∆n to M(cid:96)), (cid:96) : Dq
Rn−1 (where the latter are small
U(cid:96)(q)
−→
neighborhoods around Φ−1(q) and Π((cid:96)(q)) respectively) is given by
xn = 0
}
Rn−1
⊂
⊂
∈
|
(cid:96)(s) = (Π
(cid:96)
◦
◦
Φ)(s) = (Π
◦
(cid:96))(s) =
(cid:96)1(s), ...,
(cid:96)n−1(s)
.
(cid:101)
(cid:16)
(cid:101)
(cid:17)
(cid:101)
nHλ(int(∆n))ηl(int(∆n))•THE GEOMETRY OF MIXABILITY
33
This map is a diffeomorphism and its inverse (cid:96)
−1
denoted by
: U(cid:96)(q)
−→
Dq, will be
−1
(cid:96)
(x) =
(cid:96)−1
1 (x), ...,
(cid:96)−1
n−1(s)
.
We warn the reader about this abuse of notation,
(cid:96)i(s), it is a map satisfying
(cid:101)
(cid:101)
(cid:16)
(cid:17)
(cid:96)−1
i (x) is not the inverse of
(cid:101)
(cid:101)
((cid:96)
si =
xi =
(cid:96)i(s),
(cid:96)−1
i (x),
(cid:101)
)(x) = x,
(cid:101)
(cid:96))(s) = s.
−1
(cid:96)
◦
−1
((cid:96)
setting U(cid:96)(q)
◦
R such that graph(f )
We want to define f : U(cid:96)q −→
⊂
⊂
Π(M(cid:96)), so that it contains Π((cid:96)(q)), we arrive to
−1
(cid:96)
f (x) = ((cid:96)n
)(x) =
(x)).
(cid:96)n((cid:96)
Φ
−1
We have obtained the following result.
◦
◦
(cid:101)
M(cid:96). We see that
Lemma 3.3. Let (cid:96)
exists an open set U
admits the parametrization
∈ L
⊂
n be a strictly proper loss. Let q
and a function f : U
R
n−1
≥0 × {
0
}
int(∆n). Then there
R≥0 such that M(cid:96)
∈
−→
around (cid:96)(q).
Φf (x) = (x, f (x)),
Let (cid:96) and f be as in Lemma 3.3. The unit normal vector field (pointing
towards Rn
≥0) is then given by
(3.2)
n(cid:96)(x) =
1
(
Df (x), 1) .
2 + 1
Df (x)
|
|
We proceed to calculate the scalar second fundamental form. The first and
second derivatives of Φf are given by
(cid:112)
−
∂kΦf (x) = (ek, ∂kf (x)),
∂kmΦf (x) = (0, ∂kmf (x)),
1, where ek denotes the canonical basis of Rn−1 and 0 is
for k, m = 1, ..., n
the 0 vector of Rn−1. Denote by h(cid:96) the scalar second fundamental form of M(cid:96).
Thus with respect to this coordinates we have
−
(3.3)
h(cid:96)
km(x) =
∂kmΦf (x), n(cid:96)(x)
(cid:105)
(cid:104)
=
for k, m = 1, ..., n
1.
−
1
2 + 1
Df (x)
|
|
∂kmf (x),
(cid:112)
34
CABRERA PACHECO AND WILLIAMSON
int(∆n). The local expres-
3.1.1. Mλ as a graph. Fix an arbitrary point q∗
sion of λ (with respect to the standard parametrization Φ = Φstd around q∗
and Π around (cid:96)(q∗)) is given by
∈
thus, we have
λ(s) = (
−
ln(s1), ...,
−
ln(sn−1)) ,
−1
λ
(x) =
e−x1, ..., e−xn−1
.
Fix s∗ = Φ−1(q∗). Thus, around x∗ = Π(λ(q∗)), using Lemma 3.3, Mλ
(cid:1)
(cid:0)
around (cid:96)(q) can be described as
Φg(x) = (x, g(x)).
Moreover, in this case we have the explicit expression g(x) =
Notice that λ
form hλ of λ at x∗.
−1
(x∗) = s∗. We now compute the scalar second fundamental
ln(1
(cid:80)
−
−
n−1
i=1 e−xi).
∂kΦg(x) =
ek,
−
(cid:32)
1
e−xk
n−1
i=1 e−xi (cid:33)
,
∂kmΦg(x) =
0,
(cid:32)
1
−
δkme−xk
(cid:80)
n−1
i=1 e−xi
−
(cid:80)
+
(1
e−xke−xm
n
i=1 e−xi)2
,
(cid:33)
−
(cid:80)
for k, m = 1, ..., n
1 (here δkm denotes the Kronecker delta). In particular,
−
∂kΦg(x∗) =
ek,
−
(cid:32)
1
s∗
k
n−1
i=1 s∗
i (cid:33)
,
−
δkms∗
(cid:80)
k
n−1
i=1 s∗
i
+
−
1, and since n((x∗, g(x∗)) =
(cid:0)
(cid:80)
∂kmΦg(x∗) =
0,
(cid:32)
1
1
−
ks∗
s∗
m
n−1
i=1 s∗
i
1
(cid:1)
2
,
(cid:33)
(cid:80)
√(cid:80)n−1
i=1 (s∗
i )2+(1−(cid:80)n−1
i=1 s∗
i )2
(s∗, 1
−
for k, m = 1, ..., n
n−1
i=1 s∗
i ) we have
km(x∗) =
hλ
(3.4)
(cid:80)
(3.5)
−
=
for k, m = 1, ..., n
1
(cid:112)(cid:80)
−
∂kmΦg(x∗), n((x∗, g(x∗))
(cid:105)
(cid:104)
1
i )2 + (1
n
i=1(s∗
δkms∗
k +
(cid:18)
1
n
i=1 s∗
i )2
−
(cid:80)
ks∗
s∗
m
n
i=1 s∗
,
i (cid:19)
−
(cid:80)
Remark 3.4. Note that if instead of λ we would have used a translation of it,
that is, for c
∈
Rn, define a loss function φ : ∆n
φ(p) = λ(p) + c,
Rn
≥0 by
−→
we can repeat the previous computation. The only difference is that we would
have a different point xc
∗ instead of x∗.
THE GEOMETRY OF MIXABILITY
35
3.2. Geometric interpretation of mixability. Mixability is defined as a
property of the superprediction set of a proper loss (cid:96)
n. More precisely,
(cid:96) is mixable if and only if Eη(spr((cid:96))) is convex for some η > 0. As before,
we can determine whether Eη(spr((cid:96))) is convex by looking at its boundary
∂Eη(spr((cid:96))) = Eη((cid:96)(∆n)). Eη(spr((cid:96))) is convex if the principal curvatures of
Eη((cid:96)(∆n) are non-negative (when defined with respect to the inner pointing
normal vector) at all points. Since convexity is a global property that can be
tested "locally everywhere", it makes sense to make the following definition.
∈ L
n is η-mixable
int(∆n) if Eη(M(cid:96)) has non-negative principal curvatures with respect to
Definition 3.5 (η-Mixability at p
at p
the unit normal vector pointing towards Eη(spr((cid:96))) at Eη((cid:96)(p)).
∆n). We say that (cid:96)
∈ L
∈
∈
∈
∈ L
∈ L
Clearly, (cid:96)
Let (cid:96), (cid:37)
n is η-mixable at all p
int(∆n) if and only if it is η-mixable.
n be strictly proper. First, we note that properness implies that
the second fundamental forms of (cid:96) and (cid:37) can be compared in the following
∆n, note that the normal vector to M(cid:96) and M(cid:37) can be
sense. Given q∗
∈
chosen to be q∗/
q∗
. A translation does not affect the geometric properties
|
|
of M(cid:37) (since it is an isometry of Rn), thus we consider the translated loss
(cid:37)(cid:96)(q∗) : ∆n
Rn, given by
(cid:37)(cid:96)(q∗)(p) = (cid:37)(p) + [(cid:96)(q∗)
−
i.e., we translate (cid:37) by the vector cq∗ = λ(q∗)
(cid:96)(q∗) so that both (cid:37)q∗ and
(cid:96) coincide when evaluated at q∗. Doing so allows us to identify the tangent
spaces to M(cid:37)(cid:96)(q∗) and M(cid:96) at (cid:37)(cid:96)(q∗)(q∗) = (cid:96)(q∗). We will call (cid:37)(cid:96)(q∗) the translation
of (cid:37) to (cid:96)(q∗).
(cid:37)(q∗)] ,
−
−→
n be strictly proper. Let h(cid:96) and hλ denote the scalar
Lemma 3.6. Let (cid:96)
second fundamental form of M(cid:96) and Mλ (the log loss), respectively. Then, (cid:96) is
η-mixable at p
int(∆n) if and only if
∈ L
(3.6)
∈
h(cid:96)((cid:96)(p))
ηhλ(λ(p))
−
is positive semi-definite, where h(cid:96) and hλ denote the second fundamental forms
of (cid:96) and λ in the graphical coordintes described in Lemma 3.3. And therefore,
(cid:96) is η-mixable if and only if (3.6) holds for all p
int(∆n).
Proof. Let (cid:96) : ∆n
−→
Rn
≥0 be an admissible proper loss
(cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)) .
∈
The η-exponential projection map Eη : Rn
Rn is given by
Eη(y) = (e−ηy1, ..., e−ηyn).
−→
Let q∗
f over Rn−1, defined on an open set U f
int(∆n) and write M(cid:96) around (cid:96)(q∗) as the graph of a function
x∗ containing x∗, such that f (x∗) =
∈
36
CABRERA PACHECO AND WILLIAMSON
(cid:96)(q∗). We can directly give a parametrization of Eη(M(cid:96)) around Eη((cid:96)(q∗)) =
Eη((x∗, f (x∗)) by
Ψ(x) =
e−ηx1, ..., e−ηxn−1, e−ηf (x)
.
We proceed to compute the second fundamental form of Eη(M(cid:96)) around Eη((cid:96)(q∗))
(with respect to the inward pointing unit normal vector). The first and second
derivatives of Ψ are given by
(cid:1)
(cid:0)
∂kΨ(x) =
∂kmΨ(x) =
ηe−ηxkek,
−
−
η2δkme−ηxkek,
(cid:0)
η∂kf (x)e−ηf (x)
η∂kmf (x)e−ηf (x) + η2∂kf (x)∂mf (x)e−ηf (x)
(cid:1)
−
and noting that the (inward pointing) unit vector field is given by
(cid:0)
(cid:1)
n(Eη((cid:96)(x)) =
1
n−1
i=1 ∂if (x)2e2ηxi + e2ηf (x)
1/2
∂1f (x)eηx1, ..., ∂nf (x)eηxn,
eηf (x)
−
(cid:0)
(cid:1)
Therefore, letting
(cid:0)(cid:80)
of
η at Eη((x∗, f (x∗))) is given by
E
E
η :=
η(Uf ) = Eη(f (Uf )), the second fundamental form
(cid:1)
E
hE η
km(x∗)
∂kmΨ(x∗), n((cid:96)η(x∗))
=
(cid:105)
(cid:104)
=
=
1
n−1
i=1 ∂if (x∗)2e2ηx∗
i + e2ηf (x∗)
(cid:0)(cid:80)
η
n−1
i=1 ∂if (x∗)2e2ηx∗
i + e2ηf (x∗)
1/2
(cid:1)
η2δkme−ηx∗
kek,
(cid:34)(cid:104)
∂if (x∗)eηx∗
i ei
(cid:105)Rn−1
+η∂kmf (x∗)
η2∂kf (x∗)∂mf (x∗)
n
i=1
(cid:88)
−
1/2 [ηδkm∂kf (x∗) + ∂kmf (x∗)
η∂kf (x∗)∂mf (x∗)] .
(cid:3)
−
(cid:0)(cid:80)
Thus, since the convexity of Eη(spr((cid:96))) is equivalent to the principal curvatures
int(∆n) (with respect to the
of Eη(M(cid:96)) being non-negative at q∗ for all q∗
inner pointing normal vector), we see this will be the case if and only if the
matrix
∈
(cid:1)
Akm = ∂kmf (x∗)
is positive semi-definite for all x∗ corresponding to q∗
Note that since we have a graphical parametrization Φf of M(cid:96) around x∗
∈
η [
−
−
δkm∂kf (x∗) + ∂kf (x∗)∂mf (x∗)]
int(∆n).
U , we have
and by (3.2),
∂kΦf (x∗) = (ek, ∂kf (x∗))
n(x∗, f (x∗)) =
1
2 + 1
Df (x∗)
|
|
Df (x∗), 1) .
(
−
(cid:112)
∈
THE GEOMETRY OF MIXABILITY
37
On the other hand, since the normal vector to Φf (U ) at (x∗, f (x∗)) is q∗
have
|q∗|, we
n((x∗, f (x∗))) =
1
i )2 + (1
n
i=1(s∗
for s∗
(cid:112)(cid:80)
Rn−1 such that Φ(s∗) = q∗.
By properness we know that
∈
1, ..., s∗
s∗
n, 1
n
i=1 s∗
i )2 (cid:32)
n−1
−
i=1
(cid:88)
s∗
i
,
(cid:33)
−
(cid:80)
0 =
∂kΦf (x∗), n((x∗, f (x∗)))
(cid:105)
(cid:104)
=
1
i )2 + (1
n
i=1(s∗
k + ∂kf (x∗)
s∗
n
i=1 s∗
i )2 (cid:34)
−
1
(cid:32)
−
n−1
i=1
(cid:88)
s∗
i
(cid:33)(cid:35)
thus
(cid:112)(cid:80)
and also
(cid:80)
∂kf (x∗) =
−
s∗
k
n−1
i=1 s∗
i
,
1
−
(3.7)
1 +
2 = 1 +
Df (x∗)
|
|
1
(cid:80)
2 =
n−1
j )2
j=1 (s∗
n−1
i=1 s∗
i
(cid:80)
−
n−1
j )2 +
j=1 (s∗
1
n−1
i=1 s∗
i
2
1
−
n−1
i=1 s∗
(cid:0)
(cid:80)
i
2
.
(cid:1)
(cid:80)
−
Using (3.3) and the previous observations, we can rewrite the terms of Akm
(cid:1)
(cid:0)
(cid:0)
(cid:1)
(cid:80)
(cid:80)
as
∂kmf (x∗) =
=
∂kmf (x∗)
2 + 1
|
2 + 1
|
Df (x∗)
|
Df (x∗)
(cid:112)
|
1
(cid:112)
n−1
i=1 s∗
1
i
−
(cid:113)(cid:80)
(cid:1)
n−1
j=1 (s∗
j )2 +
1
−
n−1
i=1 s∗
i
2
km(x∗)
h(cid:96)
(cid:0)
(cid:80)
(cid:1)
and
(cid:0)
(cid:80)
[
−
δkm∂kf (x∗) + ∂kf (x∗)∂mf (x∗)]
δkms∗
k
n−1
i=1 s∗
i
ks∗
s∗
m
n−1
i=1 s∗
i
2 .
+
1
=
1
−
−
(cid:0)
Now, consider the log loss λ and its translation to (cid:96)(q∗) which we denote by
(cid:80)
(cid:1)
(cid:80)
λ∗ to simplify the notation. That is, we have
λ∗ = λ(p) + [(cid:96)(q∗)
λ(q∗)] .
−
38
CABRERA PACHECO AND WILLIAMSON
As discussed in Remark 3.4, we can write Mλ∗ as a graph around x∗ (since
λ∗(q∗) = (cid:96)(q∗)). The scalar second fundamental form of Mλ∗ at λ∗(q∗) is then
given by
(3.8)
hλ∗
ij (x∗) =
1
i )2 + (1
n
i=1(s∗
n
i=1 s∗
i )2
−
δkms∗
k +
(cid:18)
1
−
ks∗
s∗
m
n
i=1 s∗
i (cid:19)
This readily implies that
(cid:112)(cid:80)
(cid:80)
δkm∂kf (x∗) + ∂kf (x∗)∂mf (x∗)]
(cid:80)
n−1
i=1 s∗
i
2
hλ∗
ij (x∗).
n−1
j=1 (s∗
j )2 +
1
−
(cid:113)(cid:80)
Therefore, (cid:96) is η-mixable at q∗ if and only if we have that
(cid:80)
−
(cid:1)
(cid:0)
ij](x∗)
is semi-positive definite. Since q∗ was arbitrary the result follows.
ij ](x∗)
[h(cid:96)
−
η[hλ∗
[
−
=
1
(cid:0)
1
n−1
i=1 s∗
i
(cid:80)
(cid:1)
.
(cid:3)
Remark 3.7. The previous comparison of second fundamental forms is pos-
sible because properness forces the induced metrics by (cid:96) and λ to coincide at
ij ](x∗) (see Appendix A and Remark A.3).
(cid:96)(q∗) = λ∗(q∗), that is, [g(cid:96)
The conclusion of Theorem 3.6 does not necessarily hold if one takes a different
coordinate system.
ij](x∗) = [gλ∗
In order to get a geometric interpretation (i.e., independent of coordinates)
we note the following:
0
η[hλ∗
ij](x∗)
[h(cid:96)
ij ](x∗)
−
≤
ij]−1(x∗)[g(cid:96)
ij](x∗)[g(cid:96)
= [h(cid:96)
ij]−1(x∗)
ij](x∗)[g(cid:96)
[h(cid:96)
=
The matrices [h(cid:96)
ij ](x∗)[gλ∗
ij ]−1(x∗)
η[hλ∗
ij](x∗)
−
ij ](x∗)[gλ∗
η[hλ∗
ij ]−1(x∗)[gλ∗
ij](x∗).
[g(cid:96)
ij ](x∗)[gλ∗]−1(x∗) are the local ex-
pression of the Weingarten map (see [Lee18] for its definition and properties)
of (cid:96) and λ respectively. The eigenvalues of these matrices are the principal
curvatures of M(cid:96) and Mλ (and they are independent of coordinates), and the
determinants are their Gaussian curvatures. From here it also follows that
−
ij](x∗)[g(cid:96)]−1(x∗) and [hλ∗
ij ](x∗)
(cid:0)
(cid:1)
1
η
(cid:20)
[hη(cid:96)
η
=η
[h(cid:96)
ij](x∗)[g(cid:96)
ij]−1(x∗)
[hλ∗
ij ](x∗)[gλ∗
ij ](x∗)[gη(cid:96)
ij ]−1(x∗)
ij ](x∗)[gλ∗
ij ]−1(x∗)
(cid:21)
[g(cid:96)
ij ]−1(x∗)
[g(cid:96)
ij](x∗)
ij](x∗),
−
[hλ∗
−
(cid:104)
that is,
(3.9)
(cid:105)
0,
[W η(cid:96)
ij ]
[W λ
ij]
−
≥
where W (cid:96) denotes the Weingarten map of the loss function (cid:96). Then once a
∆n is chosen the relation (3.9) holds. A
system of coordinates around p
∈
THE GEOMETRY OF MIXABILITY
39
priori, the relation obtained between the Weingarten maps of (cid:96) and λ does
not provide much information, but it does points to look at the loss function
η(cid:96). With this in mind Lemma 3.6 does give a direct geometric interpretation
∆n
as follows. Let (cid:96) : ∆n
we know that around (cid:96)(q), M(cid:96) can be parametrized with Φf (x) = (x, f (x))
for some function f around the point Π((cid:96)(q)). Let x∗ = Φ((cid:96)(q)). Consider
now the proper loss (cid:37) = η(cid:96), for some η > 0. We readily see that (cid:37) can be
parametrized as Φg(y) = (y, g(y)) with
be a proper loss. Given a point q
≥0 in
−→
Rn
L
∈
g(y) = ηf (η−1y),
with g defined around yq = ηx∗. Now we compute the second fundamental
form of (cid:37) at yq. Notice that
y=ηx∗η−1 = ∂if (x∗),
y=ηx∗ = η∂if (η−1x)
∂ig(y)
|
|
y=ηx∗η−1 = η−1∂ijf (x∗),
|
y=ηx∗ = ∂ijf (η−1x)
|
∂ijg(y)
and hence,
ij (ηx∗) = η−1h(cid:96)(x∗).
Then assuming the hypothesis of Lemma 3.6, we obtain
ij(ηx∗) = hη(cid:96)
h(cid:37)
(3.10)
hη(cid:96)
ij (ηx∗)
−
ij(x∗) = η−1h(cid:96)
hλ
ij(x∗)
ij(x∗) = η−1
hλ
h(cid:96)(x∗)
ηhλ
ij(x∗)
−
0.
≥
−
The supporting planes at η(cid:96)(p) and λ(p) of Mη(cid:96) (or more precisely, of its
translation to λ(p)) and Mλ, respectively, coincide (since the normal vectors
are the same), we denote it by Hp. By looking at Mη(cid:96) and Mλ locally as graphs
over Hp, Lemma 3.6 gives the following comparison of graphs, which in turn
can be regarded as local embeddability in the sense of convex geometry (see
Definition 4.16 below).
(cid:1)
(cid:0)
int(∆n)
Theorem 3.8. (cid:96)
the local graph of the translation of η(cid:96) to λ(p) over the supporting plane to
both M(cid:96)p and Mλ at λ(p), Hp, lies above the graph of λ over Hp.
n proper is η-mixable if and only if for all p
∈ L
∈
Remark 3.9. We would like to point out the resemblance of Lemma 3.6 to
Theorem 10 in [vERW12]. To recover the latter from our point of view we will
first reinterpret Lemma 3.6 and Theorem 3.8 from a convex geometry point of
view which will lead to a transparent bridge between Lemma 3.6 and [vERW12,
Theorem 10].
4. Connections to convex geometry
In this part we reinterpret our results from the point of view of convex
geometry. With this interpretation we can relate Theorem 3.8 to results
40
CABRERA PACHECO AND WILLIAMSON
in [vERW12] and [WC22]. We first provide some background and state rel-
evant results from convex geometry which are well-known and can be found
in [Sch14] and can be adapted to our setting.
Let K
⊂
Rn be a convex set, that is
for all x, y
K and λ
We define the recession cone of K as the set
∈
∈
λx + (1
[0, 1].
λ)y
K
∈
−
rec(K) =
x
n : K + x
R
{
∈
K
.
}
⊂
The boundary of K is denoted by ∂K, as since we will assume that ∂K
is a differentiable manifold we denote the interior (as a manifold) of ∂K by
int(∂K). As usual the scaling of K by η > 0 and the Minkowski sum of K
and L are defined as
(4.1)
ηK =
ηk
∈
{
k + l
{
n : k
R
∈
n : k
K
,
}
K, l
(4.2)
K + L =
R
Definition 4.1. Let K be a closed convex set in Rn. The support function of
K, σ(K, u) : Rn
R, is defined as
∈
∈
∈
.
L
}
−→
σ(K, u) = sup
x∈K(cid:104)
.
x, u
(cid:105)
We sometimes denote it as σK(u) := σ(K, u).
From the definition we know that
K
y
∈
⇐⇒ (cid:104)
y, u
(cid:105) ≤
σK(u) for all u
n.
R
∈
From [Sch14, Section 1.7] we have the following.
Lemma 4.2 (Properties of σ). Let L, K
Rn be closed convex sets.
⊂
σK if and only if L
(1) σL
(2) σ(K + t, u) = σ(K, u) +
(3) σ(K + L, u) = σ(K, u) + σ(L, u).
⊂
t, u
(cid:105)
(cid:104)
K.
≤
for all t
Rn.
∈
Definition 4.3. A function f : D
Rn given by
Rn
⊂
−→
R is convex if its extension to
is convex.
f (x) =
(cid:101)
f (x), if x
, if x /
∈
∞
(cid:40)
D
∈
D
The following lemma is a well-known result (see [Sch14, Theorem 1.7.1] for
example).
THE GEOMETRY OF MIXABILITY
41
Lemma 4.4. Let f : Rn
→
f is the support function of the convex, closed set
R convex, closed and positively homogeneous, then
K f =
x
n
R
x, u
f (u) for all u
n
R
.
{
∈
Definition 4.5. Let L, K
⊂
summand of K if there exists a convex, closed set M
M + L.
| (cid:104)
Rn and closed and convex. We say that L is a
Rn such that K =
(cid:105) ≤
⊂
∈
}
∗ the set of closed, convex sets whose recession cone is Rn
n
We will be mainly interested in sets K whose recession cone is Rn
≥0, hence
≥0. In
we denote by
the following we extend some common results in convex geometry which are
usually stated for closed, compact convex sets in Rn (see [Sch14]), however,
n
∗ [Shv01].
some of them are easily extended to
K
n
∗ ). Let K, L
K
n
∗ and η > 0. Then,
∈ K
K
Lemma 4.6 (Basic properties of sets in
the following holds:
(1) ηK
∈ K
(2) rec(K + L) = Rn
(3) K + L is closed, and
(4) K + L
≥0,
n
∗ ,
n
∗ .
∈ K
Proof. In order to show (1), we need to show that ηK is closed, convex and
rec(ηK) = Rn
[0, 1], then we have
≥0. Let x, y
ηK and λ
∈
λx + (1
−
∈
λ)y = η(λkx + (1
λ)ky)
−
λ)ky
where x = ηkx and y = ηky for some kx, ky
λkx + (1
K and hence ηK is convex. Let xn
sequence that converges to x. Then, there exists kxn ∈
Since η is a constant,
kxn}
{
uniqueness of the limit, x = ηx∞
ηK. Now, let x
ηK. Take any k
that ηK + x
converges to kx∞ ∈
∈
K,
∈
∈
∈
⊂
∈
−
K. Since K is convex, then
K be a convergent
K such that xn = ηkxn.
K (since K is closed). By the
≥0, we want to show
Rn
∈
ηk + x = η
k +
x
ηK
1
η
∈
(cid:18)
rec(ηK), then for any k1
(cid:19)
since 1
η x
∈
Rn
≥0. Conversely, if x
K, we have
∈
then there exists k2
∈
∈
K, such that ηk1 + x = ηk2. Hence
∈
ηk1 + x
ηK
k1 +
x = k2,
1
η
Rn
≥0.
thus 1
η x
∈
rec(K) = Rn
≥0, thus x
∈
42
CABRERA PACHECO AND WILLIAMSON
To show (2), let x
K and l
k
∈
∈
∈
L, then
L. Thus Rn
since l + x
≥0 ⊂
∈
Rn
rec(K + L) such that x /
∈
rec(K + L). Let k
have λx
∈
Rn
≥0. We want to show that K + L + x
K + L. Let
⊂
k + l + x
K + L,
∈
rec(K + L). Now, suppose that there is x
∈
≥0. Since rec(K + L) is a cone, for all λ > 0, we
K and l
L. Then
∈
k + l + λx
∈
K + L
K.
⊂
∈
Thus (cid:96)+λx
since by picking λ sufficiently large, l + λx /
∈
rec(K) = Rn
∈
≥0 for all λ > 0, but notice that this is a contradiction
Rn
≥0. Thus rec(K + L) = Rn
≥0.
For (3), see Rockafellar [Roc70] Thm. 8.2 and [Shv01] Thm. 3.1. (4) is
simply the combination of (2) and (3) (and the fact that K + L is convex). (cid:3)
n
∗ . First,
We now specialize the discussion to a particular type of sets K
suppose that the boundary ∂K is of class C 2, then at each point x
int(∂K)
there is an outward pointing normal vector uK(x). Thus, clearly, we can define
Sn−1 assigning uK(x) to x
a map uK : int(∂K)
n
≤0 =
n : x = (x1, ..., xn), with xi
∈
0 for i = 1, ..., n
int(∂K). We define
∈ K
∈
−→
R
R
,
≤
}
x
{
∈
so that
n
int(R
≤0) =
∩
x
∈
R
n : x = (x1, ..., xn), with xi < 0 for i = 1, ..., n
n
= R
<0.
{
n
Definition 4.7. Define C 2
∗ with bound-
+(
ary ∂K of class C 2, and such that the map uK is a C 1-diffeomorphism from
n−1
int(∂K) to S
−
n
∗ ) as the collection of sets K
K
Rn
:= Sn−1
∈ K
<0.
}
We now specialize some properties of the support function to C 2
+(
n
∗ ).
K
Lemma 4.8. If K
C 2
+(
∗ ), then dom(σK) = int(Rn
n
≤0)
∈
K
.
0
}
∪ {
= 0 in dom(σK), then it must be an outward normal vector
. Now, for
n−1
−
Proof. Take u
to int(∂K), hence it is in S
u
and thus it must be a normal vector form some x
function evaluated at v is finite, and in consequence σK(u) is finite too.
int(Rn
0
≤0)
∪ {
}
, then v
u
<0, normalize it to make it unitary by letting v = u/
|
|
int(∂K), hence the support
(cid:3)
n−1
− . Then dom(σK)
Rn
⊂
∈
∈
∈
S
Remark 4.9. Following Schneider [Sch14, Section 2.5] the condition K
C 2
+(
zero. It also follows that
∈
n
∗ ) is equivalent to assuming the principal curvatures of ∂K to be non-
K
|S
and moreover, σK is of class C 2.
σK(u)
n−1
−
=
u−1
(cid:104)
,
K (u), u
(cid:105)
Remark 4.10. Let (cid:96)
∈ L
Remark 4.9 implies spr((cid:96))
n be a proper loss function. By definition we see that
C 2
+(
n
∗ ) (since M(cid:96) = ∂(spr((cid:96)))).
∈
K
(cid:54)
THE GEOMETRY OF MIXABILITY
43
C 2
+(
Definition 4.11. Let K, L
to each boundary point x of K, there exists a translation vector t
that x
n). We say that L slides freely inside K if
Rn, such
L + t
K.
K
∈
∈
∈
⊂
Theorem 4.12. Let K, L
freely inside K.
C 2
+(
K
∈
n
∗ ). L is a summand of K, then L slides
Proof. Suppose that there exists M
x
∂K. Then there are l
∈
L and m
C 2
+(
M such that
∈ K
n
∗ ) such that K = L + M . Let
∈
∈
∈
x = l + m.
Thus, x
L + m
L + M = K.
(cid:3)
∈
⊂
n
∗ )
Remark 4.13. For a general convex set L, if L is a summand of K
we see that the previous proof holds an we conclude that L slides freely inside
K; note however that this imposes restrictions on possible sets L. One of this
consequences is that the principal curvatures of ∂L must be positive as can be
seen from a second fundamental form comparison and Theorem 3.8.
C 2
+(
K
∈
Lemma 4.14. Let K, L
convex. Then the set
∈
C 2
−(
K
n
∗ ) and suppose that f (
) = σK(
*
)
*
σL(
) is
*
−
M =
x
{
∈
n
R
x, u
| (cid:104)
(cid:105) ≤
f (u) for all u
n
R
,
}
∈
K
n
∗ ), and it is such that K = M + L, that is, L and M are summands
is in C 2
+(
of K.
Proof. From Lemma 4.8, the domain of f is Rn
R
is convex. Thus it is the support function of M (by Lemma 4.4). That is,
f (
0
<0 ∪{
} −→
, i.e., f : Rn
0
<0 ∪{
}
σL, and hence K = M + L. Note that M
is a summand of K, then using Theorem 4.12 we know that M slides freely
inside K, and since ∂K has positive principal curvatures then ∂M does too
(cid:3)
(Remark 4.13). Since σM is of class C 2, then M has to be in C 2
−(
n
∗ ).
−
) = σM (
*
Therefore we have σM = σK
).
*
Theorem 4.15. [[Sch14, Theorem 1.5.2]] Let D
−→
R be a continuous function. Suppose that for each point x0
D there are an
affine function g on Rn and a neighborhood U of x0 such that f (x0) = g(x0)
and f
Rn convex and let f : D
D. Then f is convex.
g in U
⊂
∈
K
≥
∩
Definition 4.16. We say that L is locally embeddable in K if for all x
y
L and a neighborhood U of y, such that (L
there is a y
U ) + x
∈
Theorem 4.17. Let K, L
embeddable in K, then L is a summand of K.
C 2
−(
K
∈
n
∗ ) and L strictly convex. If L is locally
∩
−
∂K,
K.
∈
⊂
n−1
Proof. Let u0
−
is locally embeddable in K there are y0
∂K be a point such that u(x0) = u0. Since L
L and a neighborhood U0 of y0 such
and x0
∈
∈
S
∈
44
CABRERA PACHECO AND WILLIAMSON
∩
U0) + x0
L : S
y0
that (L
exists a neighborhood V0 of u0 such that u−1
σ(L + x0
y0, u0) = σ(K, u0) and σ(L + x0
by Lemma 4.2.
K. Since u−1
−
⊂
−
n−1
− −→
⊂
y0, u)
K (V0)
−
≤
∂L is continuous, there
U0. Then it follows that
V0
σ(K, u) for all u
∈
Let f (
) = σ(K,
*
) (this is defined on Rn
σ(L,
*
−
x
) =
homogeneous), and g(
(cid:104)
*
(i) f (u0) = g(u0), since
0
}
. Then, clearly, we have
≤0 ∪ {
)
*
y,
−
*(cid:105)
and is positively
f (u0) = σ(K, u0)
= σ(K, u0)
= g(u0).
−
−
σ(L, u0)
σ(L + x0
y0, u0) +
x0
(cid:104)
−
y0, u0
(cid:105)
−
(ii) f
≥
g on V0,
f (u) = σ(K, u)
= σ(K, u)
g(u).
≥
σ(L, u)
σ(L + x0
−
−
y0, u) +
x0
(cid:104)
y0, u
(cid:105)
−
−
It follows by Theorem 4.15 that f is convex, and by Lemma 4.14 we conclude
(cid:3)
that L is a summand of K.
The following lemma is a direct consequence of the characterization of mix-
ability in Theorem 3.8 and Definition 4.16.
Lemma 4.18. Let (cid:96)
spr(η(cid:96)) is locally embeddable in spr(λ).
∈ L
n be a proper loss. For η > 0, if (cid:96) is η-mixable then
Lemma 4.19. If (cid:96) is η-mixable then spr(η(cid:96)) slides freely inside spr(λ).
Proof. Let (cid:96) be η-mixable, then Lemma 4.18 implies spr(η(cid:96)) it is locally embed-
dable in spr(λ). Then Theorem 4.17 implies it is a summand and Theorem 4.12
(cid:3)
implies it slides freely inside spr(λ).
n
Corollary 4.20. Let (cid:96) be a η-mixable proper loss. Then spr(η(cid:96))
∗ )
and it slides freely inside spr(λ) (λ is the log loss). Additionally, there exists
M
C 2
−(
K
∈
n
∗ ) such that
C 2
−(
∈
K
spr(λ) = spr(η(cid:96)) + M.
Moreover, ∂M can be regarded as (cid:37)(∆n) for a 1-mixable proper loss (cid:37).
Proof. Since (cid:96) is an η-mixable proper loss function, η(cid:96) is also a proper loss
n
function and hence spr(η(cid:96))
∗ ) (Remark 4.10). Theorem 3.8 implies
that spr(η(cid:96)) is locally embeddable in spr(λ). From Theorem 4.17 we know
that spr(η(cid:96)) is a summand of spr(λ), which proves the existence of M . As a
consequence, M is a convex set with recession cone Rn
≥0 (Lemma 4.14). By
applying [WC22, Proposition 21] we can regard ∂M as the image of a proper
C 2
−(
K
∈
THE GEOMETRY OF MIXABILITY
45
loss function (cid:37), which since spr((cid:37)) is a summand of spr(λ) it is 1-mixable
(cid:3)
(Lemma 4.14).
We now state [Sch14, Theorem 2.5.4] adapted to our setting which will be
helpful to relate our work to [vERW12].
∗ ). Let hM (x) denote the second fundamen-
n
Theorem 4.21. Let K, L
tal form of M at x with respect to u (see (A.2)). The following are equivalent:
C 2
−(
K
∈
(i) h∂L(x)
(ii) σK
≥
−
σL is a support function.
h∂K(y) for all pairs of points x and y at which u(x) = u(y).
Since ∆n is an affine manifold, the geodesics in ∆n are simply straight lines.
This allows to define convexity of functions defined on ∆n in the usual way
we do for functions on Rn. The following theorem connects and reconciles our
results to those in [vERW12]. More precisely, we create a bridge between our
results and [vERW12, Theorem 10].
Theorem 4.22. Let (cid:96)
and only if ηL(cid:96)(
Lλ(
)
*
risk of the loss function (cid:37) (Definition 1.3) and λ denotes the log loss.
n be proper loss. Let η > 0, then (cid:96) is η-mixable if
∈ L
) is convex on int(∆n), where L(cid:37)(
) denotes the Bayes
*
*
−
n which is η-mixable. By Lemma 4.19
Proof. Suppose that (cid:96) is a proper loss in
hλ(λ(p)). By
spr(η(cid:96)) slides freely inside spr(λ) and in particular hη(cid:96)((cid:96)(p))
σspr(η(cid:96)) is a support function with domain
Theorem 4.21 it follows that σspr(λ)
Rn
<0, such that
the outward normal vector of (cid:96)(∆n) and λ(∆n) at (cid:96)(p) and λ(p), respectively,
is u. Then we have for x =
−
, in particular it is convex on its interior. Let u
0
<0 ∪ {
}
≥
Rn
∆n,
L
∈
σspr(λ)(x)
−
p
−
∈
σspr(η(cid:96))(x) =
=
=
=
=
=
which proves the claim.
−
σspr(η(cid:96))(x/
x
|
x
η(cid:96)(p), x/
|
η(cid:96)(p),
))
|
)
|(cid:105)
p
p/
|
−
x
|
x
|
p
|
−
)
|
(σspr(λ)(x/
x
|
|
x
λ(p), x/
(
|(cid:105) − (cid:104)
|
(cid:104)
|
p
p/
λ(p),
(
|
(cid:104)
|
η(cid:96)(p),
λ(p),
p
−
λ(p), p
(cid:105)
Lλ(p) + ηL(cid:96)(p),
(cid:105) − (cid:104)
+
−
η(cid:96)(p), p
(cid:105)
(cid:104)
|(cid:105) − (cid:104)
−
−(cid:104)
(cid:104)
p
(cid:105)
)
|(cid:105)
(cid:3)
Suppose now that for given (cid:96)
n proper, there exists a η > 0 such that
spr(η(cid:96)) slides freely inside spr(λ). Note that in particular this implies that
int(∆n) we
spr(η(cid:96)) is locally embeddable in spr(λ), and hence for each p
have
∈ L
∈
hη(cid:96)(η(cid:96)(p))
hλ(λ(p))
0,
≥
−
46
CABRERA PACHECO AND WILLIAMSON
which by (3.10) and Lemma 3.6 implies that (cid:96) is η-mixable. Thus combining
this with Lemma 4.19 we obtain the following characterization of mixability
of proper (sufficiently differentiable) loss functions.
Theorem 4.23. Let (cid:96)
slides freely inside spr(λ), where λ denotes the log loss.
n be proper. (cid:96) is η-mixable if and only if spr(η(cid:96))
∈ L
L
In general, the set
provides a family of loss functions with appealing
,
properties. Arguably, one of the most important properties is that given (cid:96)
∈ L
if we assume that (cid:96) is proper then we know its principal curvatures are strictly
positive. This is a strong and useful geometric feature. For example, in [WC22]
the notion of a "inverse loss" called the anti-polar loss was investigated. Given
(cid:96) a proper loss (in the sense of [WC22], which are not necessarily smooth), they
consider the 0-homogeneous extension of (cid:96) (see Remark 26 in [WC22]), defined
on Rn
>0 and given by
p
p
1 (cid:19)
(cid:107)
1 = p1 + ... + pn. For the following we simply denote (cid:96)ext by (cid:96).
Rn
≥0
where
In [WC22, Proposition 29] it is shown that there exists a map (cid:96)(cid:5) : R>0
such that
(cid:96)ext(p) := (cid:96)
−→
(cid:18)
(cid:107)
(cid:107)
(cid:107)
p
,
(cid:96)(p) = ((cid:96)
◦
(cid:96)(cid:5)(x) = ((cid:96)(cid:5)
(cid:96)(cid:5)
(cid:96)
◦
◦
◦
(cid:96))(p)
(cid:96)(cid:5))(x),
∈
>0. The map (cid:96)(cid:5) is called the anti-polar loss of (cid:96). For the
Rn
for all x, p
family of admissible loss function
considered in this work, we exploit the
differentiability conditions to obtain in a straightforward way an inverse loss
defined on (cid:96)(int(∆n)). To see this, suppose that (cid:96)
is proper. Since this is
equivalent to saying that spr((cid:96)) is in C 2
n
∗ ), meaning that the map uspr((cid:96)) is
+(
C 1 diffeomorphism. Then we can define the map (cid:96)−1 : (cid:96)(int(∆n))
int(∆n)
by
∈ L
−→
K
L
(cid:96)−1(x) :=
u∂spr((cid:96))(x)
uspr((cid:96))(x)
,
1
(cid:107)
(cid:107)
which is the inverse of the map (cid:96) : int(∆n)
is nothing else than the unit normal vector (pointing towards Rn
(cid:96)(int(∆n)).
−→
(cid:96)(int(∆n)). Recall that u∂spr((cid:96))(x)
≥0) at x
∈
It is of interest of finding parametrizations (or links) that simplify the ex-
pression of a given proper loss (cid:96). At a theoretical level there are potentially
many ways to to this. Notably we have at hand the notion of canonical link
in [WVR16] (or see Section 2.7 above for n = 2). As an example of other ways
to obtain nice links we have Lemma 3.3 above, which gives a nice expression
in coordinates (as the form of a graph) of (cid:96). Unfortunately, to obtain that
THE GEOMETRY OF MIXABILITY
47
results one makes uses of the inverse function theorem which does not provide
an explicit inverse but rather its existence.
We summarize the main messages of this work.
5. Conclusions
•
•
•
•
•
Since mixable loss functions are of great importance in prediction
games, it is desirable to understand them from different perspectives.
Inspired by the work of Vovk [Vov15], in Section 2 we studied binary
loss functions from the point of view of differential geometry, hence
restricting to loss functions in
(Definition 2.1). To do this, we re-
interpret properness as a geometric property, namely, a loss function
(cid:96)
is proper if and only if
L
≥0) to M(cid:96) = (cid:96)(int(∆2)) at (cid:96)(p)
∈ L
– the normal vector (belonging to R2
is p
|p| , for any p
int(∆2), and
∈
– the loss curve (cid:96)(int(∆2)) has positive curvature (with respect to
p
|p| ).
∈ L
Having this framework at hand, we characterized mixability and fun-
, as a curvature comparison to the
damentality of a proper loss (cid:96)
log loss (cid:96)log (cf. [Vov15]).
In Section 3, we extended the geometric characterization of proper
loss functions to higher dimensions, and obtained the corresponding
interpretation of mixability as a geometric comparison (now in terms
of the principal curvatures of the "loss surface"). This comparison is
done by using the second fundamental forms of the "loss surfaces".
The main goal of Section 4 is to re-interpret the geometric results in
Section 3 from the point of view of convex geometry. The main result
in this part is a new characterization of η-mixability of a proper loss
function (cid:96)
, as spr(η(cid:96)) sliding freely inside spr((cid:96)log) (in general
dimension). This provides an intuitive and geometric way to interpret
mixability.
Since the results obtained in this work are in terms of curvature, it
was necessary to re-interpret well known properties of loss functions
in the language of differential geometry. Although this task might
seem tedious at first,
it is well worth it since it reconciles the re-
sults obtain by Vovk [Vov15] for n = 2 and by van Erven, Reid and
Williamson [vERW12] for n
It is worth to point out the relation of this work with [vERW12]. Specif-
ically, the bridge between these to works established by Theorem 4.22
connects our results to Theorem 10 in [vERW12] in the following way.
In [vERW12, Theorem 10] the following statements are proven to be
equivalent:
∈ L
≥
2.
48
CABRERA PACHECO AND WILLIAMSON
Φ−1
std(int(∆n)),
∈
(i) a proper loss (cid:96)
L(t)
(ii) ηH
H
∈
L is η-mixable,
Llog(t) is positive semi-definite for all t
where HF (t) denotes the Hessian of F at t,
−
Llog(p) is convex on int(∆n), and
Llog(p) is convex on Φ−1
std(int(∆n)).
(iii) ηL(p)
(cid:101)
L(p)
(iv) η
(cid:101)
−
−
(cid:101)
(cid:101)
There, they first proved the equivalence of (i) and (ii), which is the
result of a long direct computation done very carefully. The equiva-
lence between (iii) and (iv) is straightforward. To connect these two
sets of equivalences, standard convex geometry is used to prove the
equivalence of (ii) and (iii). Note that the statements (ii) and (iv)
make reference to a precise choice of parametrization of ∆n (i.e., the
standard parametrization Φstd), therefore, the work presented here is
naturally not related to these statements but rather to (i) and (iii),
whose equivalence can be considered to be the content of Sections 3
and 4. Determining whether this new approach provides a simplifica-
tion of the computations in [vERW12] or not, strongly depends on the
differential geometry and convex geometry background of the reader.
This work should be considered as complementing the understanding
of mixable loss functions and providing a new geometric insight into
them.
References
[BSS05]
[dC16]
Andreas Buja, Werner Stuetzle, and Yi Shen. Loss functions for binary class
probability estimation and classification: Structure and applications. Technical
report, University of Pennsylvania, 2005.
Manfredo P. do Carmo. Differential geometry of curves & surfaces. Dover Pub-
lications, Inc., Mineola, NY, 2016. Revised & updated second edition of [
MR0394451].
[HKW95] David Haussler, Jyrki Kivinen, and Manfred K. Warmuth. Tight worst-case
loss bounds for predicting with expert advice. In Computational learning theory
(Barcelona, 1995), volume 904 of Lecture Notes in Comput. Sci., pages 69–83.
Springer, Berlin, 1995.
[Lee18]
[HKW98] David Haussler, Jykri Kivinen, and Manfred K. Warmuth. Sequential prediction
of individual sequences under general loss functions. IEEE Transactions on
Information Theory, 44(5):1906–1925, 1998.
John M. Lee. Introduction to Riemannian manifolds, volume 176 of Graduate
Texts in Mathematics. Springer, Cham, 2018. Second edition of [ MR1468735].
Zakaria Mhammedi and Robert C Williamson. Constant regret, generalized
mixability, and mirror descent. In S. Bengio, H. Wallach, H. Larochelle,
K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural
Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
[MW18]
[RFWM15] Mark D. Reid, Rafael M. Frongillo, Robert C. Williamson, and Nishant Mehta.
Generalized mixability via entropic duality. In Peter Gr ̈unwald, Elad Hazan,
THE GEOMETRY OF MIXABILITY
49
[Roc70]
[RW10]
[SAM66]
[Sch14]
[Shv01]
and Satyen Kale, editors, Proceedings of The 28th Conference on Learning The-
ory, volume 40 of Proceedings of Machine Learning Research, pages 1501–1522,
Paris, France, 03–06 Jul 2015. PMLR.
R. Tyrrell Rockafellar. Convex analysis. Princeton Mathematical Series, No. 28.
Princeton University Press, Princeton, N.J., 1970.
Mark D. Reid and Robert C. Williamson. Composite binary losses. J. Mach.
Learn. Res., 11:2387–2422, 2010.
Emir H. Shuford, Arthur Albert, and H. Edward Massengill. Admissible prob-
ability measurement procedures. Psychometrika, 31(2):125–145, 1966.
the Brunn-Minkowski theory, volume 151 of
Rolf Schneider. Convex bodies:
Encyclopedia of Mathematics and its Applications. Cambridge University Press,
Cambridge, expanded edition, 2014.
A. P. Shveidel. Recession cones of star-shaped and co-star-shaped sets. In Op-
timization and related topics (Ballarat/Melbourne, 1999), volume 47 of Appl.
Optim., pages 403–414. Kluwer Acad. Publ., Dordrecht, 2001.
[vERW12] Tim van Erven, Mark D. Reid, and Robert C. Williamson. Mixability is Bayes
[Vov98]
[Vov01]
[Vov15]
[VZ09]
[WC22]
risk curvature relative to log loss. J. Mach. Learn. Res., 13:1639–1663, 2012.
V Vovk. A game of prediction with expert advice. Journal of Computer and
System Sciences, 56(2):153–173, 1998.
Volodya Vovk. Competitive on-line statistics. International Statistical Review /
Revue Internationale de Statistique, 69(2):213–248, 2001.
Vladimir Vovk. The fundamental nature of the log loss function. In Lev Bek-
lemishev, Andreas Blass, Nachum Dershowitz, Berndt Finkbeiner, and Wolfram
Schulte, editors, Lecture Notes in Computer Science, volume 9300 of Lecture
Notes in Computer Science, pages 307–318. Springer, 2015.
Vladimir Vovk and Fedor Zhdanov. Prediction with expert advice for the Brier
game. J. Mach. Learn. Res., 10:2445–2471, 2009.
Robert C. Williamson and Zac Cranko. The geometry and calculus of losses,
2022. arXiv:2209.00238.
[WVR16] Robert C. Williamson, Elodie Vernet, and Mark D. Reid. Composite multiclass
losses. J. Mach. Learn. Res., 17:Paper No. 223, 52, 2016.
Appendix A. Differential Geometry
In this part we provide a brief summary of the concepts of differential geom-
etry that are used in this work (we assume the reader has some familiarity with
the topic although we try to put emphasis on the intuition). We do not intend
to give a comprehensive introduction to the topic. Most of the material can
be found in almost any differential geometry book, however, we recommend
(and when possible use the notation of) [dC16] and [Lee18].
→
A.1. Curvature of Curves. A parametrized curve is a differentiable map
Rn, (a < b). We are interested in studying the geometry of
α : (a, b)
parametrized curves. For this it would be useful to restrict our discussions to
curves with a well defined tangent line at every point α(t) for t
(a, b) (i.e.,
with non-vanishing α(cid:48)(t)). These curves are called regular. Let φ : (a, b)
→
(c, d) be a diffeomorphism, the curve β = α(φ(s)) is a reparametrization of
∈
50
CABRERA PACHECO AND WILLIAMSON
α. Note that in this case α((a, b)) = β((c, d)). The image M = α((a, b)) is a
1-dimensional differentiable manifold in Rn (for this it is essential to restrict
to regular curves). The study of curves is of particular importance since some
aspects are carried to the study of the geometry of general hypersurfaces in
Rn.
β(cid:48)(s)
|
= 1 for all s
Typically, curvature is defined for curves parametrized by arc-length mean-
ing that
(c, d) (and a regular curve can always be
parametrized this way). For these types of curves, the curvature of β at β(s)
is defined as the length of β(cid:48)(cid:48)(s), which measures "how much" a curve "curves".
However, this notion does not give information about the direction on which
a curve is "curving". We start looking at the case n = 2. We define the signed
curvature of a general curve α(t) = (x1(t), x2(t)) by (cf. (1.5))
∈
|
κα(t) :=
1(t)x(cid:48)(cid:48)
x(cid:48)
(x(cid:48)
2(t)
−
1(t)2 + x(cid:48)
x(cid:48)(cid:48)
1(t)x2(t)
2(t)2)3/2
.
κ(t)
|
coincides with the curvature of α when parametrized
It can be checked that
by arc-length (at the corresponding point), the signed curvature is well defined
up to a sign (the sign will change if we consider a reparametrization that re-
a) given by
verses the order of (a, b), for example a curve defined on (
β(s) = α(
−
s)), which motivates the discussion in Section 1.5.
−
b,
|
For example, suppose that a planar curver is defined by a function f : (a, b)
−
R is the following way:
−→
α(t) = (t, f (t)),
(a, b). A quick computation gives
κα(t) =
f (cid:48)(cid:48)(t)
(1 + f (cid:48)(t)2)3/2 .
for t
∈
(A.1)
Given a regular curve α : (a, b)
= 0,
it is straightforward to see that the curve β(t) = ηα(t) is also a regular curve
and its signed curvature is given by
R3 as above and a real number η
−→
κβ(t) =
η2x(cid:48)
1(t)x(cid:48)(cid:48)
2(t)
−
η2x(cid:48)(cid:48)
1(t)x2(t)
2(t)2)3/2 =
1
η
κα(t).
(η2x(cid:48)
1(t)2 + η2x(cid:48)
The notion of signed curvature can be extended to curves in manifolds sit-
ting inside Rn (see for example [Lee18, Chapter 8]). For α(
Rn
−→
parametrized by arc-length, the signed curvature (with respect to n) κ+
α of α
n, α(cid:48)(cid:48)(0)
at p = α(0) is given by κ+
. It can be shown that this definition
(cid:105)
agrees with the one we gave for n = 2.
α (0) =
ε, ε)
−
(cid:104)
(cid:54)
THE GEOMETRY OF MIXABILITY
51
−
M there is an open set U
A.2. Geometry of hypersurfaces in Rn. Let M be a differentiable hyper-
1-dimensional C k manifold). By this
surface inside Rn of class C k (i.e., a n
Rn−1 and a C k injective
we mean that for each p
map Φ : U
U ,
forms a basis for the tangent space TqM (q = Φ(x)) to
∂1Φ(x), ..., ∂n−1Φ(x)
{
}
Rn we can consider the induced metric on M by the
M at q. Since Φ(U )
⊂
Euclidean metric in Rn (denoted by
). This is a Riemannian metric on M
given on the coordinates given by Φ by the matrix
M (called a parametrization of M around p). For each x
,
(cid:104)*
−→
⊂
*(cid:105)
∈
∈
gij(x) =
,
∂iΦ(x), ∂jΦ(x)
(cid:105)
(cid:104)
∈
for x
U . The metric g allows us to define the length of a curves in M .
In general,
if a manifold M of dimension n
1 is sitting inside an n-
dimensional Riemannian manifold M (and M is endowed with the induced
metric from M ) the second fundamental form carries the information on how
M is "curved" inside M . Let g be the metric on M and g the induced metric
on M by g. Let
denote the Levi–Civita connection of g. Let n be a smooth
unit normal vector field to M (that is n(p) is perpendicular to TpM for each
p
M ). The scalar second fundamental form of M with respect to n is the
covariant 2-tensor h on M defined as
∇
−
∈
(A.2)
h(X, Y ) =
n,
XY
=
(cid:104)
∇
(cid:105)
−(cid:104)∇
Xn, Y
.
(cid:105)
for X, Y tangent vectors to M . Note that for a hypersurface, at each point
we have exactly to unit normal vectors to M at p, thus the scalar second
fundamental form is well-defined up to a sign. Fixing a point p
M and an
for the tangent space at p TpM , the eigenval-
orthonormal basis
ues of the matrix given by hij = h(Ei, Ej) for i, j = 1, ..., n
1 are called the
principal curvatures of M at p and the corresponding eigenspaces are called
the principal directions. For details of the above see Chapter 8 in [Lee18].
E1, ..., En−1
{
−
∈
}
When M = Rn and M is parametrized by Φ : U
Rn,
−→
of Φ(U ), the scalar second
with respect to the local frame
fundamental form with respect to a normal unit vector field n is given by
([Lee18, Proposition 8.23])
∂1Φ, ..., ∂n−1Φ
{
Rn−1
M
⊂
⊂
}
(A.3)
hij = h(∂iΦ, ∂jΦ) =
∂ijΦ, n
(cid:104)
,
(cid:105)
for i, j = 1, ..., n
Given any p
1.
M and v
−
M of M
∈
∈
passing through p with velocity v at p. Let M1 and M2 be two hypersurfaces
in Rn+1 tangent at a point p
M2. Choose a normal vector n and
∩
suppose that M1 lies above M2 (with respect to n). We have the following
lemma from [Lee18].
TpM , there a geodesic γV : (a, b)
−→
M1
∈
With the previous lemma we can obtain a comparison result for manifolds
with positive principal curvatures.
52
CABRERA PACHECO AND WILLIAMSON
M2 and
Lemma A.1. Suppose that M1 and M2 are tangent at p
fix a normal vector n at p. Suppose that M1 and M2 have positive principal
curvatures at p. Then h1(v, v)
TpM if and only if M1
h2(v, v) for all v
lies above M2 (with respect to n) locally around p.
M1
≥
∈
∈
∩
Proof. First we make the following observation. Suppose that M is a smooth
hypersurface in Rn and we have a regular curve α : (
M such that
−→
α(0) = p and α(cid:48)(0) = v for some p
TpM . Then, letting h denote
the second fundamental form of M from (A.2) we have
M and v
ε, ε)
−
∈
∈
vn, v
−(cid:104)∇
d(n
(cid:105)
α)
−(cid:104)
◦
dt
(t), α(cid:48)(t)
h(v, v) =
=
=
t=0
(cid:105)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
t=0
(cid:12)
(cid:12)
(cid:12)
(cid:12)
Thus, if α is parametrized by arc-length, h(v, v) =
=
α)(t), α(cid:48)(cid:48)(t)
(cid:105)
(n
◦
(cid:104)
n, α(cid:48)(cid:48)(0)
.
(cid:105)
(cid:104)
|
= κ+
n, α(cid:48)(cid:48)(0)
(cid:105)
(cid:104)
α (0).
Suppose M1 lies above M2 are tangent at p and let v
TpM1 = TpM2 with
= 1. Then we can intersect M1 and M2 with the plane generated by v
v
|
and n. Then we obtain two curves α1 and α2 on M1 and M2, respectively,
such that αi(0) = p and α(cid:48)(0) = v for i = 1, 2. Moreover, we can assume
that these curves are parametrized by arc-length so its Euclidean curvature is
. Since we can regard these curves as planar curves, there
given by
(cid:105)
are functions f1 and f2 such that the curves α1 and α2 are represented in the
plane
by the curves
i (0), n
α(cid:48)(cid:48)
(cid:104)
v, n
∈
(cid:104)
(cid:105)
γ1(x) = (x, f1(x))
γ2(x) = (x, f2(x)),
i(0) = v, f (cid:48)(cid:48)
with fi = (0), f (cid:48)
curvatures at p) for i = 1, 2. By construction κ+
κ+
, for i = 1, 2.
(0) =
γi
(cid:105)
If M1 lies above M2 at p, then f (cid:48)(cid:48)
i (0), n
α(cid:48)(cid:48)
(cid:104)
i (0) > 0 (since M1 and M2 have positive principal
γ1(0) = f (cid:48)(cid:48)
i (0) and by definition
1 (0) > f (cid:48)(cid:48)
h2(v, v) for any v
2 (0) and hence κ+
TpM with
κ+
γ2(0),
≥
= 1. Let
γ1(0)
v
|
|
∈
which is equivalent to h1(v, v)
w
≥
TpM be arbitrary, then
= 0
∈
(A.4)
h1(w, w) =
as claimed.
w
|
2h1
|
,
w
w
|
|
w
w
|
(cid:18)
|(cid:19)
w
≥ |
2h2
|
,
w
w
|
|
w
w
|
(cid:18)
|(cid:19)
= h2(w, w),
Conversely if (A.4) holds, then we see that in particular holds for unitary
TpM . This
(cid:3)
v, which ultimately means that f (cid:48)(cid:48)
implies that M1 lies above M2.
f (cid:48)(cid:48)
2 (0) for all unitary v
1 (0)
≥
∈
(cid:54)
THE GEOMETRY OF MIXABILITY
53
We present the following instructive example.
Example A.2. Consider the differentiable function fκ(x, y) = κ(x2 + y2)
with κ > 0, and let Mκ =
. We choose the
parametrization Φκ(x) = (x, fκ(x)) of Mκ and compute the scalar second fun-
damental form of Mκ at p = (0, 0, 0) in these coordinates. We have
(x, y, fκ(x, y))
B1(0)
}
(x, y)
∈
{
|
∂xΦ(x, y) = (1, 0, 2κx),
∂yΦ(x, y) = (0, 1, 2κy),
∂xxΦ(x, y) = (0, 0, 2κ),
∂xyΦ(x, y) = (0, 0, 0),
∂yyΦ(x, y) = (0, 0, 2),
thus from (A.3) at the point Φκ(0, 0) = (0, 0, 0), the scalar second fundamental
form of Mκ with respect to n = (0, 0, 1) is given by
[hfκ](p) =
and in particular for κ = 1 we have
2κ 0
2κ
0
(cid:19)
,
(cid:18)
Thus, clearly we have
[hf1](p) =
2 0
0 2
.
(cid:19)
(cid:18)
(A.5)
[hfκ](0)
−
[hf1](0) =
2κ
2
−
0
2κ
0
(cid:18)
2
(cid:19)
−
which is positive definite if and only if κ > 1 (when Mκ lies inside M1 and are
tangent at p).
Remark A.3. We stress a technical observation. The comparison (A.5) in Ex-
ample A.2 is valid since regardless of the value of κ, ∂xΦκ(0, 0) and ∂yΦκ(0, 0)
are the same, meaning that we can identify the tangent spaces to Mκ and M1
at p for all κ, and the basis for them is given by
. In
general this is not necessarily the case so one should perform a change of basis
before comparing the second fundamental forms.
∂xΦ1(0, 0), ∂yΦκ(0, 0)
}
{
Email address: [email protected]
Universt ̈at T ̈ubingen, T ̈ubingen AI Center
Email address: [email protected]
Universt ̈at T ̈ubingen, T ̈ubingen AI Center
|
|
http://arxiv.org/abs/2302.11893v1 | 2023-02-23T09:57:48 | 2023-02-23T09:57:48 | A framework for benchmarking class-out-of-distribution detection and its
application to ImageNet | When deployed for risk-sensitive tasks, deep neural networks must be able to
detect instances with labels from outside the distribution for which they were
trained. In this paper we present a novel framework to benchmark the ability of
image classifiers to detect class-out-of-distribution instances (i.e.,
instances whose true labels do not appear in the training distribution) at
various levels of detection difficulty. We apply this technique to ImageNet,
and benchmark 525 pretrained, publicly available, ImageNet-1k classifiers. The
code for generating a benchmark for any ImageNet-1k classifier, along with the
benchmarks prepared for the above-mentioned 525 models is available at
https://github.com/mdabbah/COOD_benchmarking.
The usefulness of the proposed framework and its advantage over alternative
existing benchmarks is demonstrated by analyzing the results obtained for these
models, which reveals numerous novel observations including: (1) knowledge
distillation consistently improves class-out-of-distribution (C-OOD) detection
performance; (2) a subset of ViTs performs better C-OOD detection than any
other model; (3) the language--vision CLIP model achieves good zero-shot
detection performance, with its best instance outperforming 96% of all other
models evaluated; (4) accuracy and in-distribution ranking are positively
correlated to C-OOD detection; and (5) we compare various confidence functions
for C-OOD detection. Our companion paper, also published in ICLR 2023 (What Can
We Learn From The Selective Prediction And Uncertainty Estimation Performance
Of 523 Imagenet Classifiers), examines the uncertainty estimation performance
(ranking, calibration, and selective prediction performance) of these
classifiers in an in-distribution setting. | [
"Ido Galil",
"Mohammed Dabbah",
"Ran El-Yaniv"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11893v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11893v1",
"@rel": "related",
"@type": "application/pdf"
}
] | [
"International Conference on Learning Representations (2023)"
] | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CV"
] | 3
2
0
2
b
e
F
3
2
]
G
L
.
s
c
[
1
v
3
9
8
1
1
.
2
0
3
2
:
v
i
X
r
a
A FRAMEWORK FOR BENCHMARKING
CLASS-OUT-OF-DISTRIBUTION DETECTION AND ITS
APPLICATION TO IMAGENET
Ido Galil*
Technion
[email protected]
Mohammed Dabbah*
Amazon
[email protected]
Ran El-Yaniv
Technion, Deci.AI
[email protected]
ABSTRACT
When deployed for risk-sensitive tasks, deep neural networks must be able to detect instances with
labels from outside the distribution for which they were trained. In this paper we present a novel
framework to benchmark the ability of image classifiers to detect class-out-of-distribution instances
(i.e., instances whose true labels do not appear in the training distribution) at various levels of
detection difficulty. We apply this technique to ImageNet, and benchmark 525 pretrained, publicly
available, ImageNet-1k classifiers. The code for generating a benchmark for any ImageNet-1k
classifier, along with the benchmarks prepared for the above-mentioned 525 models is available at
https://github.com/mdabbah/COOD benchmarking.
The usefulness of the proposed framework and its advantage over alternative existing benchmarks
is demonstrated by analyzing the results obtained for these models, which reveals numerous novel
observations including: (1) knowledge distillation consistently improves class-out-of-distribution
(C-OOD) detection performance; (2) a subset of ViTs performs better C-OOD detection than any other
model; (3) the language-vision CLIP model achieves good zero-shot detection performance, with
its best instance outperforming 96% of all other models evaluated; (4) accuracy and in-distribution
ranking are positively correlated to C-OOD detection; and (5) we compare various confidence
functions for C-OOD detection. Our companion paper, also published in ICLR 2023 (Galil et al.,
2023), examines the uncertainty estimation performance (ranking, calibration, and selective prediction
performance) of these classifiers in an in-distribution setting.
1
Introduction
Deep neural networks (DNNs) show great performance in a wide variety of application domains including computer
vision, natural language understanding and audio processing. These models are trained on data coming from a certain
distribution P (X, Y ), usually with the assumption that test points will be sampled from the same distribution. When
the underlying distribution P (X, Y ) of test points is different from the one used to train a model, we may no longer
expect the same performance from the model. The difference in distribution may be the result of many processes such
as natural deviation in the input space X , noisy sensor readings of inputs, abrupt changes due to random events, newly
arrived or refined input classes, etc. Here we distinguish between input distributional changes in PX|Y and changes in
the label distribution. We focus on the latter case and consider the class-out-of-distribution (C-OOD) scenario, AKA
open-set recognition (Scheirer et al., 2013), where the label support set Y changes to a different set that includes the set
YOOD, containing new classes not observed in training.
Consider the detection task in which our model is required to distinguish between samples belonging to classes it has
seen in training, where x ∼ P (x|y ∈ YID), and samples belonging to novel classes, i.e., x ∼ P (x|y ∈ YOOD). The
question we now ask is: how should models be evaluated to most accurately reflect their detection performance? We
aim to benchmark the detection performance of DNN classification models that use their confidence rate function κ
*The first two authors have equal contribution.
(e.g., softmax response; see Section 2) to detect OOD labels, where the basic premise is that instances whose labels are
in YOOD are assigned lower κ values.
Most works on OOD detection use small-scale datasets that generally do not resemble the training distribution and,
therefore, are easy to detect. The use of such sets often causes C-OOD detectors to appear better than they truly
are when faced with realistic, yet harder tasks. Motivated by this deficiency, Hendrycks et al. (2021) introduced the
ImageNet-O dataset as a solution. ImageNet-O, however, has two limitations. First, it benchmarks models with a
single difficulty level exclusively, having only hard C-OOD instances, which might not be relevant for every task's
requirements (Section 3 explains how to define different difficulty levels). Second, the original intent in the creation of
ImageNet-O was to include only hard C-OOD instances. Its definition of "OOD hardness", however, was carried out
with respect to ResNet-50's difficulty in detecting C-OOD classes, specifically when using softmax as its confidence
function. This property makes ImageNet-O strongly biased. Indeed, consider the right-most box in Figure 1, which
corresponds to the performance of 525 models over ImageNet-O. The orange dot in that box corresponds to ResNet-50,
whose OOD detection performance is severely harmed by these ImageNet-O data. Nevertheless, it is evident that
numerous models perform quite well, and all other models perform better than ResNet-50. The lack of an objective
benchmark for C-OOD is the main motivation for our work.
Figure 1: OOD performance across severity (difficulty) levels, using the benchmarks produced by our framework. The
detection performance decreases for all models as we increase the difficulty until it reaches near chance detection
performance at the highest severity (s10). The top curve belongs to ViT-L/32-384, which surpasses all models at every
severity level. We also observe how success or failure with regard to the previous C-OOD benchmark, ImageNet-O,
does not reflect the models' true OOD detection performance since it was designed to specifically fool ResNet-50. At
the bottom we provide visual examples for OOD classes from ImageNet-21k that may populate each severity level due
to their similarity to ID classes from ImageNet-1k, and in this example, to a Monarch butterfly.
Our contributions. We propose a novel technique to generate a C-OOD benchmark that covers a variety of difficulty
levels. Unlike other existing benchmarks (e.g., ImageNet-O), our technique is not biased towards an arbitrary model
such as Resnet50 and/or a specific confidence function such as the softmax response. This useful property is obtained by
tailoring the benchmark to the model being evaluated, including its confidence function, and not seeking to determine a
single objective criterion for hardness of C-OOD samples (see Section 3).
Second, we show and explain how we filter ImageNet-21k to use it for the purpose of generating C-OOD benchmarks
for ImageNet-1k (Deng et al., 2009) classifiers (see Section 4). We will provide a simple code to choose the filtering
2
s0s1s2s3s4s7s8s9s10ImageNet-O30405060708090100s5 s6 Models:ViT-L/32-384 ResNet-50 AlexNetSeverity LevelsC-OOD AUROC (detection)parameters most suitable for the specific aim for which the benchmark is meant (e.g., what is classes are considered
OOD).
Third, we demonstrate the power and usability of our method by applying our C-OOD framework to generate
benchmarks for 525 ImageNet-1k classifiers available from popular repositories. We provide a benchmark for each of
these classifiers, which will be available for use from our code.
We then analyze the results of these benchmarks to make numerous novel observations concerning C-OOD detection
such as: (1) training regimes using knowledge distillation (Hinton et al., 2015) consistently yield models with better
C-OOD detection performance than the same models trained identically, but without distillation; (2) a subset of
ViTs performs better C-OOD detection than any other model; (3) the language–vision model CLIP achieves good
zero-shot detection performance for low difficulty (severity) levels; (4) accuracy and in-distribution (ID) ranking are
positively correlated with C-OOD detection; (5) we compare the performance of various confidence functions for
C-OOD detection; (6) A number of other observations (see Section 5).
Lastly, we emphasize that the resulting difficulty levels of our framework allow benchmarking with respect to the
difficulty levels most relevant to the task. For example, for a task with a high tolerance for risk (e.g., a task for an
entertainment application), the performance of a model on a median difficulty level might be more important than on
the hardest difficulty level (severity 10). The opposite might be true for some applications with a low tolerance for risk
(e.g., medical applications), for which one requires the best performance to be attained even if the OOD is very hard to
detect (severity 10). Furthermore, in Section 5 we show that detection algorithms do not always improve performance
on all inputs equally, and could even hurt performance for specific difficulty levels and models (see Figure 7 for a
striking example). Choosing the combination of (model, detection algorithm) based only on the detection performance
on all data may yield sub-optimal results for our specific desired level of difficulty.
2 Problem Setup
Let X be the input space and Y = YID ∪ YOOD be the label space. Let P (X , Y) be an unknown distribution over X × Y.
A model f is a prediction function f : X → YID, and its predicted label for an image x is denoted by ˆyf (x). The model
f is produced by training on a labeled set Tm = {(xi, yi)}m
i=1 ⊆ (X × YID), sampled i.i.d. from P (X , YID), with the
objective of minimizing its empirical risk, defined by ˆr(f |Tm) (cid:44) 1
i=1 (cid:96)(f (xi), yi), where (cid:96) : YID × YID → R+ is
m
a given loss function (e.g., cross-entropy loss for classification). Note that by this definition, the model f will always
misclassify any x ∼ P (X , YOOD).
We define a confidence score function κ(x, ˆy|f ), where x ∈ X , and ˆy ∈ YID is the model's prediction for x, as follows.
The function κ should quantify confidence in the prediction of ˆy for the input x, based on signals from model f . This
function should induce a partial order over instances in X .
(cid:80)m
The most common and well-known κ function for a classification model f (with softmax at its last layer) is its softmax
response values – κ(x, ˆy|f ) (cid:44) f (x)ˆy (Cordella et al., 1995; De Stefano et al., 2000) – which is also widely accepted
as a baseline in the OOD literature (Hendrycks & Gimpel, 2017; Hendrycks et al., 2021; Berger et al., 2021; Shalev
et al., 2018). While this is the primary κ we evaluate for the sake of simplicity, various other κ functions, which are
also utilized for OOD detection, exist. To name a few: Out-of-distribution detector for neural networks (ODIN) (Liang
et al., 2018), Monte-Carlo dropout (MC dropout) (Gal & Ghahramani, 2016), Mahalanobis distance (Lee et al., 2018),
and more. Although many of these methods use the direct output from f , κ could be a different model unrelated to f
and unable to affect its predictions.
κ functions can be evaluated by the quality of the partial order they induce over instances in X . For every two random
samples (x1, y1), (x2, y2) ∼ P (X , Y), and given that x1 belongs to an OOD label and that x2 belongs to an ID label,
the detection (or ranking) performance of κ is defined as the probability that κ ranks x2 higher than x1:
Pr[κ(x1, ˆy1|f ) < κ(x2, ˆy2|f ) | x1 ∼ P (X , YOOD) ∧ x2 ∼ P (X , YID)]
The Area Under the Receiver Operating Characteristic (AUROC or AUC) metric is often used to measure the
performance of OOD detection. When ID samples are counted as true positives and OOD samples are counted as false
positives, AUROC, in fact, equals the probability in Equation (1) (Fawcett, 2006) and thus is a proper metric to measure
OOD detection in classification. See Appendix A for evaluating κ functions in an ID setting.
(1)
3 Constructing a model-specific class-out-of-distribution benchmark
We first choose a dataset that contains samples from a large set of OOD labels (e.g., labels from ImageNet-21k that are
not included in ImageNet-1k). Ideally, this OOD dataset should consist of OOD labels representing labels the model
3
may encounter when deployed. Any large dataset could be used for the purpose of benchmarking performance on
C-OOD by splitting it according to labels into an ID component, i.e., the labels on which the model trains, and into an
OOD component, i.e., the labels on which the model is exclusively tested.
We now introduce a novel framework for generating C-OOD benchmarks with a controllable degree of severity, which
could be thought of as the difficulty level of the data. Algorithm 1 summarizes our proposed technique. Let YOOD be a
Algorithm 1 Generating C-OOD benchmarks
for ̄y ∈ YOOD do
1: function GENERATE BENCHMARK(f, κ, YOOD, group size = |YID|)
2:
3:
4:
Split all samples of class ̄y into two sets: c ̄y
est and c ̄y
test
Set the severity score of class ̄y to be: s( ̄y|f, κ) = 1
x∈c ̄y
|c ̄y
Insert the class and its score ( ̄y, s( ̄y|f, κ)) into classes array
est|
(cid:80)
κ(x|f ).
est
5:
6:
7:
8:
9:
10:
11:
Sort classes array in ascending order by each OOD class' score s( ̄y|f, κ)
for i < |YOOD| − group size do
grp array[i] = classes array[i : i + group size]
(cid:46) Sliding window of size group size
for i < 11 do
(cid:46) Select groups in different percentiles to serve as benchmarks
sev benchmark[i] = {x | x ∈ c ̄y
test s.t. ̄y ∈ grp array[j] and j = [ i
10 * |grp array|]}
return sev benchmark
large set of OOD classes (e.g., labels from ImageNet-21k that are not included in ImageNet-1k), and let sf,κ( ̄y) be a
severity score, defined as the average confidence given by κ to samples from class ̄y ∈ YOOD. This score reflects the
level of difficulty faced by the model f and its κ function when detecting instances from class ̄y. When considering ID
instances we expect κ to give high values for highly confident predictions. Therefore, the larger s( ̄y|f, κ) is, the harder
it is for κ to detect the OOD class ̄y among ID classes. We estimate s( ̄y|f, κ) for each class in the OOD dataset (e.g.,
ImageNet-21K) using a set of samples from the class (denoted by c ̄y
est), while keeping a disjoint set of samples from the
same class to be used for testing (denoted by c ̄y
test). Using s we sub-sample groups of classes (severity levels) from
YOOD, with increasing severity such that severity level i ∈ [0, 10] is the ith percentile of all severity levels.
To achieve this, we first estimate the severity score for each class ̄y in our OOD dataset for our model and its confidence
function (f, κ), as follows:
s( ̄y|f, κ) =
1
|c ̄y
est|
(cid:88)
x∈c ̄y
est
κ(x|f ).
We group the OOD classes into different groups, and choose the size of each group G to be the same as |YID|, the
number of labels in the ID dataset (e.g., in ImageNet we choose it to be 1000 classes). The number of possible groups
of labels from YOOD could be huge (in ImageNet, for example, the number of possible groups of size 1000 from the
20, 000 OOD classes is about (cid:0)20,000
(cid:1) = 2.5 × 101722), so instead of going over every possible group of classes, we
sort the classes by their severity scores and then use a sliding window of size |YID| to define |YOOD| − |YID| + 1 groups
of classes with increasing severity (see Figure 2). This method for reducing the number of considered groups of classes
was chosen because it groups OOD classes with similar severity scores together.
1000
Figure 2: We define |YOOD| − |YID| + 1 groups of classes with increasing severity by sorting all OOD classes ̄yi ∈ YOOD
by their severity scores s( ̄y|f, κ), and then use a sliding window of size |YID| to choose the considered groups.
Next, we choose the groups that correspond to the percentiles {10 * i}i=10
i=0 in the array of sorted groups. Finally, we
construct the C-OOD benchmark for each severity level i from the set of test samples c ̄y
test of all classes in group i. This
procedure for choosing groups allows us to interpret the severity levels using percentiles. For example, severity level 5
contains classes that match the median severity among the considered groups. Thus, the performance evaluated on the
benchmark for severity 5 corresponds to the performance of the model on samples with a median detection difficulty.
4
തy0തy1തy2തy3തy4തy5തy6...തy−2തy−1SlidingwindowofsizeThe resulting benchmark is tailored to the evaluated model, since the latter was used to generate it and, therefore, can be
used to measure its specific performance. In Appendix B we further argue why our framework can be used to compare
C-OOD detection performance of different models.
4 Constructing benchmarks for ImageNet classifiers
To use ImageNet-21k as an OOD dataset, we first filter out undesired labels. Since ImageNet-21K contains the ID
dataset (ImageNet-1K), the first step is to remove the ID classes from the OOD dataset. Next, we remove all classes
that are hypernyms or hyponyms of classes in ImageNet-1K because it might be inaccurate to include them as an OOD
class. For example, ImageNet-1K contains the class "brown bear" and ImageNet-21K has the class "bear", which is a
hypernym for "brown bear" so it would not be accurate to include "bear" in a C-OOD detection test. We furthermore
filter OOD classes that, together with an ID class, either comprise the same object or are a component of the other one.
This is due to most images in the dataset containing both components as parts of the whole object (e.g., "pool ball"
from ImageNet-1k and "pool table" from ImageNet-21k). We also filter out classes that are practically identical, even
though they possess WordNet id numbers that are different (e.g., "hen" is found twice as two distinct classes, with id
n01514859 in ImageNet-1k and id n01792640 in ImageNet-21k). Since each class in the ImageNet-1k validation set
has 50 samples, we set the number of testing samples for each C-OOD class to be 50 as well |c ̄y
test| = 50. In addition,
We set the estimation set for each class to be 150 |c ̄y
est| = 150. Overall, this means that each OOD class must have at
least 200 samples. Accordingly, we remove classes with less than 200 samples. For classes with more than 200 samples
we randomly select 200 samples and remove the rest.
While the above filtering choices are trivial and suitable for most tasks, two additional filtering options are dependent
on the task and its definition of two objects being considered identical. The first option concerns animal classes that
might appear to be very similar but have a biological difference such that an expert could distinguish between the two.
A good example of this can be observed in Figure 3, depicting the ImageNet-1k class of Monarch butterflies and the
ImageNet-21k class of Viceroy butterflies, which are both distinct species of butterflies. The similarity is so remarkable
that scientists believe they have evolved to mimic one another to repel common predators (Ritland & Brower, 1991).
This mimicry does not only fool predators and the untrained eye: all models studied in this paper classified more than
50% of Viceroy samples as a Monarch butterfly. The fact that such classes are biologically different led us to keep them
Figure 3: While both butterflies appear very similar, a Viceroy can be distinguished from a Monarch by a black line
crossing its postmedian hindwing. The red arrow on the Viceroy image indicates this black line.
in the test set by default and serve as extremely hard OOD classes. Our code, however, allows users to disable such
classes easily, since some tasks might permit such similar classes to be classified as the same.
The second option concerns inanimate objects created by humans that might appear very similar but are, by definition,
distinct from one another and are used differently. An example of two such classes is shown in Figure 4, depicting a
cue ball used for billiard games and a ping pong ball. Both are strikingly similar, and we believe a person completely
unfamiliar with one of the games might easily confuse the two, if all they had were the images. Our code can be
configured easily to either exclude or include such classes.
After completing the filtering as described above, the remaining classes were used in the process described in Section 3
as the set of OOD classes YOOD, with ImageNet's validation set being the set of ID classes YID. Our code allows
the generation of C-OOD benchmarks for any ImageNet classification model and its κ confidence scoring function.
Moreover, we ran the process ourselves for 525 models pretrained on ImageNet, taken from the torchvision (0.10)
and "timm" (0.4.12) repositories (Paszke et al., 2019; Wightman, 2019), with softmax as κ. For these models, the
benchmarks are ready to be used by the community without further preparations being necessary.
5
MonarchViceroyFigure 4: While both balls appear similar, they are distinguished by their different uses.
5 Performance analysis
Having generated C-OOD benchmarks using the above technique for 525 different models , in this section we analyze
the results. We first focus on results obtained when setting the confidence function κ to be the softmax response, as it is
widely accepted as a baseline in the OOD literature (Hendrycks & Gimpel, 2017; Berger et al., 2021). We then evaluate
additional κ functions such as ODIN, entropy and MC dropout. Our analysis leads to several interesting insights.
Figure 5: The mean relative improvement when using different training regimes (distillation, pretraining etc.). The
shaded green area indicates the area of positive improvement.
1) Knowledge distillation improves C-OOD detection. We measured C-OOD detection improvement (measured
in AUROC) when using different training regimes to explore whether a certain method consistently contributes to
detection performance. Results are depicted in Figure 5. To make a fair comparison, we only compare pairs of
models such that both models have identical architecture and training regimes, with the exception of the method itself
being evaluated (e.g., training with or without knowledge distillation). Of all training regimes (knowledge distillation,
adversarial training (Goodfellow et al., 2015), pretraining on ImageNet-21k, see below), knowledge distillation had
the most significant impact in most severity levels s > 3. In Galil et al. (2023) we also find that among these training
regimes, knowledge distillation is the best booster of uncertainty estimation performance in an in-distribution setting.
Next, we find that ImageNet21k pretraining also improves performance, and is more beneficial to performance than
knowledge distillation in low levels of severity s ≤ 3. Note that this observation could not have been achieved with
simplified benchmarks (e.g., ImageNet-O). Our new framework allows for such observations thanks to the division
of the benchmarks into different levels of severity. Finally, it is not surprising that adversarial training is irrelevant to
C-OOD detection.
2) A subset of ViTs achieves the best C-OOD detection performance, both in absolute terms and per-model size
(# parameters, see Figure 9 in Appendix C). Several training regimes (including the original regime from the paper
introducing ViT) result in ViTs that outperform all other architectures and training regimes in terms of C-OOD detection,
e.g., Dosovitskiy et al. (2021); Steiner et al. (2022); Chen et al. (2022); Ridnik et al. (2021). Further research into other
training regimes, however, reveals that not all training regimes result in superb performance (Touvron et al., 2021, 2022;
Singh et al., 2022; Paszke et al., 2019), even when a similar amount of data is introduced into the training. We also find
6
Ping pong ballCue balls0s1s2s3s4s5s6s7s8s9s10−101234Severity LevelsTraining regimes:Vanilla - Knowledge Distillation Vanilla - Adversarial TrainingAUROC Improvement %Vanilla - ImageNet21k Pretrainingthat the same successful subset of ViTs outperforms any other model in terms of uncertainty estimation performance in
an in-distribution setting in Galil et al. (2023). These observations warrant additional research with the hope of either
training more robust ViTs or transferring the unidentified ingredient of the successful subset of ViTs into other models.
3) The language–vision CLIP model achieves good zero-shot C-OOD detection performance for low severity
levels. CLIP (Radford et al., 2021) enables zero-shot classification and produces an impressive performance. We find it
is also good at C-OOD detection (especially in severity levels lower than 6), without needing any training or fine-tuning
with regard to the dataset. This observation is significant because it means CLIP could be used as a zero-shot C-OOD
detection algorithm without the need to train on the ID classes. This also allows the user to change the definition
of which classes are considered ID in a flexible manner without the need to retrain the detector. To the best of our
knowledge, we are the first to make the observation that CLIP can serve as a capable zero-shot detector on its own,
without further training, additional components, or knowledge of the possible OOD classes in advance. For more details,
see Appendix D.
Figure 6: Architecture accuracy vs. mean C-OOD AUROC performance. In the legend, the pair of numbers next to each
architecture name corresponds to the Spearman correlation and the number of networks tested from that architecture
family (most samples are too small to draw any specific conclusions). Accuracy appears to have a high correlation with
the C-OOD detection performance, with a Spearman correlation of 0.65.
4) Accuracy is the factor most correlated with C-OOD detection. We observe that accuracy is typically a good
indicator of the model's performance in C-OOD detection at most severity levels [s0 − s8], with Spearman correlation
values in the range of [0.6, 0.73] at those levels (see Figure 12 in Appendix E). The scatter plot in Figure 6 shows the
relationship between the architecture accuracy and its C-OOD detection performance. When grouping the networks
by architecture, we notice that most architectures also follow this trend. When measuring the correlation between
AUROC and accuracy among only the 20% most accurate models, however, the Spearman correlation drops to a range
of [0.34, 0.43] (see Figure 13 in Appendix E).
5) In-distribution ranking performance is positively correlated with C-OOD detection. The next best indicative
factor correlated with C-OOD detection performance after accuracy is the model's in-distribution ranking performance
("ID AUROC", see Appendix A), with Spearman correlation values in the range of [0.4, 0.5]. When measuring the
correlation between AUROC and ID AUROC among only the 20% most accurate models, however, the Spearman
correlation increases to a range of [0.54, 0.77]; see Appendix E for more details.
6) Most OOD classes appear in every severity level i ∈ [0, 10] for at least one model, with the exception of some
classes that appear to reach severity level 10 for most or even all models (e.g., Viceroy Butterfly, depicted in Figure 3 in
Section 4). This observation suggests that "OOD hardness" is usually subjective, and changes greatly across different
models.
7
55606570758085907075808590ModelsVarious (0.59, 363) AlexNet (-, 1)ResNet (0.74, 34) EfficientNet (0.55, 52) Twins (-0.94, 6)ViT (0.76, 30)MLP Mixer (0.80, 4) NesT (-1.00, 3) ShuffleNetV2 (1.00, 2) SqueezeNet (1.00, 2) Swin (0.89, 6) EfficientNetV2 (0.82, 15) BiT (0.60, 9)AccuracyC-OOD AUROC (detection)Spearman correlation 0.657) The ranking of the best C-OOD detection models tends to remain similar across severity levels. This means
that when selecting the best model for deployment, it is usually enough to observe its performance on only a few
severity levels; see Appendix F. Note that this conclusion is only true when leaving the κ confidnece function fixed (see
below).
8) ODIN offers significant improvements over softmax for most models. In addition to evaluating with softmax as
the κ confidence function, we evaluate a few additional methods to serve as κ functions: ODIN, entropy, MC dropout
and "max-logit" (not applying softmax). For each model f and κ we re-ran the algorithm described in Section 3 to
benchmark (f, κ) (we do this because using the same C-OOD groups produced when using softmax might give an
unfair advantage to other κ functions); see Appendix G for more technical details.
Figure 7: Relative improvement gain in C-OOD detection performance when using ODIN instead of softmax. Each
point represents an evaluated model. The green shaded area indicates the area of positive improvement.
Figure 7 shows each model's improvement when using ODIN rather than softmax, from which it is visible that the
improvement has a high variance: some models benefit significantly from using ODIN, while it is detrimental to
other models. Furthermore, whether or not a model benefits from ODIN changes across different levels of severity.
For example, applying ODIN instead of softmax to ViT-L/32-384 barely improves detection when at severity level
0 (AUROC improves by 0.4%), but it significantly improves its detection as the severity level increases (for severity
level 10, AUROC improves by 9%). Other models' detection performance, on the other hand, may decrease as severity
increases (see Figure 7 for examples). These facts suggest that the pair of (model, κ) needs to be considered with
respect to the task and severity level relevant to it. Moreover, it may be that the κ function hyperparameters need to be
optimized specifically for the desired severity level.
9) Not applying softmax can improve some models significantly, although most are harmed by it. Figure 16 in
Appendix G depicts the effect of not applying softmax, which we dub "max-logit". While most models are harmed
by using max-logit instead of softmax, some models are significantly benefited. ViTs, which already outperform all
other models, perform significantly better when softmax is not applied, with ViT-L/32-384 improving by 10.6%. It is
worth mentioning that of all the (model,κ) pairs evaluated in this paper, ViT-L/32-384 applied with max-logit achieve
the best detection performance. Interestingly, regardless of the κ function evaluated, ViT-L/32-384 demonstrated
the best detection performance. In Figure 8, we plot its performance across all severity levels using each of the κ
functions we consider. Also, as noted in Appendix G, the hyperparameters used for ODIN when applied to ViT were
not optimized specifically to it. Performance by using ODIN may improve beyond max-logit with model-specific
optimization. Observing that max-logit could be so beneficial for a subset of models while being harmful to most other
models was made possible thanks to the scale of our study.
8
s0s1s2s3s4s5s6s7s8s9s10−8−6−4−20246810Severity LevelAUROC Improvement (%)Models:ViT-L/32-384 ResNet-50AlexNetFigure 8: OOD detection performance of ViT-L/32-384, the best model evaluated using each of the κ functions we
consider.
10) Using entropy as a confidence function κ improves C-OOD detection performance in most cases. We compare
the performance gain from switching to using entropy instead of the softmax score. The results are depicted in Figure 17
in Appendix G. We note that, in most cases, using entropy improves the detection performance. 1
11) MC dropout improves detection, especially for low levels of severity. We evaluate MC dropout Gal & Ghahra-
mani (2016) in the context of C-OOD detection. We use 30 dropout-enabled forward passes. The mean softmax score of
these passes is calculated and then a predictive entropy score is used as the final uncertainty estimate. The improvements
when using MC dropout instead of softmax across all severity levels are depicted in Figure 18 in Appendix G using
box plots. We find that MC dropout improves performance, especially so at lower levels of severity. The improvement
becomes less significant as severity increases. Similar to ODIN, MC dropout seems to improve some models more
significantly at lower severity levels (e.g., MobileNets (Howard et al., 2019)) , while other models are improved more
significantly by MC dropout at higher severity levels (e.g., ViTs). We further analyze MC dropout and recall that it
comprises two main components: (a) dropout-enabled forward passes and (b) entropy of the mean probability vector
from the forward passes. To test which component contributes the most to the perceived gains, we compare the C-OOD
detection performance when using MC dropout to the C-OOD detection performance when using just entropy (with no
multiple dropout-enabled forward passes). The results of this comparison are plotted in Figure 19 in Appendix G. We
find that MC dropout slightly improves upon entropy at most severity levels, especially at lower ones, with few outliers
being either significantly improved or harmed.
6 Concluding remarks
We introduced a novel approach to benchmarking the performance of classifiers in detecting C-OODs. In contrast to
existing techniques, the proposed method allows for unbiased measurements against specific models or confidence
functions. A key feature of the proposed benchmarking procedure is that it allows for graded measurements of class
out-of-distribution levels of severity. Using this property, we can identify trends in detection robustness that are
otherwise impossible to detect. In addition to opening new avenues for future research, the proposed method can be
used to draw more precise conclusions about the performance of various models and detection techniques.
Using our new benchmarking procedure, we offered numerous interesting observations that merit further investigation
into how to improve C-OOD detection. Among the interesting questions raised is why is knowledge distillation
beneficial to boosting detection performance, and how can we enhance its robustness to C-OODs? What can we learn
from the architectures that were inclined to perform well in C-OOD detection, such as ViT and CLIP? Finally, could
detection methods be crafted and optimized for specific severity levels, or can they be modified to be so by changing a
hyperparameter?
1Entropy is maximal when the distribution given by the model for P (y|x) is uniform, which implies high uncertainty. To convert
entropy into a confidence signal, which should increase as the uncertainty decreases, we use negative entropy.
9
s0s1s2s3s4s5s6s7s8s9s100.70.750.80.850.90.951Severity LevelsC-OOD AUROC (detection)Confidence Function:Softmax - ViT L/32-384Max-logit - ViT L/32-384Entropy - ViT L/32-384Monte-Carlo dropout - ViT L/32-384ODIN - ViT L/32-384Acknowledgments
This research was partially supported by the Israel Science Foundation, grant No. 710/18.
References
Christoph Berger, Magdalini Paschali, Ben Glocker, and Konstantinos Kamnitsas. Confidence-based out-of-distribution
detection: A comparative study and analysis. In Carole H. Sudre, Roxane Licandro, Christian F. Baumgartner, Andrew
Melbourne, Adrian V. Dalca, Jana Hutter, Ryutaro Tanno, Esra Abaci Turk, Koen Van Leemput, Jordina Torrents-
Barrena, William M. Wells III, and Christopher K. Macgowan (eds.), Uncertainty for Safe Utilization of Machine
Learning in Medical Imaging, and Perinatal Imaging, Placental and Preterm Image Analysis - 3rd International
Workshop, UNSURE 2021, and 6th International Workshop, PIPPI 2021 Held in Conjunction with MICCAI 2021,
Strasbourg, France, October 1, 2021, Proceedings, volume 12959 of Lecture Notes in Computer Science, pp. 122–132.
Springer, 2021. doi: 10.1007/978-3-030-87735-4\ 12. URL https://doi.org/10.1007/978-3-030-87735-4 12.
Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets without pre-training
or strong data augmentations. In The Tenth International Conference on Learning Representations, ICLR 2022,
Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=LtKcMgGOeLt.
Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Twins:
Revisiting the design of spatial attention in vision transformers, 2021.
L. P. Cordella, C. De Stefano, F. Tortorella, and M. Vento. A method for improving classification reliability of multilayer
perceptrons. IEEE Transactions on Neural Networks, 6(5):1140–1147, 1995. doi: 10.1109/72.410358.
C. De Stefano, C. Sansone, and M. Vento. To reject or not to reject: that is the question-an answer in case of neural
classifiers. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 30(1):84–94,
2000. doi: 10.1109/5326.827457.
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image
In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255, 2009. doi:
database.
10.1109/CVPR.2009.5206848.
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
In 9th International Conference
image is worth 16x16 words: Transformers for image recognition at scale.
on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL
https://openreview.net/forum?id=YicbFdNTTy.
Sepideh Esmaeilpour, Bing Liu, Eric Robertson, and Lei Shu. Zero-shot out-of-distribution detection based on the
pre-trained model CLIP. In Thirty-Sixth AAAI Conference on Artificial Intelligence, AAAI 2022, Thirty-Fourth
Conference on Innovative Applications of Artificial Intelligence, IAAI 2022, The Twelveth Symposium on Educational
Advances in Artificial Intelligence, EAAI 2022 Virtual Event, February 22 - March 1, 2022, pp. 6568–6576. AAAI
Press, 2022. URL https://ojs.aaai.org/index.php/AAAI/article/view/20610.
Tom Fawcett. An introduction to roc analysis. Pattern Recognition Letters, 27(8):861–874, 2006.
ISSN 0167-
8655. doi: https://doi.org/10.1016/j.patrec.2005.10.010. URL https://www.sciencedirect.com/science/article/pii/
S016786550500303X. ROC Analysis in Pattern Recognition.
Stanislav Fort, Jie Ren, and Balaji Lakshminarayanan. Exploring the limits of out-of-distribution detection.
In
Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan (eds.),
Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing
Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 7068–7081, 2021. URL https://proceedings.neurips.
cc/paper/2021/hash/3941c4358616274ac2436eacf67fae05-Abstract.html.
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep
learning. 2016.
Ido Galil, Mohammed Dabbah, and Ran El-Yaniv. What can we learn from the selective prediction and uncertainty
estimation performance of 523 imagenet classifiers? In International Conference on Learning Representations, 2023.
URL https://openreview.net/forum?id=p66AzKi6Xim.
Shang-Hua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip Torr. Res2net: A new
multi-scale backbone architecture. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(2):652–662,
Feb 2021. ISSN 1939-3539. doi: 10.1109/tpami.2019.2938758. URL http://dx.doi.org/10.1109/TPAMI.2019.
2938758.
10
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In Yoshua
Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego,
CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6572.
Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural
networks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26,
2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id=Hkg4TI9xl.
Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In
IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021, pp. 15262–
15271. Computer Vision Foundation / IEEE, 2021. URL https://openaccess.thecvf.com/content/CVPR2021/html/
Hendrycks Natural Adversarial Examples CVPR 2021 paper.html.
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015.
Andrew Howard, Ruoming Pang, Hartwig Adam, Quoc V. Le, Mark Sandler, Bo Chen, Weijun Wang, Liang-Chieh
Chen, Mingxing Tan, Grace Chu, Vijay Vasudevan, and Yukun Zhu. Searching for mobilenetv3. In 2019 IEEE/CVF
International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp.
1314–1324. IEEE, 2019. doi: 10.1109/ICCV.2019.00140. URL https://doi.org/10.1109/ICCV.2019.00140.
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution
samples and adversarial attacks. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicol`o
Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference
on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montr ́eal, Canada, pp. 7167–
7177, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/abdeb6f575ac5c6676b747bca8d09cc2-Abstract.
html.
Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural
networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=
H1VGkIxRZ.
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen,
Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary
DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and
Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library.
In H. Wallach,
H. Larochelle, A. Beygelzimer, F. d'Alch ́e-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Informa-
tion Processing Systems 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/
9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf.
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. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International
Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of
Machine Learning Research, pp. 8748–8763. PMLR, 2021. URL http://proceedings.mlr.press/v139/radford21a.html.
Tal Ridnik, Emanuel Ben Baruch, Asaf Noy, and Lihi Zelnik.
the
In Joaquin Vanschoren and Sai-Kit Yeung (eds.), Proceedings of the Neural Information Pro-
masses.
cessing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, De-
cember 2021, virtual, 2021.
URL https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/hash/
98f13708210194c475687be6106a3b84-Abstract-round1.html.
Imagenet-21k pretraining for
David B. Ritland and Lincoln P. Brower. The viceroy butterfly is not a batesian mimic. Nature, 350(6318):497–498,
Apr 1991. ISSN 1476-4687. doi: 10.1038/350497a0. URL https://doi.org/10.1038/350497a0.
Walter J. Scheirer, Anderson de Rezende Rocha, Archana Sapkota, and Terrance E. Boult. Toward open set recognition.
IEEE Trans. Pattern Anal. Mach. Intell., 35(7):1757–1772, 2013. doi: 10.1109/TPAMI.2012.256. URL https:
//doi.org/10.1109/TPAMI.2012.256.
Gabi Shalev, Yossi Adi, and Joseph Keshet. Out-of-distribution detection using multiple semantic label representations.
In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicol`o Cesa-Bianchi, and Roman
Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information
Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montr ́eal, Canada, pp. 7386–7396, 2018. URL
https://proceedings.neurips.cc/paper/2018/hash/2151b4c76b4dcb048d06a5c32942b6f6-Abstract.html.
Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek Kosaraju, Dhruv
Mahajan, Ross B. Girshick, Piotr Doll ́ar, and Laurens van der Maaten. Revisiting weakly supervised pre-training of
visual perception models. CoRR, abs/2201.08371, 2022. URL https://arxiv.org/abs/2201.08371.
11
Andreas Peter Steiner, Alexander Kolesnikov, Xiaohua Zhai, Ross Wightman, Jakob Uszkoreit, and Lucas Beyer. How
to train your vit? data, augmentation, and regularization in vision transformers. Transactions on Machine Learning
Research, 2022. URL https://openreview.net/forum?id=4nPswr1KcP.
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Herv ́e J ́egou. Train-
ing data-efficient image transformers & distillation through attention. In Marina Meila and Tong Zhang (eds.),
Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Vir-
tual Event, volume 139 of Proceedings of Machine Learning Research, pp. 10347–10357. PMLR, 2021. URL
http://proceedings.mlr.press/v139/touvron21a.html.
Hugo Touvron, Matthieu Cord, and Herv ́e J ́egou. Deit III: revenge of the vit. CoRR, abs/2204.07118, 2022. doi:
10.48550/arXiv.2204.07118. URL https://doi.org/10.48550/arXiv.2204.07118.
Ross Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019.
I. Zeki Yalniz, Herv ́e J ́egou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi-supervised learning
for image classification. CoRR, abs/1905.00546, 2019. URL http://arxiv.org/abs/1905.00546.
Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Haibin Lin, Zhi Zhang, Yue Sun, Tong He, Jonas Mueller,
R. Manmatha, Mu Li, and Alexander Smola. Resnest: Split-attention networks, 2020.
A Defining in-distribution AUROC
We follow Galil et al. (2023) in defining in-dsitribution AUROC ("ID AUROC"). ID AUROC is defined similarly to
Equation 1, but discriminating between correct and incorrect predictions instead of discriminating between ID and
OOD instances.
For every two random samples (x1, y1), (x2, y2) ∼ P (X , Y) and given that (cid:96)(f (x1), y1) > (cid:96)(f (x2), y2), the ranking
performance of κ is defined as the probability that κ ranks x2 higher than x1:
Pr[κ(x1, ˆy|f ) < κ(x2, ˆy|f )|(cid:96)(f (x1), y1) > (cid:96)(f (x2), y2)]
(2)
When the 0/1 loss is in play, it is known that AUROC in fact equals the probability in Equation (2) (Fawcett, 2006) and
thus is a proper metric to measure ranking in classification (AKA ID AUROC or discrimination).
B Comparing Models' Performance Using Our Framework
The proposed framework allows for a fair comparison of models in terms of model-specific difficulty, rather than
a fixed set of OOD classes chosen according to some (possibly arbitrary) criterion. This is because the framework
evaluates each model's performance on tailored benchmarks. This approach provides a more accurate representation
of the model's own performance. As the famous quote goes, "You can't judge a fish by its ability to climb a tree".
Rephrasing this quote to adapt it to our discussion: if we want to compare a fish with a monkey on what is hardest for
each of them, we should judge the fish by its ability to climb a tree and the monkey's ability to swim (although we are
aware that some monkeys can swim). Our framework constructs specialized tests for both.
That being said, by considering the construction of severity levels (per model), it is possible (neglecting estimation
error of the estimation sets c ̄y
est) to compare the performance of two models specifically for the classes populating their
maximal severity (severity 10):
(1) Suppose that model A has better performance (AUROC) on its own group Z of hardest classes (severity 10) than
model B's performance on its own severity 10 classes, denoted K. Assume that K does not equal Z (otherwise we are
done). Thus, AUROC(A, Z) > AUROC(B, K).
(2) By construction of severity groups, for every set of classes R (cid:54)= Z, AUROC(A, R) ≥ AUROC(A, Z) (since Z
is the set of hardest classes for model A). This holds true for any set of classes R, including the set K. Therefore,
AUROC(A, K) ≥ AUROC(A, Z).
By combining (1) and (2) we get that AUROC(A, K) ≥ AUROC(A, Z) > AUROC(B, K) ⇒ AUROC(A, K) >
AUROC(B, K), meaning that for the same set of classes K, model A performs better than model B.
A "mirror" argument could be crafted to compare the models' performance on the classes populating their minimal
severity (severity 0).
12
Figure 9: Number of architecture parameters vs. C-OOD AUROC performance at severity level 5 (median severity).
The pair of numbers next to each architecture name in the legend corresponds to its Spearman correlation and the
number of models tested from that architecture (family), respectively. Note that specific ViT transformers are also the
best when considering a model size limitation. Vertical lines indicate the sizes of ResNet-50 (left vertical line) and
ResNet-101 (right vertical line).
C Per-size Performance Comparison
The scatter plot in Figure 9 shows the relationship between the # of architecture parameters and its C-OOD AUROC
performance. Overall, there is a moderate Spearman correlation of 0.45 between #parameters and the C-OOD
performance when considering all tested networks. When grouping the networks by architecture families, however, we
see that some architectures have high correlation between their model size and their C-OOD AUROC. Architecture
families that exhibit this behavior are, for example, ViTs, Swins, EffecientNetV2 and ResNets whose correlations are
0.91, 0.94, 0.89, and 0.79, respectively. Other families exhibit moderate correlations, e.g., EffecientNet(V1) with a
0.47 Spearman correlation. Some architectures, on the other hand, have strong negative correlation, e.g., Twins Chu
et al. (2021), NesT Zhang et al. (2020) and Res2Net Gao et al. (2021), whose correlations are -0.94,-1.0, and -0.85,
respectively.
Additionally, we note that the subset of ViT models mentioned in Section 5 are also the best even when considering a
model size limitation.
D Zero-shot C-OOD detection with CLIP
To evaluate CLIP on ImageNet, we first prepare it
following the code provided by its authors
(https://github.com/openai/CLIP): The labels of ImageNet-1k are encoded into normalized embedding vectors. At
inference time, the incoming image is encoded into another normalized embedding vector. A cosine similarity is then
calculated between each label-embedding vector and the image-embedding vector. The highest similarity score is then
taken as the confidence score for that prediction.
To evaluate CLIP's C-OOD performance, we re-run the algorithm described in Section 3 to benchmark
(CLIP, κcosine similarity). The best-performing instance of CLIP (ResNet-50x64) outperforms 96% of all other
models (measured by its mean AUROC over all severity levels). In Figure 10 we visualize this CLIP's performance
across all severity levels, in comparison to all other models. Interestingly, CLIP's relative advantage over other models
decreases as the severity increases, and at severity 10, it is even lower than the median. The same is observed in
13
1314151617181920217075808590ModelsVarious (0.45, 318)AlexNet (-, 1)ResNet (0.79, 33)EfficientNet (0.47, 52)Twins (-0.94, 6)ViT (0.91, 21)MLP Mixer (-0.32, 4)NesT (-1.00, 3)ShuffleNetV2 (1.00, 2)SqueezeNet (-1.00, 2)Swin (0.94, 6)Res2Net (-0.85, 9)EfficientNetV2 (0.89, 15)BiT (0.64, 9)log10 Parameters #C-OOD AUROC (detection)Spearman correlation 0.45Figure 10: The same graph as in Figure 1, but with an additional lime-colored curve for CLIP ResNet-50x64. Note that
as severity levels increase, CLIP's detection advantage is greatly reduced.
Figure 11 which depicts a comparison between three identical ResNet-50 models that were trained with three different
training regimes, one of them being CLIP. CLIP outperforms its competition up to severity 6 (with a significant margin
in lower severity levels), and then underperforms. We hypothesize the degradation in CLIP's performance for higher
severity levels happens due to an increase in the number of OOD classes that are descriptively similar to ID classes
at higher levels of severity. For example, when examining different types of butterflies from Figure 3, the string text
of "monarch butterfly" is very similar to the string text of "viceroy butterfly", simply due to both sharing the word
"butterfly". Other butterflies that are less visually similar might be "confused" by CLIP and classified as monarch
butterflies, simply because they are also defined as butterflies, making their cosine similarity with the text "monarch
butterfly" higher. Common image classifiers, on the other hand, may confuse different butterflies if they appear visually
similar and share many distinguishable features, but are not affected by the fact both classes are defined as "butterflies".
We also observe that while CLIPs with a confidence function κcosine similarity perform very well at C-OOD detection,
their ID ranking is worse than other models. Using softmax and\or adding a linear-probe (as described in Radford
et al. (2021)) improves ID ranking significantly, but results in mediocre C-OOD detection performance. We believe that
this suggests the multimodal nature of CLIP is a crucial component of its C-OOD detection performance, and that the
scaling effect of softmax hinders the partial order induced on OOD and ID instances.
In Fort et al. (2021), it was suggested that CLIP be used as a zero-shot OOD detection algorithm. Their suggested
method, however, requires knowledge of the possible OOD classes in advance. The authors of Esmaeilpour et al. (2022)
suggested to use an additional captioning model, which is fine-tuned on some large dataset (which hopefully contains
knowledge of the OOD classes that might emerge during inference), instead. Our suggested approach, in contrast,
requires no knowledge, no fine-tuning and no models other than CLIP itself.
E Correlations of Various Factors with C-OOD Detection Performance
We searched for factors that could be indicative of or correlated with good performance in C-OOD detection. To this
end, we measure the correlations of various factors with the C-OOD detection AUROC performance across all levels of
severity. The results can be seen in the graphs in Figure 12. We observe that accuracy is typically a good indicator of
the model's performance in C-OOD detection at most severity levels (s0 − s8), with Spearman correlation values in
[0.6, 0.73] at those levels (see Figure 12). When measuring the correlation between AUROC and accuracy among only
the 20% most accurate models, however, the Spearman correlation drops to a range of [0.34, 0.43] (see Figure 13).
14
s0s1s2s3s4s5s6s7s8s9s10ImageNet-O30405060708090100Severity LevelC-OOD AUROC (detection)Models:ViT-L/32-384ResNet-50 AlexNet CLIP ResNet-50x64Figure 11: A comparison of three identical ResNet-50 models trained with different training regimes: (1) The orange-
colored curve represents a ResNet-50 model trained on ImageNet-1k with Torchvision's recipe; (2) the purple-colored
curve represents a ResNet-50 model trained with a semi-supervised regime (Yalniz et al., 2019); and (3) the lime-colored
curve represents a ResNet-50 trained with CLIP.
The next best indicative factors are the ID ranking performance ("ID AUROC"), number of parameters, and the input
image size (moderate correlations). Finally, the embedding size is only weakly correlated.
Figure 14 shows a scatter plot of in-distribution ranking performance and C-OOD detection performance of all evaluated
models. The overall Spearman correlation is 0.43. The legend indicates correlations obtained by specific architecture
families. Interestingly, ID AUROC exhibits slightly increasing correlation up to severity s9, and at s10 becomes the
most indicative factor for C-OOD detection performance. In contrast, all other investigated factors lose their indicative
power at the highest severity levels (s9, s10). Moreover, when measuring the correlation between AUROC and ID
AUROC among only the 20% most accurate models, the Spearman correlation increases to a range of [0.54, 0.77],
making it the most indicative factor for C-OOD detection among such models (see Figure 13).
F Correlation between Rankings of Multiple Severity Levels
Since we use multiple benchmarks for C-OOD detection (i.e., the 11 severity levels), to test the performance models in
C-OOD detection, and each severity level may rank the models differently (i.e. the best performers for each severity
level may vary), we now consider the question of how these rankings change across severity levels. To this end we
calculated the correlations between the rankings obtained at different severity levels. The resulting correlation matrix
can be seen in Figure 15. Overall, we observe high correlations, which means that different severity levels generally
yield similar rankings of the models. This means that when selecting the best model for deployment, it is usually
enough to observe its performance on only a few severity levels.
We also notice that for each severity level si, the correlation with sj is higher the closer j is to i. This is not surprising
and might be anticipated because adjacent severity levels have close severity scores by design.
G Comparison of different confidence functions
This section contains additional technical details and figures related to our comparison of ODIN, max-logit, entropy and
MC dropout. Our main conclusions are presented in Section 5 of the main text.
To use MC dropout, we first use 30 dropout-enabled forward passes. The mean softmax score of these passes is
calculated and then a predictive entropy score is used as the final uncertainty estimate.
15
s0s1s2s3s4s5s6s7s8s9s100.50.60.70.80.91Severity LevelsC-OOD AUROC (detection)Model:ResNet-50 - TorchvisionResNet-50 - Semi-supervised learningResNet-50 - CLIPFigure 12: Spearman correlations between C-OOD detection AUROC and Accuracy, ID-AUROC, #parameters, input
size, and embedding size across all severity levels.
Figure 13: Spearman correlations between C-OOD detection AUROC and Accuracy, ID-AUROC, #parameters, input
size, and embedding size across all severity levels, among only the 20% most accurate models.
When using ODIN, we use a temperature of 2 and set (cid:15) to be 1 * 10−5. We obtained these hyperparameters by using a
simple grid search over a validation set, and using seven models of different architectures of the entire sample of models
evaluated. Our objective was to find the hyperparameters that improve the mean AUROC across all severity levels the
most. We believe that fine-tuning the hyperparameters with the specific model and severity levels in mind may allow for
better results.
16
s0s1s2s3s4s5s6s7s8s9s100.10.20.30.40.50.60.7Severity LevelsSpearman CorrelationAccuracyID AUROC log(#Parameters) Input Sizes0s1s2s3s4s5s6s7s8s9s10−0.100.10.20.30.40.50.60.70.8Severity LevelsSpearman CorrelationAccuracyID AUROC log(#Parameters) Input SizeFigure 14: The x-axis represents ID ranking performance (measured by AUROC), and the y-axis represents C-OOD
detection performance in severity 5 (higher is better). The legend indicates correlations, by specific architecture families,
with the number on the right representing sample size, and the one on the left representing the correlation between ID
ranking and detection.
Figure 15: Spearman correlation between the rankings of the models given by different severity levels.
17
767880828486887075808590ID AUROCC-OOD AUROCVarious (0.40, 388) AlexNet (-, 1)ResNet (0.16, 33) ViT (0.74, 21) MLP Mixer (1.00, 4) ShuffleNetV2 (1.00, 2) SqueezeNet (1.00, 2) Swin (0.83, 6) EfficientNetV2 (-0.46, 15) BiT (0.32, 9)Models (Spearman correlation per family, number of models)(detection)Overall Spearman correlation 0.43s0s1s2s3s4s5s6s7s8s9s10s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 Spearman correlation1.00.9650.9280.8820.8540.8460.8310.8150.7870.690.3760.9651.00.9860.9550.9310.9180.90.8790.8460.7390.4160.9280.9861.00.9850.9680.9550.9380.9150.8830.7790.4610.8820.9550.9851.00.9910.980.9660.9460.9160.8240.5130.8540.9310.9680.9911.00.9930.9830.9690.9440.860.5490.8460.9180.9550.980.9931.00.9930.9830.9630.8880.5760.8310.90.9380.9660.9830.9931.00.9920.9790.9130.6030.8150.8790.9150.9460.9690.9830.9921.00.9890.9390.6340.7870.8460.8830.9160.9440.9630.9790.9891.00.9610.6750.690.7390.7790.8240.860.8880.9130.9390.9611.00.8120.3760.4160.4610.5130.5490.5760.6030.6340.6750.8121.0Figure 16: Relative improvement gain in C-OOD detection performance when using max-logit instead of softmax (i.e.,
not applying softmax). In median terms, using max-logit harms performance over softmax for most evaluated models.
However, some models (e.g., ViTs) greatly benefit from not applying softmax. The green shaded area indicates the area
of positive improvement.
Figure 17: Relative improvement gain in C-OOD detection performance when using entropy instead of softmax. In
median terms, entropy offers positive improvement over softmax for most levels of severity except s ∈ {7, 8, 9}. The
green shaded area indicates the area of positive improvement.
18
s0s1s2s3s4s5s6s7s8s9s10−20−15−10−50510Improvement by using max-logit instead of softmax (i.e. not applying softmax)Severity LevelsImprovement % in C-OOD AUROC (detection)s0s1s2s3s4s5s6s7s8s9s10−10−505Severity LevelsImprovement % in C-OOD AUROC (detection)Improvement by using entropy instead of softmaxFigure 18: Relative improvement gain in C-OOD detection performance when using MC dropout instead of softmax.
We find that MC dropout improves performance, especially at lower levels of severity. The improvement becomes less
significant as severity increases.
Figure 19: Relative improvement gain in C-OOD detection performance when using MC dropout instead of entropy.
19
s0s1s2s3s4s5s6s7s8s9s10−6−4−20246Severity LevelsImprovement % in C-OOD AUROC (detection)Improvement by using MC-dropout instead of softmaxs0s1s2s3s4s5s6s7s8s9s10−4−3−2−101234Severity LevelsImprovement % in C-OOD AUROC (detection)Improvement by using MC-dropout instead of entropy |
|
http://arxiv.org/abs/2302.12258v1 | 2023-02-23T09:51:03 | 2023-02-23T09:51:03 | Data leakage in cross-modal retrieval training: A case study | The recent progress in text-based audio retrieval was largely propelled by
the release of suitable datasets. Since the manual creation of such datasets is
a laborious task, obtaining data from online resources can be a cheap solution
to create large-scale datasets. We study the recently proposed SoundDesc
benchmark dataset, which was automatically sourced from the BBC Sound Effects
web page. In our analysis, we find that SoundDesc contains several duplicates
that cause leakage of training data to the evaluation data. This data leakage
ultimately leads to overly optimistic retrieval performance estimates in
previous benchmarks. We propose new training, validation, and testing splits
for the dataset that we make available online. To avoid weak contamination of
the test data, we pool audio files that share similar recording setups. In our
experiments, we find that the new splits serve as a more challenging benchmark. | [
"Benno Weck",
"Xavier Serra"
] | 10.1109/ICASSP49357.2023.10094617 | [
{
"@title": "doi",
"@href": "http://dx.doi.org/10.1109/ICASSP49357.2023.10094617",
"@rel": "related",
"@type": null
},
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12258v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12258v1",
"@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.CL",
"cs.IR",
"cs.LG",
"eess.AS"
] | 3
2
0
2
b
e
F
3
2
]
D
S
.
s
c
[
1
v
8
5
2
2
1
.
2
0
3
2
:
v
i
X
r
a
DATA LEAKAGE IN CROSS-MODAL RETRIEVAL TRAINING: A CASE STUDY
Benno Weck1,2, Xavier Serra2
1 Huawei Technologies, Munich Research Center, Germany
[email protected]
2 Universitat Pompeu Fabra, Music Technology Group, Spain
[email protected], [email protected]
ABSTRACT
The recent progress in text-based audio retrieval was largely
propelled by the release of suitable datasets. Since the man-
ual creation of such datasets is a laborious task, obtaining data
from online resources can be a cheap solution to create large-
scale datasets. We study the recently proposed SoundDesc
benchmark dataset, which was automatically sourced from
the BBC Sound Effects web page. In our analysis, we find
that SoundDesc contains several duplicates that cause leakage
of training data to the evaluation data. This data leakage ul-
timately leads to overly optimistic retrieval performance esti-
mates in previous benchmarks. We propose new training, val-
idation, and testing splits for the dataset that we make avail-
able online. To avoid weak contamination of the test data,
we pool audio files that share similar recording setups. In our
experiments, we find that the new splits serve as a more chal-
lenging benchmark.
Index Terms- text-based audio retrieval, cross-modal,
duplicates, data leakage, deep learning
1. INTRODUCTION
Retrieving audio through textual search queries was tradition-
ally approached by extracting metadata from all audio files in
the collection and selecting items by text-based matching al-
gorithms. With the advent of deep-learning-based methods, it
became feasible to map search queries directly into the audio
content domain in order to retrieve items at a large scale. This
form of content-based audio retrieval is commonly referred to
as text-based audio retrieval.
The research in this relatively young field is mostly driven
by the availability of large-scale datasets. These datasets
serve as a source for the necessary training data and, ad-
ditionally, allow for a comparative evaluation of different
approaches. For text–based audio retrieval, the most com-
monly used datasets are Clotho [1] and AudioCaps [2]. Both
datasets were originally designed for the task of automatic
audio captioning but lend themselves well to cross-modal
retrieval. Nevertheless, there are certain drawbacks to both:
(i) Clotho is limited in size and variability of the audio con-
tent and and (ii) the audio content in AudioCaps is not freely
accessible The recently presented SoundDesc dataset [3] ad-
dresses both shortcomings: it is large in size while keeping a
wide variation in content topics and its audio is freely avail-
able for research purposes. Moreover, the authors propose
it as a benchmark for text-based audio retrieval. The dataset
was sourced from the BBC Sound Effects Archive website1.
Due to the semi-automatic nature of the dataset creation pro-
cess, it is more likely to contain undesired artefacts. We study
the data distribution among the publicly available splits of the
dataset and identify a couple of defects. Primarily, we de-
tect several duplicate recordings. These duplicate recordings
cause an unwanted overlap of the training and the evaluation
part of the dataset, a so-called data leakage. This leakage
ultimately leads to overly optimistic retrieval scores reported
on the test set. We are convinced that these defects need
to be corrected so that no erroneous conclusions are made
and to maximise the potential of the data. This is why, in
this work, we set out to propose an updated version of the
training, validation, and test splits of the SoundDesc dataset.
More specifically, our contributions are as follows:
• We identify duplicates and overlapping recordings in
the dataset using an off-the-shelf audio fingerprinting
system.
• We show that these duplicates lead to a data leakage
problem and overly optimistic retrieval scores.
• We propose new dataset splits that avoid weak con-
tamination between development and evaluation data
by grouping recordings that potentially share the same
recording process.
• We make the new splits available online.2
1https://sound-effects.bbcrewind.co.uk/
2https://doi.org/10.5281/zenodo.7665917
2. RELATED WORK
2.1. Text-based audio retrieval
Text-based audio retrieval (sometimes also called language-
based audio retrieval) can be described as the problem of
ranking a set of audio files according to how closely they
match a free-form query text. This is a form of a cross-modal
retrieval between two modalities, namely natural language
text and audio. For this task, text queries are usually provided
as single-sentence descriptions of the audio, also referred to
as captions. A common approach in cross-modal retrieval is
to employ a separate encoder model for each modality and
map the respective outputs to a common representation space.
All submission in the Language-based audio retrieval task of
the DCASE 2022 challenge [4] used this model architecture.
Often these bi-encoder architectures rely on pretrained audio
and text models [3, 5, 6].
2.2. Dataset curation
The goal of machine learning is to build a system that can
generalise, i.e. perform well on previously unseen input data
[7]. To judge this generalisation capability, machine learning
practitioners usually keep a part of their data as a held-out
set for evaluation. This is commonly referred to as training
and test splits of a dataset. We usually assume that training
and test data are independent of each other and identically
distributed.
If information about the evaluation data is ac-
cessible to the machine learning model during training, these
assumptions are violated and we speak of data leakage [8].
This problem was studied in the context of audio datasets.
For example, Sturm [9] uncovers several problems in a bench-
mark dataset widely used in music information retrieval re-
search. They find some exact duplicates in the dataset and
show how certain characteristics of the data can be con-
founded with the ground-truth labels if left uncontrolled. For
instance, filtering the dataset so that all musical excerpts of
an artist are kept in one split can have a significant impact
on the performance measure. This phenomenon is sometimes
called "artist effect" [10].
As a positive example, Fonseca et al. explain their consid-
erations when constructing the splits for the FSD50K dataset
[11] – a dataset collected from the online platform Freesound
[12]. They differentiate between data leakage and weak con-
tamination. In their definition, this contamination can happen
if items in a dataset are similar in some regard even if they
are not the same. Similar to what Sturm [9] describes about
grouping songs of the same artist, they group recordings of
the same content uploader.
3. DATA LEAKAGE IN SOUNDDESC
stumbled across several duplicate audio items3 in the pro-
posed training and test splits. This led us to performing a
more thorough investigation about the general structure of this
dataset and the proposed splits.
3.1. The SoundDesc dataset
The SoundDesc dataset was recently proposed by Koepke et
al. [3]. It is a collection of audio recordings and sound effects
sourced from the BBC Sound Effects Archive website4 and
contains 32979 audio files with associated textual descrip-
tions. Additionally, each item in the dataset is labelled with
one primary category and potentially additional categories.
The authors of the dataset publish the training, validation and
testing splits along with benchmark results on these splits.
3.2. Detecting duplicates and overlapping recordings
To automatically detect duplicates in the dataset, it requires
a system to measure the similarity between recordings. We
employed the publicly available audio fingerprinting software
Panako [13] since it was already successfully used to detect
duplicates in a similar setting [14]. The Panako algorithm was
applied with its default configuration to generate a set of po-
tentially matching audio recording pairs. After manually re-
viewing a small subset, we decided to only keep pairs accord-
ing to the following heuristic to filter out spurious matches:
Pairs are considered duplicates if (i) the number of seconds
containing sub-fingerprint matches exceeds 50% of the total
match duration, and (ii) a score of 25 or higher is required for
a match to be considered.
We are left with 3601 distinct matching pairs. We find
that there are not only exact duplicates but also reprocessed
recordings and recordings with partial overlaps. These over-
laps occur for example at the end and the start of another, or
as one or more excerpts of a longer recording. For simplicity,
we will refer to all cases as duplicates.
3.3. The effect of duplicates on the benchmark results
After finding the duplicates in the dataset we want to assess
their influence on the validity of the performance metrics
measured in the published evaluation split. To do so we
first identify all pairs of duplicates that are split between the
training and the evaluation part (validation & testing) of the
dataset. We then create a new training set that is a subset
of the original by excluding all items that have a duplicate
recording in the evaluation data. This way we can keep the
test set unchanged and compare our results to the dataset
creators' results. In total, we exclude 1388 of the 23085 files
in the training set. To investigate the effect of the reduced
While employing the newly released SoundDesc dataset for
our work on language-based audio retrieval, we accidentally
3For example: https://sound-effects.bbcrewind.co.uk/
search?q=07054072%20OR%2007058026
4https://sound-effects.bbcrewind.co.uk/
training set size, we similarly construct three additional train-
ing sets by excluding the same number of files at random. We
refer to the new training subsets as deduplicated and random,
respectively.
To assess the impact on the model training, in our exper-
iments, we adopt the Collaborative-Experts (CE) [15] model
architecture as it was used by the SoundDesc authors in their
benchmark [3] experiment. An implementation of this model
is released together with the dataset.5 After model training,
we perform retrieval on the entire original test set. Retrieval
performance is measured as the recall at different levels by
considering only the top k elements for each query (R@k).
We report these metrics for the full test set and the subset of
duplicates in the test set (648 items). All results are given in
Table 1 as the mean and the standard deviation computed over
three runs with different random initialisations.
training set
R@1
R@5
R@10
full test set
original
deduplicated
31.3 ± 0.3
26.6 ± 0.6
60.9 ± 0.6
55.5 ± 1.1
70.9 ± 0.7
66.1 ± 0.5
random 1
random 2
random 3
29.9 ± 0.5
29.8 ± 0.4
30.2 ± 0.1
59.1 ± 0.3
58.5 ± 0.3
59.2 ± 0.4
69.2 ± 0.3
68.6 ± 0.5
69.5 ± 0.1
duplicates only
original
deduplicated
52.2 ± 0.9
21.6 ± 0.6
82.8 ± 0.4
49.7 ± 1.8
89.8 ± 0.6
61.4 ± 0.9
random 1
random 2
random 3
49.7 ± 2.5
50.4 ± 0.6
49.8 ± 1.4
80.0 ± 1.2
81.5 ± 1.6
81.0 ± 0.9
87.8 ± 0.6
88.8 ± 0.5
87.9 ± 1.2
Table 1. Comparison of retrieval results for CE models
trained with different training data
From the table, we can see that models trained without ac-
cess to the duplicates in the training set (deduplicated) score
significantly lower in all metrics than models trained with the
full training set (original). This large drop in performance
is most likely only partially due to the fact that the former
models have a smaller training set to learn from since mod-
els trained on a randomly reduced training set (random 1-3)
only suffer a minor hit in performance. This illustrates the
influence of duplicates on the retrieval scores. This effect is
also apparent when only looking at the metrics measured on
test items that have a duplicate in the training set (duplicates
only). Not surprisingly, we find that models can achieve sig-
nificantly higher retrieval scores in the test subset of only du-
plicates than the entire test set when duplicates are left un-
treated (original). For example, more than half of the du-
5https://github.com/akoepke/
audio-retrieval-benchmark/
plicates are retrieved as the highest-ranked result (duplicates
only/original R@1 = 52.2). After deduplication, the scores re-
ported for the subset (deduplicated) are even below the scores
of the entire test set. These findings illustrate that there is
a data leakage problem in the publicly available splits of the
SoundDesc dataset that leads to overly optimistic benchmark
results. We argue that, in its current form, it can not be used
as a benchmark dataset since it does not allow us to measure
if any progress is made in solving the problem of text-based
audio retrieval.
4. PROPOSING A NEW BENCHMARK
To establish a new benchmark on SoundDesc, the flaws dis-
cussed above need to be accounted for when splitting the data.
Additionally, we study if forms of weak contamination of the
test data can be avoided using the metadata associated with
the dataset.
4.1. Treating duplicates
As a minimal improvement, the discovered data leakage in
SoundDesc needs to be fixed. Simply removing the duplicates
from the training set would reduce the dataset size, which is
not the preferred solution. Instead, we propose to partition the
data so that pairs of duplicates remain in the same split. We
form groups of recordings by assigning group labels to each
pair of duplicates and by merging groups that share the same
recording. Items without any duplicates are left ungrouped.
Finally, we split the data and keep 15% for validation and
testing, each. We use stratified sampling to maintain the same
relative category distribution in all splits. We refer to this split
as clean.
4.2. Avoiding weak contamination
A bulk of the SoundDesc is sourced from the BBC natural
history unit (NHU) archive. It comprises a large number of
nature sounds, such as recordings of animals. We surmise
that some of these recordings might have a perceptual like-
ness even if they are no actual duplicates. Especially record-
ings that share the same recording setting could have substan-
tial similarities with each other. For example, if multiple vo-
calisations of a bird are snippets of a long recording session,
In the
they might overlap in ambient noise, loudness, etc.
context of machine learning these overlaps can be considered
unwanted artefacts since those artefacts could favour models
that memorise rather than generalise well. To avoid weak con-
tamination of the test data in SoundDesc we propose to not
split recordings with these kinds of potential overlaps when
partitioning the dataset.
To automatically identify potential groups of recordings,
Date
Recordist name
Topic (start of description)
Description (rest)
1996-11-21
Graham Ross
Camel Market
Camel Market
. . .
Rajasthan Musicians
Rajasthan Musicians
. . .
close-up mournful calls from camel. background voices in crowd.
close-up calls from camel. Sounds of crowd & individual voices.
. . .
medium close-up playing of flutes. Also sounds of drumming. Some background
chatter from crowd.
Sounds of masaks being played. Joined by singers & later drums.
. . .
1977-05-31
Lyndon Bird
Green Tree Frog (Hyla Cinerea)
Green Tree Frog (Hyla Cinerea)
. . .
Chorus close-up with crickets and distant traffic
Chorus close-up with crickets
. . .
Roy Horton
Common Bee Fly (Bombylius Major)
Common Bee Fly (Bombylius Major)
. . .
close-up hum from fly hovering. Birds in background.
close-up hum from fly hovering. Birds in background. Also sheep, cockerel and
voices in background.
. . .
Table 2. Examples of metadata associated with grouped recordings in our proposed split.
we rely on metadata of the NHU archive:6 the date of the
recording, the name of the recordist(s) and the topic of the
recording. The topic is given for all NHU recordings at the
start of the description text and separated from the rest with a
single dash. Recordings that do not have a recording date or
a recordist name associated will be left ungrouped. We can
assign 12444 recordings to groups. Table 2 shows examples
of the resulting groups. We merge the newly defined groups
with the groups of the clean split and use the same stratifica-
tion process to divide the data. We refer to the resulting splits
as group-filtered.
4.3. Benchmark results
To set a benchmark for our proposed splits, we compare the
previously introduced CE model with our own model. Our
system relies on a bi-encoder architecture that has shown
promising results for the task of text-based audio retrieval
[5]. We follow the same training procedure described in our
previous work [5] and only make few minor adjustments to
the model architecture: As an audio encoder, we employ
a pre-trained PANNs model [16] that we keep fixed during
training. The audio embedding sequence extracted by this
encoder is reduced by computing the mean and maximum
across the time dimension and stacking the resulting vectors.
The stacked vectors are then mapped to a dimensionality of
768 using a multi-layer perceptron (MLP). As text encoder,
we employ a pre-trained distilroberta-base [17, 18] model.
We take the first vector in the extracted text embedding se-
quence as the encoder result and similarly process it with an
MLP.
We use the same evaluation metrics as described above.
Table 3 compares the results obtained by the two methods on
each of our proposed splits. It is apparent from the figures
in the table that there are no significant differences between
6This metadata is also accessible through the BBC Sound Ef-
fects Archive website but was not included in the SoundDesc dataset.
training set R@1
R@5
R@10
CE
Ours
CE
Ours
clean split
27.3 ± 0.6
28.0 ± 0.6
55.9 ± 0.4
55.5 ± 0.7
66.5 ± 0.5
65.6 ± 0.6
group-filtered split
20.4 ± 0.6
20.8 ± 0.3
43.9 ± 0.2
44.3 ± 0.8
53.7 ± 0.5
54.2 ± 0.6
Table 3. Comparison of retrieval results achieved by two dif-
ferent methods on our newly proposed SoundDesc splits.
the results achieved by the different models in either of the
splits. As expected, the results for the clean split are in the
range of the results of the experiments with the deduplicated
training data discussed in Section 3.3. Interestingly, the re-
trieval scores are significantly lower when the group-filtered
split is used. This suggests that it is harder to retrieve the cor-
rect recording in this split of the data. A possible explanation
for these results may be that there was indeed weak contami-
nation of the test data present in SoundDesc and models could
make use of overlaps in the data to solve the retrieval problem.
5. CONCLUSION
In this paper, we demonstrated that a data leakage problem
in the publicly available splits of SoundDesc leads to overly
optimistic retrieval results. Using an off-the-shelf audio fin-
gerprinting software, we identified that the data leakage stems
from duplicates in the dataset. We define two new splits for
the dataset: a cleaned split to remove the leakage and a group-
filtered to avoid other kinds of weak contamination of the
test data. From the results achieved by two different retrieval
models, we conclude that our splits of the dataset serve as a
more challenging benchmark for text-based audio retrieval.
human-labeled sound events," IEEE/ACM Transactions
on Audio, Speech, and Language Processing, vol. 30,
pp. 829–852, 2022, Publisher: IEEE.
[12] Frederic Font, Gerard Roma,
and Xavier Serra,
in Proceedings of the
"Freesound Technical Demo,"
21st ACM International Conference on Multimedia,
New York, NY, USA, 2013, MM '13, pp. 411–412,
Association for Computing Machinery,
event-place:
Barcelona, Spain.
[13] Joren Six, "Panako: a scalable audio search system,"
Journal of Open Source Software, vol. 7, no. 78, pp.
4554, Oct. 2022.
[14] Joren Six, Federica Bressan, and Marc Leman, "Ap-
plications of Duplicate Detection in Music Archives:
From Metadata Comparison to Storage Optimisation,"
in Digital Libraries and Multimedia Archives, Giuseppe
Serra and Carlo Tasso, Eds., Cham, 2018, Communi-
cations in Computer and Information Science, pp. 101–
113, Springer International Publishing.
[15] Y. Liu, S. Albanie, A. Nagrani, and A. Zisserman,
"Use What You Have: Video retrieval using represen-
tations from collaborative experts," in arXiv preprint
arxiv:1907.13487, 2019.
[16] Qiuqiang Kong, Yin Cao, Turab Iqbal, Yuxuan Wang,
Wenwu Wang, and Mark D. Plumbley, "PANNs: Large-
Scale Pretrained Audio Neural Networks for Audio Pat-
tern Recognition," IEEE/ACM Transactions on Audio,
Speech, and Language Processing, vol. 28, pp. 2880–
2894, 2020.
[17] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Man-
dar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke
Zettlemoyer, and Veselin Stoyanov, "RoBERTa: A Ro-
bustly Optimized BERT Pretraining Approach," 2019.
[18] Victor Sanh, Lysandre Debut, Julien Chaumond, and
"DistilBERT, a distilled version of
Thomas Wolf,
BERT: smaller, faster, cheaper and lighter," 2019.
6. REFERENCES
[1] Konstantinos Drossos, Samuel Lipping, and Tuomas
Virtanen, "Clotho: an Audio Captioning Dataset," in
ICASSP 2020 - 2020 IEEE International Conference
on Acoustics, Speech and Signal Processing (ICASSP),
Barcelona, Spain, May 2020, pp. 736–740, IEEE.
[2] Chris Dongjoo Kim, Byeongchang Kim, Hyunmin Lee,
and Gunhee Kim, "AudioCaps: Generating Captions
for Audios in The Wild," in NAACL-HLT, 2019.
[3] A. Sophia Koepke, Andreea-Maria Oncescu, Joao Hen-
riques, Zeynep Akata, and Samuel Albanie,
"Audio
retrieval with natural language queries: A benchmark
IEEE Transactions on Multimedia, pp. 1–1,
study,"
2022.
[4] Huang Xie, Samuel Lipping, and Tuomas Virtanen,
"Language-based Audio Retrieval Task in DCASE 2022
Challenge," Accepted at DCASE 2022 Workshop, 2022.
[5] Benno Weck, Miguel P ́erez Fern ́andez, Holger Kirch-
hoff, and Xavier Serra, "Matching Text and Audio Em-
beddings: Exploring Transfer-Learning Strategies for
Language-Based Audio Retrieval," in Proceedings of
the 7th Workshop on Detection and Classification of
Acoustic Scenes and Events 2022, DCASE 2022, Nancy,
France, November 3-4, 2022, Mathieu Lagrange, Anna-
maria Mesaros, Thomas Pellegrini, Ga ̈el Richard, Ro-
main Serizel, and Dan Stowell, Eds. 2022, Tampere Uni-
versity.
[6] Xinhao Mei, Xubo Liu, Jianyuan Sun, Mark Plumbley,
and Wenwu Wang,
"On Metric Learning for Audio-
Text Cross-Modal Retrieval," in Interspeech 2022. Sept.
2022, pp. 4142–4146, ISCA.
[7] Ian Goodfellow, Yoshua Bengio, and Aaron Courville,
Deep Learning, MIT Press, 2016.
[8] Shachar Kaufman, Saharon Rosset, Claudia Perlich, and
Ori Stitelman, "Leakage in data mining: Formulation,
detection, and avoidance," ACM Trans. Knowl. Discov.
Data, vol. 6, no. 4, pp. 15:1–15:21, 2012.
[9] Bob L. Sturm, "The State of the Art Ten Years After a
State of the Art: Future Research in Music Information
Retrieval," Journal of New Music Research, vol. 43, no.
2, pp. 147–172, 2014.
[10] Arthur Flexer and Dominik Schnitzer, "Effects of Al-
bum and Artist Filters in Audio Similarity Computed for
Very Large Music Databases," Comput. Music. J., vol.
34, no. 3, pp. 20–28, 2010.
[11] Eduardo Fonseca, Xavier Favory, Jordi Pons, Frederic
Font, and Xavier Serra, "FSD50K: an open dataset of
|
http://arxiv.org/abs/2302.11883v3 | 2023-03-30T07:09:35 | 2023-02-23T09:42:21 | PIFON-EPT: MR-Based Electrical Property Tomography Using
Physics-Informed Fourier Networks | \textit{Objective:} In this paper, we introduce Physics-Informed Fourier
Networks for Electrical Properties Tomography (PIFON-EPT), a novel deep
learning-based method that solves an inverse scattering problem based on noisy
and/or incomplete magnetic resonance (MR) measurements. \textit{Methods:} We
used two separate fully-connected neural networks, namely $B_1^{+}$ Net and EP
Net, to solve the Helmholtz equation in order to learn a de-noised version of
the input $B_1^{+}$ maps and estimate the object's EP. A random Fourier
features mapping was embedded into $B_1^{+}$ Net, to learn the high-frequency
details of $B_1^{+}$ more efficiently. The two neural networks were trained
jointly by minimizing the combination of a physics-informed loss and a data
mismatch loss via gradient descent. \textit{Results:} We performed several
numerical experiments, showing that PIFON-EPT could provide physically
consistent reconstructions of the EP and transmit field. Even when only $50\%$
of the noisy MR measurements were used as inputs, our method could still
reconstruct the EP and transmit field with average error $2.49\%$, $4.09\%$ and
$0.32\%$ for the relative permittivity, conductivity and $B_{1}^{+}$,
respectively, over the entire volume of the phantom. The generalized version of
PIFON-EPT that accounts for gradients of EP yielded accurate results at the
interface between regions of different EP values without requiring any boundary
conditions. \textit{Conclusion:} This work demonstrated the feasibility of
PIFON-EPT, suggesting it could be an accurate and effective method for EP
estimation. \textit{Significance:} PIFON-EPT can efficiently de-noise $B_1^{+}$
maps, which has the potential to improve other MR-based EPT techniques.
Furthermore, PIFON-EPT is the first technique that can reconstruct EP and
$B_{1}^{+}$ simultaneously from incomplete noisy MR measurements. | [
"Xinling Yu",
"José E. C. Serrallés",
"Ilias I. Giannakopoulos",
"Ziyue Liu",
"Luca Daniel",
"Riccardo Lattanzi",
"Zheng Zhang"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11883v3",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11883v3",
"@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"
] | 1
PIFON-EPT: MR-Based Electrical Property
Tomography Using Physics-Informed Fourier
Networks
Xinling Yu, José E. C. Serrallés, Member, IEEE, Ilias I. Giannakopoulos, Ziyue Liu, Luca Daniel, Fellow, IEEE,
Riccardo Lattanzi, Senior Member, IEEE, Zheng Zhang, Member, IEEE
3
2
0
2
r
a
M
0
3
]
G
L
.
s
c
[
3
v
3
8
8
1
1
.
2
0
3
2
:
v
i
X
r
a
Abstract-Objective: In this paper, we introduce Physics-
Informed Fourier Networks for Electrical Properties Tomography
(PIFON-EPT), a novel deep learning-based method that solves
an inverse scattering problem based on noisy and/or incomplete
magnetic resonance (MR) measurements. Methods: We used two
separate fully-connected neural networks, namely B+
1 Net and
EP Net, to solve the Helmholtz equation in order to learn a de-
noised version of the input B+
1 maps and estimate the object's
EP. A random Fourier features mapping was embedded into B+
1
Net, to learn the high-frequency details of B+
1 more efficiently.
The two neural networks were trained jointly by minimizing the
combination of a physics-informed loss and a data mismatch loss
via gradient descent. Results: We performed several numerical
experiments, showing that PIFON-EPT could provide physically
consistent reconstructions of the EP and transmit field. Even
when only 50% of the noisy MR measurements were used as
inputs, our method could still reconstruct the EP and transmit
field with average error 2.49%, 4.09% and 0.32% for the relative
permittivity, conductivity and B+
1 , respectively, over the entire
volume of the phantom. The generalized version of PIFON-EPT
that accounts for gradients of EP yielded accurate results at the
interface between regions of different EP values without requiring
any boundary conditions. Conclusion: This work demonstrated
the feasibility of PIFON-EPT, suggesting it could be an accurate
and effective method for EP estimation. Significance: PIFON-
EPT can efficiently de-noise B+
1 maps, which has the potential to
improve other MR-based EPT techniques. Furthermore, PIFON-
EPT is the first technique that can reconstruct EP and B+
1
simultaneously from incomplete noisy MR measurements.
Index terms- Electrical Property Mapping, Fourier
Features Mapping, Magnetic Resonance Imaging, Physics
Informed Neural Networks.
This work was supported in part by research grants from the National
Science Foundation (NSF 2107321) and the National Institute of Health (NIH
2R01 EB024536) in the United States. (Corresponding author: Xinling Yu)
Xinling Yu and Zheng Zhang are with the Department of Electrical and
Computer Engineering, University of California, Santa Barbara, CA 93106
USA (email: [email protected]).
José E. C. Serrallés and Luca Daniel are with the Research Laboratory
of Electronics, Department of Electrical Engineering and Computer Science,
Massachusetts Institute of Technology, Cambridge, MA 02139 USA.
Ilias I. Giannakopoulos is with the Bernard and Irene Schwartz Center
for Biomedical Imaging, Department of Radiology, New York University
Grossman School of Medicine, NY 10016 USA.
Riccardo Lattanzi is with the Center for Advanced Imaging Innovation
and Research (CAI2R), and with the Bernard and Irene Schwartz Center
for Biomedical Imaging, Department of Radiology, New York University
Grossman School of Medicine, NY 10016 USA.
Ziyue Liu is with the Department of Statistics and Applied Probability,
University of California, Santa Barbara, CA 93106 USA.
I. INTRODUCTION
Electrical properties (EP), namely relative permittivity and
electric conductivity, determine the interactions between elec-
tromagnetic waves and biological tissue [1], [2]. EP have the
potential to be employed as biomarkers for pathologies such as
cerebral ischemia [3], [4] and cancer [5]–[8]. EP could also
be used to improve the effectiveness of existing therapeutic
modalities such as radiofrequency hyperthermia [9]–[11].
1 ) or receive (B−
Several EP tomography (EPT) methods have been proposed
that are based on MR measurements, such as the magnetic
transmit (B+
1 ) field maps [12]–[22]. These
techniques can be classified based on the form of Maxwell's
equations (differential or integral) they use to fit the MR
measurements. Differential methods, such as the Helmholtz
EPT (H-EPT) [14] or the Convection-Reaction EPT (CR-EPT)
[16], require the calculations of spatial derivatives of noisy
measured B+
1 maps, which lead to errors and artifacts in the
reconstructions [23]. On the other hand, integral equation-
based methods [19], [20] are robust
to noise, but require
computationally expensive iterative optimizations that rely on
an accurate model of the transmit coils [24], [25] and fine-
tuned regularization parameters.
Recently, data-driven deep learning-based methods have
been introduced for EP reconstruction [26]–[29]. These meth-
ods treat MR measurements and EP distributions as 2D images
or 3D volumes, and train regression convolution neural net-
works as surrogate EP reconstruction models from simulated
training data. These supervised learning-based techniques per-
form well in simulation, but they are not reliable in vivo due to
the necessarily limited number of different cases included in
the training data. To improve the generalization to in-vivo data,
hybrid techniques that embed deep learning into conventional
EP mapping methods were proposed [30], [31]. These hybrid
methods use neural networks to generate initial guesses of
EP for iterative reconstruction schemes [30], or diffusion and
convection coefficients for the convection-reaction equation
[31]. While these approaches improve generalization, several
electromagnetic simulations are still required to generate train-
ing data, which can be very expensive and time-consuming.
A recent hybrid technique directly reconstructs conductivity
from input transceive phases [32]. In such a method, a neural
network is trained to represent the input transceive phase map,
where the gradients of the phase are computed by automatic
differentiation [33] and then used to solve the phase-only
convection-reaction EPT. The reconstructed conductivity is
compared with ground-truth values at
the boundary, as a
regularization for the neural network that represents the phase.
Since this method retains the physics of EPT, it does not
require a comprehensive set of electromagnetic simulations.
However, learning a single neural network that can simulta-
neously represent the ground-truth phase and provide accurate
gradient approximations directly from noisy measured phase
maps is challenging, which is shown by the fact that they
yielded highly inaccurate EP reconstructions in most cases.
Following our preliminary study [34], here we propose the
Physics-Informed Fourier Networks (PIFONs) Electrical Prop-
erties Tomography (PIFON-EPT) framework, which leverages
recent developments on physics-informed deep learning [35],
[36] and Fourier features mapping [37] to learn both the
EP distribution and the B+
1 field globally from noisy and/or
incomplete ̃B+
1 measurements. The proposed framework can
efficiently de-noise the B+
1 measurements and provide phys-
ically consistent reconstructions of the EP. Differently from
other supervised learning-based EPT methods [26]–[29], our
proposed PIFON-EPT technique can reconstruct EP directly,
without being trained on known B+
1 and EP distribution pairs.
Compared with recent physics-aware hybrid EPT methods
[31], [32] in which EP are still solved numerically from
convection-reaction equation with boundary condition, our
method represents EP as a neural network constrained by
the Helmholtz equations and does not require any prior EP
information.
The rest of the paper is organized as follows: In Section
II, we provide a brief overview of standard EPT methods.
In Section III, we describe the proposed novel PIFON-EPT
framework. In Section IV, we demonstrate the effectiveness
of our PIFON-EPT with four representative numerical exper-
iments. Further discussion is provided in Section V, whereas
Section VI summarizes the main points of this work.
II. TECHNICAL BACKGROUND
A. Fundamental Helmholtz Equations in MRI
The relation between the magnetic field (B) and the EP of
a medium can be described by the Helmholtz equation:
∇2B + k2
0εcB + ∇εc ×
∇ × B
εc
= 0,
where k0 is the wave number in vacuum and
εc = εr −
iσ
ωε0
,
(1)
(2)
is the relative complex permittivity. Here, εr is the relative
permittivity and σ is the electric conductivity, i denotes the
imaginary unit, ω denotes the angular frequency, and ε0
denotes the vacuum permittivity. Since the full transmit B1
cannot be measured in an MRI scanner, but only its positively
rotating component B+
1 = (Bx + iBy)/2, we can re-write
equation (1) with the help of Gauss' law (∇ * B = 0) as:
∇2B+
1 + k2
0εcB+
1 =
+
(cid:18) ∂B+
1
∂x
(cid:18) ∂B+
1
∂z
− i
+
∂B+
1
∂y
∂Bz
∂x
1
2
−
− i
(cid:19)
1
2
1
2
∂Bz
∂z
∂Bz
∂y
(gx + igy)
(cid:19)
gz.
(3)
2
Here, g := (gx, gy, gz) := ∇ ln εc. If we assume a smooth
distribution of the EP, their gradient g can be ignored, and
equation (3) becomes the homogeneous Helmholtz equation:
∇2B+
1 + k2
0εcB+
1 = 0.
(4)
B. Standard Differential EPT Methods
One can solve equations (3) and (4) for the EP, starting from
measured B+
1 maps. There are several methods based on such
approach (here is a non-exhaustive list [14]–[21]). Next, we
provide a brief overview of two popular ones: the Helmholtz
EPT [14] and the Convection-Reaction EPT [16]. Open-source
software implementations of these methods can be found in
EPTlib [38].
1) Helmholtz EPT: Assuming a homogeneous distribution
of the EP and access to measured complex ̃B+
1 maps, one
can directly invert the homogeneous Helmholtz equation (4)
to estimate the EP:
.
εc = −
∇2 ̃B+
1
̃B+
k2
1
0
The second-order spatial derivatives of the measured ̃B+
1
can be computed via finite difference approaches. If the
measured fields are noisy, smoothing filters such as the 2nd
order Savitzky-Golay filter [39] can be applied to improve the
numerical derivatives.
(5)
2) Convection-Reaction EPT: High-field MRI scanners (<
7 tesla) utilize birdcage-based body coils [40] for transmission.
In these cases, the Bz component of the magnetic field can
be assumed negligible near the mid-plane of the magnet bore.
As a result, the generalized Helmholtz equation (3) can be
simplified as:
∇2 ̃B+
1 + k2
0εc ̃B+
1 =
+
(cid:33)
− i
∂ ̃B+
1
∂y
(gx + igy)
(6)
(cid:32)
∂ ̃B+
1
∂x
∂ ̃B+
1
∂z
* gz.
If we let γ = 1/εc, equation (6) can be rewritten as the
convection-reaction equation with a zero diffusion term with
respect to γ [16]:
(7)
∇2 ̃B+
1 * γ + k2
0
̃B+
1 = −
(cid:18) ∂ ̃B+
1
∂x
− i
∂ ̃B+
1
∂y
(cid:19) (cid:18) ∂γ
∂x
+ i
∂γ
∂y
(cid:19)
∂ ̃B+
1
∂z
*
.
−
∂γ
∂z
By imposing appropriate boundary conditions (for example,
the value of γ at the boundary of the domain), the convection-
reaction equation (7) can be solved with a mesh-based finite
difference scheme for γ. As for Helmholts EPT, also in this
case the gradients of the measured ̃B+
1 can be estimated using
the Savitzky-Golay filter [39]. Since at MRI frequencies below
3 tesla, the absolute phase of B+
1 is almost independent from
the permittivity [13], it is possible to perform conductivity-
only reconstructions using only the absolute phase of ̃B+
1 [22],
which, for birdcage coils, can be estimated with the transceive
assumption (see next section) [14]. It is also possible to include
an artificial diffusion term to the convection-reaction equation
to stabilize and improve the reconstruction results [41].
III. METHODS
Our proposed PIFON-EPT is a deep learning-based frame-
work for robust EP estimation using noisy and/or incom-
plete complex-valued MR measurements. Note that since in
MRI we do not have direct access to the absolute phase
of B+
1 , we must rely on symmetry assumptions to estimate
the complex-valued field in actual experiments. Specifically,
at 1.5 and 3 tesla, when RF birdcage coils are used for
transmission and reception in quadrature, the B+
1 and B−
1
phases are approximately equal [13], [14]. Therefore, since
the transceive phase is measurable [42], we can approximate
the absolute phase of B+
1 as half the transceive phase. The
goal of PIFON-EPT is to learn the EP distributions globally
that best describe the complex-valued B+
at any spatial
1
location (x, y, z), given {(ri, ̃B+
i=1 only for a limited
N locations ri = (xi, yi, zi). The workflow of PIFON-EPT is
summarized in Fig. 1.
1 (ri))}N
A. PIFON-EPT workflow
Traditional EPT methods based on finite difference ap-
proximation of derivatives of B+
1 (5), (7) can lead to noise
amplifications in the reconstructed EP distributions. To prevent
this, we seek to solve an optimization problem constrained by
the measured data and physical laws using physics-informed
deep learning [35]. We denote the Helmholtz equation that
describes the physical laws that must be satisfied by B+
1 in
the general form on a d-dimension domain Ω ∈ Rd:
Nr[B+
1 ; ε(r)](r) = 0,
(8)
1 (r) describes the hidden B+
where r ∈ Rd is a spatial coordinate and Nr[*; ε]
is a
symbolic representation of the Helmholtz equation (4) or (6).
ε(r) denotes the complex-valued EP at the location r and
B+
1 field solution governed by
equation (8). Given noisy and/or incomplete measurements
{ri, ̃B+
1 (ri)}N
i=1, we aim to learn the EP distributions ε as
well as the B+
1 for all r. To do so, we define a Fourier neural
network B+
1 (r; θ1), constructed by Gaussian random Fourier
features [37] followed by a fully-connected neural network
with a set of weights and biases θ1, to represent the complex
B+
1 field. The Gaussian random Fourier features mapping is
defined as:
γ(r) =
(cid:20) cos(Br)
sin(Br)
(cid:21)
,
(9)
where each entry in B ∈ Rm×3 is sampled from a Gaussian
distribution N(0, σ2). 2m equals the width of the fully-
connected neural network following the defined Fourier fea-
tures and σ > 0 is a task-specific hyperparameter. We use
an additional fully-connected neural network Ec(r; θ2) with
independent weights and biases θ2 to estimate the distribution
of EP. Hereinafter, we refer to B+
1 (r; θ1) and Ec(r; θ2) as
B+
1 net and EP net, respectively. The PDE residual of (8) is
transformed to:
3
A good set of candidate parameters {θ1, θ2} can be obtained
by minimizing the following composite loss function via
gradient descent with the Adam optimizer [43]:
L(θ1, θ2) = Ldata (θ1) + λLr(θ1, θ2),
N
(cid:88)
Ldata (θ1) =
|Re{B+
1 (ri; θ1)} − Re{ ̃B+
1 (ri)}|2
1
N
+
Lr(θ1, θ2) =
1
N
1
N
i=1
N
(cid:88)
i=1
N
(cid:88)
i=1
|Im{B+
1 (ri; θ1)} − Im{ ̃B+
1 (ri)}|2,
(11)
|R(ri, θ1, θ2)|2.
Ldata denotes the data mismatch and Lr denotes the PDE
residual. λ denotes the weight coefficient in the loss function,
which balances the two loss terms in the composite loss. We
remark that λ is a hyperparameter that can either be specified
by the user or be tuned automatically [44], [45]. All the
1 (r; θ1) and Ec(r; θ2) with respect to the
derivatives of B+
spatial coordinate r as well as the gradient of the loss function
with respect to the neural network parameters {θ1, θ2}, are
computed using automatic differentiation algorithms [33].
1 field solution more efficiently [37]. Second, B+
The workflow of our proposed PIFON-EPT (Fig. 1) can
be summarized as follow. First, we define two separate fully-
1 Net and EP Net (Ec(r; θ2)) to
connected neural networks B+
represent the B+
1 and the EP, respectively. A random Fourier
features mapping (see Fig. 1 green dotted box) is embedded
into B+
1 Net to learn high frequency components of the target
B+
1 Net and
EP Net are trained jointly by minimizing a composite loss
function that aims to fit the measured ̃B+
1 data (see Fig. 1 blue
dotted box), while satisfying the physics laws characterized by
the PDE residual. Finally, the trained physics-informed B+
1
Net and EP Net can be used to obtain physically consistent
predictions of B+
1 and EP at arbitrary 3D locations (see Fig.
1 bottom red dotted boxes).
B. Choice of Helmholtz equation
If we assume piece-wise constant EP, then the Helmholtz
equation simplifies as in (4). Eq. (6) is a generalized form
of the same equation, which accounts for gradients of EP,
but is yet not fully general because to reduce the number of
unknowns, we assumed that Bz is equal to zero. Depending
on which Helmholtz equation is used, we introduced two vari-
ants of PIFON-EPT: simplified PIFON-EPT and generalized
PIFON EPT.
1) Simplified PIFON-EPT: Assumes piece-wise constant
EP and does not require any assumption on Bz. Following
Eq. (4), the Helmholtz residual (10) can be represented as:
RH = ∇2B+
1 (r; θ1) + k2
0
Ec(r; θ2)B+
1 (r; θ1).
(12)
R(r, θ1, θ2) := Nr[B+
1 (r; θ1); Ec(r; θ2)](r).
(10)
2) Generalized PIFON-EPT: Assumes Bz ≈ 0 and uses
the generalized equation (6). The Helmholtz residual (10)
4
Fig. 1. PIFON-EPT workflow. Two separate fully-connected neural networks B+
field and the EP distributions, respectively. The B+
̃B+
physically consistent predictions of B+
different iterations during training is shown at the bottom (red dotted box).
1 (r; θ1)) and EP Net (Ec(r; θ2)) are defined to represent the B+
1
1 Net and EP Net are trained jointly by minimizing a composite loss function that aims to fit the measured
1 Net and EP Net can be used to obtain
1 and EP at any arbitrary 3D location. A representative axial cut of the outputs of the neural networks obtained at
1 data (blue dotted box) while also penalizing the PDE residual. Once trained, the resulting physics-informed B+
1 Net (B+
becomes:
RGH = ∇2B+
1 (r; θ1) + k2
0
Ec(r; θ2)B+
1 (r; θ1) −
(cid:32)
∂B+
1 (r; θ1)
∂x
− i
∂y
∂B+
1 (r; θ1)
(cid:33) (cid:18) ∂Ec(r; θ2)
−
1
Ec(r; θ2)
(cid:32)
∂B+
1 (r; θ1)
∂z
*
∂x
(cid:33)
∂Ec(r; θ2)
∂z
.
1
Ec(r; θ2)
∂Ec(r; θ2)
∂y
(cid:19)
(13)
+ i
Both techniques rely on knowledge of the absolute phase
of B+
1 , which for a quadrature birdcage coil can be esti-
mated from the transceive phase assumption. Note that with a
sufficient number of transmit-receive coils, it is theoretically
possible to solve for both the unknown absolute phase and
Bz [46], although the lack of suitable multi-channel coils and
the computational complexity of such solution has prevented
practical implementations.
IV. RESULTS
We present a series of numerical examples to demonstrate
the effectiveness of our proposed PIFON-EPT framework.
Throughout all experiments, unless otherwise specified, we
used simulated complex B+
1 maps as measured data and
corrupted them with white Gaussian noise with a standard
deviation equal to the ratio of the peak value of |B+
1 | to a
prescribed peak signal-to-noise-ratio (SNR) value. The simu-
lations were performed with the volume [47] and the volume-
surface integral equation [48], [49] methods. The volume
equations were solved using higher-order polynomials [50] as
basis functions to ensure accuracy in the B+
1 distributions.
All experiments were performed on a server running Ubuntu
20.04.3 LTS operating system, with an Intel(R) Xeon(R) Silver
4216 CPU at 2.10GHz, 64 cores, 2 threads per core, and an
NVIDIA RTX 3090 GPU with 24 GB of memory.
A. Validation against the analytical solution
To verify our method we used a complex B+
1 map obtained
from the Mie Scattering theory [51] for an infinitely long
homogeneous dielectric cylinder of relative permittivity 3 and
electric conductivity 0.01 S/m. The operating wavelength was
λ = 2.437 m and the cylinder had a radius r equal to the
wavelength. A TMz planewave was used as the excitation.
1) Data Acquisition: We computed the B+
1 field distribu-
tion in the domain [−2r, 2r] × [−2r, 2r] using Mie scattering
theory [52]. The pixel isotropic resolution was set to 0.05λ. We
corrupted the synthetic B+
1 field with Gaussian noise of peak
SNR of 200 and then scaled the noisy field with the peak value
of |B+
1 measurements. The resulting
̃B+
1 fields were used as the measured data for PIFON-EPT.
1 | to obtain synthetic ̃B+
xzσσσσσσσσy......σσσσ...Re{Ɛ!}Im{Ɛ!}xzσσσσσσσσy......σσσσ...Re{B"#}Im{B"#}sinsincoscos...Fourier featuresFully-connected NNFully-connected NN∂B"#∂x∂B"#∂y∂B"#∂z∇$B"#B"#∂Ɛ!∂x∂Ɛ!∂y∂Ɛ!∂zƐ!Data mismatch: LdataPDE residual: LrTotal loss: Ldata+ λLrB!"NetEP NetUpdate parameters of EP NetB!"reconstruction processzxyMeasured data "B!"Iteration = 0 Iteration = 300 Iteration = 3000 Iteration = 30000Iteration = 0 Iteration = 300 Iteration = 3000 Iteration = 30000Update parameters of B&'NetEP reconstruction process(|B+,|+φ,2) PIFON Training Settings: B+
1 Net was constructed by a
Fourier features mapping initialized with σ = 2 as a coordinate
embedding of the input, followed by a fully-connected neural
network with 3 layers, 128 units per layer. EP Net was con-
structed using a fully-connected neural network with 3 layers,
128 units per layer. We set all the activation functions as the
Sine function. We set λ = 10−4 in equation (11). We trained
B+
1 Net and EP Net jointly using the Adam optimizer for
120k iterations in total, with a decaying schedule of learning
rates 10−3, 10−4, 10−5 decreased every 40k iterations, which
took ∼ 30 minutes and ∼ 40 minutes for employing simplified
PIFON-EPT and generalized PIFON-EPT, respectively.
We tested the performance of simplified PIFON-EPT and
generalized PIFON-EPT using the same training settings. Fig.
the
2 and Fig. 3 compare the EP reconstructions against
ground truth EP for simplified PIFON-EPT and generalized
PIFON-EPT, respectively. Fig. 4 and Fig. 5 compare ground
truth and reconstructed B+
for simplified PIFON-EPT and
1
generalized PIFON-EPT, respectively. The average PNAE over
the domain for the relative permittivity, conductivity, and
B+
1 was 3.96%, 9.67% and 0.22%, respectively for simpli-
fied PIFON-EPT. The average PNAE over the domain for
the relative permittivity, conductivity, and B+
1 was 1.80%,
1.11% and 0.20%, respectively for generalized PIFON-EPT.
The generalized PIFON-EPT achieved smaller errors near the
boundary for EP reconstructions.
5
Fig. 3. EP reconstruction with generalized PIFON-EPT for a uniform dielectric
cylinder. From left to right, ground truth EP, including relative permittivity
(top) and conductivity (bottom), predicted EP using ̃B+
1 measurements with
peak SNR of 200, peak-normalized absolute errors, distribution of the error
in 6561 voxels.
Fig. 4. Reconstructed B+
1 with simplified PIFON-EPT inside a uniform
dielectric cylinder. From left to right, ground truth noise-free synthetic B+
1 ,
including magnitude (top) and transmit phase (bottom), reconstructed B+
1
from noisy synthetic ̃B+
1 measurements with peak SNR of 200, peak-
normalized absolute errors, distribution of the error in 6561 voxels.
Fig. 2. EP reconstruction with simplified PIFON-EPT for a uniform dielectric
cylinder. From left to right, ground truth EP, including relative permittivity
(top) and conductivity (bottom), predicted EP using ̃B+
1 measurements with
peak SNR of 200, peak-normalized absolute errors, distribution of the error
in 6561 voxels.
B. Concentric Cylindrical Phantom
We considered a two-compartment concentric cylindrical
phantom with relative permittivity ε = {70, 78} and conduc-
tivity σ = {0.5, 1} S/m (outer, inner). The cylinder loaded a
high-pass birdcage coil with eight legs as shown in Fig. 6. The
outer and inner radius of the cylinder were 6 cm and 3 cm,
respectively, and its length was 14 cm. For this example, we
compared the proposed PIFON-EPT with the Helmholtz-EPT
(H-EPT) and the Convection-Reaction EPT (CR-EPT) (see
II-B). In particular, we used the implementations in EPTlib
[38], with the Savitzky-Golay filter with an ellipsoid-shaped
kernel of size 2 × 2 × 2 to approximate all the gradients.
For CR-EPT, we set the diffusion coefficient to 0.02 and the
conductivity boundary condition to 0.55 S/m.
Fig. 5. Reconstructed B+
1 with generalized PIFON-EPT for a uniform
dielectric cylinder. From left to right, ground truth noise-free synthetic B+
1 ,
including magnitude (top) and transmit phase (bottom), reconstructed B+
1
from noisy synthetic ̃B+
1 measurements with peak SNR of 200, peak-
normalized absolute errors, distribution of the error in 6561 voxels.
1) Data Acquisition: We used the volume-surface integral
equation method [49] to simulate the circularly polarized (CP)
mode of the birdcage coil loaded with the cylindrical phantom
at 3 T. The resolution was set to 2 mm3. We used B+
1 and
B−
from the central region of the cylinder (12 × 12 ×
1
2 cm3, MR measurements out of cylindrical phantom were
not used) and corrupted them with Gaussian noise of peak
6
1 with generalized PIFON-EPT for
Fig. 8. Reconstructed B+
the two-
compartment cylindrical phantom. From left to right, noise-free synthetic
B+
1 for the central axial cut, including magnitude (top) and transmit phase
1 field from noisy ̃B+
(bottom), reconstructed B+
1 measurements, peak-
normalized absolute errors, distribution of the error in 31031 voxels.
Fig. 9 and Fig. 10 show the conductivity reconstruction
results for H-EPT and CR-EPT, respectively, along with the
PNAE distribution and the error histogram. The average PNAE
over the volume where EP was reconstructed was 51.80% and
11.28% for H-EPT and CR-EPT, respectively.
Fig. 9. Conductivity reconstructed with phase-based H-EPT for the two-
compartment cylindrical phantom. From left to right, ground truth conductivity
for the central axial cut of the phantom, estimated conductivity using ̃φ±
measurements with peak SNR of 200, the peak-normalized absolute errors,
the distribution of the error in 17423 voxels.
Fig. 10. Conductivity reconstructed with phase-based CR-EPT for the two-
compartment cylindrical phantom. From left to right, ground truth conductivity
for the central axial cut of the phantom, estimated conductivity using ̃φ±
measurements with peak SNR of 200, the peak-normalized absolute errors,
the distribution of the error in 11645 voxels.
C. Four-Compartment Phantom
In this example, we explore the performance of PIFON-
EPT at 7 tesla. We considered a previously used [19] tissue-
mimicking four-compartment phantom shaped as a 20×20×20
cm3 rectangular parallelepiped. The relative permittivity val-
ues of the four compartments were 51, 56, 65, and 76. The
corresponding electric conductivity values were 0.56, 0.69,
0.84, and 1.02 S/m, respectively.
Fig. 6. Geometry of
compartments cylindrical phantom
the high-pass birdcage coil
loaded with a two-
SNR of 200. We approximated the complex B+
1 using the
transceive phase assumption (TPA) and constructed the MR
measurements | ̃B+
1 | and ̃φ±.
2) PIFON Training Settings: The Bz field of a birdcage
is negligible around the mid-plane of the coil. For this rea-
son, we used the generalized PIFON-EPT to perform the
reconstruction. For B+
1 Net, the Fourier feature mapping was
initialized with σ = 40 as a coordinate embedding of the
input, followed by a fully-connected neural network with 6
layers, 128 units per layer. EP Net was an additional Fourier
neural network constructed by a Fourier feature mapping
initialized with σ = 2, followed by a fully-connected neural
network with 6 layers, 128 units per layer. We set all the
activation functions as the Sine function and set λ = 10−8 in
equation (11). We trained B+
1 Net and EP Net jointly using the
Adam optimizer for 120k iterations in total, with a decaying
schedule of learning rates 10−3, 10−4, 10−5 decreased every
40k iterations. The overall training time took 220 minutes on
our GPU.
Results are shown in Fig. 7 for the central axial cut of
the cylinder. The average PNAE over the entire volume of the
cylinder was 4.84%, 3.20% and 0.25% for relative permittivity,
conductivity and B+
1 , respectively.
the two-
Fig. 7. EP reconstructed with generalized PIFON-EPT for
compartment cylindrical phantom. From left to right, ground truth EP for
the central axial cut of the phantom, including relative permittivity (top) and
conductivity (bottom), estimated EP using synthetic ̃B+
1 measurements with
peak SNR of 200, peak-normalized absolute errors, distribution of the error
in 31031 voxels.
1) Data Acquisition: We used a single external excitation
to illuminate the phantom, generated from a numerical electro-
magnetic basis [53], similar to previous work [19]. We used 6
mm isotropic voxel resolution. We corrupted the synthetic B+
1
with different levels of Gaussian noise (Peak SNR = 200, 100,
50, 20) and then scaled each field map by the corresponding
1 | to obtain synthetic ̃B+
peak value of |B+
1 measurements. The
case of peak SNR = 50 is shown in Fig. 11.
7
Fig. 12. EP reconstructed with simplified PIFON-EPT for
the four-
compartment phantom. From left to right, ground truth EP for the central
axial cut of the phantom, including relative permittivity (top) and conductivity
(bottom), EP reconstructed from synthetic ̃B+
1 measurements with peak SNR
of 50, peak-normalized absolute errors, error distribution in 32768 voxels.
Fig. 11. Noisy synthetic ̃B+
1 measurements. Magnitude (left) and transmit
phase (right) are shown for the central axial cut of the Four-compartment
phantom. The peak SNR was set to 50.
2) PIFON Training Settings: Since the B1 field in the z
direction can not be assumed zero at 7 T, we used the simpli-
fied PIFON-EPT. The B+
1 Net was constructed using a Fourier
feature mapping initialized with σ = 40 as a coordinate
embedding of the input, followed by a fully-connected neural
network with 3 layers, 128 units per layer. For EP Net, we
used a second fully-connected neural network with 3 layers,
128 units per layer. We set all the activation functions as the
Sine function. We set λ = 10−8 in equation (11). We trained
B+
1 Net and EP Net jointly using the Adam optimizer for 30k
iterations in total, with a decaying schedule of learning rates
10−3, 10−4, 10−5 decreased every 10k iterations, which took
21.4 minutes on our GPU.
Figs. 12 and 13 show the results for the central slice of the
four-compartment phantom. Our method removed the noise
from the noisy synthetic measurements (Fig. 11) and the
reconstructed B+
1 was qualitatively similar to the noise-free
ground truth. The average PNAE over the volume was 2.47%,
4.01%, 0.24% for the relative permittivity, conductivity and
B+
1 , respectively.
The average PNAE for the reconstructed EP and B+
1 for
different levels of noise in the synthetic measurements are
summarized in TABLE I. The reconstructions were robust for
a wide range of noise levels.
TABLE I
ROBUSTNESS ANALYSIS OF PIFON-EPT WITH RESPECT TO THE NOISE
LEVEL
Peak SNR
200
100
50
20
PNAE
εr
σ
B+
1
2.56% 2.64% 2.47% 2.56%
4.00% 4.10% 4.01% 3.96%
0.15% 0.17% 0.24% 0.49%
1 with simplified PIFON-EPT for
Fig. 13. Reconstructed B+
the four-
compartment phantom. From left to right, ground truth synthetic B+
1 for
the central axial cut of the phantom, including magnitude (top) and transmit
1 field from noise-corrupted synthetic ̃B+
phase (bottom), reconstructed B+
1
measurements with peak SNR of 50, the peak-normalized absolute errors, the
distribution of the error in 32768 voxels.
D. Incomplete Four-Compartment Phantom
In this final numerical experiment, we used the same four-
compartment phantom as before, but we assumed the synthetic
̃B+
1 measurements were incomplete, which could happen in
reality if the measured signal is too low or corrupted for
certain voxels to reconstruct B+
1 . We tested whether PIFON-
EPT could reconstruct the EP and a complete, denoised B+
1
for the entire volume.
1) Data Acquisition: We randomly set to zero from 20%
to 90% of the voxels in the synthetic ̃B+
1 measurements
with peak SNR of 50. As a result, only 10% to 80% of the
measurements were used as input for simplified PIFON-EPT.
Fig. 14 shows one of the resulting ̃B+
1 measurements for the
central axial cut, where 50% of the ̃B+
1 values were set to
zero.
We used the same training settings as for the previous
experiment. The total training time when we used 10%, 20%,
50%, and 80% of the measurements was 10, 11, 15, and
18 minutes, respectively. Figs. 15 and 16 show the ground
truth EP and noise-free synthetic B+
the
1
reconstructed EP and the denoised completed B+
(second
1
column), the PNAE of the predicted EP and B+
1 (third column)
and their error distribution over the entire volume of the
(first column),
8
Fig. 14. Incomplete noisy synthetic ̃B+
1 measurements with 50% of the voxels
set to zero. Magnitude (left) and transmit phase (right) are shown for the
central axial cut of the Four-compartment phantom. The peak SNR was set
to 50.
Fig. 16. Reconstructed B+
1 with simplified PIFON-EPT for the incomplete
four-compartment phantom. From left to right, magnitude (top) and transmit
phase (bottom) of the synthetic B+
1 field for the central axial cut of the
phantom, reconstructed B+
1 with peak SNR of 50,
peak-normalized absolute errors, error distribution in 32768 voxels.
1 field using 50% of ̃B+
V. DISCUSSION
1 Net and EP Net) to represent the B+
In this work, we reformulated EPT as a physics-constrained
optimization problem with the goal to train two independent
neural networks (B+
1 and
EP at any location of interest. To achieve that, we minimized a
composite loss that aims to fit ̃B+
1 measurements while penal-
izing the PDE residual (see Fig. 1) via gradient descent with
Adam optimizer [43]. Penalizing the PDE residual not only
helps EP Net predict the EP distributions that best describe
the measured data but also prevents B+
1 Net from fitting the
noise. Compared with standard EPT methods [14], [16] that
rely on finite differences to approximate gradients of noisy
̃B+
1 measurements, which is prone to noise amplifications and
artifacts, PIFON-EPT uses automatic differentiation [33] to
calculate all the necessary gradients from de-noised B+
1 maps
provided by B+
1 Net. This way of computing derivatives makes
our method robust to noise. Unlike previous supervised deep
learning-based EPT methods [26]–[30], our approach does not
require a large amount of known data pairs to supervise the
training. Compared with previous hybrid deep learning EPT
methods [31], [32], which combine deep learning and CR-EPT
to solve EP from convection-reaction equations, our method
directly trains a neural network (EP Net) to represent the
EP based on measured data and the Helmholtz PDE without
requiring any boundary conditions and hyperparameter tuning
for the diffusion coefficient.
A major concern for B+
1 maps represented by neural net-
works is that deep fully-connected networks could fail to learn
high-frequency components of the target functions because
of the spectral bias [54]–[57]. To overcome the spectral bias
and ensure that B+
1 Net would efficiently learn the high-
frequency details of B+
1 , we applied Fourier features mapping
as an input embedding to the B+
1 . In the concentric cylindrical
phantom example, we also applied Fourier features mapping
to EP Net because it could help the network avoid predicting
homogeneous EP distributions.
In simplified PIFON-EPT, we assume a homogeneous dis-
tribution of EP. This assumption introduces errors near the
interface between regions of different EP values and can
deteriorate the quality of the reconstructions. When Bz is
Fig. 15. Reconstructed EP with simplified PIFON-EPT for the incomplete
four-compartment phantom. From left to right, ground truth EP for the central
axial cut of the phantom, including relative permittivity (top) and conductivity
(bottom), estimated EP using 50% of ̃B+
1 with peak SNR of 50, the peak-
normalized absolute errors, the distribution of the error in 32768 voxels.
phantom (fourth column), respectively. The figures show the
case where only 50% of the synthetic ̃B+
1 measurements were
used. We found that our method could accurately reconstruct
the EP and B+
1 for the whole domain, despite using partial
measurements as the input. The average PNAE over the entire
volume of the phantom was 2.49%, 4.09% and 0.32% for the
relative permittivity, conductivity, and B+
1 , respectively.
TABLE II summarizes the average PNAE for the EP and
B+
1 when different percentages of the synthetic measurements
are used. The error for the B+
1 reconstruction increased when
a smaller percentage of the data was used. However, PIFON-
EPT yielded robust results until as little as 20% of the
measurements was used as input.
TABLE II
PERFORMANCE OF PIFON-EPT WITH RESPECT TO THE PERCENTAGE OF
MEASUREMENTS USED AS INPUT FOR THE RECONSTRUCTIONS
PNAE
% of the Data
80%
50%
20%
10%
εr
σ
B+
1
2.41% 2.49% 2.77% 7.22%
3.94% 4.09% 4.06% 7.58%
0.26% 0.32% 0.57% 2.69%
negligible, the generalized PIFON-EPT can be used which
allows the estimation of inhomogeneous EP distributions based
on the generalized Helmholtz equation (6) which can greatly
decrease the errors near the tissue boundaries (see IV-A). In
fact, we showed that PIFON-EPT returned 48.6% and 8.08%
more accurate results on average compared to H-EPT and
CR-EPT (see IV-B). Furthermore, CR-EPT required tuning
of the boundary condition value and the diffusion coefficient
parameter until the reconstructed conductivity was close to
the ground-truth value, which is not practical in experiments
where the ground-truth values are unknown.
To the best of our knowledge, PIFON-EPT is the only
EPT method that can reconstruct EP and B+
1 for an entire
object, using incomplete and noisy B+
1 measurements. We
demonstrated this for an ultra-high field MRI example, us-
ing complex-valued synthetic B+
1 measurements. The same
approach would be impractical in actual experiments because
the absolute phase of the B+
is not measurable and the
1
TPA does not hold at 7 tesla. However, note that PIFON-
EPT could be adapted to work with multiple transmit coils,
which could provide enough degrees of freedom to enable EP
reconstruction using the relative phase of B+
1 between the coil
channels [19], [46], which can be measured. This approach
will be explored in future work.
The current version of PIFON-EPT has a limitation when
Bz can not be assumed equal to zero. In this case, boundary ar-
tifacts appearing in the reconstructed EP cannot be eliminated.
Previous work suggests that this limitation could be overcome
by using multiple transmit-receive coils [46]. In this work, we
used instead a birdcage coil, for which Bz can be assumed
negligible if the main field strength is lower or equal to 3T.
However, we found that our network's expressive power was
not enough to reconstruct both the EP and the B+
1 in such a
case. To address this, we made our network deeper and used
more complex architectures (for example, we included Fourier
mapping also in the EP Net) to accurately represent the EP
and B+
1 , which ultimately increased the network's training
time. This problem could be solved by designing compressed
network architectures [58], [59] to replace the current fully-
connected neural networks.
VI. CONCLUSION
We introduced PIFON-EPT, a new technique to estimate
1 distributions from noisy and/or incomplete ̃B+
EP and B+
1
measurements. We demonstrated our new approach using a
series of numerical examples, showing that PIFON-EPT is
accurate and robust even when its input is corrupted with a
significant amount of noise. Since PIFON-EPT can efficiently
de-noise MR measurements, it has the potential to improve
other MR-based EPT methods that use B+
1 maps as the input.
In future work, we will investigate the performance of the
proposed algorithms with more realistic numerical phantoms
and perform experimental validation.
ACKNOWLEDGMENTS
The authors are grateful to Alessandro Arduino for his
valuable advice about the usage of EPTlib.
9
REFERENCES
[1] C. M. Collins and Z. Wang, "Calculation of radiofrequency electro-
magnetic fields and their effects in mri of human subjects," Magnetic
resonance in medicine, vol. 65, no. 5, pp. 1470–1482, 2011.
[2] J. Hand, "Modelling the interaction of electromagnetic fields (10 mhz–
10 ghz) with the human body: methods and applications," Physics in
Medicine & Biology, vol. 53, no. 16, p. R243, 2008.
[3] D. Holder, "Detection of cerebral ischaemia in the anaesthetised rat
by impedance measurement with scalp electrodes:
implications for
non-invasive imaging of stroke by electrical impedance tomography,"
Clinical Physics and Physiological Measurement, vol. 13, no. 1, p. 63,
1992.
[4] M. A. Fallert et al., "Myocardial electrical
impedance mapping of
ischemic sheep hearts and healing aneurysms." Circulation, vol. 87,
no. 1, pp. 199–207, 1993.
[5] K. K. Tha et al., "Noninvasive evaluation of electrical conductivity of
the normal brain and brain tumors," in Proc. Int. Soc. Magn. Reson.
Med, vol. 22, 2014, p. 1885.
[6] K. K. Tha et al., "Noninvasive electrical conductivity measurement by
mri: a test of its validity and the electrical conductivity characteristics
of glioma," European radiology, vol. 28, no. 1, pp. 348–355, 2018.
[7] E. Balidemaj et al., "Feasibility of electric property tomography of pelvic
tumors at 3t," Magnetic resonance in medicine, vol. 73, no. 4, pp. 1505–
1513, 2015.
[8] J. Shin et al., "Initial study on in vivo conductivity mapping of breast
cancer using mri," Journal of Magnetic Resonance Imaging, vol. 42,
no. 2, pp. 371–378, 2015.
[9] C. Rossmann and D. Haemmerich, "Review of temperature dependence
of thermal properties, dielectric properties, and perfusion of biological
tissues at hyperthermic and ablation temperatures," Critical ReviewsTM
in Biomedical Engineering, vol. 42, no. 6, 2014.
[10] E. Balidemaj et al., "Hyperthermia treatment planning for cervical
cancer patients based on electrical conductivity tissue properties acquired
in vivo with ept at 3 t mri," International Journal of Hyperthermia,
vol. 32, no. 5, pp. 558–568, 2016.
[11] M. M. de Oliveira, P. Wen, and T. Ahfock, "Bio-heat transfer model
of electroconvulsive therapy: Effect of biological properties on induced
temperature variation," in 2016 38th Annual International Conference of
the IEEE Engineering in Medicine and Biology Society (EMBC).
IEEE,
2016, pp. 3997–4000.
[12] E. Haacke et al., "Extraction of conductivity and permittivity using
magnetic resonance imaging," Physics in Medicine & Biology, vol. 36,
no. 6, p. 723, 1991.
[13] H. Wen, "Noninvasive quantitative mapping of conductivity and dielec-
tric distributions using rf wave propagation effects in high-field mri," in
Medical Imaging 2003: Physics of Medical Imaging, vol. 5030. SPIE,
2003, pp. 471–477.
[14] U. Katscher et al., "Determination of electric conductivity and local sar
via b1 mapping," IEEE transactions on medical imaging, vol. 28, no. 9,
pp. 1365–1374, 2009.
[15] T. Voigt, U. Katscher, and O. Doessel, "Quantitative conductivity and
permittivity imaging of the human brain using electric properties tomog-
raphy," Magnetic Resonance in Medicine, vol. 66, no. 2, pp. 456–466,
2011.
[16] F. S. Hafalir et al., "Convection-reaction equation based magnetic res-
onance electrical properties tomography (cr-mrept)," IEEE transactions
on medical imaging, vol. 33, no. 3, pp. 777–793, 2014.
[17] X. Zhang, S. Zhu, and B. He, "Imaging electric properties of biological
tissues by rf field mapping in mri," IEEE transactions on medical
imaging, vol. 29, no. 2, pp. 474–481, 2010.
[18] D. K. Sodickson et al., "Local maxwell tomography using transmit-
receive coil arrays for contact-free mapping of tissue electrical properties
and determination of absolute rf phase," in Proceedings of the 20th
Annual Meeting of ISMRM.
ISMRM Concord California, USA, 2012,
p. 388.
[19] J. E. Serrallés et al., "Noninvasive estimation of electrical properties
from magnetic resonance measurements via global maxwell tomography
and match regularization," IEEE Transactions on Biomedical Engineer-
ing, vol. 67, no. 1, pp. 3–15, 2019.
[20] R. L. Leijsen et al., "3-d contrast source inversion-electrical properties
tomography," IEEE transactions on medical imaging, vol. 37, no. 9, pp.
2080–2089, 2018.
[21] J. Liu et al., "Gradient-based electrical properties tomography (g ept):
A robust method for mapping electrical properties of biological tissues
in vivo using magnetic resonance imaging," Magnetic resonance in
medicine, vol. 74, no. 3, pp. 634–646, 2015.
10
[47] I. I. Giannakopoulos, M. S. Litsarev, and A. G. Polimeridis, "Memory
footprint reduction for the FFT-based volume integral equation method
via tensor decompositions," IEEE Transactions on Antennas and Prop-
agation, vol. 67, no. 12, pp. 7476–7486, 2019.
[48] I. I. Giannakopoulos et al., "A tensor train compression scheme for
remote volume-surface integral equation interactions," in 2021 Inter-
national Applied Computational Electromagnetics Society Symposium
(ACES).
IEEE, 2021, pp. 1–4.
[49] I. I. Giannakopoulos et al., "A hybrid volume-surface integral equation
method for rapid electromagnetic simulations in mri," IEEE Transactions
on Biomedical Engineering, 2022.
[50] I. P. Georgakis et al., "A fast volume integral equation solver with linear
basis functions for the accurate computation of EM fields in MRI," IEEE
Transactions on Antennas and Propagation, vol. 69, no. 7, pp. 4020–
4032, 2020.
[51] W. J. Wiscombe, "Improved Mie scattering algorithms," Applied optics,
vol. 19, no. 9, pp. 1505–1509, 1980.
[52] C. F. Bohren and D. R. Huffman, Absorption and scattering of light by
small particles.
John Wiley & Sons, 2008.
[53] I. P. Georgakis et al., "Novel Numerical Basis Sets for Electromagnetic
Field Expansion in Arbitrary Inhomogeneous Objects," IEEE Transac-
tions on Antennas and Propagation, vol. 70, no. 9, pp. 8227–8241, 2022.
[54] B. Ronen et al., "The convergence rate of neural networks for learned
functions of different frequencies," Advances in Neural Information
Processing Systems, vol. 32, 2019.
[55] Y. Cao et al., "Towards understanding the spectral bias of deep learning,"
arXiv preprint arXiv:1912.01198, 2019.
[56] N. Rahaman et al., "On the spectral bias of neural networks," in
PMLR, 2019, pp.
International Conference on Machine Learning.
5301–5310.
[57] S. Wang, H. Wang, and P. Perdikaris, "On the eigenvector bias of
fourier feature networks: From regression to solving multi-scale pdes
with physics-informed neural networks," Computer Methods in Applied
Mechanics and Engineering, vol. 384, p. 113938, 2021.
[58] A. Novikov et al., "Tensorizing neural networks," Advances in neural
information processing systems, vol. 28, 2015.
[59] Z. Liu, X. Yu, and Z. Zhang, "TT-PINN: A tensor-compressed neural
PDE solver for edge computing," arXiv preprint arXiv:2207.01751,
2022.
[22] N. Gurler and Y. Z. Ider, "Gradient-based electrical conductivity imaging
using mr phase," Magnetic resonance in medicine, vol. 77, no. 1, pp.
137–150, 2017.
[23] S. Mandija et al., "Error analysis of helmholtz-based mr-electrical
properties tomography," Magnetic resonance in medicine, vol. 80, no. 1,
pp. 90–100, 2018.
[24] I. I. Giannakopoulos et al., "Global Maxwell Tomography using an 8-
channel radiofrequency coil: simulation results for a tissue-mimicking
phantom at 7T," in 2019 IEEE International Symposium on Antennas
and Propagation and USNC-URSI Radio Science Meeting.
IEEE, 2019,
pp. 823–824.
[25] I. I. Giannakopoulos et al., "Magnetic-resonance-based electrical prop-
erty mapping using Global Maxwell Tomography with an 8-channel head
coil at 7 Tesla: a simulation study," IEEE Transactions on Biomedical
Engineering, vol. 68, no. 1, pp. 236–246, 2020.
[26] S. Mandija et al., "Opening a new window on mr-based electrical
properties tomography with deep learning," Scientific reports, vol. 9,
no. 1, pp. 1–9, 2019.
[27] N. Hampe et al., "Investigating the challenges and generalizability of
deep learning brain conductivity mapping," Physics in Medicine &
Biology, vol. 65, no. 13, p. 135001, 2020.
[28] S. Gavazzi et al., "Deep learning-based reconstruction of in vivo pelvis
conductivity with a 3d patch-based convolutional neural network trained
on simulated mr data," Magnetic resonance in medicine, vol. 84, no. 5,
pp. 2772–2787, 2020.
[29] I. Giannakopoulos et al., "On the usage of deep neural networks as
a tensor-to-tensor translation between mr measurements and electrical
properties," Proc. ISMRM, 2020.
[30] R. Leijsen et al., "Combining deep learning and 3d contrast source inver-
sion in mr-based electrical properties tomography," NMR in Biomedicine,
vol. 35, no. 4, p. e4211, 2022.
[31] A. J. G. Inda et al., "Physics-coupled neural network magnetic resonance
electrical property tomography (mrept) for conductivity reconstruction,"
IEEE Transactions on Image Processing, 2022.
[32] A. J. G. Inda et al., "Physics informed neural networks (pinn) for
low snr magnetic resonance electrical properties tomography (mrept),"
Diagnostics, vol. 12, no. 11, p. 2627, 2022.
[33] A. G. Baydin et al., "Automatic differentiation in machine learning:
a survey," Journal of Marchine Learning Research, vol. 18, pp. 1–43,
2018.
[34] X. Yu et al., "MR-Based Electrical Property Reconstruction Using
Physics-Informed Neural Networks," arXiv preprint arXiv:2210.12584,
2022.
[35] M. Raissi, P. Perdikaris, and G. E. Karniadakis, "Physics-informed
neural networks: A deep learning framework for solving forward and
inverse problems involving nonlinear partial differential equations,"
Journal of Computational physics, vol. 378, pp. 686–707, 2019.
[36] G. E. Karniadakis et al., "Physics-informed machine learning," Nature
Reviews Physics, vol. 3, no. 6, pp. 422–440, 2021.
[37] M. Tancik et al., "Fourier features let networks learn high frequency
functions in low dimensional domains," Advances in Neural Information
Processing Systems, vol. 33, pp. 7537–7547, 2020.
[38] A. Arduino, "Eptlib: An open-source extensible collection of electric
properties tomography techniques," Applied Sciences, vol. 11, no. 7, p.
3237, 2021.
[39] A. Savitzky and M. J. Golay, "Smoothing and differentiation of data
by simplified least squares procedures." Analytical chemistry, vol. 36,
no. 8, pp. 1627–1639, 1964.
[40] C. E. Hayes et al., "An efficient, highly homogeneous radiofrequency
coil for whole-body nmr imaging at 1.5 t," Journal of Magnetic
Resonance (1969), vol. 63, no. 3, pp. 622–628, 1985.
[41] C. Li, W. Yu, and S. Y. Huang, "An mr-based viscosity-type regular-
ization method for electrical property tomography," Tomography, vol. 3,
no. 1, pp. 50–59, 2017.
[42] R. W. Brown et al., Magnetic resonance imaging: physical principles
and sequence design.
John Wiley & Sons, 2014.
[43] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization,"
arXiv preprint arXiv:1412.6980, 2014.
[44] S. Wang, X. Yu, and P. Perdikaris, "When and why pinns fail to train:
A neural tangent kernel perspective," Journal of Computational Physics,
vol. 449, p. 110768, 2022.
[45] S. Wang, Y. Teng, and P. Perdikaris, "Understanding and mitigating
gradient flow pathologies in physics-informed neural networks," SIAM
Journal on Scientific Computing, vol. 43, no. 5, pp. A3055–A3081, 2021.
[46] D. K. Sodickson et al., "Generalized local Maxwell tomography for
mapping of electrical property gradients and tensors," in Proceedings of
the 21st Annual Meeting of ISMRM.
ISMRM, 2013, p. 4175.
|
|
http://arxiv.org/abs/2302.11874v1 | 2023-02-23T09:25:28 | 2023-02-23T09:25:28 | What Can We Learn From The Selective Prediction And Uncertainty
Estimation Performance Of 523 Imagenet Classifiers | When deployed for risk-sensitive tasks, deep neural networks must include an
uncertainty estimation mechanism. Here we examine the relationship between deep
architectures and their respective training regimes, with their corresponding
selective prediction and uncertainty estimation performance. We consider some
of the most popular estimation performance metrics previously proposed
including AUROC, ECE, AURC as well as coverage for selective accuracy
constraint. We present a novel and comprehensive study of selective prediction
and the uncertainty estimation performance of 523 existing pretrained deep
ImageNet classifiers that are available in popular repositories. We identify
numerous and previously unknown factors that affect uncertainty estimation and
examine the relationships between the different metrics. We find that
distillation-based training regimes consistently yield better uncertainty
estimations than other training schemes such as vanilla training, pretraining
on a larger dataset and adversarial training. Moreover, we find a subset of ViT
models that outperform any other models in terms of uncertainty estimation
performance. For example, we discovered an unprecedented 99% top-1 selective
accuracy on ImageNet at 47% coverage (and 95% top-1 accuracy at 80%) for a ViT
model, whereas a competing EfficientNet-V2-XL cannot obtain these accuracy
constraints at any level of coverage. Our companion paper, also published in
ICLR 2023 (A framework for benchmarking class-out-of-distribution detection and
its application to ImageNet), examines the performance of these classifiers in
a class-out-of-distribution setting. | [
"Ido Galil",
"Mohammed Dabbah",
"Ran El-Yaniv"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11874v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11874v1",
"@rel": "related",
"@type": "application/pdf"
}
] | [
"International Conference on Learning Representations (2023)"
] | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CV"
] | 3
2
0
2
b
e
F
3
2
]
G
L
.
s
c
[
1
v
4
7
8
1
1
.
2
0
3
2
:
v
i
X
r
a
WHAT CAN WE LEARN FROM THE SELECTIVE
PREDICTION AND UNCERTAINTY ESTIMATION
PERFORMANCE OF 523 IMAGENET CLASSIFIERS?
Ido Galil
Technion
[email protected]
Mohammed Dabbah
Amazon
[email protected]
Ran El-Yaniv
Technion, Deci.AI
[email protected]
ABSTRACT
When deployed for risk-sensitive tasks, deep neural networks must include an
uncertainty estimation mechanism. Here we examine the relationship between
deep architectures and their respective training regimes, with their corresponding
selective prediction and uncertainty estimation performance. We consider some of
the most popular estimation performance metrics previously proposed including
AUROC, ECE, AURC as well as coverage for selective accuracy constraint. We
present a novel and comprehensive study of selective prediction and the uncertainty
estimation performance of 523 existing pretrained deep ImageNet classifiers that are
available in popular repositories. We identify numerous and previously unknown
factors that affect uncertainty estimation and examine the relationships between
the different metrics. We find that distillation-based training regimes consistently
yield better uncertainty estimations than other training schemes such as vanilla
training, pretraining on a larger dataset and adversarial training. Moreover, we find
a subset of ViT models that outperform any other models in terms of uncertainty
estimation performance. For example, we discovered an unprecedented 99% top-1
selective accuracy on ImageNet at 47% coverage (and 95% top-1 accuracy at 80%)
for a ViT model, whereas a competing EfficientNet-V2-XL cannot obtain these
accuracy constraints at any level of coverage. Our companion paper, also published
in ICLR 2023 (Galil et al., 2023), examines the performance of these classifiers in
a class-out-of-distribution setting.
1
Introduction
The excellent performance of deep neural networks (DNNs) has been demonstrated in a range of
applications, including computer vision, natural language understanding and audio processing. To
deploy these models successfully, it is imperative that they provide an uncertainty quantification of
their predictions, either via some kind of selective prediction or a probabilistic confidence score.
Notwithstanding, what metric should we use to evaluate the uncertainty estimation performance?
There are many and diverse ways so the answer to this question is not obvious, and to demonstrate
the difficulty, consider the case of two classification models for the stock market that predict whether
a stock's value is about to increase, decrease, or remain neutral (three-class classification). Suppose
that model A has a 95% true accuracy, and generates a confidence score of 0.95 on every prediction
(even on misclassified instances); model B has a 40% true accuracy, but always gives a confidence
score of 0.6 on correct predictions, and 0.4 on incorrect ones. Model B can be utilized easily to
generate perfect investment decisions. Using selective prediction (El-Yaniv & Wiener, 2010; Geifman
& El-Yaniv, 2017), Model B will simply reject all investments on stocks whenever the confidence
score is 0.4. While model A offers many more investment opportunities, each of its predictions
carries a 5% risk of failure.
Figure 1: A comparison of 523 models by their AUROC (×100, higher is better) and -log(ECE)
(higher is better) on ImageNet. Each marker's size is determined by the model's number of parameters.
A full version graph is given in Figure 8. Distilled models are better than non-distilled ones. A subset
of ViT models is superior to all other models for all aspects of uncertainty estimation ("ViT" in the
legend, marked as a red triangle facing upwards); the performance of EfficientNet-V2 and GENet
models is worse.
Among the various metrics proposed for evaluating the performance of uncertainty estimation are:
Area Under the Receiver Operating Characteristic (AUROC or AUC), Area Under the Risk-Coverage
curve (AURC) (Geifman et al., 2018), selective risk or coverage for a selective accuracy constraint
(SAC), Negative Log-likelihood (NLL), Expected Calibration Error (ECE), which is often used for
evaluating a model's calibration (see Section 2) and Brier score (Brier, 1950). All these metrics
are well known and are often used for comparing the uncertainty estimation performance of models
(Moon et al., 2020; Nado et al., 2021; Maddox et al., 2019; Lakshminarayanan et al., 2017). Somewhat
surprisingly, NLL, Brier, AURC, and ECE all fail to reveal the uncertainty superiority of Model B
in our investment example (see Appendix A for the calculations). Both AUROC and SAC, on the
other hand, reveal the advantage of Model B perfectly (see Appendix A for details). It is not hard
to construct counterexamples where these two metrics fails and others (e.g., ECE) succeed. To sum
up this brief discussion, we believe that the ultimate suitability of a performance metric should be
determined by its context. If there is no specific application in mind, there is a strong incentive to
examine a variety of metrics, as we choose to do in this study.
This study evaluates the ability of 523 models from the Torchvision and Timm repositories (Paszke
et al., 2019; Wightman, 2019) to estimate uncertainty1. Our study identifies several major factors that
affect confidence rankings, calibration, and selective prediction, and lead to numerous empirical
contributions important to selective predictions and uncertainty estimation. While no new algorithm
or method is introduced in our paper, our study generates many interesting conclusions that will help
practitioners achieve more powerful uncertainty estimation. Moreover, the research questions that
are uncovered by our empirical study shed light on uncertainty estimation, which may stimulate the
development of new methods and techniques for improving uncertainty estimation. Among the most
interesting conclusions our study elicits are:
(1) Knowledge distillation training improves estimation. Training regimes incorporating any
kind of knowledge distillation (KD) (Hinton et al., 2015) lead to DNNs with improved uncertainty
estimation performance evaluated by any metric, more than by using any other training tricks (such
1Our code is available at https://github.com/IdoGalil/benchmarking-uncertainty-estimation-performance
2
23467788082848688ModelsVariousAlexNetBiTBiT distilledEfficientNetV2GENetMLP MixerMLP Mixer distilledRegNetYResMLPResMLP distilledResNetViTViT*ViT* distilledXCiTXCiT distilled5 ModelsResMLPResMLP distilled ResNetViTViT*ViT* distilledXCiTXCiT distilledVariousAlexNetBiTBiT distilled EfficientNetV2 GENet Mixer Mixer distilledMLPMLPRegNetY-log(ECE)AUROCas pretraining on a larger dataset, adversarial training, etc.). In Galil et al. (2023) we find similar
performance boosts for class-out-of-distribution (C-OOD) detection.
(2) Certain architectures are more inclined to perform better or worse at uncertainty estima-
tion. Some architectures seem more inclined to perform well on all aspects of uncertainty estimation,
e.g., a subset of vision transformers (ViTs) (Dosovitskiy et al., 2021) and the zero-shot language–
vision CLIP model (Radford et al., 2021), while other architectures tend to perform worse, e.g.,
EfficientNet-V2 and GENet (Tan & Le, 2021; Lin et al., 2020). These results are visualized in
Figure 1. In Galil et al. (2023) we find that ViTs and CLIPs are also powerful C-OOD detectors.
(3) Several training regimes result in a subset of ViTs that outperforms all other architectures
and training regimes. These regimes include the original one from the paper introducing ViTs
(Dosovitskiy et al., 2021; Steiner et al., 2022; Chen et al., 2022; Ridnik et al., 2021). These ViTs
achieve the best uncertainty estimation performance on any aspect measured, both in absolute terms
and per-model size (# parameters, see Figures 9 and 10 in Appendix B).
(4) Temperature scaling improves selective and ranking performance. The simple post-training
calibration method of temperature scaling (Guo et al., 2017), which is known to improve ECE, for
the most part also improves ranking (AUROC) and selective prediction-meaning not only does it
calibrate the probabilistic estimation for each individual instance, but it also improves the partial
order of all instances induced by those improved estimations, pushing instances more likely to be
correct to have a higher confidence score than instances less likely to be correct (see Section 3).
(5) The correlations between AUROC, ECE, accuracy and the number of parameters are de-
pendent on the architecture analyzed. Contrary to previous work by (Guo et al., 2017), we observe
that while there is a strong correlation between accuracy/number of parameters and ECE or AUROC
within each specific family of models of the same architecture, the correlation flips between a strong
negative and a strong positive correlation depending on the type of architecture being observed. For
example, as DLA (Yu et al., 2018) architectures increase in size and accuracy, their ECE deteriorates
while their AUROC improves. The exact opposite, however, can be observed in XCiTs (Ali et al.,
2021) as their ECE improves with size while their AUROC deteriorates (see Appendix L).
(6) The best model in terms of AUROC or SAC is not always the best in terms of calibration,
as illustrated in Figure 1, and the trade-off should be considered when choosing a model based on its
application.
2 How to evaluate deep uncertainty estimation performance
Let X be the input space and Y be the label space. Let P (X , Y) be an unknown distribution over
X × Y. A model f is a prediction function f : X → Y, and its predicted label for an image
x is denoted by ˆyf (x). The model's true risk w.r.t. P is R(f |P ) = EP (X ,Y)[(cid:96)(f (x), y)], where
(cid:96) : Y × Y → R+ is a given loss function, for example, 0/1 loss for classification. Given a labeled
set Sm = {(xi, yi)}m
i=1 ⊆ (X × Y), sampled i.i.d. from P (X , Y), the empirical risk of model f is
ˆr(f |Sm) (cid:44) 1
i=1 (cid:96)(f (xi), yi). Following Geifman et al. (2018), for a given model f we define
m
a confidence score function κ(x, ˆy|f ), where x ∈ X , and ˆy ∈ Y is the model's prediction for x, as
follows. The function κ should quantify confidence in the prediction of ˆy for the input x, based on
signals from model f . This function should induce a partial order over instances in X .
(cid:80)m
The most common and well-known κ function for a classification model f (with softmax at its last
layer) is its softmax response values: κ(x, ˆy|f ) (cid:44) f (x)ˆy (Cordella et al., 1995; De Stefano et al.,
2000). We chose to focus on studying uncertainty estimation performance using softmax response as
the models' κ function because of its extreme popularity, and its importance as a baseline due to its
solid performance compared to other methods (Geifman & El-Yaniv, 2017; Geifman et al., 2018).
While this is the main κ we evaluate, we also test the popular uncertainty estimation technique of
Monte Carlo dropout (MC dropout) (Gal & Ghahramani, 2016), which is motivated by Bayesian
reasoning. Although these methods use the direct output from f , κ could be a different model
unrelated to f and unable to affect f 's predictions. Note that to enable a probabilistic interpretation,
κ can only be calibrated if its values reside in [0, 1] whereas for ranking and selective prediction any
value in R can be used.
3
A selective model f (El-Yaniv & Wiener, 2010; Chow, 1957) uses a selection function g : X →
{0, 1} to serve as a binary selector for f , enabling it to abstain from giving predictions for certain
inputs. g can be defined by a threshold θ on the values of a κ function such that gθ(x|κ, f ) =
1[κ(x, ˆyf (x)|f ) > θ]. The performance of a selective model is measured using coverage and risk,
where coverage, defined as φ(f, g) = EP [g(x)], is the probability mass of the non-rejected instances
in X . The selective risk of the selective model (f, g) is defined as R(f, g) (cid:44) EP [(cid:96)(f (x),y)g(x)]
. These
quantities can be evaluated empirically over a finite labeled set Sm, with the empirical coverage
defined as ˆφ(f, g|Sm) = 1
i=1 g(xi), and the empirical selective risk defined as ˆr(f, g|Sm) (cid:44)
m
i=1 (cid:96)(f (xi),yi)g(xi)
. Similarly, SAC is defined as the largest coverage available for a specific
accuracy constraint. A way to visually inspect the behavior of a κ function for selective prediction
ˆφ(f,g|Sm)
(cid:80)m
φ(f,g)
(cid:80)m
1
m
Figure 2: The RC curve made by a ResNet18 trained on CIFAR-10, measured on the test set. The
risk is calculated using a 0/1 loss (meaning the model has about 95% accuracy for 1.0 coverage); the
κ used was softmax-response. The value of the risk at each point of coverage corresponds to the
selective risk of the model when rejecting inputs that are not covered at that coverage slice. e.g., the
selective risk for coverage 0.8 is about 0.5%, meaning that an end user setting a matching threshold
would enjoy a model accuracy of 99.5% on the 80% of images the model would not reject.
can be done using the risk-coverage (RC) curve (El-Yaniv & Wiener, 2010)-a curve showing the
selective risk as a function of coverage, measured on some chosen test set; see Figure 2 for an
example. In general, though, two RC curves are not necessarily comparable if one does not fully
dominate the other (Figure 3 shows an example of lack of dominance).
The AURC and E-AURC metrics were defined by (Geifman et al., 2018) for quantifying the selective
quality of κ functions via a single number, with AURC being defined as the area under the RC
curve. AURC, however, is very sensitive to the model's accuracy, and in an attempt to mitigate this,
E-AURC was suggested. The latter also suffers from sensitivity to accuracy, as we demonstrate in
Appendix C. The advantage of scalar metrics such as the above is that they summarize the model's
overall uncertainty estimation behavior by reducing it to a single scalar. When not carefully chosen,
however, these reductions could result in a loss of vital information about the problem (recall the
investment example from Section 1, which is also discussed in Appendix A: reducing an RC curve
to an AURC does not show that Model B has an optimal 0 risk if the coverage is smaller than 0.4).
Thus, the choice of the "correct" single scalar performance metric unfortunately must be task-specific.
When comparing the uncertainty estimation performance of deep architectures that exhibit different
accuracies, we find that AUROC and SAC can effectively "normalize" accuracy differences that
plague the usefulness of other metrics (see Figure 3). This normalization is essential in our study
where we compare uncertainty performance of hundreds of models that can greatly differ in their
accuracies.
For risk-sensitive deployment, let us consider the two models in Figure 3 ; EfficientNet-V2-XL (Tan
& Le, 2021) and ViT-B/32-SAM (Chen et al., 2022). While the former model has better overall
accuracy and AURC (metrics that could lead us to believe the model is best for our needs), it cannot
guarantee a Top-1 ImageNet selective accuracy above 95% for any coverage. ViT-B/32-SAM, on the
other hand, can provide accuracies above 95% for all coverages below 50%.
4
Figure 3: A comparison of RC curves made by the best (ViT-L/16-384) and worst (EfficientNet-
V2-XL) models we evaluated in terms of AUROC. Comparing ViT-B/32-SAM to EfficientNet-V2
exemplifies the fact that neither accuracy nor AURC reflect selective performance well enough.
In applications where risk (or coverage) constraints are dictated (Geifman & El-Yaniv, 2017), the
most straightforward and natural metric is SAC (or selective risk), which directly measures the
coverage (resp., risk) given at the required level of risk (resp., coverage) constraint. We demonstrate
this in Appendix I, evaluating which models give the most coverage for an ambitious SAC of 99%. If
instead a specific range of coverages is specified, we could measure the area under the RC curve for
those coverages: AURCC(κ, f |Sm) = 1
|C|
ˆr(f, gc|Sm), with C being those required coverages.
(cid:80)
c∈C
Often, these requirements are not known or can change as a result of changing circumstances
or individual needs. Also, using metrics sensitive to accuracy such as AURC makes designing
architectures and methods to improve κ very hard, since an improvement in these metrics could be
attributed to either an increase in overall accuracy (if such occurred) or to a real improvement in the
model's ranking performance. Lastly, some tasks might not allow the model to abstain from making
predictions at all, but instead require interpretable and well-calibrated probabilities of correctness,
which could be measured using ECE.
2.1 Measuring ranking and calibration
A κ function is not necessarily able to change the model's predictions. Therefore, it can improve the
selective risk by ranking correct and incorrect predictions better, inducing a more accurate partial
order over instances in X . Thus, for every two random samples (x1, y1), (x2, y2) ∼ P (X , Y) and
given that (cid:96)(f (x1), y1) > (cid:96)(f (x2), y2), the ranking performance of κ is defined as the probability
that κ ranks x2 higher than x1:
Pr[κ(x1, ˆy|f ) < κ(x2, ˆy|f )|(cid:96)(f (x1), y1) > (cid:96)(f (x2), y2)]
(1)
We discuss this definition in greater detail in Appendix D. The AUROC metric is often used in the
field of machine learning. When the 0/1 loss is in play, it is known that AUROC in fact equals
the probability in Equation (1) (Fawcett, 2006) and thus is a proper metric to measure ranking in
classification (AKA discrimination). AUROC is furthermore equivalent to Goodman and Kruskal's
γ-correlation (Goodman & Kruskal, 1954), which for decades has been extensively used to measure
ranking (known as "resolution") in the field of metacognition (Nelson, 1984). The precise relationship
between γ-correlation and AUROC is γ = 2 * AUROC − 1 (Higham & Higham, 2018). We note
also that both the γ-correlation and AUROC are nearly identical or closely related to various other
correlations and metrics; γ-correlation (AUROC) becomes identical to Kendall's τ (up to a linear
5
䄀唀刀伀䌀㴀㜀㜀⸀㜀㜀䄀唀刀䌀㴀㘀㠀⸀㐀㔀䄀唀刀伀䌀㴀㠀㜀⸀㔀(ᄀ)䄀唀刀䌀㴀㜀㘀⸀㠀吀漀瀀ⴀ 䤀洀愀最攀一攀琀 䔀爀爀漀爀 ⠀刀椀猀欀⤀䌀漀瘀攀爀愀最攀刀椀猀欀ⴀ䌀漀瘀攀爀愀最攀 䌀甀爀瘀攀 䌀漀洀瀀愀爀椀猀漀渀䄀挀挀甀爀愀挀礀 㴀 ⸀㜀㐀䔀爀爀漀爀 刀愀琀攀 㴀 ⸀(ᄀ)㘀䄀挀挀甀爀愀挀礀 㴀 ⸀㠀㘀䔀爀爀漀爀 刀愀琀攀㴀 ⸀㐀䄀挀挀甀爀愀挀礀 㴀 ⸀㠀㜀䔀爀爀漀爀 刀愀琀攀㴀 ⸀アパート䄀唀刀伀䌀㴀㠀㠀⸀㐀㤀䄀唀刀䌀㴀(ᄀ)㘀⸀㐀㠀䈀椀最最攀爀 䄀唀刀伀䌀 ⠀砀 ⤀ 椀猀 戀攀琀琀攀爀匀洀愀氀氀攀爀 䄀唀刀䌀 ⠀砀 ⤀ 椀猀 戀攀琀琀攀爀transformation) in the absence of tied values. Both metrics are also closely related to rank-biserial
correlation, the Gini coefficient (not to be confused with the measure from economics) and the
Mann–Whitney U test, hinting at their importance and usefulness in a variety of fields and settings.
In Appendix E, we briefly compare the ranking performance of deep neural networks and humans
in metacognitive research, and in Appendix F we address criticism of using AUROC to measure
ranking.
The most widely used metric for calibration is ECE (Naeini et al., 2015). For a finite test set of size
N , ECE is calculated by grouping all instances into m interval bins (such that m (cid:28) N ), each of size
m (the confidence interval of bin Bj is ( j−1
1
m ]). With acc(Bj) being the mean accuracy in bin Bj
and conf(Bj) being its mean confidence, ECE is defined as
m , j
ECE =
m
(cid:88)
j=1
|Bj|
N
(cid:88)
i∈Bj
(cid:12)
(cid:12)
(cid:12)
(cid:12)
1[ˆyf (xi) = yi]
|Bj|
−
κ(x, ˆyf (xi)|f )
|Bj|
(cid:12)
(cid:12)
(cid:12)
(cid:12)
=
m
(cid:88)
j=1
|Bj|
N
|acc(Bj) − conf(Bj)|
Since ECE is widely accepted we use it here to evaluate calibration, and follow (Guo et al., 2017) in
setting the number of bins to m = 15. Many alternatives to ECE exist, allowing an adaptive binning
scheme, evaluating the calibration on the non-chosen labels as well, and other various methods
(Nixon et al., 2019; Vaicenavicius et al., 2019; Zhao et al., 2020). Relevant to our objective is that by
using binning, this metric is not affected by the overall accuracy as is the Brier score (mentioned in
Section 1), for example.
3 Performance Analysis
In this section we study the performance of 523 different models (available in timm 0.4.12 and
torchvision 0.10). Note that all figures from our analysis are available as interactive plotly plots in the
supplementary material, which provides information about every data point.
1) Among the training regimes evaluated, knowledge distillation improves performance the
most. We evaluated several training regimes: (a) Training that involves KD in any form, including
Touvron et al. (2021b), knapsack pruning with distillation (in which the teacher is the original
unpruned model) (Aflalo et al., 2020) and a pretraining technique that employs distillation (Ridnik
et al., 2021); (b) adversarial training (Xie et al., 2020a; Tram`er et al., 2018); (c) pretraining on
ImageNet21k ("pure", with no additions) (Tan & Le, 2021; Touvron et al., 2021a, 2022); and (d)
various forms of weakly or semi-supervised learning (Mahajan et al., 2018; Yalniz et al., 2019;
Xie et al., 2020b). To make a fair comparison, we only compare pairs of models such that both
models have identical architectures and training regimes, with the exception of the method itself
being evaluated (e.g., training with or without knowledge distillation). More information about each
data point of comparison is available in the supplementary material. Note that the samples are of
various sizes due to the different number of potential models available for each.
Of the methods mentioned above, training methods incorporating distillation improve AUROC and
ECE the most. For example, looking at Figure 4a, it is evident that distillation (purple box) almost
always improves AUROC, and moreover, its median improvement is the best of all techniques
evaluated. The same observation can be made with regards to improving ECE; see Figure 4b.
Distillation seems to greatly improve both metrics even when the teacher itself is much worse at both
metrics. Figure 5 nicely shows this by comparing the teacher architecture and the students in each
case. Additionally, in a pruning scenario that included distillation in which the original model was
also the teacher (Aflalo et al., 2020), the pruned models outperformed their teachers. The fact that KD
improves the model over its original form is surprising, and suggests that the distillation process itself
helps uncertainty estimation. In Galil et al. (2023) we find that KD also improves C-OOD detection
performance, measured by AUROC. We discuss these effects in greater detail in Appendix G.
2) Temperature scaling greatly benefits AUROC and selective prediction. Evaluations of the
simple post-training calibration method of temperature scaling (TS) (Guo et al., 2017), which
is widely known to improve ECE without changing the model's accuracy, also revealed several
interesting facts: (a) TS consistently and greatly improves AUROC and selective performance (see
6
(a)
(b)
Figure 4: A comparison of different methods and their improvement in terms of (a) AUROC and (b)
ECE, relative to the same model's performance without employing the method. Markers above the
x-axis represent models that benefited from the evaluated method, and vice versa. The numbers in the
legend to the right of each method indicate the number of pairs compared. Temperature scaling can
sometimes harm ECE, even though its purpose is to improve it.
Figure 4a)-meaning not only does TS calibrate the probabilistic estimation for each individual
instance, but it also improves the partial order of all instances induced by those improved estimations.
While TS is well known and used for calibration, to the best of our knowledge, its benefits for
selective prediction were previously unknown. (b) While TS is usually beneficial, it could harm
some models (see Figures 4a and 4b). While it is surprising that TS-a calibration method-would
harm ECE, this phenomenon is explained by the fact that TS optimizes NLL and not ECE (to avoid
trivial solutions), and the two may sometimes misalign. (c) Models that benefit from TS in terms
of AUROC tend to have been assigned a temperature smaller than 1 by the calibration process (see
Figure 6). This, however, does not hold true for ECE (see Figure 14 in Appendix H). This example
also emphasizes the fact that improvements in terms of AUROC do not necessarily translate into
improvements in ECE, and vice versa. (d) While all models usually improve with TS, the overall
ranking of uncertainty performance between families tends to stay similar, with the worse (in terms
of ECE and AUROC) models closing most of the gap between them and the mediocre ones (see
Figure 13 in Appendix H). .
3) A subset of ViTs outperforms all other architectures in selective prediction, ranking and
calibration, both in absolute terms and per-model size. Several training regimes (including the
original regime from the paper introducing ViT) Dosovitskiy et al. (2021); Steiner et al. (2022); Chen
et al. (2022); Ridnik et al. (2021) result in ViTs that outperform all other architectures and training
regimes in terms of AUROC and ECE (see Figure 1; Figure 13 in Appendix H shows this is true
even after using TS) as well as for the SAC of 99% we explored (see Figure 7 and Appendix I).
These ViTs also outperform all other models in terms of C-OOD detection performance (Galil et al.,
7
−3−2−10123Method4 Adversarial Training (10)Pretraining on ImageNet21k (12) Semi-Supervised Learning (17)Distillation (36) Temperature Scaling (523)MC-Dropout (22)AUROC Improvement over Vanilla−0.0500.050.10.150.2ECE Improvement over VanillaTemperature Scaling can sometimes harm ECEMethodAdversarial Training (10)Pretraining on ImageNet21k (12) Semi-Supervised Learning (17)Distillation (36) Temperature Scaling (523)Figure 5: Comparing teacher models (yellow markers) to their KD students (represented by markers
with thick borders and a dot). The performance of each model is measured in AUROC (higher is
better) and -log(ECE) (higher is better).
Figure 6: Out of 523 models evaluated, models that were assigned a temperature higher than 1 by the
calibration process tended to degrade in AUROC performance rather than improve. Markers above
the x-axis represent models that benefited from TS, and vice versa.
2023). Moreover, for any size, ViT models outperform their competition in all of these metrics (see
Figures 9 and 10 in Appendix B and Figure 15 in Appendix I).
Further research into other training regimes, however, reveals that not all training regimes result
in superb performance (Touvron et al., 2021b, 2022; Singh et al., 2022; Paszke et al., 2019) (these
ViTs are dubbed "ViT∗" in the figures), even when a similar amount of data is introduced into the
training and strong augmentations are used. In fact, the models trained by Chen et al. (2022) were not
pretrained at all and yet reach superb ranking. Even the largest model introduced by Tran et al. (2022),
which is a large modified ViT that was pretrained on JFT-4B (a dataset containing 4 billion images)
with the aim of excelling in uncertainty estimation (and other areas), is outperformed by the best ViT
we evaluated: Plex L achieves an AUROC of 87.7 (while its smaller versions, Plex M and Plex S,
achieve an AUROC of 87.4 and 86.7, respectively), compared to 88.5 achieved by ViT-L/16-384 that
has less parameters and was pretrained on ImageNet-21k. In total, 18 ViTs trained on ImageNet-21k
outperform2 Plex L, among which are two variations of small ViTs (each with 36 or 22 million
parameters). In Appendix J we analyze the different hyperparameters and augmentations used for
2The authors had not released clear results for Plex ECE performance on ImageNet, making a comparison
of calibration difficult. The authors mentioned that the average ECE of Plex L in CIFAR-10, CIFAR-100 and
8
2.533.544.555.566.578384858687-log(ECE)AUROCModelsBiTBiT distilledDeiT distilled ECANetECANet distilled EfficientNet EfficientNet distilled PiT distilled RegNetY-16GF ResMLP distilled XCiT distilledTemperature Scaling (Temp. < 1)Temperature Scaling (Temp. > 1)−2−1012345AUROC Improvement over Vanilla6 Temperature Scaling (Temp. < 1) Temperature Scaling (Temp. > 1) MethodFigure 7: Comparison of models by their overall accuracy and the coverage they are able to provide
given a selective accuracy constraint of Top-1 99% on ImageNet. A higher coverage is better. Only
ViT models are able to provide coverage beyond 30% for this constraint. They provide more coverage
than any other model compared to their accuracy or size. "Various" refers to all other models (out of
the 523) that were not mentioned by name.
training the ViT models evaluated in this paper. Unfortunately, no clear conclusions emerge to explain
the advantage of the successful training regimes. There is, however, ample evidence to show that
advanced augmentations are unlikely to be part of such an explanation.
The above facts suggest that the excellent performance exhibited by some ViTs cannot be attributed
to the amount of data or to the augmentations used during training. These observations warrant
additional research with the hope of either training more robust ViTs or transferring the unidentified
ingredient of the successful subset of ViTs into other models.
4) Correlations between AUROC, ECE, accuracy and the model's size could either be positive
or negative, and depend on the family of architectures evaluated. This observation contradicts
previous smaller scale studies on calibration. While AUROC and ECE are (negatively) correlated
(they have a Spearman correlation of -0.44, meaning that generally, as AUROC improves, so does
ECE), their agreement on the best performing model depends greatly on the architectural family in
question. For example, the Spearman correlation between the two metrics evaluated on 28 undistilled
XCiTs is 0.76 (meaning ECE deteriorates as AUROC improves), while for the 33 ResNets (He et al.,
2016) evaluated, the correlation is -0.74. Another general observation is that contrary to previous
work by (Guo et al., 2017) concerning ECE, the correlations between ECE and the accuracy or the
number of model parameters are nearly zero, although each family tends to have a strong correlation,
either negative or positive. We include a family-based comparison in Appendix L for correlations
between AUROC/ECE and accuracy, number of parameters and input size. These results suggest that
while some architectures might utilize extra resources to achieve improved uncertainty estimation
capabilities, other architectures do not and are even harmed in this respect.
5) The zero-shot language–vision CLIP model is well-calibrated, with its best instance outper-
forming 96% of all other models. CLIP (Radford et al., 2021) enables zero-shot classification
and demonstrates impressive performance. We find it is also inclined to be well-calibrated. See
Appendix K for details about how we use CLIP. The most calibrated CLIP is based on ViT-B/32
with a linear-probe added to it, and obtains an ECE of 1.3%, which outperforms 96% of models
evaluated. Moreover, for their size category, CLIP models tend to outperform their competition in
calibration, with the exception of ViTs (see Figure 10 in Appendix B). While this trend is clear for
zero-shot CLIPs, we note that some models' calibration performance deteriorates with the addition
ImageNet is slightly below 0.01. Our evaluations revealed six ViTs that achieved the same results, with the most
calibrated model being ViT-T/16 with an ECE of 0.0054 on ImageNet.
9
01020304050606570758085ModelsVariousAlexNetBiTDLARegNetXRegNetYResNetSWSL ResNeXtViTViT*Coverage for Accuracy 99AccuracyModelsVarious AlexNet BiT DLARegNetXRegNetY ResNet SWSL ResNeXt ViT ViT*of a linear-probe. Further research is required to understand the ingredients of multimodal models'
contribution to calibration, and to find ways to utilize them to get better calibrated models. For
example, could a multimodal pretraining regime be used to get better calibrated models?
6) MC dropout does not improve selective performance, in accordance with previous works.
We evaluate the performance of MC dropout using predictive entropy as its confidence score and
30 dropout-enabled forward passes. We do not measure its effects on ECE since entropy scores
do not reside in [0, 1]. Using MC dropout causes a consistent drop in both AUROC and selective
performance compared with using the same models with softmax as the κ (see Appendix M and
Figure 4a). MC dropout's underperformance was also previously observed in (Geifman & El-Yaniv,
2017). We note, however, that evaluations we have conducted in Galil et al. (2023) show that MC
dropout performs well when dealing with C-OOD data.
4 Concluding Remarks
We presented a comprehensive study of the effectiveness of numerous DNN architectures (families)
in providing reliable uncertainty estimation, including the impact of various techniques on improv-
ing such capabilities. Our study led to many new insights and perhaps the most important ones
are: (1) architectures trained with distillation almost always improve their uncertainty estimation
performance, (2) temperature scaling is very useful not only for calibration but also for ranking and
selective prediction, and (3) no DNN (evaluated in this study) demonstrated an uncertainty estimation
performance comparable-in any metric tested-to a subset of ViT models (see Section 3).
Our work leaves open many interesting avenues for future research and we would like to mention a
few. Perhaps the most interesting question is why distillation is so beneficial in boosting uncertainty
estimation. Next, is there an architectural secret in vision transformers (ViT) that enables their
uncertainty estimation supremacy under certain training regimes? This issue is especially puzzling
given the fact that comparable performance is not observed in many other supposedly similar
transformer-based models that we tested. If the secret is not in the architecture, what is the mysterious
ingredient of the subset of training regimes that produces such superb results, and how can it be used
to train other models? Finally, can we create specialized training regimes (e.g., Geifman & El-Yaniv
(2019)), specialized augmentations, special pretraining regimes (such as CLIP's multimodal training
regime) or even specialized neural architecture search (NAS) strategies that can promote superior
uncertainty estimation performance?
Acknowledgments
This research was partially supported by the Israel Science Foundation, grant No. 710/18.
We thank Prof. Rakefet Ackerman for her help with understanding how uncertainty estimation
performance is evaluated for humans in the field of metacognition, and for her useful comments for
Appendix E.
References
Rakefet Ackerman, Avi Parush, Fareda Nassar, and Avraham Shtub. Metacognition and system
usability: Incorporating metacognitive research paradigm into usability testing. Computers in
Human Behavior, 54:101–113, January 2016. doi: 10.1016/j.chb.2015.07.041. URL https:
//doi.org/10.1016/j.chb.2015.07.041.
Rakefet Ackerman, Avigdor Gal, Tomer Sagi, and Roee Shraga. A cognitive model of human
In PRICAI 2019: Trends in Artificial Intelligence, pp. 632–646. Springer
bias in matching.
International Publishing, 2019. doi: 10.1007/978-3-030-29908-8 50. URL https://doi.org/10.
1007/978-3-030-29908-8 50.
Yonathan Aflalo, Asaf Noy, Ming Lin, Itamar Friedman, and Lihi Zelnik-Manor. Knapsack pruning
with inner distillation. CoRR, abs/2002.08258, 2020. URL https://arxiv.org/abs/2002.08258.
Alaaeldin Ali, Hugo Touvron, Mathilde Caron, Piotr Bojanowski, Matthijs Douze, Armand Joulin,
Ivan Laptev, Natalia Neverova, Gabriel Synnaeve, Jakob Verbeek, and Herv ́e J ́egou. Xcit: Cross-
covariance image transformers. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin,
10
Percy Liang, and Jennifer Wortman Vaughan (eds.), Advances in Neural Information Processing
Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021,
December 6-14, 2021, virtual, pp. 20014–20027, 2021. URL https://proceedings.neurips.cc/paper/
2021/hash/a655fbe4b8d7439994aa37ddad80de56-Abstract.html.
Alexandra Basile, Maggie E. Toplak, and Brendan F. Andrade. Using metacognitive methods to
examine emotion recognition in children with ADHD. Journal of Attention Disorders, 25(2):
245–257, November 2018. doi: 10.1177/1087054718808602. URL https://doi.org/10.1177/
1087054718808602.
Glenn W. Brier. Verification of Forecasts Expressed in Terms of Probability. Monthly Weather
Review, 78(1):1, January 1950. doi: 10.1175/1520-0493(1950)0780001:VOFEIT2.0.CO;2.
Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets
without pre-training or strong data augmentations. In The Tenth International Conference on
Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022.
URL https://openreview.net/forum?id=LtKcMgGOeLt.
C. K. Chow. An optimum character recognition system using decision functions. IRE Transactions
on Electronic Computers, EC-6(4):247–254, 1957. doi: 10.1109/TEC.1957.5222035.
L. P. Cordella, C. De Stefano, F. Tortorella, and M. Vento. A method for improving classification
reliability of multilayer perceptrons. IEEE Transactions on Neural Networks, 6(5):1140–1147,
1995. doi: 10.1109/72.410358.
C. De Stefano, C. Sansone, and M. Vento. To reject or not to reject: that is the question-an answer
IEEE Transactions on Systems, Man, and Cybernetics, Part C
in case of neural classifiers.
(Applications and Reviews), 30(1):84–94, 2000. doi: 10.1109/5326.827457.
Yukun Ding, Jinglan Liu, Jinjun Xiong, and Yiyu Shi. Evaluation of neural network uncertainty
estimation with application to resource-constrained platforms. CoRR, abs/1903.02050, 2019. URL
http://arxiv.org/abs/1903.02050.
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 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria,
May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=YicbFdNTTy.
Ran El-Yaniv and Yair Wiener. On the foundations of noise-free selective classification. Journal of
Machine Learning Research, 11(5), 2010.
Tom Fawcett. An introduction to roc analysis. Pattern Recognition Letters, 27(8):861–874,
2006. ISSN 0167-8655. doi: https://doi.org/10.1016/j.patrec.2005.10.010. URL https://www.
sciencedirect.com/science/article/pii/S016786550500303X. ROC Analysis in Pattern Recognition.
K. Fiedler, Rakefet Ackerman, and Chiara Scarampi. ! metacognition : Monitoring and controlling
one ' s own knowledge , reasoning and decisions. 2019.
Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization
for efficiently improving generalization. In 9th International Conference on Learning Repre-
sentations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL
https://openreview.net/forum?id=6Tm1mposlrM.
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Training pruned neural networks.
CoRR, abs/1803.03635, 2018. URL http://arxiv.org/abs/1803.03635.
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model
uncertainty in deep learning. In Maria-Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings
of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA,
June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pp. 1050–1059.
JMLR.org, 2016. URL http://proceedings.mlr.press/v48/gal16.html.
Ido Galil, Mohammed Dabbah, and Ran El-Yaniv. A framework for benchmarking class-out-of-
distribution detection and its application to imagenet. In International Conference on Learning
Representations, 2023. URL https://openreview.net/forum?id=Iuubb9W6Jtk.
Yonatan Geifman and Ran El-Yaniv. Selective classification for deep neural networks. In Isabelle
Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vish-
wanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30:
11
Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long
Beach, CA, USA, pp. 4878–4887, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/
4a8423d5e91fda00bb7e46540e2b0cf1-Abstract.html.
Yonatan Geifman and Ran El-Yaniv. Selectivenet: A deep neural network with an integrated reject
option. CoRR, abs/1901.09192, 2019. URL http://arxiv.org/abs/1901.09192.
Yonatan Geifman, Guy Uziel, and Ran El-Yaniv. Bias-reduced uncertainty estimation for deep neural
classifiers. In International Conference on Learning Representations, 2018.
Leo A. Goodman and William H. Kruskal. Measures of association for cross classifications. Journal
of the American Statistical Association, 49(268):732–764, December 1954. doi: 10.1080/01621459.
1954.10501231. URL https://doi.org/10.1080/01621459.1954.10501231.
Thomas D. Griffin, Jennifer Wiley, and Keith W. Thiede. The effects of comprehension-test
expectancies on metacomprehension accuracy. Journal of Experimental Psychology: Learn-
ing, Memory, and Cognition, 45(6):1066–1092, June 2019. doi: 10.1037/xlm0000634. URL
https://doi.org/10.1037/xlm0000634.
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural
networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International
Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, vol-
ume 70 of Proceedings of Machine Learning Research, pp. 1321–1330. PMLR, 2017. URL
http://proceedings.mlr.press/v70/guo17a.html.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image
In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR
recognition.
2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778. IEEE Computer Society, 2016. doi:
10.1109/CVPR.2016.90. URL https://doi.org/10.1109/CVPR.2016.90.
Philip A. Higham and D. Paul Higham. New improved gamma: Enhancing the accuracy of good-
man–kruskal's gamma using ROC curves. Behavior Research Methods, 51(1):108–125, September
2018. doi: 10.3758/s13428-018-1125-5. URL https://doi.org/10.3758/s13428-018-1125-5.
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015.
Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun
Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, and Hartwig Adam. Searching
for mobilenetv3. CoRR, abs/1905.02244, 2019. URL http://arxiv.org/abs/1905.02244.
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive
uncertainty estimation using deep ensembles. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio,
Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in
Neural Information Processing Systems 30: Annual Conference on Neural Information Processing
Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 6402–6413, 2017. URL https:
//proceedings.neurips.cc/paper/2017/hash/9ef2ed4b7fd2c810847ffa5fa85bce38-Abstract.html.
Ming Lin, Hesen Chen, Xiuyu Sun, Qi Qian, Hao Li, and Rong Jin. Neural architecture design for
gpu-efficient networks, 2020.
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Confer-
ence on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7.
Wesley J. Maddox, Pavel Izmailov, Timur Garipov, Dmitry P. Vetrov, and Andrew Gordon Wil-
In Hanna M. Wallach,
son. A simple baseline for bayesian uncertainty in deep learning.
Hugo Larochelle, Alina Beygelzimer, Florence d'Alch ́e-Buc, Emily B. Fox, and Roman Gar-
nett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on
Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancou-
ver, BC, Canada, pp. 13132–13143, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/
118921efba23fc329e6560b27861f0c2-Abstract.html.
Dhruv Mahajan, Ross B. Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan
Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised
pretraining. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.),
Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September
8-14, 2018, Proceedings, Part II, volume 11206 of Lecture Notes in Computer Science, pp.
185–201. Springer, 2018. doi: 10.1007/978-3-030-01216-8\ 12. URL https://doi.org/10.1007/
978-3-030-01216-8 12.
12
Jooyoung Moon, Jihyo Kim, Younghak Shin, and Sangheum Hwang. Confidence-aware learning for
deep neural networks. In Proceedings of the 37th International Conference on Machine Learning,
ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning
Research, pp. 7034–7044. PMLR, 2020. URL http://proceedings.mlr.press/v119/moon20a.html.
Zachary Nado, Neil Band, Mark Collier, Josip Djolonga, Michael W. Dusenberry, Sebastian Far-
quhar, Angelos Filos, Marton Havasi, Rodolphe Jenatton, Ghassen Jerfel, Jeremiah Liu, Zelda
Mariet, Jeremy Nixon, Shreyas Padhy, Jie Ren, Tim G. J. Rudner, Yeming Wen, Florian Wen-
zel, Kevin Murphy, D. Sculley, Balaji Lakshminarayanan, Jasper Snoek, Yarin Gal, and Dustin
Tran. Uncertainty baselines: Benchmarks for uncertainty & robustness in deep learning. CoRR,
abs/2106.04015, 2021. URL https://arxiv.org/abs/2106.04015.
Mahdi Pakdaman Naeini, Gregory F. Cooper, and Milos Hauskrecht. Obtaining well calibrated
probabilities using bayesian binning. In Proceedings of the Twenty-Ninth AAAI Conference on
Artificial Intelligence, AAAI'15, pp. 2901–2907. AAAI Press, 2015. ISBN 0262511290.
Niv Nayman, Yonathan Aflalo, Asaf Noy, and Lihi Zelnik. Hardcore-nas: Hard constrained differ-
entiable neural architecture search. In Marina Meila and Tong Zhang (eds.), Proceedings of the
38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event,
volume 139 of Proceedings of Machine Learning Research, pp. 7979–7990. PMLR, 2021. URL
http://proceedings.mlr.press/v139/nayman21a.html.
Thomas O. Nelson. A comparison of current measures of the accuracy of feeling-of-knowing
predictions. Psychological Bulletin, 95(1):109–133, 1984. doi: 10.1037/0033-2909.95.1.109. URL
https://doi.org/10.1037/0033-2909.95.1.109.
Jeremy Nixon, Michael W. Dusenberry, Linchuan Zhang, Ghassen Jerfel, and Dustin Tran.
In IEEE Conference on Computer Vision and Pat-
Measuring calibration in deep learning.
tern Recognition Workshops, CVPR Workshops 2019, Long Beach, CA, USA, June 16-20,
2019, pp. 38–41. Computer Vision Foundation / IEEE, 2019. URL http://openaccess.thecvf.
com/content CVPRW 2019/html/Uncertainty and Robustness in Deep Visual Learning/
Nixon Measuring Calibration in Deep Learning CVPRW 2019 paper.html.
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan,
Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas
Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy,
Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style,
high-performance deep learning library.
In H. Wallach, H. Larochelle, A. Beygelzimer,
F. d'Alch ́e-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Sys-
tems 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/
9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf.
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. In Marina Meila and Tong
Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021,
18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp.
8748–8763. PMLR, 2021. URL http://proceedings.mlr.press/v139/radford21a.html.
Tal Ridnik, Emanuel Ben Baruch, Asaf Noy, and Lihi Zelnik. Imagenet-21k pretraining for the
masses. In Joaquin Vanschoren and Sai-Kit Yeung (eds.), Proceedings of the Neural Information
Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks
2021, December 2021, virtual, 2021. URL https://datasets-benchmarks-proceedings.neurips.cc/
paper/2021/hash/98f13708210194c475687be6106a3b84-Abstract-round1.html.
Mark Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen.
Mobilenetv2: Inverted residuals and linear bottlenecks. In 2018 IEEE Conference on Computer
Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp.
4510–4520. Computer Vision Foundation / IEEE Computer Society, 2018. doi: 10.1109/CVPR.
2018.00474. URL http://openaccess.thecvf.com/content cvpr 2018/html/Sandler MobileNetV2
Inverted Residuals CVPR 2018 paper.html.
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image
recognition. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning
Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings,
2015. URL http://arxiv.org/abs/1409.1556.
13
Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek
Kosaraju, Dhruv Mahajan, Ross B. Girshick, Piotr Doll ́ar, and Laurens van der Maaten. Revisiting
weakly supervised pre-training of visual perception models. CoRR, abs/2201.08371, 2022. URL
https://arxiv.org/abs/2201.08371.
Andreas Peter Steiner, Alexander Kolesnikov, Xiaohua Zhai, Ross Wightman, Jakob Uszkoreit,
and Lucas Beyer. How to train your vit? data, augmentation, and regularization in vision
transformers. Transactions on Machine Learning Research, 2022. URL https://openreview.net/
forum?id=4nPswr1KcP.
Mingxing Tan and Quoc V. Le. Efficientnetv2: Smaller models and faster training. In Marina Meila
and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning,
ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning
Research, pp. 10096–10106. PMLR, 2021. URL http://proceedings.mlr.press/v139/tan21a.html.
Hugo Touvron, Piotr Bojanowski, Mathilde Caron, Matthieu Cord, Alaaeldin El-Nouby, Edouard
Grave, Armand Joulin, Gabriel Synnaeve, Jakob Verbeek, and Herv ́e J ́egou. Resmlp: Feedforward
networks for image classification with data-efficient training. CoRR, abs/2105.03404, 2021a. URL
https://arxiv.org/abs/2105.03404.
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Herv ́e
J ́egou. Training data-efficient image transformers & distillation through attention. In Marina Meila
and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning,
ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning
Research, pp. 10347–10357. PMLR, 2021b. URL http://proceedings.mlr.press/v139/touvron21a.
html.
Hugo Touvron, Matthieu Cord, and Herv ́e J ́egou. Deit III: revenge of the vit. CoRR, abs/2204.07118,
2022. doi: 10.48550/arXiv.2204.07118. URL https://doi.org/10.48550/arXiv.2204.07118.
Florian Tram`er, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc-
Daniel. Ensemble adversarial training: Attacks and defenses. In International Conference on
Learning Representations, 2018. URL https://openreview.net/forum?id=rkZvSe-RZ.
Dustin Tran, Jeremiah Liu, Michael W. Dusenberry, Du Phan, Mark Collier, Jie Ren, Kehang Han,
Zi Wang, Zelda Mariet, Huiyi Hu, Neil Band, Tim G. J. Rudner, Karan Singhal, Zachary Nado,
Joost van Amersfoort, Andreas Kirsch, Rodolphe Jenatton, Nithum Thain, Honglin Yuan, Kelly
Buchanan, Kevin Murphy, D. Sculley, Yarin Gal, Zoubin Ghahramani, Jasper Snoek, and Balaji
Lakshminarayanan. Plex: Towards reliability using pretrained large model extensions. CoRR,
abs/2207.07411, 2022. doi: 10.48550/arXiv.2207.07411. URL https://doi.org/10.48550/arXiv.
2207.07411.
Monika Undorf and Arndt Br ̈oder. Cue integration in metamemory judgements is strategic.
Quarterly Journal of Experimental Psychology, 73(4):629–642, October 2019. doi: 10.1177/
1747021819882308. URL https://doi.org/10.1177/1747021819882308.
Juozas Vaicenavicius, David Widmann, Carl R. Andersson, Fredrik Lindsten, Jacob Roll, and
Thomas B. Sch ̈on. Evaluating model calibration in classification. In Kamalika Chaudhuri and
Masashi Sugiyama (eds.), The 22nd International Conference on Artificial Intelligence and Statis-
tics, AISTATS 2019, 16-18 April 2019, Naha, Okinawa, Japan, volume 89 of Proceedings of
Machine Learning Research, pp. 3459–3467. PMLR, 2019. URL http://proceedings.mlr.press/v89/
vaicenavicius19a.html.
Ross Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019.
Cihang Xie, Mingxing Tan, Boqing Gong, Jiang Wang, Alan L. Yuille, and Quoc V. Le. Ad-
In 2020 IEEE/CVF Conference on Com-
versarial examples improve image recognition.
puter Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020,
pp. 816–825. Computer Vision Foundation / IEEE, 2020a. doi: 10.1109/CVPR42600.2020.
00090. URL https://openaccess.thecvf.com/content CVPR 2020/html/Xie Adversarial Examples
Improve Image Recognition CVPR 2020 paper.html.
Qizhe Xie, Minh-Thang Luong, Eduard H. Hovy, and Quoc V. Le. Self-training with noisy
In 2020 IEEE/CVF Conference on Computer Vi-
student improves imagenet classification.
sion and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 10684–
10695. Computer Vision Foundation / IEEE, 2020b. doi: 10.1109/CVPR42600.2020.01070.
URL https://openaccess.thecvf.com/content CVPR 2020/html/Xie Self-Training With Noisy
Student Improves ImageNet Classification CVPR 2020 paper.html.
14
I. Zeki Yalniz, Herv ́e J ́egou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi-
supervised learning for image classification, 2019.
Fisher Yu, Dequan Wang, Evan Shelhamer, and Trevor Darrell. Deep layer aggregation. In 2018
IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2403–2412, 2018. doi:
10.1109/CVPR.2018.00255.
Shengjia Zhao, Tengyu Ma, and Stefano Ermon. Individual calibration with randomized forecasting.
In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July
2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 11387–11397.
PMLR, 2020. URL http://proceedings.mlr.press/v119/zhao20e.html.
A The investment example
Let us consider two classification models for the stock market that predict whether a stock's value
is about to increase, decrease or remain neutral (three-class classification). Suppose that Model
A has a 95% true accuracy, and generates a confidence score of 0.95 on any prediction (even on
misclassified instances); Model B has a 40% true accuracy, but always gives a confidence score of 0.6
on correct predictions, and 0.4 on incorrect ones. We now try and evaluate these two models using the
uncertainty metrics mentioned in Section 1 to see which can reveal Model B's superior uncertainty
estimation performance. AURC will fail due to its sensitivity to accuracy (the AURC of Model B is
0.12, more than twice as bad as the AURC for Model A, which is 0.05). NLL will rank Model A four
times higher (Model A's NLL is 0.23 and Model B's is 0.93). The Brier score would also much prefer
Model A (giving it a score of 0.096 while giving Model B a score of 0.54). Evaluating the models'
calibration with ECE will also not reveal Model B's advantages, since it is less calibrated than Model
A, which has perfect calibration (Model A has an ECE of 0, and Model B has a worse ECE of 0.4).
AUROC, on the other hand, would give Model B a perfect score of 1 and a terrible score of 0.5 to
Model A. The selective risk for Model B would be better for any coverage of stock predictions below
40%, and for any SAC above 95% the coverage for Model A would be 0, but 0.4 for Model B.
Those two metrics are not perfect for any example. Let us instead compare two different models for
the task of predicting the weather when we cannot abstain from making predictions. Accordingly,
being required to provide an accurate probabilistic uncertainty estimation of the model's predictions,
AUROC and selective risk would be meaningless (due to the model's inability to abstain in this task),
but ECE or the Brier Score would better evaluate the performance the new task requires.
B Ranking and Calibration Visual Comparison
A comparison of 523 models by their AUROC (×100, higher is better) and -log(ECE) (higher is
better) on ImageNet is visualized in Figure 8. An interactive version of this figure is provided
as supplementary material. To compare models fairly by their size, we plot two graphs with the
logarithm of the number of parameters as the X-axis, so that models sharing the same x value can be
compared solely based on their y value. In Figure 9 we set the X axis to be AUROC (higher is better),
and see ViTs outperform any other architecture with a comparable amount of parameters by a large
margin. We can also observe that using distillation creates a consistent improvement in AUROC. In
Figure 10 we set the X axis to be the negative logarithm of ECE (higher is better) and observe a very
similar trend, with ViT outperforming its competition for any model size.
C Demonstration of E-AURC's dependence on the model's accuracy
Excess-AURC (E-AURC) was suggested by Geifman et al. (2018) as an alternative to AURC
(explained in Section 2). To calculate E-AURC, two AURC scores need to be calculated: (1)
AU RC(model), the AURC value of the actual model and (2) AU RC(model∗), the AURC value of
a hypothetical model with identical predicted labels as the first model, but that outputs confidence
values that induce a perfect partial order on the instances in terms of their correctness. The latter
means that all incorrectly predicted instances are assigned confidence values lower than the correctly
predicted instances.
15
Figure 8: A comparison of 523 models by their AUROC (×100, higher is better) and log(ECE) (lower
is better) on ImageNet. Each marker's size is determined by the model's number of parameters. Each
dotted marker represents a distilled version of the original. An interactive version of this figure is
provided as supplementary material.
16
234567788082848688ModelsVariousAlexNetBiTCaiTCLIP + Linear ProbeCLIP Zero-ShotCoaTConViTDenseNetDLAECANetEfficientNetEfficientNetV2FBNetGENetgMLPHardCoReNASInceptionLeViTMixConvMLP MixerMnasNetMobileNetV2MobileNetV3NASNetNesTNFNetPiTRegNetXRegNetYRepVGGRes2NetResMLPResNetResNet_RSResNeXtSE_ResNetSSL_ResNetSwinSWSL_ResNetTNTTResNetTwinsVGGVisformerViTViT*WSP ResNeXt-log(ECE)AUROCFigure 9: A comparison of 523 models by their AUROC (×100, higher is better) and log(number of
model's parameters) on ImageNet. Each dotted marker represents a distilled version of the original.
Figure 10: A comparison of 523 models by their -log(ECE) (higher is better) and log(number of
model's parameters) on ImageNet. Each dotted marker represents a distilled version of the original.
E-AURC is then defined as AU RC(model)−AU RC(model∗). In essence, this metric acknowledges
that given a model's accuracy, the area of AU RC(model∗) is always unavoidable no matter how
good the partial order is, but anything above that could have been minimized if the κ function was
better at ranking, assigning correct instances higher values than incorrect ones and inducing a better
partial order over the instances.
This metric indeed helps to reduce some of the sensitivity to accuracy suffered by AURC, and for the
example presented in Section 1, E-AURC would have given a perfect score of 0 to the model inducing
a perfect partial order by its confidence values (Model B). It is easy, however, to craft examples
showing that E-AURC prefers models with higher accuracy, even if they have lower or equal capacity
to rank.
To demonstrate this in a simple way, let us consider two models with a complete lack of capacity to
rank correct and incorrect predictions correctly, always outputting the same confidence score. Model
A has an accuracy of 20% (thus an error rate of 80%), and Model B has an accuracy of 80% (and an
17
66.5788.59788082848688ModelsVariousAlexNetBiTBiT distilledEfficientNetV2GENetMLP MixerMLP Mixer distilledRegNetYResMLPResMLP distilledResNetViTViT*ViT* distilledXCiTXCiT distilledModelsResMLPResMLP distilled ResNetViTViT* ViT* distilledXCiTXCiT distilledVariousAlexNetBiTBiT distilled EfficientNetV2 GENetMLP MixerMLP Mixer distilledRegNetY7.5log(#Parameters)AUROC66.5788.59234567ModelsVariousAlexNetBiTBiT distilledCLIP + Linear Probe CLIP Zero-Shot EfficientNetV2 GENetMLP MixerMLP Mixer distilled RegNetYResMLPResMLP distilled ResNetViTViT*ViT* distilledXCiTXCiT distilled7.5log(#Parameters)-log(ECE)error rate of 20%). A good ranking metric should evaluate them equally (the same way E-AURC
gives the same score for two models that rank perfectly regardless of their accuracy). In Figure 11 we
plot their RC curves with dashed lines, which are both straight lines due to their lack of ranking ability.
We can calculate both of these models' AURCs, AU RC(modelA) = 0.8, AU RC(modelB) = 0.2.
Figure 11: The RC curves for Models A and B are plotted with dashed lines. The RC curves for the
hypothetically optimal versions of Models A and B are plotted with solid lines.
The next thing to calculate is the best AURC values those models could have achieved given the
same accuracy if they had a perfect partial order. We plot these hypothetical models' RC curves
in Figure 11 as solid lines. Their selective risk remains 0 for every coverage below their total
accuracy, since these hypothetical models assigned the highest confidence to all of their correct
instances first. As the coverage increases and they have no more correct instances to select, they begin
to give instances that are incorrect, and thus their selective risk deteriorates for higher coverages.
Calculating both of these hypothetical models' AURCs gives us the following: AU RC(modelA∗) =
0.482, AU RC(modelB∗) = 0.022. Subtracting our results we get: E-AURC(modelA) = 0.8 −
0.482 = 0.318, E-AURC(modelB) = 0.2 − 0.022 = 0.178 Hence, E-AURC prefers Model B over
Model A, even though both do not discriminate at all between incorrect and correct instances.
D More on the Definition of Ranking
Let us consider a finite set Sm = {(xi, yi)}m
i=1 ∼ PX,Y . We assume that there are no two identical
values given by κ on Sm. Such an assumption is reasonable when choosing a continuous confidence
signal.
We further denote c as the number of concordant pairs (i.e., pairs in Sm that satisfy the condition
[κ(xi, ˆy|f ) < κ(xj, ˆy|f ) ∩ (cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)]) and d as the number of discordant pairs
(i.e., pairs in Sm that satisfy the condition [κ(xi, ˆy|f ) > κ(xj, ˆy|f ) ∩ (cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)].
We assume, for now, that there are no two identical values given by (cid:96) on Sm. Accordingly, we can
further develop Equation (1) from Section 2.1 using the definition of conditional probability,
Pr[κ(xi, ˆy|f ) < κ(xj, ˆy|f )|(cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)] =
Pr[κ(xi, ˆy|f ) < κ(xj, ˆy|f ) ∩ (cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)]
Pr[(cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)]
,
18
which can be approximated empirically, using the most likelihood estimator, as
We note that the last equation is identical to Kendall's τ up to a linear transformation, which equals
c
(cid:0)m
2
(cid:1) .
(2)
(cid:1) =
c − d
(cid:0)m
2
2c − (c + d)
(cid:1)
(cid:0)m
2
(cid:1)
c − d + c − c
(cid:0)m
2
c + d
(cid:0)m
2
(cid:1) −
=
2c
(cid:0)m
2
(cid:1) − 1 = 2 * [Equation 2] − 1.
(cid:1) =
c
(cid:0)m
2
=
2 *
Otherwise, if the loss assigns two identical values to a pair of points in Sm, but κ does not, then we
get:
which is identical to Goodman & Kruskal's γ-correlation up to a linear transformation
c
c + d
.
(3)
c − d
c + d
=
c − d + c − c
c + d
c + d
c + d
−
2c
c + d
=
2c − (c + d)
c + d
=
= 2 * [Equation 3] − 1.
D.1
Inequalities of the definition
One might wonder why Equation (1) should have strict inequalities rather than non-strict ones to
define ranking. As we discuss below, this would damage the definition:
(1) If the losses had a non-strict inequality:
Pr[κ(x1, ˆy|f ) < κ(x2, ˆy|f )|(cid:96)(f (x1), y1) ≥ (cid:96)(f (x2), y2)]
Consequently, in the case of classification, for example, this probability would increase for any pairs
consisting of correct instances with different confidences. This would yield no benefit in ranking
between incorrect and correct instances and motivates giving different confidence values for instances
with the same loss-a fact that would not truly add any value.
(2) If the κ values had a non-strict inequality:
Pr[κ(x1, ˆy|f ) ≤ κ(x2, ˆy|f )|(cid:96)(f (x1), y1) > (cid:96)(f (x2), y2)].
This probability would increase for any pair (x1, x2) such that κ(x1, ˆy|f ) = κ(x2, ˆy|f ) and
(cid:96)(f (x1)) > (cid:96)(f (x2)), although κ should have ranked x1 with a lower value. Furthermore, if a
κ function were to assign the same confidence score to all x ∈ X , then when there are no two
identical values of losses, the definition's probability would be 1; otherwise, the more different
values for losses there are, the larger the probability would grow. In classification with a 0/1 loss, for
example, assigning the same confidence score to all instances would result in the probability being
Accuracy(f ) * (1 − Accuracy(f )), which is largest when Accuracy(f ) = 0.5.
E Ranking capacity comparison between humans and neural networks
In the field of metacognition, interestingly, the predictive value of confidence is evaluated by two
different aspects: by its ability to discriminate between correct and incorrect predictions (also known
as resolution in metacognition or ranking in our context) and by its ability to give well-calibrated
19
confidence estimations, not being over- or under-confident (Fiedler et al., 2019). These two aspects
correspond perfectly with much of the research done in the deep learning field, with the nearly
matching metric to AUROC of γ-correlation (see Section 2).
This allows us to compare how well humans rank predictions in various tasks versus how well
models rank their own in others. Human AUROC measurements in various tasks (translated from
γ-correlation) tend to range from 0.6 to 0.75 (Undorf & Br ̈oder, 2019; Basile et al., 2018; Ackerman
et al., 2016), but could vary, usually towards much lower values (Griffin et al., 2019).
In our
comprehensive evaluation on ImageNet, AUROC ranged from 0.77 to 0.88 (with the median value
being 0.85), and in CIFAR-10 these measurements jump to the range of 0.92 to 0.94.
While such comparisons between neural networks and humans are somewhat unfair due to the
great sensitivity required for the task, research that directly compares humans and machine learning
algorithms performing the same task exist. For example, in Ackerman et al. (2019), algorithms far
surpass even the group of highest performing individuals in terms of ranking.
F Criticisms of AUROC as a ranking metric
(i), ˆyf (xc
(i), ˆyf m(xc
In this section, addressing the criticism of AUROC as a ranking metric, we show why AUROC does
not simply reward models for having lower accuracy, . The paper by Ding et al. (2019) presented
a semi-artificial experiment to demonstrate that AUROC might get larger the worse the model's
accuracy becomes. They consider a model f and its κ function evaluated on a classification test
set X , giving each a prediction ˆyf (x) and a confidence score κ(x, ˆyf (x)|f ), which in this case is
the model's softmax response. Let X c = {xc ∈ X |ˆyf (xc) = y(x)} be the set of all instances
correctly predicted by the model f , and define xc
(i) ∈ X c to be the correct instance that received
the i-lowest confidence score from κ. Their example continues and considers an artificial model
f m to be an exact clone of f with the following modification: for every i ≤ m, the model f m now
predicts a different, incorrect label for xc
(i); however, its given confidence score remains identical:
κ(xc
(i))|f m). f 0 is exactly identical to f , by this definition, not
(i))|f ) = κ(xc
changing any predictions. The paper shows how an artificially created model f m obtains a higher
AUROC score the bigger its m. This happens even though "nothing" changed but a hit to the model's
accuracy performance (by making mistakes on more instances).
First, to understand why this happens, let us consider f 1: AUROC for κ increases the more pairs
of [κ(x1) < κ(x2)|ˆyf (x1) (cid:54)= y(x1), ˆyf (x2) = y(x2)] there are. The model f 1 is now giving
an incorrect classification to xc
(1), but this instance's position in the partial order induced by κ has
(1)) is unchanged); therefore, |X c|−1 correctly ranked pairs were added:
remained the same (since κ(xc
[κ(xc
(i))] for every 1 < i ≤ |X c|. Nevertheless,
(i)) = y(xc
this does not guarantee an increase to AUROC by itself: if, previously, all pairs of (correct,incorrect)
instances were ranked correctly by κ, AUROC would already be 1.0 for f 0 and would not change
for f 1. If AUROC for f 1 is higher than it was for f 0, this means there exists at least one instance
(1)) < κ(xw). Every such
xw that was incorrectly predicted by the original model f 0 such that κ(xc
(1)) < κ(xw)|ˆyf (xw) (cid:54)= y(xw), ˆyf (xc
originally wrongly ranked pair (by f 0) of [κ(xc
(1))]
has been eliminated by f 1 wrongly predicting xc
(1). This, therefore, causes AUROC to increase at the
expense of the model's accuracy.
(1)) < κ(xc
(1)) (cid:54)= y(xc
(1)) = y(xc
(1)), ˆyf (xc
(i))|ˆyf (xc
Such an analysis neglects many factors, which is probably why such an effect is only likely to be
observed in artificial models (and not among the actual models we have empirically tested):
1. It is unreasonable to assume that the confidence score given by κ will remain exactly the
same for an instance xc
(i) given it now has a different prediction. In the case of κ being
softmax, it assumes the model's logits have changed in a very precise and nontrivial manner.
Additionally, by our broad definition of κ, which allows κ to even be produced from an
entirely different model than f , κ receives the prediction and model as a given input (and
cannot change or affect either), and it is unlikely to assume changing its inputs will not
change its output.
2. Suppose we find the setting reasonable and assume we can actually create a model f m as
described. Let us observe a model f p such that p = minm(AUROC of f m=1), meaning
20
that f p ranks its predictions perfectly, unlike the original f 0. Is it really true that f p has no
better uncertainty estimation than f 0? Model f p behaves very much like the investment in
"Model B" from our example in Section 1, possessing perfect knowledge of when it is wrong
and when it is correct, allowing its users risk-free classification. So, given a model f , we can
use the above process to produce an improved model f p, and then we can even calibrate its
κ to output 0% for all instances below its threshold and 100% for all those above to produce
a perfect model, which might have a small coverage but is correct every time, knows it and
notifies its user when it truly knows the prediction. The increase in AUROC reflects such an
improvement.
Not only do we disagree with such an analysis and its conclusions, but we also have vast empirical
evidence to show that AUROC does not prefer lower accuracy models unless there is a good reason
for it to do so, as we demonstrate in Figure 3 (comparing EfficientNet-V2-XL to ViT-B/32-SAM). In
fact, out of the 523 models we tested, the model with the highest AUROC also has the 4th highest
accuracy of all models, and the overall Spearman correlation between AUROC and accuracy of all the
models we tested is 0.03. Furthermore, Figure 3 also exemplifies why AURC, which was suggested
by the just mentioned paper as the alternative to AUROC, is a bad choice as a single number metric,
and might lead us to deploy a model that has a worse selective risk for most coverages only due to its
higher overall accuracy.
G Knowledge distillation effects on uncertainty estimation
Figure 12: Comparing vanilla models to those incorporating KD into their training (represented by
markers with thick borders and a dot). In a pruning scenario that includes distillation, yellow markers
indicate that the original model was also the teacher. The performance of each model is measured in
AUROC (higher is better) and -log(ECE) (higher is better).
Figure 12 compares vanilla models to those incorporating KD into their training (represented by
markers with thick borders and a dot). In a pruning scenario that includes distillation, yellow markers
indicate that the original model was also the teacher (Aflalo et al., 2020). While distillation using a
different model tends to improve uncertainty estimation in both aspects, distillation by the model
itself seems to improve only one-suggesting it is generally more beneficial to use a different model
as a teacher. The fact that KD improves the model over its original form, however, is surprising, and
implies that the distillation process itself helps uncertainty estimation. Note that although this specific
method involves pruning, evaluations of models pruned without incorporating distillation (Frankle &
Carbin, 2018) revealed no improvement.
It seems, moreover, that the teacher does not have to be good in uncertainty estimation itself; Figure 5
in Section 3 shows this by comparing the teacher architecture and the students in each case.
21
34678384858687885AUROCBiTBiT distilledDeiTDeiT distilled ECANetECANet distilled EfficientNet EfficientNet distilled MLP MixerMLP Mixer distilled MobileNetV3 MobileNetV3 distilled PiTPiT distilled ResMLPResMLP distilled TResNetTResNet distilled XCiTXCiT distilledModels-log(ECE)While the training method by Ridnik et al. (2021) included pretraining on ImageNet-21k and
demonstrated impressive improvements, comparison of models that were pretrained on ImageNet21k
(Tan & Le, 2021; Touvron et al., 2021a, 2022) with identical models that were not pretrained
showed only a slight improvement in ECE, and, in fact, exhibit a degradation of AUROC (see
Figures 4a and 4b in Section 3). This suggests that pretraining alone does not improve uncertainty
estimation.
H More information about Temperature Scaling
Figure 13: A comparison of 523 models after being calibrated with TS, evaluated by their AUROC
(×100, higher is better) and -log(ECE) (higher is better) on ImageNet. Each marker's size is
determined by the model's number of parameters. ViT models are still among the best performing
architectures for all aspects of uncertainty estimation.
In Figure 13 we see how temperature scaling (TS) affects the overall ranking of models in terms
of AUROC and ECE. While the ranking between the different architecture remains similar, the
poorly performing models are much improved and minimize the gap between them and the best
models. One particularly notable exception is HardCoRe-NAS (Nayman et al., 2021), with its lowest
latency versions becoming the top performers in terms of ECE. In addition, models that benefit from
TS in terms of AUROC tend to have been assigned a temperature lower than 1 by the calibration
process (see Figure 6 in Section 3). The same, however, does not hold true for ECE (see Figure 14).
This example also emphasizes the fact that models benefiting from TS in terms of AUROC do not
necessarily benefit in terms of ECE, and vice versa. Therefore, determining whether to calibrate the
deployed model with TS is, unfortunately, a task-specific decision.
We perform TS as was suggested in Guo et al. (2017). For each model we take a random stratified
sampling of 5,000 instances from the ImageNet validation set on which to calibrate, and reserve
the remainder 45,000 instances for testing. Using the box-constrained L-BFGS (Limited-Memory
Broyden-Fletcher-Goldfarb-Shanno) algorithm, we optimize for 5,000 iterations (though fewer
iterations usually converge into the same temperature parameter) using a learning rate of 0.01.
I Architecture choice for practical deployment based on Selective
Performance
As discussed in Section 2, when we know the coverage or risk we require for deployment, the most
direct metric to check is which model obtains the best risk for the coverage required (selective risk),
or which model gets the largest coverage for the accuracy constraint (SAC). While each deployment
scenario specifies its own constraints, for demonstration purposes we consider a scenario in which
22
44.555.566.578082848688ModelsResMLPResMLP distilled ResNetViTViT*ViT* distilledXCiTXCiT distilledVariousAlexNetBiTBiT distilled EfficientNetV2 HardCoReNASMLP MixerMLP Mixer distilled RegNetY-log(ECE) with Temperature ScalingAUROC with Temperature ScalingFigure 14: Here the relationship between temperature and the success of TS, unlike the case for
AUROC, seems unrelated.
misclassifications are by far more costly than abstaining from giving correct predictions. An example
of this could be classifying a huge unlabeled dataset (or cleaning bad labels from a labeled dataset).
While it is desirable to assign labels to a larger portion of the dataset (or to correct more of the wrong
labels), it is crucial that these labels are as accurate as possible (or that correctly labeled instances are
not replaced with a bad label).
Figure 15: A comparison of 523 models by their log(number of model's parameters) and the coverage
they are able to provide for a SAC of 99% (higher is better) on ImageNet.
To explore such a scenario, we evaluate all models on ImageNet to see which ones give us the largest
coverage for a required accuracy of 99%. In Figure 7, Section 3 (paper's main body) we observe
that of all the models studied, only ViT models are able to provide coverage beyond 30% for such
an extreme constraint. Moreover, we note that the coverage they provide is significantly larger than
that given by models with comparable accuracy or size, and that ViT models that provide similar
coverage to their counterparts do so with less overall accuracy.
In Figure 15 we see that not only do ViT models provide more coverage than any other model, but that
they are also able to do so in any size category. To compare models fairly by their size, we present
23
Temperature Scaling (Temp. < 1)Temperature Scaling (Temp. > 1)00.050.10.150.20.250.30.350.4ECE Improvement over VanillaMethodTemperature Scaling (Temp. < 1) Temperature Scaling (Temp. > 1)0102030405066.577.588.59ModelsVariousAlexNetBiTDLARegNetXRegNetYResNetSWSL ResNeXtViTViT*ModelsVarious AlexNet BiT DLARegNetXRegNetY ResNet SWSL ResNeXt ViT ViT*Coverage for Accuracy 99log(#Parameters)Table 1: A comparison of different training regimes of ViTs. *The paper introducing ViTs (Dosovit-
skiy et al., 2021) had also trained ViT models with the JFT-300M dataset; however, their weights are
unavailable to the general public. All evaluations of ViTs from that paper were conducted on ViTs
pretrained on ImageNet-21k, which are publicly available. **Pretrained DeiT3 models were first
pretrained with a learning rate of 3 * 10−3 and then fine-tuned with a learning rate of 3 * 10−4
Regime
Reference
Pretraining dataset
Batch Size
Optimizer
LR
LR decay
Weight decay
Warmup epochs
Label smoothing (cid:15)
Dropout
Stoch. Depth
Repeated Aug
Gradient Clip.
H. flip
Random Resized Crop
Rand Augment
3 Augment
LayerScale
Mixup alpha
Cutmix alpha
Erasing prob.
ColorJitter
Test crop ratio
Loss
Superb performance
ViT (original)
Steiner et al.
Chen et al.
DeiT
DeiT3
DeiT3
+Pretraining
Torchvision
Dosovitskiy et al. (2021)
Steiner et al. (2022) Chen et al. (2022) Touvron et al. (2021b)
Touvron et al. (2022)
Paszke et al. (2019)
ImageNet-21k*
4096
AdamW
3 * 10−3
cosine
0.1
3.4
0.1
(cid:51)
(cid:55)
(cid:55)
1.0
(cid:51)
(cid:51)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
0.875
CE
(cid:51)
ImageNet-21k
4096
AdamW
3 * 10−3
cosine
0.3
3.4
0.1
(cid:51)
(cid:51)
(cid:55)
1.0
(cid:51)
(cid:51)
Adapt.
(cid:55)
(cid:55)
Adapt.
(cid:55)
(cid:55)
(cid:55)
0.875
CE
(cid:51)
-
4096
SAM
3 * 10−3
cosine
0.1
3.4
0.1
(cid:51)
(cid:55)
(cid:55)
1.0
(cid:51)
(cid:51)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
(cid:55)
0.875
CE
(cid:51)
-
1024
LAMB
1 * 10−3
cosine
0.05
5
0.1
(cid:55)
(cid:51)
(cid:51)
(cid:55)
(cid:51)
(cid:51)
9/0.5
(cid:55)
(cid:55)
0.8
1.0
0.25
(cid:55)
0.875
CE
(cid:55)
-
2048
LAMB
3 * 10−3
cosine
0.02
5
(cid:55)
(cid:55)
(cid:51)
(cid:51)
1.0
(cid:51)
(cid:51)
(cid:55)
(cid:51)
(cid:51)
0.8
1.0
(cid:55)
0.3
1.0
BCE
(cid:55)
ImageNet-21k
2048
LAMB
3 * 10−3**
cosine
0.02
5
0.1
(cid:55)
(cid:51)
(cid:55)
1.0
(cid:51)
(cid:55)
(cid:55)
(cid:51)
(cid:51)
(cid:55)
1.0
(cid:55)
0.3
1.0
CE
(cid:55)
-
512
AdamW
3 * 10−3
cosine
0.3
30
0.11
(cid:55)
(cid:55)
(cid:51)
1.0
(cid:51)
(cid:51)
Adapt.
(cid:55)
(cid:55)
0.2
1.0
(cid:55)
(cid:55)
0.875
CE
(cid:55)
Figure 15, which sets the Y axis to be the logarithm of the number of parameters, so that models
sharing the same y value can be compared solely based on their x value-which is the coverage they
provide for a SAC of 99%. We see that ViT models provide a larger coverage even when compared
with models of a similar size.
J Comparison of ViT training regimes and their effects on uncertainty
estimation performance
In Table 1 we compare the different hyperparameters and augmentations used for training the ViT
models evaluated in this paper, with the aim of revealing why some training regimes consistently
result in superb ViTs, while others do not. An analysis of the various differences between these
regimes, however, eliminates the obvious suspects.
1) Pretraining, on its own, does not seem to offer an explanation: First, we analyze eight pairs of
models (provided by Touvron et al. 2022) such that both models have identical architecture and
training regimes, with the exception that one was pretrained on ImageNet-21k, and the other was not.
Pretraining results in only a slight improvement of 0.16 in AUROC and 0.01 in ECE. Moreover, as
mentioned in detail in Section 3, ViT models trained on JFT-4B (Tran et al., 2022) were outperformed
by the successful ViT models evaluated in this paper, most of which were pretrained on ImageNet-21k
(and even by one ViT SAM model that was not pretrained at all). Second, we note that ViTs trained
with the SAM optimizer (Chen et al., 2022), and not pretrained at all, reach superb ranking (AUROC)
as well. These facts lead us to conclude that pretraining, at least by itself, is not the main contributor
to training successful ViTs.
2) The selection of optimizers and other hyperparameters (such as learning rate, label smoothing etc.)
does not seem to have a significant impact. For example, while AdamW (Loshchilov & Hutter, 2019)
was used by two of the successful regimes, it was also used by Paszke et al. (2019), and on the other
hand was replaced by SAM (Foret et al., 2021) in another successful training regime.
3) Advanced augmentations are unlikely to explain the gaps in uncertainty estimation performance,
as regimes producing superior ViT models (Dosovitskiy et al., 2021; Chen et al., 2022) did not use
advanced augmentations (in comparison to Touvron et al. (2021b) and Touvron et al. (2022), for
example).
For these reasons, for the moment, the explanation for the gap remains elusive. The only remaining
"suspect" is the batch size used, with all successful regimes using a batch size of 4096, while others
24
Table 2: The relationship between uncertainty estimation performance and the model's attributes
and resources (accuracy, number of parameters and input size), measured by Spearman correlation.
Positive correlations indicate good utilization of resources for uncertainty estimation.
Architecture
AUROC & Accuracy
-ECE & Accuracy AUROC & #Parameters
-ECE & #Parameters AUROC & Input Size
-ECE & Input Size
# Models Evaluated
EfficientNet
ResNet
ViT
XCiT distilled
XCiT
ViT*
SE ResNet
EfficientNetV2
NFNet
Inception
RegNetY
RegNetX
CaiT distilled
DLA
MobileNetV3
Res2Net
CLIP Zero-Shot
CLIP + Linear Probe
VGG
RepVGG
BiT
ResNeXt
ResNet RS
MixConv
DenseNet
HardCoReNAS
Swin
ECANet
Twins
SWSL ResNet
GENet
SSL ResNet
TResNet
CoaT
LeViT distilled
ResMLP
MobileNetV2
ViT* Distilled
PiT distilled
PiT
WSP ResNeXt
ResMLP distilled
MnasNet
-0.16
-0.28
0.84
0.60
-0.68
0.23
-0.46
-0.70
0.56
-0.29
-0.03
0.20
0.44
0.64
0.37
-0.70
1.0
0.88
0.81
-0.71
-0.33
-0.96
0.00
-0.11
0.43
-0.60
0.71
-0.20
-0.26
0.94
0.50
0.14
0.10
-0.10
0.60
0.20
-0.30
0.8
1.00
-0.40
1.00
0.80
0.40
-0.29
-0.22
-0.17
0.09
0.89
0.38
-0.02
-0.45
0.78
0.09
-0.98
-0.96
-0.87
-0.90
0.59
0.27
-0.63
0.26
-0.98
0.50
-0.81
0.39
0.79
0.89
-0.14
0.26
0.14
0.60
0.94
-0.89
-1.00
-1.00
-0.30
0.90
-0.90
1.00
0.00
-1.0
-1.00
1.00
0.80
0.20
0.20
-0.22
0.16
0.50
0.35
-0.79
-0.04
-0.53
-0.63
0.63
-0.43
0.27
0.20
0.35
0.77
0.42
-0.68
0.9
0.71
0.71
-0.57
-0.20
-0.22
-0.18
-0.24
0.72
-0.49
0.77
-0.43
-0.14
0.77
0.50
0.26
0.53
-0.10
0.60
0.15
-0.21
0.71
1.00
-0.40
1.00
0.80
0.63
-0.29
0.03
-0.67
0.02
0.94
0.41
0.20
-0.47
0.81
0.30
-0.86
-0.96
-0.87
-0.90
0.60
0.60
-0.8
0.1
-0.90
0.21
-0.85
-0.30
0.82
0.86
0.12
0.37
0.26
0.37
0.89
-0.83
-1.00
-0.94
0.53
0.50
-0.90
0.97
0.10
-0.77
-1.00
1.00
0.80
0.20
0.95
-0.26
-0.40
0.04
0.51
-
0.14
-0.02
-0.59
0.48
-0.08
-
-
0.58
-
-
-
0.55
0.19
-
-
-0.46
-
-0.30
-
-
-
0.41
0.83
-
-
0.87
-
-0.58
-
-
-
-
0.22
-
-
-
-
-
-0.38
-0.44
-0.13
0.12
-
-0.12
-0.35
-0.40
0.60
0.23
-
-
-0.50
-
-
-
-0.58
-0.27
-
-
-0.25
-
0.82
-
-
-
0.00
0.37
-
-
-0.87
-
-0.87
-
-
-
-
-0.77
-
-
-
-
-
50
33
31
28
28
26
18
15
13
13
12
12
10
10
10
9
9
8
8
8
8
7
7
7
6
6
6
6
6
6
6
6
5
5
5
5
5
4
4
4
4
4
4
use a smaller batch size of 2048 or lower. One could argue, however, that a two-fold increase in batch
size is not sufficient to explain the huge gaps in performance measured.
K Evaluations of the zero-shot language–vision CLIP model
In this section we describe how we use CLIP model and extract confidence signals from it during
inference. To evaluate CLIP on ImageNet, we first prepare it following the code provided by its
authors (https://github.com/openai/CLIP): The labels of ImageNet-1k are encoded into normalized
embedding vectors. At inference time, the incoming image is encoded into another normalized
embedding vector. A cosine similarity is then calculated between each label embedding vector
and the image embedding vector, and lastly, softmax is applied. The highest score is then taken as
the confidence score for that prediction. We also evaluate the same models when adding a trained
"linear-probe" to them (as described in Radford et al. (2021), which is essentially a logistic regression
head), that results in a large boost in their accuracy.
L Effects of the model's accuracy, number of parameters and input size on
uncertainty estimation performance
Table 2 shows the relationship between uncertainty estimation performance and model attributes
and resources (accuracy, number of parameters and input size), measured by Spearman correlation.
We measure uncertainty estimation performance by AUROC (higher is better) and -ECE (higher
is better). Positive correlations indicate good utilization of resources for uncertainty estimation
(for example, a positive correlation between -ECE and the number of parameters indicates that as
the number of parameters increases, the calibration improves). An interesting observation is that
distillation can drastically change the correlation between a resource and the uncertainty estimation
performance metrics. For example, undistilled XCiTs have a Spearman correlation of -0.79 between
their number of parameters and AUROC, indicating that more parameters are correlated with lower
ranking performance, while distilled XCiTs have a correlation of 0.35 between the two.
25
Table 3: Comparing using MC dropout to softmax-response (vanilla).
Method
Accuracy AUROC
Architecture
MobileNetV3 Large
MobileNetV3 Small
MobileNetV2
VGG11
VGG11 (no BatchNorm)
VGG13
VGG13 (no BatchNorm)
VGG16
VGG16 (no BatchNorm)
VGG19
VGG19 (no BatchNorm)
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
Vanilla
MC dropout
74.04
74
67.67
67.55
71.88
71.81
70.37
70.21
69.02
68.95
71.59
71.43
69.93
69.71
73.36
73.33
71.59
71.47
74.22
74.17
72.38
72.37
86.88
86.14
86.2
84.54
86.05
84.68
86.31
84.3
86.19
83.94
86.3
84.37
86.24
84.3
86.76
85.02
86.63
84.97
86.52
85.06
86.55
84.99
M Evaluations of Monte Carlo Dropout ranking performance
MC Dropout (Gal & Ghahramani, 2016) is computed using several dropout-enabled forward passes to
produce uncertainty estimates. In classification, the mean softmax score of these passes, is calculated,
and then a predictive entropy score is used as the final uncertainty estimate. In our evaluations, we use
30 dropout-enabled forward passes. We do not measure MC Dropout's effect on ECE since entropy
scores do not reside in [0, 1].
We test this technique using MobileNetV3 (Howard et al., 2019), MobileNetv2 (Sandler et al., 2018)
and VGG (Simonyan & Zisserman, 2015), all trained on ImageNet and taken from the PyTorch
repository (Paszke et al., 2019).
The results comparing these models with and without using MC dropout are provided in Table 3.
The table shows that using MC dropout causes a consistent drop in both AUROC and selective
performance compared with using the same models with softmax as the κ. These results are also
visualized in comparison to other methods in Figure 4a in Section 3. MC dropout underperformance
in an ID setting was also previously observed in Geifman & El-Yaniv (2017).
26
|
|
http://arxiv.org/abs/2302.11870v1 | 2023-02-23T09:16:54 | 2023-02-23T09:16:54 | Adaptive Sampling for Probabilistic Forecasting under Distribution Shift | The world is not static: This causes real-world time series to change over
time through external, and potentially disruptive, events such as macroeconomic
cycles or the COVID-19 pandemic. We present an adaptive sampling strategy that
selects the part of the time series history that is relevant for forecasting.
We achieve this by learning a discrete distribution over relevant time steps by
Bayesian optimization. We instantiate this idea with a two-step method that is
pre-trained with uniform sampling and then training a lightweight adaptive
architecture with adaptive sampling. We show with synthetic and real-world
experiments that this method adapts to distribution shift and significantly
reduces the forecasting error of the base model for three out of five datasets. | [
"Luca Masserano",
"Syama Sundar Rangapuram",
"Shubham Kapoor",
"Rajbir Singh Nirwan",
"Youngsuk Park",
"Michael Bohlke-Schneider"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11870v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11870v1",
"@rel": "related",
"@type": "application/pdf"
}
] | [
"Workshop on Distribution Shifts, 36th Conference on Neural\n Information Processing Systems (NeurIPS 2022)"
] | {
"@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
3
2
]
G
L
.
s
c
[
1
v
0
7
8
1
1
.
2
0
3
2
:
v
i
X
r
a
Adaptive Sampling for Probabilistic Forecasting
under Distribution Shift
Luca Masserano∗
Department of Statistics
Carnegie Mellon University
[email protected]
Syama Sundar Rangapuram†
AWS AI Labs
[email protected]
Shubham Kapoor
AWS AI Labs
[email protected]
Rajbir Singh Nirwan∗
D2S Inc.
[email protected]
Youngsuk Park
AWS AI Labs
[email protected]
Michael Bohlke-Schneider
AWS AI Labs
[email protected]
Abstract
The world is not static: This causes real-world time series to change over time
through external, and potentially disruptive, events such as macroeconomic cycles
or the COVID-19 pandemic. We present an adaptive sampling strategy that selects
the part of the time series history that is relevant for forecasting. We achieve this by
learning a discrete distribution over relevant time steps by Bayesian optimization.
We instantiate this idea with a two-step method that is pre-trained with uniform
sampling and then training a lightweight adaptive architecture with adaptive sam-
pling. We show with synthetic and real-world experiments that this method adapts
to distribution shift and significantly reduces the forecasting error of the base model
for three out of five datasets.
1
Introduction
Time series forecasting uses historical data to forecast the evolution of a time series to assist decision
making in several domains, for example retail [24, 5, 32], electric load planning [30, 13], cloud
computing management [25, 26], or labor planning [3]. Most time series forecasting algorithms make
the assumption that the data distribution does not change over time. However, this is violated in
practice where real-world time series data is affected by drifts such as evolving customer demand or
disruptive events (like the COVID-19 pandemic). These distribution shifts will inevitably be part of
the time series history and therefore forecasting algorithms need to be able to account for them.
Distribution shifts can occur with different (possibly reoccurring) patterns, but likely result in higher
test error because the train and test distribution differs. Thus, only a subset of the time series history
might come from the same distribution as the test set. Driven by this observation, we propose an
adaptive sampling mechanism that explicitly feeds the model with inputs from the history that are
only relevant for forecasting in the current (most recent) distribution. Instead of sampling uniformly
over the history, our method learns a discrete distribution over past time steps and explicitly allows
continuous adaptation, so that the model can react and adapt to distribution shifts.
Our contribution is an adaptive sampling mechanism that learns the sampling distribution over
time steps via gradient-free Bayesian optimization. We propose a two-step framework where the
forecasting model is pre-trained with uniform sampling and then a lightweight architecture is trained
with adaptive sampling. We evaluate the properties and performance of this approach with experiments
Workshop on Distribution Shifts, 36th Conference on Neural Information Processing Systems (NeurIPS 2022).
∗Work done while at AWS AI Labs
†Correspondence to: [email protected]
Figure 1: Data distribution shift that our model can address. Each frame shows an indicator function plotted
over time with respect to an assumed "standard" distribution (a value of 1 indicates a distribution shift). The
red dashed line separates the past (i.e., the training set) from the future (i.e. test set). a) New or reoccurring
shift: the distribution over time steps should focus on the shifted regions. b) This case is complementary to the
previous one: here the distribution over time steps should exclude the shifted regions. c) The shift occurs in the
forecasting window but not in the most recent region before the forecast start date: our model needs to wait until
part of the shift is in the training set in order to be able to adapt to it.
on synthetic and real-world data. This paper is organized as follows: Section 2 introduces the reader
to the background of this paper and the types of data distribution shifts for forecasting that we address.
and Section 3 introduces our method and we present experiments in Section 4. Section 5 concludes
the paper. Note that the discussion of the related work can be found in Section A.1 in the Appendix.
2 Background
Notation We denote the value of time series i at time t by zi,t, where zi,t ∈ R, and corresponding
time-varying covariates as xi,t ∈ Rd. The past of each time series (i.e., training set) is denoted
as zi,1:T := (zi,1, . . . , zi,T ), and the future (i.e., forecasting window or test set) as zi,T +1:T +τ :=
(zi,T +1, . . . , zi,T +τ ). The number of time series in the dataset is denoted by N .
Our main assumption in this work is that we are able to observe at least some of the forthcoming
shift in order to be able to react and adapt to it:
Assumption 1 Let c be a constant number of (past) time steps set a priori. We assume that there is
no (marginal) distribution shift between the most recent training window of c steps and the forecasting
(test) window. More precisely, let zi,t be the given time series at time t and let ̄zi,t be the time series
at time t obtained after removing trend, seasonalities and other effects of available features, then
p( ̄zi,T −c) = * * * = p( ̄zi,T ) = p( ̄zi,T +1) = * * * = p( ̄zi,T +τ ),
∀i = 1, . . . , N.
(1)
This assumption implies that the data with t ∈ [T − c, T ] is the closest in time to the forecasting
window, therefore it is reasonable to regard it as the most similar to the future. In practice, we take
c to be equal to the sum of context and prediction lengths, so that we can use {zi,T −c:T }N
i=1 as a
validation set to learn and adapt to any distribution shift. In general, we consider the following two
scenarios illustrated in Figure 1): (a) A new or reoccurring shift in the past and no shift between
the recent training and test window; and (b) a shift that occurred in the past but reverted back to the
"standard" regime. Note that we do not address the case where the distribution shift occurs in the test
window only, which would be more of a fundamental generalization problem (case (c) in Figure 1).
See Section A.2 in the Appendix for a detailed definition of the cases that we consider.
3 Our Method
Training of deep learning models in time series settings is usually done by sampling fixed-size
windows uniformly at random over the available time series history (i.e., the past). Since distribution
shifts happen with different (possibly reoccurring) patterns over time, uniform sampling over the
training set would likely feed the algorithm with irrelevant or even misleading data to forecast in the
current distribution regime. Therefore we propose to adaptively generate these training windows
depending on the regime of the validation set (and by Assumption 1, the test set). The key element of
our approach is automatically learning which regions to focus on to accurately forecast the test set.
2
Figure 2: Schematic descrip-
the two-step proce-
tion of
dure. i) Pre-train the full model
with uniform sampling; ii.a) use
Bayesian optimization to find
the optimal φ(cid:63); ii.b) use φ(cid:63) to
train the lightweight architecture
with adaptive sampling.
To achieve this, we introduce a discrete distribution pφ(*) over time steps 1, . . . , T that determines
the probability of sampling a training window starting at a time point t. In practice, pφ(*) can be any
discrete distribution that is well defined over integers, such as Geometric, Negative Binomial, Poisson,
or mixtures of these distributions, parameterized by φ. This distribution is responsible for sampling
time windows that are used to train our forecasting model (see Figure A.1 in the Appendix for an
illustration). We learn φ by minimizing validation loss of the model that is trained using examples
generated according to pφ(*). Ideally, the learned distribution parameters φ(cid:63) will avoid sampling
distribution shifts in history that do not correspond to the current regime. This distribution replaces
uniform sampling over the history, which cannot distinguish between distribution shifts and normal
regions. However, our model should fall back to uniform sampling if this results in lowest validation
error. This suggests that no distribution shift is present in the validation window and consequently in
the forecast window (by Assumption 1).
Adaptive training of a lightweight architecture
In practice, we would expect to frequently re-
estimate φ(cid:63) to adapt to the current distribution. To address this, we propose a two-step procedure
with a lightweight adaptive architecture that is fast to train and can be frequently re-trained. In this
sense, this approach is explicitly considering a notion of time-varying parameters. i) The model is
pre-trained using uniform sampling over the whole training history. Intuitively, this step aims at
learning common features that are useful everywhere in time. ii) After freezing the weights of the
pre-trained model, an adaptive lightweight architecture is attached and trained using the adaptive
sampling mechanism, where the training windows are generated according to pφ∗ (*). The goal of
this step is to learn time-specific features that are relevant to forecast in the current distribution. The
lightweight architecture can be a short sequence of fully connected layers, or it can even be a subset
of the pre-trained model.
Learn φ via Bayesian Optimization We now describe how we estimate the parameters φ of the
distribution pφ(*). Let us denote the parameters of the pre-trained model as wpre and those of the
lightweight architecture as wada. Moreover, let fw({zi,1:T }) denote the forecasts {ˆzi,T +1:T +τ } of the
model whose weights are given by w. Given input time series {zi,t}, i = 1, . . . , N and t = 1, . . . , T ,
we set aside the last τ observations {zi,T −τ +1:T }, ∀i, for estimating φ. We learn φ by minimizing
loss on this validation channel of the model trained according to pφ(*). More precisely, we have
φ∗ = argmin
(cid:96)(φ),
φ
where (cid:96)(φ) is the validation loss of the model that is trained using adaptive sampling pφ(*),
(cid:96)(φ) = loss
(cid:16)
fwpre∪w∗
ada(φ)
(cid:17)
(cid:0){zi,1:T −τ }(cid:1), {zi,T −τ +1:T }
.
Here w∗
ada(φ) are the weights obtained after fine-tuning the pre-trained model on the input data
{zi,1:T −τ } where the training examples are generated according to the distribution pφ(*); note the
dependence of w∗
ada on φ. A crucial observation is that one can only evaluate (cid:96)(φ) and cannot obtain
its gradients with respect to φ; hence we cannot train (wada, φ) jointly end-to-end. We propose to treat
φ as hyper-parameters and use Bayesian optimization [9] to find φ∗. Assumption 1 plays a key role in
this step because the most recent region in the training set is used as validation channel to choose φ(cid:63)
during Bayesian optimization. The overall approach is depicted in Figure 2 and the implementation
details with DeepAR [28] as the base model are given in Algorithm 1. In our experiments we assume
wada ⊂ wpre and hence the algorithm is presented for this case.
3
Figure 3: Experiments with
synthetic data. a) Synthetic
data with injected shift (top)
and noise (bottom). b1) (top
case in a): Adaptive sampling
focuses on the shifted region
in the past (red and green
bars denote the shifted region)
that is relevant for the current
regime. b2 (bottom case in a):
Adaptive sampling avoids the
injected noise shifts.
Algorithm 1 Adaptive DeepAR
1: procedure Ada-DeepAR({zi,t}, i ∈ [1 .. N ], t ∈ [1 .. T ])
2:
3:
Ztrain = {zi,t}, ∀i, ∀t
wpre ← DeepAR(Ztrain)
(cid:46) Standard training with uniform train sampler
(cid:46) Random initialization
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Zada_train = {zi,t}, ∀i, t ∈ [1 .. T − τ ]
Zvalidation_labels = {zi,t}, ∀i, t ∈ [T − τ + 1 .. T ]
φ = φ0
w = wpre
Split w into wada and wfrozen
while CONVERGENCE do
(cid:46) Solve minφ (cid:96)(φ)
wada ← DeepAR(Zada_train, init = w, sampler = pφ(*), fixed = wfrozen) (cid:46) Train with adaptive train
sampler by fixing weights wfrozen
w = wada ∪ wfrozen
ˆZvalidation_preds = forecast(Zada_train, model = w)
(cid:96)(φ) = loss( ˆZvalidation_preds, Zvalidation_labels)
update φ based on the new evaluation (cid:96)(φ)
end while
(cid:46) Bayesian Optimization
(cid:46) pφ(*) likely has more mass on indices t that help predict Zvalidation_labels accurately
(cid:46) Model is ready to predict {zi,t}, ∀i, t ∈ [T + 1 .. T + τ ]
return w
16:
17: end procedure
4 Experiments
The instantiation of our model in this manuscript is called Ada-DeepAR and uses DeepAR [28] as a
base model with a two-layer LSTM (other base models could be used). The adaptive part of our model
is the second LSTM layer. Additionally, we perform Bayesian optimization using MOBSTER, which
combines asynchronous successive halving and asynchronous Hyperband with gaussian-process
based Bayesian optimization [17]. We use the implementation available in Syne Tune [29]. For
any time series i with training history T and forecast horizon τ , we use zi,T −τ :T as a validation
channel for Bayesian optimization. We consider a geometric and a mixture of two negative binomial
distributions as our sampling distributions pφ(*). Training details are given in Section A.4.
Experiments on synthetic data: To demonstrate the applicability of our method, we first evaluate
it on two synthetic experiments that mimic cases (a) and (b) of Figure 1. We generated an artificial
sinusoidal dataset and then injected shifts or noise in different regions. Focus on shifted regions
distant in time: In this example we injected a shift in a distant portion of the training dataset and
also in the validation and test sets (see the top of panel a) in Figure 3). We show that the sampling
distribution over time steps can focus on specific regions that are relevant to the current domain,
regardless of when they occurred in the available history (see b1) in Figure 3). Exclude noisy
regions: In this example, we injected noise (a negative constant) in two different regions of the
training dataset. Our adaptive sampling mechanism avoids these noisy regions from the history (b2)
in Figure 3). Interestingly, this sometimes corresponds to sampling only in the most recent window,
while in other cases the distribution exploits its bimodality to focus on two distant windows.
4
Ada-DeepAR-uniform
(ablation)
RevIn
DeepAR
TFT
Dataset
Covid-deaths
Electricity
Traffic
Solar
Taxi
Ada-DeepAR
(ours)
0.074∗±0.013
0.048∗†±0.002
0.172±0.002
0.370∗†±0.003
0.286†±0.003
0.088±0.011
0.054†±0.005
0.171±0.004
0.376†±0.003
0.278∗†±0.001
Mean nCRPS
Mean Rank
0.190
1.8
0.193
1.8
0.13±0.006
0.063±0.005
0.172±0.003
0.376±0.004
0.288±0.004
0.103±0.053
0.062±0.011
0.176±0.004
0.388±0.007
0.279±0.004
0.053±0.061
0.082±0.000
0.306±0.050
0.562±0.015
0.509±0.001
0.202
3.4
0.206
3.4
0.302
4.2
Table 1: The nCRPS loss (lower is better) for all datasets and models. We average over ten runs and report
the mean and standard deviation. We took the results for TFT from TSBench [4], which only uses two
runs. Boldface numbers indicate that the differences in error between the best and the second-best method
are statistically significant (paired t-test p-value < 0.05). * indicates a statistically significant result when
comparing Ada-DeepAR and Ada-DeepAR-uniform. † indicates a statistically significant result when comparing
Ada-DeepAR or Ada-DeepAR-uniform to its base model DeepAR.
Experiments on real-world datasets: Finally, we show preliminary results on five real-world
datasets (see Section A.3 for details). We compare the following models: our two-step training
procedure with adaptive sampling (Ada-DeepAR), reversible instance normalization (RevIn) [16],
and the attention-based Temporal Fusion Transformer TFT [20]. We also consider an ablation variant
of our method, Ada-DeepAR-uniform, which uses the same architecture and two-step procedure as
Ada-DeepAR, but performs adaptive training (i.e., fine-tuning of the adaptive weights wada) using
uniform sampling instead of pφ(*). This variant is included to highlight the effectiveness of learning
the sampling distribution pφ by isolating the gains obtained by our model due to the fine-tuning
step. For Ada-DeepAR, Ada-DeepAR-uniform and RevIn we use DeepAR[28] as the base model.
Ada-DeepAR-uniform is different from DeepAR because of the fine-tuning step where adaptive
weights are again trained one more time; this might help correcting the overfitting of the DeepAR
model (and reduce test error) because of the lower capacity of adaptive weights and/or help es-
cape local minima (and reduce training loss). We evaluate these probabilistic methods using the
continuous-ranked probability score (CRPS) [11, 23]. Table 1 summarizes the results. Averaged over
all datasets, Ada-DeepAR improves over the base model DeepAR by 8.4% (relative improvement).
For three out of five datasets, the improvements over the base model are statistically significant
(paired Student's t-test p-value < 0.05, see Table 1). Ada-DeepAR selected the mixture of two
negative binomial distributions for all datasets except Covid-deaths (for which the geometric
distribution was selected). RevIn also improves over DeepAR, but with a much smaller margin. TFT
performs best on Covid-deaths, but overall worse than the other methods on these datasets. Inter-
estingly, Ada-DeepAR-uniform also improves the error by 6.7% over its base model. In particular,
Ada-DeepAR-uniform is the best model on the Traffic and Taxi datasets. Our hypothesis is that
adaption to distribution shift is not necessary, and perhaps even counterproductive, for these datasets.
This is also suggested by the performance of RevIn, which performs similar to Ada-DeepAR on these
datasets. Note that a uniform distribution could be seen as one of the possible distributions pφ(*) that
our adaptive architecture should consider and if no other distribution reduces the validation error,
the uniform distribution should be selected. The performance differences between Ada-DeepAR and
Ada-DeepAR-uniform are statistically significant for all datasets except Traffic.
5 Conclusion
We introduced an adaptive sampling mechanism over the training history, whose parameters are
learned using Bayesian optimization. Our experiments show that our method can improve the
forecasting error over its base model (in this work, the improvements over the base model where
statistically significant for three out of five datasets). While we find Bayesian optimization to be
a powerful technique to find good adaptive sampling parameters, this approach is computationally
expensive (because many parallel trials need to be evaluated) and could degrade as the number
of parameters increases. Re-framing our approach as an input-selection layer that uses the re-
parametrization trick for sampling could allow for cheaper end-to-end learning of the adaptive model
parameters and pφ(*).
5
References
[1] Alexander Alexandrov, Konstantinos Benidis, Michael Bohlke-Schneider, Valentin Flunkert, Jan
Gasthaus, Tim Januschowski, Danielle C Maddix, Syama Sundar Rangapuram, David Salinas,
Jasper Schulz, et al. Gluonts: Probabilistic and neural time series modeling in python. J. Mach.
Learn. Res., 21(116):1–6, 2020.
[2] Sercan O Arik, Nathanael C Yoder, and Tomas Pfister. Self-adaptive forecasting for improved
deep learning on non-stationary time-series. arXiv preprint arXiv:2202.02403, 2022.
[3] Michael Bohlke-Schneider, Shubham Kapoor, and Tim Januschowski. Resilient neural fore-
In Proceedings of the Fourth International Workshop on Data Manage-
casting systems.
ment for End-to-End Machine Learning, DEEM'20, New York, NY, USA, 2020. Association
for Computing Machinery. ISBN 9781450380232. doi: 10.1145/3399579.3399869. URL
https://doi.org/10.1145/3399579.3399869.
[4] Oliver Borchert, David Salinas, Valentin Flunkert, Tim Januschowski, and Stephan Günnemann.
Multi-objective model selection for time series forecasting, 2022. URL https://arxiv.org/
abs/2202.08485.
[5] J. D. Croston. Forecasting and stock control for intermittent demands. Journal of the Operational
Research Society, 23(3):289–303, Sep 1972. ISSN 1476-9360. doi: 10.1057/jors.1972.50. URL
https://doi.org/10.1057/jors.1972.50.
[6] Ensheng Dong, Hongru Du, and Lauren Gardner. An interactive web-based dashboard to
track COVID-19 in real time. The Lancet Infectious Diseases, 20(5):533–534, May 2020.
ISSN 1473-3099. doi: 10.1016/S1473-3099(20)30120-1. URL https://doi.org/10.1016/
S1473-3099(20)30120-1. Publisher: Elsevier.
[7] Yuntao Du, Jindong Wang, Wenjie Feng, Sinno Pan, Tao Qin, Renjun Xu, and Chongjun Wang.
Adarnn: Adaptive learning and forecasting of time series. In Proceedings of the 30th ACM
International Conference on Information & Knowledge Management, pages 402–411, 2021.
[8] Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive.
ics.uci.edu/ml.
[9] Peter I Frazier. A tutorial on bayesian optimization. arXiv preprint arXiv:1807.02811, 2018.
[10] Everette S Gardner Jr. Exponential smoothing: The state of the art. Journal of forecasting, 4(1):
1–28, 1985.
[11] Tilmann Gneiting and Adrian E Raftery. Strictly proper scoring rules, prediction, and estimation.
Journal of the American Statistical Association, 102(477):359–378, 2007. doi: 10.1198/
016214506000001437. URL https://doi.org/10.1198/016214506000001437.
[12] Rakshitha Godahewa, Christoph Bergmeir, Geoffrey I. Webb, Rob J. Hyndman, and Pablo
Montero-Manso. Monash time series forecasting archive. In Neural Information Processing
Systems Track on Datasets and Benchmarks, 2021.
[13] Tao Hong, Jingrui Xie, and Jonathan Black. Global energy forecasting competition 2017:
Hierarchical probabilistic load forecasting. International Journal of Forecasting, 35(4):1389 –
1399, 2019.
[14] Jiayuan Huang, Arthur Gretton, Karsten Borgwardt, Bernhard Schölkopf, and Alex
Smola. Correcting sample selection bias by unlabeled data.
In B. Schölkopf, J. Platt,
and T. Hoffman, editors, Advances in Neural Information Processing Systems, vol-
ume 19. MIT Press, 2006. URL https://proceedings.neurips.cc/paper/2006/file/
a2186aa7c086b46ad4e8bf81e2a3a19b-Paper.pdf.
[15] Rolf Isermann. Adaptive Control Systems (A Short Review), pages 127–140. Springer
ISBN 978-3-642-86420-9. doi: 10.1007/
Berlin Heidelberg, Berlin, Heidelberg, 1991.
978-3-642-86420-9_12. URL https://doi.org/10.1007/978-3-642-86420-9_12.
6
[16] Taesung Kim, Jinhee Kim, Yunwon Tae, Cheonbok Park, Jang-Ho Choi, and Jaegul Choo.
Reversible instance normalization for accurate time-series forecasting against distribution shift.
In International Conference on Learning Representations, 2021.
[17] Aaron Klein, Louis C. Tiao, Thibaut Lienart, Cedric Archambeau, and Matthias Seeger. Model-
based asynchronous hyperparameter and neural architecture search, 2020. URL https://
arxiv.org/abs/2003.10865.
[18] Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long- and short-
term temporal patterns with deep neural networks. CoRR, abs/1703.07015, 2017. URL
http://arxiv.org/abs/1703.07015.
[19] Fengpei Li, Henry Lam, and Siddharth Prusty. Robust importance weighting for covariate
In Silvia Chiappa and Roberto Calandra, editors, Proceedings of the Twenty Third
shift.
International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings
of Machine Learning Research, pages 352–362. PMLR, 26–28 Aug 2020. URL https:
//proceedings.mlr.press/v108/li20b.html.
[20] Bryan Lim, Sercan Ö. Arık, Nicolas Loeff, and Tomas Pfister. Temporal fusion transformers for
interpretable multi-horizon time series forecasting. International Journal of Forecasting, 37(4):
1748–1764, 2021. ISSN 0169-2070. doi: https://doi.org/10.1016/j.ijforecast.2021.03.012. URL
https://www.sciencedirect.com/science/article/pii/S0169207021000637.
[21] Linbo Liu, Youngsuk Park, Trong Nghia Hoang, Hilaf Hasson, and Jun Huan. Towards robust
multivariate time-series forecasting: Adversarial attacks and defense mechanisms. arXiv
preprint arXiv:2207.09572, 2022.
[22] Yucheng Lu, Youngsuk Park, Lifan Chen, Yuyang Wang, Christopher De Sa, and Dean Foster.
Variance reduced training with stratified sampling for forecasting models. In International
Conference on Machine Learning, pages 7145–7155. PMLR, 2021.
[23] James E. Matheson and Robert L. Winkler. Scoring rules for continuous probability distributions.
Management Science, 22(10):1087–1096, 1976. ISSN 00251909, 15265501. URL http:
//www.jstor.org/stable/2629907.
[24] Srayanta Mukherjee, Devashish Shankar, Atin Ghosh, Nilam Tathawadekar, Pramod Kompalli,
Sunita Sarawagi, and Krishnendu Chaudhury. ARMDN: Associative and recurrent mixture
density networks for retail demand forecasting. arXiv preprint arXiv:1803.03800, 2018.
[25] Youngsuk Park, Kanak Mahadik, Ryan A Rossi, Gang Wu, and Handong Zhao. Linear quadratic
regulator for resource-efficient cloud services. In Proceedings of the ACM Symposium on Cloud
Computing, pages 488–489, 2019.
[26] Youngsuk Park, Ryan Rossi, Zheng Wen, Gang Wu, and Handong Zhao. Structured policy
iteration for linear quadratic regulator. In International Conference on Machine Learning, pages
7521–7531. PMLR, 2020.
[27] Dominique Picard. Testing and estimating change-points in time series. Advances in Applied
Probability, 17(4):841–867, 1985. doi: 10.2307/1427090.
[28] David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. Deepar: Probabilistic
forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3):
1181–1191, 2020.
[29] David Salinas, Matthias Seeger, Aaron Klein, Valerio Perrone, Martin Wistuba, and Cedric
Archambeau. Syne tune: A library for large scale hyperparameter tuning and reproducible
research. In First Conference on Automated Machine Learning (Main Track), 2022.
[30] Harshit Saxena, Omar Aponte, and Katie T. McConky. A hybrid machine learning model for
forecasting a billing period's peak electric load days. International Journal of Forecasting, 35
(4):1288 – 1303, 2019. ISSN 0169-2070. doi: https://doi.org/10.1016/j.ijforecast.2019.03.025.
URL http://www.sciencedirect.com/science/article/pii/S016920701930144X.
7
[31] Masashi Sugiyama, Shinichi Nakajima, Hisashi Kashima, Paul Buenau, and Motoaki Kawanabe.
Direct importance estimation with model selection and its application to covariate shift adapta-
tion. In J. Platt, D. Koller, Y. Singer, and S. Roweis, editors, Advances in Neural Information
Processing Systems, volume 20. Curran Associates, Inc., 2007. URL https://proceedings.
neurips.cc/paper/2007/file/be83ab3ecd0db773eb2dc1b0a17836a1-Paper.pdf.
[32] Elham Taghizadeh. Utilizing artificial neural networks to predict demand for weather-sensitive
products at retail stores. arXiv preprint arXiv:1711.08325, 2017.
[33] NYC Taxi and Limousine Commission. TLC trip record data. https://www1.nyc.gov/
site/tlc/about/tlc-trip-record-data.page, 2015.
[34] Olivia Wiles, Sven Gowal, Florian Stimberg, Sylvestre-Alvise Rebuffi, Ira Ktena, Krish-
namurthy Dj Dvijotham, and Ali Taylan Cemgil. A fine-grained analysis on distribu-
In International Conference on Learning Representations, 2022. URL https:
tion shift.
//openreview.net/forum?id=Dl4LetuLdyK.
[35] TaeHo Yoon, Youngsuk Park, Ernest K Ryu, and Yuyang Wang. Robust probabilistic time
series forecasting. In International Conference on Artificial Intelligence and Statistics, pages
1336–1358. PMLR, 2022.
8
A Appendix
A.1 Related Work
The problem of learning under distribution shift for time series has been extensively studied for many
years. For example, change point detection analyzes when the statistical distribution of a time series
changes [27]. Another related field is adaptive control, where the system parameters are continuously
adjusted to account for discrepancies of expected and observed data [15]. We focus our review on
recent methods that address distribution shifts when forecasting with neural networks. Kim et al. [16]
employs a trainable instance-wise normalization-and-denormalization layer to address non-stationary
mean and variance in time series forecasting. Arik et al. [2] proposes Self-Adaptive Forecasting to
adapt the forecasting model using test-time training by "backcasting" and using the backcast errors to
signal a potential distribution shift to adjust the weights of the model before inference. AdaRNN [7]
splits the time series history into dissimilar segments and learns importance weights to combine the
RNN hidden states over these segments. Another notion of distribution shift, adversarial attacks, has
been recently considered to build more robust forecasting [35, 21].
Another class of approaches to time series forecasting use specific weighting schemes to weight the
time series history to make predictions, for example exponential smoothing, the Non-Parametric
Time Series (NPTS) Forecaster [10, 1], or stratified sampling [22]. In contrast to these models, our
approach adaptively learns the weighting scheme over the history. Thus, our work can be seen as a
specific instantiaten of weighted re-sampling (or importance sampling) for time-series forecasting.
Importance sampling weights the log-likelihood in supervised learning tasks by importance weights
w(x) = ptest(x)/ptrain(x) where ptest and ptrain are the respective densities from which the
train/test samples are drawn [31, 14, 34, 19]. Here, we propose to avoid estimating ptrain and ptest
and instead tune the parameters of a parametric re-sampling function using Bayesian optimization.
A.2 Scenarios of distribution shift occurrence
Assumption 1 allows us to provide a precise breakdown of the specific cases of distribution shift that
our model can handle. This is important because it determines the exact applicability of the work
described in this paper. As Figure 1 shows, we identify three domains:
New or reoccurring shift: When a distribution shift is new or reoccurring in the past and there is no
shift between t ∈ [T − c, T ] and t ∈ [T + 1, T + τ ]. In this case the adaptive sampling mechanism is
expected to focus only on the shifted regions that are relevant for the current regime.
Reverted shift: When a shift occurred in the past but the distribution eventually reverted back to
the "standard" regime. This case is complementary to the previous one: here the adaptive sampling
mechanism provides a way to exclude the shifted regions. One can see the shifts in this case as
regions with noisy or corrupted data: excluding them during training would guarantee robustness
against noise.
Future shift: When the shift occurs in the forecasting window but not in the most recent region before
the forecast start date. Our adaptive sampling mechanism cannot work if we have no information
regarding the distribution shift happening in the test set (no free lunch).3
A.3 Datasets
We use datasets from the Monash Time Series Forecasting Repository [12] and GluonTS [1] for our
experiments. We use the same train/test splits as described in TSBench [4]. See Table A.1 for dataset
statistics. The frequencies of our used datasets are 30 minutes (30 MIN), hourly (H), and daily (D).
In particular, we use the following datasets:
Covid-deaths: Daily COVID-19 deaths of different countries between January 22 and August 21
2020 [6].
3Note that in our setting we consider the forecasting window to be a mere continuation of the training set,
which implies that the context window used at test time was part of training inputs. In this sense, our procedure
cannot handle this case if and only if the shift happens solely in the forecasting range.
9
Freq.
Horizon Number of Series Avg. Length Number of observations
Covid-deaths
Electricity
Traffic
Solar
Taxi
D
H
H
H
30 MIN
30
24
48
24
24
227
321
862
137
1,214
182
21,044
17,496
7,009
1,488
41,314
6,755,124
15,081,552
960,233
1,806,432
Table A.1: Dataset statistics for the used datasets, taken from Borchert et al. [4].
Electricity: Hourly household consumption data between January 2012 and June 2014 [8].
Traffic: Hourly occupancy rates of freeways in the San Francisco Bay area between 2015 and
2017 [8].
Solar: Hourly power output of 137 photovoltaic power stations in the US [18].
Taxi: Number of taxi rides in different locations in New York sampled at 30 minute windows [33].
A.4 Training Details
The parameters of the distribution over history are optimized via Bayesian Optimization [9] using the
recent scalable implementation provided in Syne-Tune [29]. We leveraged an AWS EC2 instance
with ≈ 42 cores and set the number of random initializations to 44 to allow for sufficient exploration
of the parameter space. That is, the optimizer starts with 44 trials, each with a different parameter
configuration, and sequentially stops some of them or instantiate new ones given the information
from the Gaussian Process posterior. The optimizer stopping criterion was chosen to be the maximum
number of trials taken to completion, which was set to 200. We used the CRPS used to decide which
trials were stopped or continued was the mean quantile loss over the validation set.
The lightweight architecture is supposed to be simple enough to allow frequent re-training
through adaptive sampling, so that the forecasting model can quickly adapt to new distributions.
Clearly, different architectures will work better with different datasets.
In all our experiments
with DeepAR [28], we found that using the default two-layer LSTM with 40 hidden units for the
pre-trained model, and freezing the first layer only for adaptive training yielded the best results. To
clarify, this means that wada ⊂ wpre. Both pre-training and adaptive training were done over 100
epochs with a small dropout probability equal to 0.1.
For TFT, we selected the hyperparameter setting from the TSBench [4] that resulted in lowest CRPS
loss on the validation set for each dataset. The hyperparameters tuned in TSBench are the context
length, the number of hidden states, and the number of heads.
For the DeepAR and TFT models, we use the implementation available in GluonTS [1].
A.5 Additional Figures
10
Figure A.1: Adaptive sam-
pling uses pφ to sample
training windows to come
from distributions that are
similar to the forecasting
window. Both panels show a
time series (blue) at the top,
with windows (orange) sam-
pled during training, and the
distribution over time steps at
the bottom. a) Uniform sam-
pling. b) Adaptive sampling.
11
|
|
http://arxiv.org/abs/2302.11864v2 | 2023-03-07T15:01:39 | 2023-02-23T09:06:42 | Grounding Graph Network Simulators using Physical Sensor Observations | Physical simulations that accurately model reality are crucial for many
engineering disciplines such as mechanical engineering and robotic motion
planning. In recent years, learned Graph Network Simulators produced accurate
mesh-based simulations while requiring only a fraction of the computational
cost of traditional simulators. Yet, the resulting predictors are confined to
learning from data generated by existing mesh-based simulators and thus cannot
include real world sensory information such as point cloud data. As these
predictors have to simulate complex physical systems from only an initial
state, they exhibit a high error accumulation for long-term predictions. In
this work, we integrate sensory information to ground Graph Network Simulators
on real world observations. In particular, we predict the mesh state of
deformable objects by utilizing point cloud data. The resulting model allows
for accurate predictions over longer time horizons, even under uncertainties in
the simulation, such as unknown material properties. Since point clouds are
usually not available for every time step, especially in online settings, we
employ an imputation-based model. The model can make use of such additional
information only when provided, and resorts to a standard Graph Network
Simulator, otherwise. We experimentally validate our approach on a suite of
prediction tasks for mesh-based interactions between soft and rigid bodies. Our
method results in utilization of additional point cloud information to
accurately predict stable simulations where existing Graph Network Simulators
fail. | [
"Jonas Linkerhägner",
"Niklas Freymuth",
"Paul Maria Scheikl",
"Franziska Mathis-Ullrich",
"Gerhard Neumann"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11864v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11864v2",
"@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.RO"
] | 3
2
0
2
r
a
M
7
]
G
L
.
s
c
[
2
v
4
6
8
1
1
.
2
0
3
2
:
v
i
X
r
a
Published as a conference paper at ICLR 2023
GROUNDING GRAPH NETWORK SIMULATORS USING
PHYSICAL SENSOR OBSERVATIONS
Jonas Linkerhägner1∗
Niklas Freymuth1
Paul Maria Scheikl1,2
Franziska Mathis-Ullrich1,2
Gerhard Neumann1
1Institute for Anthropomatics and Robotics,
Karlsruhe Institute of Technology, Karlsruhe, Germany
2Department Artificial Intelligence in Biomedical Engineering,
Friedrich-Alexander-University Erlangen-Nürnberg, Erlangen, Germany
ABSTRACT
Physical simulations that accurately model reality are crucial for many engineer-
ing disciplines such as mechanical engineering and robotic motion planning. In
recent years, learned Graph Network Simulators produced accurate mesh-based
simulations while requiring only a fraction of the computational cost of traditional
simulators. Yet, the resulting predictors are confined to learning from data gener-
ated by existing mesh-based simulators and thus cannot include real world sensory
information such as point cloud data. As these predictors have to simulate complex
physical systems from only an initial state, they exhibit a high error accumulation
for long-term predictions. In this work, we integrate sensory information to ground
Graph Network Simulators on real world observations. In particular, we predict the
mesh state of deformable objects by utilizing point cloud data. The resulting model
allows for accurate predictions over longer time horizons, even under uncertainties
in the simulation, such as unknown material properties. Since point clouds are
usually not available for every time step, especially in online settings, we employ
an imputation-based model. The model can make use of such additional infor-
mation only when provided, and resorts to a standard Graph Network Simulator,
otherwise. We experimentally validate our approach on a suite of prediction tasks
for mesh-based interactions between soft and rigid bodies. Our method results
in utilization of additional point cloud information to accurately predict stable
simulations where existing Graph Network Simulators fail.
1
INTRODUCTION
Mesh-based simulation of complex physical systems lies at the heart of many fields in numerical sci-
ence and engineering (Liu et al., 2022; Reddy, 2019; Rao, 2017; Sabat & Kundu, 2021). Applications
include structural mechanics (Zienkiewicz & Taylor, 2005; Stanova et al., 2015), electromagnet-
ics (Jin, 2015; Xiao et al., 2022; Coggon, 1971), fluid dynamics (Chung, 1978; Zawawi et al., 2018;
Long et al., 2021) and biomedical engineering (Van Staden et al., 2006; Soro et al., 2018), most of
which traditionally depend on highly specialized task-dependent simulators. Recent advancements
in deep learning brought rise to more general learned dynamic models such as Graph Network
Simulators (GNSs) (Sanchez-Gonzalez et al., 2018; 2020; Pfaff et al., 2021). GNSs learn to predict
the dynamics of a system from data by encoding the system state as a graph and then iteratively
computing the dynamics for every node in the graph with a Graph Neural Network (GNN) (Scarselli
et al., 2009; Battaglia et al., 2018; Wu et al., 2020b). Recent extensions include long-term fluid flow
predictions (Han et al., 2022) and dynamics on different scales (Fortunato et al., 2022). Yet, these
approaches assume full knowledge of the initial system state, making them ill-suited for applications
∗correspondence to [email protected]
1
Published as a conference paper at ICLR 2023
Figure 1: A robot's end-effector (grey, red) grasps a 3-dimensional deformable cavity. The robot
maintains an internal simulated prediction of the cavity (orange) for two consecutive simulation
steps (left, right). This prediction can deviate from the true state of the cavity over time due to an
accumulation of error. However, the true cavity state can infrequently be observed from point cloud
data (blue), which the model can use to correct its prediction. Here, the point cloud is used to contract
the simulated cavity at the bottom and extend it at the top, causing the points to better align with the
mesh surface. We repeat the point cloud from the earlier simulation step in both images for clarity.
like model-predictive control (Camacho & Alba, 2013; Schwenzer et al., 2021) and model-based
Reinforcement Learning (Polydoros & Nalpantidis, 2017; Moerland et al., 2020) where accurate
predictions must be made based on partial initial states and observations.
In this work, we present Grounding Graph Network Simulators (GGNSs), a new class of GNS that
can process sensory information as input to ground predictions in the scene observations. More
precisely, we extend the graph of the current system state with point cloud data before predicting
the system dynamics from it. Since point clouds do not provide correspondences over time, it is
difficult to learn dynamics from point clouds alone. Thus, we use mesh-based data to learn the general
system dynamics and utilize point clouds to correct the predictions. As the sensory data is not always
available, particularly not for future predictions, our architecture is trained with imputed point clouds,
i.e., for each time step the model receives point clouds only with a certain probability. This training
scheme allows the model to efficiently integrate the additional information whenever provided.
During inference, the model iteratively predicts the next system state, using point clouds whenever
available to greatly improve the simulation quality, especially for simulations with incomplete initial
state information. Furthermore, our architecture addresses a critical research topic for GNSs by
alleviating common challenges such as drift and error accumulation during long-term predictions.
As a practical example, consider a robot grasping a deformable object. For optimal planning of the
grasp, the robot needs to model the state of the deformable object over time and predict the influence
of interactions between object and gripper. This prediction not only depends on the initial shape of
the object, but also on the forces the robot applies, the kind of material to grasp and external factors
such as the temperature, making it difficult to accurately predict how the material will deform over
time. However, once the robot starts deforming the object, it may easily observe the deformations in
the form of e.g., point clouds. These observations can then be integrated into the state prediction, i.e.,
they can ground the simulation whenever new information becomes available. An example is given
in Figure 1. Such observation-aided prediction is similar in nature to e.g., Kalman Filters (Kalman,
1960; Jazwinski, 1970; Becker et al., 2019) as the belief of the system state is updated based on partial
observations about the system. However, while Kalman Filters explicitly integrate novel information
into the belief in a mathematical fashion, we instead simply provide this information to a learned
model as additional unstructured sensor input.
We evaluate GGNS on a suite of 2d and 3d deformation prediction tasks created in the Simulation
Open Framework Architecture (SOFA) (Faure et al., 2012). Comparing our approach to an existing
GNS (Pfaff et al., 2021), we find that adding sensory information in the form of point clouds to our
model improves the simulation quality for all tasks. We investigate this behavior through extensive
ablation studies, showing the importance of different parameter choices and design decisions. Code
and data can be found under https://github.com/jlinki/GGNS.
Our list of contributions is as follows: (I) We extend the GNS framework to include sensory infor-
mation to ground predicted simulations in observations of the system state, allowing for accurate
2
Published as a conference paper at ICLR 2023
predictions of the full simulation. (II) We propose a simple but effective imputation training scheme
that naturally integrates sensory information to GNSs whenever available without substantially
increasing training cost or model complexity. (III) We construct and experiment on different defor-
mation prediction tasks and find that the inclusion of sensory information improves performance in
all settings, and that it is particularly crucial when the initial system state is not fully known.
2 RELATED WORK
Learned Physics Simulation. In recent years there has been a steady increase in research concerning
deep learning for physical simulations. Early work in physical reasoning aims at teaching systems
to understand physical relations on N-body systems (Battaglia et al., 2016) and deformable ob-
jects (Mrowca et al., 2018). A more direct approach is to instead train a learnable simulator from data
provided by some existing ground truth simulator. Here, Convoluational Neural Networks (CNNs)
have been extensively studied for fluid flow simulation (Tompson et al., 2017; Chu & Thuerey, 2017;
Ummenhofer et al., 2020; Kim et al., 2019; Xie et al., 2018) and aerodynamic flow fields (Guo et al.,
2016; Zhang et al., 2018; Bhatnagar et al., 2019). Further approaches use standard neural networks for
liquid splash simulations (Um et al., 2018) and latent space physics simulation (Wiewel et al., 2019).
Such learned physics simulators are considerably faster than their ground-truth counterparts, and that
they are usually fully differentiable. Thus, they have been applied to model-based Reinforcement
Learning (Mora et al., 2021) and for Inverse Design problems (Baqué et al., 2018; Durasov et al.,
2021; Allen et al., 2022b) .
Graph Network Simulators. Graph Network Simulators (GNS) (Sanchez-Gonzalez et al., 2020) are
a special case of learned physics simulators that utilize GNNs (Scarselli et al., 2009) to efficiently
encode the graph-like structure of many physical problems. They have found wide-spread application
in calculating atomic forces (Hu et al., 2021), particle-based simulations (Li et al., 2019; Sanchez-
Gonzalez et al., 2020) and mesh-based simulations (Pfaff et al., 2021; Weng et al., 2021; Han et al.,
2022; Fortunato et al., 2022; Allen et al., 2022a). Other works in this field directly solve partial
differential equations (Alet et al., 2019), and integrates explicit domain knowledge into the learned
simulator to improve the predictions (de Avila Belbute-Peres et al., 2020; Li & Farimani, 2021;
2022). Similarly, CNNs have been used to predict particle masses from images to subsequently
simulate physical systems with a GNN (Li et al., 2020) via visual grounding. This approach assumes
access to a series of images to predict particles and their behavior, whereas GGNS integrates sensor
observations into an existing mesh-based simulation. The work most closely related to our research
is MeshGraphNet (MGN) (Pfaff et al., 2021), which combines a graph-based encoding of the system
state with the next-step prediction of dynamic quantities to produce realistic predictions of mesh-based
simulations.
Simulation from Observation. Another variant of learned physics simulation is simulation from
observation. Learning directly from observations instead of a ground truth simulator requires less
expert knowledge for the design of the simulator and is more applicable to real-world scenarios.
Different approaches exist for this type of simulation, including Physical reasoning (Li et al., 2020)
and particle-based simulation (Martinkus et al., 2021). Point clouds have been used in CNN-based
simulation (Watters et al., 2017; Wang et al., 2019), and combined with PointNet (Charles et al.,
2017; Qi et al., 2017) to predict object deformations purely from observational data (Park et al., 2021).
Further approaches make use of GNNs to predict object relations (Fetaya et al., 2018) and future
frames in a point cloud sequence (Gomes et al., 2021).
Simulation of Deformable Objects. Simulating deformable objects is crucial for many applications
such as robotic manipulation tasks (Sanchez et al., 2018). Yet, recent approaches do not take explicit
deformation into account (Matas et al., 2018), or only consider highly simplified geometries such as
ropes (Sundaresan et al., 2020) or a square piece of cloth (Wu et al., 2020a; Lin et al., 2020; 2022).
One reason for this is the high computational cost of existing simulators, which may be alleviated by
fast and accurate learned simulators (Pfaff et al., 2021; Weng et al., 2021). Another recent work trains
the parameters of a differentiable simulator to align its simulations with real-world observations of
deformable objects based on point cloud information (Sundaresan et al., 2022). In this work, we
instead utilize point cloud information to improve upon existing mesh-based GNSs in settings where
additional point cloud data is available.
3
Published as a conference paper at ICLR 2023
3 FOUNDATIONS
3.1 MESSAGE PASSING NETWORK
Let G = (V, E, XV, XE) be a directed graph with nodes V, edges E ⊆ V × V, node features
XV : V → RdV of dimension dV and edge features XE : E → RdE of dimension dE. A Message
Passing Network (MPN) (Sanchez-Gonzalez et al., 2020; Pfaff et al., 2021) is a GNN consisting of L
Message Passing Blocks that receives the graph G as input and outputs a learned representation for
each node V and edge E. Each block l computes updated features for all nodes v ∈ V and edges
e ∈ E as
e = f l
xl+1
E(xl
v, xl
u, xl
e), with e = (u, v) and xl+1
v = f l
V(xl
v,
(cid:77)
xl+1
e
),
{e=(v,u)∈E}
v and x0
where x0
invariant aggregation such as a sum, max, or mean operator. Furthermore, each f l
function that is generally parameterized as a simple Multilayer Perceptron (MLP).
e are embeddings of the initial node and edge features of G and ⊕ is a permutation-
* is a learned
3.2 GRAPH NETWORK SIMULATOR
GNSs simulate a system's dynamics by repeatedly applying the following three steps. First, they
encode the system state S in a graph G. If the system state is given as e.g., a triangular or tetrahedral
mesh M of the underlying entities, this graph is naturally constructed by using the nodes of M as
nodes of the graph, and the connection between these nodes as edges. The node and edge features
XV, XE can be constructed based on the concrete simulation. In general, encoding purely relative
properties such as relative distances and velocities per edge rather than absolute positions per node
have been shown to greatly improve training speed and generalization (Sanchez-Gonzalez et al.,
2020). Next, the encoded graph G is used as input for a learned MPN, which computes final latent
representations xL
v for each node v ∈ V. These latent representations are interpreted as (potentially
higher-order) derivatives of dynamic quantities, which are used by a simple forward-Euler integrator
to derive an updated system state S (cid:48). Note that for some tasks, only a fraction of mesh nodes need to
be predicted, as the others are either fixed or belong to a known entity such as a gripper or collider. In
this case, only the latent representations of the nodes with otherwise unknown dynamics are used.
GNSs are trained on a node-wise next-step Mean Squared Error (MSE) objective, i.e., they minimize
the 1-step prediction error of the next system state to that of a given ground truth trajectory. During
inference, simulations over potentially hundreds of steps can be generated by iteratively repeating
the above-mentioned steps, using the updated dynamics of one step as the input for the next. We
note that the model does not predict the movement of fixed entities such as e.g., a collider, which is
instead assumed to be known and combined with the model's prediction about the unknown parts
of the system. Due to this iterative dependence on previous outputs, the model is prone to error
accumulation. A common strategy to tackle this limitation is to apply additional noise to the dynamic
variables of the system for each training step (Sanchez-Gonzalez et al., 2020; Pfaff et al., 2021).
Intuitively, adding training noise acts as a form of data augmentation that allows the learned model
to compensate for small prediction errors over time. This kind of error-compensating next-step
prediction leads to plausible and visually realistic predictions. However, the resulting predictions
can be arbitrarily inaccurate with respect to the true dynamics of the system, since the model has no
reference for its simulation other than some potentially incomplete initial state S0.
4 GROUNDING GRAPH NETWORK SIMULATOR
Our approach combines recent advances in graph-based learned physics simulation with additional
partial observations of the system state to generate highly accurate simulations from incomplete
initial states. To this end, we extend the existing GNS framework to naturally and efficiently integrate
auxiliary point cloud data whenever available. This auxiliary information grounds the predictions of
the model in an observation of the true system state, guiding it towards predictions that not only look
realistic but also closely match the actual dynamics of the system. Figure 2 illustrates an overview of
our approach. A more detailed description of the GNN-part of the method is found in Appendix A.
4
Published as a conference paper at ICLR 2023
Figure 2: Schematic of GGNS . Given a system state St (red) and optional point cloud observations
(dashed box), a GNN (orange) predicts how the system St+1 will look like at the next step (blue).
For object deformation tasks, the state can include boundary conditions (gray) such as colliders or
walls. When provided, the point cloud (green) is transformed into a neighborhood graph (yellow) in
the same coordinate system as the mesh, connecting each point in the point cloud to the nearest mesh
nodes. The model is trained to predict the next system state based on a true state (purple) provided by
a ground truth simulator. During inference, the model iteratively predicts updates from a potentially
incomplete initial system state (purple), using additional point cloud observations when available.
4.1 POINT CLOUDS AND NEIGHBORHOOD GRAPHS
In order to utilize point-based data in addition to meshes we first have to transfer both into a
common graph. Following previous work (Sanchez-Gonzalez et al., 2018), we do this by creating a
neighborhood graph based on spatial proximity. Given a graph G = (V, E, XV, XE) that encodes a
predicted system state and a point cloud observation P = {p1, . . . , pN }, pj ∈ Rd of the true system
state, we set V(cid:48) = V ∪ P and
E(cid:48) = E ∪ {(pi, pj) ∈ P 2|d(pi, pj) ≤ rP } ∪ {(v, p), (p, v)|v ∈ V, p ∈ P, d(p, v) ≤ rS }.
Here, d is some distance measure, usually the euclidean distance, and rP and rS are task-specific
neighborhood radii. The corresponding features XV(cid:48), XE(cid:48) of the added nodes and edges in V(cid:48) and
E(cid:48) depend on the concrete task. The different node and edge types are one-hot encoded into their
respective features to allow the model to differentiate between them. Similar to the original features,
information can be encoded in a relative fashion in the form of edge features to aid generalization.
More concretely, we encode relative distances in world space along all edges, additionally adding
mesh-space distances for edges between two mesh nodes. This connectivity is slightly different from
MGN (Pfaff et al., 2021), which make use of additional world edges between mesh-nodes by creating
a similar radius-based neighborhood graph for the mesh nodes in world space.
4.2
IMPUTATION-BASED TRAINING AND INFERENCE
For most realistic applications, point clouds are typically not available at each time step during
inference. For example, we may have access to observed point clouds from the previous k time steps
and want to use them to infer the state of the system in the future. We adapt our model to this constraint
by employing an imputation-based training scheme. Our model still uses a single GNN, but we now
randomly replace the graph G of S with the corresponding extended graph G(cid:48) = (V(cid:48), E(cid:48), XV(cid:48), XE(cid:48))
with equal probability during training. In both cases, the model is only trained to predict the system
dynamics for the original nodes V. Intuitively, this allows each system node v ∈ V to utilize the
additional information of close-by points of a point cloud when available, while at the same time
forcing it to also make sensible predictions when there is no additional information. During inference,
we construct G(cid:48) from the (predicted) system state S and a corresponding observed point cloud P of
the true object whenever available and use G otherwise. This enables the model to reason about the
true system state that is observed via P, adapting its prediction to the otherwise unknown behavior
of the system. This grounding of the prediction also alleviates common errors of GNS such as drift
and more generally error accumulation. An example can be seen in Figure 1. Here, the system state
consists of a predicted mesh and a gripper, and the point cloud consists of points sampled from the
true object. The mismatch between point cloud and predicted mesh indicates the prediction error, and
5
Optional Point-cloud InformationNeighborhood GraphState at Step tPredicted Mesh at Step t+1GNNUpdateTrue State atStep t+1Initial SystemStateInference t=0Training MSEPoint-cloud at Step tInference t=t+1Published as a conference paper at ICLR 2023
Figure 3: Final simulated meshes (t = 50) for GGNS (k = 5) (left), the ground truth simulation
(middle) and MGN (right) for 2 test rollouts with different material properties for the Deformable
Plate task. Our model closely matches the ground truth simulations for both materials, while MGN
predicts the same material every time.
the model uses this additional information to correct the current state estimate. Similar figures for the
other two tasks can be found in Appendix C.
We compare this simple imputation-based method to another training scheme in our experiments,
which we call GGNS+LSTM. Here we use an LSTM (Hochreiter & Schmidhuber, 1997) layer on the
node output features of the GNN to explicitly include recurrency into the model. This modification
allows information such as the material properties to be inferred and propagated over time, which
can be utilized to improve the predictions in time steps without point clouds. The resulting model
is trained on the same 1-step prediction loss and also uses training noise to generate stable rollouts
during inference. However, it is significantly more costly to train, as it makes use of backpropagation
in time to compute the gradients for the recurrency. We find experimentally that this recurrent model
performs worse than the imputation-based method. An explanation for this is that the potential
benefit of propagating information over time is offset by the additional training and model complexity,
especially with respect to the next-step prediction objective. For this reason, GGNS relies on this
simple but effective imputation-based approach.
5 EXPERIMENTS
We evaluate GGNS on complex 2d and 3d mesh-based object deformation prediction tasks modelled
in the Simulation Open Framework Architecture (SOFA) (Faure et al., 2012). For each task, the
true system state is given by a tetrahedral FEM mesh of a deformable object with rigid boundary
conditions combined with a triangular surface mesh of a rigid collider. The point clouds are generated
by raycasting using one virtual camera for 2d and up to five cameras for 3d tasks arranged around the
scene. More details on the generation of the point clouds are presented in Appendix B. Additional
environment-specific details, including node and edge features and dataset properties can also be found
in Appendix B. We assume that, while the initial mesh of the object is known, its material properties
are not. We model these unknown properties via the Poisson's ratio (Lim, 2015) −1 < ν < 0.5,
which is a scalar value describing the ratio of contraction (ν < 0) or expansion (ν > 0) under
compression (Mazaev et al., 2020). For all datasets, we randomly assign Poisson's ratios from
ν ∈ {−0.9, 0.0, 0.49} equally to all rollouts.
We train all models on all tasks using the Adam optimizer (Kingma & Ba, 2015) with a learning rate
of 5 × 10−4 and a batch size of 32, using early stopping on a held-out validation set to save the best
model iteration for each setting. The models use a LeakyReLU activation function, five message
passing blocks with 1-layer MLPs and a latent dimension of 128 for node and edge updates. We use
a mean aggregation for the edge features and a training noise of 0.01. All tasks use a normalized task
space of [−1, 1]d. An overview of the network hyperparameters can be found in Appendix E.
Evaluation Metrics. We evaluate the performance of all trained models on 10 different seeds per
experiment. We report the means and standard deviations of the different runs, where, for each run,
we average the results over all available steps of a trajectory and over all trajectories in the test set of
6
Published as a conference paper at ICLR 2023
Figure 4: Visualization for a test trajectory at time step t = 70 for GGNS (left), the ground truth
simulation (middle) and MGN (right). While MGN accumulates a large prediction error over time,
GGNS is able to utilize the additional point cloud information to stay close to the ground truth for the
full length of the simulation. Different angles of this visualization can be found in Appendix C.
the respective data set. For all experiments, we report the full rollout loss, where the model starts with
the initial state S0 and predicts the states up to a final state ST . Here, we provide a point cloud to the
model every k ≥ 1 steps and resort to mesh-only prediction otherwise. This corresponds to a setting
in which the deformation of an object is tracked with both high-frequency sensors and low-frequency
cameras which provide the position of the rigid collider and point-cloud information respectively.
We also consider an application where a robot observes an object's deformation up to some point in
time and then reasons about future deformations without additional point-cloud information. For this
setting, the initial system state S0 is provided to the model, followed by m point clouds for its next
m predictions. Then, 10 more steps are predicted without point clouds to predict a state Sm+10 and
and compute the corresponding 10-step prediction loss. The reported losses are the average MSE
over every step along the trajectory averaged over all possible rollouts. This metric reduces to the
average loss for a m + 10-step prediction for methods that cannot make use of point cloud data, as
the state Sm+10 needs to be predicted from the initial S0.
Baselines. We compare to MGN, a state-of-the-art GNS, which utilizes additional world edges
between close-by mesh nodes, but does not incorporate point cloud observations. Comparing these
world edges to Section 4.1, MGN assumes an edge partition E = E1 ̇∪E2 and separate edge update
functions f l
. The edge-aggregation for the node update is then computed by aggregating
E1
the latent features of both types of edges separately and concatenating the result. We adopt this
explicit representation of edge types for the MGN baseline and experiment with it for GGNS in
Appendix D. As it does not provide any significant advantages for our model, GGNS instead resorts
to a simple one-hot encoding of the type of input edge for the remaining experiments.
and f l
E2
Additionally, we evaluate a variant of MGN that has additional access to the underlying Poisson's
ratio v as a node feature, called MGN (M). This additional information leads to a deterministic ground
truth simulation w.r.t. the initial system state, and upper bounds the performance of MGN. We also
compare to GGNS+LSTM, which integrates recurrency into our imputation technique. Here, we
investigate whether this recurrency helps the model predicting e.g., material properties over time.
As a point cloud based baseline, we use a non-learned method to directly generate a mesh from the
point cloud of each time step. We voxel-subsample the point cloud so that we observe approximately
the same number of points as nodes in the ground truth mesh and then use Alpha Shapes (Akkiraju
et al., 1995) to create a (potentially non-convex) mesh for this time step. This baseline shows how
much information can be directly inferred from just the point cloud information.
Deformable Plate. We consider a family of 2-dimensional trapezoids that are deformed by a circular
collider with constant velocity. Besides the trapezoidal shapes, diversity in the dataset is introduced
by varying the size and starting positions of the collider. For this task, we additionally consider the
Intersection over Union (IoU) between the predicted and the ground truth mesh as an evaluation metric.
We find that this metric is less sensitive to individual mesh nodes and that it instead measures how
well the predicted object shape matches that of the real system state. We use a total of 675/135/135
trajectories for our training, validation and test sets. Each trajectory consist of T = 50 timesteps.
Tissue Manipulation. An important application for the prediction of deformable objects is medical
robotics. We simulate a robot-assisted surgery scenario where a piece of tissue is deformed by a
7
Published as a conference paper at ICLR 2023
r
o
r
r
E
d
e
r
a
u
q
S
n
a
e
M
t
u
o
l
l
o
R
10−2
10−3
10−4
10−5
10−6
(k=1)
(k=5)
(k=2)
GGNS
10−2
10−3
10−4
10−5
10−6
10−2
10−3
10−4
10−5
10−6
MGN
(k=1) (k=2) (k=5) (k=10) MGN
(M)
GGNS
MGN
(k=1) (k=2) (k=5) (k=10) MGN
(M)
GGNS
MGN
(k=1)
(k=2)
GGNS+LSTM
(k=5) MGN
(M)
(a) Deformable Plate
(b) Tissue Manipulation
(c) Cavity Grasping
Figure 5: Rollout Mean Squared Error of GGNS and MGN baselines evaluated on the test set of the
three datasets. We report the results for GGNS using point clouds in every k-th time step. MGN(M)
indicates the baseline method of MGN that uses the ground truth material as input feature. GGNS
outperforms the MGN baseline in all settings and in most cases even if it has access to the complete
initial state. For the Deformable Plate task we additionally report the errors for GGNS+LSTM, which
perform worse than GGNS for all k but still outperforming the MGN baseline.
solid gripper. Varying the direction of the gripper's motion and its gripping position on the tissue
results in additional diversity. Here, 600/120/120 trajectories are used, each of which is rolled out
for T = 100 timesteps. This task is visualized in Figure 4.
Cavity Grasping. Robotic manipulation of deformable objects is an important application of
deformable physics simulation. Here, a simulated Panda 1 robot gripper grasps and deforms a cavity.
For this purpose, we randomly generate cone-shaped cavities with different radii, which are deformed
by a gripper from different positions. An example simulation step by GGNS for this task is illustrated
in Figure 1. We use the same amount of samples and data split as in the Tissue Manipulation task.
6 RESULTS
Main Results. We test our method on the three deformation prediction tasks described in Section 5
and compare it to MGN with and without material information. We find that GGNS can use the
point cloud information to produce high quality rollouts that closely match the true system states. An
example is shown in Figure 3, which visualizes the final simulated meshes for our method and the
ground truth simulation. Additionally, GGNS outperforms the baselines even when they have access
to the complete initial state, which our model has not. Figure 4 shows the qualitative differences
between GGNS and MGN on the Tissue Manipulation task. Additional visualizations for all tasks
and both methods can be found in Appendix C. The evaluations for full rollouts are given in Figure 5.
Table 1 shows results for the m + 10-step evaluation. Appendix D shows the performance of GGNS
for different model hyperparameters. Similar to Pfaff et al. (2021), we find that GGNS is robust to
most parameter choices, and that a modest amount of training noise is crucial for long-term rollouts.
To show the applicability of our method for more realistic point cloud data, we provide additional
ablations on noisy and partial observable point clouds in Appendix D. We find that our model is quite
robust to the quality of the point clouds and can still reliably use their information to ground the
simulation. On the Deformable Plate dataset, we additionally evaluate the mean Intersection over
Union (IoU) during the rollouts to emphasize the compliance with the overall shape of the object
rather than that of individual mesh nodes. The results are illustrated in Figure 6a.
Recurrent Imputation Model. For the 2d data of the Deformable Plate task, we additionally
compare our imputation model to the GGNS+LSTM approach, which can use the recurrence of
LSTMs to pass information over time. Figure 5a shows that GGNS outperforms this alternative
approach for each k. We find that our simple architecture outperforms the recurrent one while
requiring significantly less time to train, likely due to the additional complexity of training the
recurrent model. The qualitative results in Appendix C confirm these findings.
Initial Mesh Generation. Using the IoU metric, we can compare objects across different mesh
representations. The results in Figure 6b show that GGNS produces accurate rollouts even if the
initial mesh is generated directly from the initial point cloud. For this, we compute a mesh with
similar resolution to the training meshes from the convex hull of the initial point cloud, avoiding
1FRANKA EMIKA GmbH, Munich, Germany
8
Published as a conference paper at ICLR 2023
Approach
m + 10-step MSE ×10−5
Tissue
Plate
Cavity
GGNS
MGN (M)
MGN
2.907 ± 0.172
10.663 ± 1.063
282.684 ± 18.112
0.514 ± 0.052
5.027 ± 1.489
5.885 ± 0.723
0.923 ± 0.040
6.294 ± 0.668
11.528 ± 0.747
Table 1: Evaluation on the m + 10-step prediction setting on the test set for all three tasks. GGNS
clearly outperforms the baselines on all tasks even if they have access to the full initial simulation
state.
U
o
I
t
u
o
l
l
o
R
p
e
t
s
-
0
5
1
0.95
0.9
0.85
0.8
U
o
I
t
u
o
l
l
o
R
p
e
t
s
-
0
5
1
0.95
0.9
0.85
0.8
t
fi
e
n
e
B
d
e
z
i
l
a
m
r
o
N
1.2
1
0.8
0.6
0.4
0.2
0
Cavity
Tissue
Plate
(k=1)
(k=2)
GGNS
(k=5) MGN
(M)
MGN
(k=1) (k=2)
GGNS
(k=5) MGN
(M)
MGN Alpha
Shapes
1
2
3
4
5
6
7
8
9
10
k
(a) Deformable Plate IoU
(b) IoU without initial mesh
(c) Different grounding frequencies
Figure 6: (a) Rollout IoU for the Deformable Plate dataset for GGNS and the MGN baseline. The
main findings here are similiar to the MSE results but enable to compare against the values in (b),
where the initial mesh is created from initial the point cloud. The achieved IoUs are lower compared
to using the ground truth mesh, but GGNS (k ≤ 2) still outperforms all baselines including the Alpha
Shapes in this setting. (c) Normalized benefit of using a point cloud in every k-th timestep, where
k = 1 means a point cloud is available in every time step.
the dependence on any simulation data. This procedure marks an important step towards using
these models on real world data. The results indicate that generating the initial mesh from point
cloud information results in a degradation of the performance compared to an evaluation that uses a
provided mesh. Yet, it still allows for a high-quality prediction of the deformation. The comparison
to Alpha Shapes shows that combining infrequent point cloud information (k = 5) with a simulator
leads to better and more consistent results than directly creating the mesh from the point cloud in
each time step. Additionally, our model naturally tracks the correspondences of mesh nodes over
time, whereas Alpha Shapes cannot observe the evolution of individual particles in the system. As
such, GGNS allows for a more thorough understanding of the modeled process.
Grounding Frequency. Figure 6c shows the normalized performance of GGNS for grounding
frequencies k ∈ {1..10} across tasks. Here, a value of 1.0 corresponds to the performance for k = 1,
and 0.0 to the performance MGN. For all tasks there is a clear advantage in utilizing the point cloud
information, and the performance increases with the frequency of available point clouds.
7 CONCLUSION
We propose Grounding Graph Network Simulator (GGNS), an extension of the popular Graph
Network Simulator framework that can utilize auxiliary observations to accurately simulate complex
dynamics from incomplete initial system states. Utilizing a neighborhood graph computed from
point cloud information and an imputation-based training scheme, our model is able to ground its
prediction in an observation of the true system state. We show experimentally that this leads to
high-quality simulations in challenging 2d and 3d object deformation tasks, outperforming existing
approaches even when these are provided with full information about the system.
In future work, we will extend GGNSs to explicitly model uncertainty and maintain a belief over the
latent variables of the system, e.g., by employing a Kalman filter in a learned latent space (Becker
et al., 2019). Another promising direction is to adapt the current next-step prediction loss to instead
predict a trajectory over a small period of time to increase the long-term consistency of the model.
Finally, we will employ our model for model-predictive control and model-based Reinforcement
Learning in both simulation and on a real robot.
9
Published as a conference paper at ICLR 2023
ACKNOWLEDGMENTS
We thank Vincent Kreuziger for the helpful discussions on the visualizations and for the high-quality
blender renderings. The authors acknowledge support by the state of Baden-Württemberg through
bwHPC. GN was supported by the DFG research unit DFG-FOR 5339 (AI-based Methodology for
the Fast Maturation of Immature Manufacturing Processes) and GN and NF were supported by the
BMBF project Davis (Datengetriebene Vernetzung für die ingenieurtechnische Simulation).
REFERENCES
N. Akkiraju, Edelsbrunner H., Facello M., P. Fu, E. P. Mücke, and C. Varela. Alpha shapes: Definition
and software. In Proceedings of the 1st International Computational Geometry Software Workshop,
pp. 63–66, 1995. URL http://www.geom.uiuc.edu/software/cglist/GeomDir/
shapes95def/.
Ferran Alet, Adarsh Keshav Jeewajee, Maria Bauza Villalonga, Alberto Rodriguez, Tomas Lozano-
Perez, and Leslie Kaelbling. Graph element networks: adaptive, structured computation and
In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th
memory.
International Conference on Machine Learning, volume 97 of Proceedings of Machine Learn-
ing Research, pp. 212–222. PMLR, 09–15 Jun 2019. URL https://proceedings.mlr.
press/v97/alet19a.html.
Kelsey R Allen, Tatiana Lopez Guevara, Yulia Rubanova, Kimberly Stachenfeld, Alvaro Sanchez-
Gonzalez, Peter Battaglia, and Tobias Pfaff. Graph network simulators can learn discontinuous,
rigid contact dynamics. Conference on Robot Learning (CoRL)., 2022a.
Kelsey R Allen, Tatiana Lopez-Guevara, Kimberly Stachenfeld, Alvaro Sanchez-Gonzalez, Pe-
ter Battaglia, Jessica Hamrick, and Tobias Pfaff. Physical design using differentiable learned
simulators. arXiv preprint arXiv:2202.00728, 2022b.
Pierre Baqué, Edoardo Remelli, François Fleuret, and Pascal Fua. Geodesic convolutional shape
optimization. In Jennifer G. Dy and Andreas Krause (eds.), Proceedings of the 35th International
Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15,
2018, volume 80 of Proceedings of Machine Learning Research, pp. 481–490. PMLR, 2018. URL
http://proceedings.mlr.press/v80/baque18a.html.
Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, and koray kavukcuoglu.
Interaction networks for learning about objects, relations and physics. In D. Lee, M. Sugiyama,
U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems,
volume 29. Curran Associates, Inc., 2016. URL https://proceedings.neurips.cc/
paper/2016/file/3147da8ab4a0437c15ef51a5cc7f2dc4-Paper.pdf.
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinícius Flores
Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner,
Çaglar Gülçehre, H. Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish
Vaswani, Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan
Wierstra, Pushmeet Kohli, Matthew Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu.
Relational inductive biases, deep learning, and graph networks. CoRR, abs/1806.01261, 2018.
URL http://arxiv.org/abs/1806.01261.
Philipp Becker, Harit Pandya, Gregor Gebhardt, Cheng Zhao, C James Taylor, and Gerhard Neumann.
Recurrent kalman networks: Factorized inference in high-dimensional deep feature spaces. In
International Conference on Machine Learning, pp. 544–552, 2019.
Saakaar Bhatnagar, Yaser Afshar, Shaowu Pan, Karthik Duraisamy, and Shailendra Kaushik.
Prediction of aerodynamic flow fields using convolutional neural networks. Computational
doi: 10.1007/s00466-019-01740-0. URL https:
Mechanics, 64(2):525–545, jun 2019.
//doi.org/10.1007%2Fs00466-019-01740-0.
Eduardo F Camacho and Carlos Bordons Alba. Model predictive control. Springer science & business
media, 2013.
10
Published as a conference paper at ICLR 2023
R. Qi Charles, Hao Su, Mo Kaichun, and Leonidas J. Guibas. Pointnet: Deep learning on point sets
for 3d classification and segmentation. In 2017 IEEE Conference on Computer Vision and Pattern
Recognition (CVPR), pp. 77–85, 2017. doi: 10.1109/CVPR.2017.16.
Mengyu Chu and Nils Thuerey. Data-driven synthesis of smoke flows with cnn-based feature
descriptors. ACM Trans. Graph., 36(4), jul 2017. ISSN 0730-0301. doi: 10.1145/3072959.3073643.
URL https://doi.org/10.1145/3072959.3073643.
TJ Chung. Finite element analysis in fluid dynamics. NASA STI/Recon Technical Report A, 78:44102,
1978.
JH Coggon. Electromagnetic and electrical modeling by the finite element method. Geophysics, 36
(1):132–155, 1971.
Filipe de Avila Belbute-Peres, Thomas D. Economon, and J. Zico Kolter. Combining differentiable
In Proceedings of the 37th
pde solvers and graph neural networks for fluid flow prediction.
International Conference on Machine Learning, ICML'20. JMLR.org, 2020.
Nikita Durasov, Artem Lukoyanov, Jonathan Donier, and Pascal Fua. Debosh: Deep bayesian shape
optimization. arXiv preprint arXiv:2109.13337, 2021.
François Faure, Christian Duriez, Hervé Delingette, Jérémie Allard, Benjamin Gilles, Stéphanie
Marchesseau, Hugo Talbot, Hadrien Courtecuisse, Guillaume Bousquet, Igor Peterlik, and Stéphane
Cotin. SOFA: A Multi-Model Framework for Interactive Physical Simulation. In Yohan Payan
(ed.), Soft Tissue Biomechanical Modeling for Computer Assisted Surgery, volume 11 of Studies in
Mechanobiology, Tissue Engineering and Biomaterials, pp. 283–321. Springer, June 2012. doi:
10.1007/8415\_2012\_125. URL https://hal.inria.fr/hal-00681539.
T. Fetaya, Elias Wang, K.-C. Welling, Michelle Zemel, Thomas Kipf, Ethan Fetaya, Kuan-Chieh
Wang, Max Welling, and Richard S. Zemel. Neural relational inference for interacting systems.
arXiv: Machine Learning, 2018.
Meire Fortunato, Tobias Pfaff, Peter Wirnsberger, Alexander Pritzel, and Peter Battaglia. Mul-
In ICML 2022 2nd AI for Science Workshop, 2022. URL https:
tiscale meshgraphnets.
//openreview.net/forum?id=G3TRIsmMhhf.
Pedro Gomes, Silvia Rossi, and Laura Toni. Spatio-temporal graph-rnn for point cloud prediction.
In 2021 IEEE International Conference on Image Processing (ICIP), pp. 3428–3432, 2021. doi:
10.1109/ICIP42928.2021.9506084.
Xiaoxiao Guo, Wei Li, and Francesco Iorio. Convolutional neural networks for steady flow ap-
proximation. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge
Discovery and Data Mining, KDD '16, pp. 481–490, New York, NY, USA, 2016. Associa-
tion for Computing Machinery. ISBN 9781450342322. doi: 10.1145/2939672.2939738. URL
https://doi.org/10.1145/2939672.2939738.
Xu Han, Han Gao, Tobias Pffaf, Jian-Xun Wang, and Li-Ping Liu. Predicting physics in mesh-reduced
space with temporal attention. CoRR, abs/2201.09113, 2022. URL https://arxiv.org/
abs/2201.09113.
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9:1735–80,
12 1997. doi: 10.1162/neco.1997.9.8.1735.
Weihua Hu, Muhammed Shuaibi, Abhishek Das, Siddharth Goyal, Anuroop Sriram, Jure Leskovec,
Devi Parikh, and C Lawrence Zitnick. Forcenet: A graph neural network for large-scale quantum
calculations. In ICLR 2021 SimDL Workshop, volume 20, 2021.
AH Jazwinski. Stochastic processes and filtering theory. ACADEMIC PRESS, INC.„ 1970.
Jian-Ming Jin. The finite element method in electromagnetics. John Wiley & Sons, 2015.
Rudolph Emil Kalman. A new approach to linear filtering and prediction problems. Journal of basic
Engineering, 82(1):35–45, 1960.
11
Published as a conference paper at ICLR 2023
Byungsoo Kim, Vinicius C. Azevedo, Nils Thuerey, Theodore Kim, Markus Gross, and Barbara
Solenthaler. Deep Fluids: A Generative Network for Parameterized Fluid Simulations. Computer
Graphics Forum (Proc. Eurographics), 38(2), 2019.
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization.
In Yoshua
Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR
2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http:
//arxiv.org/abs/1412.6980.
Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B. Tenenbaum, and Antonio Torralba. Learning
particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In International
Conference on Learning Representations, 2019. URL https://openreview.net/forum?
id=rJgbSn09Ym.
Yunzhu Li, Toru Lin, Kexin Yi, Daniel Bear, Daniel Yamins, Jiajun Wu, Joshua Tenenbaum, and
Antonio Torralba. Visual grounding of learned physical models. In Hal Daumé III and Aarti
Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119
of Proceedings of Machine Learning Research, pp. 5927–5936. PMLR, 13–18 Jul 2020. URL
https://proceedings.mlr.press/v119/li20j.html.
Zijie Li and Amir Barati Farimani. Accelerating lagrangian fluid simulation with graph neural
networks. In ICLR 2021 SimDL Workshop, volume 20, 2021.
Zijie Li and Amir Barati Farimani. Graph neural network-accelerated lagrangian fluid simulation.
Computers & Graphics, 103:201–211, 2022.
Teik-Cheng Lim. Auxetic Materials and Structures. Springer Singapore, 01 2015. ISBN 978-
981-287-274-6. doi: 10.1007/978-981-287-275-3. URL https://doi.org/10.1007/
978-981-287-275-3.
Xingyu Lin, Yufei Wang, Jake Olkin, and David Held. Softgym: Benchmarking deep reinforcement
learning for deformable object manipulation. In Conference on Robot Learning, 2020. URL
https://arxiv.org/abs/2011.07215.
Xingyu Lin, Yufei Wang, Zixuan Huang, and David Held. Learning visible connectivity dynamics for
cloth smoothing. In Aleksandra Faust, David Hsu, and Gerhard Neumann (eds.), Proceedings of
the 5th Conference on Robot Learning, volume 164 of Proceedings of Machine Learning Research,
pp. 256–266. PMLR, 08–11 Nov 2022. URL https://proceedings.mlr.press/v164/
lin22a.html.
Wing Kam Liu, Shaofan Li, and Harold S Park. Eighty years of the finite element method: Birth,
evolution, and future. Archives of Computational Methods in Engineering, pp. 1–23, 2022.
Ting Long, Can Huang, Dean Hu, and Moubin Liu. Coupling edge-based smoothed finite element
method with smoothed particle hydrodynamics for fluid structure interaction problems. Ocean
Engineering, 225:108772, 2021.
Karolis Martinkus, Aurelien Lucchi, and Nathanaël Perraudin. Scalable graph networks for par-
ticle simulations. Proceedings of the AAAI Conference on Artificial Intelligence, 35(10):8912–
8920, May 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/
17078.
Jan Matas, Stephen James, and Andrew J. Davison. Sim-to-real reinforcement learning for deformable
object manipulation. In 2nd Annual Conference on Robot Learning, CoRL 2018, Zürich, Switzer-
land, 29-31 October 2018, Proceedings, volume 87 of Proceedings of Machine Learning Research,
pp. 734–743. PMLR, 2018. URL http://proceedings.mlr.press/v87/matas18a.
html.
A V Mazaev, O Ajeneza, and M V Shitikova. Auxetics materials: classification, mechanical
properties and applications. IOP Conference Series: Materials Science and Engineering, 747
(1):012008, jan 2020. doi: 10.1088/1757-899x/747/1/012008. URL https://doi.org/10.
1088/1757-899x/747/1/012008.
12
Published as a conference paper at ICLR 2023
Thomas M Moerland, Joost Broekens, and Catholijn M Jonker. Model-based reinforcement learning:
A survey. arXiv preprint arXiv:2006.16712, 2020.
Miguel Angel Zamora Mora, Momchil Peychev, Sehoon Ha, Martin Vechev, and Stelian Coros.
In Marina Meila and Tong Zhang
Pods: Policy optimization via differentiable simulation.
(eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139
of Proceedings of Machine Learning Research, pp. 7805–7817. PMLR, 18–24 Jul 2021. URL
http://proceedings.mlr.press/v139/mora21a.html.
Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li F Fei-Fei, Josh Tenen-
baum, and Daniel L Yamins.
In
S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett
(eds.), Advances in Neural Information Processing Systems, volume 31. Curran Asso-
ciates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/file/
fd9dd764a6f1d73f4340d570804eacc4-Paper.pdf.
Flexible neural representation for physics prediction.
Jinhyung Park, Dohae Lee, and In-Kwon Lee. Flexible networks for learning physical dynamics of
deformable objects. CoRR, abs/2112.03728, 2021. URL https://arxiv.org/abs/2112.
03728.
Tobias Pfaff, Meire Fortunato, Alvaro Sanchez-Gonzalez, and Peter W. Battaglia. Learning mesh-
based simulation with graph networks. In International Conference on Learning Representations,
2021. URL https://arxiv.org/abs/2010.03409.
Athanasios S Polydoros and Lazaros Nalpantidis. Survey of model-based reinforcement learning:
Applications on robotics. Journal of Intelligent & Robotic Systems, 86(2):153–173, 2017.
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature
learning on point sets in a metric space. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach,
R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing
Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.
cc/paper/2017/file/d8bf84be3800d12f74d8b05e9b89836f-Paper.pdf.
Singiresu S Rao. The finite element method in engineering. Butterworth-heinemann, 2017.
Junuthula Narasimha Reddy. Introduction to the finite element method. McGraw-Hill Education,
2019.
Lovely Sabat and Chinmay Kumar Kundu. History of finite element method: a review. Recent
Developments in Sustainable Infrastructure, pp. 395–404, 2021.
Jose Sanchez, Juan Antonio Corrales Ramon, B. Chedli BOUZGARROU, and Y. Mezouar.
Robotic manipulation and sensing of deformable objects in domestic and industrial applica-
tions: A survey. The International Journal of Robotics Research, 37:688 – 716, 06 2018. doi:
10.1177/0278364918779698.
Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller,
Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference
and control. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International
Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research,
pp. 4470–4479. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr.press/v80/
sanchez-gonzalez18a.html.
Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter
Battaglia. Learning to simulate complex physics with graph networks. In Proceedings of the 37th
International Conference on Machine Learning, pp. 8459–8468. PMLR, 2020.
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, 2009. doi:
10.1109/TNN.2008.2005605.
Max Schwenzer, Muzaffer Ay, Thomas Bergs, and Dirk Abel. Review on model predictive control:
An engineering perspective. The International Journal of Advanced Manufacturing Technology,
117(5):1327–1349, 2021.
13
Published as a conference paper at ICLR 2023
Nicolas Soro, Laurence Brassart, Yunhui Chen, Martin Veidt, Hooyar Attar, and Matthew S Dargusch.
Finite element analysis of porous commercially pure titanium for biomedical implant application.
Materials Science and Engineering: A, 725:43–50, 2018.
Eva Stanova, Gabriel Fedorko, Stanislav Kmet, Vieroslav Molnar, and Michal Fabian. Finite element
analysis of spiral strands with different shapes subjected to axial loads. Advances in engineering
software, 83:45–58, 2015.
Priya Sundaresan, Jennifer Grannen, Brijen Thananjeyan, Ashwin Balakrishna, Michael Laskey,
Kevin Stone, Joseph E. Gonzalez, and Ken Goldberg. Learning rope manipulation policies using
dense object descriptors trained on synthetic depth data. In 2020 IEEE International Conference on
Robotics and Automation (ICRA), pp. 9411–9418, 2020. doi: 10.1109/ICRA40945.2020.9197121.
Priya Sundaresan, Rika Antonova, and Jeannette Bohg. Diffcloud: Real-to-sim from point clouds with
differentiable simulation and rendering of deformable objects. CoRR, abs/2204.03139, 2022. doi:
10.48550/arXiv.2204.03139. URL https://doi.org/10.48550/arXiv.2204.03139.
Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating eulerian
fluid simulation with convolutional networks. In Proceedings of the 34th International Conference
on Machine Learning - Volume 70, ICML'17, pp. 3424–3433. JMLR.org, 2017.
Kiwon Um, Xiangyu Hu, and Nils Thuerey. Liquid splash modeling with neural networks. Computer
Graphics Forum, 37(8):171–182, 2018. doi: https://doi.org/10.1111/cgf.13522. URL https:
//onlinelibrary.wiley.com/doi/abs/10.1111/cgf.13522.
Benjamin Ummenhofer, Lukas Prantl, Nils Thuerey, and Vladlen Koltun. Lagrangian fluid simulation
with continuous convolutions. In International Conference on Learning Representations, 2020.
URL https://openreview.net/forum?id=B1lDoJSYDH.
RC Van Staden, Hong Guan, and Yew-Chaye Loo. Application of the finite element method in dental
implant research. Computer methods in biomechanics and biomedical engineering, 9(4):257–270,
2006.
Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E. Sarma, Michael M. Bronstein, and Justin M. Solomon.
Dynamic graph cnn for learning on point clouds. ACM Trans. Graph., 38(5), oct 2019. ISSN
0730-0301. doi: 10.1145/3326362. URL https://doi.org/10.1145/3326362.
Nicholas Watters, Daniel Zoran, Theophane Weber, Peter Battaglia, Razvan Pascanu, and An-
drea Tacchetti. Visual interaction networks: Learning a physics simulator from video.
In
I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Gar-
nett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Asso-
ciates, Inc., 2017. URL https://proceedings.neurips.cc/paper/2017/file/
8cbd005a556ccd4211ce43f309bc0eac-Paper.pdf.
Zehang Weng, Fabian Paus, Anastasiia Varava, Hang Yin, Tamim Asfour, and Danica Kragic. Graph-
based task-specific prediction models for interactions between deformable and rigid objects. In
2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 5741–
5748, 2021. doi: 10.1109/IROS51168.2021.9636660. URL https://arxiv.org/abs/
2103.02932.
Steffen Wiewel, Moritz Becher, and Nils Thuerey. Latent Space Physics: Towards Learning the
Temporal Evolution of Fluid Flow. Computer Graphics Forum, 2019. ISSN 1467-8659. doi:
10.1111/cgf.13620.
Yilin Wu, Wilson Yan, Thanard Kurutach, Lerrel Pinto, and Pieter Abbeel. Learning to Manipulate
Deformable Objects without Demonstrations. In Proceedings of Robotics: Science and Systems,
Corvalis, Oregon, USA, July 2020a. doi: 10.15607/RSS.2020.XVI.065.
Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A
comprehensive survey on graph neural networks. IEEE transactions on neural networks and
learning systems, 32(1):4–24, 2020b.
14
Published as a conference paper at ICLR 2023
Longying Xiao, Gianluca Fiandaca, Bo Zhang, Esben Auken, and Anders Vest Christiansen. Fast
2.5 d and 3d inversion of transient electromagnetic surveys using the octree-based finite-element
method. Geophysics, 87(4):E267–E277, 2022.
You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. tempoGAN: A Temporally Coherent, Volu-
metric GAN for Super-resolution Fluid Flow. ACM Transactions on Graphics (TOG), 37(4):95,
2018.
Mohd Hafiz Zawawi, A Saleha, A Salwa, NH Hassan, Nazirul Mubin Zahari, Mohd Zakwan Ramli,
and Zakaria Che Muda. A review: Fundamentals of computational fluid dynamics (cfd). In AIP
conference proceedings, pp. 020252. AIP Publishing LLC, 2018.
Yao Zhang, Woong Je Sung, and Dimitri N. Mavris. Application of convolutional neural network to
predict airfoil lift coefficient. In 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and
Materials Conference, 2018. doi: 10.2514/6.2018-1903. URL https://arc.aiaa.org/
doi/abs/10.2514/6.2018-1903.
Qian-Yi Zhou, Jaesik Park, and Vladlen Koltun. Open3d: A modern library for 3d data processing.
CoRR, abs/1801.09847, 2018. URL http://arxiv.org/abs/1801.09847.
Olek C Zienkiewicz and Robert Leroy Taylor. The finite element method for solid and structural
mechanics. Elsevier, 2005.
15
Published as a conference paper at ICLR 2023
Figure 7: A detailed view of the GNN part of GGNS . Given a graph G(cid:48), the node and edge features
XV(cid:48) and XE(cid:48) are linearly embedded into a latent space and then updated with L Message Passing
Blocks. The resulting predictions are interpreted as dynamic quantities that are used to update the
system.
A MODEL DETAILS
The Message Passing Network employed by GGNS is displayed in 7. As node-wise predictions we
use velocities, which are Euler-integrated once to update the positions of the mesh of the deformable
object.
B ENVIRONMENT DETAILS
Here, we describe all key aspects, which are valid for all three environments. All datasets are
simulated using SOFA and include different material properties. Therefore, we choose discrete
Poisson's ratios from ν ∈ {−0.9, 0.0, 0.49} for one-third of all simulated trajectories each. Other
material parameters are kept constant, e.g., for the mass we choose large values for the solid object
and smaller values for the deformable to ensure sufficient deformation. The chosen parameters do
not represent the full reality, as there are other material parameters that could be varied. However, as
we want to showcase the capabilities of our method, we selected these parameters as they displayed
the biggest impact on the deformation behavior.
B.1 POINT CLOUD GENERATION
The required point clouds are not directly available in SOFA, but instead rendered from the scene of
the meshes using Raycasting from Open3D (Zhou et al., 2018). We therefore place virtual cameras
around and on top of the scene to generate partial point clouds from different directions. For the
Deformable Plate dataset one camera is sufficient, while the other two tasks rely on four cameras
around and one camera on top of the scene. This results in a good, but not complete coverage of the
entire surface with points of the point cloud. Even though there are five cameras around the scene,
there are areas that are not covered: For the tissue, the parts that are occluded by the red liver, and
for the cavity, parts of the inner surface depending on how the upper and lower radii deviates from
one another. Also, as there can be no camera from below, there are naturally no points on the lower
surface for both datasets. In Appendix D we additionally provide results for less cameras on the
cavity dataset, leading to only partially observable point clouds. If more than one point cloud camera
is used, the resulting point clouds are fused and subsampled accordingly to achieve a processable
number of points. We voxel subsample in world space, so the points do not belong to any specific
part of the mesh, but can rather be seen as some "interpolation" between mesh vertexes. The main
challenge is that there are no point correspondences and that the model needs to figure out which
point of the point cloud belongs to which vertex in the mesh to do the correction of the mesh nodes
for grounding the simulation. Still, voxel subsampling leads to the most structured results compared
to other subsampling techniques, which helps the model to account for correspondences between
points over time.
16
Message Passing NetworkMessage Passing Stack (Lx)DecoderEncoderLinear Node EmbeddingLinear Edge EmbeddingMessagePassing BlockNode-wise PredictionEuler IntegrationMessagePassing BlockMessagePassing BlockPublished as a conference paper at ICLR 2023
B.2
INPUT FEATURES
In addition to encoding the node or edge type as one-hot features, we add an encoding to static nodes
and encode the velocity of the collider in its node features. We encode the positions in space as
relative features in the edges instead of absolute encodings in the node features following previous
work (Sanchez-Gonzalez et al., 2020). All edges thus receive their relative world coordinates, while
mesh edges additionally contain relative coordinates in mesh space.
B.3 COLLISION HANDLING
SOFA as the ground truth simulator handles collision between objects using triangular surface meshes
of all objects involved to detect collisions. The detection is implemented using the LocalMinDistance
method and detected collisions are included in the constraints of the system. Using Lagrangian
multipliers, the constraints are then processed together with the other forces from the deformation to
solve the complete FEM system (Faure et al., 2012). In contrast to that, GGNS uses one-hot encoded
edges between the rigid and the soft body that are used by the model to compute the dynamics.
There is no explicit handling of collisions, the network learns to avoid them and adapts the mesh
accordingly.
B.4 DEFORMABLE PLATE
For this environment, we simulate a family of 2-dimensional trapezoids deformed by a circular
collider with constant velocity. We vary the size of the collider by sampling from a triangular
distribution between 15 and 60 % of the edge length of the deformable object. For the collider start
position we sample from a uniform distribution between the left and right corner of deformable object.
We record 50 time steps per trajectory and 945 trajectories in total, which are split in 675/135/135
trajectories per train, evaluation and test set. A single data sample contains approx. 700 nodes: 57
nodes for the collider, 81 nodes for the mesh oft the deformable object and around 600 points in the
subsampled point cloud. The mesh itself consists of 416 edges, the total number of edges is about 3
K depending on the deformation in the according time step. In contrast to the Poisson's ratio, the
other adjustable material parameter in SOFA, the Young's modulus is kept constant for all samples
at E = 5 000Pa. It describes the compressive stiffness when a force is applied lengthwise. The
different material properties together with the different trapezoidal shapes introduce uncertainty in
the form of multi-modality into the data. The reason for this is that different deformations result
in states that cannot be clearly assigned to a single trapez-material combination. We construct this
dataset because it comes with lower computational cost due to the restriction to 2d, but already allows
for more general statements due to the non-trivial deformations and the multi-modality. Therefore, it
is especially suitable as a proof-of-concept and for ablations.
B.5 TISSUE MANIPULATION
Here, a piece of tissue is deformed by a rigid gripper which could be part of a robot-assisted surgery
scenario. To generate diversity, we generate random motions in a 2d plane and sample a random
gripping point from the 19 top mesh points. We record 100 time steps per trajectory and 840
trajectories in total, which we split in 600/120/120 trajectories per train, evaluation and test set. A
single data sample consists of approx. 1 200 nodes: 361 for the mesh, one for the gripper and about
850 for the point cloud. The mesh consists of 2 154 edges, which leads to a total number of about
3 800 edges depending on the time step. To ensure physically plausible deformation, each Poisson's
ratio is assigned its specific Young's modulus from E ∈ {10 000, 80 000, 30 000}Pa. If instead it
were kept the same for each Poisson's ratio, the gripper could penetrate the deformable object or pull
it without touching it. The uncertainty in this dataset is mainly in the initial state, which can result in
different deformations depending on the material from the same initial state.
B.6 CAVITY GRASPING
We randomly generate cone-shaped cavities with radii between 87.5% and 50% of the maximum
possible gripping width. The cone shape helps to increase uncertainty in the form of multi-modality
in the data, because the states resulting from deformation cannot be clearly assigned to a single
17
Published as a conference paper at ICLR 2023
cone-material combination. The deformable cavities are deformed by a gripper located at random
positions in space. The positions are sampled form a hexahedron around the geometrical center of
the cavity ensuring collision free starting positions. For the grasping, the gripper moves as quickly as
it is allowed to the gripping position and then closes its fingers with constant velocity. We record 100
time steps per trajectory and 840 trajectories in total, which are split in 600/120/120 trajectories per
train, evaluation and test set. A single data sample consists of approx. 2.4 K nodes: 750 for the mesh,
636 for the gripper and about 1 K for the point cloud. The mesh consists of 4 500 edges, the overall
number of edges in the graph is about 8.5 K depending on the exact time step. The motivation for the
creation of this environment is that a successful use of our method in this setting is an important step
on the way to a real-world application.
18
Published as a conference paper at ICLR 2023
Figure 8: Visualization of a test trajectory in the Tissue Manipulation dataset from three different
viewing angles (rows) at time step t = 70 for GGNS (left), the ground truth simulation (middle) and
MGN (right).
C QUALITATIVE RESULTS
In addition to the qualitative illustrations in the main paper, we also provide further views and
examples here: Figure 8 shows the same trajectory as Figure 4 but from three additional viewing
angles. Figure 9 and Figure 10 show an overlay of the point cloud on the deformable object during
the time step where the simulation is grounded by the point cloud. This representation is comparable
to Figure 1 for the Cavity Grasping dataset. Furthermore, we provide example visualizations for a
test rollout over time for the Deformable Plate task in Figure 11, for the Tissue Manipulation task in
Figure 12, and for the Cavity Grasping in Figure 13. Throughout all tasks, GGNS closely matches the
ground truth simulation for the complete rollout, achieving close to optimal results when provided
with frequent point cloud information (k = 2). Opposed to this, MGN sometimes fails to predict the
correct material, leading to poor predictions over time and large mismatches in the final system states.
19
Published as a conference paper at ICLR 2023
Figure 9: Overlay of the point cloud and the predicted mesh for two consecutive time steps t = [10, 11]
in the Deformable Plate dataset. We repeat the point cloud from the earlier simulation step in both
images for clarity. The illustration shows the correction behavior of GGNS by including the point
cloud to ground the mesh based simulation in this time step. This can be observed particularly well
in the upper left and right corners of the plate.
Figure 10: Overlay of the point cloud and the predicted mesh for two consecutive time steps
t = [70, 71] in the Tissue Manipulation dataset. We repeat the point cloud from the earlier simulation
step in both images for clarity. The illustration shows the correction behavior of GGNS by including
the point cloud to ground the mesh based simulation in the time step.
20
Published as a conference paper at ICLR 2023
Figure 11: Test rollout visualization for the Deformable Plate task. The last column depicts a close-up
of the final time step, which is shown in full in the previous column. Here, we additionally show
qualitative results for the GGNS+LSTM model. We can see that for k = 2 it matches the ground
truth quite well, while for k = 5 a large error occurs due to a prediction of the wrong material.
21
Published as a conference paper at ICLR 2023
Figure 12: Test rollout visualization for the Tissue Manipulation task. The last column depicts a
close-up of the final time step, which is shown in full in the previous column.
Figure 13: Test rollout visualization for the Cavity Grasping task. The last column depicts a close-up
of the final time step, which is shown in full in the previous column.
22
Published as a conference paper at ICLR 2023
Figure 14: Performance for different changes in hyperparameter choices (grey) on the Deformable
Plate dataset in comparison to our default model (blue) with k = 1. Error bars indicate one standard
deviation. The top row shows the error for the next-step prediction, the bottom row that of full rollouts.
We find that a suitable noise scale is crucial for stable rollouts, and that more information in the
form of additional edges between the different types of graph nodes generally improves performance.
Given enough Message Passing (MP) blocks, further increases in model capacity only lead to modest
improvements.
D ABLATIONS
D.1 HYPERPARAMETER CHOICES
Figure 14 compares the performance of GGNS for different hyperparameter choices. We find that the
most importance parameters are the number of Message Passing (MP) blocks and the scale of the
noise used in training. Both are crucial to achieve a good performance over multi-step rollouts. In
terms of training noise, there is a 1-step/multi-step loss trade-off. Other than that, our approach is
robust to variations of the different hyperparameters. In terms of graph connectivity, it can be seen
that all settings achieve similar performance. Additional information in the form of more local edges
helps slightly, while larger connectivity radii do not do much. A detailed listing of the used edge radii
is display in Table 2. In particular, the use of significantly more edges in the Equal Radii setting does
not provide a significant advantage, which is why we use weaker connectivity Full Graph that saves
computation time. The results for the Reduced Graph settings show that edges within the point cloud
are not mandatory. For this reason, we omit these edges in the more complex 3d tasks in favor of
shorter computation time.
D.2 NOISY POINT CLOUDS
Besides the ablations on our hyperparameter choices, we present further ablations on more realistic
point cloud data. For this purpose, we use point clouds with additional noise and only partial
observability to get closer to real world point clouds. Figure 15 shows the results for additional
ablations on different scales of noise on the point cloud data of the Deformable Plate dataset. We
add noise to the point cloud positions during training, evaluation and testing. This makes it more
difficult to infer the correct behavior from the point cloud, but provides a more realistic scenario for,
because real world point clouds often exhibit large noise. The results show the robustness of our
23
1071061051-step MSELatent Sizea# MLP Layersb# MP BlockscNoise StddGraph Connectivitye6412825610610510410310250-step Rollout MSEf123g1357h0.00.0010.010.1iFullGraphEqualRadiiReducedGraphjPublished as a conference paper at ICLR 2023
r
o
r
r
E
d
e
r
a
u
q
S
n
a
e
M
10−2
10−3
10−4
10−5
10−6
10−2
10−3
10−4
10−5
10−6
10−2
10−3
10−4
10−5
10−6
0.0
0.001 0.005 0.01 MGN
(M)
Noise Std
MGN
0.0
0.001 0.005 0.01 MGN
(M)
Noise Std
MGN
0.0
0.001 0.005 0.01 MGN
(M)
Noise Std
MGN
(a) k = 1
(b) k = 2
(c) k = 5
Figure 15: Additional ablations for more realistic point cloud data on two datasets. Here, four
different noise levels on the point cloud are evaluated on the Deformable Plate datset. Different
grounding frequencies of k = 1 in (a), k = 2 in (b) and k = 5 in (c). GGNS performs better than the
baseline even when noise in the scale of the training noise of σ = 0.01 is applied to the point cloud.
method: Even when a noise level of σ = 0.01 is applied to the point cloud during testing, it clearly
outperforms the baseline. This noise level corresponds to the amount of noise used on the mesh
during training.
D.3 PARTIAL OBSERVABLE POINT CLOUDS
For the ablations on the partial observability, we use the Cavity Grasping dataset. We generate the
partial point clouds by using only one, two or five virtual point cloud cameras when using raycasting.
The resulting point clouds are visualized for better clarity in Figure 17 for an example test trajectory
at time step t = 0. One camera results in a coverage from only one half of the outer surface of the
cavity and two cameras cover almost the complete outer hull but not the inner surface. With five
cameras, the point cloud covers almost the entire mesh completely, except for the inside and bottom.
The resulting point clouds have a very different number of points: About 400 for one camera, about
600 for two cameras, and about 1000 for five cameras compared to 750 mesh nodes for the cavity.
The results in Figure 16 show that even with these much less complete point clouds, GGNS still
outperforms the baseline. For k ≤ 5 this is the case even if the baseline has access to the full initial
state, which GGNS has not.
24
Published as a conference paper at ICLR 2023
10−3
10−4
10−5
10−6
r
o
r
r
E
d
e
r
a
u
q
S
n
a
e
M
10−3
10−4
10−5
10−6
10−3
10−4
10−5
10−6
1
2
# of Cameras
5
MGN
(M)
MGN
1
2
# of Cameras
5
MGN
(M)
MGN
1
2
# of Cameras
5
MGN
(M)
MGN
(a) k = 2
(b) k = 5
(c) k = 10
Figure 16: Additional ablations for more realistic point cloud data on the Cavity Grasping dataset. For
this purpose, different numbers of cameras are used when generating the point cloud using raycasting.
Comparison for three different grounding frequencies:k = 2 in (a), k = 5 in (b) and k = 10 in (c).
GGNS outperforms the baseline for all camera settings and grounding frequencies k.
Figure 17: Visualization of the point clouds using one, two or five cameras for the raycasting and the
corresponding mesh for reference. It is clearly visible how better coverage of the object is achieved
as the number of cameras increases.
Table 2: Edge radii for the connectivities between point clouds P and meshes M on the 2D
Deformable Plate Dataset.
Setting
P − P M − P World
Full Graph
Equal Radii
Reduced Graph
MGN
0.1
0.2
0.0
0.0
0.08
0.2
0.08
0.0
-
-
-
0.35
25
Published as a conference paper at ICLR 2023
n
o
i
n
U
r
e
v
o
n
o
i
t
c
e
s
r
e
t
n
I
1
0.95
0.9
0.85
0.8
n
o
i
n
U
r
e
v
o
n
o
i
t
c
e
s
r
e
t
n
I
1
0.95
0.9
0.85
0.8
GGNS
MGN
(mat)
MGN
GGNS
MGN
(mat)
MGN
(a) m + 10-step IoU Evaluation
(b) m + 10-step IoU Evaluation without initial mesh
Figure 18: (a) Comparison of our model to the baseline results on the Plate cataset using the m + 10-
step Evaluation routine. (b) Results when using an initial mesh generated from the point cloud.
GGNS outperforms the MGN baseline even if it has access to the initial ground truth mesh.
10−5
r
o
r
r
E
d
e
r
a
u
q
S
n
a
e
M
p
e
t
s
-
1
10−6
0
GGNS
GGNS (k=2)
GGNS (k=5)
MGN(M)
MGN
10−5
10−6
r
o
r
r
E
d
e
r
a
u
q
S
n
a
e
M
p
e
t
s
-
1
10−2
10−3
10−4
r
o
r
r
E
d
e
r
a
u
q
S
n
a
e
M
p
e
t
s
-
0
0
1
100
200
Epochs
(a) Train loss
300
400
10−7
0
100
200
Epochs
300
400
10−5
0
100
200
Epochs
300
400
(b) 1-step Evaluation Loss
(c) 100-step Evaluation Loss
Figure 19: Exemplary learning curves for the Cavity Grasping task. The light shaded area indicates
one standard deviation. Both GGNS and the baselines learn the task pretty similarly in terms of
1-step predictions. Our model is only evaluated for the k = 2 and k = 5 variant during full rollout
evaluation. Here, we can clearly see the advantage of using the point cloud information.
r
o
r
r
E
d
e
r
a
u
q
S
n
a
e
M
t
u
o
l
l
o
R
10−2
10−3
10−4
10−5
10−6
MGN(1H) MGN MGN(1H) MGN MGN(1H) MGN
Tissue
Cavity
Plate
Figure 20: Comparison of the MGN baseline with a version using the one-hot encoded edge types
instead of an explicit edge type partitioning indicated by MGN (1H). Both are compared for all
three tasks and no significant advantage of the explicit edges partitioning could be found. For this
reason, GGNS uses the one-hot encoding, because it is both conceptually simpler and requires less
computational power. The MGN baseline still uses explicit edge type partitioning throughout this
work, following Pfaff et al. (2021).
26
Published as a conference paper at ICLR 2023
Table 3: Configuration of the hyperparameters and key information of the training of our model for
all experiments.
Parameter
Value
32
Adam
5 × 10−4
LeakyReLU
Batch Size
Optimizer
Learning Rate
Activation Function
Aggregation Function Mean
Encoder
MP-Blocks
MLP Layers
Latent Dimension
Decoder
Residuals Connections Around each MP block
Training Noise Std
Linear Layer
5
1
128
1-layer MLP
0.01
Table 4: Task specific configuration and hyperparameters for our experiments. We vary the graph
connectivity and the number of training epochs for different tasks to control the total training time of
our method.
Parameter
Plate
Tissue
Cavity
Connectivity Setting
Number of Epochs
Approx. Training Time
Full Graph Reduced
1000
21 : 00 h
800
40 : 00 h
Reduced
400
38 : 00 h
E HYPERPARAMETERS
Table 3 gives an overview of hyperparameters shared across tasks. Since GNS are generally robust
to the choice of hyperparameters (c.f. D), we use the same hyperparameters for all task and for
both, GGNS and MGN for simplicity. The only hyperparameters that vary over tasks are the graph
connectivity and the number of training epochs, as shown in Table 4. We adapt these parameters to
control for the total training time on a single GPU.
27
|
|
http://arxiv.org/abs/2302.11861v2 | 2023-06-27T00:19:14 | 2023-02-23T08:59:56 | Out-of-Domain Robustness via Targeted Augmentations | Models trained on one set of domains often suffer performance drops on unseen
domains, e.g., when wildlife monitoring models are deployed in new camera
locations. In this work, we study principles for designing data augmentations
for out-of-domain (OOD) generalization. In particular, we focus on real-world
scenarios in which some domain-dependent features are robust, i.e., some
features that vary across domains are predictive OOD. For example, in the
wildlife monitoring application above, image backgrounds vary across camera
locations but indicate habitat type, which helps predict the species of
photographed animals. Motivated by theoretical analysis on a linear setting, we
propose targeted augmentations, which selectively randomize spurious
domain-dependent features while preserving robust ones. We prove that targeted
augmentations improve OOD performance, allowing models to generalize better
with fewer domains. In contrast, existing approaches such as generic
augmentations, which fail to randomize domain-dependent features, and
domain-invariant augmentations, which randomize all domain-dependent features,
both perform poorly OOD. In experiments on three real-world datasets, we show
that targeted augmentations set new states-of-the-art for OOD performance by
3.2-15.2%. | [
"Irena Gao",
"Shiori Sagawa",
"Pang Wei Koh",
"Tatsunori Hashimoto",
"Percy Liang"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.11861v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.11861v2",
"@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"
] | Out-of-Domain Robustness via Targeted Augmentations
Irena Gao * 1 Shiori Sagawa * 1 Pang Wei Koh 2 3 Tatsunori Hashimoto 1 Percy Liang 1
3
2
0
2
n
u
J
7
2
]
G
L
.
s
c
[
2
v
1
6
8
1
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
Models trained on one set of domains often suf-
fer performance drops on unseen domains, e.g.,
when wildlife monitoring models are deployed
In this work, we
in new camera locations.
study principles for designing data augmenta-
tions for out-of-domain (OOD) generalization.
In particular, we focus on real-world scenar-
ios in which some domain-dependent features
are robust, i.e., some features that vary across
domains are predictive OOD. For example, in
the wildlife monitoring application above, im-
age backgrounds vary across camera locations
but indicate habitat type, which helps predict
the species of photographed animals. Moti-
vated by theoretical analysis on a linear setting,
we propose targeted augmentations, which se-
lectively randomize spurious domain-dependent
features while preserving robust ones. We prove
that targeted augmentations improve OOD per-
formance, allowing models to generalize better
with fewer domains.
In contrast, existing ap-
proaches such as generic augmentations, which
fail
to randomize domain-dependent features,
and domain-invariant augmentations, which ran-
domize all domain-dependent features, both per-
form poorly OOD. In experiments on three real-
world datasets, we show that targeted augmen-
tations set new states-of-the-art for OOD perfor-
mance by 3.2–15.2%.
1. Introduction
Real-world machine learning systems are often deployed
on domains unseen during training. However, distribution
shifts between domains can substantially degrade model
performance. For example, in wildlife conservation, where
*Equal
contribution
of Washington
Irena Gao <[email protected]>,
<[email protected]>.
3Google Brain.
1Stanford University 2University
to:
Sagawa
Correspondence
Shiori
Proceedings of the 40 th International Conference on Machine
Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright
2023 by the author(s).
1
ecologists use machine learning to identify animals pho-
tographed by static camera traps, models suffer large per-
formance drops on cameras not included during train-
ing (Beery et al., 2018). Out-of-domain (OOD) general-
ization in such settings remains an open challenge, with
recent work showing that current methods do not perform
well (Gulrajani & Lopez-Paz, 2020; Koh et al., 2021).
One approach to improving robustness is data augmenta-
tion, but how to design augmentations for OOD robustness
remains an open question. Training with generic augmen-
tations developed for in-domain (ID) performance (e.g.,
random crops and rotations) has sometimes improved OOD
performance, but gains are often small and inconsistent
across datasets (Gulrajani & Lopez-Paz, 2020; Wiles et al.,
2021; Hendrycks et al., 2021). Other work has designed
augmentations to encourage domain invariance, but gains
can be limited, especially on real-world shifts (Yan et al.,
2020; Zhou et al., 2020a; Gulrajani & Lopez-Paz, 2020;
Ilse et al., 2021; Yao et al., 2022). Some applied works
have shown that heuristic, application-specific augmen-
tations can improve OOD performance on specific tasks
(Tellez et al., 2018; 2019; Ruifrok et al., 2001). However,
it is unclear what makes these augmentations successful or
how to generalize the approach to other OOD problems.
In this work, we study principles for designing data aug-
mentations for OOD robustness. We focus on real-world
scenarios in which there are some domain-dependent fea-
tures that are robust, i.e., where some features that vary
across domains are predictive out-of-domain. For exam-
ple, in the wildlife monitoring application above, image
backgrounds vary across cameras but also contain features
that divulge the static camera's habitat (e.g., savanna, for-
est, etc.). This information is predictive across all domains,
as wild animals only live in certain habitats; it can also be
necessary for prediction when foreground features are in-
sufficient (e.g., when animals are blurred or obscured).
How might data augmentations improve OOD robustness
in such settings? We first theoretically analyze a linear
regression setting and show that unaugmented models in-
cur high OOD risk when the OOD generalization prob-
lem is underspecified, i.e., when there are fewer training
domains than the dimensionality of the domain-dependent
features. This insight motivates targeted augmentations,
Out-of-Domain Robustness via Targeted Augmentations
which selectively randomize spurious domain-dependent
features while preserving robust ones, reducing the effec-
tive dimensionality and bringing the problem to a fully
specified regime. We prove that targeted augmentations
improve OOD risk in expectation, allowing us to generalize
with fewer domains. In contrast, existing approaches such
as generic augmentations, which fail to randomize domain-
dependent features, and domain-invariant augmentations,
which randomize all domain-dependent features, both suf-
fer high OOD risk: the former fails to address the under-
specification issue, and the latter eliminates robust domain-
dependent features that are crucial for prediction. To our
knowledge, our analysis is the first to characterize how dif-
ferent augmentation strategies affect OOD risk and its scal-
ing with the number of domains. It also introduces a natu-
ral theoretical setting for OOD generalization, in which the
distribution shift arises from sampling finite training do-
mains, departing from prior work that considers worst-case
shifts (Rosenfeld et al., 2020; Chen et al., 2021b).
Empirically, we show targeted augmentations are effec-
tive on three real-world datasets spanning biomedical and
wildlife monitoring applications: CAMELYON17-WILDS
(Bandi et al., 2018; Koh et al., 2021), IWILDCAM2020-
WILDS (Beery et al., 2021; Koh et al., 2021), and
BIRDCALLS, which we curate from ornithology datasets
(Navine et al., 2022; Hopping et al., 2022; Kahl
et al., 2022). Targeted augmentations outperform both
generic augmentations and domain invariance baselines to
achieve state-of-the-art by substantial margins: 33.3% →
36.5% on IWILDCAM2020-WILDS, 75.3% → 90.5% on
CAMELYON17-WILDS, and 31.8% → 37.8% on BIRD-
CALLS. Overall, our work derives principles for designing
data augmentations that can substantially improve out-of-
domain performance in the wild.
2. Problem setting
Domain generalization.
In domain generalization, our
goal is to generalize to domains unseen during training. In
particular, we seek a model θ ∈ Θ that minimizes the OOD
risk under a meta distribution P , where
ROOD(θ) ≜ EP [l(θ; (x, y))],
and P comprises data from all possible domains Dall:
(cid:88)
P (x, y) =
P (x, y | d)P (d),
d∈Dall
(1)
(2)
where we assume Dall is countable to keep notation simple.
To obtain training domains Dtrain ⊂ Dall, we sample D
domains without replacement from the meta distribution P .
This yields the training distribution comprising Dtrain,
(cid:88)
P (x, y | d)P train(d),
(3)
P train(x, y) =
d∈Dtrain
2
where P train(d) is the probability of drawing domain d
from the training domains Dtrain at training time. The chal-
lenge is to generalize from the sampled training domains
Dtrain to all possible domains Dall that make up the un-
derlying meta distribution. In real-world experiments and
simulations, we estimate OOD performance by evaluating
on held-out domains Dtest, where Dtest ∩ Dtrain = ∅.
Feature decomposition.
In many real-world shifts, such
as those in Section 2.1, domain-dependent features contain
predictive information that generalizes across all domains.
To capture such settings, we introduce the feature decom-
position x = f (xobj, xnoise, xd:robust, xd:spu) (Figure 1 left).
Here, features are split along two axes: whether they are
robust (i.e., predictive out-of-domain), and whether they
are domain dependent (i.e., varying across domains). We
formalize these two criteria by (in)dependence with label y
and domain d, respectively, in the meta distribution P :
xobj, xd:robust ̸⊥⊥ y
xnoise, xd:spu ⊥⊥ y
xd:robust, xd:spu ̸⊥⊥ d
xobj, xnoise ⊥⊥ d.
(4)
For example, y depends on robust features xobj and
xd:robust, but is independent of non-robust features xnoise
and xd:spu, which yields P (y | x) = P (y | xobj, xd:robust).
We note that these independencies need not hold in the
training distribution P train due to finite-domain effects; for
instance, when D is small, there may be a dependence be-
tween the label y and a spurious feature xd:spu in the train-
ing distribution P train, leading models to learn such fea-
tures and generalize poorly out-of-domain.
2.1. Real-world datasets
We study three real-world datasets (Figure 1 right), which
have both robust and spurious domain-dependent features.
classification from camera trap images
Species
(IWILDCAM2020-WILDS). In iWildCam (Beery et al.,
2021; Koh et al., 2021), the task is to classify an animal
species y from an image x captured by a static camera
trap d. There are 243 cameras in Dtrain.
Images from
the same camera share nearly identical backgrounds.
While low-level details of each domain's background are
generally spurious (e.g., whether there are two trees or
three), backgrounds also contain habitat features, which
are predictive across domains. For example, in Figure 1,
cameras 23 and 97 are installed in dry Kenyan savannas,
while camera 54 observes a leafy Guatemalan forest. The
two regions have different label distributions: in practice,
wild African elephants are very unlikely to set foot in
Guatemala. Further, habitat features are often necessary
for prediction; foregrounds are often blurry or occluded
Out-of-Domain Robustness via Targeted Augmentations
Figure 1. We model inputs as x = f (xobj, xd:robust, xd:spu, xnoise), where each of the four types of features are either (i) dependent on
the domain d or not and (ii) dependent on the output label y or not, both in the meta distribution P . We study targeted augmentations,
which randomize xd:spu but preserve xd:robust, and we consider three real-world datasets (Beery et al., 2021; Bandi et al., 2018; Koh et al.,
2021), each of which have both robust and spurious domain-dependent features.
(see Figure 8), so randomizing all domain-dependent
features discards useful information.
3. Data augmentation
in
identification
histopathology
In Camelyon17
slides
Tumor
(CAMELYON17-WILDS).
(Bandi
et al., 2018; Koh et al., 2021),
the task is to classify
whether a patch of a histopathology slide contains a tumor.
Slides are contributed by hospitals d. Variations in imag-
ing technique result in domain-specific stain colorings,
which spuriously correlate with y in the training set (see
Figure 6). Domains also vary in distributions of patient
cancer stage. In Camelyon17's 3 training hospitals, most
patients in Hospitals 1 and 2 have earlier-stage pN1 breast
cancer, whereas nearly half of the patients in Hospital 3
have later-stage pN2 stage cancer. The pN stage relates to
the size and number of lymph node metastases, which is
correlated with other histological tumor features. These
useful tumor features thus depend on both d and y.
Bird species recognition from audio recordings (BIRD-
CALLS). To monitor bird populations, ornithologists use
machine learning to identify birds by their calls in audio
recordings. However, generalizing to recordings from new
microphones can be challenging (Joly et al., 2021). We
introduce a new bird recognition dataset curated from pub-
licly released data (see Appendix A.3 for details). The task
is to identify the bird species y vocalizing in audio clip x
recorded by microphone d. There are 9 microphones in
Dtrain, which vary in their model and location. While low-
level noise and microphone settings (e.g., gain levels) only
spuriously correlate with y, other background noises indi-
cate habitat, like particular insect calls in the Amazon Basin
that are absent from other regions (Figure 1). As in iWild-
Cam, these habitat indicators reliably predict y. We train
models on mel-spectrograms of audio clips.
Augmentation types. We use the feature decomposition
from Section 2 to model three types of data augmentations.
Generic augmentations designed for in-domain settings of-
ten do not randomize domain-dependent features. For ex-
ample, horizontal flips modify object orientation; this fea-
ture varies across examples but is typically distributed sim-
ilarly across domains. We model generic augmentations as
varying xnoise, which is label- and domain-independent:
Agen(x) = f (xobj, x′
noise, xd:robust, xd:spu),
(5)
where x′
noise is drawn from some augmentation distribution.
Domain-invariant augmentations Ainv aim to randomize all
domain-dependent features xd:robust and xd:spu:
Ainv(x) = f (xobj, xnoise, x′
d:robust, x′
d:spu are drawn from some distribution.
targeted augmentations Atgt preserve xd:robust
where x′
Finally,
while aiming to randomize xd:spu:
d:robust, x′
d:spu),
(6)
Atgt(x) = f (xobj, xnoise, xd:robust, x′
d:spu),
(7)
where x′
d:spu is drawn from some distribution. Applying
generic, domain-invariant, and targeted augmentations to
the training distribution P train yields new distributions over
examples P train
, respectively. Intuitively,
tgt
when augmentations preserve labels, they break any depen-
dence between the randomized features and the label y.
gen , P train
, and P train
inv
Training. Given N training examples {(x(i), y(i))}N
i=1
drawn from P train, we learn a model that minimizes the
average loss on the (augmented) training data:
ˆθ(unaug) = arg min
θ
E ˆP train [l(θ; (x, y))]
ˆθ(aug) = arg min
θ
E ˆP train
aug
[l(θ; (x, y))] ,
(8)
(9)
3
iWildCam2020-WILDS (D=243 cameras) Camelyon17-WILDS (D=3 hospitals) BirdCalls (D=9 microphones) animal foreground cell morphology bird calls low-level background features stain color microphone gain settings, low-level noise habitat features in background cancer stage, tumor size and density habitat noise (other fauna, rain levels) xy-position patch orientation, cell xy-positions x-position Copy-Paste (Same Y) Stain Color Jitter (Tellez et al., 2018) Copy-Paste + Jitter (Region)TARGETED AUGMENTATIONdependent on labelindependent of domaindependent on domainindependent of labelOut-of-Domain Robustness via Targeted Augmentations
Figure 2. Augmentation examples for the three real-world datasets, including targeted augmentations Copy-Paste (Same Y) for iWild-
Cam, Stain Color Jitter for Camelyon17, and Copy-Paste + Jitter (Region) for BirdCalls. Targeted augmentations randomize xd:spu but
preserve xd:robust. In Section 5.1, we compare to modified Copy-Paste augmentations in the ablation column.
where ˆP train and ˆP train
aug are the empirical distributions over
the unaugmented and augmented training data, respec-
tively. The superscript aug can stand for gen, inv, or tgt.
3.1. Targeted augmentations for real-world datasets
to paste bird calls onto other training set recordings from
the same geographic region (Southwestern Amazon Basin,
Hawaii, or Northeastern United States) (Figure 2). After
pasting the bird call, we also jitter hue levels of the spectro-
gram to simulate randomizing microphone gain settings.
We instantiate targeted augmentations on real-world
datasets from Section 2.1. Full details are in Appendix B.
4. Analysis and simulations
Species
classification from camera trap images
(IWILDCAM2020-WILDS). In iWildCam, image back-
grounds are domain-dependent features with both spurious
and robust components. While low-level background fea-
tures are spurious, habitat features are robust. Copy-Paste
(Same Y) transforms input (x, y) by pasting the animal
foreground onto a random training set background-but
only onto backgrounds from training cameras that also
observe y (Figure 2). This randomizes low-level back-
ground features while roughly preserving habitat. We use
segmentation masks from Beery et al. (2021).
identification
histopathology
Tumor
slides
in
(CAMELYON17-WILDS). In Camelyon17, stain color is
a spurious domain-dependent feature, while stage-related
Stain
features are robust domain-dependent features.
Color Jitter (Tellez et al., 2018) transforms x by jittering
its color in the hematoxylin and eosin staining color space
(Figure 2).
In contrast, domain-invariant augmentations
can distort cell morphology to attain invariance.
Bird species recognition from audio recordings (BIRD-
CALLS). In BirdCalls, low-level noise and gain levels are
spurious domain-dependent features, while habitat-specific
noise is a robust domain-dependent feature. Copy-Paste
+ Jitter (Region) leverages time-frequency bounding boxes
4
We now motivate targeted augmentations and illustrate the
shortcomings of generic and domain-invariant augmenta-
tions by analyzing a linear setting extended from Section 2.
To our knowledge, our analysis is the first to character-
ize how different augmentation strategies affect OOD risk
and its scaling with the number of domains. It also pro-
poses a natural theoretical setting for OOD generalization,
in which the distribution shift arises from finite-domain ef-
fects, departing from prior work that considers worst-case
shifts (Rosenfeld et al., 2020; Chen et al., 2021b).
4.1. Linear regression setting
Data distribution. We model each domain d as hav-
ing latent attributes μ(d) ≜ [μ(d)
spu], which affect the
distribution of the corresponding domain-dependent fea-
tures xd:robust, xd:spu. In iWildCam, μ(d)
robust intuitively cor-
responds to a habitat indicator and label prior. In the linear
setting, these domain attributes are drawn as
robust, μ(d)
μ(d)
robust ∼ N (0, τ 2I)
spu ∼ N (0, τ 2I).
μ(d)
(10)
The dimensionality of μ(d)
is pdom, and the dimen-
sionality of μ(d)
Following the feature
decomposition in Figure 1, we consider inputs x =
[xobj, xnoise, xd:robust, xd:spu]. The training data is drawn
is probust.
robust
iWildCamCamelyonBirdCallsOriginal ImageGeneric AugmentationsDesigned for in-distribution performance, often only randomize RandAugment MixUp CutMix Cutout RandAugment MixUp CutMix Cutout SpecAugment MixUp Noise Reduction Random PassLISADesigned for domain invarianceTargeted AugmentationRandomize , preserve AblationRandomize andOut-of-Domain Robustness via Targeted Augmentations
uniformly from D training domains. Within each domain,
inputs x are drawn according to the following distribution:
xobj ∼ N (0, I)
xnoise ∼ N (0, I)
robust, σ2I)
spu, σ2I).
xd:robust|d ∼ N (μ(d)
xd:spu|d ∼ N (μ(d)
(11)
The domain-dependent features xd:robust and xd:spu are cen-
tered around the corresponding domain attributes μ(d)
robust
and μ(d)
spu, while the domain-independent features xobj and
xnoise are not. We define the variance ratio γ2 ≜ τ 2/σ2,
which is the ratio of variances in μ(d) and feature noise.
When γ2 > 1, examples within a domain tend to be more
similar to each other than to examples from other domains;
we consider the typical setting in which γ2 > 1.
The output y ∈ R is a linear function of both xobj and
robust domain attribute μ(d)
robust:
y = β⊤
objxobj + β⊤
robustμ(d)
robust + N (0, σ2
ε ).
(12)
For convenience, we define the parameters for domain-
dependent components as βdom ≜ [βrobust, βspu] where
βspu = 0. Although y depends on the domain attributes
μ(d), models cannot directly observe μ(d), and instead
only observe the noised features xd:robust, xd:spu. Because
there are finite domains in the training distribution, μ(d)
robust
and μ(d)
robust not only
from xd:robust, but also from xd:spu by memorizing the
(μ(d)
spu) pairings. The fewer domains present dur-
ing training, the simpler memorization is for the model,
as there are fewer (μ(d)
spu) pairings. However, since
μ(d)
robust and μ(d)
spu are independent in the true data generating
process, relying on xd:spu does not generalize OOD.
spu are coupled: models can infer μ(d)
robust, μ(d)
robust, μ(d)
Augmentations.
Recall from Section 3 that generic,
domain-invariant, and targeted augmentations replace com-
ponents of x with draws from an augmentation distribution.
We preserve y when augmenting and fix the augmentation
distributions to match the data generating distribution:
x′
noise ∼ N (0, I)
d:robust ∼ N (0, (σ2 + τ 2)I)
x′
d:spu ∼ N (0, (σ2 + τ 2)I).
x′
(13)
Models. We study linear models, specifically ordinary
least squares linear regression in theoretical analysis (Sec-
tion 4.2) and ridge regression in simulations (Section 4.3).
problem is underspecified (Theorem 1), i.e., when there
are fewer training domains than the dimensionality of the
domain-dependent features, as is typically the case in real-
world domain generalization problems. This motivates
targeted augmentations; by eliminating spurious domain-
dependent features, targeted augmentations bring the prob-
lem to a fully specified regime. We prove that targeted aug-
mentations improve OOD risk in expectation (Theorems 2
and 3), whereas generic and domain-invariant augmenta-
tions incur high OOD risk (Corollary 1 and Theorem 3).
Our analysis assumes infinite data per domain, but finite
training domains. This allows us to focus on the effects of
OOD generalization while simplifying traditional sample
complexity issues, which are better understood.
Overview.
We study the expected excess OOD
risk E (cid:2)ROOD(θ) − ROOD(θ∗)(cid:3), where the expectation is
over random draws of training domains, and θ∗ ≜
arg minθ ROOD(θ) is the oracle model that attains opti-
mal performance on the meta distribution P . To show that
targeted augmentations improve the expected OOD risk,
we lower bound the expected excess risk for unaugmented
models, upper bound it for models with targeted augmenta-
tions, and then demonstrate a gap between the two bounds.
Proofs are in Appendix C.
Lower bound for excess OOD risk with no or generic
augmentations. When the number of domains is smaller
than the dimensionality of the domain-dependent features
(D < pdom), unaugmented models perform poorly OOD.
Theorem 1 (Excess OOD risk without augmentations). If
D < pdom, the expected excess OOD risk of the unaug-
mented model is bounded below as
(cid:104)
ROOD(ˆθ(unaug)) − ROOD(θ∗)
(cid:105)
E
≥
τ 2γ2 ∥βrobust∥2
1 + γ2
(cid:18)
1 −
(cid:19)
.
D
pdom
(cid:80)D
Proof sketch. The learned estimator has weights ˆθ(unaug)
dom =
(σ2I + M )−1M βdom, where M ≜ 1
d=1 μ(d)μ(d)⊤ is
D
a random Wishart matrix. As we only observe D < pdom
training domains, M is not full rank, with nullity pdom −D.
We lower bound the overall excess risk by the excess risk
incurred in the null space of M , which can be written as
τ 2γ2
i βdom)2; each ui is an eigenvector with a
1+γ2
zero eigenvalue and the summation term is thus the squared
norm of a projection of βdom onto the null space of M . In
expectation, the squared norm is ||βdom||2(1 − D
) be-
pdom
cause M has spherically symmetric eigenvectors. Finally,
∥βdom∥ = ∥βrobust∥ because βspu = 0.
(cid:80)pdom−D
i=1
(u⊤
4.2. Theory
In this section, we first show that unaugmented models
fail to generalize OOD when the domain generalization
To contextualize the bound, we discuss the relative scale of
the excess OOD risk with respect to the OOD risk of the
oracle model ROOD(θ∗) = σ2
ε + τ 2∥βrobust∥2/(1 + γ2),
where the first term is the irreducible error from noise in
5
Out-of-Domain Robustness via Targeted Augmentations
the output y. The excess error of the unaugmented model is
higher than the second term by a factor of γ2(1 − D/pdom),
where γ2 > 1 is the variance ratio and D is the number of
domains. Thus, in typical settings where D is small relative
to pdom and the variance ratio γ2 is large, unaugmented
models suffer substantial OOD error.
Models trained with generic augmentations have the same
lower bound (Corollary 1 in Appendix C.4), as applying
generic augmentations results in the same model as unaug-
mented training in the infinite data setting. Our analysis
captures the shortcomings of generic augmentations, which
primarily improve sample complexity; as evident in the
high OOD risk even in the infinite data setting, improving
sample complexity alone fails to achieve OOD robustness.
Motivating targeted augmentations. The core problem
above is underspecification, in which the number of do-
mains is smaller than the dimensionality of the domain-
dependent features (D < pdom); there are fewer instances
of μ(d) than its dimensionality (although E[xx⊤] is full rank
due to feature noise). In such regimes, it is not possible to
approximate βdom well, and models incur high OOD risk.
We can mitigate this via targeted augmentations, which
randomizes the spurious domain-dependent feature. This
decreases the effective dimensionality from pdom to probust,
the dimensionality of only the robust components, as mod-
els would no longer use the spurious feature.
Upper bound for excess OOD risk with targeted aug-
mentations. With targeted augmentations, the problem
(even without feature noise) is no longer underspecified
when the number of training domains D is large enough
relative to probust < pdom. In this fully specified regime,
we can upper bound the expected excess OOD risk as
O(log D/D). This resembles the standard rates for ran-
dom design linear regression up to a log factor (Hsu et al.,
2011; Gy ̈orfi et al., 2002); standard analysis shows that ex-
cess ID risk has a O(1/N ) convergence rate where N is the
number of samples, and we show that excess OOD risk has
an analogous convergence rate as a function of the number
of domains instead of examples.
Theorem 2 (Excess OOD risk with targeted augmenta-
tions). Assume γ2 > 1. For any 0 < r < 1 and large
enough D such that D > 2(probust+2) log(4Dprobust)/(1−
r)2, the excess OOD risk is bounded above as
(cid:104)
(cid:105)
ROOD(ˆθ(tgt)) − ROOD(θ∗)
E
≤
τ 2γ2 ∥βrobust∥2
1 + γ2
(cid:18) 1
D
+
2 log(4Dprobust)(probust + 2)
D(1 + γ2r)2
(cid:19)
.
Proof sketch. The learned estimator has weights ˆθ(tgt)
0 and ˆθ(tgt)
where Mrobust ≜ 1
D
spu =
robust = (σ2I + Mrobust)−1Mrobustβrobust,
is a random
robustμ(d)⊤
d=1 μ(d)
(cid:80)D
robust
σ4(τ 2−λi)2
(σ2+τ 2)(λi+σ2)2 (u⊤
Wishart matrix.
(cid:80)probust
i=1
The excess risk can be written as
i βrobust)2, where λi and ui are
eigenvalues and eigenvectors of Mrobust, respectively. Note
that this excess risk is low when D is sufficiently large rela-
tive to probust such that the eigenvalues are sufficiently close
to their expected value τ 2. We upper bound the excess
OOD risk by applying concentration of measure arguments
from Zhu (2012) to the eigenvalues of Mrobust.
Compared to the lower bound for unaugmented models
(Theorem 1), this upper bound has qualitatively different
behavior. It depends on probust instead of pdom, and it con-
verges to 0 at a fast rate of O(log D/D) whereas the lower-
bound is a negative linear function of the number of D.
Targeted augmentations improve expected OOD risk.
We now combine the lower and upper bounds to show that
targeted augmentations improve expected OOD risk.
Theorem 3 (Targeted augmentations improve OOD risk).
If γ2 > 1 and probust is small relative to pdom such that
probust <
pdom
log(2pdom)
*
1
4(1 + γ4/(γ2 − 1)2)
,
then for D such that
4γ4
D >
(γ2 − 1)2 (probust + 2) log(2pdom)
D < pdom − 4(probust + 2) log(2pdom),
the improvement in expected OOD risk is positive:
(cid:104)
(cid:105)
ROOD(ˆθ(unaug)) − ROOD(ˆθ(tgt))
E
> 0.
As expected, the minimum and maximum number of do-
mains for which there is a provable gap is proportional
to probust and pdom, respectively. However, there is some
looseness in the bound; in simulations (Section 4.3), we see
a substantial gap consistent with the above result, including
for D outside the proven range.
Domain-invariant augmentations incur high OOD er-
ror. Finally, we show that domain-invariant augmentations
incur high OOD risk in expectation.
Theorem 4 (OOD error with domain-invariant augmenta-
tions). For all D, expected OOD risk is
E[ROOD(ˆθ(inv)) − ROOD(θ∗)] =
τ 2γ2∥βrobust∥2
1 + γ2
.
Because domain-invariant augmentations randomize all
domain-dependent features, models do not use any domain-
dependent features, including the robust components that
are crucial for prediction. As a result, the expected OOD
risk is high (higher than the lower bound for unaugmented
models in Theorem 1), and the error does not decay with
the number of domains D.
6
Out-of-Domain Robustness via Targeted Augmentations
behavior, resulting in an ID and OOD improvement over
unaugmented training (also see Figure 11 in Appendix D).
However, the OOD error of generic augmentation only de-
cays slowly with D and is significantly higher than targeted
augmentation for D < 1000. Domain-invariant augmenta-
tion results in a constant level of OOD error, which im-
proves over the unaugmented and generic models for small
values of D, but underperforms once D is larger.
Overall, our simulations corroborate the theory and show
that targeted augmentations offer significant OOD gains
in the linear regression setting.
In contrast, generic
and domain-invariant augmentations improve over unaug-
mented training only in the low-sample regime.
5. Experiments on real-world datasets
We return to the real-world datasets (IWILDCAM2020-
WILDS, CAMELYON17-WILDS, BIRDCALLS) and aug-
mentations introduced in Section 2.1, where we compare
targeted augmentations to unaugmented training, generic
augmentations, and domain invariance baselines.
Generic augmentations. On image datasets iWildCam
and Camelyon17, we compare to RandAugment (Cubuk
et al., 2020), CutMix (Yun et al., 2019), MixUp (Zhang
et al., 2017), and Cutout (DeVries & Taylor, 2017). On
audio dataset BirdCalls, we compare to MixUp, SpecAug-
ment (Park et al., 2019), random low / high pass filters, and
noise reduction via spectral gating (Sainburg, 2022). Since
the targeted augmentation for BirdCalls (Copy-Paste + Jit-
ter (Region)) includes color jitter as a subroutine, we also
include a baseline of augmenting with only color jitter.
Domain invariance baselines. We compare to LISA (Yao
et al., 2022), a data augmentation strategy that aims to en-
courage domain invariance by applying either MixUp or
CutMix to inputs of the same class across domains. We
also compare to other domain invariance algorithms that do
not involve augmentation: (C)DANN (Long et al., 2018;
Ganin et al., 2016), DeepCORAL (Sun & Saenko, 2016;
Sun et al., 2017), and IRM (Arjovsky et al., 2019).
Samples of the augmentations are shown in Figure 2. Addi-
tional experimental details can be found in Appendix E.2.
Code annd BIRDCALLS are released at this link.
5.1. Results
Figure 4 plots the average ID versus OOD performance of
each method. On all three datasets, targeted augmentations
significantly improve OOD performance. Compared to
the best-performing baseline, targeted augmentations im-
prove OOD Macro F1 on iWildCam from 33.3% → 36.5%,
OOD average accuracy on Camelyon17 from 75.3% →
90.5%, and OOD Macro F1 on BirdCalls from 31.8% →
Figure 3. Targeted augmentations (red line) improve OOD er-
ror substantially, while generic (orange) or unaugmented (blue)
models require many training domains to attain low OOD error.
Domain-invariant augmentations (green line) have constant high
error. We plot OOD RMSE for varying number of training do-
mains, with standard errors over 10 random seeds. We also plot
the risk bounds from Section 4.2 for the high-sample regime; be-
cause the bounds assume infinite data, we do not plot them for the
low-sample case. The plotted Theorem 2 bound is a more general
version (Appendix C.5).
4.3. Simulations
The analysis in Section 4.2 assumes infinite data per do-
main. We now present simulation results with finite data in
a high-sample (N = 100 000) and low-sample (N = 5000)
regime, where N is the total number of examples across all
domains. We fix γ2 = 10, probust = 5 and pspu = 500.
Additional details and results are in Appendix D.
High-sample regime (N = 100 000).
In Figure 3 (left),
we plot OOD RMSE against the number of training do-
mains D, together with our upper bound for targeted aug-
mentations (a more general version of Theorem 2 in Ap-
pendix C) and lower bound for unaugmented training (The-
orem 1).
We observe the trends suggested by our theory. When D
is small, the unaugmented model (blue) has high OOD er-
ror, and as D increases, OOD error slowly decays. Train-
ing with generic augmentation (orange) does not improve
over unaugmented training. In contrast, training with tar-
geted augmentation (red) significantly reduces OOD error.
There is a substantial gap between the red and orange/blue
lines, which persists even when D is outside of the window
guaranteed by Theorem 3. Finally, domain-invariant aug-
mentations result in high OOD error (green) that does not
decrease with increasing domains, as in Theorem 3.
Low-sample regime (N = 5000). In Figure 3 (right), we
plot OOD RMSE against the number of training domains D
when the sample size is small. The unaugmented and tar-
geted models follow the same trends as in the high-sample
regime. However, in the low-sample regime, generic aug-
mentation does reduce OOD error compared to the unaug-
mented model. When the total number of examples N is
small, models are incentivized to memorize individual ex-
amples using xnoise. Generic augmentation prevents this
7
020040060080010001.01.21.41.61.8High-sample regime (N=100000)02004006008001000Low-sample regime (N=5000)OOD Test RMSENumber of training domains DUnaugmentedGeneric augmentationDomain invariant augmentationTargeted augmentationThm 1 (unaugmented lower bound)Thm 2 (targeted general upper bound)Out-of-Domain Robustness via Targeted Augmentations
Figure 4. We plot the in-domain (ID) performance of methods against their out-of-domain (OOD) performance. Error bars are standard
errors over replicates. Targeted augmentations significantly improve OOD performance over the nearest baseline, improving OOD
Macro F1 on iWildCam from 33.3% → 36.5%, OOD average accuracy on Camelyon17 from 75.3% → 90.5%, and OOD Macro F1 on
BirdCalls from 31.8% → 37.8%. Tables and additional details can be found in Appendix E.
37.8%. On iWildCam and Camelyon17, which are part of
the WILDS benchmark, these targeted augmentations set
new state-of-the-art performances (Koh et al., 2021). 1
Several generic augmentations were also able to improve
OOD performance, although by smaller amounts than tar-
geted augmentations; this matches our simulations in the
low-sample regime in Section 4.3. RandAugment (Cubuk
et al., 2020) performs strongly on iWildCam and Came-
lyon17, and both noise reduction and random high / low
pass filters perform well on BirdCalls. Some generic aug-
mentations degraded performance (MixUp, CutMix, and
SpecAugment), which may reflect the fact that these aug-
mentations can also distort xobj and xd:robust, e.g., by mix-
ing cell morphologies on Camelyon17.
Effective robustness. On iWildCam, Miller et al. (2021)
showed that the ID and OOD performances of models
across a range of sizes are linearly correlated; we plot their
linear fit on Figure 4 (left). We found that our targeted aug-
mentation Copy-Paste (Same Y) confers what Miller et al.
(2021) termed effective robustness, which is represented
in the plot by a vertical offset from the line. In contrast,
generic augmentations improve OOD performance along
the plotted line. While the domain invariance methods also
show effective robustness, they mostly underperform the
unaugmented model in raw performance numbers.
Although neither Camelyon17 nor BirdCalls have associ-
ated linear fits, we observe similar trends in Figure 4, with
targeted augmentations offering significant OOD gains
even at similar ID performances as other methods.
1BirdCalls is a new dataset, so targeted augmentations are
state-of-the-art against the baselines reported here.
Table 1. Randomizing habitat
WILDS and BIRDCALLS degrades performance.
Dataset
features
Method
in IWILDCAM2020-
ID Test Macro F1 OOD Test Macro F1
iWildCam
BirdCalls
Unaugmented
Copy-Paste (All Backgrounds)
Copy-Paste (Same Y)
Unaugmented
Copy-Paste + Jitter (All Regions)
Copy-Paste + Jitter (Same Region)
46.5 (0.4)
47.1 (1.1)
50.2 (0.7)
70.0 (0.5)
76.0 (0.3)
75.6 (0.3)
30.2 (0.3)
34.7 (0.5)
36.5 (0.4)
27.8 (1.2)
33.7 (1.0)
37.8 (1.0)
Table 2. Finetuning CLIP ViT-L/14 with targeted augmentations
improves OOD performance on CAMELYON17-WILDS (accu-
racy) and IWILDCAM2020-WILDS (macro F1). Results aver-
aged over 5 seeds with standard errors.
Dataset
ID Performance OOD Performance
Method
Camelyon17
Unaugmented
Stain Color Jitter
99.5 (0.0)
99.4 (0.0)
iWildCam
Unaugmented
Copy-Paste (Same Y)
55.6 (0.8)
56.6 (0.7)
96.0 (0.2)
97.1 (0.0)
43.5 (0.7)
45.5 (0.3)
Ablation on xd:robust. To further demonstrate the utility of
preserving xd:robust, we ran ablations on the targeted aug-
mentations for iWildCam and BirdCalls, which both pre-
serve habitat features. On iWildCam, Copy-Paste (Same
Y) selectively pastes animal foregrounds onto backgrounds
from domains which also observe y in the training set; as an
ablation, we studied Copy-Paste (All Backgrounds), which
draws backgrounds from all training domains, including
cameras in which y was not observed. Similarly, on Bird-
Calls, Copy-Paste + Jitter (Region) only pastes calls onto
recordings from the original microphone's region; as an ab-
lation, we studied Copy-Paste + Jitter (All Regions), which
merges recordings indiscriminately. In Table 1, we see that
preserving habitat features is useful-randomizing this fea-
ture, as in our ablations, decreases OOD performance by
1.8% on iWildCam and 4.1% on BirdCalls.
8
, ' 7 H V W 0 D F U R ) 2 2 ' 7 H V W 0 D F U R ) 8 Q D X J P H Q W H G & |