Title: Quantile Activation: Departing from single point estimation for better generalization across distortions
Venue: NeurIPS 2024
Accepted: no
Keywords: Uncertainty Quantification

Context Distribution

Robust Inference

Generalization across distortions

Neuronal Activation
Abstract: A classifier is, in its essence, a function which takes an input and returns the class of the input and implicitly assumes an underlying distribution which does not change. We argue in this article that one has to move away from this basic tenet to obtain generalisation across distributions. Specifically, the class of the sample should depend on the points from its “context distribution” for better generalisation across distributions. 
How does one achieve this? – The key idea is to “adapt” the outputs of each neuron of the network to its context distribution. We propose quantile activation,QACT, which, in simple terms, outputs the relative quantile of the sample in its context distribution, instead of the actual values in traditional networks. The scope of this article is to validate the proposed activation across several experimental settings, and compare it with conventional techniques. For this, we use the datasets developed to test robustness against distortions – CIFAR10C, CIFAR100C, MNISTC, TinyImagenetC, and show that we achieve a significantly better generalisation across distortions than the conventional classifiers, across different architectures. Although this paper is only a proof of concept, we surprisingly find that this approach outperforms DINOv2(small) at large distortions, even though DINOv2 is trained with a far bigger network on a considerably larger dataset.

Abstract

A classifier is, in its essence, a function which takes an input and returns the class of the input and implicitly assumes an underlying distribution. We argue in this article that one has to move away from this basic tenet to obtain generalization across distributions. Specifically, the class of the sample should depend on the points from its 'context distribution' for better generalization across distributions.

How does one achieve this? - The key idea is to 'adapt' the outputs of each neuron of the network to its context distribution. We propose quantile activation,QACT, which, in simple terms, outputs the relative quantile of the sample in its context distribution, instead of the actual values in traditional networks.

The scope of this article is to validate the proposed activation across several experimental settings, and compare it with conventional techniques. For this, we use the datasets developed to test robustness against distortions - CIFAR10C, CIFAR100C, MNISTC, TinyImagenetC, and show that we achieve a significantly higher generalization across distortions than the conventional classifiers, across different architectures. Although this paper is only a proof of concept, we surprisingly find that this approach outperforms DINOv2(small) at large distortions, even though DINOv2 is trained with a far bigger network on a considerably larger dataset.

1 Introduction

Deep learning approaches have significantly influenced image classification tasks on the machine 19

learning pipelines over the past decade. They can easily beat human performance on such tasks by non20

trivial margins by using innovative ideas such as Batch Normalization [19] and other normalization 21 techniques [3, 31], novel rectifiers such as ReLU/PReLU [26, 31, 3] and by using large datasets and 22 large models. 23

24

25

26

27

However, these classification systems do not generalize across distributions [2, 34], which leads to instability when used in practice. [22] shows that deep networks with ReLU activation degrades in performance under distortions. [4] observes that there exists a feature collapse which inhibits the networks to be reliable.

28

29

30

31

32

33

Fundamental Problem of Classification: We trace the source of the problem to the fact that Existing classification pipelines necessitates single point prediction , i.e., they should allow classification of a single sample given in isolation. We argue that, for good generalization, one should move away from this basic tenet and instead allow the class to be dependent on the 'context distribution' of the sample. That is, when performing classification, one needs to know both the sample and the context of the sample for classification.

While this is novel in the context of classification systems, it is widely prevalent in the specific domain 34 of Natural Language Processing (NLP) - The meaning of a word is dependent on the context of the 35

Severity 0

Severity 1

Severity 2

Severity 3

Severity 4

Severity 5

QACT

88.02

82.44

76.74

71.54

68.25

65.34

ReLU

90.48

81.06

65.9

48.34

41.54

35.86

word. However, to our knowledge, this has not been considered for general classification systems. 36 Even when using dominant NLP architectures such as Transformers for vision [8], the technique has 37 been to split the image into patches and then obtain the embedding for an individual image. 38

39

40

41

42

43

44

45

Obtaining a classification framework for incorporating context distribution: We suspect that the main reason why the context distribution is not incorporated into the classification system is - The naive approach of considering a lot of samples in the pipeline to classify a single sample is computationally expensive. We solve this problem by considering the context distribution of each neuron specifically. We introduce Quantile Activation (QACT), which outputs a probability depending upon the context of all outputs. This, however, gives rise to new challenges in training, which we address in section 2.

Figure 1 illustrates the differences of the proposed framework with the existing framework. As 46 severity increases (w.r.t Gaussian Noise), we observe that ReLU activation loses the class structure. 47 This behaviour can be attributed to the fact that, as the input distribution changes, the activations 48 either increase/decrease, and due to the multiplicative effect of numerous layers, this leads to very 49 different features. On the other hand, the proposed QACT framework does not suffer from this, since 50 if all the pre-activations 1 change in a systematic way, the quantiles adjust automatically to ensure that 51 the inputs for the next layer does not change by much. This is reflected in the fact that class structure 52 is preserved with QACT. 53

54

55

56

57

58

Remark: Quantile activation is different from existing quantile neural network based approaches, such as regression [30], binary quantile classification [36], Anomaly Detection [24, 33]. Our approach is achieving best in-class performance by incorporating context distribution in the classification paradigm. Our approach is also markedly different from Machine unlearning which is based on selective forgetting of certain data points or retraining from scratch [32].

59

60

61

62

63

64

65

66

67

68

Contributions: A decent amount of literature on neuronal activation is available. However, to the best of our knowledge, none matches the central idea proposed in this work.

In [5], the authors propose an approach to calibrate a pre-trained classifier f θ ( x ) by extending it to learn a quantile function , Q ( x , θ, τ ) ( τ denotes the quantile), and then estimate the probabilities using ∫ τ I [ Q ( x , θ, τ ) ≥ 0 . 5] dτ 2 . They show that this results in probabilities which are robust to distortions.

In this article, we extend this approach to the level of a neuron, by suitably deriving the forward and backward propagation equations required for learning (section 2).

We then show that a suitable incorporation of our extension produces context dependent outputs at the level of each neuron of the neural network.

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

Our approach contributes to achieving better generalization across distributions and is more robust to distortions, across architectures. We evaluate our method using different architectures and datasets, and compare with the current state-of-the-art - DINOv2. We show that QACT proposed here is more robust to distortions than DINOv2, even if we have considerably less number of parameters (22M for DINOv2 vs 11M for Resnet18). Additionally, DINOv2 is trained on 20 odd datasets, before being applied on CIFAR10C; in contrast, our framework is trained on CIFAR10, and produces more robust outcome (see figures 3,5).

The proposed QACT is consistent with all the existing techniques used in DINOv2, and hence can be easily incorporated into any ML framework.

We also adapt QACT to design a classifier which returns better calibrated probabilities.

