Elamur Research

A Simple Framework for Contrastive Learning of Visual Representations

Paper · 2020 · Ting Chen, Simon Kornblith, Mohammad Norouzi et al.

Summary

The paper asks how far a deliberately plain recipe can take self-supervised image representation learning. It introduces SimCLR, which drops specialised architectures and memory banks. Each unlabeled image is randomly transformed twice. A standard ResNet encoder, followed by a small MLP projection head, is trained so that the two versions of the same image land close together, while every other image in the batch acts as a negative. The loss is a normalized, temperature-scaled cross entropy called NT-Xent. Training runs on large batches with the LARS optimizer and batch normalization synchronised across devices. The authors take the framework apart piece by piece, using ImageNet ILSVRC-2012 and the linear evaluation protocol. They find that four things matter: the mix of augmentations, the nonlinear head, normalized embeddings with a tuned temperature, and large batches with long training. Combined, these choices beat earlier self-supervised and semi-supervised methods. The work matters because it shows that good representations can come from simple components and well-chosen training signals rather than clever architectures.

Key points

  • A linear classifier on frozen SimCLR features reaches 76.5% top-1 accuracy on ImageNet. That is a 7% relative gain over the previous best and matches a supervised ResNet-50.
  • Fine-tuning with only 1% of the ImageNet labels gives 85.8% top-5 accuracy, better than AlexNet while using 100× fewer labels.
  • Combining random crop with color distortion is the key augmentation pairing. Contrastive learning also profits from stronger augmentation than supervised training does.
  • The default setup is:
    • ResNet-50 encoder with a 2-layer MLP head into a 128-dimensional space;
    • batch size 4096 for 100 epochs;
    • batch sizes explored from 256 to 8192, where 8192 yields 16,382 negatives per positive pair.
  • In transfer to 12 natural image datasets, SimCLR matches or outperforms a solid supervised baseline on 10 of them.

Interesting ideas

  • I1. Augmentations define the task. Instead of designing a new architecture for each prediction task, the authors get a whole family of tasks simply by choosing and composing random input transformations, which makes the learning signal easy to vary and study.
  • I2. Throwaway projection head. The contrastive objective is applied after a small extra head that is discarded after training, so the representation itself keeps information the loss would otherwise squeeze out.
  • I3. Free negatives from the batch. Every other example in the minibatch serves as a negative, which removes the need for a memory bank or explicit negative sampling.
  • I4. Watch for shortcut leakage. Per-device batch normalization let the model cheat, because both views of an image shared statistics on the same device. This raised the training score without improving the representation, and pooling statistics globally fixed it.
  • I5. Probe frozen features linearly. Fitting only a linear classifier on a frozen encoder serves as a clean proxy for how good the representation is, separate from fine-tuning effects.

For Mova

How these ideas could serve Mova, our small open language model — its files, stages and tests:

  • I1 (learn): Silver data could include pairs of meaning-preserving perturbations of one sentence (e.g. punctuation or casing changes), and witness parsers would be expected to give the same tree for both; disagreement flags unreliable silver.
  • I2 (tree): Auxiliary objectives in gparse could sit on a separate disposable head, protecting the shared encoder features that the arc and label scorers depend on.
  • I3 (frames): A coreference scorer could treat mentions from other documents in the same batch as guaranteed non-coreferent negatives, giving cheap contrastive training data.
  • I4 (learn): Evaluation with negative controls should explicitly check for leakage paths like this, such as a sentence and its variant sharing a split or cache, before trusting a score jump.
  • I5 (tree): Linear probes for tags or relations on frozen gparse encoder states would give an explainable, comparable measure of what each training run actually stored.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

 Fields, topics and concepts

Cite

Cite as Ting Chen, Simon Kornblith, Mohammad Norouzi and Geoffrey Hinton. 2020. A Simple Framework for Contrastive Learning of Visual Representations. arXiv:2002.05709.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2002.05709 · arXiv 2002.05709

@misc{chen2020simple,
  title = {{A Simple Framework for Contrastive Learning of Visual Representations}},
  author = {Ting Chen, Simon Kornblith, Mohammad Norouzi and Geoffrey Hinton},
  year = {2020},
  doi = {10.48550/arxiv.2002.05709},
  eprint = {2002.05709},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2002.05709}
}

References

