目次

Amazon Augmented AI (A2I) v2.0 完全ガイド(Human-in-the-Loop AI)

概要

Amazon Augmented AI (A2I) は、機械学習モデルの予測結果に人間のレビューループを統合するサービスです。Textract(文書 OCR)・Rekognition(画像認識)・カスタム ML モデルの低信頼スコア予測を自動的にヒューマンレビュータスク化し、Amazon Mechanical Turk・AWS Marketplace ワークフォース・プライベートワーカーチームが確認・修正します。完全自動化と人間確認のハイブリッド AI ワークフロー実現により、精度・合規性・信頼度を備えた AI パイプラインを構築します。


課題解決

  • ML モデル精度不足の補完困難 - Textract・Rekognition の信頼スコアが低いが、自動化と人間確認の分岐ロジックを自前実装するのは複雑
  • 低信頼予測の除外コスト - 金融・医療・法務など高リスク判定では 100% 自動化できず、低信頼ケースの人間レビューが必須
  • ヒューマンレビュー UI の開発負担 - Lambda + SQS + カスタム Web UI を自前構築・管理するより、標準テンプレート・Mechanical Turk 統合を活用したい
  • 監査証跡・品質メトリクスの不足 - AI 予測 + 人間修正の全ジャーニーを記録し、品質改善・コンプライアンス監査に活用したい

アーキテクチャ概要

入力ドキュメント・画像・テキスト
    ↓
ML モデル(Textract / Rekognition / SageMaker / Lambda)
    ├─ 予測スコア計算
    ├─ 信頼度評価
    └─ 出力生成

    ↓ 信頼スコア判定

高信頼(score >= 閾値):
    └─ 自動承認 → 後続処理へ
    └─ S3 に記録(監査ログ)

低信頼(score < 閾値):
    └─ Human Loop 作成
    └─ 人間タスク生成

A2I Human Loop(ヒューマンレビュー):
    ├─ Amazon Mechanical Turk(クラウドワーカー)
    │   └─ 複数候補者でクロス検証(多数決)
    │
    ├─ AWS Marketplace ワークフォース
    │   └─ 業種別専門ワーカー(医療・法務など)
    │
    └─ プライベートワークフォース
        └─ 社内チーム(従業員・契約社員)

    ↓ レビュー・修正・フィードバック

出力:
    ├─ 人間確認済み結果(確定)
    ├─ 修正データ(元の AI 出力との差分)
    └─ フィードバック(AI 再学習用データ)

    ↓ S3 に保存 → 後続BI / 品質監視 / モデル改善

コアコンポーネント

1. Built-in Flow Types(組み込みワークフロー)

1.1 Textract-Integrated A2I

文書 OCR の低信頼フィールドを人間がレビュー・修正。

# Textract フォーム処理
aws textract start-form-detection \
  --document '{
    "S3Object": {
      "Bucket": "my-documents",
      "Name": "insurance-application.pdf"
    }
  }'

# Textract 結果を A2I で条件付きレビュー
aws sagemaker create-human-loop \
  --human-loop-name textract-form-review-20260427-001 \
  --human-loop-config '{
    "HumanTaskUiArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/textract-review",
    "ActivationConditions": {
      "Condition": "LowConfidenceOnly"
    }
  }' \
  --input-content '{
    "InputContent": "{
      \"taskObject\": \"document-form\",
      \"textractResult\": {
        \"Form\": [
          {
            \"FieldKey\": \"APPLICANT_NAME\",
            \"FieldValue\": \"田中太郎\",
            \"Confidence\": 0.62
          },
          {
            \"FieldKey\": \"POLICY_NUMBER\",
            \"FieldValue\": \"POL-2024-001\",
            \"Confidence\": 0.95
          }
        ]
      }
    }"
  }' \
  --role-arn arn:aws:iam::123456789012:role/A2IRole

1.2 Rekognition-Integrated A2I

画像認識結果(顔認識・コンテンツモデレーション)の人間確認。

# Rekognition 顔認識 + A2I レビュー
aws rekognition detect-faces \
  --image '{
    "S3Object": {
      "Bucket": "my-images",
      "Name": "applicant-photo.jpg"
    }
  }'

