TinySAM: Pushing the Envelope for Efficient Segment Anything Model

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Shu, Han, Li, Wenshuo, Tang, Yehui, Zhang, Yiman, Chen, Yihao, Li, Houqiang, Wang, Yunhe, Chen, Xinghao
Formato: Preprint
Publicado: 2023
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866915093915107328
author Shu, Han
Li, Wenshuo
Tang, Yehui
Zhang, Yiman
Chen, Yihao
Li, Houqiang
Wang, Yunhe
Chen, Xinghao
author_facet Shu, Han
Li, Wenshuo
Tang, Yehui
Zhang, Yiman
Chen, Yihao
Li, Houqiang
Wang, Yunhe
Chen, Xinghao
contents Recently segment anything model (SAM) has shown powerful segmentation capability and has drawn great attention in computer vision fields. Massive following works have developed various applications based on the pre-trained SAM and achieved impressive performance on downstream vision tasks. However, SAM consists of heavy architectures and requires massive computational capacity, which hinders the further application of SAM on computation constrained edge devices. To this end, in this paper we propose a framework to obtain a tiny segment anything model (TinySAM) while maintaining the strong zero-shot performance. We first propose a full-stage knowledge distillation method with hard prompt sampling and hard mask weighting strategy to distill a lightweight student model. We also adapt the post-training quantization to the prompt-based segmentation task and further reduce the computational cost. Moreover, a hierarchical segmenting everything strategy is proposed to accelerate the everything inference by $2\times$ with almost no performance degradation. With all these proposed methods, our TinySAM leads to orders of magnitude computational reduction and pushes the envelope for efficient segment anything task. Extensive experiments on various zero-shot transfer tasks demonstrate the significantly advantageous performance of our TinySAM against counterpart methods. Codes are available at https://github.com/xinghaochen/TinySAM and https://gitee.com/mindspore/models/tree/master/research/cv/TinySAM.
format Preprint
id arxiv_https___arxiv_org_abs_2312_13789
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle TinySAM: Pushing the Envelope for Efficient Segment Anything Model
Shu, Han
Li, Wenshuo
Tang, Yehui
Zhang, Yiman
Chen, Yihao
Li, Houqiang
Wang, Yunhe
Chen, Xinghao
Computer Vision and Pattern Recognition
Recently segment anything model (SAM) has shown powerful segmentation capability and has drawn great attention in computer vision fields. Massive following works have developed various applications based on the pre-trained SAM and achieved impressive performance on downstream vision tasks. However, SAM consists of heavy architectures and requires massive computational capacity, which hinders the further application of SAM on computation constrained edge devices. To this end, in this paper we propose a framework to obtain a tiny segment anything model (TinySAM) while maintaining the strong zero-shot performance. We first propose a full-stage knowledge distillation method with hard prompt sampling and hard mask weighting strategy to distill a lightweight student model. We also adapt the post-training quantization to the prompt-based segmentation task and further reduce the computational cost. Moreover, a hierarchical segmenting everything strategy is proposed to accelerate the everything inference by $2\times$ with almost no performance degradation. With all these proposed methods, our TinySAM leads to orders of magnitude computational reduction and pushes the envelope for efficient segment anything task. Extensive experiments on various zero-shot transfer tasks demonstrate the significantly advantageous performance of our TinySAM against counterpart methods. Codes are available at https://github.com/xinghaochen/TinySAM and https://gitee.com/mindspore/models/tree/master/research/cv/TinySAM.
title TinySAM: Pushing the Envelope for Efficient Segment Anything Model
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2312.13789