\definechangesauthor

[name=Author1, color=red]A1 \definechangesauthor[name=Author2, color=green]A2

Embedded Prompt Tuning: Towards Enhanced Calibration of Pretrained Models for Medical Images

Wenqiang Zu1,4,6∗, Shenghao Xie2,5,6∗, Qing Zhao3, Guoqi Li4
Lei Ma3,6
1 School of Artificial Intelligence, University of Chinese Academy of Sciences
2 Academy for Advanced Interdisciplinary Studies, Peking University
3 College of Future Technology, Peking University
4 Institute of Automation, Chinese Academy of Sciences
5 School of Cyber Science and Engineering, Wuhan University
6 Bei**g Academy of Artificial Intelligence
Equal contribution.Lei Ma is the corresponding author with email: [email protected].
Abstract

Foundation models pre-trained on large-scale data have been widely witnessed to achieve success in various natural imaging downstream tasks. Parameter-efficient fine-tuning (PEFT) methods aim to adapt foundation models to new domains by updating only a small portion of parameters in order to reduce computational overhead. However, the effectiveness of these PEFT methods, especially in cross-domain few-shot scenarios, e.g., medical image analysis, has not been fully explored. In this work, we facilitate the study of the performance of PEFT when adapting foundation models to medical image classification tasks. Furthermore, to alleviate the limitations of prompt introducing ways and approximation capabilities on Transformer architectures of mainstream prompt tuning methods, we propose the Embedded Prompt Tuning (EPT) method by embedding prompt tokens into the expanded channels. We also find that there are anomalies in the feature space distribution of foundation models during pre-training process, and prompt tuning can help mitigate this negative impact. To explain this phenomenon, we also introduce a novel perspective to understand prompt tuning: Prompt tuning is a distribution calibrator. And we support it by analyzing patch-wise scaling and feature separation operations contained in EPT. Our experiments show that EPT outperforms several state-of-the-art fine-tuning methods by a significant margin on few-shot medical image classification tasks, and completes the fine-tuning process within highly competitive time, indicating EPT is an effective PEFT method. The source code is available at github.com/zuwenqiang/EPT.

1 Introduction

Benifiting from massive training data, foundation models [1] have been widely witnessed to achieve impressive performance in various natural imaging downstream tasks, e.g., classification [2, 3], segmentation [4, 5, 6, 7], and detection [8, 9, 10].

Recent studies have attempted to explore the potential of foundation models in medical image analysis [11, 12, 13, 14, 15]. Although foundation models have robust representation and generalization capabilities on natural images, their adaptabilities are still challenged when facing downstream tasks with a significant domain gap [16]. Therefore, foundation models need to be re-trained on medical datasets to incorporate domain-specific knowledge.

However, due to the huge number of parameters in foundation models, training from scratch would result in significant computational and memory cost. To address this issue, parameter-efficient fine-tuning (PEFT) [17] methods have been proposed. The main idea of PEFT is to freeze most of parameters in foundation models, and only fine-tune a small number of existing or additionally introduced parameters. In medical image analysis, the data avalilability is limited due to several factors, e.g., significant imaging noise [18], high annotation cost [19], privacy policies [20], and rare diseases [21] etc. These factors exacerbate the data-hungry nature of the foundational models [22]. Therefore, there is a more urgent need for research on fine-tuning methods in the field of medical image analysis. To our best knowledge, the effectiveness of PEFT in such cross-domain few-shot scenarios has not yet been fully evaluated. Therefore, we launch the first comprehensive benchmark test of PEFT for few-shot medical image classification tasks on MedFMC [23].

Prompt tuning is a common paradigm of PEFT by introducing extra prompt tokens into embedding tokens of the input image. VPT [24] prepends prompts before images parallelly, while VP [25] adds prompts into images. Intuitively, previous prompt tuning methods have flaws in the way of introducing prompts. VPT cannot adjust each original token individually and fine-grainedly, whereas VP significantly disrupts the information contained in original tokens. Moreover, Wang et al. [26] points that prompt tuning has limited approximation capabilities on Transformer architectures, performing less effectively compared to LoRA [27]. Therefore, we ask: Can we design a new prompt tuning method that effectively enhances the information of original tokens\deletedbut also breaks through the limitations of approximation capabilities? In this paper, we propose the Embedded Prompt Tuning (EPT) method to answer this question. By embedding prompt tokens into expanded channels, EPT can introduce useful context to optimize input tokens fine-grainedly when maintaining the original information.

Additionally, we observe that foundation models pre-trained on natural images, when directly applied to downstream medical image classification tasks, would result in an apparent distance between samples from the same class in the feature space. Furthermore, prompt tuning helps mitigate this negative impact [28, 29], and we wonder: Is prompt tuning fundamentally a type of distribution calibrators? To figure it out, we further analyze two micro-operations of EPT: patch-wise scaling and feature separation, and provide preliminary theoretical analysis. In our findings, patch-wise scaling shorten the intra-class distribution distance by drawing closer the representation of common features among samples from the same class, and feature separation enhances the representation [30] and decoupling capabilites of features by expanding the input dimension.

In summary, our work proposes a novel PEFT method for cross-domain few-shot learning and medical image analysis. We hope our methods and findings can inspire and facilitate more valuable works in the future. Our contributions can be summarized as follows:

  1. 1.

    We propose a novel parameter-efficient prompt tuning method, namely EPT, which not only addresses shortcomings in prompt introducing ways of previous prompt tuning methods, but also exhibits stronger approximation capabilites on Transformer architectures.

  2. 2.

    We develop a new perspective to understand prompt tuning: Prompt is a distribution calibrator. We also support it by analyzing patch-wise scaling and feature separation operations in EPT intuitively and theoretically.

  3. 3.

    We launch the first comprehensive benchmark evaluation of PEFT for medical image classification tasks on MedFMC, offering further inspirations for future research.

  4. 4.

    Extensive experiments demonstrate that EPT achieves superior performance in cross-domain few-shot scenarios, e.g., medical image analysis, outperforming several state-of-the-art fine-tuning methods on few-shot medical image classification tasks by a large margin, and completes the fine-tuning process within highly competitive time.

2 Related Work

2.1 Parameter-Efficient Fine-Tuning

The goal of PEFT is to achieve higher performance by fine-tuning as few parameters as possible when adapting foundation models to downstream tasks. PEFT generally fine-tunes Transformer at three positions: input, backbone, and linear head. Since the linear head is essential for downstream tasks, it typically needs to be fine-tuned. Therefore, PEFT pays more attention on the input and backbone, and has correspondingly raised two representative methods: prompt tuning and adapter tuning.

Prompt tuning introduces extra tokens into the input image and fine-tunes them. VPT [24] prepends prompt tokens before embedding tokens parallelly. DVPT [31] employs cross-attention mechanism between prompts and features to capture distribution-specific knowledge. VP [25] adds values of prompt tokens and embedding tokens across all channels. EVP [32] primarily focuses on high-frequency components of features. CoOp [33] utilizes learnable text to addressing the issue of semantic consistency across different sentences. CoCoOp [34] introduces a Meta-net to generate prompts and enhance the generalizability. KgCoOp [35] constructed a regularization term to minize the gap between generated and crafted prompts.

Adapter tuning introduces carefully designed structures into the backbone and fine-tunes them. Adaptformer [36] is the first to introduce adapters to vision transformers by replacing MLP in transformer layers with AdaptMLP. Tip-Adapter [37] leverages knowledge from the few-shot dataset as keys and values and supports feature querying to update the output from CLIP encoders without training. TaskRes [38] decomposes pre-trained and task-specific knowledge on the textual classifier. CLIP-Adapter [39] conducts residual-style feature blending between adapters and pre-trained backbones. LoRA [27] decomposes model weights through low-rank matrices. SCT [40] leverages task-specific knowledge from salient channels of the feature map.

Our proposed EPT belongs to the category of prompt tuning, we think that prompt tuning, compared to adapter tuning, can more directly influence the input by introducing extra context, thus having a stronger effect on distribution calibration. It is also worth noting that the prompt tuning methods, unlike commonly used hard prompts in context learning, introduces parameter-learnable soft prompts. Different from VPT and VP, EPT pays more attention on expanded embedding channels. Unlike PEFT for multimodal foundation models, e.g., CoOp, CLIP-Adapter, Tip-Adapter, and TaskRes etc., EPT is designed for image-only foundation models. In cross-domain few-shot scenarios, e.g., medical image analysis, there are inadequate high-quality image-text pairs, the textual information of labels is insufficient to provide rich features, while the potential of images has not yet been fully exploited.

2.2 PEFT for Medical Image Analysis

PEFT begins to be adopted when transferring foundational models to medical image analysis scenarios recently[22]. DVPT [31], as a variant of VPT, explores the potential of prompt tuning in medical image analysis scenarios. Zhang et al. adapts SAM [4] to medical domains by LoRA. Wu et al. [41] proposes medical sam adapter (Med-SA) to incorporate medical knowledge into SAM and designs Hyper-Prompting Adapter (HyP-Adpt) to adapt to different prompt conditioning strategies. However, the effectiveness of PEFT has yet to be fully evaluated in cross-domain few-shot scenarios, e.g., medical image analysis. VPPT [42] conducts experiments of prompt tuning in natural imaging few-shot scenarios, but adapter tuning has not been tested and the domain gap is not significant. Dutt et al. [22] tests the performance of adapter tuning in medical image analysis scenarios, but prompt tuning methods do not receive sufficient attention. Wang et al. [23] proposed MedFMC benchmark in order to promote the research of PEFT in adapting foundation models to medical domains. In this paper, we conduct the first comprehensive effectiveness evaluation of PEFT in cross-domain few-shot scenarios, e.g., medical image analysis.

Refer to caption
Figure 1: Overview of proposed Embedded Prompt Tuning (EPT)\deletedand Location-Aware Prompt (LAP) Framework. (a) Contrast of VPT and EPT framework: During the fine-tuning process of VPT\deletedpre-trained vision Transformer, only the prompts embedded in each input image token are updated while the whole Transformer encoder is frozen. As a comparison, EPT embeds prompts in the softmax operation of Q and K matrices in each token (patch), rather than directly embedding prompts in input positions\deletedEPT embeds each prompt token with the corresponding image tokens in the direction of embedding dimmensions and VPT prepends prompt tokens before image tokens in the direction of the width and height of the image. (b) Overview of prompted softmax. EPT achieves scaling of embedding for each patch by embedding (or concatenating after or before each patch) learnable parameters in the multiplication matrix of Q and K, followed by utilizing softmax normalization, thereby achieving scaling functionality for each patch embedding \deletedContrast of Self-attention Layer between VPT and EPT (Ours): EPT adds prompts with the V matrix and concurrently concatenating prompts with the Q and K matrices in the direction of embedding dimmensions. In contrast, VPT inserts prompts in the direction of width and height to Q, K and V matrices, giving priority to increasing the input breadth instead of depth considered by EPT which may enhance the representation capability of input tokens. (c) EPT achieves distribution calibration of frozen features through patch-wise scaling. Patch-wise scaling can reduce the intra-class distances for each class of samples.\deletedLocation-Aware Prompt: For medical images, we first generate saliency maps to identify salient regions. We then select the top K𝐾Kitalic_K tokens, calculate the local prior of each selected token and the attention prior of all selected tokens respectively. At last, we add local priors with embeddings of corresponding each selected token and the classification token in prompts. (Here we generate the saliency map using the traditional machine learning based method from SSiT [huang2022ssit] for better illustration.)

3 Method

3.1 Preliminaries

Notations and Organization

Let σ𝜎\sigmaitalic_σ be the softmax operators. A bold lower case character, e.g. 𝐱𝐱\mathbf{x}bold_x, denotes a vector. A bold upper case character, e.g. 𝐖𝐖\mathbf{W}bold_W, denotes a matrix while 𝐖i,jsubscript𝐖𝑖𝑗\mathbf{W}_{i,j}bold_W start_POSTSUBSCRIPT italic_i , italic_j end_POSTSUBSCRIPT, 𝐖i,:subscript𝐖𝑖:\mathbf{W}_{i,{:}}bold_W start_POSTSUBSCRIPT italic_i , : end_POSTSUBSCRIPT and 𝐖:,jsubscript𝐖:𝑗\mathbf{W}_{:,j}bold_W start_POSTSUBSCRIPT : , italic_j end_POSTSUBSCRIPT is the (i,j)𝑖𝑗(i,j)( italic_i , italic_j )-th element, i𝑖iitalic_i-th row, j𝑗jitalic_j-th column, respectively. We use ReLU(𝐯)=max(𝐯,𝟎)𝑅𝑒𝐿𝑈𝐯𝐯0{ReLU}(\mathbf{v})=\max(\mathbf{v},\mathbf{0})italic_R italic_e italic_L italic_U ( bold_v ) = roman_max ( bold_v , bold_0 ) to denote the ReLU activation function where max()\max(\cdot)roman_max ( ⋅ ) function is applied entry wise to a vector.

3.1.1 Transformers

For descriptive purposes, we use single head attention to illustrate. Moreover, we use 𝐗d×n𝐗superscript𝑑𝑛\mathbf{X}\in\mathbb{R}^{d\times n}bold_X ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n end_POSTSUPERSCRIPT to describe the input shape in the subsequent explanations, instead of 𝐗n×d𝐗superscript𝑛𝑑\mathbf{X}\in\mathbb{R}^{n\times d}bold_X ∈ blackboard_R start_POSTSUPERSCRIPT italic_n × italic_d end_POSTSUPERSCRIPT depicted in Fig 1. We use 𝐐,𝐊𝐐𝐊\mathbf{Q},\mathbf{K}bold_Q , bold_K, and 𝐕𝐕\mathbf{V}bold_V to denote the multiplication of 𝐖qd×d,𝐖kd×d,𝐖vd×dformulae-sequencesubscript𝐖𝑞superscript𝑑𝑑formulae-sequencesubscript𝐖𝑘superscript𝑑𝑑subscript𝐖𝑣superscript𝑑𝑑\mathbf{W}_{q}\in\mathbb{R}^{d\times d},\mathbf{W}_{k}\in\mathbb{R}^{d\times d% },\mathbf{W}_{v}\in\mathbb{R}^{d\times d}bold_W start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_d end_POSTSUPERSCRIPT , bold_W start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_d end_POSTSUPERSCRIPT , bold_W start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_d end_POSTSUPERSCRIPT, and 𝐗d×n𝐗superscript𝑑𝑛\mathbf{X}\in\mathbb{R}^{d\times n}bold_X ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n end_POSTSUPERSCRIPT, where d𝑑ditalic_d represents the embedding dimensions, and n𝑛nitalic_n represents the number of patches. Therefore, we have:

