Papers › Depth-Wise Convolutions in Vision Transformers for Efficient Training on Small Datasets

Depth-Wise Convolutions in Vision Transformers for Efficient Training on Small Datasets

28 Jul 2024arXiv:2407.19394archive 2025-07-28

Tianxiao Zhang, Wenju Xu, Bo Luo, Guanghui Wang

The Vision Transformer (ViT) leverages the Transformer's encoder to capture global information by dividing images into patches and achieves superior performance across various computer vision tasks. However, the self-attention mechanism of ViT captures the global context from the outset, overlooking the inherent relationships between neighboring pixels in images or videos. Transformers mainly focus on global information while ignoring the fine-grained local details. Consequently, ViT lacks inductive bias during image or video dataset training. In contrast, convolutional neural networks (CNNs), with their reliance on local filters, possess an inherent inductive bias, making them more efficient and quicker to converge than ViT with less data. In this paper, we present a lightweight Depth-Wise Convolution module as a shortcut in ViT models, bypassing entire Transformer blocks to ensure the models capture both local and global information with minimal overhead. Additionally, we introduce two architecture variants, allowing the Depth-Wise Convolution modules to be applied to multiple Transformer blocks for parameter savings, and incorporating independent parallel Depth-Wise Convolution modules with different kernels to enhance the acquisition of local information. The proposed approach significantly boosts the performance of ViT models on image classification, object detection, and instance segmentation by a large margin, especially on small datasets, as evaluated on CIFAR-10, CIFAR-100, Tiny-ImageNet and ImageNet for image classification, and COCO for object detection and instance segmentation. The source code can be accessed at https://github.com/ZTX-100/Efficient_ViT_with_DW.

PaperPDFCodeCode 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 16 code samples harvested from 1 repository linked to this paper: 13 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 2 honoured, 3 violated, 3 with no contract checked; 5 where Syntology's instrument failed) · 3 unverified. Where Syntology's instrument failed: 4 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 16 samples from 1 repository, 13 ran (8 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.

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

ztx-100/efficient_vit_with_dw officialmentioned in papermentioned on GitHubpytorchSyntology: 16 samples, 13 ran (5 instrument-failed) · 3 unverified 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

16 samples harvested: 13 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 2 honoured, 3 violated, 3 with no contract checked; 5 where Syntology's instrument failed) · 3 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 · violated contract
4ran · our draft was wrong
1ran; the contract check could not run
3ran
3unverified

Licence: 16 of the 16 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 ztx-100/efficient_vit_with_dw. “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”. For 1 sample that ran, the graph records a signature this page does not show: an argument's recorded type or element kind is a printout of an object in Syntology's harness (such as a mock object, a class or a pandas printout), not the type of an input, so it does not describe the call's shape. “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.

ztx-100/efficient_vit_with_dw official repository 16 samples, 13 ran (5 instrument-failed) · 3 unverified
window_partition in 377 papers
census: 13 implementations from 17 papers, 5 distinct outputs across 3 buckets, one shared input per bucket
models/swin_transformer.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 144d10b49baeb8a6 · report fixture: signature x:Tensor/4/float, window_size:int/0/int · returned Tensor · level recorded, date not recorded
auto_resume_helper in 27 papers utils.py ran · our draft was wrong no licence file found · pointer only · 0c32459bef92ff8c · report fixture: signature output_dir:str/0/str · returned str · level recorded 2026-09-25
build_optimizer in 83 papers optimizer.py ran · our draft was wrong no licence file found · pointer only · 9fe330952c4ee761 · report fixture: signature config:Config/0/?, model:callable/0/?, simmim:bool/0/bool, is_pretrain:bool/0/bool · returned AdamW · level recorded 2026-09-24
build_scheduler in 56 papers lr_scheduler.py ran no licence file found · pointer only · 0fbdf3257aea9bcc · report fixture: signature config:SimpleNamespace/0/?, optimizer:SGD/0/?, n_iter_per_epoch:int/0/int · returned LinearLRScheduler · level recorded 2026-09-26
check_keywords_in_name in 32 papers optimizer.py ran · violated contract no licence file found · pointer only · b0a5beb34716d5a6 · report fixture: signature name:str/0/str, keywords:tuple/1/str · returned bool · level recorded 2026-09-25
create_logger in 172 papers logger.py ran · our draft was wrong no licence file found · pointer only · 80450600f7f09b0a · report fixture: signature output_dir:str/0/str, dist_rank:int/0/int, name:str/0/str · returned Logger · level recorded 2026-09-25
dropout_layers in 7 papers models/cait.py ran no licence file found · pointer only · 5c177b03eb4157b4 · report fixture: signature layers:list/1/callable, dropout:float/0/float · returned list · level recorded 2026-09-24
exists in 528 papers
census: 5 implementations from 103 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 1, kind int, dtype int64
models/cait.py ran · violated contract no licence file found · pointer only · aa5486a3650902d8 · report fixture: signature val:Tensor/1/int · returned bool · level recorded, date not recorded
get_grad_norm in 45 papers utils.py ran · honoured contract no licence file found · pointer only · eec1e7cba51d5e8e · report fixture: signature parameters:list/1/Tensor, norm_type:int/0/int · returned float · level recorded 2026-09-22
load_checkpoint in 277 papers utils.py ran · honoured contract no licence file found · pointer only · 59c3a4f0d92e6970 · report fixture: returned float · level recorded 2026-09-24
pair in 101 papers models/vit.py ran · violated contract fingerprinted no licence file found · pointer only · 6ba8cee9f5daea41 · report fixture: signature t:int/0/int · returned tuple · level recorded, date not recorded
set_weight_decay in 32 papers optimizer.py ran no licence file found · pointer only · b33222a09fc93bec · report fixture: signature model:callable/0/?, skip_list:tuple/1/empty, skip_keywords:tuple/1/empty · returned list · level recorded 2026-09-24
window_reverse in 296 papers models/swin_transformer.py ran · our draft was wrong no licence file found · pointer only · 61bf152e6a42a184 · report fixture: signature windows:Tensor/4/float, window_size:int/0/int, H:int/0/int, W:int/0/int · returned Tensor · level recorded, date not recorded
build_model in 469 papers models/build.py unverified no licence file found · pointer only · 7cc4ee2a64e93062 · report
get_config in 203 papers config.py unverified no licence file found · pointer only · 759a6b3cb8363354 · report
update_config in 54 papers config.py unverified no licence file found · pointer only · a876af529e9074d6 · report

Tasks

Image ClassificationInductive BiasInstance SegmentationObject DetectionSemantic Segmentationimage-classificationobject-detection

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutFocusLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformerVision Transformer

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