Citation and evidence

FixMatch

18 min full readUpdated 11 references

This article's verification

Report a problem with this article

Edit article
More

Use this article

Raw MarkdownExplore connections

Improve this page

Revision historyDiscuss this article

Topics

AlgorithmsComputer VisionDeep LearningMachine Learning

Cite this article

FixMatch is a semi-supervised learning algorithm for image classification that trains a model on a small set of labeled images together with a larger pool of unlabeled ones by combining two older ideas, pseudo-labeling and consistency regularization. For each unlabeled image, the model's prediction on a weakly augmented copy is turned into a hard pseudo-label, but only if the model is confident enough; the model is then trained to predict that pseudo-label for a strongly augmented copy of the same image.[1] The method was introduced in January 2020 by Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D. Cubuk, Alex Kurakin, Han Zhang and Colin Raffel of Google Research, and the paper was published at NeurIPS 2020.[1][2]

The paper's main argument was that a much simpler method could match or beat the more complicated semi-supervised pipelines of the time. FixMatch reported 94.93% accuracy on CIFAR-10 with 250 labeled images and 88.61% with 40 labeled images (4 per class).[1] Later methods such as FlexMatch, FreeMatch and SoftMatch proposed alternatives to its single fixed confidence threshold, and its weak-to-strong training scheme was carried over to semantic segmentation and audio classification.[4][5][6][9][11]

Background

Semi-supervised learning methods for deep networks often work by generating an artificial label for an unlabeled image and training the model to predict it. The FixMatch paper describes two families of such methods that it combines.[1]

Consistency regularization assumes that a model should give similar predictions for perturbed versions of the same image. In its basic form the model is trained, alongside the usual supervised loss, to minimize the squared difference between two stochastic predictions for each unlabeled image $u_b$:

∑b=1μB∥pm(y∣α(ub))−pm(y∣α(ub))∥22\sum_{b=1}^{\mu B} \left\lVert p_m(y \mid \alpha(u_b)) - p_m(y \mid \alpha(u_b)) \right\rVert_2^2

where $\alpha$ is a random data augmentation and $p_m(y \mid x)$ is the model's predicted class distribution. The two terms differ because both the augmentation and the model (for example through dropout) are random.[1] Variants replaced the squared error with cross-entropy, used an average of past model weights or predictions to produce the target (as in Mean Teacher and Temporal Ensembling), used adversarial perturbations (Virtual Adversarial Training), or used stronger augmentation (UDA and ReMixMatch).[1]

Pseudo-labeling, a form of self-training, uses the model's own predictions as labels. It takes the arg max of the predicted distribution as a hard label and keeps only those artificial labels whose largest class probability is above a threshold $\tau$. The FixMatch authors note that using a hard label makes pseudo-labeling closely related to entropy minimization, which pushes the model toward low-entropy, high-confidence predictions on unlabeled data.[1]

Before FixMatch, the strongest results on standard benchmarks came from methods such as MixMatch (2019), UDA and ReMixMatch, which combined several mechanisms: label sharpening, MixUp, distribution alignment, a self-supervised rotation loss, and schedules that ramp up the weight of the unlabeled loss.[1] The FixMatch paper describes itself as breaking this trend toward increasingly complex methods.[1]

"FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence", video from Yannic Kilcher, published April 15, 2020. Watch on YouTube.

Method

Loss function

FixMatch is defined for an $L$-class classification problem. Each training step uses a batch of $B$ labeled examples $(x_b, p_b)$, where $p_b$ is a one-hot label, and a batch of $\mu B$ unlabeled examples $u_b$, where $\mu$ sets the ratio of unlabeled to labeled data in the batch. $H(p, q)$ is the cross-entropy between two distributions, $\alpha(\cdot)$ is weak augmentation and $\mathcal{A}(\cdot)$ is strong augmentation.[1]

The supervised loss is ordinary cross-entropy on weakly augmented labeled images:[1]

