DCT Perceptron Layer: A Transform Domain Approach for Convolution Layer

Hongyi Pan, Xin Zhu, Salih Atici, Ahmet Enis ÇetinarXiv 2022 · OpenReview

Abstract

In this paper, we propose a novel Discrete Cosine Transform (DCT)-based neural network layer which we call DCT-perceptron to replace the $3\times3$ Conv2D layers in the Residual neural Network (ResNet). Convolutional filtering operations are performed in the DCT domain using element-wise multiplications by taking advantage of the Fourier and DCT Convolution theorems. A trainable soft-thresholding layer is used as the nonlinearity in the DCT perceptron. Compared to ResNet's Conv2D layer which is spatial-agnostic and channel-specific, the proposed layer is location-specific and channel-specific. The DCT-perceptron layer reduces the number of parameters and multiplications significantly while maintaining comparable accuracy results of regular ResNets in CIFAR-10 and ImageNet-1K. Moreover, the DCT-perceptron layer can be inserted with a batch normalization layer before the global average pooling layer in the conventional ResNets as an additional layer to improve classification accuracy.

Introduction

Deep learning models like ResNet have achieved remarkable success in image classification, but their increasing depth leads to a significant rise in parameter counts and computational requirements (MACs). This "weight" problem makes deployment on resource-constrained edge devices challenging. Researchers from the University of Illinois Chicago have proposed the DCT Perceptron Layer as a solution. By shifting convolutional operations from the spatial domain to the frequency domain using the Discrete Cosine Transform (DCT), they achieve up to a 44% reduction in parameters while maintaining classification accuracy.

Methodology: The DCT-Perceptron Layer

The core innovation leverages the Convolution Theorem, which states that a complex convolution in the spatial domain is equivalent to a simple point-wise multiplication in the frequency domain. The DCT-Perceptron Layer consists of five primary stages:

  1. 2D-DCT: The input feature map is transformed into the frequency domain. The DCT is preferred over the Fourier Transform as it uses only real numbers, enhancing computational efficiency.
  2. Scaling (Filtering): Filtering is performed via element-wise multiplication with a learnable weight matrix in the DCT domain.
  3. 1x1 Conv2D: This stage manages channel-specific learning and mixing.
  4. Trainable Soft-Thresholding: Standard ReLU non-linearities are unsuitable for the frequency domain because they eliminate negative components necessary for the inverse transform. The authors employ a trainable soft-thresholding function ($y = \text{sign}(x)(|x| - T)_+$) to denoise the signal while preserving essential frequency information.
  5. 2D-IDCT: The data is transformed back into the spatial domain.

The researchers also introduced a "Tripod" structure, utilizing three parallel DCT-P paths to capture a broader range of features, enhancing accuracy with minimal efficiency loss.

Detailed architecture of the DCT-P and Tripod DCT-P blocks.

Key Results

The proposed architecture was evaluated on CIFAR-10 and ImageNet-1K benchmarks. The results indicate that the DCT-perceptron significantly improves efficiency without sacrificing performance:

  • ImageNet-1K (ResNet-50): The DCT-based version reduced parameters from 25.56M to 18.28M (28.5% reduction) and MACs from 4.12G to 2.77G (32.8% reduction), maintaining a Top-1 accuracy of 75.17%.
  • CIFAR-10 (ResNet-20): The "Tripod" DCT-ResNet-20 outperformed the baseline ResNet-20 (91.75% vs 91.66% accuracy) while using 26.6% fewer parameters.
  • Accuracy Booster: Adding a single DCT-perceptron layer before final pooling in a standard ResNet-50 improved Top-5 accuracy on ImageNet to 93.84%.
Accuracy vs. Parameters comparison across various architectures, highlighting the efficiency of DCT-P and Tripod DCT-P.

Discussion and Limitations

The DCT-perceptron introduces location-specific learning. Since DCT coefficients represent specific frequency patterns across the input, the scaling layer allows the network to adapt to visual patterns more flexibly than a sliding spatial window. Furthermore, the use of fast $O(N \log N)$ algorithms for DCT/IDCT ensures that the overall MAC count remains low.

However, practical challenges remain. Current deep learning frameworks are highly optimized for spatial convolutions; developing fast DCT kernels that match cuDNN-optimized performance is necessary for widespread deployment. Additionally, the authors noted that replacing layers involved in downsampling (stride > 1) with DCT-P led to accuracy drops, necessitating that these layers remain as standard spatial convolutions for now.

Conclusion

The DCT Perceptron Layer offers a promising path toward more efficient deep learning models. By rethinking convolutions in the frequency domain and addressing the limitations of standard non-linearities like ReLU, this approach provides a scalable method to reduce the computational footprint of state-of-the-art architectures. Future work may extend this transform-domain approach to other models, such as Vision Transformers.

Summary updated

BibTeX
@misc{pan2022dct,
  author = {Hongyi Pan and Xin Zhu and Salih Atici and Ahmet Enis Çetin},
  title = {{DCT Perceptron Layer: A Transform Domain Approach for Convolution Layer}},
  year = {2022},
  eprint = {2211.08577},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.08577},
}
Figure