Title: Class Distribution Shifts in Zero-Shot Learning: Learning Robust Representations
Venue: NeurIPS 2024
Accepted: yes
Keywords: Zero-Shot Learning

Distribution Shift

Out of Distribution Generalization

Robust Representation Learning
Abstract: Zero-shot learning methods typically assume that the new, unseen classes encountered during deployment come from the same distribution as the the classes in the training set. However, real-world scenarios often involve class distribution shifts (e.g., in age or gender for person identification), posing challenges for zero-shot classifiers that rely on learned representations from training classes. In this work, we propose and analyze a model that assumes that the attribute responsible for the shift is unknown in advance. We show that in this setting, standard training may lead to non-robust representations. To mitigate this, we develop an algorithm for learning robust representations in which (a) synthetic data environments are constructed via hierarchical sampling, and (b) environment balancing penalization, inspired by out-of-distribution problems, is applied. We show that our algorithm improves generalization to diverse class distributions in both simulations and experiments on real-world datasets.

Class Distribution Shifts in Zero-Shot Learning: Learning Robust Representations

Abstract

Zero-shot learning methods typically assume that the new, unseen classes encountered during deployment come from the same distribution as the the classes in the training set. However, real-world scenarios often involve class distribution shifts (e.g., in age or gender for person identification), posing challenges for zero-shot classifiers that rely on learned representations from training classes. In this work, we propose and analyze a model that assumes that the attribute responsible for the shift is unknown in advance. We show that in this setting, standard training may lead to non-robust representations. To mitigate this, we develop an algorithm for learning robust representations in which (a) synthetic data environments are constructed via hierarchical sampling, and (b) environment balancing penalization, inspired by out-of-distribution problems, is applied. We show that our algorithm improves generalization to diverse class distributions in both simulations and experiments on real-world datasets.

1 Introduction

Zero-shot learning systems [14, 27] are designed to classify instances of new, previously unseen classes at deployment, a scenario known as open-world classification. These systems are widely applied in extreme multi-class applications, such as face or voice recognition [19] for matching observations of the same individual, and more generally, for learning data representations [2].

Class distribution shifts typically refer to changes in the prevalence of a fixed set of classes between training and testing. In zero-shot learning, however, a different challenge arises: the appearance of entirely new classes at test time. This raises a critical question - are these new classes drawn from the same distribution as the training classes? Most zero-shot methods assume that they are, an assumption that not only shapes the design of test sets [57, 16] but also plays an explicit role in assessing the generalization capabilities of zero-shot classifiers [59, 48].

In practice, training classes are often chosen based on convenience and accessibility during data collection. Even when data is carefully collected, the distribution of classes may shift over time, leading to a different distribution. For instance, this could occur when a face recognition system is deployed in a building located in a neighborhood undergoing demographic changes.

Class distribution shifts pose significant challenges to zero-shot classifiers, since they rely on learning data representations from the training classes to distinguish new, unseen ones. Typically, these classifiers are trained by minimizing the loss on the training set to effectively separate the training classes. However, this approach may result in poor performance when confronted with data from distributions that differ significantly from the class distribution in the training data. Notably, in person re-identification, this concern gained attention from a fairness perspective with respect to gender

[15, 23], age [5, 33, 50], and racial [39, 54] bias. In all these studies the variable (i.e., gender, age, race) expected to cause the distribution shift was known in advance.

In contrast, in real-world scenarios, the attribute responsible for a future distribution shift is usually unknown during training. In such cases, existing approaches based on collecting balanced datasets or re-weighting training examples [54, 41, 53] are inapplicable. Furthermore, while class distribution shifts have been extensively studied in the standard setting of supervised learning (see Appendix A), previous research assumed a closed-world setting that does not account for new classes at test time. Instead, it only addressed changes in the prevalence of fixed classes between training and testing. Consequently, class distribution shifts in zero-shot learning remain largely unaddressed.

In this paper we first address these limitations by examining the effects of class distribution shifts on constrastive zero-shot learning, by proposing and analyzing a parametric model (§3). We identify conditions where minimizing loss in this model leads to representations that perform poorly when a distribution shift has occurred.

We then use the insights gained from this model to present our second contribution (§4): an algorithm for learning representations that are robust against class distribution shifts in zero-shot classification. In our proposed approach, artificial data environments with diverse attribute distributions are constructed using hierarchical subsampling, and an environment balancing criterion inspired by out-of-distribution (OOD) methods is applied. We assess our method's effectiveness in both simulations and experiments on real-world datasets, demonstrating its enhanced robustness in §5.

1.1 Problem Setup

Let { z i , c i } N z i =1 be a labeled set of training data points z ∈ Z and classes c ∈ C , such that c i is the class of z i .

In this work, we focus on verification algorithms that enable open-world classification by determining whether two data points x ij := ( z i , z j ) belong to the same class. For instance, in person reidentification the task is to identify whether two data points (e.g., face images or voice recordings) belong to the same person. We denote this by y ij , where y ij = 1 if c i = c j and y ij = 0 otherwise. When the identity of each data point in the pair is not important, a single index is used for simplicity, namely ( x k , y k ) .

We assume that each class c is characterized by some attribute A . We further assume that the training classes are sampled from P C ( c ) , the test classes are sampled according to Q C ( c ) , and the two distributions differ solely due to a shift in the distribution of an attribute A :

Importantly, we assume that the attribute A is unknown, and that both during training and testing, data points z ∈ Z for each class are sampled according to P Z | C ( z | c ) . For instance, revisit the person identification example where each person is a class. If the attribute A is binary (e.g., a 1 is blond and a 2 is dark-haired), then P ( C | A = a 1 ) represents the distribution of people with blond hair, and P ( C | A = a 2 ) of individuals with other hair colors. The training classes might be predominantly sampled from the blond population P ( A = a 1 ) = ρ tr = 0 . 8 , while test classes are predominantly sampled from Q ( A = a 1 ) = ρ te = 0 . 1 .

We focus on verification techniques based on deep metric learning methods (for surveys see [43, 34]) such as contrastive-learning [17], Siamese neural networks [24], triplet networks [20], and other more recent variations [35, 49, 56, 58]. These methods learn a representation function that maps data points to a representation space g : Z → ˆ Z , so that examples from the same class are close (in a predefined distance function d ( · , · ) ), while those from different classes are farther apart.

We assume that g is a neural network trained by optimizing a deep-metric-learning loss, such as the contrastive loss [17]:

where m ≥ 0 is a predefined margin, and d g ( z i , z j ) := d ( g ( z i ) , g ( z j )) is the distance between the representations of the datapoints z i , z j . In our theoretical analysis, we examine the no-hinge

contrastive loss (see Appendix B for additional details):

To evaluate the class separation capability of a representation, we treat the distances between representations, d g ( z i , z j ) , as classification scores. Following common practice in the field (e.g., [47, 22]), we use the area under the receiver operating characteristic curve (AUC) to evaluate the representation, enabling threshold-agnostic assessment:

Our goal is to learn a representation g that is robust to class attribute shifts. That is, such that for an unknown shifted distribution Q A , the performance E Q A [ AUC ( g )] does not significantly deteriorate compared to the performance obtained on the training distribution P A .

2 Background on Environment Balancing Methods in OOD Generalization

The field of OOD generalization gained attention since the work of Peters et al. [36], [37], which deals with closed-world classification where training data is gathered from multiple environments E train. In this setting it is assumed that in each environment e ∈ E train examples share the same joint distribution P e C,Z ( c, z ) , but across environments the joint distribution changes, often due to variations in P e Z | C ( z | c ) . A well-known example [1] involving the classification of images of cows and camels demonstrates how an algorithm relying on background cues during training (e.g., cows in green pastures, camels in deserts) performs poorly on new images of cows with sandy backgrounds.

Several approaches that rely on access to diverse training environments were proposed to identify stable relations between the data point z and its class c . Examples of such stable relations include choosing causal variables using statistical tests [42], leveraging conditional independence induced by the common causal mechanism [9], and using multi-environment calibration as a surrogate for OOD performance [52].

