目次

Fraud Detector v2.0 完全ガイド(Machine Learning & AI)

概要・重要な注記

**重要通知:Amazon Fraud Detector は 2025 年 11 月 7 日付で新規顧客向けに販売を終了します。**既存ユーザーは引き続き利用可能ですが、新規導入の場合は SageMaker・AutoGluon・AWS WAF・Bedrock などの代替ソリューションを検討してください。

本ドキュメントは、Fraud Detector の既存ユーザー向けの v2.0 完全リファレンスおよび、サンセット後の移行ガイドを提供します。


概要

Amazon Fraud Detector は、機械学習を活用したオンライン不正検知サービスで、決済詐欺・アカウント詐欺・不正ログインをリアルタイムで検知します。AWS が Amazon.com の 20 年以上の不正検知実績から培った知見を組み込み、カスタム ML モデル・ルールエンジン・リスクスコアリングを統合した専用サービスとして提供されました。オンライン決済・EC サイト・フィンテック・ゲーミング・サブスクリプション等の業界で活用されました。


課題と特徴

従来型不正検知の課題

  • 大量の不正パターン学習: 新しい不正手法に対応するため、継続的なモデル更新が必須
  • ドメイン固有の特徴エンジニアリング: IP 地理情報・デバイスフィンガープリント・決済パターン等の自動抽出が複雑
  • ルールエンジン + ML の組み合わせ: 静的ルール(IP ブロック等)と動的な ML スコアの統合実装が困難
  • リアルタイム推論: ミリ秒単位のレスポンス時間が必須で、インフラコスト高い
  • モデル解釈可能性: リスク判定の理由を説明可能にする必要

Fraud Detector の特徴(廃止前)

特徴 効果
Pre-trained Models AWS・Amazon の不正検知知見を組み込んだ事前学習モデル
Online Fraud Insights 新規アカウント・ユーザー登録の不正検知
Transaction Fraud Insights 決済トランザクションの不正判定
Account Takeover Insights ログインパターン異常・アカウント乗っ取り検知
Rule Engine IF-THEN ルールで ML スコア + ビジネスロジック統合
Real-time Scoring API <500ms でリスクスコア(0-1000)を返却
Variable & Feature Engineering 自動特徴抽出(IP・デバイス・行動パターン)
Model Performance Metrics AUC・F1 Score・ConfusionMatrix を自動計算
Outcomes approve / review / decline の 3 段階判定

アーキテクチャ

graph TB
    subgraph Input["入力"]
        A["過去の取引データ<br/>S3 CSV"]
        B["リアルタイム<br/>トランザクション"]
    end
    
    subgraph DataPrep["データ準備"]
        C["不正フラグ付きデータ<br/>学習用セット"]
        D["Variable 定義"]
    end
    
    subgraph ModelTraining["モデル学習"]
        E["AWS 不正検知知見<br/>適用"]
        F["自動アルゴリズム<br/>選択"]
        G["Detector 作成"]
    end
    
    subgraph RuleEngine["ルールエンジン"]
        H["IF-THEN ルール<br/>定義"]
        I["Variable + ML<br/>スコア統合"]
    end
    
    subgraph RealTime["リアルタイム推論"]
        J["GetEventPrediction<br/>API"]
        K["リスクスコア<br/>0-1000"]
        L["Outcome<br/>approve/review/decline"]
    end
    
    subgraph Output["結果"]
        M["決済許可・保留"]
        N["追加認証要求"]
        O["アラート・ブロック"]
    end
    
    A --> C
    B --> D
    C --> E
    D --> F
    E --> G
    F --> G
    G --> H
    H --> I
    I --> J
    J --> K
    K --> L
    L --> M
    L --> N
    L --> O

コアコンポーネント

1. Event Type・Detector・Model 作成

import boto3
import json

fraud_detector = boto3.client('frauddetector', region_name='ap-northeast-1')

# Step 1: Event Type 定義(取引タイプの定義)
fraud_detector.create_event_type(
    name='ecommerce_transaction',
    description='Online shopping transactions',
    eventVariables=[
        'user_id', 'item_id', 'amount', 'timestamp',
        'ip_address', 'device_id', 'email'
    ],
    labels=['fraud', 'legitimate']
)