𝐐=𝐖q𝐗,𝐊=𝐖k𝐗,𝐕=𝐖v𝐗formulae-sequence𝐐subscript𝐖𝑞𝐗formulae-sequence𝐊subscript𝐖𝑘𝐗𝐕subscript𝐖𝑣𝐗\mathbf{Q}=\mathbf{W}_{q}\mathbf{X},\quad\mathbf{K}=\mathbf{W}_{k}\mathbf{X},% \quad\mathbf{V}=\mathbf{W}_{v}\mathbf{X}bold_Q = bold_W start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT bold_X , bold_K = bold_W start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT bold_X , bold_V = bold_W start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT bold_X (1)

Then, a self-attention operation of input token sequence 𝐗d×n𝐗superscript𝑑𝑛\mathbf{X}\in\mathbb{R}^{d\times n}bold_X ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n end_POSTSUPERSCRIPT can be represented as

Att(𝐗)=𝐕σ(𝐊𝐐)Att𝐗𝐕𝜎superscript𝐊top𝐐\operatorname{Att}(\mathbf{X})=\mathbf{V}\sigma\left(\mathbf{K}^{\top}\mathbf{% Q}\right)roman_Att ( bold_X ) = bold_V italic_σ ( bold_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT bold_Q ) (2)

The normalizing factor of 1dkq1subscript𝑑𝑘𝑞\frac{1}{\sqrt{d_{kq}}}divide start_ARG 1 end_ARG start_ARG square-root start_ARG italic_d start_POSTSUBSCRIPT italic_k italic_q end_POSTSUBSCRIPT end_ARG end_ARG is subsumed in the weight matrices 𝐖ksubscript𝐖𝑘\mathbf{W}_{k}bold_W start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT for notational simplicity. And we omitted the expression of multihead.

With (1) and (2), a standard Transformer layer τ𝜏\tauitalic_τ can be represented as

MLP(𝐗)MLP𝐗\displaystyle\operatorname{MLP}(\mathbf{X})roman_MLP ( bold_X ) =[𝐖2ReLU(𝐖1𝐗:,1+𝐛1)+𝐛2+𝐗:,1,\displaystyle=\left[\mathbf{W}_{2}\operatorname{ReLU}\left(\mathbf{W}_{1}% \mathbf{X}_{:,1}+\mathbf{b}_{1}\right)+\mathbf{b}_{2}+\mathbf{X}_{:,1},\right.= [ bold_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT roman_ReLU ( bold_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_X start_POSTSUBSCRIPT : , 1 end_POSTSUBSCRIPT + bold_b start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) + bold_b start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_X start_POSTSUBSCRIPT : , 1 end_POSTSUBSCRIPT , (3)
,𝐖2ReLU(𝐖1𝐗:,n+𝐛1)+𝐛2+𝐗:n]\displaystyle\left.\ldots,\mathbf{W}_{2}\operatorname{ReLU}\left(\mathbf{W}_{1% }\mathbf{X}_{:,n}+\mathbf{b}_{1}\right)+\mathbf{b}_{2}+\mathbf{X}_{:n}\right]… , bold_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT roman_ReLU ( bold_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_X start_POSTSUBSCRIPT : , italic_n end_POSTSUBSCRIPT + bold_b start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) + bold_b start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_X start_POSTSUBSCRIPT : italic_n end_POSTSUBSCRIPT ]
τ(𝐗)𝜏𝐗\displaystyle\tau(\mathbf{X})italic_τ ( bold_X ) =MLP(Att(𝐗)+𝐗).absentMLPAtt𝐗𝐗\displaystyle=\operatorname{MLP}(\operatorname{Att}(\mathbf{X})+\mathbf{X}).= roman_MLP ( roman_Att ( bold_X ) + bold_X ) .

3.1.2 Visual Prompt Tuning

Visual prompts are learnable parameters prepended to other tokens before a Transformer encoder layer. These visual prompts 𝐏d×np𝐏superscript𝑑subscript𝑛𝑝\mathbf{P}\in\mathbb{R}^{d\times n_{p}}bold_P ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT have the same dimension as other tokens, where npsubscript𝑛𝑝n_{p}italic_n start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT is the prompt length. Then the Transformer layers are represented as

[𝐙1,𝐗1]superscript𝐙1superscript𝐗1\displaystyle{\left[\mathbf{Z}^{1},\mathbf{X}^{1}\right]}[ bold_Z start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT , bold_X start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT ] =τ1([𝐏,𝐗0])absentsuperscript𝜏1𝐏superscript𝐗0\displaystyle=\tau^{1}\left(\left[\mathbf{P},\mathbf{X}^{0}\right]\right)= italic_τ start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT ( [ bold_P , bold_X start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT ] ) (4)
[𝐙i,𝐗i]superscript𝐙𝑖superscript𝐗𝑖\displaystyle{\left[\mathbf{Z}^{i},\mathbf{X}^{i}\right]}[ bold_Z start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT , bold_X start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ] =τi([𝐙i1,𝐗i1])i=2,3,,Nformulae-sequenceabsentsuperscript𝜏𝑖superscript𝐙𝑖1superscript𝐗𝑖1𝑖23𝑁\displaystyle=\tau^{i}\left(\left[\mathbf{Z}^{i-1},\mathbf{X}^{i-1}\right]% \right)\quad i=2,3,\ldots,N= italic_τ start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ( [ bold_Z start_POSTSUPERSCRIPT italic_i - 1 end_POSTSUPERSCRIPT , bold_X start_POSTSUPERSCRIPT italic_i - 1 end_POSTSUPERSCRIPT ] ) italic_i = 2 , 3 , … , italic_N
𝐲𝐲\displaystyle\mathbf{y}bold_y =Head(𝐗:,0N),absentHeadsubscriptsuperscript𝐗𝑁:0\displaystyle=\operatorname{Head}\left(\mathbf{{X}}^{N}_{:,0}\right),= roman_Head ( bold_X start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT start_POSTSUBSCRIPT : , 0 end_POSTSUBSCRIPT ) ,

where 𝐙id×npsuperscript𝐙𝑖superscript𝑑subscript𝑛𝑝\mathbf{Z}^{i}\in\mathbb{R}^{d\times n_{p}}bold_Z start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT represents the prompts computed by the i𝑖iitalic_i-th Transformer layer τisuperscript𝜏𝑖\tau^{i}italic_τ start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT, and 𝐗:,0Nsubscriptsuperscript𝐗𝑁:0\mathbf{{X}}^{N}_{:,0}bold_X start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT start_POSTSUBSCRIPT : , 0 end_POSTSUBSCRIPT represents the CLS token.

3.2 Embedded Prompt Tuning

VPT prepends prompt tokens before all original input tokens parallely, while VP adds the values of prompt tokens with original input tokens across all channels. These prompt introducing ways either do not fine-tune the original input tokens fine-grainedly or significantly disrupt the information of original input tokens. Therefore, we propose Embedded Prompt Tuning (EPT), embedding prompt tokens into expanded channels. In this way, EPT can not only preserve original information well, but also introduce extra useful context to optimize embedding tokens.

As shown in Fig 1, the concept of our proposed EPT method and its differences compared to VPT are illustrated. We use the EPT prompts 𝐏𝐄subscript𝐏𝐄\mathbf{P_{E}}bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT to differentiate 𝐏𝐏\mathbf{P}bold_P. 𝐏𝐄dp×nsubscript𝐏𝐄superscriptsubscript𝑑𝑝𝑛\mathbf{P_{E}}\in\mathbb{R}^{d_{p}\times n}bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT × italic_n end_POSTSUPERSCRIPT have a completely different shape from the prompts 𝐏d×np𝐏superscript𝑑subscript𝑛𝑝\mathbf{P}\in\mathbb{R}^{d\times n_{p}}bold_P ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT in VPT, where dpsubscript𝑑𝑝d_{p}italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT represents the prompt length. It should be noted that the prompts 𝐏𝐄subscript𝐏𝐄\mathbf{P_{E}}bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT are not directly inserted into the patch tokens but only appear during the softmax operation on 𝐊𝐓𝐐superscript𝐊𝐓𝐐\mathbf{{K^{T}}Q}bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q in the attention calculation, and they disappear after the computation is completed. The purpose of this approach is to scale 𝐊𝐓𝐐superscript𝐊𝐓𝐐\mathbf{{K^{T}}Q}bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q without altering its shape, enabling subsequent computations.

Next, we will provide the formal formulation of EPT. Embedded prompts are learnable parameters embedded in the 𝐊𝐓𝐐superscript𝐊𝐓𝐐\mathbf{{K^{T}}Q}bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q matrix and jointly participate in subsequent softmax calculations. And these embedded prompts 𝐏𝐄dp×nsubscript𝐏𝐄superscriptsubscript𝑑𝑝𝑛\mathbf{P_{E}}\in\mathbb{R}^{d_{p}\times n}bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT × italic_n end_POSTSUPERSCRIPT no longer participate in subsequent calculations after completing the softmax computation, where dpsubscript𝑑𝑝d_{p}italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT is the prompt length. Therefore, the attention mechanism is defined as

Att(𝐗;𝐏𝐄)=𝐕σ([𝐏𝐄𝐊𝐐])dp:,:Att𝐗subscript𝐏𝐄𝐕𝜎subscriptdelimited-[]subscript𝐏𝐄superscript𝐊top𝐐subscript𝑑𝑝::\operatorname{Att}\left(\mathbf{X};\mathbf{P_{E}}\right)=\mathbf{V}\sigma\left% (\left[\begin{array}[]{c}\mathbf{P_{E}}\\ \mathbf{K^{\top}Q}\end{array}\right]\right)_{d_{p}:,:}roman_Att ( bold_X ; bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT ) = bold_V italic_σ ( [ start_ARRAY start_ROW start_CELL bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT bold_Q end_CELL end_ROW end_ARRAY ] ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : , : end_POSTSUBSCRIPT (5)

where σ([𝐏𝐄𝐊𝐐])dp:,:𝜎subscriptdelimited-[]subscript𝐏𝐄superscript𝐊top𝐐subscript𝑑𝑝::\sigma\left(\left[\begin{array}[]{c}\mathbf{P_{E}}\\ \mathbf{K^{\top}Q}\end{array}\right]\right)_{d_{p}:,:}italic_σ ( [ start_ARRAY start_ROW start_CELL bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT bold_Q end_CELL end_ROW end_ARRAY ] ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : , : end_POSTSUBSCRIPT represents selecting values from the matrix 𝐊𝐓𝐐superscript𝐊𝐓𝐐\mathbf{{K^{T}}Q}bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q row-wise, starting from the dpsubscript𝑑𝑝d_{p}italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT-th row up to the (n+dp1)𝑛subscript𝑑𝑝1(n+d_{p}-1)( italic_n + italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT - 1 )-th row, after undergoing the prompt and softmax operations, thus maintaining its shape in subsequent calculations.

Then a single Transformer layer is represented as

τ(𝐗;𝐏𝐄)=MLP(Att(𝐗;𝐏𝐄)+𝐗)𝜏𝐗subscript𝐏𝐄𝑀𝐿𝑃Att𝐗subscript𝐏𝐄𝐗\displaystyle\tau\left(\mathbf{X};\mathbf{P_{E}}\right)=MLP\left(\operatorname% {Att}\left(\mathbf{X};\mathbf{P_{E}}\right)+\mathbf{X}\right)italic_τ ( bold_X ; bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT ) = italic_M italic_L italic_P ( roman_Att ( bold_X ; bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT ) + bold_X ) (6)

The EPT method is divided into two variants, EPT-SHALLOW and EPT-DEEP, depending on the number of Transformer layers involved.

EPT-SHALLOW

Only the first layer of the Transformer is embedded with prompts, therefore all the Transformer layers of EPT-SHALLOW are represented as

𝐗1superscript𝐗1\displaystyle\mathbf{X}^{1}bold_X start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT =τ1(𝐗0;𝐏𝐄0)absentsuperscript𝜏1superscript𝐗0superscriptsubscript𝐏𝐄0\displaystyle=\tau^{1}\left(\mathbf{X}^{0};\mathbf{P_{E}}^{0}\right)= italic_τ start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT ( bold_X start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT ; bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT ) (7)
𝐗isuperscript𝐗𝑖\displaystyle\mathbf{X}^{i}bold_X start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT =τi(𝐗i1)i=2,3,,Nformulae-sequenceabsentsuperscript𝜏𝑖superscript𝐗𝑖1𝑖23𝑁\displaystyle=\tau^{i}\left(\mathbf{X}^{i-1}\right)\quad i=2,3,\ldots,N= italic_τ start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ( bold_X start_POSTSUPERSCRIPT italic_i - 1 end_POSTSUPERSCRIPT ) italic_i = 2 , 3 , … , italic_N
𝐲𝐲\displaystyle\mathbf{y}bold_y =Head(𝐗𝐍:,0),absentHeadsubscriptsuperscript𝐗𝐍:0\displaystyle=\operatorname{Head}\left(\mathbf{{X}^{N}}_{:,0}\right),= roman_Head ( bold_X start_POSTSUPERSCRIPT bold_N end_POSTSUPERSCRIPT start_POSTSUBSCRIPT : , 0 end_POSTSUBSCRIPT ) ,
EPT-DEEP

All Transformer layers are embedded with prompts, and the Transformer layers of EPT-DEEP are represented as

𝐗1superscript𝐗1\displaystyle\mathbf{X}^{1}bold_X start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT =τ1(𝐗0;𝐏𝐄0)absentsuperscript𝜏1superscript𝐗0superscriptsubscript𝐏𝐄0\displaystyle=\tau^{1}\left(\mathbf{X}^{0};\mathbf{P_{E}}^{0}\right)= italic_τ start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT ( bold_X start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT ; bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT ) (8)
𝐗isuperscript𝐗𝑖\displaystyle\mathbf{X}^{i}bold_X start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT =τi(𝐗i1;𝐏𝐄i1)i=2,3,,Nformulae-sequenceabsentsuperscript𝜏𝑖superscript𝐗𝑖1superscriptsubscript𝐏𝐄𝑖1𝑖23𝑁\displaystyle=\tau^{i}\left(\mathbf{X}^{i-1};\mathbf{P_{E}}^{i-1}\right)\quad i% =2,3,\ldots,N= italic_τ start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ( bold_X start_POSTSUPERSCRIPT italic_i - 1 end_POSTSUPERSCRIPT ; bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_i - 1 end_POSTSUPERSCRIPT ) italic_i = 2 , 3 , … , italic_N
𝐲𝐲\displaystyle\mathbf{y}bold_y =Head(𝐗𝐍:,0),absentHeadsubscriptsuperscript𝐗𝐍:0\displaystyle=\operatorname{Head}\left(\mathbf{{X}^{N}}_{:,0}\right),= roman_Head ( bold_X start_POSTSUPERSCRIPT bold_N end_POSTSUPERSCRIPT start_POSTSUBSCRIPT : , 0 end_POSTSUBSCRIPT ) ,
EPT Enables Patch-Wise Scaling

For a matrix 𝐊𝐓𝐐superscript𝐊𝐓𝐐\mathbf{K^{T}Q}bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q, we select the vector from the i𝑖iitalic_i-th column to illustrate. Let 𝐮=𝐊𝐓𝐐:,i=(𝐊𝐓𝐐):,i𝐮superscript𝐊𝐓subscript𝐐:𝑖subscriptsuperscript𝐊𝐓𝐐:𝑖\mathbf{u}=\mathbf{{K^{T}}Q}_{:,i}=(\mathbf{{K^{T}}Q})_{:,i}bold_u = bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q start_POSTSUBSCRIPT : , italic_i end_POSTSUBSCRIPT = ( bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q ) start_POSTSUBSCRIPT : , italic_i end_POSTSUBSCRIPT, which corresponds to the multiplication of the query of the i𝑖iitalic_i-th patch and the keys of all patches. Then, the softmax value of 𝐮𝐮\mathbf{u}bold_u can be represented as

σ(𝐮)=e𝐮e𝐮1=1i=1neui[eu1,eu2,,eun]\sigma(\mathbf{u})=\frac{e^{\mathbf{u}}}{\left\|e^{\mathbf{u}}\right\|_{1}}=% \quad\frac{1}{\sum_{i=1}^{n}e^{u_{i}}}\left[e^{u_{1}},e^{u_{2}},\cdots,e^{u_{n% }}\right]italic_σ ( bold_u ) = divide start_ARG italic_e start_POSTSUPERSCRIPT bold_u end_POSTSUPERSCRIPT end_ARG start_ARG ∥ italic_e start_POSTSUPERSCRIPT bold_u end_POSTSUPERSCRIPT ∥ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_ARG = divide start_ARG 1 end_ARG start_ARG ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG [ italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT , italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT , ⋯ , italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ] (9)

For the prompted matrix [𝐏𝐄𝐊𝐐]delimited-[]subscript𝐏𝐄superscript𝐊top𝐐\left[\begin{array}[]{c}\mathbf{P_{E}}\\ \mathbf{K^{\top}Q}\end{array}\right][ start_ARRAY start_ROW start_CELL bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT bold_Q end_CELL end_ROW end_ARRAY ], let 𝐮𝐩=[𝐩𝐮]dp+nsubscript𝐮𝐩delimited-[]𝐩𝐮superscriptsubscript𝑑𝑝𝑛\mathbf{u_{p}}=\left[\begin{array}[]{l}\mathbf{p}\\ \mathbf{u}\end{array}\right]\in\mathbb{R}^{{d_{p}}+{\color[rgb]{0,0,0}% \definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}% \pgfsys@color@gray@fill{0}n}}bold_u start_POSTSUBSCRIPT bold_p end_POSTSUBSCRIPT = [ start_ARRAY start_ROW start_CELL bold_p end_CELL end_ROW start_ROW start_CELL bold_u end_CELL end_ROW end_ARRAY ] ∈ blackboard_R start_POSTSUPERSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT + italic_n end_POSTSUPERSCRIPT be the i𝑖iitalic_i-th column of the prompted matrix, where 𝐩dp𝐩superscriptsubscript𝑑𝑝\mathbf{p}\in\mathbb{R}^{d_{p}}bold_p ∈ blackboard_R start_POSTSUPERSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT and 𝐮n𝐮superscript𝑛\mathbf{u}\in\mathbb{R}^{{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor% }{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}n}}bold_u ∈ blackboard_R start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT represent the prompt and the original vector respectively. After the softmax operation, the value of the i𝑖iitalic_i-th column vector of the original matrix becomes