Most relevant to our work are methods that aim to balance the loss over multiple environments. These methods consider a representation g = g θ that is a neural network parameterized by θ trained to optimize an objective of the form

where ℓ e ( g θ ) is the empirical loss obtained on the environment e , E train is the set of all training environments, R is a regularization term designed to balance performance over multiple environments, and λ is a regularization factor balancing the tradeoff between the empirical risk minimization (ERM) term and the balance penalty. Below, we describe three such methods, which we will refer to later in the paper.

Invariant risk minimization (IRM) presented in [1], aims to find data representations g θ such that the optimal classifier w on top of the data representation w ◦ g θ is shared across all environments. Therefore, the authors proposed minimizing the sum of environment losses ℓ e ( w ◦ g θ ) over all training environments such that w ∈ arg min w ′ ℓ e ( w ′ ◦ g θ ) for all e ∈ E train. However, since this objective is too difficult to optimize, a relaxed version was also proposed, taking the form of Equation 5 with a penalty that measures how close w is to minimizing ℓ e ( w ◦ g θ ) : R e IRMv1 ( g θ ) = ∥ ∥ ∇ w | w =1 ℓ e ( w · g θ ) ∥ ∥ 2 .

Note that for loss functions for which optimal classifiers can be expressed as conditional expectations, the original IRM objective is equivalent to the requirement that for all environments e, e ′ ∈ E train , E P e C,Z [ c | g ( z ) = h ] = E P e ′ C,Z [ c | g ( z ) = h ] , where P e C,Z and P e ′ C,Z are the joint data distributions in the respective environments.

Calibration Loss Over Environments (CLOvE) presented in [52], leverages the equivalence above to establish a link between multi-environment calibration and invariance for binary predictors ( c ∈ { 0 , 1 } ). The proposed regularizer is based on the maximum mean calibration error (MMCE) [26]. Let s : ˆ Z → [0 , 1] be a classification score function applied on the representation s ◦ g , and

s i = max { s ◦ g ( z i ) , 1 -s ◦ g ( z i ) } be the confidence on the i -th data point. Denote the correctness as b i = ✶ {| c i -s i | < 1 2 } , and let K : R × R → R be a universal kernel. Let Z e denote the training data in the environment e . The authors proposed using the MMCE as a penalty in an objective that takes the form of Equation 5 with R e MMCE ( s, g θ ) = 1 m 2 ∑ z i ,z j ∈ Z e ( b i -s i ) ( b j -s j ) K ( s i , s j ) .

Variance Risk Extrapolation (VarREx) proposed by Krueger et al. [25], is based on the observation that reducing differences in loss (risk) across training domains can reduce a model's sensitivity to a wide range of distribution shifts. The authors found that using the variance of losses as a regularizer is stabler and more effective compared to other penalties. Therefore, they propose the following regularization term for n training environments: R VarREx ( g θ , E train ) = Var ( ℓ e 1 ( g θ ) , . . . , ℓ e n ( g θ )) .

While simple and intuitive, this approach assumes that losses across different environments accurately reflect the classifier's performance. However, as discussed in §4, this is often not true for deep metric learning losses, where significant changes in loss may correspond to only minor variations in performance.

3 Parametric Model of Class Distribution Shifts in Zero-Shot Learning

In this section, we introduce a parametric model of class distribution shifts. Our model shows that in zero-shot learning, even if the conditional distribution of data given the class P ( z | c ) remains the same between training and testing, a shift in the class distribution from P ( c ) to Q ( c ) can cause poor performance on newly encountered classes sampled from the shifted distribution Q ( c ) .

Assume that for all classes, the data points z i ∈ R d are sampled from z i | c i ∼ N ( c i , Σ z ) , where Σ z = ν z · I d , and I d is the identity matrix. Let the attribute A indicate the type of a class c , with two possible types: a 1 and a 2 . Assume that the classes c i are drawn according to c i ∼ N (0 , Σ a ) for a ∈ { a 1 , a 2 } . Finally, assume that in training, a 1 is the majority type with P ( a 1 ) = ρ tr ≫ 0 . 5 , whereas at test time, a 2 is the majority type with Q ( a 1 ) = ρ te ≪ 0 . 5 .

We construct the model such that differences between the training class distribution P ( c ) and the test distribution Q ( c ) stem solely from a shift in the mixing probabilities of an unknown attribute A (see Equation 1). Therefore, we define Σ a as a diagonal matrix with replicates of three distinct values on its diagonal: ν 0 , ν + , ν -. Let 0 < ν -< ν z ≤ ν 0 < ν + . Then, in the coordinates corresponding to ν 0 and ν + data points from different classes are well separated, whereas in the coordinates corresponding to ν -they are not. Assume the coordinates corresponding to ν 0 are shared by both types, but ν + and ν -are swapped:

An illustration with one replicate of each value is shown in Figure 1.

The following proposition shows that if the number of dimensions d 1 that allow good separation for classes of type a 1 is relatively similar to the number of dimensions d 2 that enable good separation for classes of type a 2 , specifically if h l ( ρ, ν z , ν 0 , ν 1 , ν 2 ) < d 2 +2 d 1 +2 < h u ( ρ, ν z , ν 0 , ν 1 , ν 2 ) , then the optimal solution for the training distribution prioritizes the components (features) corresponding to ν + for classes of type a 1 . Thus, the prioritized features allow good separation for classes from the majority type in training, but offer poor separation for the shifted test distribution, where most classes are of type a 2 . Note that if d 2 is large, when combined, the corresponding components may still provide reasonable separation. We define h l and h u in Equation 35 and provide the proof of Proposition 1 in Appendix B.2.

Proposition 1. Consider a weight representation g ( z ) = Wz , where W ∈ R d × d is a diagonal matrix, and the squared Euclidean distance d g ( z i , z j ) = ∥ W ( z i -z j ) ∥ 2 . Let W ∗ = diag ( w ∗ ) ∈ arg min W E [ ˜ ℓ ( · , · , · ; d g ) ] . Denote w ∗ 2 1 = 1 d 1 ∑ d 1 k = d 0 +1 w ∗ k and w ∗ 2 2 = 1 d 2 ∑ d k = d 1 +1 w ∗ 2 k . Then, for all ρ > 1 2 and ν z , ν 0 , ν 1 , ν 2 , d 1 , d 2 satisfying h l ( ρ, ν z , ν 0 , ν 1 , ν 2 ) < d 2 +2 d 1 +2 < h u ( ρ, ν z , ν 0 , ν 1 , ν 2 ) it holds that d 2 w ∗ 2 2 ≤ d 1 w ∗ 2 1 .

0.5

1.0

0/

+ =0.50

0/

=1.25

d

0 =5,

d

1 =10,

d

2=10

0/

+ =0.50

0/

=1.25

d

0 =5,

d

1 =10,

d

2=5

0/

+ =0.50

0/

=1.25

d

0 =5,

d

1 =5,

d

2=10

0.5

1.0

0/

+ =0.25

0/

=1.50

d

0 =5,

d

1 =10,

d

2=10

0/

+ =0.25

0/

=2.00

d

0 =5,

d

1 =10,

d

2=10

0/

+ =0.25

0/

=2.50

d

0 =5,

d

1 =10,

d

2=10

0.0

0.5

1.0

1

0.5

1.0

0/

+ =0.20

0/

=1.25

d

0 =5,

d

1 =10,

d

2=10

0.0

0.5

1.0

1

0/

+ =0.60

0/

=1.25

d

0 =5,

d

1 =10,

d

2=10

0.0

0.5

1.0

1

0/

+ =0.80

0/

=1.25

d

0 =5,

d

1 =10,

d

2=10

w

*2

0

w

*2

1

w

*2

2

Note that the conditions outlined in Proposition 1 are sufficient but not necessary. Accordingly, in Appendix B.3, we provide the complete analytical solution for w ∗ that minimizes the expected loss E [ ˜ ℓ ( · , · , · ; d g ) ] for the weight representation g ( z ) = Wz , using the squared Euclidean distance. According to Proposition 1, larger d 2 values favor ν -for better aggregated separation. Increasing ν 0 /ν + leads to increased differences between w ∗ 2 1 and w ∗ 2 2 , and vice versa for ν 0 /ν -.

