IP Library › Granted Patent US 12,314,861
Granted Patent B2
US 12,314,861 · App. 17/160,896 · Granted May 27, 2025

Systems and methods for semi-supervised learning with contrastive graph regularization

Inventors: Junnan Li (Singapore, SG); Chu Hong Hoi (Singapore, SG)
Assignee: Salesforce, Inc.
G06N3/084G06F18/21375G06F18/2155G06F18/22G06F18/2415
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,314,861
App. No.
17/160,896
Granted
May 27, 2025
Kind
B2
Abstract

Embodiments described herein provide an approach (referred to as “Co-training” mechanism throughout this disclosure) that jointly learns two representations of the training data, their class probabilities and low-dimensional embeddings. Specifically, two representations of each image sample are generated: a class probability produced by the classification head and a low-dimensional embedding produced by the projection head. The classification head is trained using memory-smoothed pseudo-labels, where pseudo-labels are smoothed by aggregating information from nearby samples in the embedding space. The projection head is trained using contrastive learning on a pseudo-label graph, where samples with similar pseudo-labels are encouraged to have similar embeddings.

Claims (73)

1. A method for semi-supervised learning with contrastive graph regularization, the method comprising:

receiving a batch of unlabeled image samples;

generating, from an unlabeled image sample, a weakly augmented image sample, a first strongly augmented image sample, and a second strongly augmented image sample;

generating, by an encoder and a classification of a neural model, a pseudo-label corresponding to the weakly augmented image sample, wherein the pseudo-label is generated by:

generating, by the encoder and the classification of the neural model, a classification probability for the weakly augmented image sample,

generating, by the encoder and a projection head of the neural model, an embedding for the weakly augmented image sample,

storing, at a memory bank, the generated classification probability and the generated embedding, and

aggregating class probabilities from neighboring samples in the memory bank to compute the pseudo-label;

generating, by the neural model, a first embedding corresponding to the first strongly augmented image sample and a second embedding corresponding to the second strongly augmented image sample;

building an embedding graph by comparing pairwise similarity between the first embedding and the second embedding;

generating a pseudo-label graph, comprising: constructing a similarity matrix among generated pseudo-labels corresponding to the batch of unlabeled image samples, wherein the similarity matrix contains a first similarity comparing each generated pseudo-label to itself, and a second similarity comparing each generated pseudo-label to another pseudo-label;

computing a contrastive loss based on a cross-entropy between the embedding graph and the pseudo-label graph;

computing an unsupervised classification loss based on a cross-entropy between the pseudo label and the classification probability for the weakly augmented image sample;

updating the neural model based at least in part on the contrastive loss and the unsupervised classification loss via backpropagation;

receiving, via a user data interface, an input image for classification; and

generating, via the neural model, an output classification for the input image.

2. The method of claim 1 , wherein the first embedding and the second embedding are generated by an encoder and a projection head of the neural model.

3. The method of claim 1 , further comprising:

storing class probabilities or embeddings generated from unlabeled image samples and labelled image samples at the memory bank according to a first-in-first-out strategy.

4. The method of claim 1 , wherein the generated classification probability is smoothed by a moving-average over a plurality of generated classification probabilities during training.

5. The method of claim 1 , further comprising: unsupervised classification loss receiving a batch of labeled image samples with ground-truth labels;

generating, by an encoder and a classification head of the neural model, a third classification prediction of a labeled image sample; and

computing a supervised classification loss between a ground-truth label corresponding to the labeled image sample and the third classification prediction.

6. The method of claim 5 , further comprising:

computing a weighted sum of the supervised classification loss, the unsupervised classification loss and the contrastive loss; and

jointly training the encoder, the classification head, and the projection head of the neural model based on the weighted sum.

7. The method of claim 1 , further comprising:

updating parameters of an encoder, classification head and a projection head of the neural model with a moving average of the parameters.

8. A system for semi-supervised learning with contrastive graph regularization, the system comprising:

a data interface that receives a batch of unlabeled image samples;

a memory that stores a neural model;

a processor that reads instructions from the memory to perform:

generating, from an unlabeled image sample, a weakly augmented image sample, a first strongly augmented image sample, and a second strongly augmented image sample;

generating, by an encoder and a classification of the neural model, a pseudo-label corresponding to the weakly augmented image sample, wherein the pseudo-label is generated by:

generating, by the encoder and the classification of the neural model, a classification probability for the weakly augmented image sample,

generating, by the encoder and a projection head of the neural model, an embedding for the weakly augmented image sample,

storing, at a memory bank, the generated classification probability and the generated embedding, and

aggregating class probabilities from neighboring samples in the memory bank to compute the pseudo-label;

generating, by the neural model, a first embedding corresponding to the first strongly augmented image sample and a second embedding corresponding to the second strongly augmented image sample;

building an embedding graph by comparing pairwise similarity between the first embedding and the second embedding;

generating a pseudo-label graph, comprising: constructing a similarity matrix among generated pseudo-labels corresponding to the batch of unlabeled image samples, wherein the similarity matrix contains a first similarity comparing each generated pseudo-label to itself, and a second similarity comparing each generated pseudo-label to another pseudo-label;

