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
AWS ML@Loft #11 「BASE」類似商品APIの裏側
Search
bokeneko
March 24, 2020
Technology
0
630
AWS ML@Loft #11 「BASE」類似商品APIの裏側
ML@Loft #11で発表したスライド
https://ml-loft.connpass.com/event/169623/
bokeneko
March 24, 2020
Tweet
Share
More Decks by bokeneko
See All by bokeneko
Terraformを用いた機械学習インフラの構築 / Developers Summit 2018 FUKUOKA A-8
bokeneko
0
460
Retty Tech Night #1 bokeneko
bokeneko
1
810
TechPlay DeepLearningAllStars2017
bokeneko
0
1.5k
TFUG#3 RettyにおけるDeep Learningの自然言語処理への応用事例
bokeneko
18
16k
Other Decks in Technology
See All in Technology
Autonomous Database Serverless 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
17
45k
Two Blades, One Journey: Engineering While Managing
ohbarye
4
2.2k
Apache Iceberg Case Study in LY Corporation
lycorptech_jp
PRO
0
340
AWSを活用したIoTにおけるセキュリティ対策のご紹介
kwskyk
0
400
役員・マネージャー・著者・エンジニアそれぞれの立場から見たAWS認定資格
nrinetcom
PRO
4
6.4k
大規模アジャイルフレームワークから学ぶエンジニアマネジメントの本質
staka121
PRO
3
1.3k
生成AI “再”入門 2025年春@WIRED TUESDAY EDITOR'S LOUNGE
kajikent
0
140
Fraxinus00tw assembly manual
fukumay
0
130
開発組織を進化させる!AWSで実践するチームトポロジー
iwamot
2
450
ExaDB-XSで利用されているExadata Exascaleについて
oracle4engineer
PRO
3
270
OPENLOGI Company Profile for engineer
hr01
1
20k
OCI Success Journey OCIの何が評価されてる?疑問に答える事例セミナー(2025年2月実施)
oracle4engineer
PRO
2
170
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
244
12k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Docker and Python
trallard
44
3.3k
How to train your dragon (web standard)
notwaldorf
91
5.9k
A Philosophy of Restraint
colly
203
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Transcript
© - BASE, Inc. 「BASE」類似商品APIの裏側 © - BASE, Inc.
© - BASE, Inc. ⾃⼰紹介 ⽒原 淳志 BASE株式会社 / Data
Strategy Team • データ分析、機械学習などを担当するチームに所属 • TensorFlow出たくらいからDeep Learningに⼿を出 したりしてた • 今は機械学習で作成されたモデルを実運⽤するため のインフラ設計とかが中⼼ • クラフトビール好き。会社でビール部主催中
© - BASE, Inc. ネットショップ作成サービス「BASE」 出店ショップ数 (個⼈‧法⼈‧⾏政を含む) 90万ショップ以上 BASEかんたん決済利⽤料 3.6%+40円
サービス利⽤料 % コンセプト 「誰でも簡単に使えるネットショップ作成サービス」 初期費⽤‧⽉額費⽤ 0円 ショップオーナーのサポート機能が充実! 個⼈でも決済機能をかんたん導⼊。 審査もスピーディー! クレジットカード 銀⾏振込 コンビニ決済‧Pay-easy 後払い (BASE Apps) キャリア決済
© - BASE, Inc. 関連商品 • BASEアプリで商品詳細ページの下 部にある • 表⽰中の商品に類似した商品が並ん
でいる • DSチームが提供している類似商品 APIで候補を選んでいる
© - BASE, Inc. アジェンダ • 類似商品APIの仕組み • 類似商品APIのインフラ‧運⽤
© - BASE, Inc. 類似商品APIの仕組み
© - BASE, Inc. 類似商品APIの仕組み • 画像、テキストの特徴量の近さを商品の類似度に採⽤ • 画像の特徴量 •
MobileNet • テキストの特徴量 • 以前はfastTextのdoc vector → 現在はfastText & SCDVに移⾏ • 近傍探索 • 以前はNGT → 現在はfaissに移⾏
© - BASE, Inc. MobileNet • Kerasにおいて(というか⼤抵のフレーム ワークで)ImageNetでの事前学習済みのモ デルが提供されている •
include_top=Falseで全結合層なしで使えば 1024次元の特徴量抽出モデルとして使える
© - BASE, Inc. fastText, SCDV • fastTextはFacebookがOSSで開発している単語の分散表現学習など できるツール。doc vectorも計算可(ただのword
vectorの平均っぽ い) • https://github.com/facebookresearch/fastText • SCDVはdoc vectorを計算するための⼿法 • https://dheeraj .github.io/SDV/ • この辺がくわしい • https://qiita.com/fufufukakaka/items/a a c
© - BASE, Inc. NGT • Yahoo! JAPANがOSSで開発している⾼次元 vectorの近傍探索ツール •
https://github.com/yahoojapan/NGT • 数百万個の1024次元ベクトルから数⼗msく らいで近傍を取ってこれる • (でもくっそメモリ⾷う)
© - BASE, Inc. faiss • FacebookがOSSで開発している⾼次元ベクトルの近傍探 索ツール • https://github.com/facebookresearch/faiss
• NGTと⽐べると • 圧縮のための仕組みとかが⽤意されていて便利 • 圧縮⼿法によっては事前の学習が必要 • 圧縮フル活⽤したらNGTに⽐べて必要なメモリを1/100 くらいまで減らせる • ドキュメントが充実してる(⼤事)
© - BASE, Inc. 関連商品APIのインフラ‧運⽤
© - BASE, Inc. 類似商品APIの運⽤ • 画像の特徴量は事前計算、テキストはオン デマンド • モデルの更新はdaily
• ECSを利⽤したマイクロサービスの組み合わ せでAPIを提供
© - BASE, Inc. 事前計算 DS AWS SNS SQS ECS
SageMaker 新規画像登録通知 特徴量計算 対象画像取得 特徴量の保存 S S
© - BASE, Inc. モデルの更新 DS AWS ECS Task Step
Functions faiss indexの作成 ECS 特徴量index Lambda 対象商品の取得 特徴量の取得 faiss indexの保存 ECSの再起動 Cloud Watch Rule RDS S
© - BASE, Inc. APIの提供 DS AWS ECS API Proxy
ECS 類似画像商品API ALB Internal ALB ECS 画像特徴量index ECS 類似テキスト商品API ECS テキスト特徴量index
© - BASE, Inc. Future Work • 今はファッションとそれ以外で画像とテキ ストの特徴量を使い分けているが、画像‧ テキストの特徴量を同時に扱う汎⽤的な商
品特徴量モデルを作成中 • この商品特徴量を類似商品以外にも⾃動カ テゴリ分類とかに利⽤したい
© - BASE, Inc. ご清聴ありがとうございました