These relationships in the optimal solution are illustrated in Figure 2, showcasing different scenarios. The top row shows that when d 1 = d 2 = 10 dimensions favoring classes of type a 1 are prioritized for ρ > 0 . 5 , while those favoring type a 2 are prioritized for ρ < 0 . 5 . When d 1 = 10 while d 2 = 5 , dimensions favoring type a 1 are prioritized for all values of ρ , and vice versa when d 2 is significantly larger than d 1 . The middle and the bottom row further explore the d 1 = d 2 case, showing how differences in separability between shared dimensions ( ν 0 ) and type-favoring dimensions impact weight allocation.

Since components corresponding to ν + for classes of type a 1 align with ν -for classes of type a 2 , the optimal representation for the training distribution results in poor separation for the shifted test distribution. Therefore, a robust representation should prioritize dimensions that provide effective separation for both class types, corresponding to ν 0 .

This aligns with a common principle in the OOD generalization field, where robust representations are those that rely on features shared across environments (see §2). This principle is often referred to as invariance .

4 Proposed Approach

Motivated by our analysis of the parametric model, we propose a new approach for tackling class distribution shifts in zero-shot learning. Our approach revolves around two key ideas: (i) during training, different mixtures of the attribute A can be produced by sampling small subsets of the classes, forming artificial environments, and (ii) penalizing for differences in performance across these environments is likely to increase robustness to the class mixture encountered at test time.

4.1 Synthetic Environments

Standard ERM training involves sampling pairs of data points ( z i , z j ) uniformly at random from all N c classes available during training. However, as discussed in §3, this is prone to overfitting to the attribute distribution of the training data. Since the identity of the attribute is unknown, weighted sampling (and similar approaches) cannot be used to create environments with different attribute mixtures.

Yet, our goal is to design artificial environments with diverse compositions of the (unknown) attribute of interest. To do so, we leverage the variability in small samples: while class subsets of similar size to N c maintain attribute mixtures similar to the overall training set, smaller subsets with k ≪ N c classes are likely to exhibit distinct attribute mixtures. Therefore, we propose creating multiple environments, composed of examples from few sampled classes.

̸

This results in a hierarchical sampling scheme for the data pairs: first, sample a subset of k classes, S = { c 1 , . . . , c k } . Then, for each c ∈ S sample 2 r pairs of data points as follows: r pairs from within the class c , { z i ; c i = c } , uniformly at random (positive pairs); and r negative pairs, where one point is sampled uniformly at random from c , and the other from all other data points in S , { z i ; c i = c, c i ∈ S } . 1

Across multiple class subsets S = { S 1 , . . . , S n } , this hierarchical sampling results in diverse mixtures of any unknown attribute (see Figure 3). In particular, in some of the class subsets, classes from the overall minority type constitute the majority in the environment.

A

B

C

D

E

F

C

A

E

A

E

D

C

D

B

F

B

A

F

D

B

Sample

subsets of

classes

Sample

pairs of

data points

C

C

A

C

A

A

C

C

A

A

E

E

C

A

A

E

E

A

A

A

E

A

D

E

A

A

E

E

D

D

A

D

E

A

D

E

C

C

D

C

B

D

C

C

D

D

B

B

C

B

D

B

B

D

F

F

B

F

B

B

F

F

B

B

A

A

F

B

B

A

A

F

F

F

D

F

D

D

F

F

D

D

B

B

F

D

D

B

B

D

A

E

E

A

B

A

D

B

4.2 Environment Balancing Algorithm for Class Distribution Shifts

Our goal is to learn data representations that will allow separation between classes without knowing which attribute is expected to change and how significantly. Therefore, we require the learned data representation to perform similarly well on all mixtures obtained on the synthetic environments.

To achieve this, inspired by OOD performance balancing methods (see §2), we optimize a penalized objective:

where R ( S 1 , . . . , S n ) is any balancing term between the constructed synthetic environments.

Note that computing R ( S 1 , . . . , S n ) often involves evaluating some value on each environment separately. For a general balancing term, we denote the value in the l -th environment as f ( S l ) and accordingly express R ( S 1 , . . . , S n ) = ˚ f ( f ( S 1 ) , . . . , f ( S n )) , where ˚ f represents the corresponding aggregation function. Our approach 2 for balancing performance across synthetic environments of class subsets, is outlined in Algorithm 1.

4.3 Balancing Performance Instead of Loss

In multiple OOD penalties (e.g., IRM and VarREx), f represents the loss in each environment, which, in deep metric learning algorithms, is based on distance. This presents a challenge in zero-

Algorithm 1 Robust Zero-Shot Representation

Input: Labeled data D = { z i , c i } N z i =1 , number of synthetic environments n , number of classes within subset k , number of pairs per class 2 r , neural network g ( · ; θ ) , loss ℓ , distance function d , regularization functions f , ˚ f , initial weights θ 0 , number of training iterations T , learning rate η Output: Learned representation g ( · ; θ T )

Compute unique classes C ∗ = { c (1) , . . . , c ( N c ) }

for t = 1 to T do for l = 1 to n do

Sample k classes from C ∗ without replacement: S ( t ) = { c (1) , . . . , c ( k ) } .

l l l

From each class in S ( t ) l sample r positive and r negative data pairs. Denote the set by D ( t ) l . Compute f ( S ( t ) l ) .

Compute average unpenalized loss over ( x m , y m ) ∈ D ( t ) l : ¯ ℓ ( t ) l = 1 2 rk ∑ 2 rk m =1 ℓ ( x m , y m ) .

end for

Update network parameters performing a gradient descent step:

end for

Return: g ( · ; θ T )

shot verification, where sampled tuples often include numerous easy negative examples, leading to performance plateau early in the learning process, although the distances themselves still exhibit considerable variations. Strategies like selecting the most difficult tuples [18] were proposed to address this issue, however these methods have been found to generate noisy gradients and loss values [34].

We therefore propose to balance performance directly instead of relying on the losses in the training environments. Denote the set of negative pairs in a synthetic environment by D 0 l = { x ij = ( z i , z j ) : c i , c j ∈ S l , y ij = 0 } and the set of positive pairs by D 1 l = { x ij = ( z i , z j ) : c i , c j ∈ S l , y ij = 1 } . An unbiased estimator of the AUC on a given synthetic environment S l is given by

for x ij ∈ D 1 l and x uv ∈ D 0 l . Since this estimator is non-differentiable and therefore cannot be used in gradient-descent-based optimization, we use soft-AUC as an approximation [7]

where a sigmoid σ β ( t ) = 1 1+ e -βt approximates the step function. Note that when β → ∞ , σ β converges pointwise to the step function. Consequently, we propose the penalty:

4.4 How Many Environments Are Needed?

The proposed hierarchical sampling scheme allows for the construction of many synthetic environments with various attribute mixtures, influenced by the number of classes in each environment. As shown in the analysis below, this ensures that with high probability there will be at least one environment with a pair of minority type classes, thereby supporting learning to separate negative pairs within the minority type.

In each training iteration, we consider n class subsets (environments) of size k . Our goal is to achieve robustness to all attribute values a that are associated with at least ρ min ∈ (0 , 1) of the training classes. Note that ρ min is specified by the practitioner without knowledge of the true attribute that may cause the shift or its true prevalence ρ in the training set.

We compute the number of synthetic environments n , such that with high probability of (1 -α ) , S 1 , . . . , S n will include at least one subset with at least two classes associated with a (otherwise none of the subsets would contain negative pairs with the attribute a ). Denote the probability of a given subset not to contain any class associated with a by ϕ 0 = ( ⌈ (1 -ρ min ) Nc ⌉ k ) / ( Nc k ) and the probability of a given subset to contain exactly one such class by ϕ 1 = ρ min N c ( ⌈ (1 -ρ min ) Nc ⌉ k -1 ) / ( Nc k ) . Therefore, the required number of environments needed to ensure that at least two minority-type classes appear together in the same environment is

Note that that n is typically much smaller than ( N c k ) .

5 Empirical Results