# Step 2: Variable 定義(特徴量)
variables_to_create = [
    {
        'name': 'user_id',
        'dataType': 'STRING',
        'dataSource': 'EVENT'
    },
    {
        'name': 'amount',
        'dataType': 'FLOAT',
        'dataSource': 'EVENT'
    },
    {
        'name': 'ip_country',
        'dataType': 'STRING',
        'dataSource': 'EVENT'
    },
    {
        'name': 'device_first_seen',
        'dataType': 'DATETIME',
        'dataSource': 'EVENT'
    }
]

for var in variables_to_create:
    try:
        fraud_detector.create_variable(**var)
    except fraud_detector.exceptions.ValidationException:
        pass  # Already exists

# Step 3: 学習データを S3 にアップロード
"""
s3://my-bucket/training-data.csv

event_id,user_id,amount,ip_country,device_first_seen,label
evt-001,user-123,100,JP,2024-01-01,legitimate
evt-002,user-456,99999,CN,2024-01-02,fraud
evt-003,user-789,5000,JP,2024-01-03,legitimate
...
"""

# Step 4: Detector 作成(モデル学習)
detector_response = fraud_detector.create_detector(
    detectorName='ecommerce-fraud-detector',
    description='E-commerce transaction fraud detection',
    eventTypeName='ecommerce_transaction'
)

detector_arn = detector_response['detectorArn']

# Step 5: Model 作成&トレーニング
model_response = fraud_detector.create_model(
    modelId='ecommerce-fraud-model',
    modelType='TRANSACTION_FRAUD',  # または ONLINE_FRAUD_INSIGHTS, ACCOUNT_TAKEOVER_INSIGHTS
    trainingDataSource='EXTERNAL_FILE',
    trainingDataSchema={
        'modelVariables': [
            'user_id', 'amount', 'ip_country', 'device_first_seen'
        ],
        'labelSchema': {'eventTypeName': 'ecommerce_transaction'},
        's3BucketLocation': 's3://my-bucket/training-data.csv'
    },
    externalModelEndpoint='...'  # Optional: BYOM(外部モデル持ち込み)
)

model_arn = model_response['modelArn']

# Step 6: Model Version をトレーニング
version_response = fraud_detector.create_model_version(
    modelId='ecommerce-fraud-model',
    modelType='TRANSACTION_FRAUD',
    trainingDataSource='EXTERNAL_FILE',
    trainingDataSchema={
        'modelVariables': ['user_id', 'amount', 'ip_country'],
        'labelSchema': {'eventTypeName': 'ecommerce_transaction'},
        's3BucketLocation': 's3://my-bucket/training-data.csv'
    }
)

version_arn = version_response['modelVersionArn']

print(f"✓ Model Version ARN: {version_arn}")

# トレーニング完了を待機
import time
while True:
    version = fraud_detector.describe_model_version(
        modelId='ecommerce-fraud-model',
        modelType='TRANSACTION_FRAUD',
        modelVersionNumber=version_response['modelVersionNumber']
    )
    
    status = version['modelVersionDetails']['modelVersionStatus']
    if status == 'TRAINING_COMPLETE':
        # パフォーマンスメトリクス取得
        metrics = version['modelVersionDetails']['validationMetrics']
        print(f"✓ トレーニング完了")
        print(f"  AUC: {metrics.get('auc', 'N/A')}")
        print(f"  KS: {metrics.get('ks', 'N/A')}")
        break
    elif status == 'TRAINING_CANCELLED':
        print("✗ トレーニングキャンセル")
        break
    
    time.sleep(30)

2. ルールエンジン + ML スコア統合

# Rule 定義: IF-THEN で ML スコアとビジネスロジックを統合

# ルール例 1: 高リスク自動ブロック
fraud_detector.create_rule(
    ruleId='block-high-risk',
    detectorId='ecommerce-fraud-detector',
    expression='fraud_score > 900',  # fraud_score は ML モデル出力
    language='RULES_LANGUAGE_1_0',
    outcomes=['decline']  # 自動ブロック
)

# ルール例 2: 中リスク+ 高額は確認要
fraud_detector.create_rule(
    ruleId='review-medium-risk-high-amount',
    detectorId='ecommerce-fraud-detector',
    expression='fraud_score > 700 AND amount > 100000',
    language='RULES_LANGUAGE_1_0',
    outcomes=['review']  # 人間確認
)