Related Works on Domain Generalization (DG): The problem of domain generalizations tries to answer the question - Can we use a classifier trained on one domain across several other related domains? The earliest known approach for this is Transfer Learning [28, 37], where a classifier from a single domain is applied to a different domain with/without fine-tuning. Several approaches have been proposed to achieve DG, such as extracting domain-invariant features over single/multiple source domains [11, 1, 9, 29, 16], Meta Learning [17, 9], Invariant Risk Minimization [2]. Self supervised learning is another proposed approach which tries to extract features on large scale datasets in an unsupervised manner, the most recent among them being DINOv2 [27]. Very large foundation models, such as GPT-4V, are also known to perform better with respect to distribution shifts [12]. Nevertheless, to the best of our knowledge, none of these models incorporates context distributions for classification.

2 Quantile Activation

Rethinking Outputs from a Neuron: To recall - if x denotes the input, a typical neuron does the following - (i) Applies a linear transformation with parameters w,b , giving w t x + b as the output, and (ii) applies a rectifier g , returning g ( w t x + b ) . Typically, g is taken to be the ReLU activation g relu ( x ) = max(0 , x ) . Intuitively, we expect that each neuron captures an 'abstract' feature, usually not understood by a human observer.

An alternate way to model a neuron is to consider it as predicting a latent variable y , where y = 1 if the feature is present and y = 0 if the feature is absent. Mathematically, we have the following model:

This is very similar to the standard latent variable model for logistic regression, with the main exception being, the outputs y are not known for each neuron beforehand. If y is known, it is rather easy to obtain the probabilities P ( z ≥ 0) . Can we still predict the probabilities, even when y itself is a latent variable?

The authors in [5] propose the following algorithm to estimate the probabilities:

Let { x i } denote the set of input samples from the input distribution x and { z i } denote their corresponding latent outputs, which would be from the distribution z

Assign y = 1 whenever z > (1 -τ ) th quantile of z , and 0 otherwise. For a specific sample, we have y i = 1 if z i > (1 -τ ) th quantile of { z i }

Fit the model Q ( x, τ ; θ ) to the dataset { (( x i , τ ) , y i ) } , and estimate the probability as,

The key idea: Observe that in step 2., the labelling is done without resorting to actual groundtruth labels. This allows us to obtain the probabilities on the fly for any set of parameters, only by considering the quantiles of z .

Defining the Quantile Activation QACT Let z denote the pre-activation of the neuron, and let { z i } denote the samples from this distribution. Let F z denote the cumulative distribution function (CDF), and let f z denote the density of the distribution. Accordingly, we have that F -1 z ( τ ) denotes

Algorithm 1 Forward Propagation for a single neuron

Input: [ z i ] a vector of pre-activations, 0 < τ 1 < τ 2 < · · · < τ n τ < 1 - a list of quantile indices at which we compute the quantiles.

Append two large values, c and -c , to the vector [ z i ] .

Count n + = number of positive values, n -= number of negative values, and assign the weight w = 1 /n to the positive values, and w = 1 /n to the negative values.

Compute weighted quantiles { q i } at each of { τ i } over the set { z i } ∪ { c, -c Compute QACT ( z i ) using the function,

+ + --}

Remember [ z i ] , w + , w -, [ QACT ( z i )] for backward propagation. return [ QACT ( z i )]

Algorithm 2 Backward Propagation for a single neuron

Input: grad_output , 0 < τ 1 < τ 2 < · · · < τ n τ < 1 - a list of quantile indices at which we compute the quantiles.

Context from Forward Propagation: [ z i ] , w + , w -, [ QACT ( z i )]

Obtain a weighted sample from [ z i ] with weights w + , w -- (say) S .

Obtain a kernel density estimate, using points from S , at each of the points in z i - (say) ˆ f z ( z i ) Set,

return grad_input the τ th quantile of z . Using step (2) of the algorithm above, we define, 116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

Computing the gradient of QACT: However, to use QACT in a neural network, we need to compute the gradient which is required for back-propagation. Let τ z denote the quantile at which F -1 z ( τ z ) = z . Then we have that QACT ( z ) = τ z since F -1 z ( τ ) is an increasing function. So, we have that QACT ( F -1 z ( τ )) = τ . In other words, we have that QACT ( z ) is F z ( z ) , which is nothing but the CDF of z . Hence, we have,

where f z ( z ) denotes the density of the distribution.

Grounding the Neurons: With the above formulation, observe that since QACT is identical to CDF, it follows that, QACT ( z ) is always a uniform distribution between 0 and 1 , irrespective of the distribution z . When training numerous neurons in a layer, this could cause all the neurons to learn the same behaviour. Specifically, if, half the time, a particular abstract feature is more prevalent than others, QACT (as presented above) would not be able to learn this feature. To correct this, we enforce that positive values and negative values have equal weight . Given the input distribution z , We perform the following transformation before applying QACT. Let

denote the truncated distributions. Then,

From definition of z ‡ , we get that the median of z ‡ is 0 . This grounds the input distribution to have 131 the same positive and negative weight. 132

(a)

(b)

(c)

(d)

Original

400

300

200

100

0.0

0.2

0.4

0.6

0.8

1.0

Rotated

400

300

8

200

100

0

0.0

0.2

0.4

0.6

0.8

1.0

N

Dataset

original

original

rotated

1000

rotated

800

Count

600

400

200

1.0

0.5

0.0

0.5

1.0

1.5

2.0

x1

0

Dealing with corner cases: It is possible that during training, some neurons either only get positive 133 values or only get negative values. However, for smooth outputs, one should still only give the weight 134 of 0 . 5 for positive values. To handle this, we include two values c (large positive) and -c (large 135 negative) for each neuron. Since, the quantiles are conventionally computed using linear interpolation, 136 this allows the outputs to vary smoothly. We take c = 100 in this article. 137

138

139

140

141

142

Estimating the Density for Back-Propagation: Note that the gradient for the back propagation is given by the density of z ‡ (weighted distribution). We use the Kernel Density Estimation (KDE), to estimate the density. We, (i) First sample N points with weights w + , w -, and (ii) then estimate the density at all the input points [ z i ] . This is point-wise multiplied with the backward gradient to get the gradient for the input. In this article we use N = 1000 , which we observe gets reasonable estimates.

143

144

145

146

147

148

149

150

151

152

Computational Complexity: Computational Complexity (for a single neuron) is majorly decided by 2 functions - (i) Computing the quantiles has the complexity for a vector [ z i ] of size n can be performed in O ( n log( n )) . Since this is log-linear in n , it does not increase the complexity drastically compared to other operations in a deep neural network. (ii) Computational complexity of the KDE estimates is O ( Sn τ ) where S is the size of sample (weighted sample from [ z i ] ) and n τ is the number of quantiles, giving a total of O ( n + Sn τ ) . In practice, we consider S = 1000 and n τ = 100 which works well, and hence does not increase with the batch size. This too scales linearly with batch size n , and hence does not drastically increase the complexity.

Remark: Algorithms 1, and 2 provide the pseudocode for the quantile activation. For stable training, in practice, we prepend and append the quantile activation with BatchNorm layers.