Our method enhances standard training with two components: a hierarchical sampling scheme and a balancing term for synthetic environments. To the best of our knowledge, this is the first work addressing OOD generalization for class distribution in zero-shot learning. We therefore benchmark our algorithm against the ERM baseline (uniform random sampling with an unpenalized score) and a hierarchical sampling baseline (hierarchical sampling with unpenalized score).

Additionally, we tested standard regularization techniques including dropout and the L 2 norm, which did not yield notable improvements in the distribution shift scenario, and are therefore not shown.

To ensure a comprehensive comparison, in addition to the proposed VarAUC penalty, we evaluate variants of our algorithm in which the IRM, CLOvE, and VarREx penalties are used instead. While we show that VarAUC consistently outperforms other penalties, the crucial improvement lies in its performance compared to the ERM baseline: application of existing OOD penalties is enabled by the construction of synthetic environments in our algorithm. As discussed in Appendix C, this construction facilitates the formulation of class distribution shifts in zero-shot learning within the OOD setting.

0

100

200

300

400

500

600

700

Data Points (pairs)

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

AUC

ERM

Hierarchical

IRM

CLOvE

VarREx

VarAUC

In all of the experiments performed, we trained the network with contrastive loss (Equation 2) and the normalized cosine distance: d g ( z 1 , z 2 ) = 1 2 ( 1 -g ( z 1 ) · g ( z 2 ) ∥ g ( z 1 ) ∥∥ g ( z 2 ) ∥ ) . The specific setups are detailed below (additional details can be found in Appendix F), and code to reproduce our results is available at https://github.com/YuliSl/Zero_Shot_Robust_Representations .

5.1 Simulations: Revisiting the Parametric Model

We now revisit the parametric model presented in §3. To increase the complexity of the problem, we add dimensions where classes from both types are not well separated. That is, Σ a includes additional dimensions set to zero.

Setup We used 68 subsets in each training iteration, each consisting of two classes. This corresponds to choosing ρ min = 0 . 1 (desired sensitivity, regardless of the true unknown parameter ρ ∈ { 0 . 05 , 0 . 1 , 0 . 3 } ), with a low α value of 0.5, resulting in the construction of fewer environments according to Equation 10. For each class, we sampled 2 r = 10 pairs of data points. The representation was defined as g ( z ) = wz for w ∈ R d × p 3 . Here we focus on the case of p = 16 , ν z = ν 0 = 1 ,

ν -= 0 . 1 , ν + = 2 , d 0 = 5 , d 1 = d 2 = 10 . The results for additional representation sizes p , noise ratios ν + ν -and varying proportions of positive and negative examples are presented in Appendix D.1.

To assess the importance assigned to each dimension, we examine weight values relative to other

Results In Figure 5 we examine the learned representation. The analysis indicates that ERM prioritizes dimensions 5-15, providing good separation for a 1 , the dominant type in training, but leading to poor separation after the shift. ERM assigns low weights to dimensions beneficial for both types (0-5) and those suitable for a 2 (15-25). In contrast, our algorithm, particularly with the two variance-based penalties, assigns the lowest weights to dimensions corresponding to a 1 and higher weights to shared dimensions and those that effectively separate a 2 classes.

In Figure 4, the learning progress is depicted for ρ = 0 . 9 (a similar analysis for ρ = 0 . 95 and ρ = 0 . 7 can be found in Appendix D). Performance on the same distribution as the training data is similar for ERM and our algorithm, suggesting that applying our algorithm does not negatively impact performance when no distribution shift occurs. However, when there is a distribution shift our algorithm achieves much better results. The VarREx penalty achieves high AUC values more quickly than the VarAUC penalty, but the

0.00

0.01

0.02

0.03

0.04

0.05

0.06

Importance

ERM

Hierarchical

IRM

CLOvE

VarREx

VarAUC

VarAUC penalty attains higher overall accuracy. IRM shows noisier convergence, since it is applied directly on the gradients, which have been shown to be noisy in contrastive learning due to high variance in data-pair samples [34]. Means and standard deviations are reported in Appendix D.1, as well as the results for additional data dimensions, positive proportions, and variance ratios.

5.2 Experiments on Real Data

Experiment 1 - Species Recognition We used the ETHEC dataset [11] which contains 47,978 butterfly images from six families and 561 species (example of the images are provided in Appendix D). We filtered out species with less than five images and focused on images of butterflies from the Lycaenidae and Nymphalidae families. In the training set, 10% of the species were from the Nymphalidae family, while at test time, 90% of the species were from the Nymphalidae family. For each class we sampled 2 r = 20 pairs.

Experiment 2 - Face Recognition We used the CelebA dataset [30] which contains 202,599 images of 10,177 celebrities. We filtered out people for which the dataset contains less than three images. Following Vinyals et al. [51], we implemented g as a convolutional neural network which has four modules with 3 × 3 convolutions and 64 filters, followed by batch normalization, a ReLU activation, 2 × 2 max-pooling, and a

Hier.

IRM

CLOvE VarREx VarAUC

15.0%

10.0%

5.0%

0.0%

5.0%

10.0%

15.0%

Hier.

IRM

CLOvE VarREx VarAUC

15.0%

10.0%

5.0%

0.0%

5.0%

10.0%

15.0%

fully connected layer of size 32. We used the attribute blond hair for the class distribution shift: for training, we mainly sampled people without blond hair ( 95% ), while at test time, most people ( 95% )

had blond hair. Each training iteration had 150 synthetic environments of two classes and 2 r = 20 data points per class.

We trained the models on 200 synthetic environments at a time, each of two classes. We implemented g as a fully connected neural network with layers of sizes 128, 64, 32 and 16, and ReLU activations between them.

Experimental Results As can be seen in Figure 6, while all versions of our algorithm show some improvement over ERM, the best results are achieved with the VarAUC penalty (exact means and standard deviations are reported in Table 3 in Appendix D). One-sided paired t-tests show that the improvement over ERM achieved by our algorithm with the VarAUC penalty is statistically significant, with p-values of < 0 . 04 on both datasets; p-values for other penalties are reported in Table 4. All p-values were adjusted with FDR [4] correction.

In Appendix D we also provide additional analysis confirming that the main improvement of our algorithm over the ERM baseline stems from improved performance on negative minority pairs.

6 Discussion

In this study, we examined class distribution shifts in zero-shot learning, with a focus on shifts induced by unknown attributes. Such shifts pose significant challenges in zero-shot learning where new classes emerge in testing, causing standard techniques trained via ERM to fail on shifted class distributions, even when the conditional distribution of the data given class remains the same.

Previous research (see Appendix A) assumes closed-world classification or a known cause, making these methods unsuitable for zero-shot learning or shifts caused by unknown attributes. In response, we introduced a framework and the first algorithm to address class distribution shifts in zero-shot learning using OOD environment balancing methods.

In the causal terminology of closed-world OOD generalization, our framework employs synthetic environments to intervene on attribute mixtures by sampling small class subsets, thereby manipulating the class distribution. This facilitates the creation of diverse environments with varied attribute mixtures, enhancing the distinction between negative examples. A further comparison of our framework with OOD environment balancing methods is provided in Appendix C. Additionally, our proposed VarAUC penalty, designed for metric losses, enhances the separation of negative examples.

Our results demonstrate improvements compared to the ERM baseline on shifted distributions, without compromising performance on unshifted distributions, enabling the learning of more robust representations for zero-shot tasks and ensuring reliable performance.

While the proposed framework is general, our current experiments address shifts in a binary attribute. We defer exploration of additional scenarios, such as those involving shifts in multiple correlated attributes, to future work. An additional promising direction for future work is the consideration of shifts where the responsible attribute is strongly correlated with additional attributes or covariates. This opens up possibilities to explore structured constructions of synthetic environments that leverage such correlations.

References

Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893 , 2019.

Tadas Baltrusaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency. Openface 2.0: Facial behavior analysis toolkit. In 2018 13th IEEE international conference on automatic face &gesture recognition (FG 2018) , pages 59-66. IEEE, 2018.

Aharon Ben-Tal, Dick Den Hertog, Anja De Waegenaere, Bertrand Melenberg, and Gijs Rennen. Robust solutions of optimization problems affected by uncertain probabilities. Management Science , 59(2):341-357, 2013.