ℓs=1B∑b=1BH(pb, pm(y∣α(xb)))\ell_s = \frac{1}{B} \sum_{b=1}^{B} H\big(p_b,\ p_m(y \mid \alpha(x_b))\big)

For each unlabeled image the model first computes $q_b = p_m(y \mid \alpha(u_b))$ on a weakly augmented copy and takes $\hat{q}_b = \arg\max(q_b)$ as the pseudo-label. The unsupervised loss then applies that pseudo-label to the model's prediction on a strongly augmented copy, counting only images whose top predicted probability reaches the threshold $\tau$:[1]

ℓu=1μB∑b=1μB1(max⁡(qb)≥τ) H(q^b, pm(y∣A(ub)))\ell_u = \frac{1}{\mu B} \sum_{b=1}^{\mu B} \mathbb{1}\big(\max(q_b) \ge \tau\big)\, H\big(\hat{q}_b,\ p_m(y \mid \mathcal{A}(u_b))\big)

The total loss is $\ell_s + \lambda_u \ell_u$, where $\lambda_u$ is a fixed weight for the unlabeled term.[1] In practice the labeled images are also included, without their labels, in the unlabeled batch.[1]

The difference from plain pseudo-labeling is that the pseudo-label comes from the weak view while the loss is applied to the strong view, which turns pseudo-labeling into a form of consistency regularization. Many earlier methods gradually increased $\lambda_u$ during training; the authors found this unnecessary for FixMatch. They suggested this may be because few predictions clear the threshold early in training and more do as the model grows confident, so thresholding may act as a built-in curriculum.[1]

Weak and strong augmentation

Weak augmentation is a standard flip-and-shift scheme: images are flipped horizontally with probability 50% (on every dataset except SVHN) and randomly translated by up to 12.5% vertically and horizontally.[1]

Strong augmentation uses one of two variants of AutoAugment that do not need labeled data to learn an augmentation policy: RandAugment and CTAugment. Both pick transformations at random for each image. RandAugment samples a single distortion magnitude from a preset range, while CTAugment learns the magnitudes of individual transformations during training. In both cases Cutout is applied afterwards.[1] Results labeled "FixMatch (RA)" and "FixMatch (CTA)" in the paper refer to these two choices.[1]

Training setup

The authors argued that factors outside the semi-supervised algorithm itself, such as regularization, optimizer and learning-rate schedule, strongly affect results in the low-label regime and are rarely reported, so they documented and ablated them.[1] FixMatch uses plain weight decay, stochastic gradient descent with Nesterov momentum rather than the Adam optimizer, a cosine learning rate decay of the form $\eta \cos\left(\frac{7\pi k}{16K}\right)$ (where $\eta$ is the initial learning rate, $k$ the current step and $K$ the total number of steps), and reports results with an exponential moving average of the model parameters.[1]

Almost the same hyperparameters were used for every dataset and label count except ImageNet; only the weight decay differed, doubled for the wider CIFAR-100 network:[1]

HyperparameterSymbolValue
Confidence threshold$\tau$0.95
Unlabeled loss weight$\lambda_u$1
Unlabeled-to-labeled batch ratio$\mu$7
Labeled batch size$B$64
Initial learning rate$\eta$0.03
SGD momentum$\beta$0.9 (Nesterov)
Training steps$K$$2^{20}$
Weight decay0.0005 (0.001 for CIFAR-100)

Expanded article table

The networks were a Wide ResNet-28-2 with 1.5 million parameters for CIFAR-10 and SVHN, the wider WRN-28-8 for CIFAR-100, and WRN-37-2 for STL-10.[1]

Relationship to other methods

The paper compares FixMatch with earlier methods that use consistency regularization and some post-processing of the artificial label:[1]