Why QACT is robust to distortions? To understand the idea behind quantile activation, consider a 153 simple toy example in figure 2. For ease of visualization, assume that the input features (blue) are in 2 154 dimensions, and also assume that the line of the linear projection is given by the red line in figure 2a. 155 Now, assume that the blue input features are rotated, leading to a different distribution (indicated here 156 by orange). Since activations are essentially (unnormalized) signed distances from the line, we plot 157 the histograms corresponding to the two distributions in figure 2b. As expected, these distributions 158 are different. However, after performing the quantile activation in equation 3, we have that both are 159 uniform distribution. This is illustrated in figures 2c and 2d. This behaviour has a normalizing effect 160 across different distributions, and hence has better distribution generalization than other activations. 161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

3 Training with QACT

In the previous section, we described the procedure to adapt a single neuron to its context distribution. In this section we discuss how this extends to the Dense/Convolution layers, the loss functions to train the network and the inference aspect.

Extending to standard layers: The extension of equation 3 to dense outputs is straightforward. A typical output of the dense layer would be of the shape ( B,N c ) -B denotes the batch size, N c denotes the width of the network. The principle is The context distribution of a neuron is all the values which are obtained using the same parameters . In this case, each of the values across the ' B ' dimension are considered to be samples from the context distribution.

For a convolution layer, the typical outputs are of the form -( B,N c , H, W ) -B denotes the size of the batch, N c denotes the number of channels, H,W denotes the sizes of the images. In this case we should consider all values across the 1st,3rd and 4th dimension to be from the context distribution, since all these values are obtained using the same parameters. So, the number of samples would be B × H × W .

Loss Functions: One can use any differentiable loss function to train with quantile activation. We specifically experiment with the standard Cross-Entropy Loss, Triplet Loss, and the recently proposed Watershed Loss [6] (see section 4). However, if one requires that the boundaries between classes adapt to the distribution, then learning similarities instead of boundaries can be beneficial. Both Triplet Loss and Watershed Loss fall into this category. We see that learning similarities does have slight benefits when considering the embedding quality.

Inference with QACT: As stated before, we want to assign a label for classification based on the context of the sample. There exist two approaches for this - (1) One way is to keep track of the quantiles and the estimated densities for all neurons and use it for inference. This allows inference for a single sample in the traditional sense. However, this also implies that one would not be able to assign classes based on the context at evaluation. (2) Another way is to make sure that, even for inference on a single sample, we include several samples from the context distribution, but only use the output for a specific sample. This allows one to assign classes based on the context. In this article, we follow the latter approach.

Quantile Classifier: Observe that the proposed QACT (without normalization) returns the values in [0 , 1] which can be interpreted as probabilities. Hence, one can also use this for the classification layer. Nonetheless, two changes are required - (i) Traditional softmax used in conjunction with negativelog-likelihoood loss already considers 'relative' activations of the classification in normalization. However, QACT does not. Hence, one should use Binary-Cross-Entropy loss with QACT, which amounts to one-vs-rest classification. (ii) Also, unlike a neuron in the middle layers, the bias of the neuron in the classification layer depends on the class imbalance. For instance, with 10 classes, one would have only 1 / 10 of the samples labelled 1 and 9 / 10 of the samples labelled 0 . To address this, we require that the median of the outputs be at 0 . 9 , and hence weight the positive class with 0 . 9 and the negative class with 0 . 1 respectively. In this article, whenever QACT is used, we use this approach for inference.

We observe that (figures 13 and 14) using quantile classifier on the learned features in general improves the consistency of the calibration error and also leads to the reducing the calibration error. In this article, for all networks trained with quantile activation, we use quantile classifier to compute the accracies/calibration errors.

4 Evaluation

To summarize, we make the following changes to the existing classification pipeline - (i) Replace the usual ReLU activation with QACT and (ii) Use triplet or watershed loss instead of standard cross entropy loss. We expect this framework to learn context dependent features, and hence be robust to distortions. (iii) Also, use quantile classifier to train the classifier on the embedding for better calibrated probabilities.

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

(a) Accuracy

(b) Top-Label Calibration Error

0.9

0.8

0.7

0.6

Method

Resnet18-ReLU

DenseNet-ReLU

0.5

Resnet18-Quant

DenseNet-Quant

DinoV2(s)

1

2

3

5

Severity

Method

0.30

Resnet18-ReLU

DenseNet-ReLU

Resnet18-Quant

Calib.Error(Top-Label)

0.25

DinoV2(s)

DenseNet-Quant

0.20

0.15

0.10

0.05

2

3

5

Severity

Evaluation Protocol: To evaluate our approach, we consider the two datasets developed for this purpose - CIFAR10C, CIFAR100C, TinyImagenetC [15], MNISTC[25]. These datasets have a set of 15 distortions at 5 severity levels. To ensure diversity we evaluate our method on 4 architectures - (overparametrized) LeNet, ResNet18[14] (11M parameters), VGG[35](15M parameters) and DenseNet [18](1M parameters). The code to reproduce the results can be found at https://anonymous.4open.science/r/QuantAct-2B41 .

Baselines for Comparison: To our knowledge, there exists no other framework which proposed classification based on context distribution. So, for comparison, we consider standard ReLU activation [10], pReLU [13], and SELU [20] for all the architectures stated above. Also, we compare our results with DINOv2 (small) [27] (22M parameters) which is current state-of-the-art for domain generalization. Note that for DINOv2, architecture and datasets used for training are substantially different (and substantially larger) from what we consider in this article. Nevertheless, we include the results for understanding where our proposed approach lies on the spectrum. We consider the small version of DINOv2 to match the number of parameters with the compared models.

Metrics: We consider four metrics - Accuracy (ACC), calibration error (ECE) [23] (both marginal and Top-Label) and mean average precision at K (MAP@K) to evaluate the embedding. For the case of ReLU/pReLU/SELU activation with Cross-Entropy, we use the logistic regression trained on the train set embeddings, and for QACT we use the calibrated linear classifier, as proposed above. We do not perform any additional calibration and use the probabilities. We discuss a selected set of results in the main article. Please see appendix C for more comprehensive results.

Calibration error measures the reliability of predicted probabilities. In simple words, if one predicts 100 samples with (say) probability 0.7, then we expect 70 of the samples to belong to class 1 and the rest to class 0 . This is measured using either the marginal or top-label calibration error. We refer the reader to [23] for details, which also provides an implementation to estimate the calibration error.

Remark: For all the baselines we use the standard Cross-Entropy loss for training. For inference on corrupted datasets, we retrain the last layer with logistic regression on the train embedding and evaluate it on test/corrupted embedding. For QACT, we as a convention use watershed loss unless otherwise stated, for training. For inference, we train the Quantile Classifier on the train embedding and evaluate it on test/corrupted embedding.

The proposed QACT approach is robust to distortions: In fig. 3 we compare the proposed QACT approach with predominant existing pipeline - ReLU+Cross-Entropy and DINOv2(small) on CIFAR10C. In figure 3a we see that as the severity of the distortion increases, the accuracy of ReLU and DINOv2 drops significantly. On the other hand, while at small distortions the results are comparable, as severity increases QACT performs substantially better than conventional approaches.

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