computing a contrastive loss based on a cross-entropy between the embedding graph and the pseudo-label graph;

computing an unsupervised classification loss based on a cross-entropy between the pseudo label and the classification probability for the weakly augmented image sample;

updating the neural model based at least in part on the contrastive loss and the unsupervised classification loss via backpropagation;

receiving, via a user data interface, an input image for classification; and

generating, via the neural model, an output classification for the input image.

9. The system of claim 8 , wherein the first embedding and the second embedding are generated by an encoder and a projection head of the neural model.

10. The system of claim 8 , wherein the processor further reads instructions from the memory to perform:

storing class probabilities or embeddings generated from unlabeled image samples and labeled image samples at the memory bank according to a first-in-first-out strategy.

11. The system of claim 8 , wherein the generated classification probability is smoothed by a moving-average over a plurality of generated classification probabilities during training.

12. The system of claim 8 , wherein the processor further reads instructions from the memory to perform:

receiving a batch of labeled image samples with ground-truth labels;

generating, by an encoder and a classification head of the neural model, a third classification prediction of a labeled image sample; and

computing a supervised classification loss between a ground-truth label corresponding to the labeled image sample and the third classification prediction.

13. The system of claim 12 , wherein the processor further reads instructions from the memory to perform:

computing a weighted sum of the supervised classification loss, the unsupervised classification loss and the contrastive loss; and

jointly training the encoder, the classification head, and the projection head of the neural model based on the weighted sum.

14. A non-transitory processor-readable medium storing processor-executable instructions for semi-supervised learning with contrastive graph regularization, the instructions being executed by a processor to perform:

receiving a batch of unlabeled image samples;

generating, from an unlabeled image sample, a weakly augmented image sample, a first strongly augmented image sample, and a second strongly augmented image sample;

generating, by an encoder and a classification of a neural model, a pseudo-label corresponding to the weakly augmented image sample, wherein the pseudo-label is generated by:

generating, by the encoder and the classification of the neural model, a classification probability for the weakly augmented image sample,

generating, by the encoder and a projection head of the neural model, an embedding for the weakly augmented image sample,

storing, at a memory bank, the generated classification probability and the generated embedding, and

aggregating class probabilities from neighboring samples in the memory bank to compute the pseudo-label;

generating, by the neural model, a first embedding corresponding to the first strongly augmented image sample and a second embedding corresponding to the second strongly augmented image sample;

building an embedding graph by comparing pairwise similarity between the first embedding and the second embedding;

generating a pseudo-label graph, comprising: constructing a similarity matrix among generated pseudo-labels corresponding to the batch of unlabeled image samples, wherein the similarity matrix contains a first similarity comparing each generated pseudo-label to itself, and a second similarity comparing each generated pseudo-label to another pseudo-label;

computing a contrastive loss based on a cross-entropy between the embedding graph and the pseudo-label graph;

computing an unsupervised classification loss based on a cross-entropy between the pseudo label and the classification probability for the weakly augmented image sample;

updating the neural model based at least in part on the contrastive loss and the unsupervised classification loss via backpropagation;

receiving, via a user data interface, an input image for classification; and

generating, via the neural model, an output classification for the input image.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 17, 2021
From: LI, JUNNAN; HOI, CHU HONG
To: SALESFORCE.COM, INC.
Reel/Frame 055294/0681 →
Continuity (2)
Provisional Application 63113339 · Nov 13, 2020
Related Publication 20220156591A1 · May 19, 2022
References Cited (10)
US 11816185B1 · Roth · 2023 [cited by examiner]
US 20200250304A1 · Kruus · 2020 [cited by examiner]
US 20210319266A1 · Chen · 2021 [cited by examiner]
US 20210397885A1 · Sivaraman · 2021 [cited by examiner]
Qiu, Jiezhong, et al. “Gcc: Graph contrastive coding for graph neural network pre-training.” Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining. 2020. (Year: 2020). [cited by examiner]
Sohn, Kihyuk, et al. “Fixmatch: Simplifying semi-supervised learning with consistency and confidence.” Advances in neural information processing systems 33 (2020): 596-608. (Year: 2020). [cited by examiner]
Zhu, Linchao, and Yi Yang. “Label independent memory for semi-supervised few-shot video classification.” IEEE Transactions on Pattern Analysis and Machine Intelligence 44.1 (2020): 273-285. (Year: 2020). [cited by examiner]
Li, Suichan, et al. “Density-aware graph for deep semi-supervised visual recognition.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020. (Year: 2020). [cited by examiner]
Abbasi Koohpayegani, Soroush, Ajinkya Tejankar, and Hamed Pirsiavash. “Compress: Self-supervised learning by compressing representations.” Advances in Neural Information Processing Systems 33 (2020): 12980-12992. (Year:… [cited by examiner]
Cai, Hongyun, Vincent W. Zheng, and Kevin Chen-Chuan Chang. “A comprehensive survey of graph embedding: Problems, techniques, and applications.” IEEE transactions on knowledge and data engineering 30.9 (2018): 1616-1637… [cited by examiner]
Cited By (1)
US 12,530,873