MethodAugmentation for the artificial labelAugmentation for the predictionLabel post-processing
Pi-Model / TSWeakWeakNone
Temporal EnsemblingWeakWeakNone
Mean TeacherWeakWeakNone
Virtual Adversarial TrainingNoneAdversarialNone
UDAWeakStrongSharpening
MixMatchWeakWeakSharpening
ReMixMatchWeakStrongSharpening
FixMatchWeakStrongPseudo-labeling

Expanded article table

The closest relatives are UDA and ReMixMatch, both of which already produced an artificial label from a weak view and enforced consistency on strong views. Neither used hard pseudo-labels; both instead "sharpened" the predicted distribution with a temperature. UDA also ignored low-confidence artificial labels, and ReMixMatch annealed the weight of its unlabeled loss.[1] The authors therefore describe FixMatch as a much simplified version of UDA and ReMixMatch that drops sharpening and training signal annealing from UDA, and distribution alignment and the rotation loss from ReMixMatch.[1] All seven ReMixMatch authors (Berthelot, Carlini, Cubuk, Kurakin, Sohn, Han Zhang and Raffel) are also FixMatch authors.[1]

Results

Small image benchmarks

The authors reimplemented all baselines in a single codebase with the same network, optimizer, schedule and preprocessing, following an earlier recommendation that semi-supervised methods be compared under identical conditions. Results are averaged over five different "folds" of labeled data.[1] Mean error rates (%) from the paper, lower is better:[1]

MethodCIFAR-10, 40 labelsCIFAR-10, 250CIFAR-10, 4,000CIFAR-100, 400CIFAR-100, 2,500CIFAR-100, 10,000
MixMatch47.5411.056.4267.6139.9428.31
UDA29.058.824.8859.2833.1324.50
ReMixMatch19.105.444.7244.2827.4323.03
FixMatch (RA)13.815.074.2648.8528.2922.60
FixMatch (CTA)11.395.074.3149.9528.6423.18

Expanded article table

MethodSVHN, 40 labelsSVHN, 250SVHN, 1,000STL-10, 1,000
MixMatch42.553.983.5010.41
UDA52.635.692.467.66
ReMixMatch3.342.922.655.23
FixMatch (RA)3.962.482.287.98
FixMatch (CTA)7.652.642.365.17

Expanded article table

The paper also ran Pi-Model, Pseudo-Labeling and Mean Teacher, which were much weaker (for example 54.26%, 49.78% and 32.32% error on CIFAR-10 with 250 labels) and were not run with 4 labels per class.[1] The authors stated that FixMatch was state of the art on every dataset except CIFAR-100, where ReMixMatch did slightly better. Copying ReMixMatch's distribution alignment into FixMatch closed that gap: the combination reached 40.14% error on CIFAR-100 with 400 labels, against 44.28% for ReMixMatch.[1] They also reported that the 4-labels-per-class results were high-variance across folds and random seeds, which may explain the larger gaps between the RandAugment and CTAugment versions in that setting.[1] To the authors' knowledge, theirs was the first work to run experiments at 4 labels per class on CIFAR-100.[1]

ImageNet

On ImageNet, following UDA, the authors used 10% of the training set as labeled data and the rest as unlabeled, with a ResNet-50 and RandAugment. FixMatch reached a top-1 error rate of 28.54% (plus or minus 0.52) and a top-5 error rate of 10.87%, which the paper reports as 2.68% better than UDA.[1] The paper notes that S4L held the state of the art at 26.79% error, but only after two extra training phases; after its first phase S4L was at 30.27%, which FixMatch beat.[1]

Barely supervised learning

To probe the limits of the method, the authors trained FixMatch on CIFAR-10 with a single labeled image per class (10 labels in total). Across four randomly drawn labeled sets, each trained four times, test accuracy ranged from 48.58% to 85.32%, with a median of 64.28%.[1] Runs on the same labeled set varied much less than runs on different sets, which led the authors to test whether the choice of the 10 images mattered. Using an existing ranking of CIFAR-10 training images by how representative they are of their class, they built labeled sets from different parts of that ranking: sets of the most prototypical images reached a median of 78% accuracy (maximum 84%), sets from the middle reached 65%, and sets made only of outliers failed to converge, at 10% accuracy.[1] The paper distinguishes this setting from few-shot learning, in which extra labeled examples from other classes are available, whereas here the extra data is unlabeled.[1]