Yoav Benjamini and Yosef Hochberg. Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal statistical society: series B (Methodological) , 57(1):289-300, 1995.

Lacey Best-Rowden and Anil K Jain. Longitudinal study of automatic face recognition. IEEE transactions on pattern analysis and machine intelligence , 40(1):148-162, 2017.

Jonathon Byrd and Zachary Lipton. What is the effect of importance weighting in deep learning? In International conference on machine learning , pages 872-881. PMLR, 2019.

Toon Calders and Szymon Jaroszewicz. Efficient auc optimization for classification. In European conference on principles of data mining and knowledge discovery , pages 42-53. Springer, 2007.

Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. Advances in neural information processing systems , 32, 2019.

Shiyu Chang, Yang Zhang, Mo Yu, and Tommi Jaakkola. Invariant rationalization. In International Conference on Machine Learning , pages 1448-1458. PMLR, 2020.

Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 9268-9277, 2019.

Ankit Dhall. Eth entomological collection (ethec) dataset [palearctic macrolepidoptera, spring 2019]. 2019.

John C Duchi and Hongseok Namkoong. Learning models with uniform performance via distributionally robust optimization. The Annals of Statistics , 49(3):1378-1406, 2021.

John C Duchi, Peter W Glynn, and Hongseok Namkoong. Statistics of robust optimization: A generalized empirical likelihood approach. Mathematics of Operations Research , 46(3): 946-969, 2021.

Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE transactions on pattern analysis and machine intelligence , 28(4):594-611, 2006.

Patrick Grother, Mei Ngan, Kayee Hanaoka, et al. Ongoing face recognition vendor test (frvt) part 3: Demographic effects. Nat. Inst. Stand. Technol., Gaithersburg, MA, USA, Rep. NISTIR , 8280, 2019.

Zhangxuan Gu, Siyuan Zhou, Li Niu, Zihan Zhao, and Liqing Zhang. Context-aware feature generation for zero-shot semantic segmentation. In Proceedings of the 28th ACM International Conference on Multimedia , pages 1921-1929, 2020.

Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06) , volume 2, pages 1735-1742. IEEE, 2006.

Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737 , 2017.

Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737 , 2017.

Elad Hoffer and Nir Ailon. Deep metric learning using triplet network. In International workshop on similarity-based pattern recognition , pages 84-92. Springer, 2015.

Badr Youbi Idrissi, Martin Arjovsky, Mohammad Pezeshki, and David Lopez-Paz. Simple data balancing achieves competitive worst-group-accuracy. In Conference on Causal Learning and Reasoning , pages 336-351. PMLR, 2022.

Aparna R Joshi, Xavier Suau Cuadros, Nivedha Sivakumar, Luca Zappella, and Nicholas Apostoloff. Fair sa: Sensitivity analysis for fairness in face recognition. In Algorithmic fairness through the lens of causality and robustness workshop , pages 40-58. PMLR, 2022.

Brendan F Klare, Mark J Burge, Joshua C Klontz, Richard W Vorder Bruegge, and Anil K Jain. Face recognition performance: Role of demographic information. IEEE Transactions on information forensics and security , 7(6):1789-1801, 2012.

Gregory Koch, Richard Zemel, Ruslan Salakhutdinov, et al. Siamese neural networks for one-shot image recognition. In International Conference on Machine Learning (ICML) deep learning workshop , volume 2, 2015.

David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning , pages 5815-5826. PMLR, 2021.

Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning , volume 80 of Proceedings of Machine Learning Research , pages 2805-2814. PMLR, 10-15 Jul 2018. URL https://proceedings.mlr.press/v80/kumar18a.html .

Hugo Larochelle, Dumitru Erhan, and Yoshua Bengio. Zero-data learning of new tasks. In AAAI , volume 1, page 3, 2008.

Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision , pages 2980-2988, 2017.

Evan Z Liu, Behzad Haghgoo, Annie S Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn. Just train twice: Improving group robustness without training group information. In International Conference on Machine Learning , pages 6781-6792. PMLR, 2021.

Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV) , December 2015.

Arakaparampil M Mathai and Serge B Provost. Quadratic forms in random variables: theory and applications. (No Title) , 1992.

Aditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Himanshu Jain, Andreas Veit, and Sanjiv Kumar. Long-tail learning via logit adjustment. In International Conference on Learning Representations , 2020.

Dana Michalski, Sau Yee Yiu, and Chris Malec. The impact of age and threshold variation on facial recognition algorithm performance using images of children. In 2018 International Conference on Biometrics (ICB) , pages 217-224. IEEE, 2018.

Kevin Musgrave, Serge Belongie, and Ser-Nam Lim. A metric learning reality check. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXV 16 , pages 681-699. Springer, 2020.

Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 4004-4012, 2016.

Jonas Peters, Peter Bühlmann, and Nicolai Meinshausen. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society Series B: Statistical Methodology , 78(5):947-1012, 2016.

Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: foundations and learning algorithms . The MIT Press, 2017.

Vihari Piratla, Praneeth Netrapalli, and Sunita Sarawagi. Focus on the common good: Group distributional robustness follows. In International Conference on Learning Representations , 2021.

Inioluwa Deborah Raji and Joy Buolamwini. Actionable auditing: Investigating the impact of publicly naming biased performance results of commercial ai products. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society , pages 429-435, 2019.

Jiawei Ren, Cunjun Yu, Xiao Ma, Haiyu Zhao, Shuai Yi, et al. Balanced meta-softmax for longtailed visual recognition. Advances in neural information processing systems , 33:4175-4186, 2020.

Joseph P Robinson, Gennady Livitz, Yann Henon, Can Qin, Yun Fu, and Samson Timoner. Face recognition: too bias, or not too bias? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops , pages 0-1, 2020.

Mateo Rojas-Carulla, Bernhard Schölkopf, Richard Turner, and Jonas Peters. Invariant models for causal transfer learning. The Journal of Machine Learning Research , 19(1):1309-1342, 2018.

Karsten Roth, Timo Milbich, Samarth Sinha, Prateek Gupta, Bjorn Ommer, and Joseph Paul Cohen. Revisiting training strategies and generalization performance in deep metric learning. In International Conference on Machine Learning , pages 8242-8252. PMLR, 2020.

Marco Saerens, Patrice Latinne, and Christine Decaestecker. Adjusting the outputs of a classifier to new a priori probabilities: a simple procedure. Neural computation , 14(1):21-41, 2002.

Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks. In International Conference on Learning Representations , 2019.

Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference , 90(2):227-244, 2000.

Tomáš Sixta, Julio CS Jacques Junior, Pau Buch-Cardona, Eduard Vazquez, and Sergio Escalera. Fairface challenge at eccv 2020: Analyzing bias in face recognition. In Computer Vision-ECCV 2020 Workshops: Glasgow, UK, August 23-28, 2020, Proceedings, Part VI 16 , pages 463-481. Springer, 2020.

Yuli Slavutsky and Yuval Benjamini. Predicting classification accuracy when adding new unobserved classes. In International Conference on Learning Representations, ICLR, Conference Track Proceedings , 2021.

Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. Advances in neural information processing systems , 29, 2016.

Nisha Srinivas, Karl Ricanek, Dana Michalski, David S Bolme, and Michael King. Face recognition algorithm bias: Performance differences on images of children and adults. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops , pages 0-0, 2019.

Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. Advances in neural information processing systems , 29, 2016.

Yoav Wald, Amir Feder, Daniel Greenfeld, and Uri Shalit. On calibration and out-of-domain generalization. Advances in neural information processing systems , 34:2215-2227, 2021.

Mei Wang and Weihong Deng. Mitigating bias in face recognition using skewness-aware reinforcement learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 9322-9331, 2020.

Mei Wang, Weihong Deng, Jiani Hu, Xunqiang Tao, and Yaohai Huang. Racial faces in the wild: Reducing racial bias by information maximization adaptation network. In Proceedings of the ieee/cvf international conference on computer vision , pages 692-702, 2019.