(a)

(b)

(c)

Method

0.9

Method

Triplet

ReLU

08°0

Watershed

pReLU

Cross-Entropy

0.8

SeLU

Quant

Mean.Avg.Precision

0.75

0.7

0.70

0.6

S9'0

0.5

0.60

0.4

Severity

3

0

1

2

Severity

3

0.08

Method

ReLU

pReLU

0.07

SeLU

Quant

Calib.Error(Marginal)

0.06

0.05

0.04

00

0.02

0.01

0

1

2

Severity

3

5

(a)

(b)

CIFAR100-Quant

CIFAR100-ReLU

0.7

CIFAR100-DinoV2(s)

Tinylmagenet-Quant

0.6

Tinylmagenet-ReLU

Tinylmagenet-DinoV2(s)

0.5

0.4

0.3

0.2

0.1

3

4

5

Severity

0.014

CIFAR100-Quant

CIFAR100-ReLU

0.012

CIFAR100-DinoV2(s)

Tinylmagenet-Quant

Tinylmagenet-ReLU

Calib.Error(Marginal)

0.010

Tinylmagenet-DinoV2(s)

0.008

0.006

0.004

0.002

3

4

Severity

At severity 5 , QACT outperforms DINOv2. On the other hand, we observe that in figure 3b, the calibration error stays consistent across distortions.

How much does QACT depend on the loss function? Figure 4a compares the watershed classifier with other popular losses - Triplet and Cross-Entropy. We see that all the loss functions perform comparably when used in conjunction with QACT. We observe that watershed has a slight improvement when considering MAP and hence, we consider that as the default setting. However, we point out that QACT is compatible with several loss functions as well.

QACT vs ReLU/pReLU/SELU activations: To verify that most existing activations do not share the robustness property of QACT, we compare QACT with other activations in figures 4b and 4c. We observe that QACT is greatly more robust with respect to distortions in both accuracy and calibration error than other activation functions.

Results on Larger Datasets: To verify that our observations hold for larger datasets, we use CIFAR100C/TinyImagenetC to compare the proposed QACT+watershed with existing approaches. We observe on figure 5 that QACT performs comparably well as DINOv2, although DINOv2(s) has 22M parameters and is trained on significantly larger datasets. Moreover, we also observe that

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

QACT has approximately constant calibration error across distortions, as opposed to a significantly increasing calibration error for ReLU or DINOv2.

5 Conclusion And Future Work

To summarize, traditional classification systems do not consider the 'context distributions' when assigning labels. In this article, we propose a framework to achieve this by - (i) Making the activation adaptive by using quantiles and (ii) Learning a kernel instead of the boundary for the last layer. We show that our method is more robust to distortions by considering MNISTC, CIFAR10C, CIFAR100C, TinyImagenetC datasets across varying architectures.

The scope of this article is to provide a proof of concept and a framework for performing inference in a context-dependent manner. We outline several potential directions for future research:

The key idea in our proposed approach is that the quantiles capture the distribution of each neuron from the batch of samples, providing outputs accordingly. This poses a challenge for inference, and we have discussed two potential solutions: (i) remember the quantiles and density estimates for single sample evaluation, or (ii) ensure that a batch of samples from the same distribution is processed together. We adopt the latter method in this article. An alternative approach would be to learn the distribution of each neuron using auxiliary loss functions, adjusting these distributions to fit the domain at test time. This gives us more control over the network at test time compared to current workflows.

Since the aim of the article was to establish a proof-of-concept, we did not focus on scaling, and use only a single GPU for all the experiments. To extend it to multi-GPU training, one needs to synchronize the quantiles across GPU, in a similar manner as that for BatchNormalization. We expect this to improve the statistics, and to allow considerably larger batches of training.

On the theoretical side, there is an interesting analogy between our quantile activation and how a biological neuron behaves. It is known that when the inputs to a biological neuron change, the neuron adapts to these changes [7]. Quantile activation does something very similar, which leads to an open question - can we establish a formal link between the adaptability of a biological neuron and the accuracy of classification systems?

Another theoretical direction to explore involves considering distributions not just at the neuron level, but at the layer level, introducing a high-dimensional aspect to the problem. The main challenge here is defining and utilizing high dimensional quantiles , which remains an open question [21].

Broad Impact: In this article, we propose an approach to maintain calibration and generalization across small distortions. While, we do not foresee any direct societal consequences of our work, we expect the potential future consequences of the technique to reduce the bias in the following ways - (i) Since we do not assume normal distribution, our approach is likely to handle long tails better than existing methods. This would help in reducing the dataset bias where marginal groups are less represented. (ii) Note that the output of each QACT layer is a uniform distribution. This can allow us to understand the working of each layer in isolation and possibly reduce the black-box nature of the current classification systems. (iii) Moreover, by directly modifying the context distribution of each neuron, one can easily make the networks more reliable without resorting to expensive re-training the entire network.

References

Kei Akuzawa, Yusuke Iwasawa, and Yutaka Matsuo. Adversarial invariant feature learning with accuracy constraint for domain generalization. In European Conf. Mach. Learning , 2019.

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

Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. arXiv:1607.06450 , 2016.

Jens Behrmann, Paul Vicol, Kuan-Chieh Wang, Roger B. Grosse, and Jörn-Henrik Jacobsen. 309 Understanding and mitigating exploding inverses in invertible neural networks. In Artificial 310 Intelligence and Statistics , 2021. 311

312

313

Aditya Challa, Snehanshu Saha, and Soma Dhavala. Quantprob: Generalizing probabilities along with predictions for a pre-trained classifier. arXiv:2304.12766 , 2023.

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

Aditya Challa, Sravan Danda, and Laurent Najman. A novel approach to regularising 1nn classifier for improved generalization. arXiv:2402.08405 , 2024.

Colin WG Clifford, Michael A Webster, Garrett B Stanley, Alan A Stocker, Adam Kohn, Tatyana O Sharpee, and Odelia Schwartz. Visual adaptation: Neural, psychological and computational aspects. Vision research , 2007.

Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In Int. Conf. on Learning Representations , 2021.

Qi Dou, Daniel Coelho de Castro, Konstantinos Kamnitsas, and Ben Glocker. Domain generalization via model-agnostic learning of semantic features. In Neural Inform. Process. Syst. , 2019.

Kunihiko Fukushima. Correction to "visual feature extraction by a multilayered network of analog threshold elements". IEEE Trans. Syst. Sci. Cybern. , 1970.

Muhammad Ghifary, W. Bastiaan Kleijn, Mengjie Zhang, and David Balduzzi. Domain generalization for object recognition with multi-task autoencoders. In Proc. Int. Conf. Comput. Vision , 2015.

Zhongyi Han, Guanglin Zhou, Rundong He, Jindong Wang, Tailin Wu, Yilong Yin, Salman H. 331 Khan, Lina Yao, Tongliang Liu, and Kun Zhang. How well does gpt-4v(ision) adapt to 332 distribution shifts? A preliminary investigation. arXiv:2312.07424 , 2023. 333

Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: 334 Surpassing human-level performance on imagenet classification. In Proc. Int. Conf. Comput. 335 Vision , 2015. 336

Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image 337 recognition. In Proc. Conf. Comput. Vision Pattern Recognition , 2016. 338