Ablation findings

Most ablations were run on a single 250-label CIFAR-10 split with CTAugment, where the default FixMatch configuration had 4.84% error.[1]

Factor studiedFinding
Confidence threshold0.95 gave the lowest error; 0.97 and 0.99 were close, while small thresholds cost more than 1.5 points of accuracy. Higher thresholds made the retained pseudo-labels more accurate but kept fewer of them.
Sharpening versus hard labelsReplacing the hard pseudo-label with a temperature-sharpened distribution gave no significant gain once a threshold was used, while adding a hyperparameter.
CutoutRemoving Cutout, or using only Cutout as strong augmentation, raised error from 4.84% to 6.15% in both cases.
Augmentation placementGenerating labels from strong augmentation made training diverge early; generating them from unaugmented images led to overfitting; predicting on weak instead of strong augmentation peaked at 45% accuracy and then collapsed to 12%.
OptimizerThe best Adam setting was 0.53 points worse than SGD with momentum and was far more sensitive to the learning rate. Momentum of 0.999 gave 84.33% error.
Learning-rate scheduleLinear decay did nearly as well as cosine decay; no decay was 0.86 points worse.
Weight decayA value one order of magnitude larger or smaller than the best could cost ten percentage points or more.
Unlabeled ratio $\mu$Using more unlabeled data per batch substantially reduced error.

Expanded article table

The threshold study ties into what the paper calls confirmation bias: with low thresholds almost every unlabeled image contributes to the loss, many with wrong labels, and training is held back by these noisy examples.[1] The authors concluded that, in this setting, the quality of pseudo-labels mattered more than their quantity.[1] In the conclusion they singled out weight decay and the choice of optimizer as important and often underemphasized, and warned that because of such factors the same method cannot always be compared directly across implementations even when the network architecture is fixed.[1]

Extensions described in the paper

The authors note that FixMatch can absorb other techniques because of its simplicity. Augmentation Anchoring (using several strong augmentations per unlabeled image) and Distribution Alignment from ReMixMatch can be added directly, and the strong augmentation can be swapped for modality-agnostic perturbations such as MixUp or adversarial perturbations; the paper's appendix reports experiments with these variants.[1]

Code

Google released the reference implementation at github.com/google-research/fixmatch under the Apache License 2.0. The repository was created on 21 January 2020, the same day the paper appeared on arXiv; it is written in Python on TensorFlow 1.14 and includes a separate codebase for the ImageNet experiments.[1][3] The README states that the code is not an officially supported Google product. As of November 2026 the repository is archived on GitHub.[3]

Later work

FixMatch's fixed, class-independent confidence threshold became the starting point for several follow-up methods.

MethodYear and venueChange relative to FixMatch
FlexMatch2021, NeurIPSCurriculum Pseudo Labeling: per-class thresholds adjusted during training according to how well each class is being learned
FreeMatch2023, ICLRSelf-adaptive threshold tied to the model's learning status, plus a class fairness regularization term
SoftMatch2023, ICLRReplaces the hard threshold with a truncated Gaussian weighting of each pseudo-label by its confidence, plus uniform alignment
UniMatch2023, CVPRApplies weak-to-strong consistency to semantic segmentation, adding a feature perturbation stream and two strong views per weak view

Expanded article table

FlexMatch (Zhang et al.) argued that a single pre-defined threshold for every class ignores the different learning status and difficulty of different classes. Its curriculum learning approach, Curriculum Pseudo Labeling, adjusts the threshold for each class at each step without extra parameters or forward passes. Its authors reported error rate reductions of 13.96% on CIFAR-100 and 18.96% on STL-10 compared with FixMatch when only 4 labels per class were available, and said FlexMatch could outperform FixMatch using one fifth of its training time.[4] Its code was released in the TorchSSL library.[4]

