Discrete Cosine Transform Based Decorrelated Attention for Vision Transformers

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Pan, Hongyi, Hamdan, Emadeldeen, Zhu, Xin, Cetin, Ahmet Enis, Bagci, Ulas
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917500679094272
author Pan, Hongyi
Hamdan, Emadeldeen
Zhu, Xin
Cetin, Ahmet Enis
Bagci, Ulas
author_facet Pan, Hongyi
Hamdan, Emadeldeen
Zhu, Xin
Cetin, Ahmet Enis
Bagci, Ulas
contents Self-attention is central to the success of Transformer architectures; however, learning the query, key, and value projections from random initialization remains challenging and computationally expensive. In this paper, we propose two complementary methods that leverage the Discrete Cosine Transform (DCT) to enhance the efficiency and performance of Vision Transformers. First, we address the initialization problem by introducing a simple yet effective DCT-based initialization strategy for self-attention, where projection weights are initialized using DCT coefficients. This structure-preserving approach consistently improves classification accuracy on the CIFAR-10 and ImageNet-1K benchmarks. Second, we propose a DCT-based attention compression technique that exploits the decorrelation properties of the frequency domain. By observing that high-frequency DCT coefficients typically correspond to noise, we truncate high-frequency components of the input patches, thereby reducing the dimensionality of the query, key, and value projections without sacrificing accuracy. Experiments on Swin Transformer models demonstrate that the proposed compression method achieves a substantial reduction in computational overhead while maintaining comparable performance.
format Preprint
id arxiv_https___arxiv_org_abs_2405_13901
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Discrete Cosine Transform Based Decorrelated Attention for Vision Transformers
Pan, Hongyi
Hamdan, Emadeldeen
Zhu, Xin
Cetin, Ahmet Enis
Bagci, Ulas
Computer Vision and Pattern Recognition
Machine Learning
Signal Processing
Self-attention is central to the success of Transformer architectures; however, learning the query, key, and value projections from random initialization remains challenging and computationally expensive. In this paper, we propose two complementary methods that leverage the Discrete Cosine Transform (DCT) to enhance the efficiency and performance of Vision Transformers. First, we address the initialization problem by introducing a simple yet effective DCT-based initialization strategy for self-attention, where projection weights are initialized using DCT coefficients. This structure-preserving approach consistently improves classification accuracy on the CIFAR-10 and ImageNet-1K benchmarks. Second, we propose a DCT-based attention compression technique that exploits the decorrelation properties of the frequency domain. By observing that high-frequency DCT coefficients typically correspond to noise, we truncate high-frequency components of the input patches, thereby reducing the dimensionality of the query, key, and value projections without sacrificing accuracy. Experiments on Swin Transformer models demonstrate that the proposed compression method achieves a substantial reduction in computational overhead while maintaining comparable performance.
title Discrete Cosine Transform Based Decorrelated Attention for Vision Transformers
topic Computer Vision and Pattern Recognition
Machine Learning
Signal Processing
url https://arxiv.org/abs/2405.13901