Papers › Self-Supervised Learning by Estimating Twin Class Distributions

Self-Supervised Learning by Estimating Twin Class Distributions

14 Oct 2021arXiv:2110.07402archive 2025-07-28

Feng Wang, Tao Kong, Rufeng Zhang, Huaping Liu, Hang Li

We present TWIST, a simple and theoretically explainable self-supervised representation learning method by classifying large-scale unlabeled datasets in an end-to-end way. We employ a siamese network terminated by a softmax operation to produce twin class distributions of two augmented images. Without supervision, we enforce the class distributions of different augmentations to be consistent. However, simply minimizing the divergence between augmentations will cause collapsed solutions, i.e., outputting the same class probability distribution for all images. In this case, no information about the input image is left. To solve this problem, we propose to maximize the mutual information between the input and the class predictions. Specifically, we minimize the entropy of the distribution for each sample to make the class prediction for each sample assertive and maximize the entropy of the mean distribution to make the predictions of different samples diverse. In this way, TWIST can naturally avoid the collapsed solutions without specific designs such as asymmetric network, stop-gradient operation, or momentum encoder. As a result, TWIST outperforms state-of-the-art methods on a wide range of tasks. Especially, TWIST performs surprisingly well on semi-supervised learning, achieving 61.2% top-1 accuracy with 1% ImageNet labels using a ResNet-50 as backbone, surpassing previous best results by an absolute improvement of 6.2%. Codes and pre-trained models are given on: https://github.com/bytedance/TWIST

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 15 code samples harvested from 1 repository linked to this paper: 9 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 2 honoured, 0 violated, 2 with no contract checked; 5 where Syntology's instrument failed) · 6 unverified. Where Syntology's instrument failed: 3 where our contract draft was wrong; 2 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 15 samples from 1 repository, 9 ran (4 with no instrument failure; 5 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 1 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 4 of the 9 samples that ran have no recorded date.

bytedance/TWIST officialmentioned in papermentioned on GitHubpytorchApache-2.0Syntology: 15 samples, 9 ran (5 instrument-failed) · 6 unverified report
beresandras/contrastive-classification-keras mentioned on GitHubtfSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Momentum Contrast for Unsupervised Visual Representation Learning (arXiv:1911.05722; that paper's own run record: 28 ran (of which 16 constructed an object rather than computing a result; 23 with no instrument failure: 0 honoured, 0 violated, 23 with no contract checked; 5 where Syntology's instrument failed) · 14 unverified), A Simple Framework for Contrastive Learning of Visual Representations (arXiv:2002.05709; that paper's own run record: 115 ran (of which 33 constructed an object rather than computing a result; 89 with no instrument failure: 1 honoured, 1 violated, 87 with no contract checked; 26 where Syntology's instrument failed) · 22 unverified), Barlow Twins: Self-Supervised Learning via Redundancy Reduction (arXiv:2103.03230; that paper's own run record: 21 ran (of which 6 constructed an object rather than computing a result; 15 with no instrument failure: 2 honoured, 1 violated, 12 with no contract checked; 6 where Syntology's instrument failed) · 5 unverified) and 1 more (every one in this page's JSON twin); nothing checks that they implement this paper's method. report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

15 samples harvested: 9 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 2 honoured, 0 violated, 2 with no contract checked; 5 where Syntology's instrument failed) · 6 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · honoured contract
3ran · our draft was wrong
2ran; the contract check could not run
2ran
6unverified

Licence: 4 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. For 4 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from bytedance/TWIST. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

bytedance/TWIST official repository 15 samples, 9 ran (5 instrument-failed) · 6 unverified
KL in 20 papers objective.py ran Apache-2.0 (permissive) · a74d130de19016d6 · report fixture: signature probs1:Tensor/2/float, probs2:Tensor/2/float, args:Args/0/? · returned Tensor · level recorded 2026-09-24
accuracy in 872 papers
census: 8 implementations from 7 papers, 7 distinct outputs across 6 buckets, one shared input per bucket
evaluate.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant Apache-2.0 (permissive) · b0f936d4d6ae3b8c · report fixture: signature output:Tensor/2/float, target:Tensor/1/int, topk:tuple/1/int · returned list · level recorded, date not recorded
calculate_cost_matrix in 10 papers evaluate_cluster.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · f6d031f1affc8b74 · report fixture: signature C:ndarray/2/float, n_clusters:int/0/int · returned ndarray · level recorded 2026-09-25
conv1x1 in 691 papers widen_resnet.py ran · our draft was wrong Apache-2.0 (permissive) here; the stored copy is pointer only · 2a80220dabcb742a · report fixture: signature in_planes:int/0/int, out_planes:int/0/int, stride:int/0/int · returned Conv2d · level recorded, date not recorded
conv3x3 in 1,376 papers widen_resnet.py ran · our draft was wrong Apache-2.0 (permissive) here; the stored copy is pointer only · 600ff2c45e0de056 · report fixture: signature in_planes:int/0/int, out_planes:int/0/int, stride:int/0/int, groups:int/0/int, dilation:int/0/int · returned Conv2d · level recorded, date not recorded
cosine_scheduler in 74 papers utils.py ran · honoured contract fingerprinted Apache-2.0 (permissive) · 361a6b24f11fc50a · report fixture: signature base_value:float/0/float, final_value:float/0/float, epochs:int/0/int, niter_per_ep:int/0/int, warmup_epochs:int/0/int, start_warmup_value:float/0/float · returned ndarray · level recorded, date not recorded
get_augmentations augmentation.py ran Apache-2.0 (permissive) · f8fa05939509a76b · report fixture: signature args:ArgsConfig/0/? · returned MocoAugmentations · level recorded 2026-09-24
get_cluster_labels_from_indices in 8 papers evaluate_cluster.py ran · honoured contract Apache-2.0 (permissive) here; the stored copy is pointer only · c5807f4f8acc5c0b · report fixture: signature indices:list/1/tuple · returned ndarray · level recorded 2026-09-25
trunc_normal_ in 154 papers
census: 37 implementations from 54 papers, 4 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
utils.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant Apache-2.0 (permissive) · 915b71e73a54fc97 · report fixture: signature tensor:Tensor/2/float, mean:float/0/float, std:float/0/float, a:float/0/float, b:float/0/float · returned Tensor · level recorded 2026-09-22
CE in 7 papers objective.py unverified Apache-2.0 (permissive) · 5067fd3e4ebe3111 · report
check_path in 20 papers imagenet_lmdb.py unverified Apache-2.0 (permissive) · 8b7b49496df1bbe5 · report
concat_all_gather in 141 papers
census: 7 implementations from 7 papers, 2 distinct outputs on one shared input
utils.py unverified Apache-2.0 (permissive) · 73cecca9f3575f09 · report
evaluate in 514 papers evaluate_cluster.py unverified Apache-2.0 (permissive) · e3880dee498de475 · report
loads_pyarrow in 8 papers imagenet_lmdb.py unverified Apache-2.0 (permissive) · b4c154b6f0568b6b · report
resnet18 in 432 papers widen_resnet.py unverified Apache-2.0 (permissive) · d2772e0a588e4529 · report

Tasks

Fine-Grained Image ClassificationImage ClassificationRepresentation LearningSelf-Supervised Image ClassificationSelf-Supervised LearningSemi-Supervised Image ClassificationTransfer LearningUnsupervised Image Classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Fine-Grained Image Classification Caltech-101 TWIST (ResNet-50 ) Accuracy 93.5% #6 of 18 Archive leaderboard report
Fine-Grained Image Classification Caltech-101 TWIST (ResNet-50 ) Top-1 Error Rate 6.5% #6 of 18 Archive leaderboard report
Fine-Grained Image Classification SUN397 TWIST (ResNet-50) Accuracy 67.4 #4 of 5 Archive leaderboard report
Image Classification DTD TWIST (ResNet-50) Accuracy 76.6 #8 of 11 Archive leaderboard report
Image Classification Food-101 TWIST (ResNet-50) Accuracy (%) 89.3 #5 of 11 Archive leaderboard report
Image Classification Oxford-IIIT Pet Dataset TWIST (ResNet-50) Accuracy 94.5 #1 of 5 Archive leaderboard report
Semi-Supervised Image Classification ImageNet - 1% labeled data TWIST (ResNet-50 x2) Top 1 Accuracy 67.2% #26 of 65 Archive leaderboard report
Semi-Supervised Image Classification ImageNet - 1% labeled data TWIST (ResNet-50 x2) Top 5 Accuracy 88.2% #26 of 65 Archive leaderboard report
Semi-Supervised Image Classification ImageNet - 10% labeled data TWIST (ResNet-50 x2) Top 1 Accuracy 75.3% #26 of 75 Archive leaderboard report
Semi-Supervised Image Classification ImageNet - 10% labeled data TWIST (ResNet-50 x2) Top 5 Accuracy 92.8% #26 of 75 Archive leaderboard report
Unsupervised Image Classification ImageNet TWIST (ResNet-50) ARI 30.0 #6 of 9 Archive leaderboard report
Unsupervised Image Classification ImageNet TWIST (ResNet-50) Accuracy (%) 40.6 #6 of 9 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Siamese NetworkSoftmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections