## 3 Proposed Method
### Adaptive Method with ViT  
Global features are captured using the ViT architecture, and adaptive learning is used in the Transformer encoder architecture to gradually adjust the self-attention weight parameter of each block, which not only focuses on the most relevant features and improves the expressiveness and differentiation of the features, but also suppresses the information that is irrelevant to the task to a certain extent so that it can reduce the attention to noise and redundant information, remove the feature information that is not very relevant to the facial expression, and also effectively reduce the amount of computation and improve the recognition performance of the model. The whole processing of vit is introduced first. Firstly, the input image is divided into fixed-size image blocks, and, the resulting image vectors are linearly mapped flattened into a vector, and an additional learnable embedding vector class_token is added, thus introducing global semantic information about the whole image and interacting with other image blocks as an important basis for the final classification result. Location information encoding vectors are usually added for these image blocks. The image blocks are concatenated with the class_token and fed into the Transformer Encoder. Each Transformer Encoder consists of Multi-Head Attention, Layer Norm, and MLP modules. These encoders help the model establish global relationships and contextual information in the sequence. Finally, the final recognition result for expression classification is obtained by mapping the class_token feature vector to the category probability distribution by a MLP-Head. Visual Transformer is built based on the self-attention module, which makes our adaptive token learning approach better able to find more important places to focus on globally, save more effective information, and remove the effects of noise and occlusion. The concept of the self-attention mechanism [9] is to associate different locations of a single sequence to compute a representation of that sequence. Specifically, the input features are divided into three parts: query, key, and value, and for each position of the query, the  
Figure 2: The CoT Module Structure. self-attention mechanism computes the similarity between that query and the keys of all the positions and uses the similarity to assign an attention weight to each position. The attention weights are then weighted and summed with the values of the corresponding location to obtain an output representation of that location. The dot product method is generally used to calculate the similarity, as shown in Equation (2). We use the similarity between other tokens and class_token as a basis to filter out tokens that are not relevant to the global semantic relationship. \[\left(QK^{T}\right)_{ij}=\sum\limits_{k=1}^{d}Q_{ik}\cdot K_{jk} \tag{2}\]  
After computing the similarity score, it is converted into a set of attention weights that sum to 1 using the Softmax function. These weights are then weighted and summed with the value vector V to get the final attention output as shown in Equation (3), Where Q, K, and V are query vector, key vector, and value vector, respectively. d denotes the dimension of the K vector. \[Attention(Q,K,V)=Softmax\left(\frac{QK^{T}}{\sqrt{d}}\right)V \tag{3}\]  
The main goal of the adaptive learning approach is to determine the number of tokens that need to be retained each time to achieve more effective information filtering in the model's self-attention mechanism. Specifically, we introduce a set of adaptive learning parameters \([K_{1},K_{2},K_{3},\cdots,K_{N}]\), whose values are dynamically adjusted according to the learning progress of the model during the training process.