Jiaheng Wei, Harikrishna Narasimhan, Ehsan Amid, Wen-Sheng Chu, Yang Liu, and Abhishek Kumar. Distributionally robust post-hoc classifiers under prior shifts. In International Conference on Learning Representations (ICLR) , 2023.

Chao-Yuan Wu, R Manmatha, Alexander J Smola, and Philipp Krahenbuhl. Sampling matters in deep embedding learning. In Proceedings of the IEEE international conference on computer vision , pages 2840-2848, 2017.

Yongqin Xian, Subhabrata Choudhury, Yang He, Bernt Schiele, and Zeynep Akata. Semantic projection network for zero-and few-label semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 8256-8265, 2019.

Tongtong Yuan, Weihong Deng, Jian Tang, Yinan Tang, and Binghui Chen. Signal-to-noise ratio: A robust distance metric for deep metric learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 4815-4824, 2019.

Charles Zheng, Rakesh Achanta, and Yuval Benjamini. Extrapolating expected accuracies for large multi-class problems. The Journal of Machine Learning Research , 19(1):2609-2638, 2018.

Zhisheng Zhong, Jiequan Cui, Shu Liu, and Jiaya Jia. Improving calibration for long-tailed recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 16489-16498, 2021.

A Related Work on Class Distribution Shifts in Closed-World Settings

In class-imbalanced learning [28, 10, 8] it is assumed that some classes are more dominant in training, while in deployment this is no longer the case. Therefore, solutions classically include data or loss re-weighting [46, 6, 40, 32] and calibration of the classification score [44, 60]. A popular framework for addressing class distribut ion shifts is distributionally robust optimization (DRO) [3, 13, 12, 55], where instead of assuming a specific probability distribution, a set or range of possible distributions is considered, and optimization is performed to achieve the best results on the worst-case distribution. Aspecial case known as group DRO [45, 38], involves a group variable that introduces discriminatory patterns among classes within specific groups. The framework to address this includes methods that assume that the classifier does not have access to the group information, and therefore propose re-weighting high loss examples [29], and data sub-sampling to balance classes and groups [21]. Nevertheless, the methods mentioned above rely on the training and test class sets being identical, making them unsuitable for direct application in zero-shot learning scenarios.

B Analysis of the Parametric Model

B.1 Derivation of the Loss

We begin by revisiting the parametric model introduced in §3. Let z i | c i ∼ N ( c i , Σ z ) , where Σ z = ν z I d , 0 < ν z ∈ R , and I d is the d dimensional identity matrix. Classes c i are drawn according to a Gaussian distribution c i ∼ N (0 , Σ a ) corresponding to their type a ∈ { a 1 , a 2 } . Here, we use a simpler (although less intuitive) notation for the values of the diagonal matrices Σ a :

where 0 < ν 2 < ν z < ν 0 < ν 1 .

We consider a weight representations g ( z ) = Wz , where W is a diagonal matrix with diagonal w ∈ R d .

Since Σ z is of full rank, it suffices to consider the no-hinge version of the contrastive loss, that is

where d g ( z i , z j ) := ∥ g ( z i -z j ) ∥ 2 = ∥ W ( z i -z j ) ∥ 2 ( ∥ · ∥ denotes the Euclidean norm 4 ).

For a balanced sample of positive and negative examples, the expected loss is given by

To calculate the expression above, we begin by proving the following lemma:

Lemma 1. Let µ ∈ R d be a random variable and let t | µ ∼ N ( µ, Σ) . If µ ≡ 0 (constant), then

Proof. For any random variable u ∈ R d , such that u ∼ N ( µ u , Σ u ) , and any symmetric matrix A , we have

(see, for example, Thm. 3.2b.2 in [31]).

First, letting µ u = 0 , Σ u = Σ and A = I d in (15) we get

Now, assume that µ ∼ N (0 , Σ µ ) . From (14) we get E µ ∥ µ ∥ 2 = E µ [ µ T µ ] = tr(Σ µ ) , and thus

Similarly, from (15) we have

By substituting A = Σ in (14) we get E µ [ µ T Σ µ ] = tr(ΣΣ µ ) , and from (15) we have

Therefore,

If y ij = 1 , then z i and z j are from the same class, meaning that c i = c j and thus µ = 0 . Therefore, by Lemma 1.(1) we have

However, for pairs from different classes, that is, when y ij = 0 , the mean µ is itself a Gaussian random variable distributed according to N (0 , Σ µ ) , where

Therefore, by Lemma 1.(2) we have

where

where

and so

and similarly

where we denote for short

Finally, due to symmetry, at the optimal solution we have

and by combining these results, we get

B.2 Analysis of the Optimal Solution (Proof of Proposition 1)

Proposition 1 shows that when d 1 and d 2 are relatively similar, the optimal solution on the training distribution, assigns more weight to components with high variance in the training data than to those with high variance in the shifted test distribution.

We begin by defining the required condition on d 1 and d 2 . Denote

Then for α, β, γ values as in equations 24 and 31, we define

and the corresponding condition

While this condition is sufficient, it is not necessary.Values of ρ, ν z , ν 0 , ν 1 , ν 2 and d 1 , d 2 that satisfy 35 provide an example requiring only a simple analysis, without a full characterization of the optimal solution, for the failure of optimization over the training distribution. However, such failures can occur for additional parameter values, and the full characterization is provided in Appendix B.3.

Proof. Without loss of generality assume m=1. Then,

and by setting the partial derivative to zero we get

Therefore, and similarly

Hence,

Denoting we have

and therefore

Denote and thus

Note that for d 1 , d 2 such that

we have ∆ > 0 . Since η 02 η 01 < 1 , this reduces to the last two conditions and therefore, in particular for

we have ∆ > 0 . Additionally, note that

and thus 1 -1 ξ (2 + d 1 ) ψ 1 η 12 > 0 iff

Combining these conditions reduces to

and therefore, for ν z , ν 0 , ν 1 , ν 2 , d 1 , d 2 satisfying

we have d 1 u 2 1 -d 2 u 2 2 > 0 . 5

B.3 Explicit Expression for the Optimal Representation

In order to derive the optimal representation, we differentiate the expected loss with respect to the squared values in the diagonal of W , that is, w 2 i :

Combining these results, we get for 1 ≤ i ≤ d 0

Thus, we can write for the symmetric solution

where

Therefore, the optimal representation is given by the solution to the following set of linear equations:

where

C Comparison to OOD Environment Balancing Methods

Previous methods in the field of OOD generalization (see §2) exhibit several key differences compared to our setting: (i) They address closed-world classification, whereas in zero-shot learning, new classes are encountered. (ii) The presumed shift is typically in the conditional distribution of the data given the class (e.g., the background given the class being a cow or a camel), whereas we consider shifts in the class distribution P ( c ) . (iii) Existing methods often assume that training data comes from various data environments, providing explicit information about how the distribution might shift, while we assume the attribute A causing the shift is unknown.

Despite these differences, in this work we recast class distribution shifts in zero-shot learning into environment balancing OOD setting, by making the following observations. First, when posed as verification methods, zero-shot classifiers in fact perform a binary (closed-world) classification task, predicting whether a pair of data points x ij := ( z i , z j ) belong to the same class y ij = c i = c j .

✶ Note that the distribution of possible pairs x ij = ( z i , z j ) given the label y ij changes with variations in class attribute probabilities, and therefore across synthetic environments S . Thus, in this formulation the shift occurs in the conditional distribution of the data given the class p ( x ij | y ij ) .

Another distinction lies in data availability: in the setting of closed-world OOD environment balancing methods, a main drawback is the challenge of securing a sufficient number of diverse training environments. This is essential to ensure that a representation performing well on observed environments, will likely perform similarly on unobserved ones. In contrast, our framework allows for the construction of many synthetic environments via sampling.

D Additional Empirical Results

D.1 Additional Simulation Results

Simulations Exact mean and standard deviations matching Figure 4 are provided in table 1.

AUC progress during training iterations and feature importance results for the majority class proportion of ρ = 0 . 1 were shown in the main text. Here, we provide analogous results for ρ = 0 . 05 and ρ = 0 . 3 . These are summarized in Figure 8.