# 低信頼の顔認識を A2I でレビュー
aws sagemaker create-human-loop \
  --human-loop-name rekognition-face-review-001 \
  --human-loop-config '{
    "HumanTaskUiArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/rekognition-face-review",
    "ActivationConditions": {
      "Condition": "LowConfidenceOnly"
    }
  }' \
  --input-content '{
    "InputContent": "{
      \"taskObject\": \"face-verification\",
      \"rekognitionResult\": {
        \"FaceMatches\": [
          {
            \"Face\": {
              \"BoundingBox\": {\"Width\": 0.35, \"Height\": 0.40},
              \"Confidence\": 0.58
            },
            \"Similarity\": 0.52
          }
        ]
      }
    }"
  }' \
  --role-arn arn:aws:iam::123456789012:role/A2IRole

# コンテンツモデレーション + A2I
aws rekognition detect-moderation-labels \
  --image '{
    "S3Object": {
      "Bucket": "my-images",
      "Name": "user-content.jpg"
    }
  }'

# 不適切ラベルの信頼度が低い場合→人間判定
aws sagemaker create-human-loop \
  --human-loop-name content-moderation-review-001 \
  --human-loop-config '{
    "HumanTaskUiArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/content-moderation"
  }' \
  --input-content '{
    "InputContent": "{
      \"taskObject\": \"content-moderation\",
      \"moderationLabel\": \"SUGGESTIVE\",
      \"confidence\": 0.65,
      \"imageUrl\": \"https://s3.amazonaws.com/my-images/user-content.jpg\"
    }"
  }' \
  --role-arn arn:aws:iam::123456789012:role/A2IRole

1.3 Custom A2I(カスタムモデル)

任意の ML モデル(SageMaker・Lambda)の出力に人間レビューを追加。

# カスタムタスク UI テンプレート作成
aws sagemaker create-human-task-ui \
  --human-task-ui-name custom-ml-review-ui \
  --content '{
    "TemplateBody": "<script src=\"https://assets.crowd.aws/crowd-html-elements.js\"></script>\n<crowd-form>\n  <div>\n    <h2>AI 予測の確認</h2>\n    <p>元の予測: <strong>${ml_prediction}</strong></p>\n    <p>信頼度: <strong>${confidence}%</strong></p>\n    <img src=\"${image_url}\" style=\"max-width: 400px;\" />\n  </div>\n  <crowd-classifier\n    name=\"classification\"\n    categories=\"[\'Correct\', \'Incorrect\', \'Uncertain\']\"\n    header=\"この分類は正確ですか?\">\n  </crowd-classifier>\n  <crowd-input\n    name=\"correction\"\n    label=\"修正があれば入力してください\"\n    placeholder=\"e.g., 正しい分類は ...\"\n    required=\"false\">\n  </crowd-input>\n  <crowd-button form-action=\"submit\">送信</crowd-button>\n</crowd-form>"
  }'

# カスタム Human Loop 作成(SageMaker Hyperparameter Tuning の結果確認など)
aws sagemaker create-human-loop \
  --human-loop-name custom-model-review-001 \
  --human-loop-config '{
    "HumanTaskUiArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/custom-ml-review-ui",
    "ActivationConditions": {
      "Condition": "Threshold",
      "ThresholdAttribute": "Confidence",
      "ThresholdValue": "0.7"
    }
  }' \
  --input-content '{
    "InputContent": "{
      \"ml_prediction\": \"Product Category: Electronics\",
      \"confidence\": \"65\",
      \"image_url\": \"https://s3.amazonaws.com/product-images/item-001.jpg\",
      \"product_name\": \"MacBook Pro 16インチ\"
    }"
  }' \
  --role-arn arn:aws:iam::123456789012:role/A2IRole

2. ワークフォース管理(Workforce Configuration)

2.1 Public Workforce(Amazon Mechanical Turk)

クラウドワーカーによる大規模レビュー。複数ワーカーでの多数決で精度向上。