# ルール例 3: 未知の国からのアクセスは確認
fraud_detector.create_rule(
    ruleId='review-unknown-country',
    detectorId='ecommerce-fraud-detector',
    expression='ip_country NOT IN ("JP", "US", "GB") AND amount > 10000',
    language='RULES_LANGUAGE_1_0',
    outcomes=['review']
)

# ルール例 4: 新規デバイス + 高額
fraud_detector.create_rule(
    ruleId='review-new-device-high-amount',
    detectorId='ecommerce-fraud-detector',
    expression='days_since_device_first_seen < 1 AND amount > 50000',
    language='RULES_LANGUAGE_1_0',
    outcomes=['review']
)

# ルール例 5: デフォルト(リスク低い)
fraud_detector.create_rule(
    ruleId='approve-default',
    detectorId='ecommerce-fraud-detector',
    expression='fraud_score < 500',
    language='RULES_LANGUAGE_1_0',
    outcomes=['approve']
)

print("✓ ルール設定完了")

3. リアルタイムスコアリング

# リアルタイムトランザクション評価

def evaluate_transaction(transaction):
    """
    transaction = {
        'user_id': 'user-123',
        'amount': 5000,
        'ip_country': 'JP',
        'device_id': 'device-abc123',
        'email': 'user@example.com'
    }
    """
    
    response = fraud_detector.get_event_prediction(
        detectorId='ecommerce-fraud-detector',
        eventId=f'evt-{int(time.time())}',
        eventTypeName='ecommerce_transaction',
        eventTimestamp=str(int(time.time())),
        eventVariables=transaction,
        detectorVersionId='1.0'
    )
    
    # 結果: ML スコア + ルール判定
    predictions = response['predictions']
    fraud_model_score = predictions.get('model_scores', {}).get('fraud_score', 0)
    outcomes = predictions.get('outcomes', [])
    
    result = {
        'fraud_score': fraud_model_score,      # 0-1000
        'prediction': 'FRAUD' if fraud_model_score > 700 else 'LEGITIMATE',
        'outcomes': outcomes,  # ['approve'], ['review'], or ['decline']
        'timestamp': int(time.time())
    }
    
    print(f"Transaction {transaction['user_id']}:")
    print(f"  Fraud Score: {fraud_model_score:.1f}/1000")
    print(f"  Outcome: {result['outcomes'][0] if result['outcomes'] else 'UNKNOWN'}")
    
    return result

# 使用例: リアルタイム決済チェック
transaction = {
    'user_id': 'user-789',
    'amount': 150000,
    'ip_country': 'CN',
    'device_id': 'new-device-xyz',
    'email': 'suspicious@example.com'
}

prediction = evaluate_transaction(transaction)

if prediction['outcomes'][0] == 'decline':
    print("⚠️ 決済をブロック")
elif prediction['outcomes'][0] == 'review':
    print("📋 確認キューに追加(SMS OTP 要求等)")
else:
    print("✓ 決済承認")

4. Stored Events(過去データ活用)

# 過去の決済データをシステムに学習させ、モデル改善に活用

fraud_detector.put_event(
    eventId='evt-001',
    eventTypeName='ecommerce_transaction',
    eventTimestamp=str(int(time.time())),
    eventVariables={
        'user_id': 'user-123',
        'amount': 5000,
        'ip_country': 'JP',
        'device_id': 'device-abc',
        'email': 'user@example.com'
    },
    assignedLabel='legitimate',  # or 'fraud'
    labelTimestamp=str(int(time.time()))
)

print("✓ 過去イベント記録(将来のモデル改善に活用)")

5. Online Fraud Insights(新規アカウント不正検知)

# アカウント作成時の不正登録を検知

fraud_detector.create_model(
    modelId='account-signup-fraud-detector',
    modelType='ONLINE_FRAUD_INSIGHTS',
    description='Detect fraudulent account signups',
    trainingDataSource='EXTERNAL_FILE'
)

# 新規アカウント登録リクエスト評価
signup_event = {
    'email': 'newuser@example.com',
    'phone': '+81-90-1234-5678',
    'ip_address': '1.2.3.4',
    'device_id': 'new-device-123',
    'name': 'John Doe'
}

