Abstract
Vision Transformers (ViTs) have demonstrated remarkable performance on large-scale datasets but often underperform relative to Convolutional Neural Networks (CNNs) on smaller benchmarks. This performance gap is largely attributed to the low information density of raw image pixels compared to the dense tokens used in Natural Language Processing (NLP). This paper presents DenseVT, a method to explicitly increase input information density by transforming images into the frequency domain using Discrete Cosine Transform (DCT) and selecting the most informative channels via GradCAM-based heatmaps. Experimental results show that DenseVT significantly improves ViT performance on small datasets, allowing models like Swin Transformer to surpass ResNet baselines.
Introduction
The "data hunger" of Vision Transformers is a well-documented challenge. Unlike CNNs, which possess an inherent inductive bias toward local spatial correlations, ViTs must learn global structures from scratch. A fundamental reason for this difficulty is the difference in information density between modalities. In NLP, every word token carries significant semantic weight. Conversely, in computer vision, raw pixels are highly redundant and often contain low-level noise that provides little semantic value.
Transformers were originally designed for the dense information environments of language. When applied to "sparse" raw pixels, they require massive datasets to learn how to filter noise and identify relevant features. DenseVT addresses this by preprocessing images into a format that mimics the density of language tokens.
Methodology
The DenseVT pipeline consists of three primary stages designed to strip away redundancy and highlight semantically relevant information.
1. Frequency Domain Transformation
Instead of standard RGB input, images are converted to the YCbCr color space and processed using a block-wise Discrete Cosine Transform (DCT). This transformation decomposes the image into 192 frequency channels (based on 8x8 blocks). This shift to the frequency domain allows the model to treat low-frequency coefficients as "keywords" and high-frequency components as potential noise.
2. Heatmap-Based Channel Selection
To identify which of the 192 channels are most critical for classification, the authors employ a pre-trained ResNet50 and GradCAM to generate importance heatmaps. By analyzing which frequency channels contribute most to the model's decision-making process, the system can discard non-informative data.
3. Dense Token Creation and Backbone Integration
The selection process reduces the input from 192 channels to the top 18 most informative channels—a 90% reduction in data volume. These dense tokens are then passed through a linear layer to match the input dimensions of modern Transformer backbones, such as the Swin or Focal Transformer.
Experimental Results
The researchers evaluated DenseVT across five small-scale benchmarks: CIFAR-10, CIFAR-100, SVHN, Flowers-102, and Tiny ImageNet.
- Performance Gains: On the Flowers-102 dataset, the Swin-Tiny backbone achieved a staggering 17.05% accuracy improvement over standard RGB inputs.
- Surpassing CNN Baselines: On CIFAR-100, the Focal Transformer equipped with DenseVT reached 73.94% accuracy, outperforming the ResNet50 baseline of 73.24%.
- Efficiency: Despite the preprocessing steps, the reduction to 18 channels allows the model to process 25% fewer channels than previous frequency-domain methods while achieving superior accuracy.
Discussion and Conclusion
DenseVT demonstrates that the "data hunger" of ViTs can be mitigated by aligning the information density of image inputs with the architectural strengths of Transformers. By moving to the frequency domain, the model gains interpretability—researchers can visualize exactly which frequencies drive classification decisions.
While the current method relies on a static selection of channels based on dataset-wide averages and a pre-trained ResNet50 "teacher," future work could explore dynamic, per-image channel selection. Nevertheless, DenseVT provides a robust framework for making Vision Transformers viable and competitive on small-scale datasets without the need for massive pre-training.
Summary updated