Vision Transformer Pruning 1 논문

이준석·2022년 6월 23일
0

VIT_Pruning

목록 보기
5/5

Vision Transformer Pruning

Abstract

  • Vision transformer has achieved competitive performance on a variety of computer vision applications.
    비전 트랜스포머는 다양한 컴퓨터 비전 애플리케이션에서 경쟁력 있는 성능을 달성했다

  • Howeber, thier storage, run-time memory, and computational demands are hindering the deployment to mobile devices.
    그러나 스토리지, 런타임 메모리 및 컴퓨팅 요구로 인해 모바일 장치에 대한 배포가 지연되고 있습니다.

  • Here we present a vision transformer pruning approach, which identifies the impacts of dimensions in each layer of transformer and then executes pruning accordingly.
    여기서 우리는 변압기의 각 계층에서 치수의 영향을 식별한 다음 그에 따라 가지치기를 실행하는 비전 변압기 가지치기 접근법을 제시한다.

  • By encouraging dimension-wise-sparsity in the transformer, important dimensions automatically emerge.
    Transformer에서 차원별 희소성을 장려함으로써 중요한 치수가 자동으로 나타납니다.

  • A great number of dimensions with small importance scores can be discarded to achieve a high pruning ratio without significantly compromising accuracy.
    중요도 점수가 작은 많은 차원은 정확도를 크게 손상시키지 않고 높은 가지치기 비율을 달성하기 위해 폐기될 수 있다.

  • The pipeline for vision transformer pruning is as floows: 1) training with sparsity regularization; 2) pruning dimensions of linear projections; 3) fine-tuning.
    비전 트랜스포머 가지치기 파이프라인은 1) 희소성 정규화를 통한 훈련, 2) 선형 투영의 가지치기 치수, 3) 미세 조정이다.

  • The reduced parameters and FLOPs ratios of the proposed algorithm are well evaluated and analyzed on ImageNet dataset to demonstrate the effectiveness of our proposed method.
    제안된 알고리듬의 줄어든 매개 변수와 FLOP 비율은 ImageNet 데이터 세트에서 잘 평가되고 분석되어 제안된 방법의 효과를 입증한다.

Conclusion

  • In this paper, we introduce a simple yet efficient visio transformer pruning method.
    본 논문에서는 간단하지만 효율적인 비전 트랜스포머 가지치기 방법을 소개한다.

  • L1 regulation is applied to sparse the dimensions of the transformer and the important dimensions appear automatically.
    L1 규제는 변압기의 희소 치수에 적용되며 중요한 치수가 자동으로 나타난다.

  • The experiments conducted on Imagenet-100 and ImageNet-1K demonstrate that the pruning method can largely reduce the computation costs and model parameters while maintaining the high accuracy of original vision transformers.
    Imagenet-100 및 ImageNet-1K에서 수행된 실험은 가지치기 방법이 원래 비전 트랜스포머의 높은 정확도를 유지하면서 계산 비용과 모델 매개 변수를 크게 줄일 수 있음을 보여준다.

  • In the future, the important componets such as the number of heads and the number of layers can also be reduced with this method, which is a promising attempt further compress vision transformers.
    미래에는 이 방법으로 헤드 수 및 레이어 수와 같은 중요한 구성 요소도 줄일 수 있으며, 이는 비전 트랜스포머를 추가로 압축하려는 유망한 시도이다.

2. Approach