Dan Hendrycks and Thomas G. Dietterich. Benchmarking neural network robustness to common 339 corruptions and perturbations. In Int. Conf. on Learning Representations , 2019. 340

Shoubo Hu, Kun Zhang, Zhitang Chen, and Laiwan Chan. Domain generalization via multido341 main discriminant analysis. In Uncertainity in Artificial Intelligence , 2019. 342

343

344

345

Bincheng Huang, Si Chen, Fan Zhou, Cheng Zhang, and Feng Zhang. Episodic training for domain generalization using latent domains. In Int. Conf. on Cogni. Systems and Signal Process. , 2020.

346

347

348

349

350

351

352

353

Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017 , pages 2261-2269. IEEE Computer Society, 2017. doi: 10.1109/CVPR.2017.243. URL https://doi.org/10.1109/CVPR.2017.243 .

Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Int. Conf. Mach. Learning , 2015.

Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. In Neural Inform. Process. Syst. , 2017.

Roger Koenker. Quantile Regression . Econometric Society Monographs. Cambridge University 354 Press, 2005. doi: 10.1017/CBO9780511754098. 355

Agustinus Kristiadi, Matthias Hein, and Philipp Hennig. Being bayesian, even just a bit, fixes 356 overconfidence in relu networks. In Int. Conf. Mach. Learning , 2020. 357

Ananya Kumar, Percy Liang, and Tengyu Ma. Verified uncertainty calibration. In Neural Inform. 358 Process. Syst. , 2019. 359

Zhong Li and Matthijs van Leeuwen. Explainable contextual anomaly detection using quantile 360 regression forests. Data Min. Knowl. Discov. , 2023. 361

Norman Mu and Justin Gilmer. MNIST-C: A robustness benchmark for computer vision. 362 arXiv:1906.02337 , 2019. 363

Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann 364 machines. In Int. Conf. Mach. Learning , 2010. 365

366

367

368

369

370

371

Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel Haziza, Francisco Massa, Alaaeldin El-Nouby, Mahmoud Assran, Nicolas Ballas, Wojciech Galuba, Russell Howes, Po-Yao Huang, Shang-Wen Li, Ishan Misra, Michael G. Rabbat, Vasu Sharma, Gabriel Synnaeve, Hu Xu, Hervé Jégou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. Dinov2: Learning robust visual features without supervision. arXiv:2304.07193 , 2023.

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Trans. Knowl. Data Eng. , 2010.

Vihari Piratla, Praneeth Netrapalli, and Sunita Sarawagi. Efficient domain generalization via common-specific low-rank decomposition. In Int. Conf. Mach. Learning , 2020.

Tejas Prashanth, Snehanshu Saha, Sumedh Basarkod, Suraj Aralihalli, Soma S. Dhavala, Sriparna Saha, and Raviprasad Aduri. Lipgene: Lipschitz continuity guided adaptive learning rates for fast convergence on microarray expression data sets. IEEE ACM Trans. Comput. Biol. Bioinform. , 2022.

Tim Salimans and Diederik P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Neural Inform. Process. Syst. , 2016.

Aditi Seetha, Satyendra Singh Chouhan, Emmanuel S Pilli, Vaskar Raychoudhury, and Snehanshu Saha. Dievd-sf: Disruptive event detection using continual machine learning with selective forgetting. IEEE Transactions on Computational Social Systems , 2024.

Hogeon Seo, Seunghyoung Ryu, Jiyeon Yim, Junghoon Seo, and Yonggyun Yu. Quantile autoencoder for anomaly detection. In AAAI,Workshop on AI for Design and Manufacturing (ADAM) , 2022.

Zheyan Shen, Peng Cui, Tong Zhang, and Kun Kuang. Stable learning via sample reweighting. 388 In AAAI Conf. on Artificial Intelligence , 2020. 389

Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale 390 image recognition. In Int. Conf. on Learning Representations , 2015. 391

Anuj Tambwekar, Anirudh Maiya, Soma S. Dhavala, and Snehanshu Saha. Estimation and 392 applications of quantiles in deep binary classification. IEEE Trans. Artif. Intell. , 2022. 393

Fuzhen Zhuang, Zhiyuan Qi, Keyu Duan, Dongbo Xi, Yongchun Zhu, Hengshu Zhu, Hui Xiong, 394 and Qing He. A comprehensive survey on transfer learning. Proc. IEEE , 2021. 395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

0.9

0.8

0.7

0.6

Method

Resnet18-ReLU

DenseNet-ReLU

0.5

Resnet18-Quant

DenseNet-Quant

DinoV2(s)

1

2

3

5

Severity

0.08

Method

Resnet18-ReLU

0.07

DenseNet-ReLU

Resnet18-Quant

Calib.Error(Marginal)

0.06

DenseNet-Quant

DinoV2(s)

0.05

0.04

0.03

0.02

0.01

3

Severity

0.85

0.80

0.75

Mean.Avg.Precision

0.70

0.65

0.60

Method

0.55

Resnet18-ReLU

DenseNet-ReLU

0.50

Resnet18-Quant

DenseNet-Quant

0.45

DinoV2(s)

1

2

3

5

Severity

Method

0.30

Resnet18-ReLU

DenseNet-ReLU

Resnet18-Quant

Calib.Error(Top-Label)

0.25

DinoV2(s)

DenseNet-Quant

0.20

0.15

0.10

0.05

3

5

Severity

A Experiment details for figure 1

We consider the features obtained from ResNet18 with both QACT and RelU activations for the datasets of CIFAR10C with gaussian_noise at all the severity levels. Hence, we have 6 datasets in total. To use TSNE for visualization, we consider 1000 samples from each dataset and obtain the combined TSNE visualizations. Each figure shows a scatter plot of the 2d visualization for the corresponding dataset.

B Compute Resources and Other Experimental Details

All experiments were performed on a single NVidia GPU with 32GB memory with Intel Xeon CPU (10 cores). For training, we perform an 80:20 split of the train dataset with seed 42 for reproducibility. All networks are initialized using default pytorch initialization technique.

We use Adam optimizer with initial learning rate 1 e -3 . We use ReduceLRonPlateau learning rate scheduler with parameters - factor=0.1, patience=50, cooldown=10, threshold=0.01, thresh-old_mode=abs, min_lr=1e-6. We monitor the validation accuracy for learning rate scheduling. We also use early_stopping when the validation accuracy does not increase by 0 . 001 .

C Extended Results Section

Comparing QACT + watershed and ReLU+Cross-Entropy: Figure 6 shows the corresponding 411 results. The first experiment compares QACT + watershed with ReLU + Cross-Entropy on two 412 standard networks - ResNet18 and DenseNet. With respect to accuracy, we observe that while at 413 severity 0 , ReLU + Cross-Entropy slightly outperforms QACT + watershed, as severity increases 414 QACT + watershed is far more stable. We even outperform DinoV2(small) (22M parameters) at 415 severity 5 . Moreover, with respect to calibration error, we see a consistent trend across distortions. 416 As [5] argues, this helps in building more robust systems compared to one where calibration error 417 increases across distortions. 418

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

