Patch Size对Vision Transformers微调的影响:2D与3D医学图像分类研究
Effect of Patch Size on Fine-Tuning Vision Transformers in Two-Dimensional and Three-Dimensional Medical Image Classification
研究基于12个医学影像数据集(7个2D、5个3D)微调ViT模型,发现patch size为1、2、4时分类性能最佳,2D数据集平衡准确率最高提升12.78个百分点(patch size 2 vs. 28),3D数据集最高提升23.78个百分点(patch size 1 vs. 14),代价是计算开销增加。融合patch size 1、2、4训练的模型可进一步提升多数场景性能,尤其在2D数据集上。
arXiv:2602.18614v2 Announce Type: replace Abstract: Vision Transformers (ViTs) and their variants have become state-of-the-art in many computer vision tasks. While substantial research has focused on architectural improvements, the impact of patch size, a crucial design choice in ViTs, remains underexplored, particularly in medical domains where both two-dimensional (2D) and three-dimensional (3D) imaging modalities exist. In this study, using 12 medical imaging datasets from various imaging modalities (including seven 2D and five 3D datasets), we conduct a thorough evaluation of how different patch sizes affect ViT classification performance. Using a single graphical processing unit (GPU) and a range of patch sizes (1, 2, 4, 7, 14, 28), we fine-tune ViT models and observe consistent improvements in classification performance with smaller patch sizes (1, 2, and 4), which achieve the best results across nearly all datasets. More specifically, our results indicate improvements in balanced accuracy of up to 12.78 percentage points for 2D datasets (patch size 2 vs. 28) and up to 23.78 percentage points for 3D datasets (patch size 1 vs. 14), at the cost of increased computational expense. Moreover, by combining the models trained with patch sizes 1, 2, and 4 using four fusion strategies, we achieve further performance gains in most cases, particularly for the 2D datasets. We further investigate the generalizability of these findings across higher image resolutions, different transformer architectures, and varying amounts of training data, observing performance trends similar to those of the main experiments. Our full implementation, along with guidelines for running the code, is publicly available on GitHub:https://github.com/HealMaDe/MedViT.
来源:arXiv (AI + Vision + Imaging) · arxiv.org