# Public Workforce の作成と設定
aws sagemaker create-workforce \
  --workforce-name public-workforce \
  --public-workforce-status-code {
    "PublicWorkforceStatus": "Enabled"
  }

# Mechanical Turk タスク設定
aws sagemaker create-workteam \
  --workteam-name public-team \
  --workforce-arn arn:aws:sagemaker:ap-northeast-1:123456789012:workforce/public \
  --member-definitions '[{
    "OidcMemberDefinition": {
      "OidcProviderArn": "arn:aws:iam::123456789012:oidc-provider/..."
    }
  }]' \
  --description "Amazon Mechanical Turk パブリックワーカー"

# Mechanical Turk 報酬設定
aws sagemaker create-labeling-job \
  --labeling-job-name product-category-labeling \
  --label-attribute-name prediction \
  --input-config '{
    "DataSource": {
      "S3DataSource": {
        "ManifestS3Uri": "s3://my-labeling-data/manifest.json"
      }
    }
  }' \
  --output-config '{
    "S3OutputPath": "s3://my-labeling-output/"
  }' \
  --role-arn arn:aws:iam::123456789012:role/SageMakerRole \
  --human-task-config '{
    "WorkteamArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:workteam/public/public-team",
    "Iui": "arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/product-category",
    "PreHumanTaskLambdaArn": "arn:aws:lambda:ap-northeast-1:123456789012:function:PreHumanTask",
    "AnnotationConsolidationConfig": {
      "AnnotationConsolidationLambdaArn": "arn:aws:lambda:ap-northeast-1:123456789012:function:AnnotationConsolidation"
    },
    "PublicWorkforceTaskPrice": {
      "AmountInUsd": {
        "Dollars": 0,
        "Cents": 50
      }
    },
    "NumberOfHumanWorkersPerDataObject": 3,
    "TaskTimeLimitInSeconds": 600
  }' \
  --tags Key=Team,Value=DataScience Key=Project,Value=ProductClassification

2.2 Private Workforce(内部チーム)

社内従業員・契約社員によるレビュー。機密データ・専門判定向け。

# Private Workforce の作成
aws sagemaker create-workforce \
  --workforce-name internal-team \
  --cognito-config '{
    "ClientId": "cognito-client-id",
    "UserPool": "ap-northeast-1_xxxxxxxxx"
  }' \
  --oidc-config '{
    "ClientId": "oidc-client-id",
    "ClientSecret": "...",
    "Issuer": "https://idp.example.com",
    "AuthorizationEndpoint": "https://idp.example.com/oauth/authorize",
    "TokenEndpoint": "https://idp.example.com/oauth/token",
    "UserInfoEndpoint": "https://idp.example.com/oauth/userinfo",
    "LogoutEndpoint": "https://idp.example.com/logout",
    "JwksUri": "https://idp.example.com/.well-known/jwks.json"
  }'

# Workteam 設定(内部チーム)
aws sagemaker create-workteam \
  --workteam-name medical-review-team \
  --workforce-arn arn:aws:sagemaker:ap-northeast-1:123456789012:workforce/internal-team \
  --member-definitions '[{
    "CognitoMemberDefinition": {
      "UserPool": "ap-northeast-1_xxxxxxxxx",
      "UserGroup": "medical-reviewers",
      "ClientId": "cognito-client-id"
    }
  }]' \
  --description "医療文書レビューチーム(社内 MD / RN)"

# A2I Human Loop で medical-review-team を指定
aws sagemaker create-human-loop \
  --human-loop-name medical-record-review-001 \
  --human-loop-config '{
    "WorkteamArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:workteam/internal-team/medical-review-team",
    "HumanTaskUiArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/medical-record-review"
  }' \
  --input-content '{
    "InputContent": "{
      \"document_type\": \"medical_record\",
      \"extracted_text\": \"患者: 山田太郎, 診断: 糖尿病 2 型\",
      \"ai_confidence\": 0.72,
      \"document_url\": \"s3://secure-medical-docs/record-001.pdf\"
    }"
  }' \
  --role-arn arn:aws:iam::123456789012:role/A2IRole