0.875

Method

0.850

Triplet

Watershed

0.825

Cross-Entropy

0.800

0.775

0.750

0.725

0.700

0.675

2

Severity

3

0.040

0.038

Calib.Error(Marginal)

0.036

0.034

0.032

Method

Triplet

0.030

Watershed

Cross-Entropy

1

2

3

4

5

Severity

Method

Triplet

0.80

Watershed

Cross-Entropy

Mean.Avg.Precision

0.75

0.70

0.65

0.60

1

2

3

4

5

Severity

Method

0.18

Triplet

Watershed

0.16

Cross-Entropy

Calib.Error(Top-Label)

0.14

0.12

0.10

0.08

0.06

0.04

1

2

3

4

5

Severity

Does loss function make a lot of difference? Figure 7 compares three different loss functions 419 Watershed, Triplet and Cross-Entropy when used in conjunction with QACT. We observe similar 420 trends across all loss functions. However, Watershed performs better with respect to Mean Average 421 Precision (MAP) and hence we use this as a default strategy. 422

423

424

425

426

427

Why Mean-Average-Precision? - We argue that the key indicator of distortion invariance should be the quality of embedding. While, accuracy (as measured by a linear classifier) is a good metric, a better one would be to measure the Mean-Average-Precision. With respect to calibration error, due to the scale on the Y-axis, the figures suggest reducing calibration error. However, the standard deviations overlap, and hence, these are assumed to be constant across distortions.

428

429

430

431

432

433

434

435

436

437

438

439

How well does watershed perform when used with ReLU activation? Figure 8 shows the corresponding results. We observe that both the watershed loss and cross-entropy have large overlaps in the standard deviations at all severity levels. So, this shows that, when used in conjunction with ReLU watershed and cross-entropy loss are very similar. But in conjunction with QACT, we see that watershed has a slightly higher Mean-Average-Precision.

What if we consider an easy classification task? In figure 9, we perform the comparison of QACT+Watershed and ReLU and cross-entropy on MNISTC dataset. Across different architectures, we observe a lot less variation (standard deviation) of QACT+Watershed compared to RelU and cross-entropy. This again suggests robustness against distortions of QACT+Watershed.

Comparing with other popular activations: Figures 10 and 11 shows the comparison of QACT with ReLU, pReLU and SeLU. We observe the same trend across ReLU, pReLU and SeLU, while QACT is far more stable across distortions.

Results on CIFAR100/TinyImagenetC: Figure 12 compares QACT+Watershed and ReLU+Cross440 Entropy on CIFAR100C dataset. We also include the results of QACT+Cross-Entropy vs. 441 ReLU+Cross-Entropy on TinyImagenetC. The results are consistent with what we observe on 442 CIFAR10C, and hence, draw the same conclusions as before. 443

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

0.9

Method

Resnet18-CrossEntropy

DenseNet-CrossEntropy

0.8

Resnet18-Watershed

DenseNet-Watershed

0.7

0.6

0.5

0.4

2

Severity

3

4

5

0.09

Method

Resnet18-CrossEntropy

0.08

DenseNet-CrossEntropy

Resnet18-Watershed

Calib.Error(Marginal)

0.07

DenseNet-Watershed

0.06

0.05

0.04

0.03

0.02

0.01

3

D

Severity

0.85

Method

Resnet18-CrossEntropy

0.80

DenseNet-CrossEntropy

Resnet18-Watershed

0.75

DenseNet-Watershed

Mean.Avg.Precision

0.70

0.65

0.60

0.55

0.50

0.45

1

2

3

5

Severity

0.40

Method

Resnet18-CrossEntropy

DenseNet-CrossEntropy

0.35

Resnet18-Watershed

DenseNet-Watershed

Calib.Error(Top-Label)

0.30

0.25

0.20

0.15

0.10

0.05

3

Severity

(a) Accuracy

(b) Mean Average Precision (MAP@100)

1.0

0.8

0.6

0.4

Method

LeNet

0.2

VGG

Resnet18

Densenet

Quant

ReLU

Activation

1.0

0.9

0.8

Mean.Avg.Precision

0.7

0.6

0.5

Method

0.4

LeNet

VGG

0.3

Resnetl8

Densenet

Quant

ReLU

Activation

Method

LeNet

0.8

VGG

Resnet18

Densenet

Calib.Error(Top-Label)

0.6

0.4

0.2

0.0

Quant

ReLU

Activation

0.175

Method

LeNet

VGG

0.150

Resnet18

Densenet

Calib.Error(Marginal)

0.125

oo

0.100

0.075

0.050

0.025

0.000

Quant

ReLU

Activation

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

Method

0.9

ReLU

pReLU

SeLU

0.8

Quant

0.7

0.6

0.5

0.4

0

2

3

Severity

Method

ReLU

0.08

pReLU

SeLU

Quant

Calib.Error(Marginal)

0.06

0.04

0.02

2

3

Severity

0.9

Method

ReLU

pReLU

0.8

SeLU

Quant

Mean.Avg.Precision

0.7

0.6

0.5

0

2

3

4

5

Severity

0.40

Method

ReLU

0.35

pReLU

SeLU

Calib.Error(Top-Label)

0.30

Quant

0.25

0.20

0.15

0.10

0.05

2

3

4

5

Severity

0.9

Method

ReLU

pReLU

0.8

SeLU

Quant

0.7

0.6

0.5

0.4

0

1

2

3

5

Severity

Method

0.08

ReLU

pReLU

0.07

SeLU

Quant

Calib.Error(Marginal)

0.06

0.05

0.04

0.03

0.02

0.01

0

1

2

E

Severity

Method

ReLU

0.8

pReLU

SeLU

Quant

Mean.Avg.Precision

0.7

0.6

0.5

0

2

3

4

5

Severity

0.35

Method

ReLU

0.30

pReLU

SeLU

Quant

Calib.Error(Top-Label)

0.25

0.20

0.15

0.10

0.05

0

1

2

3

4

5

Severity

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

CIFAR100-Quant

CIFAR100-ReLU

0.7

CIFAR100-DinoV2(s)

Tinylmagenet-Quant

0.6

Tinylmagenet-ReLU

Tinylmagenet-DinoV2(s)

0.5

0.4

0.3

0.2

0.1

3

Severity

CIFAR100-Quant

CIFAR100-ReLU

CIFAR100-DinoV2(s)

0.45

Tinylmagenet-Quant

Tinylmagenet-ReLU

0.40

Tinylmagenet-DinoV2(s)

Mean.Avg.Precision

0.35

0.30

0.25

0.20

0.15

0.10

2

3

Severity

CIFAR100-Quant

CIFAR100-ReLU

CIFAR100-DinoV2(s)

0.6

Tinylmagenet-Quant

