Title: ReMixMatch: Semi-Supervised Learning with Distribution Alignment and Augmentation Anchoring REMIXMATCH: SEMI-SUPERVISED LEARNING WITH DISTRIBUTION ALIGNMENT AND AUGMENTATION ANCHORING

Abstract: We improve the recently-proposed "MixMatch" semi-supervised learning algorithm by introducing two new techniques: distribution alignment and augmentation anchoring. Distribution alignment encourages the marginal distribution of predictions on unlabeled data to be close to the marginal distribution of groundtruth labels. Augmentation anchoring feeds multiple strongly augmented versions of an input into the model and encourages each output to be close to the prediction for a weakly-augmented version of the same input. To produce strong augmentations, we propose a variant of AutoAugment which learns the augmentation policy while the model is being trained. Our new algorithm, dubbed ReMix-Match, is significantly more data-efficient than prior work, requiring between 5× and 16× less data to reach the same accuracy. For example, on CIFAR-10 with 250 labeled examples we reach 93.73% accuracy (compared to Mix-Match's accuracy of 93.58% with 4,000 examples) and a median accuracy of 84.92% with just four labels per class. We make our code and data open-source at https://github.com/google-research/remixmatch.
Model predictions Label guess

1. INTRODUCTION:

Semi-supervised learning (SSL) provides a means of leveraging unlabeled data to improve a model's performance when only limited labeled data is available. This can enable the use of large, powerful models when labeling data is expensive or inconvenient. Research on SSL has produced a diverse collection of approaches, including consistency regularization (Sajjadi et al., 2016; Laine & Aila, 2017) which encourages a model to produce the same prediction when the input is perturbed and entropy minimization (Grandvalet & Bengio, 2005) which encourages the model to output highconfidence predictions. The recently proposed "MixMatch" algorithm (Berthelot et al., 2019) combines these techniques in a unified loss function and achieves strong performance on a variety of image classification benchmarks. In this paper, we propose two improvements which can be readily integrated into MixMatch's framework.

First, we introduce "distribution alignment", which encourages the distribution of a model's aggregated class predictions to match the marginal distribution of ground-truth class labels. This concept was introduced as a "fair" objective by Bridle et al. (1992) , where a related loss term was shown to arise from the maximization of mutual information between model inputs and outputs. After reviewing this theoretical framework, we show how distribution alignment can be straightforwardly added to MixMatch by modifying the "guessed labels" using a running average of model predictions.

Second, we introduce "augmentation anchoring", which replaces the consistency regularization component of MixMatch. For each given unlabeled input, augmentation anchoring first generates a weakly augmented version (e.g. using only a flip and a crop) and then generates multiple strongly augmented versions. The model's prediction for the weakly-augmented input is treated as the basis of the guessed label for all of the strongly augmented versions. To generate strong augmentations, we introduce a variant of AutoAugment (Cubuk et al., 2018) based on control theory which we dub "CTAugment". Unlike AutoAugment, CTAugment learns an augmentation policy alongside model training, making it particularly convenient in SSL settings.

We call our improved algorithm "ReMixMatch" and experimentally validate it on a suite of standard SSL image benchmarks. ReMixMatch achieves state-of-the-art accuracy across all labeled data amounts, for example achieving an accuracy of 93.73% with 250 labels on CIFAR-10 compared to the previous state-of-the-art of 88.92% (and compared to 96.09% for fully-supervised classification with 50,000 labels). We also push the limited-data setting further than ever before, ultimately achieving a median of 84.92% accuracy with only 40 labels (just 4 labels per class) on CIFAR-10. To quantify the impact of our proposed improvements, we carry out an extensive ablation study to measure the impact of our improvements to MixMatch. Finally, we release all of our models and code to facilitate future work on semi-supervised learning.

2. BACKGROUND:

The goal of a semi-supervised learning algorithm is to learn from unlabeled data in a way that improves performance on labeled data. Typical ways of achieving this include training against "guessed" labels for unlabeled data or optimizing a heuristically-motivated objective that does not rely on labels. This section reviews the semi-supervised learning methods relevant to ReMixMatch, with a particular focus on the components of the MixMatch algorithm upon which we base our work.

Consistency Regularization Many SSL methods rely on consistency regularization to enforce that the model output remains unchanged when the input is perturbed. First proposed in (Bachman et al., 2014) , (Sajjadi et al., 2016) and (Laine & Aila, 2017) , this approach was referred to as "Regularization With Stochastic Transformations and Perturbations" and the "Π-Model" respectively. While some work perturbs adversarially (Miyato et al., 2018) or using dropout (Laine & Aila, 2017; Tarvainen & Valpola, 2017) , the most common perturbation is to apply domain-specific data augmentation (Laine & Aila, 2017; Sajjadi et al., 2016; Berthelot et al., 2019; Xie et al., 2019) . The loss function used to measure consistency is typically either the mean-squared error (Laine & Aila, 2017; Tarvainen & Valpola, 2017; Sajjadi et al., 2016) or cross-entropy (Miyato et al., 2018; Xie et al., 2019) between the model's output for a perturbed and non-perturbed input.

Entropy Minimization Grandvalet & Bengio (2005) argues that unlabeled data should be used to ensure that classes are well-separated. This can be achieved by encouraging the model's output distribution to have low entropy (i.e., to make "high-confidence" predictions) on unlabeled data. For example, one can explicitly add a loss term to minimize the entropy of the model's predicted class distribution on unlabeled data (Grandvalet & Bengio, 2005; Miyato et al., 2018) . Related to this idea are "self-training" methods (McLachlan, 1975; Rosenberg et al., 2005) such as Pseudo-Label (Lee, 2013) that use the predicted class on an unlabeled input as a hard target for the same input, which implicitly minimizes the entropy of the prediction.

Standard Regularization Outside of the setting of SSL, it is often useful to regularize models in the over-parameterized regime. This regularization can often be applied both when training on labeled and unlabeled data. For example, standard "weight decay" (Hinton & van Camp, 1993) where the L 2 norm of parameters is minimized is often used alongside SSL techniques. Similarly, powerful MixUp regularization (Zhang et al., 2017) which trains a model on linear interpolants of inputs and labels has recently been applied to SSL (Berthelot et al., 2019; Verma et al., 2019) .

Other Approaches The three aforementioned categories of SSL techniques does not cover the full literature on semi-supervised learning. For example, there is a significant body of research on "transductive" or graph-based semi-supervised learning techniques which leverage the idea that unlabeled datapoints should be assigned the label of a labeled datapoint if they are sufficiently similar (Gammerman et al., 1998; Joachims, 2003; 1999; Bengio et al., 2006; Liu et al., 2018) . Since our work does not involve these (or other) approaches to SSL, we will not discuss them further. A more substantial overview of SSL methods is available in (Chapelle et al., 2006) .

2.1. MIXMATCH:

MixMatch (Berthelot et al., 2019) unifies several of the previously mentioned SSL techniques. The algorithm works by generating "guessed labels" for each unlabeled example, and then using fullysupervised techniques to train on the original labeled data along with the guessed labels for the unlabeled data. This section reviews the necessary details of MixMatch; see (Berthelot et al., 2019) for a full definition. MixMatch first produces K weakly augmented versions of each unlabeled datapoint ûb,k for k ∈ {1, . . . , K}. Then, it generates a "guessed label" q b for each u b by computing the average prediction qb across the K augmented versions: qb = 1 K k p model (y | ûb,k ; θ). The guessed label distribution is then sharpened by adjusting its temperature (i.e. raising all probabilities to a power of 1 ⁄T and renormalizing). Finally, pairs of examples (x 1 , p 1 ), (x 2 , p 2 ) from the combined set of labeled examples and unlabeled examples with label guesses are fed into the MixUp (Zhang et al., 2017) algorithm to compute examples (x , p ) where x = λx 1 + (1 -λ)x 2 for λ ∼ Beta(α, α), and similarly for p . Given these mixed-up examples, MixMatch performs standard fully-supervised training with minor modifications. A standard cross-entropy loss is used for labeled data, whereas the loss for unlabeled data is computed using a mean square error (i.e. the Brier score (Brier, 1950) ) and is weighted with a hyperparameter λ U . The terms K (number of augmentations), T (sharpening temperature), α (MixUp Beta parameter), and λ U (unlabeled loss weight) are MixMatch's hyperparameters. For augmentation, shifting and flipping was used for the CIFAR-10, CIFAR-100, and STL-10 datasets, and shifting alone was used for SVHN.

3. REMIXMATCH:

Having introduced MixMatch, we now turn to the two improvements we propose in this paper: Distribution alignment and augmentation anchoring. For clarity, we describe how we integrate them into the base MixMatch algorithm; the full algorithm for ReMixMatch is shown in algorithm 1.

3.1. DISTRIBUTION ALIGNMENT:

Our first contribution is distribution alignment, which enforces that the aggregate of predictions on unlabeled data matches the distribution of the provided labeled data. This general idea was first introduced over 25 years ago (Bridle et al., 1992) , but to the best of our knowledge is not used in modern SSL techniques. A schematic of distribution alignment can be seen in fig. 1 . After reviewing and extending the theory, we describe how it can be straightforwardly included in ReMixMatch. // Combine and shuffle labeled and unlabeled data 15:

X = MixUp( Xi, Wi); i ∈ (1, . . . , | X |)

// Apply MixUp to labeled data and entries from W 16:

U = MixUp( Ûi, W i+| X | ); i ∈ (1, . . . , | Û|)

// Apply MixUp to unlabeled data and the rest of W 17: return X , U , Û1

3.1.1. INPUT-OUTPUT MUTUAL INFORMATION:

As previously mentioned, the primary goal of an SSL algorithm is to incorporate unlabeled data in a way which improves a model's performance. One way to formalize this intuition, first proposed by Bridle et al. (1992) , is to maximize the mutual information between the model's input and output for unlabeled data. Intuitively, a good classifier's prediction should depend as much as possible on the input. Following the analysis from Bridle et al. (1992) , we can formalize this objective as

EQUATION

where H(•) refers to the entropy. See Appendix A for a proof. To interpret this result, observe that the second term in eq. ( 2) is the familiar entropy minimization objective (Grandvalet & Bengio, 2005) , which simply encourages each individual model output to have low entropy (suggesting high confidence in a class label). The first term, however, is not widely used in modern SSL techniques. This term (roughly speaking) encourages that on average, across the entire training set, the model predicts each class with equal frequency. Bridle et al. (1992) refer to this as the model being "fair".

3.1.2. DISTRIBUTION ALIGNMENT IN REMIXMATCH:

MixMatch already includes a form of entropy minimization via the "sharpening" operation which makes the guessed labels (synthetic targets) for unlabeled data have lower entropy. We are therefore interested in also incorporating a form of "fairness" in ReMixMatch. However, note that the objective H(E x [p model (y|x; θ)]) on its own essentially implies that the model should predict each class with equal frequency. This is not necessarily a useful objective if the dataset's marginal class distribution p(y) is not uniform. Furthermore, while it would in principle be possible to directly minimize this objective on a per-batch basis, we are instead interested in integrating it into MixMatch in a way which does not introduce an additional loss term or any sensitive hyperparameters.

To address these issues, we incorporate a form of fairness we call "distribution alignment" which proceeds as follows: over the course of training, we maintain a running average of the model's predictions on unlabeled data, which we refer to as p(y). Given the model's prediction q = p model (y|u; θ) on an unlabeled example u, we scale q by the ratio p(y)/p(y) and then renormalize the result to form a valid probability distribution: q = Normalize(q × p(y)/p(y)) where Normalize(x) i = x i / j x j . We then use q as the label guess for u, and proceed as usual with sharpening and other processing. In practice, we compute p(y) as the moving average of the model's predictions on unlabeled examples over the last 128 batches. We also estimate the marginal class distribution p(y) based on the labeled examples seen during training. Note that a better estimate for p(y) could be used if it is known a priori; in this work we do not explore this direction further.

3.2. IMPROVED CONSISTENCY REGULARIZATION:

Consistency regularization underlies most SSL methods (Miyato et al., 2018; Tarvainen & Valpola, 2017; Berthelot et al., 2019; Xie et al., 2019) . For image classification tasks, consistency is typically enforced between two augmented versions of the same unlabeled image. In order to enforce a form of consistency regularization, MixMatch generates K (in practice, K = 2) augmentations of each unlabeled example u and averages them together to produce a "guessed label" for u.

Recent work (Xie et al., 2019) found that applying stronger forms of augmentation can significantly improve the performance of consistency regularization. In particular, for image classification tasks it was shown that using variants of AutoAugment (Cubuk et al., 2018) produced substantial gains. Since MixMatch uses a simple flip-and-crop augmentation strategy, we were interested to see if replacing the weak augmentation in MixMatch with AutoAugment would improve performance but found that training would not converge. To circumvent this issue, we propose a new method for consistency regularization in MixMatch called "Augmentation Anchoring". The basic idea is to use the model's prediction for a weakly augmented unlabeled image as the guessed label for many strongly augmented versions of the same image.

A further logistical concern with using AutoAugment is that it uses reinforcement learning to learn a policy which requires many trials of supervised model training. This poses issues in the SSL setting where we often have limited labeled data. To address this, we propose a variant of Au-toAugment called "CTAugment" which adapts itself online using ideas from control theory without requiring any form of reinforcement learning-based training. We describe Augmentation Anchoring and CTAugment in the following two subsections.

3.2.1. AUGMENTATION ANCHORING:

We hypothesize the reason MixMatch with AutoAugment is unstable is that MixMatch averages the prediction across K augmentations. Stronger augmentation can result in disparate predictions, so their average may not be a meaningful target. Instead, given an unlabeled input we first generate an "anchor" by applying weak augmentation to it. Then, we generate K strongly-augmented versions of the same unlabeled input using CTAugment (described below). We use the guessed label (after applying distribution alignment and sharpening) as the target for all of the K strongly-augmented versions of the image. This process is visualized in fig. 2 .

While experimenting with Augmentation Anchoring, we found it enabled us to replace MixMatch's unlabeled-data mean squared error loss with a standard cross-entropy loss. This maintained stability while also simplifying the implementation. While MixMatch achieved its best performance at only K = 2, we found that augmentation anchoring benefited from a larger value of K = 8. We compare different values of K in section 4 to measure the gain achieved from additional augmentations.

3.2.2. CONTROL THEORY AUGMENT:

AutoAugment (Cubuk et al., 2018 ) is a method for learning a data augmentation policy which results in high validation set accuracy. An augmentation policy consists a sequence of transformationparameter magnitude tuples to apply to each image. Critically, the AutoAugment policy is learned with supervision: the magnitudes and sequence of transformations are determined via training many models on a proxy task which e.g. involves the use of 4,000 labels on CIFAR-10 and 1,000 labels on SVHN (Cubuk et al., 2018) . This makes applying AutoAugment methodologically problematic for low-label SSL. To remedy this necessity for training a policy on labeled data, RandAugment (Cubuk et al., 2019) uniformly randomly samples transformations, but requires tuning the hyper-parameters for the random sampling on the validation set, which again is methodologically difficult when only very few (e.g., 40 or 250) labeled examples are available.

Thus, in this work, we develop CTAugment, an alternative approach to designing high-performance augmentation strategies. Like RandAugment, CTAugment also uniformly randomly samples transformations to apply but dynamically infers magnitudes for each transformation during the training process. Since CTAugment does not need to be optimized on a supervised proxy task and has no sensitive hyperparameters, we can directly include it in our semi-supervised models to experiment with more aggressive data augmentation in semi-supervised learning. Intuitively, for each augmentation parameter, CTAugment learns the likelihood that it will produce an image which is classified as the correct label. Using these likelihoods, CTAugment then only samples augmentations that fall within the network tolerance. This process is related to what is called density-matching in Fast AutoAugment (Lim et al., 2019) , where policies are optimized so that the density of augmented validation images match the density of images from the training set.

First, CTAugment divides each parameter for each transformation into bins of distortion magnitude as is done in AutoAugment (see Appendix C for a list of the bin ranges). Let m be the vector of bin weights for some distortion parameter for some transformation. At the beginning of training, all magnitude bins are initialized to have a weight set to 1. These weights are used to determine which magnitude bin to apply to a given image.

At each training step, for each image two transformations are sampled uniformly at random. To augment images for training, for each parameter of these transformations we produce a modified set of bin weights m where mi = m i if m i > 0.8 and mi = 0 otherwise, and sample magnitude bins from Categorical(Normalize( m)). To update the weights of the sampled transformations, we first sample a magnitude bin m i for each transformation parameter uniformly at random. The resulting transformations are applied to a labeled example x with label p to obtain an augmented version x. Then, we measure the extent to which the model's prediction matches the label as

ω = 1 -1 2L |p model (y|x; θ) -p|.

The weight for each sampled magnitude bin is updated as m i = ρm i + (1 -ρ)ω where ρ = 0.99 is a fixed exponential decay hyperparameter.

3.3. PUTTING IT ALL TOGETHER:

ReMixMatch's algorithm for processing a batch of labeled and unlabeled examples is shown in algorithm 1. The main purpose of this algorithm is to produce the collections X and U , consisting of augmented labeled and unlabeled examples with MixUp applied. The labels and label guesses in X and U are fed into standard cross-entropy loss terms against the model's predictions. Algorithm 1 also outputs Û1 , which consists of a single heavily-augmented version of each unlabeled image and its label guesses without MixUp applied. Û1 is used in two additional loss terms which provide a mild boost in performance in addition to improved stability: Pre-mixup unlabeled loss We feed the guessed labels and predictions for example in Û1 as-is into a separate cross-entropy loss term.

Rotation loss Recent result have shown that applying ideas from self-supervised learning to SSL can produce strong performance (Gidaris et al., 2018; Zhai et al., 2019) . We integrate this idea by rotating each image u ∈ Û1 as Rotate(u, r) where we sample the rotation angle r uniformly from r ∼ {0, 90, 180, 270} and then ask the model to predict the rotation amount as a four-class classification problem.

In total, the ReMixMatch loss is

EQUATION

Hyperparameters ReMixMatch introduce two new hyperparameters: the weight on the rotation loss λ r and the weight on the un-augmented example λ Û1 . In practice both are fixed λ r = λ Û1 = 0.5. ReMixMatch also shares many hyperparameters from MixMatch: the weight for the unlabeled loss λ U , the sharpening temperature T , the MixUp Beta parameter, and the number of augmentations K. All experiments (unless otherwise stated) use T = 0.5, Beta = 0.75, and λ U = 1.5. We found using a larger number of augmentations monotonically increases accuracy, and so set K = 8 for all experiments (as running with K augmentations increases computation by a factor of K).

We train our models using Adam (Kingma & Ba, 2015) with a fixed learning rate of 0.002 and weight decay (Zhang et al., 2018) with a fixed value of 0.02. We take the final model as an exponential moving average over the trained model weights with a decay of 0.999.

4. EXPERIMENTS:

We now test the efficacy of ReMixMatch on a set of standard semi-supervised learning benchmarks. Unless otherwise noted, all of the experiments performed in this section use the same codebase and model architecture (a Wide ResNet-28-2 (Zagoruyko & Komodakis, 2016) with 1.5 million parameters, as used in (Oliver et al., 2018) ).

4.1. REALISTIC SSL SETTING:

We follow the Realistic Semi-Supervised Learning (Oliver et al., 2018) recommendations for performing SSL evaluations. In particular, as mentioned above, this means we use the same model and training algorithm in the same codebase for all experiments. We compare against VAT (Miyato et al., 2018) and MeanTeacher (Tarvainen & Valpola, 2017) , copying the re-implementations over from the MixMatch codebase (Berthelot et al., 2019) .

Fully supervised baseline To begin, we train a fully-supervised baseline to measure the highest accuracy we could hope to obtain with our training pipeline. The experiments we perform use the same model and training algorithm, so these baselines are valid for all discussed SSL techniques. On CIFAR-10, we obtain an fully-supervised error rate of 4.25% using weak flip + crop augmentation, which drops to 3.62% using AutoAugment and 3.91% using CTAugment. Similarly, on SVHN we obtain 2.70% error using weak (flip) augmentation and 2.31% and 2.16% using AutoAugment and CTAugment respectively. While AutoAugment performs slightly better on CIFAR-10 and slightly worse on SVHN compared to CTAugment, it is not our intent to design a better augmentation strategy; just one that can be used without a pre-training or tuning of hyper-parameters. 

CIFAR-10:



4.2. STL-10:

The STL-10 dataset consists of 5,000 labeled 96 × 96 color images drawn from 10 classes and 100,000 unlabeled images drawn from a similar-but not identical-data distribution. The labeled set is partitioned into ten pre-defined folds of 1,000 images each. For efficiency, we only run our analysis on five of these ten folds. We do not perform evaluation here under the Realistic SSL (Oliver et al., 2018) Table 2 : STL-10 error rate using 1000-label splits. SWWAE and CC-GAN results are from (Zhao et al., 2015) and (Denton et al., 2016) . 

4.3. TOWARDS FEW-SHOT LEARNING:

We find that ReMixMatch is able to work in extremely low-label settings. By only changing λ r from 0.5 to 2 we can train CIFAR-10 with just four labels per class and SVHN with only 40 labels total.

On CIFAR-10 we obtain a median-of-five error rate of 15.08%; on SVHN we reach 3.48% error and on SVHN with the "extra" dataset we reach 2.81% error. Full results are given in Appendix B.

4.4. ABLATION STUDY:

Because we have made several changes to the existing MixMatch algorithm, here we perform an ablation study and remove one component of ReMixMatch at a time to understand from which changes produce the largest accuracy gains. Our ablation results are summarized in Table 3 . We find that removing the pre-mixup unlabeled loss, removing distribution alignment, and lowering K all hurt performance by a small amount. Given that distribution alignment improves performance, we were interested to see whether it also had the intended effect of making marginal distribution of model predictions match the ground-truth marginal class distribution. We measure this directly in appendix D. Removing the rotation loss reduces accuracy at 250 labels by only 0.14 percentage points, but we find that in the 40-label setting rotation loss is necessary to prevent collapse. Changing the cross-entropy loss on unlabeled data to an L2 loss as used in MixMatch hurts performance dramatically, as does removing either of the augmentation components. This validates using augmentation anchoring in place of the consistency regularization mechanism of MixMatch.

5. CONCLUSION:

Progress on semi-supervised learning over the past year has upended many of the long-held beliefs about classification, namely, that vast quantities of labeled data is necessary. By introducing augmentation anchoring and distribution alignment to MixMatch, we continue this trend: ReMixMatch reduces the quantity of labeled data needed by a large factor compared to prior work (e.g., beating MixMatch at 4000 labeled examples with only 250 on CIFAR-10, and closely approaching Mix-Match at 5000 labeled examples with only 1000 on STL-10). In future work, we are interested in pushing the limited data regime further to close the gap between few-shot learning and SSL. We also note that in many real-life scenarios, a dataset begins as unlabeled and is incrementally labeled until satisfactory performance is achieved. Our strong empirical results suggest that it will be possible to achieve gains in this "active learning" setting by using ideas from ReMixMatch. Finally, in this paper we present results on widely-studied image benchmarks for ease of comparison. However, the true power of data-efficient learning will come from applying these techniques to real-world problems where obtaining labeling data is expensive or impractical.

A PROOF OF EQUATION 2

The proof here follows closely Bridle et al. (1992) . We begin with the definition 

I

E CTAUGMENT PARAMETERS EFFECTS:

In this section we compare the effects of varying the CTAugment hyper-parameters on CIFAR10 with 250 labels, using the standard ReMixMatch settings. The exponential weight decay ρ does not effect the results significantly while depth and threshold have significant effects. 

:

ReMixMatch: Semi-Supervised Learning with Distribution Alignment and Augmentation Anchoring

Figures and Tables:

Figure 1: Distribution alignment. Guessed label distributions are adjusted according to the ratio of the empirical ground-truth class distribution divided by the average model predictions on unlabeled data.

Figure 2: Augmentation anchoring. We use the prediction for a weakly augmented image (green, middle) as the target for predictions on strong augmentations of the same image (blue).

Let X = (x b , p b ) : b ∈ (1, . . . , B) be a batch of labeled data and their corresponding one-hot labels representing one of L classes and let xb be augmented versions of these labeled examples. Similarly, let U = u b : b ∈ (1, . . . , B) be a batch of unlabeled examples. Finally, let p model (y | x; θ) be the predicted class distribution produced by the model for input x.

ReMixMatch algorithm for producing a collection of processed labeled examples and processed unlabeled examples with label guesses (cf. Berthelot et al. (2019) Algorithm 1.) 1: Input: Batch of labeled examples and their one-hot labels X = (x b , p b ) : b ∈ (1, . . . , B) , batch of unlabeled examples U = u b : b ∈ (1, . . . , B) , sharpening temperature T , number of augmentations K, Beta distribution parameter α for MixUp. 2: for b = 1 to B do 3: xb = StrongAugment(x b ) // Apply strong data augmentation to x b 4: ûb,k = StrongAugment(u b ); k ∈ {1, . . . , K} // Apply strong data augmentation K times to u b 5: ũb = WeakAugment(u b ) // Apply weak data augmentation to u b 6: q b = p model (y | ũb ; θ) // Compute prediction for weak augmentation of u b 7: q b = Normalize(q b × p(y) p(y)) // Apply distribution alignment Apply temperature sharpening to label guess 9: end for 10: X = (x b , p b ); b ∈ (1, . . . , B) // Augmented labeled examples and their labels 11: Û1 = (û b,1 , q b ); b ∈ (1, . . . , B) // First strongly augmented unlabeled example and guessed label 12: Û = (û b,k , q b ); b ∈ (1, . . . , B), k ∈ (1, . . . , K) // All strongly augmented unlabeled examples 13: Û = Û ∪ (ũ b , q b ); b ∈ (1, . . . , B) // Add weakly augmented unlabeled examples 14: W = Shuffle Concat( X , Û)

Figure 3: KL divergence between the marginal distribution of model predictions vs. the true marginal distribution of class labels over the course of training with and without distribution alignment. This figure corresponds to a training run on CIFAR-10 with 250 labels.

Our results on CIFAR-10 are shown in table 1, left. ReMixMatch sets the new stateof-the-art for all numbers of labeled examples. Most importantly, ReMixMatch is 16× more data efficient than MixMatch (e.g., at 250 labeled examples ReMixMatch has identical accuracy compared to MixMatch at 4,000). SVHN Results for SVHN are shown in table 1, right. ReMixMatch reaches state-of-the-art at 250labeled examples, and within the margin of error for state-of-the-art otherwise. Results on CIFAR-10 and SVHN. * For UDA, due to adaptation difficulties, we report the results fromXie et al. (2019) which are not comparable to our results due to a different network implementation, training procedure, etc. For VAT, Mean Teacher, and MixMatch, we report results using our reimplementation, which makes them directly comparable to ReMixMatch's scores.

Table content: <table><tr><td/><td/><td>CIFAR-10</td><td/><td/><td>SVHN</td></tr><tr><td>Method</td><td>250 labels</td><td>1000 labels</td><td>4000 labels</td><td colspan="3">250 labels 1000 labels 4000 labels</td></tr><tr><td>VAT</td><td colspan="4">36.03±2.82 18.64±0.40 11.05±0.31 8.41±1.01</td><td>5.98±0.21</td><td>4.20±0.15</td></tr><tr><td>Mean Teacher</td><td colspan="4">47.32±4.71 17.32±4.00 10.36±0.25 6.45±2.43</td><td>3.75±0.10</td><td>3.39±0.11</td></tr><tr><td>MixMatch</td><td>11.08±0.87</td><td>7.75±0.32</td><td colspan="2">6.24±0.06 3.78±0.26</td><td>3.27±0.31</td><td>2.89±0.06</td></tr><tr><td>ReMixMatch</td><td>6.27±0.34</td><td>5.73±0.16</td><td colspan="2">5.14±0.04 3.10±0.50</td><td>2.83±0.30</td><td>2.42±0.09</td></tr><tr><td>UDA, reported*</td><td>8.76±0.90</td><td>5.87±0.13</td><td colspan="2">5.29±0.25 2.76±0.17</td><td>2.55±0.09</td><td>2.47±0.15</td></tr></table>

setting when comparing to non-MixMatch results. Our results are, however, directly comparable to the MixMatch results. Using the same WRN-37-2 network (23.8 million parameters), we reduce the error rate by a factor of two compared to MixMatch.

Table content: <table><tr><td>Method</td><td>Error Rate</td></tr><tr><td>SWWAE</td><td>25.70</td></tr><tr><td>CC-GAN</td><td>22.20</td></tr><tr><td>MixMatch</td><td>10.18 ± 1.46</td></tr><tr><td>ReMixMatch (K=1)</td><td>6.77 ± 1.66</td></tr><tr><td>ReMixMatch (K=4)</td><td>6.18 ± 1.24</td></tr></table>

Ablation study. Error rates are reported on a single 250-label split from CIFAR-10.

Table content: <table><tr><td>Ablation</td><td>Error Rate Ablation</td><td>Error Rate</td></tr><tr><td>ReMixMatch</td><td>5.94 No rotation loss</td><td>6.08</td></tr><tr><td>With K=1</td><td>7.32 No pre-mixup loss</td><td>6.66</td></tr><tr><td>With K=2</td><td>6.74 No dist. alignment</td><td>7.28</td></tr><tr><td>With K=4</td><td>6.21 L2 unlabeled loss</td><td>17.28</td></tr><tr><td>With K=16</td><td>5.93 No strong aug.</td><td>12.51</td></tr><tr><td>MixMatch</td><td>11.08 No weak aug.</td><td>29.36</td></tr></table>

We now report the full results for running ReMixMatch with just 40 labeled examples. We sort the table by error rate over five different splits (i.e., 40-label subsets) of the training data. High variance is to be expected when choosing so few labeled examples at random. Sorted error rate of ReMixMatch with 40 labeled examples.

Table content: <table><tr><td>(y; x) =</td><td colspan="2">p(y, x) log</td><td colspan="3">p(y, x) p(y)p(x)</td><td>dy dx</td><td>(5)</td></tr><tr><td>Rewriting terms we obtain</td><td/><td/><td/><td/></tr><tr><td colspan="6">= p(x) dx p(y|x) log</td><td>p(y|x) p(y)</td><td>dy</td><td>(6)</td></tr><tr><td colspan="6">= p(x) dx p(y|x) log</td><td>p(y|x) p(x)p(y|x) dx</td><td>dy</td><td>(7)</td></tr><tr><td colspan="6">Then, rewriting both integrals as expectations we obtain</td></tr><tr><td>= E x</td><td colspan="3">p(y|x) log</td><td colspan="2">p(y|x) E x [p(y|x)]</td><td>dy</td><td>(8)</td></tr><tr><td>= E x</td><td>L i=1</td><td colspan="3">p(y i |x) log</td><td>p(y i |x) E x [p(y i |x)]</td><td>(9)</td></tr><tr><td/><td>L</td><td/><td/><td/></tr><tr><td>= E x</td><td>i=1</td><td colspan="4">p(y (12)</td></tr><tr><td colspan="3">B FULL 40 LABEL RESULTS</td><td/><td/></tr><tr><td colspan="2">Dataset</td><td/><td/><td/><td>Split (ordered by error rate)</td></tr><tr><td/><td/><td/><td/><td/><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td></tr><tr><td colspan="3">CIFAR-10</td><td colspan="3">10.88 12.65 15.08 16.78 19.49</td></tr><tr><td colspan="2">SVHN</td><td/><td colspan="3">3.43</td><td>3.46</td><td>3.48</td><td>4.06 12.24</td></tr><tr><td colspan="3">SVHN+extra</td><td colspan="3">2.59</td><td>2.71</td><td>2.81</td><td>3.50 15.14</td></tr></table>

The default settings are highlighted in the table. They appear to perform well and have been shown to be robust across many datasets in our previous experiments. Effects of hyper-parameters for CTAugment, the bold results are the default settings used for all experiments.

Table content: <table><tr><td colspan="2">Depth Threshold</td><td colspan="2">ρ Error rate</td></tr><tr><td>1</td><td>0.80</td><td>0.99</td><td>23.90</td></tr><tr><td>2</td><td>0.80</td><td>0.99</td><td>6.25</td></tr><tr><td>3</td><td>0.80</td><td>0.99</td><td>6.36</td></tr><tr><td>2</td><td>0.50</td><td>0.99</td><td>10.51</td></tr><tr><td>2</td><td>0.80</td><td>0.99</td><td>6.25</td></tr><tr><td>2</td><td>0.90</td><td>0.99</td><td>10.80</td></tr><tr><td>2</td><td>0.95</td><td>0.99</td><td>18.47</td></tr><tr><td>2</td><td>0.80</td><td>0.9</td><td>6.15</td></tr><tr><td>2</td><td>0.80</td><td>0.99</td><td>6.25</td></tr><tr><td>2</td><td colspan="2">0.80 0.999</td><td>6.02</td></tr></table>

Peer review (iclr2020):
This paper proposes two modifications for the MixMatch method [1] and achieves improved accuracy on a range of semi-supervised benchmarks. The first modification enforces the distribution of predicted labels to match the distribution of labeled data. The second modification is adding a learned data augmentation strategy, and adapting the method to work with strong data augmentation. The final method is titled ReMixMatch, and improves significantly over MixMatch, especially in low-data regime. The main contribution of the paper is really strong empirical results. The method achieves state of the art results or close to that on multiple benchmarks, with especially large gains in settings with very scarce labeled data, like 40 labels on CIFAR-10. Another important contribution is the learned data augmentation strategy, which as far as I understand is novel and overcomes some of the limitations of existing learned data augmentation techniques. However, the explanation of the strategy wasn’t very clear for me, and the authors didn’t frame it as a major contribution. The main drawback of the paper is that it seems to be more engineering-focused, and doesn’t provide much insight into semi-supervised learning. The paper can be summarized as adding two modifications to mix-match, and getting better results. The final method becomes fairly involved. Mix-Match is already an elaborate method, and ReMixMatch additionally introduces learned data augmentation, an additional loss term for matching label distributions between labeled and unlabeled data, consistency-loss, and a self-supervised loss (section 3.3). For the reasons above, I think the paper is borderline, but I am currently voting for acceptance based on the strong empirical performance. At the same time, I think the paper can be made stronger and more interesting to read, if the authors added some experiments aimed at understanding the proposed modifications. One set of experiments that I think would be interesting is aimed at understanding the distribution-matching part. For example, it would be great if the author could demonstrate that without this loss term the distribution of the predicted classes is wrong in the experiments from Section 4. It would also be interesting to see an experiment where the labeled data has a skewed distribution of classes, but we provide the method with information about the true class distribution, and demonstrating that this information helps predictive performance. For the learnable data augmentation it would be great if the authors could provide more insight into the method, how it works, and why is it better than the alternatives. Just analyzing the learned data augmentation in different settings and adding more intuition for what happens would make the paper more insightful and interesting to read. On a more minor note, the paper [1] seems to report 4.95 accuracy for MixMatch on CIFAR-10 with 4k labels, while in this paper it’s being reported as 6.24. What is the reason for the difference? Another paper, [2], reports very competitive results on CIFAR-10 for 4k labels. I would recommend discussing these results briefly in the paper. At the same time the empirical performance of ReMixMatch is really impressive, and I don’t think the results in [1] and [2] affect their significance. [1] MixMatch: A Holistic Approach to Semi-Supervised Learning David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, Colin Raffel [2] There Are Many Consistent Explanations of Unlabeled Data: Why You Should Average Ben Athiwaratkun, Marc Finzi, Pavel Izmailov, Andrew Gordon Wilson