FreeMatch (Wang et al.) criticized both fixed thresholds and ad hoc threshold schedules and proposed a threshold that adapts to the model's learning status, together with a fairness penalty that encourages diverse predictions early in training.[5] SoftMatch (Chen et al.) described a quantity-quality trade-off in thresholded pseudo-labeling and replaced the threshold with a soft confidence-based weight so that training keeps both many and accurate pseudo-labels.[6]

USB, the Unified Semi-supervised Learning Benchmark (Wang et al., NeurIPS 2022 Datasets and Benchmarks track), extended evaluation from image classification to 15 tasks across computer vision, natural language processing and audio, using pretrained models to cut cost. Its authors reported that evaluating FixMatch on all 15 USB tasks took 39 GPU-days on a single NVIDIA V100, compared with 335 GPU-days for 5 vision tasks under the older TorchSSL protocol.[7] The accompanying open-source library, built on PyTorch and released under the MIT License, implements FixMatch alongside later variants including FlexMatch, FreeMatch, SoftMatch and a debiased FixMatch; Microsoft archived the repository on GitHub in October 2026.[8]

Outside image classification, the UniMatch paper (Yang et al.) described the weak-to-strong consistency framework as "popularized by FixMatch" and reported that a straightforward transfer of FixMatch to semantic segmentation was already competitive with more elaborate methods; it noted, however, that the approach depends heavily on hand-designed strong augmentations.[9] Schmutz, Humbert and Mattei argued that the risk estimate minimized by most discriminative semi-supervised methods is biased, and evaluated debiased versions of Pseudo-label and FixMatch, which they reported gave better-calibrated models.[10] Grollmisch and Cano applied FixMatch to three audio classification tasks (music, industrial sounds and acoustic scenes), adding a procedure for choosing suitable audio augmentations. Their modified FixMatch always outperformed Mean Teacher and CNNs trained from scratch, and on the music and industrial-sound datasets reached the performance of a CNN baseline trained on the full dataset with less than 5% of the training data, but transfer learning did better on the hardest task, acoustic scene classification.[11]

Limitations

Several limitations are noted in the FixMatch paper itself or in the work that followed it:

  • Fixed threshold. One confidence threshold is shared by all classes and all stages of training, which FlexMatch argued fails to account for differences in learning status and difficulty between classes, and which FreeMatch argued leaves unlabeled data underused.[4][5]
  • Quantity versus quality. A high threshold discards many unlabeled images. The FixMatch authors measured this trade-off themselves and suggested better calibration and uncertainty estimates as a future direction; SoftMatch later targeted it directly.[1][6]
  • Hand-designed augmentation. The method depends on strong image augmentations; the paper's ablations show that removing Cutout or swapping the roles of weak and strong views hurts or breaks training, and UniMatch identified reliance on manually designed strong augmentation as a limit in segmentation.[1][9]
  • Variance with very few labels. At 4 labels per class, and even more with 1 label per class, results varied widely across labeled subsets and random seeds.[1]
  • Sensitivity to training details. Weight decay, optimizer and momentum settings changed results by large margins in the authors' ablations.[1]

In the paper's broader impact statement, the authors wrote that FixMatch's simplicity and label efficiency could make machine learning usable in domains where it was previously impractical, such as medical imaging, where scans are often far cheaper to obtain than an expert's labels, but that the same efficiency could also enable more advanced surveillance, for example more accurate identification of people from a few images.[1]

Continue reading

More to read

Topics:AlgorithmsComputer VisionDeep LearningMachine Learning

