[论文解读] LPT: Long-tailed Prompt Tuning for Image Classification
LPT 提出了一种用于长尾图像分类的提示微调方法,该方法冻结预训练视觉模型,仅微调一组可学习提示。它采用两阶段训练方案,使用共享提示进行领域自适应,使用针对类别组的提示进行细粒度区分,仅增加约1.1%的可训练参数,便实现了最先进性能,并提升了对领域偏移的鲁棒性。
For long-tailed classification, most works often pretrain a big model on a large-scale dataset, and then fine-tune the whole model for adapting to long-tailed data. Though promising, fine-tuning the whole pretrained model tends to suffer from high cost in computation and deployment of different models for different tasks, as well as weakened generalization ability for overfitting to certain features of long-tailed data. To alleviate these issues, we propose an effective Long-tailed Prompt Tuning method for long-tailed classification. LPT introduces several trainable prompts into a frozen pretrained model to adapt it to long-tailed data. For better effectiveness, we divide prompts into two groups: 1) a shared prompt for the whole long-tailed dataset to learn general features and to adapt a pretrained model into target domain; and 2) group-specific prompts to gather group-specific features for the samples which have similar features and also to empower the pretrained model with discrimination ability. Then we design a two-phase training paradigm to learn these prompts. In phase 1, we train the shared prompt via supervised prompt tuning to adapt a pretrained model to the desired long-tailed domain. In phase 2, we use the learnt shared prompt as query to select a small best matched set for a group of similar samples from the group-specific prompt set to dig the common features of these similar samples, then optimize these prompts with dual sampling strategy and asymmetric GCL loss. By only fine-tuning a few prompts while fixing the pretrained model, LPT can reduce training and deployment cost by storing a few prompts, and enjoys a strong generalization ability of the pretrained model. Experiments show that on various long-tailed benchmarks, with only ~1.1% extra parameters, LPT achieves comparable performance than previous whole model fine-tuning methods, and is more robust to domain-shift.
研究动机与目标
- 解决在长尾图像分类中全量微调带来的高计算成本和泛化能力下降问题。
- 通过仅存储少量可训练提示而非整个模型,降低部署成本。
- 通过保留冻结的预训练模型的泛化能力,提升模型对领域偏移的鲁棒性。
- 在不从零重新训练特征提取器或分类器的前提下,实现对长尾数据的有效适应。
- 通过捕捉相似样本间共享特征的组特定提示,增强细粒度区分能力。
提出的方法
- 引入两种可学习提示:一种是用于通用领域自适应的共享提示,另一种是用于细粒度特征学习的组特定提示。
- 采用两阶段训练范式:第一阶段,在长尾数据上优化共享提示和分类器;第二阶段,使用学习到的共享提示作为查询,筛选出相关的组特定提示。
- 通过类标记(查询)与组特定提示集中的键之间的余弦相似度,识别每个输入最相关的提示。
- 在第二阶段使用双采样策略和非对称高斯云逻辑损失(A-GCL)来优化组特定提示。
- 固定预训练模型,仅微调提示,显著降低训练和部署成本。
- 采用解耦训练:第一阶段训练共享提示和分类器,第二阶段固定共享提示,仅优化组特定提示。
实验结果
研究问题
- RQ1使用少量可学习参数的提示微调能否有效适应冻结的预训练模型用于长尾图像分类?
- RQ2与全量微调相比,分离共享提示与组特定提示是否能提升性能和泛化能力?
- RQ3将第一阶段模型用作查询函数,与使用预训练ViT进行提示匹配相比,性能如何?
- RQ4在准确率和鲁棒性方面,组特定提示的最佳组大小是多少?
- RQ5与全量微调相比,LPT在领域偏移下的泛化能力提升程度如何?
主要发现
- 在ViT-B上,LPT在iNaturalist 2018数据集上达到50.07%的整体准确率,超越全量微调方法,创下新的 SOTA 记录。
- 仅增加约1.1%的可训练参数,LPT在多个基准测试中性能优于或匹配先前的全量微调方法。
- 使用第一阶段模型作为查询函数,将K-NN准确率提升至36.16%,并将第二阶段准确率提升至50.07%,优于使用预训练ViT-B作为查询的方案。
- 解耦训练(各40轮)达到50.07%的准确率,优于联合训练(80轮)的47.48%,证明了固定最优查询的优势。
- 该方法对领域偏移具有鲁棒性,在测试数据分布与训练数据不同时仍表现出强泛化能力。
- 提示匹配分析表明,每个类别中前两名匹配提示覆盖了大部分样本,证实了提示选择的自适应性和有效性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。