2.3 Vendor Workforce(AWS Marketplace)

医療・法務など業種別専門ワーカー。Scale AI・Surge AI・Appen など。

# Marketplace Workforce(Surge AI との統合例)
aws sagemaker create-workforce \
  --workforce-name surge-ai-workforce \
  --source-ip-config '{
    "Cidrs": ["198.51.100.0/24"]
  }' \
  --description "Surge AI 医療専門家ネットワーク"

aws sagemaker create-workteam \
  --workteam-name clinical-coding-team \
  --workforce-arn arn:aws:sagemaker:ap-northeast-1:123456789012:workforce/surge-ai-workforce \
  --member-definitions '[{
    "OidcMemberDefinition": {
      "OidcProviderArn": "arn:aws:iam::123456789012:oidc-provider/surge-ai.com"
    }
  }]' \
  --description "ICD-10 コーディング専門家(Surge AI)"

ユースケース実装

UC1: 保険申請書自動処理パイプライン

import boto3
import json
from datetime import datetime

textract = boto3.client('textract', region_name='ap-northeast-1')
sagemaker = boto3.client('sagemaker', region_name='ap-northeast-1')
s3 = boto3.client('s3')

def process_insurance_application(document_s3_uri):
    """
    1. Textract で保険申請書を OCR
    2. 信頼度低いフィールドを A2I でレビュー
    3. 人間確認データをモデル改善に活用
    """
    
    # ステップ1: Textract でドキュメント解析
    response = textract.analyze_document(
        Document={
            'S3Object': {
                'Bucket': 'insurance-applications',
                'Name': document_s3_uri
            }
        },
        FeatureTypes=['FORMS', 'TABLES']
    )
    
    # 抽出フィールドと信頼度を整理
    low_confidence_fields = []
    form_data = {}
    
    for block in response['Blocks']:
        if block['BlockType'] == 'KEY_VALUE_SET':
            if block['Confidence'] < 0.8:  # 信頼度 < 80%
                low_confidence_fields.append({
                    'fieldName': block.get('Text', 'unknown'),
                    'confidence': block['Confidence'],
                    'blockId': block['Id']
                })
            form_data[block['Text']] = {
                'confidence': block['Confidence'],
                'value': block.get('Text', '')
            }
    
    # ステップ2: 低信頼フィールドに対して A2I Human Loop を作成
    if low_confidence_fields:
        human_loop_response = sagemaker.create_human_loop(
            HumanLoopName=f'insurance-review-{datetime.utcnow().isoformat()}',
            HumanLoopConfig={
                'HumanTaskUiArn': 'arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/insurance-form-review',
                'ActivationConditions': {
                    'Condition': 'LowConfidenceOnly'
                }
            },
            InputContent={
                'InputContent': json.dumps({
                    'taskObject': 'insurance-form',
                    'documentUri': document_s3_uri,
                    'lowConfidenceFields': low_confidence_fields,
                    'formData': form_data,
                    'textractResult': response
                })
            },
            RoleArn='arn:aws:iam::123456789012:role/A2IRole'
        )
        
        human_loop_name = human_loop_response['HumanLoopArn']
        print(f"Human Loop Created: {human_loop_name}")
        
        # ステップ3: Human Loop 結果を待機
        while True:
            loop_status = sagemaker.describe_human_loop(
                HumanLoopName=human_loop_name
            )
            
            if loop_status['HumanLoopStatus'] == 'Completed':
                # 人間確認結果を取得
                output_s3_uri = loop_status['HumanLoopOutput']['OutputS3Uri']
                obj = s3.get_object(
                    Bucket='output-bucket',
                    Key=output_s3_uri.replace('s3://output-bucket/', '')
                )
                human_review_result = json.loads(obj['Body'].read())
                
                print(f"Human Review Result: {human_review_result}")
                
                # ステップ4: 人間修正データをモデル改善用に保存
                training_data = {
                    'original_extraction': form_data,
                    'human_corrections': human_review_result,
                    'timestamp': datetime.utcnow().isoformat()
                }
                
                s3.put_object(
                    Bucket='ml-training-data',
                    Key=f'insurance-corrections/{datetime.utcnow().date()}/correction-{datetime.utcnow().isoformat()}.json',
                    Body=json.dumps(training_data)
                )
                
                # ステップ5: 最終確定データをデータベースに登録
                # → 後続の給付金支払い処理へ
                print("Insurance Application Processing Complete")
                break
            
            elif loop_status['HumanLoopStatus'] == 'Failed':
                print(f"Human Loop Failed: {loop_status.get('FailureReason')}")
                break
            
            # ポーリング待機
            import time
            time.sleep(5)
    else:
        print("All fields have high confidence - No human review needed")

