AI/ML based Card Payment Fraud Detection on AWS using replicated data from mainframe
Summary
TLDRこのビデオでは、AWS上でAIMLベースのカード詐欺検出ソリューションを構築する方法を紹介します。メインフレームシステム上で動くカード支払い承認アプリケーションは、静的なビジネスルールを使って取引を承認または拒否します。AWSにリアルタイムで詐欺スコアを生成するよう、Amazon Fraud DetectorサービスまたはSageMakerで構築されたAIMLモデルにリクエストを送信するようにアプリケーションを強化します。モデルは、過去48時間の顧客購入履歴や過去24時間の販売者売上履歴などの属性でトレーニングされ、推論時に同じ属性を通して最適なスコアを生成します。ソリューションアーキテクチャをレビューし、顧客がカードをスワイプまたはオンラインで購入を試みると、銀行はメインフレームシステム上で承認リクエストを受け取り、AWS上のプロセスがリレーショナルデータベースから顧客と販売者の履歴を取得し、AIMLスコアリングモデルに提供します。
Takeaways
- 🚀 AWS上でAIMLベースのカード詐欺検出ソリューションを構築する方法が紹介されています。
- 🛠️ メインフレームシステム上のカード支払い承認アプリケーションは、静的なビジネスルールを使用してトランザクションを承認または拒否します。
- 🔄 レガシーアプリケーションは、AWSへのリアルタイム呼び出しを行い、Amazon Fraud DetectorサービスやSageMakerで構築された他のAIMLモデルによって詐欺スコアを生成するように強化されています。
- 📈 モデルは、過去48時間の顧客の購入履歴や過去24時間の売主の売上履歴などの属性を使用してトレーニングされています。
- 🔧 インファレンス時に、同じ属性がモデルに渡され、最適なスコアを生成します。
- 🏢 ソリューションアーキテクチャでは、顧客がカードをターミナルでスワイプしたりオンラインで購入をした場合、銀行はメインフレームシステム上で承認リクエストを受け取り、AWSへのリアルタイム呼び出しを行います。
- 🔑 AWS上で実行されているプロセスは、リレーショナルデータベースから顧客とマーチャントの履歴詳細を取得し、AIMLスコアリングモデルに提供します。
- 📊 スコアが高いほど、詐欺の可能性のあるトランザクションを示します。メインフレームアプリケーションは、他のビジネスルールと組み合わせてトランザクションを承認または拒否する決定を行います。
- 📚 詳細はメインフレームデータベースに挿入され、VSAM、DB2、またはIMSに記録されます。
- 🔄 Precisely Publisherエージェントはメインフレーム上で動作し、ApplyエージェントはAmazon EC2インスタンス上で動作します。Applyエージェントは、Publisherエージェントから受信した生のデータベースログをコピーブックを使用してJSON形式に変換し、Amazon Managed Streaming for KafkaまたはMSKにメッセージを配信します。
- 📈 MSKからのメッセージは、Kafka ConnectプロセスによってMSKから引き出し、RDSデータベースにライトされます。
Q & A
AWS上で構築されたカード詐欺検出ソリューションはどのような仕組みですか?
-AWS上で構築されたカード詐欺検出ソリューションは、メインフレームシステム上で動作するカード支払い承認アプリケーションを強化し、静的なビジネスルールに加えてリアルタイムでAWSにアクセスして詐欺スコアを生成するAIMLモデルを活用しています。
AIMLモデルはどのようなデータを用いてトレーニングされていますか?
-AIMLモデルは、例えば顧客の購入履歴(過去48時間の購入回数)や商人の販売履歴(過去24時間の報告された詐欺件数)などの属性を用いてトレーニングされています。
リアルタイムでのスコア生成において、どのような属性がモデルに渡されますか?
-リアルタイムでのスコア生成においては、顧客と商人の履歴の詳細がモデルに渡され、最適なスコアを生成するのに使われます。
メインフレームアプリケーションはどのようにして取引を承認または拒否する決定を下しますか?
-メインフレームアプリケーションは、AIMLスコアと他のビジネスルールを組み合わせて、取引を承認または拒否する決定を下します。
トランザクションの詳細はどこに記録されますか?
-トランザクションの詳細はメインフレームデータベースに記録され、VSAM、DB2、またはIMSのいずれかになります。
Precisely Publisher AgentとApply Agentはどのように動作しますか?
-Precisely Publisher Agentはメインフレーム上で動作し、データベースログを収集します。Apply AgentはAmazon EC2インスタンス上で動作し、Publisher Agentから受け取った生のデータベースログをJSONフォーマットに変換してAmazon Managed Streaming for KafkaまたはMSKに配信します。
Amazon S3にストリーミングされるデータはどのようにしてAIMLモデルに使われますか?
-Amazon S3にストリーミングされるデータはオフラインでAIMLモデルのトレーニングに使われ、他の内部または外部データソースと共に分析とビジネスインテリジェンスに使用されます。
AWS CloudFormationテンプレートを使用して事前構築されたAWSリソースには何がありますか?
-AWS CloudFormationテンプレートを使用して事前構築されたAWSリソースには、VPC、サブネット、IAMロール、AWS Key Management Serviceなどが含まれます。
メインフレームからのデータレプリケーションソフトウェアはどのように入手しますか?
-AWS Marketplaceからメインフレームからのデータレプリケーションソフトウェアを入手します。Preciselyのデータレプリケーションソフトウェアを検索し、購読ボタンをクリックして購読を完了させます。
Amazon EC2インスタンスはどのように設定されますか?
-Amazon EC2インスタンスは、AWS Marketplaceコンソールから起動し、作成したVPCとサブネットを選択します。また、セキュリティグループとIAMロールも設定し、ユーザーデータスクリプトを用いて必要なソフトウェアをインストールします。
メインフレームへの接続と認証にはどのような手順が必要ですか?
-メインフレームへの接続と認証には、EC2インスタンスで作成された公開キーファイルをメインフレームにコピーし、デモン認証のためにキーファイルに追加する必要があります。
RDSポスターステーブルはどのように作成されますか?
-RDSポスターステーブルは、psqlコマンドを使ってRDSデータベースに接続し、テーブルを作成コマンドを実行して作成されます。テーブルの列はVSAMコピーブックのフィールドに対応しています。
MSKからS3への配信とSNSへの統合はどのように設定されますか?
-MSKからS3への配信とSNSへの統合は、Firehoseを使用して設定されます。Firehoseストリームを作成し、S3バケットを選択して配信先を設定します。EventBridgeパイプを使ってMSKからSNSにメッセージを配信することもできます。
Redshiftの生成SQLを使用して自然言語でクエリを実行する方法はどのようなものですか?
-Redshiftの生成SQLでは、ノートブック内で自然言語でクエリを記述することができます。Redshiftは大規模な言語モデルを用いて、自然言語で記述されたクエリをSQLクエリに変換し、実行結果を提供します。
GitHubで詐欺検出セクションのコードサンプルを見ることができますか?
-はい、GitHubにはビデオスクリプトに基づく詐欺検出セクションのコードサンプルがあります。
Outlines
🚀 AWS上でAIMLベースのカード詐欺検出ソリューションの構築
このビデオでは、AWS上でAIML(人工知能マシンラーニング)を使用してカード詐欺検出ソリューションを構築する方法を紹介します。メインフレームシステム上のカード支払い承認アプリケーションは、静的なビジネスルールを使って支払いを承認または拒否してきましたが、AWSにリアルタイムで詐欺スコアを求めるために機能が強化されました。このスコアは、Amazon Fraud DetectorサービスやSageMakerで構築された他のAIMLモデルによって生成されます。モデルは、過去48時間の顧客購入履歴や過去24時間の商人販売履歴などの属性でトレーニングされています。リアルタイムでのスコアの推定では、同じ属性がモデルに渡され、最適なスコアが生成されます。ソリューションアーキテクチャでは、顧客がカードをターミナルでスワイプしたりオンラインで購入を試みた際、銀行はメインフレームシステム上で承認リクエストを受け取り、AWSにリアルタイムでコールを行います。AWS上で動作するプロセスは、リレーショナルデータベースから顧客と商人の履歴詳細を取得し、AIMLスコアリングモデルに提供します。スコアが高いほど、取引が詐欺的である可能性が高くなります。メインフレームアプリケーションは、他のビジネスルールと組み合わせて取引を承認または拒否する決定を行います。詳細はメインフレームデータベースに挿入され、VSAM、DB2、またはIMSに記録されます。記録は、Precisely PublisherエージェントによってほぼリアルタイムでAWSに再適用されます。
🛠️ AWSリソースのセットアップとメインフレームとの統合
この段落では、AWS上でEC2インスタンスを設定し、メインフレームとの統合を行う手順が説明されています。まず、AWS Marketplaceからメインフレームデータレプリケーションソフトウェアを取得し、AWSコンソールからEC2インスタンスを起動します。インスタンスには、Kafka Poster、SQLクライアントなどの必要なソフトウェアがインストールされています。次に、Kafkaトピックを作成し、Precisely Publisherが記録をこのトピックに配信できるようにします。また、メインフレームへの接続に必要な公開鍵と秘密鍵を作成し、メインフレームにコピーする必要があります。メインフレーム上で、VSAMデータベースに記録を挿入し、Preciselyのデモンプロセスを使用してトピックに記録を配信します。RDSポスターデータベースにテーブルを作成し、そのテーブルに記録を挿入するためのLambda関数を作成します。これにより、メインフレームからAWSにデータを統合し、AIMLモデルのトレーニングに使用できるデータフローが構築されます。
🔧 MSK、S3、SNSを通じたデータパイプラインの設定
このセクションでは、AWSのMSK(Managed Streaming for Kafka)、S3(Simple Storage Service)、SNS(Simple Notification Service)を通じてデータパイプラインを設定する方法が解説されています。MSKクラスターを介してデータを受信し、S3にデータを配信するFirehoseストリームを作成します。さらに、EventBridgeパイプを使用して、MSKからSNSにデータをストリーミングし、メール通知を送信します。これらの設定により、リアルタイムのデータストリーミング、データの長期保存、分析のためのオフラインデータの使用が可能になります。また、Redshiftを使用して自然言語でクエリを実行し、ビジネスインサイトを引き出す方法も紹介されています。
📈 データ分析と詐欺検出モデルのトレーニング
最後の段落では、S3に蓄積されたデータを使ってAIMLモデルをトレーニングし、ビジネスインサイトを引き出す方法が説明されています。RedshiftのGenerative SQL機能を使って、自然言語でデータベースクエリを作成し、複雑なビジネス分析を実行できます。また、GitHubでサンプルコードを確認し、詐欺検出ソリューションの構築をさらに深めることもできます。このビデオでは、AWS上でAIMLを活用したカード詐欺検出ソリューションの構築とデータ分析の概要がわかりやすく説明されています。
Mindmap
Keywords
💡AIML
💡AWS
💡詐欺検出
💡リアルタイム
💡メインフレーム
💡データベース
💡Amazon Fraud Detector
💡SagMaker
💡データレプリケーション
💡Amazon S3
Highlights
Building an AIML based card fraud detection solution on AWS.
Legacy card payment authorization application on z/OS mainframe system enhanced with real-time AWS calls.
Integration of Amazon Fraud Detector service or custom AI/ML models using SageMaker.
Model trained with customer and merchant history attributes for fraud score generation.
Solution architecture overview for card transaction authorization and fraud score retrieval.
Real-time data flow from mainframe to AWS for fraud score calculation.
Use of relational databases to store customer and merchant history details.
Fraud score indicating potential fraudulent transactions.
Combining business rules with fraud scores for transaction approval or decline.
Data replication from mainframe to AWS using Precisely Publisher and Apply agents.
Use of Amazon Managed Streaming for Kafka (MSK) for real-time data streaming.
Data consumption by various AWS services for analytics and business intelligence.
AWS CloudFormation template for creating pre-built resources like VPC, subnets, and IAM roles.
Setting up Amazon EC2 instance with Precisely software for data replication.
Replication of mainframe data to RDS PostgreSQL database using Lambda function.
Data streaming from MSK to Amazon S3 for offline model training and analytics.
Integration of Amazon EventBridge for streaming data to services like Amazon SNS for notifications.
Demonstration of capturing and replicating data online from VSAM databases.
Use of Generative SQL in Amazon Redshift for querying data using natural language.
Sample code for building the fraud detection solution available on GitHub.
Transcripts
in this video we are going to show you
how you can build an AIML based card
fraud detection Solution on
AWS in this use case the card payment
authorization application is running on
zos mainframe system and using static
business rules to approve or decline the
Legacy application is enhanced to make a
real-time call to AWS to get a fraud
score generated by Amazon fraud
detection service or any other AIML
model built using sag maker the model is
trained with attributes such as as
customer purchase history for example
number of purchases in last 48 hours and
Merchant sales history for example
reported frauds in last 24 hours during
inference of the score same attributes
are passed to the model to generate
optimal
score let us review the solution
architecture when a customer swipes a
card at Terminal or makes an online
purchase the bank will receive the
authorization request on the mainframe
system the application will make a
real-time call to AWS the process
running on AWS will get the customer and
Merchant history details from relational
database and provide to the AIML scoring
model running on say Amazon fraud
Detector service the model will return a
score higher score will indicate
potential fraudulent transaction the
Mainframe application combining with the
other business rule will make a decision
to approve or decline the transaction
detail is inserted on Mainframe database
either vsam db2 or IMS the record will
be captured and rep applicated to AWS
near real time using precisely the
precisely publisher agent is running on
Mainframe and the apply agent is running
on an Amazon ec2 instance the apply
agent converts raw database logs
received from publisher agent to Json
format using the copy book and publishes
the messages to Amazon managed streaming
for cofco or msk several service will
consume the message from msk a kovka
connect process can pull the messages
from msk and right to RDS database the
history detail details are read from
same database during the scoring process
MSG will stream the messages to Amazon
S3 using no code integration with fire
hose the data on S3 will be used offline
to train the AIML models along with
other internal or external data sources
for analytics and business intelligence
the messages from msk can be pulled to
Amazon red shift business users can run
query against the database using natural
language similarly other integration may
be built using Amazon event Bridge pipe
to stream data to services like Amazon
SNS or pinpoint for notification and
alerting in this demonstration there are
several AWS resources created some of
them are pre-built using cloud formation
template this includes VPC subnets IAM
roles AWS Key Management Service
Etc on AWS console we can see there is a
VPC created with three
subnets PR private link end points are
created for access to seress services
such as secret manager STS event Bridge
pipes
Etc a msk cluster is defined in the VPC
with three Brokers and three different
subnets both I am and sasl a
password-based authentication is
enabled the credentials are stored in
secret manager the bootstrap servers
detail for both IM am and sasl
authentication types are available in
client
information RDS posters database
instance would DB name as card payments
fraud a Lambda function is created to
pull the messages from Ms and insert RDS
posters
database the function will be running in
the same VPC
the environment variables are set for
RDS database connection
details a SNS topic messages from msk
will be streamed to SNS using an event
Bridge pipe the SNS topic is configured
to send email notification first we are
going to obtain the Mainframe data
replication software from Marketplace
from AWS console search for
Marketplace click discover products
type AWS Mainframe migration with
precisely on search
bar click on data replication for IBM
zos then click continue to subscribe
button follow the instructions to
complete subscription next we are going
to set up the amazon ec2 instance once
you have completed the subscription come
back to AWS Marketplace console and
click manage subscriptions then click
launch new instance click continue to
launch through
ec2 provide a name for the ec2
instance scroll down to network settings
and click
edit select the VPC created for this
solution select one of the
subnet click on select existing Security
Group and from the drop down on common
Security Group select the security group
created for the
solution expand the advanced details and
click existing I am roll and select
instance profile created by cloud
formation paste the script in the user
data text box the script first installs
the required software such as Liber
kofka poster SQL client Etc then it
creates a Kafka folder downloads and
extracts the Java Kafka libraries inside
the Kafka Libs folder downloads the msk
am jar file it creates an I am
authentication client properties file
the jar and the properties file are used
by the javascripts runs the kofka topic
script to create the kofka topic
precisely publisher will publish the
records to this topic then runs the
kofka consumer group script to create a
consumer group to be used later by the
even Bridge pipe andc broker details
have to be passed as one of the
parameter for the scripts next it
creates a precisely folder and then the
sasl producer configuration file for
precisely sets the path variable to
include precisely B directory and runs
the school key gen command to create the
private and public key file for
precisely the content of the public key
file has to be copied to Mainframe and
added in key file for demon for
authentication click launch instance to
launch a new ec2 instance with precisely
software installed next click on the
instance ID to open the details page for
the ec2 created click the connect
button type ec2 user for
username then click connect
this will open the ec2 command line the
ec2 user data script created the public
private key files for precisely the
naacl directory contains the public key
file to be copied to
Mainframe the software agent folder
contains software components to be
installed on Mainframe is zip file a
system administrator access is required
to install the software log into the
main frame in this use case we
considered the card payments
authorization history is stored in a
vsam
database the screen shows the Cobalt
copy Book used to define the layout of
the message the precisely software is
already installed and UI is available
using the ispf panel to perform admin
works the demon process in the publisher
is already created in started as a batch
job in this demonstration the demon job
is running on Port 90 5 DD name sqd off
refers the keys file the content of the
public key file created within the ec2
instance is pasted in this file and will
be used to authenticate the apply engine
when connection request is
made here's the publisher
job from the ispf panel for precisely
select option
three vssm to msk is the name of the
publisher engine and the configuration
is stored in cab mentioned the screen
shows the stats such as records captured
records published The Source log stream
shows the log stream name configured to
Stage the database changes in our
scenario the log stream is a vsam based
file but in production coupling facility
based log stream is
recommended One Source object is
configured which is identified by vsam
pure C this will capture the logs from
the card payments authorization V Sam
file switch back to ec2 command prompt
we will create the RDS posters table
connect to the RDS database using the
psql
command then run the create table
command the table columns corresponds to
the fields in the vsam copy book run a
select query to validate the table next
create a cpy subfolder inside precisely
folder create a file named cardor
payments and paste the Cobalt copybook
layout save the copy book
file create the apply engine script file
named script.
sqd The Script has the job name vs Sam
to msk is identifier the description
section refers to metadata referring to
the Cobalt copybook location the Sam
perk is the name of source object
identifier set by publisher Source data
store points to Mainframe IP address and
port for demon on Mainframe vssm to msk
is the publisher name vam CDC is data
source
type Target data store points to topic
name of the msk messages will be
distributed to kofka partitions using
key Json is the record format both
source and Target data source use cardor
payment SRC to describe the message
metadata the script used the replicate
function to convert raw ebcc log to Json
format with key fields from
copybook next we are going to set up the
msk S3 delivery via fire hose and
integration with SNS via event Bridge
pipe
MSG provides no code integration with
various AWS services on the MSG S3
delivery tab click create fire hose
stream some of the details are
pre-populated such as Source destination
msk
cluster paste the topic
name enter a name for the
stream select the S3 bucket created by
cloud formation template
add
prefixes click create fire host stream
to
create once the creation is complete you
will see the status is
active next click integration Tab and
then click connect Amazon msk cluster to
pipe enter a pipe
name paste the topic name in the
consumer group created
earlier for demonstration we are not
adding any filtering or enrichment
on the target page click in Target
service dropdown you can see the
different Services you can integrate
with select SNS then the topic expand
Target input Transformer on the sample
event select msk click on the value to
select the field for output click create
pipe to create the event Bridge pipe
once successfully created the status
will show is running now let's start the
apply engine and insert some record in
the vsam database on the ec2 command
prompt start the apply engine using the
sqdg command the process displays
valuable information about the data
sources and message layouts it's
connected to publisher engine on
Mainframe and waiting for data
now switch to Mainframe this PS file
contains records that will be inserted
to the vsam database the records map to
the layout of the copy book we saw
earlier in this demonstration we will
use the precisely batched differ
functionality to replicate data online
Sam or db2 IMS follow the same capture
publisher architecture with some
differences in setup and
configurations we are going to use the
job to copy the PS file to the current V
Sam and then run the sqd DFC DC utility
the utility compares the base and
current files and updates the change
records in the log stream submit the
job switching to the ispf panel we see
the engine is connected now the capture
and publish record counts have gone up
ec2 command prompt also shows records
ingested let's switch to another
terminal and let's run the select query
on RDS posters again we see the records
in the
table the metrics on Lambda console
shows the invocations it picked up the
messages from msk and inserted them to
RDS let's look at the other data
pipelines created from msk on S3 console
let's navigate to data folder and then
to the subfolders select one object and
click query with S3 select on the page
select Json as input and output format
then run SQL query we see the Json
message that was published to MSG by
precisely apply agent the change
operation is an insert in this case you
will denote an update and D delete
operation after image contains the new
values of the key Fields corresponding
to copybook fields and their respective
values an update database operation will
have both before and after image the
object stored in S3 will be aggreg ated
and used offline to train and update the
AIML
models the even Bridge pipe also
consumed the messages and sent email
notification with the Json messages body
here's a sample
email now let's experiment how we can
use generative SQL from Red shift to
query using natural language on the red
shift console page click on query data
click on plus sign and select notebook
select the cluster run SQL to create
schema directly from the msk topic and
then a materialized view with the data
from the
topic then click on generative SQL a
chatbot window is opened on right hand
side type in plain language for example
show top five states by purchase Amazon
qbed by large language model or llm
generates the SQL query to be executed
click add to notebook and then click run
we see the SQL
results let's try something little
complex
let's ask show top five Merchants with
highest single purchase ask to include
state of purchase and output also ask to
show the purchase amount in currency
format using generative AI red shift is
able to understand the request written
in natural language search the database
and generate the SQL you can do lot more
ask complex business Insight on the data
here's the
result in case you are looking for the
code sample to build the fraud detection
section check the sample code in GitHub
thanks for watching
Browse More Related Video
AI/ML based Card Payment Fraud Detection on AWS using replicated data from mainframe
【2割のロイヤル顧客が8割の利益をもたらす】良い売上と悪い売上/パレートの法則の罠/上場企業とスタートアップの罠/ウォールマートとKマートの違い【経営とマーケティングをつなぐ③:西口一希】
未経験でも成約率80%!魔法のセールステンプレートを完全公開【営業 セールス】
Marketplace Mini | Determining your offer type
セールス手法解説
本当は教えたくない、正しいLTVの算出方法|木下勝寿×神田昌典|エキスパートカフェ
5.0 / 5 (0 votes)