response = fraud_detector.get_event_prediction(
    detectorId='account-fraud-detector',
    eventTypeName='account_signup',
    eventVariables=signup_event
)

# 結果
ofi_score = response['predictions']['model_scores']['ofi_score']

if ofi_score > 800:
    print(f"⚠️ 疑わしいアカウント登録(スコア {ofi_score})→ メール確認必須")
else:
    print("✓ アカウント登録承認")

6. Account Takeover Insights(ログイン異常検知)

# ログイン時のアカウント乗っ取り検知

# ATI モデル作成
fraud_detector.create_model(
    modelId='login-ati-detector',
    modelType='ACCOUNT_TAKEOVER_INSIGHTS',
    description='Detect account takeover attempts'
)

# ログインリクエスト評価
login_event = {
    'user_id': 'user-123',
    'ip_address': '200.100.50.1',  # 通常と異なる国の IP
    'device_id': 'unknown-device',  # 過去に見ない端末
    'login_time': str(int(time.time())),
    'email': 'user@example.com'
}

response = fraud_detector.get_event_prediction(
    detectorId='login-ati-detector',
    eventTypeName='account_login',
    eventVariables=login_event
)

# 異常検知
ati_score = response['predictions']['model_scores'].get('ati_score', 0)

if ati_score > 900:
    print(f"🚨 アカウント乗っ取り疑い(スコア {ati_score})→ MFA 強制")
    # → 2FA / SMS OTP / Email Verification を要求
else:
    print("✓ ログイン承認")

主要ユースケース(10+)

1. EC サイト - 決済詐欺防止

class ECPaymentFraudPrevention:
    def __init__(self, detector_id):
        self.fd = boto3.client('frauddetector')
        self.detector_id = detector_id
    
    def check_checkout(self, order):
        """チェックアウト時のリアルタイム詐欺判定"""
        
        event_variables = {
            'user_id': order['user_id'],
            'amount': order['total_price'],
            'ip_country': order['ip_country'],
            'shipping_country': order['shipping_country'],
            'device_id': order['device_id'],
            'email': order['email'],
            'item_count': len(order['items'])
        }
        
        result = self.fd.get_event_prediction(
            detectorId=self.detector_id,
            eventId=f'checkout-{order["id"]}',
            eventTypeName='ecommerce_transaction',
            eventTimestamp=str(int(time.time())),
            eventVariables=event_variables
        )
        
        score = result['predictions']['model_scores']['fraud_score']
        outcome = result['predictions']['outcomes'][0]
        
        if outcome == 'decline':
            return {'status': 'BLOCKED', 'reason': 'High fraud risk detected'}
        elif outcome == 'review':
            return {'status': 'PENDING_REVIEW', 'reason': 'Manual review required'}
        else:
            return {'status': 'APPROVED'}

2. フィンテック - 送金不正検知

class FinTechTransferFraudDetection:
    def check_money_transfer(self, transfer_request):
        """送金リクエストの詐欺判定"""
        
        fd = boto3.client('frauddetector')
        
        event_vars = {
            'sender_id': transfer_request['from_account'],
            'recipient_id': transfer_request['to_account'],
            'amount': transfer_request['amount'],
            'timestamp': int(time.time()),
            'device_id': transfer_request['device_id'],
            'ip_address': transfer_request['ip_address'],
            'is_new_recipient': transfer_request['to_account_is_new']
        }
        
        response = fd.get_event_prediction(
            detectorId='fintech-transfer-detector',
            eventId=f'transfer-{transfer_request["id"]}',
            eventTypeName='money_transfer',
            eventTimestamp=str(int(time.time())),
            eventVariables=event_vars
        )
        
        fraud_score = response['predictions']['model_scores']['fraud_score']
        
        if fraud_score > 850:
            # 高リスク: 取引一時停止 + 追加認証
            return {'action': 'BLOCK', 'score': fraud_score}
        elif fraud_score > 600:
            # 中リスク: 確認メール + SMS OTP
            return {'action': 'VERIFY', 'score': fraud_score}
        else:
            return {'action': 'APPROVE', 'score': fraud_score}

3. ゲーミング・サブスクリプション - アカウント不正

