[Paper Review] CF-ViT: A General Coarse-to-Fine Method for Vision Transformer
CF-ViT proposes a general coarse-to-fine inference framework for Vision Transformers that reduces computational cost by first classifying images with coarse-grained patches (7×7) and only refining uncertain predictions via fine-grained patch splitting (14×14). It achieves 53% FLOPs reduction and 2.01× throughput gain over LV-ViT without performance drop, using class attention to identify informative regions for adaptive refinement.
Vision Transformers (ViT) have made many breakthroughs in computer vision tasks. However, considerable redundancy arises in the spatial dimension of an input image, leading to massive computational costs. Therefore, We propose a coarse-to-fine vision transformer (CF-ViT) to relieve computational burden while retaining performance in this paper. Our proposed CF-ViT is motivated by two important observations in modern ViT models: (1) The coarse-grained patch splitting can locate informative regions of an input image. (2) Most images can be well recognized by a ViT model in a small-length token sequence. Therefore, our CF-ViT implements network inference in a two-stage manner. At coarse inference stage, an input image is split into a small-length patch sequence for a computationally economical classification. If not well recognized, the informative patches are identified and further re-split in a fine-grained granularity. Extensive experiments demonstrate the efficacy of our CF-ViT. For example, without any compromise on performance, CF-ViT reduces 53% FLOPs of LV-ViT, and also achieves 2.01x throughput.
Motivation & Objective
- To reduce computational redundancy in Vision Transformers caused by uniform high-resolution patch processing.
- To identify images that can be accurately classified with coarse-grained patches to save computation.
- To refine only informative regions in 'hard' images using fine-grained patches, preserving accuracy.
- To develop a general, input-adaptive inference strategy applicable to various ViT architectures.
Proposed method
- The model uses a two-stage inference pipeline: coarse stage with 7×7 patches and fine stage with 14×14 patches for uncertain samples.
- Class attention from the last encoder is used to identify informative patches requiring further splitting.
- A confidence threshold η determines whether to proceed to the fine stage, enabling adaptive computation.
- A knowledge distillation loss combines cross-entropy and KL divergence to align coarse and fine predictions.
- The method dynamically splits only informative regions, avoiding full-image reprocessing.
- The framework is trained end-to-end with a loss function that encourages coarse predictions to align with fine-grained outputs.
Experimental results
Research questions
- RQ1Can coarse-grained patch splitting (7×7) effectively identify informative regions in images for efficient ViT inference?
- RQ2Can a small number of coarse tokens achieve high accuracy on most images, reducing overall FLOPs?
- RQ3Does adaptive refinement of only informative patches outperform uniform fine-grained processing in terms of efficiency and accuracy?
- RQ4How does the choice of confidence threshold η affect the trade-off between accuracy and computational cost?
Key findings
- CF-ViT reduces 53% FLOPs and achieves 2.01× higher throughput compared to LV-ViT, with no performance degradation.
- Using only 7×7 patches, DeiT-S achieves 73.2% top-1 accuracy, indicating that most images are 'easy' and can be classified coarsely.
- The model correctly classifies 76.8% of images at the coarse stage, with the remaining 23.2% requiring fine-grained refinement.
- Ablation studies show that informative region identification is critical—without it, FLOPs increase drastically due to full-image re-splitting.
- Setting α = 0.5 and β = 0.99 yields the best balance between accuracy and efficiency in the loss and attention weighting components.
- The CE+KL loss function outperforms CE+CE, reducing fine-stage accuracy drop by 0.5% while slightly improving coarse-stage performance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.