{"title":"Mixed Precision Quantization with Hardware-Friendly Activation Functions for Hybrid ViT Models","authors":"B. Kang, Dahun Choi, Hyun Kim","doi":"10.1109/ICEIC61013.2024.10457283","DOIUrl":null,"url":null,"abstract":"As hardware devices have advanced recently, various artificial intelligence tasks including convolutional neural networks (CNNs) have achieved high accuracy. Especially in computer vision tasks, vision transformer (ViT) based models have achieved unprecedented progress, and CNN + ViT hybrid models have also been proposed that take advantage of both CNNs and ViTs. However, the numerous parameters of hybrid ViTs are unsuitable for resource-constrained mobile/edge environments. In addition, the nonlinear activation functions in hybrid ViTs (e.g., GeLU and Swish) require more resources and computational cost compared to integer operation functions (e.g., ReLU) when using dedicated hardware accelerators. To address these issues, we propose a technique to efficiently compress the prominent hybrid ViT model, MobileViT, by applying the mixed precision quantization and the Shift-Swish activation function. Compressing the MobileViT-s, MobileViT-xs, and MobileViT-xxs models with the proposed method on the ImageNet dataset resulted in minimal accuracy drops of 0.41%, 0.18%, and 0.86%, respectively, while achieving effective quantization and activation function approximation at the average 7.9-bit level.","PeriodicalId":518726,"journal":{"name":"2024 International Conference on Electronics, Information, and Communication (ICEIC)","volume":"50 2","pages":"1-2"},"PeriodicalIF":0.0000,"publicationDate":"2024-01-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2024 International Conference on Electronics, Information, and Communication (ICEIC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICEIC61013.2024.10457283","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
As hardware devices have advanced recently, various artificial intelligence tasks including convolutional neural networks (CNNs) have achieved high accuracy. Especially in computer vision tasks, vision transformer (ViT) based models have achieved unprecedented progress, and CNN + ViT hybrid models have also been proposed that take advantage of both CNNs and ViTs. However, the numerous parameters of hybrid ViTs are unsuitable for resource-constrained mobile/edge environments. In addition, the nonlinear activation functions in hybrid ViTs (e.g., GeLU and Swish) require more resources and computational cost compared to integer operation functions (e.g., ReLU) when using dedicated hardware accelerators. To address these issues, we propose a technique to efficiently compress the prominent hybrid ViT model, MobileViT, by applying the mixed precision quantization and the Shift-Swish activation function. Compressing the MobileViT-s, MobileViT-xs, and MobileViT-xxs models with the proposed method on the ImageNet dataset resulted in minimal accuracy drops of 0.41%, 0.18%, and 0.86%, respectively, while achieving effective quantization and activation function approximation at the average 7.9-bit level.