Tinylmagenet-ReLU

Tinylmagenet-DinoV2(s)

0.5

Calib.Error(Top-Label)

0.4

0.3

0.2

0.1

1

3

Severity

0.014

CIFAR100-Quant

CIFAR100-ReLU

CIFAR100-DinoV2(s)

0.012

Tinylmagenet-Quant

Tinylmagenet-ReLU

Calib.Error(Marginal)

0.010

Tinyimagenet-DinoV2(s)

0.008

0.006

0.004

0.002

3

牛

Severity

0.9

ResNet18-CalibClf

Method

DinoV2(s)-CalibClf

ResNet18-LinearClf

0.8

DinoV2(s)-LinearClf

0.7

0.6

0.5

2

Severity

3

D

0.08

Method

ResNet18-CalibClf

0.07

DinoV2(s)-CalibClf

ResNet18-LinearClf

0.06

DinoV2(s)-LinearClf

Calib.Error(Marginal)

0.05

0.04

0.03

0.02

0.01

2

3

4

Severity

0.85

Method

ResNet18-CalibClf

0.80

DinoV2(s)-CalibClf

ResNet18-LinearClf

0.75

DinoV2(s)-LinearClf

Mean.Avg.Precision

0.70

0.65

0.60

0.55

0.50

1

2

3

4

5

Severity

Method

0.30

ResNet18-CalibClf

DinoV2(s)-CalibClf

ResNet18-LinearClf

Calib.Error(Top-Label)

0.25

DinoV2(s)-LinearClf

0.20

0.15

0.10

0.05

1

2

3

4

5

Severity

(a) Accuracy

(b) Mean Average Precision (MAP@100)

(c) Marginal Calibration Error

(d) Top-Label Calibration Error

Method

0.7

ResNet18-CalibClf

DinoV2(s)-CalibClf

ResNet18-LinearClf

0.6

DinoV2(s)-LinearClif

0.5

0.4

0.3

0.2

2

3

Severity

0.014

Method

ResNet18-CalibClf

DinoV2(s)-CalibClf

0.012

ResNet18-LinearClf

DinoV2(s)-LinearClf

Calib.Error(Marginal)

0.010

0.008

0.006

0.004

3

Severity

0.55

Method

ResNet18-CalibClf

0.50

DinoV2(s)-CalibClf

ResNetl8-LinearClf

0.45

DinoV2(s)-LinearClf

Mean.Avg.Precision

0.40

0.35

0.30

0.25

0.20

3

Severity

0.6

Method

ResNet18-CalibClf

DinoV2(s)-CalibClf

0.5

ResNetl8-LinearClf

Calib.Error(Top-Label)

DinoV2(s)-LinearCIf

0.4

0.3

0.2

0.1

3

Severity

Effect of Quantile Classifier: Figures 13 and 14 shows the effect of quantile classifier on standard 444 ResNet10/DinoV2 outputs with CIFAR10C/CIFAR100C datasets. While the accuracy values are 445 almost equivalent, we observe a 'flatter' trend of the calibration errors, sometimes reducing the error 446 as in the case of CIFAR100C. 447

448

449

450

451

452

453

454

455

456

457

458

459

D Watershed Loss

The authors in [6] proposed a novel classifier watershed classifier , which works by learning similarities instead of the boundaries. Below we give the brief idea of the loss function, and refer the reader to the original paper for further details.

Let ( x i , y i ) denote the samples in each batch, and let f θ denote the embedding network. f θ ( x i ) denotes the corresponding embedding.

Starting from randomly selected seeds in the batch, propagate the labels to all the samples. Let ˆ y i denote the estimated samples. For each f θ ( x i ) and for each label l , obtain the nearest neighbour in the samples in the set,

that is, all the samples of class l labelled correctly. Denote this nearest neighbour using f θ ( x i,l, 1 nn ) .

Then the loss is given by,

Why Watershed Loss?: Observe that the loss in equation 10 implicitly learns representations 460 consistent with the RBF kernel, which is known to be translation invariant. Minimizing this loss 461 function, hence, will learn translation invariant kernels. This is important for obtaining networks 462 robust to distortions. 463

If one uses (say) Cross Entropy loss, then the features learned would be such that the classes are 464 linearly separable. Contrast this with watershed, which instead learns a similarity between two points 465 in a translation invariant manner. 466

Remark: Observe that the watershed loss is very similar to metric learning losses. The authors in 467 [6] claim that this offers better generalization, and show that this is consistent with 1NN classifier. 468 Moreover, they show that this classifier (without considering f θ ) has a VC dimension which is equal 469 to the number of classes. While metric learning losses are similar, there is no such guarantee with 470 respect to classification. This motivated our choice of using watershed loss over other metric learning 471 losses. 472

NeurIPS Paper Checklist 473

474

475

476

477

478

The checklist is designed to encourage best practices for responsible machine learning research, addressing issues of reproducibility, transparency, research ethics, and societal impact. Do not remove the checklist: The papers not including the checklist will be desk rejected. The checklist should follow the references and precede the (optional) supplemental material. The checklist does NOT count towards the page limit.

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

Please read the checklist guidelines carefully for information on how to answer these questions. For each question in the checklist:

You should answer [Yes] , [No] , or [NA] .

[NA] means either that the question is Not Applicable for that particular paper or the relevant information is Not Available.

Please provide a short (1-2 sentence) justification right after your answer (even for NA).

The checklist answers are an integral part of your paper submission. They are visible to the reviewers, area chairs, senior area chairs, and ethics reviewers. You will be asked to also include it (after eventual revisions) with the final version of your paper, and its final version will be published with the paper.

The reviewers of your paper will be asked to use the checklist as one of the factors in their evaluation. While "[Yes] " is generally preferable to "[No] ", it is perfectly acceptable to answer "[No] " provided a proper justification is given (e.g., "error bars are not reported because it would be too computationally expensive" or "we were unable to find the license for the dataset we used"). In general, answering "[No] " or "[NA] " is not grounds for rejection. While the questions are phrased in a binary way, we acknowledge that the true answer is often more nuanced, so please just use your best judgment and write a justification to elaborate. All supporting evidence can appear either in the main paper or the supplemental material, provided in appendix. If you answer [Yes] to a question, in the justification please point to the section(s) where related material for the question can be found.

IMPORTANT, please:

Delete this instruction block, but keep the section heading 'NeurIPS paper checklist" ,

Keep the checklist subsection headings, questions/answers and guidelines below.

Do not modify the questions and only use the provided macros for your answers .

1. Claims

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

Answer: [Yes]

Justification: Yes. The main contribution is a proof-of-concept that one should move away from single point estimation for better generalization across distortions.

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: Since, the scope is only a proof-of-concept, we have not considered scaling to large datasets/models in this work. Scaling these ideas would require rethinking current strategies and does not fit perfectly into existing framework. Moreover, the proposed approach slightly more resource intensive than ReLU activation.

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: [NA]