ERM

IRM

CLOvE

VarREx

VarAUC

0.50

0.55

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

AUC

d

=4

ERM

IRM

CLOvE

VarREx

VarAUC

0.50

0.55

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

d

=8

ERM

IRM

CLOvE

VarREx

VarAUC

0.50

0.55

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

AUC

1 =2,

2 =0.2

ERM

IRM

CLOvE

VarREx

VarAUC

0.50

0.55

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1 =4,

2 =0.1

ERM

IRM

CLOvE

VarREx

VarAUC

0.50

0.55

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

AUC

30% negative examples

ERM

IRM

CLOvE

VarREx

VarAUC

0.50

0.55

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

70% negative examples

For ρ = 0 . 05 the convergence results are similar to those obtained for ρ = 0 . 1 - under distributionshift the two variance based methods show significantly better results compared to other approaches. Our algorithm with the VarREx penalty achieves high AUC values more quickly than the VarAUC penalty, but the VarAUC penalty attains higher accuracy overall. The CLOvE penalty achieves improvement over ERM, but smaller compared to the variance based methods. IRM converges to the same AUC as ERM. In contrast, on in-distribution data all methods perform well.

For ρ = 0 . 3 the distribution shift is milder and therefore ERM performs very well (0.902 AUC is achieved on distribution shift scenario compared to 0.932 on in-distribution setting). Therefore encouragement of similar performance across different data subsets does not benefit the learning process. Slightly better result is achieved with VarREx penalty (0.911).

The analysis of feature importance for ρ = 0 . 05 yields results similar to those for ρ = 0 . 1 . At ρ = 0 . 3 the analysis remains mostly unchanged, except that VarREx assigns higher importance to features corresponding to ν 0 (0-5) compared to VarAUC, while in more extreme distribution shifts VarAUC assigns higher importance to the shared features.

D.2 Additional Representation Sizes, Noise Ratios and Positive Proportions

In §5.1 we explored varying values of ρ in a setting where ν + = 2 , ν -= 0 . 1 ( ν + ν -= 20 ). We now focus on the case of ρ = 0 . 1 and examine additional representation sizes p , and noise ratios ( ν + ν -∈ { 10 , 40 } ). Additionally, we examine the original setting where p = 16 and ν + = 2 , ν -= 0 . 1 , with varying proportions of positive and negative examples.

The results in Figure 7 show that in all the additional settings our methods provides statistically significant improvement over the baseline. FDR adjusted p-values for multiple comparisons are provided in Table 2.

Experiments In Table 3, we provide the means and standard deviations for the experiments detailed in §5.2. Additionally, Table 4 presents the adjusted p-values for assessing the performance increase over the ERM baseline achieved by our algorithm with the explored penalties.

D.3 Analysis of Loss Values

Here we present an analysis of the unpenalized loss after convergence in both real-data experiments. We performed separate analyses on pairs of data points from the dominant type during training (majority), and those from the other type (minority). Additionally, we separated positive pairs ( y = 1 ) and negative pairs ( y = 0 ). Figure 9 displays histograms illustrating the differences between losses on the training set obtained with the representation learned using ERM ( g ERM), and those obtained using our algorithm with VarAUC penalty ( g VarAUC):

Positive values of the differences correspond to higher losses for ERM.

In both experiments, when examining negative pairs from the minority group, as shown in the top-left histograms, most of the observed differences are positive. This indicates that the ERM losses for these pairs are higher compared to the losses obtained for the representation trained with the VarAUC

penalty. The disparities are smaller for the other three groups: majority negative pairs, minority negative pairs, and minority positive pairs. Among these groups, ERM performs better on positive pairs.

0

100

200

300

400

500

600

700

Data Points (pairs)

0.6

0.7

0.8

0.9

AUC

ERM

Hierarchical

IRM

CLOvE

VarREx

VarAUC

0.00

0.01

0.02

0.03

0.04

0.05

0.06

0.07

Importance

ERM

Hierarchical

IRM

CLOvE

VarREx

VarAUC

0

100

200

300

400

500

600

700

Data Points (pairs)

0.60

0.65

0.70

0.75

0.80

0.85

0.90

AUC

ERM

Hierarchical

IRM

CLOvE

VarREx

VarAUC

0.00

0.01

0.02

0.03

0.04

0.05

Importance

ERM

Hierarchical

IRM

CLOvE

VarREx

VarAUC

0.1

0.0

0.1

0.00

0.02

0.04

0.06

0.08

0.10

y

=0

Blond (minority in training)

0.1

0.0

0.1

0.0

0.1

0.2

0.3

0.4

Not Blond (majority in training)

0.05

0.00

0.05

0.00

0.05

0.10

0.15

0.20

0.25

y

=1

0.1

0.0

0.1

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.1

0.0

0.1

0.00

0.02

0.04

0.06

0.08

0.10

0.12

0.14

0.16

y

=0

Nymphalidae (minority in training)

0.2

0.1

0.0

0.1

0.2

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Lycaenidae (majority in training)

0.050

0.025 0.000

0.025

0.050

0.0

0.1

0.2

0.3

0.4

0.5

y

=1

0.050

0.025 0.000

0.025

0.050

0.0

0.1

0.2

0.3

0.4

0.5

(a) CelebA Dataset

(b) ETHEC Dataset

E Datasets

Train

Test

Train

Pluto

Ilia

Niobe

Epiphron

Fidia

Didyma

Achine

Aristaeus

Didyma

Test

Betulae

Iolas

Virgaureae

Roboris

Trappi

Albicans

Roboris

Alcon

Roboris

Diamina

F Implementation Details

A link to a permanent repository with code to reproduce our results is included in the main text.

The data-related parameters of our experiments are described in the main text. In all our experiments we used margin of m = 0 . 5 for the contrastive loss and Adam (Kingma & Ba, 2014) optimizer to train all models.

For the CLOvE penalty we used a Laplacian kernel k ( r, r ′ ) = e 1 width -| r -r ′ | with width of 0.4 as originally suggested by Kumar et al. (2018).

For optimization of the VarAUC objective we disregard the finite sample correction N s -n N s -1 in the implementation since n is very small compared to N s . In practice, we minimize the standard deviation instead of the variance in both variance based penalties, and the hyperparameters are reported accordingly.

In our scenario where the attribute of interest is unknown, we generated a synthetic attribute for hyperparameter selection using Principle Components (PC). We ranked examples based on their first PC component values, classifying the top 10% as positive and the rest as negative. Hyperparameters for all methods were chosen via grid-search in a single experiment repetition, ensuring robustness against this synthetic attribute. Notably, the experiments themselves did not involve the PC attribute; instead, they focused on dimension swapping in simulations and attributes like hair color or species family in CelebA and ETHEC experiments.

The grid search produced almost identical hyperparameters for all three ρ values. We observed that performance converged to the same value when employing hyperparameters derived from crossvalidation for one ρ value, as those selected for another. Therefore, for simplicity we repeated simulations using the same hyperparameters, determined based on the grid search results for ρ = 0 . 1 (the intermediate parameter value). Similarly, minimal differences in optimal learning rates were observed among the methods within an experiment and therefore a shared learning rate was used for each experiment. To emphasize the improvement of OOD methods over the ERM baseline, we used the learning rate optimized for the ERM method. Large differences were observed in optimal

regularization factors, and therefore these parameters (as well as method-specific parameters) were not shared. All hyper-parameters are reported in Table 5.

All models were initialized with identical weights, and trained on identical data splits.

All the code in this work was implemented in Python 3.10. We used the TensorFlow 2.13 and TensorFlow Addons 0.21 packages. For evaluation we used the auc function from scikitlearn 1.2. The CelebA dataset was loaded through TensorFlow Datasets 4.9 and pandas 1.5 was used to process the ETHEC dataset. Statistical tests were performed using ttest_rel and false_discovery_control functions from scipy.stats 1.11.4. All figures were generated using Matplotlib 3.7.

The IRM implementation was adapted from the source code of the paper, available at https://github.com/facebookresearch/InvariantRiskMinimization .