# 実行例
process_insurance_application('insurance-form-20260427.pdf')

UC2: KYC(本人確認)プロセス

def kyc_face_verification(applicant_photo_s3_uri, registered_photo_s3_uri):
    """
    Rekognition 顔認識による本人確認:
    1. 申請者写真 vs 登録済み写真をマッチング
    2. 信頼度低い場合→人間が目視確認
    3. 不正検知との組み合わせ
    """
    
    rekognition = boto3.client('rekognition')
    sagemaker = boto3.client('sagemaker')
    
    # Rekognition 顔比較
    response = rekognition.compare_faces(
        SourceImage={
            'S3Object': {
                'Bucket': 'kyc-documents',
                'Name': applicant_photo_s3_uri
            }
        },
        TargetImage={
            'S3Object': {
                'Bucket': 'kyc-documents',
                'Name': registered_photo_s3_uri
            }
        },
        SimilarityThreshold=80
    )
    
    # 信頼度が低い場合(< 85%)→人間確認
    if response['FaceMatches']:
        match_confidence = response['FaceMatches'][0]['Similarity']
        
        if match_confidence < 85:
            # A2I でオペレーターが目視確認
            sagemaker.create_human_loop(
                HumanLoopName=f'kyc-face-verification-{datetime.utcnow().isoformat()}',
                HumanLoopConfig={
                    'HumanTaskUiArn': 'arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/kyc-face-verification',
                    'ActivationConditions': {
                        'Condition': 'LowConfidenceOnly'
                    }
                },
                InputContent={
                    'InputContent': json.dumps({
                        'taskObject': 'face-verification',
                        'applicantPhotoUri': applicant_photo_s3_uri,
                        'registeredPhotoUri': registered_photo_s3_uri,
                        'aiConfidence': match_confidence,
                        'aiVerdict': 'MATCH' if match_confidence >= 85 else 'NO_MATCH'
                    })
                },
                RoleArn='arn:aws:iam::123456789012:role/A2IRole'
            )
            print(f"KYC Face Verification: Low confidence ({match_confidence}%) - Human review initiated")
        else:
            print(f"KYC Face Verification: PASSED ({match_confidence}%)")
    else:
        print("KYC Face Verification: No faces detected")

kyc_face_verification('applicant-20260427.jpg', 'registered-id-photo.jpg')

UC3: コンテンツモデレーション(ユーザー生成コンテンツ)