σ(𝐮𝐩)dp:=e𝐮e𝐮𝐩1=1i=1neui+j=1dpepj[eu1,eu2,,eun]\sigma(\mathbf{u_{p}})_{d_{p}:}=\frac{e^{\mathbf{u}}}{\left\|e^{\mathbf{u_{p}}% }\right\|_{1}}=\quad\frac{1}{\sum_{i=1}^{n}e^{u_{i}}+\sum_{j=1}^{d_{p}}e^{p_{j% }}}\left[e^{u_{1}},e^{u_{2}},\cdots,e^{u_{n}}\right]italic_σ ( bold_u start_POSTSUBSCRIPT bold_p end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : end_POSTSUBSCRIPT = divide start_ARG italic_e start_POSTSUPERSCRIPT bold_u end_POSTSUPERSCRIPT end_ARG start_ARG ∥ italic_e start_POSTSUPERSCRIPT bold_u start_POSTSUBSCRIPT bold_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ∥ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_ARG = divide start_ARG 1 end_ARG start_ARG ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_e start_POSTSUPERSCRIPT italic_p start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG [ italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT , italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT , ⋯ , italic_e start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ] (10)

From equations (9) and (10), we can observe that the softmax operation applied to the prompt enables the adjustment of each patch-level feature, corresponding to patch-wise scaling. It is worth noting that the dimensions of the input and output remain unchanged during the softmax operation. The advantages of patch-wise scaling will be further analyzed and compared in Sec 3.3.2.

3.3 Analysis of EPT

3.3.1 Intuition

In the context of few-shot learning, researchers face the challenge of overfitting due to an insufficient number of training samples, which is characterized by accurate classification on the training set but poor performance on the test set. To tackle this challenge, we attempt to approach it from the following perspective: calibrating the distribution of the few-shot samples by reducing the intra-class distance of samples from the same class, thereby increasing the degree of separation between features of different classes during training, ultimately achieving higher accuracy [30].

Based on our observations, EPT can help mitigate the negative impact caused by foundation models when learning pretraining data distribution. Additionally, we notice that the patch-wise scaling operation, by implementing varying scaling ratios for different samples, facilitates the aggregation of features from the same class towards the intra-class center. Consequently, it increases the potential for greater separation of features between samples from different classes. Moreover, by introducing prompts, the dimensions of features are increased, thereby enhancing the high-dimensional expression and decoupling capability of features. Through analyzing these two operations intuitively and theoretically, we propose a new perspective to understand prompt tuning: Prompt is a distribution calibrator.

3.3.2 Interpretation

First, we define the intra-class distance for a better understanding of the problem. For a dataset 𝐗={𝐱k,i,k[K],i[nk]}\mathbf{X}=\left\{\mathbf{x}_{k,i},k\in[K],i\in\left[n_{k}\right]\right\}bold_X = { bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT , italic_k ∈ [ italic_K ] , italic_i ∈ [ italic_n start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ] } with K classes, where 𝐱k,idsubscript𝐱𝑘𝑖superscript𝑑\mathbf{x}_{k,i}\in\mathbb{R}^{d}bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT is the i𝑖iitalic_i-th sample in the k𝑘kitalic_k-th class, and the number of samples nksubscript𝑛𝑘n_{k}italic_n start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT in each class is balanced with n1==nK=nsubscript𝑛1subscript𝑛𝐾𝑛n_{1}=\cdots=n_{K}=nitalic_n start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = ⋯ = italic_n start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT = italic_n. We borrowed the definition from Yaras et al. [43], and we use 𝐱¯ksubscript¯𝐱𝑘\bar{\mathbf{x}}_{k}over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT to represent the center of the samples in class k, where the intra-class distance matrix is defined as

Σ𝐖=1Nk=1Ki=1n(𝐱k,i𝐱¯k)(𝐱k,i𝐱¯k)subscriptΣ𝐖1𝑁superscriptsubscript𝑘1𝐾superscriptsubscript𝑖1𝑛subscript𝐱𝑘𝑖subscript¯𝐱𝑘superscriptsubscript𝐱𝑘𝑖subscript¯𝐱𝑘top\Sigma_{\mathbf{W}}=\frac{1}{N}\sum_{k=1}^{K}\sum_{i=1}^{n}\left(\mathbf{x}_{k% ,i}-\bar{\mathbf{x}}_{k}\right)\left(\mathbf{x}_{k,i}-\bar{\mathbf{x}}_{k}% \right)^{\top}roman_Σ start_POSTSUBSCRIPT bold_W end_POSTSUBSCRIPT = divide start_ARG 1 end_ARG start_ARG italic_N end_ARG ∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_K end_POSTSUPERSCRIPT ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ( bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT (11)

According to the definition, a smaller value of Σ𝐖subscriptΣ𝐖\Sigma_{\mathbf{W}}roman_Σ start_POSTSUBSCRIPT bold_W end_POSTSUBSCRIPT indicates a higher degree of feature clustering, which may lead to better separability.

For dataset that satisfies 𝐗={𝐱k,i0,k[K],i[nk]}𝐗formulae-sequencesubscript𝐱𝑘𝑖0formulae-sequence𝑘delimited-[]𝐾𝑖delimited-[]subscript𝑛𝑘\mathbf{X}=\left\{\mathbf{x}_{k,i}\geqslant 0,k\in[K],i\in\left[n_{k}\right]\right\}bold_X = { bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ⩾ 0 , italic_k ∈ [ italic_K ] , italic_i ∈ [ italic_n start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ] }, If we apply different scaling operations to samples of the same class, we can derive the conclusion stated in Lemma 1.

Lemma 1

Let ck,i,ck,j[0,1]subscript𝑐𝑘𝑖subscript𝑐𝑘𝑗01c_{k,i},c_{k,j}\in[0,1]italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT ∈ [ 0 , 1 ] be the scaling operations on the samples 𝐱k,isubscript𝐱𝑘𝑖\mathbf{x}_{k,i}bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT and 𝐱k,jsubscript𝐱𝑘𝑗\mathbf{x}_{k,j}bold_x start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT of class k, respectively, and satisfy (ck,ick,j)(𝐱k,i2𝐱k,j2)0subscript𝑐𝑘𝑖subscript𝑐𝑘𝑗subscriptnormsubscript𝐱𝑘𝑖2subscriptnormsubscript𝐱𝑘𝑗20\left(c_{k,i}-c_{k,j}\right)\left(\left\|\mathbf{x}_{k,i}\right\|_{2}-\left\|% \mathbf{x}_{k,j}\right\|_{2}\right)\leqslant 0( italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - italic_c start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT ) ( ∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT - ∥ bold_x start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) ⩽ 0, and (ck,i𝐱k,i2ck,j𝐱k,j2)(𝐱k,i2𝐱k,j2)0subscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖2subscriptnormsubscript𝑐𝑘𝑗subscript𝐱𝑘𝑗2subscriptnormsubscript𝐱𝑘𝑖2subscriptnormsubscript𝐱𝑘𝑗20\left(\left\|c_{k,i}\mathbf{x}_{k,i}\right\|_{2}-\left\|c_{k,j}\mathbf{x}_{k,j% }\right\|_{2}\right)\left(\left\|\mathbf{x}_{k,i}\right\|_{2}-\left\|\mathbf{x% }_{k,j}\right\|_{2}\right)\geqslant 0( ∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT - ∥ italic_c start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) ( ∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT - ∥ bold_x start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) ⩾ 0. Then, the new intra-class distance matrix and the original intra-class distance matrix of class k satisfy Σ𝐖ck2Σ𝐖superscriptsubscriptΣ𝐖superscriptsubscript𝑐𝑘2subscriptΣ𝐖\Sigma_{\mathbf{W}}^{\prime}\leqslant{c_{k}}^{2}\Sigma_{\mathbf{W}}roman_Σ start_POSTSUBSCRIPT bold_W end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ⩽ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT roman_Σ start_POSTSUBSCRIPT bold_W end_POSTSUBSCRIPT, where cksubscript𝑐𝑘c_{k}italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT is the scaling factor of the k𝑘kitalic_k-th class center.

Proof of Lemma 1 is presented in Appendix. Lemma 1 demonstrates that a scaling operation ck,isubscript𝑐𝑘𝑖c_{k,i}italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT that induces intra-class clustering more effectively relative to applying the same scaling factor to all samples within a class. The actual effect is that the farther the sample 𝐱k,isubscript𝐱𝑘𝑖\mathbf{x}_{k,i}bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT is from the origin, the smaller the scaling factor it has, and vice versa. The advantage is that it can bring the samples closer to the intra-class center.

Furthermore, we can observe that by embedding prompts in the softmax function in EPT, we can achieve the scaling functionality defined in Lemma 1, thereby increasing the intra-class concentration. Therefore, we conducted an analysis of the mechanism behind EPT. Considering the complex structure of the Transformer and the dataset, to simplify the problem, we assume the number of patches (including the CLS token) is 2 and proceed with the analysis based on this assumption.

Let 𝐮1subscript𝐮1\mathbf{u}_{1}bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and 𝐮2subscript𝐮2\mathbf{u}_{2}bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT be the first column vectors of the 𝐊𝐓𝐐superscript𝐊𝐓𝐐\mathbf{K^{T}Q}bold_K start_POSTSUPERSCRIPT bold_T end_POSTSUPERSCRIPT bold_Q matrix for two different samples 𝐗k,1d×nsubscript𝐗𝑘1superscript𝑑𝑛\mathbf{X}_{k,1}\in\mathbb{R}^{d\times n}bold_X start_POSTSUBSCRIPT italic_k , 1 end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n end_POSTSUPERSCRIPT and 𝐗k,2d×nsubscript𝐗𝑘2superscript𝑑𝑛\mathbf{X}_{k,2}\in\mathbb{R}^{d\times n}bold_X start_POSTSUBSCRIPT italic_k , 2 end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n end_POSTSUPERSCRIPT within the same class k, which denote the CLS token, and n=2. Let 𝐮p,1subscript𝐮𝑝1\mathbf{u}_{p,1}bold_u start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT and 𝐮p,2subscript𝐮𝑝2\mathbf{u}_{p,2}bold_u start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT correspond to the vectors after the prompt. Then, we can draw the following conclusion.

Proposition 1

Consider an original matrix σ(𝐊𝐐)𝜎superscript𝐊top𝐐\sigma\left(\mathbf{K}^{\top}\mathbf{Q}\right)italic_σ ( bold_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT bold_Q ) and a prompted matrix σ([𝐏𝐄𝐊𝐐])dp:,:𝜎subscriptdelimited-[]subscript𝐏𝐄superscript𝐊top𝐐subscript𝑑𝑝::\sigma\left(\left[\begin{array}[]{c}\mathbf{P_{E}}\\ \mathbf{K^{\top}Q}\end{array}\right]\right)_{d_{p}:,:}italic_σ ( [ start_ARRAY start_ROW start_CELL bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT bold_Q end_CELL end_ROW end_ARRAY ] ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : , : end_POSTSUBSCRIPT. We can always find a prompt 𝐏𝐄dp×nsubscript𝐏𝐄superscriptsubscript𝑑𝑝𝑛\mathbf{P}_{\mathbf{E}}\in\mathbb{R}^{d_{p}\times n}bold_P start_POSTSUBSCRIPT bold_E end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT × italic_n end_POSTSUPERSCRIPT such that, for the CLS tokens of 𝐗k,1d×nsubscript𝐗𝑘1superscript𝑑𝑛\mathbf{X}_{k,1}\in\mathbb{R}^{d\times n}bold_X start_POSTSUBSCRIPT italic_k , 1 end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n end_POSTSUPERSCRIPT and 𝐗k,2d×nsubscript𝐗𝑘2superscript𝑑𝑛\mathbf{X}_{k,2}\in\mathbb{R}^{d\times n}bold_X start_POSTSUBSCRIPT italic_k , 2 end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d × italic_n end_POSTSUPERSCRIPT, when σ(𝐮1)2σ(𝐮2)2subscriptnorm𝜎subscript𝐮12subscriptnorm𝜎subscript𝐮22\left\|\sigma\left(\mathbf{u}_{1}\right)\right\|_{2}\leqslant\left\|\sigma% \left(\mathbf{u}_{2}\right)\right\|_{2}∥ italic_σ ( bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ ∥ italic_σ ( bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, then σ(𝐮p,1)dp:2σ(𝐮1)2σ(𝐮p,2)dp:2σ(𝐮2)2subscriptnorm𝜎subscriptsubscript𝐮𝑝1:subscript𝑑𝑝absent2subscriptnorm𝜎subscript𝐮12subscriptnorm𝜎subscriptsubscript𝐮𝑝2:subscript𝑑𝑝absent2subscriptnorm𝜎subscript𝐮22\frac{\left\|\sigma\left(\mathbf{u}_{p,1}\right)_{d_{p}:}\right\|_{2}}{\left\|% \sigma\left(\mathbf{u}_{1}\right)\right\|_{2}}\geqslant\frac{\left\|\sigma% \left(\mathbf{u}_{p,2}\right)_{d_{p}:}\right\|_{2}}{\left\|\sigma\left(\mathbf% {u}_{2}\right)\right\|_{2}}divide start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG ⩾ divide start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG.

Proof of Proposition 1 is presented in Appendix. According to Lemma 1 and Proposition 1, we can conclude that EPT can achieve more compact scaling operations by embedding prompts in the softmax, thereby reducing intra-class distances and making samples of the same class more concentrated.

4 Experiment

4.1 Experiment Setup

This article aims to investigate the performance of mainstream PEFT methods in few-shot medical classification tasks, \deletedpreliminarily explore the potential of our proposed LAP methodand emphatically validate the effectiveness of our designed EPT method, particularly by comparing the characteristics of VPT and similar PEFT methods to explore their commonalities and capabilities\deleted to strike a balance between fitting and generalization. First, we will introduce datasets, tasks, and experimental settings of our study.

Datasets

We evaluate on the MedFMC2023 grand challenge public classification dataset [23] which covers three different modalities: (1)Thoracic Disease Screening (ChestDR). 2,140 for training, 2,708 for validation, and 3,869 for testing. (2)Pathological Tumor Tissue Classification (Colon). 5,654 for training, 4,355 for validation and 7,651 for testing. (3)Endoscopy Images for Lesion Classification (Endo). 1,810 for training, 2,055 for validation and 2,936 for testing.

Table 1: Image classification accuracy for ViT-Base/16 pretrained on ImageNet-21k. We reported the average mAP and Acc for 1-shot, 5-shot and 10-shot on the Chest, Colon, and Endo datasets individually, as well as the average accuracy score for a total of 9 tasks across the three datasets and three shot numbers. \deleted"Tuned/Total" is the max percentage of tuned parameters required by 9 tasks. Best results among all methods are bolded. The percentage inside the parentheses refers to the percentage improvement of all fine-tuning methods relative to the Linear method. \deleted’Ours(224)’ refers to an image size of 224, while ’Ours(384)’ refers to an image size of 384.
ViT-Base/16 (85.8M)85.8M(85.8\mathrm{M})( 85.8 roman_M ) Chest Colon Endo average
1-shot 5-shot 10-shot 1-shot 5-shot 10-shot 1-shot 5-shot 10-shot
Full 10.61 11.16 11.99 63.90 77.02 83.85 14.05 15.66 17.57 33.98(-9.34%)
Linear 11.93 14.88 16.75 70.24 81.22 85.23 15.60 20.18 21.30 37.48(0.00%)
Partial-1 11.93 14.48 16.83 73.11 82.55 85.98 16.62 20.86 24.05 38.49(+2.69%)
MLP-3 12.54 15.85 17.78 70.56 81.63 86.13 16.34 20.29 21.67 38.09(+1.63%)
LoRA 12.30 15.66 17.40 71.91 81.69 84.88 16.01 20.12 21.37 37.93(+1.20%)
Bias 12.12 15.00 17.76 71.68 83.5883.58\mathbf{83.58}bold_83.58 86.59 16.68 20.23 21.66 38.36(+2.35%)
Adapter 12.11 15.32 17.36 73.79 83.03 85.52 16.86 22.51 24.95 39.05(+4.19%)
VP 12.22 15.65 17.33 73.70 81.26 85.11 15.67 19.46 20.79 37.91(+1.15%)
VPT 12.15 14.88 17.54 74.44 82.15 86.25 17.60 21.27 22.89 38.79(+3.50%)
Ours 12.7312.73\mathbf{12.73}bold_12.73 16.1616.16\mathbf{16.16}bold_16.16 18.0918.09\mathbf{18.09}bold_18.09 75.3175.31\mathbf{75.31}bold_75.31 83.34 87.2387.23\mathbf{87.23}bold_87.23 17.6617.66\mathbf{17.66}bold_17.66 22.8022.80\mathbf{22.80}bold_22.80 25.0725.07\mathbf{25.07}bold_25.07 39.82(+6.24%)39.82percent6.24\mathbf{39.82(+6.24\%)}bold_39.82 ( + bold_6.24 % )
Tasks

Each task is formulated as N-Way K-shot classification tasks. Due to the backbone network is pre-trained on ImageNet-21k, which owns a domain gap with medical images, the classification tasks are cross-domain few-shot classification tasks. The few-shot medical classification task, especially the multi-label classification task, particularly highlights the generalization performance of these PEFT methods. We mainly focus on few-shot scenerios rather than fully supervised training, and K is set to 1,5,10. 1-shot refers to every N images that sample from each class, rather than one image. Among the three datasets, ChestDR and Endo are multi-label classification tasks with 19 and 4 categories respectively, while Colon is a single-label classification task with 2 categories.

To evaluate the performance of experimental results, we compute the overall accuracy (Acc) for the multi-class classification tasks in the datasets of ColonPath, and the mean average precision (mAP) for the multi-label classification tasks in the datasets of ChestDR and Endo.

We compare widely used PEFT methods with our baseline method VPT. To reduce the error caused by random sampling, we follow the setup of MedFMC and performed 5 random samplings. We calculate the average accuracy score for four runs for each sampling.

Refer to caption
Figure 2: Visual Analysis of Feature Distribution of Colon Test Dataset. a. Principal component distribution results of features from the same class in the Colon test dataset after training with Full, Linear, VPT, and EPT methods. b. Contour visualization of two-dimensional projections of features from the same class in the Colon test dataset after training with Full, Linear, VPT, and EPT methods. c. T-SNE visualization of two-dimensional projections of features from different classes in the Colon test dataset after training with Full, Linear, VPT, and EPT methods.
Baselines

We follow MedFMC and compare EPT with other widely applied PEFT methods. We compare the results of \deletedtwoVision Transformer architecture\deleted, Vision Transformer [44] (ViT)\deleted and Swin Transformer(Swin), on image classification in Sec 4.2. Due to the fact that the EPT method is also a prompt-based fine-tuning approach, it shares many similarities with VPT and VP. Additionally, given the superior performances of VPT and VP, we primarily compare our results with VPT and VP. Unlike selecting the Full method as the primary reference in [24], our experiments chose the Partial-1[45] fine-tuning method as the primary reference. The reason is that for few-shot fine-tuning, fine-tuning all parameters incurs computational costs that do not match the data volume, and our experiments have found that the Full method often yields the worst results. Therefore, we chose Partial-1 as the primary reference method. \deletedFor Adapter[36] and Lora[27], we set the dimension r𝑟ritalic_r for downsampling to 4. The default prompted layers for EPT and VPT are both set to 12, meaning the prompt is used through all the layers. The prompt length for prompt-based fine-tuning methods is set to achieve the best performance individually. If not otherwise specified, we adopt ViT-Base/16 pretrained on ImageNet-21k as our default backbone model, which is also the default model for ViT in the MedFMC Challenge.

\deleted

For the two relative embedding orders of prompts in the EPT method: EPT and EPT-C, we select different relative embedding orders for each task and choose the best result as the final result of our approach. We do this because we found that EPT-C often exhibits better generalization performance, while EPT tends to have better fitting ability. This leads to each method being more suitable for relatively simple datasets (Colon) and relatively complex datasets (Chest) respectively, and this difference brings about significant performance superiority for our method. Furthermore, we conducted a more in-depth analysis of this phenomenon in Sec 4.3. In terms of fairness, our standalone EPT-C or EPT can surpass most other PEFT methods, especially the VPT that we specifically compared against. More results and details are provided in Sec 4.2 and Appendix.

Table 2: Different ViT backbone scales. Image classification accuracy for ViT-Large/16 pretrained on ImageNet-21k. We reported the average mAP and Acc for 1-shot, 5-shot and 10-shot on the Chest, Colon, and Endo datasets individually, as well as the average accuracy score for a total of 9 tasks across the three datasets and three shot numbers. Best results among all methods are bolded. The percentage inside the parentheses refers to the percentage improvement of all fine-tuning methods relative to the Linear method.
ViT-Large/16 (303.7M)303.7M(303.7\mathrm{M})( 303.7 roman_M ) Chest Colon Endo average
1-shot 5-shot 10-shot 1-shot 5-shot 10-shot 1-shot 5-shot 10-shot
Full 10.75 11.17 11.84 70.80 82.19 86.22 17.22 20.06 21.72 36.88(-5.94%)
Linear 13.19 16.67 18.44 73.65 80.04 84.49 19.08 23.47 23.87 39.21(0.00%)
Partial-1 13.27 17.05 19.12 71.65 81.53 85.98 18.54 24.7024.70\mathbf{24.70}bold_24.70 26.54 39.82(+1.56%)
MLP-3 11.49 12.24 13.47 66.12 83.83 89.5389.53\mathbf{89.53}bold_89.53 15.15 17.25 20.64 36.64(-6.55%)
LoRA 13.38 16.80 18.41 75.00 81.04 84.82 19.6219.62\mathbf{19.62}bold_19.62 23.94 23.40 39.60(+0.99%)
Bias 13.30 17.28 18.60 73.86 81.20 86.28 18.71 22.47 23.05 39.42(+0.54%)
Adapter 11.12 12.53 15.06 76.5376.53\mathbf{76.53}bold_76.53 83.38 86.67 16.76 22.51 24.73 38.81(-1.02%)
VP 13.30 17.30 18.68 73.31 85.54 87.36 18.48 23.00 23.39 40.04(+2.12%)
VPT 13.20 16.05 18.41 73.74 80.90 86.06 18.73 23.91 26.7426.74\mathbf{26.74}bold_26.74 39.75(+1.38%)
Ours 13.7313.73\mathbf{13.73}bold_13.73 17.6717.67\mathbf{17.67}bold_17.67 19.5319.53\mathbf{19.53}bold_19.53 76.33 85.9185.91\mathbf{85.91}bold_85.91 87.53 18.93 23.38 23.78 40.75(+3.93%)40.75percent3.93\mathbf{40.75(+3.93\%)}bold_40.75 ( + bold_3.93 % )

4.2 Main Results

EPT on MedFMC

We present average results of various PEFT methods for 1-shot, 5-shot and 10-shot classification on three datasets: Chest, Colon and Endo, as shown in Tab 1. Several main findings can be observed.

First, EPT outperforms other PEFT methods by a substantial margin on three datasets in most cases. Specifically, it surpasses the second-best method Adapter by 2.05% and the third-best method VPT by 2.74%, respectively. EPT still achieves second place in the Colon 5-shot task, with a performance gap of only 0.24 from Bias. This demonstrates that the superior performance of EPT when adapting pre-trained foundation models to cross-domain few-shot scenarios, e.g., medicial image analysis. Second, in the category of prompt tuning, EPT surpasses VPT and VP by 2.74% and 5.09%, respectively. In addition, EPT outperforms LoRA by 5.04%. This not only indicates that EPT has addressed previous shortcomings in the way of introducing prompts, embedding prompts in the channel direction is a more promising approach. Moreover, EPT has better approximation capabilities on Transformer architectures, thereby breaking through limitations of prompt tuning. Third, EPT, VPT and VP surpasses Linear by 6.24%, 3.50%, and 1.15%, respectively, and prompt tuning achieves very competitive ranks among all PEFT methods. This shows that prompt tuning helps to alleviate the negative impact of foundation models in learning pre-training data distributions, and calibrates their performance in new domains. Fourth, Full is 9.34% lower than Linear, potentially due to overfitting. When adapting foundation models to few-shot scenarios, fine-tuning more parameters is not always better, and PEFT methods are very meaningful.

Analysis of Feature Distribution

As shown in Fig 2, we present visualization results of feature distribution after fine-tuning on the Colon dataset.

In Fig 2 (a), it displays the feature distribution of samples from the same class on the first principal component obtained by principal component analysis (PCA). We \deletedrandomlyselect 2,628 samples labeled as existing tumours, and four methods were compared: Full, Linear(Pretrained backbones), VPT, and EPT. The x-axis represents feature values, and the y-axis represents the number of samples. Results show that: (1) EPT exhibits a more narrower range of sample distribution, with more pronounced feature values, demonstrating a more concentrated intra-class feature distribution. (2) Foundation models only pre-trained on natural images displays a clear different behavior, and lack continuity, suggesting that samples may cluster into two distinct groups that are significantly far from each other. (3) Full displays that samples are overly dispersed and exhibit lower feature values, which could be due to overfitting and the failure of capturing common features.

Refer to caption
Figure 3: Performance comparison on different downstream data scales. We report the performance of three methods on 1-shot, 5-shot, 10-shot, and 20% of the training set. The highlighted regions demonstrate the accuracy differences between EPT and VPT. All methods use ViT-Base/16 as the backbone\deleted, and the image size for EPT is 384.

In Fig 2 (b), it visualizes the two-dimensional feature distribution of samples from the same class by t-SNE. Our selcted samples and methods are same as Fig 2 (a). The x-axis and y-axis represent feature values of two different dimensions, respectively. Results show that: (1) Pretrain shows that the density contour lines on the left and right sides do not connect and close, indicating the discontinuity and a huge distance within the distribution. (2) Full shows that the density contour lines are irregular, indicating that samples are dispersed throughout the space, and not sufficiently concentrated. (3) VPT shows a clear outlier distribution on the top, far from the center. (4) EPT shows that the area enclosed by the density contour lines is the smallest, indicating that samples are more concentrated. Fig 2 (a) and Fig 2 (b) both illustrate that EPT has a more continuous and concentrated intra-class feature distribution. This may be due to the patch-wise scaling operation, which reduces the distribution scopes and extracts more universal and effective features.

In Fig 2 (c), it displays the two-dimensional feature distribution of all classes by t-SNE. We randomly select 5,256 samples from two categories, maintaining a 1:1 ratio. Results show that: (1) Pretrain not only exhibits a larger intra-class distribution but also shows inter-class linear inseparability. (2) Prompt tuning demonstrates a continuouts and concentrated intra-class distribution, and the separability between classes are also distinct. This may be due to the introduction of prompt tokens, which expand the dimensionality of the input space, thereby increasing the separability of features.

These visualization results provide strong evidence for the view that prompt tuning acts as a distribution calibrator.

EPT on Larger Backbone Scale

For the purpose of observing the performances of various tuning methods at larger backbone scales, we conducted experiments on ViT-Large/16. The experimental results, as shown in Tab 2, indicate that our EPT method still demonstrates the most significant advantages on all three datasets and outperforms other methods. Additionally, we can observe that fine-tuning with ViT-Large/16 as the backbone generally yields better classification performance compared to ViT-Base/16. Even linear methods show improved classification results. However, both MLP-3 and Adapter methods exhibit a decrease in performance, which differs from the results in Tab 1. Furthermore, the average classification results of EPT demonstrate an increasing trend compared to Tab 1. This proves the effectiveness of our EPT method on larger-scale pre-trained models.

4.3 Abalation Study

In this section, EPT is consistently evaluated using the default experimental settings: ViT-Base/16 as the backbone\added.\deleted, and an image size of 384. Except for the ablation study on prompt length, \replacedthe prompt length for prompt-based fine-tuning methods is set to achieve the best performance individually.the default prompt length was set to 1.

Refer to caption
Figure 4: Ablation on Prompt length. We vary the prompt length from 1 to 150\deleted1, 5, 10, 20, and 50 for EPT and VPT
Refer to caption
Figure 5: Ablation on Prompt Embedding Way\deletedOrder. We conducted experiments on MedFMC with four different \deletedrelative embedding ways\deletedorders of prompts.
Refer to caption
Figure 6: Ablation on Prompt Depth. We set the prompt length to be the same as in the main result\deletedto 1, which yielded the best results, for each variant of EPT with validation sets. i → j indicates the indices of Transformer layers where prompts are embedded.
EPT on Different Data Scale

We vary the training data from 1, 5, 10-shot to 20% of the entire training set. The average accuracy of different fine-tuning methods on various data scales is presented in Fig 3. First, we observe that our method consistently outperforms others across all data scales, displaying superior data scalability. Moreover, as the data scale increases, all fine-tuning methods exhibit a significant increase in accuracy, but their performance growth rate tend to slow down. Further observation reveals that the performance on Colon converges faster than on Chest and Endo. This might be because that multi-label tasks require more data to learn sufficient discriminative information.

Prompt Length

The average accuracy of different prompt tuning methods on various prompt length is presented in Fig 4. We vary prompt length from 1, 5, 10, 20, 50, 100 to 150. Since EPT has a different way of introducing prompts from VPT, the number of prompt parameters from VPT is four times that of EPT when introducing a prompt with length of 1 in a single Transformer layer. Therefore, to maintain relatively consistent number of parameters, we use relative prompt length on the x-axis. This means when the relative prompt length is 1, the actual prompt length of VPT is 1, and the actual prompt length of EPT is 4.

As the prompt length increases, the performance of VPT generally declines across three datasets. In contrast, EPT shows a clear upward trend on Colon and Endo, and remains relatively stable on Chest. This suggests that EPT can better address overfitting issues. Moreover, when the prompt length is only 1, the overall performance of EPT and VPT is nearly identical. As the prompt length and the number of prompt parameters increase, yet remain within the scope of PEFT, EPT gradully begins to outperform VPT by a large margin. This indicates that EPT has better parameter scalability, with a much higher upper limit on approximation capabilities compared to VPT. We can also observe that both EPT and VPT can achieve better performance at shorter prompt length compared to longer ones in some cases. This suggests that longer prompt length is not always necessarily better, we can explore locally optimal solutions to balance performance and efficiency.

Prompt Embedding Way

The average accuracy of different EPT variants on various prompt embedding ways is presented in Fig 5. We present four prompt embedding ways: add, multiply, concat purely, multiply and concat. "add" means the sum of PEsubscript𝑃𝐸{P_{E}}italic_P start_POSTSUBSCRIPT italic_E end_POSTSUBSCRIPT and KQsuperscript𝐾top𝑄K^{\top}Qitalic_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_Q. "multiply" means the product of PEsubscript𝑃𝐸{P_{E}}italic_P start_POSTSUBSCRIPT italic_E end_POSTSUBSCRIPT and KQsuperscript𝐾top𝑄K^{\top}Qitalic_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_Q. "concat purely" means the concatenation of PEsubscript𝑃𝐸{P_{E}}italic_P start_POSTSUBSCRIPT italic_E end_POSTSUBSCRIPT and KQsuperscript𝐾top𝑄K^{\top}Qitalic_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_Q. "multiply and concat" is a novel EPT variant based on the insight of patch-wise scaling. We first obtain a scaling vector αn𝛼superscript𝑛\alpha\in\mathbb{R}^{n}italic_α ∈ blackboard_R start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT by calculating difference between the maximum and minimum values in each patch of KQsuperscript𝐾top𝑄K^{\top}Qitalic_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_Q. Then, we multiply PEsubscript𝑃𝐸{P_{E}}italic_P start_POSTSUBSCRIPT italic_E end_POSTSUBSCRIPT with α𝛼\alphaitalic_α, and concat the product with KQsuperscript𝐾top𝑄K^{\top}Qitalic_K start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_Q.

The outcome shows that "Multi_Cat""𝑀𝑢𝑙𝑡𝑖_𝐶𝑎𝑡""Multi\_Cat"" italic_M italic_u italic_l italic_t italic_i _ italic_C italic_a italic_t " achieves the best performance across three datasets. After applying the scaling vector α𝛼\alphaitalic_α, the values of prompts become larger, and original values become smaller according to eq 10. Large original values are reduced more significantly, while small original values are reduced less. Therefore, the absolute distance between values decrease, enhancing characteristics of patch-wise scaling and further reducing the distance of intra-class feature distribution. Moreover, "Pure_Cat""𝑃𝑢𝑟𝑒_𝐶𝑎𝑡""Pure\_Cat"" italic_P italic_u italic_r italic_e _ italic_C italic_a italic_t " has better performance compared to "Add""𝐴𝑑𝑑""Add"" italic_A italic_d italic_d " and "Multi""𝑀𝑢𝑙𝑡𝑖""Multi"" italic_M italic_u italic_l italic_t italic_i ", validating our analysis of prompt introducing ways again. The way of concatenation not only can helps to preserve the information of original tokens, but also introduces additional useful context in a more fine-grained manner.

Prompt Depth

The average accuracy of EPT on various prompt depth and embedding orders is presented in Fig 6. Prompt depth is varying from 1 to 12, and embedding orders are varying from top to bottom (orange line) and bottom to top (blue line). Two valuable questions are mentioned below:

Shallow or deep? Overall, as the number of prompted layers increase, the performance of EPT improves. As the depth increases, prompts can acquire a more complex and abstract representation capability and adjust features from both shallow and deep layers.

Top or bottom? We can observe that the performance of EPT improves when embedding prompts from top to bottom, which is contrary to the conclusion of VPT. This may be related to prompt introducing ways. The foreground and background across different medical images are similar, which means there are fewer low-level and coarse-grained semantic features that are discriminative. Instead, high-level and fine-grained semantic features are more crucial. Since EPT directly embeds prompts in the channel direction, it can correlate with tokens more fine-grainedly and increase the dimension of representation. This results in greater enhancement of the high-level semantic features from deeper layers.

Refer to caption
Figure 7: Visualization of convergence and distribution. For each task, we conduct 4 runs and compare the convergence and distribution of EPT with Full, Linear, and VPT.

4.4 Futher Analysis

In this section, we conduct a more in-depth analysis of VPT and EPT. First, we performed an experiment by setting the prompt grad in VPT to false, which means completing the training with the prompt being frozen and only the linear head being trainable. Additionally, we also conducted a convergence experiment. As for the convergence experiment, \deletedWe perform fitting experiments and convergence experiments. For both experiments,we select a specific sampled dataset for training (provided in [23]). \deletedFor the fitting experiments, we use the same dataset for training and testing to evaluate the accuracy of various methods on the training set.For the convergence experiment, we test methods on the default testing set and record the distribution of results, which reflects the convergence performance of the different methods

Set Prompt Grad False

The impact of grads of prompt parameters is shown in Tab 3. The outcome demonstrates that the performance of foundation models still improves in downstream tasks compared to models that are only pre-trained on natural images, even though we freeze the prompt parameters of VPT. This suggests that prompt tuning enhances the feature separability and strengthen the distribution calibration characteristics by introducing additional prompt tokens and increasing the input dimensions.

Table 3: The impact of prompt grad on experimental results. Let VPT-F and VPT-T represent prompt grad=false and prompt grad=true, respectively. Linear and VPT-T represent the percentage improvement in performance compared to VPT-F. The prompts are initialized the same\deletedwith the same normal distribution.
VPT-F Chest Colon Endo
1-shot 12.2512.2512.2512.25 72.4872.4872.4872.48 17.2917.2917.2917.29
5-shot 15.7715.7715.7715.77 81.7881.7881.7881.78 20.9520.9520.9520.95
10-shot 17.6217.6217.6217.62 85.6285.6285.6285.62 22.5222.5222.5222.52
Linear Chest Colon Endo
1-shot 2.63%percent2.63-2.63\%- 2.63 % 3.09%percent3.09-3.09\%- 3.09 % 9.78%percent9.78-9.78\%- 9.78 %
5-shot 5.61%percent5.61-5.61\%- 5.61 % 0.69%percent0.69-0.69\%- 0.69 % 3.64%percent3.64-3.64\%- 3.64 %
10-shot 4.91%percent4.91-4.91\%- 4.91 % 0.45%percent0.45-0.45\%- 0.45 % 5.41%percent5.41-5.41\%- 5.41 %
VPT-T Chest Colon Endo
1-shot 0.82%percent0.82-0.82\%- 0.82 % +2.71%percent2.71+2.71\%+ 2.71 % +1.79%percent1.79+1.79\%+ 1.79 %
5-shot 5.69%percent5.69-5.69\%- 5.69 % +0.45%percent0.45+0.45\%+ 0.45 % +1.53%percent1.53+1.53\%+ 1.53 %
10-shot 0.45%percent0.45-0.45\%- 0.45 % +0.74%percent0.74+0.74\%+ 0.74 % +1.63%percent1.63+1.63\%+ 1.63 %
Distribution of Convergence

The visualization results of convergence distribution are showned in Fig 7. Results indicate that EPT has the highest average values and the smallest variance in the convergence interval across various tasks, making it a superior and reliable PEFT method. Moreover, both VPT and EPT achive better convergence than Full, proving the superiority of PEFT in cross-domain few-shot scenarios.

Table 4: ISIC 2018 classification tasks. Image classification accuracy for ViT-Base/16 pretrained on ImageNet-21k. We reported the average Acc for 1-shot, 5-shot and 10-shot on the ISIC 2018 dataset. Best results among all methods are bolded. The percentage inside the parentheses refers to the percentage improvement of all fine-tuning methods relative to the Linear method.
ViT-Base/16 (85.8M)85.8M(85.8\mathrm{M})( 85.8 roman_M ) ISIC 2018 average
1-shot 5-shot 10-shot
Full 24.13 31.95 33.55 29.87(-14.51%)
Linear 25.74 38.39 40.68 34.94(0.00%)
Partial-1 28.69 36.39 40.80 35.29(+1.00%)
MLP-3 22.09 37.91 38.00 32.67(-6.49%)
LoRA 28.52 38.39 41.48 36.13(+3.41%)
Bias 27.81 37.75 42.78 36.11(+3.35%)
Adapter 25.09 38.47 44.59 36.05(+3.18%)
VP 26.07 36.54 39.33 33.98(-2.75%)
VPT 26.88 39.48 44.46 36.94(+5.72%)
Ours 28.8928.89\mathbf{28.89}bold_28.89 41.3541.35\mathbf{41.35}bold_41.35 44.6544.65\mathbf{44.65}bold_44.65 38.30(+9.62%)38.30percent9.62\mathbf{38.30(+9.62\%)}bold_38.30 ( + bold_9.62 % )
EPT on More Classification Tasks

For further exploration of the performance of fine-tuning methods in few-shot medical image analysis, we also conducted experiments on the ISIC 2018 dataset [46](see Appendix for details). From Tab 4, it can be observed that some fine-tuning methods failed, such as MLP-3 and VP, both exhibiting worse performance compared to the Linear method. However, methods targeting backbone fine-tuning, such as LoRA, Bias, and Adapter, still showed more significant improvements compared to Linear. VPT and EPT demonstrated even more notable enhancements, with EPT outperforming other fine-tuning methods by nearly 10% points relative to Linear, thus confirming the effectiveness of the EPT method.

5 Conclusion

In this paper, we propose an effective PEFT method in cross-domain few-shot scenarios, e.g., medical image analysis, namely Embedded Prompt Tuning (EPT). EPT embeds prompt tokens into the expanded channels. In this way, EPT can introduce more useful context, while preserving the original information. Through analyzing patch-wise scaling and feature separation operations from EPT, we also find that prompt is a distribution calibrator, mitigating the negative impact caused by foundation models when learning feature distributions on pre-training data. Experiments show that our EPT can not only achieve superior performance, but also complete the fine-tuning process within competitive time. Considering limitations, there is still significant improvement space for EPT in fine-grained perception tasks, e.g., segmentation. In the future, we will continue to unleash the power of EPT on fine-grained perception tasks, and conduct a further theoretical exploration of the essence of EPT in distribution calibration.

References

  • [1] Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021.
  • [2] Yunkun Zhang, ** Gao, Mu Zhou, Xiaosong Wang, Yu Qiao, Shaoting Zhang, and Dequan Wang. Text-guided foundation model adaptation for pathological image classification. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 272–282. Springer, 2023.
  • [3] Xiangyang Zhu, Renrui Zhang, Bowei He, Ziyu Guo, Ziyao Zeng, Zipeng Qin, Shanghang Zhang, and Peng Gao. Pointclip v2: Prompting clip and gpt for powerful 3d open-world learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2639–2650, 2023.
  • [4] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. arXiv preprint arXiv:2304.02643, 2023.
  • [5] Junlong Cheng, ** Ye, Zhongying Deng, Jianpin Chen, Tianbin Li, Haoyu Wang, Yanzhou Su, Ziyan Huang, Jilong Chen, Lei Jiang, et al. Sam-med2d. arXiv preprint arXiv:2308.16184, 2023.
  • [6] Haoyu Wang, Sizheng Guo, ** Ye, Zhongying Deng, Junlong Cheng, Tianbin Li, Jianpin Chen, Yanzhou Su, Ziyan Huang, Yiqing Shen, et al. Sam-med3d. arXiv preprint arXiv:2310.15161, 2023.
  • [7] Yuxin Du, Fan Bai, Tiejun Huang, and Bo Zhao. Segvol: Universal and interactive volumetric medical image segmentation. arXiv preprint arXiv:2311.13385, 2023.
  • [8] Yukun Zhou, Mark A Chia, Siegfried K Wagner, Murat S Ayhan, Dominic J Williamson, Robbert R Struyven, Timing Liu, Moucheng Xu, Mateo G Lozano, Peter Woodward-Court, et al. A foundation model for generalizable disease detection from retinal images. Nature, 622(7981):156–163, 2023.
  • [9] Pinaki Nath Chowdhury, Ayan Kumar Bhunia, Aneeshan Sain, Subhadeep Koley, Tao Xiang, and Yi-Zhe Song. What can human sketches do for object detection? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15083–15094, 2023.
  • [10] Dongmei Zhang, Chang Li, Renrui Zhang, Shenghao Xie, Wei Xue, Xiaodong Xie, and Shanghang Zhang. Fm-ov3d: Foundation model-based cross-modal knowledge blending for open-vocabulary 3d detection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 16723–16731, 2024.
  • [11] Maciej A Mazurowski, Haoyu Dong, Hanxue Gu, Jichen Yang, Nicholas Konz, and Yixin Zhang. Segment anything model for medical image analysis: an experimental study. Medical Image Analysis, 89:102918, 2023.
  • [12] Julio Silva-Rodríguez, Jose Dolz, and Ismail Ben Ayed. Transductive few-shot adapters for medical image segmentation. arXiv preprint arXiv:2303.17051, 2023.
  • [13] Kaidong Zhang and Dong Liu. Customized segment anything model for medical image segmentation. arXiv preprint arXiv:2304.13785, 2023.
  • [14] Jun Ma, Yuting He, Feifei Li, Lin Han, Chenyu You, and Bo Wang. Segment anything in medical images. Nature Communications, 15(1):654, 2024.
  • [15] Raman Dutt, Ondrej Bohdal, Sotirios A Tsaftaris, and Timothy Hospedales. Fairtune: Optimizing parameter efficient fine tuning for fairness in medical image analysis. arXiv preprint arXiv:2310.05055, 2023.
  • [16] Chaoyi Wu, Jiayu Lei, Qiaoyu Zheng, Weike Zhao, Weixiong Lin, Xiaoman Zhang, Xiao Zhou, Ziheng Zhao, Ya Zhang, Yanfeng Wang, et al. Can gpt-4v (ision) serve medical applications? case studies on gpt-4v for multimodal medical diagnosis. arXiv preprint arXiv:2310.09909, 2023.
  • [17] Ning Ding, Yujia Qin, Guang Yang, Fuchao Wei, Zonghan Yang, Yusheng Su, Shengding Hu, Yulin Chen, Chi-Min Chan, Weize Chen, et al. Parameter-efficient fine-tuning of large-scale pre-trained language models. Nature Machine Intelligence, 5(3):220–235, 2023.
  • [18] Sameera V Mohd Sagheer and Sudhish N George. A review on medical image denoising algorithms. Biomedical signal processing and control, 61:102036, 2020.
  • [19] Martin J Willemink, Wojciech A Koszek, Cailin Hardell, Jie Wu, Dominik Fleischmann, Hugh Harvey, Les R Folio, Ronald M Summers, Daniel L Rubin, and Matthew P Lungren. Preparing medical imaging data for machine learning. Radiology, 295(1):4–15, 2020.
  • [20] Georgios A Kaissis, Marcus R Makowski, Daniel Rückert, and Rickmer F Braren. Secure, privacy-preserving and federated machine learning in medical imaging. Nature Machine Intelligence, 2(6):305–311, 2020.
  • [21] Yuanyuan Chen, Xiaoqing Guo, Yongsheng Pan, Yong Xia, and Yixuan Yuan. Dynamic feature splicing for few-shot rare disease diagnosis. Medical Image Analysis, 90:102959, 2023.
  • [22] Raman Dutt, Linus Ericsson, Pedro Sanchez, Sotirios A Tsaftaris, and Timothy Hospedales. Parameter-efficient fine-tuning for medical image analysis: The missed opportunity. In Medical Imaging with Deep Learning, 2024.
  • [23] Dequan Wang, Xiaosong Wang, Lilong Wang, Mengzhang Li, Qian Da, Xiaoqiang Liu, Xiangyu Gao, Jun Shen, Junjun He, Tian Shen, et al. A real-world dataset and benchmark for foundation model adaptation in medical image classification. Scientific Data, 10(1):574, 2023.
  • [24] Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In European Conference on Computer Vision, pages 709–727, 2022.
  • [25] Hyo** Bahng, Ali Jahanian, Swami Sankaranarayanan, and Phillip Isola. Exploring visual prompts for adapting large-scale models. arXiv preprint arXiv:2203.17274, 2022.
  • [26] Yihan Wang, Jatin Chauhan, Wei Wang, and Cho-Jui Hsieh. Universality and limitations of prompt tuning. Advances in Neural Information Processing Systems, 36, 2024.
  • [27] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models, 2021.
  • [28] Yi** Huang, Pu** Cheng, Roger Tam, and Xiaoying Tang. Fpt: Fine-grained prompt tuning for parameter and memory efficient fine tuning in high-resolution medical image classification. arXiv preprint arXiv:2403.07576, 2024.
  • [29] Fudan Zheng, **dong Cao, Weijiang Yu, Zhiguang Chen, Nong Xiao, and Yutong Lu. Exploring low-resource medical image classification with weakly supervised prompt learning. Pattern Recognition, 149:110250, 2024.
  • [30] Chao Zhang, Xinyu Chen, Wensheng Li, Lixue Liu, Wei Wu, and Dacheng Tao. Understanding deep neural networks via linear separability of hidden layers. arXiv preprint arXiv:2307.13962, 2023.
  • [31] Along He, Kai Wang, Zhihong Wang, Tao Li, and Huazhu Fu. Dvpt: Dynamic visual prompt tuning of large pre-trained models for medical image analysis. arXiv preprint arXiv:2307.09787, 2023.
  • [32] Weihuang Liu, Xi Shen, Chi-Man Pun, and Xiaodong Cun. Explicit visual prompting for low-level structure segmentations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 19434–19445, 2023.
  • [33] Kaiyang Zhou, **gkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 130(9):2337–2348, 2022.
  • [34] Kaiyang Zhou, **gkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 16816–16825, 2022.
  • [35] Hantao Yao, Rui Zhang, and Changsheng Xu. Visual-language prompt tuning with knowledge-guided context optimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6757–6767, 2023.
  • [36] Shoufa Chen, GE Chongjian, Zhan Tong, Jiangliu Wang, Yibing Song, Jue Wang, and ** Luo. Adaptformer: Adapting vision transformers for scalable visual recognition. In Advances in Neural Information Processing Systems, 2022.
  • [37] Renrui Zhang, Wei Zhang, Rongyao Fang, Peng Gao, Kunchang Li, Jifeng Dai, Yu Qiao, and Hongsheng Li. Tip-adapter: Training-free adaption of clip for few-shot classification. In European conference on computer vision, pages 493–510. Springer, 2022.
  • [38] Tao Yu, Zhihe Lu, Xin **, Zhibo Chen, and Xinchao Wang. Task residual for tuning vision-language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10899–10909, 2023.
  • [39] Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao Fang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao. Clip-adapter: Better vision-language models with feature adapters. International Journal of Computer Vision, 132(2):581–595, 2024.
  • [40] Henry Hengyuan Zhao, Pichao Wang, Yuyang Zhao, Hao Luo, Fan Wang, and Mike Zheng Shou. Sct: A simple baseline for parameter-efficient fine-tuning via salient channels. International Journal of Computer Vision, 132(3):731–749, 2024.
  • [41] Junde Wu, Rao Fu, Huihui Fang, Yuanpei Liu, Zhaowei Wang, Yanwu Xu, Yueming **, and Tal Arbel. Medical sam adapter: Adapting segment anything model for medical image segmentation. arXiv preprint arXiv:2304.12620, 2023.
  • [42] Zhao Song, Ke Yang, Naiyang Guan, Junjie Zhu, Peng Qiao, and Qingyong Hu. Vppt: Visual pre-trained prompt tuning framework for few-shot image classification. In ICASSP 2023-2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1–5. IEEE, 2023.
  • [43] Can Yaras, Peng Wang, Wei Hu, Zhihui Zhu, Laura Balzano, and Qing Qu. The law of parsimony in gradient descent for learning deep linear networks. arXiv preprint arXiv:2306.01154, 2023.
  • [44] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
  • [45] Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? Advances in neural information processing systems, 27, 2014.
  • [46] Noel Codella, Veronica Rotemberg, Philipp Tschandl, M Emre Celebi, Stephen Dusza, David Gutman, Brian Helba, Aadi Kalloo, Konstantinos Liopyris, Michael Marchetti, et al. Skin lesion analysis toward melanoma detection 2018: A challenge hosted by the international skin imaging collaboration (isic). arXiv preprint arXiv:1902.03368, 2019.
  • [47] Medfmc challenge. https://medfm2023.grand-challenge.org/medfm2023.
  • [48] Mmclassification. https://github.com/open-mmlab/mmclassification.
  • [49] Hyo** Bahng, Ali Jahanian, Swami Sankaranarayanan, and Phillip Isola. Exploring visual prompts for adapting large-scale models. Mar 2022.
  • [50] Debesh Jha, Pia H Smedsrud, Michael A Riegler, Pål Halvorsen, Thomas De Lange, Dag Johansen, and Håvard D Johansen. Kvasir-seg: A segmented polyp dataset. In MultiMedia Modeling: 26th International Conference, MMM 2020, Daejeon, South Korea, January 5–8, 2020, Proceedings, Part II 26, pages 451–462. Springer, 2020.
  • [51] Debesh Jha, Steven A Hicks, Krister Emanuelsen, Håvard Johansen, Dag Johansen, Thomas de Lange, Michael A Riegler, and Pål Halvorsen. Medico multimedia task at mediaeval 2020: Automatic polyp segmentation. arXiv preprint arXiv:2012.15244, 2020.
  • [52] Mmsegmentation. https://github.com/open-mmlab/mmsegmentation.
  • [53] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 6881–6890, 2021.
  • [54] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III 18, pages 234–241. Springer, 2015.

Appendix A More Results and Details

A.1 Details of Implementation

A.1.1 MedFMC Classification Experiments

Our experimental setups are consistent with MedFMC Challenge [47] and MedFMC dataset [23]. Although Wang et al. [23] conducted extensive experiments, they did not provide results on mainstream architectures such as ViT. We run the fine-tuning experiments using ViT(ViT-Base/16) on the three medical image datasets. In our experiments, the fine-tuning is performed as linear probing, i.e., only tuning the classifier (fully connected) layers since the parameters in the representation layers are also frozen for the few-shot baseline methods. Common data augmentation tricks, i.e., random crop, resize, and horizontal flip, are adopted. The cross-entropy loss is employed as the loss function for the multi-class classification of ColonPath dataset, while the binary cross-entropy loss is computed for the multi-label classification of the remaining two datasets, i.e., ChestDR and Endo. The model parameters (except the fully connected classifier layer) are initialized by the ImageNet pre-trained model weights and frozen during the tuning. The ViT model is optimized with an initial learning rate of 6e-4. We trained these classification models on a single NVIDIA A100 for 20 epochs at a batch size of 4, using the framework of MMClassification [48].

EPT

We utilize the validation set of each dataset to determine the optimal prompt length dpsubscript𝑑𝑝d_{p}italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT. The prompt length represents the exclusive hyperparameter of the EPT approach that we adjust. For Transformer-based models, we consider the range of values for prompt length as [5, 10, 20, 50, 100, 200, 400, 600]. For the ViT architecture, we set the prompted layers to ’DEEP’, which means prompts are used in all layers.

Note: For ViT-base/16, the number of embedding patches is 196, and the embedding dimensions for each patch are 768. Consequently, to facilitate comparison with VPT, we multiply our relative prompt length by 196/768. Each prompt is randomly initialized using a normal initialization scheme. We adhere to the original design choices of the backbone architecture, including the presence of classification tokens [CLS] and whether to employ the final [CLS] embeddings as input for the classification head.

VPT

For the settings in VPT, we follow Jia et al. [24]. We use the validation set of each dataset to find the best prompt length npsubscript𝑛𝑝n_{p}italic_n start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT. For Transformer backbones, the range of prompt length is [1, 5, 10, 50, 100, 150]. For the ViT architecture, we set the prompted layers to ’DEEP’, which means prompts are used in all layers.

VP

For the settings in VP [49], we use the validation set of each dataset to find the best prompt length npsubscript𝑛𝑝n_{p}italic_n start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT. Since the VP method is not our primary comparative approach, we only conducted experiments on the ViT (Vision Transformer) architecture. The range of prompt length is [1, 5, 10, 50, 100, 150]. We set the prompted layers to ’DEEP’, which means prompts are used in all layers.

Adapters

Adapters  [36] insert extra lightweight modules inside each Transformer layer. One adapter module generally consists of a linear down-projection (with a reduction rate r), followed by a nonlinear activation function, and a linear up-projection, together with a residual connection. Chen et al. [36] explored the insertion method of adapters. Therefore we also use this setup in our own implementation. We choose the reduction rate r in [1, 4, 8, 32, 64].

LoRA

According to the findings of LoRA [27], we applied the LoRA structure to the matrices Wqsubscript𝑊𝑞W_{q}italic_W start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT and Wvsubscript𝑊𝑣W_{v}italic_W start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT, and we chose the reduction rate r𝑟ritalic_r from the options [1, 4, 8, 32, 64] to select the best for each task.

Table 5: Fine-tuning time of 10 shot learning on Colon dataset with different methods.
Method Convergence Time
Full 20 epochs 5min02s
Linear 20 epochs 2min06s
Partial-1 20 epochs 2min16s
MLP-3 20 epochs 2min36s
LoRA 20 epochs 2min09s
Bias 20 epochs 2min08s
Adapter 20 epochs 2min07s
VP 20 epochs 2min08s
VPT 20 epochs 2min42s
EPT 20 epochs 2min08s
Fine-tuning time

We selected the Colon-10shot task to demonstrate the time and number of epochs needed for fine-tuning, as it is the most computationally demanding task among all. For few-shot fine-tuning tasks, as evident from Tab 5, Moreover, the entire process can generally be completed within 2-5 minutes. The full fine-tuning method takes the longest computation time, followed by VPT and MLP-3. Our EPT method partially mitigates the computational time drawback associated with prompt-based methods and achieves a computational time close to that of the Adapter method in few-shot scenarios.

A.1.2 ISIC 2018 Classification Experiments

The ISIC 2018 dataset [46] contained 10,015 training and 1512 test images for a total of 11,527 images. ISIC 2018 provided the ground-truth data, consisting of seven classes, melanoma,melanocytic nevus, basal cell carcinoma, intraepithelial carcinoma,benign keratosis,dermatofibroma and vascular lesion. For training and few-shot setup, we strive to maintain consistency with the MedFMC classification tasks. The task is also formulated as N-Way K-shot classification task, and K is set to 1,5,10. 1-shot refers to every N images that sample from each class, rather than one image.

A.1.3 Segmentation Experiments

We select kvasir-SEG  [50] for polyp segmentation task. We follow the settings in Medico automatic polyp segmentation· task at mediaeval 2020  [51] with a train-valid ratio of 880:120.

For a more meaningful comparison, we have employed SETR as our segmentation framework to ensure consistency with VPT. We have utilized the same hyperparameters as in MMSegmentation [52]. However, we have opted to use ViT-Base/16 pretrained on ImageNet-21k as our backbone.

Table 6: Semantic Segmentation: kvasir-SEG [50] validation results with SETR [53] on ViT-B/16. The best mIoU scores among all methods but Full are bolded. Results of fully fine-tuning a FCN-UNet [54] are included.
Backbone ViT-B/16 FCN-UN
Method Full Head only Bias Adapter VPT EPT Full
mIoU 55.97 53.62 53.21 56.7756.77\mathbf{56.77}bold_56.77 52.99 53.57 70.77
mDice 69.00 67.18 65.88 69.4169.41\mathbf{69.41}bold_69.41 64.73 66.21 81.58
Tunable params (M) 87.76 1.33 1.43 2.52 2.25 1.94 28.99
Apply VPT to more vision tasks

We explored the effectiveness of fine-tuning algorithms on the medical segmentation dataset, kvasir-SEG [50]. We employed the same segmentation algorithm, SETR-PUP [53], as used in VPT. For the ViT backbone, we utilized the ViT-Base/16 model pre-trained on ImageNet-21k. However, we did not use a pre-trained segmentation head. The de-facto approach is to fully fine-tune the pre-trained backbone in conjunction with the ConvNet head (Full). For comparison, we included three additional protocols: updating only the head layers, VPT, and adapter. Additionally, we used full fine-tuning FCN-UN as a comparative benchmark. The results are shown in Tab 6. A major difference is that our EPT method lags behind in the segmentation task, with a lower mIoU compared to the head-only method, but outperforms VPT. The Adapter method achieves the best results in the segmentation task, surpassing the results of full fine-tuning. The reasons behind these results are still unclear, and further exploration is needed for our EPT in segmentation experiments.

A.2 Proofs

Proof for Lemma 1

Proof. For any i[nk]𝑖delimited-[]subscript𝑛𝑘i\in[n_{k}]italic_i ∈ [ italic_n start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ], we have 𝐱k,i0subscript𝐱𝑘𝑖0\mathbf{x}_{k,i}\geqslant 0bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ⩾ 0. Therefore 𝐱¯k0subscript¯𝐱𝑘0\bar{\mathbf{x}}_{k}\geqslant 0over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ⩾ 0 and for 𝐱k,isubscript𝐱𝑘𝑖\mathbf{x}_{k,i}bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT, 𝐱¯ksubscript¯𝐱𝑘\bar{\mathbf{x}}_{k}over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT, we use θ(𝐱k,i,𝐱¯k)𝜃subscript𝐱𝑘𝑖subscript¯𝐱𝑘\theta\left(\mathbf{x}_{k,i},\bar{\mathbf{x}}_{k}\right)italic_θ ( bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT , over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) to represent the angle between two vectors 𝐱k,isubscript𝐱𝑘𝑖\mathbf{x}_{k,i}bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT and 𝐱¯ksubscript¯𝐱𝑘\bar{\mathbf{x}}_{k}over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT. Thus, we have θ(𝐱k,i,𝐱¯k)π2𝜃subscript𝐱𝑘𝑖subscript¯𝐱𝑘𝜋2\theta\left(\mathbf{x}_{k,i},\bar{\mathbf{x}}_{k}\right)\leqslant\frac{\pi}{2}italic_θ ( bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT , over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ⩽ divide start_ARG italic_π end_ARG start_ARG 2 end_ARG.

ck𝐱k,ick𝐱¯k2=(ck𝐱k,i22+ck𝐱¯k222ck𝐱k,i2||ck𝐱¯kcos(θ(𝐱k,i,𝐱¯k)))12\left\|c_{k}\mathbf{x}_{k,i}-c_{k}\bar{\mathbf{x}}_{k}\right\|_{2}=\left(\left% \|c_{k}\mathbf{x}_{k,i}\right\|_{2}^{2}+\left\|c_{k}\bar{\mathbf{x}}_{k}\right% \|_{2}^{2}-2\left\|c_{k}\mathbf{x}_{k,i}\right\|_{2}||c_{k}\bar{\mathbf{x}}_{k% }\|\cos\left(\theta\left(\mathbf{x}_{k,i},\bar{\mathbf{x}}_{k}\right)\right)% \right)^{\frac{1}{2}}∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = ( ∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + ∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT - 2 ∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT | | italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ roman_cos ( italic_θ ( bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT , over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ) ) start_POSTSUPERSCRIPT divide start_ARG 1 end_ARG start_ARG 2 end_ARG end_POSTSUPERSCRIPT (12)
ck,i𝐱k,ick𝐱k¯2=(ck,i𝐱k,i22+ck𝐱¯k222ck,i𝐱k,i2ck𝐱¯k2cos(θ(𝐱k,i,𝐱¯k)))12subscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖subscript𝑐𝑘¯subscript𝐱𝑘2superscriptsuperscriptsubscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖22superscriptsubscriptnormsubscript𝑐𝑘subscript¯𝐱𝑘222subscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖2subscriptnormsubscript𝑐𝑘subscript¯𝐱𝑘2𝜃subscript𝐱𝑘𝑖subscript¯𝐱𝑘12\left\|c_{k,i}\mathbf{x}_{k,i}-c_{k}\bar{\mathbf{x}_{k}}\right\|_{2}=\left(% \left\|c_{k,i}\mathbf{x}_{k,i}\right\|_{2}^{2}+\left\|c_{k}\bar{\mathbf{x}}_{k% }\right\|_{2}^{2}-2\left\|c_{k,i}\mathbf{x}_{k,i}\right\|_{2}\left\|c_{k}\bar{% \mathbf{x}}_{k}\right\|_{2}\cos\left(\theta\left(\mathbf{x}_{k,i},\bar{\mathbf% {x}}_{k}\right)\right)\right)^{\frac{1}{2}}∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT end_ARG ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = ( ∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + ∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT - 2 ∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT roman_cos ( italic_θ ( bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT , over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ) ) start_POSTSUPERSCRIPT divide start_ARG 1 end_ARG start_ARG 2 end_ARG end_POSTSUPERSCRIPT (13)

Consider two cases:(1)𝐱k,i2𝐱¯k2subscriptnormsubscript𝐱𝑘𝑖2subscriptnormsubscript¯𝐱𝑘2\left\|\mathbf{x}_{k,i}\right\|_{2}\leqslant\left\|\bar{\mathbf{x}}_{k}\right% \|_{2}∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ ∥ over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT;(2)𝐱k,i2𝐱¯k2subscriptnormsubscript𝐱𝑘𝑖2subscriptnormsubscript¯𝐱𝑘2\left\|\mathbf{x}_{k,i}\right\|_{2}\geqslant\left\|\bar{\mathbf{x}}_{k}\right% \|_{2}∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩾ ∥ over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT.

For 𝐱k,i2𝐱¯k2subscriptnormsubscript𝐱𝑘𝑖2subscriptnormsubscript¯𝐱𝑘2\left\|\mathbf{x}_{k,i}\right\|_{2}\leqslant\left\|\bar{\mathbf{x}}_{k}\right% \|_{2}∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ ∥ over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, we have ck𝐱k,i2ck,i𝐱k,i2ck𝐱¯k2subscriptnormsubscript𝑐𝑘subscript𝐱𝑘𝑖2subscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖2subscriptnormsubscript𝑐𝑘subscript¯𝐱𝑘2\left\|c_{k}\mathbf{x}_{k,i}\right\|_{2}\leqslant\left\|c_{k,i}\mathbf{x}_{k,i% }\right\|_{2}\leqslant\left\|c_{k}\bar{\mathbf{x}}_{k}\right\|_{2}∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ ∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ ∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. According to (12) and (13), we have ck,i𝐱k,ick𝐱¯k2ck𝐱k,i𝐱¯k2subscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖subscript𝑐𝑘subscript¯𝐱𝑘2subscript𝑐𝑘subscriptnormsubscript𝐱𝑘𝑖subscript¯𝐱𝑘2\left\|c_{k,i}\mathbf{x}_{k,i}-c_{k}\bar{\mathbf{x}}_{k}\right\|_{2}\leqslant c% _{k}\left\|\mathbf{x}_{k,i}-\bar{\mathbf{x}}_{k}\right\|_{2}∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT.

And for 𝐱k,i2𝐱¯k2subscriptnormsubscript𝐱𝑘𝑖2subscriptnormsubscript¯𝐱𝑘2\left\|\mathbf{x}_{k,i}\right\|_{2}\geqslant\|\bar{\mathbf{x}}_{k}\|_{2}∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩾ ∥ over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, we have ck𝐱k,i2ck,i𝐱k,i2ck𝐱¯k2subscriptnormsubscript𝑐𝑘subscript𝐱𝑘𝑖2subscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖2subscriptnormsubscript𝑐𝑘subscript¯𝐱𝑘2\left\|c_{k}\mathbf{x}_{k,i}\right\|_{2}\geqslant\left\|c_{k,i}\mathbf{x}_{k,i% }\right\|_{2}\geqslant\left\|c_{k}\bar{\mathbf{x}}_{k}\right\|_{2}∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩾ ∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩾ ∥ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. According to (12) and (13), we have ck,i𝐱k,ick𝐱¯k2ck𝐱k,i𝐱¯k2subscriptnormsubscript𝑐𝑘𝑖subscript𝐱𝑘𝑖subscript𝑐𝑘subscript¯𝐱𝑘2subscript𝑐𝑘subscriptnormsubscript𝐱𝑘𝑖subscript¯𝐱𝑘2\left\|c_{k,i}\mathbf{x}_{k,i}-c_{k}\bar{\mathbf{x}}_{k}\right\|_{2}\leqslant c% _{k}\left\|\mathbf{x}_{k,i}-\bar{\mathbf{x}}_{k}\right\|_{2}∥ italic_c start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ bold_x start_POSTSUBSCRIPT italic_k , italic_i end_POSTSUBSCRIPT - over¯ start_ARG bold_x end_ARG start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT.

So we can conclude that Σ𝐖ck2Σ𝐖superscriptsubscriptΣ𝐖superscriptsubscript𝑐𝑘2subscriptΣ𝐖\Sigma_{\mathbf{W}}^{\prime}\leqslant c_{k}^{2}\Sigma_{\mathbf{W}}roman_Σ start_POSTSUBSCRIPT bold_W end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ⩽ italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT roman_Σ start_POSTSUBSCRIPT bold_W end_POSTSUBSCRIPT.

Proof for Proposition 1

Proof. According to the assumptions of Proposition 1, assume dp=1subscript𝑑𝑝1d_{p}=1italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT = 1 and n=2𝑛2n=2italic_n = 2. Let σ1=[σ11,σ12]subscript𝜎1subscript𝜎11subscript𝜎12\mathbf{\sigma}_{1}=\left[\sigma_{11},\sigma_{12}\right]italic_σ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = [ italic_σ start_POSTSUBSCRIPT 11 end_POSTSUBSCRIPT , italic_σ start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT ] and σ2=[σ21,σ22]subscript𝜎2subscript𝜎21subscript𝜎22\mathbf{\sigma}_{2}=\left[\sigma_{21},\sigma_{22}\right]italic_σ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = [ italic_σ start_POSTSUBSCRIPT 21 end_POSTSUBSCRIPT , italic_σ start_POSTSUBSCRIPT 22 end_POSTSUBSCRIPT ] represent σ(𝐮1)𝜎subscript𝐮1\sigma\left(\mathbf{u}_{1}\right)italic_σ ( bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) and σ(𝐮2)𝜎subscript𝐮2\sigma\left(\mathbf{u}_{2}\right)italic_σ ( bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) respectively. Also, let σp,1=[σp,11,σp,12]subscript𝜎𝑝1subscript𝜎𝑝11subscript𝜎𝑝12\mathbf{\sigma}_{p,1}=\left[\sigma_{p,11},\sigma_{p,12}\right]italic_σ start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT = [ italic_σ start_POSTSUBSCRIPT italic_p , 11 end_POSTSUBSCRIPT , italic_σ start_POSTSUBSCRIPT italic_p , 12 end_POSTSUBSCRIPT ] and σp,2=[σp,21,σp,22]subscript𝜎𝑝2subscript𝜎𝑝21subscript𝜎𝑝22\mathbf{\sigma}_{p,2}=\left[\sigma_{p,21},\sigma_{p,22}\right]italic_σ start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT = [ italic_σ start_POSTSUBSCRIPT italic_p , 21 end_POSTSUBSCRIPT , italic_σ start_POSTSUBSCRIPT italic_p , 22 end_POSTSUBSCRIPT ] represent σ(𝐮p,1)dp:𝜎subscriptsubscript𝐮𝑝1:subscript𝑑𝑝absent\sigma\left(\mathbf{u}_{p,1}\right)_{d_{p}:}italic_σ ( bold_u start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : end_POSTSUBSCRIPT and σ(𝐮p,2)dp:𝜎subscriptsubscript𝐮𝑝2:subscript𝑑𝑝absent\sigma\left(\mathbf{u}_{p,2}\right)_{d_{p}:}italic_σ ( bold_u start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : end_POSTSUBSCRIPT respectively.

Then σ11+σ12=σ21+σ22=1subscript𝜎11subscript𝜎12subscript𝜎21subscript𝜎221\sigma_{11}+\sigma_{12}=\sigma_{21}+\sigma_{22}=1italic_σ start_POSTSUBSCRIPT 11 end_POSTSUBSCRIPT + italic_σ start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT = italic_σ start_POSTSUBSCRIPT 21 end_POSTSUBSCRIPT + italic_σ start_POSTSUBSCRIPT 22 end_POSTSUBSCRIPT = 1 and σ1>0,σ2>0formulae-sequencesubscript𝜎10subscript𝜎20\mathbf{\sigma}_{1}>0,\mathbf{\sigma}_{2}>0italic_σ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT > 0 , italic_σ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT > 0. Without loss of generality, assume σ12σ22subscriptnormsubscript𝜎12subscriptnormsubscript𝜎22\left\|\mathbf{\sigma}_{1}\right\|_{2}\leqslant\left\|\mathbf{\sigma}_{2}% \right\|_{2}∥ italic_σ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ ∥ italic_σ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. It can be inferred that σ11σ122σ21σ222subscriptnormsubscript𝜎11subscript𝜎122subscriptnormsubscript𝜎21subscript𝜎222\left\|\sigma_{11}-\sigma_{12}\right\|_{2}\leqslant\left\|\sigma_{21}-\sigma_{% 22}\right\|_{2}∥ italic_σ start_POSTSUBSCRIPT 11 end_POSTSUBSCRIPT - italic_σ start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩽ ∥ italic_σ start_POSTSUBSCRIPT 21 end_POSTSUBSCRIPT - italic_σ start_POSTSUBSCRIPT 22 end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT.

Let σ1=[11+ez1,ez11+ez1]subscript𝜎111superscript𝑒subscript𝑧1superscript𝑒subscript𝑧11superscript𝑒subscript𝑧1\mathbf{\sigma}_{1}=\left[\frac{1}{1+e^{z_{1}}},\frac{e^{z_{1}}}{1+e^{z_{1}}}\right]italic_σ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = [ divide start_ARG 1 end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG , divide start_ARG italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG ] and σ2=[11+ez2,ez21+ez2]subscript𝜎211superscript𝑒subscript𝑧2superscript𝑒subscript𝑧21superscript𝑒subscript𝑧2\mathbf{\sigma}_{2}=\left[\frac{1}{1+e^{z_{2}}},\frac{e^{z_{2}}}{1+e^{z_{2}}}\right]italic_σ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = [ divide start_ARG 1 end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG , divide start_ARG italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG ]. Then we have z2>z1subscript𝑧2subscript𝑧1z_{2}>z_{1}italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT > italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT.

For σp,1subscript𝜎𝑝1\mathbf{\sigma}_{p,1}italic_σ start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT and σp,2subscript𝜎𝑝2\mathbf{\sigma}_{p,2}italic_σ start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT, let 𝐮p,1=[11+ez1+ez1p,ez11+ez1+ez1p]subscript𝐮𝑝111superscript𝑒subscript𝑧1superscript𝑒subscript𝑧1𝑝superscript𝑒subscript𝑧11superscript𝑒subscript𝑧1superscript𝑒subscript𝑧1𝑝\mathbf{u}_{p,1}=\left[\frac{1}{1+e^{z_{1}}+e^{z_{1}p}},\frac{e^{z_{1}}}{1+e^{% z_{1}}+e^{z_{1}p}}\right]bold_u start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT = [ divide start_ARG 1 end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG , divide start_ARG italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG ] and 𝐮p,2=[11+ez2+ez2p,ez21+ez2+ez2p]subscript𝐮𝑝211superscript𝑒subscript𝑧2superscript𝑒subscript𝑧2𝑝superscript𝑒subscript𝑧21superscript𝑒subscript𝑧2superscript𝑒subscript𝑧2𝑝\mathbf{u}_{p,2}=\left[\frac{1}{1+e^{z_{2}}+e^{z_{2}p}},\frac{e^{z_{2}}}{1+e^{% z_{2}}+e^{z_{2}p}}\right]bold_u start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT = [ divide start_ARG 1 end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG , divide start_ARG italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG ].

Therefore, for σp,1=c1σ1subscript𝜎𝑝1subscript𝑐1subscript𝜎1\mathbf{\sigma}_{p,1}=c_{1}\mathbf{\sigma}_{1}italic_σ start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT = italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_σ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and σp,2=c2σ2subscript𝜎𝑝2subscript𝑐2subscript𝜎2\mathbf{\sigma}_{p,2}=c_{2}\sigma_{2}italic_σ start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT = italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_σ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, we can know that c1=1+ez11+ez1+ez1psubscript𝑐11superscript𝑒subscript𝑧11superscript𝑒subscript𝑧1superscript𝑒subscript𝑧1𝑝c_{1}=\frac{1+e^{z_{1}}}{1+e^{z_{1}}+e^{z_{1}p}}italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = divide start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG and c2=1+ez21+ez2+ez2psubscript𝑐21superscript𝑒subscript𝑧21superscript𝑒subscript𝑧2superscript𝑒subscript𝑧2𝑝c_{2}=\frac{1+e^{z_{2}}}{1+e^{z_{2}}+e^{z_{2}p}}italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = divide start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG.

To prove: c1c2subscript𝑐1subscript𝑐2c_{1}\geqslant c_{2}italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⩾ italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, it is equivalent to proving: ez1p1+ez1+ez1pez2p1+ez2+ez2psuperscript𝑒subscript𝑧1𝑝1superscript𝑒subscript𝑧1superscript𝑒subscript𝑧1𝑝superscript𝑒subscript𝑧2𝑝1superscript𝑒subscript𝑧2superscript𝑒subscript𝑧2𝑝\frac{e^{z_{1}p}}{1+e^{z_{1}}+e^{z_{1}p}}\leqslant\frac{e^{z_{2}p}}{1+e^{z_{2}% }+e^{z_{2}p}}divide start_ARG italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG ⩽ divide start_ARG italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUPERSCRIPT + italic_e start_POSTSUPERSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_p end_POSTSUPERSCRIPT end_ARG, given that z2z1subscript𝑧2subscript𝑧1z_{2}\geqslant z_{1}italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⩾ italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT. Therefore, we can conclude that p=1𝑝1p=1italic_p = 1 satisfies the condition. Thus, c1=σ(𝐮p,1)dp:2σ(𝐮1)2c2=σ(𝐮p,2)dp:2σ(𝐮2)2subscript𝑐1subscriptnorm𝜎subscriptsubscript𝐮𝑝1:subscript𝑑𝑝absent2subscriptnorm𝜎subscript𝐮12subscript𝑐2subscriptnorm𝜎subscriptsubscript𝐮𝑝2:subscript𝑑𝑝absent2subscriptnorm𝜎subscript𝐮22c_{1}=\frac{\left\|\sigma\left(\mathbf{u}_{p,1}\right)_{d_{p}:}\right\|_{2}}{% \left\|\sigma\left(\mathbf{u}_{1}\right)\right\|_{2}}\geqslant c_{2}=\frac{% \left\|\sigma\left(\mathbf{u}_{p,2}\right)_{d_{p}:}\right\|_{2}}{\left\|\sigma% \left(\mathbf{u}_{2}\right)\right\|_{2}}italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = divide start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT italic_p , 1 end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG ⩾ italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = divide start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT italic_p , 2 end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_d start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT : end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG start_ARG ∥ italic_σ ( bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG.