Faster Segment Anything: Towards Lightweight SAM for Mobile Applications
Segment Anything Model (SAM) has attracted significant attention due to its impressive zero-shot transfer performance and high versatility for numerous vision applications (like image editing with fine-grained control). Many of such applications need to be run on resource-constraint edge devices, li...
Gespeichert in:
Veröffentlicht in: | arXiv.org 2023-07 |
---|---|
Hauptverfasser: | , , , , , , |
Format: | Artikel |
Sprache: | eng |
Schlagworte: | |
Online-Zugang: | Volltext |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
container_end_page | |
---|---|
container_issue | |
container_start_page | |
container_title | arXiv.org |
container_volume | |
creator | Zhang, Chaoning Han, Dongshen Yu, Qiao Kim, Jung Uk Sung-Ho, Bae Lee, Seungkyu Hong, Choong Seon |
description | Segment Anything Model (SAM) has attracted significant attention due to its impressive zero-shot transfer performance and high versatility for numerous vision applications (like image editing with fine-grained control). Many of such applications need to be run on resource-constraint edge devices, like mobile phones. In this work, we aim to make SAM mobile-friendly by replacing the heavyweight image encoder with a lightweight one. A naive way to train such a new SAM as in the original SAM paper leads to unsatisfactory performance, especially when limited training sources are available. We find that this is mainly caused by the coupled optimization of the image encoder and mask decoder, motivated by which we propose decoupled distillation. Concretely, we distill the knowledge from the heavy image encoder (ViT-H in the original SAM) to a lightweight image encoder, which can be automatically compatible with the mask decoder in the original SAM. The training can be completed on a single GPU within less than one day, and the resulting lightweight SAM is termed MobileSAM which is more than 60 times smaller yet performs on par with the original SAM. For inference speed, With a single GPU, MobileSAM runs around 10ms per image: 8ms on the image encoder and 4ms on the mask decoder. With superior performance, our MobileSAM is around 5 times faster than the concurrent FastSAM and 7 times smaller, making it more suitable for mobile applications. Moreover, we show that MobileSAM can run relatively smoothly on CPU. The code for our project is provided at \href{https://github.com/ChaoningZhang/MobileSAM}{\textcolor{red}{MobileSAM}}), with a demo showing that MobileSAM can run relatively smoothly on CPU. |
format | Article |
fullrecord | <record><control><sourceid>proquest</sourceid><recordid>TN_cdi_proquest_journals_2829976923</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>2829976923</sourcerecordid><originalsourceid>FETCH-proquest_journals_28299769233</originalsourceid><addsrcrecordid>eNpjYuA0MjY21LUwMTLiYOAtLs4yMDAwMjM3MjU15mTwcEssLkktUghOTc9NzStRcMyrLMnIzEu3UgjJL08sSilW8MlMzygpTwWRCsGOvgpp-UUKvvlJmTmpCo4FBTmZyYklmfl5xTwMrGmJOcWpvFCam0HZzTXE2UO3oCi_sDS1uCQ-K7-0KA8oFW9kYWRpaW5mCXQWcaoAEBM7vg</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>2829976923</pqid></control><display><type>article</type><title>Faster Segment Anything: Towards Lightweight SAM for Mobile Applications</title><source>Free E- Journals</source><creator>Zhang, Chaoning ; Han, Dongshen ; Yu, Qiao ; Kim, Jung Uk ; Sung-Ho, Bae ; Lee, Seungkyu ; Hong, Choong Seon</creator><creatorcontrib>Zhang, Chaoning ; Han, Dongshen ; Yu, Qiao ; Kim, Jung Uk ; Sung-Ho, Bae ; Lee, Seungkyu ; Hong, Choong Seon</creatorcontrib><description>Segment Anything Model (SAM) has attracted significant attention due to its impressive zero-shot transfer performance and high versatility for numerous vision applications (like image editing with fine-grained control). Many of such applications need to be run on resource-constraint edge devices, like mobile phones. In this work, we aim to make SAM mobile-friendly by replacing the heavyweight image encoder with a lightweight one. A naive way to train such a new SAM as in the original SAM paper leads to unsatisfactory performance, especially when limited training sources are available. We find that this is mainly caused by the coupled optimization of the image encoder and mask decoder, motivated by which we propose decoupled distillation. Concretely, we distill the knowledge from the heavy image encoder (ViT-H in the original SAM) to a lightweight image encoder, which can be automatically compatible with the mask decoder in the original SAM. The training can be completed on a single GPU within less than one day, and the resulting lightweight SAM is termed MobileSAM which is more than 60 times smaller yet performs on par with the original SAM. For inference speed, With a single GPU, MobileSAM runs around 10ms per image: 8ms on the image encoder and 4ms on the mask decoder. With superior performance, our MobileSAM is around 5 times faster than the concurrent FastSAM and 7 times smaller, making it more suitable for mobile applications. Moreover, we show that MobileSAM can run relatively smoothly on CPU. The code for our project is provided at \href{https://github.com/ChaoningZhang/MobileSAM}{\textcolor{red}{MobileSAM}}), with a demo showing that MobileSAM can run relatively smoothly on CPU.</description><identifier>EISSN: 2331-8422</identifier><language>eng</language><publisher>Ithaca: Cornell University Library, arXiv.org</publisher><subject>Applications programs ; Coders ; Distillation ; Lightweight ; Mobile computing ; Optimization ; Segments ; Training ; Versatility</subject><ispartof>arXiv.org, 2023-07</ispartof><rights>2023. This work is published under http://creativecommons.org/licenses/by-nc-sa/4.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>780,784</link.rule.ids></links><search><creatorcontrib>Zhang, Chaoning</creatorcontrib><creatorcontrib>Han, Dongshen</creatorcontrib><creatorcontrib>Yu, Qiao</creatorcontrib><creatorcontrib>Kim, Jung Uk</creatorcontrib><creatorcontrib>Sung-Ho, Bae</creatorcontrib><creatorcontrib>Lee, Seungkyu</creatorcontrib><creatorcontrib>Hong, Choong Seon</creatorcontrib><title>Faster Segment Anything: Towards Lightweight SAM for Mobile Applications</title><title>arXiv.org</title><description>Segment Anything Model (SAM) has attracted significant attention due to its impressive zero-shot transfer performance and high versatility for numerous vision applications (like image editing with fine-grained control). Many of such applications need to be run on resource-constraint edge devices, like mobile phones. In this work, we aim to make SAM mobile-friendly by replacing the heavyweight image encoder with a lightweight one. A naive way to train such a new SAM as in the original SAM paper leads to unsatisfactory performance, especially when limited training sources are available. We find that this is mainly caused by the coupled optimization of the image encoder and mask decoder, motivated by which we propose decoupled distillation. Concretely, we distill the knowledge from the heavy image encoder (ViT-H in the original SAM) to a lightweight image encoder, which can be automatically compatible with the mask decoder in the original SAM. The training can be completed on a single GPU within less than one day, and the resulting lightweight SAM is termed MobileSAM which is more than 60 times smaller yet performs on par with the original SAM. For inference speed, With a single GPU, MobileSAM runs around 10ms per image: 8ms on the image encoder and 4ms on the mask decoder. With superior performance, our MobileSAM is around 5 times faster than the concurrent FastSAM and 7 times smaller, making it more suitable for mobile applications. Moreover, we show that MobileSAM can run relatively smoothly on CPU. The code for our project is provided at \href{https://github.com/ChaoningZhang/MobileSAM}{\textcolor{red}{MobileSAM}}), with a demo showing that MobileSAM can run relatively smoothly on CPU.</description><subject>Applications programs</subject><subject>Coders</subject><subject>Distillation</subject><subject>Lightweight</subject><subject>Mobile computing</subject><subject>Optimization</subject><subject>Segments</subject><subject>Training</subject><subject>Versatility</subject><issn>2331-8422</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2023</creationdate><recordtype>article</recordtype><sourceid>ABUWG</sourceid><sourceid>AFKRA</sourceid><sourceid>AZQEC</sourceid><sourceid>BENPR</sourceid><sourceid>CCPQU</sourceid><sourceid>DWQXO</sourceid><recordid>eNpjYuA0MjY21LUwMTLiYOAtLs4yMDAwMjM3MjU15mTwcEssLkktUghOTc9NzStRcMyrLMnIzEu3UgjJL08sSilW8MlMzygpTwWRCsGOvgpp-UUKvvlJmTmpCo4FBTmZyYklmfl5xTwMrGmJOcWpvFCam0HZzTXE2UO3oCi_sDS1uCQ-K7-0KA8oFW9kYWRpaW5mCXQWcaoAEBM7vg</recordid><startdate>20230701</startdate><enddate>20230701</enddate><creator>Zhang, Chaoning</creator><creator>Han, Dongshen</creator><creator>Yu, Qiao</creator><creator>Kim, Jung Uk</creator><creator>Sung-Ho, Bae</creator><creator>Lee, Seungkyu</creator><creator>Hong, Choong Seon</creator><general>Cornell University Library, arXiv.org</general><scope>8FE</scope><scope>8FG</scope><scope>ABJCF</scope><scope>ABUWG</scope><scope>AFKRA</scope><scope>AZQEC</scope><scope>BENPR</scope><scope>BGLVJ</scope><scope>CCPQU</scope><scope>DWQXO</scope><scope>HCIFZ</scope><scope>L6V</scope><scope>M7S</scope><scope>PIMPY</scope><scope>PQEST</scope><scope>PQQKQ</scope><scope>PQUKI</scope><scope>PRINS</scope><scope>PTHSS</scope></search><sort><creationdate>20230701</creationdate><title>Faster Segment Anything: Towards Lightweight SAM for Mobile Applications</title><author>Zhang, Chaoning ; Han, Dongshen ; Yu, Qiao ; Kim, Jung Uk ; Sung-Ho, Bae ; Lee, Seungkyu ; Hong, Choong Seon</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-proquest_journals_28299769233</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2023</creationdate><topic>Applications programs</topic><topic>Coders</topic><topic>Distillation</topic><topic>Lightweight</topic><topic>Mobile computing</topic><topic>Optimization</topic><topic>Segments</topic><topic>Training</topic><topic>Versatility</topic><toplevel>online_resources</toplevel><creatorcontrib>Zhang, Chaoning</creatorcontrib><creatorcontrib>Han, Dongshen</creatorcontrib><creatorcontrib>Yu, Qiao</creatorcontrib><creatorcontrib>Kim, Jung Uk</creatorcontrib><creatorcontrib>Sung-Ho, Bae</creatorcontrib><creatorcontrib>Lee, Seungkyu</creatorcontrib><creatorcontrib>Hong, Choong Seon</creatorcontrib><collection>ProQuest SciTech Collection</collection><collection>ProQuest Technology Collection</collection><collection>Materials Science & Engineering Collection</collection><collection>ProQuest Central (Alumni Edition)</collection><collection>ProQuest Central UK/Ireland</collection><collection>ProQuest Central Essentials</collection><collection>ProQuest Central</collection><collection>Technology Collection (ProQuest)</collection><collection>ProQuest One Community College</collection><collection>ProQuest Central Korea</collection><collection>SciTech Premium Collection</collection><collection>ProQuest Engineering Collection</collection><collection>Engineering Database</collection><collection>Publicly Available Content Database</collection><collection>ProQuest One Academic Eastern Edition (DO NOT USE)</collection><collection>ProQuest One Academic</collection><collection>ProQuest One Academic UKI Edition</collection><collection>ProQuest Central China</collection><collection>Engineering Collection</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Zhang, Chaoning</au><au>Han, Dongshen</au><au>Yu, Qiao</au><au>Kim, Jung Uk</au><au>Sung-Ho, Bae</au><au>Lee, Seungkyu</au><au>Hong, Choong Seon</au><format>book</format><genre>document</genre><ristype>GEN</ristype><atitle>Faster Segment Anything: Towards Lightweight SAM for Mobile Applications</atitle><jtitle>arXiv.org</jtitle><date>2023-07-01</date><risdate>2023</risdate><eissn>2331-8422</eissn><abstract>Segment Anything Model (SAM) has attracted significant attention due to its impressive zero-shot transfer performance and high versatility for numerous vision applications (like image editing with fine-grained control). Many of such applications need to be run on resource-constraint edge devices, like mobile phones. In this work, we aim to make SAM mobile-friendly by replacing the heavyweight image encoder with a lightweight one. A naive way to train such a new SAM as in the original SAM paper leads to unsatisfactory performance, especially when limited training sources are available. We find that this is mainly caused by the coupled optimization of the image encoder and mask decoder, motivated by which we propose decoupled distillation. Concretely, we distill the knowledge from the heavy image encoder (ViT-H in the original SAM) to a lightweight image encoder, which can be automatically compatible with the mask decoder in the original SAM. The training can be completed on a single GPU within less than one day, and the resulting lightweight SAM is termed MobileSAM which is more than 60 times smaller yet performs on par with the original SAM. For inference speed, With a single GPU, MobileSAM runs around 10ms per image: 8ms on the image encoder and 4ms on the mask decoder. With superior performance, our MobileSAM is around 5 times faster than the concurrent FastSAM and 7 times smaller, making it more suitable for mobile applications. Moreover, we show that MobileSAM can run relatively smoothly on CPU. The code for our project is provided at \href{https://github.com/ChaoningZhang/MobileSAM}{\textcolor{red}{MobileSAM}}), with a demo showing that MobileSAM can run relatively smoothly on CPU.</abstract><cop>Ithaca</cop><pub>Cornell University Library, arXiv.org</pub><oa>free_for_read</oa></addata></record> |
fulltext | fulltext |
identifier | EISSN: 2331-8422 |
ispartof | arXiv.org, 2023-07 |
issn | 2331-8422 |
language | eng |
recordid | cdi_proquest_journals_2829976923 |
source | Free E- Journals |
subjects | Applications programs Coders Distillation Lightweight Mobile computing Optimization Segments Training Versatility |
title | Faster Segment Anything: Towards Lightweight SAM for Mobile Applications |
url | https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-13T18%3A19%3A37IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest&rft_val_fmt=info:ofi/fmt:kev:mtx:book&rft.genre=document&rft.atitle=Faster%20Segment%20Anything:%20Towards%20Lightweight%20SAM%20for%20Mobile%20Applications&rft.jtitle=arXiv.org&rft.au=Zhang,%20Chaoning&rft.date=2023-07-01&rft.eissn=2331-8422&rft_id=info:doi/&rft_dat=%3Cproquest%3E2829976923%3C/proquest%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_pqid=2829976923&rft_id=info:pmid/&rfr_iscdi=true |