def moderate_user_content(image_s3_uri):
    """
    Rekognition Content Moderation + A2I:
    1. 不適切コンテンツを自動検出
    2. 境界ケース(信頼度 50-80%)を人間が判定
    3. モデレーション判定を公開
    """
    
    rekognition = boto3.client('rekognition')
    sagemaker = boto3.client('sagemaker')
    dynamodb = boto3.resource('dynamodb')
    
    # コンテンツモデレーション実行
    response = rekognition.detect_moderation_labels(
        Image={
            'S3Object': {
                'Bucket': 'user-uploads',
                'Name': image_s3_uri
            }
        }
    )
    
    # 検出ラベルを信頼度別に分類
    blocked_labels = []
    borderline_labels = []
    approved_labels = []
    
    for label in response['ModerationLabels']:
        if label['Confidence'] >= 80:
            blocked_labels.append(label)
        elif 50 <= label['Confidence'] < 80:
            borderline_labels.append(label)
        else:
            approved_labels.append(label)
    
    # 自動決定
    if blocked_labels:
        # 高信頼で不適切 → 自動削除
        decision = 'BLOCKED'
        print(f"Content AUTO-BLOCKED: {[l['Name'] for l in blocked_labels]}")
    elif borderline_labels:
        # 境界ケース → 人間判定に回す
        sagemaker.create_human_loop(
            HumanLoopName=f'content-moderation-{datetime.utcnow().isoformat()}',
            HumanLoopConfig={
                'HumanTaskUiArn': 'arn:aws:sagemaker:ap-northeast-1:123456789012:human-task-ui/content-moderation-review'
            },
            InputContent={
                'InputContent': json.dumps({
                    'taskObject': 'content-moderation',
                    'imageUri': image_s3_uri,
                    'borderlineLabels': [{'Name': l['Name'], 'Confidence': l['Confidence']} for l in borderline_labels],
                    'aiRecommendation': 'REVIEW_REQUIRED'
                })
            },
            RoleArn='arn:aws:iam::123456789012:role/A2IRole'
        )
        decision = 'PENDING_HUMAN_REVIEW'
        print(f"Content flagged for HUMAN REVIEW: {[l['Name'] for l in borderline_labels]}")
    else:
        # 低信頼で不適切でない → 自動承認
        decision = 'APPROVED'
        print("Content AUTO-APPROVED")
    
    # モデレーション結果を DynamoDB に記録
    table = dynamodb.Table('content-moderation-log')
    table.put_item(Item={
        'image_uri': image_s3_uri,
        'decision': decision,
        'blocked_labels': blocked_labels,
        'borderline_labels': borderline_labels,
        'timestamp': datetime.utcnow().isoformat()
    })

moderate_user_content('user-upload-20260427.jpg')

Ground Truth Plus との統合(廃止予定)

A2I の一部機能は SageMaker Ground Truth Plus に統合。新規プロジェクトは Ground Truth Plus の利用推奨。

# Ground Truth Plus(推奨)
aws sagemaker create-labeling-job \
  --labeling-job-name product-image-labeling \
  --label-attribute-name category \
  --input-config '{...}' \
  --output-config '{...}' \
  --role-arn arn:aws:iam::123456789012:role/SageMakerRole \
  --labeling-job-algorithm-specification-status Auto \
  --human-task-config '{
    "WorkteamArn": "arn:aws:sagemaker:ap-northeast-1:123456789012:workteam/default/default",
    "TaskTitle": "Product Image Classification",
    "TaskDescription": "画像に含まれるカテゴリを分類してください",
    "TaskKeywordsForWorkers": ["image", "classification"],
    "TaskAvailabilityDurationSeconds": 86400,
    "MaxConcurrentTaskCount": 100,
    "AnnotationConsolidationConfig": {
      "AnnotationConsolidationLambdaArn": "arn:aws:lambda:ap-northeast-1:123456789012:function:AnnotationConsolidation"
    },
    "PublicWorkforceTaskPrice": {
      "AmountInUsd": {
        "Dollars": 0,
        "Cents": 50
      }
    },
    "NumberOfHumanWorkersPerDataObject": 3
  }' \
  --tags Key=Team,Value=ML

競合他社との比較

観点 A2I Scale AI Labelbox Surge AI Appen
プラットフォーム AWS SaaS SaaS SaaS SaaS SaaS
Textract 統合 ネイティブ API 連携 API 連携 API 連携 API 連携
Rekognition 統合 ネイティブ API 連携 API 連携 API 連携 API 連携
ワークフォース MTurk / Private / Vendor Scale の専門家 パートナー ネットワーク 医療・法務専門 グローバル
カスタムタスク UI HTML テンプレート ビルダー ビルダー ビルダー ビルダー
アクティブラーニング 限定的 あり あり あり あり
品質監視・監査 CloudWatch / S3 ダッシュボード ダッシュボード ダッシュボード ダッシュボード
AWS 統合 ネイティブ API API API API
学習曲線

コスト詳細

1. Human Loop 処理:
   - $0.08/オブジェクト(A2I が処理)
   