61 references, from the paper's own bibliography.

  1. Asano, Y. M., Rupprecht, C., and Vedaldi, A. A critical analysis of self-supervision, or what we can learn from a single image. arXiv preprint arXiv:1904.13132, 2019. OpenAlex ↗ · Scholar ↗
  2. Bachman, P., Hjelm, R. D., and Buchwalter, W. Learning representations by maximizing mutual information across views. In Advances in Neural Information Processing Systems, pp. 15509–15519, 2019. our card
  3. Becker, S. and Hinton, G. E. Self-organizing neural network that discovers surfaces in random-dot stereograms. Nature, 3550 (6356):0 161–163, 1992. OpenAlex ↗ · Scholar ↗
  4. Berg, T., Liu, J., Lee, S. W., Alexander, M. L., Jacobs, D. W., and Belhumeur, P. N. Birdsnap: Large-scale fine-grained visual categorization of birds. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2019–2026. IEEE, 2014. OpenAlex ↗ · Scholar ↗
  5. Berthelot, D., Carlini, N., Goodfellow, I., Papernot, N., Oliver, A., and Raffel, C. A. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, pp. 5050–5060, 2019. our card
  6. Bossard, L., Guillaumin, M., and Van Gool, L. Food-101–mining discriminative components with random forests. In European conference on computer vision, pp. 446–461. Springer, 2014. our card
  7. Chen, T., Sun, Y., Shi, Y., and Hong, L. On sampling strategies for neural network-based collaborative filtering. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 767–776, 2017. OpenAlex ↗ · Scholar ↗
  8. Chen, T., Zhai, X., Ritter, M., Lucic, M., and Houlsby, N. Self-supervised gans via auxiliary rotation loss. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 12154–12163, 2019. OpenAlex ↗ · Scholar ↗
  9. Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., and Vedaldi, A. Describing textures in the wild. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3606–3613. IEEE, 2014. OpenAlex ↗ · Scholar ↗
  10. Cubuk, E. D., Zoph, B., Mane, D., Vasudevan, V., and Le, Q. V. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 113–123, 2019. OpenAlex ↗ · Scholar ↗
  11. DeVries, T. and Taylor, G. W. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. our card
  12. Doersch, C. and Zisserman, A. Multi-task self-supervised visual learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2051–2060, 2017. our card
  13. Doersch, C., Gupta, A., and Efros, A. A. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1422–1430, 2015. OpenAlex ↗ · Scholar ↗
  14. Donahue, J. and Simonyan, K. Large scale adversarial representation learning. In Advances in Neural Information Processing Systems, pp. 10541–10551, 2019. OpenAlex ↗ · Scholar ↗
  15. Donahue, J., Jia, Y., Vinyals, O., Hoffman, J., Zhang, N., Tzeng, E., and Darrell, T. Decaf: A deep convolutional activation feature for generic visual recognition. In International Conference on Machine Learning, pp. 647–655, 2014. our card
  16. Dosovitskiy, A., Springenberg, J. T., Riedmiller, M., and Brox, T. Discriminative unsupervised feature learning with convolutional neural networks. In Advances in neural information processing systems, pp. 766–774, 2014. OpenAlex ↗ · Scholar ↗
  17. Everingham, M., Van Gool, L., Williams, C. K., Winn, J., and Zisserman, A. The pascal visual object classes (voc) challenge. International Journal of Computer Vision, 880 (2):0 303–338, 2010. OpenAlex ↗ · Scholar ↗
  18. Fei-Fei, L., Fergus, R., and Perona, P. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshop on Generative-Model Based Vision, 2004. OpenAlex ↗ · Scholar ↗
  19. Gidaris, S., Singh, P., and Komodakis, N. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018. OpenAlex ↗ · Scholar ↗
  20. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014. OpenAlex ↗ · Scholar ↗
  21. Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. our card
  22. Hadsell, R., Chopra, S., and LeCun, Y. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06), volume 2, pp. 1735–1742. IEEE, 2006. OpenAlex ↗ · Scholar ↗
  23. He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. our card
  24. He, K., Fan, H., Wu, Y., Xie, S., and Girshick, R. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019. our card
  25. Hénaff, O. J., Razavi, A., Doersch, C., Eslami, S., and Oord, A. v. d. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019. OpenAlex ↗ · Scholar ↗
  26. Hinton, G. E., Osindero, S., and Teh, Y.-W. A fast learning algorithm for deep belief nets. Neural computation, 180 (7):0 1527–1554, 2006. OpenAlex ↗ · Scholar ↗
  27. Hjelm, R. D., Fedorov, A., Lavoie-Marchildon, S., Grewal, K., Bachman, P., Trischler, A., and Bengio, Y. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018. OpenAlex ↗ · Scholar ↗
  28. Howard, A. G. Some improvements on deep convolutional neural network based image classification. arXiv preprint arXiv:1312.5402, 2013. OpenAlex ↗ · Scholar ↗
  29. Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. OpenAlex ↗ · Scholar ↗
  30. Ji, X., Henriques, J. F., and Vedaldi, A. Invariant information clustering for unsupervised image classification and segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 9865–9874, 2019. OpenAlex ↗ · Scholar ↗
  31. Kingma, D. P. and Welling, M. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. our card
  32. Kolesnikov, A., Zhai, X., and Beyer, L. Revisiting self-supervised visual representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 1920–1929, 2019. our card
  33. Kornblith, S., Shlens, J., and Le, Q. V. Do better ImageNet models transfer better? In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2661–2671, 2019. our card
  34. Krause, J., Deng, J., Stark, M., and Fei-Fei, L. Collecting a large-scale dataset of fine-grained cars. In Second Workshop on Fine-Grained Visual Categorization, 2013. OpenAlex ↗ · Scholar ↗
  35. Krizhevsky, A. and Hinton, G. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. URL https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf. OpenAlex ↗ · Scholar ↗
  36. Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012. our card
  37. Loshchilov, I. and Hutter, F. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. our card
  38. Maaten, L. v. d. and Hinton, G. Visualizing data using t-sne. Journal of machine learning research, 90 (Nov):0 2579–2605, 2008. OpenAlex ↗ · Scholar ↗
  39. Maji, S., Kannala, J., Rahtu, E., Blaschko, M., and Vedaldi, A. Fine-grained visual classification of aircraft. Technical report, 2013. OpenAlex ↗ · Scholar ↗
  40. Mikolov, T., Chen, K., Corrado, G., and Dean, J. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. our card
  41. Misra, I. and van der Maaten, L. Self-supervised learning of pretext-invariant representations. arXiv preprint arXiv:1912.01991, 2019. OpenAlex ↗ · Scholar ↗
  42. Nilsback, M.-E. and Zisserman, A. Automated flower classification over a large number of classes. In Computer Vision, Graphics & Image Processing, 2008. ICVGIP'08. Sixth Indian Conference on, pp. 722–729. IEEE, 2008. OpenAlex ↗ · Scholar ↗
  43. Noroozi, M. and Favaro, P. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pp. 69–84. Springer, 2016. OpenAlex ↗ · Scholar ↗
  44. Oord, A. v. d., Li, Y., and Vinyals, O. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. our card
  45. Parkhi, O. M., Vedaldi, A., Zisserman, A., and Jawahar, C. Cats and dogs. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3498–3505. IEEE, 2012. OpenAlex ↗ · Scholar ↗
  46. Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 1150 (3):0 211–252, 2015. our card
  47. Schroff, F., Kalenichenko, D., and Philbin, J. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 815–823, 2015. our card
  48. Simonyan, K. and Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. our card
  49. Sohn, K. Improved deep metric learning with multi-class n-pair loss objective. In Advances in neural information processing systems, pp. 1857–1865, 2016. OpenAlex ↗ · Scholar ↗
  50. Sohn, 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 preprint arXiv:2001.07685, 2020. OpenAlex ↗ · Scholar ↗
  51. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., and Rabinovich, A. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015. OpenAlex ↗ · Scholar ↗
  52. Tian, Y., Krishnan, D., and Isola, P. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019. OpenAlex ↗ · Scholar ↗
  53. Tschannen, M., Djolonga, J., Rubenstein, P. K., Gelly, S., and Lucic, M. On mutual information maximization for representation learning. arXiv preprint arXiv:1907.13625, 2019. OpenAlex ↗ · Scholar ↗
  54. Wu, Z., Xiong, Y., Yu, S. X., and Lin, D. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3733–3742, 2018. OpenAlex ↗ · Scholar ↗
  55. Xiao, J., Hays, J., Ehinger, K. A., Oliva, A., and Torralba, A. Sun database: Large-scale scene recognition from abbey to zoo. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3485–3492. IEEE, 2010. OpenAlex ↗ · Scholar ↗
  56. Xie, Q., Dai, Z., Hovy, E., Luong, M.-T., and Le, Q. V. Unsupervised data augmentation. arXiv preprint arXiv:1904.12848, 2019. OpenAlex ↗ · Scholar ↗
  57. Ye, M., Zhang, X., Yuen, P. C., and Chang, S.-F. Unsupervised embedding learning via invariant and spreading instance feature. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6210–6219, 2019. OpenAlex ↗ · Scholar ↗
  58. You, Y., Gitman, I., and Ginsburg, B. Large batch training of convolutional networks. arXiv preprint arXiv:1708.03888, 2017. our card
  59. Zhai, X., Oliver, A., Kolesnikov, A., and Beyer, L. S4l: Self-supervised semi-supervised learning. In The IEEE International Conference on Computer Vision (ICCV), October 2019. OpenAlex ↗ · Scholar ↗
  60. Zhang, R., Isola, P., and Efros, A. A. Colorful image colorization. In European conference on computer vision, pp. 649–666. Springer, 2016. OpenAlex ↗ · Scholar ↗
  61. Zhuang, C., Zhai, A. L., and Yamins, D. Local aggregation for unsupervised learning of visual embeddings. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6002–6012, 2019. OpenAlex ↗ · Scholar ↗

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/chen-2020-simple-framework-contrastive-learning-visual/