Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BIT VALLEY 2020 数千人規模の顔認証受付サービス、一ヶ月で構築できますか?

kazuya iwami
September 10, 2020

BIT VALLEY 2020 数千人規模の顔認証受付サービス、一ヶ月で構築できますか?

BIT VALLEY 2020にて登壇させて頂いた際の資料です。

2020年1月、AWSは顔認証受付サービスを1clickで構築できるテンプレートを公開しました。実はこの仕組みは2018年にAWS Japanに新卒入社したエンジニアが立ち上げたプロジェクトが元になっています。本セッションではその裏話を中心に、サーバレス・AIサービスといったテクノロジーの登場により、サービスの構築・運用がどのように変化していくのかをご紹介します。

kazuya iwami

September 10, 2020
Tweet

More Decks by kazuya iwami

Other Decks in Technology

Transcript

  1. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 数千人規模の顔認証受付サービス、 一ヶ月で構築できますか? Amazon Web Services Japan Kazuya Iwami 2020 / 9 / 10 1 BIT VALLEY 2020
  2. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 石見 和也 - Iwami Kazuya • Amazon Web Services Japan Internet Media Solution Architect • 2018年に第一期の新卒SAとして入社 • 大学時代は3次元画像処理周りの研究や Androidアプリ・自動飛行ドローンなどの開発 • 好きなAWSサービス • Amazon SageMaker • AWS Fargate AWSをご利用のWeb系のお客様のエンジニアやCTOと、 ベストなシステム設計を一緒に考える仕事
  3. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. その話は突然に、、 • 1ヶ月後にある Amazon/AWS 合同社内イベントについての相談 • イベントに参加する人に Wow! と思ってもらえるような体験を提供したい • 「このプロジェクト、興味ありますか?」 • 顔認証受付システムを構築し、数千人の社員に体験してもらうことに
  4. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 数千人規模の顔認証受付サービス、一ヶ月で構築できますか? イベントまで 1ヶ月というスケジュール感 厳しいセキュリティ基準 開発・運用に割けるリソース も限られている Amazonのセキュリティレビュー を通過する必要あり 数千人をさばける構成とはどのようなものか? 顔認証部分は自前で作る? その場合学習データと機械学習のモデルはどうする? そもそも十分な精度出る?API化どうする? そもそもデバイスの用意や当日のオペレーションは? 実施する度に裏で手動でリソースを立ち上げたくない
  5. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. これはきっちりと設計方針を立てようという話に 当時も色々悩んだが、 スケジュール感が決まっている中で最終的に出てきた大きな設計方針は2つ • 出来るだけサーバレスサービスに寄せてスケーラビリティ・セキュリティ面 の考慮や開発・運用の手間を減らす • 使える部分はAIサービスを活用することで、精度面の不安と実装工数の 不安も解消(即座に検証して精度面を確認する) ここからは、サーバレス・AIサービスとはどのようなものなのか、 具体的にどのような構成で構築したのかをご紹介します
  6. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. © 2019, Amazon Web Services, Inc. or its Affiliates. サーバーレスとは?
  7. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. サーバーレス とは? サーバーがない? サーバーの存在を意識しない
  8. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. サーバーレス とは? サーバーがない? サーバーの存在を意識しない • ユーザーコントロール可能なサーバーを前提としない • サーバーはAWSが裏側で管理して、ユーザーには抽象化したリソースとして提供
  9. © 2019, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 仮想サーバー利⽤時の構成の⼀例 ALB Amazon RDS AWS Cloud Browser/ mobile EC2 EC2 WEB サーバー アプリケーション サーバー DB ロード バランサ ロード バランサ ALB HTTPS
  10. © 2019, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. サーバーレスなアプリケーションモデル Amazon API Gateway AWS Lambda AWS Cloud Browser/ mobile DB WEB層 アプリケーション ロジック層 Amazon DynamoDB 処理ロジック データ管理 REST API
  11. © 2019, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. サーバーレスなアプリケーションモデル Amazon API Gateway AWS Lambda AWS Cloud Browser/ mobile DB WEB層 アプリケーション ロジック層 Amazon DynamoDB 処理ロジック データ管理 REST API
  12. © 2019, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. サーバーレスなアプリケーションモデル Amazon API Gateway AWS Lambda AWS Cloud Browser/ mobile DB WEB層 アプリケーション ロジック層 Amazon DynamoDB 処理ロジック データ管理 REST API
  13. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWSが管理するもの: お客様が管理するべきもの: • 物理的なハードウェア • データセンターの管理 • リソースの拡大縮小 • OS・ミドルウェアの導入 • OSのパッチ当て • サーバーの管理 • アプリケーションコード • 物理的なハードウェア • データセンターの管理 仮想サーバー vs サーバレス AWS Lambda サーバーレスファンクション Amazon EC2 仮想サーバー Less More カバー範囲 • アプリケーションコード • リソースの拡大縮小 • OS・ミドルウェアの導入 • OSのパッチ当て • サーバーの管理 コントローラブル 開発・運用が楽
  14. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. © 2019, Amazon Web Services, Inc. or its Affiliates. AIサービスとは?
  15. © 2020, Amazon Web Services, Inc. or its Affiliates. VISION

    SPEECH TEXT SEARCH NEW CHATBOTS PERSONALIZATION FORECASTING FRAUD NEW DEVELOPMENT NEW CONTACT CENTERS NEW Amazon SageMaker Ground Truth Augmented AI SageMaker Neo Built-in algorithms SageMaker Notebooks NEW SageMaker Experiments NEW Model tuning SageMaker Debugger NEW SageMaker Autopilot NEW Model hosting SageMaker Model Monitor NEW Deep Learning AMIs & Containers GPUs & CPUs Elastic Inference Inferentia FPGA Amazon Polly Amazon Transcribe Amazon Comprehend Amazon Translate Amazon Lex Amazon Personalize Amazon Forecast Amazon Fraud Detector Amazon CodeGuru Amazon Textract Amazon Kendra Contact Lens For Amazon Connect SageMaker Studio IDE NEW AWS の ML スタック AI サービス: 機械学習の深い知識なしに利⽤可能 ML サービス: 機械学習のプロセス全体を効率化するマネージドサービス ML フレームワークとインフラストラクチャ: 機械学習の環境を⾃在に構築して利⽤ Amazon Rekognitions +Custom labels NEW 18
  16. © 2020, Amazon Web Services, Inc. or its Affiliates. VISION

    SPEECH TEXT SEARCH NEW CHATBOTS PERSONALIZATION FORECASTING FRAUD NEW DEVELOPMENT NEW CONTACT CENTERS NEW Amazon SageMaker Ground Truth Augmented AI SageMaker Neo Built-in algorithms SageMaker Notebooks NEW SageMaker Experiments NEW Model tuning SageMaker Debugger NEW SageMaker Autopilot NEW Model hosting SageMaker Model Monitor NEW Deep Learning AMIs & Containers GPUs & CPUs Elastic Inference Inferentia FPGA Amazon Polly Amazon Transcribe Amazon Comprehend Amazon Translate Amazon Lex Amazon Personalize Amazon Forecast Amazon Fraud Detector Amazon CodeGuru Amazon Textract Amazon Kendra Contact Lens For Amazon Connect SageMaker Studio IDE NEW AWS の ML スタック AI サービス: 機械学習の深い知識なしに利⽤可能 ML サービス: 機械学習のプロセス全体を効率化するマネージドサービス ML フレームワークとインフラストラクチャ: 機械学習の環境を⾃在に構築して利⽤ Amazon Rekognitions +Custom labels NEW 19 機械学習の知識がなくても学習済みのモデルを API で簡単に利⽤可 • 画像映像処理 (画像及び動画内の物体検出・顔認識・不適切コンテンツ検出や OCR) • ⾳声 (読み上げ・書き起こし) • ⾃然⾔語処理 (翻訳・⽂書意味理解) • チャットボット • 時系列予測・レコメンド • 取り引きの不正検知
  17. © 2020, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition (Deep Leaningを利用した画像・映像処理) • 裏では日々AWSのリサーチャーやエンジニアがモデルを改善し続けているため、 使っていると徐々に精度が向上していく点も魅力的
  18. © 2020, Amazon Web Services, Inc. or its Affiliates. アプリケーションに組み込む場合はAPIやSDKを用いて操作し

    ます サーバー上で稼働する アプリケーション (Pythonの例) Amazon Rekognition
  19. © 2020, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. 顔認証受付システム構築
  20. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. (再掲) これはきっちりと設計方針を立てようという話に 当時も色々悩んだが、 スケジュール感が決まっている中で最終的に出てきた大きな設計方針は2つ • 出来るだけサーバレスサービスに寄せてスケーラビリティ・セキュリティ面 の考慮や開発・運用の手間を減らす • 使える部分はAIサービスを活用することで、精度面の不安と実装工数の 不安も解消(即座に検証して精度面を確認する)
  21. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. まずPR/FAQ を書きました • PR/FAQ • Press Release + 質問集 • インターナルのプレスリリースで価値を 明確に定義 • 例 (Amazon GuardDutyの Press release) • タイトル • 日付 • 本文 24
  22. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. PR/FAQ (要約) Press Release (PR) • N月の社内イベント向けのサービス。顔認証で素早く・簡単に入場できる • 今回は顔認証と、社員証の所持 (目視) を合わせた2要素認証 • 事前登録は社員証の写真で行える FAQ • 誰が作っているか? • 5人の新卒SAメンバー • データは保存されるか? • 顔写真はクラウド上に一切保存されない • イベント後のデータの取扱いは? • 証跡管理のための運用記録だけ残し、残りのデータは AWS アカウントごと削除 • 他の手段で入場できるか? • 社員証による入場も可 25
  23. © 2020, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスに求められる機能

    Reception desk Guest Name USB Camera Operator AWS Cloud Image (bytes) {“Name”: “Yoshitaka”, “Similarity”: 99.86} 入力: 出力:
  24. © 2020, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスのアーキテクチャ

    Reception desk Guest Name USB Camera Amazon API Gateway Operator Amazon DynamoDB AWS Cloud AWS Lambda サーバーの管理・運用が不要な従量課金制のシステム設計
  25. © 2020, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスのアーキテクチャ

    Reception desk Guest Name USB Camera Amazon API Gateway Operator Amazon DynamoDB AWS Cloud AWS Lambda Amazon Rekognition
  26. © 2020, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスのアーキテクチャ

    Reception desk Guest Name USB Camera Amazon Cognito Amazon API Gateway Operator Amazon DynamoDB Amazon Rekognition Amazon CloudWatch AWS Cloud
  27. © 2020, Amazon Web Services, Inc. or its Affiliates. Guest

    Name 顔認証イベント受付サービスのアーキテクチャ Reception desk USB Camera Amazon Cognito Amazon API Gateway Operator Lambda function S3 Bucket AWS Cloud Photo + Name Amazon DynamoDB Amazon Rekognition Amazon CloudWatch
  28. © 2020, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスのアーキテクチャ

    Lambda function S3 Bucket Photo + Name Reception desk Guest Name USB Camera Amazon Cognito Amazon API Gateway Operator Amazon DynamoDB Amazon Rekognition Amazon CloudWatch AWS Cloud
  29. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. セキュリティレビューに向けての詳細な仕様修正 34 一時的な認証情報を利用 オフィスネットワークからの IP 制限 (VPN 接続経由) 顔認証のみではなく 社員証の所持と合わせた 2要素認証 API エンドポイントを 自前で作らない その他、サーバー再度暗号化や画像データの破棄の徹底など
  30. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 事前のテスト • UI/UX の重要性 • 「認識中」を表示 • 認証失敗の一番の原因は登録もれ • 概ね好評 35
  31. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. そして、開催当日へ 36 5つ星のうち 4.53
  32. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 当日のゲート通過時間 - 当初の目標: 2秒 / 人 - 実測: 3.38 秒 / 人 - ピーク時間帯の中央値 - 設計値に満たなかったのには様々な要因: - ネットワーク環境 (単一リクエスト時間増) - 現地の照明環境 (リトライ増) - NGの方向けの別オペレーション - 類似度分布の変化 (成功確率減) - 髪型 - メイク - メガネなど 37 メガネ あり / なし 閾値 (Face Model v3)
  33. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 数千人規模の顔認証受付サービス、一ヶ月で構築できますか? イベントまで 1ヶ月というスケジュール感 厳しいセキュリティ基準 開発・運用に割けるリソース も限られている Amazonのセキュリティレビュー を通過する必要あり 数千人をさばける構成とはどのようなものか? 顔認証部分は自前で作る? その場合学習データと機械学習のモデルはどうする? そもそも十分な精度出る?API化どうする? 実施する度に裏で手動でリソースを立ち上げたくない
  34. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. まとめ • サーバーレスサービスのコンセプトと使い所について サーバーレスサービスの利用により、スケーラビリティ・セキュリティ面の考 慮や構築・運用の手間を減らすことができる • AIサービスのコンセプトと使い所について 実装コストを大きく削減でき、高精度なモデルを利用することができる 汎用的な機械学習のタスクであればAIサービスの検討がオススメ • これらのテクノロジーを適材適所に組み合わせることで、効率よく新規 サービスの立ち上げが可能になり、その後の本番運用の負荷も抑えられる
  35. © 2020, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. We are hiring!
  36. © 2020, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. Thank you! “数千人規模の顔認証受付サービス、 一ヶ月で構築できますか?”