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 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="2407.19394")

Code

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

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

ztx-100/efficient_vit_with_dw officialmentioned in papermentioned on GitHubpytorch 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; 9 ran; 1 honoured the contract we drafted; 7 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
2ran · violated contract
1ran · our draft was wrong
1ran · fixture could not drive it
4ran
7unverified

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. “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 ztx-100/efficient_vit_with_dw/models/swin_transformer.py official repository ran · fixture could not drive it fingerprinted no licence file found · pointer only · 144d10b49baeb8a6 · report
build_optimizer ztx-100/efficient_vit_with_dw/optimizer.py official repository ran no licence file found · pointer only · 9fe330952c4ee761 · report
dropout_layers ztx-100/efficient_vit_with_dw/models/cait.py official repository ran no licence file found · pointer only · 5c177b03eb4157b4 · report
exists ztx-100/efficient_vit_with_dw/models/cait.py official repository ran · violated contract no licence file found · pointer only · aa5486a3650902d8 · report
get_grad_norm ztx-100/efficient_vit_with_dw/utils.py official repository ran · honoured contract no licence file found · pointer only · eec1e7cba51d5e8e · report
load_checkpoint ztx-100/efficient_vit_with_dw/utils.py official repository ran no licence file found · pointer only · 59c3a4f0d92e6970 · report
pair ztx-100/efficient_vit_with_dw/models/vit.py official repository ran · violated contract fingerprinted no licence file found · pointer only · 6ba8cee9f5daea41 · report
set_weight_decay ztx-100/efficient_vit_with_dw/optimizer.py official repository ran no licence file found · pointer only · b33222a09fc93bec · report
window_reverse ztx-100/efficient_vit_with_dw/models/swin_transformer.py official repository ran · our draft was wrong no licence file found · pointer only · 61bf152e6a42a184 · report
auto_resume_helper ztx-100/efficient_vit_with_dw/utils.py official repository unverified no licence file found · pointer only · 0c32459bef92ff8c · report
build_model ztx-100/efficient_vit_with_dw/models/build.py official repository unverified no licence file found · pointer only · 7cc4ee2a64e93062 · report
build_scheduler ztx-100/efficient_vit_with_dw/lr_scheduler.py official repository unverified no licence file found · pointer only · 0fbdf3257aea9bcc · report
check_keywords_in_name ztx-100/efficient_vit_with_dw/optimizer.py official repository unverified no licence file found · pointer only · b0a5beb34716d5a6 · report
create_logger ztx-100/efficient_vit_with_dw/logger.py official repository unverified no licence file found · pointer only · 80450600f7f09b0a · report
get_config ztx-100/efficient_vit_with_dw/config.py official repository unverified no licence file found · pointer only · 759a6b3cb8363354 · report
update_config ztx-100/efficient_vit_with_dw/config.py official repository 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