class GamingFraudDetection:
    def detect_account_fraud(self, user_id, login_info):
        """ゲーミングアカウント乗っ取り検知"""
        
        fd = boto3.client('frauddetector')
        
        # 通常の習慣との比較
        user_profile = self.get_user_profile(user_id)
        
        deviation = {
            'ip_different_country': login_info['country'] != user_profile['usual_country'],
            'unusual_time': login_info['hour'] not in user_profile['usual_hours'],
            'new_device': login_info['device_id'] not in user_profile['known_devices'],
            'rapid_login_attempts': login_info['attempts_in_5min'] > 3
        }
        
        response = fd.get_event_prediction(
            detectorId='gaming-ati-detector',
            eventTypeName='account_login',
            eventVariables={
                'user_id': user_id,
                'ip_address': login_info['ip'],
                'device_id': login_info['device_id'],
                'country': login_info['country'],
                'time_of_day': login_info['hour'],
                'failed_attempts': login_info['failed_attempts']
            }
        )
        
        ati_score = response['predictions']['model_scores'].get('ati_score', 0)
        
        if ati_score > 900 or all(deviation.values()):
            # アカウント乗っ取り疑い強い
            return {'action': 'FORCE_MFA'}
        
        return {'action': 'ALLOW'}

CLI・SDK・IaC 例(5+)

CLI 例

# Detector 作成
aws frauddetector create-detector \
  --detector-name ecommerce-detector \
  --event-type-name ecommerce_transaction \
  --region ap-northeast-1

# Model 作成・トレーニング
aws frauddetector create-model \
  --model-id ecommerce-fraud-model \
  --model-type TRANSACTION_FRAUD \
  --training-data-source EXTERNAL_FILE \
  --training-data-schema '{...}' \
  --region ap-northeast-1

# Rule 作成
aws frauddetector create-rule \
  --rule-id block-high-risk \
  --detector-id ecommerce-detector \
  --expression 'fraud_score > 900' \
  --outcomes decline \
  --region ap-northeast-1

# リアルタイムスコアリング
aws frauddetector get-event-prediction \
  --detector-id ecommerce-detector \
  --event-type-name ecommerce_transaction \
  --event-variables user_id=user-123,amount=5000 \
  --region ap-northeast-1

SDK 例(Python)

import boto3

fd = boto3.client('frauddetector', region_name='ap-northeast-1')

def batch_evaluate_historical_data(data_csv_path):
    """過去データを一括評価(モデル検証)"""
    
    import pandas as pd
    
    df = pd.read_csv(data_csv_path)
    
    predictions = []
    
    for _, row in df.iterrows():
        event_vars = {col: str(row[col]) for col in df.columns if col != 'label'}
        
        response = fd.get_event_prediction(
            detectorId='ecommerce-detector',
            eventId=f'eval-{row["id"]}',
            eventTypeName='ecommerce_transaction',
            eventVariables=event_vars
        )
        
        score = response['predictions']['model_scores']['fraud_score']
        predictions.append({
            'id': row['id'],
            'actual_label': row['label'],
            'predicted_score': score,
            'predicted_label': 'FRAUD' if score > 700 else 'LEGITIMATE'
        })
    
    # 精度計算
    return pd.DataFrame(predictions)

比較表(サンセット後の代替案含む)

特性 Fraud Detector(廃止予定) SageMaker AutoGluon AWS WAF Sift Science
リアルタイム不正検知
決済詐欺
アカウント乗っ取り
新規アカウント詐欺
ルールエンジン統合
マネージド
セットアップの簡単さ ✅✅
ML 専門知識不要
Pricing $0.99/1k 従量課金 自ホスト 従量課金 従量課金
サポート ⚠️ 廃止予定 活発 OSS 活発 ベンダー

Fraud Detector サンセット後の移行ガイド

Option 1: AWS SageMaker への移行

# SageMaker で同等の不正検知を実装

import sagemaker
from sagemaker.estimator import Estimator

session = sagemaker.Session()
role = 'arn:aws:iam::123456789:role/SageMakerRole'

# XGBoost で不正検知モデルを学習
xgb_estimator = Estimator(
    image_uri=sagemaker.image_uris.retrieve('xgboost', 'ap-northeast-1'),
    role=role,
    instance_count=1,
    instance_type='ml.m5.large',
    output_path='s3://my-bucket/sagemaker-output/'
)

