SAM-Lightening: A Lightweight Segment Anything Model with Dilated Flash Attention to Achieve 30 times Acceleration

加速度 闪光灯(摄影) 计算机科学 模拟 计算机图形学(图像) 物理 艺术 视觉艺术 经典力学
作者
Yanfei Songa,Bangzheng Pu,Peng Wanga,Hongxu Jiang,Dong Dong,Cao, Yongxiang,Shen, Yiqing
出处
期刊:Cornell University - arXiv [Cornell University]
被引量:5
标识
DOI:10.48550/arxiv.2403.09195
摘要

Segment Anything Model (SAM) has garnered significant attention in segmentation tasks due to their zero-shot generalization ability. However, a broader application of SAMs to real-world practice has been restricted by their low inference speed and high computational memory demands, which mainly stem from the attention mechanism. Existing work concentrated on optimizing the encoder, yet has not adequately addressed the inefficiency of the attention mechanism itself, even when distilled to a smaller model, which thus leaves space for further improvement. In response, we introduce SAM-Lightening, a variant of SAM, that features a re-engineered attention mechanism, termed Dilated Flash Attention. It not only facilitates higher parallelism, enhancing processing efficiency but also retains compatibility with the existing FlashAttention. Correspondingly, we propose a progressive distillation to enable an efficient knowledge transfer from the vanilla SAM without costly training from scratch. Experiments on COCO and LVIS reveal that SAM-Lightening significantly outperforms the state-of-the-art methods in both run-time efficiency and segmentation accuracy. Specifically, it can achieve an inference speed of 7 milliseconds (ms) per image, for images of size 1024*1024 pixels, which is 30.1 times faster than the vanilla SAM and 2.1 times than the state-of-the-art. Moreover, it takes only 244MB memory, which is 3.5\% of the vanilla SAM. The code and weights are available at https://anonymous.4open.science/r/SAM-LIGHTENING-BC25/.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
1秒前
123发布了新的文献求助10
1秒前
无限绫完成签到,获得积分10
1秒前
李佳完成签到,获得积分10
1秒前
1秒前
Yang完成签到,获得积分10
2秒前
shixinaaaaa发布了新的文献求助10
2秒前
2秒前
scoringtitle发布了新的文献求助10
3秒前
3秒前
Lucas的应助被睡觉早点睡觉采纳,获得10
3秒前
3秒前
多多完成签到 ,获得积分10
3秒前
KKK给KKK的求助进行了留言
3秒前
汉堡包的应助被要减肥若烟采纳,获得10
3秒前
3秒前
拼搏的帽子完成签到 ,获得积分10
4秒前
JudeCHU发布了新的文献求助10
4秒前
ding的应助被chenzai采纳,获得10
4秒前
希望天下0贩的0的应助被cc采纳,获得10
4秒前
克莱茵蓝发布了新的文献求助10
4秒前
南巷完成签到,获得积分10
4秒前
早点睡觉丶完成签到,获得积分10
4秒前
1701完成签到,获得积分10
5秒前
Stars关注了科研通微信公众号
5秒前
5秒前
5秒前
gusgusgus发布了新的文献求助10
6秒前
秋叶完成签到,获得积分10
6秒前
6秒前
睡醒的庄周完成签到,获得积分10
6秒前
小马甲的应助被司徒呀采纳,获得10
6秒前
6秒前
热爱胃肠的小赖完成签到,获得积分10
7秒前
无心的哈密瓜完成签到,获得积分20
7秒前
浩浩发布了新的文献求助10
7秒前
7秒前
M_完成签到 ,获得积分10
7秒前
哈哈哈发布了新的文献求助10
7秒前
lcsw发布了新的文献求助10
7秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Energie-Contracting 1500
Spec 401: Standards for Jet Fuel Facility and Equipment Commissioning and Flushing at Airports, 2026.1 (Original Issue) 1000
Spec 103: Standard for Jet Fuel Quality Control at Airports, Revision 2026.1 1000
Mathematical models in hydrology 1000
Klimaschutzrecht durch den Energiesektor im Mehrebenensystem – Ein Rechtsvergleich 1000
Erzählte Gnade 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 计算机科学 工程类 有机化学 化学工程 生物化学 物理 复合材料 内科学 催化作用 光电子学 人工智能 细胞生物学 无机化学 物理化学 数学
热门帖子
关注 科研通微信公众号,转发送积分 8087553
求助须知:如何正确求助?哪些是违规求助? 9500931
关于积分的说明 21423155
捐赠科研通 7659131
什么是DOI,文献DOI怎么找? 3403787
关于科研通互助平台的介绍 2532446
邀请新用户注册赠送积分活动 2442121