Papers › Efficient Training of Visual Transformers with Small Datasets

Efficient Training of Visual Transformers with Small Datasets

7 Jun 2021NeurIPS 2021 12arXiv:2106.03746archive 2025-07-28

Yahui Liu, Enver Sangineto, Wei Bi, Nicu Sebe, Bruno Lepri, Marco De Nadai

Visual Transformers (VTs) are emerging as an architectural paradigm alternative to Convolutional networks (CNNs). Differently from CNNs, VTs can capture global relations between image elements and they potentially have a larger representation capacity. However, the lack of the typical convolutional inductive bias makes these models more data-hungry than common CNNs. In fact, some local properties of the visual domain which are embedded in the CNN architectural design, in VTs should be learned from samples. In this paper, we empirically analyse different VTs, comparing their robustness in a small training-set regime, and we show that, despite having a comparable accuracy when trained on ImageNet, their performance on smaller datasets can be largely different. Moreover, we propose a self-supervised task which can extract additional information from images with only a negligible computational overhead. This task encourages the VTs to learn spatial relations within an image and makes the VT training much more robust when training data are scarce. Our task is used jointly with the standard (supervised) training and it does not depend on specific architectural choices, thus it can be easily plugged in the existing VTs. Using an extensive evaluation with different VTs and datasets, we show that our method can improve (sometimes dramatically) the final accuracy of the VTs. Our code is available at: https://github.com/yhlleo/VTs-Drloc.

PaperPDFConference PDFCodeCode Syntology ran

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

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2106.03746")

Code

Syntology Ran 13 of 19 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 3 ran · our draft was wrong; 1 ran · fixture could not drive it; 7 ran with no contract checked.

By repository: official repository: 19 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

yhlleo/VTs-Drloc officialmentioned in papermentioned on GitHubpytorchMIT 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.

Code Syntology ran Syntology

19 samples harvested; 13 ran; 1 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
3ran · our draft was wrong
1ran · fixture could not drive it
7ran
6unverified

Licence: 11 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from yhlleo/VTs-Drloc. “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. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (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 from a repository marked official are listed first. 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 four 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; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). 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.

window_partition yhlleo/VTs-Drloc/models/swin.py official repository ran · fixture could not drive it fingerprinted MIT recorded; this copy not marked cleared · pointer only · 144d10b49baeb8a6 · report
build_optimizer yhlleo/VTs-Drloc/optimizer.py official repository ran MIT recorded; this copy not marked cleared · pointer only · e35a4b2e4114b1a5 · report
collect_samples_faster yhlleo/VTs-Drloc/drloc/aux_modules.py official repository ran MIT (permissive) · d50eceebc1eabdc2 · report
get_sinusoid_encoding yhlleo/VTs-Drloc/models/t2t.py official repository ran · honoured contract fingerprinted MIT recorded; this copy not marked cleared · pointer only · ced6bc2bfdfe0059 · report
group_by_key_prefix_and_remove_prefix yhlleo/VTs-Drloc/models/cvt.py official repository ran · our draft was wrong MIT (permissive) · ca4faa49da53bd5c · report
group_dict_by_key yhlleo/VTs-Drloc/models/cvt.py official repository ran · our draft was wrong MIT (permissive) · afcf8f2954675d55 · report
pair yhlleo/VTs-Drloc/models/vit.py official repository ran · violated contract fingerprinted MIT recorded; this copy not marked cleared · pointer only · 6ba8cee9f5daea41 · report
randn_sampling yhlleo/VTs-Drloc/drloc/aux_modules.py official repository ran MIT (permissive) · a09531f2a3bed5f5 · report
relative_constraint_ce yhlleo/VTs-Drloc/drloc/losses.py official repository ran MIT (permissive) · 8872e7b986aa6d2e · report
relative_constraint_l1 yhlleo/VTs-Drloc/drloc/losses.py official repository ran fingerprinted MIT (permissive) · 7f1b680d6aa88b99 · report
set_weight_decay yhlleo/VTs-Drloc/optimizer.py official repository ran MIT recorded; this copy not marked cleared · pointer only · b33222a09fc93bec · report
variance_aware_regression yhlleo/VTs-Drloc/drloc/losses.py official repository ran MIT (permissive) · 2fc56b43da8a500b · report
window_reverse yhlleo/VTs-Drloc/models/swin.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · 61bf152e6a42a184 · report
build_model yhlleo/VTs-Drloc/models/build.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 6b79b63bd6d3342e · report
build_scheduler yhlleo/VTs-Drloc/lr_scheduler.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · c02cc4e0b5720211 · report
check_keywords_in_name yhlleo/VTs-Drloc/optimizer.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · b0a5beb34716d5a6 · report
collect_samples yhlleo/VTs-Drloc/drloc/aux_modules.py official repository unverified MIT (permissive) · e52fbbea05ecc1fb · report
create_logger yhlleo/VTs-Drloc/logger.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 80450600f7f09b0a · report
get_config yhlleo/VTs-Drloc/config.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 8a6a17f0fb1092f7 · report

Tasks

Inductive Bias

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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