xgb_estimator.fit('s3://my-bucket/training-data/')

# エンドポイント作成(リアルタイム推論)
predictor = xgb_estimator.deploy(
    initial_instance_count=1,
    instance_type='ml.t2.medium'
)

# 推論
prediction = predictor.predict(test_data)

Option 2: AWS WAF への移行(ボット・アカウント乗っ取り対策)

import boto3

waf = boto3.client('wafv2', region_name='ap-northeast-1')

# WAF WebACL で IP ブロック・レート制限等を設定
# (オンライン詐欺の代替案)

waf.create_web_acl(
    Name='fraud-protection-acl',
    Scope='CLOUDFRONT',
    DefaultAction={'Allow': {}},
    Rules=[
        {
            'Name': 'RateLimitRule',
            'Priority': 1,
            'Statement': {
                'RateBasedStatement': {'Limit': 2000}
            },
            'Action': {'Block': {}},
            'VisibilityConfig': {
                'SampledRequestsEnabled': True,
                'CloudWatchMetricsEnabled': True,
                'MetricName': 'RateLimitRule'
            }
        }
    ]
)

Option 3: Bedrock での不正検知説明生成

# 不正スコアの理由を LLM で自然言語生成

import boto3

bedrock = boto3.client('bedrock-runtime')

def explain_fraud_score(score, features):
    """スコアの理由を説明"""
    
    prompt = f"""
    不正検知スコア: {score}/1000
    
    検知対象の特徴:
    - IP 国: {features['ip_country']}
    - 取引額: {features['amount']} 円
    - 新規デバイス: {features['is_new_device']}
    - 過去 24 時間の取引回数: {features['transaction_count_24h']}
    
    このスコアの理由を日本語で簡潔に説明してください:
    """
    
    response = bedrock.invoke_model(
        modelId='anthropic.claude-3-sonnet-20240229-v1:0',
        body=prompt
    )
    
    return response['body'].read().decode('utf-8')

explanation = explain_fraud_score(
    score=750,
    features={
        'ip_country': 'CN',
        'amount': 99999,
        'is_new_device': True,
        'transaction_count_24h': 5
    }
)

print(explanation)
# 出力例: "中国からのアクセスで高額(99999円)取引、かつ新規デバイスのため注意が必要です"

ベストプラクティス

✅ DO

  • 十分な学習データ: 最低 1,000 件(推奨 10,000 件)の不正ラベル付きデータ
  • 継続的なモデル更新: 新しい不正パターンに対応するため月 1 回程度の再学習
  • ルール + ML 統合: 規則的なブロック(IP、金額)と ML スコアを組み合わせ
  • 偽陰性対策: 正規顧客の不便さ(friction)を最小化(段階的な認証等)
  • メトリクス監視: FPR(偽陽性率)と FNR(偽陰性率)の定期確認

❌ DON’T

  • ML スコアのみ依存: ビジネスルール(地域制限・金額上限等)を無視
  • 固定閾値: 季節変動・ビジネス成長に対応できない
  • モデル改善なし: 不正パターンの進化に追従しないと精度低下
  • 過度なブロック: 正規顧客の利便性を損なうと離脱を招く

2025-2026 最新動向

  • Fraud Detector 廃止: 2025 年 11 月 7 日に新規顧客向け販売終了
  • SageMaker 推奨: より柔軟な ML ソリューション
  • Bedrock 連携: 不正理由を LLM で説明可能に
  • AWS WAF + Lambda: ボット・不正アクセス対策の強化
  • 継続学習: AutoML による自動モデル改善

学習リソース

公式ドキュメント(廃止予定のため参考)

  1. Fraud Detector User Guide(アーカイブ)
  2. SageMaker ML Guide(推奨移行先)
  3. AWS WAF Documentation
  4. Bedrock Guide

代替ソリューション(5+)

  1. Sift Science - 専用不正検知 SaaS
  2. Forter - e-commerce 特化
  3. SEON - リアルタイムオムニチャネル
  4. Stripe Radar - 決済特化
  5. Featurespace - Enterprise フォーカス

採用判断チェックリスト(移行計画用)