We ran all experiments on a single A100 cloud GPU. For simulations, each full repetition of the experiment (comparing all methods) required on average 2.06 hours. Each repetition on the ETHEC dataset took 7.38 hours on average, and on the CelebA dataset 11.52 hours.

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes] ,

Justification: Both abstract and the introduction (last 2 paragraphs) accurately state the main contributions of the paper.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: Main limitations are discussed in §6.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: All assumptions are clearly stated and full proofs to the theoretical claims appear in Appendix B

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: All the details are provided in Section §5 and Appendix F.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: The datasets are publicly available and code implementing all our results is submitted with the paper.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: We specify all hyperparameters and training details in Appendix F.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: We perform statistical testing to provide significance of our results and report FDR adjusted p-values. For all reported results we include either error bars in the main text, or when other visualizations are chosen we report means and standard deviations in Appendix D.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: All resources including GPU information and run times are provided in Appendix F.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: The paper conforms with the provided code of ethics.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: This paper presents work whose goal is to advance the field of learning robust data representations. It is not tied to any particular applications and therefore we do not see an immediate risk for negative societal impact.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: We do not release any new data or models.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: The only asset used is the IRM implementation. The corresponding paper is cited and we explicitly mention this in Appendix F, while providing also reference for the code itself.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

Justification: We do not release new assets.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: The paper does not involve human subjects and did not use crowd sourcing.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: The paper does not involve human subjects and did not use crowd sourcing.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper first investigates the effect of class distribution changes on comparative zero-sample learning by proposing and analysing a class distribution shifts parameter model, leading to the idea that loss minimisation leads to poor performance of representations over the class distribution shifts. Based on this finding, the authors utilise hierarchical sub-sampling and OOD environment balancing methods to obtain robust representations and address the poor performance caused by class distribution changes in zero-sample learning, and experimentally validate the effectiveness of the methods.\n\nSTRENGTHS:\n1- This paper studies the distribution bias problem caused by challenging unknown attributes in zero-shot learning and proposes an effective solution, which is important and innovative for solving the distribution bias problem in zero-shot learning.\n\n2- The structure is clear. It enables the reader to quickly follow the research ideas and understand the content of each section.\n\n3- Figures and tables are clear and accurate. The figures and tables in this paper are concise and clear, effectively support the ideas or conclusions, and enable the reader to grasp the critical information quickly.\n\n4- Comparison and ablation studies are comprehensive. The authors demonstrated the superiority of their method through many experiments and analysed various factors.\n\nWEAKNESSES:\n1- Authors should describe their proposed soft-AUC trends in detail and analyse the penalty to help readers understand how they play a role.\n\n2- In Experiment 1, the authors used the attribute blonde hair to shift the class distribution, but we know that some people may be hairless, so can the attribute gender be used to shift the class distribution?\n\n3- The language of this paper needs to be scrutinized and improved. For example, redundant phrases such as \"with respect to\" (line 32) should be avoided. In addition, there are some grammatical errors that need to be improved, such as \"assumes\" in line 333 should be changed to \"assume\", and \"leverages\" in line 350 should be changed to \"average\".\n\n4- WRITING DETAILS: Abbreviated nouns should be introduced the first time they appear, such as “OOD”.\n\nQUESTIONS:\nSee Weaknesses\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-06-30"}

comments: SUMMARY:
This paper proposes a robust representation learning method that could assume the shift between seen classes and unseen classes.

STRENGTHS:
Good presentation and sound method.

WEAKNESSES:
Lack the experiments on the most popular benchmark of zero-shot learning [1] and comparison to some SOTAs, e.g. [2][3].

[1] Zero-shot learning-the good, the bad and the ugly[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2017.
[2] Rebalanced zero-shot learning[J]. IEEE Transactions on Image Processing, 2023.
[3] Transzero: Attribute-guided transformer for zero-shot learning[C]//Proceedings of the AAAI Conference on Artificial Intelligence. 2022.

QUESTIONS:
See weakness

LIMITATIONS:
Yes
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2024-07-11

comments: SUMMARY:
Zero-shot learning classifiers face the challenge of distribution shifts, where the distribution of new classes differs significantly from that of the training data. In this paper, the authors introduce a novel algorithm to address this problem by creating robust representations through hierarchical sampling and environment balancing penalization. 

Experimental results also demonstrate a performance increase compared to the baseline ERM model on several real-world datasets.

STRENGTHS:
1. This paper is well-written and easy to understand.
2. The paper proposes a new model that enables handling unknown attributes for distribution shifts and addresses new classes at test time.
3. The method is tested through both simulations and real-world experiments.

WEAKNESSES:
1. Some parameters need to be clearly defined, for example, $\rho_{tr}$, $\rho_{te}$, and $y_{uv}$ in Eq (4).
2. The proposed method creates multiple environments and computes penalties across them. What is the computational complexity? It's also beneficial to discuss the time complexity of Algorithm 1.
3. Figure 5 and Figure 6 do not straightforwardly show the performance.

QUESTIONS:
Please see the Weakness section above.

Additional questions:

1. Although the authors mention how to calculate the number of environments, it's better to include an ablation study to test the performance with different numbers of environments.

LIMITATIONS:
The authors acknowledge the limitations in their paper.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2024-07-16

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper treats the problem of learning models for zero-shot open-world classification settings (open-world meaning previously unseen classes might appear at test time) that are robust to distribution shifts.\n\nThe proposed approach consists of two stages. In the first stage, synthetic environments $S_i$ are sampled from the training data following a hierarchical sampling approach, where first classes and then data pairs according to sampled classes are sampled. \nIn the second stage, the model is updated to minimise a loss composed of standard ERM and the variance over environment AUC scores.\n\nThe benefits of the method are demonstrated on synthetic data, CelebA, and ETHEC (where also on the latter two a distribution shift is introduced synthetically).\n\nSTRENGTHS:\n- The proposed approach to generate synthetic environments through hierarchical sampling seems neat and novel (even though the idea of generating synthetic environments for learning robust models is not novel, see weaknesses)\n- Adjusting the performance metric in the variance regularisation term for zero-shot verification, using AUC on embedding distances instead of loss (like in VaRex) seems like a nice way of avoiding performance plateaus and enables better performance in the conducted experiments\n- In the experiments, the proposed method shows significant performance gains over ERM\n- It is good to see a theoretical derivation of the necessary number of sampled environments to achieve a minimum number of examples from each class in at least one environment during the hierarchical sampling with a certain probability (Section 4.4). I believe this result should be made more prominent in form of a Proposition with a proof (in the appendix).\n\nWEAKNESSES:\n- Lack of baselines wrt generation of synthetic environments: The idea of generating synthetic environments to learn models that are robust to distribution shift is not new, and as such the proposed approach should have been compared to existing methods for this. For example, it would be interesting to see how the approach proposed by the authors compares to the approach of the 'Environment Inference for Invariant Learning' paper by Creager et al. (2021).\n- The real data experiments are still semi-synthetic in the sense that the distribution shift is introduced synthetically (and is quite stark). I do understand that finding a dataset that has a stark enough distribution shift of one attribute inherently in it is hard or even impossible, and the synthetic shifts are good for highlighting the potential merits of the proposed approach. However, what is missing is a report on the performance of the proposed approach (in comparison to baselines) on the unshifted train and test sets of CelebA and ETHEC, to ensure that there is no performance trade-off. \n\nMinor:\n- Figure 2 is never referred to in the text - as a result it is unclear what its purpose is.\n- It would be helpful to refer to the result of Section 4.4 already in Section 4.1, when it is claimed that 'hierarchical sampling results in diverse mixtures of any unknown attribute' and that 'smaller subsets with $k < N_c$ classes are likely to exhibit distinct attribute distributions' Section 4.4. backs up these claims. \n- L 235 typo at the end of the line -> (10)\n- Line 151: $h$ needs to be defined before referring to it in an equation, or immediately after the equation.\n\nQUESTIONS:\n- How was the number of synthetic environments in Experiments 1 and 2 on real data chosen? What values of $\\alpha$ from Section 4.4 do they correspond to?\n\nLIMITATIONS:\nLimitations are briefly discussed in the Discussion.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-18"}