2. Mechanical Turk 報酬:
   - 1 タスク = $0.50(設定可能)
   - 複数ワーカーレビュー: 報酬 × ワーカー数
   
3. Private Workforce:
   - A2I オブジェクト処理: $0.08
   - 人員管理: 無料(自社チーム)
   
4. 例: 10,000 件 / 月
   - 高信頼(自動): 0 円(スキップ)
   - 低信頼(A2I): 2,000 件 × $0.08 = $160/月
   - MTurk(3 人レビュー): 2,000 × $0.50 × 3 = $3,000/月
   - 合計: $3,160/月

5. コスト最適化:
   - 信頼度閾値を上げる → A2I対象件数削減
   - Private Workforce 活用 → MTurk 報酬削減
   - バッチ処理 → 全体スループット最適化

ベストプラクティス

BP1: 信頼度閾値設定

  • Textract フォーム: 0.70~0.80(0.70 未満でレビュー)
  • Rekognition 顔: 0.85~0.95(金融/医療は 0.95)
  • カスタムモデル: モデルの実装に応じて調整・監視

BP2: ワークフォース選択

用途 推奨ワークフォース 理由
大規模・汎用 Public (MTurk) 低コスト、スケーラビリティ
機密・高精度 Private セキュリティ、社내 専門知識
医療・法務 Vendor (Scale/Surge) 業種別専門家

BP3: 品質監視

# 人間レビュー精度の監視
def monitor_a2i_quality():
    sagemaker = boto3.client('sagemaker')
    cloudwatch = boto3.client('cloudwatch')
    
    # 完了済みループの集計
    loops = sagemaker.list_human_loops(
        CreationTimeAfter='2026-04-01T00:00:00Z',
        CreationTimeBefore='2026-04-30T23:59:59Z'
    )
    
    total_loops = len(loops['HumanLoopSummaries'])
    completed = sum(1 for l in loops['HumanLoopSummaries'] if l['Status'] == 'Completed')
    failed = sum(1 for l in loops['HumanLoopSummaries'] if l['Status'] == 'Failed')
    
    completion_rate = completed / total_loops * 100 if total_loops > 0 else 0
    
    # CloudWatch にメトリクス送信
    cloudwatch.put_metric_data(
        Namespace='A2I/Quality',
        MetricData=[
            {
                'MetricName': 'HumanLoopCompletionRate',
                'Value': completion_rate,
                'Unit': 'Percent'
            },
            {
                'MetricName': 'HumanLoopFailureCount',
                'Value': failed,
                'Unit': 'Count'
            }
        ]
    )
    
    print(f"Total Loops: {total_loops}, Completion Rate: {completion_rate:.2f}%, Failures: {failed}")

monitor_a2i_quality()

トラブルシューティング

症状 原因 対応
Human Loop が完了しない ワーカー割当なし / タスク難易度高 MTurk 報酬引上げ、タスク UI 簡素化
ワーカー品質が低い 指示が不明確 / 報酬が低い UI 改善、複数ワーカー多数決、報酬増加
Textract 統合で信頼度が低い OCR 品質不十分 ドキュメント前処理(回転・スキャン品質向上)
Custom UI がレンダリングされない HTML テンプレートエラー ブラウザ開発者ツールで確認、Crowd HTML Elements バージョン確認

採用判断チェックリスト

  • [ ] Textract / Rekognition の低信頼結果の人間確認が必要?
  • [ ] 自動化と人間確認の柔軟な組み合わせが必要?
  • [ ] 監査証跡・品質メトリクスの記録が必須か(金融・医療)?
  • [ ] MTurk / Private / Vendor ワークフォースのいずれかで対応可能?

まとめ

Amazon A2I は、ML モデルの予測に人間のレビューループを統合し、精度・合規性・信頼度を確保するハイブリッド AI サービスです。Textract・Rekognition とのネイティブ統合で低信頼予測を自動的に人間確認に回し、Mechanical Turk・Private Team・Vendor Workforce で柔軟にワーカーを確保できます。修正データを学習データとして活用することで、モデル改善サイクルを加速します。


最終更新:2026-04-27 バージョン:v2.0