arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.21171cs.CV
收藏

FTerViT:全三进制视觉变换器

FTerViT: Fully Ternary Vision Transformer

CSEM(瑞士塞梅实验室);ETH Zürich(苏黎世联邦理工学院)

Szymon Ruciński, Pietro Bonazzi, Engin Türetken, Simon Narduzzi, Michele Magno, Nadim Maamari

AI总结:

本文提出了一种全三进制视觉变换器(FTerViT),通过将所有权重矩阵和归一化参数三进制化,实现了模型压缩,同时在资源受限的微控制器上实现了高效的部署。

摘要:

三进制视觉变换器(Ternary Vision Transformers)提供了显著的模型压缩,但目前最先进的方法仅将编码器层三进制化,而留下的补丁嵌入、归一化参数和分类头仍保持全精度。在针对资源受限处理器(如微控制器)的紧凑模型中,这些剩余的全精度组件决定了总内存占用,严重限制了部署效率和设备可行性。在本工作中,我们引入了一种完全三进制化的视觉变换器,其中所有权重矩阵和归一化参数均被三进制化(FTerViT)。为此,我们引入了两个新的操作符:具有通道缩放的三进制位卷积(TernaryBitConv2d)用于补丁嵌入,以及三进制归一化(TernaryLayerNorm)。FTerViT通过知识蒸馏进行训练,随后进行轻量级量化感知恢复阶段。我们的三进制W2A8 DeiT-III-S在384×384分辨率下达到82.43%的ImageNet-1K Top-1精度,内存占用为6.09MB(约15倍压缩,相比FP32降低2.42个点),优于先前的三进制ViT方法多达8个点。最后,我们展示了在ESP32-S3系统芯片上的双核XTensa LX7微控制器上首次实现三进制视觉变换器。通过部署FTerViT-Small(基于224×224分辨率的DeiT-III-Small,内存占用5.81MB),我们实现了79.64%的ImageNet-1K Top-1精度。

英文摘要:

Ternary Vision Transformers offer substantial model compression, however state-of-the-art methods only ternarize the encoder layers, leaving patch embeddings, LayerNorm parameters, and classifier heads in full precision. In compact models targeting resource-constrained processors, such as microcontrollers, these remaining full-precision components determine the total memory footprint, severely limiting deployment efficiency and on-device feasibility. In this work, we introduce a fully ternarized Vision Transformer in which all weight matrices and normalization parameters are ternarized, while activations remain 8-bit (FTerViT). To this end, we introduce two novel operators: TernaryBitConv2d with per-channel scaling for patch embedding and TernaryLayerNorm. FTerViT is trained using knowledge distillation, followed by a lightweight quantization-aware recovery phase. On a matched DeiT-S backbone, FTerViT reaches 77.47% ImageNet-1K top-1 at 5.81 MB, +3.27 pp over TerViT. With the stronger DeiT-III-S backbone at 384x384 resolution, our ternary W2A8 model achieves 82.43% at 6.09 MB (~15x compression, -2.42 pp vs. FP32). This backbone- and resolution-advantaged result exceeds prior ternary ViTs by up to 8 pp. Finally, we demonstrate the first implementation of ternary vision transformers on a dual-core Xtensa LX7 microcontroller inside the ESP32-S3 system-on-chip. By deploying FTerViT-Small (based on DeiT-III-Small at 224x224 resolution, 5.81 MB), we achieve 79.64% ImageNet-1K top-1 accuracy.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