S CARF : S ELF -S UPERVISED C ONTRASTIVE L EARNING USING R ANDOM F EATURE C ORRUPTION
A BSTRACT
Self-supervised contrastive representation learning has proved incredibly successful in the vision and natural language domains, enabling state-of-the-art performance with orders of magnitude less labeled data.
However, such methods are domainspeciﬁc and little has been done to leverage this technique on real-world tabular datasets.
We propose S CARF , a simple, widely-applicable technique for contrastive learning, where views are formed by corrupting a random subset of features.
When applied to pre-train deep neural networks on the 69 real-world, tabular classiﬁcation datasets from the OpenML-CC18 benchmark, S CARF not only improves classiﬁcation accuracy in the fully-supervised setting but does so also in the presence of label noise and in the semi-supervised setting where only a fraction of the available training data is labeled.
We show that S CARF complements existing strategies and outperforms alternatives like autoencoders.
We conduct comprehensive ablations, detailing the importance of a range of factors.
I NTRODUCTION
In many machine learning tasks, unlabeled data is abundant but labeled data is costly to collect, requiring manual human labelers.
The goal of self-supervised learning is to leverage large amounts of unlabeled data to learn useful representations for downstream tasks such as classiﬁcation.
Selfsupervised learning has proved critical in computer vision (Grill et al., 2020; Misra & Maaten, 2020;
He et al., 2020; Tian et al., 2019) and natural language processing (Song et al., 2020; Wang et al., 2019; Raffel et al., 2019).
Some recent examples include the following: Chen et al.
(2020) showed that training a linear classiﬁer on the representations learned by their proposed method, SimCLR, signiﬁcantly outperforms previous state-of-art image classiﬁers and requires 100x fewer labels to do so; Brown et al.
(2020) showed through their GPT-3 language model that by pre-training on a large corpus of text, only few labeled examples were required for task-speciﬁc ﬁne-tuning for a wide range of tasks.
A common theme of these advances is learning representations that are robust to different views or distortions of the same input; this is often achieved by maximizing the similarity between views of the same input and minimizing those of different inputs via a contrastive loss.
However, techniques to generate views or corruptions have thus far been, by and large, domain-speciﬁc (e.g. color distortion (Zhang et al., 2016) and cropping (Chen et al., 2020) in vision, and token masking (Song et al., 2020) in NLP).
Despite the importance of self-supervised learning, there is surprisingly little work done in ﬁnding methods that are applicable across domains and in particular, ones that can be applied to tabular data.
In this paper, we propose S CARF , a simple and versatile contrastive pre-training procedure.
We generate a view for a given input by selecting a random subset of its features and replacing them by random draws from the features’ respective empirical marginal distributions.
Experimentally, we test S CARF on the OpenML-CC18 benchmark (Vanschoren et al., 2013; Bischl et al., 2017; Feurer et al., 2019), a collection of 72 real-world classiﬁcation datasets.
We show that not only does S CARF pre-training improve classiﬁcation accuracy in the fully-supervised setting but does so also in the presence of label noise and in the semi-supervised setting where only a fraction of the available training data is labeled.
Moreover, we show that combining S CARF pre-training with other solutions to these problems further improves them, demonstrating the versatility of S CARF and its ability to
[Figure]
f f
Encoder [Figure] (shared weights) g g
Pre
[Figure]
(shared weights)
Maximize Similarity
InfoNCE
Unsupervised SCARF Pre-
[Figure]
learn effective task-agnostic representations. We then conduct extensive ablation studies, showing the effects of various design choices and stability to hyperparameters.
Our ablations show that S CARF ’s way of constructing views is more effective than alternatives.
We show that S CARF is less sensitive to feature scaling and is stable to various hyperparameters such as batch size, corruption rate, and softmax temperature.
R ELATED W ORKS
A number of self-supervised learning techniques have been proposed in computer vision (Zhai et al., 2019; Tung et al., 2017; Jing & Tian, 2020).
One framework involves learning features based on generated images through various methods, including using a GAN (Goodfellow et al., 2014;
Donahue et al., 2016; Radford et al., 2015; Chen et al., 2018), predicting pixels (Larsson et al., 2016), predicting colorizations (Zhang et al., 2016; Larsson et al., 2017), ensuring local and global consistency (Iizuka et al., 2017), and learning synthetic artifacts (Jenni & Favaro, 2018).
Most related to our approach are contrastive learning ones (Tian et al., 2019; Hassani & Khasahmadi, 2020;
Oord et al., 2018; Henaff, 2020; Li et al., 2016;
He et al., 2020; Bojanowski & Joulin, 2017; Wang & Gupta, 2015; Gidaris et al., 2018).
In particular, our framework is similar to SimCLR (Chen et al., 2020), which involves generating views of a single image via image-based corruptions like random cropping, color distortion and blurring; however, we generate views that are applicable to tabular data.
Self-supervised learning has had an especially large impact in language modeling (Qiu et al., 2020).
One popular approach is masked language modeling, wherein the model is trained to predict input tokens that have been intentionally masked out (Devlin et al., 2018; Raffel et al., 2019; Song et al., 2019) as well as enhancements to this approach (Liu et al., 2019; Dong et al., 2019; Bao et al., 2020; Lample & Conneau, 2019; Joshi et al., 2020) and variations involving permuting the tokens (Yang et al., 2019; Song et al., 2020). Denoising autoencoders have been used by training them to reconstruct the input from a corrupted version (produced by, for example, token masking, deletion, and inﬁlling)
(Lewis et al., 2019; Wang et al., 2019; Freitag & Roy, 2018).
Contrastive approaches uniformly
M } size q deﬁne ˜ x i
) ∈ R M let z ( i ) =
g (cid:0) f (cid:0) x
( i ) (cid:1)(cid:1) ,
˜ z ( i ) = g (cid:0) f (cid:0) ˜ x ( i ) (cid:1)(cid:1) , for i ∈ [ N ] .
for
7: let s i,j
= z ( i ) (cid:62)
( j
˜
( j
, for i, j ∈ [ N ] .
# pairwise similarity.
8: deﬁne L
[Table]
[Table] [Table] [Table] : end for 11: return encoder network f . include randomly replacing words and distinguishing between real and fake phrases (Collobert et al., 2011; Mnih & Kavukcuoglu, 2013), random token replacement (Mikolov et al., 2013;
Clark et al., 2020), and adjacent sentences (Joshi et al., 2020; Lan et al., 2019; de Vries et al., 2019).
Within the contrastive learning framework, the choice of loss function is signiﬁcant.
InfoNCE (Gutmann & Hyvärinen, 2010; Oord et al., 2018), which can be interpreted as a non-parametric estimation of the entropy of the representation (Wang & Isola, 2020), is a popular choice.
Since then there have been a number of proposals (Zbontar et al., 2021; Grill et al., 2020; Hjelm et al., 2018); however, we show that InfoNCE is effective for our framework.
Recently, Yao et al.
(2020) adapted the contrastive framework to large-scale recommendation systems in a way similar to our approach.
The key difference is in the way the methods generate multiple views.
Yao et al.
(2020) proposes masking random features in a correlated manner and applying a dropout for categorical features, while our approach involves randomizing random features based on the features’ respective empirical marginal distribution (in an uncorrelated way).
Generating such views for a task is a difﬁcult problem: there has been much work done in understanding and designing them (Wu et al., 2018; Purushwalkam & Gupta, 2020; Gontijo-Lopes et al., 2020; Lopes et al., 2019;
Perez & Wang, 2017; Park et al., 2019) and learning them (Ratner et al., 2017; Cubuk et al., 2020;
Ho et al., 2019; Lim et al., 2019; Zhang et al., 2019b; Tran et al., 2017; Tamkin et al., 2020).
Lastly, also similar to our work is VIME (Yoon et al., 2020), which proposes the same corruption technique for tabular data that we do. They pre-train an encoder network on unlabeled data by attaching “mask estimator” and “feature estimator” heads on top of the encoder state and teaching the model to recover both the binary mask that was used for corruption as well as the original uncorrupted input, given the corrupted input.
The pre-trained encoder network is subsequently used for semisupervised learning via attachment of a task-speciﬁc head and minimization of the supervised loss as well as an auto-encoder reconstruction loss.
VIME was shown to achieve state-of-art results on genomics and clinical datasets. The key differences with our work is that we pre-train using a contrastive loss, which we show to be more effective than the denoising auto-encoder loss that partly constitutes VIME. Furthermore, after pre-training we ﬁne-tune all model weights, including the encoder (unlike VIME, which only ﬁne-tunes the task head), and we do so using task supervision only.
S CARF
We now describe our proposed method (Algorithm 1), which is also described in Figure 1.
For each mini-batch of examples from the unlabeled training data, we generate a corrupted version ˜ x
( i ) for each example x
( i ) as follows.
We sample some fraction of the features uniformly at random and replace each of those features by a random draw from that feature’s empirical marginal distribution, which is deﬁned as the uniform distribution over the values that feature takes on across the training dataset.
Then, we pass both x ( i ) and ˜ x
( i ) through the encoder network f , whose output we pass through the pre-train head network g , to get z ( i ) and ˜ z
( i ) respectively.
Note that the pre-train head network (cid:96) 2 -normalizes the outputs so that they lie on the unit hypersphere – this has been found to be crucial in practice (Chen et al., 2020; Wang & Isola, 2020).
We train on the InfoNCE contrastive loss, encouraging z ( i ) and
˜ z
( i ) to be close for all i and z ( i ) and
˜ z ( j ) to be far apart for i (cid:54) =
j , and we optimize over the parameters of f and g via SGD.
Then, to train a classiﬁer for the task via ﬁne-tuning, we take the encoder network f and attach a classiﬁcation head h which takes the output of f as its input and predicts the label of the example.
We optimize the cross-entropy classiﬁcation loss and tune the parameters of both f and h .
While pre-training can be run for a pre-determined number of epochs, much like normal supervised training, how many is needed largely depends on the model and dataset.
To this end, we propose using early stopping on the validation InfoNCE loss.
Given unlabeled validation data, we cycle through it for some number of epochs, running our proposed method to generate (cid:0) x
( i ) , ˜ x
( i ) (cid:1) pairs.
Once built, the loss on this static set is tracked during pre-training.
Prototypical loss curves are shown in the Appendix.
E XPERIMENTS
We evaluate the impact of S CARF pre-training on test accuracy after supervised ﬁne-tuning in three distinct settings: on the full dataset, on the full dataset but where only 25% of samples have labels and the remaining 75% do not, and on the full dataset where 30% of samples undergo label corruption.
Datasets.
We use 69 datasets from the public OpenML-CC18 benchmark 1 under the CC-BY licence.
It consists of 72 real-world classiﬁcation datasets that have been manually curated for effective benchmarking.
Since we’re concerned with tabular datasets in this work, we remove MNIST, FashionMNIST, and CIFAR10.
For each OpenML dataset, we form 70% / 10% / 20% train/validation/test splits, where a different split is generated for every trial and all methods use the same splits.
The percentage used for validation and test are never changed and only training labels are corrupted for the label noise experiments.
Dataset pre-processing .
We represent categorical features by a one-hot encoding, and most of the corruption methods explored in the ablations are on these one-hot encoded representations of the data (with the exception of S CARF , where the marginal sampling is done before one-hot encoding).
We pre-process missing data as follows: if a feature column is always missing, we drop it.
Otherwise, if the feature is categorical, we ﬁll in missing entries with the mode, or most frequent, category computed over the full dataset.
For numerical features, we impute it with the mean.
We explore scaling numerical features by z-score, min-max, and mean normalization.
We ﬁnd that for a vanilla network (i.e. control), z-score normalization performed the best for all but three datasets (OpenML dataset ids 4134, 28, and 1468), for which no scaling was optimal.
We thus do not scale these three datasets and z-score normalize all others.
Model architecture and training .
Unless speciﬁed otherwise, we use the following settings across all experiments.
As described earlier, we decompose the neural network into an encoder f , a pretraining head g , and a classiﬁcation head h , where the inputs to g and h are the outputs of f .
We choose all three component models to be ReLU networks with hidden dimension 256 .
f consists oflayers, whereas both g and h have 2 layers.
Both S CARF and the autoencoder baselines use g (for both pre-training and co-training, described later), but for autoencoders, the output dimensionality is the input feature dimensionality, and the mean-squared error reconstruction loss is applied.
We train all models and their components with the Adam optimizer using the default learning rate of 0 .
For both pre-training and ﬁne-tuning we use 128 batch size.
Unsupervised pre-training methods all use early stopping with patience 3 on the validation loss, unless otherwise noted.
Supervised ﬁne-tuning uses this same criterion (and validation split), but classiﬁcation error is used as the validation metric for early stopping, as it performs slightly better.
We set a max number of ﬁne-tune epochs of 200 and pre-train epochs of 1000 , We use 10 epochs to build the static validation set.
Unless otherwise noted, we use a corruption rate c of 0.6 and a temperature τ of 1, for S CARF -based methods.
All runs are repeated 30 times using different train/validation/test splits.
Experiments were run on a cloud cluster of CPUs, and we used about one million CPU core hours in total for the experiments.
Evaluation methods .
We use the following to effectively convey the results across all datasets.
Win matrix .
Given M methods, we compute a “win” matrix W of size M × M , where the ( i, j ) entry is deﬁned as: [Equation] beats j on dataset d
[Equation]
method i [Equation] to j on dataset d ] . “Beats” and “loses” are only deﬁned when the means are not a statistical tie (using Welch’s t -test with unequal variance and a p -value of 0 . 05 ).
A win ratio of 0 / 1 means that out of the 69 (pairwise) comparisons, only one was signiﬁcant and it was a loss.
Since 0 / 1 and 0 / 69 have the same value but the latter is more conﬁdent indication that i is worse than j , we present the values in fractional form and use a heat map.
We add an additional column to the matrix that represents the minimum win ratio across each row.
Box plots .
The win matrix effectively conveys how often one method beats another but does not capture the degree by which.
To that end, for each method, we compute the relative percent improvement over some reference method on each dataset.
We then build box-plots depicting the distribution of the relative improvement across datasets, plotting the observations as small points.
We only consider datasets where the means of the method and the reference are different with p -value 0 .
We use a larger p -value here than when computing the win ratio because otherwise some methods would not have enough points to make the box-plots meaningful.
Baselines.
We use the following baselines:
• Label smoothing (Szegedy et al., 2016), which has proved successful for accuracy (Müller et al., 2019) and label noise (Lukasik et al., 2020).
We use a weight of 0 .
1 on the smoothing term.
• Dropout .
We use standard dropout (Srivastava et al., 2014) using rate 0 .
04 on all layers.
Dropout has been shown to improve performance and robustness to label noise (Rusiecki, 2020).
• Mixup (Zhang et al., 2017), using α = 0 .
• Autoencoders (Rumelhart et al., 1985).
We use this as our key ablative pre-training baseline.
We use the classical autoencoder (“no noise AE”), the denoising autoencoder (Vincent et al., 2008; 2010) using Gaussian additive noise (“add.
noise AE”) as well as S CARF ’s corruption method (“S CARF AE”).
We use MSE for the reconstruction loss.
We try both pre-training and co-training with the supervised task, and when co-training, we add 0 .
1 times the autoencoder loss to the supervised objective.
We discuss co-training in the Appendix as it is less effective than pre-training.
• S CARF data-augmentation .
In order to isolate the effect of our proposed feature corruption technique, we skip pre-training and instead train on the corrupted inputs during supervised ﬁne-tuning.
We discuss results for this baseline in the Appendix as it is less effective than the others.
• Discriminative S CARF .
Here, our pre-training objective is to discriminate between original input features and their counterparts that have been corrupted using our proposed technique.
To this end, we update our pre-training head network to include a ﬁnal linear projection and swap the InfoNCE with a binary logistic loss.
We use classiﬁcation error, not logistic loss, as the validation metric for early stopping, as we found it to perform slightly better.
• Self-distillation (Hinton et al., 2015; Zhang et al., 2019a).
We ﬁrst train the model on the labeled data and then train the ﬁnal model on both the labeled and unlabeled data using the ﬁrst models’ predictions as soft labels for both sets.
• Deep k -NN (Bahri et al., 2020), a recently proposed method for label noise.
We set k = 50 .
• Bi-tempered loss (Amid et al., 2019), a recently proposed method for label noise.
We useiterations, t 1 = 0 . 8 , and t 2 = 1 . 2 .
• Self-training (Yarowsky, 1995; McClosky et al., 2006).
A classical semi-supervised method – each iteration, we train on pseudo-labeled data (initialized to be the original labeled dataset) and add highly conﬁdent predictions to the training set using the prediction as the label.
We then train our ﬁnal model on the ﬁnal dataset.
We use a softmax prediction threshold of 0 .and
run for 10 iterations.
• Tri-training (Zhou & Li, 2005).
Like self-training, but using three models with different initial labeled data via bootstrap sampling.
Each iteration, every model’s training set is updated by adding only unlabeled points whose predictions made by the other two models agree.
It was shown to be competitive in modern semi-supervised NLP tasks (Ruder & Plank, 2018).
We use same hyperparameters as self-training.
4. S CARF PRE - TRAINING IMPROVES PREDICTIVE PERFORMANCE
Figure 2 shows our results.
From the ﬁrst win matrix plot, we see that all ﬁve pre-training techniques considered improve over no pre-training (control), and that S CARF outperforms the others and has
Notably, it improves state-of-the-art label noise solutions like Deep k -NN.
more statistically signiﬁcant wins. The second win matrix shows that S CARF pre-training boosts the performance of mixup, label smoothing, distillation, and dropout, and it does so better than alternatives.
In other words, pre-training complements existing solutions, suggesting that a distinct mechanism is at play here.
The box plots expand on the second win matrix, showing the relative improvement that each of the pre-training strategies confers over the baselines.
Table 1 summarizes the box-plots by the average relative gain.
We observe that S CARF generally outperforms the alternatives and adds a 1-2% relative gain across the board.
4. S CARF PRE - TRAINING IMPROVES PERFORMANCE IN THE PRESENCE TO LABEL NOISE
To show how pre-training improves model robustness when the data’s labels are unreliable, we do as follows.
Firstly, label noise robustness is often studied in two distinct settings - (1) when some subset of the training data is guaranteed to be uncorrupted and that set is known in advance, (2) when the entire dataset is untrustworthy.
For simplicity, we consider setting 2 in our experiments.
We corrupt labels as follows: leaving the validation and test splits uncorrupted, we select a random 30% percent of the training data to corrupt and for each datapoint, we replace its label by one of the classes, uniformly over all classes (including the datapoint’s true class).
Results are shown in
Figure 3 and Table 1.
Again, we see S CARF outperforms the rest and boosts all baselines by 2-3%. [Table]
4. S CARF PRE - TRAINING IMPROVES PERFORMANCE WHEN LABELED DATA IS LIMITED
To show how pre-training helps when there is more unlabeled data than labeled ones, we remove labels in the training split so that only 25% of the original split remains labeled.
Autoencoders,
S CARF , self-training and tri-training all leverage the unlabeled remainder. Results are shown in Figure 4 (Appendix) and Table 1. S CARF outperforms the rest, adding a very impressive 2-4% to all baselines.
4. A BLATIONS
We now detail the importance of every factor in S CARF .
We show only some of the results here; the rest are in the Appendix.
Other corruption strategies are less effective and are more sensitive to feature scaling.
Here, we ablate the marginal sampling corruption technique we proposed, replacing it with the following other promising strategies, while keeping all else ﬁxed.
No corruption.
We do not apply any corruption -
i
e. ˜ x ( i ) =
x ( i ) , in Algorithm 1.
In this case, the cosine similarity between positive pairs is always one and the model is learning to make negative pairs as orthogonal as possible.
Under the recent perspective (Wang & Isola, 2020) that the contrastive loss comprises two terms – one that encourages alignment between views of the same example – and one that encourages the hypersphere embeddings to be uniformly spread out – we see that with no corruption, pre-training may just be learning to embed input examples uniformly on the hypersphere.
Mean corruption.
After determining which features to corrupt, we replace their entries with the empirical marginal distribution’s mean.
Additive Gaussian noise .
We add i.i.d N (0 , 0 .
5 2 ) noise to features.
Joint sampling.
Rather than replacing features by random draws from their marginals to form ˜ x ( i ) , we instead randomly draw ˆ x ( i ) from training data X – i e. we draw from the empirical (joint) data distribution – and then set ˜ x
( i ) j
= ˆ x ( i ) j ∀ j ∈ I i .
Missing feature corruption.
We mark the selected features as “missing” and add one learnable value per feature dimension to our model.
When a feature is missing, it’s ﬁlled in with the corresponding learnable missing value.
Feature dropout.
We zero-out the selected features.
We also examine the corruption strategies under the following ways of scaling the input features.
Z-score scaling. Here, x j = [ x j − mean ( X j )] / std ( X j ) .
Min-max scaling.
x j = [ x j − min ( X j )] /
[max ( X j ) − min ( X j )] .
Mean scaling.
x j = [ x − mean ( X j )] /
[max ( X j ) − min ( X j )] .
Figure 6 (Appendix) shows the results for z-score and min-max scaling.
S CARF marginal sampling generally outperforms the other corruption strategies for different types of feature scaling.
Marginal sampling is neat in that in addition to not having hyperparameters, it is invariant to scaling and preserves the “units” of each feature.
In contrast, even a simple multiplicative scaling requires the additive noise to be scaled in the same way.
S CARF is not sensitive to batch size.
Contrastive methods like SimCLR (Chen et al., 2020) have shown consistent improvements upon increasing the batch size, N .
There is a tight coupling between the batch size and how hard the contrastive learning task is, since, in our case, the loss term for each example i involves 1 positive and N − 1 negatives.
The need for large (e.g. 5000 ) batch sizes has motivated engineering solutions to support them (Gao & Zhang, 2021) and have been seen as grounds for adopting other loss functions (Zbontar et al., 2021).
Figure 5 (Appendix) compares a range of batch sizes.
We see that increasing the batch size past 128 did not result in signiﬁcant improvements.
A reasonable hypothesis here is that higher capacity models and harder tasks beneﬁt more from negatives.
S CARF is fairly insensitive to the corruption rate and temperature.
We study the effect of the corruption rate c in Figure 5 (Appendix).
We see that performance is stable when the rate is in the range 50% − 80% .
We thus recommend a default setting of 60% .
We see a similar stability with respect to the temperature hyperparameter (see Appendix).
We recommend using a default temperature of 1.
Tweaks to the corruption do not work any better.
The Appendix shows the effect of four distinct tweaks to the corruption method.
We do not see any reason to use any of them.
Alternatives to InfoNCE do not work any better.
We investigate the importance of our choice of InfoNCE loss function and see the effects of swapping it with recently proposed alternatives
Alignment and Uniformity (Wang & Isola, 2020) and Barlow Twins (Zbontar et al., 2021).
We found that these alternative losses almost match or perform worse than the original and popular InfoNCE in our setting.
See the Appendix for details.
C ONCLUSION
Self-supervised learning has seen profound success in important domains including computer vision and natural language processing, but little progress has been made for the general tabular setting.
We propose a self-supervised learning method that’s simple and versatile and learns representations that are effective in downstream classiﬁcation tasks, even in the presence of limited labeled data or label noise.
Potential negative side effects of this method may include learning representations that reinforce biases that appear in the input data.
Finding ways to mitigate this during the training process is a potential direction for future research.
A A PPENDIX
We now present ﬁndings held out from the main text.
Unless noted otherwise, we use the same hyperparameters (i.e. c = 0.6, temperature τ = 1, etc.).
A. R ESULTS FOR DATA - LIMITED EXPERIMENTS
Figure 4 presents the results for the case when only 25% of the training labels are available.
We see that S CARF outperforms the rest here as well.
A. P RE - TRAINING LOSS CURVES
Figure 7 shows prototypical pre-training training and validation loss curves for S CARF .
We see that both losses tend to decrease rapidly at the start of training and then diminish slowly until the early stopping point.
We also notice the noisy (high variance) nature of the training loss - this is due to the stochasticity of our corruption method.
A. A BLATIONS C ONTINUED
We present more ablation results, where the metric is accuracy using 100% of the labeled data.
I MPACT OF BATCH SIZE AND CORRUPTION RATES
Figure 5 examines the impact of the batch size and corruption rate for the fully labeled, noiseless setting.
I MPACT OF CORRUPTION STRATEGIES
Figure 6 shows the performance of a variety of alternative corruption strategies for SCARF under z-score and min-max feature normalization.
Results for mean scaling are shown in Figure 12.
I MPACT OF TEMPERATURE
Figure 8 shows the impact of the temperature term.
While prior work considers temperature an important hyperparameter that needs to be tuned, we see that a default of 1 (i.e. just softmax) works the best in our setting.
M ORE CORRUPTION ABLATIONS
Figure 11 shows the following points.
• Corrupting one view is better than corrupting both the views.
The likely explanation for this is that at a corruption rate of 60% , corrupting both views i.i.d means that the fraction of feature indices that contain the same value for both views is small - in other words, there is less information between the two views and the contrastive task is harder.
• Corrupting the same set of feature indices within the mini-batch performs slightly worse than random sampling for every example in the mini-batch.
• An alternative way to select feature indices to corrupt is to use Bernoulli’s: for each feature index, corrupt it with probability (corruption rate) c , ensuring that at least one index is corrupted.
In the selection method we describe in Algorithm 1, a constant number of indices are corrupted, whereas here it is variable.
This alternative way of selecting indices performs roughly the same.
• Once the feature indices to corrupt are determined, rather than corrupting them by drawing from the empirical marginal distribution, we can instead draw a random example from the training set and use its feature entries for corrupting all views for the mini-batch.
This performs worse.
We observe that both losses drop rapidly initially and then taper off.
The training curve is jittery because of the random corruptions, but the validation curve isn’t because the validation dataset is built once before training and is static throughout training.
A LTERNATIVE LOSSES
Figure 8 shows the impact of using two recently-proposed alternatives to the InfoNCE loss: Uniform and Align (Wang & Isola, 2020) and Barlow Twins (Zbontar et al., 2021).
We use 5e-3 for the hyperparameter in Barlow, and equal weighting between the align and uniform loss terms.
We ﬁnd no beneﬁt in using these other losses.
S CARF PRE - TRAINING OUTPERFORMS S CARF CO - TRAINING
Here we address the question: is it better to pre-train using S CARF or to apply it as a term in the supervised training loss?
In particular, L co-train =
L supervised + λ cont L cont , where L cont is as described in Algorithm 1.
Figure 9 shows that pre-training outperforms co-training for a range of different λ cont .
We see this is also the case for additive noise autoencoders.
S CARF PRE - TRAINING OUTPERFORMS S CARF DATA AUGMENTATION
Figure 10 shows that using S CARF only for data augmentation during supervised training performs far worse than using it for pre-training.
U SING I NFO NCE ERROR AS THE PRE - TRAINING VALIDATION METRIC IS WORSE
S CARF uses the same loss function (InfoNCE) for training and validation.
If we instead use the
InfoNCE error for validation - where an error occurs when the model predicts an off-diagonal entry of the batch-size by batch-size similarity matrix - downstream performance degrades, as shown in
Figure
M ORE ON UNIFORM - ALIGN LOSS
Figure 12 compares S CARF using the uniform-align loss, for different weights between the align and uniform loss terms.
The best performance is achieved with equal weight between the two and
Figure 8 shows that this underperforms vanilla InfoNCE.
We thus recommend using the vanilla
InfoNCE loss.
A BSOLUTE PERFORMANCE
We have thus far presented results in terms of relative improvement over control since relative gain is easier to summarize across the many datasets we consider.
In this section, we present the absolute test accuracy for all methods and datasets, for the keen reader.
We also add a gradient-boosted decision tree baseline using the XGBoost package, since decision trees are common among practitioners working with tabular data.
We use the Python API 2 , version 0.6, and choose the default settings for
XGBClassiﬁer (max depth of 3, 100 estimators, learning rate of 0.1).
Tables 2, 3, 4 show the absolute test accuracies (averaged over the 30 trials) for each dataset and baseline for the 100% training data, the 30% label noise, and the 25% (semi-supervised) training data settings respectively.
T RAINING S PEED
We use an early stopping criteria when ﬁne-tuning S CARF and baselines.
Table 5 shows the number of actual training epochs used (averaged over the 30 trials) for each dataset and baseline for the 100% training data setting.
[Table]
[Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]