論文5分鐘 | supervised contrastive learning

在這裏插入圖片描述
摘要:

Cross entropy is the most widely used loss function for supervised training of image classification models. In this paper, we propose a novel training methodology that consistently outperforms cross entropy on supervised learning tasks across different architectures and data augmentations. We modify the batch contrastive loss,which has recently been shown to be very effective at learning powerful representations in the self-supervised setting. We are thus able to leverage label information more effectively than cross entropy. Clusters of points belonging to the same class are pulled together in embedding space, while simultaneously pushing apart clusters of samples from different classes. In addition to this, we leverage key ingredients such as large batch sizes and normalized embeddings, which have been shown to benefit self-supervised learning. On both ResNet-50 and ResNet-200, we outperform cross entropy by over 1%, setting a new state of the art number of 78.8% among methods that use AutoAugment data augmentation. The loss also shows clear benefits for robustness to natural corruptions on standard benchmarks on both calibration and accuracy. Compared to cross entropy, our supervised contrastive loss is more stable to hyperparameter settings such as optimizers or data augmentations.

在這裏插入圖片描述

有監督方法vs自監督方法 的對比損失:

  • supervised contrastive loss(左),將一類的positive與其他類的negative進行對比(因爲提供了標籤), 來自同一類別的圖像被映射到低維超球面中的附近點。

  • self-supervised contrastive loss(右),未提供標籤。因此,positive是通過作爲給定樣本的數據增強生成的,negative是batch中隨機採樣的。這可能會導致false negative(如右下所示),可能無法正確映射,導致學習到的映射效果更差。

在這裏插入圖片描述

論文核心點:

  • 其基於目前常用的contrastive loss提出的新的loss,(但是這實際上並不是新的loss,不是取代cross entropy的新loss,更準確地說是一個新的訓練方式)

  • contrastive loss包括兩個方面:1 是positive pair, 來自同一個訓練樣本 通過數據增強等操作 得到的兩個 feature 構成, 這兩個feature會越來越接近, 2 是negative pair, 來自不同訓練樣本的 兩個feature 構成, 這兩個feature 會越來越遠離。 本文不同之處在於對一個訓練樣本(文中的anchor)考慮了多對positive pair,原來的contrastive learning 只考慮一個。

  • 其核心方法是兩階段的訓練。如上圖所示。 從左向右分別是監督學習,自監督對比學習,和本文的監督對比學習。 其第一階段: 通過已知的label來構建contrastive loss中的positive 和negative pair。 因爲有label,所以negative pair 不會有false negative(見圖1解釋)。 其第二階段: 凍結主幹網絡,只用正常的監督學習方法,也就是cross entropy 訓練最後的分類層FC layer。

實驗方面,主要在ImageNet上進行了實驗,通過accuracy驗證其分類性能,通過common image corruption 驗證其魯棒性。

Extension:

這裏有一個YouTube上的講解視頻

https://www.youtube.com/watch?v=MpdbFLXOOIw

原文來自:CVN計算機視覺
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章