Learning in the Frequency Domain

Kai Xu, Minghai Qin, Fei Sun, Yuhao Wang, Yen-Kuang Chen, Fengbo Ren

Abstract

Deep neural networks have achieved remarkable success in computer vision tasks. Existing neural networks mainly operate in the spatial domain with fixed input sizes. For practical applications, images are usually large and have to be downsampled to the predetermined input size of neural networks. Even though the downsampling operations reduce computation and the required communication bandwidth, it removes both redundant and salient information obliviously, which results in accuracy degradation. Inspired by digital signal processing theories, we analyze the spectral bias from the frequency perspective and propose a learning-based frequency selection method to identify the trivial frequency components which can be removed without accuracy loss. The proposed method of learning in the frequency domain leverages identical structures of the well-known neural networks, such as ResNet-50, MobileNetV2, and Mask R-CNN, while accepting the frequency-domain information as the input. Experiment results show that learning in the frequency domain with static channel selection can achieve higher accuracy than the conventional spatial downsampling approach and meanwhile further reduce the input data size. Specifically for ImageNet classification with the same input size, the proposed method achieves 1.41% and 0.66% top-1 accuracy improvements on ResNet-50 and MobileNetV2, respectively. Even with half input size, the proposed method still improves the top-1 accuracy on ResNet-50 by 1%. In addition, we observe a 0.8% average precision improvement on Mask R-CNN for instance segmentation on the COCO dataset.

Introduction: The Downsampling Dilemma

Most modern Convolutional Neural Networks (CNNs) are designed to accept small, fixed-size inputs, typically $224 \times 224$ pixels. However, real-world images are often high-definition or larger. To bridge this gap, practitioners usually use spatial downsampling (interpolation), which "obliviously" discards both redundant and salient information. This leads to a loss of fine-grained detail and decreased model accuracy.

Furthermore, in modern AI systems, the computational power of GPUs is evolving faster than the data-loading throughput of CPUs. Moving large, uncompressed RGB images from the CPU to the GPU creates a massive communication bottleneck (CB). The authors seek a way to preserve more useful information from high-resolution images without increasing—and ideally decreasing—this communication load.

Comparison between conventional spatial downsampling (a) and the proposed frequency-domain learning (b).

Methodology: Shifting to the Frequency Domain

The proposed pipeline shifts image processing from the spatial domain to the frequency domain using the Discrete Cosine Transform (DCT), the mathematical foundation of JPEG compression.

The DCT Pipeline

  1. DCT Transformation: High-resolution images are converted to the YCbCr color space and then transformed into DCT coefficients using $8 \times 8$ blocks.
  2. Reshaping: Instead of treating the image as a grid of blocks, the authors group coefficients of the same frequency across all blocks into separate channels. For an RGB image, this results in $8 \times 8 \times 3 = 192$ frequency channels. This reshaped input has a smaller spatial resolution but a much higher channel count.
  3. Learning-based Frequency Selection: Not all frequencies are equally important for computer vision. The authors use a "gate module" with a Gumbel-Softmax trick to automatically identify which frequency channels are "trivial" and can be pruned. This allows the network to learn which parts of the spectrum are vital for the specific task.
The proposed frequency-domain pre-processing pipeline, including DCT transformation, reshaping, and channel selection.

Architectural Integration

Standard models like ResNet-50 or MobileNetV2 are minimally modified. The initial layers (like the $7 \times 7$ convolution in ResNet) are removed to accommodate the new input shape, while the rest of the "backbone" remains identical.

Key Insights and Results

The study confirms a "spectral bias": while CNNs are sensitive to low-frequency information (like the Human Visual System), they also find significant value in specific high-frequency components that spatial downsampling usually destroys.

Performance Benchmarks

The researchers evaluated their approach on ImageNet (classification) and COCO 2017 (segmentation):

  • ImageNet Classification: On ResNet-50, the proposed method achieved a 1.60% top-1 accuracy improvement over the standard RGB baseline. Even when the input data size was cut in half, the method still outperformed the full-size RGB ResNet-50 baseline by 1.42%.
  • Instance Segmentation: Using Mask R-CNN on the COCO dataset, the frequency-domain approach yielded a 0.8% Average Precision (AP) improvement.

The authors found they could prune up to 87.5% of the frequency channels with little to no loss in accuracy, directly addressing the communication bandwidth bottleneck.

Conclusion

By processing images in the frequency domain, neural networks can preserve more salient information from high-resolution sources while reducing the data bandwidth required for inference. This approach demonstrates that the "oblivious" nature of spatial downsampling can be overcome by learning-based frequency selection, leading to more efficient and accurate computer vision models.

Summary updated

BibTeX
@inproceedings{xu2020learning,
  author = {Kai Xu and Minghai Qin and Fei Sun and Yuhao Wang and Yen-Kuang Chen and Fengbo Ren},
  title = {{Learning in the Frequency Domain}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00181},
}
Figure