Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[Journal club] Mobile-Former: Bridging MobileNe...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Semantic Machine Intelligence Lab., Keio Univ.
PRO
July 27, 2022
Technology
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[Journal club] Mobile-Former: Bridging MobileNet and Transformer
Semantic Machine Intelligence Lab., Keio Univ.
PRO
July 27, 2022
More Decks by Semantic Machine Intelligence Lab., Keio Univ.
See All by Semantic Machine Intelligence Lab., Keio Univ.
[RSJ26] Building a VLA Model Based on Self-Distilled Classification
keio_smilab
PRO
0
190
[RSJ26] AnoleVLA: Lightweight Vision-Language-Action Model with Deep State Space Models for Mobile Manipulation
keio_smilab
PRO
0
120
[RSJ26] NarrativeFlow: Flow-Based Vision-Language-Action Model Using Robot Velocity Fields
keio_smilab
PRO
0
150
[RSJ26] Flow as Flow: Modeling Robot Velocity Fields as Probability Velocity Fields
keio_smilab
PRO
0
190
[RSJ26] Hierarchy-Aware Multimodal Retrieval-Augmented Generation for Embodied Question Answering
keio_smilab
PRO
1
170
[MIRU26] Open-Vocabulary Intention-Guided Object Detection in Diverse Scenes
keio_smilab
PRO
0
190
[Journal club] Evo-1: Lightweight Vision-Language-Action Model with Preserved Semantic Alignment
keio_smilab
PRO
0
48
[MIRU26] To What Extent Does MLLM-as-a-Judge Exhibit Cross-Model Preference Bias?
keio_smilab
PRO
0
280
[Journal club] FlashVID: Efficient Video Large Language Models via Training-free Tree-based Spatiotemporal Token Merging
keio_smilab
PRO
0
36
Other Decks in Technology
See All in Technology
ブラウザアプリの継続的パフォーマンスモニタリング (序) / Continuous Browser Application Performance Monitoring; Act 1
moznion
0
100
Point Cloud as a Foreign Language for Multi-modal Large Language Model
takmin
0
370
Hub & Spoke 環境のネットワークルーティングを分解してみる
tsuyataku
1
520
20260903 Tokyo Jazug Night #62 | Azure エンジニアよ、 その環境は本当にセキュアか?
olivia_0707
1
610
V8コントリビュート超入門
riyaamemiya
0
130
Jetpack Compose で挑む新聞紙面UI ─ 複合ジェスチャー・ポリゴン記事領域・適応的ページ構成という3つの壁/droidkaigi2026
nikkei_engineer_recruiting
0
170
Genie Code ワークショップ 応用編 / Genie-Code-Workshop-advanced
databricksjapan
PRO
0
300
AIエージェントを雇う前に決める5つのこと
knishioka
1
150
PM領域でのAI Agentの活用
lycorptech_jp
PRO
0
260
Does an AI Watermark Survive Translation?
machinetranslation
0
520
書籍『生成AIの安全性入門』の入門
wataoka
0
200
本番に近いテストをもっと手軽に - Postmanで広がるAPIテストの世界 / Expanding the World of API Testing with Postman
yokawasa
1
240
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
490
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
180
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Product Roadmaps are Hard
iamctodd
55
13k
YesSQL, Process and Tooling at Scale
rocio
174
15k
How GitHub (no longer) Works
holman
316
150k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Into the Great Unknown - MozCon
thekraken
41
2.7k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Transcript
慶應義塾大学 杉浦孔明研究室 是方諒介 Mobile-Former: Bridging MobileNet and Transformer Yinpeng Chen1,
Xiyang Dai1, Dongdong Chen1, Mengchen Liu1, Xiaoyi Dong2, Lu Yuan1, Zicheng Liu1 (1Microsoft, 2University of Science and Technology of China) CVPR 2022 Yinpeng Chen, Xiyang Dai, Dongdong Chen, Mengchen Liu, Xiaoyi Dong, Lu Yuan, and Zicheng Liu. "Mobile-Former: Bridging MobileNet and Transformer." CVPR 2022.
目標 ◼ 画像認識モデルを実世界アプリに組込む 課題 ◼ エッジデバイスでは、処理能力/実行時間に限界 ◼ 計算力をサーバに頼ると、個人情報やセキュリティ面で懸念 解決策 ◼
軽量かつ(ある程度)高性能なモデルの確立 背景:低計算コストかつ高精度の画像認識モデルの需要 2
関連研究:計算量/性能面で改善の余地 3 Model Detail MobileNetV1, V2, V3 [Howard+ 17], [Sandler+
18], [Howard+ ICCV19] ・携帯電話での利用を想定した軽量CNNモデル ・convolutionをdepthwiseとpointwiseに分割 ViT [Dosovitskiy+ ICLR21] ・transformer [Vaswani+ NeurIPS17] を画像分類に応用 CvT [Wu+ ICCV21] ・multi-head attentionの前にconvolutionを導入 CvT ① CNN ② transformer ③ CNN & transformer ViT
提案手法:Mobile-Former ◼ MobileNetとtransformerを、 並列かつ双方向に接続 ◼ CNNのlocalな特徴量と、 transformerのglobalな特徴量を融合 ◼ Mobile-Former Blockを𝑁段積む構造
◼ 4種のsub-blockから成る 4 𝑁 = 11段程度
モデル全体の入出力:画像と学習可能なトークン → 分類ラベル ◼ 入力 ① 𝑿 ∈ ℝ𝐻𝑊×3:画像 ②
𝒁 ∈ ℝ𝑀×𝑑:学習可能なトークン ◼ ランダムに初期化 ◼ 出力 ◼ 𝑿, 𝒁をconcatしてFC層× 2 ◼ 活性化関数はh-swish [Howard+ ICCV19] 5 𝐻:高さ 𝑊:幅 𝑀 (≤ 6):トークン数 𝑑:トークンの次元 𝑀の小ささが対ViT 計算コスト減の要因 3 × 3 convolution層
Mobile-Former Blockの入出力:local, globalな特徴量 6 Mobile-Former Block ◼ 入力 ① 𝑿
∈ ℝ𝐻𝑊×𝐶:localな特徴量 ② 𝒁 ∈ ℝ𝑀×𝑑:globalな特徴量 ◼ 出力 ①,② 更新された 𝑿′, 𝒁′ ◼ 次のMobile-Former Blockの入力 𝑀(≤ 6):トークン数 𝑑:トークンの次元 Block間で可変 Block間で不変 𝐻:高さ 𝑊:幅 𝐶:チャンネル数
Mobile sub-block:MobileNetV2 +α 7 Mobile-Former Block ◼ MobileNetV2のinverted bottleneckに類似 ◼
3 × 3のDepthwise Convolutionを、 Pointwise Convolutionで挟む ◼ Dynamic ReLU [Chen+ ECCV20] に変更 ◼ 最初の出力トークン𝑧1 ′を、FC層× 2で𝜃に変換 v 計算コスト削減に寄与 MobileNetV2との相違点 𝜃に応じて傾きが変化
Former sub-block:標準的なtransformerブロック 8 Mobile-Former Block ◼ Multi-Head Attentionおよび、 Feed Forward
Networkから構成 参考:transformerのアーキテクチャ post layer normalization
Mobile → Former:localな特徴量をglobalな特徴量へ融合 9 Mobile-Former Block ◼ 以下の式で特徴量を融合 ◼ 内部では、𝑿,
𝒁をℎ個のheadに分割 𝒁𝑜𝑢𝑡 = 𝒁 + Attn( 𝒛𝑖 𝑾 𝑖 𝑄, 𝒙𝑖 , 𝒙𝑖 ) 𝑖=1:ℎ 𝑾𝑂 𝑿 = 𝒙1 , … , 𝒙ℎ 𝒁 = 𝒛1 , … , 𝒛ℎ 𝒛𝑖 ∈ ℝ𝑀× 𝑑 ℎ 𝑾 𝑖 𝑄:𝑖 head目のQuery行列 𝑾𝑂:headsを結合する行列 ⋅ 1:ℎ :ℎ要素をconcat Attn 𝑄, 𝐾, 𝑉 = softmax 𝑄𝐾𝑇 𝑑𝑘 𝑉 Query, Key, Value 𝑾𝑖 𝐾, 𝑾𝑖 𝑉 がMobile側から 除かれており軽量
◼ 以下の式で特徴量を融合 ◼ 内部では、𝑿, 𝒁をℎ個のheadに分割 Mobile ← Former:globalな特徴量をlocalな特徴量へ融合 10 Mobile-Former
Block 𝑿𝑜𝑢𝑡 = 𝑿 + Attn( 𝒙𝑖 , 𝒛𝑖 𝑾𝑖 𝐾, 𝒛𝑖 𝑾𝑖 𝑉) 𝑖=1:ℎ 𝑿 = 𝒙1 , … , 𝒙ℎ 𝒁 = 𝒛1 , … , 𝒛ℎ 𝒛𝑖 ∈ ℝ𝑀× 𝑑 ℎ 𝑾𝑖 𝐾:𝑖 head目のKey行列 𝑾𝑖 𝑉:𝑖 head目のValue行列 ⋅ 1:ℎ :ℎ要素をconcat Attn 𝑄, 𝐾, 𝑉 = softmax 𝑄𝐾𝑇 𝑑𝑘 𝑉 Query, Key, Value 𝑾 𝑖 𝑄 がMobile側から 除かれており軽量
◼ 実験:ImageNet [Deng+ CVPR09] における画像分類 ◼ 計算コストが近いモデル同士で比較 定量的結果:対CNN/ViTともに計算コスト/性能で優位 11 Multiply-Adds:計算コストの指標
Model #Params↓ MAdds↓ Top-1↑ ShuffleNetV2 1.5× [Ma+ ECCV18] 3.5M 299M 72.6 MobileNetV3 1.25× [Howard+ ICCV19] 7.5M 356M 76.6 ViTC [Xiao+ NeurIPS21] 4.6M 1.1G 75.3 ConT-S [Yan+ CoRR21] 10.1M 1.5G 76.5 Mobile-Former-294M 11.4M 294M 77.9 CNN ViT
追試およびエラー分析(定性的結果):小さな類似物体の認識が課題 12 ◼ 類似の発展手法:MobileViT [Mehta+ ICLR22] ◼ データセット:花の5クラス画像分類(tf_flowers) ◼ 改善案:localな特徴量をより重視するため、CNNの寄与を向上
https://huggingface.co/spaces/keras-io/Flowers-Classification-MobileViT 予測:“sunflower” 正解:“dandelion” “rose” “tulip”
まとめ 背景 ✓ 低計算コストかつ高精度の画像認識モデルの需要 提案 ✓ MobileNet/transformerを、並列かつ双方向に接続 ✓ local, globalな特徴量を融合
結果 ✓ 低計算コスト条件下で、他のViT/CNNモデルを凌駕 13
Appendix:実験設定 ◼ データセット:ImageNet ◼ 1000クラス分類 ◼ 224 × 224画像 実験1:対主要なCNNモデル
◼ MAddsについて26M~508Mのグループに区切り、近いもの同士で比較 実験2:対主要なViT派生モデル ◼ 蒸留なしで比較 14
Appendix:定量的結果 +α ◼ 考察 ✓ 25M~500M M-Addsの範囲で、Mobile-Formerが最高性能 ✓ 低計算コスト下であっても、適切なアーキテクチャで組込めばtransformerは有効 15
Appendix:トークンの𝑀, 𝑑に関するAblation Study ◼ 考察 ✓ 𝑀は6でTop-1頭打ち ✓ 𝑑は192でTop1頭打ち 16
𝑑 = 192のMobile-Former-294Mで比較 𝑀 = 6のMobile-Former-294Mで比較
Appendix:Mobile-Former-294Mのアーキテクチャ詳細 17 𝑀 = 6, 𝑑 = 192, 224 ×
224画像入力の場合
Appendix:h-swish ◼ MobileNetV3で提案された活性化関数 ◼ swishを区分線形関数の積で近似 ◼ 軽量化の工夫の一つ ◼ ReLU6は、重みが最大でも6のReLU 18
h-swish(𝑥) = 𝑥 ReLU6(𝑥+3) 6 ReLU6(𝑥) = min(max 𝑥, 0 , 6) https://qiita.com/Nezura/items/741e766d14f43c0afb4f swish 𝑥 = 𝑥 ⋅ 𝜎(𝑥) 𝜎(⋅):シグモイド関数 形状の比較
Appendix:Mobile-Former Blockの計算順序 19 Mobile-Former Block ◼ 入出力の関係から、この順序以外不可能 1 2 3
4 実装もこの順序 https://github.com/ACheun9/Pytorch-implementation-of-Mobile-Former/blob/main/model.py
Appendix:物体検出にも応用可能 ◼ backboneとheadの両方にMobile-Formerを適用 ◼ end-to-endなモデルを実現 ◼ 考察 ✓ DETR [Carion+
ECCV20] より、 AP/MAdds/パラメータ数の全てで優位 20 Mobile-Former for object detection COCO [Lin+ ECCV14] において比較 Model AP↑ MAdds↓ #Params↓ DETR [Carion+ ECCV20] 42.0 86G 41.3M E2E-MF-508M (Ours) 43.1 41.4G 26.6M
Appendix:MobileViT ◼ Mobile-Formerと同じくCNN/transformerを組合わせた軽量モデル ◼ CNN/transformerをMobileViT blockで結合 ◼ 考察 ✓ 少パラメータ条件下でMobile-Formerを凌駕
21