2.2 Vision Transformer Pruning

  • To slim the transformer architecture, we focus on decreasing the FLOPs of MHSA and MLP.
    변압기 아키텍처를 슬림화하기 위해 MHSA 및 MLP의 FLOP를 줄이는 데 중점을 둡니다.

  • We propose to prune the dimension of the linear projection by learning their associated importance scores.
    관련 중요도 점수를 학습하여 선형 투영의 차원을 정리할 것을 제안합니다.

  • For the features 𝑋 ∈ R 𝑛×𝑑 , where 𝑛 denotes the number of features that need to be pruned and 𝑑 denotes the dimension of each feature, we aim to preserve the generated important features and remove the useless ones from the corresponding components of linear projection.
    특징 X∈ Rn×d 의 경우, 여기서 n은 가지치기해야 하는 피쳐의 수를 나타내고 d는 각 피쳐의 치수를 나타내며, 생성된 중요한 피쳐를 보존하고 선형 투영의 해당 컴포넌트에서 쓸모없는 피쳐들을 제거하는 것을 목표로 합니다.

  • Suppose the optimal importance scores are 'a∗' ∈ {0, 1} 𝑑 , that is, the scores for generated important features and their corresponding components are ones while the scores for useless ones are zeros.
    최적 중요도 점수가 'a*' ∈ {0, 1}𝑑 라고 가정합니다. 즉, 생성된 중요 기능과 해당 구성 요소에 대한 점수는 1이고 쓸모없는 기능에 대한 점수는 0입니다.

  • With the importance scores, we can obtain the pruned features:
    중요도 점수를 사용하여 정리된 기능을 얻을 수 있습니다.

  • However, it’s hard to optimize 'a∗' in the neural network through a back-propagation algorithm due to its discrete values.
    그러나 이산 값 때문에 역전파 알고리즘을 통해 신경망에서 'a*'를 최적화하기가 어렵습니다.

  • Thus, we propose to relax 'a∗' to real values as â ∈ R 𝑑 . The soft pruned features are obtained as
    soft pruned feature는 다음과 같이 얻어진다.

  • Then, the relaxed importance scores â can be learned together with the transformer network end-to-end.
    그런 다음, 완화된 중요도 점수 â는 트랜스포머 네트워크와 함께 종단(end-to-end) 간 학습될 수 있습니다.

  • In order to enforce sparsity of importance scores, we apply ℓ1 regularization on the importance scores: 𝜆∥â∥1 and optimize it by adding on the training objective, where 𝜆 is the sparsity hyper-parameter.
    중요도 점수의 희소성을 적용하기 위해 중요도 점수에 l1 정규화를 적용합니다: λ∥â∥1 및 λ는 희소성 하이퍼 파라미터인 훈련 목표에 추가하여 최적화합니다.

  • After training with sparsity penalty, we obtain the transformer with some importance scores near zero.
    희소성 페널티로 훈련한 후 중요도 점수가 0에 가까운 변환기를 얻습니다.

  • We rank all the values of regularized importance scores in the transformer and obtain a threshold 𝜏 according to a pre-defined pruning rate.
    우리는 변압기에서 정규화 된 중요도 점수의 모든 값을 순위를 매기고 미리 정의 된 가지치기 비율에 따라 임계 값 τ를 얻습니다.

  • With the threshold 𝜏, we obtain the discrete 'a∗' by setting the values below the threshold as zero and higher values as ones:
    임계값 τ를 사용하면 임계값 아래의 값을 0으로 설정하고 더 높은 값을 값으로 설정하여 이산 'a∗'를 얻습니다.

  • After pruning according to the importance scores 'a∗' , the total pruned transformer is fine-tuned to diminish the accuracy drop.
    중요도 점수 'a∗'에 따라 가지치기를 한 후, 총 가지 치기 변압기는 정확도 저하를 줄이기 위해 미세 조정됩니다.

  • The above pruning procedure is denoted as
    위의 가지 치기 절차는 다음과 같이 표시됩니다.

  • As shown in Figure 1, we apply the pruning operation on all the MHSA and MLP blocks. The pruning process for them can be formulated as
    그림 1과 같이 모든 MHSA 및 MLP 블록에 가지치기 작업을 적용합니다. 그들을위한 가지 치기 과정은 다음과 같이 공식화 될 수있다.

  • where FC𝑞 , FC𝑘 , FC𝑣, FC𝑜𝑢𝑡 , FC1, and FC2 are pruned linear projection corresponding to the pruned features and 'a∗'.
    여기서 FC𝑞 , FC𝑘 , FC𝑣, FC𝑜𝑢𝑡 , FC1 및 FC2 는 정리된 기능 및 'a*' 에 해당하는 정리된 선형 투영입니다.

  • The proposed vision transformer pruning (VTP) method provides a simple yet effective way to slim vision transformer models.
    제안된 비전 트랜스포머 가지치기(VTP) 방법은 비전 트랜스포머 모델을 슬림화하는 간단하면서도 효과적인 방법을 제공합니다.

  • We hope that this work will serve as a solid baseline for future research and provide useful experience for the practical deployment of vision transformers.
    우리는 이 작업이 미래 연구를 위한 견고한 기준이 되고 비전 트랜스포머의 실제 배치에 유용한 경험을 제공하기를 바랍니다.

profile
인공지능 전문가가 될레요

0개의 댓글