啟發自JPEG的視覺變換器模型壓縮方法

JPEG-Inspired Model Compression for Vision Transformer

檔案

日期

2024

類型

語言

英文

摘要

在這篇論文中,我們提出了一個針對視覺變換器(Vision Transformers)的新穎模型壓縮框架,該框架靈感來自JPEG的離散餘弦變換(DCT)。我們的方法包含兩個主要組件:一個影像資訊壓縮模組和一個模型維度縮減模組。影像資訊壓縮模組選擇性地壓縮影像資訊。從頭訓練視覺轉換器的結果顯示,壓縮影像的內容確實可以在幾乎不損害準確度的情況下壓縮模型大小,但僅僅壓縮影像而不改變模型維度,只能減少模型一開始的線性轉換計算。若要大幅縮減計算量,則需要直接改變模型維度,因此後續進行了減少模型維度的討論。

後續的蒸餾方法最主要是要提升壓縮過的視覺轉換器的準確度,因為現有文獻指出,如果單純從頭開始訓練模型,即使花費上千小時仍無法達到轉移學習的效果。但是我們的壓縮模型方法會改變模型本身的架構,因此過往的轉移學習方法並不適用於我們的訓練流程。為此我們提出了兩種蒸餾方法:一階段蒸餾以及二階段蒸餾。一階段蒸餾的目的在於討論所有壓縮模型的方法,能否透過特徵蒸餾的方式提高效能,並且觀察不同資訊壓縮以及模型維度縮減的程度,對於準確度的影響。二階段蒸餾的目的在最大幅度的利用已經訓練好的模型權重,觀察我們的資訊壓縮模組與已經訓練好的模型權重能否一起使用。
In this paper, we propose a novel model compression framework for Vision Transformers (ViTs) [1] inspired by JPEG’s Discrete Cosine Transform (DCT) [8]. Our approach includes two main components: a patch compression module and a model dimension reduction module. The patch compression module selectively compresses patch information. The results of training Vision Transformers from scratch show that compressing image content can indeed reduce model size with minimal accuracy loss. However, only compressing the image without altering the model dimensions will merely reduce the computational load of the initial linear transformation. To achieve significant reductions in computation, the model dimensions themselves must be adjusted, leading to the subsequent discussion on model dimension reduction.

The primary goal of the subsequent distillation methods is to improve the accuracy of compressed Vision Transformers, as existing literature suggests that simply training a model from scratch, even for thousands of hours, cannot achieve the same performance as transfer learning [3]. However, our model compression approach alters the architecture itself, making traditional transfer learning methods unsuitable for our training process. To address this, we propose two distillation methods: whole-model distillation and partial distillation. The purpose of whole-model distillation is to examine whether all compression methods can enhance performance through feature distillation, and to observe the impact of different levels of information compression and model dimension reduction on accuracy. The goal of partial distillation is to maximize the use of pre-trained model weights and evaluate whether our information compression module can be effectively combined with these pre-trained weights to achieve optimal performance.

所屬典藏

電子研究所
顯示完整詮釋資料 統計資料

引用此條目

Wang, H.-P. (2024). JPEG-Inspired Model Compression for Vision Transformer. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/4557

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享

永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/4557