References

  1. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16 ^17 ^18 ^19 ^20 ^21 ^22 ^23 ^24 ^25 ^26 ^27 ^28 ^29 ^30 ^31 ^32 ^33 ^34 ^35 ^36 ^37 ^38 ^39 ^40 ^41 ^42 ^43 ^44 ^45 ^46 ^47 ^48Sohn, K., Berthelot, D., Li, C.-L., Zhang, Z., Carlini, N., Cubuk, E. D., Kurakin, A., Zhang, H., and Raffel, C. "FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence". arXiv:2001.07685, 21 January 2020. arxiv.org/...2001.07685
  2. ^Sohn, K., Berthelot, D., Carlini, N., Zhang, Z., Zhang, H., Raffel, C., Cubuk, E. D., Kurakin, A., and Li, C.-L. "FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence". Advances in Neural Information Processing Systems 33 (NeurIPS 2020), pp. 596-608, 2020. proceedings.neurips.cc/...b5d6e3d9838f733-Abstract
  3. ^1 ^2Google Research. "google-research/fixmatch: A simple method to perform semi-supervised learning with limited data". GitHub, 2020. github.com/...fixmatch
  4. ^1 ^2 ^3 ^4Zhang, B., Wang, Y., Hou, W., Wu, H., Wang, J., Okumura, M., and Shinozaki, T. "FlexMatch: Boosting Semi-Supervised Learning with Curriculum Pseudo Labeling". NeurIPS 2021, arXiv:2110.08263, 2021. arxiv.org/...2110.08263
  5. ^1 ^2 ^3Wang, Y., Chen, H., Heng, Q., Hou, W., Fan, Y., Wu, Z., Wang, J., Savvides, M., Shinozaki, T., Raj, B., Schiele, B., and Xie, X. "FreeMatch: Self-adaptive Thresholding for Semi-supervised Learning". ICLR 2023, arXiv:2205.07246, 2022. arxiv.org/...2205.07246
  6. ^1 ^2 ^3Chen, H., Tao, R., Fan, Y., Wang, Y., Wang, J., Schiele, B., Xie, X., Raj, B., and Savvides, M. "SoftMatch: Addressing the Quantity-Quality Trade-off in Semi-supervised Learning". ICLR 2023, arXiv:2301.10921, 2023. arxiv.org/...2301.10921
  7. ^Wang, Y., Chen, H., Fan, Y., et al. "USB: A Unified Semi-supervised Learning Benchmark for Classification". NeurIPS 2022 Datasets and Benchmarks Track, arXiv:2208.07204, 2022. arxiv.org/...2208.07204
  8. ^Microsoft. "USB: A Unified Semi-supervised learning Benchmark for CV, NLP, and Audio Classification" (microsoft/Semi-supervised-learning). GitHub. github.com/...Semi-supervised-learning
  9. ^1 ^2 ^3Yang, L., Qi, L., Feng, L., Zhang, W., and Shi, Y. "Revisiting Weak-to-Strong Consistency in Semi-Supervised Semantic Segmentation". CVPR 2023, arXiv:2208.09910, 2022. arxiv.org/...2208.09910
  10. ^Schmutz, H., Humbert, O., and Mattei, P.-A. "Don't fear the unlabelled: safe semi-supervised learning via simple debiasing". arXiv:2203.07512, 2022. arxiv.org/...2203.07512
  11. ^1 ^2Grollmisch, S., and Cano, E. "Improving Semi-Supervised Learning for Audio Classification with FixMatch". Electronics, 10(15), 1807, 2021. doi.org/...electronics10151807

Improve this article

Add missing citations, update stale details, or write a clearer explanation. Anyone can edit: changes go live when you publish, and every edit is checked by an editor.

2 revisions · v2 · 3,505 words · full history

Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify

Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here

Reviewer note: Independent fact-check before publication on November 18, 2026: 118 claims checked against 14 cited and independent sources; 0 material and 5 minor corrections applied before publication.

Cite this page: AI Wiki. "FixMatch." aiwiki.ai, updated 18 Nov 2026, fact-checked 18 Nov 2026. CC BY 4.0. https://aiwiki.ai/wiki/fixmatch

Edit article