Justification: We do not consider theoretical aspects in this article. While there are interesting theoretical connections, we leave it for future work.

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: We provide an anonymous link to generate all the results provided in the article. Moreover, we describe all the hyper-parameters used in the appendix as well.

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: We provide the code using an anonymous link at https://anonymous. 4open.science/r/QuantAct-2B41 . The datasets are all public datasets which can be downloaded.

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 explain the experimental setting in complete detail in the article. 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: The datasets used incorporate 15 kinds of distortions across 5 severity levels. We report the error bars across the 15 kinds of distortions which should provide a good picture of the reliability of the results.

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: Yes. we include the entire information about the compute resources in the appendix.

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: We have tried to maintain the double-blind policy to the maximum extent possible.

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: [Yes]

Justification: In this article we propose a novel way to allow robustness against distortions. We do not expect any negative societal impacts. There could be positive societal impact since this can potentially stop hallucinations/bias of the ML models. 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 use any datasets/models that have high risk for misuse.

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: We have cited the original articles of all the datasets/models we use in the article. We have ensured that these can be used with credit for academic purposes.

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: [Yes]

Justification: We share the code at https://anonymous.4open.science/r/ QuantAct-2B41 .

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 crowdsourcing nor research with human subjects. 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 crowdsourcing nor research with human subjects. 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.

818

819

820

821

822

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:
comments: SUMMARY:
The paper introduces a novel activation function called Quantile Activation (QACT), which aims to improve the robustness of neural networks against various data distortions. The authors propose an end-to-end framework that combines QACT with modified loss functions and quantile classifiers, evaluating their approach on several benchmark datasets.

STRENGTHS:
1. The paper is well organized and clearly written.
1. The paper delivers useful empirical and theoretical insights.
1. The experimental results showcase the superiority of the proposed method.

WEAKNESSES:
1. The proposed method seems a bit complex, which may lead to over-fitting in scenarios with limited training data.
1. Although the experiments are promising, it remains unclear how well the proposed method would scale to larger datasets or more complex tasks beyond those tested in the paper.
1. I feel that the evaluations are somewhat limited as only a few methods are compared against, lacking the most recent SOTAs. This limits the understanding of the real technical contribution of the proposed method.

QUESTIONS:
Please see above.

LIMITATIONS:
The limitations should be discussed in the main paper, yet they are provided in the checklist.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2024-07-12

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper introduces Quantile Activation (QACT) to enhance classification model robustness against distributional shifts. Unlike traditional classifiers, QACT outputs the relative quantile of a sample in its context distribution, allowing for context-dependent classification. Validated on datasets like CIFAR10C and MNISTC, QACT improves generalization and robustness, outperforming state-of-the-art models like DINOv2 under large distortions. The paper details QACT's implementation and suggests future research directions, including scaling and exploring theoretical links to biological neurons.\n\nSTRENGTHS:\nThe paper is notable for its originality in proposing a context-aware activation function, demonstrates high quality through extensive validation, and has significant potential for enhancing generalization in classification models. The innovative use of quantile-based activations opens new opportunities for research and applications in machine learning.\n\nWEAKNESSES:\n- Lack of Clarity on Context Dependency\n\nThe concept of context dependency being batch-dependent is not clearly explained until the conclusion of the paper. This crucial detail should be introduced and elaborated on earlier to provide a better understanding of the method.\n\n- Unclear Motivation in Introduction\n\nThe motivation and fundamental problem discussed in the introduction are not clearly articulated. The authors mention that, unlike NLP where context is considered, general classification systems do not incorporate context. However, in Vision Transformers (ViTs), image patches are treated similarly to words in NLP \"[...The meaning of a word is dependent on the context of the word. However, to our knowledge, this has not been considered for general classification systems.]\". In ViTs, an image patch is considered like a word, and the context comes from the other image patches.\n\n- Insufficient Related Work on Robustness\n\nThe paper lacks a comprehensive review of related work concerning robustness to input distortions. Including a discussion of existing methods and how QACT compares or improves upon them would strengthen the paper.\n\n- Limited Comparative Analysis\n\nThe comparison with other methods addressing robustness to input distortions is insufficient. The authors primarily compare QACT with DINOv2-Small, which is not a standard model for robustness. Including comparisons with other state-of-the-art methods specifically designed for robustness would provide a more complete evaluation of QACT's performance.\n\nQUESTIONS:\nN/A\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe authors propose a new activation function called quantile activation (QACT) which outputs the relative quantile of the sample in the context distribution. Furthermore, the paper validates the proposed activation across several experimental settings, and compare it with conventional techniques. They test robustness against distortions, and find that the proposed activation can achieve a significantly higher generalization across distortions than the conventional classifiers, across different architectures.\n\nSTRENGTHS:\nFirst, the authors develop existing approach in calibrating a pre-trained classifier to the level of a neuron. Thus, suitable forward and backward propagation equations required for learning are derived. Second, the authors also show that the extension can produce context dependent outputs at the level of each neuron of the neural network.\n\nWEAKNESSES:\nThe writing of the paper meets the standard, but the notations are confusing. Nevertheless, it would be much better if the authors can polish and clarify them. For instance:\n1. in line 107, the authors claim that ‘Assign $\\mathbf y=1$ whenever $\\mathbf y > (1-\\tau)^{th}$ quantile of $\\mathbf z$’. It seems that $\\mathbf z$ is a vector and is impossible to have a vector be larger than a scalar. \n2. The authors write $z_i$ and $\\mathbf z_i$ alternatively to mean the same quantity. Similar situations occur when the authors write $z$ and $\\mathbf z$ (see line 119, Eqn. (4)), or QACT$(\\textbf z)$ and QACT$(\\mathbf z)$ (see lines 119 and 124).\n3. The authors use bold lowercase letters to represent vectors (e.g., Eq. (1)) and variable distributions (e.g., lines 105, 106). Also, what is the difference between bold lowercase letters and normal lowercase letters?\nFurther clarifications can increase the readability of the paper.\n\nQUESTIONS:\nBelow are some questions that want to ask. Please clarify:\n1. In the backward propagation, it is essential to estimate the density. Nevertheless, there are many ways in estimating the density, and different ways have different computation complexity and the accuracy. Please justify your choice: e.g., recently generative models are prominent way to estimate the density. If the methods can produce better estimations without much computation time, it is worth to switch the kernel estimation to the generative approach.\n2. Once when the samples are large enough, it may be necessary to train using batch. It is curious how to combine the estimations due to various batches. Could you describe how to integrate the estimations obtained from various batches?\n3. The worst scenario is that the estimations due to various batches vary dramatically due to the batches chosen. If, unfortunately, that two batches are drawn such that they contain extreme values (e.g., batch 1 contains extreme small values while batch 2 contains extreme large values), how to solve the problem?\n4. According to the forward and backward algorithms, the computation requires integration and kernel density estimation. Although the authors have analysed the computational complexity, they should also directly demonstrate in experiments the computational speed and memory of the proposed activation function compared to the classical activation function. Could they provide the relevant studies?\nThe current score will be adjusted according to authors’ responses.\n\nLIMITATIONS:\nPlease see the questions and weaknesses.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-07-23"}