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

Amazon Rekognition で顔認証 / Facial Recognition with Amazon Rekognition

Amazon Rekognition で顔認証 / Facial Recognition with Amazon Rekognition

Amazon Rekognition を用いた顔認証によるイベント受付ソリューションについて紹介します。AWS Solutions - Auto Check-In App としてテンプレート公開予定です。

Yoshitaka Haribara

November 27, 2019
Tweet

More Decks by Yoshitaka Haribara

Other Decks in Technology

Transcript

  1. © 2019, Amazon Web Services, Inc. or its Affiliates. アマゾン

    ウェブ サービス ジャパン株式会社 Startup Solutions Architect 針原 佳貴 2019-11-27 Amazon Rekognition で顔認証 機械学習による画像・動画分析の自動化と顔認証 #AutoCheckInApp
  2. © 2019, Amazon Web Services, Inc. or its Affiliates. 自己紹介

    • 針原 佳貴 (はりばら よしたか) • 博士 (情報理工学) • Startup Solutions Architect • スタートアップの技術支援・機械学習導入支援 • 好きなサービスは Amazon SageMaker はじめ Amazon Rekognition, AWS DeepLens など
  3. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. 全てのデベロッパーの手に 機械学習を Our mission at AWS
  4. © 2019, Amazon Web Services, Inc. or its Affiliates. Customer-focused

    90%以上の ML ロードマップは お客様の声によるもの Multi-framework 主要なフレームワークの サポート Pace of innovation 去年200以上の ML 関連の 発表・主要な機能追加 Breadth and depth 幅広い AI/ML サービスを プロダクション導入 Security and analytics 豊富なセキュリティ・暗号化 に関する機能と頑強な分析基盤 Embedded R&D 顧客中心のアプローチで state-of-the-art を実現 AWS の機械学習に対するアプローチ
  5. © 2019, Amazon Web Services, Inc. or its Affiliates. 深層学習フレームワーク

    & インフラストラクチャ AI サービス ML サービス Amazon SageMaker A M A Z O N E C 2 C 5 I n s t a n c e s A M A Z O N E C 2 P 3 / G 4 I n s t a n c e s F P G A s Frameworks AWS の機械学習スタック A m a z o n R e k o g n i t i o n I m a g e / V i d e o A m a z o n P o l l y A m a z o n T r a n s c r i b e A m a z o n T r a n s l a t e A m a z o n C o m p r e h e n d A m a z o n L e x Chatbots A m a z o n F o r e c a s t Forecasting A m a z o n T e x t r a c t A m a z o n P e r s o n a l i z e Recommendations Vision Speech Language E l a s t i c I n f e r e n c e Infrastructure Interfaces
  6. © 2019, Amazon Web Services, Inc. or its Affiliates. 深層学習フレームワーク

    & インフラストラクチャ AI サービス ML サービス Amazon SageMaker A M A Z O N E C 2 C 5 I n s t a n c e s A M A Z O N E C 2 P 3 I n s t a n c e s F P G A s Frameworks AWS の機械学習スタック A m a z o n R e k o g n i t i o n I m a g e / V i d e o A m a z o n P o l l y A m a z o n T r a n s c r i b e A m a z o n T r a n s l a t e A m a z o n C o m p r e h e n d A m a z o n L e x Chatbots A m a z o n F o r e c a s t Forecasting A m a z o n T e x t r a c t A m a z o n P e r s o n a l i z e Recommendations Vision Speech Language E l a s t i c I n f e r e n c e Infrastructure Interfaces 機械学習の知識がなくても学習済みのモデルを API で簡単に利用可 • コンピュータビジョン (画像及び動画内の物体検出・顔認識・不適切コンテンツ検出や OCR) • 音声 (読み上げ・書き起こし) • 自然言語処理 (翻訳・文書意味理解) • チャットボット • 時系列予測・レコメンド
  7. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition 機械学習による画像・動画分析の自動化
  8. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition スケーラブルな深層学習技術によりアプリケーションに画像およびビデオ分析を簡単に追加
  9. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. Demo
  10. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition Image の料金 処理された 1 か月あたりの画像 処理画像 1,000 枚あたりの料金 100 万枚まで* 1.30USD 101 万枚から 1,000 万枚まで* 1.00USD 1,001 万枚から 1 憶枚まで* 0.80USD 1 億枚を超える* 0.50USD *1 ຕ·ͨ͸ෳ਺ຕͷը૾Λड͚ೖΕΔ API ͸ɺͦΕͧΕॲཧ͞Εͨը૾ 1 ຕ෼ͱͯ͠ܭ্͞Ε·͢ɻ詳細はこちら » https://aws.amazon.com/jp/rekognition/pricing/ 東京リージョン 顔メタデータのストレージ 1 か月あたりに保存される顔メタデータ 1,000 件あたりの料金 保存された顔のメタデータ 0.013USD
  11. © 2019, Amazon Web Services, Inc. or its Affiliates. AI

    顔認証イベント受付サービス Auto Check-In App (Coming Soon)
  12. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. イベント受付の課題
  13. © 2019, Amazon Web Services, Inc. or its Affiliates. イベント受付の課題

    • 人が集まるイベントでは受付業務が発生 • 音楽コンサート・ライブ • スポーツ • 全社集会 本人確認が大変 なりすまし防止 参加者リストとの照合に 時間がかかる 人手でリスト内を検索する場合が多い オペレーション改善のための メトリクスが取りづらい 通過時間や時間帯ごとの通過人数など
  14. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. Amazon Rekognition で顔認識
  15. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition による顔認識 コレクション内での顔の検索 1. コレクションの作成 2. 顔の登録 3. 顔の検索
  16. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition による顔認識 • CreateCollection でコレクションを作成 • コレクションを作成すると、最新バージョンの顔検出モデルに関連付けられる コレクション内での顔の検索
  17. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition による顔認識 • IndexFaces オペレーションで、入力イメージ (JPEG または PNG) 内の顔を検出 し、これを指定されたコレクションに追加 • 顔の特徴に関する多次元情報 (特徴ベクトル) を抽出し、その情報を顔コレクショ ンに保存 • 自動的に割り振られる顔 ID だけでなく、ExternalImageId を指定することも可能 詳細はドキュメント「コレクションへの顔の追加」をご覧下さい コレクション内での顔の検索
  18. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition による顔認識 • SearchFacesByImage で、送った画像に似た登録済みの顔 ID を検索 • FaceMatchThreshold というパラメータで類似度の閾値を設定することができる • 詳細はドキュメント「コレクション内での顔の検索」 • これとは別に、2枚の画像を使って「イメージ間の顔の比較」を行う方法もある コレクション内での顔の検索
  19. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. import boto3 client = boto3.client('rekognition') client.create_collection( CollectionId=‘InnovateFaceCollection’ #分かりやすい名前を付ける ) AWS SDK for Python (boto3) でコレクションの作成
  20. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. client.index_faces( CollectionId='InnovateFaceCollection', Image={ 'S3Object': { 'Bucket': 'innovate-ai-reception', 'Name': 'yoshitaka.jpeg' } }, ExternalImageId='Yoshitaka' ) AWS SDK for Python (boto3) で顔の登録
  21. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. with open('face.jpeg', 'rb') as image: response = client.search_faces_by_image( CollectionId='InnovateFaceCollection', Image={'Bytes': image.read()} ) print(response['FaceMatches'][0]) {'Similarity': 99.86331176757812, 'Face': {'FaceId': 'b4340821-c006-40c8-aa9a-553650577ff9’, 'BoundingBox': {'Width': 0.5504249930381775, 'Height': 0.5131639838218689, 'Left': 0.21713200211524963, 'Top': 0.25286099314689636}, 'ImageId': 'ebf11b5e-8233-30c3-bcba-a1bd68969459’, 'ExternalImageId': 'Yoshitaka’, 'Confidence': 99.99979400634766}} AWS SDK for Python (boto3) で顔の検索
  22. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスの アーキテクチャ
  23. © 2019, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスに求められる機能

    Reception desk Guest Name USB Camera Operator AWS Cloud Image (bytes) {“Name”: “Yoshitaka”, “Similarity”: 99.86}
  24. © 2019, Amazon Web Services, Inc. or its Affiliates. 一般的なサーバーレス

    REST API の構成 AWS Cloud Amazon API Gateway Amazon DynamoDB AWS Lambda Data access (boto3) Lambda proxy HTTPS request Client
  25. © 2019, Amazon Web Services, Inc. or its Affiliates. サーバーレス

    AI サービス AWS Cloud Amazon Rekognition Amazon API Gateway Amazon DynamoDB AWS Lambda Data access (boto3) Lambda proxy Client HTTPS request
  26. © 2019, Amazon Web Services, Inc. or its Affiliates. 顔認証イベント受付サービスのアーキテクチャ

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

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

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

    Solutions - Auto Check-In App (Coming Soon) • 顔認証によるイベント受付システム • AWS CloudFormation テンプレートで簡単に環境を立ち上げ • Amazon S3 への画像アップロードで簡単に参加者登録 • Amazon Cognito によるオペレーターの認証 https://aws.amazon.com/solutions/
  30. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. Demo
  31. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. 実装・運用時の考慮事項
  32. © 2019, Amazon Web Services, Inc. or its Affiliates. 実装のためのガイド

    • AWS Lambda は3つの関数 (コレクション作成・画像登録・検索) を作成 • 表示用に顔 ID と名前などの参加者情報を Amazon DynamoDB に保存 • 名前は画像登録時にファイル名やメタデータとして渡す • 受付した際、タイムスタンプをつけて DynamoDB のアイテムを更新する • AWS CloudFormation テンプレートを AWS ソリューション “Auto Check-in App” として公開予定
  33. © 2019, Amazon Web Services, Inc. or its Affiliates. 顔の登録に関するベストプラクティス

    • 以下の条件を満たす顔写真を用いる • 顔が推奨される角度範囲内を向いている • ピッチが下向き 30 度未満、上向き 45 度未満。ヨーイングはどちらの方向にも 45 度未満 • IndexFaces を使用してコレクションに登録する際、正面と上下左右の5枚を使用する • 両目が開いている • 顔がピンぼけしておらず、人の頭全体と肩が含まれ、顔が画像の大部分を占めて いる • ヘッドバンドやマスクなど、顔を遮るものは避ける • 解像度の観点から、登録用の画像が十分に大きいことを確認 • ガイドラインは「顔認識用の入力イメージに関する推奨事項」を参照
  34. © 2019, Amazon Web Services, Inc. or its Affiliates. パフォーマンスの改善

    • イメージのバイトを Amazon Rekognition Image に送る方が、S3 にアップロー ドしたものを参照させるより高速 • 詳細はドキュメント「Amazon Rekognition Image オペレーションのレイテン シー」も参照してください • 検索時に写真をそのまま Rekognition に送るのではなく、画像サイズを小さく したり顔の部分を切り出して送るとパフォーマンスが向上する場合がある • 顔検出には例えば OpenCV などの既存ライブラリを使用 • Rekognition 自体のパフォーマンスは CloudWatch Metrics で確認 • ネットワークの遅延も考慮し、トータルでレスポンス時間を短縮できるよう設計
  35. © 2019, Amazon Web Services, Inc. or its Affiliates. 一般的なセキュリティの考慮事項

    • AWS IAM によるきめ細やかなアクセス制御 • API Gateway には Amazon Cognito による認証 • Lambda 実行ロールに DynamoDB Table 単位など最小権限の認可 • ログの取得とインフラストラクチャのセキュリティ • Amazon CloudWatch Logs でのログ取得 • サーバーレスのマネージドサービス API Gateway, AWS Lambda, Amazon DynamoDB を利用 • 転送時・保存時のデータを暗号化 • HTTPS の利用 • Amazon S3, DynamoDB の サーバーサイド暗号化 (SSE)
  36. © 2019, Amazon Web Services, Inc. or its Affiliates. Amazon

    Rekognition での考慮事項 • Amazon Rekognition の SearchFacesByImage が返す Similarity • Similarity は0から100の範囲を取るため、適切な閾値設定が重要 • 精度は Collection で使用されているモデルのバージョンによる • 顔認証だけでなく、身分証などとの多要素認証を検討 • イベントごとのセキュリティ要件に依存 • 登録用の写真・認証用の画像は保存されない • Rekognition image への入力画像は保持されず、顔から抽出された特徴ベクトル を保存・検索 その他重要な場面での使用を検討される際はドキュメント「公共安全に関係するユースケース」も合わせてご確認ください
  37. © 2019, Amazon Web Services, Inc. or its Affiliates. ©

    2019, Amazon Web Services, Inc. or its Affiliates. ユーザーの声
  38. © 2019, Amazon Web Services, Inc. or its Affiliates. Quotes

    「思ったよりもずっと早く手続きが終了したので驚きました」 「カメラの前に立ってすぐ認証できて、スピードに驚いた」 「素晴らしかった! 髪型がかなり変わっていたにも関わらず、あっさり成功して驚いた」 – イベント参加者の声, All-Hands Meeting, Amazon/AWS
  39. © 2019, Amazon Web Services, Inc. or its Affiliates. まとめ

    • AWS の機械学習スタックと Amazon Rekognition • イベント受付の課題と顔認証によるソリューション • AWS Solutions - Auto Check-In App の紹介 • Amazon Rekognition の顔認識を boto3 経由で呼び出す方法 • 顔認証イベント受付サービスのアーキテクチャ • 実装・運用時の考慮事項