Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
メルカリの写真検索を支えるバックエンド
Search
Hirofumi Nakagawa/中河 宏文
May 29, 2019
Programming
1.2k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
メルカリの写真検索を支えるバックエンド
Hirofumi Nakagawa/中河 宏文
May 29, 2019
More Decks by Hirofumi Nakagawa/中河 宏文
See All by Hirofumi Nakagawa/中河 宏文
IoTデバイスでMLモデルを動かす技術
hnakagawa
0
250
Kanazawa_AI.pdf
hnakagawa
0
240
メルカリ写真検索における Amazon EKS の活用事例と プロダクトにおけるEdgeAI technologyの展望
hnakagawa
4
9.3k
メルカリの写真検索を支えるバックエンド CCSE 2019 version
hnakagawa
0
400
メルカリ写真検索における Amazon EKS の活用事例
hnakagawa
6
30k
Mercari ML Platform
hnakagawa
1
18k
mlct.pdf
hnakagawa
2
2.1k
機械学習によるマーケット健全化施策を支える技術
hnakagawa
0
290
メルカリのマーケット健全化施策を支えるML基盤
hnakagawa
10
9.2k
Other Decks in Programming
See All in Programming
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.1k
iOSDCのペンライトを自動制御したい!
akkeylab
0
270
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
270
Agents on Rails - Rails at Scale 2026
irinanazarova
0
300
JRuby: Past, Present, and Future
headius
0
210
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
1
700
アクセシビリティから考える情報設計
high_g_engineer
0
430
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
330
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
4
400
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
270
速習iPhone Duo対応
yuukiw00w
2
910
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
160
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Un-Boring Meetings
codingconduct
0
430
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
440
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
750
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
30 Presentation Tips
portentint
PRO
1
410
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.8k
Transcript
1 Confidential - Do Not Share メルカリの写真検索を支えるバックエンド 大規模画像検索システムの裏側
2 Confidential - Do Not Share • 2017年7月入社 • 所属はSRE→今QからAI/MLチーム
• デバイスドライバ開発からフロントエン ド開発までやる何でも屋 • Twitter: hnakagawa14 GitHub: hnakagawa 中河 宏文(hnakagawa)
3 Confidential - Do Not Share 写真検索とは 所謂、画像検索機能 商品名を知らなくても画像から商 品を検索できる機能の事です
動画リンク: https://youtu.be/kTni8EvOCgI
4 Confidential - Do Not Share 基本的な写真検索の仕組み 1. Deep Neural
Networks (DNN)を使用して商品画像から特徴ベクトルを取 得 2. 取得した特徴ベクトルをApproximate Nearest Neighbor Index(ANN Index)に追加して画像indexを構築 3. 検索時には同じく商品画像からDNNを介して特徴量ベクトルを取得し、ANN Indexから検索 ◦ ANN Indexはオンメモリの物を使用しており、そのた めコンテナ化する為にシステム上の工夫が色々ある(後 述
5 Confidential - Do Not Share Architecture概要図
6 Confidential - Do Not Share ML Platform Lykeion 写真検索はLykeionと呼ばれる内製の
MLPlatform上に構築されており、以下の機 能はPlatform側の機能を使用している • Training/Serving custom resource definition controller • Container based pipeline • Serving/Training Image builder • Model repository
7 Confidential - Do Not Share Indexing architecture
8 Confidential - Do Not Share Creating training custom resource
9 Confidential - Do Not Share Creating training custom resource
• Training custom resourceをCronJobが作成 • CRD controllerがcustom resourceで設定された (YAMLベース)pipelineを実 行 • Batch単位としては Hourly,Daily,Montlyが存 在
10 Confidential - Do Not Share Download image
11 Confidential - Do Not Share Download image • Image
store(S3)上に存在する商品画像をダウンロード • 実はPipeline上もっとも時間がかかる工程 ◦ そのため商品画像をk8sのPersistent Volume(PV) に保存し一定期間キャッシュする事によって、再インデッ クスが必要な時には素早くPipelineを回せるようにして いる
12 Confidential - Do Not Share Upload assets
13 Confidential - Do Not Share Upload assets • ETL
Pipelineの成果物、写真検索では特徴ベクトルとANN indexを、 Model Repositoryと呼ばれるモデルストアにバージョン管理された状態で保 存します • Model RepositoryはGCS上に構築
14 Confidential - Do Not Share Batch Execution as Custom
Resource • 全てのbatch実行情報が CRD resourceとして k8s上に残る • batchの再実行を伴う障 害復旧作業が容易
15 Confidential - Do Not Share Serving アーキテクチャ
16 Confidential - Do Not Share Building container image
17 Confidential - Do Not Share Building container image •
Model RepositoryをImage Builderと呼ばれるdaemonが監視 • 新しいindexが追加されると自動でServingコンテナ・イメージをビルドし Container Registry(GCR)にプッシュ
18 Confidential - Do Not Share Create serving custom resource
19 Confidential - Do Not Share Create serving custom resource
• Image Builderはコンテ ナ・イメージをビルドしたあ と、Serving custom resourceを作成 • CRD controllerは custom resourceを元 にDeployment、 Service等のk8sリソース を作成しIndex Service をdeploy
20 Confidential - Do Not Share Service discovery
21 Confidential - Do Not Share Service discovery • 異なる期間・粒度のIndex
Service(Hourly, Daily, Monthly) を自動的に組 み合わせる • REST <-> Index Service間のプロトコルは gRPCを使用
22 Confidential - Do Not Share まとめ • メルカリの写真検索はAWSとGCPのマルチクラウドで構築されている ◦
Image storeにS3を使っているため ◦ k8sでインフラを抽象化する事によって、AWSとGCPの 差異を埋め各クラウド・プロバイダの良いとこ取りができ る • k8sの機能を活用し、ロバストなシステムを構築 ◦ Training/Serving CRD controller ◦ Batch Execution as Custom Resource ◦ Service discovery