Fraud Detector からの移行検討:

  • [ ] 現在 Fraud Detector を運用中か(廃止前に移行計画立案が必須)
  • [ ] SageMaker への移行か代替 SaaS への乗り換えか決定したか
  • [ ] 学習データ・ラベルを整理・バックアップしたか
  • [ ] 運用チーム向けの新ソリューション教育計画があるか

新規導入の場合:

  • [ ] SageMaker(フルコントロール)を検討したか
  • [ ] AutoGluon(自動 ML)の自ホスト可能性を検討したか
  • [ ] 専用 SaaS(Sift・Forter)の費用対効果を検討したか
  • [ ] AWS WAF でのボット・アクセス制御で十分か

実装例:SageMaker への移行スクリプト

class FraudDetectionMigration:
    """Fraud Detector → SageMaker 移行"""
    
    def __init__(self):
        self.fd = boto3.client('frauddetector')
        self.sagemaker = boto3.client('sagemaker')
    
    def export_training_data(self):
        """Fraud Detector から学習データをエクスポート"""
        
        # Step 1: Stored Events を S3 にエクスポート
        export_job = self.fd.create_batch_import_job(
            jobInputPath='s3://my-bucket/export/',
            outputPath='s3://my-bucket/exported-events/',
            eventTypeName='ecommerce_transaction'
        )
        
        return export_job['jobId']
    
    def migrate_to_sagemaker(self, data_path):
        """SageMaker XGBoost モデルを作成"""
        
        from sagemaker.xgboost.estimator import XGBoost
        
        xgb = XGBoost(
            entry_point='train.py',
            role='arn:aws:iam::123456789:role/SageMakerRole',
            instance_count=1,
            instance_type='ml.m5.large',
            framework_version='latest',
            hyperparameters={
                'objective': 'binary:logistic',
                'max_depth': 6,
                'eta': 0.2,
                'num_round': 100
            }
        )
        
        xgb.fit(data_path)
        
        return xgb

まとめ

Fraud Detector は 「AWS が 20 年以上の不正検知知見を組み込んだ専用不正検知サービス」 でしたが、2025 年 11 月 7 日に新規顧客向けに廃止されます。既存ユーザーは引き続き利用可能ですが、長期的には移行が必須です。代替案としては:

  1. SageMaker(フルコントロール、学習曲線高い)
  2. AutoGluon(自動 ML、自ホスト)
  3. Sift・Forter 等(専用 SaaS、即導入可能)
  4. AWS WAF(ボット・アクセス制限中心)
  5. Bedrock + 既存モデル(説明可能性強化)

本番運用中の場合は、今後 6 ヶ月以内に移行計画の策定・テストを開始することを強く推奨します。


移行ロードマップ(2026 年 Q2-Q3 推奨)

Phase 1: 準備・評価(4-6 週間)

  1. 現在の Fraud Detector 構成ドキュメント化

    • Detector・Model・Rule の一覧出力
    • 学習データ・Variable の仕様整理
    • メトリクス・ビジネスロジック記録
  2. 代替案の評価

    • SageMaker vs AutoGluon vs SaaS の比較
    • Total Cost of Ownership 計算
    • 組織の ML 成熟度考慮
  3. パイロットテスト

    • 本番の 5-10% トラフィックで並列運用
    • 精度・レイテンシー・コスト計測
    • フォールバック計画策定

Phase 2: 構築・検証(8-12 週間)

  • 選定ソリューション構築開始
  • 学習データセットの準備・クリーニング
  • モデル学習・テスト・評価
  • ビジネスルール・閾値の最適化

Phase 3: 本番移行(4-8 週間)

  • カナリアリリース(段階的トラフィック増加)
  • 問題対応・チューニング
  • 運用チーム教育・引き継ぎ
  • Fraud Detector サービス停止・クリーンアップ

セキュリティ考慮事項

  • データ保護: 学習データに PII(個人識別情報)を含めない
  • モデル解釈性: 不正判定の理由が説明可能である必要(規制対応)
  • 監査証跡: 判定ロジック・ルール変更を CloudTrail で記録
  • バイアス検証: モデルが性別・人種等で差別的判定していないか確認

最終更新:2026-04-26 バージョン:v2.0 重要:Fraud Detector は 2025 年 11 月 7 日に新規顧客向け販売終了予定